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.15\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-09-28 21:49+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 #: ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.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 ../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 #: ../cat/virt-cat.pod:5
27 msgid "virt-cat - Display files in a virtual machine"
31 #: ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.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 ../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 #: ../cat/virt-cat.pod:9
39 " virt-cat [--options] -d domname file [file ...]\n"
44 #: ../cat/virt-cat.pod:11
47 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
52 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
57 #: ../cat/virt-cat.pod:15
60 " virt-cat domname file\n"
65 #: ../cat/virt-cat.pod:17
68 " virt-cat disk.img file\n"
73 #: ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19 ../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 ../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
78 #: ../cat/virt-cat.pod:21
80 "C<virt-cat> is a command line tool to display the contents of C<file> where "
81 "C<file> exists in the named virtual machine (or disk image)."
85 #: ../cat/virt-cat.pod:24
87 "Multiple filenames can be given, in which case they are concatenated "
88 "together. Each filename must be a full path, starting at the root directory "
89 "(starting with '/')."
93 #: ../cat/virt-cat.pod:28
95 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
96 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
97 "tool (see L</USING GUESTFISH> below)."
101 #: ../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:1018 ../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 ../tools/virt-tar.pl:50
106 #: ../cat/virt-cat.pod:34
107 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
111 #: ../cat/virt-cat.pod:37
114 " virt-cat -d mydomain /etc/fstab\n"
119 #: ../cat/virt-cat.pod:39
120 msgid "List syslog messages from a VM disk image file:"
124 #: ../cat/virt-cat.pod:41
127 " virt-cat -a disk.img /var/log/messages | tail\n"
132 #: ../cat/virt-cat.pod:43
133 msgid "Find out what DHCP IP address a VM acquired:"
137 #: ../cat/virt-cat.pod:45
140 " virt-cat -d mydomain /var/log/messages | \\\n"
141 " grep 'dhclient: bound to' | tail\n"
146 #: ../cat/virt-cat.pod:48
147 msgid "Find out what packages were recently installed:"
151 #: ../cat/virt-cat.pod:50
154 " virt-cat -d mydomain /var/log/yum.log | tail\n"
159 #: ../cat/virt-cat.pod:52
160 msgid "Find out who is logged on inside a virtual machine:"
164 #: ../cat/virt-cat.pod:54
167 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
173 #: ../cat/virt-cat.pod:57
174 msgid "or who was logged on:"
178 #: ../cat/virt-cat.pod:59
181 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
182 " last -f /tmp/wtmp\n"
187 #: ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261 ../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:83 ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84 ../resize/virt-resize.pod:241 ../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
192 #: ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152 ../fuse/guestmount.pod:151 ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88 ../resize/virt-resize.pod:245 ../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
197 #: ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267 ../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
198 msgid "Display brief help."
202 #: ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70 ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
207 #: ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72 ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
208 msgid "B<--add> file"
212 #: ../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
214 "Add I<file> which should be a disk image from a virtual machine. If the "
215 "virtual machine has multiple block devices, you must supply all of them with "
216 "separate I<-a> options."
220 #: ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78 ../fish/guestfish.pod:174 ../fuse/guestmount.pod:93 ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
222 "The format of the disk image is auto-detected. To override this and force a "
223 "particular format use the I<--format=..> option."
227 #: ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
232 #: ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
233 msgid "B<--connect> URI"
237 #: ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295 ../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
239 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
240 "to the default libvirt hypervisor."
244 #: ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
246 "If you specify guest block devices directly (I<-a>), then libvirt is not "
251 #: ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105 ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
256 #: ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107 ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
257 msgid "B<--domain> guest"
261 #: ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109 ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
263 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
268 #: ../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:126 ../inspector/virt-inspector.pod:92
269 msgid "B<--echo-keys>"
273 #: ../cat/virt-cat.pod:100
275 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
276 "so you cannot see what you are typing. If you are not worried about Tempest "
277 "attacks and there is no one else in the room you can specify this flag to "
278 "see what you are typing."
282 #: ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328 ../df/virt-df.pod:101 ../fish/guestfish.pod:233 ../fuse/guestmount.pod:133 ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:124
283 msgid "B<--format=raw|qcow2|..>"
287 #: ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235 ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
292 #: ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237 ../fuse/guestmount.pod:137 ../rescue/virt-rescue.pod:128
294 "The default for the I<-a> option is to auto-detect the format of the disk "
295 "image. Using this forces the disk format for I<-a> options which follow on "
296 "the command line. Using I<--format> with no argument switches back to "
297 "auto-detection for subsequent I<-a> options."
301 #: ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337 ../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:2788
306 #: ../cat/virt-cat.pod:116
309 " virt-cat --format=raw -a disk.img file\n"
314 #: ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
315 msgid "forces raw format (no auto-detection) for C<disk.img>."
319 #: ../cat/virt-cat.pod:120
322 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
327 #: ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
329 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
330 "auto-detection for C<another.img>."
334 #: ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:144
336 "If you have untrusted raw-format guest disk images, you should use this "
337 "option to specify the disk format. This avoids a possible security problem "
338 "with malicious guests (CVE-2010-3851)."
342 #: ../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:163 ../inspector/virt-inspector.pod:114
343 msgid "B<--keys-from-stdin>"
347 #: ../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:165 ../inspector/virt-inspector.pod:116
349 "Read key or passphrase parameters from stdin. The default is to try to read "
350 "passphrases from the user by opening C</dev/tty>."
354 #: ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390 ../fuse/guestmount.pod:257 ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:182
359 #: ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392 ../fuse/guestmount.pod:259 ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:184
364 #: ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:186
365 msgid "Enable verbose messages for debugging."
369 #: ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397 ../fuse/guestmount.pod:263 ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:188 ../resize/virt-resize.pod:484
374 #: ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399 ../fuse/guestmount.pod:265 ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:190 ../resize/virt-resize.pod:486 ../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
379 #: ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:192 ../resize/virt-resize.pod:488 ../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
380 msgid "Display version number and exit."
384 #: ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412 ../fuse/guestmount.pod:278 ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:203 ../tools/virt-tar.pl:158
389 #: ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:205
390 msgid "Enable tracing of libguestfs API calls."
394 #: ../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
395 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
399 #: ../cat/virt-cat.pod:154
400 msgid "Previous versions of virt-cat allowed you to write either:"
404 #: ../cat/virt-cat.pod:156
407 " virt-cat disk.img [disk.img ...] file\n"
412 #: ../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
417 #: ../cat/virt-cat.pod:160
420 " virt-cat guestname file\n"
425 #: ../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
427 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
428 "the confusing case where a disk image might have the same name as a guest."
432 #: ../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
433 msgid "For compatibility the old style is still supported."
437 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
438 msgid "USING GUESTFISH"
442 #: ../cat/virt-cat.pod:170
444 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
445 "C<virt-cat> doesn't work."
449 #: ../cat/virt-cat.pod:173
450 msgid "Using C<virt-cat> is approximately equivalent to doing:"
454 #: ../cat/virt-cat.pod:175
457 " guestfish --ro -i -d domname download file -\n"
462 #: ../cat/virt-cat.pod:177
464 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
465 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
469 #: ../cat/virt-cat.pod:181
471 "The command above uses libguestfs's guest inspection feature and so does not "
472 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
473 "disk images that don't contain guests. To display a file from a disk image "
478 #: ../cat/virt-cat.pod:186
481 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
486 #: ../cat/virt-cat.pod:188
488 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
489 "the disk image, and C<file> is the full path to the file."
493 #: ../cat/virt-cat.pod:191 ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:601 ../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
494 msgid "SHELL QUOTING"
498 #: ../cat/virt-cat.pod:193 ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354 ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:603 ../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
500 "Libvirt guest names can contain arbitrary characters, some of which have "
501 "meaning to the shell such as C<#> and space. You may need to quote or "
502 "escape these characters on the command line. See the shell manual page "
503 "L<sh(1)> for details."
507 #: ../cat/virt-cat.pod:198 ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1081 ../fuse/guestmount.pod:303 ../inspector/virt-inspector.pod:375 ../resize/virt-resize.pod:608 ../test-tool/libguestfs-test-tool.pod:90
512 #: ../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:305 ../inspector/virt-inspector.pod:377 ../resize/virt-resize.pod:610
513 msgid "This program returns 0 if successful, or non-zero if there was an error."
517 #: ../cat/virt-cat.pod:203 ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495 ../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:1235 ../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:308 ../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:613 ../ruby/examples/guestfs-ruby.pod:36 ../src/guestfs.pod:3164 ../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
522 #: ../cat/virt-cat.pod:205
524 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
525 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
529 #: ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507 ../df/virt-df.pod:235 ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296 ../resize/virt-resize.pod:634 ../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
534 #: ../cat/virt-cat.pod:214 ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509 ../df/virt-df.pod:237 ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395 ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:636 ../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
535 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
539 #: ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511 ../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:1264 ../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:323 ../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:638 ../ruby/examples/guestfs-ruby.pod:52 ../src/guestfs.pod:3241 ../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
544 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405 ../resize/virt-resize.pod:640
545 msgid "Copyright (C) 2010-2011 Red Hat Inc."
549 #: ../cat/virt-cat.pod:220 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1269 ../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:328 ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:642 ../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
551 "This program is free software; you can redistribute it and/or modify it "
552 "under the terms of the GNU General Public License as published by the Free "
553 "Software Foundation; either version 2 of the License, or (at your option) "
558 #: ../cat/virt-cat.pod:225 ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1274 ../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:333 ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:647 ../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
560 "This program is distributed in the hope that it will be useful, but WITHOUT "
561 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
562 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
567 #: ../cat/virt-cat.pod:230 ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525 ../df/virt-df.pod:253 ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1279 ../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:338 ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:652 ../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
569 "You should have received a copy of the GNU General Public License along with "
570 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
571 "Ave, Cambridge, MA 02139, USA."
575 #: ../cat/virt-filesystems.pod:5
577 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
578 "virtual machine or disk image"
582 #: ../cat/virt-filesystems.pod:9
585 " virt-filesystems [--options] -d domname\n"
590 #: ../cat/virt-filesystems.pod:11
593 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
598 #: ../cat/virt-filesystems.pod:15
600 "This tool allows you to discover filesystems, partitions, logical volumes, "
601 "and their sizes in a disk image or virtual machine. It is a replacement for "
602 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
606 #: ../cat/virt-filesystems.pod:20
608 "One use for this tool is from shell scripts to iterate over all filesystems "
613 #: ../cat/virt-filesystems.pod:23
616 " for fs in $(virt-filesystems -a disk.img); do\n"
623 #: ../cat/virt-filesystems.pod:27
625 "Another use is to list partitions before using another tool to modify those "
626 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
627 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
631 #: ../cat/virt-filesystems.pod:32
633 "Various command line options control what this program displays. You need "
634 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
635 "guest respectively. If you just specify that then the program shows "
636 "filesystems found, one per line, like this:"
640 #: ../cat/virt-filesystems.pod:37
643 " $ virt-filesystems -a disk.img\n"
645 " /dev/vg_guest/lv_root\n"
650 #: ../cat/virt-filesystems.pod:41
651 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
655 #: ../cat/virt-filesystems.pod:44
658 " $ virt-filesystems -a disk.img -l\n"
659 " Name Type VFS Label Size\n"
660 " /dev/sda1 filesystem ext4 boot 524288000\n"
661 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
666 #: ../cat/virt-filesystems.pod:49
668 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
673 #: ../cat/virt-filesystems.pod:52
676 " $ virt-filesystems -a disk.img --extra\n"
678 " /dev/vg_guest/lv_root\n"
679 " /dev/vg_guest/lv_swap\n"
680 " /dev/vg_guest/lv_data\n"
685 #: ../cat/virt-filesystems.pod:58
686 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
690 #: ../cat/virt-filesystems.pod:60
693 " $ virt-filesystems -a disk.img --partitions\n"
700 #: ../cat/virt-filesystems.pod:64
702 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
703 "I<--physical-volumes>, I<--block-devices> to list those items."
707 #: ../cat/virt-filesystems.pod:67
709 "You can use these options in combination as well (if you want a combination "
710 "including filesystems, you have to add I<--filesystems>). Notice that some "
711 "items fall into several categories (eg. C</dev/sda1> might be both a "
712 "partition and a filesystem). These items are listed several times. To get "
713 "a list which includes absolutely everything that virt-filesystems knows "
714 "about, use the I<--all> option."
718 #: ../cat/virt-filesystems.pod:74
720 "UUIDs (because they are quite long) are not shown by default. Add the "
721 "I<--uuid> option to display device and filesystem UUIDs in the long output."
725 #: ../cat/virt-filesystems.pod:78
727 "I<--all --long --uuid> is a useful combination to display all possible "
728 "information about everything."
732 #: ../cat/virt-filesystems.pod:81
735 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
736 " Name Type VFS Label Size Parent UUID\n"
737 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
738 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
739 " /dev/sda1 partition - - 100M /dev/sda -\n"
740 " /dev/sda2 partition - - 20G /dev/sda -\n"
741 " /dev/sda device - - 20G - -\n"
746 #: ../cat/virt-filesystems.pod:89
747 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
751 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
756 #: ../cat/virt-filesystems.pod:112
758 "Display everything. This is currently the same as specifying these options: "
759 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
760 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
761 "be added to this list in future)."
765 #: ../cat/virt-filesystems.pod:117
766 msgid "See also I<--long>."
770 #: ../cat/virt-filesystems.pod:119
775 #: ../cat/virt-filesystems.pod:121
776 msgid "B<--block-devices>"
780 #: ../cat/virt-filesystems.pod:123
781 msgid "Display block devices."
785 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
790 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
792 "Write out the results in CSV format (comma-separated values). This format "
793 "can be imported easily into databases and spreadsheets, but read L</NOTE "
794 "ABOUT CSV FORMAT> below."
798 #: ../cat/virt-filesystems.pod:150
800 "When prompting for keys and passphrases, virt-filesystems normally turns "
801 "echoing off so you cannot see what you are typing. If you are not worried "
802 "about Tempest attacks and there is no one else in the room you can specify "
803 "this flag to see what you are typing."
807 #: ../cat/virt-filesystems.pod:155
812 #: ../cat/virt-filesystems.pod:157
814 "This causes filesystems that are not ordinary, mountable filesystems to be "
815 "displayed. This category includes swapspace, and filesystems that are empty "
816 "or contain unknown data."
820 #: ../cat/virt-filesystems.pod:161
821 msgid "This option implies I<--filesystems>."
825 #: ../cat/virt-filesystems.pod:163
826 msgid "B<--filesystems>"
830 #: ../cat/virt-filesystems.pod:165
832 "Display mountable filesystems. If no display option was selected then this "
837 #: ../cat/virt-filesystems.pod:168
838 msgid "With I<--extra>, non-mountable filesystems are shown too."
842 #: ../cat/virt-filesystems.pod:181
845 " virt-filesystems --format=raw -a disk.img\n"
850 #: ../cat/virt-filesystems.pod:185
853 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
858 #: ../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
863 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
864 msgid "B<--human-readable>"
868 #: ../cat/virt-filesystems.pod:198
869 msgid "In I<--long> mode, display sizes in human-readable format."
873 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
878 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
883 #: ../cat/virt-filesystems.pod:209
884 msgid "Display extra columns of data (\"long format\")."
888 #: ../cat/virt-filesystems.pod:211
889 msgid "A title row is added unless you also specify I<--no-title>."
893 #: ../cat/virt-filesystems.pod:213
895 "The extra columns displayed depend on what output you select, and the "
896 "ordering of columns may change in future versions. Use the title row, "
897 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
902 #: ../cat/virt-filesystems.pod:218
904 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
905 "default is to show raw numbers of I<bytes>."
909 #: ../cat/virt-filesystems.pod:221
910 msgid "Use I<--uuid> to display UUIDs too."
914 #: ../cat/virt-filesystems.pod:223
919 #: ../cat/virt-filesystems.pod:225
924 #: ../cat/virt-filesystems.pod:227
925 msgid "B<--logical-volumes>"
929 #: ../cat/virt-filesystems.pod:229
931 "Display LVM logical volumes. In this mode, these are displayed irrespective "
932 "of whether the LVs contain filesystems."
936 #: ../cat/virt-filesystems.pod:232
937 msgid "B<--no-title>"
941 #: ../cat/virt-filesystems.pod:234
942 msgid "In I<--long> mode, don't add a title row."
946 #: ../cat/virt-filesystems.pod:236
948 "Note that the order of the columns is not fixed, and may change in future "
949 "versions of virt-filesystems, so using this option may give you unexpected "
954 #: ../cat/virt-filesystems.pod:240
959 #: ../cat/virt-filesystems.pod:242
960 msgid "B<--partitions>"
964 #: ../cat/virt-filesystems.pod:244
966 "Display partitions. In this mode, these are displayed irrespective of "
967 "whether the partitions contain filesystems."
971 #: ../cat/virt-filesystems.pod:247
976 #: ../cat/virt-filesystems.pod:249
977 msgid "B<--physvols>"
981 #: ../cat/virt-filesystems.pod:251
982 msgid "B<--physical-volumes>"
986 #: ../cat/virt-filesystems.pod:253
987 msgid "Display LVM physical volumes."
991 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
996 #: ../cat/virt-filesystems.pod:257
1001 #: ../cat/virt-filesystems.pod:259
1002 msgid "In I<--long> mode, display UUIDs as well."
1006 #: ../cat/virt-filesystems.pod:273
1011 #: ../cat/virt-filesystems.pod:275
1012 msgid "B<--volgroups>"
1016 #: ../cat/virt-filesystems.pod:277
1017 msgid "B<--volume-groups>"
1021 #: ../cat/virt-filesystems.pod:279
1022 msgid "Display LVM volume groups."
1026 #: ../cat/virt-filesystems.pod:287
1031 #: ../cat/virt-filesystems.pod:289
1033 "Note that columns in the output are subject to reordering and change in "
1034 "future versions of this tool."
1038 #: ../cat/virt-filesystems.pod:294
1043 #: ../cat/virt-filesystems.pod:296
1044 msgid "The filesystem, partition, block device or LVM name."
1048 #: ../cat/virt-filesystems.pod:298
1050 "For device and partition names these are displayed as canonical libguestfs "
1051 "names, so that for example C</dev/sda2> is the second partition on the first "
1056 #: ../cat/virt-filesystems.pod:302
1058 "If the I<--long> option is B<not> specified, then only the name column is "
1059 "shown in the output."
1063 #: ../cat/virt-filesystems.pod:305
1068 #: ../cat/virt-filesystems.pod:307
1069 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1073 #: ../cat/virt-filesystems.pod:309
1078 #: ../cat/virt-filesystems.pod:311
1080 "If there is a filesystem, then this column displays the filesystem type if "
1081 "one could be detected, eg. C<ext4>."
1085 #: ../cat/virt-filesystems.pod:314
1090 #: ../cat/virt-filesystems.pod:316
1092 "If the object has a label (used for identifying and mounting filesystems) "
1093 "then this column contains the label."
1097 #: ../cat/virt-filesystems.pod:319
1102 #: ../cat/virt-filesystems.pod:321
1104 "The size of the object in bytes. If the I<--human> option is used then the "
1105 "size is displayed in a human-readable form."
1109 #: ../cat/virt-filesystems.pod:324
1114 #: ../cat/virt-filesystems.pod:326
1116 "The parent column records the parent relationship between objects. For "
1117 "example, if the object is a partition, then this column contains the name of "
1118 "the containing device. If the object is a logical volume, then this column "
1119 "is the name of the volume group."
1123 #: ../cat/virt-filesystems.pod:331
1128 #: ../cat/virt-filesystems.pod:333
1130 "If the object has a UUID (used for identifying and mounting filesystems and "
1131 "block devices) then this column contains the UUID as a string."
1135 #: ../cat/virt-filesystems.pod:337
1136 msgid "The UUID is only displayed if the I<--uuid> option is given."
1140 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459 ../df/virt-df.pod:191
1141 msgid "NOTE ABOUT CSV FORMAT"
1145 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461 ../df/virt-df.pod:193
1147 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1148 "should be easy to parse, but it is definitely not easy to parse."
1152 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464 ../df/virt-df.pod:196
1154 "Myth: Just split fields at commas. Reality: This does I<not> work "
1155 "reliably. This example has two columns:"
1159 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467 ../df/virt-df.pod:199
1162 " \"foo,bar\",baz\n"
1167 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469 ../df/virt-df.pod:201
1169 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1170 "reliably. This example has one row:"
1174 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472 ../df/virt-df.pod:204
1183 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475 ../df/virt-df.pod:207
1185 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1186 "packaged in major Linux distributions)."
1190 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478 ../df/virt-df.pod:210
1192 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1193 "or Python's built-in csv library)."
1197 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481 ../df/virt-df.pod:213
1198 msgid "Most spreadsheets and databases can import CSV directly."
1202 #: ../cat/virt-filesystems.pod:379
1204 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1205 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1206 "L<http://libguestfs.org/>."
1210 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570 ../tools/virt-win-reg.pl:778
1211 msgid "Copyright (C) 2010 Red Hat Inc."
1215 #: ../cat/virt-ls.pod:5
1216 msgid "virt-ls - List files in a virtual machine"
1220 #: ../cat/virt-ls.pod:9
1223 " virt-ls [--options] -d domname directory [directory ...]\n"
1228 #: ../cat/virt-ls.pod:11
1231 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1237 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1242 #: ../cat/virt-ls.pod:15
1245 " virt-ls [--options] domname directory\n"
1250 #: ../cat/virt-ls.pod:17
1253 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1258 #: ../cat/virt-ls.pod:21
1260 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1261 "more from a virtual machine or disk image."
1265 #: ../cat/virt-ls.pod:24
1267 "Multiple directory names can be given, in which case the output from each is "
1272 #: ../cat/virt-ls.pod:27
1274 "To list directories from a libvirt guest use the I<-d> option to specify the "
1275 "name of the guest. For a disk image, use the I<-a> option."
1279 #: ../cat/virt-ls.pod:31
1281 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1282 "may need to use L<guestfish(1)>, or write a program directly to the "
1283 "L<guestfs(3)> API."
1287 #: ../cat/virt-ls.pod:37
1288 msgid "Get a list of all files and directories in a virtual machine:"
1292 #: ../cat/virt-ls.pod:39
1295 " virt-ls -R -d guest /\n"
1300 #: ../cat/virt-ls.pod:41
1301 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1305 #: ../cat/virt-ls.pod:43
1308 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1313 #: ../cat/virt-ls.pod:45
1314 msgid "List all public-writable directories in a Linux virtual machine:"
1318 #: ../cat/virt-ls.pod:47
1321 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1326 #: ../cat/virt-ls.pod:49
1327 msgid "List all Unix domain sockets in a Linux virtual machine:"
1331 #: ../cat/virt-ls.pod:51
1334 " virt-ls -lR -d guest / | grep '^s'\n"
1339 #: ../cat/virt-ls.pod:53
1340 msgid "List all regular files with filenames ending in '.png':"
1344 #: ../cat/virt-ls.pod:55
1347 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1352 #: ../cat/virt-ls.pod:57
1353 msgid "To display files larger than 10MB in home directories:"
1357 #: ../cat/virt-ls.pod:59
1360 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1365 #: ../cat/virt-ls.pod:61
1366 msgid "Find everything modified in the last 7 days:"
1370 #: ../cat/virt-ls.pod:63
1373 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1378 #: ../cat/virt-ls.pod:65
1379 msgid "Find regular files modified in the last 24 hours:"
1383 #: ../cat/virt-ls.pod:67
1386 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1391 #: ../cat/virt-ls.pod:69
1392 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1396 #: ../cat/virt-ls.pod:71
1398 "Find the differences between files in a guest and an earlier snapshot of the "
1403 #: ../cat/virt-ls.pod:74
1406 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1407 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1408 " diff -u old new | less\n"
1413 #: ../cat/virt-ls.pod:78
1415 "The commands above won't find files where the content has changed but the "
1416 "metadata (eg. file size and modification date) is the same. To do that, you "
1417 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
1418 "I<--checksum> can be quite slow since it has to read and compute a checksum "
1419 "of every regular file in the virtual machine."
1423 #: ../cat/virt-ls.pod:84
1424 msgid "OUTPUT MODES"
1428 #: ../cat/virt-ls.pod:86
1430 "C<virt-ls> has four output modes, controlled by different combinations of "
1431 "the I<-l> and I<-R> options."
1435 #: ../cat/virt-ls.pod:89
1436 msgid "SIMPLE LISTING"
1440 #: ../cat/virt-ls.pod:91
1441 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1445 #: ../cat/virt-ls.pod:93
1448 " $ virt-ls -d guest /\n"
1456 #: ../cat/virt-ls.pod:98
1457 msgid "LONG LISTING"
1461 #: ../cat/virt-ls.pod:100
1463 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1464 "(more specifically, like the C<guestfs_ll> function)."
1468 #: ../cat/virt-ls.pod:103
1471 " $ virt-ls -l -d guest /\n"
1473 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
1474 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
1480 #: ../cat/virt-ls.pod:109
1482 "Note that while this is useful for displaying a directory, do not try "
1483 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
1488 #: ../cat/virt-ls.pod:113
1489 msgid "RECURSIVE LISTING"
1493 #: ../cat/virt-ls.pod:115
1495 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
1496 "and directories recursively:"
1500 #: ../cat/virt-ls.pod:118
1503 " $ virt-ls -R -d guest /tmp\n"
1511 #: ../cat/virt-ls.pod:123
1513 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
1514 "converts C<\\0> characters to C<\\n>."
1518 #: ../cat/virt-ls.pod:126
1519 msgid "RECURSIVE LONG LISTING"
1523 #: ../cat/virt-ls.pod:128
1525 "Using I<-lR> options together changes the output to display directories "
1526 "recursively, with file stats, and optionally other features such as "
1527 "checksums and extended attributes."
1531 #: ../cat/virt-ls.pod:132
1533 "Most of the interesting features of C<virt-ls> are only available when using "
1538 #: ../cat/virt-ls.pod:135
1540 "The fields are normally space-separated. Filenames are B<not> quoted, so "
1541 "you cannot use the output in another program (because filenames can contain "
1542 "spaces and other unsafe characters). If the guest was untrusted and someone "
1543 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
1544 "on you by creating filenames with embedded newline characters. To B<safely> "
1545 "parse the output in another program, use the I<--csv> (Comma-Separated "
1550 #: ../cat/virt-ls.pod:143
1552 "Note that this output format is completely unrelated to the C<ls -lR> "
1557 #: ../cat/virt-ls.pod:146
1560 " $ virt-ls -lR -d guest /bin\n"
1561 " d 0555 4096 /bin\n"
1562 " - 0755 123 /bin/alsaunmute\n"
1563 " - 0755 28328 /bin/arch\n"
1564 " l 0777 4 /bin/awk -> gawk\n"
1565 " - 0755 27216 /bin/basename\n"
1566 " - 0755 943360 /bin/bash\n"
1572 #: ../cat/virt-ls.pod:155
1573 msgid "These basic fields are always shown:"
1577 #: ../cat/virt-ls.pod:159
1582 #: ../cat/virt-ls.pod:161
1584 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
1585 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
1586 "link), C<s> (socket) or C<u> (unknown)."
1590 #: ../cat/virt-ls.pod:171
1595 #: ../cat/virt-ls.pod:173
1596 msgid "The Unix permissions, displayed as a 4 digit octal number."
1600 #: ../cat/virt-ls.pod:175
1605 #: ../cat/virt-ls.pod:177
1607 "The size of the file. This is shown in bytes unless I<-h> or "
1608 "I<--human-readable> option is given, in which case this is shown as a "
1609 "human-readable number."
1613 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4255
1618 #: ../cat/virt-ls.pod:183
1619 msgid "The full path of the file or directory."
1623 #: ../cat/virt-ls.pod:185
1628 #: ../cat/virt-ls.pod:187
1629 msgid "For symbolic links only, the link target."
1633 #: ../cat/virt-ls.pod:191
1635 "In I<-lR> mode, additional command line options enable the display of more "
1640 #: ../cat/virt-ls.pod:194
1642 "With the I<--uids> flag, these additional fields are displayed before the "
1647 #: ../cat/virt-ls.pod:199
1652 #: ../cat/virt-ls.pod:201
1657 #: ../cat/virt-ls.pod:203
1659 "The UID and GID of the owner of the file (displayed numerically). Note "
1660 "these only make sense in the context of a Unix-like guest."
1664 #: ../cat/virt-ls.pod:208
1665 msgid "With the I<--times> flag, these additional fields are displayed:"
1669 #: ../cat/virt-ls.pod:212
1674 #: ../cat/virt-ls.pod:214
1675 msgid "The time of last access."
1679 #: ../cat/virt-ls.pod:216
1684 #: ../cat/virt-ls.pod:218
1685 msgid "The time of last modification."
1689 #: ../cat/virt-ls.pod:220
1694 #: ../cat/virt-ls.pod:222
1695 msgid "The time of last status change."
1699 #: ../cat/virt-ls.pod:226
1701 "The time fields are displayed as string dates and times, unless one of the "
1702 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
1706 #: ../cat/virt-ls.pod:229
1707 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
1711 #: ../cat/virt-ls.pod:233
1716 #: ../cat/virt-ls.pod:235
1718 "The device containing the file (displayed as major:minor). This may not "
1719 "match devices as known to the guest."
1723 #: ../cat/virt-ls.pod:238
1728 #: ../cat/virt-ls.pod:240
1729 msgid "The inode number."
1733 #: ../cat/virt-ls.pod:242
1738 #: ../cat/virt-ls.pod:244
1739 msgid "The number of hard links."
1743 #: ../cat/virt-ls.pod:246
1748 #: ../cat/virt-ls.pod:248
1749 msgid "For block and char special files, the device (displayed as major:minor)."
1753 #: ../cat/virt-ls.pod:251
1758 #: ../cat/virt-ls.pod:253
1759 msgid "The number of 512 byte blocks allocated to the file."
1763 #: ../cat/virt-ls.pod:257
1765 "With the I<--checksum> flag, the checksum of the file contents is shown "
1766 "(only for regular files). Computing file checksums can take a considerable "
1771 #: ../cat/virt-ls.pod:280
1772 msgid "B<--checksum>"
1776 #: ../cat/virt-ls.pod:282
1777 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
1781 #: ../cat/virt-ls.pod:284
1783 "Display checksum over file contents for regular files. With no argument, "
1784 "this defaults to using I<md5>. Using an argument, you can select the "
1785 "checksum type to use."
1789 #: ../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
1791 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
1796 #: ../cat/virt-ls.pod:316
1798 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
1799 "so you cannot see what you are typing. If you are not worried about Tempest "
1800 "attacks and there is no one else in the room you can specify this flag to "
1801 "see what you are typing."
1805 #: ../cat/virt-ls.pod:321
1806 msgid "B<--extra-stats>"
1810 #: ../cat/virt-ls.pod:323
1811 msgid "Display extra stats."
1815 #: ../cat/virt-ls.pod:339
1818 " virt-ls --format=raw -a disk.img /dir\n"
1823 #: ../cat/virt-ls.pod:343
1826 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
1831 #: ../cat/virt-ls.pod:356
1832 msgid "Display file sizes in human-readable format."
1836 #: ../cat/virt-ls.pod:370
1841 #: ../cat/virt-ls.pod:372
1842 msgid "B<--recursive>"
1846 #: ../cat/virt-ls.pod:374
1848 "Select the mode. With neither of these options, C<virt-ls> produces a "
1849 "simple, flat list of the files in the named directory. See L</SIMPLE "
1854 #: ../cat/virt-ls.pod:378
1856 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
1861 #: ../cat/virt-ls.pod:381
1863 "C<virt-ls -R> produces a recursive list of files starting at the named "
1864 "directory. See L</RECURSIVE LISTING>."
1868 #: ../cat/virt-ls.pod:384
1870 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
1871 "parsed. See L</RECURSIVE LONG LISTING>."
1875 #: ../cat/virt-ls.pod:387
1880 #: ../cat/virt-ls.pod:389
1881 msgid "Display time fields."
1885 #: ../cat/virt-ls.pod:394
1886 msgid "B<--time-days>"
1890 #: ../cat/virt-ls.pod:396
1891 msgid "Display time fields as days before now (negative if in the future)."
1895 #: ../cat/virt-ls.pod:398
1897 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
1898 "of the file is between 0 and 86399 seconds."
1902 #: ../cat/virt-ls.pod:404
1903 msgid "B<--time-relative>"
1907 #: ../cat/virt-ls.pod:406
1908 msgid "Display time fields as seconds before now (negative if in the future)."
1912 #: ../cat/virt-ls.pod:411
1917 #: ../cat/virt-ls.pod:413
1918 msgid "Display time fields as seconds since the Unix epoch."
1922 #: ../cat/virt-ls.pod:418
1927 #: ../cat/virt-ls.pod:420
1928 msgid "Display UID and GID fields."
1932 #: ../cat/virt-ls.pod:445
1933 msgid "Previous versions of virt-ls allowed you to write either:"
1937 #: ../cat/virt-ls.pod:447
1940 " virt-ls disk.img [disk.img ...] /dir\n"
1945 #: ../cat/virt-ls.pod:451
1948 " virt-ls guestname /dir\n"
1953 #: ../cat/virt-ls.pod:497
1955 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
1956 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
1957 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
1961 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:302
1962 msgid "Copyright (C) 2009-2011 Red Hat Inc."
1966 #: ../df/virt-df.pod:5
1967 msgid "virt-df - Display free space on virtual filesystems"
1971 #: ../df/virt-df.pod:9
1974 " virt-df [--options]\n"
1979 #: ../df/virt-df.pod:11
1982 " virt-df [--options] -d domname\n"
1987 #: ../df/virt-df.pod:13
1990 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
1995 #: ../df/virt-df.pod:17
1998 " virt-df [--options] domname\n"
2003 #: ../df/virt-df.pod:19
2006 " virt-df [--options] disk.img [disk.img ...]\n"
2011 #: ../df/virt-df.pod:23
2013 "C<virt-df> is a command line tool to display free space on virtual machine "
2014 "filesystems. Unlike other tools, it doesn't just display the size of disk "
2015 "allocated to a virtual machine, but can look inside disk images to see how "
2016 "much space is really being used."
2020 #: ../df/virt-df.pod:28
2022 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
2023 "to get a list of all active and inactive guests, and performs a C<df>-type "
2024 "operation on each one in turn, printing out the results."
2028 #: ../df/virt-df.pod:32
2030 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
2031 "C<df>-type operation on either the single named libvirt domain, or on the "
2032 "disk image(s) listed on the command line (which must all belong to a single "
2033 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
2034 "single guest>. If you want to run on multiple guests, then you have to "
2035 "invoke C<virt-df> multiple times."
2039 #: ../df/virt-df.pod:39
2041 "Use the I<--csv> option to get a format which can be easily parsed by other "
2042 "programs. Other options are similar to the standard L<df(1)> command."
2046 #: ../df/virt-df.pod:45
2048 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
2049 "output human-readable:"
2053 #: ../df/virt-df.pod:48
2056 " # virt-df -d F14x64 -h\n"
2057 " Filesystem Size Used Available Use%\n"
2058 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
2059 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
2064 #: ../df/virt-df.pod:53
2065 msgid "Show disk usage for a disk image file called C<test.img>:"
2069 #: ../df/virt-df.pod:55
2072 " $ virt-df -a test1.img\n"
2073 " Filesystem 1K-blocks Used Available Use%\n"
2074 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
2079 #: ../df/virt-df.pod:112
2082 " virt-df --format=raw -a disk.img\n"
2087 #: ../df/virt-df.pod:116
2090 " virt-df --format=raw -a disk.img --format -a another.img\n"
2095 #: ../df/virt-df.pod:129
2096 msgid "Print sizes in human-readable format."
2100 #: ../df/virt-df.pod:131
2101 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
2105 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
2110 #: ../df/virt-df.pod:135
2115 #: ../df/virt-df.pod:137
2116 msgid "Print inodes instead of blocks."
2120 #: ../df/virt-df.pod:139
2121 msgid "B<--one-per-guest>"
2125 #: ../df/virt-df.pod:141
2127 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
2128 "disks from several guests to a single libguestfs appliance."
2132 #: ../df/virt-df.pod:144
2133 msgid "You might use this option in the following circumstances:"
2137 #: ../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:390 ../fish/guestfish-actions.pod:398 ../fish/guestfish-actions.pod:405 ../fish/guestfish-actions.pod:412 ../fish/guestfish-actions.pod:1139 ../fish/guestfish-actions.pod:1143 ../fish/guestfish-actions.pod:1147 ../fish/guestfish-actions.pod:1151 ../fish/guestfish-actions.pod:1159 ../fish/guestfish-actions.pod:1163 ../fish/guestfish-actions.pod:1167 ../fish/guestfish-actions.pod:1177 ../fish/guestfish-actions.pod:1181 ../fish/guestfish-actions.pod:1185 ../fish/guestfish-actions.pod:1275 ../fish/guestfish-actions.pod:1279 ../fish/guestfish-actions.pod:1284 ../fish/guestfish-actions.pod:1289 ../fish/guestfish-actions.pod:1331 ../fish/guestfish-actions.pod:1335 ../fish/guestfish-actions.pod:1340 ../fish/guestfish-actions.pod:1596 ../fish/guestfish-actions.pod:1603 ../fish/guestfish-actions.pod:1610 ../fish/guestfish-actions.pod:2005 ../fish/guestfish-actions.pod:2011 ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2026 ../fish/guestfish-actions.pod:2033 ../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:282 ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295 ../resize/virt-resize.pod:301 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596 ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:1774 ../src/guestfs-actions.pod:1778 ../src/guestfs-actions.pod:1782 ../src/guestfs-actions.pod:1786 ../src/guestfs-actions.pod:1794 ../src/guestfs-actions.pod:1798 ../src/guestfs-actions.pod:1802 ../src/guestfs-actions.pod:1812 ../src/guestfs-actions.pod:1816 ../src/guestfs-actions.pod:1820 ../src/guestfs-actions.pod:1958 ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:1967 ../src/guestfs-actions.pod:1972 ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:2037 ../src/guestfs-actions.pod:2042 ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:2462 ../src/guestfs-actions.pod:2469 ../src/guestfs-actions.pod:3006 ../src/guestfs-actions.pod:3012 ../src/guestfs-actions.pod:3020 ../src/guestfs-actions.pod:3027 ../src/guestfs-actions.pod:3034 ../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:1091 ../src/guestfs.pod:1095 ../src/guestfs.pod:1099 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112 ../src/guestfs.pod:1131 ../src/guestfs.pod:1139 ../src/guestfs.pod:1161 ../src/guestfs.pod:1165 ../src/guestfs.pod:1169 ../src/guestfs.pod:1173 ../src/guestfs.pod:1177 ../src/guestfs.pod:1181 ../src/guestfs.pod:1671 ../src/guestfs.pod:1676 ../src/guestfs.pod:1680 ../src/guestfs.pod:1782 ../src/guestfs.pod:1787 ../src/guestfs.pod:1791 ../src/guestfs.pod:1801 ../src/guestfs.pod:2090 ../src/guestfs.pod:2095 ../src/guestfs.pod:2101 ../src/guestfs.pod:2109 ../src/guestfs.pod:2556 ../src/guestfs.pod:2562 ../src/guestfs.pod:2567 ../src/guestfs.pod:2573 ../src/guestfs.pod:2956 ../src/guestfs.pod:2961 ../src/guestfs.pod:2965 ../src/guestfs.pod:2969 ../src/guestfs.pod:2973 ../src/guestfs.pod:2987 ../src/guestfs.pod:2992 ../src/guestfs.pod:3218 ../src/guestfs.pod:3222 ../src/guestfs.pod:3226 ../src/guestfs.pod:3230 ../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
2142 #: ../df/virt-df.pod:150
2144 "If you think an untrusted guest might actively try to exploit the libguestfs "
2145 "appliance kernel, then this prevents one guest from interfering with the "
2146 "stats printed for another guest."
2150 #: ../df/virt-df.pod:156
2152 "If the kernel has a bug which stops it from accessing a filesystem in one "
2153 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
2154 "and report stats for further guests."
2158 #: ../df/virt-df.pod:165
2160 "Print UUIDs instead of names. This is useful for following a guest even "
2161 "when the guest is migrated or renamed, or when two guests happen to have the "
2166 #: ../df/virt-df.pod:169
2168 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
2169 "images, we still print the disk image name even when this option is "
2174 #: ../df/virt-df.pod:229
2176 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
2177 "L<http://libguestfs.org/>."
2181 #: ../edit/virt-edit.pod:5
2182 msgid "virt-edit - Edit a file in a virtual machine"
2186 #: ../edit/virt-edit.pod:9
2189 " virt-edit [--options] -d domname file [file ...]\n"
2194 #: ../edit/virt-edit.pod:11
2197 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
2202 #: ../edit/virt-edit.pod:13
2205 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
2210 #: ../edit/virt-edit.pod:17
2213 " virt-edit domname file\n"
2218 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
2221 " virt-edit disk.img [disk.img ...] file\n"
2226 #: ../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
2231 #: ../edit/virt-edit.pod:23
2233 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
2234 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
2235 "doing this, but doesn't catch all cases."
2239 #: ../edit/virt-edit.pod:29
2241 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
2242 "exists in the named virtual machine (or disk image)."
2246 #: ../edit/virt-edit.pod:32
2248 "Multiple filenames can be given, in which case they are each edited in "
2249 "turn. Each filename must be a full path, starting at the root directory "
2250 "(starting with '/')."
2254 #: ../edit/virt-edit.pod:36
2255 msgid "If you want to just view a file, use L<virt-cat(1)>."
2259 #: ../edit/virt-edit.pod:38
2261 "For more complex cases you should look at the L<guestfish(1)> tool (see "
2262 "L</USING GUESTFISH> below)."
2266 #: ../edit/virt-edit.pod:41
2268 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
2269 "that and much more."
2273 #: ../edit/virt-edit.pod:46
2274 msgid "Edit the named files interactively:"
2278 #: ../edit/virt-edit.pod:48
2281 " virt-edit -d mydomain /boot/grub/grub.conf\n"
2286 #: ../edit/virt-edit.pod:50
2289 " virt-edit -d mydomain /etc/passwd\n"
2294 #: ../edit/virt-edit.pod:52
2295 msgid "For Windows guests, some Windows paths are understood:"
2299 #: ../edit/virt-edit.pod:54
2302 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
2307 #: ../edit/virt-edit.pod:56
2309 "If Perl is installed, you can also edit files non-interactively (see "
2310 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
2314 #: ../edit/virt-edit.pod:60
2317 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
2322 #: ../edit/virt-edit.pod:81
2323 msgid "B<-b> extension"
2327 #: ../edit/virt-edit.pod:83
2328 msgid "B<--backup> extension"
2332 #: ../edit/virt-edit.pod:85
2334 "Create a backup of the original file I<in the guest disk image>. The backup "
2335 "has the original filename with C<extension> added."
2339 #: ../edit/virt-edit.pod:88
2341 "Usually the first character of C<extension> would be a dot C<.> so you would "
2346 #: ../edit/virt-edit.pod:91
2349 " virt-edit -b .orig [etc]\n"
2354 #: ../edit/virt-edit.pod:93
2355 msgid "By default, no backup file is made."
2359 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181 ../fuse/guestmount.pod:96 ../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
2364 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183 ../fuse/guestmount.pod:98 ../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
2365 msgid "B<--connect URI>"
2369 #: ../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
2371 "If you specify guest block devices directly, then libvirt is not used at "
2376 #: ../edit/virt-edit.pod:114
2378 "When prompting for keys and passphrases, virt-edit normally turns echoing "
2379 "off so you cannot see what you are typing. If you are not worried about "
2380 "Tempest attacks and there is no one else in the room you can specify this "
2381 "flag to see what you are typing."
2385 #: ../edit/virt-edit.pod:119
2390 #: ../edit/virt-edit.pod:121
2391 msgid "B<--expr> EXPR"
2395 #: ../edit/virt-edit.pod:123
2397 "Instead of launching the external editor, non-interactively apply the Perl "
2398 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
2403 #: ../edit/virt-edit.pod:127
2405 "Be careful to properly quote the expression to prevent it from being altered "
2410 #: ../edit/virt-edit.pod:130
2411 msgid "Note that this option is only available when Perl 5 is installed."
2415 #: ../edit/virt-edit.pod:132
2416 msgid "B<--format> raw|qcow2|..."
2420 #: ../edit/virt-edit.pod:143
2423 " virt-edit --format=raw -a disk.img file\n"
2428 #: ../edit/virt-edit.pod:147
2431 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
2436 #: ../edit/virt-edit.pod:181
2437 msgid "Previous versions of virt-edit allowed you to write either:"
2441 #: ../edit/virt-edit.pod:187
2444 " virt-edit guestname file\n"
2449 #: ../edit/virt-edit.pod:195
2450 msgid "NON-INTERACTIVE EDITING"
2454 #: ../edit/virt-edit.pod:197
2456 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
2457 "administrator can interactively edit the file."
2461 #: ../edit/virt-edit.pod:200
2463 "There are two ways also to use C<virt-edit> from scripts in order to make "
2464 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
2465 "like this, it's less error-prone to write scripts directly using the "
2466 "libguestfs API and Augeas for configuration file editing.)"
2470 #: ../edit/virt-edit.pod:206
2472 "The first method is to temporarily set C<$EDITOR> to any script or program "
2473 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
2474 "update C<tmpfile> in place however it likes."
2478 #: ../edit/virt-edit.pod:210
2480 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
2481 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
2482 "instances of C<foo> with C<bar> in a file:"
2486 #: ../edit/virt-edit.pod:214
2489 " virt-edit -d domname filename -e 's/foo/bar/'\n"
2494 #: ../edit/virt-edit.pod:216
2496 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
2497 "For example to delete root's password you could do:"
2501 #: ../edit/virt-edit.pod:219
2504 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
2509 #: ../edit/virt-edit.pod:221
2511 "What really happens is that the snippet is evaluated as a Perl expression "
2512 "for each line of the file. The line, including the final C<\\n>, is passed "
2513 "in C<$_> and the expression should update C<$_> or leave it unchanged."
2517 #: ../edit/virt-edit.pod:226
2519 "To delete a line, set C<$_> to the empty string. For example, to delete the "
2520 "C<apache> user account from the password file you can do:"
2524 #: ../edit/virt-edit.pod:229
2527 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
2532 #: ../edit/virt-edit.pod:231
2534 "To insert a line, prepend or append it to C<$_>. However appending lines to "
2535 "the end of the file is rather difficult this way since there is no concept "
2536 "of \"last line of the file\" - your expression just doesn't get called "
2537 "again. You might want to use the first method (setting C<$EDITOR>) if you "
2542 #: ../edit/virt-edit.pod:237
2544 "The variable C<$lineno> contains the current line number. As is "
2545 "traditional, the first line in the file is number C<1>."
2549 #: ../edit/virt-edit.pod:240
2551 "The return value from the expression is ignored, but the expression may call "
2552 "C<die> in order to abort the whole program, leaving the original file "
2557 #: ../edit/virt-edit.pod:244
2559 "Remember when matching the end of a line that C<$_> may contain the final "
2560 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
2561 "newline then neither of these. Thus to match or substitute some text at the "
2562 "end of a line, use this regular expression:"
2566 #: ../edit/virt-edit.pod:249
2569 " /some text(\\r?\\n)?$/\n"
2574 #: ../edit/virt-edit.pod:251
2576 "Alternately, use the perl C<chomp> function, being careful not to chomp "
2577 "C<$_> itself (since that would remove all newlines from the file):"
2581 #: ../edit/virt-edit.pod:255
2584 " my $m = $_; chomp $m; $m =~ /some text$/\n"
2589 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
2590 msgid "WINDOWS PATHS"
2594 #: ../edit/virt-edit.pod:259
2596 "C<virt-edit> has a limited ability to understand Windows drive letters and "
2597 "paths (eg. C<E:\\foo\\bar.txt>)."
2601 #: ../edit/virt-edit.pod:262
2602 msgid "If and only if the guest is running Windows then:"
2606 #: ../edit/virt-edit.pod:268
2608 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
2609 "to the correct filesystem."
2613 #: ../edit/virt-edit.pod:273
2615 "Any backslash (C<\\>) characters in the path are replaced with forward "
2616 "slashes so that libguestfs can process it."
2620 #: ../edit/virt-edit.pod:278
2622 "The path is resolved case insensitively to locate the file that should be "
2627 #: ../edit/virt-edit.pod:283
2628 msgid "There are some known shortcomings:"
2632 #: ../edit/virt-edit.pod:289
2633 msgid "Some NTFS symbolic links may not be followed correctly."
2637 #: ../edit/virt-edit.pod:293
2638 msgid "NTFS junction points that cross filesystems are not followed."
2642 #: ../edit/virt-edit.pod:299
2644 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
2645 "C<virt-edit> doesn't work."
2649 #: ../edit/virt-edit.pod:302
2650 msgid "Using C<virt-edit> is approximately equivalent to doing:"
2654 #: ../edit/virt-edit.pod:304
2657 " guestfish --rw -i -d domname edit /file\n"
2662 #: ../edit/virt-edit.pod:306
2664 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
2669 #: ../edit/virt-edit.pod:309
2671 "The command above uses libguestfs's guest inspection feature and so does not "
2672 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
2673 "disk images that don't contain guests. To edit a file on a disk image "
2678 #: ../edit/virt-edit.pod:314
2681 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
2686 #: ../edit/virt-edit.pod:316
2688 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
2689 "the disk image to edit, and C</file> is the full path to the file."
2693 #: ../edit/virt-edit.pod:320
2695 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
2696 "C<write> or C<upload> instead:"
2700 #: ../edit/virt-edit.pod:323
2703 " guestfish --rw -i -d domname touch /newfile\n"
2708 #: ../edit/virt-edit.pod:325
2711 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
2716 #: ../edit/virt-edit.pod:327
2719 " guestfish --rw -i -d domname upload localfile /newfile\n"
2724 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1086 ../rescue/virt-rescue.pod:261 ../src/guestfs.pod:3103 ../test-tool/libguestfs-test-tool.pod:95
2725 msgid "ENVIRONMENT VARIABLES"
2729 #: ../edit/virt-edit.pod:333
2734 #: ../edit/virt-edit.pod:335
2736 "If set, this string is used as the editor. It may contain arguments, "
2737 "eg. C<\"emacs -nw\">"
2741 #: ../edit/virt-edit.pod:338
2742 msgid "If not set, C<vi> is used."
2746 #: ../edit/virt-edit.pod:356
2748 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
2749 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2750 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
2754 #: ../erlang/examples/guestfs-erlang.pod:5
2755 msgid "guestfs-erlang - How to use libguestfs from Erlang"
2759 #: ../erlang/examples/guestfs-erlang.pod:9
2762 " {ok, G} = guestfs:create(),\n"
2763 " ok = guestfs:add_drive_opts(G, Disk,\n"
2764 " [{format, \"raw\"}, {readonly, true}]),\n"
2765 " ok = guestfs:launch(G),\n"
2766 " [Device] = guestfs:list_devices(G),\n"
2767 " ok = guestfs:close(G).\n"
2772 #: ../erlang/examples/guestfs-erlang.pod:18
2774 "This manual page documents how to call libguestfs from the Erlang "
2775 "programming language. This page just documents the differences from the C "
2776 "API and gives some examples. If you are not familiar with using libguestfs, "
2777 "you also need to read L<guestfs(3)>."
2781 #: ../erlang/examples/guestfs-erlang.pod:23
2782 msgid "OPENING AND CLOSING THE HANDLE"
2786 #: ../erlang/examples/guestfs-erlang.pod:25
2788 "The Erlang bindings are implemented using an external program called "
2789 "C<erl-guestfs>. This program must be on the current PATH, or else you "
2790 "should specify the full path to the program:"
2794 #: ../erlang/examples/guestfs-erlang.pod:29
2797 " {ok, G} = guestfs:create().\n"
2802 #: ../erlang/examples/guestfs-erlang.pod:31
2805 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
2810 #: ../erlang/examples/guestfs-erlang.pod:33
2811 msgid "C<G> is the libguestfs handle which you should pass to other functions."
2815 #: ../erlang/examples/guestfs-erlang.pod:36
2816 msgid "To close the handle:"
2820 #: ../erlang/examples/guestfs-erlang.pod:38
2823 " ok = guestfs:close(G).\n"
2828 #: ../erlang/examples/guestfs-erlang.pod:40
2829 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
2833 #: ../erlang/examples/guestfs-erlang.pod:42
2835 "For functions that take optional arguments, the first arguments are the "
2836 "non-optional ones. The last argument is a list of tuples supplying the "
2837 "remaining optional arguments."
2841 #: ../erlang/examples/guestfs-erlang.pod:46
2844 " ok = guestfs:add_drive_opts(G, Disk,\n"
2845 " [{format, \"raw\"}, {readonly, true}]).\n"
2850 #: ../erlang/examples/guestfs-erlang.pod:49
2851 msgid "If the last argument would be an empty list, you can also omit it:"
2855 #: ../erlang/examples/guestfs-erlang.pod:51
2858 " ok = guestfs:add_drive_opts(G, Disk).\n"
2863 #: ../erlang/examples/guestfs-erlang.pod:53
2864 msgid "RETURN VALUES AND ERRORS"
2868 #: ../erlang/examples/guestfs-erlang.pod:55
2870 "On success, most functions return a C<Result> term (which could be a list, "
2871 "string, tuple etc.). If there is nothing for the function to return, then "
2872 "the atom C<ok> is returned."
2876 #: ../erlang/examples/guestfs-erlang.pod:59
2877 msgid "On error, you would see one of the following tuples:"
2881 #: ../erlang/examples/guestfs-erlang.pod:63
2882 msgid "C<{error, Msg, Errno}>"
2886 #: ../erlang/examples/guestfs-erlang.pod:65
2887 msgid "This indicates an ordinary error from the function."
2891 #: ../erlang/examples/guestfs-erlang.pod:67
2893 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
2898 #: ../erlang/examples/guestfs-erlang.pod:70
2899 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
2903 #: ../erlang/examples/guestfs-erlang.pod:72
2904 msgid "C<{unknown, Function}>"
2908 #: ../erlang/examples/guestfs-erlang.pod:74
2910 "This indicates that the function you called is not known. Generally this "
2911 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
2912 "which you should not do."
2916 #: ../erlang/examples/guestfs-erlang.pod:78
2917 msgid "C<Function> is the name of the unknown function."
2921 #: ../erlang/examples/guestfs-erlang.pod:80
2922 msgid "C<{unknownarg, Arg}>"
2926 #: ../erlang/examples/guestfs-erlang.pod:82
2928 "This indicates that you called a function with optional arguments, with an "
2929 "unknown argument name."
2933 #: ../erlang/examples/guestfs-erlang.pod:85
2934 msgid "C<Arg> is the name of the unknown argument."
2938 #: ../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
2939 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
2943 #: ../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
2948 #: ../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
2949 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
2953 #: ../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
2958 #: ../erlang/examples/guestfs-erlang.pod:99
2960 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
2961 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
2962 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
2963 "L<http://libguestfs.org/>."
2967 #: ../erlang/examples/guestfs-erlang.pod:110 ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397 ../fish/guestfish.pod:1260 ../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:319 ../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:3237 ../test-tool/libguestfs-test-tool.pod:106
2972 #: ../erlang/examples/guestfs-erlang.pod:112 ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399 ../fish/guestfish.pod:1262 ../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:321 ../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:3239 ../test-tool/libguestfs-test-tool.pod:108
2973 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
2977 #: ../erlang/examples/guestfs-erlang.pod:116 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
2978 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
2982 #: ../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
2984 "The examples in this manual page may be freely copied, modified and "
2985 "distributed without any restrictions."
2989 #: ../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:3246
2991 "This library is free software; you can redistribute it and/or modify it "
2992 "under the terms of the GNU Lesser General Public License as published by the "
2993 "Free Software Foundation; either version 2 of the License, or (at your "
2994 "option) any later version."
2998 #: ../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:3251
3000 "This library is distributed in the hope that it will be useful, but WITHOUT "
3001 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3002 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3007 #: ../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:3256
3009 "You should have received a copy of the GNU Lesser General Public License "
3010 "along with this library; if not, write to the Free Software Foundation, "
3011 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3015 #: ../examples/guestfs-examples.pod:5
3016 msgid "guestfs-examples - Examples of using libguestfs from C"
3020 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
3023 " #include <guestfs.h>\n"
3028 #: ../examples/guestfs-examples.pod:11
3031 " guestfs_h *g = guestfs_create ();\n"
3032 " guestfs_add_drive_ro (g, \"disk.img\");\n"
3033 " guestfs_launch (g);\n"
3038 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
3041 " cc prog.c -o prog -lguestfs\n"
3043 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
3048 #: ../examples/guestfs-examples.pod:21
3050 "This manual page contains examples of calling libguestfs from the C "
3051 "programming language. If you are not familiar with using libguestfs, you "
3052 "also need to read L<guestfs(3)>."
3056 #: ../examples/guestfs-examples.pod:35
3058 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
3059 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
3060 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
3064 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
3065 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
3069 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
3074 #: ../examples/guestfs-recipes.pod:5
3076 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
3077 "here. The only way which works for both sorts of output is to just write "
3078 "the URL directly. Do NOT use L<...> for URLs."
3082 #: ../examples/guestfs-recipes.pod:9
3084 "We break with tradition here and don't use ALL CAPS for the section "
3085 "headings, as this makes them much easier to read."
3089 #: ../examples/guestfs-recipes.pod:16
3090 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
3094 #: ../examples/guestfs-recipes.pod:20
3096 "This page contains recipes for and links to things you can do using "
3097 "libguestfs, L<guestfish(1)> and the virt tools."
3101 #: ../examples/guestfs-recipes.pod:23
3102 msgid "Audit a virtual machine for setuid files"
3106 #: ../examples/guestfs-recipes.pod:25
3108 "The link below contains a small program which can be used to audit a Linux "
3109 "virtual machine to see what setuid and setgid files it contains."
3113 #: ../examples/guestfs-recipes.pod:28
3114 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
3118 #: ../examples/guestfs-recipes.pod:30
3119 msgid "Change the background image in a Windows XP VM"
3123 #: ../examples/guestfs-recipes.pod:32
3125 "The links below explain how to use L<guestfish(1)> to change the background "
3126 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
3127 "be substantially different for each version of Windows."
3131 #: ../examples/guestfs-recipes.pod:37
3133 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
3134 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
3138 #: ../examples/guestfs-recipes.pod:40
3139 msgid "Cloning a virtual machine (Linux)"
3143 #: ../examples/guestfs-recipes.pod:42
3145 "The guestfish technique described in the link below works well for most "
3146 "Linux VMs. Depending on the Linux distro you may need to change the paths "
3151 #: ../examples/guestfs-recipes.pod:46
3152 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
3156 #: ../examples/guestfs-recipes.pod:48
3158 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
3163 #: ../examples/guestfs-recipes.pod:51
3164 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
3168 #: ../examples/guestfs-recipes.pod:53
3169 msgid "Cloning a virtual machine (Windows)"
3173 #: ../examples/guestfs-recipes.pod:55
3175 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
3176 "straightforward. Currently there is code in the Aeolus Oz project which "
3177 "does this (using libguestfs). As part of our review of the virt-clone tool, "
3178 "we may add sysprepping ability."
3182 #: ../examples/guestfs-recipes.pod:60
3184 "https://github.com/clalancette/oz "
3185 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
3189 #: ../examples/guestfs-recipes.pod:63
3190 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
3194 #: ../examples/guestfs-recipes.pod:65
3195 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
3199 #: ../examples/guestfs-recipes.pod:67
3202 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
3207 #: ../examples/guestfs-recipes.pod:69
3208 msgid "To export just a subdirectory, eg. C</files>, do:"
3212 #: ../examples/guestfs-recipes.pod:71
3215 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3220 #: ../examples/guestfs-recipes.pod:73
3221 msgid "Create empty disk images"
3225 #: ../examples/guestfs-recipes.pod:75
3227 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3228 "The useful guide below explains the options available."
3232 #: ../examples/guestfs-recipes.pod:78
3233 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
3237 #: ../examples/guestfs-recipes.pod:80
3238 msgid "Dump raw filesystem content from inside a disk image or VM"
3242 #: ../examples/guestfs-recipes.pod:82
3244 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3245 "filesystem content from any filesystem in a disk image or a VM (even one "
3246 "which is encrypted or buried inside an LV):"
3250 #: ../examples/guestfs-recipes.pod:86
3253 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3258 #: ../examples/guestfs-recipes.pod:88
3261 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3266 #: ../examples/guestfs-recipes.pod:90
3267 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
3271 #: ../examples/guestfs-recipes.pod:92
3272 msgid "Edit grub configuration in a VM"
3276 #: ../examples/guestfs-recipes.pod:94
3277 msgid "You can use this to:"
3281 #: ../examples/guestfs-recipes.pod:100
3282 msgid "Fix a virtual machine that does not boot."
3286 #: ../examples/guestfs-recipes.pod:104
3287 msgid "Change which kernel is used to boot the VM."
3291 #: ../examples/guestfs-recipes.pod:108
3292 msgid "Change kernel command line options."
3296 #: ../examples/guestfs-recipes.pod:112
3297 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
3301 #: ../examples/guestfs-recipes.pod:114
3304 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
3309 #: ../examples/guestfs-recipes.pod:116
3311 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
3316 #: ../examples/guestfs-recipes.pod:119
3319 " virt-rescue -d BrokenGuest\n"
3324 #: ../examples/guestfs-recipes.pod:121
3325 msgid "Export any directory from a VM"
3329 #: ../examples/guestfs-recipes.pod:123
3330 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
3334 #: ../examples/guestfs-recipes.pod:126
3337 " virt-copy-out -d Guest /home .\n"
3342 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1327 ../fish/guestfish-actions.pod:1592 ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:3002 ../src/guestfs.pod:1667 ../tools/virt-win-reg.pl:706
3347 #: ../examples/guestfs-recipes.pod:134
3349 "The final dot of the command is not a printing error. It means we want to "
3350 "copy out to the current directory."
3354 #: ../examples/guestfs-recipes.pod:139
3355 msgid "This creates a directory called C<home> under the current directory."
3359 #: ../examples/guestfs-recipes.pod:143
3361 "If the guest is a Windows guest then you can use drive letters and "
3362 "backslashes, but you must prefix the path with C<win:> and quote it to "
3363 "protect it from the shell, like this:"
3367 #: ../examples/guestfs-recipes.pod:147
3370 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
3375 #: ../examples/guestfs-recipes.pod:149
3376 msgid "To get the output as a compressed tarball, do:"
3380 #: ../examples/guestfs-recipes.pod:151
3383 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
3388 #: ../examples/guestfs-recipes.pod:153
3390 "Although it sounds tempting, this is usually not a reliable way to get a "
3391 "backup from a running guest. See the entry in the FAQ: "
3392 "http://libguestfs.org/FAQ.html#backup"
3396 #: ../examples/guestfs-recipes.pod:157
3397 msgid "Find out which user is using the most space"
3401 #: ../examples/guestfs-recipes.pod:159
3403 "This simple script examines a Linux guest to find out which user is using "
3404 "the most space in their home directory:"
3408 #: ../examples/guestfs-recipes.pod:162
3416 #: ../examples/guestfs-recipes.pod:164
3424 #: ../examples/guestfs-recipes.pod:166
3433 #: ../examples/guestfs-recipes.pod:169
3436 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
3441 #: ../examples/guestfs-recipes.pod:171
3444 " for d in $(guestfish --remote ls \"$dir\"); do\n"
3445 " echo -n \"$dir/$d\"\n"
3447 " guestfish --remote du \"$dir/$d\";\n"
3448 " done | sort -nr -k 2\n"
3453 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
3456 " guestfish --remote exit\n"
3461 #: ../examples/guestfs-recipes.pod:179
3462 msgid "Get DHCP address from a VM"
3466 #: ../examples/guestfs-recipes.pod:181
3468 "The link below explains the many different possible techniques for getting "
3469 "the last assigned DHCP address of a virtual machine."
3473 #: ../examples/guestfs-recipes.pod:184
3474 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
3478 #: ../examples/guestfs-recipes.pod:186
3480 "In the libguestfs source examples directory you will find the latest version "
3481 "of the C<virt-dhcp-address.c> program."
3485 #: ../examples/guestfs-recipes.pod:189
3486 msgid "Get the operating system product name string"
3490 #: ../examples/guestfs-recipes.pod:191
3491 msgid "Save the following script into a file called C<product-name.sh>:"
3495 #: ../examples/guestfs-recipes.pod:193
3500 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3501 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3502 " guestfish --remote inspect-get-product-name \"$root\"\n"
3503 " guestfish --remote exit\n"
3508 #: ../examples/guestfs-recipes.pod:200
3509 msgid "Make the script executable and run it on a named guest:"
3513 #: ../examples/guestfs-recipes.pod:202
3516 " # product-name.sh RHEL60x64\n"
3517 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
3522 #: ../examples/guestfs-recipes.pod:205
3524 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
3525 "C<xpath> command line tool or from your favourite programming language:"
3529 #: ../examples/guestfs-recipes.pod:209
3532 " # virt-inspector RHEL60x64 > xml\n"
3533 " # xpath '//product_name' < xml\n"
3536 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
3537 "(Santiago)</product_name>\n"
3542 #: ../examples/guestfs-recipes.pod:215
3543 msgid "Get the default boot kernel for a Linux VM"
3547 #: ../examples/guestfs-recipes.pod:217
3549 "The link below contains a program to print the default boot kernel for a "
3554 #: ../examples/guestfs-recipes.pod:220
3555 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
3559 #: ../examples/guestfs-recipes.pod:222
3561 "It uses Augeas, and the technique is generally applicable for many different "
3566 #: ../examples/guestfs-recipes.pod:229
3567 msgid "listing the user accounts in the guest"
3571 #: ../examples/guestfs-recipes.pod:233
3572 msgid "what repositories is it configured to use"
3576 #: ../examples/guestfs-recipes.pod:237
3577 msgid "what NTP servers does it connect to"
3581 #: ../examples/guestfs-recipes.pod:241
3582 msgid "what were the boot messages last time it booted"
3586 #: ../examples/guestfs-recipes.pod:245
3587 msgid "listing who was logged in recently"
3591 #: ../examples/guestfs-recipes.pod:249
3592 msgid "http://augeas.net/"
3596 #: ../examples/guestfs-recipes.pod:251
3597 msgid "Install RPMs in a guest"
3601 #: ../examples/guestfs-recipes.pod:253
3603 "The link below contains a method to install RPMs in a guest. In fact the "
3604 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
3605 "installs them next time the guest is booted. You could use this technique "
3606 "to install vital security updates in an offline guest."
3610 #: ../examples/guestfs-recipes.pod:259
3611 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
3615 #: ../examples/guestfs-recipes.pod:261
3616 msgid "List applications installed in a VM"
3620 #: ../examples/guestfs-recipes.pod:263
3621 msgid "Save the following to a file C<list-apps.sh>:"
3625 #: ../examples/guestfs-recipes.pod:265
3630 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3631 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3632 " guestfish --remote inspect-list-applications \"$root\"\n"
3633 " guestfish --remote exit\n"
3638 #: ../examples/guestfs-recipes.pod:272
3640 "Make the file executable and then you can run it on any named virtual "
3645 #: ../examples/guestfs-recipes.pod:275
3648 " # list-apps.sh WinGuest\n"
3650 " app_name: Mozilla Firefox (3.6.12)\n"
3651 " app_display_name: Mozilla Firefox (3.6.12)\n"
3653 " app_version: 3.6.12 (en-GB)\n"
3655 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
3656 " app_trans_path:\n"
3657 " app_publisher: Mozilla\n"
3658 " app_url: http://www.mozilla.com/en-GB/\n"
3659 " app_source_package:\n"
3661 " app_description: Mozilla Firefox\n"
3664 " app_name: VLC media player\n"
3665 " app_display_name: VLC media player 1.1.5\n"
3667 " app_version: 1.1.5\n"
3669 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
3670 " app_trans_path:\n"
3671 " app_publisher: VideoLAN\n"
3672 " app_url: http://www.videolan.org/\n"
3673 " app_source_package:\n"
3675 " app_description:\n"
3681 #: ../examples/guestfs-recipes.pod:305
3683 "If you want to run the script on disk images (instead of libvirt virtual "
3684 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
3685 "L<virt-inspector(1)>."
3689 #: ../examples/guestfs-recipes.pod:309
3690 msgid "List files and directories in a VM"
3694 #: ../examples/guestfs-recipes.pod:311
3695 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
3699 #: ../examples/guestfs-recipes.pod:313
3702 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
3707 #: ../examples/guestfs-recipes.pod:315
3708 msgid "List services in a Windows VM"
3712 #: ../examples/guestfs-recipes.pod:317
3714 "The link below contains a script that can be used to list out the services "
3715 "from a Windows VM, and whether those services run at boot time or are loaded "
3720 #: ../examples/guestfs-recipes.pod:321
3721 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
3725 #: ../examples/guestfs-recipes.pod:323
3726 msgid "Make a disk image sparse"
3730 #: ../examples/guestfs-recipes.pod:325
3732 "The link below contains some guides for making a disk image sparse (or "
3733 "reintroducing sparseness)."
3737 #: ../examples/guestfs-recipes.pod:328
3738 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
3742 #: ../examples/guestfs-recipes.pod:330
3743 msgid "Monitor disk usage over time"
3747 #: ../examples/guestfs-recipes.pod:332
3749 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
3750 "The link below contains a guide."
3754 #: ../examples/guestfs-recipes.pod:335
3755 msgid "http://virt-tools.org/learning/advanced-virt-df/"
3759 #: ../examples/guestfs-recipes.pod:337
3760 msgid "Reading the Windows Event Log from Windows Vista (or later)"
3764 #: ../examples/guestfs-recipes.pod:339
3766 "L<guestfish(1)> plus the tools described in the link below can be used to "
3767 "read out the Windows Event Log from any virtual machine running Windows "
3768 "Vista or a later version."
3772 #: ../examples/guestfs-recipes.pod:343
3773 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
3777 #: ../examples/guestfs-recipes.pod:345
3778 msgid "Remove root password (Linux)"
3782 #: ../examples/guestfs-recipes.pod:347
3784 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
3785 "files. One use is to remove the root password from a Linux guest:"
3789 #: ../examples/guestfs-recipes.pod:350
3792 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3797 #: ../examples/guestfs-recipes.pod:352
3798 msgid "Remove Administrator password (Windows)"
3802 #: ../examples/guestfs-recipes.pod:354
3804 "The link below contains one technique for removing the Administrator "
3805 "password from a Windows VM, or to be more precise, it gives you a command "
3806 "prompt the next time you log in which you can use to bypass any security:"
3810 #: ../examples/guestfs-recipes.pod:359
3811 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
3815 #: ../examples/guestfs-recipes.pod:361
3816 msgid "Unpack a live CD"
3820 #: ../examples/guestfs-recipes.pod:363
3822 "Linux live CDs often contain multiple layers of disk images wrapped like a "
3823 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
3824 "layers, as outlined in the guide below."
3828 #: ../examples/guestfs-recipes.pod:367
3829 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
3833 #: ../examples/guestfs-recipes.pod:369
3834 msgid "Uploading and downloading files"
3838 #: ../examples/guestfs-recipes.pod:371
3840 "The link below contains general tips on uploading (copying in) and "
3841 "downloading (copying out) files from VMs."
3845 #: ../examples/guestfs-recipes.pod:374
3846 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
3850 #: ../examples/guestfs-recipes.pod:376
3851 msgid "Use libguestfs tools on VMware ESX guests"
3855 #: ../examples/guestfs-recipes.pod:378
3857 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
3858 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
3862 #: ../examples/guestfs-recipes.pod:382
3863 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
3867 #: ../examples/guestfs-recipes.pod:386
3869 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
3870 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
3871 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
3872 "L<http://libguestfs.org/>."
3876 #: ../examples/guestfs-recipes.pod:403
3877 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
3881 #: ../fish/guestfish-actions.pod:1
3886 #: ../fish/guestfish-actions.pod:3
3889 " add-cdrom filename\n"
3894 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
3895 msgid "This function adds a virtual CD-ROM disk image to the guest."
3899 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
3900 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
3904 #: ../fish/guestfish-actions.pod:15
3906 "This call checks for the existence of C<filename>. This stops you from "
3907 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3908 "and C<http:> URLs. To specify those, use the general L</config> call "
3913 #: ../fish/guestfish-actions.pod:22
3915 "If you just want to add an ISO file (often you use this as an efficient way "
3916 "to transfer large files into the guest), then you should probably use "
3917 "L</add-drive-ro> instead."
3921 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163 ../fish/guestfish-actions.pod:177
3923 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
3928 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166 ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:1026 ../fish/guestfish-actions.pod:1386 ../fish/guestfish-actions.pod:1400 ../fish/guestfish-actions.pod:3157 ../fish/guestfish-actions.pod:3364 ../fish/guestfish-actions.pod:3478 ../fish/guestfish-actions.pod:3526 ../fish/guestfish-actions.pod:4439 ../fish/guestfish-actions.pod:4462 ../fish/guestfish-actions.pod:4484 ../fish/guestfish-actions.pod:4522 ../fish/guestfish-actions.pod:5171 ../fish/guestfish-actions.pod:5277 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273 ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:2114 ../src/guestfs-actions.pod:2135 ../src/guestfs-actions.pod:4765 ../src/guestfs-actions.pod:5068 ../src/guestfs-actions.pod:5297 ../src/guestfs-actions.pod:5397 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6721 ../src/guestfs-actions.pod:6755 ../src/guestfs-actions.pod:6818 ../src/guestfs-actions.pod:7750 ../src/guestfs-actions.pod:7859 ../src/guestfs-actions.pod:8042
3930 "Deprecated functions will not be removed from the API, but the fact that "
3931 "they are deprecated indicates that there are problems with correct use of "
3936 #: ../fish/guestfish-actions.pod:35
3941 #: ../fish/guestfish-actions.pod:37
3946 #: ../fish/guestfish-actions.pod:39
3949 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
3955 #: ../fish/guestfish-actions.pod:41
3957 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
3958 "It works by connecting to libvirt, requesting the domain and domain XML from "
3959 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
3963 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
3965 "The number of disks added is returned. This operation is atomic: if an "
3966 "error is returned, then no disks are added."
3970 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
3972 "This function does some minimal checks to make sure the libvirt domain is "
3973 "not running (unless C<readonly> is true). In a future version we will try "
3974 "to acquire the libvirt lock on each disk."
3978 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
3980 "Disks must be accessible locally. This often means that adding disks from a "
3981 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
3982 "unless those disks are accessible via the same device path locally too."
3986 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
3988 "The optional C<libvirturi> parameter sets the libvirt URI (see "
3989 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
3990 "default libvirt URI (or one set through an environment variable, see the "
3991 "libvirt documentation for full details)."
3995 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
3997 "The optional C<live> flag controls whether this call will try to connect to "
3998 "a running virtual machine C<guestfsd> process if it sees a suitable "
3999 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
4000 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
4001 "DAEMONS> for more information."
4005 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
4007 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
4008 "passed instead of the domain name. The C<dom> string is treated as a UUID "
4009 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
4014 #: ../fish/guestfish-actions.pod:76
4016 "The other optional parameters are passed directly through to "
4017 "L</add-drive-opts>."
4021 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143 ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:784 ../fish/guestfish-actions.pod:805 ../fish/guestfish-actions.pod:2040 ../fish/guestfish-actions.pod:3206 ../fish/guestfish-actions.pod:3379 ../fish/guestfish-actions.pod:3514
4023 "This command has one or more optional arguments. See L</OPTIONAL "
4028 #: ../fish/guestfish-actions.pod:81
4033 #: ../fish/guestfish-actions.pod:83
4036 " add-drive filename\n"
4041 #: ../fish/guestfish-actions.pod:85
4043 "This function is the equivalent of calling L</add-drive-opts> with no "
4044 "optional parameters, so the disk is added writable, with the format being "
4045 "detected automatically."
4049 #: ../fish/guestfish-actions.pod:89
4051 "Automatic detection of the format opens you up to a potential security hole "
4052 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4053 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4054 "you should think about replacing calls to this function with calls to "
4055 "L</add-drive-opts>, and specifying the format."
4059 #: ../fish/guestfish-actions.pod:96
4060 msgid "add-drive-opts"
4064 #: ../fish/guestfish-actions.pod:98
4069 #: ../fish/guestfish-actions.pod:100
4072 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
4077 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
4079 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4080 "The first time you call this function, the disk appears as C</dev/sda>, the "
4081 "second time as C</dev/sdb>, and so on."
4085 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
4087 "You don't necessarily need to be root when using libguestfs. However you "
4088 "obviously do need sufficient permissions to access the filename for whatever "
4089 "operations you want to perform (ie. read access if you just want to read the "
4090 "image or write access if you want to modify the image)."
4094 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
4095 msgid "This call checks that C<filename> exists."
4099 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3168 ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4802
4100 msgid "The optional arguments are:"
4104 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
4109 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
4111 "If true then the image is treated as read-only. Writes are still allowed, "
4112 "but they are stored in a temporary snapshot overlay which is discarded at "
4113 "the end. The disk that you add is not modified."
4117 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
4122 #: ../fish/guestfish-actions.pod:127
4124 "This forces the image format. If you omit this (or use L</add-drive> or "
4125 "L</add-drive-ro>) then the format is automatically detected. Possible "
4126 "formats include C<raw> and C<qcow2>."
4130 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
4132 "Automatic detection of the format opens you up to a potential security hole "
4133 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4134 "RHBZ#642934. Specifying the format closes this security hole."
4138 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
4143 #: ../fish/guestfish-actions.pod:138
4145 "This rarely-used option lets you emulate the behaviour of the deprecated "
4146 "L</add-drive-with-if> call (q.v.)"
4150 #: ../fish/guestfish-actions.pod:145
4151 msgid "add-drive-ro"
4155 #: ../fish/guestfish-actions.pod:147
4160 #: ../fish/guestfish-actions.pod:149
4163 " add-drive-ro filename\n"
4168 #: ../fish/guestfish-actions.pod:151
4170 "This function is the equivalent of calling L</add-drive-opts> with the "
4171 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
4172 "is added read-only, with the format being detected automatically."
4176 #: ../fish/guestfish-actions.pod:156
4177 msgid "add-drive-ro-with-if"
4181 #: ../fish/guestfish-actions.pod:158
4184 " add-drive-ro-with-if filename iface\n"
4189 #: ../fish/guestfish-actions.pod:160
4191 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
4192 "interface emulation to use at run time."
4196 #: ../fish/guestfish-actions.pod:170
4197 msgid "add-drive-with-if"
4201 #: ../fish/guestfish-actions.pod:172
4204 " add-drive-with-if filename iface\n"
4209 #: ../fish/guestfish-actions.pod:174
4211 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4212 "interface emulation to use at run time."
4216 #: ../fish/guestfish-actions.pod:184
4221 #: ../fish/guestfish-actions.pod:186
4224 " aug-clear augpath\n"
4229 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
4231 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4232 "L<augtool(1)> C<clear> command."
4236 #: ../fish/guestfish-actions.pod:191
4241 #: ../fish/guestfish-actions.pod:193
4249 #: ../fish/guestfish-actions.pod:195
4251 "Close the current Augeas handle and free up any resources used by it. After "
4252 "calling this, you have to call L</aug-init> again before you can use any "
4253 "other Augeas functions."
4257 #: ../fish/guestfish-actions.pod:200
4262 #: ../fish/guestfish-actions.pod:202
4265 " aug-defnode name expr val\n"
4270 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
4271 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4275 #: ../fish/guestfish-actions.pod:207
4277 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4278 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
4279 "containing that single node."
4283 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
4285 "On success this returns a pair containing the number of nodes in the "
4286 "nodeset, and a boolean flag if a node was created."
4290 #: ../fish/guestfish-actions.pod:215
4295 #: ../fish/guestfish-actions.pod:217
4298 " aug-defvar name expr\n"
4303 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
4305 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4306 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4310 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
4312 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4313 "evaluates to something which is not a nodeset."
4317 #: ../fish/guestfish-actions.pod:226
4322 #: ../fish/guestfish-actions.pod:228
4325 " aug-get augpath\n"
4330 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
4332 "Look up the value associated with C<path>. If C<path> matches exactly one "
4333 "node, the C<value> is returned."
4337 #: ../fish/guestfish-actions.pod:233
4342 #: ../fish/guestfish-actions.pod:235
4345 " aug-init root flags\n"
4350 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
4352 "Create a new Augeas handle for editing configuration files. If there was "
4353 "any previous Augeas handle associated with this guestfs session, then it is "
4358 #: ../fish/guestfish-actions.pod:241
4359 msgid "You must call this before using any other L</aug-*> commands."
4363 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
4364 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4368 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
4370 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4371 "logical I<or> of the following integers:"
4375 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
4376 msgid "C<AUG_SAVE_BACKUP> = 1"
4380 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
4381 msgid "Keep the original file with a C<.augsave> extension."
4385 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
4386 msgid "C<AUG_SAVE_NEWFILE> = 2"
4390 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
4392 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4393 "original. Overrides C<AUG_SAVE_BACKUP>."
4397 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
4398 msgid "C<AUG_TYPE_CHECK> = 4"
4402 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
4403 msgid "Typecheck lenses."
4407 #: ../fish/guestfish-actions.pod:266
4409 "This option is only useful when debugging Augeas lenses. Use of this option "
4410 "may require additional memory for the libguestfs appliance. You may need to "
4411 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
4415 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
4416 msgid "C<AUG_NO_STDINC> = 8"
4420 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
4421 msgid "Do not use standard load path for modules."
4425 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
4426 msgid "C<AUG_SAVE_NOOP> = 16"
4430 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
4431 msgid "Make save a no-op, just record what would have been changed."
4435 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
4436 msgid "C<AUG_NO_LOAD> = 32"
4440 #: ../fish/guestfish-actions.pod:281
4441 msgid "Do not load the tree in L</aug-init>."
4445 #: ../fish/guestfish-actions.pod:285
4446 msgid "To close the handle, you can call L</aug-close>."
4450 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
4451 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4455 #: ../fish/guestfish-actions.pod:289
4460 #: ../fish/guestfish-actions.pod:291
4463 " aug-insert augpath label true|false\n"
4468 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
4470 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4471 "or after C<path> (depending on the boolean flag C<before>)."
4475 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
4477 "C<path> must match exactly one existing node in the tree, and C<label> must "
4478 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4482 #: ../fish/guestfish-actions.pod:301
4487 #: ../fish/guestfish-actions.pod:303
4495 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
4496 msgid "Load files into the tree."
4500 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
4501 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4505 #: ../fish/guestfish-actions.pod:310
4510 #: ../fish/guestfish-actions.pod:312
4518 #: ../fish/guestfish-actions.pod:314
4520 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4521 "resulting nodes into alphabetical order."
4525 #: ../fish/guestfish-actions.pod:317
4530 #: ../fish/guestfish-actions.pod:319
4533 " aug-match augpath\n"
4538 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
4540 "Returns a list of paths which match the path expression C<path>. The "
4541 "returned paths are sufficiently qualified so that they match exactly one "
4542 "node in the current tree."
4546 #: ../fish/guestfish-actions.pod:325
4551 #: ../fish/guestfish-actions.pod:327
4554 " aug-mv src dest\n"
4559 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
4561 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4562 "C<dest> is overwritten if it exists."
4566 #: ../fish/guestfish-actions.pod:332
4571 #: ../fish/guestfish-actions.pod:334
4579 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
4580 msgid "Remove C<path> and all of its children."
4584 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
4585 msgid "On success this returns the number of entries which were removed."
4589 #: ../fish/guestfish-actions.pod:340
4594 #: ../fish/guestfish-actions.pod:342
4602 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
4603 msgid "This writes all pending changes to disk."
4607 #: ../fish/guestfish-actions.pod:346
4609 "The flags which were passed to L</aug-init> affect exactly how files are "
4614 #: ../fish/guestfish-actions.pod:349
4619 #: ../fish/guestfish-actions.pod:351
4622 " aug-set augpath val\n"
4627 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
4628 msgid "Set the value associated with C<path> to C<val>."
4632 #: ../fish/guestfish-actions.pod:355
4634 "In the Augeas API, it is possible to clear a node by setting the value to "
4635 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4636 "this call. Instead you must use the L</aug-clear> call."
4640 #: ../fish/guestfish-actions.pod:360
4645 #: ../fish/guestfish-actions.pod:362
4648 " available 'groups ...'\n"
4653 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
4655 "This command is used to check the availability of some groups of "
4656 "functionality in the appliance, which not all builds of the libguestfs "
4657 "appliance will be able to provide."
4661 #: ../fish/guestfish-actions.pod:368
4663 "The libguestfs groups, and the functions that those groups correspond to, "
4664 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4665 "runtime by calling L</available-all-groups>."
4669 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
4671 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4672 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4673 "and Augeas (configuration file editing) functions."
4677 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
4678 msgid "The command returns no error if I<all> requested groups are available."
4682 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
4684 "It fails with an error if one or more of the requested groups is unavailable "
4689 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
4691 "If an unknown group name is included in the list of groups then an error is "
4696 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
4701 #: ../fish/guestfish-actions.pod:392
4702 msgid "You must call L</launch> before calling this function."
4706 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
4708 "The reason is because we don't know what groups are supported by the "
4709 "appliance/daemon until it is running and can be queried."
4713 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
4715 "If a group of functions is available, this does not necessarily mean that "
4716 "they will work. You still have to check for errors when calling individual "
4717 "API functions even if they are available."
4721 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
4723 "It is usually the job of distro packagers to build complete functionality "
4724 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4725 "with all requirements satisfied, will support everything."
4729 #: ../fish/guestfish-actions.pod:414
4731 "This call was added in version C<1.0.80>. In previous versions of "
4732 "libguestfs all you could do would be to speculatively execute a command to "
4733 "find out if the daemon implemented it. See also L</version>."
4737 #: ../fish/guestfish-actions.pod:421
4738 msgid "available-all-groups"
4742 #: ../fish/guestfish-actions.pod:423
4745 " available-all-groups\n"
4750 #: ../fish/guestfish-actions.pod:425
4752 "This command returns a list of all optional groups that this daemon knows "
4753 "about. Note this returns both supported and unsupported groups. To find "
4754 "out which ones the daemon can actually support you have to call "
4755 "L</available> on each member of the returned list."
4759 #: ../fish/guestfish-actions.pod:431
4760 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
4764 #: ../fish/guestfish-actions.pod:433
4769 #: ../fish/guestfish-actions.pod:435
4772 " base64-in (base64file|-) filename\n"
4777 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
4778 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4782 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:782 ../fish/guestfish-actions.pod:803 ../fish/guestfish-actions.pod:902 ../fish/guestfish-actions.pod:921 ../fish/guestfish-actions.pod:1295 ../fish/guestfish-actions.pod:4742 ../fish/guestfish-actions.pod:4754 ../fish/guestfish-actions.pod:4765 ../fish/guestfish-actions.pod:4776 ../fish/guestfish-actions.pod:4828 ../fish/guestfish-actions.pod:4837 ../fish/guestfish-actions.pod:4891 ../fish/guestfish-actions.pod:4914
4783 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
4787 #: ../fish/guestfish-actions.pod:442
4792 #: ../fish/guestfish-actions.pod:444
4795 " base64-out filename (base64file|-)\n"
4800 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
4802 "This command downloads the contents of C<filename>, writing it out to local "
4803 "file C<base64file> encoded as base64."
4807 #: ../fish/guestfish-actions.pod:451
4808 msgid "blockdev-flushbufs"
4812 #: ../fish/guestfish-actions.pod:453
4815 " blockdev-flushbufs device\n"
4820 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
4821 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4825 #: ../fish/guestfish-actions.pod:458 ../fish/guestfish-actions.pod:469 ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:488 ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:513 ../fish/guestfish-actions.pod:521 ../fish/guestfish-actions.pod:532 ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:548 ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:711 ../src/guestfs-actions.pod:727 ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:764 ../src/guestfs-actions.pod:778 ../src/guestfs-actions.pod:796 ../src/guestfs-actions.pod:810 ../src/guestfs-actions.pod:824
4826 msgid "This uses the L<blockdev(8)> command."
4830 #: ../fish/guestfish-actions.pod:460
4831 msgid "blockdev-getbsz"
4835 #: ../fish/guestfish-actions.pod:462
4838 " blockdev-getbsz device\n"
4843 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
4844 msgid "This returns the block size of a device."
4848 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529 ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
4850 "(Note this is different from both I<size in blocks> and I<filesystem block "
4855 #: ../fish/guestfish-actions.pod:471
4856 msgid "blockdev-getro"
4860 #: ../fish/guestfish-actions.pod:473
4863 " blockdev-getro device\n"
4868 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
4870 "Returns a boolean indicating if the block device is read-only (true if "
4871 "read-only, false if not)."
4875 #: ../fish/guestfish-actions.pod:480
4876 msgid "blockdev-getsize64"
4880 #: ../fish/guestfish-actions.pod:482
4883 " blockdev-getsize64 device\n"
4888 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
4889 msgid "This returns the size of the device in bytes."
4893 #: ../fish/guestfish-actions.pod:486
4894 msgid "See also L</blockdev-getsz>."
4898 #: ../fish/guestfish-actions.pod:490
4899 msgid "blockdev-getss"
4903 #: ../fish/guestfish-actions.pod:492
4906 " blockdev-getss device\n"
4911 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
4913 "This returns the size of sectors on a block device. Usually 512, but can be "
4914 "larger for modern devices."
4918 #: ../fish/guestfish-actions.pod:497
4919 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
4923 #: ../fish/guestfish-actions.pod:502
4924 msgid "blockdev-getsz"
4928 #: ../fish/guestfish-actions.pod:504
4931 " blockdev-getsz device\n"
4936 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
4938 "This returns the size of the device in units of 512-byte sectors (even if "
4939 "the sectorsize isn't 512 bytes ... weird)."
4943 #: ../fish/guestfish-actions.pod:509
4945 "See also L</blockdev-getss> for the real sector size of the device, and "
4946 "L</blockdev-getsize64> for the more useful I<size in bytes>."
4950 #: ../fish/guestfish-actions.pod:515
4951 msgid "blockdev-rereadpt"
4955 #: ../fish/guestfish-actions.pod:517
4958 " blockdev-rereadpt device\n"
4963 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
4964 msgid "Reread the partition table on C<device>."
4968 #: ../fish/guestfish-actions.pod:523
4969 msgid "blockdev-setbsz"
4973 #: ../fish/guestfish-actions.pod:525
4976 " blockdev-setbsz device blocksize\n"
4981 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
4982 msgid "This sets the block size of a device."
4986 #: ../fish/guestfish-actions.pod:534
4987 msgid "blockdev-setro"
4991 #: ../fish/guestfish-actions.pod:536
4994 " blockdev-setro device\n"
4999 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
5000 msgid "Sets the block device named C<device> to read-only."
5004 #: ../fish/guestfish-actions.pod:542
5005 msgid "blockdev-setrw"
5009 #: ../fish/guestfish-actions.pod:544
5012 " blockdev-setrw device\n"
5017 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
5018 msgid "Sets the block device named C<device> to read-write."
5022 #: ../fish/guestfish-actions.pod:550
5023 msgid "btrfs-filesystem-resize"
5027 #: ../fish/guestfish-actions.pod:552
5030 " btrfs-filesystem-resize mountpoint [size:..]\n"
5035 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
5036 msgid "This command resizes a btrfs filesystem."
5040 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
5042 "Note that unlike other resize calls, the filesystem has to be mounted and "
5043 "the parameter is the mountpoint not the device (this is a requirement of "
5048 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3489 ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5336
5049 msgid "The optional parameters are:"
5053 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3493 ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5340
5058 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
5060 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
5061 "resized to the maximum size."
5065 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
5066 msgid "See also L<btrfs(8)>."
5070 #: ../fish/guestfish-actions.pod:575
5071 msgid "case-sensitive-path"
5075 #: ../fish/guestfish-actions.pod:577
5078 " case-sensitive-path path\n"
5083 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
5085 "This can be used to resolve case insensitive paths on a filesystem which is "
5086 "case sensitive. The use case is to resolve paths which you have read from "
5087 "Windows configuration files or the Windows Registry, to the true path."
5091 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
5093 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5094 "(and probably others), which is that although the underlying filesystem is "
5095 "case-insensitive, the driver exports the filesystem to Linux as "
5100 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
5102 "One consequence of this is that special directories such as C<c:\\windows> "
5103 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5104 "precise details of how they were created. In Windows itself this would not "
5109 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
5111 "Bug or feature? You decide: "
5112 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
5116 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
5118 "This function resolves the true case of each element in the path and returns "
5119 "the case-sensitive path."
5123 #: ../fish/guestfish-actions.pod:601
5125 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
5126 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5127 "how the directories were originally created under Windows)."
5131 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
5132 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5136 #: ../fish/guestfish-actions.pod:609
5137 msgid "See also L</realpath>."
5141 #: ../fish/guestfish-actions.pod:611
5146 #: ../fish/guestfish-actions.pod:613
5154 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3909 ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5979
5155 msgid "Return the contents of the file named C<path>."
5159 #: ../fish/guestfish-actions.pod:617
5161 "Note that this function cannot correctly handle binary files (specifically, "
5162 "files containing C<\\0> character which is treated as end of string). For "
5163 "those you need to use the L</read-file> or L</download> functions which have "
5164 "a more complex interface."
5168 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757 ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:990 ../fish/guestfish-actions.pod:1057 ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1259 ../fish/guestfish-actions.pod:1572 ../fish/guestfish-actions.pod:1582 ../fish/guestfish-actions.pod:1632 ../fish/guestfish-actions.pod:1647 ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1676 ../fish/guestfish-actions.pod:3779 ../fish/guestfish-actions.pod:3794 ../fish/guestfish-actions.pod:3870 ../fish/guestfish-actions.pod:3887 ../fish/guestfish-actions.pod:3902 ../fish/guestfish-actions.pod:4583 ../fish/guestfish-actions.pod:4629 ../fish/guestfish-actions.pod:4714 ../fish/guestfish-actions.pod:4729 ../fish/guestfish-actions.pod:5135 ../fish/guestfish-actions.pod:5147 ../fish/guestfish-actions.pod:5165 ../fish/guestfish-actions.pod:5182 ../fish/guestfish-actions.pod:5192 ../fish/guestfish-actions.pod:5249 ../fish/guestfish-actions.pod:5259 ../fish/guestfish-actions.pod:5288 ../fish/guestfish-actions.pod:5298 ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127 ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1550 ../src/guestfs-actions.pod:1569 ../src/guestfs-actions.pod:1672 ../src/guestfs-actions.pod:1691 ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:2417 ../src/guestfs-actions.pod:2436 ../src/guestfs-actions.pod:2501 ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:2542 ../src/guestfs-actions.pod:2571 ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:5787 ../src/guestfs-actions.pod:5918 ../src/guestfs-actions.pod:5944 ../src/guestfs-actions.pod:5968 ../src/guestfs-actions.pod:6933 ../src/guestfs-actions.pod:6988 ../src/guestfs-actions.pod:7134 ../src/guestfs-actions.pod:7158 ../src/guestfs-actions.pod:7823 ../src/guestfs-actions.pod:7843 ../src/guestfs-actions.pod:7876 ../src/guestfs-actions.pod:7895 ../src/guestfs-actions.pod:7914 ../src/guestfs-actions.pod:8008 ../src/guestfs-actions.pod:8027 ../src/guestfs-actions.pod:8073 ../src/guestfs-actions.pod:8092
5170 "Because of the message protocol, there is a transfer limit of somewhere "
5171 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5175 #: ../fish/guestfish-actions.pod:625
5180 #: ../fish/guestfish-actions.pod:627
5183 " checksum csumtype path\n"
5188 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
5189 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5193 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
5195 "The type of checksum to compute is given by the C<csumtype> parameter which "
5196 "must have one of the following values:"
5200 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
5205 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
5207 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5212 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
5217 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
5218 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5222 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
5227 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
5228 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5232 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
5237 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
5238 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5242 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
5247 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
5248 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5252 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
5257 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
5258 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5262 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
5267 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
5268 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5272 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
5273 msgid "The checksum is returned as a printable string."
5277 #: ../fish/guestfish-actions.pod:670
5278 msgid "To get the checksum for a device, use L</checksum-device>."
5282 #: ../fish/guestfish-actions.pod:672
5283 msgid "To get the checksums for many files, use L</checksums-out>."
5287 #: ../fish/guestfish-actions.pod:674
5288 msgid "checksum-device"
5292 #: ../fish/guestfish-actions.pod:676
5295 " checksum-device csumtype device\n"
5300 #: ../fish/guestfish-actions.pod:678
5302 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5303 "device named C<device>. For the types of checksums supported see the "
5304 "L</checksum> command."
5308 #: ../fish/guestfish-actions.pod:682
5309 msgid "checksums-out"
5313 #: ../fish/guestfish-actions.pod:684
5316 " checksums-out csumtype directory (sumsfile|-)\n"
5321 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
5323 "This command computes the checksums of all regular files in C<directory> and "
5324 "then emits a list of those checksums to the local output file C<sumsfile>."
5328 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
5330 "This can be used for verifying the integrity of a virtual machine. However "
5331 "to be properly secure you should pay attention to the output of the checksum "
5332 "command (it uses the ones from GNU coreutils). In particular when the "
5333 "filename is not printable, coreutils uses a special backslash syntax. For "
5334 "more information, see the GNU coreutils info file."
5338 #: ../fish/guestfish-actions.pod:700
5343 #: ../fish/guestfish-actions.pod:702
5346 " chmod mode path\n"
5351 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
5353 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5358 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
5360 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5361 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5366 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3132 ../fish/guestfish-actions.pod:3271 ../fish/guestfish-actions.pod:3281 ../fish/guestfish-actions.pod:3291 ../src/guestfs-actions.pod:1064 ../src/guestfs-actions.pod:4733 ../src/guestfs-actions.pod:4942 ../src/guestfs-actions.pod:4961 ../src/guestfs-actions.pod:4980
5367 msgid "The mode actually set is affected by the umask."
5371 #: ../fish/guestfish-actions.pod:713
5376 #: ../fish/guestfish-actions.pod:715
5379 " chown owner group path\n"
5384 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
5385 msgid "Change the file owner to C<owner> and group to C<group>."
5389 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3804
5391 "Only numeric uid and gid are supported. If you want to use names, you will "
5392 "need to locate and parse the password file yourself (Augeas support makes "
5393 "this relatively easy)."
5397 #: ../fish/guestfish-actions.pod:723
5402 #: ../fish/guestfish-actions.pod:725
5405 " command 'arguments ...'\n"
5410 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
5412 "This call runs a command from the guest filesystem. The filesystem must be "
5413 "mounted, and must contain a compatible operating system (ie. something "
5414 "Linux, with the same or compatible processor architecture)."
5418 #: ../fish/guestfish-actions.pod:732
5420 "The single parameter is an argv-style list of arguments. The first element "
5421 "is the name of the program to run. Subsequent elements are parameters. The "
5422 "list must be non-empty (ie. must contain a program name). Note that the "
5423 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5427 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
5428 msgid "The return value is anything printed to I<stdout> by the command."
5432 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
5434 "If the command returns a non-zero exit status, then this function returns an "
5435 "error message. The error message string is the content of I<stderr> from "
5440 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5442 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5443 "C</bin>. If you require a program from another location, you should provide "
5444 "the full path in the first parameter."
5448 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
5450 "Shared libraries and data files required by the program must be available on "
5451 "filesystems which are mounted in the correct places. It is the caller's "
5452 "responsibility to ensure all filesystems that are needed are mounted at the "
5457 #: ../fish/guestfish-actions.pod:760
5458 msgid "command-lines"
5462 #: ../fish/guestfish-actions.pod:762
5465 " command-lines 'arguments ...'\n"
5470 #: ../fish/guestfish-actions.pod:764
5471 msgid "This is the same as L</command>, but splits the result into a list of lines."
5475 #: ../fish/guestfish-actions.pod:767
5476 msgid "See also: L</sh-lines>"
5480 #: ../fish/guestfish-actions.pod:772
5481 msgid "compress-device-out"
5485 #: ../fish/guestfish-actions.pod:774
5488 " compress-device-out ctype device (zdevice|-) [level:..]\n"
5493 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1168
5495 "This command compresses C<device> and writes it out to the local file "
5500 #: ../fish/guestfish-actions.pod:779
5502 "The C<ctype> and optional C<level> parameters have the same meaning as in "
5507 #: ../fish/guestfish-actions.pod:786
5508 msgid "compress-out"
5512 #: ../fish/guestfish-actions.pod:788
5515 " compress-out ctype file (zfile|-) [level:..]\n"
5520 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1218
5522 "This command compresses C<file> and writes it out to the local file "
5527 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1221
5529 "The compression program used is controlled by the C<ctype> parameter. "
5530 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
5531 "Some compression types may not be supported by particular builds of "
5532 "libguestfs, in which case you will get an error containing the substring "
5533 "\"not supported\"."
5537 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1227
5539 "The optional C<level> parameter controls compression level. The meaning and "
5540 "default for this parameter depends on the compression program being used."
5544 #: ../fish/guestfish-actions.pod:807
5549 #: ../fish/guestfish-actions.pod:809
5552 " config qemuparam qemuvalue\n"
5557 #: ../fish/guestfish-actions.pod:811 ../src/guestfs-actions.pod:1266
5559 "This can be used to add arbitrary qemu command line parameters of the form "
5560 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
5561 "setting some parameters which would interfere with parameters that we use."
5565 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1271
5566 msgid "The first character of C<param> string must be a C<-> (dash)."
5570 #: ../fish/guestfish-actions.pod:818 ../src/guestfs-actions.pod:1273
5571 msgid "C<value> can be NULL."
5575 #: ../fish/guestfish-actions.pod:820
5580 #: ../fish/guestfish-actions.pod:822
5583 " copy-size src dest size\n"
5588 #: ../fish/guestfish-actions.pod:824 ../src/guestfs-actions.pod:1287
5590 "This command copies exactly C<size> bytes from one source device or file "
5591 "C<src> to another destination device or file C<dest>."
5595 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1290
5597 "Note this will fail if the source is too short or if the destination is not "
5602 #: ../fish/guestfish-actions.pod:830
5607 #: ../fish/guestfish-actions.pod:832
5615 #: ../fish/guestfish-actions.pod:834 ../src/guestfs-actions.pod:1309
5617 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5618 "destination filename or destination directory."
5622 #: ../fish/guestfish-actions.pod:837
5627 #: ../fish/guestfish-actions.pod:839
5635 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1323
5637 "This copies a file or directory from C<src> to C<dest> recursively using the "
5642 #: ../fish/guestfish-actions.pod:844
5647 #: ../fish/guestfish-actions.pod:846
5655 #: ../fish/guestfish-actions.pod:848 ../src/guestfs-actions.pod:1337
5657 "This command copies from one source device or file C<src> to another "
5658 "destination device or file C<dest>. Normally you would use this to copy to "
5659 "or from a device or partition, for example to duplicate a filesystem."
5663 #: ../fish/guestfish-actions.pod:853
5665 "If the destination is a device, it must be as large or larger than the "
5666 "source file or device, otherwise the copy will fail. This command cannot do "
5667 "partial copies (see L</copy-size>)."
5671 #: ../fish/guestfish-actions.pod:857
5676 #: ../fish/guestfish-actions.pod:859
5684 #: ../fish/guestfish-actions.pod:861 ../src/guestfs-actions.pod:1355
5685 msgid "This command runs the C<df> command to report disk space used."
5689 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:874
5691 "This command is mostly useful for interactive sessions. It is I<not> "
5692 "intended that you try to parse the output string. Use L</statvfs> from "
5697 #: ../fish/guestfish-actions.pod:867
5702 #: ../fish/guestfish-actions.pod:869
5710 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1371
5712 "This command runs the C<df -h> command to report disk space used in "
5713 "human-readable format."
5717 #: ../fish/guestfish-actions.pod:878
5722 #: ../fish/guestfish-actions.pod:880
5730 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1388
5732 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5733 "This is sometimes useful for extended debugging of problems."
5737 #: ../fish/guestfish-actions.pod:886
5739 "Another way to get the same information is to enable verbose messages with "
5740 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
5741 "before running the program."
5745 #: ../fish/guestfish-actions.pod:891
5750 #: ../fish/guestfish-actions.pod:893
5753 " download remotefilename (filename|-)\n"
5758 #: ../fish/guestfish-actions.pod:895 ../fish/guestfish-actions.pod:908 ../src/guestfs-actions.pod:1409 ../src/guestfs-actions.pod:1434
5760 "Download file C<remotefilename> and save it as C<filename> on the local "
5765 #: ../fish/guestfish-actions.pod:898 ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:1412 ../src/guestfs-actions.pod:7393
5766 msgid "C<filename> can also be a named pipe."
5770 #: ../fish/guestfish-actions.pod:900
5771 msgid "See also L</upload>, L</cat>."
5775 #: ../fish/guestfish-actions.pod:904
5776 msgid "download-offset"
5780 #: ../fish/guestfish-actions.pod:906
5783 " download-offset remotefilename (filename|-) offset size\n"
5788 #: ../fish/guestfish-actions.pod:911 ../src/guestfs-actions.pod:1437
5790 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5791 "region must be within the file or device)."
5795 #: ../fish/guestfish-actions.pod:914
5797 "Note that there is no limit on the amount of data that can be downloaded "
5798 "with this call, unlike with L</pread>, and this call always reads the full "
5799 "amount unless an error occurs."
5803 #: ../fish/guestfish-actions.pod:919
5804 msgid "See also L</download>, L</pread>."
5808 #: ../fish/guestfish-actions.pod:923
5813 #: ../fish/guestfish-actions.pod:925
5816 " drop-caches whattodrop\n"
5821 #: ../fish/guestfish-actions.pod:927 ../src/guestfs-actions.pod:1462
5823 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5824 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5825 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5829 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1467
5830 msgid "Setting C<whattodrop> to 3 should drop everything."
5834 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1469
5836 "This automatically calls L<sync(2)> before the operation, so that the "
5837 "maximum guest memory is freed."
5841 #: ../fish/guestfish-actions.pod:937
5846 #: ../fish/guestfish-actions.pod:939
5854 #: ../fish/guestfish-actions.pod:941 ../src/guestfs-actions.pod:1482
5856 "This command runs the C<du -s> command to estimate file space usage for "
5861 #: ../fish/guestfish-actions.pod:944 ../src/guestfs-actions.pod:1485
5863 "C<path> can be a file or a directory. If C<path> is a directory then the "
5864 "estimate includes the contents of the directory and all subdirectories "
5869 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1489
5870 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5874 #: ../fish/guestfish-actions.pod:951
5879 #: ../fish/guestfish-actions.pod:953
5882 " e2fsck-f device\n"
5887 #: ../fish/guestfish-actions.pod:955 ../src/guestfs-actions.pod:1507
5889 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5890 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
5895 #: ../fish/guestfish-actions.pod:959
5897 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
5898 "should use L</fsck>."
5902 #: ../fish/guestfish-actions.pod:962
5907 #: ../fish/guestfish-actions.pod:964
5910 " echo-daemon 'words ...'\n"
5915 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1524
5917 "This command concatenates the list of C<words> passed with single spaces "
5918 "between them and returns the resulting string."
5922 #: ../fish/guestfish-actions.pod:969 ../src/guestfs-actions.pod:1527
5923 msgid "You can use this command to test the connection through to the daemon."
5927 #: ../fish/guestfish-actions.pod:971
5928 msgid "See also L</ping-daemon>."
5932 #: ../fish/guestfish-actions.pod:973
5937 #: ../fish/guestfish-actions.pod:975
5940 " egrep regex path\n"
5945 #: ../fish/guestfish-actions.pod:977 ../src/guestfs-actions.pod:1543
5946 msgid "This calls the external C<egrep> program and returns the matching lines."
5950 #: ../fish/guestfish-actions.pod:983
5955 #: ../fish/guestfish-actions.pod:985
5958 " egrepi regex path\n"
5963 #: ../fish/guestfish-actions.pod:987 ../src/guestfs-actions.pod:1562
5964 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5968 #: ../fish/guestfish-actions.pod:993
5973 #: ../fish/guestfish-actions.pod:995
5976 " equal file1 file2\n"
5981 #: ../fish/guestfish-actions.pod:997 ../src/guestfs-actions.pod:1581
5983 "This compares the two files C<file1> and C<file2> and returns true if their "
5984 "content is exactly equal, or false otherwise."
5988 #: ../fish/guestfish-actions.pod:1000 ../src/guestfs-actions.pod:1584
5989 msgid "The external L<cmp(1)> program is used for the comparison."
5993 #: ../fish/guestfish-actions.pod:1002
5998 #: ../fish/guestfish-actions.pod:1004
6006 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1596
6008 "This returns C<true> if and only if there is a file, directory (or anything) "
6009 "with the given C<path> name."
6013 #: ../fish/guestfish-actions.pod:1009
6014 msgid "See also L</is-file>, L</is-dir>, L</stat>."
6018 #: ../fish/guestfish-actions.pod:1011
6023 #: ../fish/guestfish-actions.pod:1013
6026 " fallocate path len\n"
6031 #: ../fish/guestfish-actions.pod:1015 ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1619 ../src/guestfs-actions.pod:1638
6033 "This command preallocates a file (containing zero bytes) named C<path> of "
6034 "size C<len> bytes. If the file exists already, it is overwritten."
6038 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1623
6040 "Do not confuse this with the guestfish-specific C<alloc> command which "
6041 "allocates a file in the host and attaches it as a device."
6045 #: ../fish/guestfish-actions.pod:1023
6047 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
6052 #: ../fish/guestfish-actions.pod:1030
6057 #: ../fish/guestfish-actions.pod:1032
6060 " fallocate64 path len\n"
6065 #: ../fish/guestfish-actions.pod:1038
6067 "Note that this call allocates disk blocks for the file. To create a sparse "
6068 "file use L</truncate-size> instead."
6072 #: ../fish/guestfish-actions.pod:1041
6074 "The deprecated call L</fallocate> does the same, but owing to an oversight "
6075 "it only allowed 30 bit lengths to be specified, effectively limiting the "
6076 "maximum size of files created through that call to 1GB."
6080 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1650
6082 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6083 "commands which create a file in the host and attach it as a device."
6087 #: ../fish/guestfish-actions.pod:1050
6092 #: ../fish/guestfish-actions.pod:1052
6095 " fgrep pattern path\n"
6100 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1665
6101 msgid "This calls the external C<fgrep> program and returns the matching lines."
6105 #: ../fish/guestfish-actions.pod:1060
6110 #: ../fish/guestfish-actions.pod:1062
6113 " fgrepi pattern path\n"
6118 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1684
6119 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
6123 #: ../fish/guestfish-actions.pod:1070
6128 #: ../fish/guestfish-actions.pod:1072
6136 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1702
6138 "This call uses the standard L<file(1)> command to determine the type or "
6139 "contents of the file."
6143 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1705
6145 "This call will also transparently look inside various types of compressed "
6150 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1708
6152 "The exact command which runs is C<file -zb path>. Note in particular that "
6153 "the filename is not prepended to the output (the I<-b> option)."
6157 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1712
6159 "The output depends on the output of the underlying L<file(1)> command and it "
6160 "can change in future in ways beyond our control. In other words, the output "
6161 "is not guaranteed by the ABI."
6165 #: ../fish/guestfish-actions.pod:1088
6167 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
6168 "(etc), L</is-zero>."
6172 #: ../fish/guestfish-actions.pod:1091
6173 msgid "file-architecture"
6177 #: ../fish/guestfish-actions.pod:1093
6180 " file-architecture filename\n"
6185 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1730
6187 "This detects the architecture of the binary C<filename>, and returns it if "
6192 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1733
6193 msgid "Currently defined architectures are:"
6197 #: ../fish/guestfish-actions.pod:1102 ../src/guestfs-actions.pod:1737
6202 #: ../fish/guestfish-actions.pod:1104 ../src/guestfs-actions.pod:1739
6204 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6205 "irrespective of the precise processor requirements of the binary."
6209 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1742
6214 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1744
6215 msgid "64 bit x86-64."
6219 #: ../fish/guestfish-actions.pod:1111 ../src/guestfs-actions.pod:1746
6224 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1748
6225 msgid "32 bit SPARC."
6229 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1750
6234 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1752
6235 msgid "64 bit SPARC V9 and above."
6239 #: ../fish/guestfish-actions.pod:1119 ../src/guestfs-actions.pod:1754
6244 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1756
6245 msgid "Intel Itanium."
6249 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1758
6254 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1760
6255 msgid "32 bit Power PC."
6259 #: ../fish/guestfish-actions.pod:1127 ../src/guestfs-actions.pod:1762
6264 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1764
6265 msgid "64 bit Power PC."
6269 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1768
6270 msgid "Libguestfs may return other architecture strings in future."
6274 #: ../fish/guestfish-actions.pod:1135 ../src/guestfs-actions.pod:1770
6275 msgid "The function works on at least the following types of files:"
6279 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1776
6280 msgid "many types of Un*x and Linux binary"
6284 #: ../fish/guestfish-actions.pod:1145 ../src/guestfs-actions.pod:1780
6285 msgid "many types of Un*x and Linux shared library"
6289 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1784
6290 msgid "Windows Win32 and Win64 binaries"
6294 #: ../fish/guestfish-actions.pod:1153 ../src/guestfs-actions.pod:1788
6295 msgid "Windows Win32 and Win64 DLLs"
6299 #: ../fish/guestfish-actions.pod:1155 ../src/guestfs-actions.pod:1790
6300 msgid "Win32 binaries and DLLs return C<i386>."
6304 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1792
6305 msgid "Win64 binaries and DLLs return C<x86_64>."
6309 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1796
6310 msgid "Linux kernel modules"
6314 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1800
6315 msgid "Linux new-style initrd images"
6319 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1804
6320 msgid "some non-x86 Linux vmlinuz kernels"
6324 #: ../fish/guestfish-actions.pod:1173 ../src/guestfs-actions.pod:1808
6325 msgid "What it can't do currently:"
6329 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1814
6330 msgid "static libraries (libfoo.a)"
6334 #: ../fish/guestfish-actions.pod:1183 ../src/guestfs-actions.pod:1818
6335 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6339 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1822
6340 msgid "x86 Linux vmlinuz kernels"
6344 #: ../fish/guestfish-actions.pod:1189 ../src/guestfs-actions.pod:1824
6346 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6347 "compressed code, and are horribly hard to unpack. If you want to find the "
6348 "architecture of a kernel, use the architecture of the associated initrd or "
6349 "kernel module(s) instead."
6353 #: ../fish/guestfish-actions.pod:1196
6358 #: ../fish/guestfish-actions.pod:1198
6366 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1842
6367 msgid "This command returns the size of C<file> in bytes."
6371 #: ../fish/guestfish-actions.pod:1202
6373 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
6374 "L</is-file> etc. To get the size of block devices, use "
6375 "L</blockdev-getsize64>."
6379 #: ../fish/guestfish-actions.pod:1206
6384 #: ../fish/guestfish-actions.pod:1208
6387 " fill c len path\n"
6392 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:1860
6394 "This command creates a new file called C<path>. The initial content of the "
6395 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6400 #: ../fish/guestfish-actions.pod:1214
6402 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6403 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6408 #: ../fish/guestfish-actions.pod:1219
6409 msgid "fill-pattern"
6413 #: ../fish/guestfish-actions.pod:1221
6416 " fill-pattern pattern len path\n"
6421 #: ../fish/guestfish-actions.pod:1223
6423 "This function is like L</fill> except that it creates a new file of length "
6424 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6425 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6430 #: ../fish/guestfish-actions.pod:1228
6435 #: ../fish/guestfish-actions.pod:1230
6443 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:1906
6445 "This command lists out all files and directories, recursively, starting at "
6446 "C<directory>. It is essentially equivalent to running the shell command "
6447 "C<find directory -print> but some post-processing happens on the output, "
6452 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1911
6454 "This returns a list of strings I<without any prefix>. Thus if the directory "
6459 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:1914
6469 #: ../fish/guestfish-actions.pod:1244
6470 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6474 #: ../fish/guestfish-actions.pod:1247 ../src/guestfs-actions.pod:1921
6485 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1926
6486 msgid "If C<directory> is not a directory, then this command returns an error."
6490 #: ../fish/guestfish-actions.pod:1255 ../src/guestfs-actions.pod:1929
6491 msgid "The returned list is sorted."
6495 #: ../fish/guestfish-actions.pod:1257
6496 msgid "See also L</find0>."
6500 #: ../fish/guestfish-actions.pod:1262
6505 #: ../fish/guestfish-actions.pod:1264
6508 " find0 directory (files|-)\n"
6513 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1949
6515 "This command lists out all files and directories, recursively, starting at "
6516 "C<directory>, placing the resulting list in the external file called "
6521 #: ../fish/guestfish-actions.pod:1270
6522 msgid "This command works the same way as L</find> with the following exceptions:"
6526 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:1960
6527 msgid "The resulting list is written to an external file."
6531 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1964
6533 "Items (filenames) in the result are separated by C<\\0> characters. See "
6534 "L<find(1)> option I<-print0>."
6538 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1969
6539 msgid "This command is not limited in the number of names that it can return."
6543 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1974
6544 msgid "The result list is not sorted."
6548 #: ../fish/guestfish-actions.pod:1297
6549 msgid "findfs-label"
6553 #: ../fish/guestfish-actions.pod:1299
6556 " findfs-label label\n"
6561 #: ../fish/guestfish-actions.pod:1301 ../src/guestfs-actions.pod:1988
6563 "This command searches the filesystems and returns the one which has the "
6564 "given label. An error is returned if no such filesystem can be found."
6568 #: ../fish/guestfish-actions.pod:1305
6569 msgid "To find the label of a filesystem, use L</vfs-label>."
6573 #: ../fish/guestfish-actions.pod:1307
6578 #: ../fish/guestfish-actions.pod:1309
6581 " findfs-uuid uuid\n"
6586 #: ../fish/guestfish-actions.pod:1311 ../src/guestfs-actions.pod:2005
6588 "This command searches the filesystems and returns the one which has the "
6589 "given UUID. An error is returned if no such filesystem can be found."
6593 #: ../fish/guestfish-actions.pod:1315
6594 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
6598 #: ../fish/guestfish-actions.pod:1317
6603 #: ../fish/guestfish-actions.pod:1319
6606 " fsck fstype device\n"
6611 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:2023
6613 "This runs the filesystem checker (fsck) on C<device> which should have "
6614 "filesystem type C<fstype>."
6618 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2026
6620 "The returned integer is the status. See L<fsck(8)> for the list of status "
6621 "codes from C<fsck>."
6625 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2035
6626 msgid "Multiple status codes can be summed together."
6630 #: ../fish/guestfish-actions.pod:1337 ../src/guestfs-actions.pod:2039
6632 "A non-zero return code can mean \"success\", for example if errors have been "
6633 "corrected on the filesystem."
6637 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2044
6638 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6642 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2049
6643 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6647 #: ../fish/guestfish-actions.pod:1349
6652 #: ../fish/guestfish-actions.pod:1351
6660 #: ../fish/guestfish-actions.pod:1353 ../src/guestfs-actions.pod:2060
6662 "Return the additional kernel options which are added to the guest kernel "
6667 #: ../fish/guestfish-actions.pod:1356 ../src/guestfs-actions.pod:2063
6668 msgid "If C<NULL> then no options are added."
6672 #: ../fish/guestfish-actions.pod:1358
6673 msgid "get-attach-method"
6677 #: ../fish/guestfish-actions.pod:1360
6680 " get-attach-method\n"
6685 #: ../fish/guestfish-actions.pod:1362
6686 msgid "Return the current attach method. See L</set-attach-method>."
6690 #: ../fish/guestfish-actions.pod:1364
6691 msgid "get-autosync"
6695 #: ../fish/guestfish-actions.pod:1366
6703 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2088
6704 msgid "Get the autosync flag."
6708 #: ../fish/guestfish-actions.pod:1370
6713 #: ../fish/guestfish-actions.pod:1372
6721 #: ../fish/guestfish-actions.pod:1374 ../src/guestfs-actions.pod:2099
6722 msgid "Return the direct appliance mode flag."
6726 #: ../fish/guestfish-actions.pod:1376
6731 #: ../fish/guestfish-actions.pod:1378
6734 " get-e2label device\n"
6739 #: ../fish/guestfish-actions.pod:1380 ../src/guestfs-actions.pod:2118
6740 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6744 #: ../fish/guestfish-actions.pod:1383
6746 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
6751 #: ../fish/guestfish-actions.pod:1390
6756 #: ../fish/guestfish-actions.pod:1392
6759 " get-e2uuid device\n"
6764 #: ../fish/guestfish-actions.pod:1394 ../src/guestfs-actions.pod:2139
6765 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6769 #: ../fish/guestfish-actions.pod:1397
6771 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
6776 #: ../fish/guestfish-actions.pod:1404
6781 #: ../fish/guestfish-actions.pod:1406
6789 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2152
6790 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6794 #: ../fish/guestfish-actions.pod:1411
6796 "If L</set-memsize> was not called on this handle, and if "
6797 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6798 "value for memsize."
6802 #: ../fish/guestfish-actions.pod:1415 ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:4235 ../fish/guestfish-actions.pod:4337 ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:2251 ../src/guestfs-actions.pod:6440 ../src/guestfs-actions.pod:6566
6803 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6807 #: ../fish/guestfish-actions.pod:1418
6812 #: ../fish/guestfish-actions.pod:1420
6820 #: ../fish/guestfish-actions.pod:1422 ../src/guestfs-actions.pod:2171
6821 msgid "This returns the enable network flag."
6825 #: ../fish/guestfish-actions.pod:1424
6830 #: ../fish/guestfish-actions.pod:1426
6838 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2182
6839 msgid "Return the current search path."
6843 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2184
6845 "This is always non-NULL. If it wasn't set already, then this will return "
6850 #: ../fish/guestfish-actions.pod:1433
6855 #: ../fish/guestfish-actions.pod:1435
6863 #: ../fish/guestfish-actions.pod:1437 ../src/guestfs-actions.pod:2197
6864 msgid "This returns the process group flag."
6868 #: ../fish/guestfish-actions.pod:1439
6873 #: ../fish/guestfish-actions.pod:1441
6878 #: ../fish/guestfish-actions.pod:1443
6886 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2208
6888 "Return the process ID of the qemu subprocess. If there is no qemu "
6889 "subprocess, then this will return an error."
6893 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2211
6894 msgid "This is an internal call used for debugging and testing."
6898 #: ../fish/guestfish-actions.pod:1450
6903 #: ../fish/guestfish-actions.pod:1452
6911 #: ../fish/guestfish-actions.pod:1454 ../src/guestfs-actions.pod:2222
6912 msgid "Return the current qemu binary."
6916 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2224
6918 "This is always non-NULL. If it wasn't set already, then this will return "
6919 "the default qemu binary name."
6923 #: ../fish/guestfish-actions.pod:1459
6924 msgid "get-recovery-proc"
6928 #: ../fish/guestfish-actions.pod:1461
6931 " get-recovery-proc\n"
6936 #: ../fish/guestfish-actions.pod:1463 ../src/guestfs-actions.pod:2237
6937 msgid "Return the recovery process enabled flag."
6941 #: ../fish/guestfish-actions.pod:1465
6946 #: ../fish/guestfish-actions.pod:1467
6954 #: ../fish/guestfish-actions.pod:1469
6956 "This returns the current setting of the selinux flag which is passed to the "
6957 "appliance at boot time. See L</set-selinux>."
6961 #: ../fish/guestfish-actions.pod:1475
6966 #: ../fish/guestfish-actions.pod:1477
6974 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2263
6975 msgid "This returns the number of virtual CPUs assigned to the appliance."
6979 #: ../fish/guestfish-actions.pod:1481
6984 #: ../fish/guestfish-actions.pod:1483
6992 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2272
6994 "This returns the current state as an opaque integer. This is only useful "
6995 "for printing debug and internal error messages."
6999 #: ../fish/guestfish-actions.pod:1488 ../fish/guestfish-actions.pod:2434 ../fish/guestfish-actions.pod:2452 ../fish/guestfish-actions.pod:2490 ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:3581 ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:3671 ../src/guestfs-actions.pod:3698
7000 msgid "For more information on states, see L<guestfs(3)>."
7004 #: ../fish/guestfish-actions.pod:1490
7009 #: ../fish/guestfish-actions.pod:1492
7017 #: ../fish/guestfish-actions.pod:1494 ../src/guestfs-actions.pod:2286
7018 msgid "Return the command trace flag."
7022 #: ../fish/guestfish-actions.pod:1496
7027 #: ../fish/guestfish-actions.pod:1498
7035 #: ../fish/guestfish-actions.pod:1500
7037 "Return the current umask. By default the umask is C<022> unless it has been "
7038 "set by calling L</umask>."
7042 #: ../fish/guestfish-actions.pod:1503
7047 #: ../fish/guestfish-actions.pod:1505
7055 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2309
7056 msgid "This returns the verbose messages flag."
7060 #: ../fish/guestfish-actions.pod:1509
7065 #: ../fish/guestfish-actions.pod:1511
7073 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2320
7074 msgid "This gets the SELinux security context of the daemon."
7078 #: ../fish/guestfish-actions.pod:1515
7079 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
7083 #: ../fish/guestfish-actions.pod:1518
7088 #: ../fish/guestfish-actions.pod:1520
7091 " getxattr path name\n"
7096 #: ../fish/guestfish-actions.pod:1522
7098 "Get a single extended attribute from file C<path> named C<name>. This call "
7099 "follows symlinks. If you want to lookup an extended attribute for the "
7100 "symlink itself, use L</lgetxattr>."
7104 #: ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:2579
7106 "Normally it is better to get all extended attributes from a file in one go "
7107 "by calling L</getxattrs>. However some Linux filesystem implementations are "
7108 "buggy and do not provide a way to list out attributes. For these "
7109 "filesystems (notably ntfs-3g) you have to know the names of the extended "
7110 "attributes you want in advance and call this function."
7114 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:2586 ../src/guestfs-actions.pod:2349 ../src/guestfs-actions.pod:3831
7116 "Extended attribute values are blobs of binary data. If there is no extended "
7117 "attribute named C<name>, this returns an error."
7121 #: ../fish/guestfish-actions.pod:1536
7122 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
7126 #: ../fish/guestfish-actions.pod:1538
7131 #: ../fish/guestfish-actions.pod:1540
7139 #: ../fish/guestfish-actions.pod:1542 ../src/guestfs-actions.pod:2366
7140 msgid "This call lists the extended attributes of the file or directory C<path>."
7144 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2369
7146 "At the system call level, this is a combination of the L<listxattr(2)> and "
7147 "L<getxattr(2)> calls."
7151 #: ../fish/guestfish-actions.pod:1548
7152 msgid "See also: L</lgetxattrs>, L<attr(5)>."
7156 #: ../fish/guestfish-actions.pod:1550
7161 #: ../fish/guestfish-actions.pod:1552
7164 " glob-expand pattern\n"
7169 #: ../fish/guestfish-actions.pod:1554 ../src/guestfs-actions.pod:2386
7171 "This command searches for all the pathnames matching C<pattern> according to "
7172 "the wildcard expansion rules used by the shell."
7176 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2390
7177 msgid "If no paths match, then this returns an empty list (note: not an error)."
7181 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2393
7183 "It is just a wrapper around the C L<glob(3)> function with flags "
7184 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
7188 #: ../fish/guestfish-actions.pod:1565
7193 #: ../fish/guestfish-actions.pod:1567
7196 " grep regex path\n"
7201 #: ../fish/guestfish-actions.pod:1569 ../src/guestfs-actions.pod:2410
7202 msgid "This calls the external C<grep> program and returns the matching lines."
7206 #: ../fish/guestfish-actions.pod:1575
7211 #: ../fish/guestfish-actions.pod:1577
7214 " grepi regex path\n"
7219 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2429
7220 msgid "This calls the external C<grep -i> program and returns the matching lines."
7224 #: ../fish/guestfish-actions.pod:1585
7225 msgid "grub-install"
7229 #: ../fish/guestfish-actions.pod:1587
7232 " grub-install root device\n"
7237 #: ../fish/guestfish-actions.pod:1589 ../src/guestfs-actions.pod:2448
7239 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
7240 "with the root directory being C<root>."
7244 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2457
7246 "There is currently no way in the API to install grub2, which is used by most "
7247 "modern Linux guests. It is possible to run the grub2 command from the "
7248 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
7252 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2464
7254 "This uses C<grub-install> from the host. Unfortunately grub is not always "
7255 "compatible with itself, so this only works in rather narrow circumstances. "
7256 "Careful testing with each guest version is advisable."
7260 #: ../fish/guestfish-actions.pod:1612 ../src/guestfs-actions.pod:2471
7262 "If grub-install reports the error \"No suitable drive was found in the "
7263 "generated device map.\" it may be that you need to create a "
7264 "C</boot/grub/device.map> file first that contains the mapping between grub "
7265 "device names and Linux device names. It is usually sufficient to create a "
7270 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2478
7278 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2480
7279 msgid "replacing C</dev/vda> with the name of the installation device."
7283 #: ../fish/guestfish-actions.pod:1625
7288 #: ../fish/guestfish-actions.pod:1627
7296 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2494
7298 "This command returns up to the first 10 lines of a file as a list of "
7303 #: ../fish/guestfish-actions.pod:1635
7308 #: ../fish/guestfish-actions.pod:1637
7311 " head-n nrlines path\n"
7316 #: ../fish/guestfish-actions.pod:1639 ../src/guestfs-actions.pod:2513
7318 "If the parameter C<nrlines> is a positive number, this returns the first "
7319 "C<nrlines> lines of the file C<path>."
7323 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2516
7325 "If the parameter C<nrlines> is a negative number, this returns lines from "
7326 "the file C<path>, excluding the last C<nrlines> lines."
7330 #: ../fish/guestfish-actions.pod:1645 ../fish/guestfish-actions.pod:4727 ../src/guestfs-actions.pod:2519 ../src/guestfs-actions.pod:7152
7331 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7335 #: ../fish/guestfish-actions.pod:1650
7340 #: ../fish/guestfish-actions.pod:1652
7348 #: ../fish/guestfish-actions.pod:1654 ../src/guestfs-actions.pod:2536
7350 "This runs C<hexdump -C> on the given C<path>. The result is the "
7351 "human-readable, canonical hex dump of the file."
7355 #: ../fish/guestfish-actions.pod:1660
7360 #: ../fish/guestfish-actions.pod:1662
7363 " initrd-cat initrdpath filename\n"
7368 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2555
7370 "This command unpacks the file C<filename> from the initrd file called "
7371 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7376 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2559
7378 "For example, in guestfish you could use the following command to examine the "
7379 "boot script (usually called C</init>) contained in a Linux initrd or "
7384 #: ../fish/guestfish-actions.pod:1672 ../src/guestfs-actions.pod:2563
7387 " initrd-cat /boot/initrd-<version>.img init\n"
7392 #: ../fish/guestfish-actions.pod:1674
7393 msgid "See also L</initrd-list>."
7397 #: ../fish/guestfish-actions.pod:1679
7402 #: ../fish/guestfish-actions.pod:1681
7405 " initrd-list path\n"
7410 #: ../fish/guestfish-actions.pod:1683 ../src/guestfs-actions.pod:2582
7411 msgid "This command lists out files contained in an initrd."
7415 #: ../fish/guestfish-actions.pod:1685 ../src/guestfs-actions.pod:2584
7417 "The files are listed without any initial C</> character. The files are "
7418 "listed in the order they appear (not necessarily alphabetical). Directory "
7419 "names are listed as separate items."
7423 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2588
7425 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7426 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7431 #: ../fish/guestfish-actions.pod:1693
7432 msgid "inotify-add-watch"
7436 #: ../fish/guestfish-actions.pod:1695
7439 " inotify-add-watch path mask\n"
7444 #: ../fish/guestfish-actions.pod:1697 ../src/guestfs-actions.pod:2605
7445 msgid "Watch C<path> for the events listed in C<mask>."
7449 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2607
7451 "Note that if C<path> is a directory then events within that directory are "
7452 "watched, but this does I<not> happen recursively (in subdirectories)."
7456 #: ../fish/guestfish-actions.pod:1703 ../src/guestfs-actions.pod:2611
7458 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7459 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7463 #: ../fish/guestfish-actions.pod:1707
7464 msgid "inotify-close"
7468 #: ../fish/guestfish-actions.pod:1709
7476 #: ../fish/guestfish-actions.pod:1711 ../src/guestfs-actions.pod:2624
7478 "This closes the inotify handle which was previously opened by inotify_init. "
7479 "It removes all watches, throws away any pending events, and deallocates all "
7484 #: ../fish/guestfish-actions.pod:1715
7485 msgid "inotify-files"
7489 #: ../fish/guestfish-actions.pod:1717
7497 #: ../fish/guestfish-actions.pod:1719
7499 "This function is a helpful wrapper around L</inotify-read> which just "
7500 "returns a list of pathnames of objects that were touched. The returned "
7501 "pathnames are sorted and deduplicated."
7505 #: ../fish/guestfish-actions.pod:1723
7506 msgid "inotify-init"
7510 #: ../fish/guestfish-actions.pod:1725
7513 " inotify-init maxevents\n"
7518 #: ../fish/guestfish-actions.pod:1727 ../src/guestfs-actions.pod:2653
7520 "This command creates a new inotify handle. The inotify subsystem can be "
7521 "used to notify events which happen to objects in the guest filesystem."
7525 #: ../fish/guestfish-actions.pod:1731
7527 "C<maxevents> is the maximum number of events which will be queued up between "
7528 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
7529 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
7530 "default was 16384 events. Beyond this limit, the kernel throws away events, "
7531 "but records the fact that it threw them away by setting a flag "
7532 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
7536 #: ../fish/guestfish-actions.pod:1741
7538 "Before any events are generated, you have to add some watches to the "
7539 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
7540 "L</inotify-watch-all>."
7544 #: ../fish/guestfish-actions.pod:1747
7546 "Queued up events should be read periodically by calling L</inotify-read> (or "
7547 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
7548 "If you don't read the events out often enough then you risk the internal "
7549 "queue overflowing."
7553 #: ../fish/guestfish-actions.pod:1754
7555 "The handle should be closed after use by calling L</inotify-close>. This "
7556 "also removes any watches automatically."
7560 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2684
7562 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7563 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7564 "that there is one global inotify handle per libguestfs instance."
7568 #: ../fish/guestfish-actions.pod:1763
7569 msgid "inotify-read"
7573 #: ../fish/guestfish-actions.pod:1765
7581 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2698
7583 "Return the complete queue of events that have happened since the previous "
7588 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2701
7589 msgid "If no events have happened, this returns an empty list."
7593 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2703
7595 "I<Note>: In order to make sure that all events have been read, you must call "
7596 "this function repeatedly until it returns an empty list. The reason is that "
7597 "the call will read events up to the maximum appliance-to-host message size "
7598 "and leave remaining events in the queue."
7602 #: ../fish/guestfish-actions.pod:1778
7603 msgid "inotify-rm-watch"
7607 #: ../fish/guestfish-actions.pod:1780
7610 " inotify-rm-watch wd\n"
7615 #: ../fish/guestfish-actions.pod:1782
7616 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
7620 #: ../fish/guestfish-actions.pod:1785
7621 msgid "inspect-get-arch"
7625 #: ../fish/guestfish-actions.pod:1787
7628 " inspect-get-arch root\n"
7633 #: ../fish/guestfish-actions.pod:1789
7635 "This returns the architecture of the inspected operating system. The "
7636 "possible return values are listed under L</file-architecture>."
7640 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2738
7642 "If the architecture could not be determined, then the string C<unknown> is "
7647 #: ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1883 ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1974 ../fish/guestfish-actions.pod:2058 ../fish/guestfish-actions.pod:2119 ../fish/guestfish-actions.pod:2140 ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2226 ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2252 ../fish/guestfish-actions.pod:2262 ../fish/guestfish-actions.pod:2272 ../fish/guestfish-actions.pod:2284 ../fish/guestfish-actions.pod:2380 ../fish/guestfish-actions.pod:2414 ../src/guestfs-actions.pod:2741 ../src/guestfs-actions.pod:2835 ../src/guestfs-actions.pod:2939 ../src/guestfs-actions.pod:2958 ../src/guestfs-actions.pod:3089 ../src/guestfs-actions.pod:3172 ../src/guestfs-actions.pod:3200 ../src/guestfs-actions.pod:3221 ../src/guestfs-actions.pod:3274 ../src/guestfs-actions.pod:3314 ../src/guestfs-actions.pod:3334 ../src/guestfs-actions.pod:3354 ../src/guestfs-actions.pod:3371 ../src/guestfs-actions.pod:3387 ../src/guestfs-actions.pod:3405 ../src/guestfs-actions.pod:3507 ../src/guestfs-actions.pod:3548
7648 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7652 #: ../fish/guestfish-actions.pod:1798
7653 msgid "inspect-get-distro"
7657 #: ../fish/guestfish-actions.pod:1800
7660 " inspect-get-distro root\n"
7665 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2754
7666 msgid "This returns the distro (distribution) of the inspected operating system."
7670 #: ../fish/guestfish-actions.pod:1805 ../src/guestfs-actions.pod:2757
7671 msgid "Currently defined distros are:"
7675 #: ../fish/guestfish-actions.pod:1809 ../src/guestfs-actions.pod:2761
7676 msgid "\"archlinux\""
7680 #: ../fish/guestfish-actions.pod:1811 ../src/guestfs-actions.pod:2763
7685 #: ../fish/guestfish-actions.pod:1813 ../src/guestfs-actions.pod:2765
7690 #: ../fish/guestfish-actions.pod:1815 ../src/guestfs-actions.pod:2767
7695 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2769
7700 #: ../fish/guestfish-actions.pod:1819 ../src/guestfs-actions.pod:2771
7705 #: ../fish/guestfish-actions.pod:1821 ../src/guestfs-actions.pod:2773
7710 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2775
7715 #: ../fish/guestfish-actions.pod:1825 ../src/guestfs-actions.pod:2777
7720 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2779
7725 #: ../fish/guestfish-actions.pod:1829 ../src/guestfs-actions.pod:2781
7726 msgid "\"linuxmint\""
7730 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2783
7735 #: ../fish/guestfish-actions.pod:1833 ../src/guestfs-actions.pod:2785
7736 msgid "\"mandriva\""
7740 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2787
7745 #: ../fish/guestfish-actions.pod:1837 ../src/guestfs-actions.pod:2789
7750 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2791
7755 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2793
7760 #: ../fish/guestfish-actions.pod:1843 ../src/guestfs-actions.pod:2795
7765 #: ../fish/guestfish-actions.pod:1845 ../src/guestfs-actions.pod:2797
7766 msgid "\"redhat-based\""
7770 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2799
7771 msgid "Some Red Hat-derived distro."
7775 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2801
7780 #: ../fish/guestfish-actions.pod:1851 ../src/guestfs-actions.pod:2803
7781 msgid "Red Hat Enterprise Linux."
7785 #: ../fish/guestfish-actions.pod:1853 ../src/guestfs-actions.pod:2805
7786 msgid "\"scientificlinux\""
7790 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2807
7791 msgid "Scientific Linux."
7795 #: ../fish/guestfish-actions.pod:1857 ../src/guestfs-actions.pod:2809
7796 msgid "\"slackware\""
7800 #: ../fish/guestfish-actions.pod:1859 ../src/guestfs-actions.pod:2811
7805 #: ../fish/guestfish-actions.pod:1861 ../src/guestfs-actions.pod:2813
7806 msgid "\"ttylinux\""
7810 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2815
7815 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2817
7820 #: ../fish/guestfish-actions.pod:1867 ../src/guestfs-actions.pod:2819
7825 #: ../fish/guestfish-actions.pod:1869 ../fish/guestfish-actions.pod:1953 ../fish/guestfish-actions.pod:2217 ../src/guestfs-actions.pod:2821 ../src/guestfs-actions.pod:2930 ../src/guestfs-actions.pod:3305
7830 #: ../fish/guestfish-actions.pod:1871 ../src/guestfs-actions.pod:2823
7831 msgid "The distro could not be determined."
7835 #: ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:2209 ../src/guestfs-actions.pod:2825 ../src/guestfs-actions.pod:3297
7840 #: ../fish/guestfish-actions.pod:1875 ../src/guestfs-actions.pod:2827
7842 "Windows does not have distributions. This string is returned if the OS type "
7847 #: ../fish/guestfish-actions.pod:1880 ../fish/guestfish-actions.pod:1959 ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:2832 ../src/guestfs-actions.pod:2936 ../src/guestfs-actions.pod:3311
7849 "Future versions of libguestfs may return other strings here. The caller "
7850 "should be prepared to handle any string."
7854 #: ../fish/guestfish-actions.pod:1885
7855 msgid "inspect-get-drive-mappings"
7859 #: ../fish/guestfish-actions.pod:1887
7862 " inspect-get-drive-mappings root\n"
7867 #: ../fish/guestfish-actions.pod:1889 ../src/guestfs-actions.pod:2848
7869 "This call is useful for Windows which uses a primitive system of assigning "
7870 "drive letters (like \"C:\") to partitions. This inspection API examines the "
7871 "Windows Registry to find out how disks/partitions are mapped to drive "
7872 "letters, and returns a hash table as in the example below:"
7876 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:2854
7886 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2858
7888 "Note that keys are drive letters. For Windows, the key is case insensitive "
7889 "and just contains the drive letter, without the customary colon separator "
7894 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2862
7896 "In future we may support other operating systems that also used drive "
7897 "letters, but the keys for those might not be case insensitive and might be "
7898 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
7903 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2867
7905 "For Windows guests, currently only hard drive mappings are returned. "
7906 "Removable disks (eg. DVD-ROMs) are ignored."
7910 #: ../fish/guestfish-actions.pod:1911 ../src/guestfs-actions.pod:2870
7912 "For guests that do not use drive mappings, or if the drive mappings could "
7913 "not be determined, this returns an empty hash table."
7917 #: ../fish/guestfish-actions.pod:1914
7919 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7920 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
7924 #: ../fish/guestfish-actions.pod:1918
7925 msgid "inspect-get-filesystems"
7929 #: ../fish/guestfish-actions.pod:1920
7932 " inspect-get-filesystems root\n"
7937 #: ../fish/guestfish-actions.pod:1922 ../src/guestfs-actions.pod:2891
7939 "This returns a list of all the filesystems that we think are associated with "
7940 "this operating system. This includes the root filesystem, other ordinary "
7941 "filesystems, and non-mounted devices like swap partitions."
7945 #: ../fish/guestfish-actions.pod:1927 ../src/guestfs-actions.pod:2896
7947 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7948 "to be shared between operating systems."
7952 #: ../fish/guestfish-actions.pod:1930
7954 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7955 "L</inspect-get-mountpoints>."
7959 #: ../fish/guestfish-actions.pod:1933
7960 msgid "inspect-get-format"
7964 #: ../fish/guestfish-actions.pod:1935
7967 " inspect-get-format root\n"
7972 #: ../fish/guestfish-actions.pod:1937 ../src/guestfs-actions.pod:2914
7974 "This returns the format of the inspected operating system. You can use it "
7975 "to detect install images, live CDs and similar."
7979 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2917
7980 msgid "Currently defined formats are:"
7984 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:2921
7985 msgid "\"installed\""
7989 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:2923
7990 msgid "This is an installed operating system."
7994 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2925
7995 msgid "\"installer\""
7999 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2927
8001 "The disk image being inspected is not an installed operating system, but a "
8002 "I<bootable> install disk, live CD, or similar."
8006 #: ../fish/guestfish-actions.pod:1955 ../src/guestfs-actions.pod:2932
8007 msgid "The format of this disk image is not known."
8011 #: ../fish/guestfish-actions.pod:1964
8012 msgid "inspect-get-hostname"
8016 #: ../fish/guestfish-actions.pod:1966
8019 " inspect-get-hostname root\n"
8024 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2952
8026 "This function returns the hostname of the operating system as found by "
8027 "inspection of the guest's configuration files."
8031 #: ../fish/guestfish-actions.pod:1971 ../src/guestfs-actions.pod:2955
8033 "If the hostname could not be determined, then the string C<unknown> is "
8038 #: ../fish/guestfish-actions.pod:1976
8039 msgid "inspect-get-icon"
8043 #: ../fish/guestfish-actions.pod:1978
8046 " inspect-get-icon root [favicon:..] [highquality:..]\n"
8051 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:2981
8053 "This function returns an icon corresponding to the inspected operating "
8054 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
8055 "to PNG if necessary)."
8059 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2985
8061 "If it was not possible to get an icon this function returns a zero-length "
8062 "(non-NULL) buffer. I<Callers must check for this case>."
8066 #: ../fish/guestfish-actions.pod:1987 ../src/guestfs-actions.pod:2988
8068 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
8069 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
8070 "this file will be returned. You can disable favicons by passing the "
8071 "optional C<favicon> boolean as false (default is true)."
8075 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:2994
8077 "If finding the favicon fails, then we look in other places in the guest for "
8082 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:2997
8084 "If the optional C<highquality> boolean is true then only high quality icons "
8085 "are returned, which means only icons of high resolution with an alpha "
8086 "channel. The default (false) is to return any icon we can, even if it is of "
8087 "substandard quality."
8091 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3008
8093 "Unlike most other inspection API calls, the guest's disks must be mounted up "
8094 "before you call this, since it needs to read information from the guest "
8095 "filesystem during the call."
8099 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:3014
8101 "B<Security:> The icon data comes from the untrusted guest, and should be "
8102 "treated with caution. PNG files have been known to contain exploits. "
8103 "Ensure that libpng (or other relevant libraries) are fully up to date before "
8104 "trying to process or display the icon."
8108 #: ../fish/guestfish-actions.pod:2021 ../src/guestfs-actions.pod:3022
8110 "The PNG image returned can be any size. It might not be square. Libguestfs "
8111 "tries to return the largest, highest quality icon available. The "
8112 "application must scale the icon to the required size."
8116 #: ../fish/guestfish-actions.pod:2028 ../src/guestfs-actions.pod:3029
8118 "Extracting icons from Windows guests requires the external C<wrestool> "
8119 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
8120 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
8121 "installed separately."
8125 #: ../fish/guestfish-actions.pod:2035 ../src/guestfs-actions.pod:3036
8127 "Operating system icons are usually trademarks. Seek legal advice before "
8128 "using trademarks in applications."
8132 #: ../fish/guestfish-actions.pod:2042
8133 msgid "inspect-get-major-version"
8137 #: ../fish/guestfish-actions.pod:2044
8140 " inspect-get-major-version root\n"
8145 #: ../fish/guestfish-actions.pod:2046 ../src/guestfs-actions.pod:3077
8146 msgid "This returns the major version number of the inspected operating system."
8150 #: ../fish/guestfish-actions.pod:2049 ../src/guestfs-actions.pod:3080
8152 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8153 "popular public names used by the operating system. Notably the operating "
8154 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8155 "1). You can find out the real versions corresponding to releases of Windows "
8156 "by consulting Wikipedia or MSDN."
8160 #: ../fish/guestfish-actions.pod:2056 ../fish/guestfish-actions.pod:2067 ../src/guestfs-actions.pod:3087 ../src/guestfs-actions.pod:3104
8161 msgid "If the version could not be determined, then C<0> is returned."
8165 #: ../fish/guestfish-actions.pod:2060
8166 msgid "inspect-get-minor-version"
8170 #: ../fish/guestfish-actions.pod:2062
8173 " inspect-get-minor-version root\n"
8178 #: ../fish/guestfish-actions.pod:2064 ../src/guestfs-actions.pod:3101
8179 msgid "This returns the minor version number of the inspected operating system."
8183 #: ../fish/guestfish-actions.pod:2069
8185 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8186 "L</inspect-get-major-version>."
8190 #: ../fish/guestfish-actions.pod:2072
8191 msgid "inspect-get-mountpoints"
8195 #: ../fish/guestfish-actions.pod:2074
8198 " inspect-get-mountpoints root\n"
8203 #: ../fish/guestfish-actions.pod:2076 ../src/guestfs-actions.pod:3119
8205 "This returns a hash of where we think the filesystems associated with this "
8206 "operating system should be mounted. Callers should note that this is at "
8207 "best an educated guess made by reading configuration files such as "
8208 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
8209 "are non-existent or not mountable and callers should be prepared to handle "
8210 "or ignore failures if they try to mount them."
8214 #: ../fish/guestfish-actions.pod:2085 ../src/guestfs-actions.pod:3128
8216 "Each element in the returned hashtable has a key which is the path of the "
8217 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8218 "mounted there (eg. C</dev/sda1>)."
8222 #: ../fish/guestfish-actions.pod:2090 ../src/guestfs-actions.pod:3133
8223 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
8227 #: ../fish/guestfish-actions.pod:2093
8229 "For operating systems like Windows which still use drive letters, this call "
8230 "will only return an entry for the first drive \"mounted on\" C</>. For "
8231 "information about the mapping of drive letters to partitions, see "
8232 "L</inspect-get-drive-mappings>."
8236 #: ../fish/guestfish-actions.pod:2099
8238 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8239 "L</inspect-get-filesystems>."
8243 #: ../fish/guestfish-actions.pod:2102
8244 msgid "inspect-get-package-format"
8248 #: ../fish/guestfish-actions.pod:2104
8251 " inspect-get-package-format root\n"
8256 #: ../fish/guestfish-actions.pod:2106
8258 "This function and L</inspect-get-package-management> return the package "
8259 "format and package management tool used by the inspected operating system. "
8260 "For example for Fedora these functions would return C<rpm> (package format) "
8261 "and C<yum> (package management)."
8265 #: ../fish/guestfish-actions.pod:2112 ../src/guestfs-actions.pod:3165
8267 "This returns the string C<unknown> if we could not determine the package "
8268 "format I<or> if the operating system does not have a real packaging system "
8273 #: ../fish/guestfish-actions.pod:2116 ../src/guestfs-actions.pod:3169
8275 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
8276 "Future versions of libguestfs may return other strings."
8280 #: ../fish/guestfish-actions.pod:2121
8281 msgid "inspect-get-package-management"
8285 #: ../fish/guestfish-actions.pod:2123
8288 " inspect-get-package-management root\n"
8293 #: ../fish/guestfish-actions.pod:2125
8295 "L</inspect-get-package-format> and this function return the package format "
8296 "and package management tool used by the inspected operating system. For "
8297 "example for Fedora these functions would return C<rpm> (package format) and "
8298 "C<yum> (package management)."
8302 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3191
8304 "This returns the string C<unknown> if we could not determine the package "
8305 "management tool I<or> if the operating system does not have a real packaging "
8306 "system (eg. Windows)."
8310 #: ../fish/guestfish-actions.pod:2135 ../src/guestfs-actions.pod:3195
8312 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
8313 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
8314 "libguestfs may return other strings."
8318 #: ../fish/guestfish-actions.pod:2142
8319 msgid "inspect-get-product-name"
8323 #: ../fish/guestfish-actions.pod:2144
8326 " inspect-get-product-name root\n"
8331 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3213
8333 "This returns the product name of the inspected operating system. The "
8334 "product name is generally some freeform string which can be displayed to the "
8335 "user, but should not be parsed by programs."
8339 #: ../fish/guestfish-actions.pod:2151 ../src/guestfs-actions.pod:3218
8341 "If the product name could not be determined, then the string C<unknown> is "
8346 #: ../fish/guestfish-actions.pod:2156
8347 msgid "inspect-get-product-variant"
8351 #: ../fish/guestfish-actions.pod:2158
8354 " inspect-get-product-variant root\n"
8359 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3234
8360 msgid "This returns the product variant of the inspected operating system."
8364 #: ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:3237
8366 "For Windows guests, this returns the contents of the Registry key "
8367 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
8368 "which is usually a string such as C<Client> or C<Server> (other values are "
8369 "possible). This can be used to distinguish consumer and enterprise versions "
8370 "of Windows that have the same version number (for example, Windows 7 and "
8371 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8372 "the latter is C<Server>)."
8376 #: ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:3246
8378 "For enterprise Linux guests, in future we intend this to return the product "
8379 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8380 "implemented at present."
8384 #: ../fish/guestfish-actions.pod:2176 ../src/guestfs-actions.pod:3250
8386 "If the product variant could not be determined, then the string C<unknown> "
8391 #: ../fish/guestfish-actions.pod:2179
8393 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8394 "L</inspect-get-product-name>, L</inspect-get-major-version>."
8398 #: ../fish/guestfish-actions.pod:2183
8399 msgid "inspect-get-roots"
8403 #: ../fish/guestfish-actions.pod:2185
8406 " inspect-get-roots\n"
8411 #: ../fish/guestfish-actions.pod:2187
8413 "This function is a convenient way to get the list of root devices, as "
8414 "returned from a previous call to L</inspect-os>, but without redoing the "
8415 "whole inspection process."
8419 #: ../fish/guestfish-actions.pod:2191
8421 "This returns an empty list if either no root devices were found or the "
8422 "caller has not called L</inspect-os>."
8426 #: ../fish/guestfish-actions.pod:2196
8427 msgid "inspect-get-type"
8431 #: ../fish/guestfish-actions.pod:2198
8434 " inspect-get-type root\n"
8439 #: ../fish/guestfish-actions.pod:2200 ../src/guestfs-actions.pod:3288
8441 "This returns the type of the inspected operating system. Currently defined "
8446 #: ../fish/guestfish-actions.pod:2205 ../src/guestfs-actions.pod:3293
8451 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3295
8452 msgid "Any Linux-based operating system."
8456 #: ../fish/guestfish-actions.pod:2211 ../src/guestfs-actions.pod:3299
8457 msgid "Any Microsoft Windows operating system."
8461 #: ../fish/guestfish-actions.pod:2213 ../src/guestfs-actions.pod:3301
8466 #: ../fish/guestfish-actions.pod:2215 ../src/guestfs-actions.pod:3303
8471 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3307
8472 msgid "The operating system type could not be determined."
8476 #: ../fish/guestfish-actions.pod:2228
8477 msgid "inspect-get-windows-current-control-set"
8481 #: ../fish/guestfish-actions.pod:2230
8484 " inspect-get-windows-current-control-set root\n"
8489 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3327
8491 "This returns the Windows CurrentControlSet of the inspected guest. The "
8492 "CurrentControlSet is a registry key name such as C<ControlSet001>."
8496 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:3330
8498 "This call assumes that the guest is Windows and that the Registry could be "
8499 "examined by inspection. If this is not the case then an error is returned."
8503 #: ../fish/guestfish-actions.pod:2241
8504 msgid "inspect-get-windows-systemroot"
8508 #: ../fish/guestfish-actions.pod:2243
8511 " inspect-get-windows-systemroot root\n"
8516 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3347
8518 "This returns the Windows systemroot of the inspected guest. The systemroot "
8519 "is a directory path such as C</WINDOWS>."
8523 #: ../fish/guestfish-actions.pod:2248 ../src/guestfs-actions.pod:3350
8525 "This call assumes that the guest is Windows and that the systemroot could be "
8526 "determined by inspection. If this is not the case then an error is "
8531 #: ../fish/guestfish-actions.pod:2254
8532 msgid "inspect-is-live"
8536 #: ../fish/guestfish-actions.pod:2256
8539 " inspect-is-live root\n"
8544 #: ../fish/guestfish-actions.pod:2258
8546 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8547 "then this returns true if a live image was detected on the disk."
8551 #: ../fish/guestfish-actions.pod:2264
8552 msgid "inspect-is-multipart"
8556 #: ../fish/guestfish-actions.pod:2266
8559 " inspect-is-multipart root\n"
8564 #: ../fish/guestfish-actions.pod:2268
8566 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8567 "then this returns true if the disk is part of a set."
8571 #: ../fish/guestfish-actions.pod:2274
8572 msgid "inspect-is-netinst"
8576 #: ../fish/guestfish-actions.pod:2276
8579 " inspect-is-netinst root\n"
8584 #: ../fish/guestfish-actions.pod:2278
8586 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8587 "then this returns true if the disk is a network installer, ie. not a "
8588 "self-contained install CD but one which is likely to require network access "
8589 "to complete the install."
8593 #: ../fish/guestfish-actions.pod:2286
8594 msgid "inspect-list-applications"
8598 #: ../fish/guestfish-actions.pod:2288
8601 " inspect-list-applications root\n"
8606 #: ../fish/guestfish-actions.pod:2290 ../src/guestfs-actions.pod:3417
8607 msgid "Return the list of applications installed in the operating system."
8611 #: ../fish/guestfish-actions.pod:2292
8613 "I<Note:> This call works differently from other parts of the inspection "
8614 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
8615 "then mount up the disks, before calling this. Listing applications is a "
8616 "significantly more difficult operation which requires access to the full "
8617 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
8618 "are just returning data cached in the libguestfs handle, this call actually "
8619 "reads parts of the mounted filesystems during the call."
8623 #: ../fish/guestfish-actions.pod:2302 ../src/guestfs-actions.pod:3429
8625 "This returns an empty list if the inspection code was not able to determine "
8626 "the list of applications."
8630 #: ../fish/guestfish-actions.pod:2305 ../src/guestfs-actions.pod:3432
8631 msgid "The application structure contains the following fields:"
8635 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3436
8640 #: ../fish/guestfish-actions.pod:2311 ../src/guestfs-actions.pod:3438
8642 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8643 "guests, this is the package name."
8647 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3441
8648 msgid "C<app_display_name>"
8652 #: ../fish/guestfish-actions.pod:2316 ../src/guestfs-actions.pod:3443
8654 "The display name of the application, sometimes localized to the install "
8655 "language of the guest operating system."
8659 #: ../fish/guestfish-actions.pod:2319 ../src/guestfs-actions.pod:3446
8661 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8662 "to display something can use C<app_name> instead."
8666 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3449
8667 msgid "C<app_epoch>"
8671 #: ../fish/guestfish-actions.pod:2324 ../src/guestfs-actions.pod:3451
8673 "For package managers which use epochs, this contains the epoch of the "
8674 "package (an integer). If unavailable, this is returned as C<0>."
8678 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3454
8679 msgid "C<app_version>"
8683 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3456
8685 "The version string of the application or package. If unavailable this is "
8686 "returned as an empty string C<\"\">."
8690 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3459
8691 msgid "C<app_release>"
8695 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3461
8697 "The release string of the application or package, for package managers that "
8698 "use this. If unavailable this is returned as an empty string C<\"\">."
8702 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3465
8703 msgid "C<app_install_path>"
8707 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3467
8709 "The installation path of the application (on operating systems such as "
8710 "Windows which use installation paths). This path is in the format used by "
8711 "the guest operating system, it is not a libguestfs path."
8715 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3472
8716 msgid "If unavailable this is returned as an empty string C<\"\">."
8720 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3474
8721 msgid "C<app_trans_path>"
8725 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3476
8727 "The install path translated into a libguestfs path. If unavailable this is "
8728 "returned as an empty string C<\"\">."
8732 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3479
8733 msgid "C<app_publisher>"
8737 #: ../fish/guestfish-actions.pod:2354 ../src/guestfs-actions.pod:3481
8739 "The name of the publisher of the application, for package managers that use "
8740 "this. If unavailable this is returned as an empty string C<\"\">."
8744 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3485
8749 #: ../fish/guestfish-actions.pod:2360 ../src/guestfs-actions.pod:3487
8751 "The URL (eg. upstream URL) of the application. If unavailable this is "
8752 "returned as an empty string C<\"\">."
8756 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3490
8757 msgid "C<app_source_package>"
8761 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3492
8763 "For packaging systems which support this, the name of the source package. "
8764 "If unavailable this is returned as an empty string C<\"\">."
8768 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3495
8769 msgid "C<app_summary>"
8773 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3497
8775 "A short (usually one line) description of the application or package. If "
8776 "unavailable this is returned as an empty string C<\"\">."
8780 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3500
8781 msgid "C<app_description>"
8785 #: ../fish/guestfish-actions.pod:2375 ../src/guestfs-actions.pod:3502
8787 "A longer description of the application or package. If unavailable this is "
8788 "returned as an empty string C<\"\">."
8792 #: ../fish/guestfish-actions.pod:2382
8797 #: ../fish/guestfish-actions.pod:2384
8805 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3520
8807 "This function uses other libguestfs functions and certain heuristics to "
8808 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8809 "for operating systems."
8813 #: ../fish/guestfish-actions.pod:2390 ../src/guestfs-actions.pod:3524
8814 msgid "The list returned is empty if no operating systems were found."
8818 #: ../fish/guestfish-actions.pod:2392 ../src/guestfs-actions.pod:3526
8820 "If one operating system was found, then this returns a list with a single "
8821 "element, which is the name of the root filesystem of this operating system. "
8822 "It is also possible for this function to return a list containing more than "
8823 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8824 "element being the root filesystem of one of the operating systems."
8828 #: ../fish/guestfish-actions.pod:2399
8830 "You can pass the root string(s) returned to other L</inspect-get-*> "
8831 "functions in order to query further information about each operating system, "
8832 "such as the name and version."
8836 #: ../fish/guestfish-actions.pod:2404
8838 "This function uses other libguestfs features such as L</mount-ro> and "
8839 "L</umount-all> in order to mount and unmount filesystems and look at the "
8840 "contents. This should be called with no disks currently mounted. The "
8841 "function may also use Augeas, so any existing Augeas handle will be closed."
8845 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3544
8847 "This function cannot decrypt encrypted disks. The caller must do that first "
8848 "(supplying the necessary keys) if the disk is encrypted."
8852 #: ../fish/guestfish-actions.pod:2416 ../fish/guestfish-actions.pod:2614 ../fish/guestfish-actions.pod:2673
8853 msgid "See also L</list-filesystems>."
8857 #: ../fish/guestfish-actions.pod:2418
8862 #: ../fish/guestfish-actions.pod:2420
8865 " is-blockdev path\n"
8870 #: ../fish/guestfish-actions.pod:2422 ../src/guestfs-actions.pod:3564
8872 "This returns C<true> if and only if there is a block device with the given "
8877 #: ../fish/guestfish-actions.pod:2425 ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2462 ../fish/guestfish-actions.pod:2471 ../fish/guestfish-actions.pod:2481 ../fish/guestfish-actions.pod:2515 ../fish/guestfish-actions.pod:2524
8878 msgid "See also L</stat>."
8882 #: ../fish/guestfish-actions.pod:2427
8887 #: ../fish/guestfish-actions.pod:2429
8895 #: ../fish/guestfish-actions.pod:2431 ../src/guestfs-actions.pod:3578
8897 "This returns true iff this handle is busy processing a command (in the "
8902 #: ../fish/guestfish-actions.pod:2436
8907 #: ../fish/guestfish-actions.pod:2438
8910 " is-chardev path\n"
8915 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3593
8917 "This returns C<true> if and only if there is a character device with the "
8918 "given C<path> name."
8922 #: ../fish/guestfish-actions.pod:2445
8927 #: ../fish/guestfish-actions.pod:2447
8935 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3607
8937 "This returns true iff this handle is being configured (in the C<CONFIG> "
8942 #: ../fish/guestfish-actions.pod:2454
8947 #: ../fish/guestfish-actions.pod:2456
8955 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3622
8957 "This returns C<true> if and only if there is a directory with the given "
8958 "C<path> name. Note that it returns false for other objects like files."
8962 #: ../fish/guestfish-actions.pod:2464
8967 #: ../fish/guestfish-actions.pod:2466
8975 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3638
8977 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8978 "given C<path> name."
8982 #: ../fish/guestfish-actions.pod:2473
8987 #: ../fish/guestfish-actions.pod:2475
8995 #: ../fish/guestfish-actions.pod:2477 ../src/guestfs-actions.pod:3653
8997 "This returns C<true> if and only if there is a regular file with the given "
8998 "C<path> name. Note that it returns false for other objects like "
9003 #: ../fish/guestfish-actions.pod:2483
9004 msgid "is-launching"
9008 #: ../fish/guestfish-actions.pod:2485
9016 #: ../fish/guestfish-actions.pod:2487 ../src/guestfs-actions.pod:3668
9018 "This returns true iff this handle is launching the subprocess (in the "
9019 "C<LAUNCHING> state)."
9023 #: ../fish/guestfish-actions.pod:2492
9028 #: ../fish/guestfish-actions.pod:2494
9036 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3683
9038 "This command tests whether C<device> is a logical volume, and returns true "
9039 "iff this is the case."
9043 #: ../fish/guestfish-actions.pod:2499
9048 #: ../fish/guestfish-actions.pod:2501
9056 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3695
9058 "This returns true iff this handle is ready to accept commands (in the "
9063 #: ../fish/guestfish-actions.pod:2508
9068 #: ../fish/guestfish-actions.pod:2510
9076 #: ../fish/guestfish-actions.pod:2512 ../src/guestfs-actions.pod:3710
9078 "This returns C<true> if and only if there is a Unix domain socket with the "
9079 "given C<path> name."
9083 #: ../fish/guestfish-actions.pod:2517
9088 #: ../fish/guestfish-actions.pod:2519
9091 " is-symlink path\n"
9096 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3725
9098 "This returns C<true> if and only if there is a symbolic link with the given "
9103 #: ../fish/guestfish-actions.pod:2526
9108 #: ../fish/guestfish-actions.pod:2528
9116 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3740
9118 "This returns true iff the file exists and the file is empty or it contains "
9123 #: ../fish/guestfish-actions.pod:2533
9124 msgid "is-zero-device"
9128 #: ../fish/guestfish-actions.pod:2535
9131 " is-zero-device device\n"
9136 #: ../fish/guestfish-actions.pod:2537 ../src/guestfs-actions.pod:3753
9137 msgid "This returns true iff the device exists and contains all zero bytes."
9141 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3755
9142 msgid "Note that for large devices this can take a long time to run."
9146 #: ../fish/guestfish-actions.pod:2541
9147 msgid "kill-subprocess"
9151 #: ../fish/guestfish-actions.pod:2543
9154 " kill-subprocess\n"
9159 #: ../fish/guestfish-actions.pod:2545 ../src/guestfs-actions.pod:3766
9160 msgid "This kills the qemu subprocess. You should never need to call this."
9164 #: ../fish/guestfish-actions.pod:2547
9169 #: ../fish/guestfish-actions.pod:2549
9174 #: ../fish/guestfish-actions.pod:2551
9182 #: ../fish/guestfish-actions.pod:2553 ../src/guestfs-actions.pod:3777
9184 "Internally libguestfs is implemented by running a virtual machine using "
9189 #: ../fish/guestfish-actions.pod:2556 ../src/guestfs-actions.pod:3780
9191 "You should call this after configuring the handle (eg. adding drives) but "
9192 "before performing any actions."
9196 #: ../fish/guestfish-actions.pod:2559
9201 #: ../fish/guestfish-actions.pod:2561
9204 " lchown owner group path\n"
9209 #: ../fish/guestfish-actions.pod:2563
9211 "Change the file owner to C<owner> and group to C<group>. This is like "
9212 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
9217 #: ../fish/guestfish-actions.pod:2571
9222 #: ../fish/guestfish-actions.pod:2573
9225 " lgetxattr path name\n"
9230 #: ../fish/guestfish-actions.pod:2575 ../src/guestfs-actions.pod:3820
9232 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
9233 "is a symlink, then this call returns an extended attribute from the symlink."
9237 #: ../fish/guestfish-actions.pod:2589
9238 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
9242 #: ../fish/guestfish-actions.pod:2591
9247 #: ../fish/guestfish-actions.pod:2593
9250 " lgetxattrs path\n"
9255 #: ../fish/guestfish-actions.pod:2595
9257 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
9258 "it returns the extended attributes of the link itself."
9262 #: ../fish/guestfish-actions.pod:2599
9267 #: ../fish/guestfish-actions.pod:2601
9275 #: ../fish/guestfish-actions.pod:2603 ../src/guestfs-actions.pod:3863
9277 "List all 9p filesystems attached to the guest. A list of mount tags is "
9282 #: ../fish/guestfish-actions.pod:2606
9283 msgid "list-devices"
9287 #: ../fish/guestfish-actions.pod:2608
9295 #: ../fish/guestfish-actions.pod:2610 ../src/guestfs-actions.pod:3877
9296 msgid "List all the block devices."
9300 #: ../fish/guestfish-actions.pod:2612 ../src/guestfs-actions.pod:3879
9301 msgid "The full block device names are returned, eg. C</dev/sda>."
9305 #: ../fish/guestfish-actions.pod:2616
9306 msgid "list-dm-devices"
9310 #: ../fish/guestfish-actions.pod:2618
9313 " list-dm-devices\n"
9318 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:3894
9319 msgid "List all device mapper devices."
9323 #: ../fish/guestfish-actions.pod:2622
9325 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
9326 "previous call to L</luks-open>."
9330 #: ../fish/guestfish-actions.pod:2625
9332 "Device mapper devices which correspond to logical volumes are I<not> "
9333 "returned in this list. Call L</lvs> if you want to list logical volumes."
9337 #: ../fish/guestfish-actions.pod:2629
9338 msgid "list-filesystems"
9342 #: ../fish/guestfish-actions.pod:2631
9345 " list-filesystems\n"
9350 #: ../fish/guestfish-actions.pod:2633 ../src/guestfs-actions.pod:3914
9352 "This inspection command looks for filesystems on partitions, block devices "
9353 "and logical volumes, returning a list of devices containing filesystems and "
9358 #: ../fish/guestfish-actions.pod:2637 ../src/guestfs-actions.pod:3918
9360 "The return value is a hash, where the keys are the devices containing "
9361 "filesystems, and the values are the filesystem types. For example:"
9365 #: ../fish/guestfish-actions.pod:2641 ../src/guestfs-actions.pod:3922
9368 " \"/dev/sda1\" => \"ntfs\"\n"
9369 " \"/dev/sda2\" => \"ext2\"\n"
9370 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9371 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9376 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:3927
9378 "The value can have the special value \"unknown\", meaning the content of the "
9379 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9383 #: ../fish/guestfish-actions.pod:2650
9385 "This command runs other libguestfs commands, which might include L</mount> "
9386 "and L</umount>, and therefore you should use this soon after launch and only "
9387 "when nothing is mounted."
9391 #: ../fish/guestfish-actions.pod:2654
9393 "Not all of the filesystems returned will be mountable. In particular, swap "
9394 "partitions are returned in the list. Also this command does not check that "
9395 "each filesystem found is valid and mountable, and some filesystems might be "
9396 "mountable but require special options. Filesystems may not all belong to a "
9397 "single logical operating system (use L</inspect-os> to look for OSes)."
9401 #: ../fish/guestfish-actions.pod:2662
9402 msgid "list-partitions"
9406 #: ../fish/guestfish-actions.pod:2664
9409 " list-partitions\n"
9414 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:3956
9415 msgid "List all the partitions detected on all block devices."
9419 #: ../fish/guestfish-actions.pod:2668 ../src/guestfs-actions.pod:3958
9420 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9424 #: ../fish/guestfish-actions.pod:2670
9426 "This does not return logical volumes. For that you will need to call "
9431 #: ../fish/guestfish-actions.pod:2675
9436 #: ../fish/guestfish-actions.pod:2677
9444 #: ../fish/guestfish-actions.pod:2679 ../src/guestfs-actions.pod:3977
9446 "List the files in C<directory> (relative to the root directory, there is no "
9447 "cwd) in the format of 'ls -la'."
9451 #: ../fish/guestfish-actions.pod:2682 ../src/guestfs-actions.pod:3980
9453 "This command is mostly useful for interactive sessions. It is I<not> "
9454 "intended that you try to parse the output string."
9458 #: ../fish/guestfish-actions.pod:2685
9463 #: ../fish/guestfish-actions.pod:2687
9466 " ln target linkname\n"
9471 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:3995
9472 msgid "This command creates a hard link using the C<ln> command."
9476 #: ../fish/guestfish-actions.pod:2691
9481 #: ../fish/guestfish-actions.pod:2693
9484 " ln-f target linkname\n"
9489 #: ../fish/guestfish-actions.pod:2695 ../src/guestfs-actions.pod:4008
9491 "This command creates a hard link using the C<ln -f> command. The I<-f> "
9492 "option removes the link (C<linkname>) if it exists already."
9496 #: ../fish/guestfish-actions.pod:2698
9501 #: ../fish/guestfish-actions.pod:2700
9504 " ln-s target linkname\n"
9509 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4022
9510 msgid "This command creates a symbolic link using the C<ln -s> command."
9514 #: ../fish/guestfish-actions.pod:2704
9519 #: ../fish/guestfish-actions.pod:2706
9522 " ln-sf target linkname\n"
9527 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4035
9529 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
9530 "option removes the link (C<linkname>) if it exists already."
9534 #: ../fish/guestfish-actions.pod:2711
9535 msgid "lremovexattr"
9539 #: ../fish/guestfish-actions.pod:2713
9542 " lremovexattr xattr path\n"
9547 #: ../fish/guestfish-actions.pod:2715
9549 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
9550 "it removes an extended attribute of the link itself."
9554 #: ../fish/guestfish-actions.pod:2719
9559 #: ../fish/guestfish-actions.pod:2721
9567 #: ../fish/guestfish-actions.pod:2723 ../src/guestfs-actions.pod:4063
9569 "List the files in C<directory> (relative to the root directory, there is no "
9570 "cwd). The '.' and '..' entries are not returned, but hidden files are "
9575 #: ../fish/guestfish-actions.pod:2727
9577 "This command is mostly useful for interactive sessions. Programs should "
9578 "probably use L</readdir> instead."
9582 #: ../fish/guestfish-actions.pod:2730
9587 #: ../fish/guestfish-actions.pod:2732
9590 " lsetxattr xattr val vallen path\n"
9595 #: ../fish/guestfish-actions.pod:2734
9597 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
9598 "sets an extended attribute of the link itself."
9602 #: ../fish/guestfish-actions.pod:2738
9607 #: ../fish/guestfish-actions.pod:2740
9615 #: ../fish/guestfish-actions.pod:2742 ../fish/guestfish-actions.pod:4562 ../src/guestfs-actions.pod:4099 ../src/guestfs-actions.pod:6892
9616 msgid "Returns file information for the given C<path>."
9620 #: ../fish/guestfish-actions.pod:2744
9622 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
9623 "the link is stat-ed, not the file it refers to."
9627 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4105
9628 msgid "This is the same as the C<lstat(2)> system call."
9632 #: ../fish/guestfish-actions.pod:2750
9637 #: ../fish/guestfish-actions.pod:2752
9640 " lstatlist path 'names ...'\n"
9645 #: ../fish/guestfish-actions.pod:2754
9647 "This call allows you to perform the L</lstat> operation on multiple files, "
9648 "where all files are in the directory C<path>. C<names> is the list of files "
9649 "from this directory."
9653 #: ../fish/guestfish-actions.pod:2758 ../src/guestfs-actions.pod:4124
9655 "On return you get a list of stat structs, with a one-to-one correspondence "
9656 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9657 "then the C<ino> field of that structure is set to C<-1>."
9661 #: ../fish/guestfish-actions.pod:2763
9663 "This call is intended for programs that want to efficiently list a directory "
9664 "contents without making many round-trips. See also L</lxattrlist> for a "
9665 "similarly efficient call for getting extended attributes. Very long "
9666 "directory listings might cause the protocol message size to be exceeded, "
9667 "causing this call to fail. The caller must split up such requests into "
9668 "smaller groups of names."
9672 #: ../fish/guestfish-actions.pod:2771
9673 msgid "luks-add-key"
9677 #: ../fish/guestfish-actions.pod:2773
9680 " luks-add-key device keyslot\n"
9685 #: ../fish/guestfish-actions.pod:2775 ../src/guestfs-actions.pod:4152
9687 "This command adds a new key on LUKS device C<device>. C<key> is any "
9688 "existing key, and is used to access the device. C<newkey> is the new key to "
9689 "add. C<keyslot> is the key slot that will be replaced."
9693 #: ../fish/guestfish-actions.pod:2780
9695 "Note that if C<keyslot> already contains a key, then this command will "
9696 "fail. You have to use L</luks-kill-slot> first to remove that key."
9700 #: ../fish/guestfish-actions.pod:2784 ../fish/guestfish-actions.pod:2806 ../fish/guestfish-actions.pod:2819 ../fish/guestfish-actions.pod:2833 ../fish/guestfish-actions.pod:2859 ../fish/guestfish-actions.pod:2869
9702 "This command has one or more key or passphrase parameters. Guestfish will "
9703 "prompt for these separately."
9707 #: ../fish/guestfish-actions.pod:2787
9712 #: ../fish/guestfish-actions.pod:2789
9715 " luks-close device\n"
9720 #: ../fish/guestfish-actions.pod:2791
9722 "This closes a LUKS device that was created earlier by L</luks-open> or "
9723 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
9724 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9725 "underlying block device."
9729 #: ../fish/guestfish-actions.pod:2797
9734 #: ../fish/guestfish-actions.pod:2799
9737 " luks-format device keyslot\n"
9742 #: ../fish/guestfish-actions.pod:2801 ../src/guestfs-actions.pod:4193
9744 "This command erases existing data on C<device> and formats the device as a "
9745 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9746 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9750 #: ../fish/guestfish-actions.pod:2809 ../fish/guestfish-actions.pod:2822 ../fish/guestfish-actions.pod:2909 ../fish/guestfish-actions.pod:3570 ../fish/guestfish-actions.pod:4096 ../fish/guestfish-actions.pod:4433 ../fish/guestfish-actions.pod:4456 ../fish/guestfish-actions.pod:4478 ../fish/guestfish-actions.pod:5224 ../src/guestfs-actions.pod:4200 ../src/guestfs-actions.pod:4223 ../src/guestfs-actions.pod:4366 ../src/guestfs-actions.pod:5469 ../src/guestfs-actions.pod:6257 ../src/guestfs-actions.pod:6706 ../src/guestfs-actions.pod:6736 ../src/guestfs-actions.pod:6769 ../src/guestfs-actions.pod:7968
9752 "B<This command is dangerous. Without careful use you can easily destroy all "
9757 #: ../fish/guestfish-actions.pod:2812
9758 msgid "luks-format-cipher"
9762 #: ../fish/guestfish-actions.pod:2814
9765 " luks-format-cipher device keyslot cipher\n"
9770 #: ../fish/guestfish-actions.pod:2816
9772 "This command is the same as L</luks-format> but it also allows you to set "
9773 "the C<cipher> used."
9777 #: ../fish/guestfish-actions.pod:2825
9778 msgid "luks-kill-slot"
9782 #: ../fish/guestfish-actions.pod:2827
9785 " luks-kill-slot device keyslot\n"
9790 #: ../fish/guestfish-actions.pod:2829 ../src/guestfs-actions.pod:4240
9792 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9793 "device C<device>. C<key> must be one of the I<other> keys."
9797 #: ../fish/guestfish-actions.pod:2836
9802 #: ../fish/guestfish-actions.pod:2838
9805 " luks-open device mapname\n"
9810 #: ../fish/guestfish-actions.pod:2840 ../src/guestfs-actions.pod:4260
9812 "This command opens a block device which has been encrypted according to the "
9813 "Linux Unified Key Setup (LUKS) standard."
9817 #: ../fish/guestfish-actions.pod:2843 ../src/guestfs-actions.pod:4263
9818 msgid "C<device> is the encrypted block device or partition."
9822 #: ../fish/guestfish-actions.pod:2845 ../src/guestfs-actions.pod:4265
9824 "The caller must supply one of the keys associated with the LUKS block "
9825 "device, in the C<key> parameter."
9829 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4268
9831 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9832 "writes to this block device are decrypted from and encrypted to the "
9833 "underlying C<device> respectively."
9837 #: ../fish/guestfish-actions.pod:2852
9839 "If this block device contains LVM volume groups, then calling L</vgscan> "
9840 "followed by L</vg-activate-all> will make them visible."
9844 #: ../fish/guestfish-actions.pod:2856
9845 msgid "Use L</list-dm-devices> to list all device mapper devices."
9849 #: ../fish/guestfish-actions.pod:2862
9850 msgid "luks-open-ro"
9854 #: ../fish/guestfish-actions.pod:2864
9857 " luks-open-ro device mapname\n"
9862 #: ../fish/guestfish-actions.pod:2866
9864 "This is the same as L</luks-open> except that a read-only mapping is "
9869 #: ../fish/guestfish-actions.pod:2872
9874 #: ../fish/guestfish-actions.pod:2874
9877 " lvcreate logvol volgroup mbytes\n"
9882 #: ../fish/guestfish-actions.pod:2876 ../src/guestfs-actions.pod:4314
9884 "This creates an LVM logical volume called C<logvol> on the volume group "
9885 "C<volgroup>, with C<size> megabytes."
9889 #: ../fish/guestfish-actions.pod:2879
9890 msgid "lvm-canonical-lv-name"
9894 #: ../fish/guestfish-actions.pod:2881
9897 " lvm-canonical-lv-name lvname\n"
9902 #: ../fish/guestfish-actions.pod:2883 ../src/guestfs-actions.pod:4327
9904 "This converts alternative naming schemes for LVs that you might find to the "
9905 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
9910 #: ../fish/guestfish-actions.pod:2887 ../src/guestfs-actions.pod:4331
9912 "This command returns an error if the C<lvname> parameter does not refer to a "
9917 #: ../fish/guestfish-actions.pod:2890
9918 msgid "See also L</is-lv>."
9922 #: ../fish/guestfish-actions.pod:2892
9923 msgid "lvm-clear-filter"
9927 #: ../fish/guestfish-actions.pod:2894
9930 " lvm-clear-filter\n"
9935 #: ../fish/guestfish-actions.pod:2896
9937 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
9942 #: ../fish/guestfish-actions.pod:2899 ../fish/guestfish-actions.pod:2930 ../src/guestfs-actions.pod:4349 ../src/guestfs-actions.pod:4391
9943 msgid "This command also clears the LVM cache and performs a volume group scan."
9947 #: ../fish/guestfish-actions.pod:2902
9948 msgid "lvm-remove-all"
9952 #: ../fish/guestfish-actions.pod:2904
9960 #: ../fish/guestfish-actions.pod:2906 ../src/guestfs-actions.pod:4361
9962 "This command removes all LVM logical volumes, volume groups and physical "
9967 #: ../fish/guestfish-actions.pod:2912
9968 msgid "lvm-set-filter"
9972 #: ../fish/guestfish-actions.pod:2914
9975 " lvm-set-filter 'devices ...'\n"
9980 #: ../fish/guestfish-actions.pod:2916 ../src/guestfs-actions.pod:4377
9982 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9983 "block devices in the list C<devices>, and will ignore all other attached "
9988 #: ../fish/guestfish-actions.pod:2920 ../src/guestfs-actions.pod:4381
9990 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9991 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9992 "there are two types of duplication possible: either cloned PVs/VGs which "
9993 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9994 "same name. In normal operation you cannot create this situation, but you "
9995 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9996 "inside the LVM metadata."
10000 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4394
10001 msgid "You can filter whole block devices or individual partitions."
10005 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4396
10007 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10008 "filesystem), even if you are not filtering out that VG."
10012 #: ../fish/guestfish-actions.pod:2939
10017 #: ../fish/guestfish-actions.pod:2941
10020 " lvremove device\n"
10025 #: ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4410
10027 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10028 "LV, such as C</dev/VG/LV>."
10032 #: ../fish/guestfish-actions.pod:2946 ../src/guestfs-actions.pod:4413
10034 "You can also remove all LVs in a volume group by specifying the VG name, "
10039 #: ../fish/guestfish-actions.pod:2949
10044 #: ../fish/guestfish-actions.pod:2951
10047 " lvrename logvol newlogvol\n"
10052 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4427
10053 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10057 #: ../fish/guestfish-actions.pod:2955
10062 #: ../fish/guestfish-actions.pod:2957
10065 " lvresize device mbytes\n"
10070 #: ../fish/guestfish-actions.pod:2959 ../src/guestfs-actions.pod:4440
10072 "This resizes (expands or shrinks) an existing LVM logical volume to "
10073 "C<mbytes>. When reducing, data in the reduced part is lost."
10077 #: ../fish/guestfish-actions.pod:2963
10078 msgid "lvresize-free"
10082 #: ../fish/guestfish-actions.pod:2965
10085 " lvresize-free lv percent\n"
10090 #: ../fish/guestfish-actions.pod:2967 ../src/guestfs-actions.pod:4455
10092 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10093 "remaining free space in the volume group. Commonly you would call this with "
10094 "pc = 100 which expands the logical volume as much as possible, using all "
10095 "remaining free space in the volume group."
10099 #: ../fish/guestfish-actions.pod:2973
10104 #: ../fish/guestfish-actions.pod:2975
10112 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4470
10114 "List all the logical volumes detected. This is the equivalent of the "
10115 "L<lvs(8)> command."
10119 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4473
10121 "This returns a list of the logical volume device names "
10122 "(eg. C</dev/VolGroup00/LogVol00>)."
10126 #: ../fish/guestfish-actions.pod:2983
10127 msgid "See also L</lvs-full>, L</list-filesystems>."
10131 #: ../fish/guestfish-actions.pod:2985
10136 #: ../fish/guestfish-actions.pod:2987
10144 #: ../fish/guestfish-actions.pod:2989 ../src/guestfs-actions.pod:4489
10146 "List all the logical volumes detected. This is the equivalent of the "
10147 "L<lvs(8)> command. The \"full\" version includes all fields."
10151 #: ../fish/guestfish-actions.pod:2992
10156 #: ../fish/guestfish-actions.pod:2994
10164 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4504
10165 msgid "This command returns the UUID of the LVM LV C<device>."
10169 #: ../fish/guestfish-actions.pod:2998
10174 #: ../fish/guestfish-actions.pod:3000
10177 " lxattrlist path 'names ...'\n"
10182 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4518
10184 "This call allows you to get the extended attributes of multiple files, where "
10185 "all files are in the directory C<path>. C<names> is the list of files from "
10190 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4522
10192 "On return you get a flat list of xattr structs which must be interpreted "
10193 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10194 "C<attrval> in this struct is zero-length to indicate there was an error "
10195 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10196 "number (the number of following attributes for this file, which could be "
10197 "C<\"0\">). Then after the first xattr struct are the zero or more "
10198 "attributes for the first named file. This repeats for the second and "
10199 "subsequent files."
10203 #: ../fish/guestfish-actions.pod:3016
10205 "This call is intended for programs that want to efficiently list a directory "
10206 "contents without making many round-trips. See also L</lstatlist> for a "
10207 "similarly efficient call for getting standard stats. Very long directory "
10208 "listings might cause the protocol message size to be exceeded, causing this "
10209 "call to fail. The caller must split up such requests into smaller groups of "
10214 #: ../fish/guestfish-actions.pod:3024
10219 #: ../fish/guestfish-actions.pod:3026
10227 #: ../fish/guestfish-actions.pod:3028 ../src/guestfs-actions.pod:4552
10228 msgid "Create a directory named C<path>."
10232 #: ../fish/guestfish-actions.pod:3030
10237 #: ../fish/guestfish-actions.pod:3032
10240 " mkdir-mode path mode\n"
10245 #: ../fish/guestfish-actions.pod:3034 ../src/guestfs-actions.pod:4565
10247 "This command creates a directory, setting the initial permissions of the "
10248 "directory to C<mode>."
10252 #: ../fish/guestfish-actions.pod:3037 ../src/guestfs-actions.pod:4568
10254 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10255 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10260 #: ../fish/guestfish-actions.pod:3041
10261 msgid "See also L</mkdir>, L</umask>"
10265 #: ../fish/guestfish-actions.pod:3043
10270 #: ../fish/guestfish-actions.pod:3045
10278 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4584
10280 "Create a directory named C<path>, creating any parent directories as "
10281 "necessary. This is like the C<mkdir -p> shell command."
10285 #: ../fish/guestfish-actions.pod:3050
10290 #: ../fish/guestfish-actions.pod:3052
10293 " mkdtemp template\n"
10298 #: ../fish/guestfish-actions.pod:3054 ../src/guestfs-actions.pod:4597
10300 "This command creates a temporary directory. The C<template> parameter "
10301 "should be a full pathname for the temporary directory name with the final "
10302 "six characters being \"XXXXXX\"."
10306 #: ../fish/guestfish-actions.pod:3059 ../src/guestfs-actions.pod:4602
10308 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10309 "being suitable for Windows filesystems."
10313 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4605
10314 msgid "The name of the temporary directory that was created is returned."
10318 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4608
10319 msgid "The temporary directory is created with mode 0700 and is owned by root."
10323 #: ../fish/guestfish-actions.pod:3068 ../src/guestfs-actions.pod:4611
10325 "The caller is responsible for deleting the temporary directory and its "
10326 "contents after use."
10330 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4614
10331 msgid "See also: L<mkdtemp(3)>"
10335 #: ../fish/guestfish-actions.pod:3073
10340 #: ../fish/guestfish-actions.pod:3075
10343 " mke2fs-J fstype blocksize device journal\n"
10348 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4630
10350 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10351 "C<journal>. It is equivalent to the command:"
10355 #: ../fish/guestfish-actions.pod:3081 ../src/guestfs-actions.pod:4634
10358 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10363 #: ../fish/guestfish-actions.pod:3083
10364 msgid "See also L</mke2journal>."
10368 #: ../fish/guestfish-actions.pod:3085
10373 #: ../fish/guestfish-actions.pod:3087
10376 " mke2fs-JL fstype blocksize device label\n"
10381 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4651
10383 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10384 "the journal labeled C<label>."
10388 #: ../fish/guestfish-actions.pod:3092
10389 msgid "See also L</mke2journal-L>."
10393 #: ../fish/guestfish-actions.pod:3094
10398 #: ../fish/guestfish-actions.pod:3096
10401 " mke2fs-JU fstype blocksize device uuid\n"
10406 #: ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4669
10408 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10409 "the journal with UUID C<uuid>."
10413 #: ../fish/guestfish-actions.pod:3101
10414 msgid "See also L</mke2journal-U>."
10418 #: ../fish/guestfish-actions.pod:3103
10419 msgid "mke2journal"
10423 #: ../fish/guestfish-actions.pod:3105
10426 " mke2journal blocksize device\n"
10431 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4685
10433 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10438 #: ../fish/guestfish-actions.pod:3110 ../src/guestfs-actions.pod:4688
10441 " mke2fs -O journal_dev -b blocksize device\n"
10446 #: ../fish/guestfish-actions.pod:3112
10447 msgid "mke2journal-L"
10451 #: ../fish/guestfish-actions.pod:3114
10454 " mke2journal-L blocksize label device\n"
10459 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4702
10460 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10464 #: ../fish/guestfish-actions.pod:3118
10465 msgid "mke2journal-U"
10469 #: ../fish/guestfish-actions.pod:3120
10472 " mke2journal-U blocksize uuid device\n"
10477 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4716
10478 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10482 #: ../fish/guestfish-actions.pod:3124
10487 #: ../fish/guestfish-actions.pod:3126
10490 " mkfifo mode path\n"
10495 #: ../fish/guestfish-actions.pod:3128
10497 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10498 "is just a convenient wrapper around L</mknod>."
10502 #: ../fish/guestfish-actions.pod:3134
10507 #: ../fish/guestfish-actions.pod:3136
10510 " mkfs fstype device\n"
10515 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4746
10517 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10518 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10522 #: ../fish/guestfish-actions.pod:3142
10527 #: ../fish/guestfish-actions.pod:3144
10530 " mkfs-b fstype blocksize device\n"
10535 #: ../fish/guestfish-actions.pod:3146
10537 "This call is similar to L</mkfs>, but it allows you to control the block "
10538 "size of the resulting filesystem. Supported block sizes depend on the "
10539 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10543 #: ../fish/guestfish-actions.pod:3151 ../fish/guestfish-actions.pod:3178 ../src/guestfs-actions.pod:4774 ../src/guestfs-actions.pod:4812
10545 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10550 #: ../fish/guestfish-actions.pod:3154
10552 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
10557 #: ../fish/guestfish-actions.pod:3161
10562 #: ../fish/guestfish-actions.pod:3163
10565 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
10566 "[sectorsize:..]\n"
10571 #: ../fish/guestfish-actions.pod:3165 ../src/guestfs-actions.pod:4799
10573 "This function creates a filesystem on C<device>. The filesystem type is "
10574 "C<fstype>, for example C<ext3>."
10578 #: ../fish/guestfish-actions.pod:3172 ../src/guestfs-actions.pod:4806
10579 msgid "C<blocksize>"
10583 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4808
10585 "The filesystem block size. Supported block sizes depend on the filesystem "
10586 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
10591 #: ../fish/guestfish-actions.pod:3181 ../src/guestfs-actions.pod:4815
10592 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
10596 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4817
10597 msgid "C<features>"
10601 #: ../fish/guestfish-actions.pod:3185 ../src/guestfs-actions.pod:4819
10602 msgid "This passes the I<-O> parameter to the external mkfs program."
10606 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4821
10608 "For certain filesystem types, this allows extra filesystem features to be "
10609 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
10613 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4825
10615 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
10620 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4828
10625 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4830
10627 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
10628 "sets the inode size (only for ext2/3/4 filesystems at present)."
10632 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4833
10633 msgid "C<sectorsize>"
10637 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4835
10639 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
10640 "sets sector size for ufs filesystem."
10644 #: ../fish/guestfish-actions.pod:3208
10645 msgid "mkmountpoint"
10649 #: ../fish/guestfish-actions.pod:3210
10652 " mkmountpoint exemptpath\n"
10657 #: ../fish/guestfish-actions.pod:3212
10659 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
10660 "to create extra mountpoints before mounting the first filesystem."
10664 #: ../fish/guestfish-actions.pod:3216 ../src/guestfs-actions.pod:4878
10666 "These calls are I<only> necessary in some very limited circumstances, mainly "
10667 "the case where you want to mount a mix of unrelated and/or read-only "
10668 "filesystems together."
10672 #: ../fish/guestfish-actions.pod:3220 ../src/guestfs-actions.pod:4882
10674 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10675 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10676 "inside that. You can unpack this as follows in guestfish:"
10680 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4887
10683 " add-ro Fedora-11-i686-Live.iso\n"
10685 " mkmountpoint /cd\n"
10686 " mkmountpoint /sqsh\n"
10687 " mkmountpoint /ext3fs\n"
10688 " mount /dev/sda /cd\n"
10689 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10690 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10695 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4896
10696 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10700 #: ../fish/guestfish-actions.pod:3236
10702 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
10703 "unexpected errors if you try to mix these calls. It is safest to manually "
10704 "unmount filesystems and remove mountpoints after use."
10708 #: ../fish/guestfish-actions.pod:3240
10710 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
10711 "for this to work for manual mountpoints, you must ensure that the innermost "
10712 "mountpoints have the longest pathnames, as in the example code above."
10716 #: ../fish/guestfish-actions.pod:3245 ../src/guestfs-actions.pod:4907
10717 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10721 #: ../fish/guestfish-actions.pod:3247
10723 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
10724 "L</umount-all> to be called when the handle is closed which can also trigger "
10729 #: ../fish/guestfish-actions.pod:3251
10734 #: ../fish/guestfish-actions.pod:3253
10737 " mknod mode devmajor devminor path\n"
10742 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:4926
10744 "This call creates block or character special devices, or named pipes "
10749 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4929
10751 "The C<mode> parameter should be the mode, using the standard constants. "
10752 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10753 "used when creating block and character special devices."
10757 #: ../fish/guestfish-actions.pod:3263
10759 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10760 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10761 "regular file). These constants are available in the standard Linux header "
10762 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
10763 "wrappers around this command which bitwise OR in the appropriate constant "
10768 #: ../fish/guestfish-actions.pod:3273
10773 #: ../fish/guestfish-actions.pod:3275
10776 " mknod-b mode devmajor devminor path\n"
10781 #: ../fish/guestfish-actions.pod:3277
10783 "This call creates a block device node called C<path> with mode C<mode> and "
10784 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10785 "wrapper around L</mknod>."
10789 #: ../fish/guestfish-actions.pod:3283
10794 #: ../fish/guestfish-actions.pod:3285
10797 " mknod-c mode devmajor devminor path\n"
10802 #: ../fish/guestfish-actions.pod:3287
10804 "This call creates a char device node called C<path> with mode C<mode> and "
10805 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10806 "wrapper around L</mknod>."
10810 #: ../fish/guestfish-actions.pod:3293
10815 #: ../fish/guestfish-actions.pod:3295
10823 #: ../fish/guestfish-actions.pod:3297 ../src/guestfs-actions.pod:4992
10824 msgid "Create a swap partition on C<device>."
10828 #: ../fish/guestfish-actions.pod:3299
10833 #: ../fish/guestfish-actions.pod:3301
10836 " mkswap-L label device\n"
10841 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:5005
10842 msgid "Create a swap partition on C<device> with label C<label>."
10846 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:5007
10848 "Note that you cannot attach a swap label to a block device "
10849 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
10850 "the kernel or swap tools."
10854 #: ../fish/guestfish-actions.pod:3309
10859 #: ../fish/guestfish-actions.pod:3311
10862 " mkswap-U uuid device\n"
10867 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5022
10868 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10872 #: ../fish/guestfish-actions.pod:3315
10873 msgid "mkswap-file"
10877 #: ../fish/guestfish-actions.pod:3317
10880 " mkswap-file path\n"
10885 #: ../fish/guestfish-actions.pod:3319 ../src/guestfs-actions.pod:5034
10886 msgid "Create a swap file."
10890 #: ../fish/guestfish-actions.pod:3321
10892 "This command just writes a swap file signature to an existing file. To "
10893 "create the file itself, use something like L</fallocate>."
10897 #: ../fish/guestfish-actions.pod:3324
10902 #: ../fish/guestfish-actions.pod:3326
10905 " modprobe modulename\n"
10910 #: ../fish/guestfish-actions.pod:3328 ../src/guestfs-actions.pod:5049
10911 msgid "This loads a kernel module in the appliance."
10915 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5051
10917 "The kernel module must have been whitelisted when libguestfs was built (see "
10918 "C<appliance/kmod.whitelist.in> in the source)."
10922 #: ../fish/guestfish-actions.pod:3333
10927 #: ../fish/guestfish-actions.pod:3335
10930 " mount device mountpoint\n"
10935 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5072
10937 "Mount a guest disk at a position in the filesystem. Block devices are named "
10938 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10939 "those block devices contain partitions, they will have the usual names "
10940 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10944 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5078
10946 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10947 "mounted on C</> before others can be mounted. Other filesystems can only be "
10948 "mounted on directories which already exist."
10952 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5083
10954 "The mounted filesystem is writable, if we have sufficient permissions on the "
10955 "underlying device."
10959 #: ../fish/guestfish-actions.pod:3351
10961 "B<Important note:> When you use this call, the filesystem options C<sync> "
10962 "and C<noatime> are set implicitly. This was originally done because we "
10963 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10964 "very large negative performance impact and negligible effect on "
10965 "reliability. Therefore we recommend that you avoid using L</mount> in any "
10966 "code that needs performance, and instead use L</mount-options> (use an empty "
10967 "string for the first parameter if you don't want any options)."
10971 #: ../fish/guestfish-actions.pod:3361
10973 "I<This function is deprecated.> In new code, use the L</mount_options> call "
10978 #: ../fish/guestfish-actions.pod:3368
10983 #: ../fish/guestfish-actions.pod:3370
10986 " mount-9p mounttag mountpoint [options:..]\n"
10991 #: ../fish/guestfish-actions.pod:3372 ../src/guestfs-actions.pod:5115
10993 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
10998 #: ../fish/guestfish-actions.pod:3375 ../src/guestfs-actions.pod:5118
11000 "If required, C<trans=virtio> will be automatically added to the options. "
11001 "Any other options required can be passed in the optional C<options> "
11006 #: ../fish/guestfish-actions.pod:3381
11011 #: ../fish/guestfish-actions.pod:3383
11014 " mount-loop file mountpoint\n"
11019 #: ../fish/guestfish-actions.pod:3385 ../src/guestfs-actions.pod:5157
11021 "This command lets you mount C<file> (a filesystem image in a file) on a "
11022 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11027 #: ../fish/guestfish-actions.pod:3389
11028 msgid "mount-options"
11032 #: ../fish/guestfish-actions.pod:3391
11035 " mount-options options device mountpoint\n"
11040 #: ../fish/guestfish-actions.pod:3393
11042 "This is the same as the L</mount> command, but it allows you to set the "
11043 "mount options as for the L<mount(8)> I<-o> flag."
11047 #: ../fish/guestfish-actions.pod:3397 ../src/guestfs-actions.pod:5177
11049 "If the C<options> parameter is an empty string, then no options are passed "
11050 "(all options default to whatever the filesystem uses)."
11054 #: ../fish/guestfish-actions.pod:3401
11059 #: ../fish/guestfish-actions.pod:3403
11062 " mount-ro device mountpoint\n"
11067 #: ../fish/guestfish-actions.pod:3405
11069 "This is the same as the L</mount> command, but it mounts the filesystem with "
11070 "the read-only (I<-o ro>) flag."
11074 #: ../fish/guestfish-actions.pod:3408
11079 #: ../fish/guestfish-actions.pod:3410
11082 " mount-vfs options vfstype device mountpoint\n"
11087 #: ../fish/guestfish-actions.pod:3412
11089 "This is the same as the L</mount> command, but it allows you to set both the "
11090 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
11094 #: ../fish/guestfish-actions.pod:3416
11095 msgid "mountpoints"
11099 #: ../fish/guestfish-actions.pod:3418
11107 #: ../fish/guestfish-actions.pod:3420
11109 "This call is similar to L</mounts>. That call returns a list of devices. "
11110 "This one returns a hash table (map) of device name to directory where the "
11111 "device is mounted."
11115 #: ../fish/guestfish-actions.pod:3424
11120 #: ../fish/guestfish-actions.pod:3426
11128 #: ../fish/guestfish-actions.pod:3428 ../src/guestfs-actions.pod:5238
11130 "This returns the list of currently mounted filesystems. It returns the list "
11131 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11135 #: ../fish/guestfish-actions.pod:3431 ../src/guestfs-actions.pod:5241
11136 msgid "Some internal mounts are not shown."
11140 #: ../fish/guestfish-actions.pod:3433
11141 msgid "See also: L</mountpoints>"
11145 #: ../fish/guestfish-actions.pod:3435
11150 #: ../fish/guestfish-actions.pod:3437
11158 #: ../fish/guestfish-actions.pod:3439 ../src/guestfs-actions.pod:5258
11160 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11161 "destination filename or destination directory."
11165 #: ../fish/guestfish-actions.pod:3442
11166 msgid "ntfs-3g-probe"
11170 #: ../fish/guestfish-actions.pod:3444
11173 " ntfs-3g-probe true|false device\n"
11178 #: ../fish/guestfish-actions.pod:3446 ../src/guestfs-actions.pod:5272
11180 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11181 "C<device> for mountability. (Not all NTFS volumes can be mounted "
11182 "read-write, and some cannot be mounted at all)."
11186 #: ../fish/guestfish-actions.pod:3450 ../src/guestfs-actions.pod:5276
11188 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11189 "can be mounted read-write. Set it to false if you want to test if the "
11190 "volume can be mounted read-only."
11194 #: ../fish/guestfish-actions.pod:3454 ../src/guestfs-actions.pod:5280
11196 "The return value is an integer which C<0> if the operation would succeed, or "
11197 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11201 #: ../fish/guestfish-actions.pod:3458
11206 #: ../fish/guestfish-actions.pod:3460
11209 " ntfsresize device\n"
11214 #: ../fish/guestfish-actions.pod:3462 ../fish/guestfish-actions.pod:3486 ../src/guestfs-actions.pod:5301 ../src/guestfs-actions.pod:5333
11216 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11217 "size of the underlying device."
11221 #: ../fish/guestfish-actions.pod:3465 ../src/guestfs-actions.pod:5304
11223 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
11224 "consistency check (for safety). You have to boot into Windows to perform "
11225 "this check and clear this condition. Furthermore, ntfsresize refuses to "
11226 "resize filesystems which have been marked in this way. So in effect it is "
11227 "not possible to call ntfsresize multiple times on a single filesystem "
11228 "without booting into Windows between each resize."
11232 #: ../fish/guestfish-actions.pod:3473 ../fish/guestfish-actions.pod:3512 ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5359
11233 msgid "See also L<ntfsresize(8)>."
11237 #: ../fish/guestfish-actions.pod:3475 ../fish/guestfish-actions.pod:3523
11239 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
11244 #: ../fish/guestfish-actions.pod:3482
11245 msgid "ntfsresize-opts"
11249 #: ../fish/guestfish-actions.pod:3484
11252 " ntfsresize-opts device [size:..] [force:..]\n"
11257 #: ../fish/guestfish-actions.pod:3495 ../src/guestfs-actions.pod:5342
11259 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
11260 "resized to fit the container (eg. partition)."
11264 #: ../fish/guestfish-actions.pod:3498 ../src/guestfs-actions.pod:5345
11269 #: ../fish/guestfish-actions.pod:3500 ../src/guestfs-actions.pod:5347
11271 "If this option is true, then force the resize of the filesystem even if the "
11272 "filesystem is marked as requiring a consistency check."
11276 #: ../fish/guestfish-actions.pod:3503
11278 "After the resize operation, the filesystem is always marked as requiring a "
11279 "consistency check (for safety). You have to boot into Windows to perform "
11280 "this check and clear this condition. If you I<don't> set the C<force> "
11281 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
11282 "a single filesystem without booting into Windows between each resize."
11286 #: ../fish/guestfish-actions.pod:3516
11287 msgid "ntfsresize-size"
11291 #: ../fish/guestfish-actions.pod:3518
11294 " ntfsresize-size device size\n"
11299 #: ../fish/guestfish-actions.pod:3520
11301 "This command is the same as L</ntfsresize> except that it allows you to "
11302 "specify the new size (in bytes) explicitly."
11306 #: ../fish/guestfish-actions.pod:3530
11311 #: ../fish/guestfish-actions.pod:3532
11314 " part-add device prlogex startsect endsect\n"
11319 #: ../fish/guestfish-actions.pod:3534
11321 "This command adds a partition to C<device>. If there is no partition table "
11322 "on the device, call L</part-init> first."
11326 #: ../fish/guestfish-actions.pod:3537 ../src/guestfs-actions.pod:5420
11328 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11329 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11330 "C<logical>) and C<e> (or C<extended>) partition types."
11334 #: ../fish/guestfish-actions.pod:3542 ../src/guestfs-actions.pod:5425
11336 "C<startsect> and C<endsect> are the start and end of the partition in "
11337 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11338 "from the end of the disk (C<-1> is the last sector)."
11342 #: ../fish/guestfish-actions.pod:3546
11344 "Creating a partition which covers the whole disk is not so easy. Use "
11345 "L</part-disk> to do that."
11349 #: ../fish/guestfish-actions.pod:3549
11354 #: ../fish/guestfish-actions.pod:3551
11357 " part-del device partnum\n"
11362 #: ../fish/guestfish-actions.pod:3553 ../src/guestfs-actions.pod:5443
11363 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11367 #: ../fish/guestfish-actions.pod:3555 ../src/guestfs-actions.pod:5445
11369 "Note that in the case of MBR partitioning, deleting an extended partition "
11370 "also deletes any logical partitions it contains."
11374 #: ../fish/guestfish-actions.pod:3559
11379 #: ../fish/guestfish-actions.pod:3561
11382 " part-disk device parttype\n"
11387 #: ../fish/guestfish-actions.pod:3563
11389 "This command is simply a combination of L</part-init> followed by "
11390 "L</part-add> to create a single primary partition covering the whole disk."
11394 #: ../fish/guestfish-actions.pod:3567
11396 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11397 "possible values are described in L</part-init>."
11401 #: ../fish/guestfish-actions.pod:3573
11402 msgid "part-get-bootable"
11406 #: ../fish/guestfish-actions.pod:3575
11409 " part-get-bootable device partnum\n"
11414 #: ../fish/guestfish-actions.pod:3577 ../src/guestfs-actions.pod:5481
11416 "This command returns true if the partition C<partnum> on C<device> has the "
11417 "bootable flag set."
11421 #: ../fish/guestfish-actions.pod:3580
11422 msgid "See also L</part-set-bootable>."
11426 #: ../fish/guestfish-actions.pod:3582
11427 msgid "part-get-mbr-id"
11431 #: ../fish/guestfish-actions.pod:3584
11434 " part-get-mbr-id device partnum\n"
11439 #: ../fish/guestfish-actions.pod:3586 ../src/guestfs-actions.pod:5497
11441 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11442 "partition C<partnum>."
11446 #: ../fish/guestfish-actions.pod:3589 ../fish/guestfish-actions.pod:3733
11448 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11449 "undefined results for other partition table types (see "
11450 "L</part-get-parttype>)."
11454 #: ../fish/guestfish-actions.pod:3593
11455 msgid "part-get-parttype"
11459 #: ../fish/guestfish-actions.pod:3595
11462 " part-get-parttype device\n"
11467 #: ../fish/guestfish-actions.pod:3597 ../src/guestfs-actions.pod:5514
11469 "This command examines the partition table on C<device> and returns the "
11470 "partition table type (format) being used."
11474 #: ../fish/guestfish-actions.pod:3600
11476 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11477 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11478 "possible, although unusual. See L</part-init> for a full list."
11482 #: ../fish/guestfish-actions.pod:3605
11487 #: ../fish/guestfish-actions.pod:3607
11490 " part-init device parttype\n"
11495 #: ../fish/guestfish-actions.pod:3609 ../src/guestfs-actions.pod:5534
11497 "This creates an empty partition table on C<device> of one of the partition "
11498 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11499 "(for large disks)."
11503 #: ../fish/guestfish-actions.pod:3613
11505 "Initially there are no partitions. Following this, you should call "
11506 "L</part-add> for each partition required."
11510 #: ../fish/guestfish-actions.pod:3616 ../src/guestfs-actions.pod:5541
11511 msgid "Possible values for C<parttype> are:"
11515 #: ../fish/guestfish-actions.pod:3620 ../src/guestfs-actions.pod:5545
11520 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5547
11525 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5549
11526 msgid "Intel EFI / GPT partition table."
11530 #: ../fish/guestfish-actions.pod:3626 ../src/guestfs-actions.pod:5551
11532 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11533 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11534 "the C<mbr> format."
11538 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5555
11543 #: ../fish/guestfish-actions.pod:3632 ../src/guestfs-actions.pod:5557
11548 #: ../fish/guestfish-actions.pod:3634 ../src/guestfs-actions.pod:5559
11550 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11551 "Windows. This partition type will B<only> work for device sizes up to 2 "
11552 "TB. For large disks we recommend using C<gpt>."
11556 #: ../fish/guestfish-actions.pod:3641 ../src/guestfs-actions.pod:5566
11557 msgid "Other partition table types that may work but are not supported include:"
11561 #: ../fish/guestfish-actions.pod:3646 ../src/guestfs-actions.pod:5571
11566 #: ../fish/guestfish-actions.pod:3648 ../src/guestfs-actions.pod:5573
11567 msgid "AIX disk labels."
11571 #: ../fish/guestfish-actions.pod:3650 ../src/guestfs-actions.pod:5575
11576 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5577
11581 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5579
11582 msgid "Amiga \"Rigid Disk Block\" format."
11586 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5581
11591 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5583
11592 msgid "BSD disk labels."
11596 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5585
11601 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5587
11602 msgid "DASD, used on IBM mainframes."
11606 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5589
11611 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5591
11612 msgid "MIPS/SGI volumes."
11616 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5593
11621 #: ../fish/guestfish-actions.pod:3670 ../src/guestfs-actions.pod:5595
11622 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11626 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5597
11631 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5599
11632 msgid "NEC PC-98 format, common in Japan apparently."
11636 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5601
11641 #: ../fish/guestfish-actions.pod:3678 ../src/guestfs-actions.pod:5603
11642 msgid "Sun disk labels."
11646 #: ../fish/guestfish-actions.pod:3682
11651 #: ../fish/guestfish-actions.pod:3684
11654 " part-list device\n"
11659 #: ../fish/guestfish-actions.pod:3686 ../src/guestfs-actions.pod:5617
11661 "This command parses the partition table on C<device> and returns the list of "
11662 "partitions found."
11666 #: ../fish/guestfish-actions.pod:3689 ../src/guestfs-actions.pod:5620
11667 msgid "The fields in the returned structure are:"
11671 #: ../fish/guestfish-actions.pod:3693 ../src/guestfs-actions.pod:5624
11672 msgid "B<part_num>"
11676 #: ../fish/guestfish-actions.pod:3695 ../src/guestfs-actions.pod:5626
11677 msgid "Partition number, counting from 1."
11681 #: ../fish/guestfish-actions.pod:3697 ../src/guestfs-actions.pod:5628
11682 msgid "B<part_start>"
11686 #: ../fish/guestfish-actions.pod:3699
11688 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11689 "the device's sector size, see L</blockdev-getss>."
11693 #: ../fish/guestfish-actions.pod:3702 ../src/guestfs-actions.pod:5633
11694 msgid "B<part_end>"
11698 #: ../fish/guestfish-actions.pod:3704 ../src/guestfs-actions.pod:5635
11699 msgid "End of the partition in bytes."
11703 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5637
11704 msgid "B<part_size>"
11708 #: ../fish/guestfish-actions.pod:3708 ../src/guestfs-actions.pod:5639
11709 msgid "Size of the partition in bytes."
11713 #: ../fish/guestfish-actions.pod:3712
11714 msgid "part-set-bootable"
11718 #: ../fish/guestfish-actions.pod:3714
11721 " part-set-bootable device partnum true|false\n"
11726 #: ../fish/guestfish-actions.pod:3716 ../src/guestfs-actions.pod:5657
11728 "This sets the bootable flag on partition numbered C<partnum> on device "
11729 "C<device>. Note that partitions are numbered from 1."
11733 #: ../fish/guestfish-actions.pod:3719 ../src/guestfs-actions.pod:5660
11735 "The bootable flag is used by some operating systems (notably Windows) to "
11736 "determine which partition to boot from. It is by no means universally "
11741 #: ../fish/guestfish-actions.pod:3723
11742 msgid "part-set-mbr-id"
11746 #: ../fish/guestfish-actions.pod:3725
11749 " part-set-mbr-id device partnum idbyte\n"
11754 #: ../fish/guestfish-actions.pod:3727 ../src/guestfs-actions.pod:5676
11756 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11757 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11758 "documentation are in fact hexadecimal numbers, but usually documented "
11759 "without any leading \"0x\" which might be confusing."
11763 #: ../fish/guestfish-actions.pod:3737
11764 msgid "part-set-name"
11768 #: ../fish/guestfish-actions.pod:3739
11771 " part-set-name device partnum name\n"
11776 #: ../fish/guestfish-actions.pod:3741 ../src/guestfs-actions.pod:5698
11778 "This sets the partition name on partition numbered C<partnum> on device "
11779 "C<device>. Note that partitions are numbered from 1."
11783 #: ../fish/guestfish-actions.pod:3744 ../src/guestfs-actions.pod:5701
11785 "The partition name can only be set on certain types of partition table. "
11786 "This works on C<gpt> but not on C<mbr> partitions."
11790 #: ../fish/guestfish-actions.pod:3747
11791 msgid "part-to-dev"
11795 #: ../fish/guestfish-actions.pod:3749
11798 " part-to-dev partition\n"
11803 #: ../fish/guestfish-actions.pod:3751 ../src/guestfs-actions.pod:5714
11805 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11806 "partition number, returning the device name (eg. \"/dev/sdb\")."
11810 #: ../fish/guestfish-actions.pod:3755
11812 "The named partition must exist, for example as a string returned from "
11813 "L</list-partitions>."
11817 #: ../fish/guestfish-actions.pod:3758
11818 msgid "ping-daemon"
11822 #: ../fish/guestfish-actions.pod:3760
11830 #: ../fish/guestfish-actions.pod:3762 ../src/guestfs-actions.pod:5731
11832 "This is a test probe into the guestfs daemon running inside the qemu "
11833 "subprocess. Calling this function checks that the daemon responds to the "
11834 "ping message, without affecting the daemon or attached block device(s) in "
11839 #: ../fish/guestfish-actions.pod:3767
11844 #: ../fish/guestfish-actions.pod:3769
11847 " pread path count offset\n"
11852 #: ../fish/guestfish-actions.pod:3771 ../src/guestfs-actions.pod:5749
11854 "This command lets you read part of a file. It reads C<count> bytes of the "
11855 "file, starting at C<offset>, from file C<path>."
11859 #: ../fish/guestfish-actions.pod:3774 ../fish/guestfish-actions.pod:3789 ../src/guestfs-actions.pod:5752 ../src/guestfs-actions.pod:5778
11861 "This may read fewer bytes than requested. For further details see the "
11862 "L<pread(2)> system call."
11866 #: ../fish/guestfish-actions.pod:3777
11867 msgid "See also L</pwrite>, L</pread-device>."
11871 #: ../fish/guestfish-actions.pod:3782
11872 msgid "pread-device"
11876 #: ../fish/guestfish-actions.pod:3784
11879 " pread-device device count offset\n"
11884 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5775
11886 "This command lets you read part of a file. It reads C<count> bytes of "
11887 "C<device>, starting at C<offset>."
11891 #: ../fish/guestfish-actions.pod:3792
11892 msgid "See also L</pread>."
11896 #: ../fish/guestfish-actions.pod:3797
11901 #: ../fish/guestfish-actions.pod:3799
11904 " pvcreate device\n"
11909 #: ../fish/guestfish-actions.pod:3801 ../src/guestfs-actions.pod:5798
11911 "This creates an LVM physical volume on the named C<device>, where C<device> "
11912 "should usually be a partition name such as C</dev/sda1>."
11916 #: ../fish/guestfish-actions.pod:3805
11921 #: ../fish/guestfish-actions.pod:3807
11924 " pvremove device\n"
11929 #: ../fish/guestfish-actions.pod:3809 ../src/guestfs-actions.pod:5812
11931 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11936 #: ../fish/guestfish-actions.pod:3812 ../src/guestfs-actions.pod:5815
11938 "The implementation uses the C<pvremove> command which refuses to wipe "
11939 "physical volumes that contain any volume groups, so you have to remove those "
11944 #: ../fish/guestfish-actions.pod:3816
11949 #: ../fish/guestfish-actions.pod:3818
11952 " pvresize device\n"
11957 #: ../fish/guestfish-actions.pod:3820 ../src/guestfs-actions.pod:5829
11959 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11960 "the new size of the underlying device."
11964 #: ../fish/guestfish-actions.pod:3823
11965 msgid "pvresize-size"
11969 #: ../fish/guestfish-actions.pod:3825
11972 " pvresize-size device size\n"
11977 #: ../fish/guestfish-actions.pod:3827
11979 "This command is the same as L</pvresize> except that it allows you to "
11980 "specify the new size (in bytes) explicitly."
11984 #: ../fish/guestfish-actions.pod:3830
11989 #: ../fish/guestfish-actions.pod:3832
11997 #: ../fish/guestfish-actions.pod:3834 ../src/guestfs-actions.pod:5855
11999 "List all the physical volumes detected. This is the equivalent of the "
12000 "L<pvs(8)> command."
12004 #: ../fish/guestfish-actions.pod:3837 ../src/guestfs-actions.pod:5858
12006 "This returns a list of just the device names that contain PVs "
12007 "(eg. C</dev/sda2>)."
12011 #: ../fish/guestfish-actions.pod:3840
12012 msgid "See also L</pvs-full>."
12016 #: ../fish/guestfish-actions.pod:3842
12021 #: ../fish/guestfish-actions.pod:3844
12029 #: ../fish/guestfish-actions.pod:3846 ../src/guestfs-actions.pod:5874
12031 "List all the physical volumes detected. This is the equivalent of the "
12032 "L<pvs(8)> command. The \"full\" version includes all fields."
12036 #: ../fish/guestfish-actions.pod:3849
12041 #: ../fish/guestfish-actions.pod:3851
12049 #: ../fish/guestfish-actions.pod:3853 ../src/guestfs-actions.pod:5889
12050 msgid "This command returns the UUID of the LVM PV C<device>."
12054 #: ../fish/guestfish-actions.pod:3855
12059 #: ../fish/guestfish-actions.pod:3857
12062 " pwrite path content offset\n"
12067 #: ../fish/guestfish-actions.pod:3859 ../src/guestfs-actions.pod:5905
12069 "This command writes to part of a file. It writes the data buffer C<content> "
12070 "to the file C<path> starting at offset C<offset>."
12074 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:5908
12076 "This command implements the L<pwrite(2)> system call, and like that system "
12077 "call it may not write the full data requested. The return value is the "
12078 "number of bytes that were actually written to the file. This could even be "
12079 "0, although short writes are unlikely for regular files in ordinary "
12084 #: ../fish/guestfish-actions.pod:3868
12085 msgid "See also L</pread>, L</pwrite-device>."
12089 #: ../fish/guestfish-actions.pod:3873
12090 msgid "pwrite-device"
12094 #: ../fish/guestfish-actions.pod:3875
12097 " pwrite-device device content offset\n"
12102 #: ../fish/guestfish-actions.pod:3877 ../src/guestfs-actions.pod:5932
12104 "This command writes to part of a device. It writes the data buffer "
12105 "C<content> to C<device> starting at offset C<offset>."
12109 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:5935
12111 "This command implements the L<pwrite(2)> system call, and like that system "
12112 "call it may not write the full data requested (although short writes to disk "
12113 "devices and partitions are probably impossible with standard Linux kernels)."
12117 #: ../fish/guestfish-actions.pod:3885
12118 msgid "See also L</pwrite>."
12122 #: ../fish/guestfish-actions.pod:3890
12127 #: ../fish/guestfish-actions.pod:3892
12130 " read-file path\n"
12135 #: ../fish/guestfish-actions.pod:3894 ../src/guestfs-actions.pod:5956
12136 msgid "This calls returns the contents of the file C<path> as a buffer."
12140 #: ../fish/guestfish-actions.pod:3897
12142 "Unlike L</cat>, this function can correctly handle files that contain "
12143 "embedded ASCII NUL characters. However unlike L</download>, this function "
12144 "is limited in the total size of file that can be handled."
12148 #: ../fish/guestfish-actions.pod:3905
12153 #: ../fish/guestfish-actions.pod:3907
12156 " read-lines path\n"
12161 #: ../fish/guestfish-actions.pod:3911 ../src/guestfs-actions.pod:5981
12163 "The file contents are returned as a list of lines. Trailing C<LF> and "
12164 "C<CRLF> character sequences are I<not> returned."
12168 #: ../fish/guestfish-actions.pod:3914
12170 "Note that this function cannot correctly handle binary files (specifically, "
12171 "files containing C<\\0> character which is treated as end of line). For "
12172 "those you need to use the L</read-file> function which has a more complex "
12177 #: ../fish/guestfish-actions.pod:3919
12182 #: ../fish/guestfish-actions.pod:3921
12190 #: ../fish/guestfish-actions.pod:3923 ../src/guestfs-actions.pod:6001
12191 msgid "This returns the list of directory entries in directory C<dir>."
12195 #: ../fish/guestfish-actions.pod:3925 ../src/guestfs-actions.pod:6003
12197 "All entries in the directory are returned, including C<.> and C<..>. The "
12198 "entries are I<not> sorted, but returned in the same order as the underlying "
12203 #: ../fish/guestfish-actions.pod:3929 ../src/guestfs-actions.pod:6007
12205 "Also this call returns basic file type information about each file. The "
12206 "C<ftyp> field will contain one of the following characters:"
12210 #: ../fish/guestfish-actions.pod:3934 ../src/guestfs-actions.pod:6012
12215 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:6014
12216 msgid "Block special"
12220 #: ../fish/guestfish-actions.pod:3938 ../src/guestfs-actions.pod:6016
12225 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6018
12226 msgid "Char special"
12230 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6020
12235 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6022
12240 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6024
12245 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6026
12246 msgid "FIFO (named pipe)"
12250 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6028
12255 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6030
12256 msgid "Symbolic link"
12260 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6032
12265 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6034
12266 msgid "Regular file"
12270 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6036
12275 #: ../fish/guestfish-actions.pod:3960 ../src/guestfs-actions.pod:6038
12280 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6040
12285 #: ../fish/guestfish-actions.pod:3964 ../src/guestfs-actions.pod:6042
12286 msgid "Unknown file type"
12290 #: ../fish/guestfish-actions.pod:3966 ../src/guestfs-actions.pod:6044
12295 #: ../fish/guestfish-actions.pod:3968 ../src/guestfs-actions.pod:6046
12296 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12300 #: ../fish/guestfish-actions.pod:3973
12302 "This function is primarily intended for use by programs. To get a simple "
12303 "list of names, use L</ls>. To get a printable directory for human "
12304 "consumption, use L</ll>."
12308 #: ../fish/guestfish-actions.pod:3977
12313 #: ../fish/guestfish-actions.pod:3979
12321 #: ../fish/guestfish-actions.pod:3981 ../src/guestfs-actions.pod:6067
12322 msgid "This command reads the target of a symbolic link."
12326 #: ../fish/guestfish-actions.pod:3983
12327 msgid "readlinklist"
12331 #: ../fish/guestfish-actions.pod:3985
12334 " readlinklist path 'names ...'\n"
12339 #: ../fish/guestfish-actions.pod:3987 ../src/guestfs-actions.pod:6081
12341 "This call allows you to do a C<readlink> operation on multiple files, where "
12342 "all files are in the directory C<path>. C<names> is the list of files from "
12347 #: ../fish/guestfish-actions.pod:3991 ../src/guestfs-actions.pod:6085
12349 "On return you get a list of strings, with a one-to-one correspondence to the "
12350 "C<names> list. Each string is the value of the symbolic link."
12354 #: ../fish/guestfish-actions.pod:3995 ../src/guestfs-actions.pod:6089
12356 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12357 "result string is the empty string C<\"\">. However the whole operation is "
12358 "completed even if there were C<readlink(2)> errors, and so you can call this "
12359 "function with names where you don't know if they are symbolic links already "
12360 "(albeit slightly less efficient)."
12364 #: ../fish/guestfish-actions.pod:4002 ../src/guestfs-actions.pod:6096
12366 "This call is intended for programs that want to efficiently list a directory "
12367 "contents without making many round-trips. Very long directory listings "
12368 "might cause the protocol message size to be exceeded, causing this call to "
12369 "fail. The caller must split up such requests into smaller groups of names."
12373 #: ../fish/guestfish-actions.pod:4009
12378 #: ../fish/guestfish-actions.pod:4011
12386 #: ../fish/guestfish-actions.pod:4013 ../src/guestfs-actions.pod:6115
12388 "Return the canonicalized absolute pathname of C<path>. The returned path "
12389 "has no C<.>, C<..> or symbolic link path elements."
12393 #: ../fish/guestfish-actions.pod:4016
12394 msgid "removexattr"
12398 #: ../fish/guestfish-actions.pod:4018
12401 " removexattr xattr path\n"
12406 #: ../fish/guestfish-actions.pod:4020 ../src/guestfs-actions.pod:6130
12407 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
12411 #: ../fish/guestfish-actions.pod:4023
12412 msgid "See also: L</lremovexattr>, L<attr(5)>."
12416 #: ../fish/guestfish-actions.pod:4025
12421 #: ../fish/guestfish-actions.pod:4027
12424 " resize2fs device\n"
12429 #: ../fish/guestfish-actions.pod:4029 ../src/guestfs-actions.pod:6145
12431 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12432 "underlying device."
12436 #: ../fish/guestfish-actions.pod:4032
12438 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
12439 "before calling this command. For unknown reasons C<resize2fs> sometimes "
12440 "gives an error about this and sometimes not. In any case, it is always safe "
12441 "to call L</e2fsck-f> before calling this function."
12445 #: ../fish/guestfish-actions.pod:4038
12446 msgid "resize2fs-M"
12450 #: ../fish/guestfish-actions.pod:4040
12453 " resize2fs-M device\n"
12458 #: ../fish/guestfish-actions.pod:4042
12460 "This command is the same as L</resize2fs>, but the filesystem is resized to "
12461 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
12466 #: ../fish/guestfish-actions.pod:4046
12468 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
12469 "and read the C<Block size> and C<Block count> values. These two numbers, "
12470 "multiplied together, give the resulting size of the minimal filesystem in "
12475 #: ../fish/guestfish-actions.pod:4051
12476 msgid "resize2fs-size"
12480 #: ../fish/guestfish-actions.pod:4053
12483 " resize2fs-size device size\n"
12488 #: ../fish/guestfish-actions.pod:4055
12490 "This command is the same as L</resize2fs> except that it allows you to "
12491 "specify the new size (in bytes) explicitly."
12495 #: ../fish/guestfish-actions.pod:4058
12500 #: ../fish/guestfish-actions.pod:4060
12508 #: ../fish/guestfish-actions.pod:4062 ../src/guestfs-actions.pod:6197
12509 msgid "Remove the single file C<path>."
12513 #: ../fish/guestfish-actions.pod:4064
12518 #: ../fish/guestfish-actions.pod:4066
12526 #: ../fish/guestfish-actions.pod:4068 ../src/guestfs-actions.pod:6209
12528 "Remove the file or directory C<path>, recursively removing the contents if "
12529 "its a directory. This is like the C<rm -rf> shell command."
12533 #: ../fish/guestfish-actions.pod:4072
12538 #: ../fish/guestfish-actions.pod:4074
12546 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6223
12547 msgid "Remove the single directory C<path>."
12551 #: ../fish/guestfish-actions.pod:4078
12552 msgid "rmmountpoint"
12556 #: ../fish/guestfish-actions.pod:4080
12559 " rmmountpoint exemptpath\n"
12564 #: ../fish/guestfish-actions.pod:4082
12566 "This calls removes a mountpoint that was previously created with "
12567 "L</mkmountpoint>. See L</mkmountpoint> for full details."
12571 #: ../fish/guestfish-actions.pod:4086
12572 msgid "scrub-device"
12576 #: ../fish/guestfish-actions.pod:4088
12579 " scrub-device device\n"
12584 #: ../fish/guestfish-actions.pod:4090 ../src/guestfs-actions.pod:6249
12586 "This command writes patterns over C<device> to make data retrieval more "
12591 #: ../fish/guestfish-actions.pod:4093 ../fish/guestfish-actions.pod:4108 ../fish/guestfish-actions.pod:4121 ../src/guestfs-actions.pod:6252 ../src/guestfs-actions.pod:6273 ../src/guestfs-actions.pod:6292
12593 "It is an interface to the L<scrub(1)> program. See that manual page for "
12598 #: ../fish/guestfish-actions.pod:4099
12603 #: ../fish/guestfish-actions.pod:4101
12606 " scrub-file file\n"
12611 #: ../fish/guestfish-actions.pod:4103 ../src/guestfs-actions.pod:6268
12613 "This command writes patterns over a file to make data retrieval more "
12618 #: ../fish/guestfish-actions.pod:4106 ../src/guestfs-actions.pod:6271
12619 msgid "The file is I<removed> after scrubbing."
12623 #: ../fish/guestfish-actions.pod:4111
12624 msgid "scrub-freespace"
12628 #: ../fish/guestfish-actions.pod:4113
12631 " scrub-freespace dir\n"
12636 #: ../fish/guestfish-actions.pod:4115
12638 "This command creates the directory C<dir> and then fills it with files until "
12639 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
12640 "deletes them. The intention is to scrub any free space on the partition "
12641 "containing C<dir>."
12645 #: ../fish/guestfish-actions.pod:4124
12650 #: ../fish/guestfish-actions.pod:4126
12655 #: ../fish/guestfish-actions.pod:4128
12658 " set-append append\n"
12663 #: ../fish/guestfish-actions.pod:4130 ../src/guestfs-actions.pod:6305
12665 "This function is used to add additional options to the guest kernel command "
12670 #: ../fish/guestfish-actions.pod:4133 ../src/guestfs-actions.pod:6308
12672 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12673 "environment variable."
12677 #: ../fish/guestfish-actions.pod:4136 ../src/guestfs-actions.pod:6311
12679 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12680 "(libguestfs always adds a few of its own)."
12684 #: ../fish/guestfish-actions.pod:4139
12685 msgid "set-attach-method"
12689 #: ../fish/guestfish-actions.pod:4141
12690 msgid "attach-method"
12694 #: ../fish/guestfish-actions.pod:4143
12697 " set-attach-method attachmethod\n"
12702 #: ../fish/guestfish-actions.pod:4145 ../src/guestfs-actions.pod:6324
12704 "Set the method that libguestfs uses to connect to the back end guestfsd "
12705 "daemon. Possible methods are:"
12709 #: ../fish/guestfish-actions.pod:4150 ../src/guestfs-actions.pod:6329 ../src/guestfs.pod:2823
12710 msgid "C<appliance>"
12714 #: ../fish/guestfish-actions.pod:4152 ../src/guestfs-actions.pod:6331
12716 "Launch an appliance and connect to it. This is the ordinary method and the "
12721 #: ../fish/guestfish-actions.pod:4155 ../src/guestfs-actions.pod:6334
12722 msgid "C<unix:I<path>>"
12726 #: ../fish/guestfish-actions.pod:4157 ../src/guestfs-actions.pod:6336
12727 msgid "Connect to the Unix domain socket I<path>."
12731 #: ../fish/guestfish-actions.pod:4159 ../src/guestfs-actions.pod:6338
12733 "This method lets you connect to an existing daemon or (using virtio-serial) "
12734 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
12735 "RUNNING DAEMONS>."
12739 #: ../fish/guestfish-actions.pod:4165
12740 msgid "set-autosync"
12744 #: ../fish/guestfish-actions.pod:4167
12749 #: ../fish/guestfish-actions.pod:4169
12752 " set-autosync true|false\n"
12757 #: ../fish/guestfish-actions.pod:4171 ../src/guestfs-actions.pod:6354
12759 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12760 "effort attempt to make filesystems consistent and synchronized when the "
12761 "handle is closed (also if the program exits without closing handles)."
12765 #: ../fish/guestfish-actions.pod:4176 ../src/guestfs-actions.pod:6359
12767 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12768 "disabled by default)."
12772 #: ../fish/guestfish-actions.pod:4179
12777 #: ../fish/guestfish-actions.pod:4181
12782 #: ../fish/guestfish-actions.pod:4183
12785 " set-direct true|false\n"
12790 #: ../fish/guestfish-actions.pod:4185 ../src/guestfs-actions.pod:6372
12792 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12793 "passed directly through to the appliance once it is launched."
12797 #: ../fish/guestfish-actions.pod:4189
12799 "One consequence of this is that log messages aren't caught by the library "
12800 "and handled by L</set-log-message-callback>, but go straight to stdout."
12804 #: ../fish/guestfish-actions.pod:4193 ../src/guestfs-actions.pod:6380
12805 msgid "You probably don't want to use this unless you know what you are doing."
12809 #: ../fish/guestfish-actions.pod:4196 ../src/guestfs-actions.pod:6383
12810 msgid "The default is disabled."
12814 #: ../fish/guestfish-actions.pod:4198
12815 msgid "set-e2label"
12819 #: ../fish/guestfish-actions.pod:4200
12822 " set-e2label device label\n"
12827 #: ../fish/guestfish-actions.pod:4202 ../src/guestfs-actions.pod:6396
12829 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12830 "C<label>. Filesystem labels are limited to 16 characters."
12834 #: ../fish/guestfish-actions.pod:4206
12836 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
12837 "label on a filesystem."
12841 #: ../fish/guestfish-actions.pod:4209
12846 #: ../fish/guestfish-actions.pod:4211
12849 " set-e2uuid device uuid\n"
12854 #: ../fish/guestfish-actions.pod:4213 ../src/guestfs-actions.pod:6414
12856 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12857 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12858 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12862 #: ../fish/guestfish-actions.pod:4218
12864 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
12865 "UUID of a filesystem."
12869 #: ../fish/guestfish-actions.pod:4221
12870 msgid "set-memsize"
12874 #: ../fish/guestfish-actions.pod:4223
12879 #: ../fish/guestfish-actions.pod:4225
12882 " set-memsize memsize\n"
12887 #: ../fish/guestfish-actions.pod:4227
12889 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12890 "This only has any effect if called before L</launch>."
12894 #: ../fish/guestfish-actions.pod:4231 ../src/guestfs-actions.pod:6436
12896 "You can also change this by setting the environment variable "
12897 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12901 #: ../fish/guestfish-actions.pod:4238
12902 msgid "set-network"
12906 #: ../fish/guestfish-actions.pod:4240
12911 #: ../fish/guestfish-actions.pod:4242
12914 " set-network true|false\n"
12919 #: ../fish/guestfish-actions.pod:4244 ../src/guestfs-actions.pod:6453
12921 "If C<network> is true, then the network is enabled in the libguestfs "
12922 "appliance. The default is false."
12926 #: ../fish/guestfish-actions.pod:4247 ../src/guestfs-actions.pod:6456
12928 "This affects whether commands are able to access the network (see "
12929 "L<guestfs(3)/RUNNING COMMANDS>)."
12933 #: ../fish/guestfish-actions.pod:4250
12934 msgid "You must call this before calling L</launch>, otherwise it has no effect."
12938 #: ../fish/guestfish-actions.pod:4253
12943 #: ../fish/guestfish-actions.pod:4257
12946 " set-path searchpath\n"
12951 #: ../fish/guestfish-actions.pod:4259 ../src/guestfs-actions.pod:6472
12952 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12956 #: ../fish/guestfish-actions.pod:4261 ../src/guestfs-actions.pod:6474
12958 "The default is C<$libdir/guestfs> unless overridden by setting "
12959 "C<LIBGUESTFS_PATH> environment variable."
12963 #: ../fish/guestfish-actions.pod:4264 ../src/guestfs-actions.pod:6477
12964 msgid "Setting C<path> to C<NULL> restores the default path."
12968 #: ../fish/guestfish-actions.pod:4266
12973 #: ../fish/guestfish-actions.pod:4268
12978 #: ../fish/guestfish-actions.pod:4270
12981 " set-pgroup true|false\n"
12986 #: ../fish/guestfish-actions.pod:4272 ../src/guestfs-actions.pod:6489
12988 "If C<pgroup> is true, child processes are placed into their own process "
12993 #: ../fish/guestfish-actions.pod:4275 ../src/guestfs-actions.pod:6492
12995 "The practical upshot of this is that signals like C<SIGINT> (from users "
12996 "pressing C<^C>) won't be received by the child process."
13000 #: ../fish/guestfish-actions.pod:4278 ../src/guestfs-actions.pod:6495
13002 "The default for this flag is false, because usually you want C<^C> to kill "
13007 #: ../fish/guestfish-actions.pod:4281
13012 #: ../fish/guestfish-actions.pod:4283
13017 #: ../fish/guestfish-actions.pod:4285
13025 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6508
13026 msgid "Set the qemu binary that we will use."
13030 #: ../fish/guestfish-actions.pod:4289 ../src/guestfs-actions.pod:6510
13031 msgid "The default is chosen when the library was compiled by the configure script."
13035 #: ../fish/guestfish-actions.pod:4292 ../src/guestfs-actions.pod:6513
13037 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13042 #: ../fish/guestfish-actions.pod:4295 ../src/guestfs-actions.pod:6516
13043 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13047 #: ../fish/guestfish-actions.pod:4297 ../src/guestfs-actions.pod:6518
13049 "Note that you should call this function as early as possible after creating "
13050 "the handle. This is because some pre-launch operations depend on testing "
13051 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13052 "don't retest features, and so you might see inconsistent results. Using the "
13053 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13054 "the qemu binary at the same time as the handle is created."
13058 #: ../fish/guestfish-actions.pod:4305
13059 msgid "set-recovery-proc"
13063 #: ../fish/guestfish-actions.pod:4307
13064 msgid "recovery-proc"
13068 #: ../fish/guestfish-actions.pod:4309
13071 " set-recovery-proc true|false\n"
13076 #: ../fish/guestfish-actions.pod:4311
13078 "If this is called with the parameter C<false> then L</launch> does not "
13079 "create a recovery process. The purpose of the recovery process is to stop "
13080 "runaway qemu processes in the case where the main program aborts abruptly."
13084 #: ../fish/guestfish-actions.pod:4316
13086 "This only has any effect if called before L</launch>, and the default is "
13091 #: ../fish/guestfish-actions.pod:4319 ../src/guestfs-actions.pod:6544
13093 "About the only time when you would want to disable this is if the main "
13094 "process will fork itself into the background (\"daemonize\" itself). In "
13095 "this case the recovery process thinks that the main program has disappeared "
13096 "and so kills qemu, which is not very helpful."
13100 #: ../fish/guestfish-actions.pod:4325
13101 msgid "set-selinux"
13105 #: ../fish/guestfish-actions.pod:4327
13110 #: ../fish/guestfish-actions.pod:4329
13113 " set-selinux true|false\n"
13118 #: ../fish/guestfish-actions.pod:4331 ../src/guestfs-actions.pod:6560
13120 "This sets the selinux flag that is passed to the appliance at boot time. "
13121 "The default is C<selinux=0> (disabled)."
13125 #: ../fish/guestfish-actions.pod:4334 ../src/guestfs-actions.pod:6563
13127 "Note that if SELinux is enabled, it is always in Permissive mode "
13128 "(C<enforcing=0>)."
13132 #: ../fish/guestfish-actions.pod:4340
13137 #: ../fish/guestfish-actions.pod:4342
13142 #: ../fish/guestfish-actions.pod:4344
13150 #: ../fish/guestfish-actions.pod:4346 ../src/guestfs-actions.pod:6579
13152 "Change the number of virtual CPUs assigned to the appliance. The default is "
13153 "C<1>. Increasing this may improve performance, though often it has no "
13158 #: ../fish/guestfish-actions.pod:4350
13159 msgid "This function must be called before L</launch>."
13163 #: ../fish/guestfish-actions.pod:4352
13168 #: ../fish/guestfish-actions.pod:4354
13173 #: ../fish/guestfish-actions.pod:4356
13176 " set-trace true|false\n"
13181 #: ../fish/guestfish-actions.pod:4358 ../src/guestfs-actions.pod:6593
13183 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
13184 "return values are traced."
13188 #: ../fish/guestfish-actions.pod:4361 ../src/guestfs-actions.pod:6596
13190 "If you want to trace C API calls into libguestfs (and other libraries) then "
13191 "possibly a better way is to use the external ltrace(1) command."
13195 #: ../fish/guestfish-actions.pod:4365 ../src/guestfs-actions.pod:6600
13197 "Command traces are disabled unless the environment variable "
13198 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13202 #: ../fish/guestfish-actions.pod:4368
13204 "Trace messages are normally sent to C<stderr>, unless you register a "
13205 "callback to send them somewhere else (see L</set-event-callback>)."
13209 #: ../fish/guestfish-actions.pod:4372
13210 msgid "set-verbose"
13214 #: ../fish/guestfish-actions.pod:4374
13219 #: ../fish/guestfish-actions.pod:4376
13222 " set-verbose true|false\n"
13227 #: ../fish/guestfish-actions.pod:4378 ../src/guestfs-actions.pod:6617
13228 msgid "If C<verbose> is true, this turns on verbose messages."
13232 #: ../fish/guestfish-actions.pod:4380 ../src/guestfs-actions.pod:6619
13234 "Verbose messages are disabled unless the environment variable "
13235 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13239 #: ../fish/guestfish-actions.pod:4383
13241 "Verbose messages are normally sent to C<stderr>, unless you register a "
13242 "callback to send them somewhere else (see L</set-event-callback>)."
13246 #: ../fish/guestfish-actions.pod:4387
13251 #: ../fish/guestfish-actions.pod:4389
13254 " setcon context\n"
13259 #: ../fish/guestfish-actions.pod:4391 ../src/guestfs-actions.pod:6636
13261 "This sets the SELinux security context of the daemon to the string "
13266 #: ../fish/guestfish-actions.pod:4394 ../src/guestfs-actions.pod:6639
13267 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13271 #: ../fish/guestfish-actions.pod:4396
13276 #: ../fish/guestfish-actions.pod:4398
13279 " setxattr xattr val vallen path\n"
13284 #: ../fish/guestfish-actions.pod:4400 ../src/guestfs-actions.pod:6654
13286 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13287 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13291 #: ../fish/guestfish-actions.pod:4404
13292 msgid "See also: L</lsetxattr>, L<attr(5)>."
13296 #: ../fish/guestfish-actions.pod:4406
13301 #: ../fish/guestfish-actions.pod:4408
13304 " sfdisk device cyls heads sectors 'lines ...'\n"
13309 #: ../fish/guestfish-actions.pod:4410 ../src/guestfs-actions.pod:6681
13311 "This is a direct interface to the L<sfdisk(8)> program for creating "
13312 "partitions on block devices."
13316 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6684
13317 msgid "C<device> should be a block device, for example C</dev/sda>."
13321 #: ../fish/guestfish-actions.pod:4415 ../src/guestfs-actions.pod:6686
13323 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13324 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
13325 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13326 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13327 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13328 "the kernel) cannot work out the right geometry and you will need to tell it."
13332 #: ../fish/guestfish-actions.pod:4423 ../src/guestfs-actions.pod:6694
13334 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13335 "refer to the L<sfdisk(8)> manpage."
13339 #: ../fish/guestfish-actions.pod:4426 ../src/guestfs-actions.pod:6697
13341 "To create a single partition occupying the whole disk, you would pass "
13342 "C<lines> as a single element list, when the single element being the string "
13347 #: ../fish/guestfish-actions.pod:4430
13348 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
13352 #: ../fish/guestfish-actions.pod:4436 ../fish/guestfish-actions.pod:4459 ../fish/guestfish-actions.pod:4481
13354 "I<This function is deprecated.> In new code, use the L</part_add> call "
13359 #: ../fish/guestfish-actions.pod:4443
13364 #: ../fish/guestfish-actions.pod:4445
13367 " sfdiskM device 'lines ...'\n"
13372 #: ../fish/guestfish-actions.pod:4447
13374 "This is a simplified interface to the L</sfdisk> command, where partition "
13375 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13376 "you don't need to specify the cyls, heads and sectors parameters which were "
13377 "rarely if ever used anyway."
13381 #: ../fish/guestfish-actions.pod:4453
13382 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13386 #: ../fish/guestfish-actions.pod:4466
13391 #: ../fish/guestfish-actions.pod:4468
13394 " sfdisk-N device partnum cyls heads sectors line\n"
13399 #: ../fish/guestfish-actions.pod:4470 ../src/guestfs-actions.pod:6759
13401 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13402 "(note: C<n> counts from 1)."
13406 #: ../fish/guestfish-actions.pod:4473
13408 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13409 "cyls/heads/sectors parameters."
13413 #: ../fish/guestfish-actions.pod:4476
13414 msgid "See also: L</part-add>"
13418 #: ../fish/guestfish-actions.pod:4488
13419 msgid "sfdisk-disk-geometry"
13423 #: ../fish/guestfish-actions.pod:4490
13426 " sfdisk-disk-geometry device\n"
13431 #: ../fish/guestfish-actions.pod:4492
13433 "This displays the disk geometry of C<device> read from the partition table. "
13434 "Especially in the case where the underlying block device has been resized, "
13435 "this can be different from the kernel's idea of the geometry (see "
13436 "L</sfdisk-kernel-geometry>)."
13440 #: ../fish/guestfish-actions.pod:4497 ../fish/guestfish-actions.pod:4506 ../src/guestfs-actions.pod:6785 ../src/guestfs-actions.pod:6801
13441 msgid "The result is in human-readable format, and not designed to be parsed."
13445 #: ../fish/guestfish-actions.pod:4500
13446 msgid "sfdisk-kernel-geometry"
13450 #: ../fish/guestfish-actions.pod:4502
13453 " sfdisk-kernel-geometry device\n"
13458 #: ../fish/guestfish-actions.pod:4504 ../src/guestfs-actions.pod:6799
13459 msgid "This displays the kernel's idea of the geometry of C<device>."
13463 #: ../fish/guestfish-actions.pod:4509
13468 #: ../fish/guestfish-actions.pod:4511
13471 " sfdisk-l device\n"
13476 #: ../fish/guestfish-actions.pod:4513 ../src/guestfs-actions.pod:6822
13478 "This displays the partition table on C<device>, in the human-readable output "
13479 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13483 #: ../fish/guestfish-actions.pod:4517
13484 msgid "See also: L</part-list>"
13488 #: ../fish/guestfish-actions.pod:4519
13490 "I<This function is deprecated.> In new code, use the L</part_list> call "
13495 #: ../fish/guestfish-actions.pod:4526
13500 #: ../fish/guestfish-actions.pod:4528
13508 #: ../fish/guestfish-actions.pod:4530 ../src/guestfs-actions.pod:6839
13510 "This call runs a command from the guest filesystem via the guest's "
13515 #: ../fish/guestfish-actions.pod:4533
13516 msgid "This is like L</command>, but passes the command to:"
13520 #: ../fish/guestfish-actions.pod:4535 ../src/guestfs-actions.pod:6844
13523 " /bin/sh -c \"command\"\n"
13528 #: ../fish/guestfish-actions.pod:4537 ../src/guestfs-actions.pod:6846
13530 "Depending on the guest's shell, this usually results in wildcards being "
13531 "expanded, shell expressions being interpolated and so on."
13535 #: ../fish/guestfish-actions.pod:4541
13536 msgid "All the provisos about L</command> apply to this call."
13540 #: ../fish/guestfish-actions.pod:4543
13545 #: ../fish/guestfish-actions.pod:4545
13548 " sh-lines command\n"
13553 #: ../fish/guestfish-actions.pod:4547
13554 msgid "This is the same as L</sh>, but splits the result into a list of lines."
13558 #: ../fish/guestfish-actions.pod:4550
13559 msgid "See also: L</command-lines>"
13563 #: ../fish/guestfish-actions.pod:4552
13568 #: ../fish/guestfish-actions.pod:4554
13576 #: ../fish/guestfish-actions.pod:4556 ../src/guestfs-actions.pod:6880
13577 msgid "Sleep for C<secs> seconds."
13581 #: ../fish/guestfish-actions.pod:4558
13586 #: ../fish/guestfish-actions.pod:4560
13594 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6894
13595 msgid "This is the same as the C<stat(2)> system call."
13599 #: ../fish/guestfish-actions.pod:4566
13604 #: ../fish/guestfish-actions.pod:4568
13612 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:6908
13614 "Returns file system statistics for any mounted file system. C<path> should "
13615 "be a file or directory in the mounted file system (typically it is the mount "
13616 "point itself, but it doesn't need to be)."
13620 #: ../fish/guestfish-actions.pod:4574 ../src/guestfs-actions.pod:6912
13621 msgid "This is the same as the C<statvfs(2)> system call."
13625 #: ../fish/guestfish-actions.pod:4576
13630 #: ../fish/guestfish-actions.pod:4578
13638 #: ../fish/guestfish-actions.pod:4580 ../src/guestfs-actions.pod:6926
13640 "This runs the L<strings(1)> command on a file and returns the list of "
13641 "printable strings found."
13645 #: ../fish/guestfish-actions.pod:4586
13650 #: ../fish/guestfish-actions.pod:4588
13653 " strings-e encoding path\n"
13658 #: ../fish/guestfish-actions.pod:4590
13660 "This is like the L</strings> command, but allows you to specify the encoding "
13661 "of strings that are looked for in the source file C<path>."
13665 #: ../fish/guestfish-actions.pod:4594 ../src/guestfs-actions.pod:6949
13666 msgid "Allowed encodings are:"
13670 #: ../fish/guestfish-actions.pod:4598 ../src/guestfs-actions.pod:6953
13675 #: ../fish/guestfish-actions.pod:4600
13677 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13678 "ISO-8859-X (this is what L</strings> uses)."
13682 #: ../fish/guestfish-actions.pod:4603 ../src/guestfs-actions.pod:6958
13687 #: ../fish/guestfish-actions.pod:4605 ../src/guestfs-actions.pod:6960
13688 msgid "Single 8-bit-byte characters."
13692 #: ../fish/guestfish-actions.pod:4607 ../src/guestfs-actions.pod:6962
13697 #: ../fish/guestfish-actions.pod:4609 ../src/guestfs-actions.pod:6964
13698 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13702 #: ../fish/guestfish-actions.pod:4612 ../src/guestfs-actions.pod:6967
13703 msgid "l (lower case letter L)"
13707 #: ../fish/guestfish-actions.pod:4614 ../src/guestfs-actions.pod:6969
13709 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13710 "examining binaries in Windows guests."
13714 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6972
13719 #: ../fish/guestfish-actions.pod:4619 ../src/guestfs-actions.pod:6974
13720 msgid "32-bit big endian such as UCS-4BE."
13724 #: ../fish/guestfish-actions.pod:4621 ../src/guestfs-actions.pod:6976
13729 #: ../fish/guestfish-actions.pod:4623 ../src/guestfs-actions.pod:6978
13730 msgid "32-bit little endian such as UCS-4LE."
13734 #: ../fish/guestfish-actions.pod:4627 ../src/guestfs-actions.pod:6982
13735 msgid "The returned strings are transcoded to UTF-8."
13739 #: ../fish/guestfish-actions.pod:4632
13740 msgid "swapoff-device"
13744 #: ../fish/guestfish-actions.pod:4634
13747 " swapoff-device device\n"
13752 #: ../fish/guestfish-actions.pod:4636
13754 "This command disables the libguestfs appliance swap device or partition "
13755 "named C<device>. See L</swapon-device>."
13759 #: ../fish/guestfish-actions.pod:4640
13760 msgid "swapoff-file"
13764 #: ../fish/guestfish-actions.pod:4642
13767 " swapoff-file file\n"
13772 #: ../fish/guestfish-actions.pod:4644 ../src/guestfs-actions.pod:7013
13773 msgid "This command disables the libguestfs appliance swap on file."
13777 #: ../fish/guestfish-actions.pod:4646
13778 msgid "swapoff-label"
13782 #: ../fish/guestfish-actions.pod:4648
13785 " swapoff-label label\n"
13790 #: ../fish/guestfish-actions.pod:4650 ../src/guestfs-actions.pod:7025
13792 "This command disables the libguestfs appliance swap on labeled swap "
13797 #: ../fish/guestfish-actions.pod:4653
13798 msgid "swapoff-uuid"
13802 #: ../fish/guestfish-actions.pod:4655
13805 " swapoff-uuid uuid\n"
13810 #: ../fish/guestfish-actions.pod:4657 ../src/guestfs-actions.pod:7038
13812 "This command disables the libguestfs appliance swap partition with the given "
13817 #: ../fish/guestfish-actions.pod:4660
13818 msgid "swapon-device"
13822 #: ../fish/guestfish-actions.pod:4662
13825 " swapon-device device\n"
13830 #: ../fish/guestfish-actions.pod:4664
13832 "This command enables the libguestfs appliance to use the swap device or "
13833 "partition named C<device>. The increased memory is made available for all "
13834 "commands, for example those run using L</command> or L</sh>."
13838 #: ../fish/guestfish-actions.pod:4669 ../src/guestfs-actions.pod:7056
13840 "Note that you should not swap to existing guest swap partitions unless you "
13841 "know what you are doing. They may contain hibernation information, or other "
13842 "information that the guest doesn't want you to trash. You also risk leaking "
13843 "information about the host to the guest this way. Instead, attach a new "
13844 "host device to the guest and swap on that."
13848 #: ../fish/guestfish-actions.pod:4676
13849 msgid "swapon-file"
13853 #: ../fish/guestfish-actions.pod:4678
13856 " swapon-file file\n"
13861 #: ../fish/guestfish-actions.pod:4680
13862 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
13866 #: ../fish/guestfish-actions.pod:4683
13867 msgid "swapon-label"
13871 #: ../fish/guestfish-actions.pod:4685
13874 " swapon-label label\n"
13879 #: ../fish/guestfish-actions.pod:4687
13881 "This command enables swap to a labeled swap partition. See "
13882 "L</swapon-device> for other notes."
13886 #: ../fish/guestfish-actions.pod:4690
13887 msgid "swapon-uuid"
13891 #: ../fish/guestfish-actions.pod:4692
13894 " swapon-uuid uuid\n"
13899 #: ../fish/guestfish-actions.pod:4694
13901 "This command enables swap to a swap partition with the given UUID. See "
13902 "L</swapon-device> for other notes."
13906 #: ../fish/guestfish-actions.pod:4697
13911 #: ../fish/guestfish-actions.pod:4699
13919 #: ../fish/guestfish-actions.pod:4701 ../src/guestfs-actions.pod:7111
13921 "This syncs the disk, so that any writes are flushed through to the "
13922 "underlying disk image."
13926 #: ../fish/guestfish-actions.pod:4704 ../src/guestfs-actions.pod:7114
13928 "You should always call this if you have modified a disk image, before "
13929 "closing the handle."
13933 #: ../fish/guestfish-actions.pod:4707
13938 #: ../fish/guestfish-actions.pod:4709
13946 #: ../fish/guestfish-actions.pod:4711 ../src/guestfs-actions.pod:7127
13947 msgid "This command returns up to the last 10 lines of a file as a list of strings."
13951 #: ../fish/guestfish-actions.pod:4717
13956 #: ../fish/guestfish-actions.pod:4719
13959 " tail-n nrlines path\n"
13964 #: ../fish/guestfish-actions.pod:4721 ../src/guestfs-actions.pod:7146
13966 "If the parameter C<nrlines> is a positive number, this returns the last "
13967 "C<nrlines> lines of the file C<path>."
13971 #: ../fish/guestfish-actions.pod:4724 ../src/guestfs-actions.pod:7149
13973 "If the parameter C<nrlines> is a negative number, this returns lines from "
13974 "the file C<path>, starting with the C<-nrlines>th line."
13978 #: ../fish/guestfish-actions.pod:4732
13983 #: ../fish/guestfish-actions.pod:4734
13986 " tar-in (tarfile|-) directory\n"
13991 #: ../fish/guestfish-actions.pod:4736 ../src/guestfs-actions.pod:7170
13993 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13994 "tar file) into C<directory>."
13998 #: ../fish/guestfish-actions.pod:4739
13999 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
14003 #: ../fish/guestfish-actions.pod:4744
14008 #: ../fish/guestfish-actions.pod:4746
14011 " tar-out directory (tarfile|-)\n"
14016 #: ../fish/guestfish-actions.pod:4748 ../src/guestfs-actions.pod:7187
14018 "This command packs the contents of C<directory> and downloads it to local "
14023 #: ../fish/guestfish-actions.pod:4751
14024 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
14028 #: ../fish/guestfish-actions.pod:4756
14033 #: ../fish/guestfish-actions.pod:4758
14036 " tgz-in (tarball|-) directory\n"
14041 #: ../fish/guestfish-actions.pod:4760 ../src/guestfs-actions.pod:7204
14043 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14044 "tar file) into C<directory>."
14048 #: ../fish/guestfish-actions.pod:4763
14049 msgid "To upload an uncompressed tarball, use L</tar-in>."
14053 #: ../fish/guestfish-actions.pod:4767
14058 #: ../fish/guestfish-actions.pod:4769
14061 " tgz-out directory (tarball|-)\n"
14066 #: ../fish/guestfish-actions.pod:4771 ../src/guestfs-actions.pod:7220
14068 "This command packs the contents of C<directory> and downloads it to local "
14073 #: ../fish/guestfish-actions.pod:4774
14074 msgid "To download an uncompressed tarball, use L</tar-out>."
14078 #: ../fish/guestfish-actions.pod:4778
14083 #: ../fish/guestfish-actions.pod:4780
14091 #: ../fish/guestfish-actions.pod:4782 ../src/guestfs-actions.pod:7235
14093 "Touch acts like the L<touch(1)> command. It can be used to update the "
14094 "timestamps on a file, or, if the file does not exist, to create a new "
14095 "zero-length file."
14099 #: ../fish/guestfish-actions.pod:4786 ../src/guestfs-actions.pod:7239
14101 "This command only works on regular files, and will fail on other file types "
14102 "such as directories, symbolic links, block special etc."
14106 #: ../fish/guestfish-actions.pod:4789
14111 #: ../fish/guestfish-actions.pod:4791
14119 #: ../fish/guestfish-actions.pod:4793 ../src/guestfs-actions.pod:7252
14121 "This command truncates C<path> to a zero-length file. The file must exist "
14126 #: ../fish/guestfish-actions.pod:4796
14127 msgid "truncate-size"
14131 #: ../fish/guestfish-actions.pod:4798
14134 " truncate-size path size\n"
14139 #: ../fish/guestfish-actions.pod:4800 ../src/guestfs-actions.pod:7266
14141 "This command truncates C<path> to size C<size> bytes. The file must exist "
14146 #: ../fish/guestfish-actions.pod:4803
14148 "If the current file size is less than C<size> then the file is extended to "
14149 "the required size with zero bytes. This creates a sparse file (ie. disk "
14150 "blocks are not allocated for the file until you write to it). To create a "
14151 "non-sparse file of zeroes, use L</fallocate64> instead."
14155 #: ../fish/guestfish-actions.pod:4809
14160 #: ../fish/guestfish-actions.pod:4811
14163 " tune2fs-l device\n"
14168 #: ../fish/guestfish-actions.pod:4813 ../src/guestfs-actions.pod:7285
14170 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14175 #: ../fish/guestfish-actions.pod:4816 ../src/guestfs-actions.pod:7288
14177 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14178 "for more details. The list of fields returned isn't clearly defined, and "
14179 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14180 "and the filesystem itself."
14184 #: ../fish/guestfish-actions.pod:4821
14189 #: ../fish/guestfish-actions.pod:4823
14192 " txz-in (tarball|-) directory\n"
14197 #: ../fish/guestfish-actions.pod:4825 ../src/guestfs-actions.pod:7308
14199 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14200 "tar file) into C<directory>."
14204 #: ../fish/guestfish-actions.pod:4830
14209 #: ../fish/guestfish-actions.pod:4832
14212 " txz-out directory (tarball|-)\n"
14217 #: ../fish/guestfish-actions.pod:4834 ../src/guestfs-actions.pod:7322
14219 "This command packs the contents of C<directory> and downloads it to local "
14220 "file C<tarball> (as an xz compressed tar archive)."
14224 #: ../fish/guestfish-actions.pod:4839
14229 #: ../fish/guestfish-actions.pod:4841
14237 #: ../fish/guestfish-actions.pod:4843 ../src/guestfs-actions.pod:7335
14239 "This function sets the mask used for creating new files and device nodes to "
14244 #: ../fish/guestfish-actions.pod:4846 ../src/guestfs-actions.pod:7338
14246 "Typical umask values would be C<022> which creates new files with "
14247 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
14248 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
14252 #: ../fish/guestfish-actions.pod:4851 ../src/guestfs-actions.pod:7343
14254 "The default umask is C<022>. This is important because it means that "
14255 "directories and device nodes will be created with C<0644> or C<0755> mode "
14256 "even if you specify C<0777>."
14260 #: ../fish/guestfish-actions.pod:4855
14261 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
14265 #: ../fish/guestfish-actions.pod:4858 ../src/guestfs-actions.pod:7350
14266 msgid "This call returns the previous umask."
14270 #: ../fish/guestfish-actions.pod:4860
14275 #: ../fish/guestfish-actions.pod:4862
14280 #: ../fish/guestfish-actions.pod:4864
14283 " umount pathordevice\n"
14288 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7362
14290 "This unmounts the given filesystem. The filesystem may be specified either "
14291 "by its mountpoint (path) or the device which contains the filesystem."
14295 #: ../fish/guestfish-actions.pod:4870
14300 #: ../fish/guestfish-actions.pod:4872
14301 msgid "unmount-all"
14305 #: ../fish/guestfish-actions.pod:4874
14313 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7375
14314 msgid "This unmounts all mounted filesystems."
14318 #: ../fish/guestfish-actions.pod:4878 ../src/guestfs-actions.pod:7377
14319 msgid "Some internal mounts are not unmounted by this call."
14323 #: ../fish/guestfish-actions.pod:4880
14328 #: ../fish/guestfish-actions.pod:4882
14331 " upload (filename|-) remotefilename\n"
14336 #: ../fish/guestfish-actions.pod:4884 ../fish/guestfish-actions.pod:4897 ../src/guestfs-actions.pod:7390 ../src/guestfs-actions.pod:7414
14337 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14341 #: ../fish/guestfish-actions.pod:4889
14342 msgid "See also L</download>."
14346 #: ../fish/guestfish-actions.pod:4893
14347 msgid "upload-offset"
14351 #: ../fish/guestfish-actions.pod:4895
14354 " upload-offset (filename|-) remotefilename offset\n"
14359 #: ../fish/guestfish-actions.pod:4900 ../src/guestfs-actions.pod:7417
14361 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14362 "The intention is to overwrite parts of existing files or devices, although "
14363 "if a non-existant file is specified then it is created with a \"hole\" "
14364 "before C<offset>. The size of the data written is implicit in the size of "
14365 "the source C<filename>."
14369 #: ../fish/guestfish-actions.pod:4907
14371 "Note that there is no limit on the amount of data that can be uploaded with "
14372 "this call, unlike with L</pwrite>, and this call always writes the full "
14373 "amount unless an error occurs."
14377 #: ../fish/guestfish-actions.pod:4912
14378 msgid "See also L</upload>, L</pwrite>."
14382 #: ../fish/guestfish-actions.pod:4916
14387 #: ../fish/guestfish-actions.pod:4918
14390 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14395 #: ../fish/guestfish-actions.pod:4920 ../src/guestfs-actions.pod:7450
14396 msgid "This command sets the timestamps of a file with nanosecond precision."
14400 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7453
14402 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14407 #: ../fish/guestfish-actions.pod:4926 ../src/guestfs-actions.pod:7456
14409 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14410 "nanoseconds from the epoch."
14414 #: ../fish/guestfish-actions.pod:4929 ../src/guestfs-actions.pod:7459
14416 "If the C<*nsecs> field contains the special value C<-1> then the "
14417 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14418 "ignored in this case)."
14422 #: ../fish/guestfish-actions.pod:4933 ../src/guestfs-actions.pod:7463
14424 "If the C<*nsecs> field contains the special value C<-2> then the "
14425 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14430 #: ../fish/guestfish-actions.pod:4937
14435 #: ../fish/guestfish-actions.pod:4939
14443 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7476
14444 msgid "Return the libguestfs version number that the program is linked against."
14448 #: ../fish/guestfish-actions.pod:4944 ../src/guestfs-actions.pod:7479
14450 "Note that because of dynamic linking this is not necessarily the version of "
14451 "libguestfs that you compiled against. You can compile the program, and then "
14452 "at runtime dynamically link against a completely different C<libguestfs.so> "
14457 #: ../fish/guestfish-actions.pod:4949 ../src/guestfs-actions.pod:7484
14459 "This call was added in version C<1.0.58>. In previous versions of "
14460 "libguestfs there was no way to get the version number. From C code you can "
14461 "use dynamic linker functions to find out if this symbol exists (if it "
14462 "doesn't, then it's an earlier version)."
14466 #: ../fish/guestfish-actions.pod:4955 ../src/guestfs-actions.pod:7490
14468 "The call returns a structure with four elements. The first three (C<major>, "
14469 "C<minor> and C<release>) are numbers and correspond to the usual version "
14470 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14471 "but may be used for distro-specific information."
14475 #: ../fish/guestfish-actions.pod:4961 ../src/guestfs-actions.pod:7496
14476 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
14480 #: ../fish/guestfish-actions.pod:4964 ../src/guestfs-actions.pod:7499
14481 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14485 #: ../fish/guestfish-actions.pod:4966
14487 "I<Note:> Don't use this call to test for availability of features. In "
14488 "enterprise distributions we backport features from later versions into "
14489 "earlier versions, making this an unreliable way to test for features. Use "
14490 "L</available> instead."
14494 #: ../fish/guestfish-actions.pod:4972
14499 #: ../fish/guestfish-actions.pod:4974
14502 " vfs-label device\n"
14507 #: ../fish/guestfish-actions.pod:4976 ../src/guestfs-actions.pod:7519
14508 msgid "This returns the filesystem label of the filesystem on C<device>."
14512 #: ../fish/guestfish-actions.pod:4979 ../src/guestfs-actions.pod:7522
14513 msgid "If the filesystem is unlabeled, this returns the empty string."
14517 #: ../fish/guestfish-actions.pod:4981
14518 msgid "To find a filesystem from the label, use L</findfs-label>."
14522 #: ../fish/guestfish-actions.pod:4983
14527 #: ../fish/guestfish-actions.pod:4985
14530 " vfs-type device\n"
14535 #: ../fish/guestfish-actions.pod:4987 ../src/guestfs-actions.pod:7537
14537 "This command gets the filesystem type corresponding to the filesystem on "
14542 #: ../fish/guestfish-actions.pod:4990 ../src/guestfs-actions.pod:7540
14544 "For most filesystems, the result is the name of the Linux VFS module which "
14545 "would be used to mount this filesystem if you mounted it without specifying "
14546 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14550 #: ../fish/guestfish-actions.pod:4995
14555 #: ../fish/guestfish-actions.pod:4997
14558 " vfs-uuid device\n"
14563 #: ../fish/guestfish-actions.pod:4999 ../src/guestfs-actions.pod:7556
14564 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14568 #: ../fish/guestfish-actions.pod:5002 ../src/guestfs-actions.pod:7559
14569 msgid "If the filesystem does not have a UUID, this returns the empty string."
14573 #: ../fish/guestfish-actions.pod:5004
14574 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
14578 #: ../fish/guestfish-actions.pod:5006
14579 msgid "vg-activate"
14583 #: ../fish/guestfish-actions.pod:5008
14586 " vg-activate true|false 'volgroups ...'\n"
14591 #: ../fish/guestfish-actions.pod:5010 ../src/guestfs-actions.pod:7575
14593 "This command activates or (if C<activate> is false) deactivates all logical "
14594 "volumes in the listed volume groups C<volgroups>."
14598 #: ../fish/guestfish-actions.pod:5013 ../src/guestfs-actions.pod:7578
14599 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14603 #: ../fish/guestfish-actions.pod:5015 ../src/guestfs-actions.pod:7580
14605 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14606 "activated or deactivated."
14610 #: ../fish/guestfish-actions.pod:5018
14611 msgid "vg-activate-all"
14615 #: ../fish/guestfish-actions.pod:5020
14618 " vg-activate-all true|false\n"
14623 #: ../fish/guestfish-actions.pod:5022 ../src/guestfs-actions.pod:7593
14625 "This command activates or (if C<activate> is false) deactivates all logical "
14626 "volumes in all volume groups."
14630 #: ../fish/guestfish-actions.pod:5025 ../src/guestfs-actions.pod:7596
14631 msgid "This command is the same as running C<vgchange -a y|n>"
14635 #: ../fish/guestfish-actions.pod:5027
14640 #: ../fish/guestfish-actions.pod:5029
14643 " vgcreate volgroup 'physvols ...'\n"
14648 #: ../fish/guestfish-actions.pod:5031 ../src/guestfs-actions.pod:7609
14650 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14651 "of physical volumes C<physvols>."
14655 #: ../fish/guestfish-actions.pod:5034
14660 #: ../fish/guestfish-actions.pod:5036
14663 " vglvuuids vgname\n"
14668 #: ../fish/guestfish-actions.pod:5038 ../src/guestfs-actions.pod:7622
14670 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14671 "volumes created in this volume group."
14675 #: ../fish/guestfish-actions.pod:5041
14677 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
14678 "logical volumes and volume groups."
14682 #: ../fish/guestfish-actions.pod:5044
14683 msgid "See also L</vgpvuuids>."
14687 #: ../fish/guestfish-actions.pod:5046
14692 #: ../fish/guestfish-actions.pod:5048
14695 " vgpvuuids vgname\n"
14700 #: ../fish/guestfish-actions.pod:5050 ../src/guestfs-actions.pod:7642
14702 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14703 "volumes that this volume group resides on."
14707 #: ../fish/guestfish-actions.pod:5053
14709 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
14710 "physical volumes and volume groups."
14714 #: ../fish/guestfish-actions.pod:5056
14715 msgid "See also L</vglvuuids>."
14719 #: ../fish/guestfish-actions.pod:5058
14724 #: ../fish/guestfish-actions.pod:5060
14727 " vgremove vgname\n"
14732 #: ../fish/guestfish-actions.pod:5062 ../src/guestfs-actions.pod:7662
14733 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14737 #: ../fish/guestfish-actions.pod:5064 ../src/guestfs-actions.pod:7664
14738 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
14742 #: ../fish/guestfish-actions.pod:5067
14747 #: ../fish/guestfish-actions.pod:5069
14750 " vgrename volgroup newvolgroup\n"
14755 #: ../fish/guestfish-actions.pod:5071 ../src/guestfs-actions.pod:7678
14756 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14760 #: ../fish/guestfish-actions.pod:5073
14765 #: ../fish/guestfish-actions.pod:5075
14773 #: ../fish/guestfish-actions.pod:5077 ../src/guestfs-actions.pod:7689
14775 "List all the volumes groups detected. This is the equivalent of the "
14776 "L<vgs(8)> command."
14780 #: ../fish/guestfish-actions.pod:5080 ../src/guestfs-actions.pod:7692
14782 "This returns a list of just the volume group names that were detected "
14783 "(eg. C<VolGroup00>)."
14787 #: ../fish/guestfish-actions.pod:5083
14788 msgid "See also L</vgs-full>."
14792 #: ../fish/guestfish-actions.pod:5085
14797 #: ../fish/guestfish-actions.pod:5087
14805 #: ../fish/guestfish-actions.pod:5089 ../src/guestfs-actions.pod:7708
14807 "List all the volumes groups detected. This is the equivalent of the "
14808 "L<vgs(8)> command. The \"full\" version includes all fields."
14812 #: ../fish/guestfish-actions.pod:5092
14817 #: ../fish/guestfish-actions.pod:5094
14825 #: ../fish/guestfish-actions.pod:5096 ../src/guestfs-actions.pod:7722
14827 "This rescans all block devices and rebuilds the list of LVM physical "
14828 "volumes, volume groups and logical volumes."
14832 #: ../fish/guestfish-actions.pod:5099
14837 #: ../fish/guestfish-actions.pod:5101
14845 #: ../fish/guestfish-actions.pod:5103 ../src/guestfs-actions.pod:7735
14846 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14850 #: ../fish/guestfish-actions.pod:5105
14855 #: ../fish/guestfish-actions.pod:5107
14863 #: ../fish/guestfish-actions.pod:5109 ../src/guestfs-actions.pod:7775
14865 "This command counts the characters in a file, using the C<wc -c> external "
14870 #: ../fish/guestfish-actions.pod:5112
14875 #: ../fish/guestfish-actions.pod:5114
14883 #: ../fish/guestfish-actions.pod:5116 ../src/guestfs-actions.pod:7788
14885 "This command counts the lines in a file, using the C<wc -l> external "
14890 #: ../fish/guestfish-actions.pod:5119
14895 #: ../fish/guestfish-actions.pod:5121
14903 #: ../fish/guestfish-actions.pod:5123 ../src/guestfs-actions.pod:7801
14905 "This command counts the words in a file, using the C<wc -w> external "
14910 #: ../fish/guestfish-actions.pod:5126
14915 #: ../fish/guestfish-actions.pod:5128
14918 " write path content\n"
14923 #: ../fish/guestfish-actions.pod:5130 ../src/guestfs-actions.pod:7816
14925 "This call creates a file called C<path>. The content of the file is the "
14926 "string C<content> (which can contain any 8 bit data)."
14930 #: ../fish/guestfish-actions.pod:5133
14931 msgid "See also L</write-append>."
14935 #: ../fish/guestfish-actions.pod:5138
14936 msgid "write-append"
14940 #: ../fish/guestfish-actions.pod:5140
14943 " write-append path content\n"
14948 #: ../fish/guestfish-actions.pod:5142 ../src/guestfs-actions.pod:7836
14950 "This call appends C<content> to the end of file C<path>. If C<path> does "
14951 "not exist, then a new file is created."
14955 #: ../fish/guestfish-actions.pod:5145
14956 msgid "See also L</write>."
14960 #: ../fish/guestfish-actions.pod:5150
14965 #: ../fish/guestfish-actions.pod:5152
14968 " write-file path content size\n"
14973 #: ../fish/guestfish-actions.pod:5154 ../src/guestfs-actions.pod:7863
14975 "This call creates a file called C<path>. The contents of the file is the "
14976 "string C<content> (which can contain any 8 bit data), with length C<size>."
14980 #: ../fish/guestfish-actions.pod:5158 ../src/guestfs-actions.pod:7867
14982 "As a special case, if C<size> is C<0> then the length is calculated using "
14983 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14987 #: ../fish/guestfish-actions.pod:5162 ../src/guestfs-actions.pod:7871
14989 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14990 "I<not> work, even if the length is specified."
14994 #: ../fish/guestfish-actions.pod:5168
14995 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
14999 #: ../fish/guestfish-actions.pod:5175
15004 #: ../fish/guestfish-actions.pod:5177
15007 " zegrep regex path\n"
15012 #: ../fish/guestfish-actions.pod:5179 ../src/guestfs-actions.pod:7888
15013 msgid "This calls the external C<zegrep> program and returns the matching lines."
15017 #: ../fish/guestfish-actions.pod:5185
15022 #: ../fish/guestfish-actions.pod:5187
15025 " zegrepi regex path\n"
15030 #: ../fish/guestfish-actions.pod:5189 ../src/guestfs-actions.pod:7907
15031 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
15035 #: ../fish/guestfish-actions.pod:5195
15040 #: ../fish/guestfish-actions.pod:5197
15048 #: ../fish/guestfish-actions.pod:5199 ../src/guestfs-actions.pod:7925
15049 msgid "This command writes zeroes over the first few blocks of C<device>."
15053 #: ../fish/guestfish-actions.pod:5201 ../src/guestfs-actions.pod:7927
15055 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15056 "securely wipe the device). It should be sufficient to remove any partition "
15057 "tables, filesystem superblocks and so on."
15061 #: ../fish/guestfish-actions.pod:5205 ../fish/guestfish-actions.pod:5220 ../src/guestfs-actions.pod:7931 ../src/guestfs-actions.pod:7957
15063 "If blocks are already zero, then this command avoids writing zeroes. This "
15064 "prevents the underlying device from becoming non-sparse or growing "
15069 #: ../fish/guestfish-actions.pod:5209
15070 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
15074 #: ../fish/guestfish-actions.pod:5212
15075 msgid "zero-device"
15079 #: ../fish/guestfish-actions.pod:5214
15082 " zero-device device\n"
15087 #: ../fish/guestfish-actions.pod:5216
15089 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
15090 "which just zeroes the first few blocks of a device."
15094 #: ../fish/guestfish-actions.pod:5227
15099 #: ../fish/guestfish-actions.pod:5229
15102 " zerofree device\n"
15107 #: ../fish/guestfish-actions.pod:5231 ../src/guestfs-actions.pod:7979
15109 "This runs the I<zerofree> program on C<device>. This program claims to zero "
15110 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
15111 "possible to compress the filesystem more effectively."
15115 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:7984
15116 msgid "You should B<not> run this program if the filesystem is mounted."
15120 #: ../fish/guestfish-actions.pod:5239 ../src/guestfs-actions.pod:7987
15122 "It is possible that using this program can damage the filesystem or data on "
15127 #: ../fish/guestfish-actions.pod:5242
15132 #: ../fish/guestfish-actions.pod:5244
15135 " zfgrep pattern path\n"
15140 #: ../fish/guestfish-actions.pod:5246 ../src/guestfs-actions.pod:8001
15141 msgid "This calls the external C<zfgrep> program and returns the matching lines."
15145 #: ../fish/guestfish-actions.pod:5252
15150 #: ../fish/guestfish-actions.pod:5254
15153 " zfgrepi pattern path\n"
15158 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8020
15159 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
15163 #: ../fish/guestfish-actions.pod:5262
15168 #: ../fish/guestfish-actions.pod:5264
15171 " zfile meth path\n"
15176 #: ../fish/guestfish-actions.pod:5266 ../src/guestfs-actions.pod:8046
15177 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
15181 #: ../fish/guestfish-actions.pod:5269 ../src/guestfs-actions.pod:8049
15182 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15186 #: ../fish/guestfish-actions.pod:5271
15187 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
15191 #: ../fish/guestfish-actions.pod:5274
15192 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
15196 #: ../fish/guestfish-actions.pod:5281
15201 #: ../fish/guestfish-actions.pod:5283
15204 " zgrep regex path\n"
15209 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:8066
15210 msgid "This calls the external C<zgrep> program and returns the matching lines."
15214 #: ../fish/guestfish-actions.pod:5291
15219 #: ../fish/guestfish-actions.pod:5293
15222 " zgrepi regex path\n"
15227 #: ../fish/guestfish-actions.pod:5295 ../src/guestfs-actions.pod:8085
15228 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
15232 #: ../fish/guestfish-commands.pod:1
15237 #: ../fish/guestfish-commands.pod:3
15242 #: ../fish/guestfish-commands.pod:5
15245 " alloc filename size\n"
15250 #: ../fish/guestfish-commands.pod:7
15252 "This creates an empty (zeroed) file of the given size, and then adds so it "
15253 "can be further examined."
15257 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
15258 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
15262 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
15263 msgid "Size can be specified using standard suffixes, eg. C<1M>."
15267 #: ../fish/guestfish-commands.pod:14
15269 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
15270 "image, see L</PREPARED DISK IMAGES>."
15274 #: ../fish/guestfish-commands.pod:17
15279 #: ../fish/guestfish-commands.pod:19
15282 " copy-in local [local ...] /remotedir\n"
15287 #: ../fish/guestfish-commands.pod:21
15289 "C<copy-in> copies local files or directories recursively into the disk "
15290 "image, placing them in the directory called C</remotedir> (which must "
15291 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
15292 "other commands as necessary."
15296 #: ../fish/guestfish-commands.pod:26
15298 "Multiple local files and directories can be specified, but the last "
15299 "parameter must always be a remote directory. Wildcards cannot be used."
15303 #: ../fish/guestfish-commands.pod:30
15308 #: ../fish/guestfish-commands.pod:32
15311 " copy-out remote [remote ...] localdir\n"
15316 #: ../fish/guestfish-commands.pod:34
15318 "C<copy-out> copies remote files or directories recursively out of the disk "
15319 "image, placing them on the host disk in a local directory called C<localdir> "
15320 "(which must exist). This guestfish meta-command turns into a sequence of "
15321 "L</download>, L</tar-out> and other commands as necessary."
15325 #: ../fish/guestfish-commands.pod:40
15327 "Multiple remote files and directories can be specified, but the last "
15328 "parameter must always be a local directory. To download to the current "
15329 "directory, use C<.> as in:"
15333 #: ../fish/guestfish-commands.pod:44
15336 " copy-out /home .\n"
15341 #: ../fish/guestfish-commands.pod:46
15343 "Wildcards cannot be used in the ordinary command, but you can use them with "
15344 "the help of L</glob> like this:"
15348 #: ../fish/guestfish-commands.pod:49
15351 " glob copy-out /home/* .\n"
15356 #: ../fish/guestfish-commands.pod:51
15361 #: ../fish/guestfish-commands.pod:53
15364 " display filename\n"
15369 #: ../fish/guestfish-commands.pod:55
15371 "Use C<display> (a graphical display program) to display an image file. It "
15372 "downloads the file, and runs C<display> on it."
15376 #: ../fish/guestfish-commands.pod:58
15378 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15379 "environment variable. For example to use the GNOME display program:"
15383 #: ../fish/guestfish-commands.pod:61
15386 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15391 #: ../fish/guestfish-commands.pod:63
15392 msgid "See also L<display(1)>."
15396 #: ../fish/guestfish-commands.pod:65
15401 #: ../fish/guestfish-commands.pod:67
15404 " echo [params ...]\n"
15409 #: ../fish/guestfish-commands.pod:69
15410 msgid "This echos the parameters to the terminal."
15414 #: ../fish/guestfish-commands.pod:71
15419 #: ../fish/guestfish-commands.pod:73
15424 #: ../fish/guestfish-commands.pod:75
15429 #: ../fish/guestfish-commands.pod:77
15437 #: ../fish/guestfish-commands.pod:79
15439 "This is used to edit a file. It downloads the file, edits it locally using "
15440 "your editor, then uploads the result."
15444 #: ../fish/guestfish-commands.pod:82
15446 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
15447 "or C<emacs> you will get those corresponding editors."
15451 #: ../fish/guestfish-commands.pod:86
15456 #: ../fish/guestfish-commands.pod:88
15459 " glob command args...\n"
15464 #: ../fish/guestfish-commands.pod:90
15466 "Expand wildcards in any paths in the args list, and run C<command> "
15467 "repeatedly on each matching path."
15471 #: ../fish/guestfish-commands.pod:93
15472 msgid "See L</WILDCARDS AND GLOBBING>."
15476 #: ../fish/guestfish-commands.pod:95
15481 #: ../fish/guestfish-commands.pod:97
15484 " hexedit <filename|device>\n"
15485 " hexedit <filename|device> <max>\n"
15486 " hexedit <filename|device> <start> <max>\n"
15491 #: ../fish/guestfish-commands.pod:101
15493 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
15498 #: ../fish/guestfish-commands.pod:104
15500 "This command works by downloading potentially the whole file or device, "
15501 "editing it locally, then uploading it. If the file or device is large, you "
15502 "have to specify which part you wish to edit by using C<max> and/or C<start> "
15503 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
15504 "usual modifiers allowed such as C<1M> (1 megabyte)."
15508 #: ../fish/guestfish-commands.pod:111
15509 msgid "For example to edit the first few sectors of a disk you might do:"
15513 #: ../fish/guestfish-commands.pod:114
15516 " hexedit /dev/sda 1M\n"
15521 #: ../fish/guestfish-commands.pod:116
15523 "which would allow you to edit anywhere within the first megabyte of the "
15528 #: ../fish/guestfish-commands.pod:119
15529 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
15533 #: ../fish/guestfish-commands.pod:121
15536 " hexedit /dev/sda1 0x400 0x400\n"
15541 #: ../fish/guestfish-commands.pod:123
15542 msgid "(assuming the superblock is in the standard location)."
15546 #: ../fish/guestfish-commands.pod:125
15548 "This command requires the external L<hexedit(1)> program. You can specify "
15549 "another program to use by setting the C<HEXEDITOR> environment variable."
15553 #: ../fish/guestfish-commands.pod:129
15554 msgid "See also L</hexdump>."
15558 #: ../fish/guestfish-commands.pod:131
15563 #: ../fish/guestfish-commands.pod:133
15571 #: ../fish/guestfish-commands.pod:135
15572 msgid "Change the local directory, ie. the current directory of guestfish itself."
15576 #: ../fish/guestfish-commands.pod:138
15577 msgid "Note that C<!cd> won't do what you might expect."
15581 #: ../fish/guestfish-commands.pod:140
15586 #: ../fish/guestfish-commands.pod:142
15591 #: ../fish/guestfish-commands.pod:144
15599 #: ../fish/guestfish-commands.pod:146
15600 msgid "Opens the manual page for guestfish."
15604 #: ../fish/guestfish-commands.pod:148
15609 #: ../fish/guestfish-commands.pod:150
15614 #: ../fish/guestfish-commands.pod:152
15622 #: ../fish/guestfish-commands.pod:154
15630 #: ../fish/guestfish-commands.pod:156
15631 msgid "This is used to view a file."
15635 #: ../fish/guestfish-commands.pod:158
15637 "The default viewer is C<$PAGER>. However if you use the alternate command "
15638 "C<less> you will get the C<less> command specifically."
15642 #: ../fish/guestfish-commands.pod:161
15647 #: ../fish/guestfish-commands.pod:163
15655 #: ../fish/guestfish-commands.pod:165
15657 "Close and reopen the libguestfs handle. It is not necessary to use this "
15658 "normally, because the handle is closed properly when guestfish exits. "
15659 "However this is occasionally useful for testing."
15663 #: ../fish/guestfish-commands.pod:169
15668 #: ../fish/guestfish-commands.pod:171
15671 " setenv VAR value\n"
15676 #: ../fish/guestfish-commands.pod:173
15677 msgid "Set the environment variable C<VAR> to the string C<value>."
15681 #: ../fish/guestfish-commands.pod:175
15682 msgid "To print the value of an environment variable use a shell command such as:"
15686 #: ../fish/guestfish-commands.pod:178
15694 #: ../fish/guestfish-commands.pod:180
15699 #: ../fish/guestfish-commands.pod:182
15702 " sparse filename size\n"
15707 #: ../fish/guestfish-commands.pod:184
15709 "This creates an empty sparse file of the given size, and then adds so it can "
15710 "be further examined."
15714 #: ../fish/guestfish-commands.pod:187
15716 "In all respects it works the same as the L</alloc> command, except that the "
15717 "image file is allocated sparsely, which means that disk blocks are not "
15718 "assigned to the file until they are needed. Sparse disk files only use "
15719 "space when written to, but they are slower and there is a danger you could "
15720 "run out of real disk space during a write operation."
15724 #: ../fish/guestfish-commands.pod:197
15729 #: ../fish/guestfish-commands.pod:199
15737 #: ../fish/guestfish-commands.pod:201
15739 "This command returns a list of the optional groups known to the daemon, and "
15740 "indicates which ones are supported by this build of the libguestfs "
15745 #: ../fish/guestfish-commands.pod:205
15746 msgid "See also L<guestfs(3)/AVAILABILITY>."
15750 #: ../fish/guestfish-commands.pod:207
15755 #: ../fish/guestfish-commands.pod:209
15758 " time command args...\n"
15763 #: ../fish/guestfish-commands.pod:211
15765 "Run the command as usual, but print the elapsed time afterwards. This can "
15766 "be useful for benchmarking operations."
15770 #: ../fish/guestfish-commands.pod:214
15775 #: ../fish/guestfish-commands.pod:216
15783 #: ../fish/guestfish-commands.pod:218
15784 msgid "Remove C<VAR> from the environment."
15788 #: ../fish/guestfish.pod:5
15789 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15793 #: ../fish/guestfish.pod:9
15796 " guestfish [--options] [commands]\n"
15801 #: ../fish/guestfish.pod:11
15809 #: ../fish/guestfish.pod:13
15812 " guestfish [--ro|--rw] -a disk.img\n"
15817 #: ../fish/guestfish.pod:15
15820 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
15825 #: ../fish/guestfish.pod:17
15828 " guestfish -d libvirt-domain\n"
15833 #: ../fish/guestfish.pod:19
15836 " guestfish [--ro|--rw] -a disk.img -i\n"
15841 #: ../fish/guestfish.pod:21
15844 " guestfish -d libvirt-domain -i\n"
15849 #: ../fish/guestfish.pod:25
15851 "Using guestfish in read/write mode on live virtual machines can be "
15852 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15853 "option to use guestfish safely if the disk image or virtual machine might be "
15858 #: ../fish/guestfish.pod:32
15860 "Guestfish is a shell and command-line tool for examining and modifying "
15861 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15862 "functionality of the guestfs API, see L<guestfs(3)>."
15866 #: ../fish/guestfish.pod:36
15868 "Guestfish gives you structured access to the libguestfs API, from shell "
15869 "scripts or the command line or interactively. If you want to rescue a "
15870 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15875 #: ../fish/guestfish.pod:43
15876 msgid "As an interactive shell"
15880 #: ../fish/guestfish.pod:45
15888 #: ../fish/guestfish.pod:47
15891 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15892 " editing virtual machine filesystems.\n"
15897 #: ../fish/guestfish.pod:50
15900 " Type: 'help' for a list of commands\n"
15901 " 'man' to read the manual\n"
15902 " 'quit' to quit the shell\n"
15907 #: ../fish/guestfish.pod:54
15910 " ><fs> add-ro disk.img\n"
15912 " ><fs> list-filesystems\n"
15913 " /dev/sda1: ext4\n"
15914 " /dev/vg_guest/lv_root: ext4\n"
15915 " /dev/vg_guest/lv_swap: swap\n"
15916 " ><fs> mount /dev/vg_guest/lv_root /\n"
15917 " ><fs> cat /etc/fstab\n"
15919 " # Created by anaconda\n"
15926 #: ../fish/guestfish.pod:67
15927 msgid "From shell scripts"
15931 #: ../fish/guestfish.pod:69
15932 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15936 #: ../fish/guestfish.pod:71
15939 " guestfish <<_EOF_\n"
15942 " mount /dev/vg_guest/lv_root /\n"
15943 " write /etc/motd \"Welcome, new users\"\n"
15949 #: ../fish/guestfish.pod:78
15950 msgid "List the LVM logical volumes in a disk image:"
15954 #: ../fish/guestfish.pod:80
15957 " guestfish -a disk.img --ro <<_EOF_\n"
15965 #: ../fish/guestfish.pod:85
15966 msgid "List all the filesystems in a disk image:"
15970 #: ../fish/guestfish.pod:87
15973 " guestfish -a disk.img --ro <<_EOF_\n"
15975 " list-filesystems\n"
15981 #: ../fish/guestfish.pod:92
15982 msgid "On one command line"
15986 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
15987 msgid "Update C</etc/resolv.conf> in a guest:"
15991 #: ../fish/guestfish.pod:96
15995 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15996 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16001 #: ../fish/guestfish.pod:100
16002 msgid "Edit C</boot/grub/grub.conf> interactively:"
16006 #: ../fish/guestfish.pod:102
16009 " guestfish --rw --add disk.img \\\n"
16010 " --mount /dev/vg_guest/lv_root \\\n"
16011 " --mount /dev/sda1:/boot \\\n"
16012 " edit /boot/grub/grub.conf\n"
16017 #: ../fish/guestfish.pod:107
16018 msgid "Mount disks automatically"
16022 #: ../fish/guestfish.pod:109
16024 "Use the I<-i> option to automatically mount the disks from a virtual "
16029 #: ../fish/guestfish.pod:112
16032 " guestfish --ro -a disk.img -i cat /etc/group\n"
16037 #: ../fish/guestfish.pod:114
16040 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16045 #: ../fish/guestfish.pod:116
16046 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16050 #: ../fish/guestfish.pod:118
16053 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16058 #: ../fish/guestfish.pod:120
16059 msgid "As a script interpreter"
16063 #: ../fish/guestfish.pod:122
16064 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16068 #: ../fish/guestfish.pod:124
16071 " #!/usr/bin/guestfish -f\n"
16072 " sparse test1.img 100M\n"
16074 " part-disk /dev/sda mbr\n"
16075 " mkfs ext2 /dev/sda1\n"
16080 #: ../fish/guestfish.pod:130
16081 msgid "Start with a prepared disk"
16085 #: ../fish/guestfish.pod:132
16087 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16088 "single ext2-formatted partition:"
16092 #: ../fish/guestfish.pod:135
16095 " guestfish -N fs\n"
16100 #: ../fish/guestfish.pod:137
16101 msgid "To list what is available do:"
16105 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1009
16108 " guestfish -N help | less\n"
16113 #: ../fish/guestfish.pod:141
16114 msgid "Remote control"
16118 #: ../fish/guestfish.pod:143
16121 " eval \"`guestfish --listen`\"\n"
16122 " guestfish --remote add-ro disk.img\n"
16123 " guestfish --remote run\n"
16124 " guestfish --remote lvs\n"
16129 #: ../fish/guestfish.pod:154
16130 msgid "Displays general help on options."
16134 #: ../fish/guestfish.pod:158
16135 msgid "B<--cmd-help>"
16139 #: ../fish/guestfish.pod:160
16140 msgid "Lists all available guestfish commands."
16144 #: ../fish/guestfish.pod:162
16149 #: ../fish/guestfish.pod:164
16150 msgid "B<--cmd-help cmd>"
16154 #: ../fish/guestfish.pod:166
16155 msgid "Displays detailed help on a single command C<cmd>."
16159 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
16160 msgid "B<-a image>"
16164 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
16165 msgid "B<--add image>"
16169 #: ../fish/guestfish.pod:172
16170 msgid "Add a block device or virtual machine image to the shell."
16174 #: ../fish/guestfish.pod:177
16176 "Using this flag is mostly equivalent to using the C<add> command, with "
16177 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
16178 "the I<--format=...> flag was given."
16182 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
16184 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16185 "URI to use. The default is to use the default libvirt connection."
16189 #: ../fish/guestfish.pod:189
16194 #: ../fish/guestfish.pod:191
16196 "If using the I<--listen> option and a csh-like shell, use this option. See "
16197 "section L</REMOTE CONTROL AND CSH> below."
16201 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
16202 msgid "B<-d libvirt-domain>"
16206 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
16207 msgid "B<--domain libvirt-domain>"
16211 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
16213 "Add disks from the named libvirt domain. If the I<--ro> option is also "
16214 "used, then any libvirt domain can be used. However in write mode, only "
16215 "libvirt domains which are shut down can be named here."
16219 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
16220 msgid "Domain UUIDs can be used instead of names."
16224 #: ../fish/guestfish.pod:204
16226 "Using this flag is mostly equivalent to using the C<add-domain> command, "
16227 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
16228 "if the I<--format:...> flag was given."
16232 #: ../fish/guestfish.pod:208
16237 #: ../fish/guestfish.pod:210
16238 msgid "B<--no-dest-paths>"
16242 #: ../fish/guestfish.pod:212
16244 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
16245 "to hit the tab key to complete paths on the guest filesystem, but this "
16246 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
16247 "allow this feature to be disabled."
16251 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
16253 "When prompting for keys and passphrases, guestfish normally turns echoing "
16254 "off so you cannot see what you are typing. If you are not worried about "
16255 "Tempest attacks and there is no one else in the room you can specify this "
16256 "flag to see what you are typing."
16260 #: ../fish/guestfish.pod:224
16265 #: ../fish/guestfish.pod:226
16266 msgid "B<--file file>"
16270 #: ../fish/guestfish.pod:228
16271 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
16275 #: ../fish/guestfish.pod:231
16278 " #!/usr/bin/guestfish -f\n"
16283 #: ../fish/guestfish.pod:244
16286 " guestfish --format=raw -a disk.img\n"
16291 #: ../fish/guestfish.pod:248
16294 " guestfish --format=raw -a disk.img --format -a another.img\n"
16299 #: ../fish/guestfish.pod:253
16301 "If you have untrusted raw-format guest disk images, you should use this "
16302 "option to specify the disk format. This avoids a possible security problem "
16303 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
16307 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
16308 msgid "B<--inspector>"
16312 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
16314 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
16315 "system and mount filesystems as they would be mounted on the real virtual "
16320 #: ../fish/guestfish.pod:266
16321 msgid "Typical usage is either:"
16325 #: ../fish/guestfish.pod:268
16328 " guestfish -d myguest -i\n"
16333 #: ../fish/guestfish.pod:270
16334 msgid "(for an inactive libvirt domain called I<myguest>), or:"
16338 #: ../fish/guestfish.pod:272
16341 " guestfish --ro -d myguest -i\n"
16346 #: ../fish/guestfish.pod:274
16347 msgid "(for active domains, readonly), or specify the block device directly:"
16351 #: ../fish/guestfish.pod:276
16354 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
16359 #: ../fish/guestfish.pod:278
16361 "Note that the command line syntax changed slightly over older versions of "
16362 "guestfish. You can still use the old syntax:"
16366 #: ../fish/guestfish.pod:281
16369 " guestfish [--ro] -i disk.img\n"
16374 #: ../fish/guestfish.pod:283
16377 " guestfish [--ro] -i libvirt-domain\n"
16382 #: ../fish/guestfish.pod:285
16384 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
16385 "then using other commands to mount the filesystems that were found."
16389 #: ../fish/guestfish.pod:294
16390 msgid "B<--listen>"
16394 #: ../fish/guestfish.pod:296
16396 "Fork into the background and listen for remote commands. See section "
16397 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16401 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
16406 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
16408 "Connect to a live virtual machine. (Experimental, see "
16409 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
16413 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
16414 msgid "B<-m dev[:mountpoint[:options]]>"
16418 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
16419 msgid "B<--mount dev[:mountpoint[:options]]>"
16423 #: ../fish/guestfish.pod:308
16424 msgid "Mount the named partition or logical volume on the given mountpoint."
16428 #: ../fish/guestfish.pod:310
16429 msgid "If the mountpoint is omitted, it defaults to C</>."
16433 #: ../fish/guestfish.pod:312
16434 msgid "You have to mount something on C</> before most commands will work."
16438 #: ../fish/guestfish.pod:314
16440 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16445 #: ../fish/guestfish.pod:317
16447 "If you don't know what filesystems a disk image contains, you can either run "
16448 "guestfish without this option, then list the partitions, filesystems and LVs "
16449 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
16450 "commands), or you can use the L<virt-filesystems(1)> program."
16454 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
16456 "The third (and rarely used) part of the mount parameter is the list of mount "
16457 "options used to mount the underlying filesystem. If this is not given, then "
16458 "the mount options are either the empty string or C<ro> (the latter if the "
16459 "I<--ro> flag is used). By specifying the mount options, you override this "
16460 "default choice. Probably the only time you would use this is to enable ACLs "
16461 "and/or extended attributes if the filesystem can support them:"
16465 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
16468 " -m /dev/sda1:/:acl,user_xattr\n"
16473 #: ../fish/guestfish.pod:333
16474 msgid "Using this flag is equivalent to using the C<mount-options> command."
16478 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193 ../resize/virt-resize.pod:358
16483 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
16484 msgid "B<--no-sync>"
16488 #: ../fish/guestfish.pod:339
16490 "Disable autosync. This is enabled by default. See the discussion of "
16491 "autosync in the L<guestfs(3)> manpage."
16495 #: ../fish/guestfish.pod:342
16500 #: ../fish/guestfish.pod:344
16501 msgid "B<--new type>"
16505 #: ../fish/guestfish.pod:346
16510 #: ../fish/guestfish.pod:348
16512 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16513 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16514 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16519 #: ../fish/guestfish.pod:353
16520 msgid "B<--progress-bars>"
16524 #: ../fish/guestfish.pod:355
16525 msgid "Enable progress bars, even when guestfish is used non-interactively."
16529 #: ../fish/guestfish.pod:357
16531 "Progress bars are enabled by default when guestfish is used as an "
16532 "interactive shell."
16536 #: ../fish/guestfish.pod:360
16537 msgid "B<--no-progress-bars>"
16541 #: ../fish/guestfish.pod:362
16542 msgid "Disable progress bars."
16546 #: ../fish/guestfish.pod:364
16547 msgid "B<--remote[=pid]>"
16551 #: ../fish/guestfish.pod:366
16553 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16554 "CONTROL GUESTFISH OVER A SOCKET> below."
16558 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239 ../rescue/virt-rescue.pod:161
16563 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241 ../rescue/virt-rescue.pod:163
16568 #: ../fish/guestfish.pod:373
16570 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16571 "mounts are done read-only."
16575 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
16577 "The option must always be used if the disk image or virtual machine might be "
16578 "running, and is generally recommended in cases where you don't need write "
16579 "access to the disk."
16583 #: ../fish/guestfish.pod:380
16585 "Note that prepared disk images created with I<-N> are not affected by this "
16586 "option. Also commands like C<add> are not affected - you have to specify "
16587 "the C<readonly:true> option explicitly if you need it."
16591 #: ../fish/guestfish.pod:384
16592 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16596 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253 ../rescue/virt-rescue.pod:173
16597 msgid "B<--selinux>"
16601 #: ../fish/guestfish.pod:388
16602 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16606 #: ../fish/guestfish.pod:394
16608 "Enable very verbose messages. This is particularly useful if you find a "
16613 #: ../fish/guestfish.pod:401
16614 msgid "Display the guestfish / libguestfs version number and exit."
16618 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269 ../rescue/virt-rescue.pod:194
16623 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271 ../rescue/virt-rescue.pod:196
16628 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
16630 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16631 "mounts are done read-write."
16635 #: ../fish/guestfish.pod:410
16636 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
16640 #: ../fish/guestfish.pod:414
16641 msgid "Echo each command before executing it."
16645 #: ../fish/guestfish.pod:418
16646 msgid "COMMANDS ON COMMAND LINE"
16650 #: ../fish/guestfish.pod:420
16651 msgid "Any additional (non-option) arguments are treated as commands to execute."
16655 #: ../fish/guestfish.pod:423
16657 "Commands to execute should be separated by a colon (C<:>), where the colon "
16658 "is a separate parameter. Thus:"
16662 #: ../fish/guestfish.pod:426
16665 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16670 #: ../fish/guestfish.pod:428
16672 "If there are no additional arguments, then we enter a shell, either an "
16673 "interactive shell with a prompt (if the input is a terminal) or a "
16674 "non-interactive shell."
16678 #: ../fish/guestfish.pod:432
16680 "In either command line mode or non-interactive shell, the first command that "
16681 "gives an error causes the whole shell to exit. In interactive mode (with a "
16682 "prompt) if a command fails, you can continue to enter commands."
16686 #: ../fish/guestfish.pod:437
16687 msgid "USING launch (OR run)"
16691 #: ../fish/guestfish.pod:439
16693 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16694 "then launch it, then mount any disks you need, and finally issue "
16695 "actions/commands. So the general order of the day is:"
16699 #: ../fish/guestfish.pod:447
16700 msgid "add or -a/--add"
16704 #: ../fish/guestfish.pod:451
16705 msgid "launch (aka run)"
16709 #: ../fish/guestfish.pod:455
16710 msgid "mount or -m/--mount"
16714 #: ../fish/guestfish.pod:459
16715 msgid "any other commands"
16719 #: ../fish/guestfish.pod:463
16721 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16722 "guest before mounting or performing any other commands."
16726 #: ../fish/guestfish.pod:466
16728 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16729 "I<--new> options were given then C<run> is done automatically, simply "
16730 "because guestfish can't perform the action you asked for without doing this."
16734 #: ../fish/guestfish.pod:471
16735 msgid "OPENING DISKS FOR READ AND WRITE"
16739 #: ../fish/guestfish.pod:473
16741 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
16742 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
16743 "I<-i> and I<-m> open disk images read-only or for writing."
16747 #: ../fish/guestfish.pod:478
16749 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
16750 "opening disk images supplied on the command line for write. To open a disk "
16751 "image read-only you have to do I<-a image --ro>."
16755 #: ../fish/guestfish.pod:482
16757 "This matters: If you accidentally open a live VM disk image writable then "
16758 "you will cause irreversible disk corruption."
16762 #: ../fish/guestfish.pod:485
16764 "In a future libguestfs we intend to change the default the other way. Disk "
16765 "images will be opened read-only. You will have to either specify "
16766 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
16767 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
16768 "access for disk images specified by those other command line options."
16772 #: ../fish/guestfish.pod:492
16774 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
16775 "which does nothing (it is already the default). However it is highly "
16776 "recommended that you use this option to indicate that you need write access, "
16777 "and prepare your scripts for the day when this option will be required for "
16782 #: ../fish/guestfish.pod:498
16784 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
16785 "other libguestfs program apart from guestfish and guestmount."
16789 #: ../fish/guestfish.pod:501
16794 #: ../fish/guestfish.pod:503
16796 "You can quote ordinary parameters using either single or double quotes. For "
16801 #: ../fish/guestfish.pod:506
16804 " add \"file with a space.img\"\n"
16809 #: ../fish/guestfish.pod:508
16812 " rm '/file name'\n"
16817 #: ../fish/guestfish.pod:510
16825 #: ../fish/guestfish.pod:512
16827 "A few commands require a list of strings to be passed. For these, use a "
16828 "whitespace-separated list, enclosed in quotes. Strings containing "
16829 "whitespace to be passed through must be enclosed in single quotes. A "
16830 "literal single quote must be escaped with a backslash."
16834 #: ../fish/guestfish.pod:517
16837 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16838 " command \"/bin/echo 'foo bar'\"\n"
16839 " command \"/bin/echo \\'foo\\'\"\n"
16844 #: ../fish/guestfish.pod:521
16845 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
16849 #: ../fish/guestfish.pod:523
16851 "In double-quoted arguments (only) use backslash to insert special "
16856 #: ../fish/guestfish.pod:528
16861 #: ../fish/guestfish.pod:530
16862 msgid "Alert (bell) character."
16866 #: ../fish/guestfish.pod:532
16871 #: ../fish/guestfish.pod:534
16872 msgid "Backspace character."
16876 #: ../fish/guestfish.pod:536
16881 #: ../fish/guestfish.pod:538
16882 msgid "Form feed character."
16886 #: ../fish/guestfish.pod:540
16891 #: ../fish/guestfish.pod:542
16892 msgid "Newline character."
16896 #: ../fish/guestfish.pod:544
16901 #: ../fish/guestfish.pod:546
16902 msgid "Carriage return character."
16906 #: ../fish/guestfish.pod:548
16911 #: ../fish/guestfish.pod:550
16912 msgid "Horizontal tab character."
16916 #: ../fish/guestfish.pod:552
16921 #: ../fish/guestfish.pod:554
16922 msgid "Vertical tab character."
16926 #: ../fish/guestfish.pod:556
16931 #: ../fish/guestfish.pod:558
16932 msgid "A literal double quote character."
16936 #: ../fish/guestfish.pod:560
16941 #: ../fish/guestfish.pod:562
16943 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
16948 #: ../fish/guestfish.pod:565
16953 #: ../fish/guestfish.pod:567
16954 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
16958 #: ../fish/guestfish.pod:570
16960 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
16965 #: ../fish/guestfish.pod:573
16970 #: ../fish/guestfish.pod:575
16971 msgid "A literal backslash character."
16975 #: ../fish/guestfish.pod:579
16976 msgid "OPTIONAL ARGUMENTS"
16980 #: ../fish/guestfish.pod:581
16982 "Some commands take optional arguments. These arguments appear in this "
16983 "documentation as C<[argname:..]>. You can use them as in these examples:"
16987 #: ../fish/guestfish.pod:585
16990 " add-drive-opts filename\n"
16995 #: ../fish/guestfish.pod:587
16998 " add-drive-opts filename readonly:true\n"
17003 #: ../fish/guestfish.pod:589
17006 " add-drive-opts filename format:qcow2 readonly:false\n"
17011 #: ../fish/guestfish.pod:591
17013 "Each optional argument can appear at most once. All optional arguments must "
17014 "appear after the required ones."
17018 #: ../fish/guestfish.pod:594
17023 #: ../fish/guestfish.pod:596
17024 msgid "This section applies to all commands which can take integers as parameters."
17028 #: ../fish/guestfish.pod:599
17029 msgid "SIZE SUFFIX"
17033 #: ../fish/guestfish.pod:601
17035 "When the command takes a parameter measured in bytes, you can use one of the "
17036 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17040 #: ../fish/guestfish.pod:607
17041 msgid "B<k> or B<K> or B<KiB>"
17045 #: ../fish/guestfish.pod:609
17046 msgid "The size in kilobytes (multiplied by 1024)."
17050 #: ../fish/guestfish.pod:611
17055 #: ../fish/guestfish.pod:613
17056 msgid "The size in SI 1000 byte units."
17060 #: ../fish/guestfish.pod:615
17061 msgid "B<M> or B<MiB>"
17065 #: ../fish/guestfish.pod:617
17066 msgid "The size in megabytes (multiplied by 1048576)."
17070 #: ../fish/guestfish.pod:619
17075 #: ../fish/guestfish.pod:621
17076 msgid "The size in SI 1000000 byte units."
17080 #: ../fish/guestfish.pod:623
17081 msgid "B<G> or B<GiB>"
17085 #: ../fish/guestfish.pod:625
17086 msgid "The size in gigabytes (multiplied by 2**30)."
17090 #: ../fish/guestfish.pod:627
17095 #: ../fish/guestfish.pod:629
17096 msgid "The size in SI 10**9 byte units."
17100 #: ../fish/guestfish.pod:631
17101 msgid "B<T> or B<TiB>"
17105 #: ../fish/guestfish.pod:633
17106 msgid "The size in terabytes (multiplied by 2**40)."
17110 #: ../fish/guestfish.pod:635
17115 #: ../fish/guestfish.pod:637
17116 msgid "The size in SI 10**12 byte units."
17120 #: ../fish/guestfish.pod:639
17121 msgid "B<P> or B<PiB>"
17125 #: ../fish/guestfish.pod:641
17126 msgid "The size in petabytes (multiplied by 2**50)."
17130 #: ../fish/guestfish.pod:643
17135 #: ../fish/guestfish.pod:645
17136 msgid "The size in SI 10**15 byte units."
17140 #: ../fish/guestfish.pod:647
17141 msgid "B<E> or B<EiB>"
17145 #: ../fish/guestfish.pod:649
17146 msgid "The size in exabytes (multiplied by 2**60)."
17150 #: ../fish/guestfish.pod:651
17155 #: ../fish/guestfish.pod:653
17156 msgid "The size in SI 10**18 byte units."
17160 #: ../fish/guestfish.pod:655
17161 msgid "B<Z> or B<ZiB>"
17165 #: ../fish/guestfish.pod:657
17166 msgid "The size in zettabytes (multiplied by 2**70)."
17170 #: ../fish/guestfish.pod:659
17175 #: ../fish/guestfish.pod:661
17176 msgid "The size in SI 10**21 byte units."
17180 #: ../fish/guestfish.pod:663
17181 msgid "B<Y> or B<YiB>"
17185 #: ../fish/guestfish.pod:665
17186 msgid "The size in yottabytes (multiplied by 2**80)."
17190 #: ../fish/guestfish.pod:667
17195 #: ../fish/guestfish.pod:669
17196 msgid "The size in SI 10**24 byte units."
17200 #: ../fish/guestfish.pod:675
17203 " truncate-size /file 1G\n"
17208 #: ../fish/guestfish.pod:677
17209 msgid "would truncate the file to 1 gigabyte."
17213 #: ../fish/guestfish.pod:679
17215 "Be careful because a few commands take sizes in kilobytes or megabytes "
17216 "(eg. the parameter to L</memsize> is specified in megabytes already). "
17217 "Adding a suffix will probably not do what you expect."
17221 #: ../fish/guestfish.pod:683
17222 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17226 #: ../fish/guestfish.pod:685
17228 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17229 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17233 #: ../fish/guestfish.pod:688
17236 " 1234 decimal number 1234\n"
17237 " 02322 octal number, equivalent to decimal 1234\n"
17238 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17243 #: ../fish/guestfish.pod:692
17245 "When using the C<chmod> command, you almost always want to specify an octal "
17246 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17247 "L<chmod(1)> program):"
17251 #: ../fish/guestfish.pod:696
17254 " chmod 0777 /public # OK\n"
17255 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17260 #: ../fish/guestfish.pod:699
17262 "Commands that return numbers usually print them in decimal, but some "
17263 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17264 "octal, preceeded by C<0>)."
17268 #: ../fish/guestfish.pod:703
17269 msgid "WILDCARDS AND GLOBBING"
17273 #: ../fish/guestfish.pod:705
17275 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17276 "(globbing) by default. So for example the following will not do what you "
17281 #: ../fish/guestfish.pod:709
17289 #: ../fish/guestfish.pod:711
17291 "Assuming you don't have a directory called literally C</home/*> then the "
17292 "above command will return an error."
17296 #: ../fish/guestfish.pod:714
17297 msgid "To perform wildcard expansion, use the C<glob> command."
17301 #: ../fish/guestfish.pod:716
17304 " glob rm-rf /home/*\n"
17309 #: ../fish/guestfish.pod:718
17311 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17312 "many times), equivalent to:"
17316 #: ../fish/guestfish.pod:721
17319 " rm-rf /home/jim\n"
17320 " rm-rf /home/joe\n"
17321 " rm-rf /home/mary\n"
17326 #: ../fish/guestfish.pod:725
17327 msgid "C<glob> only works on simple guest paths and not on device names."
17331 #: ../fish/guestfish.pod:727
17333 "If you have several parameters, each containing a wildcard, then glob will "
17334 "perform a Cartesian product."
17338 #: ../fish/guestfish.pod:730
17343 #: ../fish/guestfish.pod:732
17345 "Any line which starts with a I<#> character is treated as a comment and "
17346 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17347 "a command. For example:"
17351 #: ../fish/guestfish.pod:736
17354 " # this is a comment\n"
17355 " # this is a comment\n"
17356 " foo # NOT a comment\n"
17361 #: ../fish/guestfish.pod:740
17362 msgid "Blank lines are also ignored."
17366 #: ../fish/guestfish.pod:742
17367 msgid "RUNNING COMMANDS LOCALLY"
17371 #: ../fish/guestfish.pod:744
17373 "Any line which starts with a I<!> character is treated as a command sent to "
17374 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17378 #: ../fish/guestfish.pod:748
17382 " tgz-out /remote local/remote-data.tar.gz\n"
17387 #: ../fish/guestfish.pod:751
17389 "will create a directory C<local> on the host, and then export the contents "
17390 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17391 "(See C<tgz-out>)."
17395 #: ../fish/guestfish.pod:755
17397 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17398 "effect, due to the way that subprocesses work in Unix."
17402 #: ../fish/guestfish.pod:758
17403 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
17407 #: ../fish/guestfish.pod:760
17409 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
17410 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
17411 "and executed as guestfish commands."
17415 #: ../fish/guestfish.pod:764
17417 "Thus you can use shell script to construct arbitrary guestfish commands "
17418 "which are then parsed by guestfish."
17422 #: ../fish/guestfish.pod:767
17424 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
17425 "through C</foo.100>) using guestfish commands alone. However this is simple "
17426 "if we use a shell script to create the guestfish commands for us:"
17430 #: ../fish/guestfish.pod:772
17433 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
17438 #: ../fish/guestfish.pod:774
17439 msgid "or with names like C</foo.001>:"
17443 #: ../fish/guestfish.pod:776
17446 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
17451 #: ../fish/guestfish.pod:778
17453 "When using guestfish interactively it can be helpful to just run the shell "
17454 "script first (ie. remove the initial C<E<lt>> character so it is just an "
17455 "ordinary I<!> local command), see what guestfish commands it would run, and "
17456 "when you are happy with those prepend the C<E<lt>> character to run the "
17457 "guestfish commands for real."
17461 #: ../fish/guestfish.pod:784
17466 #: ../fish/guestfish.pod:786
17468 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17469 "command (a guestfish command) to the second command (any host command). For "
17474 #: ../fish/guestfish.pod:790
17477 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17482 #: ../fish/guestfish.pod:792
17484 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17485 "program). The above command would list all accounts in the guest filesystem "
17486 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17490 #: ../fish/guestfish.pod:797
17493 " hexdump /bin/ls | head\n"
17494 " list-devices | tail -1\n"
17495 " tgz-out / - | tar ztf -\n"
17500 #: ../fish/guestfish.pod:801
17502 "The space before the pipe symbol is required, any space after the pipe "
17503 "symbol is optional. Everything after the pipe symbol is just passed "
17504 "straight to the host shell, so it can contain redirections, globs and "
17505 "anything else that makes sense on the host side."
17509 #: ../fish/guestfish.pod:806
17511 "To use a literal argument which begins with a pipe symbol, you have to quote "
17516 #: ../fish/guestfish.pod:809
17524 #: ../fish/guestfish.pod:811
17525 msgid "HOME DIRECTORIES"
17529 #: ../fish/guestfish.pod:813
17531 "If a parameter starts with the character C<~> then the tilde may be expanded "
17532 "as a home directory path (either C<~> for the current user's home directory, "
17533 "or C<~user> for another user)."
17537 #: ../fish/guestfish.pod:817
17539 "Note that home directory expansion happens for users known I<on the host>, "
17540 "not in the guest filesystem."
17544 #: ../fish/guestfish.pod:820
17546 "To use a literal argument which begins with a tilde, you have to quote it, "
17551 #: ../fish/guestfish.pod:823
17559 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
17560 msgid "ENCRYPTED DISKS"
17564 #: ../fish/guestfish.pod:827
17566 "Libguestfs has some support for Linux guests encrypted according to the "
17567 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17568 "disk encryption systems used by modern Linux guests. Currently only "
17569 "LVM-on-LUKS is supported."
17573 #: ../fish/guestfish.pod:832
17574 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17578 #: ../fish/guestfish.pod:834
17581 " ><fs> vfs-type /dev/sda2\n"
17587 #: ../fish/guestfish.pod:837
17589 "Then open those devices using L</luks-open>. This creates a device-mapper "
17590 "device called C</dev/mapper/luksdev>."
17594 #: ../fish/guestfish.pod:840
17597 " ><fs> luks-open /dev/sda2 luksdev\n"
17598 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17603 #: ../fish/guestfish.pod:843
17605 "Finally you have to tell LVM to scan for volume groups on the newly created "
17610 #: ../fish/guestfish.pod:846
17614 " vg-activate-all true\n"
17619 #: ../fish/guestfish.pod:849
17620 msgid "The logical volume(s) can now be mounted in the usual way."
17624 #: ../fish/guestfish.pod:851
17626 "Before closing a LUKS device you must unmount any logical volumes on it and "
17627 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17628 "one. Then you can close the mapper device:"
17632 #: ../fish/guestfish.pod:855
17635 " vg-activate false /dev/VG\n"
17636 " luks-close /dev/mapper/luksdev\n"
17641 #: ../fish/guestfish.pod:860
17643 "If a path is prefixed with C<win:> then you can use Windows-style drive "
17644 "letters and paths (with some limitations). The following commands are "
17649 #: ../fish/guestfish.pod:864
17652 " file /WINDOWS/system32/config/system.LOG\n"
17657 #: ../fish/guestfish.pod:866
17660 " file win:\\windows\\system32\\config\\system.log\n"
17665 #: ../fish/guestfish.pod:868
17668 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
17673 #: ../fish/guestfish.pod:870
17675 "The parameter is rewritten \"behind the scenes\" by looking up the position "
17676 "where the drive is mounted, prepending that to the path, changing all "
17677 "backslash characters to forward slash, then resolving the result using "
17678 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
17679 "then the parameter might be rewritten like this:"
17683 #: ../fish/guestfish.pod:876
17686 " win:e:\\foo\\bar => /e/FOO/bar\n"
17691 #: ../fish/guestfish.pod:878
17692 msgid "This only works in argument positions that expect a path."
17696 #: ../fish/guestfish.pod:880
17697 msgid "UPLOADING AND DOWNLOADING FILES"
17701 #: ../fish/guestfish.pod:882
17703 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17704 "others which upload from or download to a local file, you can use the "
17705 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17709 #: ../fish/guestfish.pod:886
17717 #: ../fish/guestfish.pod:888
17718 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
17722 #: ../fish/guestfish.pod:891
17725 " tar-out /etc - | tar tf -\n"
17730 #: ../fish/guestfish.pod:893
17732 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17733 "command (see L</PIPES>)."
17737 #: ../fish/guestfish.pod:896
17739 "When using C<-> to read from stdin, the input is read up to the end of "
17740 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17741 "some arbitrary end marker:"
17745 #: ../fish/guestfish.pod:900
17748 " upload -<<END /foo\n"
17757 #: ../fish/guestfish.pod:906
17759 "Any string of characters can be used instead of C<END>. The end marker must "
17760 "appear on a line of its own, without any preceeding or following characters "
17761 "(not even spaces)."
17765 #: ../fish/guestfish.pod:910
17767 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
17768 "upload local files (so-called \"FileIn\" parameters in the generator)."
17772 #: ../fish/guestfish.pod:913
17773 msgid "EXIT ON ERROR BEHAVIOUR"
17777 #: ../fish/guestfish.pod:915
17779 "By default, guestfish will ignore any errors when in interactive mode "
17780 "(ie. taking commands from a human over a tty), and will exit on the first "
17781 "error in non-interactive mode (scripts, commands given on the command line)."
17785 #: ../fish/guestfish.pod:920
17787 "If you prefix a command with a I<-> character, then that command will not "
17788 "cause guestfish to exit, even if that (one) command returns an error."
17792 #: ../fish/guestfish.pod:924
17793 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
17797 #: ../fish/guestfish.pod:926
17799 "Guestfish can be remote-controlled over a socket. This is useful "
17800 "particularly in shell scripts where you want to make several different "
17801 "changes to a filesystem, but you don't want the overhead of starting up a "
17802 "guestfish process each time."
17806 #: ../fish/guestfish.pod:931
17807 msgid "Start a guestfish server process using:"
17811 #: ../fish/guestfish.pod:933
17814 " eval \"`guestfish --listen`\"\n"
17819 #: ../fish/guestfish.pod:935
17820 msgid "and then send it commands by doing:"
17824 #: ../fish/guestfish.pod:937
17827 " guestfish --remote cmd [...]\n"
17832 #: ../fish/guestfish.pod:939
17833 msgid "To cause the server to exit, send it the exit command:"
17837 #: ../fish/guestfish.pod:943
17839 "Note that the server will normally exit if there is an error in a command. "
17840 "You can change this in the usual way. See section L</EXIT ON ERROR "
17845 #: ../fish/guestfish.pod:947
17846 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
17850 #: ../fish/guestfish.pod:949
17852 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
17853 "is how the I<--remote> option knows where to send the commands. You can "
17854 "have several guestfish listener processes running using:"
17858 #: ../fish/guestfish.pod:953
17861 " eval \"`guestfish --listen`\"\n"
17862 " pid1=$GUESTFISH_PID\n"
17863 " eval \"`guestfish --listen`\"\n"
17864 " pid2=$GUESTFISH_PID\n"
17866 " guestfish --remote=$pid1 cmd\n"
17867 " guestfish --remote=$pid2 cmd\n"
17872 #: ../fish/guestfish.pod:961
17873 msgid "REMOTE CONTROL AND CSH"
17877 #: ../fish/guestfish.pod:963
17879 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
17884 #: ../fish/guestfish.pod:966
17887 " eval \"`guestfish --listen --csh`\"\n"
17892 #: ../fish/guestfish.pod:968
17893 msgid "REMOTE CONTROL DETAILS"
17897 #: ../fish/guestfish.pod:970
17899 "Remote control happens over a Unix domain socket called "
17900 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
17901 "of the process, and C<$PID> is the process ID of the server."
17905 #: ../fish/guestfish.pod:974
17906 msgid "Guestfish client and server versions must match exactly."
17910 #: ../fish/guestfish.pod:976
17911 msgid "REMOTE CONTROL RUN COMMAND HANGING"
17915 #: ../fish/guestfish.pod:978
17917 "Using the C<run> (or C<launch>) command remotely in a command substitution "
17918 "context hangs, ie. don't do (note the backquotes):"
17922 #: ../fish/guestfish.pod:981
17925 " a=`guestfish --remote run`\n"
17930 #: ../fish/guestfish.pod:983
17932 "Since the C<run> command produces no output on stdout, this is not useful "
17933 "anyway. For further information see "
17934 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
17938 #: ../fish/guestfish.pod:987
17939 msgid "PREPARED DISK IMAGES"
17943 #: ../fish/guestfish.pod:989
17945 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
17946 "preformatted disk images that guestfish can make for you to save typing. "
17947 "This is particularly useful for testing purposes. This option is used "
17948 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
17949 "can be mixed with I<-a>)."
17953 #: ../fish/guestfish.pod:995
17955 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17956 "the second and so on. Existing files in the current directory are "
17961 #: ../fish/guestfish.pod:999
17963 "The type briefly describes how the disk should be sized, partitioned, how "
17964 "filesystem(s) should be created, and how content should be added. "
17965 "Optionally the type can be followed by extra parameters, separated by C<:> "
17966 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
17967 "sparsely-allocated disk, containing a single partition, with the partition "
17968 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
17969 "on a 1GB disk instead."
17973 #: ../fish/guestfish.pod:1007
17974 msgid "To list the available types and any extra parameters they take, run:"
17978 #: ../fish/guestfish.pod:1011
17980 "Note that the prepared filesystem is not mounted. You would usually have to "
17981 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17985 #: ../fish/guestfish.pod:1015
17987 "If any I<-N> or I<--new> options are given, the guest is automatically "
17992 #: ../fish/guestfish.pod:1020
17993 msgid "Create a 100MB disk with an ext4-formatted partition:"
17997 #: ../fish/guestfish.pod:1022
18000 " guestfish -N fs:ext4\n"
18005 #: ../fish/guestfish.pod:1024
18006 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18010 #: ../fish/guestfish.pod:1026
18013 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18018 #: ../fish/guestfish.pod:1028
18019 msgid "Create a blank 200MB disk:"
18023 #: ../fish/guestfish.pod:1030
18026 " guestfish -N disk:200M\n"
18031 #: ../fish/guestfish.pod:1032
18032 msgid "PROGRESS BARS"
18036 #: ../fish/guestfish.pod:1034
18038 "Some (not all) long-running commands send progress notification messages as "
18039 "they are running. Guestfish turns these messages into progress bars."
18043 #: ../fish/guestfish.pod:1038
18045 "When a command that supports progress bars takes longer than two seconds to "
18046 "run, and if progress bars are enabled, then you will see one appearing below "
18051 #: ../fish/guestfish.pod:1042
18054 " ><fs> copy-size /large-file /another-file 2048M\n"
18055 " / 10% [#####-----------------------------------------] 00:30\n"
18060 #: ../fish/guestfish.pod:1045
18062 "The spinner on the left hand side moves round once for every progress "
18063 "notification received from the backend. This is a (reasonably) golden "
18064 "assurance that the command is \"doing something\" even if the progress bar "
18065 "is not moving, because the command is able to send the progress "
18066 "notifications. When the bar reaches 100% and the command finishes, the "
18067 "spinner disappears."
18071 #: ../fish/guestfish.pod:1052
18073 "Progress bars are enabled by default when guestfish is used interactively. "
18074 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18075 "and you can disable them completely using I<--no-progress-bars>."
18079 #: ../fish/guestfish.pod:1057
18080 msgid "GUESTFISH COMMANDS"
18084 #: ../fish/guestfish.pod:1059
18086 "The commands in this section are guestfish convenience commands, in other "
18087 "words, they are not part of the L<guestfs(3)> API."
18091 #: ../fish/guestfish.pod:1062
18096 #: ../fish/guestfish.pod:1064
18105 #: ../fish/guestfish.pod:1067
18106 msgid "Without any parameter, this provides general help."
18110 #: ../fish/guestfish.pod:1069
18111 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18115 #: ../fish/guestfish.pod:1071
18116 msgid "quit | exit"
18120 #: ../fish/guestfish.pod:1073
18121 msgid "This exits guestfish. You can also use C<^D> key."
18125 #: ../fish/guestfish.pod:1075
18126 msgid "@FISH_COMMANDS@"
18130 #: ../fish/guestfish.pod:1077
18135 #: ../fish/guestfish.pod:1079 ../src/guestfs.pod:1502
18140 #: ../fish/guestfish.pod:1083
18142 "guestfish returns 0 if the commands completed without error, or 1 if there "
18147 #: ../fish/guestfish.pod:1090
18152 #: ../fish/guestfish.pod:1092
18154 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18159 #: ../fish/guestfish.pod:1095 ../src/guestfs.pod:3107
18160 msgid "FEBOOTSTRAP_KERNEL"
18164 #: ../fish/guestfish.pod:1097 ../src/guestfs.pod:3109
18165 msgid "FEBOOTSTRAP_MODULES"
18169 #: ../fish/guestfish.pod:1099 ../src/guestfs.pod:3111
18171 "These two environment variables allow the kernel that libguestfs uses in the "
18172 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
18173 "most recent host kernel is chosen. For more information about kernel "
18174 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
18175 "available in febootstrap E<ge> 3.8."
18179 #: ../fish/guestfish.pod:1105
18180 msgid "GUESTFISH_DISPLAY_IMAGE"
18184 #: ../fish/guestfish.pod:1107
18186 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
18187 "If not set, it uses L<display(1)>."
18191 #: ../fish/guestfish.pod:1110
18192 msgid "GUESTFISH_PID"
18196 #: ../fish/guestfish.pod:1112
18198 "Used with the I<--remote> option to specify the remote guestfish process to "
18199 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18203 #: ../fish/guestfish.pod:1116
18208 #: ../fish/guestfish.pod:1118
18210 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18211 "not specified, the external L<hexedit(1)> program is used."
18215 #: ../fish/guestfish.pod:1122
18220 #: ../fish/guestfish.pod:1124
18222 "If compiled with GNU readline support, various files in the home directory "
18223 "can be used. See L</FILES>."
18227 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3117
18228 msgid "LIBGUESTFS_APPEND"
18232 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3119
18233 msgid "Pass additional options to the guest kernel."
18237 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3121
18238 msgid "LIBGUESTFS_DEBUG"
18242 #: ../fish/guestfish.pod:1133
18244 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18245 "effect as using the B<-v> option."
18249 #: ../fish/guestfish.pod:1136 ../src/guestfs.pod:3126
18250 msgid "LIBGUESTFS_MEMSIZE"
18254 #: ../fish/guestfish.pod:1138 ../src/guestfs.pod:3128
18255 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
18259 #: ../fish/guestfish.pod:1141 ../src/guestfs.pod:3131
18262 " LIBGUESTFS_MEMSIZE=700\n"
18267 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3133
18268 msgid "LIBGUESTFS_PATH"
18272 #: ../fish/guestfish.pod:1145
18274 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18275 "the discussion of paths in L<guestfs(3)>."
18279 #: ../fish/guestfish.pod:1148 ../src/guestfs.pod:3138
18280 msgid "LIBGUESTFS_QEMU"
18284 #: ../fish/guestfish.pod:1150 ../src/guestfs.pod:3140
18286 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
18287 "which was found at compile time by the configure script is used."
18291 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3146
18292 msgid "LIBGUESTFS_TRACE"
18296 #: ../fish/guestfish.pod:1156
18297 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18301 #: ../fish/guestfish.pod:1158
18306 #: ../fish/guestfish.pod:1160
18308 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18313 #: ../fish/guestfish.pod:1163 ../src/guestfs.pod:3151
18318 #: ../fish/guestfish.pod:1165 ../src/guestfs.pod:3153
18320 "Location of temporary directory, defaults to C</tmp> except for the cached "
18321 "supermin appliance which defaults to C</var/tmp>."
18325 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3156
18327 "If libguestfs was compiled to use the supermin appliance then the real "
18328 "appliance is cached in this directory, shared between all handles belonging "
18329 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
18330 "use in case C</var/tmp> is not large enough."
18334 #: ../fish/guestfish.pod:1176 ../fuse/guestmount.pod:288 ../rescue/virt-rescue.pod:273
18339 #: ../fish/guestfish.pod:1180 ../fuse/guestmount.pod:292 ../rescue/virt-rescue.pod:277
18340 msgid "$HOME/.libguestfs-tools.rc"
18344 #: ../fish/guestfish.pod:1182 ../fuse/guestmount.pod:294 ../rescue/virt-rescue.pod:279
18345 msgid "/etc/libguestfs-tools.conf"
18349 #: ../fish/guestfish.pod:1184 ../fuse/guestmount.pod:296 ../rescue/virt-rescue.pod:281
18351 "This configuration file controls the default read-only or read-write mode "
18352 "(I<--ro> or I<--rw>)."
18356 #: ../fish/guestfish.pod:1187
18357 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
18361 #: ../fish/guestfish.pod:1189
18362 msgid "$HOME/.guestfish"
18366 #: ../fish/guestfish.pod:1191
18368 "If compiled with GNU readline support, then the command history is saved in "
18373 #: ../fish/guestfish.pod:1194
18374 msgid "$HOME/.inputrc"
18378 #: ../fish/guestfish.pod:1196
18379 msgid "/etc/inputrc"
18383 #: ../fish/guestfish.pod:1198
18385 "If compiled with GNU readline support, then these files can be used to "
18386 "configure readline. For further information, please see "
18387 "L<readline(3)/INITIALIZATION FILE>."
18391 #: ../fish/guestfish.pod:1202
18392 msgid "To write rules which only apply to guestfish, use:"
18396 #: ../fish/guestfish.pod:1204
18406 #: ../fish/guestfish.pod:1208
18408 "Variables that you can set in inputrc that change the behaviour of guestfish "
18409 "in useful ways include:"
18413 #: ../fish/guestfish.pod:1213
18414 msgid "completion-ignore-case (default: on)"
18418 #: ../fish/guestfish.pod:1215
18420 "By default, guestfish will ignore case when tab-completing paths on the "
18425 #: ../fish/guestfish.pod:1218
18428 " set completion-ignore-case off\n"
18433 #: ../fish/guestfish.pod:1220
18434 msgid "to make guestfish case sensitive."
18438 #: ../fish/guestfish.pod:1224
18443 #: ../fish/guestfish.pod:1226
18444 msgid "test2.img (etc)"
18448 #: ../fish/guestfish.pod:1228
18450 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18451 "will be created in the file C<test1.img> in the current directory. The "
18452 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18453 "the same name will be overwritten."
18457 #: ../fish/guestfish.pod:1237
18459 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, "
18460 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
18461 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
18462 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
18463 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
18464 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
18465 "L<febootstrap-supermin-helper(8)>."
18469 #: ../fish/guestfish.pod:1266 ../src/guestfs.pod:3243 ../test-tool/libguestfs-test-tool.pod:112
18470 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18474 #: ../fish/virt-copy-in.pod:5
18475 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
18479 #: ../fish/virt-copy-in.pod:9
18482 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18487 #: ../fish/virt-copy-in.pod:11
18490 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18495 #: ../fish/virt-copy-in.pod:15
18497 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18498 "causing disk corruption. The virtual machine must be shut down before you "
18499 "use this command."
18503 #: ../fish/virt-copy-in.pod:21
18505 "C<virt-copy-in> copies files and directories from the local disk into a "
18506 "virtual machine disk image or named libvirt domain."
18510 #: ../fish/virt-copy-in.pod:24
18512 "You can give one of more filenames and directories on the command line. "
18513 "Directories are copied in recursively. The final parameter must be the "
18514 "destination directory in the disk image which must be an absolute path "
18515 "starting with a C</> character."
18519 #: ../fish/virt-copy-in.pod:33
18522 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18527 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18528 msgid "Upload a home directory to a guest:"
18532 #: ../fish/virt-copy-in.pod:37
18535 " virt-copy-in -d MyGuest skel /home\n"
18540 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18541 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18545 #: ../fish/virt-copy-in.pod:41
18547 "This command is just a simple shell script wrapper around the "
18548 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
18549 "trivial copy, you are probably better off using guestfish directly."
18553 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18555 "Since the shell script just passes options straight to guestfish, read "
18556 "L<guestfish(1)> to see the full list of options."
18560 #: ../fish/virt-copy-in.pod:52
18562 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18563 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18567 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18568 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18572 #: ../fish/virt-copy-out.pod:5
18574 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18579 #: ../fish/virt-copy-out.pod:9
18582 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18587 #: ../fish/virt-copy-out.pod:11
18590 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18595 #: ../fish/virt-copy-out.pod:15
18597 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18598 "image or named libvirt domain."
18602 #: ../fish/virt-copy-out.pod:18
18604 "You can give one of more filenames and directories on the command line. "
18605 "Directories are copied out recursively."
18609 #: ../fish/virt-copy-out.pod:23
18610 msgid "Download the home directories from a virtual machine:"
18614 #: ../fish/virt-copy-out.pod:25
18618 " virt-copy-out -d MyGuest /home homes\n"
18623 #: ../fish/virt-copy-out.pod:30
18625 "This command is just a simple shell script wrapper around the "
18626 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
18627 "trivial copy, you are probably better off using guestfish directly."
18631 #: ../fish/virt-copy-out.pod:41
18633 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
18634 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18638 #: ../fish/virt-tar-in.pod:5
18639 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18643 #: ../fish/virt-tar-in.pod:9
18646 " virt-tar-in -a disk.img data.tar /destination\n"
18651 #: ../fish/virt-tar-in.pod:11
18654 " virt-tar-in -d domain data.tar /destination\n"
18659 #: ../fish/virt-tar-in.pod:13
18662 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18667 #: ../fish/virt-tar-in.pod:17
18669 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18670 "causing disk corruption. The virtual machine must be shut down before you "
18671 "use this command."
18675 #: ../fish/virt-tar-in.pod:23
18677 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18678 "image or named libvirt domain."
18682 #: ../fish/virt-tar-in.pod:26
18684 "The first parameter is the tar file. Use C<-> to read the tar file from "
18685 "standard input. The second parameter is the absolute target directory to "
18690 #: ../fish/virt-tar-in.pod:34
18693 " virt-tar-in -d MyGuest homes.tar /home\n"
18698 #: ../fish/virt-tar-in.pod:38
18700 "This command is just a simple shell script wrapper around the "
18701 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
18702 "copy, you are probably better off using guestfish directly."
18706 #: ../fish/virt-tar-in.pod:49
18708 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18709 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
18710 "L<http://libguestfs.org/>."
18714 #: ../fish/virt-tar-out.pod:5
18715 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
18719 #: ../fish/virt-tar-out.pod:9
18722 " virt-tar-out -a disk.img /dir files.tar\n"
18727 #: ../fish/virt-tar-out.pod:11
18730 " virt-tar-out -d domain /dir files.tar\n"
18735 #: ../fish/virt-tar-out.pod:13
18738 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
18743 #: ../fish/virt-tar-out.pod:17
18744 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
18748 #: ../fish/virt-tar-out.pod:20
18750 "The first parameter is the absolute path of the virtual machine directory. "
18751 "The second parameter is the tar file to write. Use C<-> to write to "
18756 #: ../fish/virt-tar-out.pod:26
18757 msgid "Download the home directories from a guest:"
18761 #: ../fish/virt-tar-out.pod:28
18764 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
18769 #: ../fish/virt-tar-out.pod:32
18771 "This command is just a simple shell script wrapper around the "
18772 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
18773 "trivial copy, you are probably better off using guestfish directly."
18777 #: ../fish/virt-tar-out.pod:43
18779 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18780 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
18784 #: ../fuse/guestmount.pod:5
18785 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
18789 #: ../fuse/guestmount.pod:9
18792 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
18797 #: ../fuse/guestmount.pod:11
18800 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
18805 #: ../fuse/guestmount.pod:13
18808 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
18813 #: ../fuse/guestmount.pod:17
18815 "You must I<not> use C<guestmount> in read-write mode on live virtual "
18816 "machines. If you do this, you risk disk corruption in the VM."
18820 #: ../fuse/guestmount.pod:22
18822 "The guestmount program can be used to mount virtual machine filesystems and "
18823 "other disk images on the host. It uses libguestfs for access to the guest "
18824 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
18825 "a mountable device."
18829 #: ../fuse/guestmount.pod:27
18831 "Along with other options, you have to give at least one device (I<-a> "
18832 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
18833 "option) or use the I<-i> inspection option. How this works is better "
18834 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
18839 #: ../fuse/guestmount.pod:33
18841 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
18842 "by you, and the filesystem will not be visible to any other users unless you "
18843 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
18844 "the filesystem, use the C<fusermount -u> command."
18848 #: ../fuse/guestmount.pod:41
18850 "For a typical Windows guest which has its main filesystem on the first "
18855 #: ../fuse/guestmount.pod:44
18858 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
18863 #: ../fuse/guestmount.pod:46
18865 "For a typical Linux guest which has a /boot filesystem on the first "
18866 "partition, and the root filesystem on a logical volume:"
18870 #: ../fuse/guestmount.pod:49
18873 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
18878 #: ../fuse/guestmount.pod:51
18879 msgid "To get libguestfs to detect guest mountpoints for you:"
18883 #: ../fuse/guestmount.pod:53
18886 " guestmount -a guest.img -i --ro /mnt\n"
18891 #: ../fuse/guestmount.pod:55
18892 msgid "For a libvirt guest called \"Guest\" you could do:"
18896 #: ../fuse/guestmount.pod:57
18899 " guestmount -d Guest -i --ro /mnt\n"
18904 #: ../fuse/guestmount.pod:59
18906 "If you don't know what filesystems are contained in a guest or disk image, "
18907 "use L<virt-filesystems(1)> first:"
18911 #: ../fuse/guestmount.pod:62
18914 " virt-filesystems MyGuest\n"
18919 #: ../fuse/guestmount.pod:64
18921 "If you want to trace the libguestfs calls but without excessive debugging "
18922 "information, we recommend:"
18926 #: ../fuse/guestmount.pod:67
18929 " guestmount [...] --trace /mnt\n"
18934 #: ../fuse/guestmount.pod:69
18935 msgid "If you want to debug the program, we recommend:"
18939 #: ../fuse/guestmount.pod:71
18942 " guestmount [...] --trace --verbose /mnt\n"
18947 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:544
18952 #: ../fuse/guestmount.pod:75
18953 msgid "Other users cannot see the filesystem by default"
18957 #: ../fuse/guestmount.pod:77
18959 "If you mount a filesystem as one user (eg. root), then other users will not "
18960 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
18961 "option when mounting:"
18965 #: ../fuse/guestmount.pod:81
18968 " sudo guestmount [...] -o allow_other /mnt\n"
18973 #: ../fuse/guestmount.pod:91
18974 msgid "Add a block device or virtual machine image."
18978 #: ../fuse/guestmount.pod:114
18979 msgid "B<--dir-cache-timeout N>"
18983 #: ../fuse/guestmount.pod:116
18985 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
18986 "seconds. The readdir cache [actually, there are several semi-independent "
18987 "caches] is populated after a readdir(2) call with the stat and extended "
18988 "attributes of the files in the directory, in anticipation that they will be "
18989 "requested soon after."
18993 #: ../fuse/guestmount.pod:122
18995 "There is also a different attribute cache implemented by FUSE (see the FUSE "
18996 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
18997 "requests, only cache existing ones."
19001 #: ../fuse/guestmount.pod:142
19003 "If you have untrusted raw-format guest disk images, you should use this "
19004 "option to specify the disk format. This avoids a possible security problem "
19005 "with malicious guests (CVE-2010-3851). See also "
19006 "L<guestfs(3)/guestfs_add_drive_opts>."
19010 #: ../fuse/guestmount.pod:147
19011 msgid "B<--fuse-help>"
19015 #: ../fuse/guestmount.pod:149
19016 msgid "Display help on special FUSE options (see I<-o> below)."
19020 #: ../fuse/guestmount.pod:153
19021 msgid "Display brief help and exit."
19025 #: ../fuse/guestmount.pod:177
19027 "Mount the named partition or logical volume on the given mountpoint B<in the "
19028 "guest> (this has nothing to do with mountpoints in the host)."
19032 #: ../fuse/guestmount.pod:180
19034 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
19035 "something on C</>."
19039 #: ../fuse/guestmount.pod:197
19041 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
19042 "unmounted. If you specify this option, then we don't attempt to sync the "
19043 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
19047 #: ../fuse/guestmount.pod:202
19048 msgid "B<-o option>"
19052 #: ../fuse/guestmount.pod:204
19053 msgid "B<--option option>"
19057 #: ../fuse/guestmount.pod:206
19058 msgid "Pass extra options to FUSE."
19062 #: ../fuse/guestmount.pod:208
19064 "To get a list of all the extra options supported by FUSE, use the command "
19065 "below. Note that only the FUSE I<-o> options can be passed, and only some "
19066 "of them are a good idea."
19070 #: ../fuse/guestmount.pod:212
19073 " guestmount --fuse-help\n"
19078 #: ../fuse/guestmount.pod:214
19079 msgid "Some potentially useful FUSE options:"
19083 #: ../fuse/guestmount.pod:218
19084 msgid "B<-o allow_other>"
19088 #: ../fuse/guestmount.pod:220
19089 msgid "Allow other users to see the filesystem."
19093 #: ../fuse/guestmount.pod:222
19094 msgid "B<-o attr_timeout=N>"
19098 #: ../fuse/guestmount.pod:224
19099 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
19103 #: ../fuse/guestmount.pod:226
19104 msgid "B<-o kernel_cache>"
19108 #: ../fuse/guestmount.pod:228
19110 "Allow the kernel to cache files (reduces the number of reads that have to go "
19111 "through the L<guestfs(3)> API). This is generally a good idea if you can "
19112 "afford the extra memory usage."
19116 #: ../fuse/guestmount.pod:232
19117 msgid "B<-o uid=N> B<-o gid=N>"
19121 #: ../fuse/guestmount.pod:234
19123 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
19124 "the chosen values."
19128 #: ../fuse/guestmount.pod:243
19130 "Add devices and mount everything read-only. Also disallow writes and make "
19131 "the disk appear read-only to FUSE."
19135 #: ../fuse/guestmount.pod:246
19137 "This is highly recommended if you are not going to edit the guest disk. If "
19138 "the guest is running and this option is I<not> supplied, then there is a "
19139 "strong risk of disk corruption in the guest. We try to prevent this from "
19140 "happening, but it is not always possible."
19144 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
19145 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19149 #: ../fuse/guestmount.pod:255
19150 msgid "Enable SELinux support for the guest."
19154 #: ../fuse/guestmount.pod:261
19155 msgid "Enable verbose messages from underlying libguestfs."
19159 #: ../fuse/guestmount.pod:267
19160 msgid "Display the program version and exit."
19164 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
19165 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19169 #: ../fuse/guestmount.pod:280
19174 #: ../fuse/guestmount.pod:282
19175 msgid "Trace libguestfs calls and entry into each FUSE function."
19179 #: ../fuse/guestmount.pod:284
19180 msgid "This also stops the daemon from forking into the background."
19184 #: ../fuse/guestmount.pod:310
19186 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
19187 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
19188 "L<http://fuse.sf.net/>."
19192 #: ../fuse/guestmount.pod:325
19193 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
19197 #: ../inspector/virt-inspector.pod:5
19199 "virt-inspector - Display operating system version and other information "
19200 "about a virtual machine"
19204 #: ../inspector/virt-inspector.pod:9
19207 " virt-inspector [--options] -d domname\n"
19212 #: ../inspector/virt-inspector.pod:11
19215 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
19220 #: ../inspector/virt-inspector.pod:15
19223 " virt-inspector domname\n"
19228 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
19231 " virt-inspector disk.img [disk.img ...]\n"
19236 #: ../inspector/virt-inspector.pod:21
19238 "B<virt-inspector> examines a virtual machine or disk image and tries to "
19239 "determine the version of the operating system and other information about "
19240 "the virtual machine."
19244 #: ../inspector/virt-inspector.pod:25
19245 msgid "Virt-inspector produces XML output for feeding into other programs."
19249 #: ../inspector/virt-inspector.pod:27
19251 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
19252 "the libvirt domain (see: C<virsh list --all>)."
19256 #: ../inspector/virt-inspector.pod:30
19258 "You can also run virt-inspector directly on disk images from a single "
19259 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
19260 "has several block devices, in which case you should list several I<-a> "
19261 "options one after another, with the first corresponding to the guest's "
19262 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
19266 #: ../inspector/virt-inspector.pod:37
19268 "You can also run virt-inspector on install disks, live CDs, bootable USB "
19269 "keys and similar."
19273 #: ../inspector/virt-inspector.pod:40
19275 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
19276 "inspect several virtual machines, you have to run virt-inspector several "
19277 "times (for example, from a shell script for-loop)."
19281 #: ../inspector/virt-inspector.pod:45
19283 "Because virt-inspector needs direct access to guest images, it won't "
19284 "normally work over remote libvirt connections."
19288 #: ../inspector/virt-inspector.pod:48
19290 "All of the information available from virt-inspector is also available "
19291 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
19292 "The same information can also be fetched using guestfish or via libguestfs "
19293 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
19294 "WITH OTHER PROGRAMMING LANGUAGES>)."
19298 #: ../inspector/virt-inspector.pod:81
19300 "Libvirt is only used if you specify a C<domname> on the command line. If "
19301 "you specify guest block devices directly (I<-a>), then libvirt is not used "
19306 #: ../inspector/virt-inspector.pod:94
19308 "When prompting for keys and passphrases, virt-inspector normally turns "
19309 "echoing off so you cannot see what you are typing. If you are not worried "
19310 "about Tempest attacks and there is no one else in the room you can specify "
19311 "this flag to see what you are typing."
19315 #: ../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
19317 "Specify the format of disk images given on the command line. If this is "
19318 "omitted then the format is autodetected from the content of the disk image."
19322 #: ../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
19324 "If disk images are requested from libvirt, then this program asks libvirt "
19325 "for this information. In this case, the value of the format parameter is "
19330 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314 ../resize/virt-resize.pod:406 ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
19332 "If working with untrusted raw-format guest disk images, you should ensure "
19333 "the format is always specified."
19337 #: ../inspector/virt-inspector.pod:139
19338 msgid "Previous versions of virt-inspector allowed you to write either:"
19342 #: ../inspector/virt-inspector.pod:145
19345 " virt-inspector guestname\n"
19350 #: ../inspector/virt-inspector.pod:153
19355 #: ../inspector/virt-inspector.pod:155
19357 "The virt-inspector XML is described precisely in a RELAX NG schema file "
19358 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
19359 "just an overview."
19363 #: ../inspector/virt-inspector.pod:159
19365 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
19366 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
19367 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
19368 "which is vanishingly rare in real world VMs."
19372 #: ../inspector/virt-inspector.pod:164
19373 msgid "E<lt>operatingsystemE<gt>"
19377 #: ../inspector/virt-inspector.pod:166
19379 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
19380 "describe the operating system, its architecture, the descriptive \"product "
19381 "name\" string, the type of OS and so on, as in this example:"
19385 #: ../inspector/virt-inspector.pod:170
19388 " <operatingsystems>\n"
19389 " <operatingsystem>\n"
19390 " <root>/dev/sda2</root>\n"
19391 " <name>windows</name>\n"
19392 " <arch>i386</arch>\n"
19393 " <distro>windows</distro>\n"
19394 " <product_name>Windows 7 Enterprise</product_name>\n"
19395 " <product_variant>Client</product_variant>\n"
19396 " <major_version>6</major_version>\n"
19397 " <minor_version>1</minor_version>\n"
19398 " <windows_systemroot>/Windows</windows_systemroot>\n"
19399 " <format>installed</format>\n"
19404 #: ../inspector/virt-inspector.pod:183
19406 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
19407 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
19408 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
19409 "architecture. The other fields are fairly self-explanatory, but because "
19410 "these fields are taken directly from the libguestfs inspection API you can "
19411 "find precise information from L<guestfs(3)/INSPECTION>."
19415 #: ../inspector/virt-inspector.pod:191
19417 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
19418 "of view of libguestfs (block devices may have completely different names "
19419 "inside the VM itself)."
19423 #: ../inspector/virt-inspector.pod:195
19424 msgid "E<lt>mountpointsE<gt>"
19428 #: ../inspector/virt-inspector.pod:197
19430 "Un*x-like guests typically have multiple filesystems which are mounted at "
19431 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
19432 "element which looks like this:"
19436 #: ../inspector/virt-inspector.pod:201
19439 " <operatingsystems>\n"
19440 " <operatingsystem>\n"
19443 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19444 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19445 " </mountpoints>\n"
19450 #: ../inspector/virt-inspector.pod:209
19452 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19453 "and may have completely different names inside the guest. Only mountable "
19454 "filesystems appear in this list, not things like swap devices."
19458 #: ../inspector/virt-inspector.pod:214
19459 msgid "E<lt>filesystemsE<gt>"
19463 #: ../inspector/virt-inspector.pod:216
19465 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19466 "filesystems belonging to the guest, including swap and empty partitions. "
19467 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19468 "this OS or shared with this OS and other OSes)."
19472 #: ../inspector/virt-inspector.pod:222
19473 msgid "You might see something like this:"
19477 #: ../inspector/virt-inspector.pod:224
19480 " <operatingsystems>\n"
19481 " <operatingsystem>\n"
19484 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19485 " <type>ext4</type>\n"
19486 " <label>Fedora-13-x86_64</label>\n"
19487 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19493 #: ../inspector/virt-inspector.pod:234
19495 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19496 "the label, and the UUID."
19500 #: ../inspector/virt-inspector.pod:237
19501 msgid "E<lt>applicationsE<gt>"
19505 #: ../inspector/virt-inspector.pod:239
19507 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19508 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19513 #: ../inspector/virt-inspector.pod:243
19515 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19516 "Typical values would be C<rpm> and C<deb>."
19520 #: ../inspector/virt-inspector.pod:246
19522 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19523 "Typical values include C<yum>, C<up2date> and C<apt>"
19527 #: ../inspector/virt-inspector.pod:249
19528 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19532 #: ../inspector/virt-inspector.pod:252
19535 " <operatingsystems>\n"
19536 " <operatingsystem>\n"
19538 " <applications>\n"
19540 " <name>coreutils</name>\n"
19541 " <version>8.5</version>\n"
19542 " <release>1</release>\n"
19543 " </application>\n"
19548 #: ../inspector/virt-inspector.pod:262
19550 "The version and release fields may not be available for some types guests. "
19551 "Other fields are possible, see "
19552 "L<guestfs(3)/guestfs_inspect_list_applications>."
19556 #: ../inspector/virt-inspector.pod:266
19557 msgid "E<lt>drive_mappingsE<gt>"
19561 #: ../inspector/virt-inspector.pod:268
19563 "For operating systems like Windows which use drive letters, virt-inspector "
19564 "is able to find out how drive letters map to filesystems."
19568 #: ../inspector/virt-inspector.pod:272
19571 " <operatingsystems>\n"
19572 " <operatingsystem>\n"
19574 " <drive_mappings>\n"
19575 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19576 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19577 " </drive_mappings>\n"
19582 #: ../inspector/virt-inspector.pod:280
19584 "In the example above, drive C maps to the filesystem on the second partition "
19585 "on the first disk, and drive E maps to the filesystem on the first partition "
19586 "on the second disk."
19590 #: ../inspector/virt-inspector.pod:284
19592 "Note that this only covers permanent local filesystem mappings, not things "
19593 "like network shares. Furthermore NTFS volume mount points may not be listed "
19598 #: ../inspector/virt-inspector.pod:288
19599 msgid "E<lt>iconE<gt>"
19603 #: ../inspector/virt-inspector.pod:290
19605 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19606 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19607 "very large and high quality."
19611 #: ../inspector/virt-inspector.pod:294
19614 " <operatingsystems>\n"
19615 " <operatingsystem>\n"
19618 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19619 " [... many lines of base64 data ...]\n"
19625 #: ../inspector/virt-inspector.pod:302
19627 "To display the icon, you have to extract it and convert the base64 data back "
19628 "to a binary file. Use an XPath query or simply an editor to extract the "
19629 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19634 #: ../inspector/virt-inspector.pod:307
19637 " base64 -i -d < icon.data > icon.png\n"
19642 #: ../inspector/virt-inspector.pod:309
19643 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19647 #: ../inspector/virt-inspector.pod:311
19649 "Virt-inspector can detect some operating system installers on install disks, "
19650 "live CDs, bootable USB keys and more."
19654 #: ../inspector/virt-inspector.pod:314
19656 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19657 "fields may be present to indicate a live CD, network installer, or one part "
19658 "of a multipart CD. For example:"
19662 #: ../inspector/virt-inspector.pod:318
19665 " <operatingsystems>\n"
19666 " <operatingsystem>\n"
19667 " <root>/dev/sda</root>\n"
19668 " <name>linux</name>\n"
19669 " <arch>i386</arch>\n"
19670 " <distro>ubuntu</distro>\n"
19671 " <product_name>Ubuntu 10.10 "Maverick "
19672 "Meerkat"</product_name>\n"
19673 " <major_version>10</major_version>\n"
19674 " <minor_version>10</minor_version>\n"
19675 " <format>installer</format>\n"
19681 #: ../inspector/virt-inspector.pod:330
19682 msgid "USING XPATH"
19686 #: ../inspector/virt-inspector.pod:332
19688 "You can use the XPath query language to select parts of the XML. We "
19689 "recommend using C<xmlstarlet> to perform XPath queries from the command "
19694 #: ../inspector/virt-inspector.pod:338
19697 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
19699 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19700 " <type>ext4</type>\n"
19706 #: ../inspector/virt-inspector.pod:344
19709 " $ virt-inspector -d Guest | \\\n"
19710 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
19716 #: ../inspector/virt-inspector.pod:348
19719 " $ virt-inspector -d Guest | \\\n"
19720 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
19721 " [displays the guest icon, if there is one]\n"
19726 #: ../inspector/virt-inspector.pod:359
19727 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
19731 #: ../inspector/virt-inspector.pod:361
19733 "Early versions of libguestfs shipped with a different virt-inspector program "
19734 "written in Perl (the current version is written in C). The XML output of "
19735 "the Perl virt-inspector was different and it could also output in other "
19736 "formats like text."
19740 #: ../inspector/virt-inspector.pod:366
19741 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
19745 #: ../inspector/virt-inspector.pod:369
19747 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
19748 "versions of virt-inspector with different names:"
19752 #: ../inspector/virt-inspector.pod:372
19755 " virt-inspector Old Perl version.\n"
19756 " virt-inspector2 New C version.\n"
19761 #: ../inspector/virt-inspector.pod:382
19763 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
19764 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
19768 #: ../inspector/virt-inspector.pod:399
19769 msgid "Matthew Booth L<mbooth@redhat.com>"
19773 #: ../java/examples/guestfs-java.pod:5
19774 msgid "guestfs-java - How to use libguestfs from Java"
19778 #: ../java/examples/guestfs-java.pod:9
19781 " import com.redhat.et.libguestfs.*;\n"
19786 #: ../java/examples/guestfs-java.pod:11
19789 " GuestFS g = new GuestFS ();\n"
19790 " g.add_drive_opts (\"disk.img\", null);\n"
19796 #: ../java/examples/guestfs-java.pod:17
19798 "This manual page documents how to call libguestfs from the Java programming "
19799 "language. This page just documents the differences from the C API and gives "
19800 "some examples. If you are not familiar with using libguestfs, you also need "
19801 "to read L<guestfs(3)>."
19805 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
19806 msgid "CLOSING THE HANDLE"
19810 #: ../java/examples/guestfs-java.pod:24
19812 "The handle is closed when it is reaped by the garbage collector. Because "
19813 "libguestfs handles include a lot of state, it is also possible to close (and "
19814 "hence free) them explicitly by calling the C<close> method."
19818 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
19823 #: ../java/examples/guestfs-java.pod:31
19825 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
19826 "exception. This has a single parameter which is the error message (a "
19831 #: ../java/examples/guestfs-java.pod:35
19832 msgid "Calling any method on a closed handle raises the same exception."
19836 #: ../java/examples/guestfs-java.pod:47
19838 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
19839 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
19840 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
19841 "L<http://caml.inria.fr/>."
19845 #: ../ocaml/examples/guestfs-ocaml.pod:5
19846 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
19850 #: ../ocaml/examples/guestfs-ocaml.pod:9
19851 msgid "Module style:"
19855 #: ../ocaml/examples/guestfs-ocaml.pod:11
19858 " let g = Guestfs.create () in\n"
19859 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19860 " Guestfs.launch g;\n"
19865 #: ../ocaml/examples/guestfs-ocaml.pod:15
19866 msgid "Object-oriented style:"
19870 #: ../ocaml/examples/guestfs-ocaml.pod:17
19873 " let g = new Guestfs.guestfs () in\n"
19874 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19880 #: ../ocaml/examples/guestfs-ocaml.pod:21
19883 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
19885 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
19890 #: ../ocaml/examples/guestfs-ocaml.pod:27
19892 "This manual page documents how to call libguestfs from the OCaml programming "
19893 "language. This page just documents the differences from the C API and gives "
19894 "some examples. If you are not familiar with using libguestfs, you also need "
19895 "to read L<guestfs(3)>."
19899 #: ../ocaml/examples/guestfs-ocaml.pod:32
19900 msgid "PROGRAMMING STYLES"
19904 #: ../ocaml/examples/guestfs-ocaml.pod:34
19906 "There are two different programming styles supported by the OCaml bindings. "
19907 "You can use a module style, with each C function mapped to an OCaml "
19912 #: ../ocaml/examples/guestfs-ocaml.pod:38
19915 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
19920 #: ../ocaml/examples/guestfs-ocaml.pod:40
19925 #: ../ocaml/examples/guestfs-ocaml.pod:42
19928 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
19933 #: ../ocaml/examples/guestfs-ocaml.pod:44
19935 "Alternately you can use an object-oriented style, calling methods on the "
19936 "class C<Guestfs.guestfs>:"
19940 #: ../ocaml/examples/guestfs-ocaml.pod:47
19943 " method set_verbose : bool -> unit\n"
19948 #: ../ocaml/examples/guestfs-ocaml.pod:49
19950 "The object-oriented style is usually briefer, and the minor performance "
19951 "penalty isn't noticable in the general overhead of performing libguestfs "
19956 #: ../ocaml/examples/guestfs-ocaml.pod:55
19958 "The handle is closed when it is reaped by the garbage collector. Because "
19959 "libguestfs handles include a lot of state, it is also possible to close (and "
19960 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
19965 #: ../ocaml/examples/guestfs-ocaml.pod:62
19967 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
19968 "exception. This has a single parameter which is the error message (a "
19973 #: ../ocaml/examples/guestfs-ocaml.pod:66
19975 "Calling any function/method on a closed handle raises "
19976 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
19981 #: ../ocaml/examples/guestfs-ocaml.pod:80
19983 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
19984 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
19985 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
19986 "L<http://caml.inria.fr/>."
19990 #: ../perl/examples/guestfs-perl.pod:5
19991 msgid "guestfs-perl - How to use libguestfs from Perl"
19995 #: ../perl/examples/guestfs-perl.pod:9
19998 " use Sys::Guestfs;\n"
20003 #: ../perl/examples/guestfs-perl.pod:11
20006 " my $h = Sys::Guestfs->new ();\n"
20007 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
20008 " $h->launch ();\n"
20009 " $h->mount_options ('', '/dev/sda1', '/');\n"
20010 " $h->touch ('/hello');\n"
20016 #: ../perl/examples/guestfs-perl.pod:20
20018 "This manual page documents how to call libguestfs from the Perl programming "
20019 "language. This page just documents the differences from the C API and gives "
20020 "some examples. If you are not familiar with using libguestfs, you also need "
20021 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
20025 #: ../perl/examples/guestfs-perl.pod:26
20030 #: ../perl/examples/guestfs-perl.pod:28
20032 "Errors from libguestfs functions turn into calls to C<croak> (see "
20037 #: ../perl/examples/guestfs-perl.pod:41
20039 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
20040 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
20041 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
20042 "L<http://libguestfs.org/>."
20046 #: ../python/examples/guestfs-python.pod:5
20047 msgid "guestfs-python - How to use libguestfs from Python"
20051 #: ../python/examples/guestfs-python.pod:9
20054 " import guestfs\n"
20055 " g = guestfs.GuestFS ()\n"
20056 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
20062 #: ../python/examples/guestfs-python.pod:16
20064 "This manual page documents how to call libguestfs from the Python "
20065 "programming language. This page just documents the differences from the C "
20066 "API and gives some examples. If you are not familiar with using libguestfs, "
20067 "you also need to read L<guestfs(3)>."
20071 #: ../python/examples/guestfs-python.pod:23
20073 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
20074 "single string argument which is the error message."
20078 #: ../python/examples/guestfs-python.pod:26
20079 msgid "MORE DOCUMENTATION"
20083 #: ../python/examples/guestfs-python.pod:28
20088 #: ../python/examples/guestfs-python.pod:30
20092 " >>> import guestfs\n"
20093 " >>> help (guestfs)\n"
20098 #: ../python/examples/guestfs-python.pod:44
20100 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
20101 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
20102 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20106 #: ../rescue/virt-rescue.pod:5
20107 msgid "virt-rescue - Run a rescue shell on a virtual machine"
20111 #: ../rescue/virt-rescue.pod:9
20114 " virt-rescue [--options] -d domname\n"
20119 #: ../rescue/virt-rescue.pod:11
20122 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
20127 #: ../rescue/virt-rescue.pod:15
20130 " virt-rescue [--options] domname\n"
20135 #: ../rescue/virt-rescue.pod:17
20138 " virt-rescue [--options] disk.img [disk.img ...]\n"
20143 #: ../rescue/virt-rescue.pod:21
20145 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
20146 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
20147 "you from doing this, but doesn't catch all cases."
20151 #: ../rescue/virt-rescue.pod:25
20153 "However if you use the I<--ro> (read only) option, then you can attach a "
20154 "shell to a live virtual machine. The results might be strange or "
20155 "inconsistent at times but you won't get disk corruption."
20159 #: ../rescue/virt-rescue.pod:31
20161 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
20162 "need for a CD. virt-rescue gives you a rescue shell and some simple "
20163 "recovery tools which you can use to examine or rescue a virtual machine or "
20168 #: ../rescue/virt-rescue.pod:36
20170 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
20171 "on disk image(s):"
20175 #: ../rescue/virt-rescue.pod:39
20178 " virt-rescue -d GuestName\n"
20183 #: ../rescue/virt-rescue.pod:41
20186 " virt-rescue --ro -a /path/to/disk.img\n"
20191 #: ../rescue/virt-rescue.pod:43
20194 " virt-rescue -a /dev/sdc\n"
20199 #: ../rescue/virt-rescue.pod:45
20200 msgid "For live VMs you I<must> use the --ro option."
20204 #: ../rescue/virt-rescue.pod:47
20206 "When you run virt-rescue on a virtual machine or disk image, you are placed "
20207 "in an interactive bash shell where you can use many ordinary Linux "
20208 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
20209 "appliance. You must mount the virtual machine's filesystems by hand. There "
20210 "is an empty directory called C</sysroot> where you can mount filesystems."
20214 #: ../rescue/virt-rescue.pod:54
20216 "In the example below, we list logical volumes, then choose one to mount "
20217 "under C</sysroot>:"
20221 #: ../rescue/virt-rescue.pod:57
20225 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
20226 " lv_root vg_f11x64 -wi-a- 8.83G\n"
20227 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
20228 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
20229 " ><rescue> ls /sysroot\n"
20234 #: ../rescue/virt-rescue.pod:64
20236 "If you don't know what filesystems are available on the virtual machine then "
20237 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
20241 #: ../rescue/virt-rescue.pod:70
20243 "Virt-rescue can be used on I<any> disk image file or device, not just a "
20244 "virtual machine. For example you can use it on a blank file if you want to "
20245 "partition that file (although we would recommend using L<guestfish(1)> "
20246 "instead as it is more suitable for this purpose). You can even use "
20247 "virt-rescue on things like SD cards."
20251 #: ../rescue/virt-rescue.pod:76
20253 "Virt-rescue does not require root. You only need to run it as root if you "
20254 "need root to open the disk image."
20258 #: ../rescue/virt-rescue.pod:79
20260 "This tool is just designed for quick interactive hacking on a virtual "
20261 "machine. For more structured access to a virtual machine disk image, you "
20262 "should use L<guestfs(3)>. To get a structured shell that you can use to "
20263 "make scripted changes to guests, use L<guestfish(1)>."
20267 #: ../rescue/virt-rescue.pod:103
20268 msgid "B<--append kernelopts>"
20272 #: ../rescue/virt-rescue.pod:105
20273 msgid "Pass additional options to the rescue kernel."
20277 #: ../rescue/virt-rescue.pod:135
20280 " virt-rescue --format=raw -a disk.img\n"
20285 #: ../rescue/virt-rescue.pod:139
20288 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
20293 #: ../rescue/virt-rescue.pod:148
20298 #: ../rescue/virt-rescue.pod:150
20299 msgid "B<--memsize MB>"
20303 #: ../rescue/virt-rescue.pod:152
20305 "Change the amount of memory allocated to the rescue system. The default is "
20306 "set by libguestfs and is small but adequate for running system tools. The "
20307 "occasional program might need more memory. The parameter is specified in "
20312 #: ../rescue/virt-rescue.pod:157
20313 msgid "B<--network>"
20317 #: ../rescue/virt-rescue.pod:159
20318 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
20322 #: ../rescue/virt-rescue.pod:165
20323 msgid "Open the image read-only."
20327 #: ../rescue/virt-rescue.pod:175
20329 "Enable SELinux in the rescue appliance. You should read "
20330 "L<guestfs(3)/SELINUX> before using this option."
20334 #: ../rescue/virt-rescue.pod:178
20339 #: ../rescue/virt-rescue.pod:180
20340 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
20344 #: ../rescue/virt-rescue.pod:198
20346 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
20347 "are done read-write."
20351 #: ../rescue/virt-rescue.pod:211
20352 msgid "Previous versions of virt-rescue allowed you to write either:"
20356 #: ../rescue/virt-rescue.pod:213
20359 " virt-rescue disk.img [disk.img ...]\n"
20364 #: ../rescue/virt-rescue.pod:217
20367 " virt-rescue guestname\n"
20372 #: ../rescue/virt-rescue.pod:225
20377 #: ../rescue/virt-rescue.pod:227
20379 "Adding the I<--network> option enables QEMU user networking in the rescue "
20380 "appliance. There are some differences between user networking and ordinary "
20385 #: ../rescue/virt-rescue.pod:233
20386 msgid "ping does not work"
20390 #: ../rescue/virt-rescue.pod:235
20392 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
20393 "send the ping packets, and because virt-rescue must be able to run as "
20394 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
20395 "command. The ping command will appear to resolve addresses but will not be "
20396 "able to send or receive any packets. This does not mean that the network is "
20401 #: ../rescue/virt-rescue.pod:242
20402 msgid "cannot receive connections"
20406 #: ../rescue/virt-rescue.pod:244
20407 msgid "QEMU user networking cannot receive incoming connections."
20411 #: ../rescue/virt-rescue.pod:246
20412 msgid "making TCP connections"
20416 #: ../rescue/virt-rescue.pod:248
20418 "The virt-rescue appliance needs to be small and so does not include many "
20419 "network tools. In particular there is no L<telnet(1)> command. You can "
20420 "make TCP connections from the shell using the magical "
20421 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
20425 #: ../rescue/virt-rescue.pod:253
20428 " exec 3<>/dev/tcp/redhat.com/80\n"
20429 " echo \"GET /\" >&3\n"
20435 #: ../rescue/virt-rescue.pod:257
20436 msgid "See L<bash(1)> for more details."
20440 #: ../rescue/virt-rescue.pod:263
20442 "Several environment variables affect virt-rescue. See "
20443 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
20447 #: ../rescue/virt-rescue.pod:290
20449 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20450 "L<http://libguestfs.org/>."
20454 #: ../resize/virt-resize.pod:5
20455 msgid "virt-resize - Resize a virtual machine disk"
20459 #: ../resize/virt-resize.pod:9
20462 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20463 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20464 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20469 #: ../resize/virt-resize.pod:15
20471 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20472 "larger or smaller overall, and resizing or deleting any partitions contained "
20477 #: ../resize/virt-resize.pod:19
20479 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20480 "not> be used on live virtual machines - for consistent results, shut the "
20481 "virtual machine down before resizing it."
20485 #: ../resize/virt-resize.pod:23
20487 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20488 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20492 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520 ../src/guestfs.pod:469 ../src/guestfs.pod:1284 ../src/guestfs.pod:1423 ../src/guestfs.pod:2601
20497 #: ../resize/virt-resize.pod:33
20499 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20500 "fill the extra 5GB of space."
20504 #: ../resize/virt-resize.pod:36
20507 " virt-filesystems --long -h --all -a olddisk\n"
20512 #: ../resize/virt-resize.pod:38
20515 " truncate -r olddisk newdisk\n"
20516 " truncate -s +5G newdisk\n"
20521 #: ../resize/virt-resize.pod:41
20524 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20525 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20530 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527 ../src/guestfs.pod:475 ../src/guestfs.pod:1288 ../src/guestfs.pod:1427 ../src/guestfs.pod:2626
20535 #: ../resize/virt-resize.pod:46
20537 "As above, but make the /boot partition 200MB bigger, while giving the "
20538 "remaining space to /dev/sda2:"
20542 #: ../resize/virt-resize.pod:49
20545 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20546 " olddisk newdisk\n"
20551 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533 ../src/guestfs.pod:486 ../src/guestfs.pod:1433
20556 #: ../resize/virt-resize.pod:54
20558 "As in the first example, but expand a logical volume as the final step. "
20559 "This is what you would typically use for Linux guests that use LVM:"
20563 #: ../resize/virt-resize.pod:58
20566 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20567 " olddisk newdisk\n"
20572 #: ../resize/virt-resize.pod:61
20577 #: ../resize/virt-resize.pod:63
20579 "As in the first example, but the output format will be qcow2 instead of a "
20584 #: ../resize/virt-resize.pod:66
20587 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20588 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20593 #: ../resize/virt-resize.pod:71
20594 msgid "DETAILED USAGE"
20598 #: ../resize/virt-resize.pod:73
20599 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20603 #: ../resize/virt-resize.pod:77
20604 msgid "1. Shut down the virtual machine"
20608 #: ../resize/virt-resize.pod:79
20609 msgid "2. Locate input disk image"
20613 #: ../resize/virt-resize.pod:81
20615 "Locate the input disk image (ie. the file or device on the host containing "
20616 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20617 "dumpxml> like this to find the disk image name:"
20621 #: ../resize/virt-resize.pod:85
20624 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20625 " Found 1 nodes:\n"
20627 " <source dev=\"/dev/vg/lv_guest\" />\n"
20632 #: ../resize/virt-resize.pod:90
20633 msgid "3. Look at current sizing"
20637 #: ../resize/virt-resize.pod:92
20638 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20642 #: ../resize/virt-resize.pod:95
20645 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20646 " Name Type Size Parent\n"
20647 " /dev/sda1 partition 101M /dev/sda\n"
20648 " /dev/sda2 partition 7.9G /dev/sda\n"
20649 " /dev/sda device 8.0G -\n"
20654 #: ../resize/virt-resize.pod:101
20656 "(This example is a virtual machine with an 8 GB disk which we would like to "
20657 "expand up to 10 GB)."
20661 #: ../resize/virt-resize.pod:104
20662 msgid "4. Create output disk"
20666 #: ../resize/virt-resize.pod:106
20668 "Virt-resize cannot do in-place disk modifications. You have to have space "
20669 "to store the resized output disk."
20673 #: ../resize/virt-resize.pod:109
20674 msgid "To store the resized disk image in a file, create a file of a suitable size:"
20678 #: ../resize/virt-resize.pod:112
20681 " # rm -f outdisk\n"
20682 " # truncate -s 10G outdisk\n"
20687 #: ../resize/virt-resize.pod:115
20688 msgid "Or use L<lvcreate(1)> to create a logical volume:"
20692 #: ../resize/virt-resize.pod:117
20695 " # lvcreate -L 10G -n lv_name vg_name\n"
20700 #: ../resize/virt-resize.pod:119
20701 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
20705 #: ../resize/virt-resize.pod:121
20708 " # virsh pool-list\n"
20709 " # virsh vol-create-as poolname newvol 10G\n"
20714 #: ../resize/virt-resize.pod:124
20719 #: ../resize/virt-resize.pod:126
20721 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
20722 "file) and the output disk. The output disk is the one created in the "
20727 #: ../resize/virt-resize.pod:130
20730 " # virt-resize indisk outdisk\n"
20735 #: ../resize/virt-resize.pod:132
20737 "This command just copies disk image C<indisk> to disk image C<outdisk> "
20738 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
20739 "larger, then an extra, empty partition is created at the end of the disk "
20740 "covering the extra space. If C<outdisk> is smaller, then it will give an "
20745 #: ../resize/virt-resize.pod:138
20747 "More realistically you'd want to expand existing partitions in the disk "
20748 "image by passing extra options (for the full list see the L</OPTIONS> "
20753 #: ../resize/virt-resize.pod:142
20755 "L</--expand> is the most useful option. It expands the named partition "
20756 "within the disk to fill any extra space:"
20760 #: ../resize/virt-resize.pod:145
20763 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
20768 #: ../resize/virt-resize.pod:147
20770 "(In this case, an extra partition is I<not> created at the end of the disk, "
20771 "because there will be no unused space)."
20775 #: ../resize/virt-resize.pod:150
20777 "L</--resize> is the other commonly used option. The following would "
20778 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
20779 "rest of the available space:"
20783 #: ../resize/virt-resize.pod:154
20786 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20787 " indisk outdisk\n"
20792 #: ../resize/virt-resize.pod:157
20794 "If the expanded partition in the image contains a filesystem or LVM PV, then "
20795 "if virt-resize knows how, it will resize the contents, the equivalent of "
20796 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
20797 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
20798 "filesystems, so you would have to online resize them after booting the "
20803 #: ../resize/virt-resize.pod:164
20804 msgid "Other options are covered below."
20808 #: ../resize/virt-resize.pod:166
20813 #: ../resize/virt-resize.pod:168
20814 msgid "Thoroughly test the new disk image I<before> discarding the old one."
20818 #: ../resize/virt-resize.pod:170
20819 msgid "If you are using libvirt, edit the XML to point at the new disk:"
20823 #: ../resize/virt-resize.pod:172
20826 " # virsh edit guestname\n"
20831 #: ../resize/virt-resize.pod:174
20833 "Change E<lt>source ...E<gt>, see "
20834 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
20838 #: ../resize/virt-resize.pod:177
20839 msgid "Then start up the domain with the new, resized disk:"
20843 #: ../resize/virt-resize.pod:179
20846 " # virsh start guestname\n"
20851 #: ../resize/virt-resize.pod:181
20853 "and check that it still works. See also the L</NOTES> section below for "
20854 "additional information."
20858 #: ../resize/virt-resize.pod:184
20859 msgid "7. Resize LVs etc inside the guest"
20863 #: ../resize/virt-resize.pod:186
20864 msgid "(This can also be done offline using L<guestfish(1)>)"
20868 #: ../resize/virt-resize.pod:188
20870 "Once the guest has booted you should see the new space available, at least "
20871 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
20872 "may need to resize LVs inside PVs, and also resize filesystem types that "
20873 "virt-resize does not know how to expand."
20877 #: ../resize/virt-resize.pod:195
20878 msgid "SHRINKING A VIRTUAL MACHINE DISK"
20882 #: ../resize/virt-resize.pod:197
20884 "Shrinking is somewhat more complex than expanding, and only an overview is "
20889 #: ../resize/virt-resize.pod:200
20891 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
20892 "filesystems). The user has to shrink content before passing the disk image "
20893 "to virt-resize, and virt-resize will check that the content has been shrunk "
20898 #: ../resize/virt-resize.pod:205
20899 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
20903 #: ../resize/virt-resize.pod:207
20905 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
20906 "steps 3 and 4 above to allocate a new disk image."
20910 #: ../resize/virt-resize.pod:210
20911 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
20915 #: ../resize/virt-resize.pod:213
20916 msgid "IGNORING OR DELETING PARTITIONS"
20920 #: ../resize/virt-resize.pod:215
20922 "virt-resize also gives a convenient way to ignore or delete partitions when "
20923 "copying from the input disk to the output disk. Ignoring a partition speeds "
20924 "up the copy where you don't care about the existing contents of a "
20925 "partition. Deleting a partition removes it completely, but note that it "
20926 "also renumbers any partitions after the one which is deleted, which can "
20927 "leave some guests unbootable."
20931 #: ../resize/virt-resize.pod:222
20932 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
20936 #: ../resize/virt-resize.pod:224
20938 "If the input disk is in qcow2 format, then you may prefer that the output is "
20939 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
20940 "the fly. The output format is simply determined by the format of the empty "
20941 "output container that you provide. Thus to create qcow2 output, use:"
20945 #: ../resize/virt-resize.pod:230
20948 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
20953 #: ../resize/virt-resize.pod:232
20954 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
20958 #: ../resize/virt-resize.pod:234
20959 msgid "Similarly, to get non-sparse raw output use:"
20963 #: ../resize/virt-resize.pod:236
20966 " fallocate -l size outdisk\n"
20971 #: ../resize/virt-resize.pod:238
20973 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
20974 "if=/dev/zero of=outdisk bs=1M count=..>)"
20978 #: ../resize/virt-resize.pod:247
20979 msgid "Display help."
20983 #: ../resize/virt-resize.pod:249
20988 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
20993 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
20994 msgid "Enable debugging messages."
20998 #: ../resize/virt-resize.pod:255
20999 msgid "B<--delete part>"
21003 #: ../resize/virt-resize.pod:257
21005 "Delete the named partition. It would be more accurate to describe this as "
21006 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
21007 "the original disk image is left intact."
21011 #: ../resize/virt-resize.pod:261
21013 "Note that when you delete a partition, then anything contained in the "
21014 "partition is also deleted. Furthermore, this causes any partitions that "
21015 "come after to be I<renumbered>, which can easily make your guest unbootable."
21019 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327 ../resize/virt-resize.pod:454
21020 msgid "You can give this option multiple times."
21024 #: ../resize/virt-resize.pod:268
21025 msgid "B<--expand part>"
21029 #: ../resize/virt-resize.pod:270
21031 "Expand the named partition so it uses up all extra space (space left over "
21032 "after any other resize changes that you request have been done)."
21036 #: ../resize/virt-resize.pod:273
21038 "If virt-resize knows how, it will expand the direct content of the "
21039 "partition. For example, if the partition is an LVM PV, it will expand the "
21040 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
21041 "content it doesn't know about alone."
21045 #: ../resize/virt-resize.pod:278
21046 msgid "Currently virt-resize can resize:"
21050 #: ../resize/virt-resize.pod:284
21051 msgid "ext2, ext3 and ext4 filesystems."
21055 #: ../resize/virt-resize.pod:288
21056 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
21060 #: ../resize/virt-resize.pod:290
21062 "The filesystem must have been shut down consistently last time it was used. "
21063 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
21064 "consistency check, so at the first boot after resizing Windows will check "
21069 #: ../resize/virt-resize.pod:297
21071 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
21072 "inside the PV, but see the I<--LV-expand> option. The user could also "
21073 "resize LVs as desired after boot."
21077 #: ../resize/virt-resize.pod:303
21078 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
21082 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
21083 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
21087 #: ../resize/virt-resize.pod:309 ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
21088 msgid "B<--format> raw"
21092 #: ../resize/virt-resize.pod:311
21094 "Specify the format of the input disk image. If this flag is not given then "
21095 "it is auto-detected from the image itself."
21099 #: ../resize/virt-resize.pod:317
21101 "Note that this option I<does not> affect the output format. See L</QCOW2 "
21102 "AND NON-SPARSE RAW FORMATS>."
21106 #: ../resize/virt-resize.pod:320
21107 msgid "B<--ignore part>"
21111 #: ../resize/virt-resize.pod:322
21113 "Ignore the named partition. Effectively this means the partition is "
21114 "allocated on the destination disk, but the content is not copied across from "
21115 "the source disk. The content of the partition will be blank (all zero "
21120 #: ../resize/virt-resize.pod:329
21121 msgid "B<--LV-expand logvol>"
21125 #: ../resize/virt-resize.pod:331
21127 "This takes the logical volume and, as a final step, expands it to fill all "
21128 "the space available in its volume group. A typical usage, assuming a Linux "
21129 "guest with a single PV C</dev/sda2> and a root device called "
21130 "C</dev/vg_guest/lv_root> would be:"
21134 #: ../resize/virt-resize.pod:336
21137 " virt-resize indisk outdisk \\\n"
21138 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
21143 #: ../resize/virt-resize.pod:339
21145 "This would first expand the partition (and PV), and then expand the root "
21146 "device to fill the extra space in the PV."
21150 #: ../resize/virt-resize.pod:342
21152 "The contents of the LV are also resized if virt-resize knows how to do "
21153 "that. You can stop virt-resize from trying to expand the content by using "
21154 "the option I<--no-expand-content>."
21158 #: ../resize/virt-resize.pod:346
21159 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
21163 #: ../resize/virt-resize.pod:348
21165 "You can give this option multiple times, I<but> it doesn't make sense to do "
21166 "this unless the logical volumes you specify are all in different volume "
21171 #: ../resize/virt-resize.pod:352
21172 msgid "B<--machine-readable>"
21176 #: ../resize/virt-resize.pod:354
21178 "This option is used to make the output more machine friendly when being "
21179 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
21183 #: ../resize/virt-resize.pod:360
21184 msgid "B<--dryrun>"
21188 #: ../resize/virt-resize.pod:362
21189 msgid "Print a summary of what would be done, but don't do anything."
21193 #: ../resize/virt-resize.pod:364
21194 msgid "B<--no-copy-boot-loader>"
21198 #: ../resize/virt-resize.pod:366
21200 "By default, virt-resize copies over some sectors at the start of the disk "
21201 "(up to the beginning of the first partition). Commonly these sectors "
21202 "contain the Master Boot Record (MBR) and the boot loader, and are required "
21203 "in order for the guest to boot correctly."
21207 #: ../resize/virt-resize.pod:371
21209 "If you specify this flag, then this initial copy is not done. You may need "
21210 "to reinstall the boot loader in this case."
21214 #: ../resize/virt-resize.pod:374
21215 msgid "B<--no-extra-partition>"
21219 #: ../resize/virt-resize.pod:376
21221 "By default, virt-resize creates an extra partition if there is any extra, "
21222 "unused space after all resizing has happened. Use this option to prevent "
21223 "the extra partition from being created. If you do this then the extra space "
21224 "will be inaccessible until you run fdisk, parted, or some other partitioning "
21225 "tool in the guest."
21229 #: ../resize/virt-resize.pod:382
21231 "Note that if the surplus space is smaller than 10 MB, no extra partition "
21236 #: ../resize/virt-resize.pod:385
21237 msgid "B<--no-expand-content>"
21241 #: ../resize/virt-resize.pod:387
21243 "By default, virt-resize will try to expand the direct contents of "
21244 "partitions, if it knows how (see I<--expand> option above)."
21248 #: ../resize/virt-resize.pod:390
21250 "If you give the I<--no-expand-content> option then virt-resize will not "
21255 #: ../resize/virt-resize.pod:393
21256 msgid "B<--ntfsresize-force>"
21260 #: ../resize/virt-resize.pod:395
21262 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
21263 "the NTFS disk is marked as needing a consistency check. You have to use "
21264 "this option if you want to resize a Windows guest multiple times without "
21265 "booting into Windows between each resize."
21269 #: ../resize/virt-resize.pod:401
21270 msgid "B<--output-format> raw"
21274 #: ../resize/virt-resize.pod:403
21276 "Specify the format of the output disk image. If this flag is not given then "
21277 "it is auto-detected from the image itself."
21281 #: ../resize/virt-resize.pod:409
21283 "Note that this option I<does not create> the output format. This option "
21284 "just tells libguestfs what it is so it doesn't try to guess it. You still "
21285 "need to create the output disk with the right format. See L</QCOW2 AND "
21286 "NON-SPARSE RAW FORMATS>."
21290 #: ../resize/virt-resize.pod:414
21295 #: ../resize/virt-resize.pod:416
21300 #: ../resize/virt-resize.pod:418
21301 msgid "Don't print the summary."
21305 #: ../resize/virt-resize.pod:420
21306 msgid "B<--resize part=size>"
21310 #: ../resize/virt-resize.pod:422
21312 "Resize the named partition (expanding or shrinking it) so that it has the "
21317 #: ../resize/virt-resize.pod:425
21319 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
21320 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
21321 "size; or as a relative number or percentage. For example:"
21325 #: ../resize/virt-resize.pod:431
21328 " --resize /dev/sda2=10G\n"
21333 #: ../resize/virt-resize.pod:433
21336 " --resize /dev/sda4=90%\n"
21341 #: ../resize/virt-resize.pod:435
21344 " --resize /dev/sda2=+1G\n"
21349 #: ../resize/virt-resize.pod:437
21352 " --resize /dev/sda2=-200M\n"
21357 #: ../resize/virt-resize.pod:439
21360 " --resize /dev/sda1=+128K\n"
21365 #: ../resize/virt-resize.pod:441
21368 " --resize /dev/sda1=+10%\n"
21373 #: ../resize/virt-resize.pod:443
21376 " --resize /dev/sda1=-10%\n"
21381 #: ../resize/virt-resize.pod:445
21383 "You can increase the size of any partition. Virt-resize will expand the "
21384 "direct content of the partition if it knows how (see I<--expand> below)."
21388 #: ../resize/virt-resize.pod:449
21390 "You can only I<decrease> the size of partitions that contain filesystems or "
21391 "PVs which have already been shrunk. Virt-resize will check this has been "
21392 "done before proceeding, or else will print an error (see also "
21393 "I<--resize-force>)."
21397 #: ../resize/virt-resize.pod:456
21398 msgid "B<--resize-force part=size>"
21402 #: ../resize/virt-resize.pod:458
21404 "This is the same as I<--resize> except that it will let you decrease the "
21405 "size of any partition. Generally this means you will lose any data which "
21406 "was at the end of the partition you shrink, but you may not care about that "
21407 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
21408 "as a swap partition)."
21412 #: ../resize/virt-resize.pod:464
21413 msgid "See also the I<--ignore> option."
21417 #: ../resize/virt-resize.pod:466
21418 msgid "B<--shrink part>"
21422 #: ../resize/virt-resize.pod:468
21424 "Shrink the named partition until the overall disk image fits in the "
21425 "destination. The named partition B<must> contain a filesystem or PV which "
21426 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
21427 "online tools). Virt-resize will check this and give an error if it has not "
21432 #: ../resize/virt-resize.pod:474
21434 "The amount by which the overall disk must be shrunk (after carrying out all "
21435 "other operations requested by the user) is called the \"deficit\". For "
21436 "example, a straight copy (assume no other operations) from a 5GB disk image "
21437 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
21438 "would give an error unless the user specified a partition to shrink and that "
21439 "partition had more than a gigabyte of free space."
21443 #: ../resize/virt-resize.pod:492
21444 msgid "MACHINE READABLE OUTPUT"
21448 #: ../resize/virt-resize.pod:494
21450 "The I<--machine-readable> option can be used to make the output more machine "
21451 "friendly, which is useful when calling virt-resize from other programs, GUIs "
21456 #: ../resize/virt-resize.pod:498
21457 msgid "There are two ways to use this option."
21461 #: ../resize/virt-resize.pod:500
21463 "Firstly use the option on its own to query the capabilities of the "
21464 "virt-resize binary. Typical output looks like this:"
21468 #: ../resize/virt-resize.pod:503
21471 " $ virt-resize --machine-readable\n"
21473 " ntfsresize-force\n"
21481 #: ../resize/virt-resize.pod:510
21483 "A list of features is printed, one per line, and the program exits with "
21488 #: ../resize/virt-resize.pod:513
21490 "Secondly use the option in conjunction with other options to make the "
21491 "regular program output more machine friendly."
21495 #: ../resize/virt-resize.pod:516
21496 msgid "At the moment this means:"
21500 #: ../resize/virt-resize.pod:522
21502 "Progress bar messages can be parsed from stdout by looking for this regular "
21507 #: ../resize/virt-resize.pod:525
21510 " ^[0-9]+/[0-9]+$\n"
21515 #: ../resize/virt-resize.pod:529
21517 "The calling program should treat messages sent to stdout (except for "
21518 "progress bar messages) as status messages. They can be logged and/or "
21519 "displayed to the user."
21523 #: ../resize/virt-resize.pod:535
21525 "The calling program should treat messages sent to stderr as error messages. "
21526 "In addition, virt-resize exits with a non-zero status code if there was a "
21531 #: ../resize/virt-resize.pod:541
21533 "Versions of the program prior to 1.13.9 did not support the "
21534 "I<--machine-readable> option and will return an error."
21538 #: ../resize/virt-resize.pod:546
21539 msgid "\"Partition 1 does not end on cylinder boundary.\""
21543 #: ../resize/virt-resize.pod:548
21545 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
21546 "means the partitions will not be aligned to the ancient CHS geometry. "
21547 "However CHS geometry is meaningless for disks manufactured since the early "
21548 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
21549 "cylinders is not required by any modern operating system."
21553 #: ../resize/virt-resize.pod:555
21554 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
21558 #: ../resize/virt-resize.pod:557
21560 "In Windows Vista and later versions, Microsoft switched to using a separate "
21561 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
21562 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
21563 "the boot partition. Doing so seems to break the guest completely. However "
21564 "expanding the second partition (ie. C: drive) should work."
21568 #: ../resize/virt-resize.pod:564
21570 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21571 "NTFS partitions have been expanded. This is just a safety check and (unless "
21572 "it find errors) is nothing to worry about."
21576 #: ../resize/virt-resize.pod:568
21577 msgid "GUEST BOOT STUCK AT \"GRUB\""
21581 #: ../resize/virt-resize.pod:570
21583 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21584 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21585 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21586 "although we think is to do with partition alignment."
21590 #: ../resize/virt-resize.pod:575
21593 " guestfish -i -a newdisk\n"
21594 " ><fs> cat /boot/grub/device.map\n"
21595 " # check the contents of this file are sensible or\n"
21596 " # edit the file if necessary\n"
21597 " ><fs> grub-install / /dev/vda\n"
21603 #: ../resize/virt-resize.pod:582
21605 "For more flexible guest reconfiguration, including if you need to specify "
21606 "other parameters to grub-install, use L<virt-rescue(1)>."
21610 #: ../resize/virt-resize.pod:585
21611 msgid "ALTERNATIVE TOOLS"
21615 #: ../resize/virt-resize.pod:587
21617 "There are several proprietary tools for resizing partitions. We won't "
21618 "mention any here."
21622 #: ../resize/virt-resize.pod:590
21624 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21625 "operations on disk images. They can resize and move partitions, but I don't "
21626 "think they can do anything with the contents, and they certainly don't "
21631 #: ../resize/virt-resize.pod:595
21633 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21634 "but at a much lower level. You will probably end up hand-calculating sector "
21635 "offsets, which is something that virt-resize was designed to avoid. If you "
21636 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21641 #: ../resize/virt-resize.pod:615
21643 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
21644 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
21645 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
21646 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
21647 "L<http://libguestfs.org/>."
21651 #: ../ruby/examples/guestfs-ruby.pod:5
21652 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21656 #: ../ruby/examples/guestfs-ruby.pod:9
21659 " require 'guestfs'\n"
21660 " g = Guestfs::Guestfs.new()\n"
21661 " g.add_drive_opts(\"disk.img\",\n"
21662 " :readonly => 1, :format => \"raw\")\n"
21668 #: ../ruby/examples/guestfs-ruby.pod:17
21670 "This manual page documents how to call libguestfs from the Ruby programming "
21671 "language. This page just documents the differences from the C API and gives "
21672 "some examples. If you are not familiar with using libguestfs, you also need "
21673 "to read L<guestfs(3)>."
21677 #: ../ruby/examples/guestfs-ruby.pod:24
21679 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21680 "This has a single parameter which is the error message (a string)."
21684 #: ../ruby/examples/guestfs-ruby.pod:38
21686 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21687 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21688 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
21692 #: ../src/guestfs-actions.pod:1
21693 msgid "guestfs_add_cdrom"
21697 #: ../src/guestfs-actions.pod:3
21701 " guestfs_add_cdrom (guestfs_h *g,\n"
21702 " const char *filename);\n"
21707 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
21709 "I<This function is deprecated.> In new code, use the "
21710 "L</guestfs_add_drive_opts> call instead."
21714 #: ../src/guestfs-actions.pod:24
21716 "This call checks for the existence of C<filename>. This stops you from "
21717 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21718 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21723 #: ../src/guestfs-actions.pod:31
21725 "If you just want to add an ISO file (often you use this as an efficient way "
21726 "to transfer large files into the guest), then you should probably use "
21727 "C<guestfs_add_drive_ro> instead."
21731 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280 ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307 ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447 ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506 ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552 ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652 ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681 ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826 ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046 ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084 ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1231 ../src/guestfs-actions.pod:1275 ../src/guestfs-actions.pod:1293 ../src/guestfs-actions.pod:1312 ../src/guestfs-actions.pod:1326 ../src/guestfs-actions.pod:1346 ../src/guestfs-actions.pod:1416 ../src/guestfs-actions.pod:1447 ../src/guestfs-actions.pod:1472 ../src/guestfs-actions.pod:1514 ../src/guestfs-actions.pod:1627 ../src/guestfs-actions.pod:1654 ../src/guestfs-actions.pod:1869 ../src/guestfs-actions.pod:1891 ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:2484 ../src/guestfs-actions.pod:2628 ../src/guestfs-actions.pod:2689 ../src/guestfs-actions.pod:2724 ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:3783 ../src/guestfs-actions.pod:3808 ../src/guestfs-actions.pod:3997 ../src/guestfs-actions.pod:4011 ../src/guestfs-actions.pod:4024 ../src/guestfs-actions.pod:4038 ../src/guestfs-actions.pod:4053 ../src/guestfs-actions.pod:4089 ../src/guestfs-actions.pod:4161 ../src/guestfs-actions.pod:4181 ../src/guestfs-actions.pod:4198 ../src/guestfs-actions.pod:4221 ../src/guestfs-actions.pod:4244 ../src/guestfs-actions.pod:4279 ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:4317 ../src/guestfs-actions.pod:4352 ../src/guestfs-actions.pod:4364 ../src/guestfs-actions.pod:4400 ../src/guestfs-actions.pod:4416 ../src/guestfs-actions.pod:4429 ../src/guestfs-actions.pod:4444 ../src/guestfs-actions.pod:4461 ../src/guestfs-actions.pod:4554 ../src/guestfs-actions.pod:4574 ../src/guestfs-actions.pod:4587 ../src/guestfs-actions.pod:4638 ../src/guestfs-actions.pod:4656 ../src/guestfs-actions.pod:4674 ../src/guestfs-actions.pod:4690 ../src/guestfs-actions.pod:4704 ../src/guestfs-actions.pod:4718 ../src/guestfs-actions.pod:4735 ../src/guestfs-actions.pod:4750 ../src/guestfs-actions.pod:4777 ../src/guestfs-actions.pod:4840 ../src/guestfs-actions.pod:4913 ../src/guestfs-actions.pod:4944 ../src/guestfs-actions.pod:4963 ../src/guestfs-actions.pod:4982 ../src/guestfs-actions.pod:4994 ../src/guestfs-actions.pod:5011 ../src/guestfs-actions.pod:5024 ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5054 ../src/guestfs-actions.pod:5096 ../src/guestfs-actions.pod:5122 ../src/guestfs-actions.pod:5161 ../src/guestfs-actions.pod:5181 ../src/guestfs-actions.pod:5195 ../src/guestfs-actions.pod:5212 ../src/guestfs-actions.pod:5261 ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:5361 ../src/guestfs-actions.pod:5404 ../src/guestfs-actions.pod:5432 ../src/guestfs-actions.pod:5449 ../src/guestfs-actions.pod:5467 ../src/guestfs-actions.pod:5607 ../src/guestfs-actions.pod:5664 ../src/guestfs-actions.pod:5686 ../src/guestfs-actions.pod:5704 ../src/guestfs-actions.pod:5736 ../src/guestfs-actions.pod:5802 ../src/guestfs-actions.pod:5819 ../src/guestfs-actions.pod:5832 ../src/guestfs-actions.pod:5846 ../src/guestfs-actions.pod:6135 ../src/guestfs-actions.pod:6154 ../src/guestfs-actions.pod:6173 ../src/guestfs-actions.pod:6187 ../src/guestfs-actions.pod:6199 ../src/guestfs-actions.pod:6213 ../src/guestfs-actions.pod:6225 ../src/guestfs-actions.pod:6239 ../src/guestfs-actions.pod:6255 ../src/guestfs-actions.pod:6276 ../src/guestfs-actions.pod:6295 ../src/guestfs-actions.pod:6314 ../src/guestfs-actions.pod:6344 ../src/guestfs-actions.pod:6362 ../src/guestfs-actions.pod:6385 ../src/guestfs-actions.pod:6403 ../src/guestfs-actions.pod:6422 ../src/guestfs-actions.pod:6443 ../src/guestfs-actions.pod:6462 ../src/guestfs-actions.pod:6479 ../src/guestfs-actions.pod:6498 ../src/guestfs-actions.pod:6526 ../src/guestfs-actions.pod:6550 ../src/guestfs-actions.pod:6569 ../src/guestfs-actions.pod:6585 ../src/guestfs-actions.pod:6607 ../src/guestfs-actions.pod:6626 ../src/guestfs-actions.pod:6641 ../src/guestfs-actions.pod:6660 ../src/guestfs-actions.pod:6704 ../src/guestfs-actions.pod:6734 ../src/guestfs-actions.pod:6767 ../src/guestfs-actions.pod:6882 ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7015 ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7041 ../src/guestfs-actions.pod:7063 ../src/guestfs-actions.pod:7076 ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7102 ../src/guestfs-actions.pod:7117 ../src/guestfs-actions.pod:7176 ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7209 ../src/guestfs-actions.pod:7225 ../src/guestfs-actions.pod:7242 ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7275 ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7325 ../src/guestfs-actions.pod:7366 ../src/guestfs-actions.pod:7379 ../src/guestfs-actions.pod:7397 ../src/guestfs-actions.pod:7431 ../src/guestfs-actions.pod:7467 ../src/guestfs-actions.pod:7583 ../src/guestfs-actions.pod:7598 ../src/guestfs-actions.pod:7612 ../src/guestfs-actions.pod:7667 ../src/guestfs-actions.pod:7680 ../src/guestfs-actions.pod:7725 ../src/guestfs-actions.pod:7765 ../src/guestfs-actions.pod:7821 ../src/guestfs-actions.pod:7841 ../src/guestfs-actions.pod:7874 ../src/guestfs-actions.pod:7938 ../src/guestfs-actions.pod:7961 ../src/guestfs-actions.pod:7990
21732 msgid "This function returns 0 on success or -1 on error."
21736 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1277 ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:2313 ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:3790 ../src/guestfs-actions.pod:5098 ../src/guestfs-actions.pod:6364 ../src/guestfs-actions.pod:6481 ../src/guestfs-actions.pod:6628 ../src/guestfs-actions.pod:7119 ../src/guestfs-actions.pod:7244 ../src/guestfs-actions.pod:7767
21737 msgid "(Added in 0.3)"
21741 #: ../src/guestfs-actions.pod:41
21742 msgid "guestfs_add_domain"
21746 #: ../src/guestfs-actions.pod:43
21750 " guestfs_add_domain (guestfs_h *g,\n"
21751 " const char *dom,\n"
21757 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:1161 ../src/guestfs-actions.pod:1211 ../src/guestfs-actions.pod:2973 ../src/guestfs-actions.pod:4789 ../src/guestfs-actions.pod:5108 ../src/guestfs-actions.pod:5325
21759 "You may supply a list of optional arguments to this call. Use zero or more "
21760 "of the following pairs of parameters, and terminate the list with C<-1> on "
21761 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
21765 #: ../src/guestfs-actions.pod:53
21768 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
21769 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
21770 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
21771 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
21772 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
21777 #: ../src/guestfs-actions.pod:59
21779 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
21780 "It works by connecting to libvirt, requesting the domain and domain XML from "
21781 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
21786 #: ../src/guestfs-actions.pod:94
21788 "The other optional parameters are passed directly through to "
21789 "C<guestfs_add_drive_opts>."
21793 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350 ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698 ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1492 ../src/guestfs-actions.pod:1848 ../src/guestfs-actions.pod:2051 ../src/guestfs-actions.pod:2162 ../src/guestfs-actions.pod:2213 ../src/guestfs-actions.pod:2265 ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:2300 ../src/guestfs-actions.pod:2615 ../src/guestfs-actions.pod:3091 ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:5284 ../src/guestfs-actions.pod:5504 ../src/guestfs-actions.pod:5916 ../src/guestfs-actions.pod:5942 ../src/guestfs-actions.pod:7352 ../src/guestfs-actions.pod:7778 ../src/guestfs-actions.pod:7791 ../src/guestfs-actions.pod:7804
21794 msgid "On error this function returns -1."
21798 #: ../src/guestfs-actions.pod:99
21799 msgid "(Added in 1.7.4)"
21803 #: ../src/guestfs-actions.pod:101
21804 msgid "guestfs_add_domain_va"
21808 #: ../src/guestfs-actions.pod:103
21812 " guestfs_add_domain_va (guestfs_h *g,\n"
21813 " const char *dom,\n"
21814 " va_list args);\n"
21819 #: ../src/guestfs-actions.pod:108
21820 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
21824 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225 ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887 ../src/guestfs-actions.pod:1187 ../src/guestfs-actions.pod:1200 ../src/guestfs-actions.pod:1244 ../src/guestfs-actions.pod:1257 ../src/guestfs-actions.pod:3057 ../src/guestfs-actions.pod:3069 ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:4866 ../src/guestfs-actions.pod:5136 ../src/guestfs-actions.pod:5148 ../src/guestfs-actions.pod:5374 ../src/guestfs-actions.pod:5385
21825 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
21829 #: ../src/guestfs-actions.pod:112
21830 msgid "guestfs_add_domain_argv"
21834 #: ../src/guestfs-actions.pod:114
21838 " guestfs_add_domain_argv (guestfs_h *g,\n"
21839 " const char *dom,\n"
21840 " const struct guestfs_add_domain_argv *optargs);\n"
21845 #: ../src/guestfs-actions.pod:119
21846 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
21850 #: ../src/guestfs-actions.pod:123
21851 msgid "guestfs_add_drive"
21855 #: ../src/guestfs-actions.pod:125
21859 " guestfs_add_drive (guestfs_h *g,\n"
21860 " const char *filename);\n"
21865 #: ../src/guestfs-actions.pod:129
21867 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
21868 "optional parameters, so the disk is added writable, with the format being "
21869 "detected automatically."
21873 #: ../src/guestfs-actions.pod:133
21875 "Automatic detection of the format opens you up to a potential security hole "
21876 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
21877 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
21878 "you should think about replacing calls to this function with calls to "
21879 "C<guestfs_add_drive_opts>, and specifying the format."
21883 #: ../src/guestfs-actions.pod:144
21884 msgid "guestfs_add_drive_opts"
21888 #: ../src/guestfs-actions.pod:146
21892 " guestfs_add_drive_opts (guestfs_h *g,\n"
21893 " const char *filename,\n"
21899 #: ../src/guestfs-actions.pod:156
21902 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
21903 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
21904 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
21909 #: ../src/guestfs-actions.pod:185
21911 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
21912 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
21913 "Possible formats include C<raw> and C<qcow2>."
21917 #: ../src/guestfs-actions.pod:196
21919 "This rarely-used option lets you emulate the behaviour of the deprecated "
21920 "C<guestfs_add_drive_with_if> call (q.v.)"
21924 #: ../src/guestfs-actions.pod:203
21925 msgid "(Added in 1.5.23)"
21929 #: ../src/guestfs-actions.pod:205
21930 msgid "guestfs_add_drive_opts_va"
21934 #: ../src/guestfs-actions.pod:207
21938 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
21939 " const char *filename,\n"
21940 " va_list args);\n"
21945 #: ../src/guestfs-actions.pod:212
21946 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
21950 #: ../src/guestfs-actions.pod:216
21951 msgid "guestfs_add_drive_opts_argv"
21955 #: ../src/guestfs-actions.pod:218
21959 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
21960 " const char *filename,\n"
21961 " const struct guestfs_add_drive_opts_argv "
21967 #: ../src/guestfs-actions.pod:223
21968 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
21972 #: ../src/guestfs-actions.pod:227
21973 msgid "guestfs_add_drive_ro"
21977 #: ../src/guestfs-actions.pod:229
21981 " guestfs_add_drive_ro (guestfs_h *g,\n"
21982 " const char *filename);\n"
21987 #: ../src/guestfs-actions.pod:233
21989 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
21990 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
21991 "disk is added read-only, with the format being detected automatically."
21995 #: ../src/guestfs-actions.pod:240
21996 msgid "(Added in 1.0.38)"
22000 #: ../src/guestfs-actions.pod:242
22001 msgid "guestfs_add_drive_ro_with_if"
22005 #: ../src/guestfs-actions.pod:244
22009 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
22010 " const char *filename,\n"
22011 " const char *iface);\n"
22016 #: ../src/guestfs-actions.pod:256
22018 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
22019 "QEMU interface emulation to use at run time."
22023 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282 ../src/guestfs-actions.pod:2574
22024 msgid "(Added in 1.0.84)"
22028 #: ../src/guestfs-actions.pod:263
22029 msgid "guestfs_add_drive_with_if"
22033 #: ../src/guestfs-actions.pod:265
22037 " guestfs_add_drive_with_if (guestfs_h *g,\n"
22038 " const char *filename,\n"
22039 " const char *iface);\n"
22044 #: ../src/guestfs-actions.pod:277
22046 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
22047 "QEMU interface emulation to use at run time."
22051 #: ../src/guestfs-actions.pod:284
22052 msgid "guestfs_aug_clear"
22056 #: ../src/guestfs-actions.pod:286
22060 " guestfs_aug_clear (guestfs_h *g,\n"
22061 " const char *augpath);\n"
22066 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2302
22067 msgid "(Added in 1.3.4)"
22071 #: ../src/guestfs-actions.pod:297
22072 msgid "guestfs_aug_close"
22076 #: ../src/guestfs-actions.pod:299
22080 " guestfs_aug_close (guestfs_h *g);\n"
22085 #: ../src/guestfs-actions.pod:302
22087 "Close the current Augeas handle and free up any resources used by it. After "
22088 "calling this, you have to call C<guestfs_aug_init> again before you can use "
22089 "any other Augeas functions."
22093 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334 ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366 ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449 ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494 ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522 ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554 ../src/guestfs-actions.pod:5993
22094 msgid "(Added in 0.7)"
22098 #: ../src/guestfs-actions.pod:311
22099 msgid "guestfs_aug_defnode"
22103 #: ../src/guestfs-actions.pod:313
22106 " struct guestfs_int_bool *\n"
22107 " guestfs_aug_defnode (guestfs_h *g,\n"
22108 " const char *name,\n"
22109 " const char *expr,\n"
22110 " const char *val);\n"
22115 #: ../src/guestfs-actions.pod:322
22117 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
22118 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
22119 "containing that single node."
22123 #: ../src/guestfs-actions.pod:330
22125 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
22126 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
22130 #: ../src/guestfs-actions.pod:336
22131 msgid "guestfs_aug_defvar"
22135 #: ../src/guestfs-actions.pod:338
22139 " guestfs_aug_defvar (guestfs_h *g,\n"
22140 " const char *name,\n"
22141 " const char *expr);\n"
22146 #: ../src/guestfs-actions.pod:354
22147 msgid "guestfs_aug_get"
22151 #: ../src/guestfs-actions.pod:356
22155 " guestfs_aug_get (guestfs_h *g,\n"
22156 " const char *augpath);\n"
22161 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927 ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005 ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124 ../src/guestfs-actions.pod:1361 ../src/guestfs-actions.pod:1378 ../src/guestfs-actions.pod:1397 ../src/guestfs-actions.pod:1531 ../src/guestfs-actions.pod:1719 ../src/guestfs-actions.pod:1831 ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:2011 ../src/guestfs-actions.pod:2078 ../src/guestfs-actions.pod:2121 ../src/guestfs-actions.pod:2142 ../src/guestfs-actions.pod:2325 ../src/guestfs-actions.pod:2539 ../src/guestfs-actions.pod:2743 ../src/guestfs-actions.pod:2837 ../src/guestfs-actions.pod:2941 ../src/guestfs-actions.pod:2960 ../src/guestfs-actions.pod:3174 ../src/guestfs-actions.pod:3202 ../src/guestfs-actions.pod:3223 ../src/guestfs-actions.pod:3257 ../src/guestfs-actions.pod:3316 ../src/guestfs-actions.pod:3336 ../src/guestfs-actions.pod:3356 ../src/guestfs-actions.pod:3983 ../src/guestfs-actions.pod:4336 ../src/guestfs-actions.pod:4506 ../src/guestfs-actions.pod:4616 ../src/guestfs-actions.pod:5522 ../src/guestfs-actions.pod:5721 ../src/guestfs-actions.pod:5891 ../src/guestfs-actions.pod:6069 ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6788 ../src/guestfs-actions.pod:6804 ../src/guestfs-actions.pod:6828 ../src/guestfs-actions.pod:6852 ../src/guestfs-actions.pod:7526 ../src/guestfs-actions.pod:7545 ../src/guestfs-actions.pod:7563 ../src/guestfs-actions.pod:7737 ../src/guestfs-actions.pod:8054
22163 "This function returns a string, or NULL on error. I<The caller must free "
22164 "the returned string after use>."
22168 #: ../src/guestfs-actions.pod:368
22169 msgid "guestfs_aug_init"
22173 #: ../src/guestfs-actions.pod:370
22177 " guestfs_aug_init (guestfs_h *g,\n"
22178 " const char *root,\n"
22184 #: ../src/guestfs-actions.pod:379
22185 msgid "You must call this before using any other C<guestfs_aug_*> commands."
22189 #: ../src/guestfs-actions.pod:404
22191 "This option is only useful when debugging Augeas lenses. Use of this option "
22192 "may require additional memory for the libguestfs appliance. You may need to "
22193 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
22194 "C<guestfs_set_memsize>."
22198 #: ../src/guestfs-actions.pod:419
22199 msgid "Do not load the tree in C<guestfs_aug_init>."
22203 #: ../src/guestfs-actions.pod:423
22204 msgid "To close the handle, you can call C<guestfs_aug_close>."
22208 #: ../src/guestfs-actions.pod:431
22209 msgid "guestfs_aug_insert"
22213 #: ../src/guestfs-actions.pod:433
22217 " guestfs_aug_insert (guestfs_h *g,\n"
22218 " const char *augpath,\n"
22219 " const char *label,\n"
22225 #: ../src/guestfs-actions.pod:451
22226 msgid "guestfs_aug_load"
22230 #: ../src/guestfs-actions.pod:453
22234 " guestfs_aug_load (guestfs_h *g);\n"
22239 #: ../src/guestfs-actions.pod:465
22240 msgid "guestfs_aug_ls"
22244 #: ../src/guestfs-actions.pod:467
22248 " guestfs_aug_ls (guestfs_h *g,\n"
22249 " const char *augpath);\n"
22254 #: ../src/guestfs-actions.pod:471
22256 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
22257 "sorting the resulting nodes into alphabetical order."
22261 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490 ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1546 ../src/guestfs-actions.pod:1565 ../src/guestfs-actions.pod:1668 ../src/guestfs-actions.pod:1687 ../src/guestfs-actions.pod:1933 ../src/guestfs-actions.pod:2397 ../src/guestfs-actions.pod:2413 ../src/guestfs-actions.pod:2432 ../src/guestfs-actions.pod:2497 ../src/guestfs-actions.pod:2521 ../src/guestfs-actions.pod:2592 ../src/guestfs-actions.pod:2641 ../src/guestfs-actions.pod:2902 ../src/guestfs-actions.pod:3276 ../src/guestfs-actions.pod:3552 ../src/guestfs-actions.pod:3866 ../src/guestfs-actions.pod:3883 ../src/guestfs-actions.pod:3903 ../src/guestfs-actions.pod:3965 ../src/guestfs-actions.pod:4070 ../src/guestfs-actions.pod:4478 ../src/guestfs-actions.pod:5245 ../src/guestfs-actions.pod:5863 ../src/guestfs-actions.pod:5989 ../src/guestfs-actions.pod:6103 ../src/guestfs-actions.pod:6868 ../src/guestfs-actions.pod:6929 ../src/guestfs-actions.pod:6984 ../src/guestfs-actions.pod:7130 ../src/guestfs-actions.pod:7154 ../src/guestfs-actions.pod:7630 ../src/guestfs-actions.pod:7650 ../src/guestfs-actions.pod:7697 ../src/guestfs-actions.pod:7891 ../src/guestfs-actions.pod:7910 ../src/guestfs-actions.pod:8004 ../src/guestfs-actions.pod:8023 ../src/guestfs-actions.pod:8069 ../src/guestfs-actions.pod:8088
22263 "This function returns a NULL-terminated array of strings (like "
22264 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
22265 "strings and the array after use>."
22269 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1603 ../src/guestfs-actions.pod:3630 ../src/guestfs-actions.pod:3661 ../src/guestfs-actions.pod:4319 ../src/guestfs-actions.pod:4369 ../src/guestfs-actions.pod:4556 ../src/guestfs-actions.pod:4589 ../src/guestfs-actions.pod:4752 ../src/guestfs-actions.pod:5249 ../src/guestfs-actions.pod:5804 ../src/guestfs-actions.pod:6201 ../src/guestfs-actions.pod:6215 ../src/guestfs-actions.pod:6227 ../src/guestfs-actions.pod:6709 ../src/guestfs-actions.pod:7368 ../src/guestfs-actions.pod:7381 ../src/guestfs-actions.pod:7614 ../src/guestfs-actions.pod:7879
22270 msgid "(Added in 0.8)"
22274 #: ../src/guestfs-actions.pod:480
22275 msgid "guestfs_aug_match"
22279 #: ../src/guestfs-actions.pod:482
22283 " guestfs_aug_match (guestfs_h *g,\n"
22284 " const char *augpath);\n"
22289 #: ../src/guestfs-actions.pod:496
22290 msgid "guestfs_aug_mv"
22294 #: ../src/guestfs-actions.pod:498
22298 " guestfs_aug_mv (guestfs_h *g,\n"
22299 " const char *src,\n"
22300 " const char *dest);\n"
22305 #: ../src/guestfs-actions.pod:510
22306 msgid "guestfs_aug_rm"
22310 #: ../src/guestfs-actions.pod:512
22314 " guestfs_aug_rm (guestfs_h *g,\n"
22315 " const char *augpath);\n"
22320 #: ../src/guestfs-actions.pod:524
22321 msgid "guestfs_aug_save"
22325 #: ../src/guestfs-actions.pod:526
22329 " guestfs_aug_save (guestfs_h *g);\n"
22334 #: ../src/guestfs-actions.pod:531
22336 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
22341 #: ../src/guestfs-actions.pod:538
22342 msgid "guestfs_aug_set"
22346 #: ../src/guestfs-actions.pod:540
22350 " guestfs_aug_set (guestfs_h *g,\n"
22351 " const char *augpath,\n"
22352 " const char *val);\n"
22357 #: ../src/guestfs-actions.pod:547
22359 "In the Augeas API, it is possible to clear a node by setting the value to "
22360 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
22361 "this call. Instead you must use the C<guestfs_aug_clear> call."
22365 #: ../src/guestfs-actions.pod:556
22366 msgid "guestfs_available"
22370 #: ../src/guestfs-actions.pod:558
22374 " guestfs_available (guestfs_h *g,\n"
22375 " char *const *groups);\n"
22380 #: ../src/guestfs-actions.pod:566
22382 "The libguestfs groups, and the functions that those groups correspond to, "
22383 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
22384 "runtime by calling C<guestfs_available_all_groups>."
22388 #: ../src/guestfs-actions.pod:590
22389 msgid "You must call C<guestfs_launch> before calling this function."
22393 #: ../src/guestfs-actions.pod:612
22395 "This call was added in version C<1.0.80>. In previous versions of "
22396 "libguestfs all you could do would be to speculatively execute a command to "
22397 "find out if the daemon implemented it. See also C<guestfs_version>."
22401 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1348
22402 msgid "(Added in 1.0.80)"
22406 #: ../src/guestfs-actions.pod:623
22407 msgid "guestfs_available_all_groups"
22411 #: ../src/guestfs-actions.pod:625
22415 " guestfs_available_all_groups (guestfs_h *g);\n"
22420 #: ../src/guestfs-actions.pod:628
22422 "This command returns a list of all optional groups that this daemon knows "
22423 "about. Note this returns both supported and unsupported groups. To find "
22424 "out which ones the daemon can actually support you have to call "
22425 "C<guestfs_available> on each member of the returned list."
22429 #: ../src/guestfs-actions.pod:634
22430 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
22434 #: ../src/guestfs-actions.pod:640
22435 msgid "(Added in 1.3.15)"
22439 #: ../src/guestfs-actions.pod:642
22440 msgid "guestfs_base64_in"
22444 #: ../src/guestfs-actions.pod:644
22448 " guestfs_base64_in (guestfs_h *g,\n"
22449 " const char *base64file,\n"
22450 " const char *filename);\n"
22455 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
22456 msgid "(Added in 1.3.5)"
22460 #: ../src/guestfs-actions.pod:656
22461 msgid "guestfs_base64_out"
22465 #: ../src/guestfs-actions.pod:658
22469 " guestfs_base64_out (guestfs_h *g,\n"
22470 " const char *filename,\n"
22471 " const char *base64file);\n"
22476 #: ../src/guestfs-actions.pod:670
22477 msgid "guestfs_blockdev_flushbufs"
22481 #: ../src/guestfs-actions.pod:672
22485 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
22486 " const char *device);\n"
22491 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700 ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768 ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800 ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
22492 msgid "(Added in 0.9.3)"
22496 #: ../src/guestfs-actions.pod:685
22497 msgid "guestfs_blockdev_getbsz"
22501 #: ../src/guestfs-actions.pod:687
22505 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
22506 " const char *device);\n"
22511 #: ../src/guestfs-actions.pod:702
22512 msgid "guestfs_blockdev_getro"
22516 #: ../src/guestfs-actions.pod:704
22520 " guestfs_blockdev_getro (guestfs_h *g,\n"
22521 " const char *device);\n"
22526 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1586 ../src/guestfs-actions.pod:1601 ../src/guestfs-actions.pod:2090 ../src/guestfs-actions.pod:2101 ../src/guestfs-actions.pod:2173 ../src/guestfs-actions.pod:2199 ../src/guestfs-actions.pod:2239 ../src/guestfs-actions.pod:2254 ../src/guestfs-actions.pod:2288 ../src/guestfs-actions.pod:2311 ../src/guestfs-actions.pod:3373 ../src/guestfs-actions.pod:3389 ../src/guestfs-actions.pod:3407 ../src/guestfs-actions.pod:3569 ../src/guestfs-actions.pod:3583 ../src/guestfs-actions.pod:3598 ../src/guestfs-actions.pod:3612 ../src/guestfs-actions.pod:3628 ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:3659 ../src/guestfs-actions.pod:3673 ../src/guestfs-actions.pod:3686 ../src/guestfs-actions.pod:3700 ../src/guestfs-actions.pod:3715 ../src/guestfs-actions.pod:3730 ../src/guestfs-actions.pod:3743 ../src/guestfs-actions.pod:3757 ../src/guestfs-actions.pod:5486
22527 msgid "This function returns a C truth value on success or -1 on error."
22531 #: ../src/guestfs-actions.pod:717
22532 msgid "guestfs_blockdev_getsize64"
22536 #: ../src/guestfs-actions.pod:719
22540 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
22541 " const char *device);\n"
22546 #: ../src/guestfs-actions.pod:725
22547 msgid "See also C<guestfs_blockdev_getsz>."
22551 #: ../src/guestfs-actions.pod:733
22552 msgid "guestfs_blockdev_getss"
22556 #: ../src/guestfs-actions.pod:735
22560 " guestfs_blockdev_getss (guestfs_h *g,\n"
22561 " const char *device);\n"
22566 #: ../src/guestfs-actions.pod:742
22568 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
22573 #: ../src/guestfs-actions.pod:751
22574 msgid "guestfs_blockdev_getsz"
22578 #: ../src/guestfs-actions.pod:753
22582 " guestfs_blockdev_getsz (guestfs_h *g,\n"
22583 " const char *device);\n"
22588 #: ../src/guestfs-actions.pod:760
22590 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
22591 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
22595 #: ../src/guestfs-actions.pod:770
22596 msgid "guestfs_blockdev_rereadpt"
22600 #: ../src/guestfs-actions.pod:772
22604 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
22605 " const char *device);\n"
22610 #: ../src/guestfs-actions.pod:784
22611 msgid "guestfs_blockdev_setbsz"
22615 #: ../src/guestfs-actions.pod:786
22619 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
22620 " const char *device,\n"
22621 " int blocksize);\n"
22626 #: ../src/guestfs-actions.pod:802
22627 msgid "guestfs_blockdev_setro"
22631 #: ../src/guestfs-actions.pod:804
22635 " guestfs_blockdev_setro (guestfs_h *g,\n"
22636 " const char *device);\n"
22641 #: ../src/guestfs-actions.pod:816
22642 msgid "guestfs_blockdev_setrw"
22646 #: ../src/guestfs-actions.pod:818
22650 " guestfs_blockdev_setrw (guestfs_h *g,\n"
22651 " const char *device);\n"
22656 #: ../src/guestfs-actions.pod:830
22657 msgid "guestfs_btrfs_filesystem_resize"
22661 #: ../src/guestfs-actions.pod:832
22665 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
22666 " const char *mountpoint,\n"
22672 #: ../src/guestfs-actions.pod:842
22675 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
22680 #: ../src/guestfs-actions.pod:865
22681 msgid "(Added in 1.11.17)"
22685 #: ../src/guestfs-actions.pod:867
22686 msgid "guestfs_btrfs_filesystem_resize_va"
22690 #: ../src/guestfs-actions.pod:869
22694 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
22695 " const char *mountpoint,\n"
22696 " va_list args);\n"
22701 #: ../src/guestfs-actions.pod:874
22702 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
22706 #: ../src/guestfs-actions.pod:878
22707 msgid "guestfs_btrfs_filesystem_resize_argv"
22711 #: ../src/guestfs-actions.pod:880
22715 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
22716 " const char *mountpoint,\n"
22718 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
22723 #: ../src/guestfs-actions.pod:885
22724 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
22728 #: ../src/guestfs-actions.pod:889
22729 msgid "guestfs_case_sensitive_path"
22733 #: ../src/guestfs-actions.pod:891
22737 " guestfs_case_sensitive_path (guestfs_h *g,\n"
22738 " const char *path);\n"
22743 #: ../src/guestfs-actions.pod:917
22745 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
22746 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
22747 "how the directories were originally created under Windows)."
22751 #: ../src/guestfs-actions.pod:925
22752 msgid "See also C<guestfs_realpath>."
22756 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7548
22757 msgid "(Added in 1.0.75)"
22761 #: ../src/guestfs-actions.pod:932
22762 msgid "guestfs_cat"
22766 #: ../src/guestfs-actions.pod:934
22770 " guestfs_cat (guestfs_h *g,\n"
22771 " const char *path);\n"
22776 #: ../src/guestfs-actions.pod:940
22778 "Note that this function cannot correctly handle binary files (specifically, "
22779 "files containing C<\\0> character which is treated as end of string). For "
22780 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
22781 "functions which have a more complex interface."
22785 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3887 ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:3986 ../src/guestfs-actions.pod:4074 ../src/guestfs-actions.pod:4482 ../src/guestfs-actions.pod:4496 ../src/guestfs-actions.pod:5867 ../src/guestfs-actions.pod:5881 ../src/guestfs-actions.pod:7701 ../src/guestfs-actions.pod:7715
22786 msgid "(Added in 0.4)"
22790 #: ../src/guestfs-actions.pod:953
22791 msgid "guestfs_checksum"
22795 #: ../src/guestfs-actions.pod:955
22799 " guestfs_checksum (guestfs_h *g,\n"
22800 " const char *csumtype,\n"
22801 " const char *path);\n"
22806 #: ../src/guestfs-actions.pod:1001
22807 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
22811 #: ../src/guestfs-actions.pod:1003
22812 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
22816 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1423 ../src/guestfs-actions.pod:2279 ../src/guestfs-actions.pod:3585 ../src/guestfs-actions.pod:3614 ../src/guestfs-actions.pod:3675 ../src/guestfs-actions.pod:3702 ../src/guestfs-actions.pod:7404
22817 msgid "(Added in 1.0.2)"
22821 #: ../src/guestfs-actions.pod:1010
22822 msgid "guestfs_checksum_device"
22826 #: ../src/guestfs-actions.pod:1012
22830 " guestfs_checksum_device (guestfs_h *g,\n"
22831 " const char *csumtype,\n"
22832 " const char *device);\n"
22837 #: ../src/guestfs-actions.pod:1017
22839 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
22840 "device named C<device>. For the types of checksums supported see the "
22841 "C<guestfs_checksum> command."
22845 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5451 ../src/guestfs-actions.pod:5488 ../src/guestfs-actions.pod:5506 ../src/guestfs-actions.pod:5688 ../src/guestfs-actions.pod:7313 ../src/guestfs-actions.pod:7327 ../src/guestfs-actions.pod:7727
22846 msgid "(Added in 1.3.2)"
22850 #: ../src/guestfs-actions.pod:1026
22851 msgid "guestfs_checksums_out"
22855 #: ../src/guestfs-actions.pod:1028
22859 " guestfs_checksums_out (guestfs_h *g,\n"
22860 " const char *csumtype,\n"
22861 " const char *directory,\n"
22862 " const char *sumsfile);\n"
22867 #: ../src/guestfs-actions.pod:1048
22868 msgid "(Added in 1.3.7)"
22872 #: ../src/guestfs-actions.pod:1050
22873 msgid "guestfs_chmod"
22877 #: ../src/guestfs-actions.pod:1052
22881 " guestfs_chmod (guestfs_h *g,\n"
22883 " const char *path);\n"
22888 #: ../src/guestfs-actions.pod:1070
22889 msgid "guestfs_chown"
22893 #: ../src/guestfs-actions.pod:1072
22897 " guestfs_chown (guestfs_h *g,\n"
22900 " const char *path);\n"
22905 #: ../src/guestfs-actions.pod:1088
22906 msgid "guestfs_command"
22910 #: ../src/guestfs-actions.pod:1090
22914 " guestfs_command (guestfs_h *g,\n"
22915 " char *const *arguments);\n"
22920 #: ../src/guestfs-actions.pod:1099
22922 "The single parameter is an argv-style list of arguments. The first element "
22923 "is the name of the program to run. Subsequent elements are parameters. The "
22924 "list must be non-empty (ie. must contain a program name). Note that the "
22925 "command runs directly, and is I<not> invoked via the shell (see "
22930 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150 ../src/guestfs-actions.pod:1722
22931 msgid "(Added in 0.9.1)"
22935 #: ../src/guestfs-actions.pod:1132
22936 msgid "guestfs_command_lines"
22940 #: ../src/guestfs-actions.pod:1134
22944 " guestfs_command_lines (guestfs_h *g,\n"
22945 " char *const *arguments);\n"
22950 #: ../src/guestfs-actions.pod:1138
22952 "This is the same as C<guestfs_command>, but splits the result into a list of "
22957 #: ../src/guestfs-actions.pod:1141
22958 msgid "See also: C<guestfs_sh_lines>"
22962 #: ../src/guestfs-actions.pod:1152
22963 msgid "guestfs_compress_device_out"
22967 #: ../src/guestfs-actions.pod:1154
22971 " guestfs_compress_device_out (guestfs_h *g,\n"
22972 " const char *ctype,\n"
22973 " const char *device,\n"
22974 " const char *zdevice,\n"
22980 #: ../src/guestfs-actions.pod:1166
22983 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
22988 #: ../src/guestfs-actions.pod:1171
22990 "The C<ctype> and optional C<level> parameters have the same meaning as in "
22991 "C<guestfs_compress_out>."
22995 #: ../src/guestfs-actions.pod:1176
22996 msgid "guestfs_compress_device_out_va"
23000 #: ../src/guestfs-actions.pod:1178
23004 " guestfs_compress_device_out_va (guestfs_h *g,\n"
23005 " const char *ctype,\n"
23006 " const char *device,\n"
23007 " const char *zdevice,\n"
23008 " va_list args);\n"
23013 #: ../src/guestfs-actions.pod:1185
23014 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
23018 #: ../src/guestfs-actions.pod:1189
23019 msgid "guestfs_compress_device_out_argv"
23023 #: ../src/guestfs-actions.pod:1191
23027 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
23028 " const char *ctype,\n"
23029 " const char *device,\n"
23030 " const char *zdevice,\n"
23032 "guestfs_compress_device_out_argv *optargs);\n"
23037 #: ../src/guestfs-actions.pod:1198
23038 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
23042 #: ../src/guestfs-actions.pod:1202
23043 msgid "guestfs_compress_out"
23047 #: ../src/guestfs-actions.pod:1204
23051 " guestfs_compress_out (guestfs_h *g,\n"
23052 " const char *ctype,\n"
23053 " const char *file,\n"
23054 " const char *zfile,\n"
23060 #: ../src/guestfs-actions.pod:1216
23063 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
23068 #: ../src/guestfs-actions.pod:1233
23069 msgid "guestfs_compress_out_va"
23073 #: ../src/guestfs-actions.pod:1235
23077 " guestfs_compress_out_va (guestfs_h *g,\n"
23078 " const char *ctype,\n"
23079 " const char *file,\n"
23080 " const char *zfile,\n"
23081 " va_list args);\n"
23086 #: ../src/guestfs-actions.pod:1242
23087 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
23091 #: ../src/guestfs-actions.pod:1246
23092 msgid "guestfs_compress_out_argv"
23096 #: ../src/guestfs-actions.pod:1248
23100 " guestfs_compress_out_argv (guestfs_h *g,\n"
23101 " const char *ctype,\n"
23102 " const char *file,\n"
23103 " const char *zfile,\n"
23104 " const struct guestfs_compress_out_argv "
23110 #: ../src/guestfs-actions.pod:1255
23111 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
23115 #: ../src/guestfs-actions.pod:1259
23116 msgid "guestfs_config"
23120 #: ../src/guestfs-actions.pod:1261
23124 " guestfs_config (guestfs_h *g,\n"
23125 " const char *qemuparam,\n"
23126 " const char *qemuvalue);\n"
23131 #: ../src/guestfs-actions.pod:1279
23132 msgid "guestfs_copy_size"
23136 #: ../src/guestfs-actions.pod:1281
23140 " guestfs_copy_size (guestfs_h *g,\n"
23141 " const char *src,\n"
23142 " const char *dest,\n"
23143 " int64_t size);\n"
23148 #: ../src/guestfs-actions.pod:1295 ../src/guestfs-actions.pod:1418 ../src/guestfs-actions.pod:1449 ../src/guestfs-actions.pod:1494 ../src/guestfs-actions.pod:1871 ../src/guestfs-actions.pod:1893 ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:7399 ../src/guestfs-actions.pod:7433 ../src/guestfs-actions.pod:7940 ../src/guestfs-actions.pod:7963
23150 "This long-running command can generate progress notification messages so "
23151 "that the caller can display a progress bar or indicator. To receive these "
23152 "messages, the caller must register a progress event callback. See "
23153 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
23157 #: ../src/guestfs-actions.pod:1300 ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:5894 ../src/guestfs-actions.pod:7634 ../src/guestfs-actions.pod:7654 ../src/guestfs-actions.pod:7740
23158 msgid "(Added in 1.0.87)"
23162 #: ../src/guestfs-actions.pod:1302
23167 #: ../src/guestfs-actions.pod:1304
23171 " guestfs_cp (guestfs_h *g,\n"
23172 " const char *src,\n"
23173 " const char *dest);\n"
23178 #: ../src/guestfs-actions.pod:1314 ../src/guestfs-actions.pod:1328 ../src/guestfs-actions.pod:1400 ../src/guestfs-actions.pod:1474 ../src/guestfs-actions.pod:1588 ../src/guestfs-actions.pod:5263 ../src/guestfs-actions.pod:5738
23179 msgid "(Added in 1.0.18)"
23183 #: ../src/guestfs-actions.pod:1316
23184 msgid "guestfs_cp_a"
23188 #: ../src/guestfs-actions.pod:1318
23192 " guestfs_cp_a (guestfs_h *g,\n"
23193 " const char *src,\n"
23194 " const char *dest);\n"
23199 #: ../src/guestfs-actions.pod:1330
23204 #: ../src/guestfs-actions.pod:1332
23208 " guestfs_dd (guestfs_h *g,\n"
23209 " const char *src,\n"
23210 " const char *dest);\n"
23215 #: ../src/guestfs-actions.pod:1342
23217 "If the destination is a device, it must be as large or larger than the "
23218 "source file or device, otherwise the copy will fail. This command cannot do "
23219 "partial copies (see C<guestfs_copy_size>)."
23223 #: ../src/guestfs-actions.pod:1350
23228 #: ../src/guestfs-actions.pod:1352
23232 " guestfs_df (guestfs_h *g);\n"
23237 #: ../src/guestfs-actions.pod:1357 ../src/guestfs-actions.pod:1374
23239 "This command is mostly useful for interactive sessions. It is I<not> "
23240 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
23245 #: ../src/guestfs-actions.pod:1364 ../src/guestfs-actions.pod:1381 ../src/guestfs-actions.pod:1499 ../src/guestfs-actions.pod:2504 ../src/guestfs-actions.pod:2528 ../src/guestfs-actions.pod:2596 ../src/guestfs-actions.pod:4619 ../src/guestfs-actions.pod:5163 ../src/guestfs-actions.pod:7137 ../src/guestfs-actions.pod:7161 ../src/guestfs-actions.pod:7780 ../src/guestfs-actions.pod:7793 ../src/guestfs-actions.pod:7806
23246 msgid "(Added in 1.0.54)"
23250 #: ../src/guestfs-actions.pod:1366
23251 msgid "guestfs_df_h"
23255 #: ../src/guestfs-actions.pod:1368
23259 " guestfs_df_h (guestfs_h *g);\n"
23264 #: ../src/guestfs-actions.pod:1383
23265 msgid "guestfs_dmesg"
23269 #: ../src/guestfs-actions.pod:1385
23273 " guestfs_dmesg (guestfs_h *g);\n"
23278 #: ../src/guestfs-actions.pod:1392
23280 "Another way to get the same information is to enable verbose messages with "
23281 "C<guestfs_set_verbose> or by setting the environment variable "
23282 "C<LIBGUESTFS_DEBUG=1> before running the program."
23286 #: ../src/guestfs-actions.pod:1402
23287 msgid "guestfs_download"
23291 #: ../src/guestfs-actions.pod:1404
23295 " guestfs_download (guestfs_h *g,\n"
23296 " const char *remotefilename,\n"
23297 " const char *filename);\n"
23302 #: ../src/guestfs-actions.pod:1414
23303 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
23307 #: ../src/guestfs-actions.pod:1425
23308 msgid "guestfs_download_offset"
23312 #: ../src/guestfs-actions.pod:1427
23316 " guestfs_download_offset (guestfs_h *g,\n"
23317 " const char *remotefilename,\n"
23318 " const char *filename,\n"
23319 " int64_t offset,\n"
23320 " int64_t size);\n"
23325 #: ../src/guestfs-actions.pod:1440
23327 "Note that there is no limit on the amount of data that can be downloaded "
23328 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
23329 "full amount unless an error occurs."
23333 #: ../src/guestfs-actions.pod:1445
23334 msgid "See also C<guestfs_download>, C<guestfs_pread>."
23338 #: ../src/guestfs-actions.pod:1454 ../src/guestfs-actions.pod:7438
23339 msgid "(Added in 1.5.17)"
23343 #: ../src/guestfs-actions.pod:1456
23344 msgid "guestfs_drop_caches"
23348 #: ../src/guestfs-actions.pod:1458
23352 " guestfs_drop_caches (guestfs_h *g,\n"
23353 " int whattodrop);\n"
23358 #: ../src/guestfs-actions.pod:1476
23363 #: ../src/guestfs-actions.pod:1478
23367 " guestfs_du (guestfs_h *g,\n"
23368 " const char *path);\n"
23373 #: ../src/guestfs-actions.pod:1501
23374 msgid "guestfs_e2fsck_f"
23378 #: ../src/guestfs-actions.pod:1503
23382 " guestfs_e2fsck_f (guestfs_h *g,\n"
23383 " const char *device);\n"
23388 #: ../src/guestfs-actions.pod:1511
23390 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
23391 "Normally you should use C<guestfs_fsck>."
23395 #: ../src/guestfs-actions.pod:1516
23396 msgid "(Added in 1.0.29)"
23400 #: ../src/guestfs-actions.pod:1518
23401 msgid "guestfs_echo_daemon"
23405 #: ../src/guestfs-actions.pod:1520
23409 " guestfs_echo_daemon (guestfs_h *g,\n"
23410 " char *const *words);\n"
23415 #: ../src/guestfs-actions.pod:1529
23416 msgid "See also C<guestfs_ping_daemon>."
23420 #: ../src/guestfs-actions.pod:1534 ../src/guestfs-actions.pod:2290 ../src/guestfs-actions.pod:6609
23421 msgid "(Added in 1.0.69)"
23425 #: ../src/guestfs-actions.pod:1536
23426 msgid "guestfs_egrep"
23430 #: ../src/guestfs-actions.pod:1538
23434 " guestfs_egrep (guestfs_h *g,\n"
23435 " const char *regex,\n"
23436 " const char *path);\n"
23441 #: ../src/guestfs-actions.pod:1553 ../src/guestfs-actions.pod:1572 ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1675 ../src/guestfs-actions.pod:1694 ../src/guestfs-actions.pod:2420 ../src/guestfs-actions.pod:2439 ../src/guestfs-actions.pod:2617 ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:2645 ../src/guestfs-actions.pod:2691 ../src/guestfs-actions.pod:2713 ../src/guestfs-actions.pod:2726 ../src/guestfs-actions.pod:3999 ../src/guestfs-actions.pod:4013 ../src/guestfs-actions.pod:4026 ../src/guestfs-actions.pod:4040 ../src/guestfs-actions.pod:5041 ../src/guestfs-actions.pod:6072 ../src/guestfs-actions.pod:6121 ../src/guestfs-actions.pod:7005 ../src/guestfs-actions.pod:7017 ../src/guestfs-actions.pod:7030 ../src/guestfs-actions.pod:7043 ../src/guestfs-actions.pod:7065 ../src/guestfs-actions.pod:7078 ../src/guestfs-actions.pod:7091 ../src/guestfs-actions.pod:7104 ../src/guestfs-actions.pod:7898 ../src/guestfs-actions.pod:7917 ../src/guestfs-actions.pod:8011 ../src/guestfs-actions.pod:8030 ../src/guestfs-actions.pod:8076 ../src/guestfs-actions.pod:8095
23442 msgid "(Added in 1.0.66)"
23446 #: ../src/guestfs-actions.pod:1555
23447 msgid "guestfs_egrepi"
23451 #: ../src/guestfs-actions.pod:1557
23455 " guestfs_egrepi (guestfs_h *g,\n"
23456 " const char *regex,\n"
23457 " const char *path);\n"
23462 #: ../src/guestfs-actions.pod:1574
23463 msgid "guestfs_equal"
23467 #: ../src/guestfs-actions.pod:1576
23471 " guestfs_equal (guestfs_h *g,\n"
23472 " const char *file1,\n"
23473 " const char *file2);\n"
23478 #: ../src/guestfs-actions.pod:1590
23479 msgid "guestfs_exists"
23483 #: ../src/guestfs-actions.pod:1592
23487 " guestfs_exists (guestfs_h *g,\n"
23488 " const char *path);\n"
23493 #: ../src/guestfs-actions.pod:1599
23494 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
23498 #: ../src/guestfs-actions.pod:1605
23499 msgid "guestfs_fallocate"
23503 #: ../src/guestfs-actions.pod:1607
23507 " guestfs_fallocate (guestfs_h *g,\n"
23508 " const char *path,\n"
23514 #: ../src/guestfs-actions.pod:1612
23516 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
23521 #: ../src/guestfs-actions.pod:1631
23522 msgid "guestfs_fallocate64"
23526 #: ../src/guestfs-actions.pod:1633
23530 " guestfs_fallocate64 (guestfs_h *g,\n"
23531 " const char *path,\n"
23537 #: ../src/guestfs-actions.pod:1642
23539 "Note that this call allocates disk blocks for the file. To create a sparse "
23540 "file use C<guestfs_truncate_size> instead."
23544 #: ../src/guestfs-actions.pod:1645
23546 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
23547 "oversight it only allowed 30 bit lengths to be specified, effectively "
23548 "limiting the maximum size of files created through that call to 1GB."
23552 #: ../src/guestfs-actions.pod:1656
23553 msgid "(Added in 1.3.17)"
23557 #: ../src/guestfs-actions.pod:1658
23558 msgid "guestfs_fgrep"
23562 #: ../src/guestfs-actions.pod:1660
23566 " guestfs_fgrep (guestfs_h *g,\n"
23567 " const char *pattern,\n"
23568 " const char *path);\n"
23573 #: ../src/guestfs-actions.pod:1677
23574 msgid "guestfs_fgrepi"
23578 #: ../src/guestfs-actions.pod:1679
23582 " guestfs_fgrepi (guestfs_h *g,\n"
23583 " const char *pattern,\n"
23584 " const char *path);\n"
23589 #: ../src/guestfs-actions.pod:1696
23590 msgid "guestfs_file"
23594 #: ../src/guestfs-actions.pod:1698
23598 " guestfs_file (guestfs_h *g,\n"
23599 " const char *path);\n"
23604 #: ../src/guestfs-actions.pod:1716
23606 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
23607 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
23611 #: ../src/guestfs-actions.pod:1724
23612 msgid "guestfs_file_architecture"
23616 #: ../src/guestfs-actions.pod:1726
23620 " guestfs_file_architecture (guestfs_h *g,\n"
23621 " const char *filename);\n"
23626 #: ../src/guestfs-actions.pod:1834 ../src/guestfs-actions.pod:1997 ../src/guestfs-actions.pod:2014 ../src/guestfs-actions.pod:2746 ../src/guestfs-actions.pod:2840 ../src/guestfs-actions.pod:2906 ../src/guestfs-actions.pod:3093 ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3151 ../src/guestfs-actions.pod:3226 ../src/guestfs-actions.pod:3319 ../src/guestfs-actions.pod:3556 ../src/guestfs-actions.pod:3688
23627 msgid "(Added in 1.5.3)"
23631 #: ../src/guestfs-actions.pod:1836
23632 msgid "guestfs_filesize"
23636 #: ../src/guestfs-actions.pod:1838
23640 " guestfs_filesize (guestfs_h *g,\n"
23641 " const char *file);\n"
23646 #: ../src/guestfs-actions.pod:1844
23648 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
23649 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
23650 "devices, use C<guestfs_blockdev_getsize64>."
23654 #: ../src/guestfs-actions.pod:1850
23655 msgid "(Added in 1.0.82)"
23659 #: ../src/guestfs-actions.pod:1852
23660 msgid "guestfs_fill"
23664 #: ../src/guestfs-actions.pod:1854
23668 " guestfs_fill (guestfs_h *g,\n"
23671 " const char *path);\n"
23676 #: ../src/guestfs-actions.pod:1864
23678 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
23679 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
23680 "bytes use C<guestfs_fill_pattern>."
23684 #: ../src/guestfs-actions.pod:1876
23685 msgid "(Added in 1.0.79)"
23689 #: ../src/guestfs-actions.pod:1878
23690 msgid "guestfs_fill_pattern"
23694 #: ../src/guestfs-actions.pod:1880
23698 " guestfs_fill_pattern (guestfs_h *g,\n"
23699 " const char *pattern,\n"
23701 " const char *path);\n"
23706 #: ../src/guestfs-actions.pod:1886
23708 "This function is like C<guestfs_fill> except that it creates a new file of "
23709 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
23710 "pattern is truncated if necessary to ensure the length of the file is "
23711 "exactly C<len> bytes."
23715 #: ../src/guestfs-actions.pod:1898
23716 msgid "(Added in 1.3.12)"
23720 #: ../src/guestfs-actions.pod:1900
23721 msgid "guestfs_find"
23725 #: ../src/guestfs-actions.pod:1902
23729 " guestfs_find (guestfs_h *g,\n"
23730 " const char *directory);\n"
23735 #: ../src/guestfs-actions.pod:1918
23736 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
23740 #: ../src/guestfs-actions.pod:1931
23741 msgid "See also C<guestfs_find0>."
23745 #: ../src/guestfs-actions.pod:1940 ../src/guestfs-actions.pod:4446 ../src/guestfs-actions.pod:6156
23746 msgid "(Added in 1.0.27)"
23750 #: ../src/guestfs-actions.pod:1942
23751 msgid "guestfs_find0"
23755 #: ../src/guestfs-actions.pod:1944
23759 " guestfs_find0 (guestfs_h *g,\n"
23760 " const char *directory,\n"
23761 " const char *files);\n"
23766 #: ../src/guestfs-actions.pod:1953
23768 "This command works the same way as C<guestfs_find> with the following "
23773 #: ../src/guestfs-actions.pod:1980
23774 msgid "(Added in 1.0.74)"
23778 #: ../src/guestfs-actions.pod:1982
23779 msgid "guestfs_findfs_label"
23783 #: ../src/guestfs-actions.pod:1984
23787 " guestfs_findfs_label (guestfs_h *g,\n"
23788 " const char *label);\n"
23793 #: ../src/guestfs-actions.pod:1992
23794 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
23798 #: ../src/guestfs-actions.pod:1999
23799 msgid "guestfs_findfs_uuid"
23803 #: ../src/guestfs-actions.pod:2001
23807 " guestfs_findfs_uuid (guestfs_h *g,\n"
23808 " const char *uuid);\n"
23813 #: ../src/guestfs-actions.pod:2009
23814 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
23818 #: ../src/guestfs-actions.pod:2016
23819 msgid "guestfs_fsck"
23823 #: ../src/guestfs-actions.pod:2018
23827 " guestfs_fsck (guestfs_h *g,\n"
23828 " const char *fstype,\n"
23829 " const char *device);\n"
23834 #: ../src/guestfs-actions.pod:2053 ../src/guestfs-actions.pod:7945
23835 msgid "(Added in 1.0.16)"
23839 #: ../src/guestfs-actions.pod:2055
23840 msgid "guestfs_get_append"
23844 #: ../src/guestfs-actions.pod:2057
23848 " guestfs_get_append (guestfs_h *g);\n"
23853 #: ../src/guestfs-actions.pod:2065
23855 "This function returns a string which may be NULL. There is no way to return "
23856 "an error from this function. The string is owned by the guest handle and "
23857 "must I<not> be freed."
23861 #: ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:5834 ../src/guestfs-actions.pod:6316 ../src/guestfs-actions.pod:6772 ../src/guestfs-actions.pod:6791 ../src/guestfs-actions.pod:6807 ../src/guestfs-actions.pod:6831 ../src/guestfs-actions.pod:7585 ../src/guestfs-actions.pod:7600 ../src/guestfs-actions.pod:7992
23862 msgid "(Added in 1.0.26)"
23866 #: ../src/guestfs-actions.pod:2071
23867 msgid "guestfs_get_attach_method"
23871 #: ../src/guestfs-actions.pod:2073
23875 " guestfs_get_attach_method (guestfs_h *g);\n"
23880 #: ../src/guestfs-actions.pod:2076
23881 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
23885 #: ../src/guestfs-actions.pod:2081 ../src/guestfs-actions.pod:6346
23886 msgid "(Added in 1.9.8)"
23890 #: ../src/guestfs-actions.pod:2083
23891 msgid "guestfs_get_autosync"
23895 #: ../src/guestfs-actions.pod:2085
23899 " guestfs_get_autosync (guestfs_h *g);\n"
23904 #: ../src/guestfs-actions.pod:2094
23905 msgid "guestfs_get_direct"
23909 #: ../src/guestfs-actions.pod:2096
23913 " guestfs_get_direct (guestfs_h *g);\n"
23918 #: ../src/guestfs-actions.pod:2103 ../src/guestfs-actions.pod:6387
23919 msgid "(Added in 1.0.72)"
23923 #: ../src/guestfs-actions.pod:2105
23924 msgid "guestfs_get_e2label"
23928 #: ../src/guestfs-actions.pod:2107
23932 " guestfs_get_e2label (guestfs_h *g,\n"
23933 " const char *device);\n"
23938 #: ../src/guestfs-actions.pod:2111
23940 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
23945 #: ../src/guestfs-actions.pod:2124 ../src/guestfs-actions.pod:2145 ../src/guestfs-actions.pod:6405 ../src/guestfs-actions.pod:6424
23946 msgid "(Added in 1.0.15)"
23950 #: ../src/guestfs-actions.pod:2126
23951 msgid "guestfs_get_e2uuid"
23955 #: ../src/guestfs-actions.pod:2128
23959 " guestfs_get_e2uuid (guestfs_h *g,\n"
23960 " const char *device);\n"
23965 #: ../src/guestfs-actions.pod:2132
23967 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
23972 #: ../src/guestfs-actions.pod:2147
23973 msgid "guestfs_get_memsize"
23977 #: ../src/guestfs-actions.pod:2149
23981 " guestfs_get_memsize (guestfs_h *g);\n"
23986 #: ../src/guestfs-actions.pod:2155
23988 "If C<guestfs_set_memsize> was not called on this handle, and if "
23989 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
23990 "value for memsize."
23994 #: ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4946 ../src/guestfs-actions.pod:4965 ../src/guestfs-actions.pod:4984 ../src/guestfs-actions.pod:4996 ../src/guestfs-actions.pod:5013 ../src/guestfs-actions.pod:5026 ../src/guestfs-actions.pod:6059 ../src/guestfs-actions.pod:6445 ../src/guestfs-actions.pod:6739 ../src/guestfs-actions.pod:7354
23995 msgid "(Added in 1.0.55)"
23999 #: ../src/guestfs-actions.pod:2166
24000 msgid "guestfs_get_network"
24004 #: ../src/guestfs-actions.pod:2168
24008 " guestfs_get_network (guestfs_h *g);\n"
24013 #: ../src/guestfs-actions.pod:2175 ../src/guestfs-actions.pod:6464
24014 msgid "(Added in 1.5.4)"
24018 #: ../src/guestfs-actions.pod:2177
24019 msgid "guestfs_get_path"
24023 #: ../src/guestfs-actions.pod:2179
24027 " guestfs_get_path (guestfs_h *g);\n"
24032 #: ../src/guestfs-actions.pod:2187 ../src/guestfs-actions.pod:2227
24034 "This function returns a string, or NULL on error. The string is owned by "
24035 "the guest handle and must I<not> be freed."
24039 #: ../src/guestfs-actions.pod:2192
24040 msgid "guestfs_get_pgroup"
24044 #: ../src/guestfs-actions.pod:2194
24048 " guestfs_get_pgroup (guestfs_h *g);\n"
24053 #: ../src/guestfs-actions.pod:2201 ../src/guestfs-actions.pod:6500 ../src/guestfs-actions.pod:7846
24054 msgid "(Added in 1.11.18)"
24058 #: ../src/guestfs-actions.pod:2203
24059 msgid "guestfs_get_pid"
24063 #: ../src/guestfs-actions.pod:2205
24067 " guestfs_get_pid (guestfs_h *g);\n"
24072 #: ../src/guestfs-actions.pod:2215
24073 msgid "(Added in 1.0.56)"
24077 #: ../src/guestfs-actions.pod:2217
24078 msgid "guestfs_get_qemu"
24082 #: ../src/guestfs-actions.pod:2219
24086 " guestfs_get_qemu (guestfs_h *g);\n"
24091 #: ../src/guestfs-actions.pod:2230 ../src/guestfs-actions.pod:6528
24092 msgid "(Added in 1.0.6)"
24096 #: ../src/guestfs-actions.pod:2232
24097 msgid "guestfs_get_recovery_proc"
24101 #: ../src/guestfs-actions.pod:2234
24105 " guestfs_get_recovery_proc (guestfs_h *g);\n"
24110 #: ../src/guestfs-actions.pod:2241 ../src/guestfs-actions.pod:3810 ../src/guestfs-actions.pod:4141 ../src/guestfs-actions.pod:4544 ../src/guestfs-actions.pod:4576 ../src/guestfs-actions.pod:5764 ../src/guestfs-actions.pod:6107 ../src/guestfs-actions.pod:6552 ../src/guestfs-actions.pod:7257 ../src/guestfs-actions.pod:7277 ../src/guestfs-actions.pod:7469
24111 msgid "(Added in 1.0.77)"
24115 #: ../src/guestfs-actions.pod:2243
24116 msgid "guestfs_get_selinux"
24120 #: ../src/guestfs-actions.pod:2245
24124 " guestfs_get_selinux (guestfs_h *g);\n"
24129 #: ../src/guestfs-actions.pod:2248
24131 "This returns the current setting of the selinux flag which is passed to the "
24132 "appliance at boot time. See C<guestfs_set_selinux>."
24136 #: ../src/guestfs-actions.pod:2256 ../src/guestfs-actions.pod:2328 ../src/guestfs-actions.pod:6571 ../src/guestfs-actions.pod:6643
24137 msgid "(Added in 1.0.67)"
24141 #: ../src/guestfs-actions.pod:2258
24142 msgid "guestfs_get_smp"
24146 #: ../src/guestfs-actions.pod:2260
24150 " guestfs_get_smp (guestfs_h *g);\n"
24155 #: ../src/guestfs-actions.pod:2267
24156 msgid "guestfs_get_state"
24160 #: ../src/guestfs-actions.pod:2269
24164 " guestfs_get_state (guestfs_h *g);\n"
24169 #: ../src/guestfs-actions.pod:2281
24170 msgid "guestfs_get_trace"
24174 #: ../src/guestfs-actions.pod:2283
24178 " guestfs_get_trace (guestfs_h *g);\n"
24183 #: ../src/guestfs-actions.pod:2292
24184 msgid "guestfs_get_umask"
24188 #: ../src/guestfs-actions.pod:2294
24192 " guestfs_get_umask (guestfs_h *g);\n"
24197 #: ../src/guestfs-actions.pod:2297
24199 "Return the current umask. By default the umask is C<022> unless it has been "
24200 "set by calling C<guestfs_umask>."
24204 #: ../src/guestfs-actions.pod:2304
24205 msgid "guestfs_get_verbose"
24209 #: ../src/guestfs-actions.pod:2306
24213 " guestfs_get_verbose (guestfs_h *g);\n"
24218 #: ../src/guestfs-actions.pod:2315
24219 msgid "guestfs_getcon"
24223 #: ../src/guestfs-actions.pod:2317
24227 " guestfs_getcon (guestfs_h *g);\n"
24232 #: ../src/guestfs-actions.pod:2322
24233 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
24237 #: ../src/guestfs-actions.pod:2330
24238 msgid "guestfs_getxattr"
24242 #: ../src/guestfs-actions.pod:2332
24246 " guestfs_getxattr (guestfs_h *g,\n"
24247 " const char *path,\n"
24248 " const char *name,\n"
24249 " size_t *size_r);\n"
24254 #: ../src/guestfs-actions.pod:2338
24256 "Get a single extended attribute from file C<path> named C<name>. This call "
24257 "follows symlinks. If you want to lookup an extended attribute for the "
24258 "symlink itself, use C<guestfs_lgetxattr>."
24262 #: ../src/guestfs-actions.pod:2342 ../src/guestfs-actions.pod:3824
24264 "Normally it is better to get all extended attributes from a file in one go "
24265 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
24266 "implementations are buggy and do not provide a way to list out attributes. "
24267 "For these filesystems (notably ntfs-3g) you have to know the names of the "
24268 "extended attributes you want in advance and call this function."
24272 #: ../src/guestfs-actions.pod:2352
24273 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
24277 #: ../src/guestfs-actions.pod:2354 ../src/guestfs-actions.pod:2567 ../src/guestfs-actions.pod:3041 ../src/guestfs-actions.pod:3836 ../src/guestfs-actions.pod:5757 ../src/guestfs-actions.pod:5783 ../src/guestfs-actions.pod:5964
24279 "This function returns a buffer, or NULL on error. The size of the returned "
24280 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
24285 #: ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:3840
24286 msgid "(Added in 1.7.24)"
24290 #: ../src/guestfs-actions.pod:2360
24291 msgid "guestfs_getxattrs"
24295 #: ../src/guestfs-actions.pod:2362
24298 " struct guestfs_xattr_list *\n"
24299 " guestfs_getxattrs (guestfs_h *g,\n"
24300 " const char *path);\n"
24305 #: ../src/guestfs-actions.pod:2372
24306 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
24310 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:3852 ../src/guestfs-actions.pod:4540
24312 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
24313 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
24317 #: ../src/guestfs-actions.pod:2378 ../src/guestfs-actions.pod:3856 ../src/guestfs-actions.pod:4055 ../src/guestfs-actions.pod:4091 ../src/guestfs-actions.pod:6137 ../src/guestfs-actions.pod:6662 ../src/guestfs-actions.pod:8057
24318 msgid "(Added in 1.0.59)"
24322 #: ../src/guestfs-actions.pod:2380
24323 msgid "guestfs_glob_expand"
24327 #: ../src/guestfs-actions.pod:2382
24331 " guestfs_glob_expand (guestfs_h *g,\n"
24332 " const char *pattern);\n"
24337 #: ../src/guestfs-actions.pod:2401 ../src/guestfs-actions.pod:6855 ../src/guestfs-actions.pod:6872
24338 msgid "(Added in 1.0.50)"
24342 #: ../src/guestfs-actions.pod:2403
24343 msgid "guestfs_grep"
24347 #: ../src/guestfs-actions.pod:2405
24351 " guestfs_grep (guestfs_h *g,\n"
24352 " const char *regex,\n"
24353 " const char *path);\n"
24358 #: ../src/guestfs-actions.pod:2422
24359 msgid "guestfs_grepi"
24363 #: ../src/guestfs-actions.pod:2424
24367 " guestfs_grepi (guestfs_h *g,\n"
24368 " const char *regex,\n"
24369 " const char *path);\n"
24374 #: ../src/guestfs-actions.pod:2441
24375 msgid "guestfs_grub_install"
24379 #: ../src/guestfs-actions.pod:2443
24383 " guestfs_grub_install (guestfs_h *g,\n"
24384 " const char *root,\n"
24385 " const char *device);\n"
24390 #: ../src/guestfs-actions.pod:2486
24391 msgid "(Added in 1.0.17)"
24395 #: ../src/guestfs-actions.pod:2488
24396 msgid "guestfs_head"
24400 #: ../src/guestfs-actions.pod:2490
24404 " guestfs_head (guestfs_h *g,\n"
24405 " const char *path);\n"
24410 #: ../src/guestfs-actions.pod:2506
24411 msgid "guestfs_head_n"
24415 #: ../src/guestfs-actions.pod:2508
24419 " guestfs_head_n (guestfs_h *g,\n"
24421 " const char *path);\n"
24426 #: ../src/guestfs-actions.pod:2530
24427 msgid "guestfs_hexdump"
24431 #: ../src/guestfs-actions.pod:2532
24435 " guestfs_hexdump (guestfs_h *g,\n"
24436 " const char *path);\n"
24441 #: ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:6936 ../src/guestfs-actions.pod:6991
24442 msgid "(Added in 1.0.22)"
24446 #: ../src/guestfs-actions.pod:2547
24447 msgid "guestfs_initrd_cat"
24451 #: ../src/guestfs-actions.pod:2549
24455 " guestfs_initrd_cat (guestfs_h *g,\n"
24456 " const char *initrdpath,\n"
24457 " const char *filename,\n"
24458 " size_t *size_r);\n"
24463 #: ../src/guestfs-actions.pod:2565
24464 msgid "See also C<guestfs_initrd_list>."
24468 #: ../src/guestfs-actions.pod:2576
24469 msgid "guestfs_initrd_list"
24473 #: ../src/guestfs-actions.pod:2578
24477 " guestfs_initrd_list (guestfs_h *g,\n"
24478 " const char *path);\n"
24483 #: ../src/guestfs-actions.pod:2598
24484 msgid "guestfs_inotify_add_watch"
24488 #: ../src/guestfs-actions.pod:2600
24492 " guestfs_inotify_add_watch (guestfs_h *g,\n"
24493 " const char *path,\n"
24499 #: ../src/guestfs-actions.pod:2619
24500 msgid "guestfs_inotify_close"
24504 #: ../src/guestfs-actions.pod:2621
24508 " guestfs_inotify_close (guestfs_h *g);\n"
24513 #: ../src/guestfs-actions.pod:2632
24514 msgid "guestfs_inotify_files"
24518 #: ../src/guestfs-actions.pod:2634
24522 " guestfs_inotify_files (guestfs_h *g);\n"
24527 #: ../src/guestfs-actions.pod:2637
24529 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
24530 "returns a list of pathnames of objects that were touched. The returned "
24531 "pathnames are sorted and deduplicated."
24535 #: ../src/guestfs-actions.pod:2647
24536 msgid "guestfs_inotify_init"
24540 #: ../src/guestfs-actions.pod:2649
24544 " guestfs_inotify_init (guestfs_h *g,\n"
24545 " int maxevents);\n"
24550 #: ../src/guestfs-actions.pod:2657
24552 "C<maxevents> is the maximum number of events which will be queued up between "
24553 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
24554 "passed as C<0>, then the kernel (or previously set) default is used. For "
24555 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
24556 "throws away events, but records the fact that it threw them away by setting "
24557 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
24558 "C<guestfs_inotify_read>)."
24562 #: ../src/guestfs-actions.pod:2667
24564 "Before any events are generated, you have to add some watches to the "
24565 "internal watch list. See: C<guestfs_inotify_add_watch>, "
24566 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
24570 #: ../src/guestfs-actions.pod:2673
24572 "Queued up events should be read periodically by calling "
24573 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
24574 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
24575 "often enough then you risk the internal queue overflowing."
24579 #: ../src/guestfs-actions.pod:2680
24581 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
24582 "This also removes any watches automatically."
24586 #: ../src/guestfs-actions.pod:2693
24587 msgid "guestfs_inotify_read"
24591 #: ../src/guestfs-actions.pod:2695
24594 " struct guestfs_inotify_event_list *\n"
24595 " guestfs_inotify_read (guestfs_h *g);\n"
24600 #: ../src/guestfs-actions.pod:2709
24602 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
24603 "there was an error. I<The caller must call "
24604 "C<guestfs_free_inotify_event_list> after use>."
24608 #: ../src/guestfs-actions.pod:2715
24609 msgid "guestfs_inotify_rm_watch"
24613 #: ../src/guestfs-actions.pod:2717
24617 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
24623 #: ../src/guestfs-actions.pod:2721
24625 "Remove a previously defined inotify watch. See "
24626 "C<guestfs_inotify_add_watch>."
24630 #: ../src/guestfs-actions.pod:2728
24631 msgid "guestfs_inspect_get_arch"
24635 #: ../src/guestfs-actions.pod:2730
24639 " guestfs_inspect_get_arch (guestfs_h *g,\n"
24640 " const char *root);\n"
24645 #: ../src/guestfs-actions.pod:2734
24647 "This returns the architecture of the inspected operating system. The "
24648 "possible return values are listed under C<guestfs_file_architecture>."
24652 #: ../src/guestfs-actions.pod:2748
24653 msgid "guestfs_inspect_get_distro"
24657 #: ../src/guestfs-actions.pod:2750
24661 " guestfs_inspect_get_distro (guestfs_h *g,\n"
24662 " const char *root);\n"
24667 #: ../src/guestfs-actions.pod:2842
24668 msgid "guestfs_inspect_get_drive_mappings"
24672 #: ../src/guestfs-actions.pod:2844
24676 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
24677 " const char *root);\n"
24682 #: ../src/guestfs-actions.pod:2873
24684 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24685 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
24689 #: ../src/guestfs-actions.pod:2877 ../src/guestfs-actions.pod:3145 ../src/guestfs-actions.pod:3943 ../src/guestfs-actions.pod:5225 ../src/guestfs-actions.pod:7293
24691 "This function returns a NULL-terminated array of strings, or NULL if there "
24692 "was an error. The array of strings will always have length C<2n+1>, where "
24693 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
24694 "caller must free the strings and the array after use>."
24698 #: ../src/guestfs-actions.pod:2883 ../src/guestfs-actions.pod:3339
24699 msgid "(Added in 1.9.17)"
24703 #: ../src/guestfs-actions.pod:2885
24704 msgid "guestfs_inspect_get_filesystems"
24708 #: ../src/guestfs-actions.pod:2887
24712 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
24713 " const char *root);\n"
24718 #: ../src/guestfs-actions.pod:2899
24720 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24721 "C<guestfs_inspect_get_mountpoints>."
24725 #: ../src/guestfs-actions.pod:2908
24726 msgid "guestfs_inspect_get_format"
24730 #: ../src/guestfs-actions.pod:2910
24734 " guestfs_inspect_get_format (guestfs_h *g,\n"
24735 " const char *root);\n"
24740 #: ../src/guestfs-actions.pod:2944 ../src/guestfs-actions.pod:3375 ../src/guestfs-actions.pod:3391 ../src/guestfs-actions.pod:3409 ../src/guestfs-actions.pod:6175
24741 msgid "(Added in 1.9.4)"
24745 #: ../src/guestfs-actions.pod:2946
24746 msgid "guestfs_inspect_get_hostname"
24750 #: ../src/guestfs-actions.pod:2948
24754 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
24755 " const char *root);\n"
24760 #: ../src/guestfs-actions.pod:2963
24761 msgid "(Added in 1.7.9)"
24765 #: ../src/guestfs-actions.pod:2965
24766 msgid "guestfs_inspect_get_icon"
24770 #: ../src/guestfs-actions.pod:2967
24774 " guestfs_inspect_get_icon (guestfs_h *g,\n"
24775 " const char *root,\n"
24776 " size_t *size_r,\n"
24782 #: ../src/guestfs-actions.pod:2978
24785 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
24786 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
24791 #: ../src/guestfs-actions.pod:3045 ../src/guestfs-actions.pod:3870 ../src/guestfs-actions.pod:5124
24792 msgid "(Added in 1.11.12)"
24796 #: ../src/guestfs-actions.pod:3047
24797 msgid "guestfs_inspect_get_icon_va"
24801 #: ../src/guestfs-actions.pod:3049
24805 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
24806 " const char *root,\n"
24807 " size_t *size_r,\n"
24808 " va_list args);\n"
24813 #: ../src/guestfs-actions.pod:3055
24814 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
24818 #: ../src/guestfs-actions.pod:3059
24819 msgid "guestfs_inspect_get_icon_argv"
24823 #: ../src/guestfs-actions.pod:3061
24827 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
24828 " const char *root,\n"
24829 " size_t *size_r,\n"
24830 " const struct guestfs_inspect_get_icon_argv "
24836 #: ../src/guestfs-actions.pod:3067
24837 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
24841 #: ../src/guestfs-actions.pod:3071
24842 msgid "guestfs_inspect_get_major_version"
24846 #: ../src/guestfs-actions.pod:3073
24850 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
24851 " const char *root);\n"
24856 #: ../src/guestfs-actions.pod:3095
24857 msgid "guestfs_inspect_get_minor_version"
24861 #: ../src/guestfs-actions.pod:3097
24865 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
24866 " const char *root);\n"
24871 #: ../src/guestfs-actions.pod:3106
24873 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24874 "C<guestfs_inspect_get_major_version>."
24878 #: ../src/guestfs-actions.pod:3113
24879 msgid "guestfs_inspect_get_mountpoints"
24883 #: ../src/guestfs-actions.pod:3115
24887 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
24888 " const char *root);\n"
24893 #: ../src/guestfs-actions.pod:3136
24895 "For operating systems like Windows which still use drive letters, this call "
24896 "will only return an entry for the first drive \"mounted on\" C</>. For "
24897 "information about the mapping of drive letters to partitions, see "
24898 "C<guestfs_inspect_get_drive_mappings>."
24902 #: ../src/guestfs-actions.pod:3142
24904 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24905 "C<guestfs_inspect_get_filesystems>."
24909 #: ../src/guestfs-actions.pod:3153
24910 msgid "guestfs_inspect_get_package_format"
24914 #: ../src/guestfs-actions.pod:3155
24918 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
24919 " const char *root);\n"
24924 #: ../src/guestfs-actions.pod:3159
24926 "This function and C<guestfs_inspect_get_package_management> return the "
24927 "package format and package management tool used by the inspected operating "
24928 "system. For example for Fedora these functions would return C<rpm> (package "
24929 "format) and C<yum> (package management)."
24933 #: ../src/guestfs-actions.pod:3177 ../src/guestfs-actions.pod:3205
24934 msgid "(Added in 1.7.5)"
24938 #: ../src/guestfs-actions.pod:3179
24939 msgid "guestfs_inspect_get_package_management"
24943 #: ../src/guestfs-actions.pod:3181
24947 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
24948 " const char *root);\n"
24953 #: ../src/guestfs-actions.pod:3185
24955 "C<guestfs_inspect_get_package_format> and this function return the package "
24956 "format and package management tool used by the inspected operating system. "
24957 "For example for Fedora these functions would return C<rpm> (package format) "
24958 "and C<yum> (package management)."
24962 #: ../src/guestfs-actions.pod:3207
24963 msgid "guestfs_inspect_get_product_name"
24967 #: ../src/guestfs-actions.pod:3209
24971 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
24972 " const char *root);\n"
24977 #: ../src/guestfs-actions.pod:3228
24978 msgid "guestfs_inspect_get_product_variant"
24982 #: ../src/guestfs-actions.pod:3230
24986 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
24987 " const char *root);\n"
24992 #: ../src/guestfs-actions.pod:3253
24994 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24995 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
24999 #: ../src/guestfs-actions.pod:3260
25000 msgid "(Added in 1.9.13)"
25004 #: ../src/guestfs-actions.pod:3262
25005 msgid "guestfs_inspect_get_roots"
25009 #: ../src/guestfs-actions.pod:3264
25013 " guestfs_inspect_get_roots (guestfs_h *g);\n"
25018 #: ../src/guestfs-actions.pod:3267
25020 "This function is a convenient way to get the list of root devices, as "
25021 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
25022 "the whole inspection process."
25026 #: ../src/guestfs-actions.pod:3271
25028 "This returns an empty list if either no root devices were found or the "
25029 "caller has not called C<guestfs_inspect_os>."
25033 #: ../src/guestfs-actions.pod:3280
25034 msgid "(Added in 1.7.3)"
25038 #: ../src/guestfs-actions.pod:3282
25039 msgid "guestfs_inspect_get_type"
25043 #: ../src/guestfs-actions.pod:3284
25047 " guestfs_inspect_get_type (guestfs_h *g,\n"
25048 " const char *root);\n"
25053 #: ../src/guestfs-actions.pod:3321
25054 msgid "guestfs_inspect_get_windows_current_control_set"
25058 #: ../src/guestfs-actions.pod:3323
25062 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
25063 " const char *root);\n"
25068 #: ../src/guestfs-actions.pod:3341
25069 msgid "guestfs_inspect_get_windows_systemroot"
25073 #: ../src/guestfs-actions.pod:3343
25077 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
25078 " const char *root);\n"
25083 #: ../src/guestfs-actions.pod:3359
25084 msgid "(Added in 1.5.25)"
25088 #: ../src/guestfs-actions.pod:3361
25089 msgid "guestfs_inspect_is_live"
25093 #: ../src/guestfs-actions.pod:3363
25097 " guestfs_inspect_is_live (guestfs_h *g,\n"
25098 " const char *root);\n"
25103 #: ../src/guestfs-actions.pod:3367
25105 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25106 "disk), then this returns true if a live image was detected on the disk."
25110 #: ../src/guestfs-actions.pod:3377
25111 msgid "guestfs_inspect_is_multipart"
25115 #: ../src/guestfs-actions.pod:3379
25119 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
25120 " const char *root);\n"
25125 #: ../src/guestfs-actions.pod:3383
25127 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25128 "disk), then this returns true if the disk is part of a set."
25132 #: ../src/guestfs-actions.pod:3393
25133 msgid "guestfs_inspect_is_netinst"
25137 #: ../src/guestfs-actions.pod:3395
25141 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
25142 " const char *root);\n"
25147 #: ../src/guestfs-actions.pod:3399
25149 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25150 "disk), then this returns true if the disk is a network installer, ie. not a "
25151 "self-contained install CD but one which is likely to require network access "
25152 "to complete the install."
25156 #: ../src/guestfs-actions.pod:3411
25157 msgid "guestfs_inspect_list_applications"
25161 #: ../src/guestfs-actions.pod:3413
25164 " struct guestfs_application_list *\n"
25165 " guestfs_inspect_list_applications (guestfs_h *g,\n"
25166 " const char *root);\n"
25171 #: ../src/guestfs-actions.pod:3419
25173 "I<Note:> This call works differently from other parts of the inspection "
25174 "API. You have to call C<guestfs_inspect_os>, then "
25175 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
25176 "this. Listing applications is a significantly more difficult operation "
25177 "which requires access to the full filesystem. Also note that unlike the "
25178 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
25179 "the libguestfs handle, this call actually reads parts of the mounted "
25180 "filesystems during the call."
25184 #: ../src/guestfs-actions.pod:3509
25186 "This function returns a C<struct guestfs_application_list *>, or NULL if "
25187 "there was an error. I<The caller must call C<guestfs_free_application_list> "
25192 #: ../src/guestfs-actions.pod:3513
25193 msgid "(Added in 1.7.8)"
25197 #: ../src/guestfs-actions.pod:3515
25198 msgid "guestfs_inspect_os"
25202 #: ../src/guestfs-actions.pod:3517
25206 " guestfs_inspect_os (guestfs_h *g);\n"
25211 #: ../src/guestfs-actions.pod:3533
25213 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
25214 "functions in order to query further information about each operating system, "
25215 "such as the name and version."
25219 #: ../src/guestfs-actions.pod:3538
25221 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
25222 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
25223 "the contents. This should be called with no disks currently mounted. The "
25224 "function may also use Augeas, so any existing Augeas handle will be closed."
25228 #: ../src/guestfs-actions.pod:3550 ../src/guestfs-actions.pod:3881 ../src/guestfs-actions.pod:3963
25229 msgid "See also C<guestfs_list_filesystems>."
25233 #: ../src/guestfs-actions.pod:3558
25234 msgid "guestfs_is_blockdev"
25238 #: ../src/guestfs-actions.pod:3560
25242 " guestfs_is_blockdev (guestfs_h *g,\n"
25243 " const char *path);\n"
25248 #: ../src/guestfs-actions.pod:3567 ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3626 ../src/guestfs-actions.pod:3641 ../src/guestfs-actions.pod:3657 ../src/guestfs-actions.pod:3713 ../src/guestfs-actions.pod:3728
25249 msgid "See also C<guestfs_stat>."
25253 #: ../src/guestfs-actions.pod:3571 ../src/guestfs-actions.pod:3600 ../src/guestfs-actions.pod:3645 ../src/guestfs-actions.pod:3717 ../src/guestfs-actions.pod:3732
25254 msgid "(Added in 1.5.10)"
25258 #: ../src/guestfs-actions.pod:3573
25259 msgid "guestfs_is_busy"
25263 #: ../src/guestfs-actions.pod:3575
25267 " guestfs_is_busy (guestfs_h *g);\n"
25272 #: ../src/guestfs-actions.pod:3587
25273 msgid "guestfs_is_chardev"
25277 #: ../src/guestfs-actions.pod:3589
25281 " guestfs_is_chardev (guestfs_h *g,\n"
25282 " const char *path);\n"
25287 #: ../src/guestfs-actions.pod:3602
25288 msgid "guestfs_is_config"
25292 #: ../src/guestfs-actions.pod:3604
25296 " guestfs_is_config (guestfs_h *g);\n"
25301 #: ../src/guestfs-actions.pod:3616
25302 msgid "guestfs_is_dir"
25306 #: ../src/guestfs-actions.pod:3618
25310 " guestfs_is_dir (guestfs_h *g,\n"
25311 " const char *path);\n"
25316 #: ../src/guestfs-actions.pod:3632
25317 msgid "guestfs_is_fifo"
25321 #: ../src/guestfs-actions.pod:3634
25325 " guestfs_is_fifo (guestfs_h *g,\n"
25326 " const char *path);\n"
25331 #: ../src/guestfs-actions.pod:3647
25332 msgid "guestfs_is_file"
25336 #: ../src/guestfs-actions.pod:3649
25340 " guestfs_is_file (guestfs_h *g,\n"
25341 " const char *path);\n"
25346 #: ../src/guestfs-actions.pod:3663
25347 msgid "guestfs_is_launching"
25351 #: ../src/guestfs-actions.pod:3665
25355 " guestfs_is_launching (guestfs_h *g);\n"
25360 #: ../src/guestfs-actions.pod:3677
25361 msgid "guestfs_is_lv"
25365 #: ../src/guestfs-actions.pod:3679
25369 " guestfs_is_lv (guestfs_h *g,\n"
25370 " const char *device);\n"
25375 #: ../src/guestfs-actions.pod:3690
25376 msgid "guestfs_is_ready"
25380 #: ../src/guestfs-actions.pod:3692
25384 " guestfs_is_ready (guestfs_h *g);\n"
25389 #: ../src/guestfs-actions.pod:3704
25390 msgid "guestfs_is_socket"
25394 #: ../src/guestfs-actions.pod:3706
25398 " guestfs_is_socket (guestfs_h *g,\n"
25399 " const char *path);\n"
25404 #: ../src/guestfs-actions.pod:3719
25405 msgid "guestfs_is_symlink"
25409 #: ../src/guestfs-actions.pod:3721
25413 " guestfs_is_symlink (guestfs_h *g,\n"
25414 " const char *path);\n"
25419 #: ../src/guestfs-actions.pod:3734
25420 msgid "guestfs_is_zero"
25424 #: ../src/guestfs-actions.pod:3736
25428 " guestfs_is_zero (guestfs_h *g,\n"
25429 " const char *path);\n"
25434 #: ../src/guestfs-actions.pod:3745 ../src/guestfs-actions.pod:3759
25435 msgid "(Added in 1.11.8)"
25439 #: ../src/guestfs-actions.pod:3747
25440 msgid "guestfs_is_zero_device"
25444 #: ../src/guestfs-actions.pod:3749
25448 " guestfs_is_zero_device (guestfs_h *g,\n"
25449 " const char *device);\n"
25454 #: ../src/guestfs-actions.pod:3761
25455 msgid "guestfs_kill_subprocess"
25459 #: ../src/guestfs-actions.pod:3763
25463 " guestfs_kill_subprocess (guestfs_h *g);\n"
25468 #: ../src/guestfs-actions.pod:3772
25469 msgid "guestfs_launch"
25473 #: ../src/guestfs-actions.pod:3774
25477 " guestfs_launch (guestfs_h *g);\n"
25482 #: ../src/guestfs-actions.pod:3792
25483 msgid "guestfs_lchown"
25487 #: ../src/guestfs-actions.pod:3794
25491 " guestfs_lchown (guestfs_h *g,\n"
25494 " const char *path);\n"
25499 #: ../src/guestfs-actions.pod:3800
25501 "Change the file owner to C<owner> and group to C<group>. This is like "
25502 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
25503 "changed, not the target."
25507 #: ../src/guestfs-actions.pod:3812
25508 msgid "guestfs_lgetxattr"
25512 #: ../src/guestfs-actions.pod:3814
25516 " guestfs_lgetxattr (guestfs_h *g,\n"
25517 " const char *path,\n"
25518 " const char *name,\n"
25519 " size_t *size_r);\n"
25524 #: ../src/guestfs-actions.pod:3834
25525 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
25529 #: ../src/guestfs-actions.pod:3842
25530 msgid "guestfs_lgetxattrs"
25534 #: ../src/guestfs-actions.pod:3844
25537 " struct guestfs_xattr_list *\n"
25538 " guestfs_lgetxattrs (guestfs_h *g,\n"
25539 " const char *path);\n"
25544 #: ../src/guestfs-actions.pod:3848
25546 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
25547 "then it returns the extended attributes of the link itself."
25551 #: ../src/guestfs-actions.pod:3858
25552 msgid "guestfs_list_9p"
25556 #: ../src/guestfs-actions.pod:3860
25560 " guestfs_list_9p (guestfs_h *g);\n"
25565 #: ../src/guestfs-actions.pod:3872
25566 msgid "guestfs_list_devices"
25570 #: ../src/guestfs-actions.pod:3874
25574 " guestfs_list_devices (guestfs_h *g);\n"
25579 #: ../src/guestfs-actions.pod:3889
25580 msgid "guestfs_list_dm_devices"
25584 #: ../src/guestfs-actions.pod:3891
25588 " guestfs_list_dm_devices (guestfs_h *g);\n"
25593 #: ../src/guestfs-actions.pod:3896
25595 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
25596 "previous call to C<guestfs_luks_open>."
25600 #: ../src/guestfs-actions.pod:3899
25602 "Device mapper devices which correspond to logical volumes are I<not> "
25603 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
25608 #: ../src/guestfs-actions.pod:3907 ../src/guestfs-actions.pod:5363
25609 msgid "(Added in 1.11.15)"
25613 #: ../src/guestfs-actions.pod:3909
25614 msgid "guestfs_list_filesystems"
25618 #: ../src/guestfs-actions.pod:3911
25622 " guestfs_list_filesystems (guestfs_h *g);\n"
25627 #: ../src/guestfs-actions.pod:3931
25629 "This command runs other libguestfs commands, which might include "
25630 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
25631 "soon after launch and only when nothing is mounted."
25635 #: ../src/guestfs-actions.pod:3935
25637 "Not all of the filesystems returned will be mountable. In particular, swap "
25638 "partitions are returned in the list. Also this command does not check that "
25639 "each filesystem found is valid and mountable, and some filesystems might be "
25640 "mountable but require special options. Filesystems may not all belong to a "
25641 "single logical operating system (use C<guestfs_inspect_os> to look for "
25646 #: ../src/guestfs-actions.pod:3949 ../src/guestfs-actions.pod:5724
25647 msgid "(Added in 1.5.15)"
25651 #: ../src/guestfs-actions.pod:3951
25652 msgid "guestfs_list_partitions"
25656 #: ../src/guestfs-actions.pod:3953
25660 " guestfs_list_partitions (guestfs_h *g);\n"
25665 #: ../src/guestfs-actions.pod:3960
25667 "This does not return logical volumes. For that you will need to call "
25672 #: ../src/guestfs-actions.pod:3971
25677 #: ../src/guestfs-actions.pod:3973
25681 " guestfs_ll (guestfs_h *g,\n"
25682 " const char *directory);\n"
25687 #: ../src/guestfs-actions.pod:3988
25692 #: ../src/guestfs-actions.pod:3990
25696 " guestfs_ln (guestfs_h *g,\n"
25697 " const char *target,\n"
25698 " const char *linkname);\n"
25703 #: ../src/guestfs-actions.pod:4001
25704 msgid "guestfs_ln_f"
25708 #: ../src/guestfs-actions.pod:4003
25712 " guestfs_ln_f (guestfs_h *g,\n"
25713 " const char *target,\n"
25714 " const char *linkname);\n"
25719 #: ../src/guestfs-actions.pod:4015
25720 msgid "guestfs_ln_s"
25724 #: ../src/guestfs-actions.pod:4017
25728 " guestfs_ln_s (guestfs_h *g,\n"
25729 " const char *target,\n"
25730 " const char *linkname);\n"
25735 #: ../src/guestfs-actions.pod:4028
25736 msgid "guestfs_ln_sf"
25740 #: ../src/guestfs-actions.pod:4030
25744 " guestfs_ln_sf (guestfs_h *g,\n"
25745 " const char *target,\n"
25746 " const char *linkname);\n"
25751 #: ../src/guestfs-actions.pod:4042
25752 msgid "guestfs_lremovexattr"
25756 #: ../src/guestfs-actions.pod:4044
25760 " guestfs_lremovexattr (guestfs_h *g,\n"
25761 " const char *xattr,\n"
25762 " const char *path);\n"
25767 #: ../src/guestfs-actions.pod:4049
25769 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
25770 "link, then it removes an extended attribute of the link itself."
25774 #: ../src/guestfs-actions.pod:4057
25779 #: ../src/guestfs-actions.pod:4059
25783 " guestfs_ls (guestfs_h *g,\n"
25784 " const char *directory);\n"
25789 #: ../src/guestfs-actions.pod:4067
25791 "This command is mostly useful for interactive sessions. Programs should "
25792 "probably use C<guestfs_readdir> instead."
25796 #: ../src/guestfs-actions.pod:4076
25797 msgid "guestfs_lsetxattr"
25801 #: ../src/guestfs-actions.pod:4078
25805 " guestfs_lsetxattr (guestfs_h *g,\n"
25806 " const char *xattr,\n"
25807 " const char *val,\n"
25809 " const char *path);\n"
25814 #: ../src/guestfs-actions.pod:4085
25816 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
25817 "then it sets an extended attribute of the link itself."
25821 #: ../src/guestfs-actions.pod:4093
25822 msgid "guestfs_lstat"
25826 #: ../src/guestfs-actions.pod:4095
25829 " struct guestfs_stat *\n"
25830 " guestfs_lstat (guestfs_h *g,\n"
25831 " const char *path);\n"
25836 #: ../src/guestfs-actions.pod:4101
25838 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
25839 "link, then the link is stat-ed, not the file it refers to."
25843 #: ../src/guestfs-actions.pod:4107 ../src/guestfs-actions.pod:6896
25845 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
25846 "error. I<The caller must call C<guestfs_free_stat> after use>."
25850 #: ../src/guestfs-actions.pod:4111 ../src/guestfs-actions.pod:6900 ../src/guestfs-actions.pod:6918 ../src/guestfs-actions.pod:7299
25851 msgid "(Added in 0.9.2)"
25855 #: ../src/guestfs-actions.pod:4113
25856 msgid "guestfs_lstatlist"
25860 #: ../src/guestfs-actions.pod:4115
25863 " struct guestfs_stat_list *\n"
25864 " guestfs_lstatlist (guestfs_h *g,\n"
25865 " const char *path,\n"
25866 " char *const *names);\n"
25871 #: ../src/guestfs-actions.pod:4120
25873 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
25874 "files, where all files are in the directory C<path>. C<names> is the list "
25875 "of files from this directory."
25879 #: ../src/guestfs-actions.pod:4129
25881 "This call is intended for programs that want to efficiently list a directory "
25882 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
25883 "for a similarly efficient call for getting extended attributes. Very long "
25884 "directory listings might cause the protocol message size to be exceeded, "
25885 "causing this call to fail. The caller must split up such requests into "
25886 "smaller groups of names."
25890 #: ../src/guestfs-actions.pod:4137
25892 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
25893 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
25897 #: ../src/guestfs-actions.pod:4143
25898 msgid "guestfs_luks_add_key"
25902 #: ../src/guestfs-actions.pod:4145
25906 " guestfs_luks_add_key (guestfs_h *g,\n"
25907 " const char *device,\n"
25908 " const char *key,\n"
25909 " const char *newkey,\n"
25915 #: ../src/guestfs-actions.pod:4157
25917 "Note that if C<keyslot> already contains a key, then this command will "
25918 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
25922 #: ../src/guestfs-actions.pod:4163 ../src/guestfs-actions.pod:4203 ../src/guestfs-actions.pod:4226 ../src/guestfs-actions.pod:4246 ../src/guestfs-actions.pod:4281 ../src/guestfs-actions.pod:4300
25924 "This function takes a key or passphrase parameter which could contain "
25925 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
25930 #: ../src/guestfs-actions.pod:4167 ../src/guestfs-actions.pod:4207 ../src/guestfs-actions.pod:4230 ../src/guestfs-actions.pod:4250
25931 msgid "(Added in 1.5.2)"
25935 #: ../src/guestfs-actions.pod:4169
25936 msgid "guestfs_luks_close"
25940 #: ../src/guestfs-actions.pod:4171
25944 " guestfs_luks_close (guestfs_h *g,\n"
25945 " const char *device);\n"
25950 #: ../src/guestfs-actions.pod:4175
25952 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
25953 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
25954 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
25955 "underlying block device."
25959 #: ../src/guestfs-actions.pod:4183 ../src/guestfs-actions.pod:4285 ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:4402
25960 msgid "(Added in 1.5.1)"
25964 #: ../src/guestfs-actions.pod:4185
25965 msgid "guestfs_luks_format"
25969 #: ../src/guestfs-actions.pod:4187
25973 " guestfs_luks_format (guestfs_h *g,\n"
25974 " const char *device,\n"
25975 " const char *key,\n"
25981 #: ../src/guestfs-actions.pod:4209
25982 msgid "guestfs_luks_format_cipher"
25986 #: ../src/guestfs-actions.pod:4211
25990 " guestfs_luks_format_cipher (guestfs_h *g,\n"
25991 " const char *device,\n"
25992 " const char *key,\n"
25994 " const char *cipher);\n"
25999 #: ../src/guestfs-actions.pod:4218
26001 "This command is the same as C<guestfs_luks_format> but it also allows you to "
26002 "set the C<cipher> used."
26006 #: ../src/guestfs-actions.pod:4232
26007 msgid "guestfs_luks_kill_slot"
26011 #: ../src/guestfs-actions.pod:4234
26015 " guestfs_luks_kill_slot (guestfs_h *g,\n"
26016 " const char *device,\n"
26017 " const char *key,\n"
26023 #: ../src/guestfs-actions.pod:4252
26024 msgid "guestfs_luks_open"
26028 #: ../src/guestfs-actions.pod:4254
26032 " guestfs_luks_open (guestfs_h *g,\n"
26033 " const char *device,\n"
26034 " const char *key,\n"
26035 " const char *mapname);\n"
26040 #: ../src/guestfs-actions.pod:4272
26042 "If this block device contains LVM volume groups, then calling "
26043 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
26048 #: ../src/guestfs-actions.pod:4276
26049 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
26053 #: ../src/guestfs-actions.pod:4287
26054 msgid "guestfs_luks_open_ro"
26058 #: ../src/guestfs-actions.pod:4289
26062 " guestfs_luks_open_ro (guestfs_h *g,\n"
26063 " const char *device,\n"
26064 " const char *key,\n"
26065 " const char *mapname);\n"
26070 #: ../src/guestfs-actions.pod:4295
26072 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
26077 #: ../src/guestfs-actions.pod:4306
26078 msgid "guestfs_lvcreate"
26082 #: ../src/guestfs-actions.pod:4308
26086 " guestfs_lvcreate (guestfs_h *g,\n"
26087 " const char *logvol,\n"
26088 " const char *volgroup,\n"
26094 #: ../src/guestfs-actions.pod:4321
26095 msgid "guestfs_lvm_canonical_lv_name"
26099 #: ../src/guestfs-actions.pod:4323
26103 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
26104 " const char *lvname);\n"
26109 #: ../src/guestfs-actions.pod:4334
26110 msgid "See also C<guestfs_is_lv>."
26114 #: ../src/guestfs-actions.pod:4339
26115 msgid "(Added in 1.5.24)"
26119 #: ../src/guestfs-actions.pod:4341
26120 msgid "guestfs_lvm_clear_filter"
26124 #: ../src/guestfs-actions.pod:4343
26128 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
26133 #: ../src/guestfs-actions.pod:4346
26135 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
26136 "see every block device."
26140 #: ../src/guestfs-actions.pod:4356
26141 msgid "guestfs_lvm_remove_all"
26145 #: ../src/guestfs-actions.pod:4358
26149 " guestfs_lvm_remove_all (guestfs_h *g);\n"
26154 #: ../src/guestfs-actions.pod:4371
26155 msgid "guestfs_lvm_set_filter"
26159 #: ../src/guestfs-actions.pod:4373
26163 " guestfs_lvm_set_filter (guestfs_h *g,\n"
26164 " char *const *devices);\n"
26169 #: ../src/guestfs-actions.pod:4404
26170 msgid "guestfs_lvremove"
26174 #: ../src/guestfs-actions.pod:4406
26178 " guestfs_lvremove (guestfs_h *g,\n"
26179 " const char *device);\n"
26184 #: ../src/guestfs-actions.pod:4418 ../src/guestfs-actions.pod:5821 ../src/guestfs-actions.pod:7669
26185 msgid "(Added in 1.0.13)"
26189 #: ../src/guestfs-actions.pod:4420
26190 msgid "guestfs_lvrename"
26194 #: ../src/guestfs-actions.pod:4422
26198 " guestfs_lvrename (guestfs_h *g,\n"
26199 " const char *logvol,\n"
26200 " const char *newlogvol);\n"
26205 #: ../src/guestfs-actions.pod:4431 ../src/guestfs-actions.pod:7682
26206 msgid "(Added in 1.0.83)"
26210 #: ../src/guestfs-actions.pod:4433
26211 msgid "guestfs_lvresize"
26215 #: ../src/guestfs-actions.pod:4435
26219 " guestfs_lvresize (guestfs_h *g,\n"
26220 " const char *device,\n"
26226 #: ../src/guestfs-actions.pod:4448
26227 msgid "guestfs_lvresize_free"
26231 #: ../src/guestfs-actions.pod:4450
26235 " guestfs_lvresize_free (guestfs_h *g,\n"
26236 " const char *lv,\n"
26242 #: ../src/guestfs-actions.pod:4463
26243 msgid "(Added in 1.3.3)"
26247 #: ../src/guestfs-actions.pod:4465
26248 msgid "guestfs_lvs"
26252 #: ../src/guestfs-actions.pod:4467
26256 " guestfs_lvs (guestfs_h *g);\n"
26261 #: ../src/guestfs-actions.pod:4476
26262 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
26266 #: ../src/guestfs-actions.pod:4484
26267 msgid "guestfs_lvs_full"
26271 #: ../src/guestfs-actions.pod:4486
26274 " struct guestfs_lvm_lv_list *\n"
26275 " guestfs_lvs_full (guestfs_h *g);\n"
26280 #: ../src/guestfs-actions.pod:4492
26282 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
26283 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
26288 #: ../src/guestfs-actions.pod:4498
26289 msgid "guestfs_lvuuid"
26293 #: ../src/guestfs-actions.pod:4500
26297 " guestfs_lvuuid (guestfs_h *g,\n"
26298 " const char *device);\n"
26303 #: ../src/guestfs-actions.pod:4511
26304 msgid "guestfs_lxattrlist"
26308 #: ../src/guestfs-actions.pod:4513
26311 " struct guestfs_xattr_list *\n"
26312 " guestfs_lxattrlist (guestfs_h *g,\n"
26313 " const char *path,\n"
26314 " char *const *names);\n"
26319 #: ../src/guestfs-actions.pod:4532
26321 "This call is intended for programs that want to efficiently list a directory "
26322 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
26323 "a similarly efficient call for getting standard stats. Very long directory "
26324 "listings might cause the protocol message size to be exceeded, causing this "
26325 "call to fail. The caller must split up such requests into smaller groups of "
26330 #: ../src/guestfs-actions.pod:4546
26331 msgid "guestfs_mkdir"
26335 #: ../src/guestfs-actions.pod:4548
26339 " guestfs_mkdir (guestfs_h *g,\n"
26340 " const char *path);\n"
26345 #: ../src/guestfs-actions.pod:4558
26346 msgid "guestfs_mkdir_mode"
26350 #: ../src/guestfs-actions.pod:4560
26354 " guestfs_mkdir_mode (guestfs_h *g,\n"
26355 " const char *path,\n"
26361 #: ../src/guestfs-actions.pod:4572
26362 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
26366 #: ../src/guestfs-actions.pod:4578
26367 msgid "guestfs_mkdir_p"
26371 #: ../src/guestfs-actions.pod:4580
26375 " guestfs_mkdir_p (guestfs_h *g,\n"
26376 " const char *path);\n"
26381 #: ../src/guestfs-actions.pod:4591
26382 msgid "guestfs_mkdtemp"
26386 #: ../src/guestfs-actions.pod:4593
26390 " guestfs_mkdtemp (guestfs_h *g,\n"
26391 " const char *template);\n"
26396 #: ../src/guestfs-actions.pod:4621
26397 msgid "guestfs_mke2fs_J"
26401 #: ../src/guestfs-actions.pod:4623
26405 " guestfs_mke2fs_J (guestfs_h *g,\n"
26406 " const char *fstype,\n"
26407 " int blocksize,\n"
26408 " const char *device,\n"
26409 " const char *journal);\n"
26414 #: ../src/guestfs-actions.pod:4636
26415 msgid "See also C<guestfs_mke2journal>."
26419 #: ../src/guestfs-actions.pod:4640 ../src/guestfs-actions.pod:4658 ../src/guestfs-actions.pod:4676 ../src/guestfs-actions.pod:4692 ../src/guestfs-actions.pod:4706 ../src/guestfs-actions.pod:4720 ../src/guestfs-actions.pod:4779 ../src/guestfs-actions.pod:5056
26420 msgid "(Added in 1.0.68)"
26424 #: ../src/guestfs-actions.pod:4642
26425 msgid "guestfs_mke2fs_JL"
26429 #: ../src/guestfs-actions.pod:4644
26433 " guestfs_mke2fs_JL (guestfs_h *g,\n"
26434 " const char *fstype,\n"
26435 " int blocksize,\n"
26436 " const char *device,\n"
26437 " const char *label);\n"
26442 #: ../src/guestfs-actions.pod:4654
26443 msgid "See also C<guestfs_mke2journal_L>."
26447 #: ../src/guestfs-actions.pod:4660
26448 msgid "guestfs_mke2fs_JU"
26452 #: ../src/guestfs-actions.pod:4662
26456 " guestfs_mke2fs_JU (guestfs_h *g,\n"
26457 " const char *fstype,\n"
26458 " int blocksize,\n"
26459 " const char *device,\n"
26460 " const char *uuid);\n"
26465 #: ../src/guestfs-actions.pod:4672
26466 msgid "See also C<guestfs_mke2journal_U>."
26470 #: ../src/guestfs-actions.pod:4678
26471 msgid "guestfs_mke2journal"
26475 #: ../src/guestfs-actions.pod:4680
26479 " guestfs_mke2journal (guestfs_h *g,\n"
26480 " int blocksize,\n"
26481 " const char *device);\n"
26486 #: ../src/guestfs-actions.pod:4694
26487 msgid "guestfs_mke2journal_L"
26491 #: ../src/guestfs-actions.pod:4696
26495 " guestfs_mke2journal_L (guestfs_h *g,\n"
26496 " int blocksize,\n"
26497 " const char *label,\n"
26498 " const char *device);\n"
26503 #: ../src/guestfs-actions.pod:4708
26504 msgid "guestfs_mke2journal_U"
26508 #: ../src/guestfs-actions.pod:4710
26512 " guestfs_mke2journal_U (guestfs_h *g,\n"
26513 " int blocksize,\n"
26514 " const char *uuid,\n"
26515 " const char *device);\n"
26520 #: ../src/guestfs-actions.pod:4722
26521 msgid "guestfs_mkfifo"
26525 #: ../src/guestfs-actions.pod:4724
26529 " guestfs_mkfifo (guestfs_h *g,\n"
26531 " const char *path);\n"
26536 #: ../src/guestfs-actions.pod:4729
26538 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
26539 "is just a convenient wrapper around C<guestfs_mknod>."
26543 #: ../src/guestfs-actions.pod:4739
26544 msgid "guestfs_mkfs"
26548 #: ../src/guestfs-actions.pod:4741
26552 " guestfs_mkfs (guestfs_h *g,\n"
26553 " const char *fstype,\n"
26554 " const char *device);\n"
26559 #: ../src/guestfs-actions.pod:4754
26560 msgid "guestfs_mkfs_b"
26564 #: ../src/guestfs-actions.pod:4756
26568 " guestfs_mkfs_b (guestfs_h *g,\n"
26569 " const char *fstype,\n"
26570 " int blocksize,\n"
26571 " const char *device);\n"
26576 #: ../src/guestfs-actions.pod:4762
26578 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
26583 #: ../src/guestfs-actions.pod:4769
26585 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
26586 "block size of the resulting filesystem. Supported block sizes depend on the "
26587 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
26591 #: ../src/guestfs-actions.pod:4781
26592 msgid "guestfs_mkfs_opts"
26596 #: ../src/guestfs-actions.pod:4783
26600 " guestfs_mkfs_opts (guestfs_h *g,\n"
26601 " const char *fstype,\n"
26602 " const char *device,\n"
26608 #: ../src/guestfs-actions.pod:4794
26611 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
26612 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
26613 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
26614 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
26619 #: ../src/guestfs-actions.pod:4842
26620 msgid "(Added in 1.7.19)"
26624 #: ../src/guestfs-actions.pod:4844
26625 msgid "guestfs_mkfs_opts_va"
26629 #: ../src/guestfs-actions.pod:4846
26633 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
26634 " const char *fstype,\n"
26635 " const char *device,\n"
26636 " va_list args);\n"
26641 #: ../src/guestfs-actions.pod:4852
26642 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
26646 #: ../src/guestfs-actions.pod:4856
26647 msgid "guestfs_mkfs_opts_argv"
26651 #: ../src/guestfs-actions.pod:4858
26655 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
26656 " const char *fstype,\n"
26657 " const char *device,\n"
26658 " const struct guestfs_mkfs_opts_argv *optargs);\n"
26663 #: ../src/guestfs-actions.pod:4864
26664 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
26668 #: ../src/guestfs-actions.pod:4868
26669 msgid "guestfs_mkmountpoint"
26673 #: ../src/guestfs-actions.pod:4870
26677 " guestfs_mkmountpoint (guestfs_h *g,\n"
26678 " const char *exemptpath);\n"
26683 #: ../src/guestfs-actions.pod:4874
26685 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
26686 "that can be used to create extra mountpoints before mounting the first "
26691 #: ../src/guestfs-actions.pod:4898
26693 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
26694 "may get unexpected errors if you try to mix these calls. It is safest to "
26695 "manually unmount filesystems and remove mountpoints after use."
26699 #: ../src/guestfs-actions.pod:4902
26701 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
26702 "first, so for this to work for manual mountpoints, you must ensure that the "
26703 "innermost mountpoints have the longest pathnames, as in the example code "
26708 #: ../src/guestfs-actions.pod:4909
26710 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
26711 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
26712 "can also trigger these issues."
26716 #: ../src/guestfs-actions.pod:4915 ../src/guestfs-actions.pod:5231 ../src/guestfs-actions.pod:6241
26717 msgid "(Added in 1.0.62)"
26721 #: ../src/guestfs-actions.pod:4917
26722 msgid "guestfs_mknod"
26726 #: ../src/guestfs-actions.pod:4919
26730 " guestfs_mknod (guestfs_h *g,\n"
26734 " const char *path);\n"
26739 #: ../src/guestfs-actions.pod:4934
26741 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
26742 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
26743 "regular file). These constants are available in the standard Linux header "
26744 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
26745 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
26746 "the appropriate constant for you."
26750 #: ../src/guestfs-actions.pod:4948
26751 msgid "guestfs_mknod_b"
26755 #: ../src/guestfs-actions.pod:4950
26759 " guestfs_mknod_b (guestfs_h *g,\n"
26763 " const char *path);\n"
26768 #: ../src/guestfs-actions.pod:4957
26770 "This call creates a block device node called C<path> with mode C<mode> and "
26771 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26772 "wrapper around C<guestfs_mknod>."
26776 #: ../src/guestfs-actions.pod:4967
26777 msgid "guestfs_mknod_c"
26781 #: ../src/guestfs-actions.pod:4969
26785 " guestfs_mknod_c (guestfs_h *g,\n"
26789 " const char *path);\n"
26794 #: ../src/guestfs-actions.pod:4976
26796 "This call creates a char device node called C<path> with mode C<mode> and "
26797 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26798 "wrapper around C<guestfs_mknod>."
26802 #: ../src/guestfs-actions.pod:4986
26803 msgid "guestfs_mkswap"
26807 #: ../src/guestfs-actions.pod:4988
26811 " guestfs_mkswap (guestfs_h *g,\n"
26812 " const char *device);\n"
26817 #: ../src/guestfs-actions.pod:4998
26818 msgid "guestfs_mkswap_L"
26822 #: ../src/guestfs-actions.pod:5000
26826 " guestfs_mkswap_L (guestfs_h *g,\n"
26827 " const char *label,\n"
26828 " const char *device);\n"
26833 #: ../src/guestfs-actions.pod:5015
26834 msgid "guestfs_mkswap_U"
26838 #: ../src/guestfs-actions.pod:5017
26842 " guestfs_mkswap_U (guestfs_h *g,\n"
26843 " const char *uuid,\n"
26844 " const char *device);\n"
26849 #: ../src/guestfs-actions.pod:5028
26850 msgid "guestfs_mkswap_file"
26854 #: ../src/guestfs-actions.pod:5030
26858 " guestfs_mkswap_file (guestfs_h *g,\n"
26859 " const char *path);\n"
26864 #: ../src/guestfs-actions.pod:5036
26866 "This command just writes a swap file signature to an existing file. To "
26867 "create the file itself, use something like C<guestfs_fallocate>."
26871 #: ../src/guestfs-actions.pod:5043
26872 msgid "guestfs_modprobe"
26876 #: ../src/guestfs-actions.pod:5045
26880 " guestfs_modprobe (guestfs_h *g,\n"
26881 " const char *modulename);\n"
26886 #: ../src/guestfs-actions.pod:5058
26887 msgid "guestfs_mount"
26891 #: ../src/guestfs-actions.pod:5060
26895 " guestfs_mount (guestfs_h *g,\n"
26896 " const char *device,\n"
26897 " const char *mountpoint);\n"
26902 #: ../src/guestfs-actions.pod:5065
26904 "I<This function is deprecated.> In new code, use the "
26905 "L</guestfs_mount_options> call instead."
26909 #: ../src/guestfs-actions.pod:5086
26911 "B<Important note:> When you use this call, the filesystem options C<sync> "
26912 "and C<noatime> are set implicitly. This was originally done because we "
26913 "thought it would improve reliability, but it turns out that I<-o sync> has a "
26914 "very large negative performance impact and negligible effect on "
26915 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
26916 "in any code that needs performance, and instead use C<guestfs_mount_options> "
26917 "(use an empty string for the first parameter if you don't want any options)."
26921 #: ../src/guestfs-actions.pod:5100
26922 msgid "guestfs_mount_9p"
26926 #: ../src/guestfs-actions.pod:5102
26930 " guestfs_mount_9p (guestfs_h *g,\n"
26931 " const char *mounttag,\n"
26932 " const char *mountpoint,\n"
26938 #: ../src/guestfs-actions.pod:5113
26941 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
26946 #: ../src/guestfs-actions.pod:5126
26947 msgid "guestfs_mount_9p_va"
26951 #: ../src/guestfs-actions.pod:5128
26955 " guestfs_mount_9p_va (guestfs_h *g,\n"
26956 " const char *mounttag,\n"
26957 " const char *mountpoint,\n"
26958 " va_list args);\n"
26963 #: ../src/guestfs-actions.pod:5134
26964 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
26968 #: ../src/guestfs-actions.pod:5138
26969 msgid "guestfs_mount_9p_argv"
26973 #: ../src/guestfs-actions.pod:5140
26977 " guestfs_mount_9p_argv (guestfs_h *g,\n"
26978 " const char *mounttag,\n"
26979 " const char *mountpoint,\n"
26980 " const struct guestfs_mount_9p_argv *optargs);\n"
26985 #: ../src/guestfs-actions.pod:5146
26986 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
26990 #: ../src/guestfs-actions.pod:5150
26991 msgid "guestfs_mount_loop"
26995 #: ../src/guestfs-actions.pod:5152
26999 " guestfs_mount_loop (guestfs_h *g,\n"
27000 " const char *file,\n"
27001 " const char *mountpoint);\n"
27006 #: ../src/guestfs-actions.pod:5165
27007 msgid "guestfs_mount_options"
27011 #: ../src/guestfs-actions.pod:5167
27015 " guestfs_mount_options (guestfs_h *g,\n"
27016 " const char *options,\n"
27017 " const char *device,\n"
27018 " const char *mountpoint);\n"
27023 #: ../src/guestfs-actions.pod:5173
27025 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27026 "the mount options as for the L<mount(8)> I<-o> flag."
27030 #: ../src/guestfs-actions.pod:5183 ../src/guestfs-actions.pod:5197 ../src/guestfs-actions.pod:5214
27031 msgid "(Added in 1.0.10)"
27035 #: ../src/guestfs-actions.pod:5185
27036 msgid "guestfs_mount_ro"
27040 #: ../src/guestfs-actions.pod:5187
27044 " guestfs_mount_ro (guestfs_h *g,\n"
27045 " const char *device,\n"
27046 " const char *mountpoint);\n"
27051 #: ../src/guestfs-actions.pod:5192
27053 "This is the same as the C<guestfs_mount> command, but it mounts the "
27054 "filesystem with the read-only (I<-o ro>) flag."
27058 #: ../src/guestfs-actions.pod:5199
27059 msgid "guestfs_mount_vfs"
27063 #: ../src/guestfs-actions.pod:5201
27067 " guestfs_mount_vfs (guestfs_h *g,\n"
27068 " const char *options,\n"
27069 " const char *vfstype,\n"
27070 " const char *device,\n"
27071 " const char *mountpoint);\n"
27076 #: ../src/guestfs-actions.pod:5208
27078 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27079 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
27084 #: ../src/guestfs-actions.pod:5216
27085 msgid "guestfs_mountpoints"
27089 #: ../src/guestfs-actions.pod:5218
27093 " guestfs_mountpoints (guestfs_h *g);\n"
27098 #: ../src/guestfs-actions.pod:5221
27100 "This call is similar to C<guestfs_mounts>. That call returns a list of "
27101 "devices. This one returns a hash table (map) of device name to directory "
27102 "where the device is mounted."
27106 #: ../src/guestfs-actions.pod:5233
27107 msgid "guestfs_mounts"
27111 #: ../src/guestfs-actions.pod:5235
27115 " guestfs_mounts (guestfs_h *g);\n"
27120 #: ../src/guestfs-actions.pod:5243
27121 msgid "See also: C<guestfs_mountpoints>"
27125 #: ../src/guestfs-actions.pod:5251
27130 #: ../src/guestfs-actions.pod:5253
27134 " guestfs_mv (guestfs_h *g,\n"
27135 " const char *src,\n"
27136 " const char *dest);\n"
27141 #: ../src/guestfs-actions.pod:5265
27142 msgid "guestfs_ntfs_3g_probe"
27146 #: ../src/guestfs-actions.pod:5267
27150 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
27152 " const char *device);\n"
27157 #: ../src/guestfs-actions.pod:5286
27158 msgid "(Added in 1.0.43)"
27162 #: ../src/guestfs-actions.pod:5288
27163 msgid "guestfs_ntfsresize"
27167 #: ../src/guestfs-actions.pod:5290
27171 " guestfs_ntfsresize (guestfs_h *g,\n"
27172 " const char *device);\n"
27177 #: ../src/guestfs-actions.pod:5294 ../src/guestfs-actions.pod:5394
27179 "I<This function is deprecated.> In new code, use the "
27180 "L</guestfs_ntfsresize_opts> call instead."
27184 #: ../src/guestfs-actions.pod:5318
27185 msgid "guestfs_ntfsresize_opts"
27189 #: ../src/guestfs-actions.pod:5320
27193 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
27194 " const char *device,\n"
27200 #: ../src/guestfs-actions.pod:5330
27203 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
27204 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
27209 #: ../src/guestfs-actions.pod:5350
27211 "After the resize operation, the filesystem is always marked as requiring a "
27212 "consistency check (for safety). You have to boot into Windows to perform "
27213 "this check and clear this condition. If you I<don't> set the C<force> "
27214 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
27215 "times on a single filesystem without booting into Windows between each "
27220 #: ../src/guestfs-actions.pod:5365
27221 msgid "guestfs_ntfsresize_opts_va"
27225 #: ../src/guestfs-actions.pod:5367
27229 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
27230 " const char *device,\n"
27231 " va_list args);\n"
27236 #: ../src/guestfs-actions.pod:5372
27237 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
27241 #: ../src/guestfs-actions.pod:5376
27242 msgid "guestfs_ntfsresize_opts_argv"
27246 #: ../src/guestfs-actions.pod:5378
27250 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
27251 " const char *device,\n"
27252 " const struct guestfs_ntfsresize_opts_argv "
27258 #: ../src/guestfs-actions.pod:5383
27259 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
27263 #: ../src/guestfs-actions.pod:5387
27264 msgid "guestfs_ntfsresize_size"
27268 #: ../src/guestfs-actions.pod:5389
27272 " guestfs_ntfsresize_size (guestfs_h *g,\n"
27273 " const char *device,\n"
27274 " int64_t size);\n"
27279 #: ../src/guestfs-actions.pod:5401
27281 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
27282 "to specify the new size (in bytes) explicitly."
27286 #: ../src/guestfs-actions.pod:5406 ../src/guestfs-actions.pod:5848 ../src/guestfs-actions.pod:5921 ../src/guestfs-actions.pod:6189 ../src/guestfs-actions.pod:7826
27287 msgid "(Added in 1.3.14)"
27291 #: ../src/guestfs-actions.pod:5408
27292 msgid "guestfs_part_add"
27296 #: ../src/guestfs-actions.pod:5410
27300 " guestfs_part_add (guestfs_h *g,\n"
27301 " const char *device,\n"
27302 " const char *prlogex,\n"
27303 " int64_t startsect,\n"
27304 " int64_t endsect);\n"
27309 #: ../src/guestfs-actions.pod:5417
27311 "This command adds a partition to C<device>. If there is no partition table "
27312 "on the device, call C<guestfs_part_init> first."
27316 #: ../src/guestfs-actions.pod:5429
27318 "Creating a partition which covers the whole disk is not so easy. Use "
27319 "C<guestfs_part_disk> to do that."
27323 #: ../src/guestfs-actions.pod:5434 ../src/guestfs-actions.pod:5472 ../src/guestfs-actions.pod:5525 ../src/guestfs-actions.pod:5609 ../src/guestfs-actions.pod:5647 ../src/guestfs-actions.pod:5666 ../src/guestfs-actions.pod:5706
27324 msgid "(Added in 1.0.78)"
27328 #: ../src/guestfs-actions.pod:5436
27329 msgid "guestfs_part_del"
27333 #: ../src/guestfs-actions.pod:5438
27337 " guestfs_part_del (guestfs_h *g,\n"
27338 " const char *device,\n"
27344 #: ../src/guestfs-actions.pod:5453
27345 msgid "guestfs_part_disk"
27349 #: ../src/guestfs-actions.pod:5455
27353 " guestfs_part_disk (guestfs_h *g,\n"
27354 " const char *device,\n"
27355 " const char *parttype);\n"
27360 #: ../src/guestfs-actions.pod:5460
27362 "This command is simply a combination of C<guestfs_part_init> followed by "
27363 "C<guestfs_part_add> to create a single primary partition covering the whole "
27368 #: ../src/guestfs-actions.pod:5464
27370 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27371 "possible values are described in C<guestfs_part_init>."
27375 #: ../src/guestfs-actions.pod:5474
27376 msgid "guestfs_part_get_bootable"
27380 #: ../src/guestfs-actions.pod:5476
27384 " guestfs_part_get_bootable (guestfs_h *g,\n"
27385 " const char *device,\n"
27391 #: ../src/guestfs-actions.pod:5484
27392 msgid "See also C<guestfs_part_set_bootable>."
27396 #: ../src/guestfs-actions.pod:5490
27397 msgid "guestfs_part_get_mbr_id"
27401 #: ../src/guestfs-actions.pod:5492
27405 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
27406 " const char *device,\n"
27412 #: ../src/guestfs-actions.pod:5500 ../src/guestfs-actions.pod:5682
27414 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
27415 "undefined results for other partition table types (see "
27416 "C<guestfs_part_get_parttype>)."
27420 #: ../src/guestfs-actions.pod:5508
27421 msgid "guestfs_part_get_parttype"
27425 #: ../src/guestfs-actions.pod:5510
27429 " guestfs_part_get_parttype (guestfs_h *g,\n"
27430 " const char *device);\n"
27435 #: ../src/guestfs-actions.pod:5517
27437 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
27438 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
27439 "possible, although unusual. See C<guestfs_part_init> for a full list."
27443 #: ../src/guestfs-actions.pod:5527
27444 msgid "guestfs_part_init"
27448 #: ../src/guestfs-actions.pod:5529
27452 " guestfs_part_init (guestfs_h *g,\n"
27453 " const char *device,\n"
27454 " const char *parttype);\n"
27459 #: ../src/guestfs-actions.pod:5538
27461 "Initially there are no partitions. Following this, you should call "
27462 "C<guestfs_part_add> for each partition required."
27466 #: ../src/guestfs-actions.pod:5611
27467 msgid "guestfs_part_list"
27471 #: ../src/guestfs-actions.pod:5613
27474 " struct guestfs_partition_list *\n"
27475 " guestfs_part_list (guestfs_h *g,\n"
27476 " const char *device);\n"
27481 #: ../src/guestfs-actions.pod:5630
27483 "Start of the partition I<in bytes>. To get sectors you have to divide by "
27484 "the device's sector size, see C<guestfs_blockdev_getss>."
27488 #: ../src/guestfs-actions.pod:5643
27490 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
27491 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
27496 #: ../src/guestfs-actions.pod:5649
27497 msgid "guestfs_part_set_bootable"
27501 #: ../src/guestfs-actions.pod:5651
27505 " guestfs_part_set_bootable (guestfs_h *g,\n"
27506 " const char *device,\n"
27508 " int bootable);\n"
27513 #: ../src/guestfs-actions.pod:5668
27514 msgid "guestfs_part_set_mbr_id"
27518 #: ../src/guestfs-actions.pod:5670
27522 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
27523 " const char *device,\n"
27530 #: ../src/guestfs-actions.pod:5690
27531 msgid "guestfs_part_set_name"
27535 #: ../src/guestfs-actions.pod:5692
27539 " guestfs_part_set_name (guestfs_h *g,\n"
27540 " const char *device,\n"
27542 " const char *name);\n"
27547 #: ../src/guestfs-actions.pod:5708
27548 msgid "guestfs_part_to_dev"
27552 #: ../src/guestfs-actions.pod:5710
27556 " guestfs_part_to_dev (guestfs_h *g,\n"
27557 " const char *partition);\n"
27562 #: ../src/guestfs-actions.pod:5718
27564 "The named partition must exist, for example as a string returned from "
27565 "C<guestfs_list_partitions>."
27569 #: ../src/guestfs-actions.pod:5726
27570 msgid "guestfs_ping_daemon"
27574 #: ../src/guestfs-actions.pod:5728
27578 " guestfs_ping_daemon (guestfs_h *g);\n"
27583 #: ../src/guestfs-actions.pod:5740
27584 msgid "guestfs_pread"
27588 #: ../src/guestfs-actions.pod:5742
27592 " guestfs_pread (guestfs_h *g,\n"
27593 " const char *path,\n"
27595 " int64_t offset,\n"
27596 " size_t *size_r);\n"
27601 #: ../src/guestfs-actions.pod:5755
27602 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
27606 #: ../src/guestfs-actions.pod:5766
27607 msgid "guestfs_pread_device"
27611 #: ../src/guestfs-actions.pod:5768
27615 " guestfs_pread_device (guestfs_h *g,\n"
27616 " const char *device,\n"
27618 " int64_t offset,\n"
27619 " size_t *size_r);\n"
27624 #: ../src/guestfs-actions.pod:5781
27625 msgid "See also C<guestfs_pread>."
27629 #: ../src/guestfs-actions.pod:5790
27630 msgid "(Added in 1.5.21)"
27634 #: ../src/guestfs-actions.pod:5792
27635 msgid "guestfs_pvcreate"
27639 #: ../src/guestfs-actions.pod:5794
27643 " guestfs_pvcreate (guestfs_h *g,\n"
27644 " const char *device);\n"
27649 #: ../src/guestfs-actions.pod:5806
27650 msgid "guestfs_pvremove"
27654 #: ../src/guestfs-actions.pod:5808
27658 " guestfs_pvremove (guestfs_h *g,\n"
27659 " const char *device);\n"
27664 #: ../src/guestfs-actions.pod:5823
27665 msgid "guestfs_pvresize"
27669 #: ../src/guestfs-actions.pod:5825
27673 " guestfs_pvresize (guestfs_h *g,\n"
27674 " const char *device);\n"
27679 #: ../src/guestfs-actions.pod:5836
27680 msgid "guestfs_pvresize_size"
27684 #: ../src/guestfs-actions.pod:5838
27688 " guestfs_pvresize_size (guestfs_h *g,\n"
27689 " const char *device,\n"
27690 " int64_t size);\n"
27695 #: ../src/guestfs-actions.pod:5843
27697 "This command is the same as C<guestfs_pvresize> except that it allows you to "
27698 "specify the new size (in bytes) explicitly."
27702 #: ../src/guestfs-actions.pod:5850
27703 msgid "guestfs_pvs"
27707 #: ../src/guestfs-actions.pod:5852
27711 " guestfs_pvs (guestfs_h *g);\n"
27716 #: ../src/guestfs-actions.pod:5861
27717 msgid "See also C<guestfs_pvs_full>."
27721 #: ../src/guestfs-actions.pod:5869
27722 msgid "guestfs_pvs_full"
27726 #: ../src/guestfs-actions.pod:5871
27729 " struct guestfs_lvm_pv_list *\n"
27730 " guestfs_pvs_full (guestfs_h *g);\n"
27735 #: ../src/guestfs-actions.pod:5877
27737 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
27738 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
27743 #: ../src/guestfs-actions.pod:5883
27744 msgid "guestfs_pvuuid"
27748 #: ../src/guestfs-actions.pod:5885
27752 " guestfs_pvuuid (guestfs_h *g,\n"
27753 " const char *device);\n"
27758 #: ../src/guestfs-actions.pod:5896
27759 msgid "guestfs_pwrite"
27763 #: ../src/guestfs-actions.pod:5898
27767 " guestfs_pwrite (guestfs_h *g,\n"
27768 " const char *path,\n"
27769 " const char *content,\n"
27770 " size_t content_size,\n"
27771 " int64_t offset);\n"
27776 #: ../src/guestfs-actions.pod:5914
27777 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
27781 #: ../src/guestfs-actions.pod:5923
27782 msgid "guestfs_pwrite_device"
27786 #: ../src/guestfs-actions.pod:5925
27790 " guestfs_pwrite_device (guestfs_h *g,\n"
27791 " const char *device,\n"
27792 " const char *content,\n"
27793 " size_t content_size,\n"
27794 " int64_t offset);\n"
27799 #: ../src/guestfs-actions.pod:5940
27800 msgid "See also C<guestfs_pwrite>."
27804 #: ../src/guestfs-actions.pod:5947
27805 msgid "(Added in 1.5.20)"
27809 #: ../src/guestfs-actions.pod:5949
27810 msgid "guestfs_read_file"
27814 #: ../src/guestfs-actions.pod:5951
27818 " guestfs_read_file (guestfs_h *g,\n"
27819 " const char *path,\n"
27820 " size_t *size_r);\n"
27825 #: ../src/guestfs-actions.pod:5959
27827 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
27828 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
27829 "function is limited in the total size of file that can be handled."
27833 #: ../src/guestfs-actions.pod:5971
27834 msgid "(Added in 1.0.63)"
27838 #: ../src/guestfs-actions.pod:5973
27839 msgid "guestfs_read_lines"
27843 #: ../src/guestfs-actions.pod:5975
27847 " guestfs_read_lines (guestfs_h *g,\n"
27848 " const char *path);\n"
27853 #: ../src/guestfs-actions.pod:5984
27855 "Note that this function cannot correctly handle binary files (specifically, "
27856 "files containing C<\\0> character which is treated as end of line). For "
27857 "those you need to use the C<guestfs_read_file> function which has a more "
27858 "complex interface."
27862 #: ../src/guestfs-actions.pod:5995
27863 msgid "guestfs_readdir"
27867 #: ../src/guestfs-actions.pod:5997
27870 " struct guestfs_dirent_list *\n"
27871 " guestfs_readdir (guestfs_h *g,\n"
27872 " const char *dir);\n"
27877 #: ../src/guestfs-actions.pod:6051
27879 "This function is primarily intended for use by programs. To get a simple "
27880 "list of names, use C<guestfs_ls>. To get a printable directory for human "
27881 "consumption, use C<guestfs_ll>."
27885 #: ../src/guestfs-actions.pod:6055
27887 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
27888 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
27893 #: ../src/guestfs-actions.pod:6061
27894 msgid "guestfs_readlink"
27898 #: ../src/guestfs-actions.pod:6063
27902 " guestfs_readlink (guestfs_h *g,\n"
27903 " const char *path);\n"
27908 #: ../src/guestfs-actions.pod:6074
27909 msgid "guestfs_readlinklist"
27913 #: ../src/guestfs-actions.pod:6076
27917 " guestfs_readlinklist (guestfs_h *g,\n"
27918 " const char *path,\n"
27919 " char *const *names);\n"
27924 #: ../src/guestfs-actions.pod:6109
27925 msgid "guestfs_realpath"
27929 #: ../src/guestfs-actions.pod:6111
27933 " guestfs_realpath (guestfs_h *g,\n"
27934 " const char *path);\n"
27939 #: ../src/guestfs-actions.pod:6123
27940 msgid "guestfs_removexattr"
27944 #: ../src/guestfs-actions.pod:6125
27948 " guestfs_removexattr (guestfs_h *g,\n"
27949 " const char *xattr,\n"
27950 " const char *path);\n"
27955 #: ../src/guestfs-actions.pod:6133
27956 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
27960 #: ../src/guestfs-actions.pod:6139
27961 msgid "guestfs_resize2fs"
27965 #: ../src/guestfs-actions.pod:6141
27969 " guestfs_resize2fs (guestfs_h *g,\n"
27970 " const char *device);\n"
27975 #: ../src/guestfs-actions.pod:6148
27977 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
27978 "C<device> before calling this command. For unknown reasons C<resize2fs> "
27979 "sometimes gives an error about this and sometimes not. In any case, it is "
27980 "always safe to call C<guestfs_e2fsck_f> before calling this function."
27984 #: ../src/guestfs-actions.pod:6158
27985 msgid "guestfs_resize2fs_M"
27989 #: ../src/guestfs-actions.pod:6160
27993 " guestfs_resize2fs_M (guestfs_h *g,\n"
27994 " const char *device);\n"
27999 #: ../src/guestfs-actions.pod:6164
28001 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
28002 "resized to its minimum size. This works like the I<-M> option to the "
28003 "C<resize2fs> command."
28007 #: ../src/guestfs-actions.pod:6168
28009 "To get the resulting size of the filesystem you should call "
28010 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
28011 "These two numbers, multiplied together, give the resulting size of the "
28012 "minimal filesystem in bytes."
28016 #: ../src/guestfs-actions.pod:6177
28017 msgid "guestfs_resize2fs_size"
28021 #: ../src/guestfs-actions.pod:6179
28025 " guestfs_resize2fs_size (guestfs_h *g,\n"
28026 " const char *device,\n"
28027 " int64_t size);\n"
28032 #: ../src/guestfs-actions.pod:6184
28034 "This command is the same as C<guestfs_resize2fs> except that it allows you "
28035 "to specify the new size (in bytes) explicitly."
28039 #: ../src/guestfs-actions.pod:6191
28044 #: ../src/guestfs-actions.pod:6193
28048 " guestfs_rm (guestfs_h *g,\n"
28049 " const char *path);\n"
28054 #: ../src/guestfs-actions.pod:6203
28055 msgid "guestfs_rm_rf"
28059 #: ../src/guestfs-actions.pod:6205
28063 " guestfs_rm_rf (guestfs_h *g,\n"
28064 " const char *path);\n"
28069 #: ../src/guestfs-actions.pod:6217
28070 msgid "guestfs_rmdir"
28074 #: ../src/guestfs-actions.pod:6219
28078 " guestfs_rmdir (guestfs_h *g,\n"
28079 " const char *path);\n"
28084 #: ../src/guestfs-actions.pod:6229
28085 msgid "guestfs_rmmountpoint"
28089 #: ../src/guestfs-actions.pod:6231
28093 " guestfs_rmmountpoint (guestfs_h *g,\n"
28094 " const char *exemptpath);\n"
28099 #: ../src/guestfs-actions.pod:6235
28101 "This calls removes a mountpoint that was previously created with "
28102 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
28106 #: ../src/guestfs-actions.pod:6243
28107 msgid "guestfs_scrub_device"
28111 #: ../src/guestfs-actions.pod:6245
28115 " guestfs_scrub_device (guestfs_h *g,\n"
28116 " const char *device);\n"
28121 #: ../src/guestfs-actions.pod:6260 ../src/guestfs-actions.pod:6278 ../src/guestfs-actions.pod:6297
28122 msgid "(Added in 1.0.52)"
28126 #: ../src/guestfs-actions.pod:6262
28127 msgid "guestfs_scrub_file"
28131 #: ../src/guestfs-actions.pod:6264
28135 " guestfs_scrub_file (guestfs_h *g,\n"
28136 " const char *file);\n"
28141 #: ../src/guestfs-actions.pod:6280
28142 msgid "guestfs_scrub_freespace"
28146 #: ../src/guestfs-actions.pod:6282
28150 " guestfs_scrub_freespace (guestfs_h *g,\n"
28151 " const char *dir);\n"
28156 #: ../src/guestfs-actions.pod:6286
28158 "This command creates the directory C<dir> and then fills it with files until "
28159 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
28160 "and deletes them. The intention is to scrub any free space on the partition "
28161 "containing C<dir>."
28165 #: ../src/guestfs-actions.pod:6299
28166 msgid "guestfs_set_append"
28170 #: ../src/guestfs-actions.pod:6301
28174 " guestfs_set_append (guestfs_h *g,\n"
28175 " const char *append);\n"
28180 #: ../src/guestfs-actions.pod:6318
28181 msgid "guestfs_set_attach_method"
28185 #: ../src/guestfs-actions.pod:6320
28189 " guestfs_set_attach_method (guestfs_h *g,\n"
28190 " const char *attachmethod);\n"
28195 #: ../src/guestfs-actions.pod:6348
28196 msgid "guestfs_set_autosync"
28200 #: ../src/guestfs-actions.pod:6350
28204 " guestfs_set_autosync (guestfs_h *g,\n"
28205 " int autosync);\n"
28210 #: ../src/guestfs-actions.pod:6366
28211 msgid "guestfs_set_direct"
28215 #: ../src/guestfs-actions.pod:6368
28219 " guestfs_set_direct (guestfs_h *g,\n"
28225 #: ../src/guestfs-actions.pod:6376
28227 "One consequence of this is that log messages aren't caught by the library "
28228 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
28233 #: ../src/guestfs-actions.pod:6389
28234 msgid "guestfs_set_e2label"
28238 #: ../src/guestfs-actions.pod:6391
28242 " guestfs_set_e2label (guestfs_h *g,\n"
28243 " const char *device,\n"
28244 " const char *label);\n"
28249 #: ../src/guestfs-actions.pod:6400
28251 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
28252 "the existing label on a filesystem."
28256 #: ../src/guestfs-actions.pod:6407
28257 msgid "guestfs_set_e2uuid"
28261 #: ../src/guestfs-actions.pod:6409
28265 " guestfs_set_e2uuid (guestfs_h *g,\n"
28266 " const char *device,\n"
28267 " const char *uuid);\n"
28272 #: ../src/guestfs-actions.pod:6419
28274 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
28275 "the existing UUID of a filesystem."
28279 #: ../src/guestfs-actions.pod:6426
28280 msgid "guestfs_set_memsize"
28284 #: ../src/guestfs-actions.pod:6428
28288 " guestfs_set_memsize (guestfs_h *g,\n"
28294 #: ../src/guestfs-actions.pod:6432
28296 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28297 "This only has any effect if called before C<guestfs_launch>."
28301 #: ../src/guestfs-actions.pod:6447
28302 msgid "guestfs_set_network"
28306 #: ../src/guestfs-actions.pod:6449
28310 " guestfs_set_network (guestfs_h *g,\n"
28316 #: ../src/guestfs-actions.pod:6459
28318 "You must call this before calling C<guestfs_launch>, otherwise it has no "
28323 #: ../src/guestfs-actions.pod:6466
28324 msgid "guestfs_set_path"
28328 #: ../src/guestfs-actions.pod:6468
28332 " guestfs_set_path (guestfs_h *g,\n"
28333 " const char *searchpath);\n"
28338 #: ../src/guestfs-actions.pod:6483
28339 msgid "guestfs_set_pgroup"
28343 #: ../src/guestfs-actions.pod:6485
28347 " guestfs_set_pgroup (guestfs_h *g,\n"
28353 #: ../src/guestfs-actions.pod:6502
28354 msgid "guestfs_set_qemu"
28358 #: ../src/guestfs-actions.pod:6504
28362 " guestfs_set_qemu (guestfs_h *g,\n"
28363 " const char *qemu);\n"
28368 #: ../src/guestfs-actions.pod:6530
28369 msgid "guestfs_set_recovery_proc"
28373 #: ../src/guestfs-actions.pod:6532
28377 " guestfs_set_recovery_proc (guestfs_h *g,\n"
28378 " int recoveryproc);\n"
28383 #: ../src/guestfs-actions.pod:6536
28385 "If this is called with the parameter C<false> then C<guestfs_launch> does "
28386 "not create a recovery process. The purpose of the recovery process is to "
28387 "stop runaway qemu processes in the case where the main program aborts "
28392 #: ../src/guestfs-actions.pod:6541
28394 "This only has any effect if called before C<guestfs_launch>, and the default "
28399 #: ../src/guestfs-actions.pod:6554
28400 msgid "guestfs_set_selinux"
28404 #: ../src/guestfs-actions.pod:6556
28408 " guestfs_set_selinux (guestfs_h *g,\n"
28414 #: ../src/guestfs-actions.pod:6573
28415 msgid "guestfs_set_smp"
28419 #: ../src/guestfs-actions.pod:6575
28423 " guestfs_set_smp (guestfs_h *g,\n"
28429 #: ../src/guestfs-actions.pod:6583
28430 msgid "This function must be called before C<guestfs_launch>."
28434 #: ../src/guestfs-actions.pod:6587
28435 msgid "guestfs_set_trace"
28439 #: ../src/guestfs-actions.pod:6589
28443 " guestfs_set_trace (guestfs_h *g,\n"
28449 #: ../src/guestfs-actions.pod:6603
28451 "Trace messages are normally sent to C<stderr>, unless you register a "
28452 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28456 #: ../src/guestfs-actions.pod:6611
28457 msgid "guestfs_set_verbose"
28461 #: ../src/guestfs-actions.pod:6613
28465 " guestfs_set_verbose (guestfs_h *g,\n"
28471 #: ../src/guestfs-actions.pod:6622
28473 "Verbose messages are normally sent to C<stderr>, unless you register a "
28474 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28478 #: ../src/guestfs-actions.pod:6630
28479 msgid "guestfs_setcon"
28483 #: ../src/guestfs-actions.pod:6632
28487 " guestfs_setcon (guestfs_h *g,\n"
28488 " const char *context);\n"
28493 #: ../src/guestfs-actions.pod:6645
28494 msgid "guestfs_setxattr"
28498 #: ../src/guestfs-actions.pod:6647
28502 " guestfs_setxattr (guestfs_h *g,\n"
28503 " const char *xattr,\n"
28504 " const char *val,\n"
28506 " const char *path);\n"
28511 #: ../src/guestfs-actions.pod:6658
28512 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
28516 #: ../src/guestfs-actions.pod:6664
28517 msgid "guestfs_sfdisk"
28521 #: ../src/guestfs-actions.pod:6666
28525 " guestfs_sfdisk (guestfs_h *g,\n"
28526 " const char *device,\n"
28530 " char *const *lines);\n"
28535 #: ../src/guestfs-actions.pod:6674 ../src/guestfs-actions.pod:6718 ../src/guestfs-actions.pod:6752
28537 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
28542 #: ../src/guestfs-actions.pod:6701
28543 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
28547 #: ../src/guestfs-actions.pod:6711
28548 msgid "guestfs_sfdiskM"
28552 #: ../src/guestfs-actions.pod:6713
28556 " guestfs_sfdiskM (guestfs_h *g,\n"
28557 " const char *device,\n"
28558 " char *const *lines);\n"
28563 #: ../src/guestfs-actions.pod:6725
28565 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
28566 "partition sizes are specified in megabytes only (rounded to the nearest "
28567 "cylinder) and you don't need to specify the cyls, heads and sectors "
28568 "parameters which were rarely if ever used anyway."
28572 #: ../src/guestfs-actions.pod:6731
28574 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
28575 "C<guestfs_part_disk>"
28579 #: ../src/guestfs-actions.pod:6741
28580 msgid "guestfs_sfdisk_N"
28584 #: ../src/guestfs-actions.pod:6743
28588 " guestfs_sfdisk_N (guestfs_h *g,\n"
28589 " const char *device,\n"
28594 " const char *line);\n"
28599 #: ../src/guestfs-actions.pod:6762
28601 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
28602 "for the cyls/heads/sectors parameters."
28606 #: ../src/guestfs-actions.pod:6765
28607 msgid "See also: C<guestfs_part_add>"
28611 #: ../src/guestfs-actions.pod:6774
28612 msgid "guestfs_sfdisk_disk_geometry"
28616 #: ../src/guestfs-actions.pod:6776
28620 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
28621 " const char *device);\n"
28626 #: ../src/guestfs-actions.pod:6780
28628 "This displays the disk geometry of C<device> read from the partition table. "
28629 "Especially in the case where the underlying block device has been resized, "
28630 "this can be different from the kernel's idea of the geometry (see "
28631 "C<guestfs_sfdisk_kernel_geometry>)."
28635 #: ../src/guestfs-actions.pod:6793
28636 msgid "guestfs_sfdisk_kernel_geometry"
28640 #: ../src/guestfs-actions.pod:6795
28644 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
28645 " const char *device);\n"
28650 #: ../src/guestfs-actions.pod:6809
28651 msgid "guestfs_sfdisk_l"
28655 #: ../src/guestfs-actions.pod:6811
28659 " guestfs_sfdisk_l (guestfs_h *g,\n"
28660 " const char *device);\n"
28665 #: ../src/guestfs-actions.pod:6815
28667 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
28672 #: ../src/guestfs-actions.pod:6826
28673 msgid "See also: C<guestfs_part_list>"
28677 #: ../src/guestfs-actions.pod:6833
28682 #: ../src/guestfs-actions.pod:6835
28686 " guestfs_sh (guestfs_h *g,\n"
28687 " const char *command);\n"
28692 #: ../src/guestfs-actions.pod:6842
28693 msgid "This is like C<guestfs_command>, but passes the command to:"
28697 #: ../src/guestfs-actions.pod:6850
28698 msgid "All the provisos about C<guestfs_command> apply to this call."
28702 #: ../src/guestfs-actions.pod:6857
28703 msgid "guestfs_sh_lines"
28707 #: ../src/guestfs-actions.pod:6859
28711 " guestfs_sh_lines (guestfs_h *g,\n"
28712 " const char *command);\n"
28717 #: ../src/guestfs-actions.pod:6863
28719 "This is the same as C<guestfs_sh>, but splits the result into a list of "
28724 #: ../src/guestfs-actions.pod:6866
28725 msgid "See also: C<guestfs_command_lines>"
28729 #: ../src/guestfs-actions.pod:6874
28730 msgid "guestfs_sleep"
28734 #: ../src/guestfs-actions.pod:6876
28738 " guestfs_sleep (guestfs_h *g,\n"
28744 #: ../src/guestfs-actions.pod:6884
28745 msgid "(Added in 1.0.41)"
28749 #: ../src/guestfs-actions.pod:6886 ../src/guestfs-structs.pod:109
28750 msgid "guestfs_stat"
28754 #: ../src/guestfs-actions.pod:6888
28757 " struct guestfs_stat *\n"
28758 " guestfs_stat (guestfs_h *g,\n"
28759 " const char *path);\n"
28764 #: ../src/guestfs-actions.pod:6902 ../src/guestfs-structs.pod:135
28765 msgid "guestfs_statvfs"
28769 #: ../src/guestfs-actions.pod:6904
28772 " struct guestfs_statvfs *\n"
28773 " guestfs_statvfs (guestfs_h *g,\n"
28774 " const char *path);\n"
28779 #: ../src/guestfs-actions.pod:6914
28781 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
28782 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
28786 #: ../src/guestfs-actions.pod:6920
28787 msgid "guestfs_strings"
28791 #: ../src/guestfs-actions.pod:6922
28795 " guestfs_strings (guestfs_h *g,\n"
28796 " const char *path);\n"
28801 #: ../src/guestfs-actions.pod:6938
28802 msgid "guestfs_strings_e"
28806 #: ../src/guestfs-actions.pod:6940
28810 " guestfs_strings_e (guestfs_h *g,\n"
28811 " const char *encoding,\n"
28812 " const char *path);\n"
28817 #: ../src/guestfs-actions.pod:6945
28819 "This is like the C<guestfs_strings> command, but allows you to specify the "
28820 "encoding of strings that are looked for in the source file C<path>."
28824 #: ../src/guestfs-actions.pod:6955
28826 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
28827 "ISO-8859-X (this is what C<guestfs_strings> uses)."
28831 #: ../src/guestfs-actions.pod:6993
28832 msgid "guestfs_swapoff_device"
28836 #: ../src/guestfs-actions.pod:6995
28840 " guestfs_swapoff_device (guestfs_h *g,\n"
28841 " const char *device);\n"
28846 #: ../src/guestfs-actions.pod:6999
28848 "This command disables the libguestfs appliance swap device or partition "
28849 "named C<device>. See C<guestfs_swapon_device>."
28853 #: ../src/guestfs-actions.pod:7007
28854 msgid "guestfs_swapoff_file"
28858 #: ../src/guestfs-actions.pod:7009
28862 " guestfs_swapoff_file (guestfs_h *g,\n"
28863 " const char *file);\n"
28868 #: ../src/guestfs-actions.pod:7019
28869 msgid "guestfs_swapoff_label"
28873 #: ../src/guestfs-actions.pod:7021
28877 " guestfs_swapoff_label (guestfs_h *g,\n"
28878 " const char *label);\n"
28883 #: ../src/guestfs-actions.pod:7032
28884 msgid "guestfs_swapoff_uuid"
28888 #: ../src/guestfs-actions.pod:7034
28892 " guestfs_swapoff_uuid (guestfs_h *g,\n"
28893 " const char *uuid);\n"
28898 #: ../src/guestfs-actions.pod:7045
28899 msgid "guestfs_swapon_device"
28903 #: ../src/guestfs-actions.pod:7047
28907 " guestfs_swapon_device (guestfs_h *g,\n"
28908 " const char *device);\n"
28913 #: ../src/guestfs-actions.pod:7051
28915 "This command enables the libguestfs appliance to use the swap device or "
28916 "partition named C<device>. The increased memory is made available for all "
28917 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
28921 #: ../src/guestfs-actions.pod:7067
28922 msgid "guestfs_swapon_file"
28926 #: ../src/guestfs-actions.pod:7069
28930 " guestfs_swapon_file (guestfs_h *g,\n"
28931 " const char *file);\n"
28936 #: ../src/guestfs-actions.pod:7073
28938 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
28943 #: ../src/guestfs-actions.pod:7080
28944 msgid "guestfs_swapon_label"
28948 #: ../src/guestfs-actions.pod:7082
28952 " guestfs_swapon_label (guestfs_h *g,\n"
28953 " const char *label);\n"
28958 #: ../src/guestfs-actions.pod:7086
28960 "This command enables swap to a labeled swap partition. See "
28961 "C<guestfs_swapon_device> for other notes."
28965 #: ../src/guestfs-actions.pod:7093
28966 msgid "guestfs_swapon_uuid"
28970 #: ../src/guestfs-actions.pod:7095
28974 " guestfs_swapon_uuid (guestfs_h *g,\n"
28975 " const char *uuid);\n"
28980 #: ../src/guestfs-actions.pod:7099
28982 "This command enables swap to a swap partition with the given UUID. See "
28983 "C<guestfs_swapon_device> for other notes."
28987 #: ../src/guestfs-actions.pod:7106
28988 msgid "guestfs_sync"
28992 #: ../src/guestfs-actions.pod:7108
28996 " guestfs_sync (guestfs_h *g);\n"
29001 #: ../src/guestfs-actions.pod:7121
29002 msgid "guestfs_tail"
29006 #: ../src/guestfs-actions.pod:7123
29010 " guestfs_tail (guestfs_h *g,\n"
29011 " const char *path);\n"
29016 #: ../src/guestfs-actions.pod:7139
29017 msgid "guestfs_tail_n"
29021 #: ../src/guestfs-actions.pod:7141
29025 " guestfs_tail_n (guestfs_h *g,\n"
29027 " const char *path);\n"
29032 #: ../src/guestfs-actions.pod:7163
29033 msgid "guestfs_tar_in"
29037 #: ../src/guestfs-actions.pod:7165
29041 " guestfs_tar_in (guestfs_h *g,\n"
29042 " const char *tarfile,\n"
29043 " const char *directory);\n"
29048 #: ../src/guestfs-actions.pod:7173
29049 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
29053 #: ../src/guestfs-actions.pod:7178 ../src/guestfs-actions.pod:7195 ../src/guestfs-actions.pod:7211 ../src/guestfs-actions.pod:7227
29054 msgid "(Added in 1.0.3)"
29058 #: ../src/guestfs-actions.pod:7180
29059 msgid "guestfs_tar_out"
29063 #: ../src/guestfs-actions.pod:7182
29067 " guestfs_tar_out (guestfs_h *g,\n"
29068 " const char *directory,\n"
29069 " const char *tarfile);\n"
29074 #: ../src/guestfs-actions.pod:7190
29076 "To download a compressed tarball, use C<guestfs_tgz_out> or "
29077 "C<guestfs_txz_out>."
29081 #: ../src/guestfs-actions.pod:7197
29082 msgid "guestfs_tgz_in"
29086 #: ../src/guestfs-actions.pod:7199
29090 " guestfs_tgz_in (guestfs_h *g,\n"
29091 " const char *tarball,\n"
29092 " const char *directory);\n"
29097 #: ../src/guestfs-actions.pod:7207
29098 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
29102 #: ../src/guestfs-actions.pod:7213
29103 msgid "guestfs_tgz_out"
29107 #: ../src/guestfs-actions.pod:7215
29111 " guestfs_tgz_out (guestfs_h *g,\n"
29112 " const char *directory,\n"
29113 " const char *tarball);\n"
29118 #: ../src/guestfs-actions.pod:7223
29119 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
29123 #: ../src/guestfs-actions.pod:7229
29124 msgid "guestfs_touch"
29128 #: ../src/guestfs-actions.pod:7231
29132 " guestfs_touch (guestfs_h *g,\n"
29133 " const char *path);\n"
29138 #: ../src/guestfs-actions.pod:7246
29139 msgid "guestfs_truncate"
29143 #: ../src/guestfs-actions.pod:7248
29147 " guestfs_truncate (guestfs_h *g,\n"
29148 " const char *path);\n"
29153 #: ../src/guestfs-actions.pod:7259
29154 msgid "guestfs_truncate_size"
29158 #: ../src/guestfs-actions.pod:7261
29162 " guestfs_truncate_size (guestfs_h *g,\n"
29163 " const char *path,\n"
29164 " int64_t size);\n"
29169 #: ../src/guestfs-actions.pod:7269
29171 "If the current file size is less than C<size> then the file is extended to "
29172 "the required size with zero bytes. This creates a sparse file (ie. disk "
29173 "blocks are not allocated for the file until you write to it). To create a "
29174 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
29178 #: ../src/guestfs-actions.pod:7279
29179 msgid "guestfs_tune2fs_l"
29183 #: ../src/guestfs-actions.pod:7281
29187 " guestfs_tune2fs_l (guestfs_h *g,\n"
29188 " const char *device);\n"
29193 #: ../src/guestfs-actions.pod:7301
29194 msgid "guestfs_txz_in"
29198 #: ../src/guestfs-actions.pod:7303
29202 " guestfs_txz_in (guestfs_h *g,\n"
29203 " const char *tarball,\n"
29204 " const char *directory);\n"
29209 #: ../src/guestfs-actions.pod:7315
29210 msgid "guestfs_txz_out"
29214 #: ../src/guestfs-actions.pod:7317
29218 " guestfs_txz_out (guestfs_h *g,\n"
29219 " const char *directory,\n"
29220 " const char *tarball);\n"
29225 #: ../src/guestfs-actions.pod:7329
29226 msgid "guestfs_umask"
29230 #: ../src/guestfs-actions.pod:7331
29234 " guestfs_umask (guestfs_h *g,\n"
29240 #: ../src/guestfs-actions.pod:7347
29242 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
29243 "C<guestfs_mkdir>."
29247 #: ../src/guestfs-actions.pod:7356
29248 msgid "guestfs_umount"
29252 #: ../src/guestfs-actions.pod:7358
29256 " guestfs_umount (guestfs_h *g,\n"
29257 " const char *pathordevice);\n"
29262 #: ../src/guestfs-actions.pod:7370
29263 msgid "guestfs_umount_all"
29267 #: ../src/guestfs-actions.pod:7372
29271 " guestfs_umount_all (guestfs_h *g);\n"
29276 #: ../src/guestfs-actions.pod:7383
29277 msgid "guestfs_upload"
29281 #: ../src/guestfs-actions.pod:7385
29285 " guestfs_upload (guestfs_h *g,\n"
29286 " const char *filename,\n"
29287 " const char *remotefilename);\n"
29292 #: ../src/guestfs-actions.pod:7395
29293 msgid "See also C<guestfs_download>."
29297 #: ../src/guestfs-actions.pod:7406
29298 msgid "guestfs_upload_offset"
29302 #: ../src/guestfs-actions.pod:7408
29306 " guestfs_upload_offset (guestfs_h *g,\n"
29307 " const char *filename,\n"
29308 " const char *remotefilename,\n"
29309 " int64_t offset);\n"
29314 #: ../src/guestfs-actions.pod:7424
29316 "Note that there is no limit on the amount of data that can be uploaded with "
29317 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
29318 "full amount unless an error occurs."
29322 #: ../src/guestfs-actions.pod:7429
29323 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
29327 #: ../src/guestfs-actions.pod:7440
29328 msgid "guestfs_utimens"
29332 #: ../src/guestfs-actions.pod:7442
29336 " guestfs_utimens (guestfs_h *g,\n"
29337 " const char *path,\n"
29338 " int64_t atsecs,\n"
29339 " int64_t atnsecs,\n"
29340 " int64_t mtsecs,\n"
29341 " int64_t mtnsecs);\n"
29346 #: ../src/guestfs-actions.pod:7471 ../src/guestfs-structs.pod:175
29347 msgid "guestfs_version"
29351 #: ../src/guestfs-actions.pod:7473
29354 " struct guestfs_version *\n"
29355 " guestfs_version (guestfs_h *g);\n"
29360 #: ../src/guestfs-actions.pod:7501
29362 "I<Note:> Don't use this call to test for availability of features. In "
29363 "enterprise distributions we backport features from later versions into "
29364 "earlier versions, making this an unreliable way to test for features. Use "
29365 "C<guestfs_available> instead."
29369 #: ../src/guestfs-actions.pod:7507
29371 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
29372 "error. I<The caller must call C<guestfs_free_version> after use>."
29376 #: ../src/guestfs-actions.pod:7511
29377 msgid "(Added in 1.0.58)"
29381 #: ../src/guestfs-actions.pod:7513
29382 msgid "guestfs_vfs_label"
29386 #: ../src/guestfs-actions.pod:7515
29390 " guestfs_vfs_label (guestfs_h *g,\n"
29391 " const char *device);\n"
29396 #: ../src/guestfs-actions.pod:7524
29397 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
29401 #: ../src/guestfs-actions.pod:7529 ../src/guestfs-actions.pod:7566
29402 msgid "(Added in 1.3.18)"
29406 #: ../src/guestfs-actions.pod:7531
29407 msgid "guestfs_vfs_type"
29411 #: ../src/guestfs-actions.pod:7533
29415 " guestfs_vfs_type (guestfs_h *g,\n"
29416 " const char *device);\n"
29421 #: ../src/guestfs-actions.pod:7550
29422 msgid "guestfs_vfs_uuid"
29426 #: ../src/guestfs-actions.pod:7552
29430 " guestfs_vfs_uuid (guestfs_h *g,\n"
29431 " const char *device);\n"
29436 #: ../src/guestfs-actions.pod:7561
29437 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
29441 #: ../src/guestfs-actions.pod:7568
29442 msgid "guestfs_vg_activate"
29446 #: ../src/guestfs-actions.pod:7570
29450 " guestfs_vg_activate (guestfs_h *g,\n"
29452 " char *const *volgroups);\n"
29457 #: ../src/guestfs-actions.pod:7587
29458 msgid "guestfs_vg_activate_all"
29462 #: ../src/guestfs-actions.pod:7589
29466 " guestfs_vg_activate_all (guestfs_h *g,\n"
29467 " int activate);\n"
29472 #: ../src/guestfs-actions.pod:7602
29473 msgid "guestfs_vgcreate"
29477 #: ../src/guestfs-actions.pod:7604
29481 " guestfs_vgcreate (guestfs_h *g,\n"
29482 " const char *volgroup,\n"
29483 " char *const *physvols);\n"
29488 #: ../src/guestfs-actions.pod:7616
29489 msgid "guestfs_vglvuuids"
29493 #: ../src/guestfs-actions.pod:7618
29497 " guestfs_vglvuuids (guestfs_h *g,\n"
29498 " const char *vgname);\n"
29503 #: ../src/guestfs-actions.pod:7625
29505 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
29506 "associate logical volumes and volume groups."
29510 #: ../src/guestfs-actions.pod:7628
29511 msgid "See also C<guestfs_vgpvuuids>."
29515 #: ../src/guestfs-actions.pod:7636
29516 msgid "guestfs_vgpvuuids"
29520 #: ../src/guestfs-actions.pod:7638
29524 " guestfs_vgpvuuids (guestfs_h *g,\n"
29525 " const char *vgname);\n"
29530 #: ../src/guestfs-actions.pod:7645
29532 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
29533 "associate physical volumes and volume groups."
29537 #: ../src/guestfs-actions.pod:7648
29538 msgid "See also C<guestfs_vglvuuids>."
29542 #: ../src/guestfs-actions.pod:7656
29543 msgid "guestfs_vgremove"
29547 #: ../src/guestfs-actions.pod:7658
29551 " guestfs_vgremove (guestfs_h *g,\n"
29552 " const char *vgname);\n"
29557 #: ../src/guestfs-actions.pod:7671
29558 msgid "guestfs_vgrename"
29562 #: ../src/guestfs-actions.pod:7673
29566 " guestfs_vgrename (guestfs_h *g,\n"
29567 " const char *volgroup,\n"
29568 " const char *newvolgroup);\n"
29573 #: ../src/guestfs-actions.pod:7684
29574 msgid "guestfs_vgs"
29578 #: ../src/guestfs-actions.pod:7686
29582 " guestfs_vgs (guestfs_h *g);\n"
29587 #: ../src/guestfs-actions.pod:7695
29588 msgid "See also C<guestfs_vgs_full>."
29592 #: ../src/guestfs-actions.pod:7703
29593 msgid "guestfs_vgs_full"
29597 #: ../src/guestfs-actions.pod:7705
29600 " struct guestfs_lvm_vg_list *\n"
29601 " guestfs_vgs_full (guestfs_h *g);\n"
29606 #: ../src/guestfs-actions.pod:7711
29608 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
29609 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
29614 #: ../src/guestfs-actions.pod:7717
29615 msgid "guestfs_vgscan"
29619 #: ../src/guestfs-actions.pod:7719
29623 " guestfs_vgscan (guestfs_h *g);\n"
29628 #: ../src/guestfs-actions.pod:7729
29629 msgid "guestfs_vguuid"
29633 #: ../src/guestfs-actions.pod:7731
29637 " guestfs_vguuid (guestfs_h *g,\n"
29638 " const char *vgname);\n"
29643 #: ../src/guestfs-actions.pod:7742
29644 msgid "guestfs_wait_ready"
29648 #: ../src/guestfs-actions.pod:7744
29652 " guestfs_wait_ready (guestfs_h *g);\n"
29657 #: ../src/guestfs-actions.pod:7747
29659 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
29664 #: ../src/guestfs-actions.pod:7754
29665 msgid "This function is a no op."
29669 #: ../src/guestfs-actions.pod:7756
29671 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
29672 "calling C<guestfs_launch> to wait for the launch to complete. However this "
29673 "is no longer necessary because C<guestfs_launch> now does the waiting."
29677 #: ../src/guestfs-actions.pod:7761
29679 "If you see any calls to this function in code then you can just remove them, "
29680 "unless you want to retain compatibility with older versions of the API."
29684 #: ../src/guestfs-actions.pod:7769
29685 msgid "guestfs_wc_c"
29689 #: ../src/guestfs-actions.pod:7771
29693 " guestfs_wc_c (guestfs_h *g,\n"
29694 " const char *path);\n"
29699 #: ../src/guestfs-actions.pod:7782
29700 msgid "guestfs_wc_l"
29704 #: ../src/guestfs-actions.pod:7784
29708 " guestfs_wc_l (guestfs_h *g,\n"
29709 " const char *path);\n"
29714 #: ../src/guestfs-actions.pod:7795
29715 msgid "guestfs_wc_w"
29719 #: ../src/guestfs-actions.pod:7797
29723 " guestfs_wc_w (guestfs_h *g,\n"
29724 " const char *path);\n"
29729 #: ../src/guestfs-actions.pod:7808
29730 msgid "guestfs_write"
29734 #: ../src/guestfs-actions.pod:7810
29738 " guestfs_write (guestfs_h *g,\n"
29739 " const char *path,\n"
29740 " const char *content,\n"
29741 " size_t content_size);\n"
29746 #: ../src/guestfs-actions.pod:7819
29747 msgid "See also C<guestfs_write_append>."
29751 #: ../src/guestfs-actions.pod:7828
29752 msgid "guestfs_write_append"
29756 #: ../src/guestfs-actions.pod:7830
29760 " guestfs_write_append (guestfs_h *g,\n"
29761 " const char *path,\n"
29762 " const char *content,\n"
29763 " size_t content_size);\n"
29768 #: ../src/guestfs-actions.pod:7839
29769 msgid "See also C<guestfs_write>."
29773 #: ../src/guestfs-actions.pod:7848
29774 msgid "guestfs_write_file"
29778 #: ../src/guestfs-actions.pod:7850
29782 " guestfs_write_file (guestfs_h *g,\n"
29783 " const char *path,\n"
29784 " const char *content,\n"
29790 #: ../src/guestfs-actions.pod:7856
29792 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
29797 #: ../src/guestfs-actions.pod:7881
29798 msgid "guestfs_zegrep"
29802 #: ../src/guestfs-actions.pod:7883
29806 " guestfs_zegrep (guestfs_h *g,\n"
29807 " const char *regex,\n"
29808 " const char *path);\n"
29813 #: ../src/guestfs-actions.pod:7900
29814 msgid "guestfs_zegrepi"
29818 #: ../src/guestfs-actions.pod:7902
29822 " guestfs_zegrepi (guestfs_h *g,\n"
29823 " const char *regex,\n"
29824 " const char *path);\n"
29829 #: ../src/guestfs-actions.pod:7919
29830 msgid "guestfs_zero"
29834 #: ../src/guestfs-actions.pod:7921
29838 " guestfs_zero (guestfs_h *g,\n"
29839 " const char *device);\n"
29844 #: ../src/guestfs-actions.pod:7935
29846 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
29847 "C<guestfs_is_zero_device>"
29851 #: ../src/guestfs-actions.pod:7947
29852 msgid "guestfs_zero_device"
29856 #: ../src/guestfs-actions.pod:7949
29860 " guestfs_zero_device (guestfs_h *g,\n"
29861 " const char *device);\n"
29866 #: ../src/guestfs-actions.pod:7953
29868 "This command writes zeroes over the entire C<device>. Compare with "
29869 "C<guestfs_zero> which just zeroes the first few blocks of a device."
29873 #: ../src/guestfs-actions.pod:7971
29874 msgid "(Added in 1.3.1)"
29878 #: ../src/guestfs-actions.pod:7973
29879 msgid "guestfs_zerofree"
29883 #: ../src/guestfs-actions.pod:7975
29887 " guestfs_zerofree (guestfs_h *g,\n"
29888 " const char *device);\n"
29893 #: ../src/guestfs-actions.pod:7994
29894 msgid "guestfs_zfgrep"
29898 #: ../src/guestfs-actions.pod:7996
29902 " guestfs_zfgrep (guestfs_h *g,\n"
29903 " const char *pattern,\n"
29904 " const char *path);\n"
29909 #: ../src/guestfs-actions.pod:8013
29910 msgid "guestfs_zfgrepi"
29914 #: ../src/guestfs-actions.pod:8015
29918 " guestfs_zfgrepi (guestfs_h *g,\n"
29919 " const char *pattern,\n"
29920 " const char *path);\n"
29925 #: ../src/guestfs-actions.pod:8032
29926 msgid "guestfs_zfile"
29930 #: ../src/guestfs-actions.pod:8034
29934 " guestfs_zfile (guestfs_h *g,\n"
29935 " const char *meth,\n"
29936 " const char *path);\n"
29941 #: ../src/guestfs-actions.pod:8039
29943 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
29948 #: ../src/guestfs-actions.pod:8051
29950 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
29955 #: ../src/guestfs-actions.pod:8059
29956 msgid "guestfs_zgrep"
29960 #: ../src/guestfs-actions.pod:8061
29964 " guestfs_zgrep (guestfs_h *g,\n"
29965 " const char *regex,\n"
29966 " const char *path);\n"
29971 #: ../src/guestfs-actions.pod:8078
29972 msgid "guestfs_zgrepi"
29976 #: ../src/guestfs-actions.pod:8080
29980 " guestfs_zgrepi (guestfs_h *g,\n"
29981 " const char *regex,\n"
29982 " const char *path);\n"
29987 #: ../src/guestfs-availability.pod:3
29992 #: ../src/guestfs-availability.pod:5
29994 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
29995 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
29996 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
29997 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
29998 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
30002 #: ../src/guestfs-availability.pod:21
30007 #: ../src/guestfs-availability.pod:23
30008 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
30012 #: ../src/guestfs-availability.pod:26
30017 #: ../src/guestfs-availability.pod:28
30018 msgid "The following functions: L</guestfs_grub_install>"
30022 #: ../src/guestfs-availability.pod:31
30027 #: ../src/guestfs-availability.pod:33
30029 "The following functions: L</guestfs_inotify_add_watch> "
30030 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
30031 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
30035 #: ../src/guestfs-availability.pod:41
30036 msgid "B<linuxfsuuid>"
30040 #: ../src/guestfs-availability.pod:43
30042 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
30043 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
30047 #: ../src/guestfs-availability.pod:50
30048 msgid "B<linuxmodules>"
30052 #: ../src/guestfs-availability.pod:52
30053 msgid "The following functions: L</guestfs_modprobe>"
30057 #: ../src/guestfs-availability.pod:55
30058 msgid "B<linuxxattrs>"
30062 #: ../src/guestfs-availability.pod:57
30064 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
30065 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
30066 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
30067 "L</guestfs_setxattr>"
30071 #: ../src/guestfs-availability.pod:68
30076 #: ../src/guestfs-availability.pod:70
30078 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
30079 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
30080 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
30084 #: ../src/guestfs-availability.pod:79
30089 #: ../src/guestfs-availability.pod:81
30091 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
30092 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
30093 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
30094 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
30095 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
30096 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
30097 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
30098 "L</guestfs_vgs_full>"
30102 #: ../src/guestfs-availability.pod:104
30107 #: ../src/guestfs-availability.pod:106
30109 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
30110 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
30114 #: ../src/guestfs-availability.pod:112
30119 #: ../src/guestfs-availability.pod:114
30120 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
30124 #: ../src/guestfs-availability.pod:117
30125 msgid "B<ntfsprogs>"
30129 #: ../src/guestfs-availability.pod:119
30131 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
30132 "L</guestfs_ntfsresize_size>"
30136 #: ../src/guestfs-availability.pod:124
30137 msgid "B<realpath>"
30141 #: ../src/guestfs-availability.pod:126
30142 msgid "The following functions: L</guestfs_realpath>"
30146 #: ../src/guestfs-availability.pod:129
30151 #: ../src/guestfs-availability.pod:131
30153 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
30154 "L</guestfs_scrub_freespace>"
30158 #: ../src/guestfs-availability.pod:136
30163 #: ../src/guestfs-availability.pod:138
30164 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
30168 #: ../src/guestfs-availability.pod:142
30173 #: ../src/guestfs-availability.pod:144
30174 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
30178 #: ../src/guestfs-availability.pod:148
30179 msgid "B<zerofree>"
30183 #: ../src/guestfs-availability.pod:150
30184 msgid "The following functions: L</guestfs_zerofree>"
30188 #: ../src/guestfs-structs.pod:1
30189 msgid "guestfs_int_bool"
30193 #: ../src/guestfs-structs.pod:3
30196 " struct guestfs_int_bool {\n"
30204 #: ../src/guestfs-structs.pod:8
30207 " struct guestfs_int_bool_list {\n"
30208 " uint32_t len; /* Number of elements in list. */\n"
30209 " struct guestfs_int_bool *val; /* Elements. */\n"
30215 #: ../src/guestfs-structs.pod:13
30218 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
30219 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
30224 #: ../src/guestfs-structs.pod:16
30225 msgid "guestfs_lvm_pv"
30229 #: ../src/guestfs-structs.pod:18
30232 " struct guestfs_lvm_pv {\n"
30233 " char *pv_name;\n"
30234 " /* The next field is NOT nul-terminated, be careful when printing it: "
30236 " char pv_uuid[32];\n"
30238 " uint64_t pv_size;\n"
30239 " uint64_t dev_size;\n"
30240 " uint64_t pv_free;\n"
30241 " uint64_t pv_used;\n"
30242 " char *pv_attr;\n"
30243 " int64_t pv_pe_count;\n"
30244 " int64_t pv_pe_alloc_count;\n"
30245 " char *pv_tags;\n"
30246 " uint64_t pe_start;\n"
30247 " int64_t pv_mda_count;\n"
30248 " uint64_t pv_mda_free;\n"
30254 #: ../src/guestfs-structs.pod:36
30257 " struct guestfs_lvm_pv_list {\n"
30258 " uint32_t len; /* Number of elements in list. */\n"
30259 " struct guestfs_lvm_pv *val; /* Elements. */\n"
30265 #: ../src/guestfs-structs.pod:41
30268 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
30269 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
30274 #: ../src/guestfs-structs.pod:44
30275 msgid "guestfs_lvm_vg"
30279 #: ../src/guestfs-structs.pod:46
30282 " struct guestfs_lvm_vg {\n"
30283 " char *vg_name;\n"
30284 " /* The next field is NOT nul-terminated, be careful when printing it: "
30286 " char vg_uuid[32];\n"
30288 " char *vg_attr;\n"
30289 " uint64_t vg_size;\n"
30290 " uint64_t vg_free;\n"
30291 " char *vg_sysid;\n"
30292 " uint64_t vg_extent_size;\n"
30293 " int64_t vg_extent_count;\n"
30294 " int64_t vg_free_count;\n"
30295 " int64_t max_lv;\n"
30296 " int64_t max_pv;\n"
30297 " int64_t pv_count;\n"
30298 " int64_t lv_count;\n"
30299 " int64_t snap_count;\n"
30300 " int64_t vg_seqno;\n"
30301 " char *vg_tags;\n"
30302 " int64_t vg_mda_count;\n"
30303 " uint64_t vg_mda_free;\n"
30309 #: ../src/guestfs-structs.pod:69
30312 " struct guestfs_lvm_vg_list {\n"
30313 " uint32_t len; /* Number of elements in list. */\n"
30314 " struct guestfs_lvm_vg *val; /* Elements. */\n"
30320 #: ../src/guestfs-structs.pod:74
30323 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
30324 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
30329 #: ../src/guestfs-structs.pod:77
30330 msgid "guestfs_lvm_lv"
30334 #: ../src/guestfs-structs.pod:79
30337 " struct guestfs_lvm_lv {\n"
30338 " char *lv_name;\n"
30339 " /* The next field is NOT nul-terminated, be careful when printing it: "
30341 " char lv_uuid[32];\n"
30342 " char *lv_attr;\n"
30343 " int64_t lv_major;\n"
30344 " int64_t lv_minor;\n"
30345 " int64_t lv_kernel_major;\n"
30346 " int64_t lv_kernel_minor;\n"
30347 " uint64_t lv_size;\n"
30348 " int64_t seg_count;\n"
30350 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30351 " float snap_percent;\n"
30352 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30353 " float copy_percent;\n"
30354 " char *move_pv;\n"
30355 " char *lv_tags;\n"
30356 " char *mirror_log;\n"
30357 " char *modules;\n"
30363 #: ../src/guestfs-structs.pod:101
30366 " struct guestfs_lvm_lv_list {\n"
30367 " uint32_t len; /* Number of elements in list. */\n"
30368 " struct guestfs_lvm_lv *val; /* Elements. */\n"
30374 #: ../src/guestfs-structs.pod:106
30377 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
30378 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
30383 #: ../src/guestfs-structs.pod:111
30386 " struct guestfs_stat {\n"
30390 " int64_t nlink;\n"
30395 " int64_t blksize;\n"
30396 " int64_t blocks;\n"
30397 " int64_t atime;\n"
30398 " int64_t mtime;\n"
30399 " int64_t ctime;\n"
30405 #: ../src/guestfs-structs.pod:127
30408 " struct guestfs_stat_list {\n"
30409 " uint32_t len; /* Number of elements in list. */\n"
30410 " struct guestfs_stat *val; /* Elements. */\n"
30416 #: ../src/guestfs-structs.pod:132
30419 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
30420 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
30425 #: ../src/guestfs-structs.pod:137
30428 " struct guestfs_statvfs {\n"
30429 " int64_t bsize;\n"
30430 " int64_t frsize;\n"
30431 " int64_t blocks;\n"
30432 " int64_t bfree;\n"
30433 " int64_t bavail;\n"
30434 " int64_t files;\n"
30435 " int64_t ffree;\n"
30436 " int64_t favail;\n"
30439 " int64_t namemax;\n"
30445 #: ../src/guestfs-structs.pod:151
30448 " struct guestfs_statvfs_list {\n"
30449 " uint32_t len; /* Number of elements in list. */\n"
30450 " struct guestfs_statvfs *val; /* Elements. */\n"
30456 #: ../src/guestfs-structs.pod:156
30459 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
30460 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
30465 #: ../src/guestfs-structs.pod:159
30466 msgid "guestfs_dirent"
30470 #: ../src/guestfs-structs.pod:161
30473 " struct guestfs_dirent {\n"
30482 #: ../src/guestfs-structs.pod:167
30485 " struct guestfs_dirent_list {\n"
30486 " uint32_t len; /* Number of elements in list. */\n"
30487 " struct guestfs_dirent *val; /* Elements. */\n"
30493 #: ../src/guestfs-structs.pod:172
30496 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
30497 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
30502 #: ../src/guestfs-structs.pod:177
30505 " struct guestfs_version {\n"
30506 " int64_t major;\n"
30507 " int64_t minor;\n"
30508 " int64_t release;\n"
30515 #: ../src/guestfs-structs.pod:184
30518 " struct guestfs_version_list {\n"
30519 " uint32_t len; /* Number of elements in list. */\n"
30520 " struct guestfs_version *val; /* Elements. */\n"
30526 #: ../src/guestfs-structs.pod:189
30529 " void guestfs_free_version (struct guestfs_free_version *);\n"
30530 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
30535 #: ../src/guestfs-structs.pod:192
30536 msgid "guestfs_xattr"
30540 #: ../src/guestfs-structs.pod:194
30543 " struct guestfs_xattr {\n"
30544 " char *attrname;\n"
30545 " /* The next two fields describe a byte array. */\n"
30546 " uint32_t attrval_len;\n"
30547 " char *attrval;\n"
30553 #: ../src/guestfs-structs.pod:201
30556 " struct guestfs_xattr_list {\n"
30557 " uint32_t len; /* Number of elements in list. */\n"
30558 " struct guestfs_xattr *val; /* Elements. */\n"
30564 #: ../src/guestfs-structs.pod:206
30567 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
30568 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
30573 #: ../src/guestfs-structs.pod:209
30574 msgid "guestfs_inotify_event"
30578 #: ../src/guestfs-structs.pod:211
30581 " struct guestfs_inotify_event {\n"
30582 " int64_t in_wd;\n"
30583 " uint32_t in_mask;\n"
30584 " uint32_t in_cookie;\n"
30585 " char *in_name;\n"
30591 #: ../src/guestfs-structs.pod:218
30594 " struct guestfs_inotify_event_list {\n"
30595 " uint32_t len; /* Number of elements in list. */\n"
30596 " struct guestfs_inotify_event *val; /* Elements. */\n"
30602 #: ../src/guestfs-structs.pod:223
30605 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
30606 " void guestfs_free_inotify_event_list (struct "
30607 "guestfs_free_inotify_event_list *);\n"
30612 #: ../src/guestfs-structs.pod:226
30613 msgid "guestfs_partition"
30617 #: ../src/guestfs-structs.pod:228
30620 " struct guestfs_partition {\n"
30621 " int32_t part_num;\n"
30622 " uint64_t part_start;\n"
30623 " uint64_t part_end;\n"
30624 " uint64_t part_size;\n"
30630 #: ../src/guestfs-structs.pod:235
30633 " struct guestfs_partition_list {\n"
30634 " uint32_t len; /* Number of elements in list. */\n"
30635 " struct guestfs_partition *val; /* Elements. */\n"
30641 #: ../src/guestfs-structs.pod:240
30644 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
30645 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
30650 #: ../src/guestfs-structs.pod:243
30651 msgid "guestfs_application"
30655 #: ../src/guestfs-structs.pod:245
30658 " struct guestfs_application {\n"
30659 " char *app_name;\n"
30660 " char *app_display_name;\n"
30661 " int32_t app_epoch;\n"
30662 " char *app_version;\n"
30663 " char *app_release;\n"
30664 " char *app_install_path;\n"
30665 " char *app_trans_path;\n"
30666 " char *app_publisher;\n"
30667 " char *app_url;\n"
30668 " char *app_source_package;\n"
30669 " char *app_summary;\n"
30670 " char *app_description;\n"
30676 #: ../src/guestfs-structs.pod:260
30679 " struct guestfs_application_list {\n"
30680 " uint32_t len; /* Number of elements in list. */\n"
30681 " struct guestfs_application *val; /* Elements. */\n"
30687 #: ../src/guestfs-structs.pod:265
30690 " void guestfs_free_application (struct guestfs_free_application *);\n"
30691 " void guestfs_free_application_list (struct guestfs_free_application_list "
30697 #: ../src/guestfs.pod:5
30698 msgid "guestfs - Library for accessing and modifying virtual machine images"
30702 #: ../src/guestfs.pod:11
30705 " guestfs_h *g = guestfs_create ();\n"
30706 " guestfs_add_drive (g, \"guest.img\");\n"
30707 " guestfs_launch (g);\n"
30708 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30709 " guestfs_touch (g, \"/hello\");\n"
30710 " guestfs_umount (g, \"/\");\n"
30711 " guestfs_close (g);\n"
30716 #: ../src/guestfs.pod:25
30718 "Libguestfs is a library for accessing and modifying guest disk images. "
30719 "Amongst the things this is good for: making batch configuration changes to "
30720 "guests, getting disk used/free statistics (see also: virt-df), migrating "
30721 "between virtualization systems (see also: virt-p2v), performing partial "
30722 "backups, performing partial guest clones, cloning guests and changing "
30723 "registry/UUID/hostname info, and much else besides."
30727 #: ../src/guestfs.pod:33
30729 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
30730 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
30731 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
30736 #: ../src/guestfs.pod:38
30738 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
30739 "what filesystem is in each LV, etc.). It can also run commands in the "
30740 "context of the guest. Also you can access filesystems over FUSE."
30744 #: ../src/guestfs.pod:43
30746 "Libguestfs is a library that can be linked with C and C++ management "
30747 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
30748 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
30753 #: ../src/guestfs.pod:48
30755 "You don't need to be root to use libguestfs, although obviously you do need "
30756 "enough permissions to access the disk images."
30760 #: ../src/guestfs.pod:51
30762 "Libguestfs is a large API because it can do many things. For a gentle "
30763 "introduction, please read the L</API OVERVIEW> section next."
30767 #: ../src/guestfs.pod:54
30769 "There are also some example programs in the L<guestfs-examples(3)> manual "
30774 #: ../src/guestfs.pod:57
30775 msgid "API OVERVIEW"
30779 #: ../src/guestfs.pod:59
30781 "This section provides a gentler overview of the libguestfs API. We also try "
30782 "to group API calls together, where that may not be obvious from reading "
30783 "about the individual calls in the main section of this manual."
30787 #: ../src/guestfs.pod:64
30792 #: ../src/guestfs.pod:66
30794 "Before you can use libguestfs calls, you have to create a handle. Then you "
30795 "must add at least one disk image to the handle, followed by launching the "
30796 "handle, then performing whatever operations you want, and finally closing "
30797 "the handle. By convention we use the single letter C<g> for the name of the "
30798 "handle variable, although of course you can use any name you want."
30802 #: ../src/guestfs.pod:73
30803 msgid "The general structure of all libguestfs-using programs looks like this:"
30807 #: ../src/guestfs.pod:76
30810 " guestfs_h *g = guestfs_create ();\n"
30815 #: ../src/guestfs.pod:78
30818 " /* Call guestfs_add_drive additional times if there are\n"
30819 " * multiple disk images.\n"
30821 " guestfs_add_drive (g, \"guest.img\");\n"
30826 #: ../src/guestfs.pod:83
30829 " /* Most manipulation calls won't work until you've launched\n"
30830 " * the handle 'g'. You have to do this _after_ adding drives\n"
30831 " * and _before_ other commands.\n"
30833 " guestfs_launch (g);\n"
30838 #: ../src/guestfs.pod:89
30841 " /* Now you can examine what partitions, LVs etc are available.\n"
30843 " char **partitions = guestfs_list_partitions (g);\n"
30844 " char **logvols = guestfs_lvs (g);\n"
30849 #: ../src/guestfs.pod:94
30852 " /* To access a filesystem in the image, you must mount it.\n"
30854 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30859 #: ../src/guestfs.pod:98
30862 " /* Now you can perform filesystem actions on the guest\n"
30865 " guestfs_touch (g, \"/hello\");\n"
30870 #: ../src/guestfs.pod:103
30873 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
30874 " * it is done automatically when you close the handle. See\n"
30875 " * discussion of autosync in this page.\n"
30877 " guestfs_sync (g);\n"
30882 #: ../src/guestfs.pod:109
30885 " /* Close the handle 'g'. */\n"
30886 " guestfs_close (g);\n"
30891 #: ../src/guestfs.pod:112
30893 "The code above doesn't include any error checking. In real code you should "
30894 "check return values carefully for errors. In general all functions that "
30895 "return integers return C<-1> on error, and all functions that return "
30896 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
30897 "how to handle errors, and consult the documentation for each function call "
30898 "below to see precisely how they return error indications. See "
30899 "L<guestfs-examples(3)> for fully worked examples."
30903 #: ../src/guestfs.pod:121
30904 msgid "DISK IMAGES"
30908 #: ../src/guestfs.pod:123
30910 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
30911 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
30912 "actual block device, or simply an empty file of zeroes that you have created "
30913 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
30918 #: ../src/guestfs.pod:129
30920 "The call you should use in modern code for adding drives is "
30921 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
30922 "specifying that the format is raw, do:"
30926 #: ../src/guestfs.pod:133
30929 " guestfs_add_drive_opts (g, filename,\n"
30930 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30936 #: ../src/guestfs.pod:137
30937 msgid "You can add a disk read-only using:"
30941 #: ../src/guestfs.pod:139
30944 " guestfs_add_drive_opts (g, filename,\n"
30945 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30946 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
30952 #: ../src/guestfs.pod:144
30954 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
30955 "libguestfs won't modify the file."
30959 #: ../src/guestfs.pod:147
30961 "Be extremely cautious if the disk image is in use, eg. if it is being used "
30962 "by a virtual machine. Adding it read-write will almost certainly cause disk "
30963 "corruption, but adding it read-only is safe."
30967 #: ../src/guestfs.pod:151
30969 "You must add at least one disk image, and you may add multiple disk images. "
30970 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
30971 "first one you added), C</dev/sdb> (for the second one you added), etc."
30975 #: ../src/guestfs.pod:156
30977 "Once L</guestfs_launch> has been called you cannot add any more images. You "
30978 "can call L</guestfs_list_devices> to get a list of the device names, in the "
30979 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
30983 #: ../src/guestfs.pod:161
30988 #: ../src/guestfs.pod:163
30990 "Before you can read or write files, create directories and so on in a disk "
30991 "image that contains filesystems, you have to mount those filesystems using "
30992 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
30993 "a disk image contains (for example) one partition with a filesystem on that "
30994 "partition, then you can mount it directly:"
30998 #: ../src/guestfs.pod:170
31001 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
31006 #: ../src/guestfs.pod:172
31008 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
31009 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
31010 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
31011 "that these are libguestfs virtual devices, and are nothing to do with host "
31016 #: ../src/guestfs.pod:178
31018 "If you are given a disk image and you don't know what it contains then you "
31019 "have to find out. Libguestfs can do that too: use "
31020 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
31021 "and LVs, and either try mounting each to see what is mountable, or else "
31022 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
31023 "filesystems, use L</guestfs_list_filesystems>."
31027 #: ../src/guestfs.pod:186
31029 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
31030 "L</INSPECTION> below). But you might find it easier to look at higher level "
31031 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
31035 #: ../src/guestfs.pod:191
31037 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
31038 "several other variations of the C<guestfs_mount_*> call."
31042 #: ../src/guestfs.pod:194
31043 msgid "FILESYSTEM ACCESS AND MODIFICATION"
31047 #: ../src/guestfs.pod:196
31049 "The majority of the libguestfs API consists of fairly low-level calls for "
31050 "accessing and modifying the files, directories, symlinks etc on mounted "
31051 "filesystems. There are over a hundred such calls which you can find listed "
31052 "in detail below in this man page, and we don't even pretend to cover them "
31053 "all in this overview."
31057 #: ../src/guestfs.pod:202
31059 "Specify filenames as full paths, starting with C<\"/\"> and including the "
31064 #: ../src/guestfs.pod:205
31066 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
31067 "the file called C<\"etc/passwd\"> then you could do:"
31071 #: ../src/guestfs.pod:208
31074 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
31079 #: ../src/guestfs.pod:210
31081 "This would return C<data> as a newly allocated buffer containing the full "
31082 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
31083 "or C<NULL> if there was an error."
31087 #: ../src/guestfs.pod:214
31089 "As another example, to create a top-level directory on that filesystem "
31090 "called C<\"var\"> you would do:"
31094 #: ../src/guestfs.pod:217
31097 " guestfs_mkdir (g, \"/var\");\n"
31102 #: ../src/guestfs.pod:219
31103 msgid "To create a symlink you could do:"
31107 #: ../src/guestfs.pod:221
31110 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
31111 " \"/etc/rc3.d/S30portmap\");\n"
31116 #: ../src/guestfs.pod:224
31118 "Libguestfs will reject attempts to use relative paths and there is no "
31119 "concept of a current working directory."
31123 #: ../src/guestfs.pod:227
31125 "Libguestfs can return errors in many situations: for example if the "
31126 "filesystem isn't writable, or if a file or directory that you requested "
31127 "doesn't exist. If you are using the C API (documented here) you have to "
31128 "check for those error conditions after each call. (Other language bindings "
31129 "turn these errors into exceptions)."
31133 #: ../src/guestfs.pod:233
31135 "File writes are affected by the per-handle umask, set by calling "
31136 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
31140 #: ../src/guestfs.pod:236
31141 msgid "PARTITIONING"
31145 #: ../src/guestfs.pod:238
31147 "Libguestfs contains API calls to read, create and modify partition tables on "
31152 #: ../src/guestfs.pod:241
31154 "In the common case where you want to create a single partition covering the "
31155 "whole disk, you should use the L</guestfs_part_disk> call:"
31159 #: ../src/guestfs.pod:245
31162 " const char *parttype = \"mbr\";\n"
31163 " if (disk_is_larger_than_2TB)\n"
31164 " parttype = \"gpt\";\n"
31165 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
31170 #: ../src/guestfs.pod:250
31172 "Obviously this effectively wipes anything that was on that disk image "
31177 #: ../src/guestfs.pod:253
31182 #: ../src/guestfs.pod:255
31184 "Libguestfs provides access to a large part of the LVM2 API, such as "
31185 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
31186 "unless you familiarize yourself with the concepts of physical volumes, "
31187 "volume groups and logical volumes."
31191 #: ../src/guestfs.pod:260
31193 "This author strongly recommends reading the LVM HOWTO, online at "
31194 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
31198 #: ../src/guestfs.pod:263
31199 msgid "DOWNLOADING"
31203 #: ../src/guestfs.pod:265
31205 "Use L</guestfs_cat> to download small, text only files. This call is "
31206 "limited to files which are less than 2 MB and which cannot contain any ASCII "
31207 "NUL (C<\\0>) characters. However the API is very simple to use."
31211 #: ../src/guestfs.pod:269
31213 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
31214 "bit data, since it returns a (pointer, size) pair. However it is still "
31215 "limited to \"small\" files, less than 2 MB."
31219 #: ../src/guestfs.pod:273
31221 "L</guestfs_download> can be used to download any file, with no limits on "
31222 "content or size (even files larger than 4 GB)."
31226 #: ../src/guestfs.pod:276
31227 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
31231 #: ../src/guestfs.pod:279
31236 #: ../src/guestfs.pod:281
31238 "It's often the case that you want to write a file or files to the disk "
31243 #: ../src/guestfs.pod:284
31245 "To write a small file with fixed content, use L</guestfs_write>. To create "
31246 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
31247 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
31248 "variety of other functions for creating test files, for example "
31249 "L</guestfs_fill> and L</guestfs_fill_pattern>."
31253 #: ../src/guestfs.pod:290
31255 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
31256 "file content or size (even files larger than 4 GB)."
31260 #: ../src/guestfs.pod:293
31261 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
31265 #: ../src/guestfs.pod:295
31267 "However the fastest way to upload I<large numbers of arbitrary files> is to "
31268 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
31269 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
31270 "the drive in a predictable way (eg. adding it last after all other drives) "
31271 "then you can get the device name from L</guestfs_list_devices> and mount it "
31272 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
31273 "sometimes non-portable between kernel versions, and they don't support "
31274 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
31275 "using a label or UUID, use an ISO image instead."
31279 #: ../src/guestfs.pod:306
31284 #: ../src/guestfs.pod:308
31286 "There are various different commands for copying between files and devices "
31287 "and in and out of the guest filesystem. These are summarised in the table "
31292 #: ../src/guestfs.pod:314
31293 msgid "B<file> to B<file>"
31297 #: ../src/guestfs.pod:316
31299 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
31300 "directories recursively."
31304 #: ../src/guestfs.pod:319
31305 msgid "B<file or device> to B<file or device>"
31309 #: ../src/guestfs.pod:321
31311 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
31312 "devices in the guest."
31316 #: ../src/guestfs.pod:324
31317 msgid "Example: duplicate the contents of an LV:"
31321 #: ../src/guestfs.pod:326
31324 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
31329 #: ../src/guestfs.pod:328
31331 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
31332 "(C</dev/VG/Original>). To copy less than the whole source device, use "
31333 "L</guestfs_copy_size>."
31337 #: ../src/guestfs.pod:332
31338 msgid "B<file on the host> to B<file or device>"
31342 #: ../src/guestfs.pod:334
31343 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
31347 #: ../src/guestfs.pod:336
31348 msgid "B<file or device> to B<file on the host>"
31352 #: ../src/guestfs.pod:338
31353 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
31357 #: ../src/guestfs.pod:342
31358 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
31362 #: ../src/guestfs.pod:344
31364 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
31365 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
31366 "appears you can only upload and download to files. However many Un*x-like "
31367 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
31368 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
31369 "stderr, and arbitrary file descriptor N."
31373 #: ../src/guestfs.pod:352
31374 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
31378 #: ../src/guestfs.pod:355
31381 " guestfs_download (g, filename, \"/dev/stdout\");\n"
31386 #: ../src/guestfs.pod:357
31387 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
31391 #: ../src/guestfs.pod:359
31394 " char devfd[64];\n"
31395 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
31396 " guestfs_tar_out (g, \"/\", devfd);\n"
31401 #: ../src/guestfs.pod:363
31402 msgid "LISTING FILES"
31406 #: ../src/guestfs.pod:365
31408 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
31409 "L<guestfish(1)>-equivalent command C<ll>)."
31413 #: ../src/guestfs.pod:368
31415 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
31416 "programs, as a flat list of strings."
31420 #: ../src/guestfs.pod:371
31422 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
31423 "directory, plus additional information about each one. It is more "
31424 "equivalent to using the L<readdir(3)> call on a local filesystem."
31428 #: ../src/guestfs.pod:375
31430 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
31435 #: ../src/guestfs.pod:378
31436 msgid "RUNNING COMMANDS"
31440 #: ../src/guestfs.pod:380
31442 "Although libguestfs is primarily an API for manipulating files inside guest "
31443 "images, we also provide some limited facilities for running commands inside "
31448 #: ../src/guestfs.pod:384
31449 msgid "There are many limitations to this:"
31453 #: ../src/guestfs.pod:390
31455 "The kernel version that the command runs under will be different from what "
31460 #: ../src/guestfs.pod:395
31462 "If the command needs to communicate with daemons, then most likely they "
31463 "won't be running."
31467 #: ../src/guestfs.pod:400
31468 msgid "The command will be running in limited memory."
31472 #: ../src/guestfs.pod:404
31474 "The network may not be available unless you enable it (see "
31475 "L</guestfs_set_network>)."
31479 #: ../src/guestfs.pod:409
31480 msgid "Only supports Linux guests (not Windows, BSD, etc)."
31484 #: ../src/guestfs.pod:413
31485 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
31489 #: ../src/guestfs.pod:418
31491 "For SELinux guests, you may need to enable SELinux and load policy first. "
31492 "See L</SELINUX> in this manpage."
31496 #: ../src/guestfs.pod:423
31498 "I<Security:> It is not safe to run commands from untrusted, possibly "
31499 "malicious guests. These commands may attempt to exploit your program by "
31500 "sending unexpected output. They could also try to exploit the Linux kernel "
31501 "or qemu provided by the libguestfs appliance. They could use the network "
31502 "provided by the libguestfs appliance to bypass ordinary network partitions "
31503 "and firewalls. They could use the elevated privileges or different SELinux "
31504 "context of your program to their advantage."
31508 #: ../src/guestfs.pod:432
31510 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
31511 "(a script which runs when the guest next boots normally), and to have this "
31512 "script run the commands you want in the normal context of the running guest, "
31513 "network security and so on. For information about other security issues, "
31514 "see L</SECURITY>."
31518 #: ../src/guestfs.pod:440
31520 "The two main API calls to run commands are L</guestfs_command> and "
31521 "L</guestfs_sh> (there are also variations)."
31525 #: ../src/guestfs.pod:443
31527 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
31528 "shell globs, redirections, etc will work."
31532 #: ../src/guestfs.pod:446
31533 msgid "CONFIGURATION FILES"
31537 #: ../src/guestfs.pod:448
31539 "To read and write configuration files in Linux guest filesystems, we "
31540 "strongly recommend using Augeas. For example, Augeas understands how to "
31541 "read and write, say, a Linux shadow password file or X.org configuration "
31542 "file, and so avoids you having to write that code."
31546 #: ../src/guestfs.pod:453
31548 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
31549 "document Augeas itself here because there is excellent documentation on the "
31550 "L<http://augeas.net/> website."
31554 #: ../src/guestfs.pod:457
31556 "If you don't want to use Augeas (you fool!) then try calling "
31557 "L</guestfs_read_lines> to get the file as a list of lines which you can "
31562 #: ../src/guestfs.pod:461
31567 #: ../src/guestfs.pod:463
31569 "We support SELinux guests. To ensure that labeling happens correctly in "
31570 "SELinux guests, you need to enable SELinux and load the guest's policy:"
31574 #: ../src/guestfs.pod:471
31575 msgid "Before launching, do:"
31579 #: ../src/guestfs.pod:473
31582 " guestfs_set_selinux (g, 1);\n"
31587 #: ../src/guestfs.pod:477
31589 "After mounting the guest's filesystem(s), load the policy. This is best "
31590 "done by running the L<load_policy(8)> command in the guest itself:"
31594 #: ../src/guestfs.pod:481
31597 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
31602 #: ../src/guestfs.pod:483
31604 "(Older versions of C<load_policy> require you to specify the name of the "
31609 #: ../src/guestfs.pod:488
31611 "Optionally, set the security context for the API. The correct security "
31612 "context to use can only be known by inspecting the guest. As an example:"
31616 #: ../src/guestfs.pod:492
31619 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
31624 #: ../src/guestfs.pod:496
31625 msgid "This will work for running commands and editing existing files."
31629 #: ../src/guestfs.pod:498
31631 "When new files are created, you may need to label them explicitly, for "
31632 "example by running the external command C<restorecon pathname>."
31636 #: ../src/guestfs.pod:502
31641 #: ../src/guestfs.pod:504
31643 "Certain calls are affected by the current file mode creation mask (the "
31644 "\"umask\"). In particular ones which create files or directories, such as "
31645 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
31646 "either the default mode that the file is created with or modifies the mode "
31651 #: ../src/guestfs.pod:510
31653 "The default umask is C<022>, so files are created with modes such as C<0644> "
31654 "and directories with C<0755>."
31658 #: ../src/guestfs.pod:513
31660 "There are two ways to avoid being affected by umask. Either set umask to 0 "
31661 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
31662 "L</guestfs_chmod> after creating each file or directory."
31666 #: ../src/guestfs.pod:517
31667 msgid "For more information about umask, see L<umask(2)>."
31671 #: ../src/guestfs.pod:521
31673 "Libguestfs allows you to access Linux guests which have been encrypted using "
31674 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
31675 "standard. This includes nearly all whole disk encryption systems used by "
31676 "modern Linux guests."
31680 #: ../src/guestfs.pod:527
31682 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
31683 "returns the string C<crypto_LUKS>)."
31687 #: ../src/guestfs.pod:530
31689 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
31690 "will require the passphrase!"
31694 #: ../src/guestfs.pod:533
31696 "Opening a LUKS device creates a new device mapper device called "
31697 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
31698 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
31699 "decrypted from and encrypted to the underlying block device respectively."
31703 #: ../src/guestfs.pod:539
31705 "LVM volume groups on the device can be made visible by calling "
31706 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
31707 "volume(s) can now be mounted in the usual way."
31711 #: ../src/guestfs.pod:543
31713 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
31714 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
31715 "[\"/dev/VG\"])>. Then close the mapper device by calling "
31716 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
31717 "underlying encrypted block device)."
31721 #: ../src/guestfs.pod:550
31726 #: ../src/guestfs.pod:552
31728 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
31729 "contains operating systems, an install CD or a live CD. (These APIs used to "
31730 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
31731 "version 1.5.3 the most frequently used part of this library has been "
31732 "rewritten in C and moved into the core code)."
31736 #: ../src/guestfs.pod:559
31738 "Add all disks belonging to the unknown virtual machine and call "
31739 "L</guestfs_launch> in the usual way."
31743 #: ../src/guestfs.pod:562
31745 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
31746 "and certain heuristics, and returns a list of operating systems that were "
31747 "found. An empty list means none were found. A single element is the root "
31748 "filesystem of the operating system. For dual- or multi-boot guests, "
31749 "multiple roots can be returned, each one corresponding to a separate "
31750 "operating system. (Multi-boot virtual machines are extremely rare in the "
31751 "world of virtualization, but since this scenario can happen, we have built "
31752 "libguestfs to deal with it.)"
31756 #: ../src/guestfs.pod:571
31758 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
31759 "to get additional details about that operating system. For example, call "
31760 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
31761 "Windows and Linux-based operating systems respectively."
31765 #: ../src/guestfs.pod:577
31767 "Un*x-like and Linux-based operating systems usually consist of several "
31768 "filesystems which are mounted at boot time (for example, a separate boot "
31769 "partition mounted on C</boot>). The inspection rules are able to detect how "
31770 "filesystems correspond to mount points. Call "
31771 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
31772 "hash table like this example:"
31776 #: ../src/guestfs.pod:584
31779 " /boot => /dev/sda1\n"
31780 " / => /dev/vg_guest/lv_root\n"
31781 " /usr => /dev/vg_guest/lv_usr\n"
31786 #: ../src/guestfs.pod:588
31788 "The caller can then make calls to L</guestfs_mount_options> to mount the "
31789 "filesystems as suggested."
31793 #: ../src/guestfs.pod:591
31795 "Be careful to mount filesystems in the right order (eg. C</> before "
31796 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
31801 #: ../src/guestfs.pod:595
31803 "Inspection currently only works for some common operating systems. "
31804 "Contributors are welcome to send patches for other operating systems that we "
31805 "currently cannot detect."
31809 #: ../src/guestfs.pod:599
31811 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
31812 "for more details. The L</guestfs_inspect_os> function just ignores any "
31813 "encrypted devices."
31817 #: ../src/guestfs.pod:603
31819 "A note on the implementation: The call L</guestfs_inspect_os> performs "
31820 "inspection and caches the results in the guest handle. Subsequent calls to "
31821 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
31822 "re-read the disks. If you change the content of the guest disks, you can "
31823 "redo inspection by calling L</guestfs_inspect_os> again. "
31824 "(L</guestfs_inspect_list_applications> works a little differently from the "
31825 "other calls and does read the disks. See documentation for that function "
31830 #: ../src/guestfs.pod:612
31831 msgid "INSPECTING INSTALL DISKS"
31835 #: ../src/guestfs.pod:614
31837 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
31842 #: ../src/guestfs.pod:617
31844 "Call L</guestfs_inspect_get_format> to return the format of the operating "
31845 "system, which currently can be C<installed> (a regular operating system) or "
31846 "C<installer> (some sort of install disk)."
31850 #: ../src/guestfs.pod:621
31852 "Further information is available about the operating system that can be "
31853 "installed using the regular inspection APIs like "
31854 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
31859 #: ../src/guestfs.pod:626
31861 "Some additional information specific to installer disks is also available "
31862 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
31863 "L</guestfs_inspect_is_multipart> calls."
31867 #: ../src/guestfs.pod:631
31868 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
31872 #: ../src/guestfs.pod:633
31874 "Libguestfs can mount NTFS partitions. It does this using the "
31875 "L<http://www.ntfs-3g.org/> driver."
31879 #: ../src/guestfs.pod:636
31880 msgid "DRIVE LETTERS AND PATHS"
31884 #: ../src/guestfs.pod:638
31886 "DOS and Windows still use drive letters, and the filesystems are always "
31887 "treated as case insensitive by Windows itself, and therefore you might find "
31888 "a Windows configuration file referring to a path like "
31889 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
31890 "that directory might be referred to as C</WINDOWS/System32>."
31894 #: ../src/guestfs.pod:644
31896 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
31897 "L</guestfs_inspect_get_drive_mappings>)"
31901 #: ../src/guestfs.pod:647
31903 "Dealing with separator characters (backslash vs forward slash) is outside "
31904 "the scope of libguestfs, but usually a simple character replacement will "
31909 #: ../src/guestfs.pod:651
31911 "To resolve the case insensitivity of paths, call "
31912 "L</guestfs_case_sensitive_path>."
31916 #: ../src/guestfs.pod:654
31917 msgid "ACCESSING THE WINDOWS REGISTRY"
31921 #: ../src/guestfs.pod:656
31923 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
31924 "files, through the library C<hivex> which is part of the libguestfs project "
31925 "although ships as a separate tarball. You have to locate and download the "
31926 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
31927 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
31928 "L<virt-win-reg(1)> for more help on this issue."
31932 #: ../src/guestfs.pod:664
31933 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
31937 #: ../src/guestfs.pod:666
31939 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
31940 "provide something which looks like a Linux symlink. The way it tries to do "
31941 "the rewriting is described here:"
31945 #: ../src/guestfs.pod:670
31946 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
31950 #: ../src/guestfs.pod:672
31952 "The essential problem is that ntfs-3g simply does not have enough "
31953 "information to do a correct job. NTFS links can contain drive letters and "
31954 "references to external device GUIDs that ntfs-3g has no way of resolving. "
31955 "It is almost certainly the case that libguestfs callers should ignore what "
31956 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
31960 #: ../src/guestfs.pod:679
31962 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
31963 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
31964 "attribute, and read the raw reparse data from that (you can find the format "
31965 "documented in various places around the web)."
31969 #: ../src/guestfs.pod:684
31970 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
31974 #: ../src/guestfs.pod:686
31976 "There are other useful extended attributes that can be read from ntfs-3g "
31977 "filesystems (using L</guestfs_getxattr>). See:"
31981 #: ../src/guestfs.pod:689
31982 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
31986 #: ../src/guestfs.pod:691
31987 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
31991 #: ../src/guestfs.pod:693
31993 "Although we don't want to discourage you from using the C API, we will "
31994 "mention here that the same API is also available in other languages."
31998 #: ../src/guestfs.pod:696
32000 "The API is broadly identical in all supported languages. This means that "
32001 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
32002 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
32003 "OCaml. In other words, a straightforward, predictable isomorphism between "
32008 #: ../src/guestfs.pod:702
32010 "Error messages are automatically transformed into exceptions if the language "
32015 #: ../src/guestfs.pod:705
32017 "We don't try to \"object orientify\" parts of the API in OO languages, "
32018 "although contributors are welcome to write higher level APIs above what we "
32019 "provide in their favourite languages if they wish."
32023 #: ../src/guestfs.pod:711
32028 #: ../src/guestfs.pod:713
32030 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
32031 "identical to the C API. C++ classes and exceptions are not used."
32035 #: ../src/guestfs.pod:717
32040 #: ../src/guestfs.pod:719
32042 "The C# bindings are highly experimental. Please read the warnings at the "
32043 "top of C<csharp/Libguestfs.cs>."
32047 #: ../src/guestfs.pod:722
32052 #: ../src/guestfs.pod:724
32053 msgid "See L<guestfs-erlang(3)>."
32057 #: ../src/guestfs.pod:726
32062 #: ../src/guestfs.pod:728
32064 "This is the only language binding that is working but incomplete. Only "
32065 "calls which return simple integers have been bound in Haskell, and we are "
32066 "looking for help to complete this binding."
32070 #: ../src/guestfs.pod:732
32075 #: ../src/guestfs.pod:734
32077 "Full documentation is contained in the Javadoc which is distributed with "
32078 "libguestfs. For examples, see L<guestfs-java(3)>."
32082 #: ../src/guestfs.pod:737
32087 #: ../src/guestfs.pod:739
32088 msgid "See L<guestfs-ocaml(3)>."
32092 #: ../src/guestfs.pod:741
32097 #: ../src/guestfs.pod:743
32098 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
32102 #: ../src/guestfs.pod:745
32107 #: ../src/guestfs.pod:747
32109 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
32110 "the php-libguestfs package for your distribution."
32114 #: ../src/guestfs.pod:750
32115 msgid "The PHP binding only works correctly on 64 bit machines."
32119 #: ../src/guestfs.pod:752
32124 #: ../src/guestfs.pod:754
32125 msgid "See L<guestfs-python(3)>."
32129 #: ../src/guestfs.pod:756
32134 #: ../src/guestfs.pod:758
32135 msgid "See L<guestfs-ruby(3)>."
32139 #: ../src/guestfs.pod:760
32140 msgid "B<shell scripts>"
32144 #: ../src/guestfs.pod:762
32145 msgid "See L<guestfish(1)>."
32149 #: ../src/guestfs.pod:766
32150 msgid "LIBGUESTFS GOTCHAS"
32154 #: ../src/guestfs.pod:768
32156 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
32157 "system [...] that works in the way it is documented but is counterintuitive "
32158 "and almost invites mistakes.\""
32162 #: ../src/guestfs.pod:772
32164 "Since we developed libguestfs and the associated tools, there are several "
32165 "things we would have designed differently, but are now stuck with for "
32166 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
32167 "release, you can expect these to change. Beware of them."
32171 #: ../src/guestfs.pod:780
32172 msgid "Autosync / forgetting to sync."
32176 #: ../src/guestfs.pod:782
32178 "I<Update:> Autosync is enabled by default for all API users starting from "
32179 "libguestfs 1.5.24. This section only applies to older versions."
32183 #: ../src/guestfs.pod:785
32185 "When modifying a filesystem from C or another language, you B<must> unmount "
32186 "all filesystems and call L</guestfs_sync> explicitly before you close the "
32187 "libguestfs handle. You can also call:"
32191 #: ../src/guestfs.pod:789
32194 " guestfs_set_autosync (g, 1);\n"
32199 #: ../src/guestfs.pod:791
32201 "to have the unmount/sync done automatically for you when the handle 'g' is "
32202 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
32207 #: ../src/guestfs.pod:795
32209 "If you forget to do this, then it is entirely possible that your changes "
32210 "won't be written out, or will be partially written, or (very rarely) that "
32211 "you'll get disk corruption."
32215 #: ../src/guestfs.pod:799
32217 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
32218 "guestfish scripts that forget to sync will work just fine, which can make "
32219 "this very puzzling if you are trying to debug a problem."
32223 #: ../src/guestfs.pod:803
32224 msgid "Mount option C<-o sync> should not be the default."
32228 #: ../src/guestfs.pod:805
32230 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
32231 "However C<-o sync> does not add any reliability benefit, but does have a "
32232 "very large performance impact."
32236 #: ../src/guestfs.pod:809
32238 "The work around is to use L</guestfs_mount_options> and set the mount "
32239 "options that you actually want to use."
32243 #: ../src/guestfs.pod:812
32244 msgid "Read-only should be the default."
32248 #: ../src/guestfs.pod:814
32250 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
32251 "specify I<--rw> if you want to make changes to the image."
32255 #: ../src/guestfs.pod:817
32256 msgid "This would reduce the potential to corrupt live VM images."
32260 #: ../src/guestfs.pod:819
32262 "Note that many filesystems change the disk when you just mount and unmount, "
32263 "even if you didn't perform any writes. You need to use "
32264 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
32268 #: ../src/guestfs.pod:823
32269 msgid "guestfish command line is hard to use."
32273 #: ../src/guestfs.pod:825
32275 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
32276 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
32277 "exist, so it fails. In earlier versions of guestfish the error message was "
32278 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
32279 "we should have used C<guestfish -c command> to run commands."
32283 #: ../src/guestfs.pod:832
32284 msgid "guestfish megabyte modifiers don't work right on all commands"
32288 #: ../src/guestfs.pod:834
32290 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
32291 "other modifiers). What guestfish actually does is to multiply the number "
32292 "part by the modifier part and pass the result to the C API. However this "
32293 "doesn't work for a few APIs which aren't expecting bytes, but are already "
32294 "expecting some other unit (eg. megabytes)."
32298 #: ../src/guestfs.pod:841
32299 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
32303 #: ../src/guestfs.pod:843
32306 " lvcreate LV VG 100M\n"
32311 #: ../src/guestfs.pod:845
32313 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
32314 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
32315 "megabytes * megabytes) logical volume. The error message you get from this "
32316 "is also a little obscure."
32320 #: ../src/guestfs.pod:850
32322 "This could be fixed in the generator by specially marking parameters and "
32323 "return values which take bytes or other units."
32327 #: ../src/guestfs.pod:853
32328 msgid "Ambiguity between devices and paths"
32332 #: ../src/guestfs.pod:855
32334 "There is a subtle ambiguity in the API between a device name "
32335 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
32336 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
32340 #: ../src/guestfs.pod:860
32342 "In the current API we usually resolve this ambiguity by having two separate "
32343 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
32344 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
32345 "detecting if the path supplied begins with C</dev/>."
32349 #: ../src/guestfs.pod:866
32351 "To avoid both the ambiguity and the need to duplicate some calls, we could "
32352 "make paths/devices into structured names. One way to do this would be to "
32353 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
32354 "aspect of grub. Another way would be to use a structured type, equivalent "
32355 "to this OCaml type:"
32359 #: ../src/guestfs.pod:872
32362 " type path = Path of string | Device of int | Partition of int * int\n"
32367 #: ../src/guestfs.pod:874
32368 msgid "which would allow you to pass arguments like:"
32372 #: ../src/guestfs.pod:876
32375 " Path \"/foo/bar\"\n"
32376 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
32377 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
32378 " Path \"/dev/sdb2\" (* not a device *)\n"
32383 #: ../src/guestfs.pod:881
32385 "As you can see there are still problems to resolve even with this "
32386 "representation. Also consider how it might work in guestfish."
32390 #: ../src/guestfs.pod:886
32391 msgid "KEYS AND PASSPHRASES"
32395 #: ../src/guestfs.pod:888
32397 "Certain libguestfs calls take a parameter that contains sensitive key "
32398 "material, passed in as a C string."
32402 #: ../src/guestfs.pod:891
32404 "In the future we would hope to change the libguestfs implementation so that "
32405 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
32406 "swap. However this is I<not> done at the moment, because of the complexity "
32407 "of such an implementation."
32411 #: ../src/guestfs.pod:896
32413 "Therefore you should be aware that any key parameter you pass to libguestfs "
32414 "might end up being written out to the swap partition. If this is a concern, "
32415 "scrub the swap partition or don't use libguestfs on encrypted devices."
32419 #: ../src/guestfs.pod:901
32420 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
32424 #: ../src/guestfs.pod:903
32426 "All high-level libguestfs actions are synchronous. If you want to use "
32427 "libguestfs asynchronously then you must create a thread."
32431 #: ../src/guestfs.pod:906
32433 "Only use the handle from a single thread. Either use the handle exclusively "
32434 "from one thread, or provide your own mutex so that two threads cannot issue "
32435 "calls on the same handle at the same time."
32439 #: ../src/guestfs.pod:910
32441 "See the graphical program guestfs-browser for one possible architecture for "
32442 "multithreaded programs using libvirt and libguestfs."
32446 #: ../src/guestfs.pod:913
32451 #: ../src/guestfs.pod:915
32453 "Libguestfs needs a supermin appliance, which it finds by looking along an "
32458 #: ../src/guestfs.pod:918
32460 "By default it looks for these in the directory C<$libdir/guestfs> "
32461 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
32465 #: ../src/guestfs.pod:921
32467 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
32468 "to change the directories that libguestfs will search in. The value is a "
32469 "colon-separated list of paths. The current directory is I<not> searched "
32470 "unless the path contains an empty element or C<.>. For example "
32471 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
32472 "then C</usr/lib/guestfs>."
32476 #: ../src/guestfs.pod:928
32477 msgid "QEMU WRAPPERS"
32481 #: ../src/guestfs.pod:930
32483 "If you want to compile your own qemu, run qemu from a non-standard location, "
32484 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
32489 #: ../src/guestfs.pod:934
32491 "There is one important rule to remember: you I<must C<exec qemu>> as the "
32492 "last command in the shell script (so that qemu replaces the shell and "
32493 "becomes the direct child of the libguestfs-using program). If you don't do "
32494 "this, then the qemu process won't be cleaned up correctly."
32498 #: ../src/guestfs.pod:939
32500 "Here is an example of a wrapper, where I have built my own copy of qemu from "
32505 #: ../src/guestfs.pod:942
32509 " qemudir=/home/rjones/d/qemu\n"
32510 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
32516 #: ../src/guestfs.pod:946
32518 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
32519 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
32524 #: ../src/guestfs.pod:950
32527 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
32532 #: ../src/guestfs.pod:952
32534 "Note that libguestfs also calls qemu with the -help and -version options in "
32535 "order to determine features."
32539 #: ../src/guestfs.pod:955
32541 "Wrappers can also be used to edit the options passed to qemu. In the "
32542 "following example, the C<-machine ...> option (C<-machine> and the following "
32543 "argument) are removed from the command line and replaced with C<-machine "
32544 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
32545 "right one to remove, putting the remaining options into the C<args> array."
32549 #: ../src/guestfs.pod:962
32557 #: ../src/guestfs.pod:964
32561 " while [ $# -gt 0 ]; do\n"
32562 " case \"$1\" in\n"
32566 " args[i]=\"$1\"\n"
32575 #: ../src/guestfs.pod:976
32578 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
32583 #: ../src/guestfs.pod:978
32584 msgid "ATTACHING TO RUNNING DAEMONS"
32588 #: ../src/guestfs.pod:980
32590 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
32591 "babies. Use with caution."
32595 #: ../src/guestfs.pod:983
32597 "I<Note (2):> This section explains how to attach to a running daemon from a "
32598 "low level perspective. For most users, simply using virt tools such as "
32599 "L<guestfish(1)> with the I<--live> option will \"just work\"."
32603 #: ../src/guestfs.pod:987
32604 msgid "Using guestfs_set_attach_method"
32608 #: ../src/guestfs.pod:989
32610 "By calling L</guestfs_set_attach_method> you can change how the library "
32611 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
32612 "L</ARCHITECTURE> for some background)."
32616 #: ../src/guestfs.pod:993
32618 "The normal attach method is C<appliance>, where a small appliance is created "
32619 "containing the daemon, and then the library connects to this."
32623 #: ../src/guestfs.pod:996
32625 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
32626 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
32627 "daemon over the Unix domain socket."
32631 #: ../src/guestfs.pod:1000
32633 "The normal use for this is to connect to a running virtual machine that "
32634 "contains a C<guestfsd> daemon, and send commands so you can read and write "
32635 "files inside the live virtual machine."
32639 #: ../src/guestfs.pod:1004
32640 msgid "Using guestfs_add_domain with live flag"
32644 #: ../src/guestfs.pod:1006
32646 "L</guestfs_add_domain> provides some help for getting the correct attach "
32647 "method. If you pass the C<live> option to this function, then (if the "
32648 "virtual machine is running) it will examine the libvirt XML looking for a "
32649 "virtio-serial channel to connect to:"
32653 #: ../src/guestfs.pod:1012
32660 " <channel type='unix'>\n"
32661 " <source mode='bind' path='/path/to/socket'/>\n"
32662 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
32671 #: ../src/guestfs.pod:1024
32673 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
32674 "method to C<unix:/path/to/socket>."
32678 #: ../src/guestfs.pod:1027
32680 "Some of the libguestfs tools (including guestfish) support a I<--live> "
32681 "option which is passed through to L</guestfs_add_domain> thus allowing you "
32682 "to attach to and modify live virtual machines."
32686 #: ../src/guestfs.pod:1031
32688 "The virtual machine needs to have been set up beforehand so that it has the "
32689 "virtio-serial channel and so that guestfsd is running inside it."
32693 #: ../src/guestfs.pod:1035
32694 msgid "ABI GUARANTEE"
32698 #: ../src/guestfs.pod:1037
32700 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
32701 "actions as outlined in this section. Although we will deprecate some "
32702 "actions, for example if they get replaced by newer calls, we will keep the "
32703 "old actions forever. This allows you the developer to program in confidence "
32704 "against the libguestfs API."
32708 #: ../src/guestfs.pod:1043
32709 msgid "BLOCK DEVICE NAMING"
32713 #: ../src/guestfs.pod:1045
32715 "In the kernel there is now quite a profusion of schemata for naming block "
32716 "devices (in this context, by I<block device> I mean a physical or virtual "
32717 "hard drive). The original Linux IDE driver used names starting with "
32718 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
32719 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
32720 "replacement for the old IDE driver (particularly for SATA devices) those "
32721 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
32722 "machines with paravirtualized drivers. This has created several different "
32723 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
32728 #: ../src/guestfs.pod:1057
32730 "As discussed above, libguestfs uses a qemu appliance running an embedded "
32731 "Linux kernel to access block devices. We can run a variety of appliances "
32732 "based on a variety of Linux kernels."
32736 #: ../src/guestfs.pod:1061
32738 "This causes a problem for libguestfs because many API calls use device or "
32739 "partition names. Working scripts and the recipe (example) scripts that we "
32740 "make available over the internet could fail if the naming scheme changes."
32744 #: ../src/guestfs.pod:1066
32746 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
32747 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
32748 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
32749 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
32753 #: ../src/guestfs.pod:1072
32755 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
32756 "L</guestfs_list_partitions> and similar calls return the true names of the "
32757 "devices and partitions as known to the appliance."
32761 #: ../src/guestfs.pod:1077
32762 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
32766 #: ../src/guestfs.pod:1079
32768 "Usually this translation is transparent. However in some (very rare) cases "
32769 "you may need to know the exact algorithm. Such cases include where you use "
32770 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
32771 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
32776 #: ../src/guestfs.pod:1085
32778 "The algorithm is applied only to I<parameters> which are known to be either "
32779 "device or partition names. Return values from functions such as "
32780 "L</guestfs_list_devices> are never changed."
32784 #: ../src/guestfs.pod:1093
32785 msgid "Is the string a parameter which is a device or partition name?"
32789 #: ../src/guestfs.pod:1097
32790 msgid "Does the string begin with C</dev/sd>?"
32794 #: ../src/guestfs.pod:1101
32796 "Does the named device exist? If so, we use that device. However if I<not> "
32797 "then we continue with this algorithm."
32801 #: ../src/guestfs.pod:1106
32802 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
32806 #: ../src/guestfs.pod:1108
32807 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
32811 #: ../src/guestfs.pod:1110
32812 msgid "If that named device exists, use it. If not, continue."
32816 #: ../src/guestfs.pod:1114
32817 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
32821 #: ../src/guestfs.pod:1116
32822 msgid "If that named device exists, use it. If not, return an error."
32826 #: ../src/guestfs.pod:1120
32827 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
32831 #: ../src/guestfs.pod:1122
32833 "Although the standard naming scheme and automatic translation is useful for "
32834 "simple programs and guestfish scripts, for larger programs it is best not to "
32835 "rely on this mechanism."
32839 #: ../src/guestfs.pod:1126
32841 "Where possible for maximum future portability programs using libguestfs "
32842 "should use these future-proof techniques:"
32846 #: ../src/guestfs.pod:1133
32848 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
32849 "device names, and then use those names directly."
32853 #: ../src/guestfs.pod:1136
32854 msgid "Since those device names exist by definition, they will never be translated."
32858 #: ../src/guestfs.pod:1141
32860 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
32861 "filesystem labels."
32865 #: ../src/guestfs.pod:1146
32870 #: ../src/guestfs.pod:1148
32872 "This section discusses security implications of using libguestfs, "
32873 "particularly with untrusted or malicious guests or disk images."
32877 #: ../src/guestfs.pod:1151
32878 msgid "GENERAL SECURITY CONSIDERATIONS"
32882 #: ../src/guestfs.pod:1153
32884 "Be careful with any files or data that you download from a guest (by "
32885 "\"download\" we mean not just the L</guestfs_download> command but any "
32886 "command that reads files, filenames, directories or anything else from a "
32887 "disk image). An attacker could manipulate the data to fool your program "
32888 "into doing the wrong thing. Consider cases such as:"
32892 #: ../src/guestfs.pod:1163
32893 msgid "the data (file etc) not being present"
32897 #: ../src/guestfs.pod:1167
32898 msgid "being present but empty"
32902 #: ../src/guestfs.pod:1171
32903 msgid "being much larger than normal"
32907 #: ../src/guestfs.pod:1175
32908 msgid "containing arbitrary 8 bit data"
32912 #: ../src/guestfs.pod:1179
32913 msgid "being in an unexpected character encoding"
32917 #: ../src/guestfs.pod:1183
32918 msgid "containing homoglyphs."
32922 #: ../src/guestfs.pod:1187
32923 msgid "SECURITY OF MOUNTING FILESYSTEMS"
32927 #: ../src/guestfs.pod:1189
32929 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
32930 "(VFS) module can sometimes be escalated into exploits by deliberately "
32931 "creating a malicious, malformed filesystem. These exploits are very severe "
32932 "for two reasons. Firstly there are very many filesystem drivers in the "
32933 "kernel, and many of them are infrequently used and not much developer "
32934 "attention has been paid to the code. Linux userspace helps potential "
32935 "crackers by detecting the filesystem type and automatically choosing the "
32936 "right VFS driver, even if that filesystem type is obscure or unexpected for "
32937 "the administrator. Secondly, a kernel-level exploit is like a local root "
32938 "exploit (worse in some ways), giving immediate and total access to the "
32939 "system right down to the hardware level."
32943 #: ../src/guestfs.pod:1202
32945 "That explains why you should never mount a filesystem from an untrusted "
32946 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
32947 "inside a qemu virtual machine, usually running as a non-root user. The "
32948 "attacker would need to write a filesystem which first exploited the kernel, "
32949 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
32950 "the libguestfs protocol, and finally to be as serious as the host kernel "
32951 "exploit it would need to escalate its privileges to root. This multi-step "
32952 "escalation, performed by a static piece of data, is thought to be extremely "
32953 "hard to do, although we never say 'never' about security issues."
32957 #: ../src/guestfs.pod:1213
32959 "In any case callers can reduce the attack surface by forcing the filesystem "
32960 "type when mounting (use L</guestfs_mount_vfs>)."
32964 #: ../src/guestfs.pod:1216
32965 msgid "PROTOCOL SECURITY"
32969 #: ../src/guestfs.pod:1218
32971 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
32972 "defined upper message size. However a program that uses libguestfs must "
32973 "also take care - for example you can write a program that downloads a binary "
32974 "from a disk image and executes it locally, and no amount of protocol "
32975 "security will save you from the consequences."
32979 #: ../src/guestfs.pod:1224
32980 msgid "INSPECTION SECURITY"
32984 #: ../src/guestfs.pod:1226
32986 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
32987 "directly from the guest, and these could contain any 8 bit data. Callers "
32988 "should be careful to escape these before printing them to a structured file "
32989 "(for example, use HTML escaping if creating a web page)."
32993 #: ../src/guestfs.pod:1232
32995 "Guest configuration may be altered in unusual ways by the administrator of "
32996 "the virtual machine, and may not reflect reality (particularly for untrusted "
32997 "or actively malicious guests). For example we parse the hostname from "
32998 "configuration files like C</etc/sysconfig/network> that we find in the "
32999 "guest, but the guest administrator can easily manipulate these files to "
33000 "provide the wrong hostname."
33004 #: ../src/guestfs.pod:1240
33006 "The inspection API parses guest configuration using two external libraries: "
33007 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
33008 "designed to be robust in the face of malicious data, although denial of "
33009 "service attacks are still possible, for example with oversized configuration "
33014 #: ../src/guestfs.pod:1246
33015 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
33019 #: ../src/guestfs.pod:1248
33021 "Be very cautious about running commands from the guest. By running a "
33022 "command in the guest, you are giving CPU time to a binary that you do not "
33023 "control, under the same user account as the library, albeit wrapped in qemu "
33024 "virtualization. More information and alternatives can be found in the "
33025 "section L</RUNNING COMMANDS>."
33029 #: ../src/guestfs.pod:1254
33030 msgid "CVE-2010-3851"
33034 #: ../src/guestfs.pod:1256
33035 msgid "https://bugzilla.redhat.com/642934"
33039 #: ../src/guestfs.pod:1258
33041 "This security bug concerns the automatic disk format detection that qemu "
33042 "does on disk images."
33046 #: ../src/guestfs.pod:1261
33048 "A raw disk image is just the raw bytes, there is no header. Other disk "
33049 "images like qcow2 contain a special header. Qemu deals with this by looking "
33050 "for one of the known headers, and if none is found then assuming the disk "
33051 "image must be raw."
33055 #: ../src/guestfs.pod:1266
33057 "This allows a guest which has been given a raw disk image to write some "
33058 "other header. At next boot (or when the disk image is accessed by "
33059 "libguestfs) qemu would do autodetection and think the disk image format was, "
33060 "say, qcow2 based on the header written by the guest."
33064 #: ../src/guestfs.pod:1271
33066 "This in itself would not be a problem, but qcow2 offers many features, one "
33067 "of which is to allow a disk image to refer to another image (called the "
33068 "\"backing disk\"). It does this by placing the path to the backing disk "
33069 "into the qcow2 header. This path is not validated and could point to any "
33070 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
33071 "\"holes\" in the qcow2 disk image, which of course is completely under the "
33072 "control of the attacker."
33076 #: ../src/guestfs.pod:1279
33077 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
33081 #: ../src/guestfs.pod:1286
33082 msgid "You have enabled the network or have opened the disk in write mode."
33086 #: ../src/guestfs.pod:1290
33088 "You are also running untrusted code from the guest (see L</RUNNING "
33093 #: ../src/guestfs.pod:1295
33095 "The way to avoid this is to specify the expected disk format when adding "
33096 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
33097 "should always do this if the disk is raw format, and it's a good idea for "
33102 #: ../src/guestfs.pod:1300
33104 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
33105 "format is fetched from libvirt and passed through."
33109 #: ../src/guestfs.pod:1303
33111 "For libguestfs tools, use the I<--format> command line parameter as "
33116 #: ../src/guestfs.pod:1306
33117 msgid "CONNECTION MANAGEMENT"
33121 #: ../src/guestfs.pod:1308
33122 msgid "guestfs_h *"
33126 #: ../src/guestfs.pod:1310
33128 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
33129 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
33130 "handle and release all resources used."
33134 #: ../src/guestfs.pod:1314
33136 "For information on using multiple handles and threads, see the section "
33137 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
33141 #: ../src/guestfs.pod:1317
33142 msgid "guestfs_create"
33146 #: ../src/guestfs.pod:1319
33149 " guestfs_h *guestfs_create (void);\n"
33154 #: ../src/guestfs.pod:1321
33155 msgid "Create a connection handle."
33159 #: ../src/guestfs.pod:1323
33161 "On success this returns a non-NULL pointer to a handle. On error it returns "
33166 #: ../src/guestfs.pod:1326
33168 "You have to \"configure\" the handle after creating it. This includes "
33169 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
33170 "handle at least once."
33174 #: ../src/guestfs.pod:1330
33175 msgid "After configuring the handle, you have to call L</guestfs_launch>."
33179 #: ../src/guestfs.pod:1332
33181 "You may also want to configure error handling for the handle. See the "
33182 "L</ERROR HANDLING> section below."
33186 #: ../src/guestfs.pod:1335
33187 msgid "guestfs_close"
33191 #: ../src/guestfs.pod:1337
33194 " void guestfs_close (guestfs_h *g);\n"
33199 #: ../src/guestfs.pod:1339
33200 msgid "This closes the connection handle and frees up all resources used."
33204 #: ../src/guestfs.pod:1341
33206 "If autosync was set on the handle and the handle was launched, then this "
33207 "implicitly calls various functions to unmount filesystems and sync the "
33208 "disk. See L</guestfs_set_autosync> for more details."
33212 #: ../src/guestfs.pod:1345
33213 msgid "If a close callback was set on the handle, then it is called."
33217 #: ../src/guestfs.pod:1347
33218 msgid "ERROR HANDLING"
33222 #: ../src/guestfs.pod:1349
33224 "API functions can return errors. For example, almost all functions that "
33225 "return C<int> will return C<-1> to indicate an error."
33229 #: ../src/guestfs.pod:1352
33231 "Additional information is available for errors: an error message string and "
33232 "optionally an error number (errno) if the thing that failed was a system "
33237 #: ../src/guestfs.pod:1356
33239 "You can get at the additional information about the last error on the handle "
33240 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
33241 "up an error handler with L</guestfs_set_error_handler>."
33245 #: ../src/guestfs.pod:1361
33247 "When the handle is created, a default error handler is installed which "
33248 "prints the error message string to C<stderr>. For small short-running "
33249 "command line programs it is sufficient to do:"
33253 #: ../src/guestfs.pod:1365
33256 " if (guestfs_launch (g) == -1)\n"
33257 " exit (EXIT_FAILURE);\n"
33262 #: ../src/guestfs.pod:1368
33264 "since the default error handler will ensure that an error message has been "
33265 "printed to C<stderr> before the program exits."
33269 #: ../src/guestfs.pod:1371
33271 "For other programs the caller will almost certainly want to install an "
33272 "alternate error handler or do error handling in-line like this:"
33276 #: ../src/guestfs.pod:1374
33279 " /* This disables the default behaviour of printing errors\n"
33281 " guestfs_set_error_handler (g, NULL, NULL);\n"
33286 #: ../src/guestfs.pod:1378
33289 " if (guestfs_launch (g) == -1) {\n"
33290 " /* Examine the error message and print it etc. */\n"
33291 " char *msg = guestfs_last_error (g);\n"
33292 " int errnum = guestfs_last_errno (g);\n"
33293 " fprintf (stderr, \"%s\", msg);\n"
33294 " if (errnum != 0)\n"
33295 " fprintf (stderr, \": %s\", strerror (errnum));\n"
33296 " fprintf (stderr, \"\\n\");\n"
33303 #: ../src/guestfs.pod:1389
33305 "Out of memory errors are handled differently. The default action is to call "
33306 "L<abort(3)>. If this is undesirable, then you can set a handler using "
33307 "L</guestfs_set_out_of_memory_handler>."
33311 #: ../src/guestfs.pod:1393
33313 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
33314 "because there is no handle if this happens there is no way to get additional "
33315 "error information. However L</guestfs_create> is supposed to be a "
33316 "lightweight operation which can only fail because of insufficient memory (it "
33317 "returns NULL in this case)."
33321 #: ../src/guestfs.pod:1399
33322 msgid "guestfs_last_error"
33326 #: ../src/guestfs.pod:1401
33329 " const char *guestfs_last_error (guestfs_h *g);\n"
33334 #: ../src/guestfs.pod:1403
33336 "This returns the last error message that happened on C<g>. If there has not "
33337 "been an error since the handle was created, then this returns C<NULL>."
33341 #: ../src/guestfs.pod:1407
33343 "The lifetime of the returned string is until the next error occurs, or "
33344 "L</guestfs_close> is called."
33348 #: ../src/guestfs.pod:1410
33349 msgid "guestfs_last_errno"
33353 #: ../src/guestfs.pod:1412
33356 " int guestfs_last_errno (guestfs_h *g);\n"
33361 #: ../src/guestfs.pod:1414
33362 msgid "This returns the last error number (errno) that happened on C<g>."
33366 #: ../src/guestfs.pod:1416
33367 msgid "If successful, an errno integer not equal to zero is returned."
33371 #: ../src/guestfs.pod:1418
33372 msgid "If no error, this returns 0. This call can return 0 in three situations:"
33376 #: ../src/guestfs.pod:1425
33377 msgid "There has not been any error on the handle."
33381 #: ../src/guestfs.pod:1429
33383 "There has been an error but the errno was meaningless. This corresponds to "
33384 "the case where the error did not come from a failed system call, but for "
33385 "some other reason."
33389 #: ../src/guestfs.pod:1435
33391 "There was an error from a failed system call, but for some reason the errno "
33392 "was not captured and returned. This usually indicates a bug in libguestfs."
33396 #: ../src/guestfs.pod:1441
33398 "Libguestfs tries to convert the errno from inside the applicance into a "
33399 "corresponding errno for the caller (not entirely trivial: the appliance "
33400 "might be running a completely different operating system from the library "
33401 "and error numbers are not standardized across Un*xen). If this could not be "
33402 "done, then the error is translated to C<EINVAL>. In practice this should "
33403 "only happen in very rare circumstances."
33407 #: ../src/guestfs.pod:1449
33408 msgid "guestfs_set_error_handler"
33412 #: ../src/guestfs.pod:1451
33415 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
33417 " const char *msg);\n"
33418 " void guestfs_set_error_handler (guestfs_h *g,\n"
33419 " guestfs_error_handler_cb cb,\n"
33420 " void *opaque);\n"
33425 #: ../src/guestfs.pod:1458
33427 "The callback C<cb> will be called if there is an error. The parameters "
33428 "passed to the callback are an opaque data pointer and the error message "
33433 #: ../src/guestfs.pod:1462
33435 "C<errno> is not passed to the callback. To get that the callback must call "
33436 "L</guestfs_last_errno>."
33440 #: ../src/guestfs.pod:1465
33442 "Note that the message string C<msg> is freed as soon as the callback "
33443 "function returns, so if you want to stash it somewhere you must make your "
33448 #: ../src/guestfs.pod:1469
33449 msgid "The default handler prints messages on C<stderr>."
33453 #: ../src/guestfs.pod:1471
33454 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
33458 #: ../src/guestfs.pod:1473
33459 msgid "guestfs_get_error_handler"
33463 #: ../src/guestfs.pod:1475
33466 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
33467 " void **opaque_rtn);\n"
33472 #: ../src/guestfs.pod:1478
33473 msgid "Returns the current error handler callback."
33477 #: ../src/guestfs.pod:1480
33478 msgid "guestfs_set_out_of_memory_handler"
33482 #: ../src/guestfs.pod:1482
33485 " typedef void (*guestfs_abort_cb) (void);\n"
33486 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
33487 " guestfs_abort_cb);\n"
33492 #: ../src/guestfs.pod:1486
33494 "The callback C<cb> will be called if there is an out of memory situation. "
33495 "I<Note this callback must not return>."
33499 #: ../src/guestfs.pod:1489
33500 msgid "The default is to call L<abort(3)>."
33504 #: ../src/guestfs.pod:1491
33505 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
33509 #: ../src/guestfs.pod:1494
33510 msgid "guestfs_get_out_of_memory_handler"
33514 #: ../src/guestfs.pod:1496
33517 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
33522 #: ../src/guestfs.pod:1498
33523 msgid "This returns the current out of memory handler."
33527 #: ../src/guestfs.pod:1500
33532 #: ../src/guestfs.pod:1504
33537 #: ../src/guestfs.pod:1506
33542 #: ../src/guestfs.pod:1508
33543 msgid "AVAILABILITY"
33547 #: ../src/guestfs.pod:1510
33548 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
33552 #: ../src/guestfs.pod:1512
33554 "Using L</guestfs_available> you can test availability of the following "
33555 "groups of functions. This test queries the appliance to see if the "
33556 "appliance you are currently using supports the functionality."
33560 #: ../src/guestfs.pod:1517
33561 msgid "@AVAILABILITY@"
33565 #: ../src/guestfs.pod:1519
33566 msgid "GUESTFISH supported COMMAND"
33570 #: ../src/guestfs.pod:1521
33572 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
33573 "prints out the available groups and whether they are supported by this build "
33574 "of libguestfs. Note however that you have to do C<run> first."
33578 #: ../src/guestfs.pod:1526
33579 msgid "SINGLE CALLS AT COMPILE TIME"
33583 #: ../src/guestfs.pod:1528
33585 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
33586 "function, such as:"
33590 #: ../src/guestfs.pod:1531
33593 " #define LIBGUESTFS_HAVE_DD 1\n"
33598 #: ../src/guestfs.pod:1533
33599 msgid "if L</guestfs_dd> is available."
33603 #: ../src/guestfs.pod:1535
33605 "Before version 1.5.8, if you needed to test whether a single libguestfs "
33606 "function is available at compile time, we recommended using build tools such "
33607 "as autoconf or cmake. For example in autotools you could use:"
33611 #: ../src/guestfs.pod:1540
33614 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
33615 " AC_CHECK_FUNCS([guestfs_dd])\n"
33620 #: ../src/guestfs.pod:1543
33622 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
33627 #: ../src/guestfs.pod:1546
33628 msgid "SINGLE CALLS AT RUN TIME"
33632 #: ../src/guestfs.pod:1548
33634 "Testing at compile time doesn't guarantee that a function really exists in "
33635 "the library. The reason is that you might be dynamically linked against a "
33636 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
33637 "This situation unfortunately results in a segmentation fault, which is a "
33638 "shortcoming of the C dynamic linking system itself."
33642 #: ../src/guestfs.pod:1555
33644 "You can use L<dlopen(3)> to test if a function is available at run time, as "
33645 "in this example program (note that you still need the compile time check as "
33650 #: ../src/guestfs.pod:1559
33653 " #include <stdio.h>\n"
33654 " #include <stdlib.h>\n"
33655 " #include <unistd.h>\n"
33656 " #include <dlfcn.h>\n"
33657 " #include <guestfs.h>\n"
33662 #: ../src/guestfs.pod:1565
33667 " #ifdef LIBGUESTFS_HAVE_DD\n"
33669 " int has_function;\n"
33674 #: ../src/guestfs.pod:1571
33677 " /* Test if the function guestfs_dd is really available. */\n"
33678 " dl = dlopen (NULL, RTLD_LAZY);\n"
33680 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
33681 " exit (EXIT_FAILURE);\n"
33683 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
33689 #: ../src/guestfs.pod:1580
33692 " if (!has_function)\n"
33693 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
33695 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
33696 " /* Now it's safe to call\n"
33697 " guestfs_dd (g, \"foo\", \"bar\");\n"
33701 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
33708 #: ../src/guestfs.pod:1593
33710 "You may think the above is an awful lot of hassle, and it is. There are "
33711 "other ways outside of the C linking system to ensure that this kind of "
33712 "incompatibility never arises, such as using package versioning:"
33716 #: ../src/guestfs.pod:1598
33719 " Requires: libguestfs >= 1.0.80\n"
33724 #: ../src/guestfs.pod:1600
33725 msgid "CALLS WITH OPTIONAL ARGUMENTS"
33729 #: ../src/guestfs.pod:1602
33731 "A recent feature of the API is the introduction of calls which take optional "
33732 "arguments. In C these are declared 3 ways. The main way is as a call which "
33733 "takes variable arguments (ie. C<...>), as in this example:"
33737 #: ../src/guestfs.pod:1607
33740 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
33745 #: ../src/guestfs.pod:1609
33747 "Call this with a list of optional arguments, terminated by C<-1>. So to "
33748 "call with no optional arguments specified:"
33752 #: ../src/guestfs.pod:1612
33755 " guestfs_add_drive_opts (g, filename, -1);\n"
33760 #: ../src/guestfs.pod:1614
33761 msgid "With a single optional argument:"
33765 #: ../src/guestfs.pod:1616
33768 " guestfs_add_drive_opts (g, filename,\n"
33769 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33775 #: ../src/guestfs.pod:1620
33780 #: ../src/guestfs.pod:1622
33783 " guestfs_add_drive_opts (g, filename,\n"
33784 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33785 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33791 #: ../src/guestfs.pod:1627
33793 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
33798 #: ../src/guestfs.pod:1630
33799 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
33803 #: ../src/guestfs.pod:1632
33805 "The second variant has the same name with the suffix C<_va>, which works the "
33806 "same way but takes a C<va_list>. See the C manual for details. For the "
33807 "example function, this is declared:"
33811 #: ../src/guestfs.pod:1636
33814 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
33815 " va_list args);\n"
33820 #: ../src/guestfs.pod:1639
33821 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
33825 #: ../src/guestfs.pod:1641
33827 "The third variant is useful where you need to construct these calls. You "
33828 "pass in a structure where you fill in the optional fields. The structure "
33829 "has a bitmask as the first element which you must set to indicate which "
33830 "fields you have filled in. For our example function the structure and call "
33835 #: ../src/guestfs.pod:1647
33838 " struct guestfs_add_drive_opts_argv {\n"
33839 " uint64_t bitmask;\n"
33841 " const char *format;\n"
33844 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
33845 " const struct guestfs_add_drive_opts_argv *optargs);\n"
33850 #: ../src/guestfs.pod:1656
33851 msgid "You could call it like this:"
33855 #: ../src/guestfs.pod:1658
33858 " struct guestfs_add_drive_opts_argv optargs = {\n"
33859 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
33860 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
33861 " .readonly = 1,\n"
33862 " .format = \"qcow2\"\n"
33868 #: ../src/guestfs.pod:1665
33871 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
33876 #: ../src/guestfs.pod:1673
33877 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
33881 #: ../src/guestfs.pod:1678
33882 msgid "You do not need to fill in all fields of the structure."
33886 #: ../src/guestfs.pod:1682
33888 "There must be a one-to-one correspondence between fields of the structure "
33889 "that are filled in, and bits set in the bitmask."
33893 #: ../src/guestfs.pod:1687
33894 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
33898 #: ../src/guestfs.pod:1689
33900 "In other languages, optional arguments are expressed in the way that is "
33901 "natural for that language. We refer you to the language-specific "
33902 "documentation for more details on that."
33906 #: ../src/guestfs.pod:1693
33907 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
33911 #: ../src/guestfs.pod:1695
33912 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
33916 #: ../src/guestfs.pod:1697
33918 "B<Note:> This section documents the generic event mechanism introduced in "
33919 "libguestfs 1.10, which you should use in new code if possible. The old "
33920 "functions C<guestfs_set_log_message_callback>, "
33921 "C<guestfs_set_subprocess_quit_callback>, "
33922 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
33923 "C<guestfs_set_progress_callback> are no longer documented in this manual "
33924 "page. Because of the ABI guarantee, the old functions continue to work."
33928 #: ../src/guestfs.pod:1706
33930 "Handles generate events when certain things happen, such as log messages "
33931 "being generated, progress messages during long-running operations, or the "
33932 "handle being closed. The API calls described below let you register a "
33933 "callback to be called when events happen. You can register multiple "
33934 "callbacks (for the same, different or overlapping sets of events), and "
33935 "individually remove callbacks. If callbacks are not removed, then they "
33936 "remain in force until the handle is closed."
33940 #: ../src/guestfs.pod:1714
33942 "In the current implementation, events are only generated synchronously: that "
33943 "means that events (and hence callbacks) can only happen while you are in the "
33944 "middle of making another libguestfs call. The callback is called in the "
33949 #: ../src/guestfs.pod:1719
33951 "Events may contain a payload, usually nothing (void), an array of 64 bit "
33952 "unsigned integers, or a message buffer. Payloads are discussed later on."
33956 #: ../src/guestfs.pod:1723
33957 msgid "CLASSES OF EVENTS"
33961 #: ../src/guestfs.pod:1727
33962 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
33966 #: ../src/guestfs.pod:1730
33968 "The callback function will be called while the handle is being closed "
33969 "(synchronously from L</guestfs_close>)."
33973 #: ../src/guestfs.pod:1733
33975 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
33976 "handles that are open when the program exits. This means that this callback "
33977 "might be called indirectly from L<exit(3)>, which can cause unexpected "
33978 "problems in higher-level languages (eg. if your HLL interpreter has already "
33979 "been cleaned up by the time this is called, and if your callback then jumps "
33980 "into some HLL function)."
33984 #: ../src/guestfs.pod:1740
33986 "If no callback is registered: the handle is closed without any callback "
33991 #: ../src/guestfs.pod:1743
33992 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
33996 #: ../src/guestfs.pod:1746
33998 "The callback function will be called when the child process quits, either "
33999 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
34000 "corresponds to a transition from any state to the CONFIG state)."
34004 #: ../src/guestfs.pod:1750 ../src/guestfs.pod:1759 ../src/guestfs.pod:1876
34005 msgid "If no callback is registered: the event is ignored."
34009 #: ../src/guestfs.pod:1752
34010 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
34014 #: ../src/guestfs.pod:1755
34016 "The callback function will be called when the child process becomes ready "
34017 "first time after it has been launched. (This corresponds to a transition "
34018 "from LAUNCHING to the READY state)."
34022 #: ../src/guestfs.pod:1761
34023 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
34027 #: ../src/guestfs.pod:1764
34029 "Some long-running operations can generate progress messages. If this "
34030 "callback is registered, then it will be called each time a progress message "
34031 "is generated (usually two seconds after the operation started, and three "
34032 "times per second thereafter until it completes, although the frequency may "
34033 "change in future versions)."
34037 #: ../src/guestfs.pod:1770
34039 "The callback receives in the payload four unsigned 64 bit numbers which are "
34040 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
34044 #: ../src/guestfs.pod:1773
34046 "The units of C<total> are not defined, although for some operations C<total> "
34047 "may relate in some way to the amount of data to be transferred (eg. in bytes "
34048 "or megabytes), and C<position> may be the portion which has been "
34053 #: ../src/guestfs.pod:1778
34054 msgid "The only defined and stable parts of the API are:"
34058 #: ../src/guestfs.pod:1784
34060 "The callback can display to the user some type of progress bar or indicator "
34061 "which shows the ratio of C<position>:C<total>."
34065 #: ../src/guestfs.pod:1789
34066 msgid "0 E<lt>= C<position> E<lt>= C<total>"
34070 #: ../src/guestfs.pod:1793
34072 "If any progress notification is sent during a call, then a final progress "
34073 "notification is always sent when C<position> = C<total> (I<unless> the call "
34074 "fails with an error)."
34078 #: ../src/guestfs.pod:1797
34080 "This is to simplify caller code, so callers can easily set the progress "
34081 "indicator to \"100%\" at the end of the operation, without requiring special "
34082 "code to detect this case."
34086 #: ../src/guestfs.pod:1803
34088 "For some calls we are unable to estimate the progress of the call, but we "
34089 "can still generate progress messages to indicate activity. This is known as "
34090 "\"pulse mode\", and is directly supported by certain progress bar "
34091 "implementations (eg. GtkProgressBar)."
34095 #: ../src/guestfs.pod:1808
34097 "For these calls, zero or more progress messages are generated with "
34098 "C<position = 0> and C<total = 1>, followed by a final message with "
34099 "C<position = total = 1>."
34103 #: ../src/guestfs.pod:1812
34105 "As noted above, if the call fails with an error then the final message may "
34106 "not be generated."
34110 #: ../src/guestfs.pod:1817
34112 "The callback also receives the procedure number (C<proc_nr>) and serial "
34113 "number (C<serial>) of the call. These are only useful for debugging "
34114 "protocol issues, and the callback can normally ignore them. The callback "
34115 "may want to print these numbers in error messages or debugging messages."
34119 #: ../src/guestfs.pod:1823
34120 msgid "If no callback is registered: progress messages are discarded."
34124 #: ../src/guestfs.pod:1825
34125 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
34129 #: ../src/guestfs.pod:1828
34131 "The callback function is called whenever a log message is generated by qemu, "
34132 "the appliance kernel, guestfsd (daemon), or utility programs."
34136 #: ../src/guestfs.pod:1831
34138 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
34139 "(L</guestfs_launch>) then additional debug messages are generated."
34143 #: ../src/guestfs.pod:1834 ../src/guestfs.pod:1848
34145 "If no callback is registered: the messages are discarded unless the verbose "
34146 "flag is set in which case they are sent to stderr. You can override the "
34147 "printing of verbose messages to stderr by setting up a callback."
34151 #: ../src/guestfs.pod:1839
34152 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
34156 #: ../src/guestfs.pod:1842
34158 "The callback function is called whenever a log message is generated by the "
34159 "library part of libguestfs."
34163 #: ../src/guestfs.pod:1845
34165 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
34166 "messages are generated."
34170 #: ../src/guestfs.pod:1853
34171 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
34175 #: ../src/guestfs.pod:1856
34177 "The callback function is called whenever a trace message is generated. This "
34178 "only applies if the trace flag (L</guestfs_set_trace>) is set."
34182 #: ../src/guestfs.pod:1859
34184 "If no callback is registered: the messages are sent to stderr. You can "
34185 "override the printing of trace messages to stderr by setting up a callback."
34189 #: ../src/guestfs.pod:1863
34190 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
34194 #: ../src/guestfs.pod:1866
34195 msgid "The callback function is called whenever a libguestfs function is entered."
34199 #: ../src/guestfs.pod:1869
34201 "The payload is a string which contains the name of the function that we are "
34202 "entering (not including C<guestfs_> prefix)."
34206 #: ../src/guestfs.pod:1872
34208 "Note that libguestfs functions can call themselves, so you may see many "
34209 "events from a single call. A few libguestfs functions do not generate this "
34214 #: ../src/guestfs.pod:1880
34215 msgid "guestfs_set_event_callback"
34219 #: ../src/guestfs.pod:1882
34222 " int guestfs_set_event_callback (guestfs_h *g,\n"
34223 " guestfs_event_callback cb,\n"
34224 " uint64_t event_bitmask,\n"
34226 " void *opaque);\n"
34231 #: ../src/guestfs.pod:1888
34233 "This function registers a callback (C<cb>) for all event classes in the "
34234 "C<event_bitmask>."
34238 #: ../src/guestfs.pod:1891
34240 "For example, to register for all log message events, you could call this "
34241 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
34242 "To register a single callback for all possible classes of events, use "
34243 "C<GUESTFS_EVENT_ALL>."
34247 #: ../src/guestfs.pod:1897
34248 msgid "C<flags> should always be passed as 0."
34252 #: ../src/guestfs.pod:1899
34254 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
34255 "it for any purpose."
34259 #: ../src/guestfs.pod:1902
34261 "The return value is the event handle (an integer) which you can use to "
34262 "delete the callback (see below)."
34266 #: ../src/guestfs.pod:1905
34268 "If there is an error, this function returns C<-1>, and sets the error in the "
34269 "handle in the usual way (see L</guestfs_last_error> etc.)"
34273 #: ../src/guestfs.pod:1908
34275 "Callbacks remain in effect until they are deleted, or until the handle is "
34280 #: ../src/guestfs.pod:1911
34282 "In the case where multiple callbacks are registered for a particular event "
34283 "class, all of the callbacks are called. The order in which multiple "
34284 "callbacks are called is not defined."
34288 #: ../src/guestfs.pod:1915
34289 msgid "guestfs_delete_event_callback"
34293 #: ../src/guestfs.pod:1917
34296 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
34301 #: ../src/guestfs.pod:1919
34303 "Delete a callback that was previously registered. C<event_handle> should be "
34304 "the integer that was returned by a previous call to "
34305 "C<guestfs_set_event_callback> on the same handle."
34309 #: ../src/guestfs.pod:1923
34310 msgid "guestfs_event_callback"
34314 #: ../src/guestfs.pod:1925
34317 " typedef void (*guestfs_event_callback) (\n"
34320 " uint64_t event,\n"
34321 " int event_handle,\n"
34323 " const char *buf, size_t buf_len,\n"
34324 " const uint64_t *array, size_t array_len);\n"
34329 #: ../src/guestfs.pod:1934
34330 msgid "This is the type of the event callback function that you have to provide."
34334 #: ../src/guestfs.pod:1937
34336 "The basic parameters are: the handle (C<g>), the opaque user pointer "
34337 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
34338 "handle, and C<flags> which in the current API you should ignore."
34342 #: ../src/guestfs.pod:1941
34344 "The remaining parameters contain the event payload (if any). Each event may "
34345 "contain a payload, which usually relates to the event class, but for future "
34346 "proofing your code should be written to handle any payload for any event "
34351 #: ../src/guestfs.pod:1946
34353 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
34354 "there is no message buffer). Note that this message buffer can contain "
34355 "arbitrary 8 bit data, including NUL bytes."
34359 #: ../src/guestfs.pod:1950
34361 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
34362 "moment this is only used for progress messages."
34366 #: ../src/guestfs.pod:1953
34367 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
34371 #: ../src/guestfs.pod:1955
34373 "One motivation for the generic event API was to allow GUI programs to "
34374 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
34375 "unconditionally to C<stderr>."
34379 #: ../src/guestfs.pod:1959
34381 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
34382 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
34383 "messages are not events; you must capture error messages separately)."
34387 #: ../src/guestfs.pod:1964
34389 "Programs have to set up a callback to capture the classes of events of "
34394 #: ../src/guestfs.pod:1967
34398 " guestfs_set_event_callback\n"
34399 " (g, message_callback,\n"
34400 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
34401 " GUESTFS_EVENT_TRACE,\n"
34402 " 0, NULL) == -1)\n"
34403 " if (eh == -1) {\n"
34404 " // handle error in the usual way\n"
34410 #: ../src/guestfs.pod:1977
34412 "The callback can then direct messages to the appropriate place. In this "
34413 "example, messages are directed to syslog:"
34417 #: ../src/guestfs.pod:1980
34421 " message_callback (\n"
34424 " uint64_t event,\n"
34425 " int event_handle,\n"
34427 " const char *buf, size_t buf_len,\n"
34428 " const uint64_t *array, size_t array_len)\n"
34430 " const int priority = LOG_USER|LOG_INFO;\n"
34431 " if (buf_len > 0)\n"
34432 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
34438 #: ../src/guestfs.pod:1995
34439 msgid "CANCELLING LONG TRANSFERS"
34443 #: ../src/guestfs.pod:1997
34445 "Some operations can be cancelled by the caller while they are in progress. "
34446 "Currently only operations that involve uploading or downloading data can be "
34447 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
34448 "parameters in the generator)."
34452 #: ../src/guestfs.pod:2002
34453 msgid "guestfs_user_cancel"
34457 #: ../src/guestfs.pod:2004
34460 " void guestfs_user_cancel (guestfs_h *g);\n"
34465 #: ../src/guestfs.pod:2006
34466 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
34470 #: ../src/guestfs.pod:2009
34472 "Unlike most other libguestfs calls, this function is signal safe and thread "
34473 "safe. You can call it from a signal handler or from another thread, without "
34474 "needing to do any locking."
34478 #: ../src/guestfs.pod:2013
34480 "The transfer that was in progress (if there is one) will stop shortly "
34481 "afterwards, and will return an error. The errno (see "
34482 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
34483 "out if the operation was cancelled or failed because of another error."
34487 #: ../src/guestfs.pod:2019
34489 "No cleanup is performed: for example, if a file was being uploaded then "
34490 "after cancellation there may be a partially uploaded file. It is the "
34491 "caller's responsibility to clean up if necessary."
34495 #: ../src/guestfs.pod:2023
34496 msgid "There are two common places that you might call C<guestfs_user_cancel>."
34500 #: ../src/guestfs.pod:2025
34502 "In an interactive text-based program, you might call it from a C<SIGINT> "
34503 "signal handler so that pressing C<^C> cancels the current operation. (You "
34504 "also need to call L</guestfs_set_pgroup> so that child processes don't "
34505 "receive the C<^C> signal)."
34509 #: ../src/guestfs.pod:2030
34511 "In a graphical program, when the main thread is displaying a progress bar "
34512 "with a cancel button, wire up the cancel button to call this function."
34516 #: ../src/guestfs.pod:2034
34517 msgid "PRIVATE DATA AREA"
34521 #: ../src/guestfs.pod:2036
34523 "You can attach named pieces of private data to the libguestfs handle, fetch "
34524 "them by name, and walk over them, for the lifetime of the handle. This is "
34525 "called the private data area and is only available from the C API."
34529 #: ../src/guestfs.pod:2041
34530 msgid "To attach a named piece of data, use the following call:"
34534 #: ../src/guestfs.pod:2043
34537 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
34542 #: ../src/guestfs.pod:2045
34544 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
34545 "pointer (which can be C<NULL>). Any previous item with the same key is "
34550 #: ../src/guestfs.pod:2049
34552 "You can use any C<key> you want, but your key should I<not> start with an "
34553 "underscore character. Keys beginning with an underscore character are "
34554 "reserved for internal libguestfs purposes (eg. for implementing language "
34555 "bindings). It is recommended that you prefix the key with some unique "
34556 "string to avoid collisions with other users."
34560 #: ../src/guestfs.pod:2055
34561 msgid "To retrieve the pointer, use:"
34565 #: ../src/guestfs.pod:2057
34568 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
34573 #: ../src/guestfs.pod:2059
34575 "This function returns C<NULL> if either no data is found associated with "
34576 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
34581 #: ../src/guestfs.pod:2063
34583 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
34584 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
34585 "all. In particular, libguestfs does I<not> try to free the data when the "
34586 "handle is closed. If the data must be freed, then the caller must either "
34587 "free it before calling L</guestfs_close> or must set up a close callback to "
34588 "do it (see L</GUESTFS_EVENT_CLOSE>)."
34592 #: ../src/guestfs.pod:2070
34593 msgid "To walk over all entries, use these two functions:"
34597 #: ../src/guestfs.pod:2072
34600 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
34605 #: ../src/guestfs.pod:2074
34608 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
34613 #: ../src/guestfs.pod:2076
34615 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
34616 "not have any particular meaning -- keys are not returned in any defined "
34617 "order). A pointer to the key is returned in C<*key_rtn> and the "
34618 "corresponding data pointer is returned from the function. C<NULL> is "
34619 "returned if there are no keys stored in the handle."
34623 #: ../src/guestfs.pod:2082
34625 "C<guestfs_next_private> returns the next key, pointer pair. The return "
34626 "value of this function is also C<NULL> is there are no further entries to "
34631 #: ../src/guestfs.pod:2086
34632 msgid "Notes about walking over entries:"
34636 #: ../src/guestfs.pod:2092
34637 msgid "You must not call C<guestfs_set_private> while walking over the entries."
34641 #: ../src/guestfs.pod:2097
34643 "The handle maintains an internal iterator which is reset when you call "
34644 "C<guestfs_first_private>. This internal iterator is invalidated when you "
34645 "call C<guestfs_set_private>."
34649 #: ../src/guestfs.pod:2103
34650 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
34654 #: ../src/guestfs.pod:2105
34657 " guestfs_set_private (g, key, NULL);\n"
34662 #: ../src/guestfs.pod:2107
34663 msgid "then that C<key> is not returned when walking."
34667 #: ../src/guestfs.pod:2111
34669 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
34670 "C<guestfs_next_private> or C<guestfs_set_private>."
34674 #: ../src/guestfs.pod:2117
34676 "The following example code shows how to print all keys and data pointers "
34677 "that are associated with the handle C<g>:"
34681 #: ../src/guestfs.pod:2120
34684 " const char *key;\n"
34685 " void *data = guestfs_first_private (g, &key);\n"
34686 " while (data != NULL)\n"
34688 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34689 " data = guestfs_next_private (g, &key);\n"
34695 #: ../src/guestfs.pod:2128
34697 "More commonly you are only interested in keys that begin with an "
34698 "application-specific prefix C<foo_>. Modify the loop like so:"
34702 #: ../src/guestfs.pod:2131
34705 " const char *key;\n"
34706 " void *data = guestfs_first_private (g, &key);\n"
34707 " while (data != NULL)\n"
34709 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34710 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34711 " data = guestfs_next_private (g, &key);\n"
34717 #: ../src/guestfs.pod:2140
34719 "If you need to modify keys while walking, then you have to jump back to the "
34720 "beginning of the loop. For example, to delete all keys prefixed with "
34725 #: ../src/guestfs.pod:2144
34728 " const char *key;\n"
34731 " data = guestfs_first_private (g, &key);\n"
34732 " while (data != NULL)\n"
34734 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34736 " guestfs_set_private (g, key, NULL);\n"
34737 " /* note that 'key' pointer is now invalid, and so is\n"
34738 " the internal iterator */\n"
34741 " data = guestfs_next_private (g, &key);\n"
34747 #: ../src/guestfs.pod:2160
34749 "Note that the above loop is guaranteed to terminate because the keys are "
34750 "being deleted, but other manipulations of keys within the loop might not "
34751 "terminate unless you also maintain an indication of which keys have been "
34756 #: ../src/guestfs.pod:2165 ../src/guestfs.pod:2170
34761 #: ../src/guestfs.pod:2167
34763 "<!-- old anchor for the next section --> <a "
34764 "name=\"state_machine_and_low_level_event_api\"/>"
34768 #: ../src/guestfs.pod:2172
34769 msgid "ARCHITECTURE"
34773 #: ../src/guestfs.pod:2174
34775 "Internally, libguestfs is implemented by running an appliance (a special "
34776 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
34777 "process of the main program."
34781 #: ../src/guestfs.pod:2178
34784 " ___________________\n"
34786 " | main program |\n"
34788 " | | child process / appliance\n"
34789 " | | __________________________\n"
34791 " +-------------------+ RPC | +-----------------+ |\n"
34792 " | libguestfs <--------------------> guestfsd | |\n"
34793 " | | | +-----------------+ |\n"
34794 " \\___________________/ | | Linux kernel | |\n"
34795 " | +--^--------------+ |\n"
34796 " \\_________|________________/\n"
34798 " _______v______\n"
34801 " | disk image |\n"
34802 " \\______________/\n"
34807 #: ../src/guestfs.pod:2198
34809 "The library, linked to the main program, creates the child process and hence "
34810 "the appliance in the L</guestfs_launch> function."
34814 #: ../src/guestfs.pod:2201
34816 "Inside the appliance is a Linux kernel and a complete stack of userspace "
34817 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
34818 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
34819 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
34820 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
34821 "attached to the qemu process which translates device access by the "
34822 "appliance's Linux kernel into accesses to the image."
34826 #: ../src/guestfs.pod:2210
34828 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
34829 "Although the disk image you are attached to might also be used by some "
34830 "virtual machine, libguestfs doesn't know or care about this. (But you will "
34831 "care if both libguestfs's qemu process and your virtual machine are trying "
34832 "to update the disk image at the same time, since these usually results in "
34833 "massive disk corruption)."
34837 #: ../src/guestfs.pod:2217
34838 msgid "STATE MACHINE"
34842 #: ../src/guestfs.pod:2219
34843 msgid "libguestfs uses a state machine to model the child process:"
34847 #: ../src/guestfs.pod:2221
34851 " guestfs_create\n"
34859 " / | \\ \\ guestfs_launch\n"
34860 " / | _\\__V______\n"
34862 " / | | LAUNCHING |\n"
34863 " / | \\___________/\n"
34865 " / | guestfs_launch\n"
34867 " ______ / __|____V\n"
34868 " / \\ ------> / \\\n"
34869 " | BUSY | | READY |\n"
34870 " \\______/ <------ \\________/\n"
34875 #: ../src/guestfs.pod:2243
34877 "The normal transitions are (1) CONFIG (when the handle is created, but there "
34878 "is no child process), (2) LAUNCHING (when the child process is booting up), "
34879 "(3) alternating between READY and BUSY as commands are issued to, and "
34880 "carried out by, the child process."
34884 #: ../src/guestfs.pod:2248
34886 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
34887 "asynchronously at any time (eg. due to some internal error), and that causes "
34888 "the state to transition back to CONFIG."
34892 #: ../src/guestfs.pod:2252
34894 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
34895 "issued when in the CONFIG state."
34899 #: ../src/guestfs.pod:2255
34901 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
34902 "L</guestfs_launch> blocks until the child process is READY to accept "
34903 "commands (or until some failure or timeout). L</guestfs_launch> internally "
34904 "moves the state from CONFIG to LAUNCHING while it is running."
34908 #: ../src/guestfs.pod:2261
34910 "API actions such as L</guestfs_mount> can only be issued when in the READY "
34911 "state. These API calls block waiting for the command to be carried out "
34912 "(ie. the state to transition to BUSY and then back to READY). There are no "
34913 "non-blocking versions, and no way to issue more than one command per handle "
34914 "at the same time."
34918 #: ../src/guestfs.pod:2267
34920 "Finally, the child process sends asynchronous messages back to the main "
34921 "program, such as kernel log messages. You can register a callback to "
34922 "receive these messages."
34926 #: ../src/guestfs.pod:2271
34931 #: ../src/guestfs.pod:2273
34932 msgid "APPLIANCE BOOT PROCESS"
34936 #: ../src/guestfs.pod:2275
34938 "This process has evolved and continues to evolve. The description here "
34939 "corresponds only to the current version of libguestfs and is provided for "
34940 "information only."
34944 #: ../src/guestfs.pod:2279
34946 "In order to follow the stages involved below, enable libguestfs debugging "
34947 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
34951 #: ../src/guestfs.pod:2284
34952 msgid "Create the appliance"
34956 #: ../src/guestfs.pod:2286
34958 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
34959 "initrd and the appliance."
34963 #: ../src/guestfs.pod:2289
34965 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
34966 "directory if C<TMPDIR> is set)."
34970 #: ../src/guestfs.pod:2292
34972 "For a complete description of how the appliance is created and cached, read "
34973 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
34977 #: ../src/guestfs.pod:2296
34978 msgid "Start qemu and boot the kernel"
34982 #: ../src/guestfs.pod:2298
34983 msgid "qemu is invoked to boot the kernel."
34987 #: ../src/guestfs.pod:2300
34988 msgid "Run the initrd"
34992 #: ../src/guestfs.pod:2302
34994 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
34995 "appliance. The purpose of the initrd is to load enough kernel modules in "
34996 "order that the appliance itself can be mounted and started."
35000 #: ../src/guestfs.pod:2306
35002 "The initrd is a cpio archive called "
35003 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
35007 #: ../src/guestfs.pod:2309
35009 "When the initrd has started you will see messages showing that kernel "
35010 "modules are being loaded, similar to this:"
35014 #: ../src/guestfs.pod:2312
35017 " febootstrap: ext2 mini initrd starting up\n"
35018 " febootstrap: mounting /sys\n"
35019 " febootstrap: internal insmod libcrc32c.ko\n"
35020 " febootstrap: internal insmod crc32c-intel.ko\n"
35025 #: ../src/guestfs.pod:2317
35026 msgid "Find and mount the appliance device"
35030 #: ../src/guestfs.pod:2319
35032 "The appliance is a sparse file containing an ext2 filesystem which contains "
35033 "a familiar (although reduced in size) Linux operating system. It would "
35034 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
35038 #: ../src/guestfs.pod:2323
35040 "The regular disks being inspected by libguestfs are the first devices "
35041 "exposed by qemu (eg. as C</dev/vda>)."
35045 #: ../src/guestfs.pod:2326
35047 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
35048 "there was only one regular disk)."
35052 #: ../src/guestfs.pod:2329
35054 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
35055 "and switch root into the appliance, and run C</init> from the appliance."
35059 #: ../src/guestfs.pod:2333
35060 msgid "If this works successfully you will see messages such as:"
35064 #: ../src/guestfs.pod:2335
35067 " febootstrap: picked /sys/block/vdb/dev as root device\n"
35068 " febootstrap: creating /dev/root as block special 252:16\n"
35069 " febootstrap: mounting new root on /root\n"
35070 " febootstrap: chroot\n"
35071 " Starting /init script ...\n"
35076 #: ../src/guestfs.pod:2341
35078 "Note that C<Starting /init script ...> indicates that the appliance's init "
35079 "script is now running."
35083 #: ../src/guestfs.pod:2344
35084 msgid "Initialize the appliance"
35088 #: ../src/guestfs.pod:2346
35090 "The appliance itself now initializes itself. This involves starting certain "
35091 "processes like C<udev>, possibly printing some debug information, and "
35092 "finally running the daemon (C<guestfsd>)."
35096 #: ../src/guestfs.pod:2350
35101 #: ../src/guestfs.pod:2352
35103 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
35108 #: ../src/guestfs.pod:2355
35111 " verbose daemon enabled\n"
35116 #: ../src/guestfs.pod:2357
35118 "The daemon expects to see a named virtio-serial port exposed by qemu and "
35119 "connected on the other end to the library."
35123 #: ../src/guestfs.pod:2360
35125 "The daemon connects to this port (and hence to the library) and sends a four "
35126 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
35127 "protocol (see below)."
35131 #: ../src/guestfs.pod:2366
35132 msgid "COMMUNICATION PROTOCOL"
35136 #: ../src/guestfs.pod:2368
35138 "Don't rely on using this protocol directly. This section documents how it "
35139 "currently works, but it may change at any time."
35143 #: ../src/guestfs.pod:2371
35145 "The protocol used to talk between the library and the daemon running inside "
35146 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
35147 "1014, RFC 1832, RFC 4506)."
35151 #: ../src/guestfs.pod:2375
35153 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
35154 "this file is automatically generated)."
35158 #: ../src/guestfs.pod:2378
35160 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
35161 "and C<FileOut> parameters, which are handled with very simple request/reply "
35162 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
35163 "parameters, which use the same request and reply messages, but they may also "
35164 "be followed by files sent using a chunked encoding."
35168 #: ../src/guestfs.pod:2385
35169 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
35173 #: ../src/guestfs.pod:2387
35174 msgid "For ordinary functions, the request message is:"
35178 #: ../src/guestfs.pod:2389
35181 " total length (header + arguments,\n"
35182 " but not including the length word itself)\n"
35183 " struct guestfs_message_header (encoded as XDR)\n"
35184 " struct guestfs_<foo>_args (encoded as XDR)\n"
35189 #: ../src/guestfs.pod:2394
35191 "The total length field allows the daemon to allocate a fixed size buffer "
35192 "into which it slurps the rest of the message. As a result, the total length "
35193 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
35194 "effective size of any request is limited to somewhere under this size."
35198 #: ../src/guestfs.pod:2400
35200 "Note also that many functions don't take any arguments, in which case the "
35201 "C<guestfs_I<foo>_args> is completely omitted."
35205 #: ../src/guestfs.pod:2403
35207 "The header contains the procedure number (C<guestfs_proc>) which is how the "
35208 "receiver knows what type of args structure to expect, or none at all."
35212 #: ../src/guestfs.pod:2407
35214 "For functions that take optional arguments, the optional arguments are "
35215 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
35216 "arguments. A bitmask in the header indicates which optional arguments are "
35217 "meaningful. The bitmask is also checked to see if it contains bits set "
35218 "which the daemon does not know about (eg. if more optional arguments were "
35219 "added in a later version of the library), and this causes the call to be "
35224 #: ../src/guestfs.pod:2415
35225 msgid "The reply message for ordinary functions is:"
35229 #: ../src/guestfs.pod:2417
35232 " total length (header + ret,\n"
35233 " but not including the length word itself)\n"
35234 " struct guestfs_message_header (encoded as XDR)\n"
35235 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35240 #: ../src/guestfs.pod:2422
35242 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
35243 "functions that return no formal return values."
35247 #: ../src/guestfs.pod:2425
35248 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
35252 #: ../src/guestfs.pod:2428
35254 "In the case of an error, a flag is set in the header, and the reply message "
35255 "is slightly changed:"
35259 #: ../src/guestfs.pod:2431
35262 " total length (header + error,\n"
35263 " but not including the length word itself)\n"
35264 " struct guestfs_message_header (encoded as XDR)\n"
35265 " struct guestfs_message_error (encoded as XDR)\n"
35270 #: ../src/guestfs.pod:2436
35272 "The C<guestfs_message_error> structure contains the error message as a "
35277 #: ../src/guestfs.pod:2439
35278 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
35282 #: ../src/guestfs.pod:2441
35284 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
35285 "The normal request message is sent (see above). However this is followed by "
35286 "a sequence of file chunks."
35290 #: ../src/guestfs.pod:2445
35293 " total length (header + arguments,\n"
35294 " but not including the length word itself,\n"
35295 " and not including the chunks)\n"
35296 " struct guestfs_message_header (encoded as XDR)\n"
35297 " struct guestfs_<foo>_args (encoded as XDR)\n"
35298 " sequence of chunks for FileIn param #0\n"
35299 " sequence of chunks for FileIn param #1 etc.\n"
35304 #: ../src/guestfs.pod:2453
35305 msgid "The \"sequence of chunks\" is:"
35309 #: ../src/guestfs.pod:2455
35312 " length of chunk (not including length word itself)\n"
35313 " struct guestfs_chunk (encoded as XDR)\n"
35314 " length of chunk\n"
35315 " struct guestfs_chunk (encoded as XDR)\n"
35317 " length of chunk\n"
35318 " struct guestfs_chunk (with data.data_len == 0)\n"
35323 #: ../src/guestfs.pod:2463
35325 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
35326 "is set in the final chunk to indicate either successful completion or early "
35331 #: ../src/guestfs.pod:2467
35333 "At time of writing there are no functions that have more than one FileIn "
35334 "parameter. However this is (theoretically) supported, by sending the "
35335 "sequence of chunks for each FileIn parameter one after another (from left to "
35340 #: ../src/guestfs.pod:2472
35342 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
35343 "transfer. The library does this by sending a chunk with a special flag set "
35344 "to indicate cancellation. When the daemon sees this, it cancels the whole "
35345 "RPC, does I<not> send any reply, and goes back to reading the next request."
35349 #: ../src/guestfs.pod:2478
35351 "The daemon may also cancel. It does this by writing a special word "
35352 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
35353 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
35354 "cancel chunk). The special word is chosen so that even if cancellation "
35355 "happens right at the end of the transfer (after the library has finished "
35356 "writing and has started listening for the reply), the \"spurious\" cancel "
35357 "flag will not be confused with the reply message."
35361 #: ../src/guestfs.pod:2487
35363 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
35364 "limit), and also files where the size is not known in advance (eg. from "
35365 "pipes or sockets). However the chunks are rather small "
35366 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
35367 "to keep much in memory."
35371 #: ../src/guestfs.pod:2493
35372 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
35376 #: ../src/guestfs.pod:2495
35378 "The protocol for FileOut parameters is exactly the same as for FileIn "
35379 "parameters, but with the roles of daemon and library reversed."
35383 #: ../src/guestfs.pod:2498
35386 " total length (header + ret,\n"
35387 " but not including the length word itself,\n"
35388 " and not including the chunks)\n"
35389 " struct guestfs_message_header (encoded as XDR)\n"
35390 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35391 " sequence of chunks for FileOut param #0\n"
35392 " sequence of chunks for FileOut param #1 etc.\n"
35397 #: ../src/guestfs.pod:2506
35398 msgid "INITIAL MESSAGE"
35402 #: ../src/guestfs.pod:2508
35404 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
35405 "which indicates that the guest and daemon is alive. This is what "
35406 "L</guestfs_launch> waits for."
35410 #: ../src/guestfs.pod:2512
35411 msgid "PROGRESS NOTIFICATION MESSAGES"
35415 #: ../src/guestfs.pod:2514
35417 "The daemon may send progress notification messages at any time. These are "
35418 "distinguished by the normal length word being replaced by "
35419 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
35423 #: ../src/guestfs.pod:2518
35425 "The library turns them into progress callbacks (see "
35426 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
35431 #: ../src/guestfs.pod:2522
35433 "The daemon self-limits the frequency of progress messages it sends (see "
35434 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
35439 #: ../src/guestfs.pod:2526
35440 msgid "LIBGUESTFS VERSION NUMBERS"
35444 #: ../src/guestfs.pod:2528
35446 "Since April 2010, libguestfs has started to make separate development and "
35447 "stable releases, along with corresponding branches in our git repository. "
35448 "These separate releases can be identified by version number:"
35452 #: ../src/guestfs.pod:2533
35455 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
35456 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
35462 " | `-------- sub-version\n"
35464 " `------ always '1' because we don't change the ABI\n"
35469 #: ../src/guestfs.pod:2544
35470 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
35474 #: ../src/guestfs.pod:2546
35476 "As time passes we cherry pick fixes from the development branch and backport "
35477 "those into the stable branch, the effect being that the stable branch should "
35478 "get more stable and less buggy over time. So the stable releases are ideal "
35479 "for people who don't need new features but would just like the software to "
35484 #: ../src/guestfs.pod:2552
35485 msgid "Our criteria for backporting changes are:"
35489 #: ../src/guestfs.pod:2558
35491 "Documentation changes which don't affect any code are backported unless the "
35492 "documentation refers to a future feature which is not in stable."
35496 #: ../src/guestfs.pod:2564
35498 "Bug fixes which are not controversial, fix obvious problems, and have been "
35499 "well tested are backported."
35503 #: ../src/guestfs.pod:2569
35505 "Simple rearrangements of code which shouldn't affect how it works get "
35506 "backported. This is so that the code in the two branches doesn't get too "
35507 "far out of step, allowing us to backport future fixes more easily."
35511 #: ../src/guestfs.pod:2575
35513 "We I<don't> backport new features, new APIs, new tools etc, except in one "
35514 "exceptional case: the new feature is required in order to implement an "
35515 "important bug fix."
35519 #: ../src/guestfs.pod:2581
35521 "A new stable branch starts when we think the new features in development are "
35522 "substantial and compelling enough over the current stable branch to warrant "
35523 "it. When that happens we create new stable and development versions 1.N.0 "
35524 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
35525 "stable at this point, but by backporting fixes from development, that branch "
35526 "will stabilize over time."
35530 #: ../src/guestfs.pod:2589
35531 msgid "EXTENDING LIBGUESTFS"
35535 #: ../src/guestfs.pod:2591
35536 msgid "ADDING A NEW API ACTION"
35540 #: ../src/guestfs.pod:2593
35542 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
35543 "documentation) are generated, and this makes it easy to extend the "
35548 #: ../src/guestfs.pod:2597
35549 msgid "To add a new API action there are two changes:"
35553 #: ../src/guestfs.pod:2603
35555 "You need to add a description of the call (name, parameters, return type, "
35556 "tests, documentation) to C<generator/generator_actions.ml>."
35560 #: ../src/guestfs.pod:2606
35562 "There are two sorts of API action, depending on whether the call goes "
35563 "through to the daemon in the appliance, or is serviced entirely by the "
35564 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
35565 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
35566 "an example of the latter, since a trace flag is maintained in the handle and "
35567 "all tracing is done on the library side."
35571 #: ../src/guestfs.pod:2614
35573 "Most new actions are of the first type, and get added to the "
35574 "C<daemon_functions> list. Each function has a unique procedure number used "
35575 "in the RPC protocol which is assigned to that action when we publish "
35576 "libguestfs and cannot be reused. Take the latest procedure number and "
35581 #: ../src/guestfs.pod:2620
35583 "For library-only actions of the second type, add to the "
35584 "C<non_daemon_functions> list. Since these functions are serviced by the "
35585 "library and do not travel over the RPC mechanism to the daemon, these "
35586 "functions do not need a procedure number, and so the procedure number is set "
35591 #: ../src/guestfs.pod:2628
35592 msgid "Implement the action (in C):"
35596 #: ../src/guestfs.pod:2630
35598 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
35599 "C<daemon/> directory."
35603 #: ../src/guestfs.pod:2633
35605 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
35606 "(note: double underscore) in the C<src/> directory."
35610 #: ../src/guestfs.pod:2636
35611 msgid "In either case, use another function as an example of what to do."
35615 #: ../src/guestfs.pod:2640
35616 msgid "After making these changes, use C<make> to compile."
35620 #: ../src/guestfs.pod:2642
35622 "Note that you don't need to implement the RPC, language bindings, manual "
35623 "pages or anything else. It's all automatically generated from the OCaml "
35628 #: ../src/guestfs.pod:2646
35629 msgid "ADDING TESTS FOR AN API ACTION"
35633 #: ../src/guestfs.pod:2648
35635 "You can supply zero or as many tests as you want per API call. The tests "
35636 "can either be added as part of the API description "
35637 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
35638 "drop a script into C<regressions/>. Note that adding a script to "
35639 "C<regressions/> is slower, so if possible use the first method."
35643 #: ../src/guestfs.pod:2654
35645 "The following describes the test environment used when you add an API test "
35646 "in C<generator_actions.ml>."
35650 #: ../src/guestfs.pod:2657
35651 msgid "The test environment has 4 block devices:"
35655 #: ../src/guestfs.pod:2661
35656 msgid "C</dev/sda> 500MB"
35660 #: ../src/guestfs.pod:2663
35661 msgid "General block device for testing."
35665 #: ../src/guestfs.pod:2665
35666 msgid "C</dev/sdb> 50MB"
35670 #: ../src/guestfs.pod:2667
35672 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
35677 #: ../src/guestfs.pod:2670
35678 msgid "C</dev/sdc> 10MB"
35682 #: ../src/guestfs.pod:2672
35683 msgid "Used in a few tests where two block devices are needed."
35687 #: ../src/guestfs.pod:2674
35688 msgid "C</dev/sdd>"
35692 #: ../src/guestfs.pod:2676
35693 msgid "ISO with fixed content (see C<images/test.iso>)."
35697 #: ../src/guestfs.pod:2680
35699 "To be able to run the tests in a reasonable amount of time, the libguestfs "
35700 "appliance and block devices are reused between tests. So don't try testing "
35701 "L</guestfs_kill_subprocess> :-x"
35705 #: ../src/guestfs.pod:2684
35707 "Each test starts with an initial scenario, selected using one of the "
35708 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
35709 "initialize the disks mentioned above in a particular way as documented in "
35710 "C<generator_types.ml>. You should not assume anything about the previous "
35711 "contents of other disks that are not initialized."
35715 #: ../src/guestfs.pod:2690
35717 "You can add a prerequisite clause to any individual test. This is a "
35718 "run-time check, which, if it fails, causes the test to be skipped. Useful "
35719 "if testing a command which might not work on all variations of libguestfs "
35720 "builds. A test that has prerequisite of C<Always> means to run "
35725 #: ../src/guestfs.pod:2696
35727 "In addition, packagers can skip individual tests by setting environment "
35728 "variables before running C<make check>."
35732 #: ../src/guestfs.pod:2699
35735 " SKIP_TEST_<CMD>_<NUM>=1\n"
35740 #: ../src/guestfs.pod:2701
35741 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
35745 #: ../src/guestfs.pod:2703
35750 #: ../src/guestfs.pod:2705
35753 " SKIP_TEST_<CMD>=1\n"
35758 #: ../src/guestfs.pod:2707
35759 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
35763 #: ../src/guestfs.pod:2709
35764 msgid "Packagers can run only certain tests by setting for example:"
35768 #: ../src/guestfs.pod:2711
35771 " TEST_ONLY=\"vfs_type zerofree\"\n"
35776 #: ../src/guestfs.pod:2713
35778 "See C<capitests/tests.c> for more details of how these environment variables "
35783 #: ../src/guestfs.pod:2716
35784 msgid "DEBUGGING NEW API ACTIONS"
35788 #: ../src/guestfs.pod:2718
35789 msgid "Test new actions work before submitting them."
35793 #: ../src/guestfs.pod:2720
35794 msgid "You can use guestfish to try out new commands."
35798 #: ../src/guestfs.pod:2722
35800 "Debugging the daemon is a problem because it runs inside a minimal "
35801 "environment. However you can fprintf messages in the daemon to stderr, and "
35802 "they will show up if you use C<guestfish -v>."
35806 #: ../src/guestfs.pod:2726
35807 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
35811 #: ../src/guestfs.pod:2728
35813 "Our C source code generally adheres to some basic code-formatting "
35814 "conventions. The existing code base is not totally consistent on this "
35815 "front, but we do prefer that contributed code be formatted similarly. In "
35816 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
35817 "indentation level, and other than that, follow the K&R style."
35821 #: ../src/guestfs.pod:2734
35823 "If you use Emacs, add the following to one of one of your start-up files "
35824 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
35828 #: ../src/guestfs.pod:2737
35831 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
35832 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
35833 " (add-hook 'find-file-hook\n"
35834 " '(lambda () (if (and buffer-file-name\n"
35835 " (string-match \"/libguestfs\\\\>\"\n"
35836 " (buffer-file-name))\n"
35837 " (not (string-equal mode-name \"Change Log\"))\n"
35838 " (not (string-equal mode-name \"Makefile\")))\n"
35839 " (setq indent-tabs-mode nil))))\n"
35844 #: ../src/guestfs.pod:2747
35847 " ;;; When editing C sources in libguestfs, use this style.\n"
35848 " (defun libguestfs-c-mode ()\n"
35849 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
35851 " (c-set-style \"K&R\")\n"
35852 " (setq c-indent-level 2)\n"
35853 " (setq c-basic-offset 2))\n"
35854 " (add-hook 'c-mode-hook\n"
35855 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
35856 " (buffer-file-name))\n"
35857 " (libguestfs-c-mode))))\n"
35862 #: ../src/guestfs.pod:2759
35863 msgid "Enable warnings when compiling (and fix any problems this finds):"
35867 #: ../src/guestfs.pod:2762
35870 " ./configure --enable-gcc-warnings\n"
35875 #: ../src/guestfs.pod:2764
35876 msgid "Useful targets are:"
35880 #: ../src/guestfs.pod:2766
35883 " make syntax-check # checks the syntax of the C code\n"
35884 " make check # runs the test suite\n"
35889 #: ../src/guestfs.pod:2769
35890 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
35894 #: ../src/guestfs.pod:2771
35896 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
35897 "which are used to do shell quoting."
35901 #: ../src/guestfs.pod:2776
35906 #: ../src/guestfs.pod:2778
35908 "Simple shell quoted string. Any spaces or other shell characters are "
35913 #: ../src/guestfs.pod:2781
35918 #: ../src/guestfs.pod:2783
35920 "Same as C<%Q> except the string is treated as a path which is prefixed by "
35925 #: ../src/guestfs.pod:2790
35928 " asprintf (&cmd, \"cat %R\", path);\n"
35933 #: ../src/guestfs.pod:2792
35934 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
35938 #: ../src/guestfs.pod:2794
35940 "I<Note:> Do I<not> use these when you are passing parameters to the "
35941 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
35942 "because they are not passed via the shell (instead, straight to exec). You "
35943 "probably want to use the C<sysroot_path()> function however."
35947 #: ../src/guestfs.pod:2800
35948 msgid "SUBMITTING YOUR NEW API ACTIONS"
35952 #: ../src/guestfs.pod:2802
35954 "Submit patches to the mailing list: "
35955 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
35956 "L<rjones@redhat.com>."
35960 #: ../src/guestfs.pod:2806
35961 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
35965 #: ../src/guestfs.pod:2808
35966 msgid "We support i18n (gettext anyhow) in the library."
35970 #: ../src/guestfs.pod:2810
35972 "However many messages come from the daemon, and we don't translate those at "
35973 "the moment. One reason is that the appliance generally has all locale files "
35974 "removed from it, because they take up a lot of space. So we'd have to readd "
35975 "some of those, as well as copying our PO files into the appliance."
35979 #: ../src/guestfs.pod:2816
35981 "Debugging messages are never translated, since they are intended for the "
35986 #: ../src/guestfs.pod:2819
35987 msgid "SOURCE CODE SUBDIRECTORIES"
35991 #: ../src/guestfs.pod:2825
35992 msgid "The libguestfs appliance, build scripts and so on."
35996 #: ../src/guestfs.pod:2827
35997 msgid "C<capitests>"
36001 #: ../src/guestfs.pod:2829
36002 msgid "Automated tests of the C API."
36006 #: ../src/guestfs.pod:2831
36011 #: ../src/guestfs.pod:2833
36013 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
36018 #: ../src/guestfs.pod:2836
36023 #: ../src/guestfs.pod:2838
36025 "Safety and liveness tests of components that libguestfs depends upon (not of "
36026 "libguestfs itself). Mainly this is for qemu and the kernel."
36030 #: ../src/guestfs.pod:2841
36035 #: ../src/guestfs.pod:2843
36036 msgid "Outside contributions, experimental parts."
36040 #: ../src/guestfs.pod:2845
36045 #: ../src/guestfs.pod:2847
36047 "The daemon that runs inside the libguestfs appliance and carries out "
36052 #: ../src/guestfs.pod:2850
36057 #: ../src/guestfs.pod:2852
36058 msgid "L<virt-df(1)> command and documentation."
36062 #: ../src/guestfs.pod:2854
36067 #: ../src/guestfs.pod:2856
36068 msgid "L<virt-edit(1)> command and documentation."
36072 #: ../src/guestfs.pod:2858
36073 msgid "C<examples>"
36077 #: ../src/guestfs.pod:2860
36078 msgid "C API example code."
36082 #: ../src/guestfs.pod:2862
36087 #: ../src/guestfs.pod:2864
36089 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
36090 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
36091 "L<virt-tar-out(1)>."
36095 #: ../src/guestfs.pod:2868
36100 #: ../src/guestfs.pod:2870
36101 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
36105 #: ../src/guestfs.pod:2872
36106 msgid "C<generator>"
36110 #: ../src/guestfs.pod:2874
36112 "The crucially important generator, used to automatically generate large "
36113 "amounts of boilerplate C code for things like RPC and bindings."
36117 #: ../src/guestfs.pod:2877
36122 #: ../src/guestfs.pod:2879
36123 msgid "Files used by the test suite."
36127 #: ../src/guestfs.pod:2881
36128 msgid "Some \"phony\" guest images which we test against."
36132 #: ../src/guestfs.pod:2883
36133 msgid "C<inspector>"
36137 #: ../src/guestfs.pod:2885
36138 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
36142 #: ../src/guestfs.pod:2887
36147 #: ../src/guestfs.pod:2889
36148 msgid "Logo used on the website. The fish is called Arthur by the way."
36152 #: ../src/guestfs.pod:2891
36157 #: ../src/guestfs.pod:2893
36158 msgid "M4 macros used by autoconf."
36162 #: ../src/guestfs.pod:2895
36167 #: ../src/guestfs.pod:2897
36168 msgid "Translations of simple gettext strings."
36172 #: ../src/guestfs.pod:2899
36177 #: ../src/guestfs.pod:2901
36179 "The build infrastructure and PO files for translations of manpages and POD "
36180 "files. Eventually this will be combined with the C<po> directory, but that "
36181 "is rather complicated."
36185 #: ../src/guestfs.pod:2905
36186 msgid "C<regressions>"
36190 #: ../src/guestfs.pod:2907
36191 msgid "Regression tests."
36195 #: ../src/guestfs.pod:2909
36200 #: ../src/guestfs.pod:2911
36201 msgid "L<virt-rescue(1)> command and documentation."
36205 #: ../src/guestfs.pod:2913
36210 #: ../src/guestfs.pod:2915
36211 msgid "Source code to the C library."
36215 #: ../src/guestfs.pod:2917
36220 #: ../src/guestfs.pod:2919
36221 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
36225 #: ../src/guestfs.pod:2921
36226 msgid "C<test-tool>"
36230 #: ../src/guestfs.pod:2923
36232 "Test tool for end users to test if their qemu/kernel combination will work "
36237 #: ../src/guestfs.pod:2926
36242 #: ../src/guestfs.pod:2928
36247 #: ../src/guestfs.pod:2930
36252 #: ../src/guestfs.pod:2932
36257 #: ../src/guestfs.pod:2934
36262 #: ../src/guestfs.pod:2936
36267 #: ../src/guestfs.pod:2938
36272 #: ../src/guestfs.pod:2940
36277 #: ../src/guestfs.pod:2942
36282 #: ../src/guestfs.pod:2944
36283 msgid "Language bindings."
36287 #: ../src/guestfs.pod:2948
36288 msgid "MAKING A STABLE RELEASE"
36292 #: ../src/guestfs.pod:2950
36294 "When we make a stable release, there are several steps documented here. See "
36295 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
36300 #: ../src/guestfs.pod:2958
36301 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
36305 #: ../src/guestfs.pod:2963
36306 msgid "Finalize RELEASE-NOTES."
36310 #: ../src/guestfs.pod:2967
36311 msgid "Update ROADMAP."
36315 #: ../src/guestfs.pod:2971
36316 msgid "Run C<src/api-support/update-from-tarballs.sh>."
36320 #: ../src/guestfs.pod:2975
36321 msgid "Push and pull from Transifex."
36325 #: ../src/guestfs.pod:2977
36330 #: ../src/guestfs.pod:2979
36338 #: ../src/guestfs.pod:2981
36339 msgid "to push the latest POT files to Transifex. Then run:"
36343 #: ../src/guestfs.pod:2983
36351 #: ../src/guestfs.pod:2985
36352 msgid "which is a wrapper to pull the latest translated C<*.po> files."
36356 #: ../src/guestfs.pod:2989
36358 "Create new stable and development directories under "
36359 "L<http://libguestfs.org/download>."
36363 #: ../src/guestfs.pod:2994
36364 msgid "Create the branch in git:"
36368 #: ../src/guestfs.pod:2996
36371 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
36372 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
36373 " git branch stable-1.XX\n"
36374 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
36379 #: ../src/guestfs.pod:3003
36384 #: ../src/guestfs.pod:3005
36385 msgid "PROTOCOL LIMITS"
36389 #: ../src/guestfs.pod:3007
36391 "Internally libguestfs uses a message-based protocol to pass API calls and "
36392 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
36393 "plenty more detail about this). The maximum message size used by the "
36394 "protocol is slightly less than 4 MB. For some API calls you may need to be "
36395 "aware of this limit. The API calls which may be affected are individually "
36396 "documented, with a link back to this section of the documentation."
36400 #: ../src/guestfs.pod:3015
36402 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
36403 "a simple string. Because this string is at some point internally encoded as "
36404 "a message, the maximum size that it can return is slightly under 4 MB. If "
36405 "the requested file is larger than this then you will get an error."
36409 #: ../src/guestfs.pod:3021
36411 "In order to transfer large files into and out of the guest filesystem, you "
36412 "need to use particular calls that support this. The sections L</UPLOADING> "
36413 "and L</DOWNLOADING> document how to do this."
36417 #: ../src/guestfs.pod:3025
36419 "You might also consider mounting the disk image using our FUSE filesystem "
36420 "support (L<guestmount(1)>)."
36424 #: ../src/guestfs.pod:3028
36425 msgid "MAXIMUM NUMBER OF DISKS"
36429 #: ../src/guestfs.pod:3030
36430 msgid "When using virtio disks (the default) the current limit is B<25> disks."
36434 #: ../src/guestfs.pod:3033
36436 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
36437 "slots. However febootstrap only understands disks with names C</dev/vda> "
36438 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
36443 #: ../src/guestfs.pod:3038
36445 "We are working to substantially raise this limit in future versions but it "
36446 "requires complex changes to qemu."
36450 #: ../src/guestfs.pod:3041
36452 "In future versions of libguestfs it should also be possible to \"hot plug\" "
36453 "disks (add and remove disks after calling L</guestfs_launch>). This also "
36454 "requires changes to qemu."
36458 #: ../src/guestfs.pod:3045
36459 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
36463 #: ../src/guestfs.pod:3047
36464 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
36468 #: ../src/guestfs.pod:3049
36470 "This is because it reserves 4 bits for the minor device number (thus "
36471 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
36475 #: ../src/guestfs.pod:3052
36477 "If you attach a disk with more than 15 partitions, the extra partitions are "
36478 "ignored by libguestfs."
36482 #: ../src/guestfs.pod:3055
36483 msgid "MAXIMUM SIZE OF A DISK"
36487 #: ../src/guestfs.pod:3057
36488 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
36492 #: ../src/guestfs.pod:3059
36494 "We have tested block devices up to 1 exabyte (2**60 or "
36495 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
36500 #: ../src/guestfs.pod:3063
36502 "Although libguestfs probably does not impose any limit, the underlying host "
36503 "storage will. If you store disk images on a host ext4 filesystem, then the "
36504 "maximum size will be limited by the maximum ext4 file size (currently 16 "
36505 "TB). If you store disk images as host logical volumes then you are limited "
36506 "by the maximum size of an LV."
36510 #: ../src/guestfs.pod:3069
36512 "For the hugest disk image files, we recommend using XFS on the host for "
36517 #: ../src/guestfs.pod:3072
36518 msgid "MAXIMUM SIZE OF A PARTITION"
36522 #: ../src/guestfs.pod:3074
36524 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
36525 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
36526 "address a partition located beyond 2 TB on the disk."
36530 #: ../src/guestfs.pod:3078
36532 "It is recommended that you use GPT partitions on disks which are larger than "
36533 "this size. GPT uses 64 bit sector numbers and so can address partitions "
36534 "which are theoretically larger than the largest disk we could support."
36538 #: ../src/guestfs.pod:3083
36539 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
36543 #: ../src/guestfs.pod:3085
36545 "This depends on the filesystem type. libguestfs itself does not impose any "
36546 "known limit. Consult Wikipedia or the filesystem documentation to find out "
36547 "what these limits are."
36551 #: ../src/guestfs.pod:3089
36552 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
36556 #: ../src/guestfs.pod:3091
36558 "The API functions L</guestfs_upload>, L</guestfs_download>, "
36559 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
36560 "uploads and downloads."
36564 #: ../src/guestfs.pod:3095
36565 msgid "INSPECTION LIMITS"
36569 #: ../src/guestfs.pod:3097
36571 "The inspection code has several arbitrary limits on things like the size of "
36572 "Windows Registry hive it will read, and the length of product name. These "
36573 "are intended to stop a malicious guest from consuming arbitrary amounts of "
36574 "memory and disk space on the host, and should not be reached in practice. "
36575 "See the source code for more information."
36579 #: ../src/guestfs.pod:3123
36581 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
36582 "effect as calling C<guestfs_set_verbose (g, 1)>."
36586 #: ../src/guestfs.pod:3135
36588 "Set the path that libguestfs uses to search for a supermin appliance. See "
36589 "the discussion of paths in section L</PATH> above."
36593 #: ../src/guestfs.pod:3144
36594 msgid "See also L</QEMU WRAPPERS> above."
36598 #: ../src/guestfs.pod:3148
36600 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
36601 "effect as calling C<guestfs_set_trace (g, 1)>."
36605 #: ../src/guestfs.pod:3166
36607 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
36608 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
36609 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, "
36610 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
36611 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
36612 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
36613 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
36614 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
36615 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
36619 #: ../src/guestfs.pod:3197
36621 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
36622 "L<lvm(8)>, L<disktype(1)>."
36626 #: ../src/guestfs.pod:3204 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
36631 #: ../src/guestfs.pod:3206
36632 msgid "To get a list of bugs against libguestfs use this link:"
36636 #: ../src/guestfs.pod:3208
36637 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
36641 #: ../src/guestfs.pod:3210
36642 msgid "To report a new bug against libguestfs use this link:"
36646 #: ../src/guestfs.pod:3212
36647 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
36651 #: ../src/guestfs.pod:3214
36652 msgid "When reporting a bug, please check:"
36656 #: ../src/guestfs.pod:3220
36657 msgid "That the bug hasn't been reported already."
36661 #: ../src/guestfs.pod:3224
36662 msgid "That you are testing a recent version."
36666 #: ../src/guestfs.pod:3228
36667 msgid "Describe the bug accurately, and give a way to reproduce it."
36671 #: ../src/guestfs.pod:3232
36673 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
36678 #: ../test-tool/libguestfs-test-tool.pod:5
36679 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
36683 #: ../test-tool/libguestfs-test-tool.pod:9
36686 " libguestfs-test-tool [--options]\n"
36691 #: ../test-tool/libguestfs-test-tool.pod:13
36693 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
36694 "to check basic libguestfs functionality is working. This is needed because "
36695 "libguestfs occasionally breaks for reasons beyond our control: usually "
36696 "because of changes in the underlying qemu or kernel packages, or the host "
36701 #: ../test-tool/libguestfs-test-tool.pod:19
36702 msgid "If you suspect a problem in libguestfs, then just run:"
36706 #: ../test-tool/libguestfs-test-tool.pod:21
36709 " libguestfs-test-tool\n"
36714 #: ../test-tool/libguestfs-test-tool.pod:23
36715 msgid "It will print lots of diagnostic messages."
36719 #: ../test-tool/libguestfs-test-tool.pod:25
36720 msgid "If it runs to completion successfully, you will see this near the end:"
36724 #: ../test-tool/libguestfs-test-tool.pod:27
36727 " ===== TEST FINISHED OK =====\n"
36732 #: ../test-tool/libguestfs-test-tool.pod:29
36733 msgid "and the test tool will exit with code 0."
36737 #: ../test-tool/libguestfs-test-tool.pod:31
36739 "If it fails (and/or exits with non-zero error code), please paste the "
36740 "I<complete, unedited> output of the test tool into a bug report. More "
36741 "information about reporting bugs can be found on the "
36742 "L<http://libguestfs.org/> website."
36746 #: ../test-tool/libguestfs-test-tool.pod:42
36747 msgid "Display short usage information and exit."
36751 #: ../test-tool/libguestfs-test-tool.pod:44
36752 msgid "B<--qemu qemu_binary>"
36756 #: ../test-tool/libguestfs-test-tool.pod:46
36758 "If you have downloaded another qemu binary, point this option at the full "
36759 "path of the binary to try it."
36763 #: ../test-tool/libguestfs-test-tool.pod:49
36764 msgid "B<--qemudir qemu_source_dir>"
36768 #: ../test-tool/libguestfs-test-tool.pod:51
36770 "If you have compiled qemu from source, point this option at the source "
36771 "directory to try it."
36775 #: ../test-tool/libguestfs-test-tool.pod:54
36780 #: ../test-tool/libguestfs-test-tool.pod:56
36781 msgid "B<--timeout N>"
36785 #: ../test-tool/libguestfs-test-tool.pod:58
36787 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
36788 "minutes) which does not usually need to be adjusted."
36792 #: ../test-tool/libguestfs-test-tool.pod:63
36793 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
36797 #: ../test-tool/libguestfs-test-tool.pod:65
36799 "If you have compiled another version of qemu from source and would like to "
36800 "try that, then you can use the I<--qemudir> option to point to the qemu "
36801 "source directory."
36805 #: ../test-tool/libguestfs-test-tool.pod:69
36807 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
36808 "option to point to the binary."
36812 #: ../test-tool/libguestfs-test-tool.pod:72
36814 "Note when using these options, you can ignore the business of qemu wrapper "
36815 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
36816 "wrapper script for you if one is needed."
36820 #: ../test-tool/libguestfs-test-tool.pod:76
36821 msgid "TRYING OUT A DIFFERENT KERNEL"
36825 #: ../test-tool/libguestfs-test-tool.pod:78
36827 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
36828 "libguestfs tries. You do this by setting the environment variables "
36829 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
36833 #: ../test-tool/libguestfs-test-tool.pod:82
36835 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
36840 #: ../test-tool/libguestfs-test-tool.pod:85
36841 msgid "SELF-DIAGNOSIS"
36845 #: ../test-tool/libguestfs-test-tool.pod:87
36847 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
36848 "produced by libguestfs-test-tool and/or possible errors."
36852 #: ../test-tool/libguestfs-test-tool.pod:92
36854 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
36855 "I<1> if there was an error."
36859 #: ../test-tool/libguestfs-test-tool.pod:97
36861 "For the full list of environment variables which may affect libguestfs, "
36862 "please see the L<guestfs(3)> manual page."
36866 #: ../test-tool/libguestfs-test-tool.pod:102
36867 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
36871 #: ../tools/virt-list-filesystems.pl:32
36872 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
36876 #: ../tools/virt-list-filesystems.pl:36
36879 " virt-list-filesystems [--options] domname\n"
36884 #: ../tools/virt-list-filesystems.pl:38
36887 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
36892 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
36894 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
36899 #: ../tools/virt-list-filesystems.pl:45
36901 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
36902 "are contained in a virtual machine or disk image."
36906 #: ../tools/virt-list-filesystems.pl:49
36908 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
36909 "functionality. For more complex cases you should look at the "
36910 "L<guestfish(1)> tool."
36914 #: ../tools/virt-list-filesystems.pl:112
36916 "With this option, C<virt-list-filesystems> displays the type of each "
36917 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
36921 #: ../tools/virt-list-filesystems.pl:119
36926 #: ../tools/virt-list-filesystems.pl:123
36928 "Normally we only show mountable filesystems. If this option is given then "
36929 "swap devices are shown too."
36933 #: ../tools/virt-list-filesystems.pl:197
36935 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
36936 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
36937 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36941 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
36942 msgid "Copyright (C) 2009 Red Hat Inc."
36946 #: ../tools/virt-list-partitions.pl:32
36947 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
36951 #: ../tools/virt-list-partitions.pl:36
36954 " virt-list-partitions [--options] domname\n"
36959 #: ../tools/virt-list-partitions.pl:38
36962 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
36967 #: ../tools/virt-list-partitions.pl:45
36969 "C<virt-list-partitions> is a command line tool to list the partitions that "
36970 "are contained in a virtual machine or disk image. It is mainly useful as a "
36971 "first step to using L<virt-resize(1)>."
36975 #: ../tools/virt-list-partitions.pl:50
36977 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
36978 "functionality. For more complex cases you should look at the "
36979 "L<guestfish(1)> tool."
36983 #: ../tools/virt-list-partitions.pl:113
36984 msgid "Show sizes in human-readable form (eg. \"1G\")."
36988 #: ../tools/virt-list-partitions.pl:123
36990 "With this option, C<virt-list-partitions> displays the type and size of each "
36991 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
36995 #: ../tools/virt-list-partitions.pl:130
37000 #: ../tools/virt-list-partitions.pl:132
37005 #: ../tools/virt-list-partitions.pl:134
37006 msgid "Display the total size of each block device (as a separate row or rows)."
37010 #: ../tools/virt-list-partitions.pl:267
37012 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
37013 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
37014 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37018 #: ../tools/virt-list-partitions.pl:283
37019 msgid "Copyright (C) 2009-2010 Red Hat Inc."
37023 #: ../tools/virt-make-fs.pl:37
37024 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
37028 #: ../tools/virt-make-fs.pl:41
37031 " virt-make-fs [--options] input.tar output.img\n"
37036 #: ../tools/virt-make-fs.pl:43
37039 " virt-make-fs [--options] input.tar.gz output.img\n"
37044 #: ../tools/virt-make-fs.pl:45
37047 " virt-make-fs [--options] directory output.img\n"
37052 #: ../tools/virt-make-fs.pl:49
37054 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
37055 "archive or some files in a directory. It is similar to tools like "
37056 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
37057 "it can create common filesystem types like ext2/3 or NTFS, which can be "
37058 "useful if you want to attach these filesystems to existing virtual machines "
37059 "(eg. to import large amounts of read-only data to a VM)."
37063 #: ../tools/virt-make-fs.pl:57
37064 msgid "Basic usage is:"
37068 #: ../tools/virt-make-fs.pl:59
37071 " virt-make-fs input output\n"
37076 #: ../tools/virt-make-fs.pl:61
37078 "where C<input> is either a directory containing files that you want to add, "
37079 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
37080 "C<output> is a disk image. The input type is detected automatically. The "
37081 "output disk image defaults to a raw ext2 image unless you specify extra "
37082 "flags (see L</OPTIONS> below)."
37086 #: ../tools/virt-make-fs.pl:67
37087 msgid "EXTRA SPACE"
37091 #: ../tools/virt-make-fs.pl:69
37093 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
37094 "the files that it contains, but might have extra space. Depending on how "
37095 "you are going to use the output, you might think this extra space is wasted "
37096 "and want to minimize it, or you might want to leave space so that more files "
37097 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
37098 "but you can use the I<--size> flag to leave space in the filesystem if you "
37103 #: ../tools/virt-make-fs.pl:77
37105 "An alternative way to leave extra space but not make the output image any "
37106 "bigger is to use an alternative disk image format (instead of the default "
37107 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
37108 "image format (check your hypervisor supports this before using it). This "
37109 "allows you to choose a large I<--size> but the extra space won't actually be "
37110 "allocated in the image until you try to store something in it."
37114 #: ../tools/virt-make-fs.pl:85
37116 "Don't forget that you can also use local commands including L<resize2fs(8)> "
37117 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
37118 "to build another image from scratch."
37122 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
37127 #: ../tools/virt-make-fs.pl:91
37130 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
37135 #: ../tools/virt-make-fs.pl:93
37136 msgid "FILESYSTEM TYPE"
37140 #: ../tools/virt-make-fs.pl:95
37142 "The default filesystem type is C<ext2>. Just about any filesystem type that "
37143 "libguestfs supports can be used (but I<not> read-only formats like "
37144 "ISO9660). Here are some of the more common choices:"
37148 #: ../tools/virt-make-fs.pl:101
37153 #: ../tools/virt-make-fs.pl:103
37155 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
37156 "you are not going to use the filesystem in a way that requires the journal, "
37157 "then this is just wasted overhead."
37161 #: ../tools/virt-make-fs.pl:107
37162 msgid "I<ntfs> or I<vfat>"
37166 #: ../tools/virt-make-fs.pl:109
37167 msgid "Useful if exporting data to a Windows guest."
37171 #: ../tools/virt-make-fs.pl:111
37173 "I<Note for vfat>: The tar archive or local directory must only contain files "
37174 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
37175 "program running within libguestfs is unable to change the ownership of "
37176 "non-root files, since vfat itself does not support this."
37180 #: ../tools/virt-make-fs.pl:116
37185 #: ../tools/virt-make-fs.pl:118
37187 "Lower overhead than C<ext2>, but certain limitations on filename length and "
37188 "total filesystem size."
37192 #: ../tools/virt-make-fs.pl:125
37195 " virt-make-fs --type=minix input minixfs.img\n"
37200 #: ../tools/virt-make-fs.pl:127
37201 msgid "TO PARTITION OR NOT TO PARTITION"
37205 #: ../tools/virt-make-fs.pl:129
37206 msgid "Optionally virt-make-fs can add a partition table to the output disk."
37210 #: ../tools/virt-make-fs.pl:131
37212 "Adding a partition can make the disk image more compatible with certain "
37213 "virtualized operating systems which don't expect to see a filesystem "
37214 "directly located on a block device (Linux doesn't care and will happily "
37215 "handle both types)."
37219 #: ../tools/virt-make-fs.pl:136
37221 "On the other hand, if you have a partition table then the output image is no "
37222 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
37223 "directly on a partitioned disk image. (However libguestfs tools such as "
37224 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
37228 #: ../tools/virt-make-fs.pl:144
37229 msgid "Add an MBR partition:"
37233 #: ../tools/virt-make-fs.pl:146
37236 " virt-make-fs --partition -- input disk.img\n"
37241 #: ../tools/virt-make-fs.pl:148
37243 "If the output disk image could be terabyte-sized or larger, it's better to "
37244 "use an EFI/GPT-compatible partition table:"
37248 #: ../tools/virt-make-fs.pl:151
37251 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
37256 #: ../tools/virt-make-fs.pl:179
37257 msgid "Enable debugging information."
37261 #: ../tools/virt-make-fs.pl:185
37262 msgid "B<--size=E<lt>NE<gt>>"
37266 #: ../tools/virt-make-fs.pl:187
37267 msgid "B<--size=+E<lt>NE<gt>>"
37271 #: ../tools/virt-make-fs.pl:189
37272 msgid "B<-s E<lt>NE<gt>>"
37276 #: ../tools/virt-make-fs.pl:191
37277 msgid "B<-s +E<lt>NE<gt>>"
37281 #: ../tools/virt-make-fs.pl:193
37282 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
37286 #: ../tools/virt-make-fs.pl:196
37288 "If this option is I<not> given, then the output image will be just large "
37289 "enough to contain all the files, with not much wasted space."
37293 #: ../tools/virt-make-fs.pl:199
37295 "To choose a fixed size output disk, specify an absolute number followed by "
37296 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37297 "Petabytes or Exabytes. This must be large enough to contain all the input "
37298 "files, else you will get an error."
37302 #: ../tools/virt-make-fs.pl:204
37304 "To leave extra space, specify C<+> (plus sign) and a number followed by "
37305 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37306 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
37307 "the input files, and (approximately) an extra 200 MB free space."
37311 #: ../tools/virt-make-fs.pl:210
37313 "Note that virt-make-fs estimates free space, and therefore will not produce "
37314 "filesystems containing precisely the free space requested. (It is much more "
37315 "expensive and time-consuming to produce a filesystem which has precisely the "
37316 "desired free space)."
37320 #: ../tools/virt-make-fs.pl:219
37321 msgid "B<--format=E<lt>fmtE<gt>>"
37325 #: ../tools/virt-make-fs.pl:221
37326 msgid "B<-F E<lt>fmtE<gt>>"
37330 #: ../tools/virt-make-fs.pl:223
37331 msgid "Choose the output disk image format."
37335 #: ../tools/virt-make-fs.pl:225
37336 msgid "The default is C<raw> (raw disk image)."
37340 #: ../tools/virt-make-fs.pl:227
37342 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
37343 "that would really make sense here is C<qcow2>."
37347 #: ../tools/virt-make-fs.pl:234
37348 msgid "B<--type=E<lt>fsE<gt>>"
37352 #: ../tools/virt-make-fs.pl:236
37353 msgid "B<-t E<lt>fsE<gt>>"
37357 #: ../tools/virt-make-fs.pl:238
37358 msgid "Choose the output filesystem type."
37362 #: ../tools/virt-make-fs.pl:240
37363 msgid "The default is C<ext2>."
37367 #: ../tools/virt-make-fs.pl:242
37368 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
37372 #: ../tools/virt-make-fs.pl:249
37373 msgid "B<--partition>"
37377 #: ../tools/virt-make-fs.pl:251
37378 msgid "B<--partition=E<lt>parttypeE<gt>>"
37382 #: ../tools/virt-make-fs.pl:253
37384 "If specified, this flag adds an MBR partition table to the output disk "
37389 #: ../tools/virt-make-fs.pl:256
37391 "You can change the partition table type, eg. I<--partition=gpt> for large "
37396 #: ../tools/virt-make-fs.pl:259
37398 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
37399 "might consider the next parameter to be the partition type. For example:"
37403 #: ../tools/virt-make-fs.pl:263
37406 " virt-make-fs --partition input.tar ...\n"
37411 #: ../tools/virt-make-fs.pl:265
37413 "would cause virt-make-fs to think you wanted to use a partition type of "
37414 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
37415 "dash) between options and the input file argument:"
37419 #: ../tools/virt-make-fs.pl:269
37422 " virt-make-fs --partition -- input.tar ...\n"
37427 #: ../tools/virt-make-fs.pl:541
37429 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
37430 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
37431 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
37435 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
37437 "When reporting bugs, please enable debugging and capture the I<complete> "
37442 #: ../tools/virt-make-fs.pl:558
37445 " export LIBGUESTFS_DEBUG=1\n"
37446 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
37451 #: ../tools/virt-make-fs.pl:561
37453 "Attach /tmp/virt-make-fs.log to a new bug report at "
37454 "L<https://bugzilla.redhat.com/>"
37458 #: ../tools/virt-tar.pl:33
37459 msgid "virt-tar - Extract or upload files to a virtual machine"
37463 #: ../tools/virt-tar.pl:37
37466 " virt-tar [--options] -x domname directory tarball\n"
37471 #: ../tools/virt-tar.pl:39
37474 " virt-tar [--options] -u domname tarball directory\n"
37479 #: ../tools/virt-tar.pl:41
37482 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
37487 #: ../tools/virt-tar.pl:43
37490 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
37495 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
37500 #: ../tools/virt-tar.pl:47
37502 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
37503 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
37507 #: ../tools/virt-tar.pl:52
37508 msgid "Download C</home> from the VM into a local tarball:"
37512 #: ../tools/virt-tar.pl:54
37515 " virt-tar -x domname /home home.tar\n"
37520 #: ../tools/virt-tar.pl:56
37523 " virt-tar -zx domname /home home.tar.gz\n"
37528 #: ../tools/virt-tar.pl:58
37529 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
37533 #: ../tools/virt-tar.pl:60
37536 " virt-tar -u domname uploadstuff.tar /tmp\n"
37541 #: ../tools/virt-tar.pl:62
37544 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
37549 #: ../tools/virt-tar.pl:66
37551 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
37552 "virtual machines. If you do this, you risk disk corruption in the VM. "
37553 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
37557 #: ../tools/virt-tar.pl:71
37559 "You can use I<-x> (extract) on live virtual machines, but you might get "
37560 "inconsistent results or errors if there is filesystem activity inside the "
37561 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
37562 "work, but the only way to guarantee consistent results is if the virtual "
37563 "machine is shut down."
37567 #: ../tools/virt-tar.pl:79
37569 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
37570 "parts of a guest filesystem. There are many possibilities: making backups, "
37571 "uploading data files, snooping on guest activity, fixing or customizing "
37576 #: ../tools/virt-tar.pl:84
37578 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
37579 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
37580 "should look at the L<guestfish(1)> tool."
37584 #: ../tools/virt-tar.pl:88
37586 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
37587 "its contents (recursively) from the virtual machine into a local tarball. "
37588 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
37589 "virtual machine. You cannot use these two options together."
37593 #: ../tools/virt-tar.pl:94
37595 "In addition, you may need to use the I<-z> (gZip) option to enable "
37596 "compression. When uploading, you have to specify I<-z> if the upload file "
37597 "is compressed because virt-tar won't detect this on its own."
37601 #: ../tools/virt-tar.pl:98
37603 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
37604 "example it cannot do PKZip files or bzip2 compression. If you want that "
37605 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
37606 "the L<libguestfs(3)> API)."
37610 #: ../tools/virt-tar.pl:160
37611 msgid "B<--extract>"
37615 #: ../tools/virt-tar.pl:162
37616 msgid "B<--download>"
37620 #: ../tools/virt-tar.pl:164
37625 #: ../tools/virt-tar.pl:166
37626 msgid "B<--upload>"
37630 #: ../tools/virt-tar.pl:168
37632 "Use I<-x> to extract (download) a directory from a virtual machine to a "
37637 #: ../tools/virt-tar.pl:171
37639 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
37640 "Please read the L</WARNING> section above before using this option."
37644 #: ../tools/virt-tar.pl:175
37645 msgid "You must specify exactly one of these options."
37649 #: ../tools/virt-tar.pl:181
37654 #: ../tools/virt-tar.pl:183
37659 #: ../tools/virt-tar.pl:185
37660 msgid "Specify that the input or output tarball is gzip-compressed."
37664 #: ../tools/virt-tar.pl:298
37666 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
37667 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
37668 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
37669 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37673 #: ../tools/virt-win-reg.pl:37
37675 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
37680 #: ../tools/virt-win-reg.pl:41
37683 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
37688 #: ../tools/virt-win-reg.pl:43
37691 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
37696 #: ../tools/virt-win-reg.pl:45
37699 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
37704 #: ../tools/virt-win-reg.pl:47
37707 " virt-win-reg --merge domname [input.reg ...]\n"
37712 #: ../tools/virt-win-reg.pl:49
37715 " virt-win-reg [--options] disk.img ... # instead of domname\n"
37720 #: ../tools/virt-win-reg.pl:53
37722 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
37723 "virtual machines. If you do this, you I<will> get irreversible disk "
37724 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
37725 "but doesn't catch all cases."
37729 #: ../tools/virt-win-reg.pl:58
37731 "Modifying the Windows Registry is an inherently risky operation. The format "
37732 "is deliberately obscure and undocumented, and Registry changes can leave the "
37733 "system unbootable. Therefore when using the I<--merge> option, make sure "
37734 "you have a reliable backup first."
37738 #: ../tools/virt-win-reg.pl:65
37740 "This program can export and merge Windows Registry entries from a Windows "
37745 #: ../tools/virt-win-reg.pl:68
37747 "The first parameter is the libvirt guest name or the raw disk image of a "
37752 #: ../tools/virt-win-reg.pl:71
37754 "If I<--merge> is I<not> specified, then the chosen registry key is "
37755 "displayed/exported (recursively). For example:"
37759 #: ../tools/virt-win-reg.pl:74
37762 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
37767 #: ../tools/virt-win-reg.pl:76
37768 msgid "You can also display single values from within registry keys, for example:"
37772 #: ../tools/virt-win-reg.pl:79
37775 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
37776 " $ virt-win-reg Windows7 $cvkey ProductName\n"
37777 " Windows 7 Enterprise\n"
37782 #: ../tools/virt-win-reg.pl:83
37784 "With I<--merge>, you can merge a textual regedit file into the Windows "
37789 #: ../tools/virt-win-reg.pl:86
37792 " $ virt-win-reg --merge Windows7 changes.reg\n"
37797 #: ../tools/virt-win-reg.pl:90
37799 "This program is only meant for simple access to the registry. If you want "
37800 "to do complicated things with the registry, we suggest you download the "
37801 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
37802 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
37803 "L<hivexregedit(1)>."
37807 #: ../tools/virt-win-reg.pl:159
37812 #: ../tools/virt-win-reg.pl:161
37814 "In merge mode, this merges a textual regedit file into the Windows Registry "
37815 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
37816 "displays or exports Registry entries instead."
37820 #: ../tools/virt-win-reg.pl:165
37822 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
37823 "result in disk corruption. However exporting (without this flag) is always "
37828 #: ../tools/virt-win-reg.pl:173
37829 msgid "B<--encoding> UTF-16LE|ASCII"
37833 #: ../tools/virt-win-reg.pl:175
37835 "When merging (only), you may need to specify the encoding for strings to be "
37836 "used in the hive file. This is explained in detail in "
37837 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
37841 #: ../tools/virt-win-reg.pl:179
37843 "The default is to use UTF-16LE, which should work with recent versions of "
37848 #: ../tools/virt-win-reg.pl:186
37849 msgid "B<--unsafe-printable-strings>"
37853 #: ../tools/virt-win-reg.pl:188
37855 "When exporting (only), assume strings are UTF-16LE and print them as strings "
37856 "instead of hex sequences. Remove the final zero codepoint from strings if "
37861 #: ../tools/virt-win-reg.pl:192
37863 "This is unsafe and does not preserve the fidelity of strings in the original "
37864 "Registry for various reasons:"
37868 #: ../tools/virt-win-reg.pl:199
37870 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
37871 "other encodings will be corrupted by this transformation."
37875 #: ../tools/virt-win-reg.pl:204
37877 "Assumes that everything which has type 1 or 2 is really a string and that "
37878 "everything else is not a string, but the type field in real Registries is "
37883 #: ../tools/virt-win-reg.pl:210
37885 "Loses information about whether a zero codepoint followed the string in the "
37890 #: ../tools/virt-win-reg.pl:215
37892 "This all happens because the Registry itself contains no information about "
37893 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
37897 #: ../tools/virt-win-reg.pl:219
37899 "You should only use this option for quick hacking and debugging of the "
37900 "Registry contents, and I<never> use it if the output is going to be passed "
37901 "into another program or stored in another Registry."
37905 #: ../tools/virt-win-reg.pl:556
37906 msgid "SUPPORTED SYSTEMS"
37910 #: ../tools/virt-win-reg.pl:558
37912 "The program currently supports Windows NT-derived guests starting with "
37913 "Windows XP through to at least Windows 7."
37917 #: ../tools/virt-win-reg.pl:561
37918 msgid "The following Registry keys are supported:"
37922 #: ../tools/virt-win-reg.pl:565
37923 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
37927 #: ../tools/virt-win-reg.pl:567
37928 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
37932 #: ../tools/virt-win-reg.pl:569
37933 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
37937 #: ../tools/virt-win-reg.pl:571
37938 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
37942 #: ../tools/virt-win-reg.pl:573
37943 msgid "C<HKEY_USERS\\.DEFAULT>"
37947 #: ../tools/virt-win-reg.pl:575
37948 msgid "C<HKEY_USERS\\I<SID>>"
37952 #: ../tools/virt-win-reg.pl:577
37953 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
37957 #: ../tools/virt-win-reg.pl:579
37958 msgid "C<HKEY_USERS\\I<username>>"
37962 #: ../tools/virt-win-reg.pl:581
37963 msgid "where I<username> is a local user name (this is a libguestfs extension)."
37967 #: ../tools/virt-win-reg.pl:585
37969 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
37974 #: ../tools/virt-win-reg.pl:588
37976 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
37977 "supported (there is no \"current user\")."
37981 #: ../tools/virt-win-reg.pl:591
37986 #: ../tools/virt-win-reg.pl:593
37988 "C<virt-win-reg> expects that regedit files have already been reencoded in "
37989 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
37990 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
37991 "with Windows-style line endings, you may need to reencode the whole file "
37992 "before or after processing."
37996 #: ../tools/virt-win-reg.pl:599
37998 "To reencode a file from Windows format to Linux (before processing it with "
37999 "the I<--merge> option), you would do something like this:"
38003 #: ../tools/virt-win-reg.pl:602
38006 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
38011 #: ../tools/virt-win-reg.pl:604
38013 "To go in the opposite direction, after exporting and before sending the file "
38014 "to a Windows user, do something like this:"
38018 #: ../tools/virt-win-reg.pl:607
38021 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
38026 #: ../tools/virt-win-reg.pl:609
38027 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
38031 #: ../tools/virt-win-reg.pl:611
38033 "If you are unsure about the current encoding, use the L<file(1)> command. "
38034 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
38035 "Windows-style (CRLF) line endings, like this:"
38039 #: ../tools/virt-win-reg.pl:615
38042 " $ file software.reg\n"
38043 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
38044 " with CRLF line terminators\n"
38049 #: ../tools/virt-win-reg.pl:619
38050 msgid "This file would need conversion before you could I<--merge> it."
38054 #: ../tools/virt-win-reg.pl:621
38055 msgid "CurrentControlSet etc."
38059 #: ../tools/virt-win-reg.pl:623
38061 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
38062 "Registry at the level of the hive file, and therefore you cannot modify "
38067 #: ../tools/virt-win-reg.pl:627
38069 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
38070 "circumstances it might refer to another control set. The way to find out is "
38071 "to look at the C<HKLM\\SYSTEM\\Select> key:"
38075 #: ../tools/virt-win-reg.pl:631
38078 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
38079 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
38080 " \"Current\"=dword:00000001\n"
38081 " \"Default\"=dword:00000001\n"
38082 " \"Failed\"=dword:00000000\n"
38083 " \"LastKnownGood\"=dword:00000002\n"
38088 #: ../tools/virt-win-reg.pl:638
38089 msgid "\"Current\" is the one which Windows will choose when it boots."
38093 #: ../tools/virt-win-reg.pl:640
38094 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
38098 #: ../tools/virt-win-reg.pl:643
38099 msgid "WINDOWS TIPS"
38103 #: ../tools/virt-win-reg.pl:645
38105 "Note that some of these tips modify the guest disk image. The guest I<must> "
38106 "be shut off, else you will get disk corruption."
38110 #: ../tools/virt-win-reg.pl:648
38111 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
38115 #: ../tools/virt-win-reg.pl:650
38117 "Prepare a DOS batch script, VBScript or executable. Upload this using "
38118 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
38119 "is uploaded into C<C:\\>:"
38123 #: ../tools/virt-win-reg.pl:654
38126 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
38131 #: ../tools/virt-win-reg.pl:656
38132 msgid "Prepare a regedit file containing the registry change:"
38136 #: ../tools/virt-win-reg.pl:658
38139 " cat > test.reg <<'EOF'\n"
38140 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
38141 " \"Test\"=\"c:\\\\test.bat\"\n"
38147 #: ../tools/virt-win-reg.pl:663
38149 "In this example we use the key C<RunOnce> which means that the script will "
38150 "run precisely once when the first user logs in. If you want it to run every "
38151 "time a user logs in, replace C<RunOnce> with C<Run>."
38155 #: ../tools/virt-win-reg.pl:667
38156 msgid "Now update the registry:"
38160 #: ../tools/virt-win-reg.pl:669
38163 " virt-win-reg --merge WindowsGuest test.reg\n"
38168 #: ../tools/virt-win-reg.pl:671
38169 msgid "INSTALLING A SERVICE"
38173 #: ../tools/virt-win-reg.pl:673
38175 "This section assumes you are familiar with Windows services, and you either "
38176 "have a program which handles the Windows Service Control Protocol directly "
38177 "or you want to run any program using a service wrapper like SrvAny or the "
38182 #: ../tools/virt-win-reg.pl:678
38184 "First upload the program and optionally the service wrapper. In this case "
38185 "the test program is called C<test.exe> and we are using the RHSrvAny "
38190 #: ../tools/virt-win-reg.pl:682
38193 " guestfish -i -d WindowsGuest <<EOF\n"
38194 " upload rhsrvany.exe /rhsrvany.exe\n"
38195 " upload test.exe /test.exe\n"
38201 #: ../tools/virt-win-reg.pl:687
38203 "Prepare a regedit file containing the registry changes. In this example, "
38204 "the first registry change is needed for the service itself or the service "
38205 "wrapper (if used). The second registry change is only needed because I am "
38206 "using the RHSrvAny service wrapper."
38210 #: ../tools/virt-win-reg.pl:692
38213 " cat > service.reg <<'EOF'\n"
38214 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
38215 " \"Type\"=dword:00000010\n"
38216 " \"Start\"=dword:00000002\n"
38217 " \"ErrorControl\"=dword:00000001\n"
38218 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
38219 " \"DisplayName\"=\"RHSrvAny\"\n"
38220 " \"ObjectName\"=\"NetworkService\"\n"
38225 #: ../tools/virt-win-reg.pl:701
38228 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
38229 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
38230 " \"PWD\"=\"c:\\\\Temp\"\n"
38236 #: ../tools/virt-win-reg.pl:712
38238 "For use of C<ControlSet001> see the section above in this manual page. You "
38239 "may need to adjust this according to the control set that is in use by the "
38244 #: ../tools/virt-win-reg.pl:718
38246 "C<\"ObjectName\"> controls the privileges that the service will have. An "
38247 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
38248 "privileged account."
38252 #: ../tools/virt-win-reg.pl:724
38254 "For the meaning of the magic numbers, see this Microsoft KB article: "
38255 "L<http://support.microsoft.com/kb/103000>."
38259 #: ../tools/virt-win-reg.pl:729
38260 msgid "Update the registry:"
38264 #: ../tools/virt-win-reg.pl:731
38267 " virt-win-reg --merge WindowsGuest service.reg\n"
38272 #: ../tools/virt-win-reg.pl:735
38274 "Be careful when passing parameters containing C<\\> (backslash) in the "
38275 "shell. Usually you will have to use 'single quotes' or double backslashes "
38276 "(but not both) to protect them from the shell."
38280 #: ../tools/virt-win-reg.pl:739
38281 msgid "Paths and value names are case-insensitive."
38285 #: ../tools/virt-win-reg.pl:748
38287 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
38288 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
38289 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
38290 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38294 #: ../tools/virt-win-reg.pl:766
38297 " export LIBGUESTFS_DEBUG=1\n"
38298 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
38303 #: ../tools/virt-win-reg.pl:769
38305 "Attach /tmp/virt-win-reg.log to a new bug report at "
38306 "L<https://bugzilla.redhat.com/>"