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.12.7\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-09-16 16:31+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 ../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 ../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 ../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:2745
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:178
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:180
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:182
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:184 ../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:186 ../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:188 ../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:199 ../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:201
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:205
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:211
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:215
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:219
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:262 ../resize/virt-resize.pod:568 ../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:264 ../resize/virt-resize.pod:570 ../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:575 ../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:577
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 ../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:284 ../resize/virt-resize.pod:580 ../ruby/examples/guestfs-ruby.pod:36 ../src/guestfs.pod:3119 ../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:292 ../resize/virt-resize.pod:601 ../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:294 ../resize/virt-resize.pod:603 ../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 ../examples/guestfs-examples.pod:48 ../examples/guestfs-recipes.pod:400 ../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:61 ../ocaml/examples/guestfs-ocaml.pod:94 ../perl/examples/guestfs-perl.pod:55 ../python/examples/guestfs-python.pod:57 ../rescue/virt-rescue.pod:296 ../resize/virt-resize.pod:605 ../ruby/examples/guestfs-ruby.pod:51 ../src/guestfs.pod:3195 ../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:607
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:300 ../resize/virt-resize.pod:609 ../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:305 ../resize/virt-resize.pod:614 ../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:310 ../resize/virt-resize.pod:619 ../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:4210
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:298
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:1104 ../fish/guestfish-actions.pod:1108 ../fish/guestfish-actions.pod:1112 ../fish/guestfish-actions.pod:1116 ../fish/guestfish-actions.pod:1124 ../fish/guestfish-actions.pod:1128 ../fish/guestfish-actions.pod:1132 ../fish/guestfish-actions.pod:1142 ../fish/guestfish-actions.pod:1146 ../fish/guestfish-actions.pod:1150 ../fish/guestfish-actions.pod:1240 ../fish/guestfish-actions.pod:1244 ../fish/guestfish-actions.pod:1249 ../fish/guestfish-actions.pod:1254 ../fish/guestfish-actions.pod:1296 ../fish/guestfish-actions.pod:1300 ../fish/guestfish-actions.pod:1305 ../fish/guestfish-actions.pod:1555 ../fish/guestfish-actions.pod:1562 ../fish/guestfish-actions.pod:1569 ../fish/guestfish-actions.pod:1960 ../fish/guestfish-actions.pod:1966 ../fish/guestfish-actions.pod:1974 ../fish/guestfish-actions.pod:1981 ../fish/guestfish-actions.pod:1988 ../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:15 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596 ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:1667 ../src/guestfs-actions.pod:1671 ../src/guestfs-actions.pod:1675 ../src/guestfs-actions.pod:1679 ../src/guestfs-actions.pod:1687 ../src/guestfs-actions.pod:1691 ../src/guestfs-actions.pod:1695 ../src/guestfs-actions.pod:1705 ../src/guestfs-actions.pod:1709 ../src/guestfs-actions.pod:1713 ../src/guestfs-actions.pod:1851 ../src/guestfs-actions.pod:1855 ../src/guestfs-actions.pod:1860 ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:1926 ../src/guestfs-actions.pod:1930 ../src/guestfs-actions.pod:1935 ../src/guestfs-actions.pod:2339 ../src/guestfs-actions.pod:2346 ../src/guestfs-actions.pod:2353 ../src/guestfs-actions.pod:2886 ../src/guestfs-actions.pod:2892 ../src/guestfs-actions.pod:2900 ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2914 ../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:1064 ../src/guestfs.pod:1068 ../src/guestfs.pod:1072 ../src/guestfs.pod:1077 ../src/guestfs.pod:1085 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112 ../src/guestfs.pod:1134 ../src/guestfs.pod:1138 ../src/guestfs.pod:1142 ../src/guestfs.pod:1146 ../src/guestfs.pod:1150 ../src/guestfs.pod:1154 ../src/guestfs.pod:1643 ../src/guestfs.pod:1648 ../src/guestfs.pod:1652 ../src/guestfs.pod:1754 ../src/guestfs.pod:1759 ../src/guestfs.pod:1763 ../src/guestfs.pod:1773 ../src/guestfs.pod:2047 ../src/guestfs.pod:2052 ../src/guestfs.pod:2058 ../src/guestfs.pod:2066 ../src/guestfs.pod:2513 ../src/guestfs.pod:2519 ../src/guestfs.pod:2524 ../src/guestfs.pod:2530 ../src/guestfs.pod:2911 ../src/guestfs.pod:2916 ../src/guestfs.pod:2920 ../src/guestfs.pod:2924 ../src/guestfs.pod:2928 ../src/guestfs.pod:2942 ../src/guestfs.pod:2947 ../src/guestfs.pod:3172 ../src/guestfs.pod:3176 ../src/guestfs.pod:3180 ../src/guestfs.pod:3184 ../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:257 ../src/guestfs.pod:3058 ../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 #: ../examples/guestfs-examples.pod:5
2755 msgid "guestfs-examples - Examples of using libguestfs from C"
2759 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
2762 " #include <guestfs.h>\n"
2767 #: ../examples/guestfs-examples.pod:11
2770 " guestfs_h *g = guestfs_create ();\n"
2771 " guestfs_add_drive_ro (g, \"disk.img\");\n"
2772 " guestfs_launch (g);\n"
2777 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
2780 " cc prog.c -o prog -lguestfs\n"
2782 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
2787 #: ../examples/guestfs-examples.pod:21
2789 "This manual page contains examples of calling libguestfs from the C "
2790 "programming language. If you are not familiar with using libguestfs, you "
2791 "also need to read L<guestfs(3)>."
2795 #: ../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
2796 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
2800 #: ../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
2805 #: ../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
2806 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
2810 #: ../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
2815 #: ../examples/guestfs-examples.pod:35
2817 "L<guestfs(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
2818 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
2819 "L<http://libguestfs.org/>."
2823 #: ../examples/guestfs-examples.pod:44 ../examples/guestfs-recipes.pod:396 ../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:57 ../ocaml/examples/guestfs-ocaml.pod:90 ../perl/examples/guestfs-perl.pod:51 ../python/examples/guestfs-python.pod:53 ../ruby/examples/guestfs-ruby.pod:47 ../src/guestfs.pod:3191 ../test-tool/libguestfs-test-tool.pod:106
2828 #: ../examples/guestfs-examples.pod:46 ../examples/guestfs-recipes.pod:398 ../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:59 ../ocaml/examples/guestfs-ocaml.pod:92 ../perl/examples/guestfs-perl.pod:53 ../python/examples/guestfs-python.pod:55 ../ruby/examples/guestfs-ruby.pod:49 ../src/guestfs.pod:3193 ../test-tool/libguestfs-test-tool.pod:108
2829 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
2833 #: ../examples/guestfs-examples.pod:50 ../ocaml/examples/guestfs-ocaml.pod:96 ../python/examples/guestfs-python.pod:59 ../ruby/examples/guestfs-ruby.pod:53
2834 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
2838 #: ../examples/guestfs-examples.pod:52 ../examples/guestfs-recipes.pod:404 ../java/examples/guestfs-java.pod:65 ../ocaml/examples/guestfs-ocaml.pod:98 ../perl/examples/guestfs-perl.pod:59 ../python/examples/guestfs-python.pod:61 ../ruby/examples/guestfs-ruby.pod:55
2840 "The examples in this manual page may be freely copied, modified and "
2841 "distributed without any restrictions."
2845 #: ../examples/guestfs-examples.pod:55 ../examples/guestfs-recipes.pod:407 ../java/examples/guestfs-java.pod:68 ../ocaml/examples/guestfs-ocaml.pod:101 ../perl/examples/guestfs-perl.pod:62 ../python/examples/guestfs-python.pod:64 ../ruby/examples/guestfs-ruby.pod:58 ../src/guestfs.pod:3200
2847 "This library is free software; you can redistribute it and/or modify it "
2848 "under the terms of the GNU Lesser General Public License as published by the "
2849 "Free Software Foundation; either version 2 of the License, or (at your "
2850 "option) any later version."
2854 #: ../examples/guestfs-examples.pod:60 ../examples/guestfs-recipes.pod:412 ../java/examples/guestfs-java.pod:73 ../ocaml/examples/guestfs-ocaml.pod:106 ../perl/examples/guestfs-perl.pod:67 ../python/examples/guestfs-python.pod:69 ../ruby/examples/guestfs-ruby.pod:63 ../src/guestfs.pod:3205
2856 "This library is distributed in the hope that it will be useful, but WITHOUT "
2857 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
2858 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
2863 #: ../examples/guestfs-examples.pod:65 ../examples/guestfs-recipes.pod:417 ../java/examples/guestfs-java.pod:78 ../ocaml/examples/guestfs-ocaml.pod:111 ../perl/examples/guestfs-perl.pod:72 ../python/examples/guestfs-python.pod:74 ../ruby/examples/guestfs-ruby.pod:68 ../src/guestfs.pod:3210
2865 "You should have received a copy of the GNU Lesser General Public License "
2866 "along with this library; if not, write to the Free Software Foundation, "
2867 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
2871 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
2876 #: ../examples/guestfs-recipes.pod:5
2878 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
2879 "here. The only way which works for both sorts of output is to just write "
2880 "the URL directly. Do NOT use L<...> for URLs."
2884 #: ../examples/guestfs-recipes.pod:9
2886 "We break with tradition here and don't use ALL CAPS for the section "
2887 "headings, as this makes them much easier to read."
2891 #: ../examples/guestfs-recipes.pod:16
2892 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
2896 #: ../examples/guestfs-recipes.pod:20
2898 "This page contains recipes for and links to things you can do using "
2899 "libguestfs, L<guestfish(1)> and the virt tools."
2903 #: ../examples/guestfs-recipes.pod:23
2904 msgid "Audit a virtual machine for setuid files"
2908 #: ../examples/guestfs-recipes.pod:25
2910 "The link below contains a small program which can be used to audit a Linux "
2911 "virtual machine to see what setuid and setgid files it contains."
2915 #: ../examples/guestfs-recipes.pod:28
2916 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
2920 #: ../examples/guestfs-recipes.pod:30
2921 msgid "Change the background image in a Windows XP VM"
2925 #: ../examples/guestfs-recipes.pod:32
2927 "The links below explain how to use L<guestfish(1)> to change the background "
2928 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
2929 "be substantially different for each version of Windows."
2933 #: ../examples/guestfs-recipes.pod:37
2935 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
2936 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
2940 #: ../examples/guestfs-recipes.pod:40
2941 msgid "Cloning a virtual machine (Linux)"
2945 #: ../examples/guestfs-recipes.pod:42
2947 "The guestfish technique described in the link below works well for most "
2948 "Linux VMs. Depending on the Linux distro you may need to change the paths "
2953 #: ../examples/guestfs-recipes.pod:46
2954 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
2958 #: ../examples/guestfs-recipes.pod:48
2960 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
2965 #: ../examples/guestfs-recipes.pod:51
2966 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
2970 #: ../examples/guestfs-recipes.pod:53
2971 msgid "Cloning a virtual machine (Windows)"
2975 #: ../examples/guestfs-recipes.pod:55
2977 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
2978 "straightforward. Currently there is code in the Aeolus Oz project which "
2979 "does this (using libguestfs). As part of our review of the virt-clone tool, "
2980 "we may add sysprepping ability."
2984 #: ../examples/guestfs-recipes.pod:60
2986 "https://github.com/clalancette/oz "
2987 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
2991 #: ../examples/guestfs-recipes.pod:63
2992 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
2996 #: ../examples/guestfs-recipes.pod:65
2997 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
3001 #: ../examples/guestfs-recipes.pod:67
3004 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
3009 #: ../examples/guestfs-recipes.pod:69
3010 msgid "To export just a subdirectory, eg. C</files>, do:"
3014 #: ../examples/guestfs-recipes.pod:71
3017 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3022 #: ../examples/guestfs-recipes.pod:73
3023 msgid "Create empty disk images"
3027 #: ../examples/guestfs-recipes.pod:75
3029 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3030 "The useful guide below explains the options available."
3034 #: ../examples/guestfs-recipes.pod:78
3035 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
3039 #: ../examples/guestfs-recipes.pod:80
3040 msgid "Dump raw filesystem content from inside a disk image or VM"
3044 #: ../examples/guestfs-recipes.pod:82
3046 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3047 "filesystem content from any filesystem in a disk image or a VM (even one "
3048 "which is encrypted or buried inside an LV):"
3052 #: ../examples/guestfs-recipes.pod:86
3055 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3060 #: ../examples/guestfs-recipes.pod:88
3063 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3068 #: ../examples/guestfs-recipes.pod:90
3069 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
3073 #: ../examples/guestfs-recipes.pod:92
3074 msgid "Edit grub configuration in a VM"
3078 #: ../examples/guestfs-recipes.pod:94
3079 msgid "You can use this to:"
3083 #: ../examples/guestfs-recipes.pod:100
3084 msgid "Fix a virtual machine that does not boot."
3088 #: ../examples/guestfs-recipes.pod:104
3089 msgid "Change which kernel is used to boot the VM."
3093 #: ../examples/guestfs-recipes.pod:108
3094 msgid "Change kernel command line options."
3098 #: ../examples/guestfs-recipes.pod:112
3099 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
3103 #: ../examples/guestfs-recipes.pod:114
3106 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
3111 #: ../examples/guestfs-recipes.pod:116
3113 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
3118 #: ../examples/guestfs-recipes.pod:119
3121 " virt-rescue -d BrokenGuest\n"
3126 #: ../examples/guestfs-recipes.pod:121
3127 msgid "Export any directory from a VM"
3131 #: ../examples/guestfs-recipes.pod:123
3132 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
3136 #: ../examples/guestfs-recipes.pod:126
3139 " virt-copy-out -d Guest /home .\n"
3144 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1292 ../fish/guestfish-actions.pod:1551 ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:11 ../src/guestfs-actions.pod:1922 ../src/guestfs-actions.pod:2335 ../src/guestfs-actions.pod:2882 ../src/guestfs.pod:1639 ../tools/virt-win-reg.pl:706
3149 #: ../examples/guestfs-recipes.pod:134
3151 "The final dot of the command is not a printing error. It means we want to "
3152 "copy out to the current directory."
3156 #: ../examples/guestfs-recipes.pod:139
3157 msgid "This creates a directory called C<home> under the current directory."
3161 #: ../examples/guestfs-recipes.pod:143
3163 "If the guest is a Windows guest then you can use drive letters and "
3164 "backslashes, but you must prefix the path with C<win:> and quote it to "
3165 "protect it from the shell, like this:"
3169 #: ../examples/guestfs-recipes.pod:147
3172 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
3177 #: ../examples/guestfs-recipes.pod:149
3178 msgid "To get the output as a compressed tarball, do:"
3182 #: ../examples/guestfs-recipes.pod:151
3185 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
3190 #: ../examples/guestfs-recipes.pod:153
3192 "Although it sounds tempting, this is usually not a reliable way to get a "
3193 "backup from a running guest. See the entry in the FAQ: "
3194 "http://libguestfs.org/FAQ.html#backup"
3198 #: ../examples/guestfs-recipes.pod:157
3199 msgid "Find out which user is using the most space"
3203 #: ../examples/guestfs-recipes.pod:159
3205 "This simple script examines a Linux guest to find out which user is using "
3206 "the most space in their home directory:"
3210 #: ../examples/guestfs-recipes.pod:162
3218 #: ../examples/guestfs-recipes.pod:164
3226 #: ../examples/guestfs-recipes.pod:166
3235 #: ../examples/guestfs-recipes.pod:169
3238 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
3243 #: ../examples/guestfs-recipes.pod:171
3246 " for d in $(guestfish --remote ls \"$dir\"); do\n"
3247 " echo -n \"$dir/$d\"\n"
3249 " guestfish --remote du \"$dir/$d\";\n"
3250 " done | sort -nr -k 2\n"
3255 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
3258 " guestfish --remote exit\n"
3263 #: ../examples/guestfs-recipes.pod:179
3264 msgid "Get DHCP address from a VM"
3268 #: ../examples/guestfs-recipes.pod:181
3270 "The link below explains the many different possible techniques for getting "
3271 "the last assigned DHCP address of a virtual machine."
3275 #: ../examples/guestfs-recipes.pod:184
3276 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
3280 #: ../examples/guestfs-recipes.pod:186
3282 "In the libguestfs source examples directory you will find the latest version "
3283 "of the C<virt-dhcp-address.c> program."
3287 #: ../examples/guestfs-recipes.pod:189
3288 msgid "Get the operating system product name string"
3292 #: ../examples/guestfs-recipes.pod:191
3293 msgid "Save the following script into a file called C<product-name.sh>:"
3297 #: ../examples/guestfs-recipes.pod:193
3302 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3303 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3304 " guestfish --remote inspect-get-product-name \"$root\"\n"
3305 " guestfish --remote exit\n"
3310 #: ../examples/guestfs-recipes.pod:200
3311 msgid "Make the script executable and run it on a named guest:"
3315 #: ../examples/guestfs-recipes.pod:202
3318 " # product-name.sh RHEL60x64\n"
3319 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
3324 #: ../examples/guestfs-recipes.pod:205
3326 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
3327 "C<xpath> command line tool or from your favourite programming language:"
3331 #: ../examples/guestfs-recipes.pod:209
3334 " # virt-inspector RHEL60x64 > xml\n"
3335 " # xpath '//product_name' < xml\n"
3338 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
3339 "(Santiago)</product_name>\n"
3344 #: ../examples/guestfs-recipes.pod:215
3345 msgid "Get the default boot kernel for a Linux VM"
3349 #: ../examples/guestfs-recipes.pod:217
3351 "The link below contains a program to print the default boot kernel for a "
3356 #: ../examples/guestfs-recipes.pod:220
3357 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
3361 #: ../examples/guestfs-recipes.pod:222
3363 "It uses Augeas, and the technique is generally applicable for many different "
3368 #: ../examples/guestfs-recipes.pod:229
3369 msgid "listing the user accounts in the guest"
3373 #: ../examples/guestfs-recipes.pod:233
3374 msgid "what repositories is it configured to use"
3378 #: ../examples/guestfs-recipes.pod:237
3379 msgid "what NTP servers does it connect to"
3383 #: ../examples/guestfs-recipes.pod:241
3384 msgid "what were the boot messages last time it booted"
3388 #: ../examples/guestfs-recipes.pod:245
3389 msgid "listing who was logged in recently"
3393 #: ../examples/guestfs-recipes.pod:249
3394 msgid "http://augeas.net/"
3398 #: ../examples/guestfs-recipes.pod:251
3399 msgid "Install RPMs in a guest"
3403 #: ../examples/guestfs-recipes.pod:253
3405 "The link below contains a method to install RPMs in a guest. In fact the "
3406 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
3407 "installs them next time the guest is booted. You could use this technique "
3408 "to install vital security updates in an offline guest."
3412 #: ../examples/guestfs-recipes.pod:259
3413 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
3417 #: ../examples/guestfs-recipes.pod:261
3418 msgid "List applications installed in a VM"
3422 #: ../examples/guestfs-recipes.pod:263
3423 msgid "Save the following to a file C<list-apps.sh>:"
3427 #: ../examples/guestfs-recipes.pod:265
3432 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3433 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3434 " guestfish --remote inspect-list-applications \"$root\"\n"
3435 " guestfish --remote exit\n"
3440 #: ../examples/guestfs-recipes.pod:272
3442 "Make the file executable and then you can run it on any named virtual "
3447 #: ../examples/guestfs-recipes.pod:275
3450 " # list-apps.sh WinGuest\n"
3452 " app_name: Mozilla Firefox (3.6.12)\n"
3453 " app_display_name: Mozilla Firefox (3.6.12)\n"
3455 " app_version: 3.6.12 (en-GB)\n"
3457 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
3458 " app_trans_path:\n"
3459 " app_publisher: Mozilla\n"
3460 " app_url: http://www.mozilla.com/en-GB/\n"
3461 " app_source_package:\n"
3463 " app_description: Mozilla Firefox\n"
3466 " app_name: VLC media player\n"
3467 " app_display_name: VLC media player 1.1.5\n"
3469 " app_version: 1.1.5\n"
3471 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
3472 " app_trans_path:\n"
3473 " app_publisher: VideoLAN\n"
3474 " app_url: http://www.videolan.org/\n"
3475 " app_source_package:\n"
3477 " app_description:\n"
3483 #: ../examples/guestfs-recipes.pod:305
3485 "If you want to run the script on disk images (instead of libvirt virtual "
3486 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
3487 "L<virt-inspector(1)>."
3491 #: ../examples/guestfs-recipes.pod:309
3492 msgid "List files and directories in a VM"
3496 #: ../examples/guestfs-recipes.pod:311
3497 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
3501 #: ../examples/guestfs-recipes.pod:313
3504 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
3509 #: ../examples/guestfs-recipes.pod:315
3510 msgid "List services in a Windows VM"
3514 #: ../examples/guestfs-recipes.pod:317
3516 "The link below contains a script that can be used to list out the services "
3517 "from a Windows VM, and whether those services run at boot time or are loaded "
3522 #: ../examples/guestfs-recipes.pod:321
3523 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
3527 #: ../examples/guestfs-recipes.pod:323
3528 msgid "Make a disk image sparse"
3532 #: ../examples/guestfs-recipes.pod:325
3534 "The link below contains some guides for making a disk image sparse (or "
3535 "reintroducing sparseness)."
3539 #: ../examples/guestfs-recipes.pod:328
3540 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
3544 #: ../examples/guestfs-recipes.pod:330
3545 msgid "Monitor disk usage over time"
3549 #: ../examples/guestfs-recipes.pod:332
3551 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
3552 "The link below contains a guide."
3556 #: ../examples/guestfs-recipes.pod:335
3557 msgid "http://virt-tools.org/learning/advanced-virt-df/"
3561 #: ../examples/guestfs-recipes.pod:337
3562 msgid "Reading the Windows Event Log from Windows Vista (or later)"
3566 #: ../examples/guestfs-recipes.pod:339
3568 "L<guestfish(1)> plus the tools described in the link below can be used to "
3569 "read out the Windows Event Log from any virtual machine running Windows "
3570 "Vista or a later version."
3574 #: ../examples/guestfs-recipes.pod:343
3575 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
3579 #: ../examples/guestfs-recipes.pod:345
3580 msgid "Remove root password (Linux)"
3584 #: ../examples/guestfs-recipes.pod:347
3586 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
3587 "files. One use is to remove the root password from a Linux guest:"
3591 #: ../examples/guestfs-recipes.pod:350
3594 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3599 #: ../examples/guestfs-recipes.pod:352
3600 msgid "Remove Administrator password (Windows)"
3604 #: ../examples/guestfs-recipes.pod:354
3606 "The link below contains one technique for removing the Administrator "
3607 "password from a Windows VM, or to be more precise, it gives you a command "
3608 "prompt the next time you log in which you can use to bypass any security:"
3612 #: ../examples/guestfs-recipes.pod:359
3613 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
3617 #: ../examples/guestfs-recipes.pod:361
3618 msgid "Unpack a live CD"
3622 #: ../examples/guestfs-recipes.pod:363
3624 "Linux live CDs often contain multiple layers of disk images wrapped like a "
3625 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
3626 "layers, as outlined in the guide below."
3630 #: ../examples/guestfs-recipes.pod:367
3631 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
3635 #: ../examples/guestfs-recipes.pod:369
3636 msgid "Uploading and downloading files"
3640 #: ../examples/guestfs-recipes.pod:371
3642 "The link below contains general tips on uploading (copying in) and "
3643 "downloading (copying out) files from VMs."
3647 #: ../examples/guestfs-recipes.pod:374
3648 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
3652 #: ../examples/guestfs-recipes.pod:376
3653 msgid "Use libguestfs tools on VMware ESX guests"
3657 #: ../examples/guestfs-recipes.pod:378
3659 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
3660 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
3664 #: ../examples/guestfs-recipes.pod:382
3665 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
3669 #: ../examples/guestfs-recipes.pod:386
3671 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
3672 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
3673 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
3677 #: ../examples/guestfs-recipes.pod:402
3678 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
3682 #: ../fish/guestfish-actions.pod:1
3687 #: ../fish/guestfish-actions.pod:3
3690 " add-cdrom filename\n"
3695 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:7
3696 msgid "This function adds a virtual CD-ROM disk image to the guest."
3700 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:9
3701 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
3705 #: ../fish/guestfish-actions.pod:15
3707 "This call checks for the existence of C<filename>. This stops you from "
3708 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3709 "and C<http:> URLs. To specify those, use the general L</config> call "
3714 #: ../fish/guestfish-actions.pod:22
3716 "If you just want to add an ISO file (often you use this as an efficient way "
3717 "to transfer large files into the guest), then you should probably use "
3718 "L</add-drive-ro> instead."
3722 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163 ../fish/guestfish-actions.pod:177
3724 "This function is deprecated. In new code, use the L</add_drive_opts> call "
3729 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166 ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:991 ../fish/guestfish-actions.pod:1351 ../fish/guestfish-actions.pod:1365 ../fish/guestfish-actions.pod:3112 ../fish/guestfish-actions.pod:3319 ../fish/guestfish-actions.pod:3433 ../fish/guestfish-actions.pod:3481 ../fish/guestfish-actions.pod:4382 ../fish/guestfish-actions.pod:4405 ../fish/guestfish-actions.pod:4427 ../fish/guestfish-actions.pod:4465 ../fish/guestfish-actions.pod:5114 ../fish/guestfish-actions.pod:5220 ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:257 ../src/guestfs-actions.pod:278 ../src/guestfs-actions.pod:1518 ../src/guestfs-actions.pod:2013 ../src/guestfs-actions.pod:2034 ../src/guestfs-actions.pod:4655 ../src/guestfs-actions.pod:4974 ../src/guestfs-actions.pod:5192 ../src/guestfs-actions.pod:5282 ../src/guestfs-actions.pod:6571 ../src/guestfs-actions.pod:6601 ../src/guestfs-actions.pod:6634 ../src/guestfs-actions.pod:6693 ../src/guestfs-actions.pod:7629 ../src/guestfs-actions.pod:7741 ../src/guestfs-actions.pod:7919
3731 "Deprecated functions will not be removed from the API, but the fact that "
3732 "they are deprecated indicates that there are problems with correct use of "
3737 #: ../fish/guestfish-actions.pod:35
3742 #: ../fish/guestfish-actions.pod:37
3747 #: ../fish/guestfish-actions.pod:39
3750 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
3756 #: ../fish/guestfish-actions.pod:41
3758 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
3759 "It works by connecting to libvirt, requesting the domain and domain XML from "
3760 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
3764 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
3766 "The number of disks added is returned. This operation is atomic: if an "
3767 "error is returned, then no disks are added."
3771 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
3773 "This function does some minimal checks to make sure the libvirt domain is "
3774 "not running (unless C<readonly> is true). In a future version we will try "
3775 "to acquire the libvirt lock on each disk."
3779 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
3781 "Disks must be accessible locally. This often means that adding disks from a "
3782 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
3783 "unless those disks are accessible via the same device path locally too."
3787 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
3789 "The optional C<libvirturi> parameter sets the libvirt URI (see "
3790 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
3791 "default libvirt URI (or one set through an environment variable, see the "
3792 "libvirt documentation for full details)."
3796 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
3798 "The optional C<live> flag controls whether this call will try to connect to "
3799 "a running virtual machine C<guestfsd> process if it sees a suitable "
3800 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
3801 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
3802 "DAEMONS> for more information."
3806 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
3808 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
3809 "passed instead of the domain name. The C<dom> string is treated as a UUID "
3810 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
3815 #: ../fish/guestfish-actions.pod:76
3817 "The other optional parameters are passed directly through to "
3818 "L</add-drive-opts>."
3822 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143 ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:1995 ../fish/guestfish-actions.pod:3161 ../fish/guestfish-actions.pod:3334 ../fish/guestfish-actions.pod:3469
3824 "This command has one or more optional arguments. See L</OPTIONAL "
3829 #: ../fish/guestfish-actions.pod:81
3834 #: ../fish/guestfish-actions.pod:83
3837 " add-drive filename\n"
3842 #: ../fish/guestfish-actions.pod:85
3844 "This function is the equivalent of calling L</add-drive-opts> with no "
3845 "optional parameters, so the disk is added writable, with the format being "
3846 "detected automatically."
3850 #: ../fish/guestfish-actions.pod:89
3852 "Automatic detection of the format opens you up to a potential security hole "
3853 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3854 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
3855 "you should think about replacing calls to this function with calls to "
3856 "L</add-drive-opts>, and specifying the format."
3860 #: ../fish/guestfish-actions.pod:96
3861 msgid "add-drive-opts"
3865 #: ../fish/guestfish-actions.pod:98
3870 #: ../fish/guestfish-actions.pod:100
3873 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
3878 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
3880 "This function adds a virtual machine disk image C<filename> to libguestfs. "
3881 "The first time you call this function, the disk appears as C</dev/sda>, the "
3882 "second time as C</dev/sdb>, and so on."
3886 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
3888 "You don't necessarily need to be root when using libguestfs. However you "
3889 "obviously do need sufficient permissions to access the filename for whatever "
3890 "operations you want to perform (ie. read access if you just want to read the "
3891 "image or write access if you want to modify the image)."
3895 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
3896 msgid "This call checks that C<filename> exists."
3900 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3123 ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4682
3901 msgid "The optional arguments are:"
3905 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
3910 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
3912 "If true then the image is treated as read-only. Writes are still allowed, "
3913 "but they are stored in a temporary snapshot overlay which is discarded at "
3914 "the end. The disk that you add is not modified."
3918 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
3923 #: ../fish/guestfish-actions.pod:127
3925 "This forces the image format. If you omit this (or use L</add-drive> or "
3926 "L</add-drive-ro>) then the format is automatically detected. Possible "
3927 "formats include C<raw> and C<qcow2>."
3931 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
3933 "Automatic detection of the format opens you up to a potential security hole "
3934 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3935 "RHBZ#642934. Specifying the format closes this security hole."
3939 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
3944 #: ../fish/guestfish-actions.pod:138
3946 "This rarely-used option lets you emulate the behaviour of the deprecated "
3947 "L</add-drive-with-if> call (q.v.)"
3951 #: ../fish/guestfish-actions.pod:145
3952 msgid "add-drive-ro"
3956 #: ../fish/guestfish-actions.pod:147
3961 #: ../fish/guestfish-actions.pod:149
3964 " add-drive-ro filename\n"
3969 #: ../fish/guestfish-actions.pod:151
3971 "This function is the equivalent of calling L</add-drive-opts> with the "
3972 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
3973 "is added read-only, with the format being detected automatically."
3977 #: ../fish/guestfish-actions.pod:156
3978 msgid "add-drive-ro-with-if"
3982 #: ../fish/guestfish-actions.pod:158
3985 " add-drive-ro-with-if filename iface\n"
3990 #: ../fish/guestfish-actions.pod:160
3992 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
3993 "interface emulation to use at run time."
3997 #: ../fish/guestfish-actions.pod:170
3998 msgid "add-drive-with-if"
4002 #: ../fish/guestfish-actions.pod:172
4005 " add-drive-with-if filename iface\n"
4010 #: ../fish/guestfish-actions.pod:174
4012 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4013 "interface emulation to use at run time."
4017 #: ../fish/guestfish-actions.pod:184
4022 #: ../fish/guestfish-actions.pod:186
4025 " aug-clear augpath\n"
4030 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
4032 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4033 "L<augtool(1)> C<clear> command."
4037 #: ../fish/guestfish-actions.pod:191
4042 #: ../fish/guestfish-actions.pod:193
4050 #: ../fish/guestfish-actions.pod:195
4052 "Close the current Augeas handle and free up any resources used by it. After "
4053 "calling this, you have to call L</aug-init> again before you can use any "
4054 "other Augeas functions."
4058 #: ../fish/guestfish-actions.pod:200
4063 #: ../fish/guestfish-actions.pod:202
4066 " aug-defnode name expr val\n"
4071 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
4072 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4076 #: ../fish/guestfish-actions.pod:207
4078 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4079 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
4080 "containing that single node."
4084 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
4086 "On success this returns a pair containing the number of nodes in the "
4087 "nodeset, and a boolean flag if a node was created."
4091 #: ../fish/guestfish-actions.pod:215
4096 #: ../fish/guestfish-actions.pod:217
4099 " aug-defvar name expr\n"
4104 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
4106 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4107 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4111 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
4113 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4114 "evaluates to something which is not a nodeset."
4118 #: ../fish/guestfish-actions.pod:226
4123 #: ../fish/guestfish-actions.pod:228
4126 " aug-get augpath\n"
4131 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
4133 "Look up the value associated with C<path>. If C<path> matches exactly one "
4134 "node, the C<value> is returned."
4138 #: ../fish/guestfish-actions.pod:233
4143 #: ../fish/guestfish-actions.pod:235
4146 " aug-init root flags\n"
4151 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
4153 "Create a new Augeas handle for editing configuration files. If there was "
4154 "any previous Augeas handle associated with this guestfs session, then it is "
4159 #: ../fish/guestfish-actions.pod:241
4160 msgid "You must call this before using any other L</aug-*> commands."
4164 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
4165 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4169 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
4171 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4172 "logical I<or> of the following integers:"
4176 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
4177 msgid "C<AUG_SAVE_BACKUP> = 1"
4181 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
4182 msgid "Keep the original file with a C<.augsave> extension."
4186 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
4187 msgid "C<AUG_SAVE_NEWFILE> = 2"
4191 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
4193 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4194 "original. Overrides C<AUG_SAVE_BACKUP>."
4198 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
4199 msgid "C<AUG_TYPE_CHECK> = 4"
4203 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
4204 msgid "Typecheck lenses."
4208 #: ../fish/guestfish-actions.pod:266
4210 "This option is only useful when debugging Augeas lenses. Use of this option "
4211 "may require additional memory for the libguestfs appliance. You may need to "
4212 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
4216 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
4217 msgid "C<AUG_NO_STDINC> = 8"
4221 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
4222 msgid "Do not use standard load path for modules."
4226 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
4227 msgid "C<AUG_SAVE_NOOP> = 16"
4231 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
4232 msgid "Make save a no-op, just record what would have been changed."
4236 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
4237 msgid "C<AUG_NO_LOAD> = 32"
4241 #: ../fish/guestfish-actions.pod:281
4242 msgid "Do not load the tree in L</aug-init>."
4246 #: ../fish/guestfish-actions.pod:285
4247 msgid "To close the handle, you can call L</aug-close>."
4251 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
4252 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4256 #: ../fish/guestfish-actions.pod:289
4261 #: ../fish/guestfish-actions.pod:291
4264 " aug-insert augpath label true|false\n"
4269 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
4271 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4272 "or after C<path> (depending on the boolean flag C<before>)."
4276 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
4278 "C<path> must match exactly one existing node in the tree, and C<label> must "
4279 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4283 #: ../fish/guestfish-actions.pod:301
4288 #: ../fish/guestfish-actions.pod:303
4296 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
4297 msgid "Load files into the tree."
4301 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
4302 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4306 #: ../fish/guestfish-actions.pod:310
4311 #: ../fish/guestfish-actions.pod:312
4319 #: ../fish/guestfish-actions.pod:314
4321 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4322 "resulting nodes into alphabetical order."
4326 #: ../fish/guestfish-actions.pod:317
4331 #: ../fish/guestfish-actions.pod:319
4334 " aug-match augpath\n"
4339 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
4341 "Returns a list of paths which match the path expression C<path>. The "
4342 "returned paths are sufficiently qualified so that they match exactly one "
4343 "node in the current tree."
4347 #: ../fish/guestfish-actions.pod:325
4352 #: ../fish/guestfish-actions.pod:327
4355 " aug-mv src dest\n"
4360 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
4362 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4363 "C<dest> is overwritten if it exists."
4367 #: ../fish/guestfish-actions.pod:332
4372 #: ../fish/guestfish-actions.pod:334
4380 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
4381 msgid "Remove C<path> and all of its children."
4385 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
4386 msgid "On success this returns the number of entries which were removed."
4390 #: ../fish/guestfish-actions.pod:340
4395 #: ../fish/guestfish-actions.pod:342
4403 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
4404 msgid "This writes all pending changes to disk."
4408 #: ../fish/guestfish-actions.pod:346
4410 "The flags which were passed to L</aug-init> affect exactly how files are "
4415 #: ../fish/guestfish-actions.pod:349
4420 #: ../fish/guestfish-actions.pod:351
4423 " aug-set augpath val\n"
4428 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
4429 msgid "Set the value associated with C<path> to C<val>."
4433 #: ../fish/guestfish-actions.pod:355
4435 "In the Augeas API, it is possible to clear a node by setting the value to "
4436 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4437 "this call. Instead you must use the L</aug-clear> call."
4441 #: ../fish/guestfish-actions.pod:360
4446 #: ../fish/guestfish-actions.pod:362
4449 " available 'groups ...'\n"
4454 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
4456 "This command is used to check the availability of some groups of "
4457 "functionality in the appliance, which not all builds of the libguestfs "
4458 "appliance will be able to provide."
4462 #: ../fish/guestfish-actions.pod:368
4464 "The libguestfs groups, and the functions that those groups correspond to, "
4465 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4466 "runtime by calling L</available-all-groups>."
4470 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
4472 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4473 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4474 "and Augeas (configuration file editing) functions."
4478 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
4479 msgid "The command returns no error if I<all> requested groups are available."
4483 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
4485 "It fails with an error if one or more of the requested groups is unavailable "
4490 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
4492 "If an unknown group name is included in the list of groups then an error is "
4497 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
4502 #: ../fish/guestfish-actions.pod:392
4503 msgid "You must call L</launch> before calling this function."
4507 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
4509 "The reason is because we don't know what groups are supported by the "
4510 "appliance/daemon until it is running and can be queried."
4514 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
4516 "If a group of functions is available, this does not necessarily mean that "
4517 "they will work. You still have to check for errors when calling individual "
4518 "API functions even if they are available."
4522 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
4524 "It is usually the job of distro packagers to build complete functionality "
4525 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4526 "with all requirements satisfied, will support everything."
4530 #: ../fish/guestfish-actions.pod:414
4532 "This call was added in version C<1.0.80>. In previous versions of "
4533 "libguestfs all you could do would be to speculatively execute a command to "
4534 "find out if the daemon implemented it. See also L</version>."
4538 #: ../fish/guestfish-actions.pod:421
4539 msgid "available-all-groups"
4543 #: ../fish/guestfish-actions.pod:423
4546 " available-all-groups\n"
4551 #: ../fish/guestfish-actions.pod:425
4553 "This command returns a list of all optional groups that this daemon knows "
4554 "about. Note this returns both supported and unsupported groups. To find "
4555 "out which ones the daemon can actually support you have to call "
4556 "L</available> on each member of the returned list."
4560 #: ../fish/guestfish-actions.pod:431
4561 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
4565 #: ../fish/guestfish-actions.pod:433
4570 #: ../fish/guestfish-actions.pod:435
4573 " base64-in (base64file|-) filename\n"
4578 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
4579 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4583 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:867 ../fish/guestfish-actions.pod:886 ../fish/guestfish-actions.pod:1260 ../fish/guestfish-actions.pod:4685 ../fish/guestfish-actions.pod:4697 ../fish/guestfish-actions.pod:4708 ../fish/guestfish-actions.pod:4719 ../fish/guestfish-actions.pod:4771 ../fish/guestfish-actions.pod:4780 ../fish/guestfish-actions.pod:4834 ../fish/guestfish-actions.pod:4857
4584 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
4588 #: ../fish/guestfish-actions.pod:442
4593 #: ../fish/guestfish-actions.pod:444
4596 " base64-out filename (base64file|-)\n"
4601 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
4603 "This command downloads the contents of C<filename>, writing it out to local "
4604 "file C<base64file> encoded as base64."
4608 #: ../fish/guestfish-actions.pod:451
4609 msgid "blockdev-flushbufs"
4613 #: ../fish/guestfish-actions.pod:453
4616 " blockdev-flushbufs device\n"
4621 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
4622 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4626 #: ../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
4627 msgid "This uses the L<blockdev(8)> command."
4631 #: ../fish/guestfish-actions.pod:460
4632 msgid "blockdev-getbsz"
4636 #: ../fish/guestfish-actions.pod:462
4639 " blockdev-getbsz device\n"
4644 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
4645 msgid "This returns the block size of a device."
4649 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529 ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
4651 "(Note this is different from both I<size in blocks> and I<filesystem block "
4656 #: ../fish/guestfish-actions.pod:471
4657 msgid "blockdev-getro"
4661 #: ../fish/guestfish-actions.pod:473
4664 " blockdev-getro device\n"
4669 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
4671 "Returns a boolean indicating if the block device is read-only (true if "
4672 "read-only, false if not)."
4676 #: ../fish/guestfish-actions.pod:480
4677 msgid "blockdev-getsize64"
4681 #: ../fish/guestfish-actions.pod:482
4684 " blockdev-getsize64 device\n"
4689 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
4690 msgid "This returns the size of the device in bytes."
4694 #: ../fish/guestfish-actions.pod:486
4695 msgid "See also L</blockdev-getsz>."
4699 #: ../fish/guestfish-actions.pod:490
4700 msgid "blockdev-getss"
4704 #: ../fish/guestfish-actions.pod:492
4707 " blockdev-getss device\n"
4712 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
4714 "This returns the size of sectors on a block device. Usually 512, but can be "
4715 "larger for modern devices."
4719 #: ../fish/guestfish-actions.pod:497
4720 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
4724 #: ../fish/guestfish-actions.pod:502
4725 msgid "blockdev-getsz"
4729 #: ../fish/guestfish-actions.pod:504
4732 " blockdev-getsz device\n"
4737 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
4739 "This returns the size of the device in units of 512-byte sectors (even if "
4740 "the sectorsize isn't 512 bytes ... weird)."
4744 #: ../fish/guestfish-actions.pod:509
4746 "See also L</blockdev-getss> for the real sector size of the device, and "
4747 "L</blockdev-getsize64> for the more useful I<size in bytes>."
4751 #: ../fish/guestfish-actions.pod:515
4752 msgid "blockdev-rereadpt"
4756 #: ../fish/guestfish-actions.pod:517
4759 " blockdev-rereadpt device\n"
4764 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
4765 msgid "Reread the partition table on C<device>."
4769 #: ../fish/guestfish-actions.pod:523
4770 msgid "blockdev-setbsz"
4774 #: ../fish/guestfish-actions.pod:525
4777 " blockdev-setbsz device blocksize\n"
4782 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
4783 msgid "This sets the block size of a device."
4787 #: ../fish/guestfish-actions.pod:534
4788 msgid "blockdev-setro"
4792 #: ../fish/guestfish-actions.pod:536
4795 " blockdev-setro device\n"
4800 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
4801 msgid "Sets the block device named C<device> to read-only."
4805 #: ../fish/guestfish-actions.pod:542
4806 msgid "blockdev-setrw"
4810 #: ../fish/guestfish-actions.pod:544
4813 " blockdev-setrw device\n"
4818 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
4819 msgid "Sets the block device named C<device> to read-write."
4823 #: ../fish/guestfish-actions.pod:550
4824 msgid "btrfs-filesystem-resize"
4828 #: ../fish/guestfish-actions.pod:552
4831 " btrfs-filesystem-resize mountpoint [size:..]\n"
4836 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
4837 msgid "This command resizes a btrfs filesystem."
4841 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
4843 "Note that unlike other resize calls, the filesystem has to be mounted and "
4844 "the parameter is the mountpoint not the device (this is a requirement of "
4849 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3444 ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5216
4850 msgid "The optional parameters are:"
4854 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3448 ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5220
4859 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
4861 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
4862 "resized to the maximum size."
4866 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
4867 msgid "See also L<btrfs(8)>."
4871 #: ../fish/guestfish-actions.pod:575
4872 msgid "case-sensitive-path"
4876 #: ../fish/guestfish-actions.pod:577
4879 " case-sensitive-path path\n"
4884 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
4886 "This can be used to resolve case insensitive paths on a filesystem which is "
4887 "case sensitive. The use case is to resolve paths which you have read from "
4888 "Windows configuration files or the Windows Registry, to the true path."
4892 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
4894 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4895 "(and probably others), which is that although the underlying filesystem is "
4896 "case-insensitive, the driver exports the filesystem to Linux as "
4901 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
4903 "One consequence of this is that special directories such as C<c:\\windows> "
4904 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4905 "precise details of how they were created. In Windows itself this would not "
4910 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
4912 "Bug or feature? You decide: "
4913 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
4917 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
4919 "This function resolves the true case of each element in the path and returns "
4920 "the case-sensitive path."
4924 #: ../fish/guestfish-actions.pod:601
4926 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
4927 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4928 "how the directories were originally created under Windows)."
4932 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
4933 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4937 #: ../fish/guestfish-actions.pod:609
4938 msgid "See also L</realpath>."
4942 #: ../fish/guestfish-actions.pod:611
4947 #: ../fish/guestfish-actions.pod:613
4955 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3864 ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5859
4956 msgid "Return the contents of the file named C<path>."
4960 #: ../fish/guestfish-actions.pod:617
4962 "Note that this function cannot correctly handle binary files (specifically, "
4963 "files containing C<\\0> character which is treated as end of string). For "
4964 "those you need to use the L</read-file> or L</download> functions which have "
4965 "a more complex interface."
4969 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757 ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:945 ../fish/guestfish-actions.pod:955 ../fish/guestfish-actions.pod:1022 ../fish/guestfish-actions.pod:1032 ../fish/guestfish-actions.pod:1224 ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:1541 ../fish/guestfish-actions.pod:1591 ../fish/guestfish-actions.pod:1606 ../fish/guestfish-actions.pod:1616 ../fish/guestfish-actions.pod:1635 ../fish/guestfish-actions.pod:3734 ../fish/guestfish-actions.pod:3749 ../fish/guestfish-actions.pod:3825 ../fish/guestfish-actions.pod:3842 ../fish/guestfish-actions.pod:3857 ../fish/guestfish-actions.pod:4526 ../fish/guestfish-actions.pod:4572 ../fish/guestfish-actions.pod:4657 ../fish/guestfish-actions.pod:4672 ../fish/guestfish-actions.pod:5078 ../fish/guestfish-actions.pod:5090 ../fish/guestfish-actions.pod:5108 ../fish/guestfish-actions.pod:5125 ../fish/guestfish-actions.pod:5135 ../fish/guestfish-actions.pod:5192 ../fish/guestfish-actions.pod:5202 ../fish/guestfish-actions.pod:5231 ../fish/guestfish-actions.pod:5241 ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127 ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1443 ../src/guestfs-actions.pod:1462 ../src/guestfs-actions.pod:1565 ../src/guestfs-actions.pod:1584 ../src/guestfs-actions.pod:1830 ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2320 ../src/guestfs-actions.pod:2385 ../src/guestfs-actions.pod:2409 ../src/guestfs-actions.pod:2426 ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:5641 ../src/guestfs-actions.pod:5667 ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5824 ../src/guestfs-actions.pod:5848 ../src/guestfs-actions.pod:6799 ../src/guestfs-actions.pod:6854 ../src/guestfs-actions.pod:7000 ../src/guestfs-actions.pod:7024 ../src/guestfs-actions.pod:7689 ../src/guestfs-actions.pod:7709 ../src/guestfs-actions.pod:7735 ../src/guestfs-actions.pod:7761 ../src/guestfs-actions.pod:7780 ../src/guestfs-actions.pod:7874 ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7939 ../src/guestfs-actions.pod:7958
4971 "Because of the message protocol, there is a transfer limit of somewhere "
4972 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4976 #: ../fish/guestfish-actions.pod:625
4981 #: ../fish/guestfish-actions.pod:627
4984 " checksum csumtype path\n"
4989 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
4990 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
4994 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
4996 "The type of checksum to compute is given by the C<csumtype> parameter which "
4997 "must have one of the following values:"
5001 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
5006 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
5008 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5013 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
5018 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
5019 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5023 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
5028 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
5029 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5033 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
5038 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
5039 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5043 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
5048 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
5049 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5053 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
5058 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
5059 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5063 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
5068 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
5069 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5073 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
5074 msgid "The checksum is returned as a printable string."
5078 #: ../fish/guestfish-actions.pod:670
5079 msgid "To get the checksum for a device, use L</checksum-device>."
5083 #: ../fish/guestfish-actions.pod:672
5084 msgid "To get the checksums for many files, use L</checksums-out>."
5088 #: ../fish/guestfish-actions.pod:674
5089 msgid "checksum-device"
5093 #: ../fish/guestfish-actions.pod:676
5096 " checksum-device csumtype device\n"
5101 #: ../fish/guestfish-actions.pod:678
5103 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5104 "device named C<device>. For the types of checksums supported see the "
5105 "L</checksum> command."
5109 #: ../fish/guestfish-actions.pod:682
5110 msgid "checksums-out"
5114 #: ../fish/guestfish-actions.pod:684
5117 " checksums-out csumtype directory (sumsfile|-)\n"
5122 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
5124 "This command computes the checksums of all regular files in C<directory> and "
5125 "then emits a list of those checksums to the local output file C<sumsfile>."
5129 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
5131 "This can be used for verifying the integrity of a virtual machine. However "
5132 "to be properly secure you should pay attention to the output of the checksum "
5133 "command (it uses the ones from GNU coreutils). In particular when the "
5134 "filename is not printable, coreutils uses a special backslash syntax. For "
5135 "more information, see the GNU coreutils info file."
5139 #: ../fish/guestfish-actions.pod:700
5144 #: ../fish/guestfish-actions.pod:702
5147 " chmod mode path\n"
5152 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
5154 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5159 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
5161 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5162 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5167 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3087 ../fish/guestfish-actions.pod:3226 ../fish/guestfish-actions.pod:3236 ../fish/guestfish-actions.pod:3246 ../src/guestfs-actions.pod:1064 ../src/guestfs-actions.pod:4613 ../src/guestfs-actions.pod:4822 ../src/guestfs-actions.pod:4841 ../src/guestfs-actions.pod:4860
5168 msgid "The mode actually set is affected by the umask."
5172 #: ../fish/guestfish-actions.pod:713
5177 #: ../fish/guestfish-actions.pod:715
5180 " chown owner group path\n"
5185 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
5186 msgid "Change the file owner to C<owner> and group to C<group>."
5190 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2522 ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3684
5192 "Only numeric uid and gid are supported. If you want to use names, you will "
5193 "need to locate and parse the password file yourself (Augeas support makes "
5194 "this relatively easy)."
5198 #: ../fish/guestfish-actions.pod:723
5203 #: ../fish/guestfish-actions.pod:725
5206 " command 'arguments ...'\n"
5211 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
5213 "This call runs a command from the guest filesystem. The filesystem must be "
5214 "mounted, and must contain a compatible operating system (ie. something "
5215 "Linux, with the same or compatible processor architecture)."
5219 #: ../fish/guestfish-actions.pod:732
5221 "The single parameter is an argv-style list of arguments. The first element "
5222 "is the name of the program to run. Subsequent elements are parameters. The "
5223 "list must be non-empty (ie. must contain a program name). Note that the "
5224 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5228 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
5229 msgid "The return value is anything printed to I<stdout> by the command."
5233 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
5235 "If the command returns a non-zero exit status, then this function returns an "
5236 "error message. The error message string is the content of I<stderr> from "
5241 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5243 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5244 "C</bin>. If you require a program from another location, you should provide "
5245 "the full path in the first parameter."
5249 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
5251 "Shared libraries and data files required by the program must be available on "
5252 "filesystems which are mounted in the correct places. It is the caller's "
5253 "responsibility to ensure all filesystems that are needed are mounted at the "
5258 #: ../fish/guestfish-actions.pod:760
5259 msgid "command-lines"
5263 #: ../fish/guestfish-actions.pod:762
5266 " command-lines 'arguments ...'\n"
5271 #: ../fish/guestfish-actions.pod:764
5272 msgid "This is the same as L</command>, but splits the result into a list of lines."
5276 #: ../fish/guestfish-actions.pod:767
5277 msgid "See also: L</sh-lines>"
5281 #: ../fish/guestfish-actions.pod:772
5286 #: ../fish/guestfish-actions.pod:774
5289 " config qemuparam qemuvalue\n"
5294 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1159
5296 "This can be used to add arbitrary qemu command line parameters of the form "
5297 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
5298 "setting some parameters which would interfere with parameters that we use."
5302 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1164
5303 msgid "The first character of C<param> string must be a C<-> (dash)."
5307 #: ../fish/guestfish-actions.pod:783 ../src/guestfs-actions.pod:1166
5308 msgid "C<value> can be NULL."
5312 #: ../fish/guestfish-actions.pod:785
5317 #: ../fish/guestfish-actions.pod:787
5320 " copy-size src dest size\n"
5325 #: ../fish/guestfish-actions.pod:789 ../src/guestfs-actions.pod:1180
5327 "This command copies exactly C<size> bytes from one source device or file "
5328 "C<src> to another destination device or file C<dest>."
5332 #: ../fish/guestfish-actions.pod:792 ../src/guestfs-actions.pod:1183
5334 "Note this will fail if the source is too short or if the destination is not "
5339 #: ../fish/guestfish-actions.pod:795
5344 #: ../fish/guestfish-actions.pod:797
5352 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1202
5354 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5355 "destination filename or destination directory."
5359 #: ../fish/guestfish-actions.pod:802
5364 #: ../fish/guestfish-actions.pod:804
5372 #: ../fish/guestfish-actions.pod:806 ../src/guestfs-actions.pod:1216
5374 "This copies a file or directory from C<src> to C<dest> recursively using the "
5379 #: ../fish/guestfish-actions.pod:809
5384 #: ../fish/guestfish-actions.pod:811
5392 #: ../fish/guestfish-actions.pod:813 ../src/guestfs-actions.pod:1230
5394 "This command copies from one source device or file C<src> to another "
5395 "destination device or file C<dest>. Normally you would use this to copy to "
5396 "or from a device or partition, for example to duplicate a filesystem."
5400 #: ../fish/guestfish-actions.pod:818
5402 "If the destination is a device, it must be as large or larger than the "
5403 "source file or device, otherwise the copy will fail. This command cannot do "
5404 "partial copies (see L</copy-size>)."
5408 #: ../fish/guestfish-actions.pod:822
5413 #: ../fish/guestfish-actions.pod:824
5421 #: ../fish/guestfish-actions.pod:826 ../src/guestfs-actions.pod:1248
5422 msgid "This command runs the C<df> command to report disk space used."
5426 #: ../fish/guestfish-actions.pod:828 ../fish/guestfish-actions.pod:839
5428 "This command is mostly useful for interactive sessions. It is I<not> "
5429 "intended that you try to parse the output string. Use L</statvfs> from "
5434 #: ../fish/guestfish-actions.pod:832
5439 #: ../fish/guestfish-actions.pod:834
5447 #: ../fish/guestfish-actions.pod:836 ../src/guestfs-actions.pod:1264
5449 "This command runs the C<df -h> command to report disk space used in "
5450 "human-readable format."
5454 #: ../fish/guestfish-actions.pod:843
5459 #: ../fish/guestfish-actions.pod:845
5467 #: ../fish/guestfish-actions.pod:847 ../src/guestfs-actions.pod:1281
5469 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5470 "This is sometimes useful for extended debugging of problems."
5474 #: ../fish/guestfish-actions.pod:851
5476 "Another way to get the same information is to enable verbose messages with "
5477 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
5478 "before running the program."
5482 #: ../fish/guestfish-actions.pod:856
5487 #: ../fish/guestfish-actions.pod:858
5490 " download remotefilename (filename|-)\n"
5495 #: ../fish/guestfish-actions.pod:860 ../fish/guestfish-actions.pod:873 ../src/guestfs-actions.pod:1302 ../src/guestfs-actions.pod:1327
5497 "Download file C<remotefilename> and save it as C<filename> on the local "
5502 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:4830 ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:7259
5503 msgid "C<filename> can also be a named pipe."
5507 #: ../fish/guestfish-actions.pod:865
5508 msgid "See also L</upload>, L</cat>."
5512 #: ../fish/guestfish-actions.pod:869
5513 msgid "download-offset"
5517 #: ../fish/guestfish-actions.pod:871
5520 " download-offset remotefilename (filename|-) offset size\n"
5525 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1330
5527 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5528 "region must be within the file or device)."
5532 #: ../fish/guestfish-actions.pod:879
5534 "Note that there is no limit on the amount of data that can be downloaded "
5535 "with this call, unlike with L</pread>, and this call always reads the full "
5536 "amount unless an error occurs."
5540 #: ../fish/guestfish-actions.pod:884
5541 msgid "See also L</download>, L</pread>."
5545 #: ../fish/guestfish-actions.pod:888
5550 #: ../fish/guestfish-actions.pod:890
5553 " drop-caches whattodrop\n"
5558 #: ../fish/guestfish-actions.pod:892 ../src/guestfs-actions.pod:1355
5560 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5561 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5562 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5566 #: ../fish/guestfish-actions.pod:897 ../src/guestfs-actions.pod:1360
5567 msgid "Setting C<whattodrop> to 3 should drop everything."
5571 #: ../fish/guestfish-actions.pod:899 ../src/guestfs-actions.pod:1362
5573 "This automatically calls L<sync(2)> before the operation, so that the "
5574 "maximum guest memory is freed."
5578 #: ../fish/guestfish-actions.pod:902
5583 #: ../fish/guestfish-actions.pod:904
5591 #: ../fish/guestfish-actions.pod:906 ../src/guestfs-actions.pod:1375
5593 "This command runs the C<du -s> command to estimate file space usage for "
5598 #: ../fish/guestfish-actions.pod:909 ../src/guestfs-actions.pod:1378
5600 "C<path> can be a file or a directory. If C<path> is a directory then the "
5601 "estimate includes the contents of the directory and all subdirectories "
5606 #: ../fish/guestfish-actions.pod:913 ../src/guestfs-actions.pod:1382
5607 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5611 #: ../fish/guestfish-actions.pod:916
5616 #: ../fish/guestfish-actions.pod:918
5619 " e2fsck-f device\n"
5624 #: ../fish/guestfish-actions.pod:920 ../src/guestfs-actions.pod:1400
5626 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5627 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
5632 #: ../fish/guestfish-actions.pod:924
5634 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
5635 "should use L</fsck>."
5639 #: ../fish/guestfish-actions.pod:927
5644 #: ../fish/guestfish-actions.pod:929
5647 " echo-daemon 'words ...'\n"
5652 #: ../fish/guestfish-actions.pod:931 ../src/guestfs-actions.pod:1417
5654 "This command concatenates the list of C<words> passed with single spaces "
5655 "between them and returns the resulting string."
5659 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1420
5660 msgid "You can use this command to test the connection through to the daemon."
5664 #: ../fish/guestfish-actions.pod:936
5665 msgid "See also L</ping-daemon>."
5669 #: ../fish/guestfish-actions.pod:938
5674 #: ../fish/guestfish-actions.pod:940
5677 " egrep regex path\n"
5682 #: ../fish/guestfish-actions.pod:942 ../src/guestfs-actions.pod:1436
5683 msgid "This calls the external C<egrep> program and returns the matching lines."
5687 #: ../fish/guestfish-actions.pod:948
5692 #: ../fish/guestfish-actions.pod:950
5695 " egrepi regex path\n"
5700 #: ../fish/guestfish-actions.pod:952 ../src/guestfs-actions.pod:1455
5701 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5705 #: ../fish/guestfish-actions.pod:958
5710 #: ../fish/guestfish-actions.pod:960
5713 " equal file1 file2\n"
5718 #: ../fish/guestfish-actions.pod:962 ../src/guestfs-actions.pod:1474
5720 "This compares the two files C<file1> and C<file2> and returns true if their "
5721 "content is exactly equal, or false otherwise."
5725 #: ../fish/guestfish-actions.pod:965 ../src/guestfs-actions.pod:1477
5726 msgid "The external L<cmp(1)> program is used for the comparison."
5730 #: ../fish/guestfish-actions.pod:967
5735 #: ../fish/guestfish-actions.pod:969
5743 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1489
5745 "This returns C<true> if and only if there is a file, directory (or anything) "
5746 "with the given C<path> name."
5750 #: ../fish/guestfish-actions.pod:974
5751 msgid "See also L</is-file>, L</is-dir>, L</stat>."
5755 #: ../fish/guestfish-actions.pod:976
5760 #: ../fish/guestfish-actions.pod:978
5763 " fallocate path len\n"
5768 #: ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:999 ../src/guestfs-actions.pod:1505 ../src/guestfs-actions.pod:1531
5770 "This command preallocates a file (containing zero bytes) named C<path> of "
5771 "size C<len> bytes. If the file exists already, it is overwritten."
5775 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1509
5777 "Do not confuse this with the guestfish-specific C<alloc> command which "
5778 "allocates a file in the host and attaches it as a device."
5782 #: ../fish/guestfish-actions.pod:988
5784 "This function is deprecated. In new code, use the L</fallocate64> call "
5789 #: ../fish/guestfish-actions.pod:995
5794 #: ../fish/guestfish-actions.pod:997
5797 " fallocate64 path len\n"
5802 #: ../fish/guestfish-actions.pod:1003
5804 "Note that this call allocates disk blocks for the file. To create a sparse "
5805 "file use L</truncate-size> instead."
5809 #: ../fish/guestfish-actions.pod:1006
5811 "The deprecated call L</fallocate> does the same, but owing to an oversight "
5812 "it only allowed 30 bit lengths to be specified, effectively limiting the "
5813 "maximum size of files created through that call to 1GB."
5817 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1543
5819 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5820 "commands which create a file in the host and attach it as a device."
5824 #: ../fish/guestfish-actions.pod:1015
5829 #: ../fish/guestfish-actions.pod:1017
5832 " fgrep pattern path\n"
5837 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1558
5838 msgid "This calls the external C<fgrep> program and returns the matching lines."
5842 #: ../fish/guestfish-actions.pod:1025
5847 #: ../fish/guestfish-actions.pod:1027
5850 " fgrepi pattern path\n"
5855 #: ../fish/guestfish-actions.pod:1029 ../src/guestfs-actions.pod:1577
5856 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
5860 #: ../fish/guestfish-actions.pod:1035
5865 #: ../fish/guestfish-actions.pod:1037
5873 #: ../fish/guestfish-actions.pod:1039 ../src/guestfs-actions.pod:1595
5875 "This call uses the standard L<file(1)> command to determine the type or "
5876 "contents of the file."
5880 #: ../fish/guestfish-actions.pod:1042 ../src/guestfs-actions.pod:1598
5882 "This call will also transparently look inside various types of compressed "
5887 #: ../fish/guestfish-actions.pod:1045 ../src/guestfs-actions.pod:1601
5889 "The exact command which runs is C<file -zb path>. Note in particular that "
5890 "the filename is not prepended to the output (the I<-b> option)."
5894 #: ../fish/guestfish-actions.pod:1049 ../src/guestfs-actions.pod:1605
5896 "The output depends on the output of the underlying L<file(1)> command and it "
5897 "can change in future in ways beyond our control. In other words, the output "
5898 "is not guaranteed by the ABI."
5902 #: ../fish/guestfish-actions.pod:1053
5904 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
5905 "(etc), L</is-zero>."
5909 #: ../fish/guestfish-actions.pod:1056
5910 msgid "file-architecture"
5914 #: ../fish/guestfish-actions.pod:1058
5917 " file-architecture filename\n"
5922 #: ../fish/guestfish-actions.pod:1060 ../src/guestfs-actions.pod:1623
5924 "This detects the architecture of the binary C<filename>, and returns it if "
5929 #: ../fish/guestfish-actions.pod:1063 ../src/guestfs-actions.pod:1626
5930 msgid "Currently defined architectures are:"
5934 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1630
5939 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1632
5941 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
5942 "irrespective of the precise processor requirements of the binary."
5946 #: ../fish/guestfish-actions.pod:1072 ../src/guestfs-actions.pod:1635
5951 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1637
5952 msgid "64 bit x86-64."
5956 #: ../fish/guestfish-actions.pod:1076 ../src/guestfs-actions.pod:1639
5961 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1641
5962 msgid "32 bit SPARC."
5966 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1643
5971 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1645
5972 msgid "64 bit SPARC V9 and above."
5976 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1647
5981 #: ../fish/guestfish-actions.pod:1086 ../src/guestfs-actions.pod:1649
5982 msgid "Intel Itanium."
5986 #: ../fish/guestfish-actions.pod:1088 ../src/guestfs-actions.pod:1651
5991 #: ../fish/guestfish-actions.pod:1090 ../src/guestfs-actions.pod:1653
5992 msgid "32 bit Power PC."
5996 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1655
6001 #: ../fish/guestfish-actions.pod:1094 ../src/guestfs-actions.pod:1657
6002 msgid "64 bit Power PC."
6006 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1661
6007 msgid "Libguestfs may return other architecture strings in future."
6011 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1663
6012 msgid "The function works on at least the following types of files:"
6016 #: ../fish/guestfish-actions.pod:1106 ../src/guestfs-actions.pod:1669
6017 msgid "many types of Un*x and Linux binary"
6021 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1673
6022 msgid "many types of Un*x and Linux shared library"
6026 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1677
6027 msgid "Windows Win32 and Win64 binaries"
6031 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1681
6032 msgid "Windows Win32 and Win64 DLLs"
6036 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1683
6037 msgid "Win32 binaries and DLLs return C<i386>."
6041 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1685
6042 msgid "Win64 binaries and DLLs return C<x86_64>."
6046 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1689
6047 msgid "Linux kernel modules"
6051 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1693
6052 msgid "Linux new-style initrd images"
6056 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1697
6057 msgid "some non-x86 Linux vmlinuz kernels"
6061 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1701
6062 msgid "What it can't do currently:"
6066 #: ../fish/guestfish-actions.pod:1144 ../src/guestfs-actions.pod:1707
6067 msgid "static libraries (libfoo.a)"
6071 #: ../fish/guestfish-actions.pod:1148 ../src/guestfs-actions.pod:1711
6072 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6076 #: ../fish/guestfish-actions.pod:1152 ../src/guestfs-actions.pod:1715
6077 msgid "x86 Linux vmlinuz kernels"
6081 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1717
6083 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6084 "compressed code, and are horribly hard to unpack. If you want to find the "
6085 "architecture of a kernel, use the architecture of the associated initrd or "
6086 "kernel module(s) instead."
6090 #: ../fish/guestfish-actions.pod:1161
6095 #: ../fish/guestfish-actions.pod:1163
6103 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1735
6104 msgid "This command returns the size of C<file> in bytes."
6108 #: ../fish/guestfish-actions.pod:1167
6110 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
6111 "L</is-file> etc. To get the size of block devices, use "
6112 "L</blockdev-getsize64>."
6116 #: ../fish/guestfish-actions.pod:1171
6121 #: ../fish/guestfish-actions.pod:1173
6124 " fill c len path\n"
6129 #: ../fish/guestfish-actions.pod:1175 ../src/guestfs-actions.pod:1753
6131 "This command creates a new file called C<path>. The initial content of the "
6132 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6137 #: ../fish/guestfish-actions.pod:1179
6139 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6140 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6145 #: ../fish/guestfish-actions.pod:1184
6146 msgid "fill-pattern"
6150 #: ../fish/guestfish-actions.pod:1186
6153 " fill-pattern pattern len path\n"
6158 #: ../fish/guestfish-actions.pod:1188
6160 "This function is like L</fill> except that it creates a new file of length "
6161 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6162 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6167 #: ../fish/guestfish-actions.pod:1193
6172 #: ../fish/guestfish-actions.pod:1195
6180 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:1799
6182 "This command lists out all files and directories, recursively, starting at "
6183 "C<directory>. It is essentially equivalent to running the shell command "
6184 "C<find directory -print> but some post-processing happens on the output, "
6189 #: ../fish/guestfish-actions.pod:1202 ../src/guestfs-actions.pod:1804
6191 "This returns a list of strings I<without any prefix>. Thus if the directory "
6196 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1807
6206 #: ../fish/guestfish-actions.pod:1209
6207 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6211 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:1814
6222 #: ../fish/guestfish-actions.pod:1217 ../src/guestfs-actions.pod:1819
6223 msgid "If C<directory> is not a directory, then this command returns an error."
6227 #: ../fish/guestfish-actions.pod:1220 ../src/guestfs-actions.pod:1822
6228 msgid "The returned list is sorted."
6232 #: ../fish/guestfish-actions.pod:1222
6233 msgid "See also L</find0>."
6237 #: ../fish/guestfish-actions.pod:1227
6242 #: ../fish/guestfish-actions.pod:1229
6245 " find0 directory (files|-)\n"
6250 #: ../fish/guestfish-actions.pod:1231 ../src/guestfs-actions.pod:1842
6252 "This command lists out all files and directories, recursively, starting at "
6253 "C<directory>, placing the resulting list in the external file called "
6258 #: ../fish/guestfish-actions.pod:1235
6259 msgid "This command works the same way as L</find> with the following exceptions:"
6263 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1853
6264 msgid "The resulting list is written to an external file."
6268 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:1857
6270 "Items (filenames) in the result are separated by C<\\0> characters. See "
6271 "L<find(1)> option I<-print0>."
6275 #: ../fish/guestfish-actions.pod:1251 ../src/guestfs-actions.pod:1862
6276 msgid "This command is not limited in the number of names that it can return."
6280 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:1867
6281 msgid "The result list is not sorted."
6285 #: ../fish/guestfish-actions.pod:1262
6286 msgid "findfs-label"
6290 #: ../fish/guestfish-actions.pod:1264
6293 " findfs-label label\n"
6298 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1881
6300 "This command searches the filesystems and returns the one which has the "
6301 "given label. An error is returned if no such filesystem can be found."
6305 #: ../fish/guestfish-actions.pod:1270
6306 msgid "To find the label of a filesystem, use L</vfs-label>."
6310 #: ../fish/guestfish-actions.pod:1272
6315 #: ../fish/guestfish-actions.pod:1274
6318 " findfs-uuid uuid\n"
6323 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:1898
6325 "This command searches the filesystems and returns the one which has the "
6326 "given UUID. An error is returned if no such filesystem can be found."
6330 #: ../fish/guestfish-actions.pod:1280
6331 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
6335 #: ../fish/guestfish-actions.pod:1282
6340 #: ../fish/guestfish-actions.pod:1284
6343 " fsck fstype device\n"
6348 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1916
6350 "This runs the filesystem checker (fsck) on C<device> which should have "
6351 "filesystem type C<fstype>."
6355 #: ../fish/guestfish-actions.pod:1289 ../src/guestfs-actions.pod:1919
6357 "The returned integer is the status. See L<fsck(8)> for the list of status "
6358 "codes from C<fsck>."
6362 #: ../fish/guestfish-actions.pod:1298 ../src/guestfs-actions.pod:1928
6363 msgid "Multiple status codes can be summed together."
6367 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:1932
6369 "A non-zero return code can mean \"success\", for example if errors have been "
6370 "corrected on the filesystem."
6374 #: ../fish/guestfish-actions.pod:1307 ../src/guestfs-actions.pod:1937
6375 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6379 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:1942
6380 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6384 #: ../fish/guestfish-actions.pod:1314
6389 #: ../fish/guestfish-actions.pod:1316
6397 #: ../fish/guestfish-actions.pod:1318 ../src/guestfs-actions.pod:1953
6399 "Return the additional kernel options which are added to the guest kernel "
6404 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:1956
6405 msgid "If C<NULL> then no options are added."
6409 #: ../fish/guestfish-actions.pod:1323
6410 msgid "get-attach-method"
6414 #: ../fish/guestfish-actions.pod:1325
6417 " get-attach-method\n"
6422 #: ../fish/guestfish-actions.pod:1327
6423 msgid "Return the current attach method. See L</set-attach-method>."
6427 #: ../fish/guestfish-actions.pod:1329
6428 msgid "get-autosync"
6432 #: ../fish/guestfish-actions.pod:1331
6440 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:1981
6441 msgid "Get the autosync flag."
6445 #: ../fish/guestfish-actions.pod:1335
6450 #: ../fish/guestfish-actions.pod:1337
6458 #: ../fish/guestfish-actions.pod:1339 ../src/guestfs-actions.pod:1992
6459 msgid "Return the direct appliance mode flag."
6463 #: ../fish/guestfish-actions.pod:1341
6468 #: ../fish/guestfish-actions.pod:1343
6471 " get-e2label device\n"
6476 #: ../fish/guestfish-actions.pod:1345 ../src/guestfs-actions.pod:2004
6477 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6481 #: ../fish/guestfish-actions.pod:1348
6483 "This function is deprecated. In new code, use the L</vfs_label> call "
6488 #: ../fish/guestfish-actions.pod:1355
6493 #: ../fish/guestfish-actions.pod:1357
6496 " get-e2uuid device\n"
6501 #: ../fish/guestfish-actions.pod:1359 ../src/guestfs-actions.pod:2025
6502 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6506 #: ../fish/guestfish-actions.pod:1362
6508 "This function is deprecated. In new code, use the L</vfs_uuid> call "
6513 #: ../fish/guestfish-actions.pod:1369
6518 #: ../fish/guestfish-actions.pod:1371
6526 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2045
6527 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6531 #: ../fish/guestfish-actions.pod:1376
6533 "If L</set-memsize> was not called on this handle, and if "
6534 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6535 "value for memsize."
6539 #: ../fish/guestfish-actions.pod:1380 ../fish/guestfish-actions.pod:1437 ../fish/guestfish-actions.pod:4190 ../fish/guestfish-actions.pod:4292 ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2144 ../src/guestfs-actions.pod:6320 ../src/guestfs-actions.pod:6446
6540 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6544 #: ../fish/guestfish-actions.pod:1383
6549 #: ../fish/guestfish-actions.pod:1385
6557 #: ../fish/guestfish-actions.pod:1387 ../src/guestfs-actions.pod:2064
6558 msgid "This returns the enable network flag."
6562 #: ../fish/guestfish-actions.pod:1389
6567 #: ../fish/guestfish-actions.pod:1391
6575 #: ../fish/guestfish-actions.pod:1393 ../src/guestfs-actions.pod:2075
6576 msgid "Return the current search path."
6580 #: ../fish/guestfish-actions.pod:1395 ../src/guestfs-actions.pod:2077
6582 "This is always non-NULL. If it wasn't set already, then this will return "
6587 #: ../fish/guestfish-actions.pod:1398
6592 #: ../fish/guestfish-actions.pod:1400
6600 #: ../fish/guestfish-actions.pod:1402 ../src/guestfs-actions.pod:2090
6601 msgid "This returns the process group flag."
6605 #: ../fish/guestfish-actions.pod:1404
6610 #: ../fish/guestfish-actions.pod:1406
6615 #: ../fish/guestfish-actions.pod:1408
6623 #: ../fish/guestfish-actions.pod:1410 ../src/guestfs-actions.pod:2101
6625 "Return the process ID of the qemu subprocess. If there is no qemu "
6626 "subprocess, then this will return an error."
6630 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2104
6631 msgid "This is an internal call used for debugging and testing."
6635 #: ../fish/guestfish-actions.pod:1415
6640 #: ../fish/guestfish-actions.pod:1417
6648 #: ../fish/guestfish-actions.pod:1419 ../src/guestfs-actions.pod:2115
6649 msgid "Return the current qemu binary."
6653 #: ../fish/guestfish-actions.pod:1421 ../src/guestfs-actions.pod:2117
6655 "This is always non-NULL. If it wasn't set already, then this will return "
6656 "the default qemu binary name."
6660 #: ../fish/guestfish-actions.pod:1424
6661 msgid "get-recovery-proc"
6665 #: ../fish/guestfish-actions.pod:1426
6668 " get-recovery-proc\n"
6673 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2130
6674 msgid "Return the recovery process enabled flag."
6678 #: ../fish/guestfish-actions.pod:1430
6683 #: ../fish/guestfish-actions.pod:1432
6691 #: ../fish/guestfish-actions.pod:1434
6693 "This returns the current setting of the selinux flag which is passed to the "
6694 "appliance at boot time. See L</set-selinux>."
6698 #: ../fish/guestfish-actions.pod:1440
6703 #: ../fish/guestfish-actions.pod:1442
6711 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2156
6713 "This returns the current state as an opaque integer. This is only useful "
6714 "for printing debug and internal error messages."
6718 #: ../fish/guestfish-actions.pod:1447 ../fish/guestfish-actions.pod:2389 ../fish/guestfish-actions.pod:2407 ../fish/guestfish-actions.pod:2445 ../fish/guestfish-actions.pod:2461 ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:3461 ../src/guestfs-actions.pod:3490 ../src/guestfs-actions.pod:3551 ../src/guestfs-actions.pod:3578
6719 msgid "For more information on states, see L<guestfs(3)>."
6723 #: ../fish/guestfish-actions.pod:1449
6728 #: ../fish/guestfish-actions.pod:1451
6736 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2170
6737 msgid "Return the command trace flag."
6741 #: ../fish/guestfish-actions.pod:1455
6746 #: ../fish/guestfish-actions.pod:1457
6754 #: ../fish/guestfish-actions.pod:1459
6756 "Return the current umask. By default the umask is C<022> unless it has been "
6757 "set by calling L</umask>."
6761 #: ../fish/guestfish-actions.pod:1462
6766 #: ../fish/guestfish-actions.pod:1464
6774 #: ../fish/guestfish-actions.pod:1466 ../src/guestfs-actions.pod:2193
6775 msgid "This returns the verbose messages flag."
6779 #: ../fish/guestfish-actions.pod:1468
6784 #: ../fish/guestfish-actions.pod:1470
6792 #: ../fish/guestfish-actions.pod:1472 ../src/guestfs-actions.pod:2204
6793 msgid "This gets the SELinux security context of the daemon."
6797 #: ../fish/guestfish-actions.pod:1474
6798 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
6802 #: ../fish/guestfish-actions.pod:1477
6807 #: ../fish/guestfish-actions.pod:1479
6810 " getxattr path name\n"
6815 #: ../fish/guestfish-actions.pod:1481
6817 "Get a single extended attribute from file C<path> named C<name>. This call "
6818 "follows symlinks. If you want to lookup an extended attribute for the "
6819 "symlink itself, use L</lgetxattr>."
6823 #: ../fish/guestfish-actions.pod:1485 ../fish/guestfish-actions.pod:2534
6825 "Normally it is better to get all extended attributes from a file in one go "
6826 "by calling L</getxattrs>. However some Linux filesystem implementations are "
6827 "buggy and do not provide a way to list out attributes. For these "
6828 "filesystems (notably ntfs-3g) you have to know the names of the extended "
6829 "attributes you want in advance and call this function."
6833 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:2541 ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:3711
6835 "Extended attribute values are blobs of binary data. If there is no extended "
6836 "attribute named C<name>, this returns an error."
6840 #: ../fish/guestfish-actions.pod:1495
6841 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
6845 #: ../fish/guestfish-actions.pod:1497
6850 #: ../fish/guestfish-actions.pod:1499
6858 #: ../fish/guestfish-actions.pod:1501 ../src/guestfs-actions.pod:2250
6859 msgid "This call lists the extended attributes of the file or directory C<path>."
6863 #: ../fish/guestfish-actions.pod:1504 ../src/guestfs-actions.pod:2253
6865 "At the system call level, this is a combination of the L<listxattr(2)> and "
6866 "L<getxattr(2)> calls."
6870 #: ../fish/guestfish-actions.pod:1507
6871 msgid "See also: L</lgetxattrs>, L<attr(5)>."
6875 #: ../fish/guestfish-actions.pod:1509
6880 #: ../fish/guestfish-actions.pod:1511
6883 " glob-expand pattern\n"
6888 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2270
6890 "This command searches for all the pathnames matching C<pattern> according to "
6891 "the wildcard expansion rules used by the shell."
6895 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2274
6896 msgid "If no paths match, then this returns an empty list (note: not an error)."
6900 #: ../fish/guestfish-actions.pod:1520 ../src/guestfs-actions.pod:2277
6902 "It is just a wrapper around the C L<glob(3)> function with flags "
6903 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
6907 #: ../fish/guestfish-actions.pod:1524
6912 #: ../fish/guestfish-actions.pod:1526
6915 " grep regex path\n"
6920 #: ../fish/guestfish-actions.pod:1528 ../src/guestfs-actions.pod:2294
6921 msgid "This calls the external C<grep> program and returns the matching lines."
6925 #: ../fish/guestfish-actions.pod:1534
6930 #: ../fish/guestfish-actions.pod:1536
6933 " grepi regex path\n"
6938 #: ../fish/guestfish-actions.pod:1538 ../src/guestfs-actions.pod:2313
6939 msgid "This calls the external C<grep -i> program and returns the matching lines."
6943 #: ../fish/guestfish-actions.pod:1544
6944 msgid "grub-install"
6948 #: ../fish/guestfish-actions.pod:1546
6951 " grub-install root device\n"
6956 #: ../fish/guestfish-actions.pod:1548 ../src/guestfs-actions.pod:2332
6958 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
6959 "with the root directory being C<root>."
6963 #: ../fish/guestfish-actions.pod:1557 ../src/guestfs-actions.pod:2341
6965 "There is currently no way in the API to install grub2, which is used by most "
6966 "modern Linux guests. It is possible to run the grub2 command from the "
6967 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
6971 #: ../fish/guestfish-actions.pod:1564 ../src/guestfs-actions.pod:2348
6973 "This uses C<grub-install> from the host. Unfortunately grub is not always "
6974 "compatible with itself, so this only works in rather narrow circumstances. "
6975 "Careful testing with each guest version is advisable."
6979 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2355
6981 "If grub-install reports the error \"No suitable drive was found in the "
6982 "generated device map.\" it may be that you need to create a "
6983 "C</boot/grub/device.map> file first that contains the mapping between grub "
6984 "device names and Linux device names. It is usually sufficient to create a "
6989 #: ../fish/guestfish-actions.pod:1578 ../src/guestfs-actions.pod:2362
6997 #: ../fish/guestfish-actions.pod:1580 ../src/guestfs-actions.pod:2364
6998 msgid "replacing C</dev/vda> with the name of the installation device."
7002 #: ../fish/guestfish-actions.pod:1584
7007 #: ../fish/guestfish-actions.pod:1586
7015 #: ../fish/guestfish-actions.pod:1588 ../src/guestfs-actions.pod:2378
7017 "This command returns up to the first 10 lines of a file as a list of "
7022 #: ../fish/guestfish-actions.pod:1594
7027 #: ../fish/guestfish-actions.pod:1596
7030 " head-n nrlines path\n"
7035 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2397
7037 "If the parameter C<nrlines> is a positive number, this returns the first "
7038 "C<nrlines> lines of the file C<path>."
7042 #: ../fish/guestfish-actions.pod:1601 ../src/guestfs-actions.pod:2400
7044 "If the parameter C<nrlines> is a negative number, this returns lines from "
7045 "the file C<path>, excluding the last C<nrlines> lines."
7049 #: ../fish/guestfish-actions.pod:1604 ../fish/guestfish-actions.pod:4670 ../src/guestfs-actions.pod:2403 ../src/guestfs-actions.pod:7018
7050 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7054 #: ../fish/guestfish-actions.pod:1609
7059 #: ../fish/guestfish-actions.pod:1611
7067 #: ../fish/guestfish-actions.pod:1613 ../src/guestfs-actions.pod:2420
7069 "This runs C<hexdump -C> on the given C<path>. The result is the "
7070 "human-readable, canonical hex dump of the file."
7074 #: ../fish/guestfish-actions.pod:1619
7079 #: ../fish/guestfish-actions.pod:1621
7082 " initrd-cat initrdpath filename\n"
7087 #: ../fish/guestfish-actions.pod:1623 ../src/guestfs-actions.pod:2439
7089 "This command unpacks the file C<filename> from the initrd file called "
7090 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7095 #: ../fish/guestfish-actions.pod:1627 ../src/guestfs-actions.pod:2443
7097 "For example, in guestfish you could use the following command to examine the "
7098 "boot script (usually called C</init>) contained in a Linux initrd or "
7103 #: ../fish/guestfish-actions.pod:1631 ../src/guestfs-actions.pod:2447
7106 " initrd-cat /boot/initrd-<version>.img init\n"
7111 #: ../fish/guestfish-actions.pod:1633
7112 msgid "See also L</initrd-list>."
7116 #: ../fish/guestfish-actions.pod:1638
7121 #: ../fish/guestfish-actions.pod:1640
7124 " initrd-list path\n"
7129 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2466
7130 msgid "This command lists out files contained in an initrd."
7134 #: ../fish/guestfish-actions.pod:1644 ../src/guestfs-actions.pod:2468
7136 "The files are listed without any initial C</> character. The files are "
7137 "listed in the order they appear (not necessarily alphabetical). Directory "
7138 "names are listed as separate items."
7142 #: ../fish/guestfish-actions.pod:1648 ../src/guestfs-actions.pod:2472
7144 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7145 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7150 #: ../fish/guestfish-actions.pod:1652
7151 msgid "inotify-add-watch"
7155 #: ../fish/guestfish-actions.pod:1654
7158 " inotify-add-watch path mask\n"
7163 #: ../fish/guestfish-actions.pod:1656 ../src/guestfs-actions.pod:2489
7164 msgid "Watch C<path> for the events listed in C<mask>."
7168 #: ../fish/guestfish-actions.pod:1658 ../src/guestfs-actions.pod:2491
7170 "Note that if C<path> is a directory then events within that directory are "
7171 "watched, but this does I<not> happen recursively (in subdirectories)."
7175 #: ../fish/guestfish-actions.pod:1662 ../src/guestfs-actions.pod:2495
7177 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7178 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7182 #: ../fish/guestfish-actions.pod:1666
7183 msgid "inotify-close"
7187 #: ../fish/guestfish-actions.pod:1668
7195 #: ../fish/guestfish-actions.pod:1670 ../src/guestfs-actions.pod:2508
7197 "This closes the inotify handle which was previously opened by inotify_init. "
7198 "It removes all watches, throws away any pending events, and deallocates all "
7203 #: ../fish/guestfish-actions.pod:1674
7204 msgid "inotify-files"
7208 #: ../fish/guestfish-actions.pod:1676
7216 #: ../fish/guestfish-actions.pod:1678
7218 "This function is a helpful wrapper around L</inotify-read> which just "
7219 "returns a list of pathnames of objects that were touched. The returned "
7220 "pathnames are sorted and deduplicated."
7224 #: ../fish/guestfish-actions.pod:1682
7225 msgid "inotify-init"
7229 #: ../fish/guestfish-actions.pod:1684
7232 " inotify-init maxevents\n"
7237 #: ../fish/guestfish-actions.pod:1686 ../src/guestfs-actions.pod:2537
7239 "This command creates a new inotify handle. The inotify subsystem can be "
7240 "used to notify events which happen to objects in the guest filesystem."
7244 #: ../fish/guestfish-actions.pod:1690
7246 "C<maxevents> is the maximum number of events which will be queued up between "
7247 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
7248 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
7249 "default was 16384 events. Beyond this limit, the kernel throws away events, "
7250 "but records the fact that it threw them away by setting a flag "
7251 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
7255 #: ../fish/guestfish-actions.pod:1700
7257 "Before any events are generated, you have to add some watches to the "
7258 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
7259 "L</inotify-watch-all>."
7263 #: ../fish/guestfish-actions.pod:1706
7265 "Queued up events should be read periodically by calling L</inotify-read> (or "
7266 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
7267 "If you don't read the events out often enough then you risk the internal "
7268 "queue overflowing."
7272 #: ../fish/guestfish-actions.pod:1713
7274 "The handle should be closed after use by calling L</inotify-close>. This "
7275 "also removes any watches automatically."
7279 #: ../fish/guestfish-actions.pod:1717 ../src/guestfs-actions.pod:2568
7281 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7282 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7283 "that there is one global inotify handle per libguestfs instance."
7287 #: ../fish/guestfish-actions.pod:1722
7288 msgid "inotify-read"
7292 #: ../fish/guestfish-actions.pod:1724
7300 #: ../fish/guestfish-actions.pod:1726 ../src/guestfs-actions.pod:2582
7302 "Return the complete queue of events that have happened since the previous "
7307 #: ../fish/guestfish-actions.pod:1729 ../src/guestfs-actions.pod:2585
7308 msgid "If no events have happened, this returns an empty list."
7312 #: ../fish/guestfish-actions.pod:1731 ../src/guestfs-actions.pod:2587
7314 "I<Note>: In order to make sure that all events have been read, you must call "
7315 "this function repeatedly until it returns an empty list. The reason is that "
7316 "the call will read events up to the maximum appliance-to-host message size "
7317 "and leave remaining events in the queue."
7321 #: ../fish/guestfish-actions.pod:1737
7322 msgid "inotify-rm-watch"
7326 #: ../fish/guestfish-actions.pod:1739
7329 " inotify-rm-watch wd\n"
7334 #: ../fish/guestfish-actions.pod:1741
7335 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
7339 #: ../fish/guestfish-actions.pod:1744
7340 msgid "inspect-get-arch"
7344 #: ../fish/guestfish-actions.pod:1746
7347 " inspect-get-arch root\n"
7352 #: ../fish/guestfish-actions.pod:1748
7354 "This returns the architecture of the inspected operating system. The "
7355 "possible return values are listed under L</file-architecture>."
7359 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2622
7361 "If the architecture could not be determined, then the string C<unknown> is "
7366 #: ../fish/guestfish-actions.pod:1755 ../fish/guestfish-actions.pod:1838 ../fish/guestfish-actions.pod:1917 ../fish/guestfish-actions.pod:1929 ../fish/guestfish-actions.pod:2013 ../fish/guestfish-actions.pod:2074 ../fish/guestfish-actions.pod:2095 ../fish/guestfish-actions.pod:2109 ../fish/guestfish-actions.pod:2149 ../fish/guestfish-actions.pod:2181 ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2207 ../fish/guestfish-actions.pod:2217 ../fish/guestfish-actions.pod:2227 ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2335 ../fish/guestfish-actions.pod:2369 ../src/guestfs-actions.pod:2625 ../src/guestfs-actions.pod:2715 ../src/guestfs-actions.pod:2819 ../src/guestfs-actions.pod:2838 ../src/guestfs-actions.pod:2969 ../src/guestfs-actions.pod:3052 ../src/guestfs-actions.pod:3080 ../src/guestfs-actions.pod:3101 ../src/guestfs-actions.pod:3154 ../src/guestfs-actions.pod:3194 ../src/guestfs-actions.pod:3214 ../src/guestfs-actions.pod:3234 ../src/guestfs-actions.pod:3251 ../src/guestfs-actions.pod:3267 ../src/guestfs-actions.pod:3285 ../src/guestfs-actions.pod:3387 ../src/guestfs-actions.pod:3428
7367 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7371 #: ../fish/guestfish-actions.pod:1757
7372 msgid "inspect-get-distro"
7376 #: ../fish/guestfish-actions.pod:1759
7379 " inspect-get-distro root\n"
7384 #: ../fish/guestfish-actions.pod:1761 ../src/guestfs-actions.pod:2638
7385 msgid "This returns the distro (distribution) of the inspected operating system."
7389 #: ../fish/guestfish-actions.pod:1764 ../src/guestfs-actions.pod:2641
7390 msgid "Currently defined distros are:"
7394 #: ../fish/guestfish-actions.pod:1768 ../src/guestfs-actions.pod:2645
7395 msgid "\"archlinux\""
7399 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2647
7404 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2649
7409 #: ../fish/guestfish-actions.pod:1774 ../src/guestfs-actions.pod:2651
7414 #: ../fish/guestfish-actions.pod:1776 ../src/guestfs-actions.pod:2653
7419 #: ../fish/guestfish-actions.pod:1778 ../src/guestfs-actions.pod:2655
7424 #: ../fish/guestfish-actions.pod:1780 ../src/guestfs-actions.pod:2657
7429 #: ../fish/guestfish-actions.pod:1782 ../src/guestfs-actions.pod:2659
7434 #: ../fish/guestfish-actions.pod:1784 ../src/guestfs-actions.pod:2661
7439 #: ../fish/guestfish-actions.pod:1786 ../src/guestfs-actions.pod:2663
7444 #: ../fish/guestfish-actions.pod:1788 ../src/guestfs-actions.pod:2665
7445 msgid "\"linuxmint\""
7449 #: ../fish/guestfish-actions.pod:1790 ../src/guestfs-actions.pod:2667
7454 #: ../fish/guestfish-actions.pod:1792 ../src/guestfs-actions.pod:2669
7455 msgid "\"mandriva\""
7459 #: ../fish/guestfish-actions.pod:1794 ../src/guestfs-actions.pod:2671
7464 #: ../fish/guestfish-actions.pod:1796 ../src/guestfs-actions.pod:2673
7469 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2675
7474 #: ../fish/guestfish-actions.pod:1800 ../src/guestfs-actions.pod:2677
7479 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2679
7484 #: ../fish/guestfish-actions.pod:1804 ../src/guestfs-actions.pod:2681
7485 msgid "\"redhat-based\""
7489 #: ../fish/guestfish-actions.pod:1806 ../src/guestfs-actions.pod:2683
7490 msgid "Some Red Hat-derived distro."
7494 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2685
7499 #: ../fish/guestfish-actions.pod:1810 ../src/guestfs-actions.pod:2687
7500 msgid "Red Hat Enterprise Linux."
7504 #: ../fish/guestfish-actions.pod:1812 ../src/guestfs-actions.pod:2689
7505 msgid "\"scientificlinux\""
7509 #: ../fish/guestfish-actions.pod:1814 ../src/guestfs-actions.pod:2691
7510 msgid "Scientific Linux."
7514 #: ../fish/guestfish-actions.pod:1816 ../src/guestfs-actions.pod:2693
7515 msgid "\"slackware\""
7519 #: ../fish/guestfish-actions.pod:1818 ../src/guestfs-actions.pod:2695
7524 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2697
7529 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2699
7534 #: ../fish/guestfish-actions.pod:1824 ../fish/guestfish-actions.pod:1908 ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:2701 ../src/guestfs-actions.pod:2810 ../src/guestfs-actions.pod:3185
7539 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2703
7540 msgid "The distro could not be determined."
7544 #: ../fish/guestfish-actions.pod:1828 ../fish/guestfish-actions.pod:2164 ../src/guestfs-actions.pod:2705 ../src/guestfs-actions.pod:3177
7549 #: ../fish/guestfish-actions.pod:1830 ../src/guestfs-actions.pod:2707
7551 "Windows does not have distributions. This string is returned if the OS type "
7556 #: ../fish/guestfish-actions.pod:1835 ../fish/guestfish-actions.pod:1914 ../fish/guestfish-actions.pod:2178 ../src/guestfs-actions.pod:2712 ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:3191
7558 "Future versions of libguestfs may return other strings here. The caller "
7559 "should be prepared to handle any string."
7563 #: ../fish/guestfish-actions.pod:1840
7564 msgid "inspect-get-drive-mappings"
7568 #: ../fish/guestfish-actions.pod:1842
7571 " inspect-get-drive-mappings root\n"
7576 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2728
7578 "This call is useful for Windows which uses a primitive system of assigning "
7579 "drive letters (like \"C:\") to partitions. This inspection API examines the "
7580 "Windows Registry to find out how disks/partitions are mapped to drive "
7581 "letters, and returns a hash table as in the example below:"
7585 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2734
7595 #: ../fish/guestfish-actions.pod:1854 ../src/guestfs-actions.pod:2738
7597 "Note that keys are drive letters. For Windows, the key is case insensitive "
7598 "and just contains the drive letter, without the customary colon separator "
7603 #: ../fish/guestfish-actions.pod:1858 ../src/guestfs-actions.pod:2742
7605 "In future we may support other operating systems that also used drive "
7606 "letters, but the keys for those might not be case insensitive and might be "
7607 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
7612 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2747
7614 "For Windows guests, currently only hard drive mappings are returned. "
7615 "Removable disks (eg. DVD-ROMs) are ignored."
7619 #: ../fish/guestfish-actions.pod:1866 ../src/guestfs-actions.pod:2750
7621 "For guests that do not use drive mappings, or if the drive mappings could "
7622 "not be determined, this returns an empty hash table."
7626 #: ../fish/guestfish-actions.pod:1869
7628 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7629 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
7633 #: ../fish/guestfish-actions.pod:1873
7634 msgid "inspect-get-filesystems"
7638 #: ../fish/guestfish-actions.pod:1875
7641 " inspect-get-filesystems root\n"
7646 #: ../fish/guestfish-actions.pod:1877 ../src/guestfs-actions.pod:2771
7648 "This returns a list of all the filesystems that we think are associated with "
7649 "this operating system. This includes the root filesystem, other ordinary "
7650 "filesystems, and non-mounted devices like swap partitions."
7654 #: ../fish/guestfish-actions.pod:1882 ../src/guestfs-actions.pod:2776
7656 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7657 "to be shared between operating systems."
7661 #: ../fish/guestfish-actions.pod:1885
7663 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7664 "L</inspect-get-mountpoints>."
7668 #: ../fish/guestfish-actions.pod:1888
7669 msgid "inspect-get-format"
7673 #: ../fish/guestfish-actions.pod:1890
7676 " inspect-get-format root\n"
7681 #: ../fish/guestfish-actions.pod:1892 ../src/guestfs-actions.pod:2794
7683 "This returns the format of the inspected operating system. You can use it "
7684 "to detect install images, live CDs and similar."
7688 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:2797
7689 msgid "Currently defined formats are:"
7693 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2801
7694 msgid "\"installed\""
7698 #: ../fish/guestfish-actions.pod:1901 ../src/guestfs-actions.pod:2803
7699 msgid "This is an installed operating system."
7703 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2805
7704 msgid "\"installer\""
7708 #: ../fish/guestfish-actions.pod:1905 ../src/guestfs-actions.pod:2807
7710 "The disk image being inspected is not an installed operating system, but a "
7711 "I<bootable> install disk, live CD, or similar."
7715 #: ../fish/guestfish-actions.pod:1910 ../src/guestfs-actions.pod:2812
7716 msgid "The format of this disk image is not known."
7720 #: ../fish/guestfish-actions.pod:1919
7721 msgid "inspect-get-hostname"
7725 #: ../fish/guestfish-actions.pod:1921
7728 " inspect-get-hostname root\n"
7733 #: ../fish/guestfish-actions.pod:1923 ../src/guestfs-actions.pod:2832
7735 "This function returns the hostname of the operating system as found by "
7736 "inspection of the guest's configuration files."
7740 #: ../fish/guestfish-actions.pod:1926 ../src/guestfs-actions.pod:2835
7742 "If the hostname could not be determined, then the string C<unknown> is "
7747 #: ../fish/guestfish-actions.pod:1931
7748 msgid "inspect-get-icon"
7752 #: ../fish/guestfish-actions.pod:1933
7755 " inspect-get-icon root [favicon:..] [highquality:..]\n"
7760 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2861
7762 "This function returns an icon corresponding to the inspected operating "
7763 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
7764 "to PNG if necessary)."
7768 #: ../fish/guestfish-actions.pod:1939 ../src/guestfs-actions.pod:2865
7770 "If it was not possible to get an icon this function returns a zero-length "
7771 "(non-NULL) buffer. I<Callers must check for this case>."
7775 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:2868
7777 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
7778 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
7779 "this file will be returned. You can disable favicons by passing the "
7780 "optional C<favicon> boolean as false (default is true)."
7784 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2874
7786 "If finding the favicon fails, then we look in other places in the guest for "
7791 #: ../fish/guestfish-actions.pod:1951 ../src/guestfs-actions.pod:2877
7793 "If the optional C<highquality> boolean is true then only high quality icons "
7794 "are returned, which means only icons of high resolution with an alpha "
7795 "channel. The default (false) is to return any icon we can, even if it is of "
7796 "substandard quality."
7800 #: ../fish/guestfish-actions.pod:1962 ../src/guestfs-actions.pod:2888
7802 "Unlike most other inspection API calls, the guest's disks must be mounted up "
7803 "before you call this, since it needs to read information from the guest "
7804 "filesystem during the call."
7808 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2894
7810 "B<Security:> The icon data comes from the untrusted guest, and should be "
7811 "treated with caution. PNG files have been known to contain exploits. "
7812 "Ensure that libpng (or other relevant libraries) are fully up to date before "
7813 "trying to process or display the icon."
7817 #: ../fish/guestfish-actions.pod:1976 ../src/guestfs-actions.pod:2902
7819 "The PNG image returned can be any size. It might not be square. Libguestfs "
7820 "tries to return the largest, highest quality icon available. The "
7821 "application must scale the icon to the required size."
7825 #: ../fish/guestfish-actions.pod:1983 ../src/guestfs-actions.pod:2909
7827 "Extracting icons from Windows guests requires the external C<wrestool> "
7828 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
7829 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
7830 "installed separately."
7834 #: ../fish/guestfish-actions.pod:1990 ../src/guestfs-actions.pod:2916
7836 "Operating system icons are usually trademarks. Seek legal advice before "
7837 "using trademarks in applications."
7841 #: ../fish/guestfish-actions.pod:1997
7842 msgid "inspect-get-major-version"
7846 #: ../fish/guestfish-actions.pod:1999
7849 " inspect-get-major-version root\n"
7854 #: ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:2957
7855 msgid "This returns the major version number of the inspected operating system."
7859 #: ../fish/guestfish-actions.pod:2004 ../src/guestfs-actions.pod:2960
7861 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7862 "popular public names used by the operating system. Notably the operating "
7863 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7864 "1). You can find out the real versions corresponding to releases of Windows "
7865 "by consulting Wikipedia or MSDN."
7869 #: ../fish/guestfish-actions.pod:2011 ../fish/guestfish-actions.pod:2022 ../src/guestfs-actions.pod:2967 ../src/guestfs-actions.pod:2984
7870 msgid "If the version could not be determined, then C<0> is returned."
7874 #: ../fish/guestfish-actions.pod:2015
7875 msgid "inspect-get-minor-version"
7879 #: ../fish/guestfish-actions.pod:2017
7882 " inspect-get-minor-version root\n"
7887 #: ../fish/guestfish-actions.pod:2019 ../src/guestfs-actions.pod:2981
7888 msgid "This returns the minor version number of the inspected operating system."
7892 #: ../fish/guestfish-actions.pod:2024
7894 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7895 "L</inspect-get-major-version>."
7899 #: ../fish/guestfish-actions.pod:2027
7900 msgid "inspect-get-mountpoints"
7904 #: ../fish/guestfish-actions.pod:2029
7907 " inspect-get-mountpoints root\n"
7912 #: ../fish/guestfish-actions.pod:2031 ../src/guestfs-actions.pod:2999
7914 "This returns a hash of where we think the filesystems associated with this "
7915 "operating system should be mounted. Callers should note that this is at "
7916 "best an educated guess made by reading configuration files such as "
7917 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
7918 "are non-existent or not mountable and callers should be prepared to handle "
7919 "or ignore failures if they try to mount them."
7923 #: ../fish/guestfish-actions.pod:2040 ../src/guestfs-actions.pod:3008
7925 "Each element in the returned hashtable has a key which is the path of the "
7926 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7927 "mounted there (eg. C</dev/sda1>)."
7931 #: ../fish/guestfish-actions.pod:2045 ../src/guestfs-actions.pod:3013
7932 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
7936 #: ../fish/guestfish-actions.pod:2048
7938 "For operating systems like Windows which still use drive letters, this call "
7939 "will only return an entry for the first drive \"mounted on\" C</>. For "
7940 "information about the mapping of drive letters to partitions, see "
7941 "L</inspect-get-drive-mappings>."
7945 #: ../fish/guestfish-actions.pod:2054
7947 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7948 "L</inspect-get-filesystems>."
7952 #: ../fish/guestfish-actions.pod:2057
7953 msgid "inspect-get-package-format"
7957 #: ../fish/guestfish-actions.pod:2059
7960 " inspect-get-package-format root\n"
7965 #: ../fish/guestfish-actions.pod:2061
7967 "This function and L</inspect-get-package-management> return the package "
7968 "format and package management tool used by the inspected operating system. "
7969 "For example for Fedora these functions would return C<rpm> (package format) "
7970 "and C<yum> (package management)."
7974 #: ../fish/guestfish-actions.pod:2067 ../src/guestfs-actions.pod:3045
7976 "This returns the string C<unknown> if we could not determine the package "
7977 "format I<or> if the operating system does not have a real packaging system "
7982 #: ../fish/guestfish-actions.pod:2071 ../src/guestfs-actions.pod:3049
7984 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
7985 "Future versions of libguestfs may return other strings."
7989 #: ../fish/guestfish-actions.pod:2076
7990 msgid "inspect-get-package-management"
7994 #: ../fish/guestfish-actions.pod:2078
7997 " inspect-get-package-management root\n"
8002 #: ../fish/guestfish-actions.pod:2080
8004 "L</inspect-get-package-format> and this function return the package format "
8005 "and package management tool used by the inspected operating system. For "
8006 "example for Fedora these functions would return C<rpm> (package format) and "
8007 "C<yum> (package management)."
8011 #: ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:3071
8013 "This returns the string C<unknown> if we could not determine the package "
8014 "management tool I<or> if the operating system does not have a real packaging "
8015 "system (eg. Windows)."
8019 #: ../fish/guestfish-actions.pod:2090 ../src/guestfs-actions.pod:3075
8021 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
8022 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
8023 "libguestfs may return other strings."
8027 #: ../fish/guestfish-actions.pod:2097
8028 msgid "inspect-get-product-name"
8032 #: ../fish/guestfish-actions.pod:2099
8035 " inspect-get-product-name root\n"
8040 #: ../fish/guestfish-actions.pod:2101 ../src/guestfs-actions.pod:3093
8042 "This returns the product name of the inspected operating system. The "
8043 "product name is generally some freeform string which can be displayed to the "
8044 "user, but should not be parsed by programs."
8048 #: ../fish/guestfish-actions.pod:2106 ../src/guestfs-actions.pod:3098
8050 "If the product name could not be determined, then the string C<unknown> is "
8055 #: ../fish/guestfish-actions.pod:2111
8056 msgid "inspect-get-product-variant"
8060 #: ../fish/guestfish-actions.pod:2113
8063 " inspect-get-product-variant root\n"
8068 #: ../fish/guestfish-actions.pod:2115 ../src/guestfs-actions.pod:3114
8069 msgid "This returns the product variant of the inspected operating system."
8073 #: ../fish/guestfish-actions.pod:2118 ../src/guestfs-actions.pod:3117
8075 "For Windows guests, this returns the contents of the Registry key "
8076 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
8077 "which is usually a string such as C<Client> or C<Server> (other values are "
8078 "possible). This can be used to distinguish consumer and enterprise versions "
8079 "of Windows that have the same version number (for example, Windows 7 and "
8080 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8081 "the latter is C<Server>)."
8085 #: ../fish/guestfish-actions.pod:2127 ../src/guestfs-actions.pod:3126
8087 "For enterprise Linux guests, in future we intend this to return the product "
8088 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8089 "implemented at present."
8093 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3130
8095 "If the product variant could not be determined, then the string C<unknown> "
8100 #: ../fish/guestfish-actions.pod:2134
8102 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8103 "L</inspect-get-product-name>, L</inspect-get-major-version>."
8107 #: ../fish/guestfish-actions.pod:2138
8108 msgid "inspect-get-roots"
8112 #: ../fish/guestfish-actions.pod:2140
8115 " inspect-get-roots\n"
8120 #: ../fish/guestfish-actions.pod:2142
8122 "This function is a convenient way to get the list of root devices, as "
8123 "returned from a previous call to L</inspect-os>, but without redoing the "
8124 "whole inspection process."
8128 #: ../fish/guestfish-actions.pod:2146
8130 "This returns an empty list if either no root devices were found or the "
8131 "caller has not called L</inspect-os>."
8135 #: ../fish/guestfish-actions.pod:2151
8136 msgid "inspect-get-type"
8140 #: ../fish/guestfish-actions.pod:2153
8143 " inspect-get-type root\n"
8148 #: ../fish/guestfish-actions.pod:2155 ../src/guestfs-actions.pod:3168
8150 "This returns the type of the inspected operating system. Currently defined "
8155 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3173
8160 #: ../fish/guestfish-actions.pod:2162 ../src/guestfs-actions.pod:3175
8161 msgid "Any Linux-based operating system."
8165 #: ../fish/guestfish-actions.pod:2166 ../src/guestfs-actions.pod:3179
8166 msgid "Any Microsoft Windows operating system."
8170 #: ../fish/guestfish-actions.pod:2168 ../src/guestfs-actions.pod:3181
8175 #: ../fish/guestfish-actions.pod:2170 ../src/guestfs-actions.pod:3183
8180 #: ../fish/guestfish-actions.pod:2174 ../src/guestfs-actions.pod:3187
8181 msgid "The operating system type could not be determined."
8185 #: ../fish/guestfish-actions.pod:2183
8186 msgid "inspect-get-windows-current-control-set"
8190 #: ../fish/guestfish-actions.pod:2185
8193 " inspect-get-windows-current-control-set root\n"
8198 #: ../fish/guestfish-actions.pod:2187 ../src/guestfs-actions.pod:3207
8200 "This returns the Windows CurrentControlSet of the inspected guest. The "
8201 "CurrentControlSet is a registry key name such as C<ControlSet001>."
8205 #: ../fish/guestfish-actions.pod:2190 ../src/guestfs-actions.pod:3210
8207 "This call assumes that the guest is Windows and that the Registry could be "
8208 "examined by inspection. If this is not the case then an error is returned."
8212 #: ../fish/guestfish-actions.pod:2196
8213 msgid "inspect-get-windows-systemroot"
8217 #: ../fish/guestfish-actions.pod:2198
8220 " inspect-get-windows-systemroot root\n"
8225 #: ../fish/guestfish-actions.pod:2200 ../src/guestfs-actions.pod:3227
8227 "This returns the Windows systemroot of the inspected guest. The systemroot "
8228 "is a directory path such as C</WINDOWS>."
8232 #: ../fish/guestfish-actions.pod:2203 ../src/guestfs-actions.pod:3230
8234 "This call assumes that the guest is Windows and that the systemroot could be "
8235 "determined by inspection. If this is not the case then an error is "
8240 #: ../fish/guestfish-actions.pod:2209
8241 msgid "inspect-is-live"
8245 #: ../fish/guestfish-actions.pod:2211
8248 " inspect-is-live root\n"
8253 #: ../fish/guestfish-actions.pod:2213
8255 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8256 "then this returns true if a live image was detected on the disk."
8260 #: ../fish/guestfish-actions.pod:2219
8261 msgid "inspect-is-multipart"
8265 #: ../fish/guestfish-actions.pod:2221
8268 " inspect-is-multipart root\n"
8273 #: ../fish/guestfish-actions.pod:2223
8275 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8276 "then this returns true if the disk is part of a set."
8280 #: ../fish/guestfish-actions.pod:2229
8281 msgid "inspect-is-netinst"
8285 #: ../fish/guestfish-actions.pod:2231
8288 " inspect-is-netinst root\n"
8293 #: ../fish/guestfish-actions.pod:2233
8295 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8296 "then this returns true if the disk is a network installer, ie. not a "
8297 "self-contained install CD but one which is likely to require network access "
8298 "to complete the install."
8302 #: ../fish/guestfish-actions.pod:2241
8303 msgid "inspect-list-applications"
8307 #: ../fish/guestfish-actions.pod:2243
8310 " inspect-list-applications root\n"
8315 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3297
8316 msgid "Return the list of applications installed in the operating system."
8320 #: ../fish/guestfish-actions.pod:2247
8322 "I<Note:> This call works differently from other parts of the inspection "
8323 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
8324 "then mount up the disks, before calling this. Listing applications is a "
8325 "significantly more difficult operation which requires access to the full "
8326 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
8327 "are just returning data cached in the libguestfs handle, this call actually "
8328 "reads parts of the mounted filesystems during the call."
8332 #: ../fish/guestfish-actions.pod:2257 ../src/guestfs-actions.pod:3309
8334 "This returns an empty list if the inspection code was not able to determine "
8335 "the list of applications."
8339 #: ../fish/guestfish-actions.pod:2260 ../src/guestfs-actions.pod:3312
8340 msgid "The application structure contains the following fields:"
8344 #: ../fish/guestfish-actions.pod:2264 ../src/guestfs-actions.pod:3316
8349 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3318
8351 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8352 "guests, this is the package name."
8356 #: ../fish/guestfish-actions.pod:2269 ../src/guestfs-actions.pod:3321
8357 msgid "C<app_display_name>"
8361 #: ../fish/guestfish-actions.pod:2271 ../src/guestfs-actions.pod:3323
8363 "The display name of the application, sometimes localized to the install "
8364 "language of the guest operating system."
8368 #: ../fish/guestfish-actions.pod:2274 ../src/guestfs-actions.pod:3326
8370 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8371 "to display something can use C<app_name> instead."
8375 #: ../fish/guestfish-actions.pod:2277 ../src/guestfs-actions.pod:3329
8376 msgid "C<app_epoch>"
8380 #: ../fish/guestfish-actions.pod:2279 ../src/guestfs-actions.pod:3331
8382 "For package managers which use epochs, this contains the epoch of the "
8383 "package (an integer). If unavailable, this is returned as C<0>."
8387 #: ../fish/guestfish-actions.pod:2282 ../src/guestfs-actions.pod:3334
8388 msgid "C<app_version>"
8392 #: ../fish/guestfish-actions.pod:2284 ../src/guestfs-actions.pod:3336
8394 "The version string of the application or package. If unavailable this is "
8395 "returned as an empty string C<\"\">."
8399 #: ../fish/guestfish-actions.pod:2287 ../src/guestfs-actions.pod:3339
8400 msgid "C<app_release>"
8404 #: ../fish/guestfish-actions.pod:2289 ../src/guestfs-actions.pod:3341
8406 "The release string of the application or package, for package managers that "
8407 "use this. If unavailable this is returned as an empty string C<\"\">."
8411 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3345
8412 msgid "C<app_install_path>"
8416 #: ../fish/guestfish-actions.pod:2295 ../src/guestfs-actions.pod:3347
8418 "The installation path of the application (on operating systems such as "
8419 "Windows which use installation paths). This path is in the format used by "
8420 "the guest operating system, it is not a libguestfs path."
8424 #: ../fish/guestfish-actions.pod:2300 ../src/guestfs-actions.pod:3352
8425 msgid "If unavailable this is returned as an empty string C<\"\">."
8429 #: ../fish/guestfish-actions.pod:2302 ../src/guestfs-actions.pod:3354
8430 msgid "C<app_trans_path>"
8434 #: ../fish/guestfish-actions.pod:2304 ../src/guestfs-actions.pod:3356
8436 "The install path translated into a libguestfs path. If unavailable this is "
8437 "returned as an empty string C<\"\">."
8441 #: ../fish/guestfish-actions.pod:2307 ../src/guestfs-actions.pod:3359
8442 msgid "C<app_publisher>"
8446 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3361
8448 "The name of the publisher of the application, for package managers that use "
8449 "this. If unavailable this is returned as an empty string C<\"\">."
8453 #: ../fish/guestfish-actions.pod:2313 ../src/guestfs-actions.pod:3365
8458 #: ../fish/guestfish-actions.pod:2315 ../src/guestfs-actions.pod:3367
8460 "The URL (eg. upstream URL) of the application. If unavailable this is "
8461 "returned as an empty string C<\"\">."
8465 #: ../fish/guestfish-actions.pod:2318 ../src/guestfs-actions.pod:3370
8466 msgid "C<app_source_package>"
8470 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3372
8472 "For packaging systems which support this, the name of the source package. "
8473 "If unavailable this is returned as an empty string C<\"\">."
8477 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3375
8478 msgid "C<app_summary>"
8482 #: ../fish/guestfish-actions.pod:2325 ../src/guestfs-actions.pod:3377
8484 "A short (usually one line) description of the application or package. If "
8485 "unavailable this is returned as an empty string C<\"\">."
8489 #: ../fish/guestfish-actions.pod:2328 ../src/guestfs-actions.pod:3380
8490 msgid "C<app_description>"
8494 #: ../fish/guestfish-actions.pod:2330 ../src/guestfs-actions.pod:3382
8496 "A longer description of the application or package. If unavailable this is "
8497 "returned as an empty string C<\"\">."
8501 #: ../fish/guestfish-actions.pod:2337
8506 #: ../fish/guestfish-actions.pod:2339
8514 #: ../fish/guestfish-actions.pod:2341 ../src/guestfs-actions.pod:3400
8516 "This function uses other libguestfs functions and certain heuristics to "
8517 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8518 "for operating systems."
8522 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3404
8523 msgid "The list returned is empty if no operating systems were found."
8527 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3406
8529 "If one operating system was found, then this returns a list with a single "
8530 "element, which is the name of the root filesystem of this operating system. "
8531 "It is also possible for this function to return a list containing more than "
8532 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8533 "element being the root filesystem of one of the operating systems."
8537 #: ../fish/guestfish-actions.pod:2354
8539 "You can pass the root string(s) returned to other L</inspect-get-*> "
8540 "functions in order to query further information about each operating system, "
8541 "such as the name and version."
8545 #: ../fish/guestfish-actions.pod:2359
8547 "This function uses other libguestfs features such as L</mount-ro> and "
8548 "L</umount-all> in order to mount and unmount filesystems and look at the "
8549 "contents. This should be called with no disks currently mounted. The "
8550 "function may also use Augeas, so any existing Augeas handle will be closed."
8554 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3424
8556 "This function cannot decrypt encrypted disks. The caller must do that first "
8557 "(supplying the necessary keys) if the disk is encrypted."
8561 #: ../fish/guestfish-actions.pod:2371 ../fish/guestfish-actions.pod:2569 ../fish/guestfish-actions.pod:2628
8562 msgid "See also L</list-filesystems>."
8566 #: ../fish/guestfish-actions.pod:2373
8571 #: ../fish/guestfish-actions.pod:2375
8574 " is-blockdev path\n"
8579 #: ../fish/guestfish-actions.pod:2377 ../src/guestfs-actions.pod:3444
8581 "This returns C<true> if and only if there is a block device with the given "
8586 #: ../fish/guestfish-actions.pod:2380 ../fish/guestfish-actions.pod:2398 ../fish/guestfish-actions.pod:2417 ../fish/guestfish-actions.pod:2426 ../fish/guestfish-actions.pod:2436 ../fish/guestfish-actions.pod:2470 ../fish/guestfish-actions.pod:2479
8587 msgid "See also L</stat>."
8591 #: ../fish/guestfish-actions.pod:2382
8596 #: ../fish/guestfish-actions.pod:2384
8604 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3458
8606 "This returns true iff this handle is busy processing a command (in the "
8611 #: ../fish/guestfish-actions.pod:2391
8616 #: ../fish/guestfish-actions.pod:2393
8619 " is-chardev path\n"
8624 #: ../fish/guestfish-actions.pod:2395 ../src/guestfs-actions.pod:3473
8626 "This returns C<true> if and only if there is a character device with the "
8627 "given C<path> name."
8631 #: ../fish/guestfish-actions.pod:2400
8636 #: ../fish/guestfish-actions.pod:2402
8644 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3487
8646 "This returns true iff this handle is being configured (in the C<CONFIG> "
8651 #: ../fish/guestfish-actions.pod:2409
8656 #: ../fish/guestfish-actions.pod:2411
8664 #: ../fish/guestfish-actions.pod:2413 ../src/guestfs-actions.pod:3502
8666 "This returns C<true> if and only if there is a directory with the given "
8667 "C<path> name. Note that it returns false for other objects like files."
8671 #: ../fish/guestfish-actions.pod:2419
8676 #: ../fish/guestfish-actions.pod:2421
8684 #: ../fish/guestfish-actions.pod:2423 ../src/guestfs-actions.pod:3518
8686 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8687 "given C<path> name."
8691 #: ../fish/guestfish-actions.pod:2428
8696 #: ../fish/guestfish-actions.pod:2430
8704 #: ../fish/guestfish-actions.pod:2432 ../src/guestfs-actions.pod:3533
8706 "This returns C<true> if and only if there is a regular file with the given "
8707 "C<path> name. Note that it returns false for other objects like "
8712 #: ../fish/guestfish-actions.pod:2438
8713 msgid "is-launching"
8717 #: ../fish/guestfish-actions.pod:2440
8725 #: ../fish/guestfish-actions.pod:2442 ../src/guestfs-actions.pod:3548
8727 "This returns true iff this handle is launching the subprocess (in the "
8728 "C<LAUNCHING> state)."
8732 #: ../fish/guestfish-actions.pod:2447
8737 #: ../fish/guestfish-actions.pod:2449
8745 #: ../fish/guestfish-actions.pod:2451 ../src/guestfs-actions.pod:3563
8747 "This command tests whether C<device> is a logical volume, and returns true "
8748 "iff this is the case."
8752 #: ../fish/guestfish-actions.pod:2454
8757 #: ../fish/guestfish-actions.pod:2456
8765 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3575
8767 "This returns true iff this handle is ready to accept commands (in the "
8772 #: ../fish/guestfish-actions.pod:2463
8777 #: ../fish/guestfish-actions.pod:2465
8785 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3590
8787 "This returns C<true> if and only if there is a Unix domain socket with the "
8788 "given C<path> name."
8792 #: ../fish/guestfish-actions.pod:2472
8797 #: ../fish/guestfish-actions.pod:2474
8800 " is-symlink path\n"
8805 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3605
8807 "This returns C<true> if and only if there is a symbolic link with the given "
8812 #: ../fish/guestfish-actions.pod:2481
8817 #: ../fish/guestfish-actions.pod:2483
8825 #: ../fish/guestfish-actions.pod:2485 ../src/guestfs-actions.pod:3620
8827 "This returns true iff the file exists and the file is empty or it contains "
8832 #: ../fish/guestfish-actions.pod:2488
8833 msgid "is-zero-device"
8837 #: ../fish/guestfish-actions.pod:2490
8840 " is-zero-device device\n"
8845 #: ../fish/guestfish-actions.pod:2492 ../src/guestfs-actions.pod:3633
8846 msgid "This returns true iff the device exists and contains all zero bytes."
8850 #: ../fish/guestfish-actions.pod:2494 ../src/guestfs-actions.pod:3635
8851 msgid "Note that for large devices this can take a long time to run."
8855 #: ../fish/guestfish-actions.pod:2496
8856 msgid "kill-subprocess"
8860 #: ../fish/guestfish-actions.pod:2498
8863 " kill-subprocess\n"
8868 #: ../fish/guestfish-actions.pod:2500 ../src/guestfs-actions.pod:3646
8869 msgid "This kills the qemu subprocess. You should never need to call this."
8873 #: ../fish/guestfish-actions.pod:2502
8878 #: ../fish/guestfish-actions.pod:2504
8883 #: ../fish/guestfish-actions.pod:2506
8891 #: ../fish/guestfish-actions.pod:2508 ../src/guestfs-actions.pod:3657
8893 "Internally libguestfs is implemented by running a virtual machine using "
8898 #: ../fish/guestfish-actions.pod:2511 ../src/guestfs-actions.pod:3660
8900 "You should call this after configuring the handle (eg. adding drives) but "
8901 "before performing any actions."
8905 #: ../fish/guestfish-actions.pod:2514
8910 #: ../fish/guestfish-actions.pod:2516
8913 " lchown owner group path\n"
8918 #: ../fish/guestfish-actions.pod:2518
8920 "Change the file owner to C<owner> and group to C<group>. This is like "
8921 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
8926 #: ../fish/guestfish-actions.pod:2526
8931 #: ../fish/guestfish-actions.pod:2528
8934 " lgetxattr path name\n"
8939 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3700
8941 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
8942 "is a symlink, then this call returns an extended attribute from the symlink."
8946 #: ../fish/guestfish-actions.pod:2544
8947 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
8951 #: ../fish/guestfish-actions.pod:2546
8956 #: ../fish/guestfish-actions.pod:2548
8959 " lgetxattrs path\n"
8964 #: ../fish/guestfish-actions.pod:2550
8966 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
8967 "it returns the extended attributes of the link itself."
8971 #: ../fish/guestfish-actions.pod:2554
8976 #: ../fish/guestfish-actions.pod:2556
8984 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3743
8986 "List all 9p filesystems attached to the guest. A list of mount tags is "
8991 #: ../fish/guestfish-actions.pod:2561
8992 msgid "list-devices"
8996 #: ../fish/guestfish-actions.pod:2563
9004 #: ../fish/guestfish-actions.pod:2565 ../src/guestfs-actions.pod:3757
9005 msgid "List all the block devices."
9009 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3759
9010 msgid "The full block device names are returned, eg. C</dev/sda>."
9014 #: ../fish/guestfish-actions.pod:2571
9015 msgid "list-dm-devices"
9019 #: ../fish/guestfish-actions.pod:2573
9022 " list-dm-devices\n"
9027 #: ../fish/guestfish-actions.pod:2575 ../src/guestfs-actions.pod:3774
9028 msgid "List all device mapper devices."
9032 #: ../fish/guestfish-actions.pod:2577
9034 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
9035 "previous call to L</luks-open>."
9039 #: ../fish/guestfish-actions.pod:2580
9041 "Device mapper devices which correspond to logical volumes are I<not> "
9042 "returned in this list. Call L</lvs> if you want to list logical volumes."
9046 #: ../fish/guestfish-actions.pod:2584
9047 msgid "list-filesystems"
9051 #: ../fish/guestfish-actions.pod:2586
9054 " list-filesystems\n"
9059 #: ../fish/guestfish-actions.pod:2588 ../src/guestfs-actions.pod:3794
9061 "This inspection command looks for filesystems on partitions, block devices "
9062 "and logical volumes, returning a list of devices containing filesystems and "
9067 #: ../fish/guestfish-actions.pod:2592 ../src/guestfs-actions.pod:3798
9069 "The return value is a hash, where the keys are the devices containing "
9070 "filesystems, and the values are the filesystem types. For example:"
9074 #: ../fish/guestfish-actions.pod:2596 ../src/guestfs-actions.pod:3802
9077 " \"/dev/sda1\" => \"ntfs\"\n"
9078 " \"/dev/sda2\" => \"ext2\"\n"
9079 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9080 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9085 #: ../fish/guestfish-actions.pod:2601 ../src/guestfs-actions.pod:3807
9087 "The value can have the special value \"unknown\", meaning the content of the "
9088 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9092 #: ../fish/guestfish-actions.pod:2605
9094 "This command runs other libguestfs commands, which might include L</mount> "
9095 "and L</umount>, and therefore you should use this soon after launch and only "
9096 "when nothing is mounted."
9100 #: ../fish/guestfish-actions.pod:2609
9102 "Not all of the filesystems returned will be mountable. In particular, swap "
9103 "partitions are returned in the list. Also this command does not check that "
9104 "each filesystem found is valid and mountable, and some filesystems might be "
9105 "mountable but require special options. Filesystems may not all belong to a "
9106 "single logical operating system (use L</inspect-os> to look for OSes)."
9110 #: ../fish/guestfish-actions.pod:2617
9111 msgid "list-partitions"
9115 #: ../fish/guestfish-actions.pod:2619
9118 " list-partitions\n"
9123 #: ../fish/guestfish-actions.pod:2621 ../src/guestfs-actions.pod:3836
9124 msgid "List all the partitions detected on all block devices."
9128 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3838
9129 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9133 #: ../fish/guestfish-actions.pod:2625
9135 "This does not return logical volumes. For that you will need to call "
9140 #: ../fish/guestfish-actions.pod:2630
9145 #: ../fish/guestfish-actions.pod:2632
9153 #: ../fish/guestfish-actions.pod:2634 ../src/guestfs-actions.pod:3857
9155 "List the files in C<directory> (relative to the root directory, there is no "
9156 "cwd) in the format of 'ls -la'."
9160 #: ../fish/guestfish-actions.pod:2637 ../src/guestfs-actions.pod:3860
9162 "This command is mostly useful for interactive sessions. It is I<not> "
9163 "intended that you try to parse the output string."
9167 #: ../fish/guestfish-actions.pod:2640
9172 #: ../fish/guestfish-actions.pod:2642
9175 " ln target linkname\n"
9180 #: ../fish/guestfish-actions.pod:2644 ../src/guestfs-actions.pod:3875
9181 msgid "This command creates a hard link using the C<ln> command."
9185 #: ../fish/guestfish-actions.pod:2646
9190 #: ../fish/guestfish-actions.pod:2648
9193 " ln-f target linkname\n"
9198 #: ../fish/guestfish-actions.pod:2650 ../src/guestfs-actions.pod:3888
9200 "This command creates a hard link using the C<ln -f> command. The I<-f> "
9201 "option removes the link (C<linkname>) if it exists already."
9205 #: ../fish/guestfish-actions.pod:2653
9210 #: ../fish/guestfish-actions.pod:2655
9213 " ln-s target linkname\n"
9218 #: ../fish/guestfish-actions.pod:2657 ../src/guestfs-actions.pod:3902
9219 msgid "This command creates a symbolic link using the C<ln -s> command."
9223 #: ../fish/guestfish-actions.pod:2659
9228 #: ../fish/guestfish-actions.pod:2661
9231 " ln-sf target linkname\n"
9236 #: ../fish/guestfish-actions.pod:2663 ../src/guestfs-actions.pod:3915
9238 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
9239 "option removes the link (C<linkname>) if it exists already."
9243 #: ../fish/guestfish-actions.pod:2666
9244 msgid "lremovexattr"
9248 #: ../fish/guestfish-actions.pod:2668
9251 " lremovexattr xattr path\n"
9256 #: ../fish/guestfish-actions.pod:2670
9258 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
9259 "it removes an extended attribute of the link itself."
9263 #: ../fish/guestfish-actions.pod:2674
9268 #: ../fish/guestfish-actions.pod:2676
9276 #: ../fish/guestfish-actions.pod:2678 ../src/guestfs-actions.pod:3943
9278 "List the files in C<directory> (relative to the root directory, there is no "
9279 "cwd). The '.' and '..' entries are not returned, but hidden files are "
9284 #: ../fish/guestfish-actions.pod:2682
9286 "This command is mostly useful for interactive sessions. Programs should "
9287 "probably use L</readdir> instead."
9291 #: ../fish/guestfish-actions.pod:2685
9296 #: ../fish/guestfish-actions.pod:2687
9299 " lsetxattr xattr val vallen path\n"
9304 #: ../fish/guestfish-actions.pod:2689
9306 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
9307 "sets an extended attribute of the link itself."
9311 #: ../fish/guestfish-actions.pod:2693
9316 #: ../fish/guestfish-actions.pod:2695
9324 #: ../fish/guestfish-actions.pod:2697 ../fish/guestfish-actions.pod:4505 ../src/guestfs-actions.pod:3979 ../src/guestfs-actions.pod:6758
9325 msgid "Returns file information for the given C<path>."
9329 #: ../fish/guestfish-actions.pod:2699
9331 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
9332 "the link is stat-ed, not the file it refers to."
9336 #: ../fish/guestfish-actions.pod:2703 ../src/guestfs-actions.pod:3985
9337 msgid "This is the same as the C<lstat(2)> system call."
9341 #: ../fish/guestfish-actions.pod:2705
9346 #: ../fish/guestfish-actions.pod:2707
9349 " lstatlist path 'names ...'\n"
9354 #: ../fish/guestfish-actions.pod:2709
9356 "This call allows you to perform the L</lstat> operation on multiple files, "
9357 "where all files are in the directory C<path>. C<names> is the list of files "
9358 "from this directory."
9362 #: ../fish/guestfish-actions.pod:2713 ../src/guestfs-actions.pod:4004
9364 "On return you get a list of stat structs, with a one-to-one correspondence "
9365 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9366 "then the C<ino> field of that structure is set to C<-1>."
9370 #: ../fish/guestfish-actions.pod:2718
9372 "This call is intended for programs that want to efficiently list a directory "
9373 "contents without making many round-trips. See also L</lxattrlist> for a "
9374 "similarly efficient call for getting extended attributes. Very long "
9375 "directory listings might cause the protocol message size to be exceeded, "
9376 "causing this call to fail. The caller must split up such requests into "
9377 "smaller groups of names."
9381 #: ../fish/guestfish-actions.pod:2726
9382 msgid "luks-add-key"
9386 #: ../fish/guestfish-actions.pod:2728
9389 " luks-add-key device keyslot\n"
9394 #: ../fish/guestfish-actions.pod:2730 ../src/guestfs-actions.pod:4032
9396 "This command adds a new key on LUKS device C<device>. C<key> is any "
9397 "existing key, and is used to access the device. C<newkey> is the new key to "
9398 "add. C<keyslot> is the key slot that will be replaced."
9402 #: ../fish/guestfish-actions.pod:2735
9404 "Note that if C<keyslot> already contains a key, then this command will "
9405 "fail. You have to use L</luks-kill-slot> first to remove that key."
9409 #: ../fish/guestfish-actions.pod:2739 ../fish/guestfish-actions.pod:2761 ../fish/guestfish-actions.pod:2774 ../fish/guestfish-actions.pod:2788 ../fish/guestfish-actions.pod:2814 ../fish/guestfish-actions.pod:2824
9411 "This command has one or more key or passphrase parameters. Guestfish will "
9412 "prompt for these separately."
9416 #: ../fish/guestfish-actions.pod:2742
9421 #: ../fish/guestfish-actions.pod:2744
9424 " luks-close device\n"
9429 #: ../fish/guestfish-actions.pod:2746
9431 "This closes a LUKS device that was created earlier by L</luks-open> or "
9432 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
9433 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9434 "underlying block device."
9438 #: ../fish/guestfish-actions.pod:2752
9443 #: ../fish/guestfish-actions.pod:2754
9446 " luks-format device keyslot\n"
9451 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4073
9453 "This command erases existing data on C<device> and formats the device as a "
9454 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9455 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9459 #: ../fish/guestfish-actions.pod:2764 ../fish/guestfish-actions.pod:2777 ../fish/guestfish-actions.pod:2864 ../fish/guestfish-actions.pod:3525 ../fish/guestfish-actions.pod:4051 ../fish/guestfish-actions.pod:4376 ../fish/guestfish-actions.pod:4399 ../fish/guestfish-actions.pod:4421 ../fish/guestfish-actions.pod:5167 ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4103 ../src/guestfs-actions.pod:4246 ../src/guestfs-actions.pod:5349 ../src/guestfs-actions.pod:6137 ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6595 ../src/guestfs-actions.pod:6628 ../src/guestfs-actions.pod:7834
9461 "B<This command is dangerous. Without careful use you can easily destroy all "
9466 #: ../fish/guestfish-actions.pod:2767
9467 msgid "luks-format-cipher"
9471 #: ../fish/guestfish-actions.pod:2769
9474 " luks-format-cipher device keyslot cipher\n"
9479 #: ../fish/guestfish-actions.pod:2771
9481 "This command is the same as L</luks-format> but it also allows you to set "
9482 "the C<cipher> used."
9486 #: ../fish/guestfish-actions.pod:2780
9487 msgid "luks-kill-slot"
9491 #: ../fish/guestfish-actions.pod:2782
9494 " luks-kill-slot device keyslot\n"
9499 #: ../fish/guestfish-actions.pod:2784 ../src/guestfs-actions.pod:4120
9501 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9502 "device C<device>. C<key> must be one of the I<other> keys."
9506 #: ../fish/guestfish-actions.pod:2791
9511 #: ../fish/guestfish-actions.pod:2793
9514 " luks-open device mapname\n"
9519 #: ../fish/guestfish-actions.pod:2795 ../src/guestfs-actions.pod:4140
9521 "This command opens a block device which has been encrypted according to the "
9522 "Linux Unified Key Setup (LUKS) standard."
9526 #: ../fish/guestfish-actions.pod:2798 ../src/guestfs-actions.pod:4143
9527 msgid "C<device> is the encrypted block device or partition."
9531 #: ../fish/guestfish-actions.pod:2800 ../src/guestfs-actions.pod:4145
9533 "The caller must supply one of the keys associated with the LUKS block "
9534 "device, in the C<key> parameter."
9538 #: ../fish/guestfish-actions.pod:2803 ../src/guestfs-actions.pod:4148
9540 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9541 "writes to this block device are decrypted from and encrypted to the "
9542 "underlying C<device> respectively."
9546 #: ../fish/guestfish-actions.pod:2807
9548 "If this block device contains LVM volume groups, then calling L</vgscan> "
9549 "followed by L</vg-activate-all> will make them visible."
9553 #: ../fish/guestfish-actions.pod:2811
9554 msgid "Use L</list-dm-devices> to list all device mapper devices."
9558 #: ../fish/guestfish-actions.pod:2817
9559 msgid "luks-open-ro"
9563 #: ../fish/guestfish-actions.pod:2819
9566 " luks-open-ro device mapname\n"
9571 #: ../fish/guestfish-actions.pod:2821
9573 "This is the same as L</luks-open> except that a read-only mapping is "
9578 #: ../fish/guestfish-actions.pod:2827
9583 #: ../fish/guestfish-actions.pod:2829
9586 " lvcreate logvol volgroup mbytes\n"
9591 #: ../fish/guestfish-actions.pod:2831 ../src/guestfs-actions.pod:4194
9593 "This creates an LVM logical volume called C<logvol> on the volume group "
9594 "C<volgroup>, with C<size> megabytes."
9598 #: ../fish/guestfish-actions.pod:2834
9599 msgid "lvm-canonical-lv-name"
9603 #: ../fish/guestfish-actions.pod:2836
9606 " lvm-canonical-lv-name lvname\n"
9611 #: ../fish/guestfish-actions.pod:2838 ../src/guestfs-actions.pod:4207
9613 "This converts alternative naming schemes for LVs that you might find to the "
9614 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
9619 #: ../fish/guestfish-actions.pod:2842 ../src/guestfs-actions.pod:4211
9621 "This command returns an error if the C<lvname> parameter does not refer to a "
9626 #: ../fish/guestfish-actions.pod:2845
9627 msgid "See also L</is-lv>."
9631 #: ../fish/guestfish-actions.pod:2847
9632 msgid "lvm-clear-filter"
9636 #: ../fish/guestfish-actions.pod:2849
9639 " lvm-clear-filter\n"
9644 #: ../fish/guestfish-actions.pod:2851
9646 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
9651 #: ../fish/guestfish-actions.pod:2854 ../fish/guestfish-actions.pod:2885 ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:4271
9652 msgid "This command also clears the LVM cache and performs a volume group scan."
9656 #: ../fish/guestfish-actions.pod:2857
9657 msgid "lvm-remove-all"
9661 #: ../fish/guestfish-actions.pod:2859
9669 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4241
9671 "This command removes all LVM logical volumes, volume groups and physical "
9676 #: ../fish/guestfish-actions.pod:2867
9677 msgid "lvm-set-filter"
9681 #: ../fish/guestfish-actions.pod:2869
9684 " lvm-set-filter 'devices ...'\n"
9689 #: ../fish/guestfish-actions.pod:2871 ../src/guestfs-actions.pod:4257
9691 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9692 "block devices in the list C<devices>, and will ignore all other attached "
9697 #: ../fish/guestfish-actions.pod:2875 ../src/guestfs-actions.pod:4261
9699 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9700 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9701 "there are two types of duplication possible: either cloned PVs/VGs which "
9702 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9703 "same name. In normal operation you cannot create this situation, but you "
9704 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9705 "inside the LVM metadata."
9709 #: ../fish/guestfish-actions.pod:2888 ../src/guestfs-actions.pod:4274
9710 msgid "You can filter whole block devices or individual partitions."
9714 #: ../fish/guestfish-actions.pod:2890 ../src/guestfs-actions.pod:4276
9716 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9717 "filesystem), even if you are not filtering out that VG."
9721 #: ../fish/guestfish-actions.pod:2894
9726 #: ../fish/guestfish-actions.pod:2896
9729 " lvremove device\n"
9734 #: ../fish/guestfish-actions.pod:2898 ../src/guestfs-actions.pod:4290
9736 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9737 "LV, such as C</dev/VG/LV>."
9741 #: ../fish/guestfish-actions.pod:2901 ../src/guestfs-actions.pod:4293
9743 "You can also remove all LVs in a volume group by specifying the VG name, "
9748 #: ../fish/guestfish-actions.pod:2904
9753 #: ../fish/guestfish-actions.pod:2906
9756 " lvrename logvol newlogvol\n"
9761 #: ../fish/guestfish-actions.pod:2908 ../src/guestfs-actions.pod:4307
9762 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9766 #: ../fish/guestfish-actions.pod:2910
9771 #: ../fish/guestfish-actions.pod:2912
9774 " lvresize device mbytes\n"
9779 #: ../fish/guestfish-actions.pod:2914 ../src/guestfs-actions.pod:4320
9781 "This resizes (expands or shrinks) an existing LVM logical volume to "
9782 "C<mbytes>. When reducing, data in the reduced part is lost."
9786 #: ../fish/guestfish-actions.pod:2918
9787 msgid "lvresize-free"
9791 #: ../fish/guestfish-actions.pod:2920
9794 " lvresize-free lv percent\n"
9799 #: ../fish/guestfish-actions.pod:2922 ../src/guestfs-actions.pod:4335
9801 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9802 "remaining free space in the volume group. Commonly you would call this with "
9803 "pc = 100 which expands the logical volume as much as possible, using all "
9804 "remaining free space in the volume group."
9808 #: ../fish/guestfish-actions.pod:2928
9813 #: ../fish/guestfish-actions.pod:2930
9821 #: ../fish/guestfish-actions.pod:2932 ../src/guestfs-actions.pod:4350
9823 "List all the logical volumes detected. This is the equivalent of the "
9824 "L<lvs(8)> command."
9828 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4353
9830 "This returns a list of the logical volume device names "
9831 "(eg. C</dev/VolGroup00/LogVol00>)."
9835 #: ../fish/guestfish-actions.pod:2938
9836 msgid "See also L</lvs-full>, L</list-filesystems>."
9840 #: ../fish/guestfish-actions.pod:2940
9845 #: ../fish/guestfish-actions.pod:2942
9853 #: ../fish/guestfish-actions.pod:2944 ../src/guestfs-actions.pod:4369
9855 "List all the logical volumes detected. This is the equivalent of the "
9856 "L<lvs(8)> command. The \"full\" version includes all fields."
9860 #: ../fish/guestfish-actions.pod:2947
9865 #: ../fish/guestfish-actions.pod:2949
9873 #: ../fish/guestfish-actions.pod:2951 ../src/guestfs-actions.pod:4384
9874 msgid "This command returns the UUID of the LVM LV C<device>."
9878 #: ../fish/guestfish-actions.pod:2953
9883 #: ../fish/guestfish-actions.pod:2955
9886 " lxattrlist path 'names ...'\n"
9891 #: ../fish/guestfish-actions.pod:2957 ../src/guestfs-actions.pod:4398
9893 "This call allows you to get the extended attributes of multiple files, where "
9894 "all files are in the directory C<path>. C<names> is the list of files from "
9899 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4402
9901 "On return you get a flat list of xattr structs which must be interpreted "
9902 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9903 "C<attrval> in this struct is zero-length to indicate there was an error "
9904 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9905 "number (the number of following attributes for this file, which could be "
9906 "C<\"0\">). Then after the first xattr struct are the zero or more "
9907 "attributes for the first named file. This repeats for the second and "
9912 #: ../fish/guestfish-actions.pod:2971
9914 "This call is intended for programs that want to efficiently list a directory "
9915 "contents without making many round-trips. See also L</lstatlist> for a "
9916 "similarly efficient call for getting standard stats. Very long directory "
9917 "listings might cause the protocol message size to be exceeded, causing this "
9918 "call to fail. The caller must split up such requests into smaller groups of "
9923 #: ../fish/guestfish-actions.pod:2979
9928 #: ../fish/guestfish-actions.pod:2981
9936 #: ../fish/guestfish-actions.pod:2983 ../src/guestfs-actions.pod:4432
9937 msgid "Create a directory named C<path>."
9941 #: ../fish/guestfish-actions.pod:2985
9946 #: ../fish/guestfish-actions.pod:2987
9949 " mkdir-mode path mode\n"
9954 #: ../fish/guestfish-actions.pod:2989 ../src/guestfs-actions.pod:4445
9956 "This command creates a directory, setting the initial permissions of the "
9957 "directory to C<mode>."
9961 #: ../fish/guestfish-actions.pod:2992 ../src/guestfs-actions.pod:4448
9963 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9964 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9969 #: ../fish/guestfish-actions.pod:2996
9970 msgid "See also L</mkdir>, L</umask>"
9974 #: ../fish/guestfish-actions.pod:2998
9979 #: ../fish/guestfish-actions.pod:3000
9987 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4464
9989 "Create a directory named C<path>, creating any parent directories as "
9990 "necessary. This is like the C<mkdir -p> shell command."
9994 #: ../fish/guestfish-actions.pod:3005
9999 #: ../fish/guestfish-actions.pod:3007
10002 " mkdtemp template\n"
10007 #: ../fish/guestfish-actions.pod:3009 ../src/guestfs-actions.pod:4477
10009 "This command creates a temporary directory. The C<template> parameter "
10010 "should be a full pathname for the temporary directory name with the final "
10011 "six characters being \"XXXXXX\"."
10015 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4482
10017 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10018 "being suitable for Windows filesystems."
10022 #: ../fish/guestfish-actions.pod:3017 ../src/guestfs-actions.pod:4485
10023 msgid "The name of the temporary directory that was created is returned."
10027 #: ../fish/guestfish-actions.pod:3020 ../src/guestfs-actions.pod:4488
10028 msgid "The temporary directory is created with mode 0700 and is owned by root."
10032 #: ../fish/guestfish-actions.pod:3023 ../src/guestfs-actions.pod:4491
10034 "The caller is responsible for deleting the temporary directory and its "
10035 "contents after use."
10039 #: ../fish/guestfish-actions.pod:3026 ../src/guestfs-actions.pod:4494
10040 msgid "See also: L<mkdtemp(3)>"
10044 #: ../fish/guestfish-actions.pod:3028
10049 #: ../fish/guestfish-actions.pod:3030
10052 " mke2fs-J fstype blocksize device journal\n"
10057 #: ../fish/guestfish-actions.pod:3032 ../src/guestfs-actions.pod:4510
10059 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10060 "C<journal>. It is equivalent to the command:"
10064 #: ../fish/guestfish-actions.pod:3036 ../src/guestfs-actions.pod:4514
10067 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10072 #: ../fish/guestfish-actions.pod:3038
10073 msgid "See also L</mke2journal>."
10077 #: ../fish/guestfish-actions.pod:3040
10082 #: ../fish/guestfish-actions.pod:3042
10085 " mke2fs-JL fstype blocksize device label\n"
10090 #: ../fish/guestfish-actions.pod:3044 ../src/guestfs-actions.pod:4531
10092 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10093 "the journal labeled C<label>."
10097 #: ../fish/guestfish-actions.pod:3047
10098 msgid "See also L</mke2journal-L>."
10102 #: ../fish/guestfish-actions.pod:3049
10107 #: ../fish/guestfish-actions.pod:3051
10110 " mke2fs-JU fstype blocksize device uuid\n"
10115 #: ../fish/guestfish-actions.pod:3053 ../src/guestfs-actions.pod:4549
10117 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10118 "the journal with UUID C<uuid>."
10122 #: ../fish/guestfish-actions.pod:3056
10123 msgid "See also L</mke2journal-U>."
10127 #: ../fish/guestfish-actions.pod:3058
10128 msgid "mke2journal"
10132 #: ../fish/guestfish-actions.pod:3060
10135 " mke2journal blocksize device\n"
10140 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4565
10142 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10147 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4568
10150 " mke2fs -O journal_dev -b blocksize device\n"
10155 #: ../fish/guestfish-actions.pod:3067
10156 msgid "mke2journal-L"
10160 #: ../fish/guestfish-actions.pod:3069
10163 " mke2journal-L blocksize label device\n"
10168 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4582
10169 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10173 #: ../fish/guestfish-actions.pod:3073
10174 msgid "mke2journal-U"
10178 #: ../fish/guestfish-actions.pod:3075
10181 " mke2journal-U blocksize uuid device\n"
10186 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4596
10187 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10191 #: ../fish/guestfish-actions.pod:3079
10196 #: ../fish/guestfish-actions.pod:3081
10199 " mkfifo mode path\n"
10204 #: ../fish/guestfish-actions.pod:3083
10206 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10207 "is just a convenient wrapper around L</mknod>."
10211 #: ../fish/guestfish-actions.pod:3089
10216 #: ../fish/guestfish-actions.pod:3091
10219 " mkfs fstype device\n"
10224 #: ../fish/guestfish-actions.pod:3093 ../src/guestfs-actions.pod:4626
10226 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10227 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10231 #: ../fish/guestfish-actions.pod:3097
10236 #: ../fish/guestfish-actions.pod:3099
10239 " mkfs-b fstype blocksize device\n"
10244 #: ../fish/guestfish-actions.pod:3101
10246 "This call is similar to L</mkfs>, but it allows you to control the block "
10247 "size of the resulting filesystem. Supported block sizes depend on the "
10248 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10252 #: ../fish/guestfish-actions.pod:3106 ../fish/guestfish-actions.pod:3133 ../src/guestfs-actions.pod:4647 ../src/guestfs-actions.pod:4692
10254 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10259 #: ../fish/guestfish-actions.pod:3109
10261 "This function is deprecated. In new code, use the L</mkfs_opts> call "
10266 #: ../fish/guestfish-actions.pod:3116
10271 #: ../fish/guestfish-actions.pod:3118
10274 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
10275 "[sectorsize:..]\n"
10280 #: ../fish/guestfish-actions.pod:3120 ../src/guestfs-actions.pod:4679
10282 "This function creates a filesystem on C<device>. The filesystem type is "
10283 "C<fstype>, for example C<ext3>."
10287 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4686
10288 msgid "C<blocksize>"
10292 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4688
10294 "The filesystem block size. Supported block sizes depend on the filesystem "
10295 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
10300 #: ../fish/guestfish-actions.pod:3136 ../src/guestfs-actions.pod:4695
10301 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
10305 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4697
10306 msgid "C<features>"
10310 #: ../fish/guestfish-actions.pod:3140 ../src/guestfs-actions.pod:4699
10311 msgid "This passes the I<-O> parameter to the external mkfs program."
10315 #: ../fish/guestfish-actions.pod:3142 ../src/guestfs-actions.pod:4701
10317 "For certain filesystem types, this allows extra filesystem features to be "
10318 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
10322 #: ../fish/guestfish-actions.pod:3146 ../src/guestfs-actions.pod:4705
10324 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
10329 #: ../fish/guestfish-actions.pod:3149 ../src/guestfs-actions.pod:4708
10334 #: ../fish/guestfish-actions.pod:3151 ../src/guestfs-actions.pod:4710
10336 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
10337 "sets the inode size (only for ext2/3/4 filesystems at present)."
10341 #: ../fish/guestfish-actions.pod:3154 ../src/guestfs-actions.pod:4713
10342 msgid "C<sectorsize>"
10346 #: ../fish/guestfish-actions.pod:3156 ../src/guestfs-actions.pod:4715
10348 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
10349 "sets sector size for ufs filesystem."
10353 #: ../fish/guestfish-actions.pod:3163
10354 msgid "mkmountpoint"
10358 #: ../fish/guestfish-actions.pod:3165
10361 " mkmountpoint exemptpath\n"
10366 #: ../fish/guestfish-actions.pod:3167
10368 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
10369 "to create extra mountpoints before mounting the first filesystem."
10373 #: ../fish/guestfish-actions.pod:3171 ../src/guestfs-actions.pod:4758
10375 "These calls are I<only> necessary in some very limited circumstances, mainly "
10376 "the case where you want to mount a mix of unrelated and/or read-only "
10377 "filesystems together."
10381 #: ../fish/guestfish-actions.pod:3175 ../src/guestfs-actions.pod:4762
10383 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10384 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10385 "inside that. You can unpack this as follows in guestfish:"
10389 #: ../fish/guestfish-actions.pod:3180 ../src/guestfs-actions.pod:4767
10392 " add-ro Fedora-11-i686-Live.iso\n"
10394 " mkmountpoint /cd\n"
10395 " mkmountpoint /sqsh\n"
10396 " mkmountpoint /ext3fs\n"
10397 " mount /dev/sda /cd\n"
10398 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10399 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10404 #: ../fish/guestfish-actions.pod:3189 ../src/guestfs-actions.pod:4776
10405 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10409 #: ../fish/guestfish-actions.pod:3191
10411 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
10412 "unexpected errors if you try to mix these calls. It is safest to manually "
10413 "unmount filesystems and remove mountpoints after use."
10417 #: ../fish/guestfish-actions.pod:3195
10419 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
10420 "for this to work for manual mountpoints, you must ensure that the innermost "
10421 "mountpoints have the longest pathnames, as in the example code above."
10425 #: ../fish/guestfish-actions.pod:3200 ../src/guestfs-actions.pod:4787
10426 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10430 #: ../fish/guestfish-actions.pod:3202
10432 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
10433 "L</umount-all> to be called when the handle is closed which can also trigger "
10438 #: ../fish/guestfish-actions.pod:3206
10443 #: ../fish/guestfish-actions.pod:3208
10446 " mknod mode devmajor devminor path\n"
10451 #: ../fish/guestfish-actions.pod:3210 ../src/guestfs-actions.pod:4806
10453 "This call creates block or character special devices, or named pipes "
10458 #: ../fish/guestfish-actions.pod:3213 ../src/guestfs-actions.pod:4809
10460 "The C<mode> parameter should be the mode, using the standard constants. "
10461 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10462 "used when creating block and character special devices."
10466 #: ../fish/guestfish-actions.pod:3218
10468 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10469 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10470 "regular file). These constants are available in the standard Linux header "
10471 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
10472 "wrappers around this command which bitwise OR in the appropriate constant "
10477 #: ../fish/guestfish-actions.pod:3228
10482 #: ../fish/guestfish-actions.pod:3230
10485 " mknod-b mode devmajor devminor path\n"
10490 #: ../fish/guestfish-actions.pod:3232
10492 "This call creates a block device node called C<path> with mode C<mode> and "
10493 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10494 "wrapper around L</mknod>."
10498 #: ../fish/guestfish-actions.pod:3238
10503 #: ../fish/guestfish-actions.pod:3240
10506 " mknod-c mode devmajor devminor path\n"
10511 #: ../fish/guestfish-actions.pod:3242
10513 "This call creates a char device node called C<path> with mode C<mode> and "
10514 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10515 "wrapper around L</mknod>."
10519 #: ../fish/guestfish-actions.pod:3248
10524 #: ../fish/guestfish-actions.pod:3250
10532 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4872
10533 msgid "Create a swap partition on C<device>."
10537 #: ../fish/guestfish-actions.pod:3254
10542 #: ../fish/guestfish-actions.pod:3256
10545 " mkswap-L label device\n"
10550 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4885
10551 msgid "Create a swap partition on C<device> with label C<label>."
10555 #: ../fish/guestfish-actions.pod:3260 ../src/guestfs-actions.pod:4887
10557 "Note that you cannot attach a swap label to a block device "
10558 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
10559 "the kernel or swap tools."
10563 #: ../fish/guestfish-actions.pod:3264
10568 #: ../fish/guestfish-actions.pod:3266
10571 " mkswap-U uuid device\n"
10576 #: ../fish/guestfish-actions.pod:3268 ../src/guestfs-actions.pod:4902
10577 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10581 #: ../fish/guestfish-actions.pod:3270
10582 msgid "mkswap-file"
10586 #: ../fish/guestfish-actions.pod:3272
10589 " mkswap-file path\n"
10594 #: ../fish/guestfish-actions.pod:3274 ../src/guestfs-actions.pod:4914
10595 msgid "Create a swap file."
10599 #: ../fish/guestfish-actions.pod:3276
10601 "This command just writes a swap file signature to an existing file. To "
10602 "create the file itself, use something like L</fallocate>."
10606 #: ../fish/guestfish-actions.pod:3279
10611 #: ../fish/guestfish-actions.pod:3281
10614 " modprobe modulename\n"
10619 #: ../fish/guestfish-actions.pod:3283 ../src/guestfs-actions.pod:4929
10620 msgid "This loads a kernel module in the appliance."
10624 #: ../fish/guestfish-actions.pod:3285 ../src/guestfs-actions.pod:4931
10626 "The kernel module must have been whitelisted when libguestfs was built (see "
10627 "C<appliance/kmod.whitelist.in> in the source)."
10631 #: ../fish/guestfish-actions.pod:3288
10636 #: ../fish/guestfish-actions.pod:3290
10639 " mount device mountpoint\n"
10644 #: ../fish/guestfish-actions.pod:3292 ../src/guestfs-actions.pod:4945
10646 "Mount a guest disk at a position in the filesystem. Block devices are named "
10647 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10648 "those block devices contain partitions, they will have the usual names "
10649 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10653 #: ../fish/guestfish-actions.pod:3298 ../src/guestfs-actions.pod:4951
10655 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10656 "mounted on C</> before others can be mounted. Other filesystems can only be "
10657 "mounted on directories which already exist."
10661 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:4956
10663 "The mounted filesystem is writable, if we have sufficient permissions on the "
10664 "underlying device."
10668 #: ../fish/guestfish-actions.pod:3306
10670 "B<Important note:> When you use this call, the filesystem options C<sync> "
10671 "and C<noatime> are set implicitly. This was originally done because we "
10672 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10673 "very large negative performance impact and negligible effect on "
10674 "reliability. Therefore we recommend that you avoid using L</mount> in any "
10675 "code that needs performance, and instead use L</mount-options> (use an empty "
10676 "string for the first parameter if you don't want any options)."
10680 #: ../fish/guestfish-actions.pod:3316
10682 "This function is deprecated. In new code, use the L</mount_options> call "
10687 #: ../fish/guestfish-actions.pod:3323
10692 #: ../fish/guestfish-actions.pod:3325
10695 " mount-9p mounttag mountpoint [options:..]\n"
10700 #: ../fish/guestfish-actions.pod:3327 ../src/guestfs-actions.pod:4995
10702 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
10707 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:4998
10709 "If required, C<trans=virtio> will be automatically added to the options. "
10710 "Any other options required can be passed in the optional C<options> "
10715 #: ../fish/guestfish-actions.pod:3336
10720 #: ../fish/guestfish-actions.pod:3338
10723 " mount-loop file mountpoint\n"
10728 #: ../fish/guestfish-actions.pod:3340 ../src/guestfs-actions.pod:5037
10730 "This command lets you mount C<file> (a filesystem image in a file) on a "
10731 "mount point. It is entirely equivalent to the command C<mount -o loop file "
10736 #: ../fish/guestfish-actions.pod:3344
10737 msgid "mount-options"
10741 #: ../fish/guestfish-actions.pod:3346
10744 " mount-options options device mountpoint\n"
10749 #: ../fish/guestfish-actions.pod:3348
10751 "This is the same as the L</mount> command, but it allows you to set the "
10752 "mount options as for the L<mount(8)> I<-o> flag."
10756 #: ../fish/guestfish-actions.pod:3352 ../src/guestfs-actions.pod:5057
10758 "If the C<options> parameter is an empty string, then no options are passed "
10759 "(all options default to whatever the filesystem uses)."
10763 #: ../fish/guestfish-actions.pod:3356
10768 #: ../fish/guestfish-actions.pod:3358
10771 " mount-ro device mountpoint\n"
10776 #: ../fish/guestfish-actions.pod:3360
10778 "This is the same as the L</mount> command, but it mounts the filesystem with "
10779 "the read-only (I<-o ro>) flag."
10783 #: ../fish/guestfish-actions.pod:3363
10788 #: ../fish/guestfish-actions.pod:3365
10791 " mount-vfs options vfstype device mountpoint\n"
10796 #: ../fish/guestfish-actions.pod:3367
10798 "This is the same as the L</mount> command, but it allows you to set both the "
10799 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
10803 #: ../fish/guestfish-actions.pod:3371
10804 msgid "mountpoints"
10808 #: ../fish/guestfish-actions.pod:3373
10816 #: ../fish/guestfish-actions.pod:3375
10818 "This call is similar to L</mounts>. That call returns a list of devices. "
10819 "This one returns a hash table (map) of device name to directory where the "
10820 "device is mounted."
10824 #: ../fish/guestfish-actions.pod:3379
10829 #: ../fish/guestfish-actions.pod:3381
10837 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5118
10839 "This returns the list of currently mounted filesystems. It returns the list "
10840 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10844 #: ../fish/guestfish-actions.pod:3386 ../src/guestfs-actions.pod:5121
10845 msgid "Some internal mounts are not shown."
10849 #: ../fish/guestfish-actions.pod:3388
10850 msgid "See also: L</mountpoints>"
10854 #: ../fish/guestfish-actions.pod:3390
10859 #: ../fish/guestfish-actions.pod:3392
10867 #: ../fish/guestfish-actions.pod:3394 ../src/guestfs-actions.pod:5138
10869 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10870 "destination filename or destination directory."
10874 #: ../fish/guestfish-actions.pod:3397
10875 msgid "ntfs-3g-probe"
10879 #: ../fish/guestfish-actions.pod:3399
10882 " ntfs-3g-probe true|false device\n"
10887 #: ../fish/guestfish-actions.pod:3401 ../src/guestfs-actions.pod:5152
10889 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10890 "C<device> for mountability. (Not all NTFS volumes can be mounted "
10891 "read-write, and some cannot be mounted at all)."
10895 #: ../fish/guestfish-actions.pod:3405 ../src/guestfs-actions.pod:5156
10897 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10898 "can be mounted read-write. Set it to false if you want to test if the "
10899 "volume can be mounted read-only."
10903 #: ../fish/guestfish-actions.pod:3409 ../src/guestfs-actions.pod:5160
10905 "The return value is an integer which C<0> if the operation would succeed, or "
10906 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10910 #: ../fish/guestfish-actions.pod:3413
10915 #: ../fish/guestfish-actions.pod:3415
10918 " ntfsresize device\n"
10923 #: ../fish/guestfish-actions.pod:3417 ../fish/guestfish-actions.pod:3441 ../src/guestfs-actions.pod:5174 ../src/guestfs-actions.pod:5213
10925 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10926 "size of the underlying device."
10930 #: ../fish/guestfish-actions.pod:3420 ../src/guestfs-actions.pod:5177
10932 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
10933 "consistency check (for safety). You have to boot into Windows to perform "
10934 "this check and clear this condition. Furthermore, ntfsresize refuses to "
10935 "resize filesystems which have been marked in this way. So in effect it is "
10936 "not possible to call ntfsresize multiple times on a single filesystem "
10937 "without booting into Windows between each resize."
10941 #: ../fish/guestfish-actions.pod:3428 ../fish/guestfish-actions.pod:3467 ../src/guestfs-actions.pod:5185 ../src/guestfs-actions.pod:5239
10942 msgid "See also L<ntfsresize(8)>."
10946 #: ../fish/guestfish-actions.pod:3430 ../fish/guestfish-actions.pod:3478
10948 "This function is deprecated. In new code, use the L</ntfsresize_opts> call "
10953 #: ../fish/guestfish-actions.pod:3437
10954 msgid "ntfsresize-opts"
10958 #: ../fish/guestfish-actions.pod:3439
10961 " ntfsresize-opts device [size:..] [force:..]\n"
10966 #: ../fish/guestfish-actions.pod:3450 ../src/guestfs-actions.pod:5222
10968 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
10969 "resized to fit the container (eg. partition)."
10973 #: ../fish/guestfish-actions.pod:3453 ../src/guestfs-actions.pod:5225
10978 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5227
10980 "If this option is true, then force the resize of the filesystem even if the "
10981 "filesystem is marked as requiring a consistency check."
10985 #: ../fish/guestfish-actions.pod:3458
10987 "After the resize operation, the filesystem is always marked as requiring a "
10988 "consistency check (for safety). You have to boot into Windows to perform "
10989 "this check and clear this condition. If you I<don't> set the C<force> "
10990 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
10991 "a single filesystem without booting into Windows between each resize."
10995 #: ../fish/guestfish-actions.pod:3471
10996 msgid "ntfsresize-size"
11000 #: ../fish/guestfish-actions.pod:3473
11003 " ntfsresize-size device size\n"
11008 #: ../fish/guestfish-actions.pod:3475
11010 "This command is the same as L</ntfsresize> except that it allows you to "
11011 "specify the new size (in bytes) explicitly."
11015 #: ../fish/guestfish-actions.pod:3485
11020 #: ../fish/guestfish-actions.pod:3487
11023 " part-add device prlogex startsect endsect\n"
11028 #: ../fish/guestfish-actions.pod:3489
11030 "This command adds a partition to C<device>. If there is no partition table "
11031 "on the device, call L</part-init> first."
11035 #: ../fish/guestfish-actions.pod:3492 ../src/guestfs-actions.pod:5300
11037 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11038 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11039 "C<logical>) and C<e> (or C<extended>) partition types."
11043 #: ../fish/guestfish-actions.pod:3497 ../src/guestfs-actions.pod:5305
11045 "C<startsect> and C<endsect> are the start and end of the partition in "
11046 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11047 "from the end of the disk (C<-1> is the last sector)."
11051 #: ../fish/guestfish-actions.pod:3501
11053 "Creating a partition which covers the whole disk is not so easy. Use "
11054 "L</part-disk> to do that."
11058 #: ../fish/guestfish-actions.pod:3504
11063 #: ../fish/guestfish-actions.pod:3506
11066 " part-del device partnum\n"
11071 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5323
11072 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11076 #: ../fish/guestfish-actions.pod:3510 ../src/guestfs-actions.pod:5325
11078 "Note that in the case of MBR partitioning, deleting an extended partition "
11079 "also deletes any logical partitions it contains."
11083 #: ../fish/guestfish-actions.pod:3514
11088 #: ../fish/guestfish-actions.pod:3516
11091 " part-disk device parttype\n"
11096 #: ../fish/guestfish-actions.pod:3518
11098 "This command is simply a combination of L</part-init> followed by "
11099 "L</part-add> to create a single primary partition covering the whole disk."
11103 #: ../fish/guestfish-actions.pod:3522
11105 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11106 "possible values are described in L</part-init>."
11110 #: ../fish/guestfish-actions.pod:3528
11111 msgid "part-get-bootable"
11115 #: ../fish/guestfish-actions.pod:3530
11118 " part-get-bootable device partnum\n"
11123 #: ../fish/guestfish-actions.pod:3532 ../src/guestfs-actions.pod:5361
11125 "This command returns true if the partition C<partnum> on C<device> has the "
11126 "bootable flag set."
11130 #: ../fish/guestfish-actions.pod:3535
11131 msgid "See also L</part-set-bootable>."
11135 #: ../fish/guestfish-actions.pod:3537
11136 msgid "part-get-mbr-id"
11140 #: ../fish/guestfish-actions.pod:3539
11143 " part-get-mbr-id device partnum\n"
11148 #: ../fish/guestfish-actions.pod:3541 ../src/guestfs-actions.pod:5377
11150 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11151 "partition C<partnum>."
11155 #: ../fish/guestfish-actions.pod:3544 ../fish/guestfish-actions.pod:3688
11157 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11158 "undefined results for other partition table types (see "
11159 "L</part-get-parttype>)."
11163 #: ../fish/guestfish-actions.pod:3548
11164 msgid "part-get-parttype"
11168 #: ../fish/guestfish-actions.pod:3550
11171 " part-get-parttype device\n"
11176 #: ../fish/guestfish-actions.pod:3552 ../src/guestfs-actions.pod:5394
11178 "This command examines the partition table on C<device> and returns the "
11179 "partition table type (format) being used."
11183 #: ../fish/guestfish-actions.pod:3555
11185 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11186 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11187 "possible, although unusual. See L</part-init> for a full list."
11191 #: ../fish/guestfish-actions.pod:3560
11196 #: ../fish/guestfish-actions.pod:3562
11199 " part-init device parttype\n"
11204 #: ../fish/guestfish-actions.pod:3564 ../src/guestfs-actions.pod:5414
11206 "This creates an empty partition table on C<device> of one of the partition "
11207 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11208 "(for large disks)."
11212 #: ../fish/guestfish-actions.pod:3568
11214 "Initially there are no partitions. Following this, you should call "
11215 "L</part-add> for each partition required."
11219 #: ../fish/guestfish-actions.pod:3571 ../src/guestfs-actions.pod:5421
11220 msgid "Possible values for C<parttype> are:"
11224 #: ../fish/guestfish-actions.pod:3575 ../src/guestfs-actions.pod:5425
11229 #: ../fish/guestfish-actions.pod:3577 ../src/guestfs-actions.pod:5427
11234 #: ../fish/guestfish-actions.pod:3579 ../src/guestfs-actions.pod:5429
11235 msgid "Intel EFI / GPT partition table."
11239 #: ../fish/guestfish-actions.pod:3581 ../src/guestfs-actions.pod:5431
11241 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11242 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11243 "the C<mbr> format."
11247 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5435
11252 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5437
11257 #: ../fish/guestfish-actions.pod:3589 ../src/guestfs-actions.pod:5439
11259 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11260 "Windows. This partition type will B<only> work for device sizes up to 2 "
11261 "TB. For large disks we recommend using C<gpt>."
11265 #: ../fish/guestfish-actions.pod:3596 ../src/guestfs-actions.pod:5446
11266 msgid "Other partition table types that may work but are not supported include:"
11270 #: ../fish/guestfish-actions.pod:3601 ../src/guestfs-actions.pod:5451
11275 #: ../fish/guestfish-actions.pod:3603 ../src/guestfs-actions.pod:5453
11276 msgid "AIX disk labels."
11280 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5455
11285 #: ../fish/guestfish-actions.pod:3607 ../src/guestfs-actions.pod:5457
11290 #: ../fish/guestfish-actions.pod:3609 ../src/guestfs-actions.pod:5459
11291 msgid "Amiga \"Rigid Disk Block\" format."
11295 #: ../fish/guestfish-actions.pod:3611 ../src/guestfs-actions.pod:5461
11300 #: ../fish/guestfish-actions.pod:3613 ../src/guestfs-actions.pod:5463
11301 msgid "BSD disk labels."
11305 #: ../fish/guestfish-actions.pod:3615 ../src/guestfs-actions.pod:5465
11310 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5467
11311 msgid "DASD, used on IBM mainframes."
11315 #: ../fish/guestfish-actions.pod:3619 ../src/guestfs-actions.pod:5469
11320 #: ../fish/guestfish-actions.pod:3621 ../src/guestfs-actions.pod:5471
11321 msgid "MIPS/SGI volumes."
11325 #: ../fish/guestfish-actions.pod:3623 ../src/guestfs-actions.pod:5473
11330 #: ../fish/guestfish-actions.pod:3625 ../src/guestfs-actions.pod:5475
11331 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11335 #: ../fish/guestfish-actions.pod:3627 ../src/guestfs-actions.pod:5477
11340 #: ../fish/guestfish-actions.pod:3629 ../src/guestfs-actions.pod:5479
11341 msgid "NEC PC-98 format, common in Japan apparently."
11345 #: ../fish/guestfish-actions.pod:3631 ../src/guestfs-actions.pod:5481
11350 #: ../fish/guestfish-actions.pod:3633 ../src/guestfs-actions.pod:5483
11351 msgid "Sun disk labels."
11355 #: ../fish/guestfish-actions.pod:3637
11360 #: ../fish/guestfish-actions.pod:3639
11363 " part-list device\n"
11368 #: ../fish/guestfish-actions.pod:3641 ../src/guestfs-actions.pod:5497
11370 "This command parses the partition table on C<device> and returns the list of "
11371 "partitions found."
11375 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5500
11376 msgid "The fields in the returned structure are:"
11380 #: ../fish/guestfish-actions.pod:3648 ../src/guestfs-actions.pod:5504
11381 msgid "B<part_num>"
11385 #: ../fish/guestfish-actions.pod:3650 ../src/guestfs-actions.pod:5506
11386 msgid "Partition number, counting from 1."
11390 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5508
11391 msgid "B<part_start>"
11395 #: ../fish/guestfish-actions.pod:3654
11397 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11398 "the device's sector size, see L</blockdev-getss>."
11402 #: ../fish/guestfish-actions.pod:3657 ../src/guestfs-actions.pod:5513
11403 msgid "B<part_end>"
11407 #: ../fish/guestfish-actions.pod:3659 ../src/guestfs-actions.pod:5515
11408 msgid "End of the partition in bytes."
11412 #: ../fish/guestfish-actions.pod:3661 ../src/guestfs-actions.pod:5517
11413 msgid "B<part_size>"
11417 #: ../fish/guestfish-actions.pod:3663 ../src/guestfs-actions.pod:5519
11418 msgid "Size of the partition in bytes."
11422 #: ../fish/guestfish-actions.pod:3667
11423 msgid "part-set-bootable"
11427 #: ../fish/guestfish-actions.pod:3669
11430 " part-set-bootable device partnum true|false\n"
11435 #: ../fish/guestfish-actions.pod:3671 ../src/guestfs-actions.pod:5537
11437 "This sets the bootable flag on partition numbered C<partnum> on device "
11438 "C<device>. Note that partitions are numbered from 1."
11442 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5540
11444 "The bootable flag is used by some operating systems (notably Windows) to "
11445 "determine which partition to boot from. It is by no means universally "
11450 #: ../fish/guestfish-actions.pod:3678
11451 msgid "part-set-mbr-id"
11455 #: ../fish/guestfish-actions.pod:3680
11458 " part-set-mbr-id device partnum idbyte\n"
11463 #: ../fish/guestfish-actions.pod:3682 ../src/guestfs-actions.pod:5556
11465 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11466 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11467 "documentation are in fact hexadecimal numbers, but usually documented "
11468 "without any leading \"0x\" which might be confusing."
11472 #: ../fish/guestfish-actions.pod:3692
11473 msgid "part-set-name"
11477 #: ../fish/guestfish-actions.pod:3694
11480 " part-set-name device partnum name\n"
11485 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5578
11487 "This sets the partition name on partition numbered C<partnum> on device "
11488 "C<device>. Note that partitions are numbered from 1."
11492 #: ../fish/guestfish-actions.pod:3699 ../src/guestfs-actions.pod:5581
11494 "The partition name can only be set on certain types of partition table. "
11495 "This works on C<gpt> but not on C<mbr> partitions."
11499 #: ../fish/guestfish-actions.pod:3702
11500 msgid "part-to-dev"
11504 #: ../fish/guestfish-actions.pod:3704
11507 " part-to-dev partition\n"
11512 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5594
11514 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11515 "partition number, returning the device name (eg. \"/dev/sdb\")."
11519 #: ../fish/guestfish-actions.pod:3710
11521 "The named partition must exist, for example as a string returned from "
11522 "L</list-partitions>."
11526 #: ../fish/guestfish-actions.pod:3713
11527 msgid "ping-daemon"
11531 #: ../fish/guestfish-actions.pod:3715
11539 #: ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5611
11541 "This is a test probe into the guestfs daemon running inside the qemu "
11542 "subprocess. Calling this function checks that the daemon responds to the "
11543 "ping message, without affecting the daemon or attached block device(s) in "
11548 #: ../fish/guestfish-actions.pod:3722
11553 #: ../fish/guestfish-actions.pod:3724
11556 " pread path count offset\n"
11561 #: ../fish/guestfish-actions.pod:3726 ../src/guestfs-actions.pod:5629
11563 "This command lets you read part of a file. It reads C<count> bytes of the "
11564 "file, starting at C<offset>, from file C<path>."
11568 #: ../fish/guestfish-actions.pod:3729 ../fish/guestfish-actions.pod:3744 ../src/guestfs-actions.pod:5632 ../src/guestfs-actions.pod:5658
11570 "This may read fewer bytes than requested. For further details see the "
11571 "L<pread(2)> system call."
11575 #: ../fish/guestfish-actions.pod:3732
11576 msgid "See also L</pwrite>, L</pread-device>."
11580 #: ../fish/guestfish-actions.pod:3737
11581 msgid "pread-device"
11585 #: ../fish/guestfish-actions.pod:3739
11588 " pread-device device count offset\n"
11593 #: ../fish/guestfish-actions.pod:3741 ../src/guestfs-actions.pod:5655
11595 "This command lets you read part of a file. It reads C<count> bytes of "
11596 "C<device>, starting at C<offset>."
11600 #: ../fish/guestfish-actions.pod:3747
11601 msgid "See also L</pread>."
11605 #: ../fish/guestfish-actions.pod:3752
11610 #: ../fish/guestfish-actions.pod:3754
11613 " pvcreate device\n"
11618 #: ../fish/guestfish-actions.pod:3756 ../src/guestfs-actions.pod:5678
11620 "This creates an LVM physical volume on the named C<device>, where C<device> "
11621 "should usually be a partition name such as C</dev/sda1>."
11625 #: ../fish/guestfish-actions.pod:3760
11630 #: ../fish/guestfish-actions.pod:3762
11633 " pvremove device\n"
11638 #: ../fish/guestfish-actions.pod:3764 ../src/guestfs-actions.pod:5692
11640 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11645 #: ../fish/guestfish-actions.pod:3767 ../src/guestfs-actions.pod:5695
11647 "The implementation uses the C<pvremove> command which refuses to wipe "
11648 "physical volumes that contain any volume groups, so you have to remove those "
11653 #: ../fish/guestfish-actions.pod:3771
11658 #: ../fish/guestfish-actions.pod:3773
11661 " pvresize device\n"
11666 #: ../fish/guestfish-actions.pod:3775 ../src/guestfs-actions.pod:5709
11668 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11669 "the new size of the underlying device."
11673 #: ../fish/guestfish-actions.pod:3778
11674 msgid "pvresize-size"
11678 #: ../fish/guestfish-actions.pod:3780
11681 " pvresize-size device size\n"
11686 #: ../fish/guestfish-actions.pod:3782
11688 "This command is the same as L</pvresize> except that it allows you to "
11689 "specify the new size (in bytes) explicitly."
11693 #: ../fish/guestfish-actions.pod:3785
11698 #: ../fish/guestfish-actions.pod:3787
11706 #: ../fish/guestfish-actions.pod:3789 ../src/guestfs-actions.pod:5735
11708 "List all the physical volumes detected. This is the equivalent of the "
11709 "L<pvs(8)> command."
11713 #: ../fish/guestfish-actions.pod:3792 ../src/guestfs-actions.pod:5738
11715 "This returns a list of just the device names that contain PVs "
11716 "(eg. C</dev/sda2>)."
11720 #: ../fish/guestfish-actions.pod:3795
11721 msgid "See also L</pvs-full>."
11725 #: ../fish/guestfish-actions.pod:3797
11730 #: ../fish/guestfish-actions.pod:3799
11738 #: ../fish/guestfish-actions.pod:3801 ../src/guestfs-actions.pod:5754
11740 "List all the physical volumes detected. This is the equivalent of the "
11741 "L<pvs(8)> command. The \"full\" version includes all fields."
11745 #: ../fish/guestfish-actions.pod:3804
11750 #: ../fish/guestfish-actions.pod:3806
11758 #: ../fish/guestfish-actions.pod:3808 ../src/guestfs-actions.pod:5769
11759 msgid "This command returns the UUID of the LVM PV C<device>."
11763 #: ../fish/guestfish-actions.pod:3810
11768 #: ../fish/guestfish-actions.pod:3812
11771 " pwrite path content offset\n"
11776 #: ../fish/guestfish-actions.pod:3814 ../src/guestfs-actions.pod:5785
11778 "This command writes to part of a file. It writes the data buffer C<content> "
11779 "to the file C<path> starting at offset C<offset>."
11783 #: ../fish/guestfish-actions.pod:3817 ../src/guestfs-actions.pod:5788
11785 "This command implements the L<pwrite(2)> system call, and like that system "
11786 "call it may not write the full data requested. The return value is the "
11787 "number of bytes that were actually written to the file. This could even be "
11788 "0, although short writes are unlikely for regular files in ordinary "
11793 #: ../fish/guestfish-actions.pod:3823
11794 msgid "See also L</pread>, L</pwrite-device>."
11798 #: ../fish/guestfish-actions.pod:3828
11799 msgid "pwrite-device"
11803 #: ../fish/guestfish-actions.pod:3830
11806 " pwrite-device device content offset\n"
11811 #: ../fish/guestfish-actions.pod:3832 ../src/guestfs-actions.pod:5812
11813 "This command writes to part of a device. It writes the data buffer "
11814 "C<content> to C<device> starting at offset C<offset>."
11818 #: ../fish/guestfish-actions.pod:3835 ../src/guestfs-actions.pod:5815
11820 "This command implements the L<pwrite(2)> system call, and like that system "
11821 "call it may not write the full data requested (although short writes to disk "
11822 "devices and partitions are probably impossible with standard Linux kernels)."
11826 #: ../fish/guestfish-actions.pod:3840
11827 msgid "See also L</pwrite>."
11831 #: ../fish/guestfish-actions.pod:3845
11836 #: ../fish/guestfish-actions.pod:3847
11839 " read-file path\n"
11844 #: ../fish/guestfish-actions.pod:3849 ../src/guestfs-actions.pod:5836
11845 msgid "This calls returns the contents of the file C<path> as a buffer."
11849 #: ../fish/guestfish-actions.pod:3852
11851 "Unlike L</cat>, this function can correctly handle files that contain "
11852 "embedded ASCII NUL characters. However unlike L</download>, this function "
11853 "is limited in the total size of file that can be handled."
11857 #: ../fish/guestfish-actions.pod:3860
11862 #: ../fish/guestfish-actions.pod:3862
11865 " read-lines path\n"
11870 #: ../fish/guestfish-actions.pod:3866 ../src/guestfs-actions.pod:5861
11872 "The file contents are returned as a list of lines. Trailing C<LF> and "
11873 "C<CRLF> character sequences are I<not> returned."
11877 #: ../fish/guestfish-actions.pod:3869
11879 "Note that this function cannot correctly handle binary files (specifically, "
11880 "files containing C<\\0> character which is treated as end of line). For "
11881 "those you need to use the L</read-file> function which has a more complex "
11886 #: ../fish/guestfish-actions.pod:3874
11891 #: ../fish/guestfish-actions.pod:3876
11899 #: ../fish/guestfish-actions.pod:3878 ../src/guestfs-actions.pod:5881
11900 msgid "This returns the list of directory entries in directory C<dir>."
11904 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:5883
11906 "All entries in the directory are returned, including C<.> and C<..>. The "
11907 "entries are I<not> sorted, but returned in the same order as the underlying "
11912 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5887
11914 "Also this call returns basic file type information about each file. The "
11915 "C<ftyp> field will contain one of the following characters:"
11919 #: ../fish/guestfish-actions.pod:3889 ../src/guestfs-actions.pod:5892
11924 #: ../fish/guestfish-actions.pod:3891 ../src/guestfs-actions.pod:5894
11925 msgid "Block special"
11929 #: ../fish/guestfish-actions.pod:3893 ../src/guestfs-actions.pod:5896
11934 #: ../fish/guestfish-actions.pod:3895 ../src/guestfs-actions.pod:5898
11935 msgid "Char special"
11939 #: ../fish/guestfish-actions.pod:3897 ../src/guestfs-actions.pod:5900
11944 #: ../fish/guestfish-actions.pod:3899 ../src/guestfs-actions.pod:5902
11949 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5904
11954 #: ../fish/guestfish-actions.pod:3903 ../src/guestfs-actions.pod:5906
11955 msgid "FIFO (named pipe)"
11959 #: ../fish/guestfish-actions.pod:3905 ../src/guestfs-actions.pod:5908
11964 #: ../fish/guestfish-actions.pod:3907 ../src/guestfs-actions.pod:5910
11965 msgid "Symbolic link"
11969 #: ../fish/guestfish-actions.pod:3909 ../src/guestfs-actions.pod:5912
11974 #: ../fish/guestfish-actions.pod:3911 ../src/guestfs-actions.pod:5914
11975 msgid "Regular file"
11979 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:5916
11984 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5918
11989 #: ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:5920
11994 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5922
11995 msgid "Unknown file type"
11999 #: ../fish/guestfish-actions.pod:3921 ../src/guestfs-actions.pod:5924
12004 #: ../fish/guestfish-actions.pod:3923 ../src/guestfs-actions.pod:5926
12005 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12009 #: ../fish/guestfish-actions.pod:3928
12011 "This function is primarily intended for use by programs. To get a simple "
12012 "list of names, use L</ls>. To get a printable directory for human "
12013 "consumption, use L</ll>."
12017 #: ../fish/guestfish-actions.pod:3932
12022 #: ../fish/guestfish-actions.pod:3934
12030 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:5947
12031 msgid "This command reads the target of a symbolic link."
12035 #: ../fish/guestfish-actions.pod:3938
12036 msgid "readlinklist"
12040 #: ../fish/guestfish-actions.pod:3940
12043 " readlinklist path 'names ...'\n"
12048 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:5961
12050 "This call allows you to do a C<readlink> operation on multiple files, where "
12051 "all files are in the directory C<path>. C<names> is the list of files from "
12056 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:5965
12058 "On return you get a list of strings, with a one-to-one correspondence to the "
12059 "C<names> list. Each string is the value of the symbolic link."
12063 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:5969
12065 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12066 "result string is the empty string C<\"\">. However the whole operation is "
12067 "completed even if there were C<readlink(2)> errors, and so you can call this "
12068 "function with names where you don't know if they are symbolic links already "
12069 "(albeit slightly less efficient)."
12073 #: ../fish/guestfish-actions.pod:3957 ../src/guestfs-actions.pod:5976
12075 "This call is intended for programs that want to efficiently list a directory "
12076 "contents without making many round-trips. Very long directory listings "
12077 "might cause the protocol message size to be exceeded, causing this call to "
12078 "fail. The caller must split up such requests into smaller groups of names."
12082 #: ../fish/guestfish-actions.pod:3964
12087 #: ../fish/guestfish-actions.pod:3966
12095 #: ../fish/guestfish-actions.pod:3968 ../src/guestfs-actions.pod:5995
12097 "Return the canonicalized absolute pathname of C<path>. The returned path "
12098 "has no C<.>, C<..> or symbolic link path elements."
12102 #: ../fish/guestfish-actions.pod:3971
12103 msgid "removexattr"
12107 #: ../fish/guestfish-actions.pod:3973
12110 " removexattr xattr path\n"
12115 #: ../fish/guestfish-actions.pod:3975 ../src/guestfs-actions.pod:6010
12116 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
12120 #: ../fish/guestfish-actions.pod:3978
12121 msgid "See also: L</lremovexattr>, L<attr(5)>."
12125 #: ../fish/guestfish-actions.pod:3980
12130 #: ../fish/guestfish-actions.pod:3982
12133 " resize2fs device\n"
12138 #: ../fish/guestfish-actions.pod:3984 ../src/guestfs-actions.pod:6025
12140 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12141 "underlying device."
12145 #: ../fish/guestfish-actions.pod:3987
12147 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
12148 "before calling this command. For unknown reasons C<resize2fs> sometimes "
12149 "gives an error about this and sometimes not. In any case, it is always safe "
12150 "to call L</e2fsck-f> before calling this function."
12154 #: ../fish/guestfish-actions.pod:3993
12155 msgid "resize2fs-M"
12159 #: ../fish/guestfish-actions.pod:3995
12162 " resize2fs-M device\n"
12167 #: ../fish/guestfish-actions.pod:3997
12169 "This command is the same as L</resize2fs>, but the filesystem is resized to "
12170 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
12175 #: ../fish/guestfish-actions.pod:4001
12177 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
12178 "and read the C<Block size> and C<Block count> values. These two numbers, "
12179 "multiplied together, give the resulting size of the minimal filesystem in "
12184 #: ../fish/guestfish-actions.pod:4006
12185 msgid "resize2fs-size"
12189 #: ../fish/guestfish-actions.pod:4008
12192 " resize2fs-size device size\n"
12197 #: ../fish/guestfish-actions.pod:4010
12199 "This command is the same as L</resize2fs> except that it allows you to "
12200 "specify the new size (in bytes) explicitly."
12204 #: ../fish/guestfish-actions.pod:4013
12209 #: ../fish/guestfish-actions.pod:4015
12217 #: ../fish/guestfish-actions.pod:4017 ../src/guestfs-actions.pod:6077
12218 msgid "Remove the single file C<path>."
12222 #: ../fish/guestfish-actions.pod:4019
12227 #: ../fish/guestfish-actions.pod:4021
12235 #: ../fish/guestfish-actions.pod:4023 ../src/guestfs-actions.pod:6089
12237 "Remove the file or directory C<path>, recursively removing the contents if "
12238 "its a directory. This is like the C<rm -rf> shell command."
12242 #: ../fish/guestfish-actions.pod:4027
12247 #: ../fish/guestfish-actions.pod:4029
12255 #: ../fish/guestfish-actions.pod:4031 ../src/guestfs-actions.pod:6103
12256 msgid "Remove the single directory C<path>."
12260 #: ../fish/guestfish-actions.pod:4033
12261 msgid "rmmountpoint"
12265 #: ../fish/guestfish-actions.pod:4035
12268 " rmmountpoint exemptpath\n"
12273 #: ../fish/guestfish-actions.pod:4037
12275 "This calls removes a mountpoint that was previously created with "
12276 "L</mkmountpoint>. See L</mkmountpoint> for full details."
12280 #: ../fish/guestfish-actions.pod:4041
12281 msgid "scrub-device"
12285 #: ../fish/guestfish-actions.pod:4043
12288 " scrub-device device\n"
12293 #: ../fish/guestfish-actions.pod:4045 ../src/guestfs-actions.pod:6129
12295 "This command writes patterns over C<device> to make data retrieval more "
12300 #: ../fish/guestfish-actions.pod:4048 ../fish/guestfish-actions.pod:4063 ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6132 ../src/guestfs-actions.pod:6153 ../src/guestfs-actions.pod:6172
12302 "It is an interface to the L<scrub(1)> program. See that manual page for "
12307 #: ../fish/guestfish-actions.pod:4054
12312 #: ../fish/guestfish-actions.pod:4056
12315 " scrub-file file\n"
12320 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6148
12322 "This command writes patterns over a file to make data retrieval more "
12327 #: ../fish/guestfish-actions.pod:4061 ../src/guestfs-actions.pod:6151
12328 msgid "The file is I<removed> after scrubbing."
12332 #: ../fish/guestfish-actions.pod:4066
12333 msgid "scrub-freespace"
12337 #: ../fish/guestfish-actions.pod:4068
12340 " scrub-freespace dir\n"
12345 #: ../fish/guestfish-actions.pod:4070
12347 "This command creates the directory C<dir> and then fills it with files until "
12348 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
12349 "deletes them. The intention is to scrub any free space on the partition "
12350 "containing C<dir>."
12354 #: ../fish/guestfish-actions.pod:4079
12359 #: ../fish/guestfish-actions.pod:4081
12364 #: ../fish/guestfish-actions.pod:4083
12367 " set-append append\n"
12372 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6185
12374 "This function is used to add additional options to the guest kernel command "
12379 #: ../fish/guestfish-actions.pod:4088 ../src/guestfs-actions.pod:6188
12381 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12382 "environment variable."
12386 #: ../fish/guestfish-actions.pod:4091 ../src/guestfs-actions.pod:6191
12388 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12389 "(libguestfs always adds a few of its own)."
12393 #: ../fish/guestfish-actions.pod:4094
12394 msgid "set-attach-method"
12398 #: ../fish/guestfish-actions.pod:4096
12399 msgid "attach-method"
12403 #: ../fish/guestfish-actions.pod:4098
12406 " set-attach-method attachmethod\n"
12411 #: ../fish/guestfish-actions.pod:4100 ../src/guestfs-actions.pod:6204
12413 "Set the method that libguestfs uses to connect to the back end guestfsd "
12414 "daemon. Possible methods are:"
12418 #: ../fish/guestfish-actions.pod:4105 ../src/guestfs-actions.pod:6209 ../src/guestfs.pod:2780
12419 msgid "C<appliance>"
12423 #: ../fish/guestfish-actions.pod:4107 ../src/guestfs-actions.pod:6211
12425 "Launch an appliance and connect to it. This is the ordinary method and the "
12430 #: ../fish/guestfish-actions.pod:4110 ../src/guestfs-actions.pod:6214
12431 msgid "C<unix:I<path>>"
12435 #: ../fish/guestfish-actions.pod:4112 ../src/guestfs-actions.pod:6216
12436 msgid "Connect to the Unix domain socket I<path>."
12440 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6218
12442 "This method lets you connect to an existing daemon or (using virtio-serial) "
12443 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
12444 "RUNNING DAEMONS>."
12448 #: ../fish/guestfish-actions.pod:4120
12449 msgid "set-autosync"
12453 #: ../fish/guestfish-actions.pod:4122
12458 #: ../fish/guestfish-actions.pod:4124
12461 " set-autosync true|false\n"
12466 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6234
12468 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12469 "effort attempt to make filesystems consistent and synchronized when the "
12470 "handle is closed (also if the program exits without closing handles)."
12474 #: ../fish/guestfish-actions.pod:4131 ../src/guestfs-actions.pod:6239
12476 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12477 "disabled by default)."
12481 #: ../fish/guestfish-actions.pod:4134
12486 #: ../fish/guestfish-actions.pod:4136
12491 #: ../fish/guestfish-actions.pod:4138
12494 " set-direct true|false\n"
12499 #: ../fish/guestfish-actions.pod:4140 ../src/guestfs-actions.pod:6252
12501 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12502 "passed directly through to the appliance once it is launched."
12506 #: ../fish/guestfish-actions.pod:4144
12508 "One consequence of this is that log messages aren't caught by the library "
12509 "and handled by L</set-log-message-callback>, but go straight to stdout."
12513 #: ../fish/guestfish-actions.pod:4148 ../src/guestfs-actions.pod:6260
12514 msgid "You probably don't want to use this unless you know what you are doing."
12518 #: ../fish/guestfish-actions.pod:4151 ../src/guestfs-actions.pod:6263
12519 msgid "The default is disabled."
12523 #: ../fish/guestfish-actions.pod:4153
12524 msgid "set-e2label"
12528 #: ../fish/guestfish-actions.pod:4155
12531 " set-e2label device label\n"
12536 #: ../fish/guestfish-actions.pod:4157 ../src/guestfs-actions.pod:6276
12538 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12539 "C<label>. Filesystem labels are limited to 16 characters."
12543 #: ../fish/guestfish-actions.pod:4161
12545 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
12546 "label on a filesystem."
12550 #: ../fish/guestfish-actions.pod:4164
12555 #: ../fish/guestfish-actions.pod:4166
12558 " set-e2uuid device uuid\n"
12563 #: ../fish/guestfish-actions.pod:4168 ../src/guestfs-actions.pod:6294
12565 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12566 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12567 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12571 #: ../fish/guestfish-actions.pod:4173
12573 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
12574 "UUID of a filesystem."
12578 #: ../fish/guestfish-actions.pod:4176
12579 msgid "set-memsize"
12583 #: ../fish/guestfish-actions.pod:4178
12588 #: ../fish/guestfish-actions.pod:4180
12591 " set-memsize memsize\n"
12596 #: ../fish/guestfish-actions.pod:4182
12598 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12599 "This only has any effect if called before L</launch>."
12603 #: ../fish/guestfish-actions.pod:4186 ../src/guestfs-actions.pod:6316
12605 "You can also change this by setting the environment variable "
12606 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12610 #: ../fish/guestfish-actions.pod:4193
12611 msgid "set-network"
12615 #: ../fish/guestfish-actions.pod:4195
12620 #: ../fish/guestfish-actions.pod:4197
12623 " set-network true|false\n"
12628 #: ../fish/guestfish-actions.pod:4199 ../src/guestfs-actions.pod:6333
12630 "If C<network> is true, then the network is enabled in the libguestfs "
12631 "appliance. The default is false."
12635 #: ../fish/guestfish-actions.pod:4202 ../src/guestfs-actions.pod:6336
12637 "This affects whether commands are able to access the network (see "
12638 "L<guestfs(3)/RUNNING COMMANDS>)."
12642 #: ../fish/guestfish-actions.pod:4205
12643 msgid "You must call this before calling L</launch>, otherwise it has no effect."
12647 #: ../fish/guestfish-actions.pod:4208
12652 #: ../fish/guestfish-actions.pod:4212
12655 " set-path searchpath\n"
12660 #: ../fish/guestfish-actions.pod:4214 ../src/guestfs-actions.pod:6352
12661 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12665 #: ../fish/guestfish-actions.pod:4216 ../src/guestfs-actions.pod:6354
12667 "The default is C<$libdir/guestfs> unless overridden by setting "
12668 "C<LIBGUESTFS_PATH> environment variable."
12672 #: ../fish/guestfish-actions.pod:4219 ../src/guestfs-actions.pod:6357
12673 msgid "Setting C<path> to C<NULL> restores the default path."
12677 #: ../fish/guestfish-actions.pod:4221
12682 #: ../fish/guestfish-actions.pod:4223
12687 #: ../fish/guestfish-actions.pod:4225
12690 " set-pgroup true|false\n"
12695 #: ../fish/guestfish-actions.pod:4227 ../src/guestfs-actions.pod:6369
12697 "If C<pgroup> is true, child processes are placed into their own process "
12702 #: ../fish/guestfish-actions.pod:4230 ../src/guestfs-actions.pod:6372
12704 "The practical upshot of this is that signals like C<SIGINT> (from users "
12705 "pressing C<^C>) won't be received by the child process."
12709 #: ../fish/guestfish-actions.pod:4233 ../src/guestfs-actions.pod:6375
12711 "The default for this flag is false, because usually you want C<^C> to kill "
12716 #: ../fish/guestfish-actions.pod:4236
12721 #: ../fish/guestfish-actions.pod:4238
12726 #: ../fish/guestfish-actions.pod:4240
12734 #: ../fish/guestfish-actions.pod:4242 ../src/guestfs-actions.pod:6388
12735 msgid "Set the qemu binary that we will use."
12739 #: ../fish/guestfish-actions.pod:4244 ../src/guestfs-actions.pod:6390
12740 msgid "The default is chosen when the library was compiled by the configure script."
12744 #: ../fish/guestfish-actions.pod:4247 ../src/guestfs-actions.pod:6393
12746 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
12751 #: ../fish/guestfish-actions.pod:4250 ../src/guestfs-actions.pod:6396
12752 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
12756 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6398
12758 "Note that you should call this function as early as possible after creating "
12759 "the handle. This is because some pre-launch operations depend on testing "
12760 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
12761 "don't retest features, and so you might see inconsistent results. Using the "
12762 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
12763 "the qemu binary at the same time as the handle is created."
12767 #: ../fish/guestfish-actions.pod:4260
12768 msgid "set-recovery-proc"
12772 #: ../fish/guestfish-actions.pod:4262
12773 msgid "recovery-proc"
12777 #: ../fish/guestfish-actions.pod:4264
12780 " set-recovery-proc true|false\n"
12785 #: ../fish/guestfish-actions.pod:4266
12787 "If this is called with the parameter C<false> then L</launch> does not "
12788 "create a recovery process. The purpose of the recovery process is to stop "
12789 "runaway qemu processes in the case where the main program aborts abruptly."
12793 #: ../fish/guestfish-actions.pod:4271
12795 "This only has any effect if called before L</launch>, and the default is "
12800 #: ../fish/guestfish-actions.pod:4274 ../src/guestfs-actions.pod:6424
12802 "About the only time when you would want to disable this is if the main "
12803 "process will fork itself into the background (\"daemonize\" itself). In "
12804 "this case the recovery process thinks that the main program has disappeared "
12805 "and so kills qemu, which is not very helpful."
12809 #: ../fish/guestfish-actions.pod:4280
12810 msgid "set-selinux"
12814 #: ../fish/guestfish-actions.pod:4282
12819 #: ../fish/guestfish-actions.pod:4284
12822 " set-selinux true|false\n"
12827 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6440
12829 "This sets the selinux flag that is passed to the appliance at boot time. "
12830 "The default is C<selinux=0> (disabled)."
12834 #: ../fish/guestfish-actions.pod:4289 ../src/guestfs-actions.pod:6443
12836 "Note that if SELinux is enabled, it is always in Permissive mode "
12837 "(C<enforcing=0>)."
12841 #: ../fish/guestfish-actions.pod:4295
12846 #: ../fish/guestfish-actions.pod:4297
12851 #: ../fish/guestfish-actions.pod:4299
12854 " set-trace true|false\n"
12859 #: ../fish/guestfish-actions.pod:4301 ../src/guestfs-actions.pod:6459
12861 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
12862 "return values are traced."
12866 #: ../fish/guestfish-actions.pod:4304 ../src/guestfs-actions.pod:6462
12868 "If you want to trace C API calls into libguestfs (and other libraries) then "
12869 "possibly a better way is to use the external ltrace(1) command."
12873 #: ../fish/guestfish-actions.pod:4308 ../src/guestfs-actions.pod:6466
12875 "Command traces are disabled unless the environment variable "
12876 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12880 #: ../fish/guestfish-actions.pod:4311
12882 "Trace messages are normally sent to C<stderr>, unless you register a "
12883 "callback to send them somewhere else (see L</set-event-callback>)."
12887 #: ../fish/guestfish-actions.pod:4315
12888 msgid "set-verbose"
12892 #: ../fish/guestfish-actions.pod:4317
12897 #: ../fish/guestfish-actions.pod:4319
12900 " set-verbose true|false\n"
12905 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6483
12906 msgid "If C<verbose> is true, this turns on verbose messages."
12910 #: ../fish/guestfish-actions.pod:4323 ../src/guestfs-actions.pod:6485
12912 "Verbose messages are disabled unless the environment variable "
12913 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12917 #: ../fish/guestfish-actions.pod:4326
12919 "Verbose messages are normally sent to C<stderr>, unless you register a "
12920 "callback to send them somewhere else (see L</set-event-callback>)."
12924 #: ../fish/guestfish-actions.pod:4330
12929 #: ../fish/guestfish-actions.pod:4332
12932 " setcon context\n"
12937 #: ../fish/guestfish-actions.pod:4334 ../src/guestfs-actions.pod:6502
12939 "This sets the SELinux security context of the daemon to the string "
12944 #: ../fish/guestfish-actions.pod:4337 ../src/guestfs-actions.pod:6505
12945 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12949 #: ../fish/guestfish-actions.pod:4339
12954 #: ../fish/guestfish-actions.pod:4341
12957 " setxattr xattr val vallen path\n"
12962 #: ../fish/guestfish-actions.pod:4343 ../src/guestfs-actions.pod:6520
12964 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12965 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12969 #: ../fish/guestfish-actions.pod:4347
12970 msgid "See also: L</lsetxattr>, L<attr(5)>."
12974 #: ../fish/guestfish-actions.pod:4349
12979 #: ../fish/guestfish-actions.pod:4351
12982 " sfdisk device cyls heads sectors 'lines ...'\n"
12987 #: ../fish/guestfish-actions.pod:4353 ../src/guestfs-actions.pod:6540
12989 "This is a direct interface to the L<sfdisk(8)> program for creating "
12990 "partitions on block devices."
12994 #: ../fish/guestfish-actions.pod:4356 ../src/guestfs-actions.pod:6543
12995 msgid "C<device> should be a block device, for example C</dev/sda>."
12999 #: ../fish/guestfish-actions.pod:4358 ../src/guestfs-actions.pod:6545
13001 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13002 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
13003 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13004 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13005 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13006 "the kernel) cannot work out the right geometry and you will need to tell it."
13010 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6553
13012 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13013 "refer to the L<sfdisk(8)> manpage."
13017 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6556
13019 "To create a single partition occupying the whole disk, you would pass "
13020 "C<lines> as a single element list, when the single element being the string "
13025 #: ../fish/guestfish-actions.pod:4373
13026 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
13030 #: ../fish/guestfish-actions.pod:4379 ../fish/guestfish-actions.pod:4402 ../fish/guestfish-actions.pod:4424
13032 "This function is deprecated. In new code, use the L</part_add> call "
13037 #: ../fish/guestfish-actions.pod:4386
13042 #: ../fish/guestfish-actions.pod:4388
13045 " sfdiskM device 'lines ...'\n"
13050 #: ../fish/guestfish-actions.pod:4390
13052 "This is a simplified interface to the L</sfdisk> command, where partition "
13053 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13054 "you don't need to specify the cyls, heads and sectors parameters which were "
13055 "rarely if ever used anyway."
13059 #: ../fish/guestfish-actions.pod:4396
13060 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13064 #: ../fish/guestfish-actions.pod:4409
13069 #: ../fish/guestfish-actions.pod:4411
13072 " sfdisk-N device partnum cyls heads sectors line\n"
13077 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6618
13079 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13080 "(note: C<n> counts from 1)."
13084 #: ../fish/guestfish-actions.pod:4416
13086 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13087 "cyls/heads/sectors parameters."
13091 #: ../fish/guestfish-actions.pod:4419
13092 msgid "See also: L</part-add>"
13096 #: ../fish/guestfish-actions.pod:4431
13097 msgid "sfdisk-disk-geometry"
13101 #: ../fish/guestfish-actions.pod:4433
13104 " sfdisk-disk-geometry device\n"
13109 #: ../fish/guestfish-actions.pod:4435
13111 "This displays the disk geometry of C<device> read from the partition table. "
13112 "Especially in the case where the underlying block device has been resized, "
13113 "this can be different from the kernel's idea of the geometry (see "
13114 "L</sfdisk-kernel-geometry>)."
13118 #: ../fish/guestfish-actions.pod:4440 ../fish/guestfish-actions.pod:4449 ../src/guestfs-actions.pod:6651 ../src/guestfs-actions.pod:6667
13119 msgid "The result is in human-readable format, and not designed to be parsed."
13123 #: ../fish/guestfish-actions.pod:4443
13124 msgid "sfdisk-kernel-geometry"
13128 #: ../fish/guestfish-actions.pod:4445
13131 " sfdisk-kernel-geometry device\n"
13136 #: ../fish/guestfish-actions.pod:4447 ../src/guestfs-actions.pod:6665
13137 msgid "This displays the kernel's idea of the geometry of C<device>."
13141 #: ../fish/guestfish-actions.pod:4452
13146 #: ../fish/guestfish-actions.pod:4454
13149 " sfdisk-l device\n"
13154 #: ../fish/guestfish-actions.pod:4456 ../src/guestfs-actions.pod:6681
13156 "This displays the partition table on C<device>, in the human-readable output "
13157 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13161 #: ../fish/guestfish-actions.pod:4460
13162 msgid "See also: L</part-list>"
13166 #: ../fish/guestfish-actions.pod:4462
13168 "This function is deprecated. In new code, use the L</part_list> call "
13173 #: ../fish/guestfish-actions.pod:4469
13178 #: ../fish/guestfish-actions.pod:4471
13186 #: ../fish/guestfish-actions.pod:4473 ../src/guestfs-actions.pod:6705
13188 "This call runs a command from the guest filesystem via the guest's "
13193 #: ../fish/guestfish-actions.pod:4476
13194 msgid "This is like L</command>, but passes the command to:"
13198 #: ../fish/guestfish-actions.pod:4478 ../src/guestfs-actions.pod:6710
13201 " /bin/sh -c \"command\"\n"
13206 #: ../fish/guestfish-actions.pod:4480 ../src/guestfs-actions.pod:6712
13208 "Depending on the guest's shell, this usually results in wildcards being "
13209 "expanded, shell expressions being interpolated and so on."
13213 #: ../fish/guestfish-actions.pod:4484
13214 msgid "All the provisos about L</command> apply to this call."
13218 #: ../fish/guestfish-actions.pod:4486
13223 #: ../fish/guestfish-actions.pod:4488
13226 " sh-lines command\n"
13231 #: ../fish/guestfish-actions.pod:4490
13232 msgid "This is the same as L</sh>, but splits the result into a list of lines."
13236 #: ../fish/guestfish-actions.pod:4493
13237 msgid "See also: L</command-lines>"
13241 #: ../fish/guestfish-actions.pod:4495
13246 #: ../fish/guestfish-actions.pod:4497
13254 #: ../fish/guestfish-actions.pod:4499 ../src/guestfs-actions.pod:6746
13255 msgid "Sleep for C<secs> seconds."
13259 #: ../fish/guestfish-actions.pod:4501
13264 #: ../fish/guestfish-actions.pod:4503
13272 #: ../fish/guestfish-actions.pod:4507 ../src/guestfs-actions.pod:6760
13273 msgid "This is the same as the C<stat(2)> system call."
13277 #: ../fish/guestfish-actions.pod:4509
13282 #: ../fish/guestfish-actions.pod:4511
13290 #: ../fish/guestfish-actions.pod:4513 ../src/guestfs-actions.pod:6774
13292 "Returns file system statistics for any mounted file system. C<path> should "
13293 "be a file or directory in the mounted file system (typically it is the mount "
13294 "point itself, but it doesn't need to be)."
13298 #: ../fish/guestfish-actions.pod:4517 ../src/guestfs-actions.pod:6778
13299 msgid "This is the same as the C<statvfs(2)> system call."
13303 #: ../fish/guestfish-actions.pod:4519
13308 #: ../fish/guestfish-actions.pod:4521
13316 #: ../fish/guestfish-actions.pod:4523 ../src/guestfs-actions.pod:6792
13318 "This runs the L<strings(1)> command on a file and returns the list of "
13319 "printable strings found."
13323 #: ../fish/guestfish-actions.pod:4529
13328 #: ../fish/guestfish-actions.pod:4531
13331 " strings-e encoding path\n"
13336 #: ../fish/guestfish-actions.pod:4533
13338 "This is like the L</strings> command, but allows you to specify the encoding "
13339 "of strings that are looked for in the source file C<path>."
13343 #: ../fish/guestfish-actions.pod:4537 ../src/guestfs-actions.pod:6815
13344 msgid "Allowed encodings are:"
13348 #: ../fish/guestfish-actions.pod:4541 ../src/guestfs-actions.pod:6819
13353 #: ../fish/guestfish-actions.pod:4543
13355 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13356 "ISO-8859-X (this is what L</strings> uses)."
13360 #: ../fish/guestfish-actions.pod:4546 ../src/guestfs-actions.pod:6824
13365 #: ../fish/guestfish-actions.pod:4548 ../src/guestfs-actions.pod:6826
13366 msgid "Single 8-bit-byte characters."
13370 #: ../fish/guestfish-actions.pod:4550 ../src/guestfs-actions.pod:6828
13375 #: ../fish/guestfish-actions.pod:4552 ../src/guestfs-actions.pod:6830
13376 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13380 #: ../fish/guestfish-actions.pod:4555 ../src/guestfs-actions.pod:6833
13381 msgid "l (lower case letter L)"
13385 #: ../fish/guestfish-actions.pod:4557 ../src/guestfs-actions.pod:6835
13387 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13388 "examining binaries in Windows guests."
13392 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6838
13397 #: ../fish/guestfish-actions.pod:4562 ../src/guestfs-actions.pod:6840
13398 msgid "32-bit big endian such as UCS-4BE."
13402 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6842
13407 #: ../fish/guestfish-actions.pod:4566 ../src/guestfs-actions.pod:6844
13408 msgid "32-bit little endian such as UCS-4LE."
13412 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:6848
13413 msgid "The returned strings are transcoded to UTF-8."
13417 #: ../fish/guestfish-actions.pod:4575
13418 msgid "swapoff-device"
13422 #: ../fish/guestfish-actions.pod:4577
13425 " swapoff-device device\n"
13430 #: ../fish/guestfish-actions.pod:4579
13432 "This command disables the libguestfs appliance swap device or partition "
13433 "named C<device>. See L</swapon-device>."
13437 #: ../fish/guestfish-actions.pod:4583
13438 msgid "swapoff-file"
13442 #: ../fish/guestfish-actions.pod:4585
13445 " swapoff-file file\n"
13450 #: ../fish/guestfish-actions.pod:4587 ../src/guestfs-actions.pod:6879
13451 msgid "This command disables the libguestfs appliance swap on file."
13455 #: ../fish/guestfish-actions.pod:4589
13456 msgid "swapoff-label"
13460 #: ../fish/guestfish-actions.pod:4591
13463 " swapoff-label label\n"
13468 #: ../fish/guestfish-actions.pod:4593 ../src/guestfs-actions.pod:6891
13470 "This command disables the libguestfs appliance swap on labeled swap "
13475 #: ../fish/guestfish-actions.pod:4596
13476 msgid "swapoff-uuid"
13480 #: ../fish/guestfish-actions.pod:4598
13483 " swapoff-uuid uuid\n"
13488 #: ../fish/guestfish-actions.pod:4600 ../src/guestfs-actions.pod:6904
13490 "This command disables the libguestfs appliance swap partition with the given "
13495 #: ../fish/guestfish-actions.pod:4603
13496 msgid "swapon-device"
13500 #: ../fish/guestfish-actions.pod:4605
13503 " swapon-device device\n"
13508 #: ../fish/guestfish-actions.pod:4607
13510 "This command enables the libguestfs appliance to use the swap device or "
13511 "partition named C<device>. The increased memory is made available for all "
13512 "commands, for example those run using L</command> or L</sh>."
13516 #: ../fish/guestfish-actions.pod:4612 ../src/guestfs-actions.pod:6922
13518 "Note that you should not swap to existing guest swap partitions unless you "
13519 "know what you are doing. They may contain hibernation information, or other "
13520 "information that the guest doesn't want you to trash. You also risk leaking "
13521 "information about the host to the guest this way. Instead, attach a new "
13522 "host device to the guest and swap on that."
13526 #: ../fish/guestfish-actions.pod:4619
13527 msgid "swapon-file"
13531 #: ../fish/guestfish-actions.pod:4621
13534 " swapon-file file\n"
13539 #: ../fish/guestfish-actions.pod:4623
13540 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
13544 #: ../fish/guestfish-actions.pod:4626
13545 msgid "swapon-label"
13549 #: ../fish/guestfish-actions.pod:4628
13552 " swapon-label label\n"
13557 #: ../fish/guestfish-actions.pod:4630
13559 "This command enables swap to a labeled swap partition. See "
13560 "L</swapon-device> for other notes."
13564 #: ../fish/guestfish-actions.pod:4633
13565 msgid "swapon-uuid"
13569 #: ../fish/guestfish-actions.pod:4635
13572 " swapon-uuid uuid\n"
13577 #: ../fish/guestfish-actions.pod:4637
13579 "This command enables swap to a swap partition with the given UUID. See "
13580 "L</swapon-device> for other notes."
13584 #: ../fish/guestfish-actions.pod:4640
13589 #: ../fish/guestfish-actions.pod:4642
13597 #: ../fish/guestfish-actions.pod:4644 ../src/guestfs-actions.pod:6977
13599 "This syncs the disk, so that any writes are flushed through to the "
13600 "underlying disk image."
13604 #: ../fish/guestfish-actions.pod:4647 ../src/guestfs-actions.pod:6980
13606 "You should always call this if you have modified a disk image, before "
13607 "closing the handle."
13611 #: ../fish/guestfish-actions.pod:4650
13616 #: ../fish/guestfish-actions.pod:4652
13624 #: ../fish/guestfish-actions.pod:4654 ../src/guestfs-actions.pod:6993
13625 msgid "This command returns up to the last 10 lines of a file as a list of strings."
13629 #: ../fish/guestfish-actions.pod:4660
13634 #: ../fish/guestfish-actions.pod:4662
13637 " tail-n nrlines path\n"
13642 #: ../fish/guestfish-actions.pod:4664 ../src/guestfs-actions.pod:7012
13644 "If the parameter C<nrlines> is a positive number, this returns the last "
13645 "C<nrlines> lines of the file C<path>."
13649 #: ../fish/guestfish-actions.pod:4667 ../src/guestfs-actions.pod:7015
13651 "If the parameter C<nrlines> is a negative number, this returns lines from "
13652 "the file C<path>, starting with the C<-nrlines>th line."
13656 #: ../fish/guestfish-actions.pod:4675
13661 #: ../fish/guestfish-actions.pod:4677
13664 " tar-in (tarfile|-) directory\n"
13669 #: ../fish/guestfish-actions.pod:4679 ../src/guestfs-actions.pod:7036
13671 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13672 "tar file) into C<directory>."
13676 #: ../fish/guestfish-actions.pod:4682
13677 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
13681 #: ../fish/guestfish-actions.pod:4687
13686 #: ../fish/guestfish-actions.pod:4689
13689 " tar-out directory (tarfile|-)\n"
13694 #: ../fish/guestfish-actions.pod:4691 ../src/guestfs-actions.pod:7053
13696 "This command packs the contents of C<directory> and downloads it to local "
13701 #: ../fish/guestfish-actions.pod:4694
13702 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
13706 #: ../fish/guestfish-actions.pod:4699
13711 #: ../fish/guestfish-actions.pod:4701
13714 " tgz-in (tarball|-) directory\n"
13719 #: ../fish/guestfish-actions.pod:4703 ../src/guestfs-actions.pod:7070
13721 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
13722 "tar file) into C<directory>."
13726 #: ../fish/guestfish-actions.pod:4706
13727 msgid "To upload an uncompressed tarball, use L</tar-in>."
13731 #: ../fish/guestfish-actions.pod:4710
13736 #: ../fish/guestfish-actions.pod:4712
13739 " tgz-out directory (tarball|-)\n"
13744 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7086
13746 "This command packs the contents of C<directory> and downloads it to local "
13751 #: ../fish/guestfish-actions.pod:4717
13752 msgid "To download an uncompressed tarball, use L</tar-out>."
13756 #: ../fish/guestfish-actions.pod:4721
13761 #: ../fish/guestfish-actions.pod:4723
13769 #: ../fish/guestfish-actions.pod:4725 ../src/guestfs-actions.pod:7101
13771 "Touch acts like the L<touch(1)> command. It can be used to update the "
13772 "timestamps on a file, or, if the file does not exist, to create a new "
13773 "zero-length file."
13777 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7105
13779 "This command only works on regular files, and will fail on other file types "
13780 "such as directories, symbolic links, block special etc."
13784 #: ../fish/guestfish-actions.pod:4732
13789 #: ../fish/guestfish-actions.pod:4734
13797 #: ../fish/guestfish-actions.pod:4736 ../src/guestfs-actions.pod:7118
13799 "This command truncates C<path> to a zero-length file. The file must exist "
13804 #: ../fish/guestfish-actions.pod:4739
13805 msgid "truncate-size"
13809 #: ../fish/guestfish-actions.pod:4741
13812 " truncate-size path size\n"
13817 #: ../fish/guestfish-actions.pod:4743 ../src/guestfs-actions.pod:7132
13819 "This command truncates C<path> to size C<size> bytes. The file must exist "
13824 #: ../fish/guestfish-actions.pod:4746
13826 "If the current file size is less than C<size> then the file is extended to "
13827 "the required size with zero bytes. This creates a sparse file (ie. disk "
13828 "blocks are not allocated for the file until you write to it). To create a "
13829 "non-sparse file of zeroes, use L</fallocate64> instead."
13833 #: ../fish/guestfish-actions.pod:4752
13838 #: ../fish/guestfish-actions.pod:4754
13841 " tune2fs-l device\n"
13846 #: ../fish/guestfish-actions.pod:4756 ../src/guestfs-actions.pod:7151
13848 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13853 #: ../fish/guestfish-actions.pod:4759 ../src/guestfs-actions.pod:7154
13855 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13856 "for more details. The list of fields returned isn't clearly defined, and "
13857 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13858 "and the filesystem itself."
13862 #: ../fish/guestfish-actions.pod:4764
13867 #: ../fish/guestfish-actions.pod:4766
13870 " txz-in (tarball|-) directory\n"
13875 #: ../fish/guestfish-actions.pod:4768 ../src/guestfs-actions.pod:7174
13877 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13878 "tar file) into C<directory>."
13882 #: ../fish/guestfish-actions.pod:4773
13887 #: ../fish/guestfish-actions.pod:4775
13890 " txz-out directory (tarball|-)\n"
13895 #: ../fish/guestfish-actions.pod:4777 ../src/guestfs-actions.pod:7188
13897 "This command packs the contents of C<directory> and downloads it to local "
13898 "file C<tarball> (as an xz compressed tar archive)."
13902 #: ../fish/guestfish-actions.pod:4782
13907 #: ../fish/guestfish-actions.pod:4784
13915 #: ../fish/guestfish-actions.pod:4786 ../src/guestfs-actions.pod:7201
13917 "This function sets the mask used for creating new files and device nodes to "
13922 #: ../fish/guestfish-actions.pod:4789 ../src/guestfs-actions.pod:7204
13924 "Typical umask values would be C<022> which creates new files with "
13925 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13926 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13930 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7209
13932 "The default umask is C<022>. This is important because it means that "
13933 "directories and device nodes will be created with C<0644> or C<0755> mode "
13934 "even if you specify C<0777>."
13938 #: ../fish/guestfish-actions.pod:4798
13939 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
13943 #: ../fish/guestfish-actions.pod:4801 ../src/guestfs-actions.pod:7216
13944 msgid "This call returns the previous umask."
13948 #: ../fish/guestfish-actions.pod:4803
13953 #: ../fish/guestfish-actions.pod:4805
13958 #: ../fish/guestfish-actions.pod:4807
13961 " umount pathordevice\n"
13966 #: ../fish/guestfish-actions.pod:4809 ../src/guestfs-actions.pod:7228
13968 "This unmounts the given filesystem. The filesystem may be specified either "
13969 "by its mountpoint (path) or the device which contains the filesystem."
13973 #: ../fish/guestfish-actions.pod:4813
13978 #: ../fish/guestfish-actions.pod:4815
13979 msgid "unmount-all"
13983 #: ../fish/guestfish-actions.pod:4817
13991 #: ../fish/guestfish-actions.pod:4819 ../src/guestfs-actions.pod:7241
13992 msgid "This unmounts all mounted filesystems."
13996 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7243
13997 msgid "Some internal mounts are not unmounted by this call."
14001 #: ../fish/guestfish-actions.pod:4823
14006 #: ../fish/guestfish-actions.pod:4825
14009 " upload (filename|-) remotefilename\n"
14014 #: ../fish/guestfish-actions.pod:4827 ../fish/guestfish-actions.pod:4840 ../src/guestfs-actions.pod:7256 ../src/guestfs-actions.pod:7280
14015 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14019 #: ../fish/guestfish-actions.pod:4832
14020 msgid "See also L</download>."
14024 #: ../fish/guestfish-actions.pod:4836
14025 msgid "upload-offset"
14029 #: ../fish/guestfish-actions.pod:4838
14032 " upload-offset (filename|-) remotefilename offset\n"
14037 #: ../fish/guestfish-actions.pod:4843 ../src/guestfs-actions.pod:7283
14039 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14040 "The intention is to overwrite parts of existing files or devices, although "
14041 "if a non-existant file is specified then it is created with a \"hole\" "
14042 "before C<offset>. The size of the data written is implicit in the size of "
14043 "the source C<filename>."
14047 #: ../fish/guestfish-actions.pod:4850
14049 "Note that there is no limit on the amount of data that can be uploaded with "
14050 "this call, unlike with L</pwrite>, and this call always writes the full "
14051 "amount unless an error occurs."
14055 #: ../fish/guestfish-actions.pod:4855
14056 msgid "See also L</upload>, L</pwrite>."
14060 #: ../fish/guestfish-actions.pod:4859
14065 #: ../fish/guestfish-actions.pod:4861
14068 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14073 #: ../fish/guestfish-actions.pod:4863 ../src/guestfs-actions.pod:7316
14074 msgid "This command sets the timestamps of a file with nanosecond precision."
14078 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7319
14080 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14085 #: ../fish/guestfish-actions.pod:4869 ../src/guestfs-actions.pod:7322
14087 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14088 "nanoseconds from the epoch."
14092 #: ../fish/guestfish-actions.pod:4872 ../src/guestfs-actions.pod:7325
14094 "If the C<*nsecs> field contains the special value C<-1> then the "
14095 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14096 "ignored in this case)."
14100 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7329
14102 "If the C<*nsecs> field contains the special value C<-2> then the "
14103 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14108 #: ../fish/guestfish-actions.pod:4880
14113 #: ../fish/guestfish-actions.pod:4882
14121 #: ../fish/guestfish-actions.pod:4884 ../src/guestfs-actions.pod:7342
14122 msgid "Return the libguestfs version number that the program is linked against."
14126 #: ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:7345
14128 "Note that because of dynamic linking this is not necessarily the version of "
14129 "libguestfs that you compiled against. You can compile the program, and then "
14130 "at runtime dynamically link against a completely different C<libguestfs.so> "
14135 #: ../fish/guestfish-actions.pod:4892 ../src/guestfs-actions.pod:7350
14137 "This call was added in version C<1.0.58>. In previous versions of "
14138 "libguestfs there was no way to get the version number. From C code you can "
14139 "use dynamic linker functions to find out if this symbol exists (if it "
14140 "doesn't, then it's an earlier version)."
14144 #: ../fish/guestfish-actions.pod:4898 ../src/guestfs-actions.pod:7356
14146 "The call returns a structure with four elements. The first three (C<major>, "
14147 "C<minor> and C<release>) are numbers and correspond to the usual version "
14148 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14149 "but may be used for distro-specific information."
14153 #: ../fish/guestfish-actions.pod:4904 ../src/guestfs-actions.pod:7362
14154 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
14158 #: ../fish/guestfish-actions.pod:4907 ../src/guestfs-actions.pod:7365
14159 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14163 #: ../fish/guestfish-actions.pod:4909
14165 "I<Note:> Don't use this call to test for availability of features. In "
14166 "enterprise distributions we backport features from later versions into "
14167 "earlier versions, making this an unreliable way to test for features. Use "
14168 "L</available> instead."
14172 #: ../fish/guestfish-actions.pod:4915
14177 #: ../fish/guestfish-actions.pod:4917
14180 " vfs-label device\n"
14185 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7385
14186 msgid "This returns the filesystem label of the filesystem on C<device>."
14190 #: ../fish/guestfish-actions.pod:4922 ../src/guestfs-actions.pod:7388
14191 msgid "If the filesystem is unlabeled, this returns the empty string."
14195 #: ../fish/guestfish-actions.pod:4924
14196 msgid "To find a filesystem from the label, use L</findfs-label>."
14200 #: ../fish/guestfish-actions.pod:4926
14205 #: ../fish/guestfish-actions.pod:4928
14208 " vfs-type device\n"
14213 #: ../fish/guestfish-actions.pod:4930 ../src/guestfs-actions.pod:7403
14215 "This command gets the filesystem type corresponding to the filesystem on "
14220 #: ../fish/guestfish-actions.pod:4933 ../src/guestfs-actions.pod:7406
14222 "For most filesystems, the result is the name of the Linux VFS module which "
14223 "would be used to mount this filesystem if you mounted it without specifying "
14224 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14228 #: ../fish/guestfish-actions.pod:4938
14233 #: ../fish/guestfish-actions.pod:4940
14236 " vfs-uuid device\n"
14241 #: ../fish/guestfish-actions.pod:4942 ../src/guestfs-actions.pod:7422
14242 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14246 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7425
14247 msgid "If the filesystem does not have a UUID, this returns the empty string."
14251 #: ../fish/guestfish-actions.pod:4947
14252 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
14256 #: ../fish/guestfish-actions.pod:4949
14257 msgid "vg-activate"
14261 #: ../fish/guestfish-actions.pod:4951
14264 " vg-activate true|false 'volgroups ...'\n"
14269 #: ../fish/guestfish-actions.pod:4953 ../src/guestfs-actions.pod:7441
14271 "This command activates or (if C<activate> is false) deactivates all logical "
14272 "volumes in the listed volume groups C<volgroups>."
14276 #: ../fish/guestfish-actions.pod:4956 ../src/guestfs-actions.pod:7444
14277 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14281 #: ../fish/guestfish-actions.pod:4958 ../src/guestfs-actions.pod:7446
14283 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14284 "activated or deactivated."
14288 #: ../fish/guestfish-actions.pod:4961
14289 msgid "vg-activate-all"
14293 #: ../fish/guestfish-actions.pod:4963
14296 " vg-activate-all true|false\n"
14301 #: ../fish/guestfish-actions.pod:4965 ../src/guestfs-actions.pod:7459
14303 "This command activates or (if C<activate> is false) deactivates all logical "
14304 "volumes in all volume groups."
14308 #: ../fish/guestfish-actions.pod:4968 ../src/guestfs-actions.pod:7462
14309 msgid "This command is the same as running C<vgchange -a y|n>"
14313 #: ../fish/guestfish-actions.pod:4970
14318 #: ../fish/guestfish-actions.pod:4972
14321 " vgcreate volgroup 'physvols ...'\n"
14326 #: ../fish/guestfish-actions.pod:4974 ../src/guestfs-actions.pod:7475
14328 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14329 "of physical volumes C<physvols>."
14333 #: ../fish/guestfish-actions.pod:4977
14338 #: ../fish/guestfish-actions.pod:4979
14341 " vglvuuids vgname\n"
14346 #: ../fish/guestfish-actions.pod:4981 ../src/guestfs-actions.pod:7488
14348 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14349 "volumes created in this volume group."
14353 #: ../fish/guestfish-actions.pod:4984
14355 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
14356 "logical volumes and volume groups."
14360 #: ../fish/guestfish-actions.pod:4987
14361 msgid "See also L</vgpvuuids>."
14365 #: ../fish/guestfish-actions.pod:4989
14370 #: ../fish/guestfish-actions.pod:4991
14373 " vgpvuuids vgname\n"
14378 #: ../fish/guestfish-actions.pod:4993 ../src/guestfs-actions.pod:7508
14380 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14381 "volumes that this volume group resides on."
14385 #: ../fish/guestfish-actions.pod:4996
14387 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
14388 "physical volumes and volume groups."
14392 #: ../fish/guestfish-actions.pod:4999
14393 msgid "See also L</vglvuuids>."
14397 #: ../fish/guestfish-actions.pod:5001
14402 #: ../fish/guestfish-actions.pod:5003
14405 " vgremove vgname\n"
14410 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7528
14411 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14415 #: ../fish/guestfish-actions.pod:5007 ../src/guestfs-actions.pod:7530
14416 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
14420 #: ../fish/guestfish-actions.pod:5010
14425 #: ../fish/guestfish-actions.pod:5012
14428 " vgrename volgroup newvolgroup\n"
14433 #: ../fish/guestfish-actions.pod:5014 ../src/guestfs-actions.pod:7544
14434 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14438 #: ../fish/guestfish-actions.pod:5016
14443 #: ../fish/guestfish-actions.pod:5018
14451 #: ../fish/guestfish-actions.pod:5020 ../src/guestfs-actions.pod:7555
14453 "List all the volumes groups detected. This is the equivalent of the "
14454 "L<vgs(8)> command."
14458 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7558
14460 "This returns a list of just the volume group names that were detected "
14461 "(eg. C<VolGroup00>)."
14465 #: ../fish/guestfish-actions.pod:5026
14466 msgid "See also L</vgs-full>."
14470 #: ../fish/guestfish-actions.pod:5028
14475 #: ../fish/guestfish-actions.pod:5030
14483 #: ../fish/guestfish-actions.pod:5032 ../src/guestfs-actions.pod:7574
14485 "List all the volumes groups detected. This is the equivalent of the "
14486 "L<vgs(8)> command. The \"full\" version includes all fields."
14490 #: ../fish/guestfish-actions.pod:5035
14495 #: ../fish/guestfish-actions.pod:5037
14503 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7588
14505 "This rescans all block devices and rebuilds the list of LVM physical "
14506 "volumes, volume groups and logical volumes."
14510 #: ../fish/guestfish-actions.pod:5042
14515 #: ../fish/guestfish-actions.pod:5044
14523 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7601
14524 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14528 #: ../fish/guestfish-actions.pod:5048
14533 #: ../fish/guestfish-actions.pod:5050
14541 #: ../fish/guestfish-actions.pod:5052 ../src/guestfs-actions.pod:7641
14543 "This command counts the characters in a file, using the C<wc -c> external "
14548 #: ../fish/guestfish-actions.pod:5055
14553 #: ../fish/guestfish-actions.pod:5057
14561 #: ../fish/guestfish-actions.pod:5059 ../src/guestfs-actions.pod:7654
14563 "This command counts the lines in a file, using the C<wc -l> external "
14568 #: ../fish/guestfish-actions.pod:5062
14573 #: ../fish/guestfish-actions.pod:5064
14581 #: ../fish/guestfish-actions.pod:5066 ../src/guestfs-actions.pod:7667
14583 "This command counts the words in a file, using the C<wc -w> external "
14588 #: ../fish/guestfish-actions.pod:5069
14593 #: ../fish/guestfish-actions.pod:5071
14596 " write path content\n"
14601 #: ../fish/guestfish-actions.pod:5073 ../src/guestfs-actions.pod:7682
14603 "This call creates a file called C<path>. The content of the file is the "
14604 "string C<content> (which can contain any 8 bit data)."
14608 #: ../fish/guestfish-actions.pod:5076
14609 msgid "See also L</write-append>."
14613 #: ../fish/guestfish-actions.pod:5081
14614 msgid "write-append"
14618 #: ../fish/guestfish-actions.pod:5083
14621 " write-append path content\n"
14626 #: ../fish/guestfish-actions.pod:5085 ../src/guestfs-actions.pod:7702
14628 "This call appends C<content> to the end of file C<path>. If C<path> does "
14629 "not exist, then a new file is created."
14633 #: ../fish/guestfish-actions.pod:5088
14634 msgid "See also L</write>."
14638 #: ../fish/guestfish-actions.pod:5093
14643 #: ../fish/guestfish-actions.pod:5095
14646 " write-file path content size\n"
14651 #: ../fish/guestfish-actions.pod:5097 ../src/guestfs-actions.pod:7722
14653 "This call creates a file called C<path>. The contents of the file is the "
14654 "string C<content> (which can contain any 8 bit data), with length C<size>."
14658 #: ../fish/guestfish-actions.pod:5101 ../src/guestfs-actions.pod:7726
14660 "As a special case, if C<size> is C<0> then the length is calculated using "
14661 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14665 #: ../fish/guestfish-actions.pod:5105 ../src/guestfs-actions.pod:7730
14667 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14668 "I<not> work, even if the length is specified."
14672 #: ../fish/guestfish-actions.pod:5111
14673 msgid "This function is deprecated. In new code, use the L</write> call instead."
14677 #: ../fish/guestfish-actions.pod:5118
14682 #: ../fish/guestfish-actions.pod:5120
14685 " zegrep regex path\n"
14690 #: ../fish/guestfish-actions.pod:5122 ../src/guestfs-actions.pod:7754
14691 msgid "This calls the external C<zegrep> program and returns the matching lines."
14695 #: ../fish/guestfish-actions.pod:5128
14700 #: ../fish/guestfish-actions.pod:5130
14703 " zegrepi regex path\n"
14708 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7773
14709 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
14713 #: ../fish/guestfish-actions.pod:5138
14718 #: ../fish/guestfish-actions.pod:5140
14726 #: ../fish/guestfish-actions.pod:5142 ../src/guestfs-actions.pod:7791
14727 msgid "This command writes zeroes over the first few blocks of C<device>."
14731 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7793
14733 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
14734 "securely wipe the device). It should be sufficient to remove any partition "
14735 "tables, filesystem superblocks and so on."
14739 #: ../fish/guestfish-actions.pod:5148 ../fish/guestfish-actions.pod:5163 ../src/guestfs-actions.pod:7797 ../src/guestfs-actions.pod:7823
14741 "If blocks are already zero, then this command avoids writing zeroes. This "
14742 "prevents the underlying device from becoming non-sparse or growing "
14747 #: ../fish/guestfish-actions.pod:5152
14748 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
14752 #: ../fish/guestfish-actions.pod:5155
14753 msgid "zero-device"
14757 #: ../fish/guestfish-actions.pod:5157
14760 " zero-device device\n"
14765 #: ../fish/guestfish-actions.pod:5159
14767 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
14768 "which just zeroes the first few blocks of a device."
14772 #: ../fish/guestfish-actions.pod:5170
14777 #: ../fish/guestfish-actions.pod:5172
14780 " zerofree device\n"
14785 #: ../fish/guestfish-actions.pod:5174 ../src/guestfs-actions.pod:7845
14787 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14788 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14789 "possible to compress the filesystem more effectively."
14793 #: ../fish/guestfish-actions.pod:5179 ../src/guestfs-actions.pod:7850
14794 msgid "You should B<not> run this program if the filesystem is mounted."
14798 #: ../fish/guestfish-actions.pod:5182 ../src/guestfs-actions.pod:7853
14800 "It is possible that using this program can damage the filesystem or data on "
14805 #: ../fish/guestfish-actions.pod:5185
14810 #: ../fish/guestfish-actions.pod:5187
14813 " zfgrep pattern path\n"
14818 #: ../fish/guestfish-actions.pod:5189 ../src/guestfs-actions.pod:7867
14819 msgid "This calls the external C<zfgrep> program and returns the matching lines."
14823 #: ../fish/guestfish-actions.pod:5195
14828 #: ../fish/guestfish-actions.pod:5197
14831 " zfgrepi pattern path\n"
14836 #: ../fish/guestfish-actions.pod:5199 ../src/guestfs-actions.pod:7886
14837 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
14841 #: ../fish/guestfish-actions.pod:5205
14846 #: ../fish/guestfish-actions.pod:5207
14849 " zfile meth path\n"
14854 #: ../fish/guestfish-actions.pod:5209 ../src/guestfs-actions.pod:7905
14855 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
14859 #: ../fish/guestfish-actions.pod:5212 ../src/guestfs-actions.pod:7908
14860 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
14864 #: ../fish/guestfish-actions.pod:5214
14865 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
14869 #: ../fish/guestfish-actions.pod:5217
14870 msgid "This function is deprecated. In new code, use the L</file> call instead."
14874 #: ../fish/guestfish-actions.pod:5224
14879 #: ../fish/guestfish-actions.pod:5226
14882 " zgrep regex path\n"
14887 #: ../fish/guestfish-actions.pod:5228 ../src/guestfs-actions.pod:7932
14888 msgid "This calls the external C<zgrep> program and returns the matching lines."
14892 #: ../fish/guestfish-actions.pod:5234
14897 #: ../fish/guestfish-actions.pod:5236
14900 " zgrepi regex path\n"
14905 #: ../fish/guestfish-actions.pod:5238 ../src/guestfs-actions.pod:7951
14906 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
14910 #: ../fish/guestfish-commands.pod:1
14915 #: ../fish/guestfish-commands.pod:3
14920 #: ../fish/guestfish-commands.pod:5
14923 " alloc filename size\n"
14928 #: ../fish/guestfish-commands.pod:7
14930 "This creates an empty (zeroed) file of the given size, and then adds so it "
14931 "can be further examined."
14935 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:182
14936 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
14940 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:184
14941 msgid "Size can be specified using standard suffixes, eg. C<1M>."
14945 #: ../fish/guestfish-commands.pod:14
14947 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
14948 "image, see L</PREPARED DISK IMAGES>."
14952 #: ../fish/guestfish-commands.pod:17
14957 #: ../fish/guestfish-commands.pod:19
14960 " copy-in local [local ...] /remotedir\n"
14965 #: ../fish/guestfish-commands.pod:21
14967 "C<copy-in> copies local files or directories recursively into the disk "
14968 "image, placing them in the directory called C</remotedir> (which must "
14969 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
14970 "other commands as necessary."
14974 #: ../fish/guestfish-commands.pod:26
14976 "Multiple local files and directories can be specified, but the last "
14977 "parameter must always be a remote directory. Wildcards cannot be used."
14981 #: ../fish/guestfish-commands.pod:30
14986 #: ../fish/guestfish-commands.pod:32
14989 " copy-out remote [remote ...] localdir\n"
14994 #: ../fish/guestfish-commands.pod:34
14996 "C<copy-out> copies remote files or directories recursively out of the disk "
14997 "image, placing them on the host disk in a local directory called C<localdir> "
14998 "(which must exist). This guestfish meta-command turns into a sequence of "
14999 "L</download>, L</tar-out> and other commands as necessary."
15003 #: ../fish/guestfish-commands.pod:40
15005 "Multiple remote files and directories can be specified, but the last "
15006 "parameter must always be a local directory. To download to the current "
15007 "directory, use C<.> as in:"
15011 #: ../fish/guestfish-commands.pod:44
15014 " copy-out /home .\n"
15019 #: ../fish/guestfish-commands.pod:46
15021 "Wildcards cannot be used in the ordinary command, but you can use them with "
15022 "the help of L</glob> like this:"
15026 #: ../fish/guestfish-commands.pod:49
15029 " glob copy-out /home/* .\n"
15034 #: ../fish/guestfish-commands.pod:51
15039 #: ../fish/guestfish-commands.pod:53
15042 " display filename\n"
15047 #: ../fish/guestfish-commands.pod:55
15049 "Use C<display> (a graphical display program) to display an image file. It "
15050 "downloads the file, and runs C<display> on it."
15054 #: ../fish/guestfish-commands.pod:58
15056 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15057 "environment variable. For example to use the GNOME display program:"
15061 #: ../fish/guestfish-commands.pod:61
15064 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15069 #: ../fish/guestfish-commands.pod:63
15070 msgid "See also L<display(1)>."
15074 #: ../fish/guestfish-commands.pod:65
15079 #: ../fish/guestfish-commands.pod:67
15082 " echo [params ...]\n"
15087 #: ../fish/guestfish-commands.pod:69
15088 msgid "This echos the parameters to the terminal."
15092 #: ../fish/guestfish-commands.pod:71
15097 #: ../fish/guestfish-commands.pod:73
15102 #: ../fish/guestfish-commands.pod:75
15107 #: ../fish/guestfish-commands.pod:77
15115 #: ../fish/guestfish-commands.pod:79
15117 "This is used to edit a file. It downloads the file, edits it locally using "
15118 "your editor, then uploads the result."
15122 #: ../fish/guestfish-commands.pod:82
15124 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
15125 "or C<emacs> you will get those corresponding editors."
15129 #: ../fish/guestfish-commands.pod:86
15134 #: ../fish/guestfish-commands.pod:88
15137 " glob command args...\n"
15142 #: ../fish/guestfish-commands.pod:90
15144 "Expand wildcards in any paths in the args list, and run C<command> "
15145 "repeatedly on each matching path."
15149 #: ../fish/guestfish-commands.pod:93
15150 msgid "See L</WILDCARDS AND GLOBBING>."
15154 #: ../fish/guestfish-commands.pod:95
15159 #: ../fish/guestfish-commands.pod:97
15162 " hexedit <filename|device>\n"
15163 " hexedit <filename|device> <max>\n"
15164 " hexedit <filename|device> <start> <max>\n"
15169 #: ../fish/guestfish-commands.pod:101
15171 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
15176 #: ../fish/guestfish-commands.pod:104
15178 "This command works by downloading potentially the whole file or device, "
15179 "editing it locally, then uploading it. If the file or device is large, you "
15180 "have to specify which part you wish to edit by using C<max> and/or C<start> "
15181 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
15182 "usual modifiers allowed such as C<1M> (1 megabyte)."
15186 #: ../fish/guestfish-commands.pod:111
15187 msgid "For example to edit the first few sectors of a disk you might do:"
15191 #: ../fish/guestfish-commands.pod:114
15194 " hexedit /dev/sda 1M\n"
15199 #: ../fish/guestfish-commands.pod:116
15201 "which would allow you to edit anywhere within the first megabyte of the "
15206 #: ../fish/guestfish-commands.pod:119
15207 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
15211 #: ../fish/guestfish-commands.pod:121
15214 " hexedit /dev/sda1 0x400 0x400\n"
15219 #: ../fish/guestfish-commands.pod:123
15220 msgid "(assuming the superblock is in the standard location)."
15224 #: ../fish/guestfish-commands.pod:125
15226 "This command requires the external L<hexedit(1)> program. You can specify "
15227 "another program to use by setting the C<HEXEDITOR> environment variable."
15231 #: ../fish/guestfish-commands.pod:129
15232 msgid "See also L</hexdump>."
15236 #: ../fish/guestfish-commands.pod:131
15241 #: ../fish/guestfish-commands.pod:133
15249 #: ../fish/guestfish-commands.pod:135
15250 msgid "Change the local directory, ie. the current directory of guestfish itself."
15254 #: ../fish/guestfish-commands.pod:138
15255 msgid "Note that C<!cd> won't do what you might expect."
15259 #: ../fish/guestfish-commands.pod:140
15264 #: ../fish/guestfish-commands.pod:142
15269 #: ../fish/guestfish-commands.pod:144
15277 #: ../fish/guestfish-commands.pod:146
15278 msgid "Opens the manual page for guestfish."
15282 #: ../fish/guestfish-commands.pod:148
15287 #: ../fish/guestfish-commands.pod:150
15292 #: ../fish/guestfish-commands.pod:152
15300 #: ../fish/guestfish-commands.pod:154
15308 #: ../fish/guestfish-commands.pod:156
15309 msgid "This is used to view a file."
15313 #: ../fish/guestfish-commands.pod:158
15315 "The default viewer is C<$PAGER>. However if you use the alternate command "
15316 "C<less> you will get the C<less> command specifically."
15320 #: ../fish/guestfish-commands.pod:161
15325 #: ../fish/guestfish-commands.pod:163
15333 #: ../fish/guestfish-commands.pod:165
15335 "Close and reopen the libguestfs handle. It is not necessary to use this "
15336 "normally, because the handle is closed properly when guestfish exits. "
15337 "However this is occasionally useful for testing."
15341 #: ../fish/guestfish-commands.pod:169
15346 #: ../fish/guestfish-commands.pod:171
15349 " sparse filename size\n"
15354 #: ../fish/guestfish-commands.pod:173
15356 "This creates an empty sparse file of the given size, and then adds so it can "
15357 "be further examined."
15361 #: ../fish/guestfish-commands.pod:176
15363 "In all respects it works the same as the L</alloc> command, except that the "
15364 "image file is allocated sparsely, which means that disk blocks are not "
15365 "assigned to the file until they are needed. Sparse disk files only use "
15366 "space when written to, but they are slower and there is a danger you could "
15367 "run out of real disk space during a write operation."
15371 #: ../fish/guestfish-commands.pod:186
15376 #: ../fish/guestfish-commands.pod:188
15384 #: ../fish/guestfish-commands.pod:190
15386 "This command returns a list of the optional groups known to the daemon, and "
15387 "indicates which ones are supported by this build of the libguestfs "
15392 #: ../fish/guestfish-commands.pod:194
15393 msgid "See also L<guestfs(3)/AVAILABILITY>."
15397 #: ../fish/guestfish-commands.pod:196
15402 #: ../fish/guestfish-commands.pod:198
15405 " time command args...\n"
15410 #: ../fish/guestfish-commands.pod:200
15412 "Run the command as usual, but print the elapsed time afterwards. This can "
15413 "be useful for benchmarking operations."
15417 #: ../fish/guestfish.pod:5
15418 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15422 #: ../fish/guestfish.pod:9
15425 " guestfish [--options] [commands]\n"
15430 #: ../fish/guestfish.pod:11
15438 #: ../fish/guestfish.pod:13
15441 " guestfish [--ro|--rw] -a disk.img\n"
15446 #: ../fish/guestfish.pod:15
15449 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
15454 #: ../fish/guestfish.pod:17
15457 " guestfish -d libvirt-domain\n"
15462 #: ../fish/guestfish.pod:19
15465 " guestfish [--ro|--rw] -a disk.img -i\n"
15470 #: ../fish/guestfish.pod:21
15473 " guestfish -d libvirt-domain -i\n"
15478 #: ../fish/guestfish.pod:25
15480 "Using guestfish in read/write mode on live virtual machines can be "
15481 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15482 "option to use guestfish safely if the disk image or virtual machine might be "
15487 #: ../fish/guestfish.pod:32
15489 "Guestfish is a shell and command-line tool for examining and modifying "
15490 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15491 "functionality of the guestfs API, see L<guestfs(3)>."
15495 #: ../fish/guestfish.pod:36
15497 "Guestfish gives you structured access to the libguestfs API, from shell "
15498 "scripts or the command line or interactively. If you want to rescue a "
15499 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15504 #: ../fish/guestfish.pod:43
15505 msgid "As an interactive shell"
15509 #: ../fish/guestfish.pod:45
15517 #: ../fish/guestfish.pod:47
15520 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15521 " editing virtual machine filesystems.\n"
15526 #: ../fish/guestfish.pod:50
15529 " Type: 'help' for a list of commands\n"
15530 " 'man' to read the manual\n"
15531 " 'quit' to quit the shell\n"
15536 #: ../fish/guestfish.pod:54
15539 " ><fs> add-ro disk.img\n"
15541 " ><fs> list-filesystems\n"
15542 " /dev/sda1: ext4\n"
15543 " /dev/vg_guest/lv_root: ext4\n"
15544 " /dev/vg_guest/lv_swap: swap\n"
15545 " ><fs> mount /dev/vg_guest/lv_root /\n"
15546 " ><fs> cat /etc/fstab\n"
15548 " # Created by anaconda\n"
15555 #: ../fish/guestfish.pod:67
15556 msgid "From shell scripts"
15560 #: ../fish/guestfish.pod:69
15561 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15565 #: ../fish/guestfish.pod:71
15568 " guestfish <<_EOF_\n"
15571 " mount /dev/vg_guest/lv_root /\n"
15572 " write /etc/motd \"Welcome, new users\"\n"
15578 #: ../fish/guestfish.pod:78
15579 msgid "List the LVM logical volumes in a disk image:"
15583 #: ../fish/guestfish.pod:80
15586 " guestfish -a disk.img --ro <<_EOF_\n"
15594 #: ../fish/guestfish.pod:85
15595 msgid "List all the filesystems in a disk image:"
15599 #: ../fish/guestfish.pod:87
15602 " guestfish -a disk.img --ro <<_EOF_\n"
15604 " list-filesystems\n"
15610 #: ../fish/guestfish.pod:92
15611 msgid "On one command line"
15615 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
15616 msgid "Update C</etc/resolv.conf> in a guest:"
15620 #: ../fish/guestfish.pod:96
15624 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15625 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15630 #: ../fish/guestfish.pod:100
15631 msgid "Edit C</boot/grub/grub.conf> interactively:"
15635 #: ../fish/guestfish.pod:102
15638 " guestfish --rw --add disk.img \\\n"
15639 " --mount /dev/vg_guest/lv_root \\\n"
15640 " --mount /dev/sda1:/boot \\\n"
15641 " edit /boot/grub/grub.conf\n"
15646 #: ../fish/guestfish.pod:107
15647 msgid "Mount disks automatically"
15651 #: ../fish/guestfish.pod:109
15653 "Use the I<-i> option to automatically mount the disks from a virtual "
15658 #: ../fish/guestfish.pod:112
15661 " guestfish --ro -a disk.img -i cat /etc/group\n"
15666 #: ../fish/guestfish.pod:114
15669 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15674 #: ../fish/guestfish.pod:116
15675 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
15679 #: ../fish/guestfish.pod:118
15682 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
15687 #: ../fish/guestfish.pod:120
15688 msgid "As a script interpreter"
15692 #: ../fish/guestfish.pod:122
15693 msgid "Create a 100MB disk containing an ext2-formatted partition:"
15697 #: ../fish/guestfish.pod:124
15700 " #!/usr/bin/guestfish -f\n"
15701 " sparse test1.img 100M\n"
15703 " part-disk /dev/sda mbr\n"
15704 " mkfs ext2 /dev/sda1\n"
15709 #: ../fish/guestfish.pod:130
15710 msgid "Start with a prepared disk"
15714 #: ../fish/guestfish.pod:132
15716 "An alternate way to create a 100MB disk called C<test1.img> containing a "
15717 "single ext2-formatted partition:"
15721 #: ../fish/guestfish.pod:135
15724 " guestfish -N fs\n"
15729 #: ../fish/guestfish.pod:137
15730 msgid "To list what is available do:"
15734 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1009
15737 " guestfish -N help | less\n"
15742 #: ../fish/guestfish.pod:141
15743 msgid "Remote control"
15747 #: ../fish/guestfish.pod:143
15750 " eval \"`guestfish --listen`\"\n"
15751 " guestfish --remote add-ro disk.img\n"
15752 " guestfish --remote run\n"
15753 " guestfish --remote lvs\n"
15758 #: ../fish/guestfish.pod:154
15759 msgid "Displays general help on options."
15763 #: ../fish/guestfish.pod:158
15764 msgid "B<--cmd-help>"
15768 #: ../fish/guestfish.pod:160
15769 msgid "Lists all available guestfish commands."
15773 #: ../fish/guestfish.pod:162
15778 #: ../fish/guestfish.pod:164
15779 msgid "B<--cmd-help cmd>"
15783 #: ../fish/guestfish.pod:166
15784 msgid "Displays detailed help on a single command C<cmd>."
15788 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
15789 msgid "B<-a image>"
15793 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
15794 msgid "B<--add image>"
15798 #: ../fish/guestfish.pod:172
15799 msgid "Add a block device or virtual machine image to the shell."
15803 #: ../fish/guestfish.pod:177
15805 "Using this flag is mostly equivalent to using the C<add> command, with "
15806 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
15807 "the I<--format=...> flag was given."
15811 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
15813 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15814 "URI to use. The default is to use the default libvirt connection."
15818 #: ../fish/guestfish.pod:189
15823 #: ../fish/guestfish.pod:191
15825 "If using the I<--listen> option and a csh-like shell, use this option. See "
15826 "section L</REMOTE CONTROL AND CSH> below."
15830 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
15831 msgid "B<-d libvirt-domain>"
15835 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
15836 msgid "B<--domain libvirt-domain>"
15840 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
15842 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15843 "used, then any libvirt domain can be used. However in write mode, only "
15844 "libvirt domains which are shut down can be named here."
15848 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
15849 msgid "Domain UUIDs can be used instead of names."
15853 #: ../fish/guestfish.pod:204
15855 "Using this flag is mostly equivalent to using the C<add-domain> command, "
15856 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
15857 "if the I<--format:...> flag was given."
15861 #: ../fish/guestfish.pod:208
15866 #: ../fish/guestfish.pod:210
15867 msgid "B<--no-dest-paths>"
15871 #: ../fish/guestfish.pod:212
15873 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15874 "to hit the tab key to complete paths on the guest filesystem, but this "
15875 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15876 "allow this feature to be disabled."
15880 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
15882 "When prompting for keys and passphrases, guestfish normally turns echoing "
15883 "off so you cannot see what you are typing. If you are not worried about "
15884 "Tempest attacks and there is no one else in the room you can specify this "
15885 "flag to see what you are typing."
15889 #: ../fish/guestfish.pod:224
15894 #: ../fish/guestfish.pod:226
15895 msgid "B<--file file>"
15899 #: ../fish/guestfish.pod:228
15900 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15904 #: ../fish/guestfish.pod:231
15907 " #!/usr/bin/guestfish -f\n"
15912 #: ../fish/guestfish.pod:244
15915 " guestfish --format=raw -a disk.img\n"
15920 #: ../fish/guestfish.pod:248
15923 " guestfish --format=raw -a disk.img --format -a another.img\n"
15928 #: ../fish/guestfish.pod:253
15930 "If you have untrusted raw-format guest disk images, you should use this "
15931 "option to specify the disk format. This avoids a possible security problem "
15932 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15936 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
15937 msgid "B<--inspector>"
15941 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
15943 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15944 "system and mount filesystems as they would be mounted on the real virtual "
15949 #: ../fish/guestfish.pod:266
15950 msgid "Typical usage is either:"
15954 #: ../fish/guestfish.pod:268
15957 " guestfish -d myguest -i\n"
15962 #: ../fish/guestfish.pod:270
15963 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15967 #: ../fish/guestfish.pod:272
15970 " guestfish --ro -d myguest -i\n"
15975 #: ../fish/guestfish.pod:274
15976 msgid "(for active domains, readonly), or specify the block device directly:"
15980 #: ../fish/guestfish.pod:276
15983 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
15988 #: ../fish/guestfish.pod:278
15990 "Note that the command line syntax changed slightly over older versions of "
15991 "guestfish. You can still use the old syntax:"
15995 #: ../fish/guestfish.pod:281
15998 " guestfish [--ro] -i disk.img\n"
16003 #: ../fish/guestfish.pod:283
16006 " guestfish [--ro] -i libvirt-domain\n"
16011 #: ../fish/guestfish.pod:285
16013 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
16014 "then using other commands to mount the filesystems that were found."
16018 #: ../fish/guestfish.pod:294
16019 msgid "B<--listen>"
16023 #: ../fish/guestfish.pod:296
16025 "Fork into the background and listen for remote commands. See section "
16026 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16030 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
16035 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
16037 "Connect to a live virtual machine. (Experimental, see "
16038 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
16042 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
16043 msgid "B<-m dev[:mountpoint[:options]]>"
16047 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
16048 msgid "B<--mount dev[:mountpoint[:options]]>"
16052 #: ../fish/guestfish.pod:308
16053 msgid "Mount the named partition or logical volume on the given mountpoint."
16057 #: ../fish/guestfish.pod:310
16058 msgid "If the mountpoint is omitted, it defaults to C</>."
16062 #: ../fish/guestfish.pod:312
16063 msgid "You have to mount something on C</> before most commands will work."
16067 #: ../fish/guestfish.pod:314
16069 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16074 #: ../fish/guestfish.pod:317
16076 "If you don't know what filesystems a disk image contains, you can either run "
16077 "guestfish without this option, then list the partitions, filesystems and LVs "
16078 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
16079 "commands), or you can use the L<virt-filesystems(1)> program."
16083 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
16085 "The third (and rarely used) part of the mount parameter is the list of mount "
16086 "options used to mount the underlying filesystem. If this is not given, then "
16087 "the mount options are either the empty string or C<ro> (the latter if the "
16088 "I<--ro> flag is used). By specifying the mount options, you override this "
16089 "default choice. Probably the only time you would use this is to enable ACLs "
16090 "and/or extended attributes if the filesystem can support them:"
16094 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
16097 " -m /dev/sda1:/:acl,user_xattr\n"
16102 #: ../fish/guestfish.pod:333
16103 msgid "Using this flag is equivalent to using the C<mount-options> command."
16107 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193 ../resize/virt-resize.pod:358
16112 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
16113 msgid "B<--no-sync>"
16117 #: ../fish/guestfish.pod:339
16119 "Disable autosync. This is enabled by default. See the discussion of "
16120 "autosync in the L<guestfs(3)> manpage."
16124 #: ../fish/guestfish.pod:342
16129 #: ../fish/guestfish.pod:344
16130 msgid "B<--new type>"
16134 #: ../fish/guestfish.pod:346
16139 #: ../fish/guestfish.pod:348
16141 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16142 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16143 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16148 #: ../fish/guestfish.pod:353
16149 msgid "B<--progress-bars>"
16153 #: ../fish/guestfish.pod:355
16154 msgid "Enable progress bars, even when guestfish is used non-interactively."
16158 #: ../fish/guestfish.pod:357
16160 "Progress bars are enabled by default when guestfish is used as an "
16161 "interactive shell."
16165 #: ../fish/guestfish.pod:360
16166 msgid "B<--no-progress-bars>"
16170 #: ../fish/guestfish.pod:362
16171 msgid "Disable progress bars."
16175 #: ../fish/guestfish.pod:364
16176 msgid "B<--remote[=pid]>"
16180 #: ../fish/guestfish.pod:366
16182 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16183 "CONTROL GUESTFISH OVER A SOCKET> below."
16187 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239 ../rescue/virt-rescue.pod:161
16192 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241 ../rescue/virt-rescue.pod:163
16197 #: ../fish/guestfish.pod:373
16199 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16200 "mounts are done read-only."
16204 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
16206 "The option must always be used if the disk image or virtual machine might be "
16207 "running, and is generally recommended in cases where you don't need write "
16208 "access to the disk."
16212 #: ../fish/guestfish.pod:380
16214 "Note that prepared disk images created with I<-N> are not affected by this "
16215 "option. Also commands like C<add> are not affected - you have to specify "
16216 "the C<readonly:true> option explicitly if you need it."
16220 #: ../fish/guestfish.pod:384
16221 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16225 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253 ../rescue/virt-rescue.pod:173
16226 msgid "B<--selinux>"
16230 #: ../fish/guestfish.pod:388
16231 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16235 #: ../fish/guestfish.pod:394
16237 "Enable very verbose messages. This is particularly useful if you find a "
16242 #: ../fish/guestfish.pod:401
16243 msgid "Display the guestfish / libguestfs version number and exit."
16247 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269 ../rescue/virt-rescue.pod:190
16252 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271 ../rescue/virt-rescue.pod:192
16257 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
16259 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16260 "mounts are done read-write."
16264 #: ../fish/guestfish.pod:410
16265 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
16269 #: ../fish/guestfish.pod:414
16270 msgid "Echo each command before executing it."
16274 #: ../fish/guestfish.pod:418
16275 msgid "COMMANDS ON COMMAND LINE"
16279 #: ../fish/guestfish.pod:420
16280 msgid "Any additional (non-option) arguments are treated as commands to execute."
16284 #: ../fish/guestfish.pod:423
16286 "Commands to execute should be separated by a colon (C<:>), where the colon "
16287 "is a separate parameter. Thus:"
16291 #: ../fish/guestfish.pod:426
16294 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16299 #: ../fish/guestfish.pod:428
16301 "If there are no additional arguments, then we enter a shell, either an "
16302 "interactive shell with a prompt (if the input is a terminal) or a "
16303 "non-interactive shell."
16307 #: ../fish/guestfish.pod:432
16309 "In either command line mode or non-interactive shell, the first command that "
16310 "gives an error causes the whole shell to exit. In interactive mode (with a "
16311 "prompt) if a command fails, you can continue to enter commands."
16315 #: ../fish/guestfish.pod:437
16316 msgid "USING launch (OR run)"
16320 #: ../fish/guestfish.pod:439
16322 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16323 "then launch it, then mount any disks you need, and finally issue "
16324 "actions/commands. So the general order of the day is:"
16328 #: ../fish/guestfish.pod:447
16329 msgid "add or -a/--add"
16333 #: ../fish/guestfish.pod:451
16334 msgid "launch (aka run)"
16338 #: ../fish/guestfish.pod:455
16339 msgid "mount or -m/--mount"
16343 #: ../fish/guestfish.pod:459
16344 msgid "any other commands"
16348 #: ../fish/guestfish.pod:463
16350 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16351 "guest before mounting or performing any other commands."
16355 #: ../fish/guestfish.pod:466
16357 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16358 "I<--new> options were given then C<run> is done automatically, simply "
16359 "because guestfish can't perform the action you asked for without doing this."
16363 #: ../fish/guestfish.pod:471
16364 msgid "OPENING DISKS FOR READ AND WRITE"
16368 #: ../fish/guestfish.pod:473
16370 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
16371 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
16372 "I<-i> and I<-m> open disk images read-only or for writing."
16376 #: ../fish/guestfish.pod:478
16378 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
16379 "opening disk images supplied on the command line for write. To open a disk "
16380 "image read-only you have to do I<-a image --ro>."
16384 #: ../fish/guestfish.pod:482
16386 "This matters: If you accidentally open a live VM disk image writable then "
16387 "you will cause irreversible disk corruption."
16391 #: ../fish/guestfish.pod:485
16393 "In a future libguestfs we intend to change the default the other way. Disk "
16394 "images will be opened read-only. You will have to either specify "
16395 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
16396 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
16397 "access for disk images specified by those other command line options."
16401 #: ../fish/guestfish.pod:492
16403 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
16404 "which does nothing (it is already the default). However it is highly "
16405 "recommended that you use this option to indicate that you need write access, "
16406 "and prepare your scripts for the day when this option will be required for "
16411 #: ../fish/guestfish.pod:498
16413 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
16414 "other libguestfs program apart from guestfish and guestmount."
16418 #: ../fish/guestfish.pod:501
16423 #: ../fish/guestfish.pod:503
16425 "You can quote ordinary parameters using either single or double quotes. For "
16430 #: ../fish/guestfish.pod:506
16433 " add \"file with a space.img\"\n"
16438 #: ../fish/guestfish.pod:508
16441 " rm '/file name'\n"
16446 #: ../fish/guestfish.pod:510
16454 #: ../fish/guestfish.pod:512
16456 "A few commands require a list of strings to be passed. For these, use a "
16457 "whitespace-separated list, enclosed in quotes. Strings containing "
16458 "whitespace to be passed through must be enclosed in single quotes. A "
16459 "literal single quote must be escaped with a backslash."
16463 #: ../fish/guestfish.pod:517
16466 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16467 " command \"/bin/echo 'foo bar'\"\n"
16468 " command \"/bin/echo \\'foo\\'\"\n"
16473 #: ../fish/guestfish.pod:521
16474 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
16478 #: ../fish/guestfish.pod:523
16480 "In double-quoted arguments (only) use backslash to insert special "
16485 #: ../fish/guestfish.pod:528
16490 #: ../fish/guestfish.pod:530
16491 msgid "Alert (bell) character."
16495 #: ../fish/guestfish.pod:532
16500 #: ../fish/guestfish.pod:534
16501 msgid "Backspace character."
16505 #: ../fish/guestfish.pod:536
16510 #: ../fish/guestfish.pod:538
16511 msgid "Form feed character."
16515 #: ../fish/guestfish.pod:540
16520 #: ../fish/guestfish.pod:542
16521 msgid "Newline character."
16525 #: ../fish/guestfish.pod:544
16530 #: ../fish/guestfish.pod:546
16531 msgid "Carriage return character."
16535 #: ../fish/guestfish.pod:548
16540 #: ../fish/guestfish.pod:550
16541 msgid "Horizontal tab character."
16545 #: ../fish/guestfish.pod:552
16550 #: ../fish/guestfish.pod:554
16551 msgid "Vertical tab character."
16555 #: ../fish/guestfish.pod:556
16560 #: ../fish/guestfish.pod:558
16561 msgid "A literal double quote character."
16565 #: ../fish/guestfish.pod:560
16570 #: ../fish/guestfish.pod:562
16572 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
16577 #: ../fish/guestfish.pod:565
16582 #: ../fish/guestfish.pod:567
16583 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
16587 #: ../fish/guestfish.pod:570
16589 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
16594 #: ../fish/guestfish.pod:573
16599 #: ../fish/guestfish.pod:575
16600 msgid "A literal backslash character."
16604 #: ../fish/guestfish.pod:579
16605 msgid "OPTIONAL ARGUMENTS"
16609 #: ../fish/guestfish.pod:581
16611 "Some commands take optional arguments. These arguments appear in this "
16612 "documentation as C<[argname:..]>. You can use them as in these examples:"
16616 #: ../fish/guestfish.pod:585
16619 " add-drive-opts filename\n"
16624 #: ../fish/guestfish.pod:587
16627 " add-drive-opts filename readonly:true\n"
16632 #: ../fish/guestfish.pod:589
16635 " add-drive-opts filename format:qcow2 readonly:false\n"
16640 #: ../fish/guestfish.pod:591
16642 "Each optional argument can appear at most once. All optional arguments must "
16643 "appear after the required ones."
16647 #: ../fish/guestfish.pod:594
16652 #: ../fish/guestfish.pod:596
16653 msgid "This section applies to all commands which can take integers as parameters."
16657 #: ../fish/guestfish.pod:599
16658 msgid "SIZE SUFFIX"
16662 #: ../fish/guestfish.pod:601
16664 "When the command takes a parameter measured in bytes, you can use one of the "
16665 "following suffixes to specify kilobytes, megabytes and larger sizes:"
16669 #: ../fish/guestfish.pod:607
16670 msgid "B<k> or B<K> or B<KiB>"
16674 #: ../fish/guestfish.pod:609
16675 msgid "The size in kilobytes (multiplied by 1024)."
16679 #: ../fish/guestfish.pod:611
16684 #: ../fish/guestfish.pod:613
16685 msgid "The size in SI 1000 byte units."
16689 #: ../fish/guestfish.pod:615
16690 msgid "B<M> or B<MiB>"
16694 #: ../fish/guestfish.pod:617
16695 msgid "The size in megabytes (multiplied by 1048576)."
16699 #: ../fish/guestfish.pod:619
16704 #: ../fish/guestfish.pod:621
16705 msgid "The size in SI 1000000 byte units."
16709 #: ../fish/guestfish.pod:623
16710 msgid "B<G> or B<GiB>"
16714 #: ../fish/guestfish.pod:625
16715 msgid "The size in gigabytes (multiplied by 2**30)."
16719 #: ../fish/guestfish.pod:627
16724 #: ../fish/guestfish.pod:629
16725 msgid "The size in SI 10**9 byte units."
16729 #: ../fish/guestfish.pod:631
16730 msgid "B<T> or B<TiB>"
16734 #: ../fish/guestfish.pod:633
16735 msgid "The size in terabytes (multiplied by 2**40)."
16739 #: ../fish/guestfish.pod:635
16744 #: ../fish/guestfish.pod:637
16745 msgid "The size in SI 10**12 byte units."
16749 #: ../fish/guestfish.pod:639
16750 msgid "B<P> or B<PiB>"
16754 #: ../fish/guestfish.pod:641
16755 msgid "The size in petabytes (multiplied by 2**50)."
16759 #: ../fish/guestfish.pod:643
16764 #: ../fish/guestfish.pod:645
16765 msgid "The size in SI 10**15 byte units."
16769 #: ../fish/guestfish.pod:647
16770 msgid "B<E> or B<EiB>"
16774 #: ../fish/guestfish.pod:649
16775 msgid "The size in exabytes (multiplied by 2**60)."
16779 #: ../fish/guestfish.pod:651
16784 #: ../fish/guestfish.pod:653
16785 msgid "The size in SI 10**18 byte units."
16789 #: ../fish/guestfish.pod:655
16790 msgid "B<Z> or B<ZiB>"
16794 #: ../fish/guestfish.pod:657
16795 msgid "The size in zettabytes (multiplied by 2**70)."
16799 #: ../fish/guestfish.pod:659
16804 #: ../fish/guestfish.pod:661
16805 msgid "The size in SI 10**21 byte units."
16809 #: ../fish/guestfish.pod:663
16810 msgid "B<Y> or B<YiB>"
16814 #: ../fish/guestfish.pod:665
16815 msgid "The size in yottabytes (multiplied by 2**80)."
16819 #: ../fish/guestfish.pod:667
16824 #: ../fish/guestfish.pod:669
16825 msgid "The size in SI 10**24 byte units."
16829 #: ../fish/guestfish.pod:675
16832 " truncate-size /file 1G\n"
16837 #: ../fish/guestfish.pod:677
16838 msgid "would truncate the file to 1 gigabyte."
16842 #: ../fish/guestfish.pod:679
16844 "Be careful because a few commands take sizes in kilobytes or megabytes "
16845 "(eg. the parameter to L</memsize> is specified in megabytes already). "
16846 "Adding a suffix will probably not do what you expect."
16850 #: ../fish/guestfish.pod:683
16851 msgid "OCTAL AND HEXADECIMAL NUMBERS"
16855 #: ../fish/guestfish.pod:685
16857 "For specifying the radix (base) use the C convention: C<0> to prefix an "
16858 "octal number or C<0x> to prefix a hexadecimal number. For example:"
16862 #: ../fish/guestfish.pod:688
16865 " 1234 decimal number 1234\n"
16866 " 02322 octal number, equivalent to decimal 1234\n"
16867 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
16872 #: ../fish/guestfish.pod:692
16874 "When using the C<chmod> command, you almost always want to specify an octal "
16875 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
16876 "L<chmod(1)> program):"
16880 #: ../fish/guestfish.pod:696
16883 " chmod 0777 /public # OK\n"
16884 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
16889 #: ../fish/guestfish.pod:699
16891 "Commands that return numbers usually print them in decimal, but some "
16892 "commands print numbers in other radices (eg. C<umask> prints the mode in "
16893 "octal, preceeded by C<0>)."
16897 #: ../fish/guestfish.pod:703
16898 msgid "WILDCARDS AND GLOBBING"
16902 #: ../fish/guestfish.pod:705
16904 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
16905 "(globbing) by default. So for example the following will not do what you "
16910 #: ../fish/guestfish.pod:709
16918 #: ../fish/guestfish.pod:711
16920 "Assuming you don't have a directory called literally C</home/*> then the "
16921 "above command will return an error."
16925 #: ../fish/guestfish.pod:714
16926 msgid "To perform wildcard expansion, use the C<glob> command."
16930 #: ../fish/guestfish.pod:716
16933 " glob rm-rf /home/*\n"
16938 #: ../fish/guestfish.pod:718
16940 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
16941 "many times), equivalent to:"
16945 #: ../fish/guestfish.pod:721
16948 " rm-rf /home/jim\n"
16949 " rm-rf /home/joe\n"
16950 " rm-rf /home/mary\n"
16955 #: ../fish/guestfish.pod:725
16956 msgid "C<glob> only works on simple guest paths and not on device names."
16960 #: ../fish/guestfish.pod:727
16962 "If you have several parameters, each containing a wildcard, then glob will "
16963 "perform a Cartesian product."
16967 #: ../fish/guestfish.pod:730
16972 #: ../fish/guestfish.pod:732
16974 "Any line which starts with a I<#> character is treated as a comment and "
16975 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
16976 "a command. For example:"
16980 #: ../fish/guestfish.pod:736
16983 " # this is a comment\n"
16984 " # this is a comment\n"
16985 " foo # NOT a comment\n"
16990 #: ../fish/guestfish.pod:740
16991 msgid "Blank lines are also ignored."
16995 #: ../fish/guestfish.pod:742
16996 msgid "RUNNING COMMANDS LOCALLY"
17000 #: ../fish/guestfish.pod:744
17002 "Any line which starts with a I<!> character is treated as a command sent to "
17003 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17007 #: ../fish/guestfish.pod:748
17011 " tgz-out /remote local/remote-data.tar.gz\n"
17016 #: ../fish/guestfish.pod:751
17018 "will create a directory C<local> on the host, and then export the contents "
17019 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17020 "(See C<tgz-out>)."
17024 #: ../fish/guestfish.pod:755
17026 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17027 "effect, due to the way that subprocesses work in Unix."
17031 #: ../fish/guestfish.pod:758
17032 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
17036 #: ../fish/guestfish.pod:760
17038 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
17039 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
17040 "and executed as guestfish commands."
17044 #: ../fish/guestfish.pod:764
17046 "Thus you can use shell script to construct arbitrary guestfish commands "
17047 "which are then parsed by guestfish."
17051 #: ../fish/guestfish.pod:767
17053 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
17054 "through C</foo.100>) using guestfish commands alone. However this is simple "
17055 "if we use a shell script to create the guestfish commands for us:"
17059 #: ../fish/guestfish.pod:772
17062 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
17067 #: ../fish/guestfish.pod:774
17068 msgid "or with names like C</foo.001>:"
17072 #: ../fish/guestfish.pod:776
17075 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
17080 #: ../fish/guestfish.pod:778
17082 "When using guestfish interactively it can be helpful to just run the shell "
17083 "script first (ie. remove the initial C<E<lt>> character so it is just an "
17084 "ordinary I<!> local command), see what guestfish commands it would run, and "
17085 "when you are happy with those prepend the C<E<lt>> character to run the "
17086 "guestfish commands for real."
17090 #: ../fish/guestfish.pod:784
17095 #: ../fish/guestfish.pod:786
17097 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17098 "command (a guestfish command) to the second command (any host command). For "
17103 #: ../fish/guestfish.pod:790
17106 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17111 #: ../fish/guestfish.pod:792
17113 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17114 "program). The above command would list all accounts in the guest filesystem "
17115 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17119 #: ../fish/guestfish.pod:797
17122 " hexdump /bin/ls | head\n"
17123 " list-devices | tail -1\n"
17124 " tgz-out / - | tar ztf -\n"
17129 #: ../fish/guestfish.pod:801
17131 "The space before the pipe symbol is required, any space after the pipe "
17132 "symbol is optional. Everything after the pipe symbol is just passed "
17133 "straight to the host shell, so it can contain redirections, globs and "
17134 "anything else that makes sense on the host side."
17138 #: ../fish/guestfish.pod:806
17140 "To use a literal argument which begins with a pipe symbol, you have to quote "
17145 #: ../fish/guestfish.pod:809
17153 #: ../fish/guestfish.pod:811
17154 msgid "HOME DIRECTORIES"
17158 #: ../fish/guestfish.pod:813
17160 "If a parameter starts with the character C<~> then the tilde may be expanded "
17161 "as a home directory path (either C<~> for the current user's home directory, "
17162 "or C<~user> for another user)."
17166 #: ../fish/guestfish.pod:817
17168 "Note that home directory expansion happens for users known I<on the host>, "
17169 "not in the guest filesystem."
17173 #: ../fish/guestfish.pod:820
17175 "To use a literal argument which begins with a tilde, you have to quote it, "
17180 #: ../fish/guestfish.pod:823
17188 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
17189 msgid "ENCRYPTED DISKS"
17193 #: ../fish/guestfish.pod:827
17195 "Libguestfs has some support for Linux guests encrypted according to the "
17196 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17197 "disk encryption systems used by modern Linux guests. Currently only "
17198 "LVM-on-LUKS is supported."
17202 #: ../fish/guestfish.pod:832
17203 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17207 #: ../fish/guestfish.pod:834
17210 " ><fs> vfs-type /dev/sda2\n"
17216 #: ../fish/guestfish.pod:837
17218 "Then open those devices using L</luks-open>. This creates a device-mapper "
17219 "device called C</dev/mapper/luksdev>."
17223 #: ../fish/guestfish.pod:840
17226 " ><fs> luks-open /dev/sda2 luksdev\n"
17227 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17232 #: ../fish/guestfish.pod:843
17234 "Finally you have to tell LVM to scan for volume groups on the newly created "
17239 #: ../fish/guestfish.pod:846
17243 " vg-activate-all true\n"
17248 #: ../fish/guestfish.pod:849
17249 msgid "The logical volume(s) can now be mounted in the usual way."
17253 #: ../fish/guestfish.pod:851
17255 "Before closing a LUKS device you must unmount any logical volumes on it and "
17256 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17257 "one. Then you can close the mapper device:"
17261 #: ../fish/guestfish.pod:855
17264 " vg-activate false /dev/VG\n"
17265 " luks-close /dev/mapper/luksdev\n"
17270 #: ../fish/guestfish.pod:860
17272 "If a path is prefixed with C<win:> then you can use Windows-style drive "
17273 "letters and paths (with some limitations). The following commands are "
17278 #: ../fish/guestfish.pod:864
17281 " file /WINDOWS/system32/config/system.LOG\n"
17286 #: ../fish/guestfish.pod:866
17289 " file win:\\windows\\system32\\config\\system.log\n"
17294 #: ../fish/guestfish.pod:868
17297 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
17302 #: ../fish/guestfish.pod:870
17304 "The parameter is rewritten \"behind the scenes\" by looking up the position "
17305 "where the drive is mounted, prepending that to the path, changing all "
17306 "backslash characters to forward slash, then resolving the result using "
17307 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
17308 "then the parameter might be rewritten like this:"
17312 #: ../fish/guestfish.pod:876
17315 " win:e:\\foo\\bar => /e/FOO/bar\n"
17320 #: ../fish/guestfish.pod:878
17321 msgid "This only works in argument positions that expect a path."
17325 #: ../fish/guestfish.pod:880
17326 msgid "UPLOADING AND DOWNLOADING FILES"
17330 #: ../fish/guestfish.pod:882
17332 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17333 "others which upload from or download to a local file, you can use the "
17334 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17338 #: ../fish/guestfish.pod:886
17346 #: ../fish/guestfish.pod:888
17347 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
17351 #: ../fish/guestfish.pod:891
17354 " tar-out /etc - | tar tf -\n"
17359 #: ../fish/guestfish.pod:893
17361 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17362 "command (see L</PIPES>)."
17366 #: ../fish/guestfish.pod:896
17368 "When using C<-> to read from stdin, the input is read up to the end of "
17369 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17370 "some arbitrary end marker:"
17374 #: ../fish/guestfish.pod:900
17377 " upload -<<END /foo\n"
17386 #: ../fish/guestfish.pod:906
17388 "Any string of characters can be used instead of C<END>. The end marker must "
17389 "appear on a line of its own, without any preceeding or following characters "
17390 "(not even spaces)."
17394 #: ../fish/guestfish.pod:910
17396 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
17397 "upload local files (so-called \"FileIn\" parameters in the generator)."
17401 #: ../fish/guestfish.pod:913
17402 msgid "EXIT ON ERROR BEHAVIOUR"
17406 #: ../fish/guestfish.pod:915
17408 "By default, guestfish will ignore any errors when in interactive mode "
17409 "(ie. taking commands from a human over a tty), and will exit on the first "
17410 "error in non-interactive mode (scripts, commands given on the command line)."
17414 #: ../fish/guestfish.pod:920
17416 "If you prefix a command with a I<-> character, then that command will not "
17417 "cause guestfish to exit, even if that (one) command returns an error."
17421 #: ../fish/guestfish.pod:924
17422 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
17426 #: ../fish/guestfish.pod:926
17428 "Guestfish can be remote-controlled over a socket. This is useful "
17429 "particularly in shell scripts where you want to make several different "
17430 "changes to a filesystem, but you don't want the overhead of starting up a "
17431 "guestfish process each time."
17435 #: ../fish/guestfish.pod:931
17436 msgid "Start a guestfish server process using:"
17440 #: ../fish/guestfish.pod:933
17443 " eval \"`guestfish --listen`\"\n"
17448 #: ../fish/guestfish.pod:935
17449 msgid "and then send it commands by doing:"
17453 #: ../fish/guestfish.pod:937
17456 " guestfish --remote cmd [...]\n"
17461 #: ../fish/guestfish.pod:939
17462 msgid "To cause the server to exit, send it the exit command:"
17466 #: ../fish/guestfish.pod:943
17468 "Note that the server will normally exit if there is an error in a command. "
17469 "You can change this in the usual way. See section L</EXIT ON ERROR "
17474 #: ../fish/guestfish.pod:947
17475 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
17479 #: ../fish/guestfish.pod:949
17481 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
17482 "is how the I<--remote> option knows where to send the commands. You can "
17483 "have several guestfish listener processes running using:"
17487 #: ../fish/guestfish.pod:953
17490 " eval \"`guestfish --listen`\"\n"
17491 " pid1=$GUESTFISH_PID\n"
17492 " eval \"`guestfish --listen`\"\n"
17493 " pid2=$GUESTFISH_PID\n"
17495 " guestfish --remote=$pid1 cmd\n"
17496 " guestfish --remote=$pid2 cmd\n"
17501 #: ../fish/guestfish.pod:961
17502 msgid "REMOTE CONTROL AND CSH"
17506 #: ../fish/guestfish.pod:963
17508 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
17513 #: ../fish/guestfish.pod:966
17516 " eval \"`guestfish --listen --csh`\"\n"
17521 #: ../fish/guestfish.pod:968
17522 msgid "REMOTE CONTROL DETAILS"
17526 #: ../fish/guestfish.pod:970
17528 "Remote control happens over a Unix domain socket called "
17529 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
17530 "of the process, and C<$PID> is the process ID of the server."
17534 #: ../fish/guestfish.pod:974
17535 msgid "Guestfish client and server versions must match exactly."
17539 #: ../fish/guestfish.pod:976
17540 msgid "REMOTE CONTROL RUN COMMAND HANGING"
17544 #: ../fish/guestfish.pod:978
17546 "Using the C<run> (or C<launch>) command remotely in a command substitution "
17547 "context hangs, ie. don't do (note the backquotes):"
17551 #: ../fish/guestfish.pod:981
17554 " a=`guestfish --remote run`\n"
17559 #: ../fish/guestfish.pod:983
17561 "Since the C<run> command produces no output on stdout, this is not useful "
17562 "anyway. For further information see "
17563 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
17567 #: ../fish/guestfish.pod:987
17568 msgid "PREPARED DISK IMAGES"
17572 #: ../fish/guestfish.pod:989
17574 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
17575 "preformatted disk images that guestfish can make for you to save typing. "
17576 "This is particularly useful for testing purposes. This option is used "
17577 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
17578 "can be mixed with I<-a>)."
17582 #: ../fish/guestfish.pod:995
17584 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17585 "the second and so on. Existing files in the current directory are "
17590 #: ../fish/guestfish.pod:999
17592 "The type briefly describes how the disk should be sized, partitioned, how "
17593 "filesystem(s) should be created, and how content should be added. "
17594 "Optionally the type can be followed by extra parameters, separated by C<:> "
17595 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
17596 "sparsely-allocated disk, containing a single partition, with the partition "
17597 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
17598 "on a 1GB disk instead."
17602 #: ../fish/guestfish.pod:1007
17603 msgid "To list the available types and any extra parameters they take, run:"
17607 #: ../fish/guestfish.pod:1011
17609 "Note that the prepared filesystem is not mounted. You would usually have to "
17610 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17614 #: ../fish/guestfish.pod:1015
17616 "If any I<-N> or I<--new> options are given, the guest is automatically "
17621 #: ../fish/guestfish.pod:1020
17622 msgid "Create a 100MB disk with an ext4-formatted partition:"
17626 #: ../fish/guestfish.pod:1022
17629 " guestfish -N fs:ext4\n"
17634 #: ../fish/guestfish.pod:1024
17635 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
17639 #: ../fish/guestfish.pod:1026
17642 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
17647 #: ../fish/guestfish.pod:1028
17648 msgid "Create a blank 200MB disk:"
17652 #: ../fish/guestfish.pod:1030
17655 " guestfish -N disk:200M\n"
17660 #: ../fish/guestfish.pod:1032
17661 msgid "PROGRESS BARS"
17665 #: ../fish/guestfish.pod:1034
17667 "Some (not all) long-running commands send progress notification messages as "
17668 "they are running. Guestfish turns these messages into progress bars."
17672 #: ../fish/guestfish.pod:1038
17674 "When a command that supports progress bars takes longer than two seconds to "
17675 "run, and if progress bars are enabled, then you will see one appearing below "
17680 #: ../fish/guestfish.pod:1042
17683 " ><fs> copy-size /large-file /another-file 2048M\n"
17684 " / 10% [#####-----------------------------------------] 00:30\n"
17689 #: ../fish/guestfish.pod:1045
17691 "The spinner on the left hand side moves round once for every progress "
17692 "notification received from the backend. This is a (reasonably) golden "
17693 "assurance that the command is \"doing something\" even if the progress bar "
17694 "is not moving, because the command is able to send the progress "
17695 "notifications. When the bar reaches 100% and the command finishes, the "
17696 "spinner disappears."
17700 #: ../fish/guestfish.pod:1052
17702 "Progress bars are enabled by default when guestfish is used interactively. "
17703 "You can enable them even for non-interactive modes using I<--progress-bars>, "
17704 "and you can disable them completely using I<--no-progress-bars>."
17708 #: ../fish/guestfish.pod:1057
17709 msgid "GUESTFISH COMMANDS"
17713 #: ../fish/guestfish.pod:1059
17715 "The commands in this section are guestfish convenience commands, in other "
17716 "words, they are not part of the L<guestfs(3)> API."
17720 #: ../fish/guestfish.pod:1062
17725 #: ../fish/guestfish.pod:1064
17734 #: ../fish/guestfish.pod:1067
17735 msgid "Without any parameter, this provides general help."
17739 #: ../fish/guestfish.pod:1069
17740 msgid "With a C<cmd> parameter, this displays detailed help for that command."
17744 #: ../fish/guestfish.pod:1071
17745 msgid "quit | exit"
17749 #: ../fish/guestfish.pod:1073
17750 msgid "This exits guestfish. You can also use C<^D> key."
17754 #: ../fish/guestfish.pod:1075
17755 msgid "@FISH_COMMANDS@"
17759 #: ../fish/guestfish.pod:1077
17764 #: ../fish/guestfish.pod:1079 ../src/guestfs.pod:1474
17769 #: ../fish/guestfish.pod:1083
17771 "guestfish returns 0 if the commands completed without error, or 1 if there "
17776 #: ../fish/guestfish.pod:1090
17781 #: ../fish/guestfish.pod:1092
17783 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
17788 #: ../fish/guestfish.pod:1095 ../src/guestfs.pod:3062
17789 msgid "FEBOOTSTRAP_KERNEL"
17793 #: ../fish/guestfish.pod:1097 ../src/guestfs.pod:3064
17794 msgid "FEBOOTSTRAP_MODULES"
17798 #: ../fish/guestfish.pod:1099 ../src/guestfs.pod:3066
17800 "These two environment variables allow the kernel that libguestfs uses in the "
17801 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
17802 "most recent host kernel is chosen. For more information about kernel "
17803 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
17804 "available in febootstrap E<ge> 3.8."
17808 #: ../fish/guestfish.pod:1105
17809 msgid "GUESTFISH_DISPLAY_IMAGE"
17813 #: ../fish/guestfish.pod:1107
17815 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
17816 "If not set, it uses L<display(1)>."
17820 #: ../fish/guestfish.pod:1110
17821 msgid "GUESTFISH_PID"
17825 #: ../fish/guestfish.pod:1112
17827 "Used with the I<--remote> option to specify the remote guestfish process to "
17828 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
17832 #: ../fish/guestfish.pod:1116
17837 #: ../fish/guestfish.pod:1118
17839 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
17840 "not specified, the external L<hexedit(1)> program is used."
17844 #: ../fish/guestfish.pod:1122
17849 #: ../fish/guestfish.pod:1124
17851 "If compiled with GNU readline support, various files in the home directory "
17852 "can be used. See L</FILES>."
17856 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3072
17857 msgid "LIBGUESTFS_APPEND"
17861 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3074
17862 msgid "Pass additional options to the guest kernel."
17866 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3076
17867 msgid "LIBGUESTFS_DEBUG"
17871 #: ../fish/guestfish.pod:1133
17873 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
17874 "effect as using the B<-v> option."
17878 #: ../fish/guestfish.pod:1136 ../src/guestfs.pod:3081
17879 msgid "LIBGUESTFS_MEMSIZE"
17883 #: ../fish/guestfish.pod:1138 ../src/guestfs.pod:3083
17884 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
17888 #: ../fish/guestfish.pod:1141 ../src/guestfs.pod:3086
17891 " LIBGUESTFS_MEMSIZE=700\n"
17896 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3088
17897 msgid "LIBGUESTFS_PATH"
17901 #: ../fish/guestfish.pod:1145
17903 "Set the path that guestfish uses to search for kernel and initrd.img. See "
17904 "the discussion of paths in L<guestfs(3)>."
17908 #: ../fish/guestfish.pod:1148 ../src/guestfs.pod:3093
17909 msgid "LIBGUESTFS_QEMU"
17913 #: ../fish/guestfish.pod:1150 ../src/guestfs.pod:3095
17915 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
17916 "which was found at compile time by the configure script is used."
17920 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3101
17921 msgid "LIBGUESTFS_TRACE"
17925 #: ../fish/guestfish.pod:1156
17926 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
17930 #: ../fish/guestfish.pod:1158
17935 #: ../fish/guestfish.pod:1160
17937 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
17942 #: ../fish/guestfish.pod:1163 ../src/guestfs.pod:3106
17947 #: ../fish/guestfish.pod:1165 ../src/guestfs.pod:3108
17949 "Location of temporary directory, defaults to C</tmp> except for the cached "
17950 "supermin appliance which defaults to C</var/tmp>."
17954 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3111
17956 "If libguestfs was compiled to use the supermin appliance then the real "
17957 "appliance is cached in this directory, shared between all handles belonging "
17958 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
17959 "use in case C</var/tmp> is not large enough."
17963 #: ../fish/guestfish.pod:1176 ../fuse/guestmount.pod:288 ../rescue/virt-rescue.pod:269
17968 #: ../fish/guestfish.pod:1180 ../fuse/guestmount.pod:292 ../rescue/virt-rescue.pod:273
17969 msgid "$HOME/.libguestfs-tools.rc"
17973 #: ../fish/guestfish.pod:1182 ../fuse/guestmount.pod:294 ../rescue/virt-rescue.pod:275
17974 msgid "/etc/libguestfs-tools.conf"
17978 #: ../fish/guestfish.pod:1184 ../fuse/guestmount.pod:296 ../rescue/virt-rescue.pod:277
17980 "This configuration file controls the default read-only or read-write mode "
17981 "(I<--ro> or I<--rw>)."
17985 #: ../fish/guestfish.pod:1187
17986 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
17990 #: ../fish/guestfish.pod:1189
17991 msgid "$HOME/.guestfish"
17995 #: ../fish/guestfish.pod:1191
17997 "If compiled with GNU readline support, then the command history is saved in "
18002 #: ../fish/guestfish.pod:1194
18003 msgid "$HOME/.inputrc"
18007 #: ../fish/guestfish.pod:1196
18008 msgid "/etc/inputrc"
18012 #: ../fish/guestfish.pod:1198
18014 "If compiled with GNU readline support, then these files can be used to "
18015 "configure readline. For further information, please see "
18016 "L<readline(3)/INITIALIZATION FILE>."
18020 #: ../fish/guestfish.pod:1202
18021 msgid "To write rules which only apply to guestfish, use:"
18025 #: ../fish/guestfish.pod:1204
18035 #: ../fish/guestfish.pod:1208
18037 "Variables that you can set in inputrc that change the behaviour of guestfish "
18038 "in useful ways include:"
18042 #: ../fish/guestfish.pod:1213
18043 msgid "completion-ignore-case (default: on)"
18047 #: ../fish/guestfish.pod:1215
18049 "By default, guestfish will ignore case when tab-completing paths on the "
18054 #: ../fish/guestfish.pod:1218
18057 " set completion-ignore-case off\n"
18062 #: ../fish/guestfish.pod:1220
18063 msgid "to make guestfish case sensitive."
18067 #: ../fish/guestfish.pod:1224
18072 #: ../fish/guestfish.pod:1226
18073 msgid "test2.img (etc)"
18077 #: ../fish/guestfish.pod:1228
18079 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18080 "will be created in the file C<test1.img> in the current directory. The "
18081 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18082 "the same name will be overwritten."
18086 #: ../fish/guestfish.pod:1237
18088 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, "
18089 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
18090 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
18091 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
18092 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
18093 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
18094 "L<febootstrap-supermin-helper(8)>."
18098 #: ../fish/guestfish.pod:1266 ../src/guestfs.pod:3197 ../test-tool/libguestfs-test-tool.pod:112
18099 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18103 #: ../fish/virt-copy-in.pod:5
18104 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
18108 #: ../fish/virt-copy-in.pod:9
18111 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18116 #: ../fish/virt-copy-in.pod:11
18119 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18124 #: ../fish/virt-copy-in.pod:15
18126 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18127 "causing disk corruption. The virtual machine must be shut down before you "
18128 "use this command."
18132 #: ../fish/virt-copy-in.pod:21
18134 "C<virt-copy-in> copies files and directories from the local disk into a "
18135 "virtual machine disk image or named libvirt domain."
18139 #: ../fish/virt-copy-in.pod:24
18141 "You can give one of more filenames and directories on the command line. "
18142 "Directories are copied in recursively. The final parameter must be the "
18143 "destination directory in the disk image which must be an absolute path "
18144 "starting with a C</> character."
18148 #: ../fish/virt-copy-in.pod:33
18151 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18156 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18157 msgid "Upload a home directory to a guest:"
18161 #: ../fish/virt-copy-in.pod:37
18164 " virt-copy-in -d MyGuest skel /home\n"
18169 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18170 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18174 #: ../fish/virt-copy-in.pod:41
18176 "This command is just a simple shell script wrapper around the "
18177 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
18178 "trivial copy, you are probably better off using guestfish directly."
18182 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18184 "Since the shell script just passes options straight to guestfish, read "
18185 "L<guestfish(1)> to see the full list of options."
18189 #: ../fish/virt-copy-in.pod:52
18191 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18192 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18196 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18197 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18201 #: ../fish/virt-copy-out.pod:5
18203 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18208 #: ../fish/virt-copy-out.pod:9
18211 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18216 #: ../fish/virt-copy-out.pod:11
18219 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18224 #: ../fish/virt-copy-out.pod:15
18226 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18227 "image or named libvirt domain."
18231 #: ../fish/virt-copy-out.pod:18
18233 "You can give one of more filenames and directories on the command line. "
18234 "Directories are copied out recursively."
18238 #: ../fish/virt-copy-out.pod:23
18239 msgid "Download the home directories from a virtual machine:"
18243 #: ../fish/virt-copy-out.pod:25
18247 " virt-copy-out -d MyGuest /home homes\n"
18252 #: ../fish/virt-copy-out.pod:30
18254 "This command is just a simple shell script wrapper around the "
18255 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
18256 "trivial copy, you are probably better off using guestfish directly."
18260 #: ../fish/virt-copy-out.pod:41
18262 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
18263 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18267 #: ../fish/virt-tar-in.pod:5
18268 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18272 #: ../fish/virt-tar-in.pod:9
18275 " virt-tar-in -a disk.img data.tar /destination\n"
18280 #: ../fish/virt-tar-in.pod:11
18283 " virt-tar-in -d domain data.tar /destination\n"
18288 #: ../fish/virt-tar-in.pod:13
18291 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18296 #: ../fish/virt-tar-in.pod:17
18298 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18299 "causing disk corruption. The virtual machine must be shut down before you "
18300 "use this command."
18304 #: ../fish/virt-tar-in.pod:23
18306 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18307 "image or named libvirt domain."
18311 #: ../fish/virt-tar-in.pod:26
18313 "The first parameter is the tar file. Use C<-> to read the tar file from "
18314 "standard input. The second parameter is the absolute target directory to "
18319 #: ../fish/virt-tar-in.pod:34
18322 " virt-tar-in -d MyGuest homes.tar /home\n"
18327 #: ../fish/virt-tar-in.pod:38
18329 "This command is just a simple shell script wrapper around the "
18330 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
18331 "copy, you are probably better off using guestfish directly."
18335 #: ../fish/virt-tar-in.pod:49
18337 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18338 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
18339 "L<http://libguestfs.org/>."
18343 #: ../fish/virt-tar-out.pod:5
18344 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
18348 #: ../fish/virt-tar-out.pod:9
18351 " virt-tar-out -a disk.img /dir files.tar\n"
18356 #: ../fish/virt-tar-out.pod:11
18359 " virt-tar-out -d domain /dir files.tar\n"
18364 #: ../fish/virt-tar-out.pod:13
18367 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
18372 #: ../fish/virt-tar-out.pod:17
18373 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
18377 #: ../fish/virt-tar-out.pod:20
18379 "The first parameter is the absolute path of the virtual machine directory. "
18380 "The second parameter is the tar file to write. Use C<-> to write to "
18385 #: ../fish/virt-tar-out.pod:26
18386 msgid "Download the home directories from a guest:"
18390 #: ../fish/virt-tar-out.pod:28
18393 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
18398 #: ../fish/virt-tar-out.pod:32
18400 "This command is just a simple shell script wrapper around the "
18401 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
18402 "trivial copy, you are probably better off using guestfish directly."
18406 #: ../fish/virt-tar-out.pod:43
18408 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18409 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
18413 #: ../fuse/guestmount.pod:5
18414 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
18418 #: ../fuse/guestmount.pod:9
18421 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
18426 #: ../fuse/guestmount.pod:11
18429 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
18434 #: ../fuse/guestmount.pod:13
18437 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
18442 #: ../fuse/guestmount.pod:17
18444 "You must I<not> use C<guestmount> in read-write mode on live virtual "
18445 "machines. If you do this, you risk disk corruption in the VM."
18449 #: ../fuse/guestmount.pod:22
18451 "The guestmount program can be used to mount virtual machine filesystems and "
18452 "other disk images on the host. It uses libguestfs for access to the guest "
18453 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
18454 "a mountable device."
18458 #: ../fuse/guestmount.pod:27
18460 "Along with other options, you have to give at least one device (I<-a> "
18461 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
18462 "option) or use the I<-i> inspection option. How this works is better "
18463 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
18468 #: ../fuse/guestmount.pod:33
18470 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
18471 "by you, and the filesystem will not be visible to any other users unless you "
18472 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
18473 "the filesystem, use the C<fusermount -u> command."
18477 #: ../fuse/guestmount.pod:41
18479 "For a typical Windows guest which has its main filesystem on the first "
18484 #: ../fuse/guestmount.pod:44
18487 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
18492 #: ../fuse/guestmount.pod:46
18494 "For a typical Linux guest which has a /boot filesystem on the first "
18495 "partition, and the root filesystem on a logical volume:"
18499 #: ../fuse/guestmount.pod:49
18502 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
18507 #: ../fuse/guestmount.pod:51
18508 msgid "To get libguestfs to detect guest mountpoints for you:"
18512 #: ../fuse/guestmount.pod:53
18515 " guestmount -a guest.img -i --ro /mnt\n"
18520 #: ../fuse/guestmount.pod:55
18521 msgid "For a libvirt guest called \"Guest\" you could do:"
18525 #: ../fuse/guestmount.pod:57
18528 " guestmount -d Guest -i --ro /mnt\n"
18533 #: ../fuse/guestmount.pod:59
18535 "If you don't know what filesystems are contained in a guest or disk image, "
18536 "use L<virt-filesystems(1)> first:"
18540 #: ../fuse/guestmount.pod:62
18543 " virt-filesystems MyGuest\n"
18548 #: ../fuse/guestmount.pod:64
18550 "If you want to trace the libguestfs calls but without excessive debugging "
18551 "information, we recommend:"
18555 #: ../fuse/guestmount.pod:67
18558 " guestmount [...] --trace /mnt\n"
18563 #: ../fuse/guestmount.pod:69
18564 msgid "If you want to debug the program, we recommend:"
18568 #: ../fuse/guestmount.pod:71
18571 " guestmount [...] --trace --verbose /mnt\n"
18576 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:511
18581 #: ../fuse/guestmount.pod:75
18582 msgid "Other users cannot see the filesystem by default"
18586 #: ../fuse/guestmount.pod:77
18588 "If you mount a filesystem as one user (eg. root), then other users will not "
18589 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
18590 "option when mounting:"
18594 #: ../fuse/guestmount.pod:81
18597 " sudo guestmount [...] -o allow_other /mnt\n"
18602 #: ../fuse/guestmount.pod:91
18603 msgid "Add a block device or virtual machine image."
18607 #: ../fuse/guestmount.pod:114
18608 msgid "B<--dir-cache-timeout N>"
18612 #: ../fuse/guestmount.pod:116
18614 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
18615 "seconds. The readdir cache [actually, there are several semi-independent "
18616 "caches] is populated after a readdir(2) call with the stat and extended "
18617 "attributes of the files in the directory, in anticipation that they will be "
18618 "requested soon after."
18622 #: ../fuse/guestmount.pod:122
18624 "There is also a different attribute cache implemented by FUSE (see the FUSE "
18625 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
18626 "requests, only cache existing ones."
18630 #: ../fuse/guestmount.pod:142
18632 "If you have untrusted raw-format guest disk images, you should use this "
18633 "option to specify the disk format. This avoids a possible security problem "
18634 "with malicious guests (CVE-2010-3851). See also "
18635 "L<guestfs(3)/guestfs_add_drive_opts>."
18639 #: ../fuse/guestmount.pod:147
18640 msgid "B<--fuse-help>"
18644 #: ../fuse/guestmount.pod:149
18645 msgid "Display help on special FUSE options (see I<-o> below)."
18649 #: ../fuse/guestmount.pod:153
18650 msgid "Display brief help and exit."
18654 #: ../fuse/guestmount.pod:177
18656 "Mount the named partition or logical volume on the given mountpoint B<in the "
18657 "guest> (this has nothing to do with mountpoints in the host)."
18661 #: ../fuse/guestmount.pod:180
18663 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
18664 "something on C</>."
18668 #: ../fuse/guestmount.pod:197
18670 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
18671 "unmounted. If you specify this option, then we don't attempt to sync the "
18672 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
18676 #: ../fuse/guestmount.pod:202
18677 msgid "B<-o option>"
18681 #: ../fuse/guestmount.pod:204
18682 msgid "B<--option option>"
18686 #: ../fuse/guestmount.pod:206
18687 msgid "Pass extra options to FUSE."
18691 #: ../fuse/guestmount.pod:208
18693 "To get a list of all the extra options supported by FUSE, use the command "
18694 "below. Note that only the FUSE I<-o> options can be passed, and only some "
18695 "of them are a good idea."
18699 #: ../fuse/guestmount.pod:212
18702 " guestmount --fuse-help\n"
18707 #: ../fuse/guestmount.pod:214
18708 msgid "Some potentially useful FUSE options:"
18712 #: ../fuse/guestmount.pod:218
18713 msgid "B<-o allow_other>"
18717 #: ../fuse/guestmount.pod:220
18718 msgid "Allow other users to see the filesystem."
18722 #: ../fuse/guestmount.pod:222
18723 msgid "B<-o attr_timeout=N>"
18727 #: ../fuse/guestmount.pod:224
18728 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
18732 #: ../fuse/guestmount.pod:226
18733 msgid "B<-o kernel_cache>"
18737 #: ../fuse/guestmount.pod:228
18739 "Allow the kernel to cache files (reduces the number of reads that have to go "
18740 "through the L<guestfs(3)> API). This is generally a good idea if you can "
18741 "afford the extra memory usage."
18745 #: ../fuse/guestmount.pod:232
18746 msgid "B<-o uid=N> B<-o gid=N>"
18750 #: ../fuse/guestmount.pod:234
18752 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
18753 "the chosen values."
18757 #: ../fuse/guestmount.pod:243
18759 "Add devices and mount everything read-only. Also disallow writes and make "
18760 "the disk appear read-only to FUSE."
18764 #: ../fuse/guestmount.pod:246
18766 "This is highly recommended if you are not going to edit the guest disk. If "
18767 "the guest is running and this option is I<not> supplied, then there is a "
18768 "strong risk of disk corruption in the guest. We try to prevent this from "
18769 "happening, but it is not always possible."
18773 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
18774 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
18778 #: ../fuse/guestmount.pod:255
18779 msgid "Enable SELinux support for the guest."
18783 #: ../fuse/guestmount.pod:261
18784 msgid "Enable verbose messages from underlying libguestfs."
18788 #: ../fuse/guestmount.pod:267
18789 msgid "Display the program version and exit."
18793 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299 ../rescue/virt-rescue.pod:197 ../rescue/virt-rescue.pod:280
18794 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
18798 #: ../fuse/guestmount.pod:280
18803 #: ../fuse/guestmount.pod:282
18804 msgid "Trace libguestfs calls and entry into each FUSE function."
18808 #: ../fuse/guestmount.pod:284
18809 msgid "This also stops the daemon from forking into the background."
18813 #: ../fuse/guestmount.pod:310
18815 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
18816 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
18817 "L<http://fuse.sf.net/>."
18821 #: ../fuse/guestmount.pod:325
18822 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
18826 #: ../inspector/virt-inspector.pod:5
18828 "virt-inspector - Display operating system version and other information "
18829 "about a virtual machine"
18833 #: ../inspector/virt-inspector.pod:9
18836 " virt-inspector [--options] -d domname\n"
18841 #: ../inspector/virt-inspector.pod:11
18844 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
18849 #: ../inspector/virt-inspector.pod:15
18852 " virt-inspector domname\n"
18857 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
18860 " virt-inspector disk.img [disk.img ...]\n"
18865 #: ../inspector/virt-inspector.pod:21
18867 "B<virt-inspector> examines a virtual machine or disk image and tries to "
18868 "determine the version of the operating system and other information about "
18869 "the virtual machine."
18873 #: ../inspector/virt-inspector.pod:25
18874 msgid "Virt-inspector produces XML output for feeding into other programs."
18878 #: ../inspector/virt-inspector.pod:27
18880 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
18881 "the libvirt domain (see: C<virsh list --all>)."
18885 #: ../inspector/virt-inspector.pod:30
18887 "You can also run virt-inspector directly on disk images from a single "
18888 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
18889 "has several block devices, in which case you should list several I<-a> "
18890 "options one after another, with the first corresponding to the guest's "
18891 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
18895 #: ../inspector/virt-inspector.pod:37
18897 "You can also run virt-inspector on install disks, live CDs, bootable USB "
18898 "keys and similar."
18902 #: ../inspector/virt-inspector.pod:40
18904 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
18905 "inspect several virtual machines, you have to run virt-inspector several "
18906 "times (for example, from a shell script for-loop)."
18910 #: ../inspector/virt-inspector.pod:45
18912 "Because virt-inspector needs direct access to guest images, it won't "
18913 "normally work over remote libvirt connections."
18917 #: ../inspector/virt-inspector.pod:48
18919 "All of the information available from virt-inspector is also available "
18920 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
18921 "The same information can also be fetched using guestfish or via libguestfs "
18922 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
18923 "WITH OTHER PROGRAMMING LANGUAGES>)."
18927 #: ../inspector/virt-inspector.pod:81
18929 "Libvirt is only used if you specify a C<domname> on the command line. If "
18930 "you specify guest block devices directly (I<-a>), then libvirt is not used "
18935 #: ../inspector/virt-inspector.pod:94
18937 "When prompting for keys and passphrases, virt-inspector normally turns "
18938 "echoing off so you cannot see what you are typing. If you are not worried "
18939 "about Tempest attacks and there is no one else in the room you can specify "
18940 "this flag to see what you are typing."
18944 #: ../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
18946 "Specify the format of disk images given on the command line. If this is "
18947 "omitted then the format is autodetected from the content of the disk image."
18951 #: ../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
18953 "If disk images are requested from libvirt, then this program asks libvirt "
18954 "for this information. In this case, the value of the format parameter is "
18959 #: ../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
18961 "If working with untrusted raw-format guest disk images, you should ensure "
18962 "the format is always specified."
18966 #: ../inspector/virt-inspector.pod:139
18967 msgid "Previous versions of virt-inspector allowed you to write either:"
18971 #: ../inspector/virt-inspector.pod:145
18974 " virt-inspector guestname\n"
18979 #: ../inspector/virt-inspector.pod:153
18984 #: ../inspector/virt-inspector.pod:155
18986 "The virt-inspector XML is described precisely in a RELAX NG schema file "
18987 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
18988 "just an overview."
18992 #: ../inspector/virt-inspector.pod:159
18994 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
18995 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
18996 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
18997 "which is vanishingly rare in real world VMs."
19001 #: ../inspector/virt-inspector.pod:164
19002 msgid "E<lt>operatingsystemE<gt>"
19006 #: ../inspector/virt-inspector.pod:166
19008 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
19009 "describe the operating system, its architecture, the descriptive \"product "
19010 "name\" string, the type of OS and so on, as in this example:"
19014 #: ../inspector/virt-inspector.pod:170
19017 " <operatingsystems>\n"
19018 " <operatingsystem>\n"
19019 " <root>/dev/sda2</root>\n"
19020 " <name>windows</name>\n"
19021 " <arch>i386</arch>\n"
19022 " <distro>windows</distro>\n"
19023 " <product_name>Windows 7 Enterprise</product_name>\n"
19024 " <product_variant>Client</product_variant>\n"
19025 " <major_version>6</major_version>\n"
19026 " <minor_version>1</minor_version>\n"
19027 " <windows_systemroot>/Windows</windows_systemroot>\n"
19028 " <format>installed</format>\n"
19033 #: ../inspector/virt-inspector.pod:183
19035 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
19036 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
19037 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
19038 "architecture. The other fields are fairly self-explanatory, but because "
19039 "these fields are taken directly from the libguestfs inspection API you can "
19040 "find precise information from L<guestfs(3)/INSPECTION>."
19044 #: ../inspector/virt-inspector.pod:191
19046 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
19047 "of view of libguestfs (block devices may have completely different names "
19048 "inside the VM itself)."
19052 #: ../inspector/virt-inspector.pod:195
19053 msgid "E<lt>mountpointsE<gt>"
19057 #: ../inspector/virt-inspector.pod:197
19059 "Un*x-like guests typically have multiple filesystems which are mounted at "
19060 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
19061 "element which looks like this:"
19065 #: ../inspector/virt-inspector.pod:201
19068 " <operatingsystems>\n"
19069 " <operatingsystem>\n"
19072 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19073 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19074 " </mountpoints>\n"
19079 #: ../inspector/virt-inspector.pod:209
19081 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19082 "and may have completely different names inside the guest. Only mountable "
19083 "filesystems appear in this list, not things like swap devices."
19087 #: ../inspector/virt-inspector.pod:214
19088 msgid "E<lt>filesystemsE<gt>"
19092 #: ../inspector/virt-inspector.pod:216
19094 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19095 "filesystems belonging to the guest, including swap and empty partitions. "
19096 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19097 "this OS or shared with this OS and other OSes)."
19101 #: ../inspector/virt-inspector.pod:222
19102 msgid "You might see something like this:"
19106 #: ../inspector/virt-inspector.pod:224
19109 " <operatingsystems>\n"
19110 " <operatingsystem>\n"
19113 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19114 " <type>ext4</type>\n"
19115 " <label>Fedora-13-x86_64</label>\n"
19116 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19122 #: ../inspector/virt-inspector.pod:234
19124 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19125 "the label, and the UUID."
19129 #: ../inspector/virt-inspector.pod:237
19130 msgid "E<lt>applicationsE<gt>"
19134 #: ../inspector/virt-inspector.pod:239
19136 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19137 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19142 #: ../inspector/virt-inspector.pod:243
19144 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19145 "Typical values would be C<rpm> and C<deb>."
19149 #: ../inspector/virt-inspector.pod:246
19151 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19152 "Typical values include C<yum>, C<up2date> and C<apt>"
19156 #: ../inspector/virt-inspector.pod:249
19157 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19161 #: ../inspector/virt-inspector.pod:252
19164 " <operatingsystems>\n"
19165 " <operatingsystem>\n"
19167 " <applications>\n"
19169 " <name>coreutils</name>\n"
19170 " <version>8.5</version>\n"
19171 " <release>1</release>\n"
19172 " </application>\n"
19177 #: ../inspector/virt-inspector.pod:262
19179 "The version and release fields may not be available for some types guests. "
19180 "Other fields are possible, see "
19181 "L<guestfs(3)/guestfs_inspect_list_applications>."
19185 #: ../inspector/virt-inspector.pod:266
19186 msgid "E<lt>drive_mappingsE<gt>"
19190 #: ../inspector/virt-inspector.pod:268
19192 "For operating systems like Windows which use drive letters, virt-inspector "
19193 "is able to find out how drive letters map to filesystems."
19197 #: ../inspector/virt-inspector.pod:272
19200 " <operatingsystems>\n"
19201 " <operatingsystem>\n"
19203 " <drive_mappings>\n"
19204 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19205 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19206 " </drive_mappings>\n"
19211 #: ../inspector/virt-inspector.pod:280
19213 "In the example above, drive C maps to the filesystem on the second partition "
19214 "on the first disk, and drive E maps to the filesystem on the first partition "
19215 "on the second disk."
19219 #: ../inspector/virt-inspector.pod:284
19221 "Note that this only covers permanent local filesystem mappings, not things "
19222 "like network shares. Furthermore NTFS volume mount points may not be listed "
19227 #: ../inspector/virt-inspector.pod:288
19228 msgid "E<lt>iconE<gt>"
19232 #: ../inspector/virt-inspector.pod:290
19234 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19235 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19236 "very large and high quality."
19240 #: ../inspector/virt-inspector.pod:294
19243 " <operatingsystems>\n"
19244 " <operatingsystem>\n"
19247 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19248 " [... many lines of base64 data ...]\n"
19254 #: ../inspector/virt-inspector.pod:302
19256 "To display the icon, you have to extract it and convert the base64 data back "
19257 "to a binary file. Use an XPath query or simply an editor to extract the "
19258 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19263 #: ../inspector/virt-inspector.pod:307
19266 " base64 -i -d < icon.data > icon.png\n"
19271 #: ../inspector/virt-inspector.pod:309
19272 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19276 #: ../inspector/virt-inspector.pod:311
19278 "Virt-inspector can detect some operating system installers on install disks, "
19279 "live CDs, bootable USB keys and more."
19283 #: ../inspector/virt-inspector.pod:314
19285 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19286 "fields may be present to indicate a live CD, network installer, or one part "
19287 "of a multipart CD. For example:"
19291 #: ../inspector/virt-inspector.pod:318
19294 " <operatingsystems>\n"
19295 " <operatingsystem>\n"
19296 " <root>/dev/sda</root>\n"
19297 " <name>linux</name>\n"
19298 " <arch>i386</arch>\n"
19299 " <distro>ubuntu</distro>\n"
19300 " <product_name>Ubuntu 10.10 "Maverick "
19301 "Meerkat"</product_name>\n"
19302 " <major_version>10</major_version>\n"
19303 " <minor_version>10</minor_version>\n"
19304 " <format>installer</format>\n"
19310 #: ../inspector/virt-inspector.pod:330
19311 msgid "USING XPATH"
19315 #: ../inspector/virt-inspector.pod:332
19317 "You can use the XPath query language to select parts of the XML. We "
19318 "recommend using C<xmlstarlet> to perform XPath queries from the command "
19323 #: ../inspector/virt-inspector.pod:338
19326 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
19328 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19329 " <type>ext4</type>\n"
19335 #: ../inspector/virt-inspector.pod:344
19338 " $ virt-inspector -d Guest | \\\n"
19339 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
19345 #: ../inspector/virt-inspector.pod:348
19348 " $ virt-inspector -d Guest | \\\n"
19349 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
19350 " [displays the guest icon, if there is one]\n"
19355 #: ../inspector/virt-inspector.pod:359
19356 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
19360 #: ../inspector/virt-inspector.pod:361
19362 "Early versions of libguestfs shipped with a different virt-inspector program "
19363 "written in Perl (the current version is written in C). The XML output of "
19364 "the Perl virt-inspector was different and it could also output in other "
19365 "formats like text."
19369 #: ../inspector/virt-inspector.pod:366
19370 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
19374 #: ../inspector/virt-inspector.pod:369
19376 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
19377 "versions of virt-inspector with different names:"
19381 #: ../inspector/virt-inspector.pod:372
19384 " virt-inspector Old Perl version.\n"
19385 " virt-inspector2 New C version.\n"
19390 #: ../inspector/virt-inspector.pod:382
19392 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
19393 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
19397 #: ../inspector/virt-inspector.pod:399
19398 msgid "Matthew Booth L<mbooth@redhat.com>"
19402 #: ../java/examples/guestfs-java.pod:5
19403 msgid "guestfs-java - How to use libguestfs from Java"
19407 #: ../java/examples/guestfs-java.pod:9
19410 " import com.redhat.et.libguestfs.*;\n"
19415 #: ../java/examples/guestfs-java.pod:11
19418 " GuestFS g = new GuestFS ();\n"
19419 " g.add_drive_opts (\"disk.img\", null);\n"
19425 #: ../java/examples/guestfs-java.pod:17
19427 "This manual page documents how to call libguestfs from the Java programming "
19428 "language. This page just documents the differences from the C API and gives "
19429 "some examples. If you are not familiar with using libguestfs, you also need "
19430 "to read L<guestfs(3)>."
19434 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
19435 msgid "CLOSING THE HANDLE"
19439 #: ../java/examples/guestfs-java.pod:24
19441 "The handle is closed when it is reaped by the garbage collector. Because "
19442 "libguestfs handles include a lot of state, it is also possible to close (and "
19443 "hence free) them explicitly by calling the C<close> method."
19447 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
19452 #: ../java/examples/guestfs-java.pod:31
19454 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
19455 "exception. This has a single parameter which is the error message (a "
19460 #: ../java/examples/guestfs-java.pod:35
19461 msgid "Calling any method on a closed handle raises the same exception."
19465 #: ../java/examples/guestfs-java.pod:47
19467 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, "
19468 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
19469 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
19473 #: ../java/examples/guestfs-java.pod:63 ../perl/examples/guestfs-perl.pod:57
19474 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
19478 #: ../ocaml/examples/guestfs-ocaml.pod:5
19479 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
19483 #: ../ocaml/examples/guestfs-ocaml.pod:9
19484 msgid "Module style:"
19488 #: ../ocaml/examples/guestfs-ocaml.pod:11
19491 " let g = Guestfs.create () in\n"
19492 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19493 " Guestfs.launch g;\n"
19498 #: ../ocaml/examples/guestfs-ocaml.pod:15
19499 msgid "Object-oriented style:"
19503 #: ../ocaml/examples/guestfs-ocaml.pod:17
19506 " let g = new Guestfs.guestfs () in\n"
19507 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19513 #: ../ocaml/examples/guestfs-ocaml.pod:21
19516 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
19518 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
19523 #: ../ocaml/examples/guestfs-ocaml.pod:27
19525 "This manual page documents how to call libguestfs from the OCaml programming "
19526 "language. This page just documents the differences from the C API and gives "
19527 "some examples. If you are not familiar with using libguestfs, you also need "
19528 "to read L<guestfs(3)>."
19532 #: ../ocaml/examples/guestfs-ocaml.pod:32
19533 msgid "PROGRAMMING STYLES"
19537 #: ../ocaml/examples/guestfs-ocaml.pod:34
19539 "There are two different programming styles supported by the OCaml bindings. "
19540 "You can use a module style, with each C function mapped to an OCaml "
19545 #: ../ocaml/examples/guestfs-ocaml.pod:38
19548 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
19553 #: ../ocaml/examples/guestfs-ocaml.pod:40
19558 #: ../ocaml/examples/guestfs-ocaml.pod:42
19561 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
19566 #: ../ocaml/examples/guestfs-ocaml.pod:44
19568 "Alternately you can use an object-oriented style, calling methods on the "
19569 "class C<Guestfs.guestfs>:"
19573 #: ../ocaml/examples/guestfs-ocaml.pod:47
19576 " method set_verbose : bool -> unit\n"
19581 #: ../ocaml/examples/guestfs-ocaml.pod:49
19583 "The object-oriented style is usually briefer, and the minor performance "
19584 "penalty isn't noticable in the general overhead of performing libguestfs "
19589 #: ../ocaml/examples/guestfs-ocaml.pod:55
19591 "The handle is closed when it is reaped by the garbage collector. Because "
19592 "libguestfs handles include a lot of state, it is also possible to close (and "
19593 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
19598 #: ../ocaml/examples/guestfs-ocaml.pod:62
19600 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
19601 "exception. This has a single parameter which is the error message (a "
19606 #: ../ocaml/examples/guestfs-ocaml.pod:66
19608 "Calling any function/method on a closed handle raises "
19609 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
19614 #: ../ocaml/examples/guestfs-ocaml.pod:80
19616 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
19617 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
19618 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
19622 #: ../perl/examples/guestfs-perl.pod:5
19623 msgid "guestfs-perl - How to use libguestfs from Perl"
19627 #: ../perl/examples/guestfs-perl.pod:9
19630 " use Sys::Guestfs;\n"
19635 #: ../perl/examples/guestfs-perl.pod:11
19638 " my $h = Sys::Guestfs->new ();\n"
19639 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
19640 " $h->launch ();\n"
19641 " $h->mount_options ('', '/dev/sda1', '/');\n"
19642 " $h->touch ('/hello');\n"
19648 #: ../perl/examples/guestfs-perl.pod:20
19650 "This manual page documents how to call libguestfs from the Perl programming "
19651 "language. This page just documents the differences from the C API and gives "
19652 "some examples. If you are not familiar with using libguestfs, you also need "
19653 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
19657 #: ../perl/examples/guestfs-perl.pod:26
19662 #: ../perl/examples/guestfs-perl.pod:28
19664 "Errors from libguestfs functions turn into calls to C<croak> (see "
19669 #: ../perl/examples/guestfs-perl.pod:41
19671 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
19672 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
19673 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
19677 #: ../python/examples/guestfs-python.pod:5
19678 msgid "guestfs-python - How to use libguestfs from Python"
19682 #: ../python/examples/guestfs-python.pod:9
19685 " import guestfs\n"
19686 " g = guestfs.GuestFS ()\n"
19687 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
19693 #: ../python/examples/guestfs-python.pod:16
19695 "This manual page documents how to call libguestfs from the Python "
19696 "programming language. This page just documents the differences from the C "
19697 "API and gives some examples. If you are not familiar with using libguestfs, "
19698 "you also need to read L<guestfs(3)>."
19702 #: ../python/examples/guestfs-python.pod:23
19704 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
19705 "single string argument which is the error message."
19709 #: ../python/examples/guestfs-python.pod:26
19710 msgid "MORE DOCUMENTATION"
19714 #: ../python/examples/guestfs-python.pod:28
19719 #: ../python/examples/guestfs-python.pod:30
19723 " >>> import guestfs\n"
19724 " >>> help (guestfs)\n"
19729 #: ../python/examples/guestfs-python.pod:44
19731 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
19732 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
19733 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
19737 #: ../rescue/virt-rescue.pod:5
19738 msgid "virt-rescue - Run a rescue shell on a virtual machine"
19742 #: ../rescue/virt-rescue.pod:9
19745 " virt-rescue [--options] -d domname\n"
19750 #: ../rescue/virt-rescue.pod:11
19753 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
19758 #: ../rescue/virt-rescue.pod:15
19761 " virt-rescue [--options] domname\n"
19766 #: ../rescue/virt-rescue.pod:17
19769 " virt-rescue [--options] disk.img [disk.img ...]\n"
19774 #: ../rescue/virt-rescue.pod:21
19776 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
19777 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
19778 "you from doing this, but doesn't catch all cases."
19782 #: ../rescue/virt-rescue.pod:25
19784 "However if you use the I<--ro> (read only) option, then you can attach a "
19785 "shell to a live virtual machine. The results might be strange or "
19786 "inconsistent at times but you won't get disk corruption."
19790 #: ../rescue/virt-rescue.pod:31
19792 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
19793 "need for a CD. virt-rescue gives you a rescue shell and some simple "
19794 "recovery tools which you can use to examine or rescue a virtual machine or "
19799 #: ../rescue/virt-rescue.pod:36
19801 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
19802 "on disk image(s):"
19806 #: ../rescue/virt-rescue.pod:39
19809 " virt-rescue -d GuestName\n"
19814 #: ../rescue/virt-rescue.pod:41
19817 " virt-rescue --ro -a /path/to/disk.img\n"
19822 #: ../rescue/virt-rescue.pod:43
19825 " virt-rescue -a /dev/sdc\n"
19830 #: ../rescue/virt-rescue.pod:45
19831 msgid "For live VMs you I<must> use the --ro option."
19835 #: ../rescue/virt-rescue.pod:47
19837 "When you run virt-rescue on a virtual machine or disk image, you are placed "
19838 "in an interactive bash shell where you can use many ordinary Linux "
19839 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
19840 "appliance. You must mount the virtual machine's filesystems by hand. There "
19841 "is an empty directory called C</sysroot> where you can mount filesystems."
19845 #: ../rescue/virt-rescue.pod:54
19847 "In the example below, we list logical volumes, then choose one to mount "
19848 "under C</sysroot>:"
19852 #: ../rescue/virt-rescue.pod:57
19856 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
19857 " lv_root vg_f11x64 -wi-a- 8.83G\n"
19858 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
19859 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
19860 " ><rescue> ls /sysroot\n"
19865 #: ../rescue/virt-rescue.pod:64
19867 "If you don't know what filesystems are available on the virtual machine then "
19868 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
19872 #: ../rescue/virt-rescue.pod:70
19874 "Virt-rescue can be used on I<any> disk image file or device, not just a "
19875 "virtual machine. For example you can use it on a blank file if you want to "
19876 "partition that file (although we would recommend using L<guestfish(1)> "
19877 "instead as it is more suitable for this purpose). You can even use "
19878 "virt-rescue on things like SD cards."
19882 #: ../rescue/virt-rescue.pod:76
19884 "Virt-rescue does not require root. You only need to run it as root if you "
19885 "need root to open the disk image."
19889 #: ../rescue/virt-rescue.pod:79
19891 "This tool is just designed for quick interactive hacking on a virtual "
19892 "machine. For more structured access to a virtual machine disk image, you "
19893 "should use L<guestfs(3)>. To get a structured shell that you can use to "
19894 "make scripted changes to guests, use L<guestfish(1)>."
19898 #: ../rescue/virt-rescue.pod:103
19899 msgid "B<--append kernelopts>"
19903 #: ../rescue/virt-rescue.pod:105
19904 msgid "Pass additional options to the rescue kernel."
19908 #: ../rescue/virt-rescue.pod:135
19911 " virt-rescue --format=raw -a disk.img\n"
19916 #: ../rescue/virt-rescue.pod:139
19919 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
19924 #: ../rescue/virt-rescue.pod:148
19929 #: ../rescue/virt-rescue.pod:150
19930 msgid "B<--memsize MB>"
19934 #: ../rescue/virt-rescue.pod:152
19936 "Change the amount of memory allocated to the rescue system. The default is "
19937 "set by libguestfs and is small but adequate for running system tools. The "
19938 "occasional program might need more memory. The parameter is specified in "
19943 #: ../rescue/virt-rescue.pod:157
19944 msgid "B<--network>"
19948 #: ../rescue/virt-rescue.pod:159
19949 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
19953 #: ../rescue/virt-rescue.pod:165
19954 msgid "Open the image read-only."
19958 #: ../rescue/virt-rescue.pod:175
19960 "Enable SELinux in the rescue appliance. You should read "
19961 "L<guestfs(3)/SELINUX> before using this option."
19965 #: ../rescue/virt-rescue.pod:194
19967 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
19968 "are done read-write."
19972 #: ../rescue/virt-rescue.pod:207
19973 msgid "Previous versions of virt-rescue allowed you to write either:"
19977 #: ../rescue/virt-rescue.pod:209
19980 " virt-rescue disk.img [disk.img ...]\n"
19985 #: ../rescue/virt-rescue.pod:213
19988 " virt-rescue guestname\n"
19993 #: ../rescue/virt-rescue.pod:221
19998 #: ../rescue/virt-rescue.pod:223
20000 "Adding the I<--network> option enables QEMU user networking in the rescue "
20001 "appliance. There are some differences between user networking and ordinary "
20006 #: ../rescue/virt-rescue.pod:229
20007 msgid "ping does not work"
20011 #: ../rescue/virt-rescue.pod:231
20013 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
20014 "send the ping packets, and because virt-rescue must be able to run as "
20015 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
20016 "command. The ping command will appear to resolve addresses but will not be "
20017 "able to send or receive any packets. This does not mean that the network is "
20022 #: ../rescue/virt-rescue.pod:238
20023 msgid "cannot receive connections"
20027 #: ../rescue/virt-rescue.pod:240
20028 msgid "QEMU user networking cannot receive incoming connections."
20032 #: ../rescue/virt-rescue.pod:242
20033 msgid "making TCP connections"
20037 #: ../rescue/virt-rescue.pod:244
20039 "The virt-rescue appliance needs to be small and so does not include many "
20040 "network tools. In particular there is no L<telnet(1)> command. You can "
20041 "make TCP connections from the shell using the magical "
20042 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
20046 #: ../rescue/virt-rescue.pod:249
20049 " exec 3<>/dev/tcp/redhat.com/80\n"
20050 " echo \"GET /\" >&3\n"
20056 #: ../rescue/virt-rescue.pod:253
20057 msgid "See L<bash(1)> for more details."
20061 #: ../rescue/virt-rescue.pod:259
20063 "Several environment variables affect virt-rescue. See "
20064 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
20068 #: ../rescue/virt-rescue.pod:286
20070 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20071 "L<http://libguestfs.org/>."
20075 #: ../resize/virt-resize.pod:5
20076 msgid "virt-resize - Resize a virtual machine disk"
20080 #: ../resize/virt-resize.pod:9
20083 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20084 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20085 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20090 #: ../resize/virt-resize.pod:15
20092 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20093 "larger or smaller overall, and resizing or deleting any partitions contained "
20098 #: ../resize/virt-resize.pod:19
20100 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20101 "not> be used on live virtual machines - for consistent results, shut the "
20102 "virtual machine down before resizing it."
20106 #: ../resize/virt-resize.pod:23
20108 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20109 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20113 #: ../resize/virt-resize.pod:31 ../src/guestfs.pod:469 ../src/guestfs.pod:1257 ../src/guestfs.pod:1395 ../src/guestfs.pod:2558
20118 #: ../resize/virt-resize.pod:33
20120 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20121 "fill the extra 5GB of space."
20125 #: ../resize/virt-resize.pod:36
20128 " virt-filesystems --long -h --all -a olddisk\n"
20133 #: ../resize/virt-resize.pod:38
20136 " truncate -r olddisk newdisk\n"
20137 " truncate -s +5G newdisk\n"
20142 #: ../resize/virt-resize.pod:41
20145 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20146 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20151 #: ../resize/virt-resize.pod:44 ../src/guestfs.pod:475 ../src/guestfs.pod:1261 ../src/guestfs.pod:1399 ../src/guestfs.pod:2583
20156 #: ../resize/virt-resize.pod:46
20158 "As above, but make the /boot partition 200MB bigger, while giving the "
20159 "remaining space to /dev/sda2:"
20163 #: ../resize/virt-resize.pod:49
20166 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20167 " olddisk newdisk\n"
20172 #: ../resize/virt-resize.pod:52 ../src/guestfs.pod:486 ../src/guestfs.pod:1405
20177 #: ../resize/virt-resize.pod:54
20179 "As in the first example, but expand a logical volume as the final step. "
20180 "This is what you would typically use for Linux guests that use LVM:"
20184 #: ../resize/virt-resize.pod:58
20187 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20188 " olddisk newdisk\n"
20193 #: ../resize/virt-resize.pod:61
20198 #: ../resize/virt-resize.pod:63
20200 "As in the first example, but the output format will be qcow2 instead of a "
20205 #: ../resize/virt-resize.pod:66
20208 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20209 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20214 #: ../resize/virt-resize.pod:71
20215 msgid "DETAILED USAGE"
20219 #: ../resize/virt-resize.pod:73
20220 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20224 #: ../resize/virt-resize.pod:77
20225 msgid "1. Shut down the virtual machine"
20229 #: ../resize/virt-resize.pod:79
20230 msgid "2. Locate input disk image"
20234 #: ../resize/virt-resize.pod:81
20236 "Locate the input disk image (ie. the file or device on the host containing "
20237 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20238 "dumpxml> like this to find the disk image name:"
20242 #: ../resize/virt-resize.pod:85
20245 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20246 " Found 1 nodes:\n"
20248 " <source dev=\"/dev/vg/lv_guest\" />\n"
20253 #: ../resize/virt-resize.pod:90
20254 msgid "3. Look at current sizing"
20258 #: ../resize/virt-resize.pod:92
20259 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20263 #: ../resize/virt-resize.pod:95
20266 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20267 " Name Type Size Parent\n"
20268 " /dev/sda1 partition 101M /dev/sda\n"
20269 " /dev/sda2 partition 7.9G /dev/sda\n"
20270 " /dev/sda device 8.0G -\n"
20275 #: ../resize/virt-resize.pod:101
20277 "(This example is a virtual machine with an 8 GB disk which we would like to "
20278 "expand up to 10 GB)."
20282 #: ../resize/virt-resize.pod:104
20283 msgid "4. Create output disk"
20287 #: ../resize/virt-resize.pod:106
20289 "Virt-resize cannot do in-place disk modifications. You have to have space "
20290 "to store the resized output disk."
20294 #: ../resize/virt-resize.pod:109
20295 msgid "To store the resized disk image in a file, create a file of a suitable size:"
20299 #: ../resize/virt-resize.pod:112
20302 " # rm -f outdisk\n"
20303 " # truncate -s 10G outdisk\n"
20308 #: ../resize/virt-resize.pod:115
20309 msgid "Or use L<lvcreate(1)> to create a logical volume:"
20313 #: ../resize/virt-resize.pod:117
20316 " # lvcreate -L 10G -n lv_name vg_name\n"
20321 #: ../resize/virt-resize.pod:119
20322 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
20326 #: ../resize/virt-resize.pod:121
20329 " # virsh pool-list\n"
20330 " # virsh vol-create-as poolname newvol 10G\n"
20335 #: ../resize/virt-resize.pod:124
20340 #: ../resize/virt-resize.pod:126
20342 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
20343 "file) and the output disk. The output disk is the one created in the "
20348 #: ../resize/virt-resize.pod:130
20351 " # virt-resize indisk outdisk\n"
20356 #: ../resize/virt-resize.pod:132
20358 "This command just copies disk image C<indisk> to disk image C<outdisk> "
20359 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
20360 "larger, then an extra, empty partition is created at the end of the disk "
20361 "covering the extra space. If C<outdisk> is smaller, then it will give an "
20366 #: ../resize/virt-resize.pod:138
20368 "More realistically you'd want to expand existing partitions in the disk "
20369 "image by passing extra options (for the full list see the L</OPTIONS> "
20374 #: ../resize/virt-resize.pod:142
20376 "L</--expand> is the most useful option. It expands the named partition "
20377 "within the disk to fill any extra space:"
20381 #: ../resize/virt-resize.pod:145
20384 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
20389 #: ../resize/virt-resize.pod:147
20391 "(In this case, an extra partition is I<not> created at the end of the disk, "
20392 "because there will be no unused space)."
20396 #: ../resize/virt-resize.pod:150
20398 "L</--resize> is the other commonly used option. The following would "
20399 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
20400 "rest of the available space:"
20404 #: ../resize/virt-resize.pod:154
20407 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20408 " indisk outdisk\n"
20413 #: ../resize/virt-resize.pod:157
20415 "If the expanded partition in the image contains a filesystem or LVM PV, then "
20416 "if virt-resize knows how, it will resize the contents, the equivalent of "
20417 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
20418 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
20419 "filesystems, so you would have to online resize them after booting the "
20424 #: ../resize/virt-resize.pod:164
20425 msgid "Other options are covered below."
20429 #: ../resize/virt-resize.pod:166
20434 #: ../resize/virt-resize.pod:168
20435 msgid "Thoroughly test the new disk image I<before> discarding the old one."
20439 #: ../resize/virt-resize.pod:170
20440 msgid "If you are using libvirt, edit the XML to point at the new disk:"
20444 #: ../resize/virt-resize.pod:172
20447 " # virsh edit guestname\n"
20452 #: ../resize/virt-resize.pod:174
20454 "Change E<lt>source ...E<gt>, see "
20455 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
20459 #: ../resize/virt-resize.pod:177
20460 msgid "Then start up the domain with the new, resized disk:"
20464 #: ../resize/virt-resize.pod:179
20467 " # virsh start guestname\n"
20472 #: ../resize/virt-resize.pod:181
20474 "and check that it still works. See also the L</NOTES> section below for "
20475 "additional information."
20479 #: ../resize/virt-resize.pod:184
20480 msgid "7. Resize LVs etc inside the guest"
20484 #: ../resize/virt-resize.pod:186
20485 msgid "(This can also be done offline using L<guestfish(1)>)"
20489 #: ../resize/virt-resize.pod:188
20491 "Once the guest has booted you should see the new space available, at least "
20492 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
20493 "may need to resize LVs inside PVs, and also resize filesystem types that "
20494 "virt-resize does not know how to expand."
20498 #: ../resize/virt-resize.pod:195
20499 msgid "SHRINKING A VIRTUAL MACHINE DISK"
20503 #: ../resize/virt-resize.pod:197
20505 "Shrinking is somewhat more complex than expanding, and only an overview is "
20510 #: ../resize/virt-resize.pod:200
20512 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
20513 "filesystems). The user has to shrink content before passing the disk image "
20514 "to virt-resize, and virt-resize will check that the content has been shrunk "
20519 #: ../resize/virt-resize.pod:205
20520 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
20524 #: ../resize/virt-resize.pod:207
20526 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
20527 "steps 3 and 4 above to allocate a new disk image."
20531 #: ../resize/virt-resize.pod:210
20532 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
20536 #: ../resize/virt-resize.pod:213
20537 msgid "IGNORING OR DELETING PARTITIONS"
20541 #: ../resize/virt-resize.pod:215
20543 "virt-resize also gives a convenient way to ignore or delete partitions when "
20544 "copying from the input disk to the output disk. Ignoring a partition speeds "
20545 "up the copy where you don't care about the existing contents of a "
20546 "partition. Deleting a partition removes it completely, but note that it "
20547 "also renumbers any partitions after the one which is deleted, which can "
20548 "leave some guests unbootable."
20552 #: ../resize/virt-resize.pod:222
20553 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
20557 #: ../resize/virt-resize.pod:224
20559 "If the input disk is in qcow2 format, then you may prefer that the output is "
20560 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
20561 "the fly. The output format is simply determined by the format of the empty "
20562 "output container that you provide. Thus to create qcow2 output, use:"
20566 #: ../resize/virt-resize.pod:230
20569 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
20574 #: ../resize/virt-resize.pod:232
20575 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
20579 #: ../resize/virt-resize.pod:234
20580 msgid "Similarly, to get non-sparse raw output use:"
20584 #: ../resize/virt-resize.pod:236
20587 " fallocate -l size outdisk\n"
20592 #: ../resize/virt-resize.pod:238
20594 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
20595 "if=/dev/zero of=outdisk bs=1M count=..>)"
20599 #: ../resize/virt-resize.pod:247
20600 msgid "Display help."
20604 #: ../resize/virt-resize.pod:249
20609 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
20614 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
20615 msgid "Enable debugging messages."
20619 #: ../resize/virt-resize.pod:255
20620 msgid "B<--delete part>"
20624 #: ../resize/virt-resize.pod:257
20626 "Delete the named partition. It would be more accurate to describe this as "
20627 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
20628 "the original disk image is left intact."
20632 #: ../resize/virt-resize.pod:261
20634 "Note that when you delete a partition, then anything contained in the "
20635 "partition is also deleted. Furthermore, this causes any partitions that "
20636 "come after to be I<renumbered>, which can easily make your guest unbootable."
20640 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327 ../resize/virt-resize.pod:454
20641 msgid "You can give this option multiple times."
20645 #: ../resize/virt-resize.pod:268
20646 msgid "B<--expand part>"
20650 #: ../resize/virt-resize.pod:270
20652 "Expand the named partition so it uses up all extra space (space left over "
20653 "after any other resize changes that you request have been done)."
20657 #: ../resize/virt-resize.pod:273
20659 "If virt-resize knows how, it will expand the direct content of the "
20660 "partition. For example, if the partition is an LVM PV, it will expand the "
20661 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
20662 "content it doesn't know about alone."
20666 #: ../resize/virt-resize.pod:278
20667 msgid "Currently virt-resize can resize:"
20671 #: ../resize/virt-resize.pod:284
20672 msgid "ext2, ext3 and ext4 filesystems."
20676 #: ../resize/virt-resize.pod:288
20677 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
20681 #: ../resize/virt-resize.pod:290
20683 "The filesystem must have been shut down consistently last time it was used. "
20684 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
20685 "consistency check, so at the first boot after resizing Windows will check "
20690 #: ../resize/virt-resize.pod:297
20692 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
20693 "inside the PV, but see the I<--LV-expand> option. The user could also "
20694 "resize LVs as desired after boot."
20698 #: ../resize/virt-resize.pod:303
20699 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
20703 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
20704 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
20708 #: ../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
20709 msgid "B<--format> raw"
20713 #: ../resize/virt-resize.pod:311
20715 "Specify the format of the input disk image. If this flag is not given then "
20716 "it is auto-detected from the image itself."
20720 #: ../resize/virt-resize.pod:317
20722 "Note that this option I<does not> affect the output format. See L</QCOW2 "
20723 "AND NON-SPARSE RAW FORMATS>."
20727 #: ../resize/virt-resize.pod:320
20728 msgid "B<--ignore part>"
20732 #: ../resize/virt-resize.pod:322
20734 "Ignore the named partition. Effectively this means the partition is "
20735 "allocated on the destination disk, but the content is not copied across from "
20736 "the source disk. The content of the partition will be blank (all zero "
20741 #: ../resize/virt-resize.pod:329
20742 msgid "B<--LV-expand logvol>"
20746 #: ../resize/virt-resize.pod:331
20748 "This takes the logical volume and, as a final step, expands it to fill all "
20749 "the space available in its volume group. A typical usage, assuming a Linux "
20750 "guest with a single PV C</dev/sda2> and a root device called "
20751 "C</dev/vg_guest/lv_root> would be:"
20755 #: ../resize/virt-resize.pod:336
20758 " virt-resize indisk outdisk \\\n"
20759 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
20764 #: ../resize/virt-resize.pod:339
20766 "This would first expand the partition (and PV), and then expand the root "
20767 "device to fill the extra space in the PV."
20771 #: ../resize/virt-resize.pod:342
20773 "The contents of the LV are also resized if virt-resize knows how to do "
20774 "that. You can stop virt-resize from trying to expand the content by using "
20775 "the option I<--no-expand-content>."
20779 #: ../resize/virt-resize.pod:346
20780 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
20784 #: ../resize/virt-resize.pod:348
20786 "You can give this option multiple times, I<but> it doesn't make sense to do "
20787 "this unless the logical volumes you specify are all in different volume "
20792 #: ../resize/virt-resize.pod:352
20793 msgid "B<--machine-readable>"
20797 #: ../resize/virt-resize.pod:354
20799 "This option is used to make the output more machine friendly when being "
20800 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
20804 #: ../resize/virt-resize.pod:360
20805 msgid "B<--dryrun>"
20809 #: ../resize/virt-resize.pod:362
20810 msgid "Print a summary of what would be done, but don't do anything."
20814 #: ../resize/virt-resize.pod:364
20815 msgid "B<--no-copy-boot-loader>"
20819 #: ../resize/virt-resize.pod:366
20821 "By default, virt-resize copies over some sectors at the start of the disk "
20822 "(up to the beginning of the first partition). Commonly these sectors "
20823 "contain the Master Boot Record (MBR) and the boot loader, and are required "
20824 "in order for the guest to boot correctly."
20828 #: ../resize/virt-resize.pod:371
20830 "If you specify this flag, then this initial copy is not done. You may need "
20831 "to reinstall the boot loader in this case."
20835 #: ../resize/virt-resize.pod:374
20836 msgid "B<--no-extra-partition>"
20840 #: ../resize/virt-resize.pod:376
20842 "By default, virt-resize creates an extra partition if there is any extra, "
20843 "unused space after all resizing has happened. Use this option to prevent "
20844 "the extra partition from being created. If you do this then the extra space "
20845 "will be inaccessible until you run fdisk, parted, or some other partitioning "
20846 "tool in the guest."
20850 #: ../resize/virt-resize.pod:382
20852 "Note that if the surplus space is smaller than 10 MB, no extra partition "
20857 #: ../resize/virt-resize.pod:385
20858 msgid "B<--no-expand-content>"
20862 #: ../resize/virt-resize.pod:387
20864 "By default, virt-resize will try to expand the direct contents of "
20865 "partitions, if it knows how (see I<--expand> option above)."
20869 #: ../resize/virt-resize.pod:390
20871 "If you give the I<--no-expand-content> option then virt-resize will not "
20876 #: ../resize/virt-resize.pod:393
20877 msgid "B<--ntfsresize-force>"
20881 #: ../resize/virt-resize.pod:395
20883 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
20884 "the NTFS disk is marked as needing a consistency check. You have to use "
20885 "this option if you want to resize a Windows guest multiple times without "
20886 "booting into Windows between each resize."
20890 #: ../resize/virt-resize.pod:401
20891 msgid "B<--output-format> raw"
20895 #: ../resize/virt-resize.pod:403
20897 "Specify the format of the output disk image. If this flag is not given then "
20898 "it is auto-detected from the image itself."
20902 #: ../resize/virt-resize.pod:409
20904 "Note that this option I<does not create> the output format. This option "
20905 "just tells libguestfs what it is so it doesn't try to guess it. You still "
20906 "need to create the output disk with the right format. See L</QCOW2 AND "
20907 "NON-SPARSE RAW FORMATS>."
20911 #: ../resize/virt-resize.pod:414
20916 #: ../resize/virt-resize.pod:416
20921 #: ../resize/virt-resize.pod:418
20922 msgid "Don't print the summary."
20926 #: ../resize/virt-resize.pod:420
20927 msgid "B<--resize part=size>"
20931 #: ../resize/virt-resize.pod:422
20933 "Resize the named partition (expanding or shrinking it) so that it has the "
20938 #: ../resize/virt-resize.pod:425
20940 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
20941 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
20942 "size; or as a relative number or percentage. For example:"
20946 #: ../resize/virt-resize.pod:431
20949 " --resize /dev/sda2=10G\n"
20954 #: ../resize/virt-resize.pod:433
20957 " --resize /dev/sda4=90%\n"
20962 #: ../resize/virt-resize.pod:435
20965 " --resize /dev/sda2=+1G\n"
20970 #: ../resize/virt-resize.pod:437
20973 " --resize /dev/sda2=-200M\n"
20978 #: ../resize/virt-resize.pod:439
20981 " --resize /dev/sda1=+128K\n"
20986 #: ../resize/virt-resize.pod:441
20989 " --resize /dev/sda1=+10%\n"
20994 #: ../resize/virt-resize.pod:443
20997 " --resize /dev/sda1=-10%\n"
21002 #: ../resize/virt-resize.pod:445
21004 "You can increase the size of any partition. Virt-resize will expand the "
21005 "direct content of the partition if it knows how (see I<--expand> below)."
21009 #: ../resize/virt-resize.pod:449
21011 "You can only I<decrease> the size of partitions that contain filesystems or "
21012 "PVs which have already been shrunk. Virt-resize will check this has been "
21013 "done before proceeding, or else will print an error (see also "
21014 "I<--resize-force>)."
21018 #: ../resize/virt-resize.pod:456
21019 msgid "B<--resize-force part=size>"
21023 #: ../resize/virt-resize.pod:458
21025 "This is the same as I<--resize> except that it will let you decrease the "
21026 "size of any partition. Generally this means you will lose any data which "
21027 "was at the end of the partition you shrink, but you may not care about that "
21028 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
21029 "as a swap partition)."
21033 #: ../resize/virt-resize.pod:464
21034 msgid "See also the I<--ignore> option."
21038 #: ../resize/virt-resize.pod:466
21039 msgid "B<--shrink part>"
21043 #: ../resize/virt-resize.pod:468
21045 "Shrink the named partition until the overall disk image fits in the "
21046 "destination. The named partition B<must> contain a filesystem or PV which "
21047 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
21048 "online tools). Virt-resize will check this and give an error if it has not "
21053 #: ../resize/virt-resize.pod:474
21055 "The amount by which the overall disk must be shrunk (after carrying out all "
21056 "other operations requested by the user) is called the \"deficit\". For "
21057 "example, a straight copy (assume no other operations) from a 5GB disk image "
21058 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
21059 "would give an error unless the user specified a partition to shrink and that "
21060 "partition had more than a gigabyte of free space."
21064 #: ../resize/virt-resize.pod:492
21065 msgid "MACHINE READABLE OUTPUT"
21069 #: ../resize/virt-resize.pod:494
21071 "The I<--machine-readable> option can be used to make the output more machine "
21072 "friendly, which is useful when calling virt-resize from other programs, GUIs "
21077 #: ../resize/virt-resize.pod:498
21079 "Use the option on its own to query the capabilities of the virt-resize "
21080 "binary. Typical output looks like this:"
21084 #: ../resize/virt-resize.pod:501
21087 " $ virt-resize --machine-readable\n"
21089 " ntfsresize-force\n"
21097 #: ../resize/virt-resize.pod:508
21099 "A list of features is printed, one per line, and the program exits with "
21104 #: ../resize/virt-resize.pod:513
21105 msgid "\"Partition 1 does not end on cylinder boundary.\""
21109 #: ../resize/virt-resize.pod:515
21111 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
21112 "means the partitions will not be aligned to the ancient CHS geometry. "
21113 "However CHS geometry is meaningless for disks manufactured since the early "
21114 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
21115 "cylinders is not required by any modern operating system."
21119 #: ../resize/virt-resize.pod:522
21120 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
21124 #: ../resize/virt-resize.pod:524
21126 "In Windows Vista and later versions, Microsoft switched to using a separate "
21127 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
21128 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
21129 "the boot partition. Doing so seems to break the guest completely. However "
21130 "expanding the second partition (ie. C: drive) should work."
21134 #: ../resize/virt-resize.pod:531
21136 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21137 "NTFS partitions have been expanded. This is just a safety check and (unless "
21138 "it find errors) is nothing to worry about."
21142 #: ../resize/virt-resize.pod:535
21143 msgid "GUEST BOOT STUCK AT \"GRUB\""
21147 #: ../resize/virt-resize.pod:537
21149 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21150 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21151 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21152 "although we think is to do with partition alignment."
21156 #: ../resize/virt-resize.pod:542
21159 " guestfish -i -a newdisk\n"
21160 " ><fs> cat /boot/grub/device.map\n"
21161 " # check the contents of this file are sensible or\n"
21162 " # edit the file if necessary\n"
21163 " ><fs> grub-install / /dev/vda\n"
21169 #: ../resize/virt-resize.pod:549
21171 "For more flexible guest reconfiguration, including if you need to specify "
21172 "other parameters to grub-install, use L<virt-rescue(1)>."
21176 #: ../resize/virt-resize.pod:552
21177 msgid "ALTERNATIVE TOOLS"
21181 #: ../resize/virt-resize.pod:554
21183 "There are several proprietary tools for resizing partitions. We won't "
21184 "mention any here."
21188 #: ../resize/virt-resize.pod:557
21190 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21191 "operations on disk images. They can resize and move partitions, but I don't "
21192 "think they can do anything with the contents, and they certainly don't "
21197 #: ../resize/virt-resize.pod:562
21199 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21200 "but at a much lower level. You will probably end up hand-calculating sector "
21201 "offsets, which is something that virt-resize was designed to avoid. If you "
21202 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21207 #: ../resize/virt-resize.pod:582
21209 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
21210 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
21211 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
21212 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
21213 "L<http://libguestfs.org/>."
21217 #: ../ruby/examples/guestfs-ruby.pod:5
21218 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21222 #: ../ruby/examples/guestfs-ruby.pod:9
21225 " require 'guestfs'\n"
21226 " g = Guestfs::Guestfs.new()\n"
21227 " g.add_drive_opts(\"disk.img\",\n"
21228 " :readonly => 1, :format => \"raw\")\n"
21234 #: ../ruby/examples/guestfs-ruby.pod:17
21236 "This manual page documents how to call libguestfs from the Ruby programming "
21237 "language. This page just documents the differences from the C API and gives "
21238 "some examples. If you are not familiar with using libguestfs, you also need "
21239 "to read L<guestfs(3)>."
21243 #: ../ruby/examples/guestfs-ruby.pod:24
21245 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21246 "This has a single parameter which is the error message (a string)."
21250 #: ../ruby/examples/guestfs-ruby.pod:38
21252 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
21253 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21254 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
21258 #: ../src/guestfs-actions.pod:1
21259 msgid "guestfs_add_cdrom"
21263 #: ../src/guestfs-actions.pod:3
21267 " guestfs_add_cdrom (guestfs_h *g,\n"
21268 " const char *filename);\n"
21273 #: ../src/guestfs-actions.pod:17
21275 "This call checks for the existence of C<filename>. This stops you from "
21276 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21277 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21282 #: ../src/guestfs-actions.pod:24
21284 "If you just want to add an ISO file (often you use this as an efficient way "
21285 "to transfer large files into the guest), then you should probably use "
21286 "C<guestfs_add_drive_ro> instead."
21290 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273 ../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:1168 ../src/guestfs-actions.pod:1186 ../src/guestfs-actions.pod:1205 ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:1340 ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1513 ../src/guestfs-actions.pod:1547 ../src/guestfs-actions.pod:1762 ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1871 ../src/guestfs-actions.pod:2368 ../src/guestfs-actions.pod:2512 ../src/guestfs-actions.pod:2573 ../src/guestfs-actions.pod:2608 ../src/guestfs-actions.pod:3648 ../src/guestfs-actions.pod:3663 ../src/guestfs-actions.pod:3688 ../src/guestfs-actions.pod:3877 ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3904 ../src/guestfs-actions.pod:3918 ../src/guestfs-actions.pod:3933 ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:4041 ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4078 ../src/guestfs-actions.pod:4101 ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:4159 ../src/guestfs-actions.pod:4178 ../src/guestfs-actions.pod:4197 ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4244 ../src/guestfs-actions.pod:4280 ../src/guestfs-actions.pod:4296 ../src/guestfs-actions.pod:4309 ../src/guestfs-actions.pod:4324 ../src/guestfs-actions.pod:4341 ../src/guestfs-actions.pod:4434 ../src/guestfs-actions.pod:4454 ../src/guestfs-actions.pod:4467 ../src/guestfs-actions.pod:4518 ../src/guestfs-actions.pod:4536 ../src/guestfs-actions.pod:4554 ../src/guestfs-actions.pod:4570 ../src/guestfs-actions.pod:4584 ../src/guestfs-actions.pod:4598 ../src/guestfs-actions.pod:4615 ../src/guestfs-actions.pod:4630 ../src/guestfs-actions.pod:4650 ../src/guestfs-actions.pod:4720 ../src/guestfs-actions.pod:4793 ../src/guestfs-actions.pod:4824 ../src/guestfs-actions.pod:4843 ../src/guestfs-actions.pod:4862 ../src/guestfs-actions.pod:4874 ../src/guestfs-actions.pod:4891 ../src/guestfs-actions.pod:4904 ../src/guestfs-actions.pod:4919 ../src/guestfs-actions.pod:4934 ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:5002 ../src/guestfs-actions.pod:5041 ../src/guestfs-actions.pod:5061 ../src/guestfs-actions.pod:5075 ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5141 ../src/guestfs-actions.pod:5187 ../src/guestfs-actions.pod:5241 ../src/guestfs-actions.pod:5277 ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5329 ../src/guestfs-actions.pod:5347 ../src/guestfs-actions.pod:5487 ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5566 ../src/guestfs-actions.pod:5584 ../src/guestfs-actions.pod:5616 ../src/guestfs-actions.pod:5682 ../src/guestfs-actions.pod:5699 ../src/guestfs-actions.pod:5712 ../src/guestfs-actions.pod:5726 ../src/guestfs-actions.pod:6015 ../src/guestfs-actions.pod:6034 ../src/guestfs-actions.pod:6053 ../src/guestfs-actions.pod:6067 ../src/guestfs-actions.pod:6079 ../src/guestfs-actions.pod:6093 ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6119 ../src/guestfs-actions.pod:6135 ../src/guestfs-actions.pod:6156 ../src/guestfs-actions.pod:6175 ../src/guestfs-actions.pod:6194 ../src/guestfs-actions.pod:6224 ../src/guestfs-actions.pod:6242 ../src/guestfs-actions.pod:6265 ../src/guestfs-actions.pod:6283 ../src/guestfs-actions.pod:6302 ../src/guestfs-actions.pod:6323 ../src/guestfs-actions.pod:6342 ../src/guestfs-actions.pod:6359 ../src/guestfs-actions.pod:6378 ../src/guestfs-actions.pod:6406 ../src/guestfs-actions.pod:6430 ../src/guestfs-actions.pod:6449 ../src/guestfs-actions.pod:6473 ../src/guestfs-actions.pod:6492 ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:6526 ../src/guestfs-actions.pod:6563 ../src/guestfs-actions.pod:6593 ../src/guestfs-actions.pod:6626 ../src/guestfs-actions.pod:6748 ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:6881 ../src/guestfs-actions.pod:6894 ../src/guestfs-actions.pod:6907 ../src/guestfs-actions.pod:6929 ../src/guestfs-actions.pod:6942 ../src/guestfs-actions.pod:6955 ../src/guestfs-actions.pod:6968 ../src/guestfs-actions.pod:6983 ../src/guestfs-actions.pod:7042 ../src/guestfs-actions.pod:7059 ../src/guestfs-actions.pod:7075 ../src/guestfs-actions.pod:7091 ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7121 ../src/guestfs-actions.pod:7141 ../src/guestfs-actions.pod:7177 ../src/guestfs-actions.pod:7191 ../src/guestfs-actions.pod:7232 ../src/guestfs-actions.pod:7245 ../src/guestfs-actions.pod:7263 ../src/guestfs-actions.pod:7297 ../src/guestfs-actions.pod:7333 ../src/guestfs-actions.pod:7449 ../src/guestfs-actions.pod:7464 ../src/guestfs-actions.pod:7478 ../src/guestfs-actions.pod:7533 ../src/guestfs-actions.pod:7546 ../src/guestfs-actions.pod:7591 ../src/guestfs-actions.pod:7624 ../src/guestfs-actions.pod:7687 ../src/guestfs-actions.pod:7707 ../src/guestfs-actions.pod:7733 ../src/guestfs-actions.pod:7804 ../src/guestfs-actions.pod:7827 ../src/guestfs-actions.pod:7856
21291 msgid "This function returns 0 on success or -1 on error."
21295 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:254 ../src/guestfs-actions.pod:275
21297 "This function is deprecated. In new code, use the "
21298 "L</guestfs_add_drive_opts> call instead."
21302 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1170 ../src/guestfs-actions.pod:1985 ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2197 ../src/guestfs-actions.pod:3650 ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:4978 ../src/guestfs-actions.pod:6244 ../src/guestfs-actions.pod:6361 ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6985 ../src/guestfs-actions.pod:7110 ../src/guestfs-actions.pod:7633
21303 msgid "(Added in 0.3)"
21307 #: ../src/guestfs-actions.pod:41
21308 msgid "guestfs_add_domain"
21312 #: ../src/guestfs-actions.pod:43
21316 " guestfs_add_domain (guestfs_h *g,\n"
21317 " const char *dom,\n"
21323 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:2853 ../src/guestfs-actions.pod:4669 ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5205
21325 "You may supply a list of optional arguments to this call. Use zero or more "
21326 "of the following pairs of parameters, and terminate the list with C<-1> on "
21327 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
21331 #: ../src/guestfs-actions.pod:53
21334 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
21335 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
21336 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
21337 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
21338 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
21343 #: ../src/guestfs-actions.pod:59
21345 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
21346 "It works by connecting to libvirt, requesting the domain and domain XML from "
21347 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
21352 #: ../src/guestfs-actions.pod:94
21354 "The other optional parameters are passed directly through to "
21355 "C<guestfs_add_drive_opts>."
21359 #: ../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:1385 ../src/guestfs-actions.pod:1741 ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2106 ../src/guestfs-actions.pod:2161 ../src/guestfs-actions.pod:2184 ../src/guestfs-actions.pod:2499 ../src/guestfs-actions.pod:2971 ../src/guestfs-actions.pod:2989 ../src/guestfs-actions.pod:5164 ../src/guestfs-actions.pod:5384 ../src/guestfs-actions.pod:5796 ../src/guestfs-actions.pod:5822 ../src/guestfs-actions.pod:7218 ../src/guestfs-actions.pod:7644 ../src/guestfs-actions.pod:7657 ../src/guestfs-actions.pod:7670
21360 msgid "On error this function returns -1."
21364 #: ../src/guestfs-actions.pod:99
21365 msgid "(Added in 1.7.4)"
21369 #: ../src/guestfs-actions.pod:101
21370 msgid "guestfs_add_domain_va"
21374 #: ../src/guestfs-actions.pod:103
21378 " guestfs_add_domain_va (guestfs_h *g,\n"
21379 " const char *dom,\n"
21380 " va_list args);\n"
21385 #: ../src/guestfs-actions.pod:108
21386 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
21390 #: ../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:2937 ../src/guestfs-actions.pod:2949 ../src/guestfs-actions.pod:4734 ../src/guestfs-actions.pod:4746 ../src/guestfs-actions.pod:5016 ../src/guestfs-actions.pod:5028 ../src/guestfs-actions.pod:5254 ../src/guestfs-actions.pod:5265
21391 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
21395 #: ../src/guestfs-actions.pod:112
21396 msgid "guestfs_add_domain_argv"
21400 #: ../src/guestfs-actions.pod:114
21404 " guestfs_add_domain_argv (guestfs_h *g,\n"
21405 " const char *dom,\n"
21406 " const struct guestfs_add_domain_argv *optargs);\n"
21411 #: ../src/guestfs-actions.pod:119
21412 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
21416 #: ../src/guestfs-actions.pod:123
21417 msgid "guestfs_add_drive"
21421 #: ../src/guestfs-actions.pod:125
21425 " guestfs_add_drive (guestfs_h *g,\n"
21426 " const char *filename);\n"
21431 #: ../src/guestfs-actions.pod:129
21433 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
21434 "optional parameters, so the disk is added writable, with the format being "
21435 "detected automatically."
21439 #: ../src/guestfs-actions.pod:133
21441 "Automatic detection of the format opens you up to a potential security hole "
21442 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
21443 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
21444 "you should think about replacing calls to this function with calls to "
21445 "C<guestfs_add_drive_opts>, and specifying the format."
21449 #: ../src/guestfs-actions.pod:144
21450 msgid "guestfs_add_drive_opts"
21454 #: ../src/guestfs-actions.pod:146
21458 " guestfs_add_drive_opts (guestfs_h *g,\n"
21459 " const char *filename,\n"
21465 #: ../src/guestfs-actions.pod:156
21468 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
21469 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
21470 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
21475 #: ../src/guestfs-actions.pod:185
21477 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
21478 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
21479 "Possible formats include C<raw> and C<qcow2>."
21483 #: ../src/guestfs-actions.pod:196
21485 "This rarely-used option lets you emulate the behaviour of the deprecated "
21486 "C<guestfs_add_drive_with_if> call (q.v.)"
21490 #: ../src/guestfs-actions.pod:203
21491 msgid "(Added in 1.5.23)"
21495 #: ../src/guestfs-actions.pod:205
21496 msgid "guestfs_add_drive_opts_va"
21500 #: ../src/guestfs-actions.pod:207
21504 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
21505 " const char *filename,\n"
21506 " va_list args);\n"
21511 #: ../src/guestfs-actions.pod:212
21512 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
21516 #: ../src/guestfs-actions.pod:216
21517 msgid "guestfs_add_drive_opts_argv"
21521 #: ../src/guestfs-actions.pod:218
21525 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
21526 " const char *filename,\n"
21527 " const struct guestfs_add_drive_opts_argv "
21533 #: ../src/guestfs-actions.pod:223
21534 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
21538 #: ../src/guestfs-actions.pod:227
21539 msgid "guestfs_add_drive_ro"
21543 #: ../src/guestfs-actions.pod:229
21547 " guestfs_add_drive_ro (guestfs_h *g,\n"
21548 " const char *filename);\n"
21553 #: ../src/guestfs-actions.pod:233
21555 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
21556 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
21557 "disk is added read-only, with the format being detected automatically."
21561 #: ../src/guestfs-actions.pod:240
21562 msgid "(Added in 1.0.38)"
21566 #: ../src/guestfs-actions.pod:242
21567 msgid "guestfs_add_drive_ro_with_if"
21571 #: ../src/guestfs-actions.pod:244
21575 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
21576 " const char *filename,\n"
21577 " const char *iface);\n"
21582 #: ../src/guestfs-actions.pod:249
21584 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
21585 "QEMU interface emulation to use at run time."
21589 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282 ../src/guestfs-actions.pod:2458
21590 msgid "(Added in 1.0.84)"
21594 #: ../src/guestfs-actions.pod:263
21595 msgid "guestfs_add_drive_with_if"
21599 #: ../src/guestfs-actions.pod:265
21603 " guestfs_add_drive_with_if (guestfs_h *g,\n"
21604 " const char *filename,\n"
21605 " const char *iface);\n"
21610 #: ../src/guestfs-actions.pod:270
21612 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
21613 "QEMU interface emulation to use at run time."
21617 #: ../src/guestfs-actions.pod:284
21618 msgid "guestfs_aug_clear"
21622 #: ../src/guestfs-actions.pod:286
21626 " guestfs_aug_clear (guestfs_h *g,\n"
21627 " const char *augpath);\n"
21632 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2186
21633 msgid "(Added in 1.3.4)"
21637 #: ../src/guestfs-actions.pod:297
21638 msgid "guestfs_aug_close"
21642 #: ../src/guestfs-actions.pod:299
21646 " guestfs_aug_close (guestfs_h *g);\n"
21651 #: ../src/guestfs-actions.pod:302
21653 "Close the current Augeas handle and free up any resources used by it. After "
21654 "calling this, you have to call C<guestfs_aug_init> again before you can use "
21655 "any other Augeas functions."
21659 #: ../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:5873
21660 msgid "(Added in 0.7)"
21664 #: ../src/guestfs-actions.pod:311
21665 msgid "guestfs_aug_defnode"
21669 #: ../src/guestfs-actions.pod:313
21672 " struct guestfs_int_bool *\n"
21673 " guestfs_aug_defnode (guestfs_h *g,\n"
21674 " const char *name,\n"
21675 " const char *expr,\n"
21676 " const char *val);\n"
21681 #: ../src/guestfs-actions.pod:322
21683 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
21684 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
21685 "containing that single node."
21689 #: ../src/guestfs-actions.pod:330
21691 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
21692 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
21696 #: ../src/guestfs-actions.pod:336
21697 msgid "guestfs_aug_defvar"
21701 #: ../src/guestfs-actions.pod:338
21705 " guestfs_aug_defvar (guestfs_h *g,\n"
21706 " const char *name,\n"
21707 " const char *expr);\n"
21712 #: ../src/guestfs-actions.pod:354
21713 msgid "guestfs_aug_get"
21717 #: ../src/guestfs-actions.pod:356
21721 " guestfs_aug_get (guestfs_h *g,\n"
21722 " const char *augpath);\n"
21727 #: ../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:1254 ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:1290 ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1612 ../src/guestfs-actions.pod:1724 ../src/guestfs-actions.pod:1887 ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:2007 ../src/guestfs-actions.pod:2028 ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2627 ../src/guestfs-actions.pod:2717 ../src/guestfs-actions.pod:2821 ../src/guestfs-actions.pod:2840 ../src/guestfs-actions.pod:3054 ../src/guestfs-actions.pod:3082 ../src/guestfs-actions.pod:3103 ../src/guestfs-actions.pod:3137 ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3216 ../src/guestfs-actions.pod:3236 ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:4216 ../src/guestfs-actions.pod:4386 ../src/guestfs-actions.pod:4496 ../src/guestfs-actions.pod:5402 ../src/guestfs-actions.pod:5601 ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5949 ../src/guestfs-actions.pod:5998 ../src/guestfs-actions.pod:6654 ../src/guestfs-actions.pod:6670 ../src/guestfs-actions.pod:6687 ../src/guestfs-actions.pod:6718 ../src/guestfs-actions.pod:7392 ../src/guestfs-actions.pod:7411 ../src/guestfs-actions.pod:7429 ../src/guestfs-actions.pod:7603 ../src/guestfs-actions.pod:7913
21729 "This function returns a string, or NULL on error. I<The caller must free "
21730 "the returned string after use>."
21734 #: ../src/guestfs-actions.pod:368
21735 msgid "guestfs_aug_init"
21739 #: ../src/guestfs-actions.pod:370
21743 " guestfs_aug_init (guestfs_h *g,\n"
21744 " const char *root,\n"
21750 #: ../src/guestfs-actions.pod:379
21751 msgid "You must call this before using any other C<guestfs_aug_*> commands."
21755 #: ../src/guestfs-actions.pod:404
21757 "This option is only useful when debugging Augeas lenses. Use of this option "
21758 "may require additional memory for the libguestfs appliance. You may need to "
21759 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
21760 "C<guestfs_set_memsize>."
21764 #: ../src/guestfs-actions.pod:419
21765 msgid "Do not load the tree in C<guestfs_aug_init>."
21769 #: ../src/guestfs-actions.pod:423
21770 msgid "To close the handle, you can call C<guestfs_aug_close>."
21774 #: ../src/guestfs-actions.pod:431
21775 msgid "guestfs_aug_insert"
21779 #: ../src/guestfs-actions.pod:433
21783 " guestfs_aug_insert (guestfs_h *g,\n"
21784 " const char *augpath,\n"
21785 " const char *label,\n"
21791 #: ../src/guestfs-actions.pod:451
21792 msgid "guestfs_aug_load"
21796 #: ../src/guestfs-actions.pod:453
21800 " guestfs_aug_load (guestfs_h *g);\n"
21805 #: ../src/guestfs-actions.pod:465
21806 msgid "guestfs_aug_ls"
21810 #: ../src/guestfs-actions.pod:467
21814 " guestfs_aug_ls (guestfs_h *g,\n"
21815 " const char *augpath);\n"
21820 #: ../src/guestfs-actions.pod:471
21822 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
21823 "sorting the resulting nodes into alphabetical order."
21827 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490 ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:1561 ../src/guestfs-actions.pod:1580 ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:2281 ../src/guestfs-actions.pod:2297 ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2381 ../src/guestfs-actions.pod:2405 ../src/guestfs-actions.pod:2476 ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:3156 ../src/guestfs-actions.pod:3432 ../src/guestfs-actions.pod:3746 ../src/guestfs-actions.pod:3763 ../src/guestfs-actions.pod:3783 ../src/guestfs-actions.pod:3845 ../src/guestfs-actions.pod:3950 ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:5125 ../src/guestfs-actions.pod:5743 ../src/guestfs-actions.pod:5869 ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6734 ../src/guestfs-actions.pod:6795 ../src/guestfs-actions.pod:6850 ../src/guestfs-actions.pod:6996 ../src/guestfs-actions.pod:7020 ../src/guestfs-actions.pod:7496 ../src/guestfs-actions.pod:7516 ../src/guestfs-actions.pod:7563 ../src/guestfs-actions.pod:7757 ../src/guestfs-actions.pod:7776 ../src/guestfs-actions.pod:7870 ../src/guestfs-actions.pod:7889 ../src/guestfs-actions.pod:7935 ../src/guestfs-actions.pod:7954
21829 "This function returns a NULL-terminated array of strings (like "
21830 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
21831 "strings and the array after use>."
21835 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1496 ../src/guestfs-actions.pod:3510 ../src/guestfs-actions.pod:3541 ../src/guestfs-actions.pod:4199 ../src/guestfs-actions.pod:4249 ../src/guestfs-actions.pod:4436 ../src/guestfs-actions.pod:4469 ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:5129 ../src/guestfs-actions.pod:5684 ../src/guestfs-actions.pod:6081 ../src/guestfs-actions.pod:6095 ../src/guestfs-actions.pod:6107 ../src/guestfs-actions.pod:6575 ../src/guestfs-actions.pod:7234 ../src/guestfs-actions.pod:7247 ../src/guestfs-actions.pod:7480 ../src/guestfs-actions.pod:7745
21836 msgid "(Added in 0.8)"
21840 #: ../src/guestfs-actions.pod:480
21841 msgid "guestfs_aug_match"
21845 #: ../src/guestfs-actions.pod:482
21849 " guestfs_aug_match (guestfs_h *g,\n"
21850 " const char *augpath);\n"
21855 #: ../src/guestfs-actions.pod:496
21856 msgid "guestfs_aug_mv"
21860 #: ../src/guestfs-actions.pod:498
21864 " guestfs_aug_mv (guestfs_h *g,\n"
21865 " const char *src,\n"
21866 " const char *dest);\n"
21871 #: ../src/guestfs-actions.pod:510
21872 msgid "guestfs_aug_rm"
21876 #: ../src/guestfs-actions.pod:512
21880 " guestfs_aug_rm (guestfs_h *g,\n"
21881 " const char *augpath);\n"
21886 #: ../src/guestfs-actions.pod:524
21887 msgid "guestfs_aug_save"
21891 #: ../src/guestfs-actions.pod:526
21895 " guestfs_aug_save (guestfs_h *g);\n"
21900 #: ../src/guestfs-actions.pod:531
21902 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
21907 #: ../src/guestfs-actions.pod:538
21908 msgid "guestfs_aug_set"
21912 #: ../src/guestfs-actions.pod:540
21916 " guestfs_aug_set (guestfs_h *g,\n"
21917 " const char *augpath,\n"
21918 " const char *val);\n"
21923 #: ../src/guestfs-actions.pod:547
21925 "In the Augeas API, it is possible to clear a node by setting the value to "
21926 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
21927 "this call. Instead you must use the C<guestfs_aug_clear> call."
21931 #: ../src/guestfs-actions.pod:556
21932 msgid "guestfs_available"
21936 #: ../src/guestfs-actions.pod:558
21940 " guestfs_available (guestfs_h *g,\n"
21941 " char *const *groups);\n"
21946 #: ../src/guestfs-actions.pod:566
21948 "The libguestfs groups, and the functions that those groups correspond to, "
21949 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
21950 "runtime by calling C<guestfs_available_all_groups>."
21954 #: ../src/guestfs-actions.pod:590
21955 msgid "You must call C<guestfs_launch> before calling this function."
21959 #: ../src/guestfs-actions.pod:612
21961 "This call was added in version C<1.0.80>. In previous versions of "
21962 "libguestfs all you could do would be to speculatively execute a command to "
21963 "find out if the daemon implemented it. See also C<guestfs_version>."
21967 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1241
21968 msgid "(Added in 1.0.80)"
21972 #: ../src/guestfs-actions.pod:623
21973 msgid "guestfs_available_all_groups"
21977 #: ../src/guestfs-actions.pod:625
21981 " guestfs_available_all_groups (guestfs_h *g);\n"
21986 #: ../src/guestfs-actions.pod:628
21988 "This command returns a list of all optional groups that this daemon knows "
21989 "about. Note this returns both supported and unsupported groups. To find "
21990 "out which ones the daemon can actually support you have to call "
21991 "C<guestfs_available> on each member of the returned list."
21995 #: ../src/guestfs-actions.pod:634
21996 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
22000 #: ../src/guestfs-actions.pod:640
22001 msgid "(Added in 1.3.15)"
22005 #: ../src/guestfs-actions.pod:642
22006 msgid "guestfs_base64_in"
22010 #: ../src/guestfs-actions.pod:644
22014 " guestfs_base64_in (guestfs_h *g,\n"
22015 " const char *base64file,\n"
22016 " const char *filename);\n"
22021 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
22022 msgid "(Added in 1.3.5)"
22026 #: ../src/guestfs-actions.pod:656
22027 msgid "guestfs_base64_out"
22031 #: ../src/guestfs-actions.pod:658
22035 " guestfs_base64_out (guestfs_h *g,\n"
22036 " const char *filename,\n"
22037 " const char *base64file);\n"
22042 #: ../src/guestfs-actions.pod:670
22043 msgid "guestfs_blockdev_flushbufs"
22047 #: ../src/guestfs-actions.pod:672
22051 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
22052 " const char *device);\n"
22057 #: ../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
22058 msgid "(Added in 0.9.3)"
22062 #: ../src/guestfs-actions.pod:685
22063 msgid "guestfs_blockdev_getbsz"
22067 #: ../src/guestfs-actions.pod:687
22071 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
22072 " const char *device);\n"
22077 #: ../src/guestfs-actions.pod:702
22078 msgid "guestfs_blockdev_getro"
22082 #: ../src/guestfs-actions.pod:704
22086 " guestfs_blockdev_getro (guestfs_h *g,\n"
22087 " const char *device);\n"
22092 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1479 ../src/guestfs-actions.pod:1494 ../src/guestfs-actions.pod:1983 ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:2132 ../src/guestfs-actions.pod:2147 ../src/guestfs-actions.pod:2172 ../src/guestfs-actions.pod:2195 ../src/guestfs-actions.pod:3253 ../src/guestfs-actions.pod:3269 ../src/guestfs-actions.pod:3287 ../src/guestfs-actions.pod:3449 ../src/guestfs-actions.pod:3463 ../src/guestfs-actions.pod:3478 ../src/guestfs-actions.pod:3492 ../src/guestfs-actions.pod:3508 ../src/guestfs-actions.pod:3523 ../src/guestfs-actions.pod:3539 ../src/guestfs-actions.pod:3553 ../src/guestfs-actions.pod:3566 ../src/guestfs-actions.pod:3580 ../src/guestfs-actions.pod:3595 ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3637 ../src/guestfs-actions.pod:5366
22093 msgid "This function returns a C truth value on success or -1 on error."
22097 #: ../src/guestfs-actions.pod:717
22098 msgid "guestfs_blockdev_getsize64"
22102 #: ../src/guestfs-actions.pod:719
22106 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
22107 " const char *device);\n"
22112 #: ../src/guestfs-actions.pod:725
22113 msgid "See also C<guestfs_blockdev_getsz>."
22117 #: ../src/guestfs-actions.pod:733
22118 msgid "guestfs_blockdev_getss"
22122 #: ../src/guestfs-actions.pod:735
22126 " guestfs_blockdev_getss (guestfs_h *g,\n"
22127 " const char *device);\n"
22132 #: ../src/guestfs-actions.pod:742
22134 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
22139 #: ../src/guestfs-actions.pod:751
22140 msgid "guestfs_blockdev_getsz"
22144 #: ../src/guestfs-actions.pod:753
22148 " guestfs_blockdev_getsz (guestfs_h *g,\n"
22149 " const char *device);\n"
22154 #: ../src/guestfs-actions.pod:760
22156 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
22157 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
22161 #: ../src/guestfs-actions.pod:770
22162 msgid "guestfs_blockdev_rereadpt"
22166 #: ../src/guestfs-actions.pod:772
22170 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
22171 " const char *device);\n"
22176 #: ../src/guestfs-actions.pod:784
22177 msgid "guestfs_blockdev_setbsz"
22181 #: ../src/guestfs-actions.pod:786
22185 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
22186 " const char *device,\n"
22187 " int blocksize);\n"
22192 #: ../src/guestfs-actions.pod:802
22193 msgid "guestfs_blockdev_setro"
22197 #: ../src/guestfs-actions.pod:804
22201 " guestfs_blockdev_setro (guestfs_h *g,\n"
22202 " const char *device);\n"
22207 #: ../src/guestfs-actions.pod:816
22208 msgid "guestfs_blockdev_setrw"
22212 #: ../src/guestfs-actions.pod:818
22216 " guestfs_blockdev_setrw (guestfs_h *g,\n"
22217 " const char *device);\n"
22222 #: ../src/guestfs-actions.pod:830
22223 msgid "guestfs_btrfs_filesystem_resize"
22227 #: ../src/guestfs-actions.pod:832
22231 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
22232 " const char *mountpoint,\n"
22238 #: ../src/guestfs-actions.pod:842
22241 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
22246 #: ../src/guestfs-actions.pod:865
22247 msgid "(Added in 1.11.17)"
22251 #: ../src/guestfs-actions.pod:867
22252 msgid "guestfs_btrfs_filesystem_resize_va"
22256 #: ../src/guestfs-actions.pod:869
22260 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
22261 " const char *mountpoint,\n"
22262 " va_list args);\n"
22267 #: ../src/guestfs-actions.pod:874
22268 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
22272 #: ../src/guestfs-actions.pod:878
22273 msgid "guestfs_btrfs_filesystem_resize_argv"
22277 #: ../src/guestfs-actions.pod:880
22281 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
22282 " const char *mountpoint,\n"
22284 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
22289 #: ../src/guestfs-actions.pod:885
22290 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
22294 #: ../src/guestfs-actions.pod:889
22295 msgid "guestfs_case_sensitive_path"
22299 #: ../src/guestfs-actions.pod:891
22303 " guestfs_case_sensitive_path (guestfs_h *g,\n"
22304 " const char *path);\n"
22309 #: ../src/guestfs-actions.pod:917
22311 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
22312 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
22313 "how the directories were originally created under Windows)."
22317 #: ../src/guestfs-actions.pod:925
22318 msgid "See also C<guestfs_realpath>."
22322 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7414
22323 msgid "(Added in 1.0.75)"
22327 #: ../src/guestfs-actions.pod:932
22328 msgid "guestfs_cat"
22332 #: ../src/guestfs-actions.pod:934
22336 " guestfs_cat (guestfs_h *g,\n"
22337 " const char *path);\n"
22342 #: ../src/guestfs-actions.pod:940
22344 "Note that this function cannot correctly handle binary files (specifically, "
22345 "files containing C<\\0> character which is treated as end of string). For "
22346 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
22347 "functions which have a more complex interface."
22351 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3767 ../src/guestfs-actions.pod:3849 ../src/guestfs-actions.pod:3866 ../src/guestfs-actions.pod:3954 ../src/guestfs-actions.pod:4362 ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:5747 ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:7567 ../src/guestfs-actions.pod:7581
22352 msgid "(Added in 0.4)"
22356 #: ../src/guestfs-actions.pod:953
22357 msgid "guestfs_checksum"
22361 #: ../src/guestfs-actions.pod:955
22365 " guestfs_checksum (guestfs_h *g,\n"
22366 " const char *csumtype,\n"
22367 " const char *path);\n"
22372 #: ../src/guestfs-actions.pod:1001
22373 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
22377 #: ../src/guestfs-actions.pod:1003
22378 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
22382 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1316 ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:3465 ../src/guestfs-actions.pod:3494 ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:3582 ../src/guestfs-actions.pod:7270
22383 msgid "(Added in 1.0.2)"
22387 #: ../src/guestfs-actions.pod:1010
22388 msgid "guestfs_checksum_device"
22392 #: ../src/guestfs-actions.pod:1012
22396 " guestfs_checksum_device (guestfs_h *g,\n"
22397 " const char *csumtype,\n"
22398 " const char *device);\n"
22403 #: ../src/guestfs-actions.pod:1017
22405 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
22406 "device named C<device>. For the types of checksums supported see the "
22407 "C<guestfs_checksum> command."
22411 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5196 ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5368 ../src/guestfs-actions.pod:5386 ../src/guestfs-actions.pod:5568 ../src/guestfs-actions.pod:7179 ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7593
22412 msgid "(Added in 1.3.2)"
22416 #: ../src/guestfs-actions.pod:1026
22417 msgid "guestfs_checksums_out"
22421 #: ../src/guestfs-actions.pod:1028
22425 " guestfs_checksums_out (guestfs_h *g,\n"
22426 " const char *csumtype,\n"
22427 " const char *directory,\n"
22428 " const char *sumsfile);\n"
22433 #: ../src/guestfs-actions.pod:1048
22434 msgid "(Added in 1.3.7)"
22438 #: ../src/guestfs-actions.pod:1050
22439 msgid "guestfs_chmod"
22443 #: ../src/guestfs-actions.pod:1052
22447 " guestfs_chmod (guestfs_h *g,\n"
22449 " const char *path);\n"
22454 #: ../src/guestfs-actions.pod:1070
22455 msgid "guestfs_chown"
22459 #: ../src/guestfs-actions.pod:1072
22463 " guestfs_chown (guestfs_h *g,\n"
22466 " const char *path);\n"
22471 #: ../src/guestfs-actions.pod:1088
22472 msgid "guestfs_command"
22476 #: ../src/guestfs-actions.pod:1090
22480 " guestfs_command (guestfs_h *g,\n"
22481 " char *const *arguments);\n"
22486 #: ../src/guestfs-actions.pod:1099
22488 "The single parameter is an argv-style list of arguments. The first element "
22489 "is the name of the program to run. Subsequent elements are parameters. The "
22490 "list must be non-empty (ie. must contain a program name). Note that the "
22491 "command runs directly, and is I<not> invoked via the shell (see "
22496 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150 ../src/guestfs-actions.pod:1615
22497 msgid "(Added in 0.9.1)"
22501 #: ../src/guestfs-actions.pod:1132
22502 msgid "guestfs_command_lines"
22506 #: ../src/guestfs-actions.pod:1134
22510 " guestfs_command_lines (guestfs_h *g,\n"
22511 " char *const *arguments);\n"
22516 #: ../src/guestfs-actions.pod:1138
22518 "This is the same as C<guestfs_command>, but splits the result into a list of "
22523 #: ../src/guestfs-actions.pod:1141
22524 msgid "See also: C<guestfs_sh_lines>"
22528 #: ../src/guestfs-actions.pod:1152
22529 msgid "guestfs_config"
22533 #: ../src/guestfs-actions.pod:1154
22537 " guestfs_config (guestfs_h *g,\n"
22538 " const char *qemuparam,\n"
22539 " const char *qemuvalue);\n"
22544 #: ../src/guestfs-actions.pod:1172
22545 msgid "guestfs_copy_size"
22549 #: ../src/guestfs-actions.pod:1174
22553 " guestfs_copy_size (guestfs_h *g,\n"
22554 " const char *src,\n"
22555 " const char *dest,\n"
22556 " int64_t size);\n"
22561 #: ../src/guestfs-actions.pod:1188 ../src/guestfs-actions.pod:1311 ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:1387 ../src/guestfs-actions.pod:1764 ../src/guestfs-actions.pod:1786 ../src/guestfs-actions.pod:3665 ../src/guestfs-actions.pod:7265 ../src/guestfs-actions.pod:7299 ../src/guestfs-actions.pod:7806 ../src/guestfs-actions.pod:7829
22563 "This long-running command can generate progress notification messages so "
22564 "that the caller can display a progress bar or indicator. To receive these "
22565 "messages, the caller must register a progress event callback. See "
22566 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
22570 #: ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:4389 ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:7500 ../src/guestfs-actions.pod:7520 ../src/guestfs-actions.pod:7606
22571 msgid "(Added in 1.0.87)"
22575 #: ../src/guestfs-actions.pod:1195
22580 #: ../src/guestfs-actions.pod:1197
22584 " guestfs_cp (guestfs_h *g,\n"
22585 " const char *src,\n"
22586 " const char *dest);\n"
22591 #: ../src/guestfs-actions.pod:1207 ../src/guestfs-actions.pod:1221 ../src/guestfs-actions.pod:1293 ../src/guestfs-actions.pod:1367 ../src/guestfs-actions.pod:1481 ../src/guestfs-actions.pod:5143 ../src/guestfs-actions.pod:5618
22592 msgid "(Added in 1.0.18)"
22596 #: ../src/guestfs-actions.pod:1209
22597 msgid "guestfs_cp_a"
22601 #: ../src/guestfs-actions.pod:1211
22605 " guestfs_cp_a (guestfs_h *g,\n"
22606 " const char *src,\n"
22607 " const char *dest);\n"
22612 #: ../src/guestfs-actions.pod:1223
22617 #: ../src/guestfs-actions.pod:1225
22621 " guestfs_dd (guestfs_h *g,\n"
22622 " const char *src,\n"
22623 " const char *dest);\n"
22628 #: ../src/guestfs-actions.pod:1235
22630 "If the destination is a device, it must be as large or larger than the "
22631 "source file or device, otherwise the copy will fail. This command cannot do "
22632 "partial copies (see C<guestfs_copy_size>)."
22636 #: ../src/guestfs-actions.pod:1243
22641 #: ../src/guestfs-actions.pod:1245
22645 " guestfs_df (guestfs_h *g);\n"
22650 #: ../src/guestfs-actions.pod:1250 ../src/guestfs-actions.pod:1267
22652 "This command is mostly useful for interactive sessions. It is I<not> "
22653 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
22658 #: ../src/guestfs-actions.pod:1257 ../src/guestfs-actions.pod:1274 ../src/guestfs-actions.pod:1392 ../src/guestfs-actions.pod:2388 ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2480 ../src/guestfs-actions.pod:4499 ../src/guestfs-actions.pod:5043 ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7027 ../src/guestfs-actions.pod:7646 ../src/guestfs-actions.pod:7659 ../src/guestfs-actions.pod:7672
22659 msgid "(Added in 1.0.54)"
22663 #: ../src/guestfs-actions.pod:1259
22664 msgid "guestfs_df_h"
22668 #: ../src/guestfs-actions.pod:1261
22672 " guestfs_df_h (guestfs_h *g);\n"
22677 #: ../src/guestfs-actions.pod:1276
22678 msgid "guestfs_dmesg"
22682 #: ../src/guestfs-actions.pod:1278
22686 " guestfs_dmesg (guestfs_h *g);\n"
22691 #: ../src/guestfs-actions.pod:1285
22693 "Another way to get the same information is to enable verbose messages with "
22694 "C<guestfs_set_verbose> or by setting the environment variable "
22695 "C<LIBGUESTFS_DEBUG=1> before running the program."
22699 #: ../src/guestfs-actions.pod:1295
22700 msgid "guestfs_download"
22704 #: ../src/guestfs-actions.pod:1297
22708 " guestfs_download (guestfs_h *g,\n"
22709 " const char *remotefilename,\n"
22710 " const char *filename);\n"
22715 #: ../src/guestfs-actions.pod:1307
22716 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
22720 #: ../src/guestfs-actions.pod:1318
22721 msgid "guestfs_download_offset"
22725 #: ../src/guestfs-actions.pod:1320
22729 " guestfs_download_offset (guestfs_h *g,\n"
22730 " const char *remotefilename,\n"
22731 " const char *filename,\n"
22732 " int64_t offset,\n"
22733 " int64_t size);\n"
22738 #: ../src/guestfs-actions.pod:1333
22740 "Note that there is no limit on the amount of data that can be downloaded "
22741 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
22742 "full amount unless an error occurs."
22746 #: ../src/guestfs-actions.pod:1338
22747 msgid "See also C<guestfs_download>, C<guestfs_pread>."
22751 #: ../src/guestfs-actions.pod:1347 ../src/guestfs-actions.pod:7304
22752 msgid "(Added in 1.5.17)"
22756 #: ../src/guestfs-actions.pod:1349
22757 msgid "guestfs_drop_caches"
22761 #: ../src/guestfs-actions.pod:1351
22765 " guestfs_drop_caches (guestfs_h *g,\n"
22766 " int whattodrop);\n"
22771 #: ../src/guestfs-actions.pod:1369
22776 #: ../src/guestfs-actions.pod:1371
22780 " guestfs_du (guestfs_h *g,\n"
22781 " const char *path);\n"
22786 #: ../src/guestfs-actions.pod:1394
22787 msgid "guestfs_e2fsck_f"
22791 #: ../src/guestfs-actions.pod:1396
22795 " guestfs_e2fsck_f (guestfs_h *g,\n"
22796 " const char *device);\n"
22801 #: ../src/guestfs-actions.pod:1404
22803 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
22804 "Normally you should use C<guestfs_fsck>."
22808 #: ../src/guestfs-actions.pod:1409
22809 msgid "(Added in 1.0.29)"
22813 #: ../src/guestfs-actions.pod:1411
22814 msgid "guestfs_echo_daemon"
22818 #: ../src/guestfs-actions.pod:1413
22822 " guestfs_echo_daemon (guestfs_h *g,\n"
22823 " char *const *words);\n"
22828 #: ../src/guestfs-actions.pod:1422
22829 msgid "See also C<guestfs_ping_daemon>."
22833 #: ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:6475
22834 msgid "(Added in 1.0.69)"
22838 #: ../src/guestfs-actions.pod:1429
22839 msgid "guestfs_egrep"
22843 #: ../src/guestfs-actions.pod:1431
22847 " guestfs_egrep (guestfs_h *g,\n"
22848 " const char *regex,\n"
22849 " const char *path);\n"
22854 #: ../src/guestfs-actions.pod:1446 ../src/guestfs-actions.pod:1465 ../src/guestfs-actions.pod:1522 ../src/guestfs-actions.pod:1568 ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:2304 ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:2501 ../src/guestfs-actions.pod:2514 ../src/guestfs-actions.pod:2529 ../src/guestfs-actions.pod:2575 ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:2610 ../src/guestfs-actions.pod:3879 ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:3920 ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:5952 ../src/guestfs-actions.pod:6001 ../src/guestfs-actions.pod:6871 ../src/guestfs-actions.pod:6883 ../src/guestfs-actions.pod:6896 ../src/guestfs-actions.pod:6909 ../src/guestfs-actions.pod:6931 ../src/guestfs-actions.pod:6944 ../src/guestfs-actions.pod:6957 ../src/guestfs-actions.pod:6970 ../src/guestfs-actions.pod:7764 ../src/guestfs-actions.pod:7783 ../src/guestfs-actions.pod:7877 ../src/guestfs-actions.pod:7896 ../src/guestfs-actions.pod:7942 ../src/guestfs-actions.pod:7961
22855 msgid "(Added in 1.0.66)"
22859 #: ../src/guestfs-actions.pod:1448
22860 msgid "guestfs_egrepi"
22864 #: ../src/guestfs-actions.pod:1450
22868 " guestfs_egrepi (guestfs_h *g,\n"
22869 " const char *regex,\n"
22870 " const char *path);\n"
22875 #: ../src/guestfs-actions.pod:1467
22876 msgid "guestfs_equal"
22880 #: ../src/guestfs-actions.pod:1469
22884 " guestfs_equal (guestfs_h *g,\n"
22885 " const char *file1,\n"
22886 " const char *file2);\n"
22891 #: ../src/guestfs-actions.pod:1483
22892 msgid "guestfs_exists"
22896 #: ../src/guestfs-actions.pod:1485
22900 " guestfs_exists (guestfs_h *g,\n"
22901 " const char *path);\n"
22906 #: ../src/guestfs-actions.pod:1492
22907 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
22911 #: ../src/guestfs-actions.pod:1498
22912 msgid "guestfs_fallocate"
22916 #: ../src/guestfs-actions.pod:1500
22920 " guestfs_fallocate (guestfs_h *g,\n"
22921 " const char *path,\n"
22927 #: ../src/guestfs-actions.pod:1515
22929 "This function is deprecated. In new code, use the L</guestfs_fallocate64> "
22934 #: ../src/guestfs-actions.pod:1524
22935 msgid "guestfs_fallocate64"
22939 #: ../src/guestfs-actions.pod:1526
22943 " guestfs_fallocate64 (guestfs_h *g,\n"
22944 " const char *path,\n"
22950 #: ../src/guestfs-actions.pod:1535
22952 "Note that this call allocates disk blocks for the file. To create a sparse "
22953 "file use C<guestfs_truncate_size> instead."
22957 #: ../src/guestfs-actions.pod:1538
22959 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
22960 "oversight it only allowed 30 bit lengths to be specified, effectively "
22961 "limiting the maximum size of files created through that call to 1GB."
22965 #: ../src/guestfs-actions.pod:1549
22966 msgid "(Added in 1.3.17)"
22970 #: ../src/guestfs-actions.pod:1551
22971 msgid "guestfs_fgrep"
22975 #: ../src/guestfs-actions.pod:1553
22979 " guestfs_fgrep (guestfs_h *g,\n"
22980 " const char *pattern,\n"
22981 " const char *path);\n"
22986 #: ../src/guestfs-actions.pod:1570
22987 msgid "guestfs_fgrepi"
22991 #: ../src/guestfs-actions.pod:1572
22995 " guestfs_fgrepi (guestfs_h *g,\n"
22996 " const char *pattern,\n"
22997 " const char *path);\n"
23002 #: ../src/guestfs-actions.pod:1589
23003 msgid "guestfs_file"
23007 #: ../src/guestfs-actions.pod:1591
23011 " guestfs_file (guestfs_h *g,\n"
23012 " const char *path);\n"
23017 #: ../src/guestfs-actions.pod:1609
23019 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
23020 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
23024 #: ../src/guestfs-actions.pod:1617
23025 msgid "guestfs_file_architecture"
23029 #: ../src/guestfs-actions.pod:1619
23033 " guestfs_file_architecture (guestfs_h *g,\n"
23034 " const char *filename);\n"
23039 #: ../src/guestfs-actions.pod:1727 ../src/guestfs-actions.pod:1890 ../src/guestfs-actions.pod:1907 ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:2786 ../src/guestfs-actions.pod:2973 ../src/guestfs-actions.pod:2991 ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:3106 ../src/guestfs-actions.pod:3199 ../src/guestfs-actions.pod:3436 ../src/guestfs-actions.pod:3568
23040 msgid "(Added in 1.5.3)"
23044 #: ../src/guestfs-actions.pod:1729
23045 msgid "guestfs_filesize"
23049 #: ../src/guestfs-actions.pod:1731
23053 " guestfs_filesize (guestfs_h *g,\n"
23054 " const char *file);\n"
23059 #: ../src/guestfs-actions.pod:1737
23061 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
23062 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
23063 "devices, use C<guestfs_blockdev_getsize64>."
23067 #: ../src/guestfs-actions.pod:1743
23068 msgid "(Added in 1.0.82)"
23072 #: ../src/guestfs-actions.pod:1745
23073 msgid "guestfs_fill"
23077 #: ../src/guestfs-actions.pod:1747
23081 " guestfs_fill (guestfs_h *g,\n"
23084 " const char *path);\n"
23089 #: ../src/guestfs-actions.pod:1757
23091 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
23092 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
23093 "bytes use C<guestfs_fill_pattern>."
23097 #: ../src/guestfs-actions.pod:1769
23098 msgid "(Added in 1.0.79)"
23102 #: ../src/guestfs-actions.pod:1771
23103 msgid "guestfs_fill_pattern"
23107 #: ../src/guestfs-actions.pod:1773
23111 " guestfs_fill_pattern (guestfs_h *g,\n"
23112 " const char *pattern,\n"
23114 " const char *path);\n"
23119 #: ../src/guestfs-actions.pod:1779
23121 "This function is like C<guestfs_fill> except that it creates a new file of "
23122 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
23123 "pattern is truncated if necessary to ensure the length of the file is "
23124 "exactly C<len> bytes."
23128 #: ../src/guestfs-actions.pod:1791
23129 msgid "(Added in 1.3.12)"
23133 #: ../src/guestfs-actions.pod:1793
23134 msgid "guestfs_find"
23138 #: ../src/guestfs-actions.pod:1795
23142 " guestfs_find (guestfs_h *g,\n"
23143 " const char *directory);\n"
23148 #: ../src/guestfs-actions.pod:1811
23149 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
23153 #: ../src/guestfs-actions.pod:1824
23154 msgid "See also C<guestfs_find0>."
23158 #: ../src/guestfs-actions.pod:1833 ../src/guestfs-actions.pod:4326 ../src/guestfs-actions.pod:6036
23159 msgid "(Added in 1.0.27)"
23163 #: ../src/guestfs-actions.pod:1835
23164 msgid "guestfs_find0"
23168 #: ../src/guestfs-actions.pod:1837
23172 " guestfs_find0 (guestfs_h *g,\n"
23173 " const char *directory,\n"
23174 " const char *files);\n"
23179 #: ../src/guestfs-actions.pod:1846
23181 "This command works the same way as C<guestfs_find> with the following "
23186 #: ../src/guestfs-actions.pod:1873
23187 msgid "(Added in 1.0.74)"
23191 #: ../src/guestfs-actions.pod:1875
23192 msgid "guestfs_findfs_label"
23196 #: ../src/guestfs-actions.pod:1877
23200 " guestfs_findfs_label (guestfs_h *g,\n"
23201 " const char *label);\n"
23206 #: ../src/guestfs-actions.pod:1885
23207 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
23211 #: ../src/guestfs-actions.pod:1892
23212 msgid "guestfs_findfs_uuid"
23216 #: ../src/guestfs-actions.pod:1894
23220 " guestfs_findfs_uuid (guestfs_h *g,\n"
23221 " const char *uuid);\n"
23226 #: ../src/guestfs-actions.pod:1902
23227 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
23231 #: ../src/guestfs-actions.pod:1909
23232 msgid "guestfs_fsck"
23236 #: ../src/guestfs-actions.pod:1911
23240 " guestfs_fsck (guestfs_h *g,\n"
23241 " const char *fstype,\n"
23242 " const char *device);\n"
23247 #: ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:7811
23248 msgid "(Added in 1.0.16)"
23252 #: ../src/guestfs-actions.pod:1948
23253 msgid "guestfs_get_append"
23257 #: ../src/guestfs-actions.pod:1950
23261 " guestfs_get_append (guestfs_h *g);\n"
23266 #: ../src/guestfs-actions.pod:1958
23268 "This function returns a string which may be NULL. There is no way to return "
23269 "an error from this function. The string is owned by the guest handle and "
23270 "must I<not> be freed."
23274 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:5714 ../src/guestfs-actions.pod:6196 ../src/guestfs-actions.pod:6638 ../src/guestfs-actions.pod:6657 ../src/guestfs-actions.pod:6673 ../src/guestfs-actions.pod:6697 ../src/guestfs-actions.pod:7451 ../src/guestfs-actions.pod:7466 ../src/guestfs-actions.pod:7858
23275 msgid "(Added in 1.0.26)"
23279 #: ../src/guestfs-actions.pod:1964
23280 msgid "guestfs_get_attach_method"
23284 #: ../src/guestfs-actions.pod:1966
23288 " guestfs_get_attach_method (guestfs_h *g);\n"
23293 #: ../src/guestfs-actions.pod:1969
23294 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
23298 #: ../src/guestfs-actions.pod:1974 ../src/guestfs-actions.pod:6226
23299 msgid "(Added in 1.9.8)"
23303 #: ../src/guestfs-actions.pod:1976
23304 msgid "guestfs_get_autosync"
23308 #: ../src/guestfs-actions.pod:1978
23312 " guestfs_get_autosync (guestfs_h *g);\n"
23317 #: ../src/guestfs-actions.pod:1987
23318 msgid "guestfs_get_direct"
23322 #: ../src/guestfs-actions.pod:1989
23326 " guestfs_get_direct (guestfs_h *g);\n"
23331 #: ../src/guestfs-actions.pod:1996 ../src/guestfs-actions.pod:6267
23332 msgid "(Added in 1.0.72)"
23336 #: ../src/guestfs-actions.pod:1998
23337 msgid "guestfs_get_e2label"
23341 #: ../src/guestfs-actions.pod:2000
23345 " guestfs_get_e2label (guestfs_h *g,\n"
23346 " const char *device);\n"
23351 #: ../src/guestfs-actions.pod:2010
23353 "This function is deprecated. In new code, use the L</guestfs_vfs_label> "
23358 #: ../src/guestfs-actions.pod:2017 ../src/guestfs-actions.pod:2038 ../src/guestfs-actions.pod:6285 ../src/guestfs-actions.pod:6304
23359 msgid "(Added in 1.0.15)"
23363 #: ../src/guestfs-actions.pod:2019
23364 msgid "guestfs_get_e2uuid"
23368 #: ../src/guestfs-actions.pod:2021
23372 " guestfs_get_e2uuid (guestfs_h *g,\n"
23373 " const char *device);\n"
23378 #: ../src/guestfs-actions.pod:2031
23380 "This function is deprecated. In new code, use the L</guestfs_vfs_uuid> call "
23385 #: ../src/guestfs-actions.pod:2040
23386 msgid "guestfs_get_memsize"
23390 #: ../src/guestfs-actions.pod:2042
23394 " guestfs_get_memsize (guestfs_h *g);\n"
23399 #: ../src/guestfs-actions.pod:2048
23401 "If C<guestfs_set_memsize> was not called on this handle, and if "
23402 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
23403 "value for memsize."
23407 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:4617 ../src/guestfs-actions.pod:4826 ../src/guestfs-actions.pod:4845 ../src/guestfs-actions.pod:4864 ../src/guestfs-actions.pod:4876 ../src/guestfs-actions.pod:4893 ../src/guestfs-actions.pod:4906 ../src/guestfs-actions.pod:5939 ../src/guestfs-actions.pod:6325 ../src/guestfs-actions.pod:6605 ../src/guestfs-actions.pod:7220
23408 msgid "(Added in 1.0.55)"
23412 #: ../src/guestfs-actions.pod:2059
23413 msgid "guestfs_get_network"
23417 #: ../src/guestfs-actions.pod:2061
23421 " guestfs_get_network (guestfs_h *g);\n"
23426 #: ../src/guestfs-actions.pod:2068 ../src/guestfs-actions.pod:6344
23427 msgid "(Added in 1.5.4)"
23431 #: ../src/guestfs-actions.pod:2070
23432 msgid "guestfs_get_path"
23436 #: ../src/guestfs-actions.pod:2072
23440 " guestfs_get_path (guestfs_h *g);\n"
23445 #: ../src/guestfs-actions.pod:2080 ../src/guestfs-actions.pod:2120
23447 "This function returns a string, or NULL on error. The string is owned by "
23448 "the guest handle and must I<not> be freed."
23452 #: ../src/guestfs-actions.pod:2085
23453 msgid "guestfs_get_pgroup"
23457 #: ../src/guestfs-actions.pod:2087
23461 " guestfs_get_pgroup (guestfs_h *g);\n"
23466 #: ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:6380 ../src/guestfs-actions.pod:7712
23467 msgid "(Added in 1.11.18)"
23471 #: ../src/guestfs-actions.pod:2096
23472 msgid "guestfs_get_pid"
23476 #: ../src/guestfs-actions.pod:2098
23480 " guestfs_get_pid (guestfs_h *g);\n"
23485 #: ../src/guestfs-actions.pod:2108
23486 msgid "(Added in 1.0.56)"
23490 #: ../src/guestfs-actions.pod:2110
23491 msgid "guestfs_get_qemu"
23495 #: ../src/guestfs-actions.pod:2112
23499 " guestfs_get_qemu (guestfs_h *g);\n"
23504 #: ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:6408
23505 msgid "(Added in 1.0.6)"
23509 #: ../src/guestfs-actions.pod:2125
23510 msgid "guestfs_get_recovery_proc"
23514 #: ../src/guestfs-actions.pod:2127
23518 " guestfs_get_recovery_proc (guestfs_h *g);\n"
23523 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:3690 ../src/guestfs-actions.pod:4021 ../src/guestfs-actions.pod:4424 ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:5644 ../src/guestfs-actions.pod:5987 ../src/guestfs-actions.pod:6432 ../src/guestfs-actions.pod:7123 ../src/guestfs-actions.pod:7143 ../src/guestfs-actions.pod:7335
23524 msgid "(Added in 1.0.77)"
23528 #: ../src/guestfs-actions.pod:2136
23529 msgid "guestfs_get_selinux"
23533 #: ../src/guestfs-actions.pod:2138
23537 " guestfs_get_selinux (guestfs_h *g);\n"
23542 #: ../src/guestfs-actions.pod:2141
23544 "This returns the current setting of the selinux flag which is passed to the "
23545 "appliance at boot time. See C<guestfs_set_selinux>."
23549 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2212 ../src/guestfs-actions.pod:6451 ../src/guestfs-actions.pod:6509
23550 msgid "(Added in 1.0.67)"
23554 #: ../src/guestfs-actions.pod:2151
23555 msgid "guestfs_get_state"
23559 #: ../src/guestfs-actions.pod:2153
23563 " guestfs_get_state (guestfs_h *g);\n"
23568 #: ../src/guestfs-actions.pod:2165
23569 msgid "guestfs_get_trace"
23573 #: ../src/guestfs-actions.pod:2167
23577 " guestfs_get_trace (guestfs_h *g);\n"
23582 #: ../src/guestfs-actions.pod:2176
23583 msgid "guestfs_get_umask"
23587 #: ../src/guestfs-actions.pod:2178
23591 " guestfs_get_umask (guestfs_h *g);\n"
23596 #: ../src/guestfs-actions.pod:2181
23598 "Return the current umask. By default the umask is C<022> unless it has been "
23599 "set by calling C<guestfs_umask>."
23603 #: ../src/guestfs-actions.pod:2188
23604 msgid "guestfs_get_verbose"
23608 #: ../src/guestfs-actions.pod:2190
23612 " guestfs_get_verbose (guestfs_h *g);\n"
23617 #: ../src/guestfs-actions.pod:2199
23618 msgid "guestfs_getcon"
23622 #: ../src/guestfs-actions.pod:2201
23626 " guestfs_getcon (guestfs_h *g);\n"
23631 #: ../src/guestfs-actions.pod:2206
23632 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
23636 #: ../src/guestfs-actions.pod:2214
23637 msgid "guestfs_getxattr"
23641 #: ../src/guestfs-actions.pod:2216
23645 " guestfs_getxattr (guestfs_h *g,\n"
23646 " const char *path,\n"
23647 " const char *name,\n"
23648 " size_t *size_r);\n"
23653 #: ../src/guestfs-actions.pod:2222
23655 "Get a single extended attribute from file C<path> named C<name>. This call "
23656 "follows symlinks. If you want to lookup an extended attribute for the "
23657 "symlink itself, use C<guestfs_lgetxattr>."
23661 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:3704
23663 "Normally it is better to get all extended attributes from a file in one go "
23664 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
23665 "implementations are buggy and do not provide a way to list out attributes. "
23666 "For these filesystems (notably ntfs-3g) you have to know the names of the "
23667 "extended attributes you want in advance and call this function."
23671 #: ../src/guestfs-actions.pod:2236
23672 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
23676 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:2921 ../src/guestfs-actions.pod:3716 ../src/guestfs-actions.pod:5637 ../src/guestfs-actions.pod:5663 ../src/guestfs-actions.pod:5844
23678 "This function returns a buffer, or NULL on error. The size of the returned "
23679 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
23684 #: ../src/guestfs-actions.pod:2242 ../src/guestfs-actions.pod:3720
23685 msgid "(Added in 1.7.24)"
23689 #: ../src/guestfs-actions.pod:2244
23690 msgid "guestfs_getxattrs"
23694 #: ../src/guestfs-actions.pod:2246
23697 " struct guestfs_xattr_list *\n"
23698 " guestfs_getxattrs (guestfs_h *g,\n"
23699 " const char *path);\n"
23704 #: ../src/guestfs-actions.pod:2256
23705 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
23709 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:3732 ../src/guestfs-actions.pod:4420
23711 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
23712 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
23716 #: ../src/guestfs-actions.pod:2262 ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3935 ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:6017 ../src/guestfs-actions.pod:6528 ../src/guestfs-actions.pod:7923
23717 msgid "(Added in 1.0.59)"
23721 #: ../src/guestfs-actions.pod:2264
23722 msgid "guestfs_glob_expand"
23726 #: ../src/guestfs-actions.pod:2266
23730 " guestfs_glob_expand (guestfs_h *g,\n"
23731 " const char *pattern);\n"
23736 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:6721 ../src/guestfs-actions.pod:6738
23737 msgid "(Added in 1.0.50)"
23741 #: ../src/guestfs-actions.pod:2287
23742 msgid "guestfs_grep"
23746 #: ../src/guestfs-actions.pod:2289
23750 " guestfs_grep (guestfs_h *g,\n"
23751 " const char *regex,\n"
23752 " const char *path);\n"
23757 #: ../src/guestfs-actions.pod:2306
23758 msgid "guestfs_grepi"
23762 #: ../src/guestfs-actions.pod:2308
23766 " guestfs_grepi (guestfs_h *g,\n"
23767 " const char *regex,\n"
23768 " const char *path);\n"
23773 #: ../src/guestfs-actions.pod:2325
23774 msgid "guestfs_grub_install"
23778 #: ../src/guestfs-actions.pod:2327
23782 " guestfs_grub_install (guestfs_h *g,\n"
23783 " const char *root,\n"
23784 " const char *device);\n"
23789 #: ../src/guestfs-actions.pod:2370
23790 msgid "(Added in 1.0.17)"
23794 #: ../src/guestfs-actions.pod:2372
23795 msgid "guestfs_head"
23799 #: ../src/guestfs-actions.pod:2374
23803 " guestfs_head (guestfs_h *g,\n"
23804 " const char *path);\n"
23809 #: ../src/guestfs-actions.pod:2390
23810 msgid "guestfs_head_n"
23814 #: ../src/guestfs-actions.pod:2392
23818 " guestfs_head_n (guestfs_h *g,\n"
23820 " const char *path);\n"
23825 #: ../src/guestfs-actions.pod:2414
23826 msgid "guestfs_hexdump"
23830 #: ../src/guestfs-actions.pod:2416
23834 " guestfs_hexdump (guestfs_h *g,\n"
23835 " const char *path);\n"
23840 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6857
23841 msgid "(Added in 1.0.22)"
23845 #: ../src/guestfs-actions.pod:2431
23846 msgid "guestfs_initrd_cat"
23850 #: ../src/guestfs-actions.pod:2433
23854 " guestfs_initrd_cat (guestfs_h *g,\n"
23855 " const char *initrdpath,\n"
23856 " const char *filename,\n"
23857 " size_t *size_r);\n"
23862 #: ../src/guestfs-actions.pod:2449
23863 msgid "See also C<guestfs_initrd_list>."
23867 #: ../src/guestfs-actions.pod:2460
23868 msgid "guestfs_initrd_list"
23872 #: ../src/guestfs-actions.pod:2462
23876 " guestfs_initrd_list (guestfs_h *g,\n"
23877 " const char *path);\n"
23882 #: ../src/guestfs-actions.pod:2482
23883 msgid "guestfs_inotify_add_watch"
23887 #: ../src/guestfs-actions.pod:2484
23891 " guestfs_inotify_add_watch (guestfs_h *g,\n"
23892 " const char *path,\n"
23898 #: ../src/guestfs-actions.pod:2503
23899 msgid "guestfs_inotify_close"
23903 #: ../src/guestfs-actions.pod:2505
23907 " guestfs_inotify_close (guestfs_h *g);\n"
23912 #: ../src/guestfs-actions.pod:2516
23913 msgid "guestfs_inotify_files"
23917 #: ../src/guestfs-actions.pod:2518
23921 " guestfs_inotify_files (guestfs_h *g);\n"
23926 #: ../src/guestfs-actions.pod:2521
23928 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
23929 "returns a list of pathnames of objects that were touched. The returned "
23930 "pathnames are sorted and deduplicated."
23934 #: ../src/guestfs-actions.pod:2531
23935 msgid "guestfs_inotify_init"
23939 #: ../src/guestfs-actions.pod:2533
23943 " guestfs_inotify_init (guestfs_h *g,\n"
23944 " int maxevents);\n"
23949 #: ../src/guestfs-actions.pod:2541
23951 "C<maxevents> is the maximum number of events which will be queued up between "
23952 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
23953 "passed as C<0>, then the kernel (or previously set) default is used. For "
23954 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
23955 "throws away events, but records the fact that it threw them away by setting "
23956 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
23957 "C<guestfs_inotify_read>)."
23961 #: ../src/guestfs-actions.pod:2551
23963 "Before any events are generated, you have to add some watches to the "
23964 "internal watch list. See: C<guestfs_inotify_add_watch>, "
23965 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
23969 #: ../src/guestfs-actions.pod:2557
23971 "Queued up events should be read periodically by calling "
23972 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
23973 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
23974 "often enough then you risk the internal queue overflowing."
23978 #: ../src/guestfs-actions.pod:2564
23980 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
23981 "This also removes any watches automatically."
23985 #: ../src/guestfs-actions.pod:2577
23986 msgid "guestfs_inotify_read"
23990 #: ../src/guestfs-actions.pod:2579
23993 " struct guestfs_inotify_event_list *\n"
23994 " guestfs_inotify_read (guestfs_h *g);\n"
23999 #: ../src/guestfs-actions.pod:2593
24001 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
24002 "there was an error. I<The caller must call "
24003 "C<guestfs_free_inotify_event_list> after use>."
24007 #: ../src/guestfs-actions.pod:2599
24008 msgid "guestfs_inotify_rm_watch"
24012 #: ../src/guestfs-actions.pod:2601
24016 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
24022 #: ../src/guestfs-actions.pod:2605
24024 "Remove a previously defined inotify watch. See "
24025 "C<guestfs_inotify_add_watch>."
24029 #: ../src/guestfs-actions.pod:2612
24030 msgid "guestfs_inspect_get_arch"
24034 #: ../src/guestfs-actions.pod:2614
24038 " guestfs_inspect_get_arch (guestfs_h *g,\n"
24039 " const char *root);\n"
24044 #: ../src/guestfs-actions.pod:2618
24046 "This returns the architecture of the inspected operating system. The "
24047 "possible return values are listed under C<guestfs_file_architecture>."
24051 #: ../src/guestfs-actions.pod:2632
24052 msgid "guestfs_inspect_get_distro"
24056 #: ../src/guestfs-actions.pod:2634
24060 " guestfs_inspect_get_distro (guestfs_h *g,\n"
24061 " const char *root);\n"
24066 #: ../src/guestfs-actions.pod:2722
24067 msgid "guestfs_inspect_get_drive_mappings"
24071 #: ../src/guestfs-actions.pod:2724
24075 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
24076 " const char *root);\n"
24081 #: ../src/guestfs-actions.pod:2753
24083 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24084 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
24088 #: ../src/guestfs-actions.pod:2757 ../src/guestfs-actions.pod:3025 ../src/guestfs-actions.pod:3823 ../src/guestfs-actions.pod:5105 ../src/guestfs-actions.pod:7159
24090 "This function returns a NULL-terminated array of strings, or NULL if there "
24091 "was an error. The array of strings will always have length C<2n+1>, where "
24092 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
24093 "caller must free the strings and the array after use>."
24097 #: ../src/guestfs-actions.pod:2763 ../src/guestfs-actions.pod:3219
24098 msgid "(Added in 1.9.17)"
24102 #: ../src/guestfs-actions.pod:2765
24103 msgid "guestfs_inspect_get_filesystems"
24107 #: ../src/guestfs-actions.pod:2767
24111 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
24112 " const char *root);\n"
24117 #: ../src/guestfs-actions.pod:2779
24119 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24120 "C<guestfs_inspect_get_mountpoints>."
24124 #: ../src/guestfs-actions.pod:2788
24125 msgid "guestfs_inspect_get_format"
24129 #: ../src/guestfs-actions.pod:2790
24133 " guestfs_inspect_get_format (guestfs_h *g,\n"
24134 " const char *root);\n"
24139 #: ../src/guestfs-actions.pod:2824 ../src/guestfs-actions.pod:3255 ../src/guestfs-actions.pod:3271 ../src/guestfs-actions.pod:3289 ../src/guestfs-actions.pod:6055
24140 msgid "(Added in 1.9.4)"
24144 #: ../src/guestfs-actions.pod:2826
24145 msgid "guestfs_inspect_get_hostname"
24149 #: ../src/guestfs-actions.pod:2828
24153 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
24154 " const char *root);\n"
24159 #: ../src/guestfs-actions.pod:2843
24160 msgid "(Added in 1.7.9)"
24164 #: ../src/guestfs-actions.pod:2845
24165 msgid "guestfs_inspect_get_icon"
24169 #: ../src/guestfs-actions.pod:2847
24173 " guestfs_inspect_get_icon (guestfs_h *g,\n"
24174 " const char *root,\n"
24175 " size_t *size_r,\n"
24181 #: ../src/guestfs-actions.pod:2858
24184 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
24185 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
24190 #: ../src/guestfs-actions.pod:2925 ../src/guestfs-actions.pod:3750 ../src/guestfs-actions.pod:5004
24191 msgid "(Added in 1.11.12)"
24195 #: ../src/guestfs-actions.pod:2927
24196 msgid "guestfs_inspect_get_icon_va"
24200 #: ../src/guestfs-actions.pod:2929
24204 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
24205 " const char *root,\n"
24206 " size_t *size_r,\n"
24207 " va_list args);\n"
24212 #: ../src/guestfs-actions.pod:2935
24213 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
24217 #: ../src/guestfs-actions.pod:2939
24218 msgid "guestfs_inspect_get_icon_argv"
24222 #: ../src/guestfs-actions.pod:2941
24226 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
24227 " const char *root,\n"
24228 " size_t *size_r,\n"
24229 " const struct guestfs_inspect_get_icon_argv "
24235 #: ../src/guestfs-actions.pod:2947
24236 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
24240 #: ../src/guestfs-actions.pod:2951
24241 msgid "guestfs_inspect_get_major_version"
24245 #: ../src/guestfs-actions.pod:2953
24249 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
24250 " const char *root);\n"
24255 #: ../src/guestfs-actions.pod:2975
24256 msgid "guestfs_inspect_get_minor_version"
24260 #: ../src/guestfs-actions.pod:2977
24264 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
24265 " const char *root);\n"
24270 #: ../src/guestfs-actions.pod:2986
24272 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24273 "C<guestfs_inspect_get_major_version>."
24277 #: ../src/guestfs-actions.pod:2993
24278 msgid "guestfs_inspect_get_mountpoints"
24282 #: ../src/guestfs-actions.pod:2995
24286 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
24287 " const char *root);\n"
24292 #: ../src/guestfs-actions.pod:3016
24294 "For operating systems like Windows which still use drive letters, this call "
24295 "will only return an entry for the first drive \"mounted on\" C</>. For "
24296 "information about the mapping of drive letters to partitions, see "
24297 "C<guestfs_inspect_get_drive_mappings>."
24301 #: ../src/guestfs-actions.pod:3022
24303 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24304 "C<guestfs_inspect_get_filesystems>."
24308 #: ../src/guestfs-actions.pod:3033
24309 msgid "guestfs_inspect_get_package_format"
24313 #: ../src/guestfs-actions.pod:3035
24317 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
24318 " const char *root);\n"
24323 #: ../src/guestfs-actions.pod:3039
24325 "This function and C<guestfs_inspect_get_package_management> return the "
24326 "package format and package management tool used by the inspected operating "
24327 "system. For example for Fedora these functions would return C<rpm> (package "
24328 "format) and C<yum> (package management)."
24332 #: ../src/guestfs-actions.pod:3057 ../src/guestfs-actions.pod:3085
24333 msgid "(Added in 1.7.5)"
24337 #: ../src/guestfs-actions.pod:3059
24338 msgid "guestfs_inspect_get_package_management"
24342 #: ../src/guestfs-actions.pod:3061
24346 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
24347 " const char *root);\n"
24352 #: ../src/guestfs-actions.pod:3065
24354 "C<guestfs_inspect_get_package_format> and this function return the package "
24355 "format and package management tool used by the inspected operating system. "
24356 "For example for Fedora these functions would return C<rpm> (package format) "
24357 "and C<yum> (package management)."
24361 #: ../src/guestfs-actions.pod:3087
24362 msgid "guestfs_inspect_get_product_name"
24366 #: ../src/guestfs-actions.pod:3089
24370 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
24371 " const char *root);\n"
24376 #: ../src/guestfs-actions.pod:3108
24377 msgid "guestfs_inspect_get_product_variant"
24381 #: ../src/guestfs-actions.pod:3110
24385 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
24386 " const char *root);\n"
24391 #: ../src/guestfs-actions.pod:3133
24393 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24394 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
24398 #: ../src/guestfs-actions.pod:3140
24399 msgid "(Added in 1.9.13)"
24403 #: ../src/guestfs-actions.pod:3142
24404 msgid "guestfs_inspect_get_roots"
24408 #: ../src/guestfs-actions.pod:3144
24412 " guestfs_inspect_get_roots (guestfs_h *g);\n"
24417 #: ../src/guestfs-actions.pod:3147
24419 "This function is a convenient way to get the list of root devices, as "
24420 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
24421 "the whole inspection process."
24425 #: ../src/guestfs-actions.pod:3151
24427 "This returns an empty list if either no root devices were found or the "
24428 "caller has not called C<guestfs_inspect_os>."
24432 #: ../src/guestfs-actions.pod:3160
24433 msgid "(Added in 1.7.3)"
24437 #: ../src/guestfs-actions.pod:3162
24438 msgid "guestfs_inspect_get_type"
24442 #: ../src/guestfs-actions.pod:3164
24446 " guestfs_inspect_get_type (guestfs_h *g,\n"
24447 " const char *root);\n"
24452 #: ../src/guestfs-actions.pod:3201
24453 msgid "guestfs_inspect_get_windows_current_control_set"
24457 #: ../src/guestfs-actions.pod:3203
24461 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
24462 " const char *root);\n"
24467 #: ../src/guestfs-actions.pod:3221
24468 msgid "guestfs_inspect_get_windows_systemroot"
24472 #: ../src/guestfs-actions.pod:3223
24476 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
24477 " const char *root);\n"
24482 #: ../src/guestfs-actions.pod:3239
24483 msgid "(Added in 1.5.25)"
24487 #: ../src/guestfs-actions.pod:3241
24488 msgid "guestfs_inspect_is_live"
24492 #: ../src/guestfs-actions.pod:3243
24496 " guestfs_inspect_is_live (guestfs_h *g,\n"
24497 " const char *root);\n"
24502 #: ../src/guestfs-actions.pod:3247
24504 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24505 "disk), then this returns true if a live image was detected on the disk."
24509 #: ../src/guestfs-actions.pod:3257
24510 msgid "guestfs_inspect_is_multipart"
24514 #: ../src/guestfs-actions.pod:3259
24518 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
24519 " const char *root);\n"
24524 #: ../src/guestfs-actions.pod:3263
24526 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24527 "disk), then this returns true if the disk is part of a set."
24531 #: ../src/guestfs-actions.pod:3273
24532 msgid "guestfs_inspect_is_netinst"
24536 #: ../src/guestfs-actions.pod:3275
24540 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
24541 " const char *root);\n"
24546 #: ../src/guestfs-actions.pod:3279
24548 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24549 "disk), then this returns true if the disk is a network installer, ie. not a "
24550 "self-contained install CD but one which is likely to require network access "
24551 "to complete the install."
24555 #: ../src/guestfs-actions.pod:3291
24556 msgid "guestfs_inspect_list_applications"
24560 #: ../src/guestfs-actions.pod:3293
24563 " struct guestfs_application_list *\n"
24564 " guestfs_inspect_list_applications (guestfs_h *g,\n"
24565 " const char *root);\n"
24570 #: ../src/guestfs-actions.pod:3299
24572 "I<Note:> This call works differently from other parts of the inspection "
24573 "API. You have to call C<guestfs_inspect_os>, then "
24574 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
24575 "this. Listing applications is a significantly more difficult operation "
24576 "which requires access to the full filesystem. Also note that unlike the "
24577 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
24578 "the libguestfs handle, this call actually reads parts of the mounted "
24579 "filesystems during the call."
24583 #: ../src/guestfs-actions.pod:3389
24585 "This function returns a C<struct guestfs_application_list *>, or NULL if "
24586 "there was an error. I<The caller must call C<guestfs_free_application_list> "
24591 #: ../src/guestfs-actions.pod:3393
24592 msgid "(Added in 1.7.8)"
24596 #: ../src/guestfs-actions.pod:3395
24597 msgid "guestfs_inspect_os"
24601 #: ../src/guestfs-actions.pod:3397
24605 " guestfs_inspect_os (guestfs_h *g);\n"
24610 #: ../src/guestfs-actions.pod:3413
24612 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
24613 "functions in order to query further information about each operating system, "
24614 "such as the name and version."
24618 #: ../src/guestfs-actions.pod:3418
24620 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
24621 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
24622 "the contents. This should be called with no disks currently mounted. The "
24623 "function may also use Augeas, so any existing Augeas handle will be closed."
24627 #: ../src/guestfs-actions.pod:3430 ../src/guestfs-actions.pod:3761 ../src/guestfs-actions.pod:3843
24628 msgid "See also C<guestfs_list_filesystems>."
24632 #: ../src/guestfs-actions.pod:3438
24633 msgid "guestfs_is_blockdev"
24637 #: ../src/guestfs-actions.pod:3440
24641 " guestfs_is_blockdev (guestfs_h *g,\n"
24642 " const char *path);\n"
24647 #: ../src/guestfs-actions.pod:3447 ../src/guestfs-actions.pod:3476 ../src/guestfs-actions.pod:3506 ../src/guestfs-actions.pod:3521 ../src/guestfs-actions.pod:3537 ../src/guestfs-actions.pod:3593 ../src/guestfs-actions.pod:3608
24648 msgid "See also C<guestfs_stat>."
24652 #: ../src/guestfs-actions.pod:3451 ../src/guestfs-actions.pod:3480 ../src/guestfs-actions.pod:3525 ../src/guestfs-actions.pod:3597 ../src/guestfs-actions.pod:3612
24653 msgid "(Added in 1.5.10)"
24657 #: ../src/guestfs-actions.pod:3453
24658 msgid "guestfs_is_busy"
24662 #: ../src/guestfs-actions.pod:3455
24666 " guestfs_is_busy (guestfs_h *g);\n"
24671 #: ../src/guestfs-actions.pod:3467
24672 msgid "guestfs_is_chardev"
24676 #: ../src/guestfs-actions.pod:3469
24680 " guestfs_is_chardev (guestfs_h *g,\n"
24681 " const char *path);\n"
24686 #: ../src/guestfs-actions.pod:3482
24687 msgid "guestfs_is_config"
24691 #: ../src/guestfs-actions.pod:3484
24695 " guestfs_is_config (guestfs_h *g);\n"
24700 #: ../src/guestfs-actions.pod:3496
24701 msgid "guestfs_is_dir"
24705 #: ../src/guestfs-actions.pod:3498
24709 " guestfs_is_dir (guestfs_h *g,\n"
24710 " const char *path);\n"
24715 #: ../src/guestfs-actions.pod:3512
24716 msgid "guestfs_is_fifo"
24720 #: ../src/guestfs-actions.pod:3514
24724 " guestfs_is_fifo (guestfs_h *g,\n"
24725 " const char *path);\n"
24730 #: ../src/guestfs-actions.pod:3527
24731 msgid "guestfs_is_file"
24735 #: ../src/guestfs-actions.pod:3529
24739 " guestfs_is_file (guestfs_h *g,\n"
24740 " const char *path);\n"
24745 #: ../src/guestfs-actions.pod:3543
24746 msgid "guestfs_is_launching"
24750 #: ../src/guestfs-actions.pod:3545
24754 " guestfs_is_launching (guestfs_h *g);\n"
24759 #: ../src/guestfs-actions.pod:3557
24760 msgid "guestfs_is_lv"
24764 #: ../src/guestfs-actions.pod:3559
24768 " guestfs_is_lv (guestfs_h *g,\n"
24769 " const char *device);\n"
24774 #: ../src/guestfs-actions.pod:3570
24775 msgid "guestfs_is_ready"
24779 #: ../src/guestfs-actions.pod:3572
24783 " guestfs_is_ready (guestfs_h *g);\n"
24788 #: ../src/guestfs-actions.pod:3584
24789 msgid "guestfs_is_socket"
24793 #: ../src/guestfs-actions.pod:3586
24797 " guestfs_is_socket (guestfs_h *g,\n"
24798 " const char *path);\n"
24803 #: ../src/guestfs-actions.pod:3599
24804 msgid "guestfs_is_symlink"
24808 #: ../src/guestfs-actions.pod:3601
24812 " guestfs_is_symlink (guestfs_h *g,\n"
24813 " const char *path);\n"
24818 #: ../src/guestfs-actions.pod:3614
24819 msgid "guestfs_is_zero"
24823 #: ../src/guestfs-actions.pod:3616
24827 " guestfs_is_zero (guestfs_h *g,\n"
24828 " const char *path);\n"
24833 #: ../src/guestfs-actions.pod:3625 ../src/guestfs-actions.pod:3639
24834 msgid "(Added in 1.11.8)"
24838 #: ../src/guestfs-actions.pod:3627
24839 msgid "guestfs_is_zero_device"
24843 #: ../src/guestfs-actions.pod:3629
24847 " guestfs_is_zero_device (guestfs_h *g,\n"
24848 " const char *device);\n"
24853 #: ../src/guestfs-actions.pod:3641
24854 msgid "guestfs_kill_subprocess"
24858 #: ../src/guestfs-actions.pod:3643
24862 " guestfs_kill_subprocess (guestfs_h *g);\n"
24867 #: ../src/guestfs-actions.pod:3652
24868 msgid "guestfs_launch"
24872 #: ../src/guestfs-actions.pod:3654
24876 " guestfs_launch (guestfs_h *g);\n"
24881 #: ../src/guestfs-actions.pod:3672
24882 msgid "guestfs_lchown"
24886 #: ../src/guestfs-actions.pod:3674
24890 " guestfs_lchown (guestfs_h *g,\n"
24893 " const char *path);\n"
24898 #: ../src/guestfs-actions.pod:3680
24900 "Change the file owner to C<owner> and group to C<group>. This is like "
24901 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
24902 "changed, not the target."
24906 #: ../src/guestfs-actions.pod:3692
24907 msgid "guestfs_lgetxattr"
24911 #: ../src/guestfs-actions.pod:3694
24915 " guestfs_lgetxattr (guestfs_h *g,\n"
24916 " const char *path,\n"
24917 " const char *name,\n"
24918 " size_t *size_r);\n"
24923 #: ../src/guestfs-actions.pod:3714
24924 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
24928 #: ../src/guestfs-actions.pod:3722
24929 msgid "guestfs_lgetxattrs"
24933 #: ../src/guestfs-actions.pod:3724
24936 " struct guestfs_xattr_list *\n"
24937 " guestfs_lgetxattrs (guestfs_h *g,\n"
24938 " const char *path);\n"
24943 #: ../src/guestfs-actions.pod:3728
24945 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
24946 "then it returns the extended attributes of the link itself."
24950 #: ../src/guestfs-actions.pod:3738
24951 msgid "guestfs_list_9p"
24955 #: ../src/guestfs-actions.pod:3740
24959 " guestfs_list_9p (guestfs_h *g);\n"
24964 #: ../src/guestfs-actions.pod:3752
24965 msgid "guestfs_list_devices"
24969 #: ../src/guestfs-actions.pod:3754
24973 " guestfs_list_devices (guestfs_h *g);\n"
24978 #: ../src/guestfs-actions.pod:3769
24979 msgid "guestfs_list_dm_devices"
24983 #: ../src/guestfs-actions.pod:3771
24987 " guestfs_list_dm_devices (guestfs_h *g);\n"
24992 #: ../src/guestfs-actions.pod:3776
24994 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
24995 "previous call to C<guestfs_luks_open>."
24999 #: ../src/guestfs-actions.pod:3779
25001 "Device mapper devices which correspond to logical volumes are I<not> "
25002 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
25007 #: ../src/guestfs-actions.pod:3787 ../src/guestfs-actions.pod:5243
25008 msgid "(Added in 1.11.15)"
25012 #: ../src/guestfs-actions.pod:3789
25013 msgid "guestfs_list_filesystems"
25017 #: ../src/guestfs-actions.pod:3791
25021 " guestfs_list_filesystems (guestfs_h *g);\n"
25026 #: ../src/guestfs-actions.pod:3811
25028 "This command runs other libguestfs commands, which might include "
25029 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
25030 "soon after launch and only when nothing is mounted."
25034 #: ../src/guestfs-actions.pod:3815
25036 "Not all of the filesystems returned will be mountable. In particular, swap "
25037 "partitions are returned in the list. Also this command does not check that "
25038 "each filesystem found is valid and mountable, and some filesystems might be "
25039 "mountable but require special options. Filesystems may not all belong to a "
25040 "single logical operating system (use C<guestfs_inspect_os> to look for "
25045 #: ../src/guestfs-actions.pod:3829 ../src/guestfs-actions.pod:5604
25046 msgid "(Added in 1.5.15)"
25050 #: ../src/guestfs-actions.pod:3831
25051 msgid "guestfs_list_partitions"
25055 #: ../src/guestfs-actions.pod:3833
25059 " guestfs_list_partitions (guestfs_h *g);\n"
25064 #: ../src/guestfs-actions.pod:3840
25066 "This does not return logical volumes. For that you will need to call "
25071 #: ../src/guestfs-actions.pod:3851
25076 #: ../src/guestfs-actions.pod:3853
25080 " guestfs_ll (guestfs_h *g,\n"
25081 " const char *directory);\n"
25086 #: ../src/guestfs-actions.pod:3868
25091 #: ../src/guestfs-actions.pod:3870
25095 " guestfs_ln (guestfs_h *g,\n"
25096 " const char *target,\n"
25097 " const char *linkname);\n"
25102 #: ../src/guestfs-actions.pod:3881
25103 msgid "guestfs_ln_f"
25107 #: ../src/guestfs-actions.pod:3883
25111 " guestfs_ln_f (guestfs_h *g,\n"
25112 " const char *target,\n"
25113 " const char *linkname);\n"
25118 #: ../src/guestfs-actions.pod:3895
25119 msgid "guestfs_ln_s"
25123 #: ../src/guestfs-actions.pod:3897
25127 " guestfs_ln_s (guestfs_h *g,\n"
25128 " const char *target,\n"
25129 " const char *linkname);\n"
25134 #: ../src/guestfs-actions.pod:3908
25135 msgid "guestfs_ln_sf"
25139 #: ../src/guestfs-actions.pod:3910
25143 " guestfs_ln_sf (guestfs_h *g,\n"
25144 " const char *target,\n"
25145 " const char *linkname);\n"
25150 #: ../src/guestfs-actions.pod:3922
25151 msgid "guestfs_lremovexattr"
25155 #: ../src/guestfs-actions.pod:3924
25159 " guestfs_lremovexattr (guestfs_h *g,\n"
25160 " const char *xattr,\n"
25161 " const char *path);\n"
25166 #: ../src/guestfs-actions.pod:3929
25168 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
25169 "link, then it removes an extended attribute of the link itself."
25173 #: ../src/guestfs-actions.pod:3937
25178 #: ../src/guestfs-actions.pod:3939
25182 " guestfs_ls (guestfs_h *g,\n"
25183 " const char *directory);\n"
25188 #: ../src/guestfs-actions.pod:3947
25190 "This command is mostly useful for interactive sessions. Programs should "
25191 "probably use C<guestfs_readdir> instead."
25195 #: ../src/guestfs-actions.pod:3956
25196 msgid "guestfs_lsetxattr"
25200 #: ../src/guestfs-actions.pod:3958
25204 " guestfs_lsetxattr (guestfs_h *g,\n"
25205 " const char *xattr,\n"
25206 " const char *val,\n"
25208 " const char *path);\n"
25213 #: ../src/guestfs-actions.pod:3965
25215 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
25216 "then it sets an extended attribute of the link itself."
25220 #: ../src/guestfs-actions.pod:3973
25221 msgid "guestfs_lstat"
25225 #: ../src/guestfs-actions.pod:3975
25228 " struct guestfs_stat *\n"
25229 " guestfs_lstat (guestfs_h *g,\n"
25230 " const char *path);\n"
25235 #: ../src/guestfs-actions.pod:3981
25237 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
25238 "link, then the link is stat-ed, not the file it refers to."
25242 #: ../src/guestfs-actions.pod:3987 ../src/guestfs-actions.pod:6762
25244 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
25245 "error. I<The caller must call C<guestfs_free_stat> after use>."
25249 #: ../src/guestfs-actions.pod:3991 ../src/guestfs-actions.pod:6766 ../src/guestfs-actions.pod:6784 ../src/guestfs-actions.pod:7165
25250 msgid "(Added in 0.9.2)"
25254 #: ../src/guestfs-actions.pod:3993
25255 msgid "guestfs_lstatlist"
25259 #: ../src/guestfs-actions.pod:3995
25262 " struct guestfs_stat_list *\n"
25263 " guestfs_lstatlist (guestfs_h *g,\n"
25264 " const char *path,\n"
25265 " char *const *names);\n"
25270 #: ../src/guestfs-actions.pod:4000
25272 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
25273 "files, where all files are in the directory C<path>. C<names> is the list "
25274 "of files from this directory."
25278 #: ../src/guestfs-actions.pod:4009
25280 "This call is intended for programs that want to efficiently list a directory "
25281 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
25282 "for a similarly efficient call for getting extended attributes. Very long "
25283 "directory listings might cause the protocol message size to be exceeded, "
25284 "causing this call to fail. The caller must split up such requests into "
25285 "smaller groups of names."
25289 #: ../src/guestfs-actions.pod:4017
25291 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
25292 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
25296 #: ../src/guestfs-actions.pod:4023
25297 msgid "guestfs_luks_add_key"
25301 #: ../src/guestfs-actions.pod:4025
25305 " guestfs_luks_add_key (guestfs_h *g,\n"
25306 " const char *device,\n"
25307 " const char *key,\n"
25308 " const char *newkey,\n"
25314 #: ../src/guestfs-actions.pod:4037
25316 "Note that if C<keyslot> already contains a key, then this command will "
25317 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
25321 #: ../src/guestfs-actions.pod:4043 ../src/guestfs-actions.pod:4083 ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4126 ../src/guestfs-actions.pod:4161 ../src/guestfs-actions.pod:4180
25323 "This function takes a key or passphrase parameter which could contain "
25324 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
25329 #: ../src/guestfs-actions.pod:4047 ../src/guestfs-actions.pod:4087 ../src/guestfs-actions.pod:4110 ../src/guestfs-actions.pod:4130
25330 msgid "(Added in 1.5.2)"
25334 #: ../src/guestfs-actions.pod:4049
25335 msgid "guestfs_luks_close"
25339 #: ../src/guestfs-actions.pod:4051
25343 " guestfs_luks_close (guestfs_h *g,\n"
25344 " const char *device);\n"
25349 #: ../src/guestfs-actions.pod:4055
25351 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
25352 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
25353 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
25354 "underlying block device."
25358 #: ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4165 ../src/guestfs-actions.pod:4184 ../src/guestfs-actions.pod:4234 ../src/guestfs-actions.pod:4282
25359 msgid "(Added in 1.5.1)"
25363 #: ../src/guestfs-actions.pod:4065
25364 msgid "guestfs_luks_format"
25368 #: ../src/guestfs-actions.pod:4067
25372 " guestfs_luks_format (guestfs_h *g,\n"
25373 " const char *device,\n"
25374 " const char *key,\n"
25380 #: ../src/guestfs-actions.pod:4089
25381 msgid "guestfs_luks_format_cipher"
25385 #: ../src/guestfs-actions.pod:4091
25389 " guestfs_luks_format_cipher (guestfs_h *g,\n"
25390 " const char *device,\n"
25391 " const char *key,\n"
25393 " const char *cipher);\n"
25398 #: ../src/guestfs-actions.pod:4098
25400 "This command is the same as C<guestfs_luks_format> but it also allows you to "
25401 "set the C<cipher> used."
25405 #: ../src/guestfs-actions.pod:4112
25406 msgid "guestfs_luks_kill_slot"
25410 #: ../src/guestfs-actions.pod:4114
25414 " guestfs_luks_kill_slot (guestfs_h *g,\n"
25415 " const char *device,\n"
25416 " const char *key,\n"
25422 #: ../src/guestfs-actions.pod:4132
25423 msgid "guestfs_luks_open"
25427 #: ../src/guestfs-actions.pod:4134
25431 " guestfs_luks_open (guestfs_h *g,\n"
25432 " const char *device,\n"
25433 " const char *key,\n"
25434 " const char *mapname);\n"
25439 #: ../src/guestfs-actions.pod:4152
25441 "If this block device contains LVM volume groups, then calling "
25442 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
25447 #: ../src/guestfs-actions.pod:4156
25448 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
25452 #: ../src/guestfs-actions.pod:4167
25453 msgid "guestfs_luks_open_ro"
25457 #: ../src/guestfs-actions.pod:4169
25461 " guestfs_luks_open_ro (guestfs_h *g,\n"
25462 " const char *device,\n"
25463 " const char *key,\n"
25464 " const char *mapname);\n"
25469 #: ../src/guestfs-actions.pod:4175
25471 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
25476 #: ../src/guestfs-actions.pod:4186
25477 msgid "guestfs_lvcreate"
25481 #: ../src/guestfs-actions.pod:4188
25485 " guestfs_lvcreate (guestfs_h *g,\n"
25486 " const char *logvol,\n"
25487 " const char *volgroup,\n"
25493 #: ../src/guestfs-actions.pod:4201
25494 msgid "guestfs_lvm_canonical_lv_name"
25498 #: ../src/guestfs-actions.pod:4203
25502 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
25503 " const char *lvname);\n"
25508 #: ../src/guestfs-actions.pod:4214
25509 msgid "See also C<guestfs_is_lv>."
25513 #: ../src/guestfs-actions.pod:4219
25514 msgid "(Added in 1.5.24)"
25518 #: ../src/guestfs-actions.pod:4221
25519 msgid "guestfs_lvm_clear_filter"
25523 #: ../src/guestfs-actions.pod:4223
25527 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
25532 #: ../src/guestfs-actions.pod:4226
25534 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
25535 "see every block device."
25539 #: ../src/guestfs-actions.pod:4236
25540 msgid "guestfs_lvm_remove_all"
25544 #: ../src/guestfs-actions.pod:4238
25548 " guestfs_lvm_remove_all (guestfs_h *g);\n"
25553 #: ../src/guestfs-actions.pod:4251
25554 msgid "guestfs_lvm_set_filter"
25558 #: ../src/guestfs-actions.pod:4253
25562 " guestfs_lvm_set_filter (guestfs_h *g,\n"
25563 " char *const *devices);\n"
25568 #: ../src/guestfs-actions.pod:4284
25569 msgid "guestfs_lvremove"
25573 #: ../src/guestfs-actions.pod:4286
25577 " guestfs_lvremove (guestfs_h *g,\n"
25578 " const char *device);\n"
25583 #: ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:5701 ../src/guestfs-actions.pod:7535
25584 msgid "(Added in 1.0.13)"
25588 #: ../src/guestfs-actions.pod:4300
25589 msgid "guestfs_lvrename"
25593 #: ../src/guestfs-actions.pod:4302
25597 " guestfs_lvrename (guestfs_h *g,\n"
25598 " const char *logvol,\n"
25599 " const char *newlogvol);\n"
25604 #: ../src/guestfs-actions.pod:4311 ../src/guestfs-actions.pod:7548
25605 msgid "(Added in 1.0.83)"
25609 #: ../src/guestfs-actions.pod:4313
25610 msgid "guestfs_lvresize"
25614 #: ../src/guestfs-actions.pod:4315
25618 " guestfs_lvresize (guestfs_h *g,\n"
25619 " const char *device,\n"
25625 #: ../src/guestfs-actions.pod:4328
25626 msgid "guestfs_lvresize_free"
25630 #: ../src/guestfs-actions.pod:4330
25634 " guestfs_lvresize_free (guestfs_h *g,\n"
25635 " const char *lv,\n"
25641 #: ../src/guestfs-actions.pod:4343
25642 msgid "(Added in 1.3.3)"
25646 #: ../src/guestfs-actions.pod:4345
25647 msgid "guestfs_lvs"
25651 #: ../src/guestfs-actions.pod:4347
25655 " guestfs_lvs (guestfs_h *g);\n"
25660 #: ../src/guestfs-actions.pod:4356
25661 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
25665 #: ../src/guestfs-actions.pod:4364
25666 msgid "guestfs_lvs_full"
25670 #: ../src/guestfs-actions.pod:4366
25673 " struct guestfs_lvm_lv_list *\n"
25674 " guestfs_lvs_full (guestfs_h *g);\n"
25679 #: ../src/guestfs-actions.pod:4372
25681 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
25682 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
25687 #: ../src/guestfs-actions.pod:4378
25688 msgid "guestfs_lvuuid"
25692 #: ../src/guestfs-actions.pod:4380
25696 " guestfs_lvuuid (guestfs_h *g,\n"
25697 " const char *device);\n"
25702 #: ../src/guestfs-actions.pod:4391
25703 msgid "guestfs_lxattrlist"
25707 #: ../src/guestfs-actions.pod:4393
25710 " struct guestfs_xattr_list *\n"
25711 " guestfs_lxattrlist (guestfs_h *g,\n"
25712 " const char *path,\n"
25713 " char *const *names);\n"
25718 #: ../src/guestfs-actions.pod:4412
25720 "This call is intended for programs that want to efficiently list a directory "
25721 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
25722 "a similarly efficient call for getting standard stats. Very long directory "
25723 "listings might cause the protocol message size to be exceeded, causing this "
25724 "call to fail. The caller must split up such requests into smaller groups of "
25729 #: ../src/guestfs-actions.pod:4426
25730 msgid "guestfs_mkdir"
25734 #: ../src/guestfs-actions.pod:4428
25738 " guestfs_mkdir (guestfs_h *g,\n"
25739 " const char *path);\n"
25744 #: ../src/guestfs-actions.pod:4438
25745 msgid "guestfs_mkdir_mode"
25749 #: ../src/guestfs-actions.pod:4440
25753 " guestfs_mkdir_mode (guestfs_h *g,\n"
25754 " const char *path,\n"
25760 #: ../src/guestfs-actions.pod:4452
25761 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
25765 #: ../src/guestfs-actions.pod:4458
25766 msgid "guestfs_mkdir_p"
25770 #: ../src/guestfs-actions.pod:4460
25774 " guestfs_mkdir_p (guestfs_h *g,\n"
25775 " const char *path);\n"
25780 #: ../src/guestfs-actions.pod:4471
25781 msgid "guestfs_mkdtemp"
25785 #: ../src/guestfs-actions.pod:4473
25789 " guestfs_mkdtemp (guestfs_h *g,\n"
25790 " const char *template);\n"
25795 #: ../src/guestfs-actions.pod:4501
25796 msgid "guestfs_mke2fs_J"
25800 #: ../src/guestfs-actions.pod:4503
25804 " guestfs_mke2fs_J (guestfs_h *g,\n"
25805 " const char *fstype,\n"
25806 " int blocksize,\n"
25807 " const char *device,\n"
25808 " const char *journal);\n"
25813 #: ../src/guestfs-actions.pod:4516
25814 msgid "See also C<guestfs_mke2journal>."
25818 #: ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4538 ../src/guestfs-actions.pod:4556 ../src/guestfs-actions.pod:4572 ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4600 ../src/guestfs-actions.pod:4659 ../src/guestfs-actions.pod:4936
25819 msgid "(Added in 1.0.68)"
25823 #: ../src/guestfs-actions.pod:4522
25824 msgid "guestfs_mke2fs_JL"
25828 #: ../src/guestfs-actions.pod:4524
25832 " guestfs_mke2fs_JL (guestfs_h *g,\n"
25833 " const char *fstype,\n"
25834 " int blocksize,\n"
25835 " const char *device,\n"
25836 " const char *label);\n"
25841 #: ../src/guestfs-actions.pod:4534
25842 msgid "See also C<guestfs_mke2journal_L>."
25846 #: ../src/guestfs-actions.pod:4540
25847 msgid "guestfs_mke2fs_JU"
25851 #: ../src/guestfs-actions.pod:4542
25855 " guestfs_mke2fs_JU (guestfs_h *g,\n"
25856 " const char *fstype,\n"
25857 " int blocksize,\n"
25858 " const char *device,\n"
25859 " const char *uuid);\n"
25864 #: ../src/guestfs-actions.pod:4552
25865 msgid "See also C<guestfs_mke2journal_U>."
25869 #: ../src/guestfs-actions.pod:4558
25870 msgid "guestfs_mke2journal"
25874 #: ../src/guestfs-actions.pod:4560
25878 " guestfs_mke2journal (guestfs_h *g,\n"
25879 " int blocksize,\n"
25880 " const char *device);\n"
25885 #: ../src/guestfs-actions.pod:4574
25886 msgid "guestfs_mke2journal_L"
25890 #: ../src/guestfs-actions.pod:4576
25894 " guestfs_mke2journal_L (guestfs_h *g,\n"
25895 " int blocksize,\n"
25896 " const char *label,\n"
25897 " const char *device);\n"
25902 #: ../src/guestfs-actions.pod:4588
25903 msgid "guestfs_mke2journal_U"
25907 #: ../src/guestfs-actions.pod:4590
25911 " guestfs_mke2journal_U (guestfs_h *g,\n"
25912 " int blocksize,\n"
25913 " const char *uuid,\n"
25914 " const char *device);\n"
25919 #: ../src/guestfs-actions.pod:4602
25920 msgid "guestfs_mkfifo"
25924 #: ../src/guestfs-actions.pod:4604
25928 " guestfs_mkfifo (guestfs_h *g,\n"
25930 " const char *path);\n"
25935 #: ../src/guestfs-actions.pod:4609
25937 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
25938 "is just a convenient wrapper around C<guestfs_mknod>."
25942 #: ../src/guestfs-actions.pod:4619
25943 msgid "guestfs_mkfs"
25947 #: ../src/guestfs-actions.pod:4621
25951 " guestfs_mkfs (guestfs_h *g,\n"
25952 " const char *fstype,\n"
25953 " const char *device);\n"
25958 #: ../src/guestfs-actions.pod:4634
25959 msgid "guestfs_mkfs_b"
25963 #: ../src/guestfs-actions.pod:4636
25967 " guestfs_mkfs_b (guestfs_h *g,\n"
25968 " const char *fstype,\n"
25969 " int blocksize,\n"
25970 " const char *device);\n"
25975 #: ../src/guestfs-actions.pod:4642
25977 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
25978 "block size of the resulting filesystem. Supported block sizes depend on the "
25979 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
25983 #: ../src/guestfs-actions.pod:4652
25985 "This function is deprecated. In new code, use the L</guestfs_mkfs_opts> "
25990 #: ../src/guestfs-actions.pod:4661
25991 msgid "guestfs_mkfs_opts"
25995 #: ../src/guestfs-actions.pod:4663
25999 " guestfs_mkfs_opts (guestfs_h *g,\n"
26000 " const char *fstype,\n"
26001 " const char *device,\n"
26007 #: ../src/guestfs-actions.pod:4674
26010 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
26011 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
26012 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
26013 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
26018 #: ../src/guestfs-actions.pod:4722
26019 msgid "(Added in 1.7.19)"
26023 #: ../src/guestfs-actions.pod:4724
26024 msgid "guestfs_mkfs_opts_va"
26028 #: ../src/guestfs-actions.pod:4726
26032 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
26033 " const char *fstype,\n"
26034 " const char *device,\n"
26035 " va_list args);\n"
26040 #: ../src/guestfs-actions.pod:4732
26041 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
26045 #: ../src/guestfs-actions.pod:4736
26046 msgid "guestfs_mkfs_opts_argv"
26050 #: ../src/guestfs-actions.pod:4738
26054 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
26055 " const char *fstype,\n"
26056 " const char *device,\n"
26057 " const struct guestfs_mkfs_opts_argv *optargs);\n"
26062 #: ../src/guestfs-actions.pod:4744
26063 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
26067 #: ../src/guestfs-actions.pod:4748
26068 msgid "guestfs_mkmountpoint"
26072 #: ../src/guestfs-actions.pod:4750
26076 " guestfs_mkmountpoint (guestfs_h *g,\n"
26077 " const char *exemptpath);\n"
26082 #: ../src/guestfs-actions.pod:4754
26084 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
26085 "that can be used to create extra mountpoints before mounting the first "
26090 #: ../src/guestfs-actions.pod:4778
26092 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
26093 "may get unexpected errors if you try to mix these calls. It is safest to "
26094 "manually unmount filesystems and remove mountpoints after use."
26098 #: ../src/guestfs-actions.pod:4782
26100 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
26101 "first, so for this to work for manual mountpoints, you must ensure that the "
26102 "innermost mountpoints have the longest pathnames, as in the example code "
26107 #: ../src/guestfs-actions.pod:4789
26109 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
26110 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
26111 "can also trigger these issues."
26115 #: ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:5111 ../src/guestfs-actions.pod:6121
26116 msgid "(Added in 1.0.62)"
26120 #: ../src/guestfs-actions.pod:4797
26121 msgid "guestfs_mknod"
26125 #: ../src/guestfs-actions.pod:4799
26129 " guestfs_mknod (guestfs_h *g,\n"
26133 " const char *path);\n"
26138 #: ../src/guestfs-actions.pod:4814
26140 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
26141 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
26142 "regular file). These constants are available in the standard Linux header "
26143 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
26144 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
26145 "the appropriate constant for you."
26149 #: ../src/guestfs-actions.pod:4828
26150 msgid "guestfs_mknod_b"
26154 #: ../src/guestfs-actions.pod:4830
26158 " guestfs_mknod_b (guestfs_h *g,\n"
26162 " const char *path);\n"
26167 #: ../src/guestfs-actions.pod:4837
26169 "This call creates a block device node called C<path> with mode C<mode> and "
26170 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26171 "wrapper around C<guestfs_mknod>."
26175 #: ../src/guestfs-actions.pod:4847
26176 msgid "guestfs_mknod_c"
26180 #: ../src/guestfs-actions.pod:4849
26184 " guestfs_mknod_c (guestfs_h *g,\n"
26188 " const char *path);\n"
26193 #: ../src/guestfs-actions.pod:4856
26195 "This call creates a char device node called C<path> with mode C<mode> and "
26196 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26197 "wrapper around C<guestfs_mknod>."
26201 #: ../src/guestfs-actions.pod:4866
26202 msgid "guestfs_mkswap"
26206 #: ../src/guestfs-actions.pod:4868
26210 " guestfs_mkswap (guestfs_h *g,\n"
26211 " const char *device);\n"
26216 #: ../src/guestfs-actions.pod:4878
26217 msgid "guestfs_mkswap_L"
26221 #: ../src/guestfs-actions.pod:4880
26225 " guestfs_mkswap_L (guestfs_h *g,\n"
26226 " const char *label,\n"
26227 " const char *device);\n"
26232 #: ../src/guestfs-actions.pod:4895
26233 msgid "guestfs_mkswap_U"
26237 #: ../src/guestfs-actions.pod:4897
26241 " guestfs_mkswap_U (guestfs_h *g,\n"
26242 " const char *uuid,\n"
26243 " const char *device);\n"
26248 #: ../src/guestfs-actions.pod:4908
26249 msgid "guestfs_mkswap_file"
26253 #: ../src/guestfs-actions.pod:4910
26257 " guestfs_mkswap_file (guestfs_h *g,\n"
26258 " const char *path);\n"
26263 #: ../src/guestfs-actions.pod:4916
26265 "This command just writes a swap file signature to an existing file. To "
26266 "create the file itself, use something like C<guestfs_fallocate>."
26270 #: ../src/guestfs-actions.pod:4923
26271 msgid "guestfs_modprobe"
26275 #: ../src/guestfs-actions.pod:4925
26279 " guestfs_modprobe (guestfs_h *g,\n"
26280 " const char *modulename);\n"
26285 #: ../src/guestfs-actions.pod:4938
26286 msgid "guestfs_mount"
26290 #: ../src/guestfs-actions.pod:4940
26294 " guestfs_mount (guestfs_h *g,\n"
26295 " const char *device,\n"
26296 " const char *mountpoint);\n"
26301 #: ../src/guestfs-actions.pod:4959
26303 "B<Important note:> When you use this call, the filesystem options C<sync> "
26304 "and C<noatime> are set implicitly. This was originally done because we "
26305 "thought it would improve reliability, but it turns out that I<-o sync> has a "
26306 "very large negative performance impact and negligible effect on "
26307 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
26308 "in any code that needs performance, and instead use C<guestfs_mount_options> "
26309 "(use an empty string for the first parameter if you don't want any options)."
26313 #: ../src/guestfs-actions.pod:4971
26315 "This function is deprecated. In new code, use the L</guestfs_mount_options> "
26320 #: ../src/guestfs-actions.pod:4980
26321 msgid "guestfs_mount_9p"
26325 #: ../src/guestfs-actions.pod:4982
26329 " guestfs_mount_9p (guestfs_h *g,\n"
26330 " const char *mounttag,\n"
26331 " const char *mountpoint,\n"
26337 #: ../src/guestfs-actions.pod:4993
26340 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
26345 #: ../src/guestfs-actions.pod:5006
26346 msgid "guestfs_mount_9p_va"
26350 #: ../src/guestfs-actions.pod:5008
26354 " guestfs_mount_9p_va (guestfs_h *g,\n"
26355 " const char *mounttag,\n"
26356 " const char *mountpoint,\n"
26357 " va_list args);\n"
26362 #: ../src/guestfs-actions.pod:5014
26363 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
26367 #: ../src/guestfs-actions.pod:5018
26368 msgid "guestfs_mount_9p_argv"
26372 #: ../src/guestfs-actions.pod:5020
26376 " guestfs_mount_9p_argv (guestfs_h *g,\n"
26377 " const char *mounttag,\n"
26378 " const char *mountpoint,\n"
26379 " const struct guestfs_mount_9p_argv *optargs);\n"
26384 #: ../src/guestfs-actions.pod:5026
26385 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
26389 #: ../src/guestfs-actions.pod:5030
26390 msgid "guestfs_mount_loop"
26394 #: ../src/guestfs-actions.pod:5032
26398 " guestfs_mount_loop (guestfs_h *g,\n"
26399 " const char *file,\n"
26400 " const char *mountpoint);\n"
26405 #: ../src/guestfs-actions.pod:5045
26406 msgid "guestfs_mount_options"
26410 #: ../src/guestfs-actions.pod:5047
26414 " guestfs_mount_options (guestfs_h *g,\n"
26415 " const char *options,\n"
26416 " const char *device,\n"
26417 " const char *mountpoint);\n"
26422 #: ../src/guestfs-actions.pod:5053
26424 "This is the same as the C<guestfs_mount> command, but it allows you to set "
26425 "the mount options as for the L<mount(8)> I<-o> flag."
26429 #: ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5077 ../src/guestfs-actions.pod:5094
26430 msgid "(Added in 1.0.10)"
26434 #: ../src/guestfs-actions.pod:5065
26435 msgid "guestfs_mount_ro"
26439 #: ../src/guestfs-actions.pod:5067
26443 " guestfs_mount_ro (guestfs_h *g,\n"
26444 " const char *device,\n"
26445 " const char *mountpoint);\n"
26450 #: ../src/guestfs-actions.pod:5072
26452 "This is the same as the C<guestfs_mount> command, but it mounts the "
26453 "filesystem with the read-only (I<-o ro>) flag."
26457 #: ../src/guestfs-actions.pod:5079
26458 msgid "guestfs_mount_vfs"
26462 #: ../src/guestfs-actions.pod:5081
26466 " guestfs_mount_vfs (guestfs_h *g,\n"
26467 " const char *options,\n"
26468 " const char *vfstype,\n"
26469 " const char *device,\n"
26470 " const char *mountpoint);\n"
26475 #: ../src/guestfs-actions.pod:5088
26477 "This is the same as the C<guestfs_mount> command, but it allows you to set "
26478 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
26483 #: ../src/guestfs-actions.pod:5096
26484 msgid "guestfs_mountpoints"
26488 #: ../src/guestfs-actions.pod:5098
26492 " guestfs_mountpoints (guestfs_h *g);\n"
26497 #: ../src/guestfs-actions.pod:5101
26499 "This call is similar to C<guestfs_mounts>. That call returns a list of "
26500 "devices. This one returns a hash table (map) of device name to directory "
26501 "where the device is mounted."
26505 #: ../src/guestfs-actions.pod:5113
26506 msgid "guestfs_mounts"
26510 #: ../src/guestfs-actions.pod:5115
26514 " guestfs_mounts (guestfs_h *g);\n"
26519 #: ../src/guestfs-actions.pod:5123
26520 msgid "See also: C<guestfs_mountpoints>"
26524 #: ../src/guestfs-actions.pod:5131
26529 #: ../src/guestfs-actions.pod:5133
26533 " guestfs_mv (guestfs_h *g,\n"
26534 " const char *src,\n"
26535 " const char *dest);\n"
26540 #: ../src/guestfs-actions.pod:5145
26541 msgid "guestfs_ntfs_3g_probe"
26545 #: ../src/guestfs-actions.pod:5147
26549 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
26551 " const char *device);\n"
26556 #: ../src/guestfs-actions.pod:5166
26557 msgid "(Added in 1.0.43)"
26561 #: ../src/guestfs-actions.pod:5168
26562 msgid "guestfs_ntfsresize"
26566 #: ../src/guestfs-actions.pod:5170
26570 " guestfs_ntfsresize (guestfs_h *g,\n"
26571 " const char *device);\n"
26576 #: ../src/guestfs-actions.pod:5189 ../src/guestfs-actions.pod:5279
26578 "This function is deprecated. In new code, use the "
26579 "L</guestfs_ntfsresize_opts> call instead."
26583 #: ../src/guestfs-actions.pod:5198
26584 msgid "guestfs_ntfsresize_opts"
26588 #: ../src/guestfs-actions.pod:5200
26592 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
26593 " const char *device,\n"
26599 #: ../src/guestfs-actions.pod:5210
26602 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
26603 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
26608 #: ../src/guestfs-actions.pod:5230
26610 "After the resize operation, the filesystem is always marked as requiring a "
26611 "consistency check (for safety). You have to boot into Windows to perform "
26612 "this check and clear this condition. If you I<don't> set the C<force> "
26613 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
26614 "times on a single filesystem without booting into Windows between each "
26619 #: ../src/guestfs-actions.pod:5245
26620 msgid "guestfs_ntfsresize_opts_va"
26624 #: ../src/guestfs-actions.pod:5247
26628 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
26629 " const char *device,\n"
26630 " va_list args);\n"
26635 #: ../src/guestfs-actions.pod:5252
26636 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
26640 #: ../src/guestfs-actions.pod:5256
26641 msgid "guestfs_ntfsresize_opts_argv"
26645 #: ../src/guestfs-actions.pod:5258
26649 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
26650 " const char *device,\n"
26651 " const struct guestfs_ntfsresize_opts_argv "
26657 #: ../src/guestfs-actions.pod:5263
26658 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
26662 #: ../src/guestfs-actions.pod:5267
26663 msgid "guestfs_ntfsresize_size"
26667 #: ../src/guestfs-actions.pod:5269
26671 " guestfs_ntfsresize_size (guestfs_h *g,\n"
26672 " const char *device,\n"
26673 " int64_t size);\n"
26678 #: ../src/guestfs-actions.pod:5274
26680 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
26681 "to specify the new size (in bytes) explicitly."
26685 #: ../src/guestfs-actions.pod:5286 ../src/guestfs-actions.pod:5728 ../src/guestfs-actions.pod:5801 ../src/guestfs-actions.pod:6069 ../src/guestfs-actions.pod:7692
26686 msgid "(Added in 1.3.14)"
26690 #: ../src/guestfs-actions.pod:5288
26691 msgid "guestfs_part_add"
26695 #: ../src/guestfs-actions.pod:5290
26699 " guestfs_part_add (guestfs_h *g,\n"
26700 " const char *device,\n"
26701 " const char *prlogex,\n"
26702 " int64_t startsect,\n"
26703 " int64_t endsect);\n"
26708 #: ../src/guestfs-actions.pod:5297
26710 "This command adds a partition to C<device>. If there is no partition table "
26711 "on the device, call C<guestfs_part_init> first."
26715 #: ../src/guestfs-actions.pod:5309
26717 "Creating a partition which covers the whole disk is not so easy. Use "
26718 "C<guestfs_part_disk> to do that."
26722 #: ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:5352 ../src/guestfs-actions.pod:5405 ../src/guestfs-actions.pod:5489 ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:5546 ../src/guestfs-actions.pod:5586
26723 msgid "(Added in 1.0.78)"
26727 #: ../src/guestfs-actions.pod:5316
26728 msgid "guestfs_part_del"
26732 #: ../src/guestfs-actions.pod:5318
26736 " guestfs_part_del (guestfs_h *g,\n"
26737 " const char *device,\n"
26743 #: ../src/guestfs-actions.pod:5333
26744 msgid "guestfs_part_disk"
26748 #: ../src/guestfs-actions.pod:5335
26752 " guestfs_part_disk (guestfs_h *g,\n"
26753 " const char *device,\n"
26754 " const char *parttype);\n"
26759 #: ../src/guestfs-actions.pod:5340
26761 "This command is simply a combination of C<guestfs_part_init> followed by "
26762 "C<guestfs_part_add> to create a single primary partition covering the whole "
26767 #: ../src/guestfs-actions.pod:5344
26769 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
26770 "possible values are described in C<guestfs_part_init>."
26774 #: ../src/guestfs-actions.pod:5354
26775 msgid "guestfs_part_get_bootable"
26779 #: ../src/guestfs-actions.pod:5356
26783 " guestfs_part_get_bootable (guestfs_h *g,\n"
26784 " const char *device,\n"
26790 #: ../src/guestfs-actions.pod:5364
26791 msgid "See also C<guestfs_part_set_bootable>."
26795 #: ../src/guestfs-actions.pod:5370
26796 msgid "guestfs_part_get_mbr_id"
26800 #: ../src/guestfs-actions.pod:5372
26804 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
26805 " const char *device,\n"
26811 #: ../src/guestfs-actions.pod:5380 ../src/guestfs-actions.pod:5562
26813 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
26814 "undefined results for other partition table types (see "
26815 "C<guestfs_part_get_parttype>)."
26819 #: ../src/guestfs-actions.pod:5388
26820 msgid "guestfs_part_get_parttype"
26824 #: ../src/guestfs-actions.pod:5390
26828 " guestfs_part_get_parttype (guestfs_h *g,\n"
26829 " const char *device);\n"
26834 #: ../src/guestfs-actions.pod:5397
26836 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
26837 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
26838 "possible, although unusual. See C<guestfs_part_init> for a full list."
26842 #: ../src/guestfs-actions.pod:5407
26843 msgid "guestfs_part_init"
26847 #: ../src/guestfs-actions.pod:5409
26851 " guestfs_part_init (guestfs_h *g,\n"
26852 " const char *device,\n"
26853 " const char *parttype);\n"
26858 #: ../src/guestfs-actions.pod:5418
26860 "Initially there are no partitions. Following this, you should call "
26861 "C<guestfs_part_add> for each partition required."
26865 #: ../src/guestfs-actions.pod:5491
26866 msgid "guestfs_part_list"
26870 #: ../src/guestfs-actions.pod:5493
26873 " struct guestfs_partition_list *\n"
26874 " guestfs_part_list (guestfs_h *g,\n"
26875 " const char *device);\n"
26880 #: ../src/guestfs-actions.pod:5510
26882 "Start of the partition I<in bytes>. To get sectors you have to divide by "
26883 "the device's sector size, see C<guestfs_blockdev_getss>."
26887 #: ../src/guestfs-actions.pod:5523
26889 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
26890 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
26895 #: ../src/guestfs-actions.pod:5529
26896 msgid "guestfs_part_set_bootable"
26900 #: ../src/guestfs-actions.pod:5531
26904 " guestfs_part_set_bootable (guestfs_h *g,\n"
26905 " const char *device,\n"
26907 " int bootable);\n"
26912 #: ../src/guestfs-actions.pod:5548
26913 msgid "guestfs_part_set_mbr_id"
26917 #: ../src/guestfs-actions.pod:5550
26921 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
26922 " const char *device,\n"
26929 #: ../src/guestfs-actions.pod:5570
26930 msgid "guestfs_part_set_name"
26934 #: ../src/guestfs-actions.pod:5572
26938 " guestfs_part_set_name (guestfs_h *g,\n"
26939 " const char *device,\n"
26941 " const char *name);\n"
26946 #: ../src/guestfs-actions.pod:5588
26947 msgid "guestfs_part_to_dev"
26951 #: ../src/guestfs-actions.pod:5590
26955 " guestfs_part_to_dev (guestfs_h *g,\n"
26956 " const char *partition);\n"
26961 #: ../src/guestfs-actions.pod:5598
26963 "The named partition must exist, for example as a string returned from "
26964 "C<guestfs_list_partitions>."
26968 #: ../src/guestfs-actions.pod:5606
26969 msgid "guestfs_ping_daemon"
26973 #: ../src/guestfs-actions.pod:5608
26977 " guestfs_ping_daemon (guestfs_h *g);\n"
26982 #: ../src/guestfs-actions.pod:5620
26983 msgid "guestfs_pread"
26987 #: ../src/guestfs-actions.pod:5622
26991 " guestfs_pread (guestfs_h *g,\n"
26992 " const char *path,\n"
26994 " int64_t offset,\n"
26995 " size_t *size_r);\n"
27000 #: ../src/guestfs-actions.pod:5635
27001 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
27005 #: ../src/guestfs-actions.pod:5646
27006 msgid "guestfs_pread_device"
27010 #: ../src/guestfs-actions.pod:5648
27014 " guestfs_pread_device (guestfs_h *g,\n"
27015 " const char *device,\n"
27017 " int64_t offset,\n"
27018 " size_t *size_r);\n"
27023 #: ../src/guestfs-actions.pod:5661
27024 msgid "See also C<guestfs_pread>."
27028 #: ../src/guestfs-actions.pod:5670
27029 msgid "(Added in 1.5.21)"
27033 #: ../src/guestfs-actions.pod:5672
27034 msgid "guestfs_pvcreate"
27038 #: ../src/guestfs-actions.pod:5674
27042 " guestfs_pvcreate (guestfs_h *g,\n"
27043 " const char *device);\n"
27048 #: ../src/guestfs-actions.pod:5686
27049 msgid "guestfs_pvremove"
27053 #: ../src/guestfs-actions.pod:5688
27057 " guestfs_pvremove (guestfs_h *g,\n"
27058 " const char *device);\n"
27063 #: ../src/guestfs-actions.pod:5703
27064 msgid "guestfs_pvresize"
27068 #: ../src/guestfs-actions.pod:5705
27072 " guestfs_pvresize (guestfs_h *g,\n"
27073 " const char *device);\n"
27078 #: ../src/guestfs-actions.pod:5716
27079 msgid "guestfs_pvresize_size"
27083 #: ../src/guestfs-actions.pod:5718
27087 " guestfs_pvresize_size (guestfs_h *g,\n"
27088 " const char *device,\n"
27089 " int64_t size);\n"
27094 #: ../src/guestfs-actions.pod:5723
27096 "This command is the same as C<guestfs_pvresize> except that it allows you to "
27097 "specify the new size (in bytes) explicitly."
27101 #: ../src/guestfs-actions.pod:5730
27102 msgid "guestfs_pvs"
27106 #: ../src/guestfs-actions.pod:5732
27110 " guestfs_pvs (guestfs_h *g);\n"
27115 #: ../src/guestfs-actions.pod:5741
27116 msgid "See also C<guestfs_pvs_full>."
27120 #: ../src/guestfs-actions.pod:5749
27121 msgid "guestfs_pvs_full"
27125 #: ../src/guestfs-actions.pod:5751
27128 " struct guestfs_lvm_pv_list *\n"
27129 " guestfs_pvs_full (guestfs_h *g);\n"
27134 #: ../src/guestfs-actions.pod:5757
27136 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
27137 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
27142 #: ../src/guestfs-actions.pod:5763
27143 msgid "guestfs_pvuuid"
27147 #: ../src/guestfs-actions.pod:5765
27151 " guestfs_pvuuid (guestfs_h *g,\n"
27152 " const char *device);\n"
27157 #: ../src/guestfs-actions.pod:5776
27158 msgid "guestfs_pwrite"
27162 #: ../src/guestfs-actions.pod:5778
27166 " guestfs_pwrite (guestfs_h *g,\n"
27167 " const char *path,\n"
27168 " const char *content,\n"
27169 " size_t content_size,\n"
27170 " int64_t offset);\n"
27175 #: ../src/guestfs-actions.pod:5794
27176 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
27180 #: ../src/guestfs-actions.pod:5803
27181 msgid "guestfs_pwrite_device"
27185 #: ../src/guestfs-actions.pod:5805
27189 " guestfs_pwrite_device (guestfs_h *g,\n"
27190 " const char *device,\n"
27191 " const char *content,\n"
27192 " size_t content_size,\n"
27193 " int64_t offset);\n"
27198 #: ../src/guestfs-actions.pod:5820
27199 msgid "See also C<guestfs_pwrite>."
27203 #: ../src/guestfs-actions.pod:5827
27204 msgid "(Added in 1.5.20)"
27208 #: ../src/guestfs-actions.pod:5829
27209 msgid "guestfs_read_file"
27213 #: ../src/guestfs-actions.pod:5831
27217 " guestfs_read_file (guestfs_h *g,\n"
27218 " const char *path,\n"
27219 " size_t *size_r);\n"
27224 #: ../src/guestfs-actions.pod:5839
27226 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
27227 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
27228 "function is limited in the total size of file that can be handled."
27232 #: ../src/guestfs-actions.pod:5851
27233 msgid "(Added in 1.0.63)"
27237 #: ../src/guestfs-actions.pod:5853
27238 msgid "guestfs_read_lines"
27242 #: ../src/guestfs-actions.pod:5855
27246 " guestfs_read_lines (guestfs_h *g,\n"
27247 " const char *path);\n"
27252 #: ../src/guestfs-actions.pod:5864
27254 "Note that this function cannot correctly handle binary files (specifically, "
27255 "files containing C<\\0> character which is treated as end of line). For "
27256 "those you need to use the C<guestfs_read_file> function which has a more "
27257 "complex interface."
27261 #: ../src/guestfs-actions.pod:5875
27262 msgid "guestfs_readdir"
27266 #: ../src/guestfs-actions.pod:5877
27269 " struct guestfs_dirent_list *\n"
27270 " guestfs_readdir (guestfs_h *g,\n"
27271 " const char *dir);\n"
27276 #: ../src/guestfs-actions.pod:5931
27278 "This function is primarily intended for use by programs. To get a simple "
27279 "list of names, use C<guestfs_ls>. To get a printable directory for human "
27280 "consumption, use C<guestfs_ll>."
27284 #: ../src/guestfs-actions.pod:5935
27286 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
27287 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
27292 #: ../src/guestfs-actions.pod:5941
27293 msgid "guestfs_readlink"
27297 #: ../src/guestfs-actions.pod:5943
27301 " guestfs_readlink (guestfs_h *g,\n"
27302 " const char *path);\n"
27307 #: ../src/guestfs-actions.pod:5954
27308 msgid "guestfs_readlinklist"
27312 #: ../src/guestfs-actions.pod:5956
27316 " guestfs_readlinklist (guestfs_h *g,\n"
27317 " const char *path,\n"
27318 " char *const *names);\n"
27323 #: ../src/guestfs-actions.pod:5989
27324 msgid "guestfs_realpath"
27328 #: ../src/guestfs-actions.pod:5991
27332 " guestfs_realpath (guestfs_h *g,\n"
27333 " const char *path);\n"
27338 #: ../src/guestfs-actions.pod:6003
27339 msgid "guestfs_removexattr"
27343 #: ../src/guestfs-actions.pod:6005
27347 " guestfs_removexattr (guestfs_h *g,\n"
27348 " const char *xattr,\n"
27349 " const char *path);\n"
27354 #: ../src/guestfs-actions.pod:6013
27355 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
27359 #: ../src/guestfs-actions.pod:6019
27360 msgid "guestfs_resize2fs"
27364 #: ../src/guestfs-actions.pod:6021
27368 " guestfs_resize2fs (guestfs_h *g,\n"
27369 " const char *device);\n"
27374 #: ../src/guestfs-actions.pod:6028
27376 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
27377 "C<device> before calling this command. For unknown reasons C<resize2fs> "
27378 "sometimes gives an error about this and sometimes not. In any case, it is "
27379 "always safe to call C<guestfs_e2fsck_f> before calling this function."
27383 #: ../src/guestfs-actions.pod:6038
27384 msgid "guestfs_resize2fs_M"
27388 #: ../src/guestfs-actions.pod:6040
27392 " guestfs_resize2fs_M (guestfs_h *g,\n"
27393 " const char *device);\n"
27398 #: ../src/guestfs-actions.pod:6044
27400 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
27401 "resized to its minimum size. This works like the I<-M> option to the "
27402 "C<resize2fs> command."
27406 #: ../src/guestfs-actions.pod:6048
27408 "To get the resulting size of the filesystem you should call "
27409 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
27410 "These two numbers, multiplied together, give the resulting size of the "
27411 "minimal filesystem in bytes."
27415 #: ../src/guestfs-actions.pod:6057
27416 msgid "guestfs_resize2fs_size"
27420 #: ../src/guestfs-actions.pod:6059
27424 " guestfs_resize2fs_size (guestfs_h *g,\n"
27425 " const char *device,\n"
27426 " int64_t size);\n"
27431 #: ../src/guestfs-actions.pod:6064
27433 "This command is the same as C<guestfs_resize2fs> except that it allows you "
27434 "to specify the new size (in bytes) explicitly."
27438 #: ../src/guestfs-actions.pod:6071
27443 #: ../src/guestfs-actions.pod:6073
27447 " guestfs_rm (guestfs_h *g,\n"
27448 " const char *path);\n"
27453 #: ../src/guestfs-actions.pod:6083
27454 msgid "guestfs_rm_rf"
27458 #: ../src/guestfs-actions.pod:6085
27462 " guestfs_rm_rf (guestfs_h *g,\n"
27463 " const char *path);\n"
27468 #: ../src/guestfs-actions.pod:6097
27469 msgid "guestfs_rmdir"
27473 #: ../src/guestfs-actions.pod:6099
27477 " guestfs_rmdir (guestfs_h *g,\n"
27478 " const char *path);\n"
27483 #: ../src/guestfs-actions.pod:6109
27484 msgid "guestfs_rmmountpoint"
27488 #: ../src/guestfs-actions.pod:6111
27492 " guestfs_rmmountpoint (guestfs_h *g,\n"
27493 " const char *exemptpath);\n"
27498 #: ../src/guestfs-actions.pod:6115
27500 "This calls removes a mountpoint that was previously created with "
27501 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
27505 #: ../src/guestfs-actions.pod:6123
27506 msgid "guestfs_scrub_device"
27510 #: ../src/guestfs-actions.pod:6125
27514 " guestfs_scrub_device (guestfs_h *g,\n"
27515 " const char *device);\n"
27520 #: ../src/guestfs-actions.pod:6140 ../src/guestfs-actions.pod:6158 ../src/guestfs-actions.pod:6177
27521 msgid "(Added in 1.0.52)"
27525 #: ../src/guestfs-actions.pod:6142
27526 msgid "guestfs_scrub_file"
27530 #: ../src/guestfs-actions.pod:6144
27534 " guestfs_scrub_file (guestfs_h *g,\n"
27535 " const char *file);\n"
27540 #: ../src/guestfs-actions.pod:6160
27541 msgid "guestfs_scrub_freespace"
27545 #: ../src/guestfs-actions.pod:6162
27549 " guestfs_scrub_freespace (guestfs_h *g,\n"
27550 " const char *dir);\n"
27555 #: ../src/guestfs-actions.pod:6166
27557 "This command creates the directory C<dir> and then fills it with files until "
27558 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
27559 "and deletes them. The intention is to scrub any free space on the partition "
27560 "containing C<dir>."
27564 #: ../src/guestfs-actions.pod:6179
27565 msgid "guestfs_set_append"
27569 #: ../src/guestfs-actions.pod:6181
27573 " guestfs_set_append (guestfs_h *g,\n"
27574 " const char *append);\n"
27579 #: ../src/guestfs-actions.pod:6198
27580 msgid "guestfs_set_attach_method"
27584 #: ../src/guestfs-actions.pod:6200
27588 " guestfs_set_attach_method (guestfs_h *g,\n"
27589 " const char *attachmethod);\n"
27594 #: ../src/guestfs-actions.pod:6228
27595 msgid "guestfs_set_autosync"
27599 #: ../src/guestfs-actions.pod:6230
27603 " guestfs_set_autosync (guestfs_h *g,\n"
27604 " int autosync);\n"
27609 #: ../src/guestfs-actions.pod:6246
27610 msgid "guestfs_set_direct"
27614 #: ../src/guestfs-actions.pod:6248
27618 " guestfs_set_direct (guestfs_h *g,\n"
27624 #: ../src/guestfs-actions.pod:6256
27626 "One consequence of this is that log messages aren't caught by the library "
27627 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
27632 #: ../src/guestfs-actions.pod:6269
27633 msgid "guestfs_set_e2label"
27637 #: ../src/guestfs-actions.pod:6271
27641 " guestfs_set_e2label (guestfs_h *g,\n"
27642 " const char *device,\n"
27643 " const char *label);\n"
27648 #: ../src/guestfs-actions.pod:6280
27650 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
27651 "the existing label on a filesystem."
27655 #: ../src/guestfs-actions.pod:6287
27656 msgid "guestfs_set_e2uuid"
27660 #: ../src/guestfs-actions.pod:6289
27664 " guestfs_set_e2uuid (guestfs_h *g,\n"
27665 " const char *device,\n"
27666 " const char *uuid);\n"
27671 #: ../src/guestfs-actions.pod:6299
27673 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
27674 "the existing UUID of a filesystem."
27678 #: ../src/guestfs-actions.pod:6306
27679 msgid "guestfs_set_memsize"
27683 #: ../src/guestfs-actions.pod:6308
27687 " guestfs_set_memsize (guestfs_h *g,\n"
27693 #: ../src/guestfs-actions.pod:6312
27695 "This sets the memory size in megabytes allocated to the qemu subprocess. "
27696 "This only has any effect if called before C<guestfs_launch>."
27700 #: ../src/guestfs-actions.pod:6327
27701 msgid "guestfs_set_network"
27705 #: ../src/guestfs-actions.pod:6329
27709 " guestfs_set_network (guestfs_h *g,\n"
27715 #: ../src/guestfs-actions.pod:6339
27717 "You must call this before calling C<guestfs_launch>, otherwise it has no "
27722 #: ../src/guestfs-actions.pod:6346
27723 msgid "guestfs_set_path"
27727 #: ../src/guestfs-actions.pod:6348
27731 " guestfs_set_path (guestfs_h *g,\n"
27732 " const char *searchpath);\n"
27737 #: ../src/guestfs-actions.pod:6363
27738 msgid "guestfs_set_pgroup"
27742 #: ../src/guestfs-actions.pod:6365
27746 " guestfs_set_pgroup (guestfs_h *g,\n"
27752 #: ../src/guestfs-actions.pod:6382
27753 msgid "guestfs_set_qemu"
27757 #: ../src/guestfs-actions.pod:6384
27761 " guestfs_set_qemu (guestfs_h *g,\n"
27762 " const char *qemu);\n"
27767 #: ../src/guestfs-actions.pod:6410
27768 msgid "guestfs_set_recovery_proc"
27772 #: ../src/guestfs-actions.pod:6412
27776 " guestfs_set_recovery_proc (guestfs_h *g,\n"
27777 " int recoveryproc);\n"
27782 #: ../src/guestfs-actions.pod:6416
27784 "If this is called with the parameter C<false> then C<guestfs_launch> does "
27785 "not create a recovery process. The purpose of the recovery process is to "
27786 "stop runaway qemu processes in the case where the main program aborts "
27791 #: ../src/guestfs-actions.pod:6421
27793 "This only has any effect if called before C<guestfs_launch>, and the default "
27798 #: ../src/guestfs-actions.pod:6434
27799 msgid "guestfs_set_selinux"
27803 #: ../src/guestfs-actions.pod:6436
27807 " guestfs_set_selinux (guestfs_h *g,\n"
27813 #: ../src/guestfs-actions.pod:6453
27814 msgid "guestfs_set_trace"
27818 #: ../src/guestfs-actions.pod:6455
27822 " guestfs_set_trace (guestfs_h *g,\n"
27828 #: ../src/guestfs-actions.pod:6469
27830 "Trace messages are normally sent to C<stderr>, unless you register a "
27831 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
27835 #: ../src/guestfs-actions.pod:6477
27836 msgid "guestfs_set_verbose"
27840 #: ../src/guestfs-actions.pod:6479
27844 " guestfs_set_verbose (guestfs_h *g,\n"
27850 #: ../src/guestfs-actions.pod:6488
27852 "Verbose messages are normally sent to C<stderr>, unless you register a "
27853 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
27857 #: ../src/guestfs-actions.pod:6496
27858 msgid "guestfs_setcon"
27862 #: ../src/guestfs-actions.pod:6498
27866 " guestfs_setcon (guestfs_h *g,\n"
27867 " const char *context);\n"
27872 #: ../src/guestfs-actions.pod:6511
27873 msgid "guestfs_setxattr"
27877 #: ../src/guestfs-actions.pod:6513
27881 " guestfs_setxattr (guestfs_h *g,\n"
27882 " const char *xattr,\n"
27883 " const char *val,\n"
27885 " const char *path);\n"
27890 #: ../src/guestfs-actions.pod:6524
27891 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
27895 #: ../src/guestfs-actions.pod:6530
27896 msgid "guestfs_sfdisk"
27900 #: ../src/guestfs-actions.pod:6532
27904 " guestfs_sfdisk (guestfs_h *g,\n"
27905 " const char *device,\n"
27909 " char *const *lines);\n"
27914 #: ../src/guestfs-actions.pod:6560
27915 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
27919 #: ../src/guestfs-actions.pod:6568 ../src/guestfs-actions.pod:6598 ../src/guestfs-actions.pod:6631
27921 "This function is deprecated. In new code, use the L</guestfs_part_add> call "
27926 #: ../src/guestfs-actions.pod:6577
27927 msgid "guestfs_sfdiskM"
27931 #: ../src/guestfs-actions.pod:6579
27935 " guestfs_sfdiskM (guestfs_h *g,\n"
27936 " const char *device,\n"
27937 " char *const *lines);\n"
27942 #: ../src/guestfs-actions.pod:6584
27944 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
27945 "partition sizes are specified in megabytes only (rounded to the nearest "
27946 "cylinder) and you don't need to specify the cyls, heads and sectors "
27947 "parameters which were rarely if ever used anyway."
27951 #: ../src/guestfs-actions.pod:6590
27953 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
27954 "C<guestfs_part_disk>"
27958 #: ../src/guestfs-actions.pod:6607
27959 msgid "guestfs_sfdisk_N"
27963 #: ../src/guestfs-actions.pod:6609
27967 " guestfs_sfdisk_N (guestfs_h *g,\n"
27968 " const char *device,\n"
27973 " const char *line);\n"
27978 #: ../src/guestfs-actions.pod:6621
27980 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
27981 "for the cyls/heads/sectors parameters."
27985 #: ../src/guestfs-actions.pod:6624
27986 msgid "See also: C<guestfs_part_add>"
27990 #: ../src/guestfs-actions.pod:6640
27991 msgid "guestfs_sfdisk_disk_geometry"
27995 #: ../src/guestfs-actions.pod:6642
27999 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
28000 " const char *device);\n"
28005 #: ../src/guestfs-actions.pod:6646
28007 "This displays the disk geometry of C<device> read from the partition table. "
28008 "Especially in the case where the underlying block device has been resized, "
28009 "this can be different from the kernel's idea of the geometry (see "
28010 "C<guestfs_sfdisk_kernel_geometry>)."
28014 #: ../src/guestfs-actions.pod:6659
28015 msgid "guestfs_sfdisk_kernel_geometry"
28019 #: ../src/guestfs-actions.pod:6661
28023 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
28024 " const char *device);\n"
28029 #: ../src/guestfs-actions.pod:6675
28030 msgid "guestfs_sfdisk_l"
28034 #: ../src/guestfs-actions.pod:6677
28038 " guestfs_sfdisk_l (guestfs_h *g,\n"
28039 " const char *device);\n"
28044 #: ../src/guestfs-actions.pod:6685
28045 msgid "See also: C<guestfs_part_list>"
28049 #: ../src/guestfs-actions.pod:6690
28051 "This function is deprecated. In new code, use the L</guestfs_part_list> "
28056 #: ../src/guestfs-actions.pod:6699
28061 #: ../src/guestfs-actions.pod:6701
28065 " guestfs_sh (guestfs_h *g,\n"
28066 " const char *command);\n"
28071 #: ../src/guestfs-actions.pod:6708
28072 msgid "This is like C<guestfs_command>, but passes the command to:"
28076 #: ../src/guestfs-actions.pod:6716
28077 msgid "All the provisos about C<guestfs_command> apply to this call."
28081 #: ../src/guestfs-actions.pod:6723
28082 msgid "guestfs_sh_lines"
28086 #: ../src/guestfs-actions.pod:6725
28090 " guestfs_sh_lines (guestfs_h *g,\n"
28091 " const char *command);\n"
28096 #: ../src/guestfs-actions.pod:6729
28098 "This is the same as C<guestfs_sh>, but splits the result into a list of "
28103 #: ../src/guestfs-actions.pod:6732
28104 msgid "See also: C<guestfs_command_lines>"
28108 #: ../src/guestfs-actions.pod:6740
28109 msgid "guestfs_sleep"
28113 #: ../src/guestfs-actions.pod:6742
28117 " guestfs_sleep (guestfs_h *g,\n"
28123 #: ../src/guestfs-actions.pod:6750
28124 msgid "(Added in 1.0.41)"
28128 #: ../src/guestfs-actions.pod:6752 ../src/guestfs-structs.pod:109
28129 msgid "guestfs_stat"
28133 #: ../src/guestfs-actions.pod:6754
28136 " struct guestfs_stat *\n"
28137 " guestfs_stat (guestfs_h *g,\n"
28138 " const char *path);\n"
28143 #: ../src/guestfs-actions.pod:6768 ../src/guestfs-structs.pod:135
28144 msgid "guestfs_statvfs"
28148 #: ../src/guestfs-actions.pod:6770
28151 " struct guestfs_statvfs *\n"
28152 " guestfs_statvfs (guestfs_h *g,\n"
28153 " const char *path);\n"
28158 #: ../src/guestfs-actions.pod:6780
28160 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
28161 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
28165 #: ../src/guestfs-actions.pod:6786
28166 msgid "guestfs_strings"
28170 #: ../src/guestfs-actions.pod:6788
28174 " guestfs_strings (guestfs_h *g,\n"
28175 " const char *path);\n"
28180 #: ../src/guestfs-actions.pod:6804
28181 msgid "guestfs_strings_e"
28185 #: ../src/guestfs-actions.pod:6806
28189 " guestfs_strings_e (guestfs_h *g,\n"
28190 " const char *encoding,\n"
28191 " const char *path);\n"
28196 #: ../src/guestfs-actions.pod:6811
28198 "This is like the C<guestfs_strings> command, but allows you to specify the "
28199 "encoding of strings that are looked for in the source file C<path>."
28203 #: ../src/guestfs-actions.pod:6821
28205 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
28206 "ISO-8859-X (this is what C<guestfs_strings> uses)."
28210 #: ../src/guestfs-actions.pod:6859
28211 msgid "guestfs_swapoff_device"
28215 #: ../src/guestfs-actions.pod:6861
28219 " guestfs_swapoff_device (guestfs_h *g,\n"
28220 " const char *device);\n"
28225 #: ../src/guestfs-actions.pod:6865
28227 "This command disables the libguestfs appliance swap device or partition "
28228 "named C<device>. See C<guestfs_swapon_device>."
28232 #: ../src/guestfs-actions.pod:6873
28233 msgid "guestfs_swapoff_file"
28237 #: ../src/guestfs-actions.pod:6875
28241 " guestfs_swapoff_file (guestfs_h *g,\n"
28242 " const char *file);\n"
28247 #: ../src/guestfs-actions.pod:6885
28248 msgid "guestfs_swapoff_label"
28252 #: ../src/guestfs-actions.pod:6887
28256 " guestfs_swapoff_label (guestfs_h *g,\n"
28257 " const char *label);\n"
28262 #: ../src/guestfs-actions.pod:6898
28263 msgid "guestfs_swapoff_uuid"
28267 #: ../src/guestfs-actions.pod:6900
28271 " guestfs_swapoff_uuid (guestfs_h *g,\n"
28272 " const char *uuid);\n"
28277 #: ../src/guestfs-actions.pod:6911
28278 msgid "guestfs_swapon_device"
28282 #: ../src/guestfs-actions.pod:6913
28286 " guestfs_swapon_device (guestfs_h *g,\n"
28287 " const char *device);\n"
28292 #: ../src/guestfs-actions.pod:6917
28294 "This command enables the libguestfs appliance to use the swap device or "
28295 "partition named C<device>. The increased memory is made available for all "
28296 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
28300 #: ../src/guestfs-actions.pod:6933
28301 msgid "guestfs_swapon_file"
28305 #: ../src/guestfs-actions.pod:6935
28309 " guestfs_swapon_file (guestfs_h *g,\n"
28310 " const char *file);\n"
28315 #: ../src/guestfs-actions.pod:6939
28317 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
28322 #: ../src/guestfs-actions.pod:6946
28323 msgid "guestfs_swapon_label"
28327 #: ../src/guestfs-actions.pod:6948
28331 " guestfs_swapon_label (guestfs_h *g,\n"
28332 " const char *label);\n"
28337 #: ../src/guestfs-actions.pod:6952
28339 "This command enables swap to a labeled swap partition. See "
28340 "C<guestfs_swapon_device> for other notes."
28344 #: ../src/guestfs-actions.pod:6959
28345 msgid "guestfs_swapon_uuid"
28349 #: ../src/guestfs-actions.pod:6961
28353 " guestfs_swapon_uuid (guestfs_h *g,\n"
28354 " const char *uuid);\n"
28359 #: ../src/guestfs-actions.pod:6965
28361 "This command enables swap to a swap partition with the given UUID. See "
28362 "C<guestfs_swapon_device> for other notes."
28366 #: ../src/guestfs-actions.pod:6972
28367 msgid "guestfs_sync"
28371 #: ../src/guestfs-actions.pod:6974
28375 " guestfs_sync (guestfs_h *g);\n"
28380 #: ../src/guestfs-actions.pod:6987
28381 msgid "guestfs_tail"
28385 #: ../src/guestfs-actions.pod:6989
28389 " guestfs_tail (guestfs_h *g,\n"
28390 " const char *path);\n"
28395 #: ../src/guestfs-actions.pod:7005
28396 msgid "guestfs_tail_n"
28400 #: ../src/guestfs-actions.pod:7007
28404 " guestfs_tail_n (guestfs_h *g,\n"
28406 " const char *path);\n"
28411 #: ../src/guestfs-actions.pod:7029
28412 msgid "guestfs_tar_in"
28416 #: ../src/guestfs-actions.pod:7031
28420 " guestfs_tar_in (guestfs_h *g,\n"
28421 " const char *tarfile,\n"
28422 " const char *directory);\n"
28427 #: ../src/guestfs-actions.pod:7039
28428 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
28432 #: ../src/guestfs-actions.pod:7044 ../src/guestfs-actions.pod:7061 ../src/guestfs-actions.pod:7077 ../src/guestfs-actions.pod:7093
28433 msgid "(Added in 1.0.3)"
28437 #: ../src/guestfs-actions.pod:7046
28438 msgid "guestfs_tar_out"
28442 #: ../src/guestfs-actions.pod:7048
28446 " guestfs_tar_out (guestfs_h *g,\n"
28447 " const char *directory,\n"
28448 " const char *tarfile);\n"
28453 #: ../src/guestfs-actions.pod:7056
28455 "To download a compressed tarball, use C<guestfs_tgz_out> or "
28456 "C<guestfs_txz_out>."
28460 #: ../src/guestfs-actions.pod:7063
28461 msgid "guestfs_tgz_in"
28465 #: ../src/guestfs-actions.pod:7065
28469 " guestfs_tgz_in (guestfs_h *g,\n"
28470 " const char *tarball,\n"
28471 " const char *directory);\n"
28476 #: ../src/guestfs-actions.pod:7073
28477 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
28481 #: ../src/guestfs-actions.pod:7079
28482 msgid "guestfs_tgz_out"
28486 #: ../src/guestfs-actions.pod:7081
28490 " guestfs_tgz_out (guestfs_h *g,\n"
28491 " const char *directory,\n"
28492 " const char *tarball);\n"
28497 #: ../src/guestfs-actions.pod:7089
28498 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
28502 #: ../src/guestfs-actions.pod:7095
28503 msgid "guestfs_touch"
28507 #: ../src/guestfs-actions.pod:7097
28511 " guestfs_touch (guestfs_h *g,\n"
28512 " const char *path);\n"
28517 #: ../src/guestfs-actions.pod:7112
28518 msgid "guestfs_truncate"
28522 #: ../src/guestfs-actions.pod:7114
28526 " guestfs_truncate (guestfs_h *g,\n"
28527 " const char *path);\n"
28532 #: ../src/guestfs-actions.pod:7125
28533 msgid "guestfs_truncate_size"
28537 #: ../src/guestfs-actions.pod:7127
28541 " guestfs_truncate_size (guestfs_h *g,\n"
28542 " const char *path,\n"
28543 " int64_t size);\n"
28548 #: ../src/guestfs-actions.pod:7135
28550 "If the current file size is less than C<size> then the file is extended to "
28551 "the required size with zero bytes. This creates a sparse file (ie. disk "
28552 "blocks are not allocated for the file until you write to it). To create a "
28553 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
28557 #: ../src/guestfs-actions.pod:7145
28558 msgid "guestfs_tune2fs_l"
28562 #: ../src/guestfs-actions.pod:7147
28566 " guestfs_tune2fs_l (guestfs_h *g,\n"
28567 " const char *device);\n"
28572 #: ../src/guestfs-actions.pod:7167
28573 msgid "guestfs_txz_in"
28577 #: ../src/guestfs-actions.pod:7169
28581 " guestfs_txz_in (guestfs_h *g,\n"
28582 " const char *tarball,\n"
28583 " const char *directory);\n"
28588 #: ../src/guestfs-actions.pod:7181
28589 msgid "guestfs_txz_out"
28593 #: ../src/guestfs-actions.pod:7183
28597 " guestfs_txz_out (guestfs_h *g,\n"
28598 " const char *directory,\n"
28599 " const char *tarball);\n"
28604 #: ../src/guestfs-actions.pod:7195
28605 msgid "guestfs_umask"
28609 #: ../src/guestfs-actions.pod:7197
28613 " guestfs_umask (guestfs_h *g,\n"
28619 #: ../src/guestfs-actions.pod:7213
28621 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
28622 "C<guestfs_mkdir>."
28626 #: ../src/guestfs-actions.pod:7222
28627 msgid "guestfs_umount"
28631 #: ../src/guestfs-actions.pod:7224
28635 " guestfs_umount (guestfs_h *g,\n"
28636 " const char *pathordevice);\n"
28641 #: ../src/guestfs-actions.pod:7236
28642 msgid "guestfs_umount_all"
28646 #: ../src/guestfs-actions.pod:7238
28650 " guestfs_umount_all (guestfs_h *g);\n"
28655 #: ../src/guestfs-actions.pod:7249
28656 msgid "guestfs_upload"
28660 #: ../src/guestfs-actions.pod:7251
28664 " guestfs_upload (guestfs_h *g,\n"
28665 " const char *filename,\n"
28666 " const char *remotefilename);\n"
28671 #: ../src/guestfs-actions.pod:7261
28672 msgid "See also C<guestfs_download>."
28676 #: ../src/guestfs-actions.pod:7272
28677 msgid "guestfs_upload_offset"
28681 #: ../src/guestfs-actions.pod:7274
28685 " guestfs_upload_offset (guestfs_h *g,\n"
28686 " const char *filename,\n"
28687 " const char *remotefilename,\n"
28688 " int64_t offset);\n"
28693 #: ../src/guestfs-actions.pod:7290
28695 "Note that there is no limit on the amount of data that can be uploaded with "
28696 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
28697 "full amount unless an error occurs."
28701 #: ../src/guestfs-actions.pod:7295
28702 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
28706 #: ../src/guestfs-actions.pod:7306
28707 msgid "guestfs_utimens"
28711 #: ../src/guestfs-actions.pod:7308
28715 " guestfs_utimens (guestfs_h *g,\n"
28716 " const char *path,\n"
28717 " int64_t atsecs,\n"
28718 " int64_t atnsecs,\n"
28719 " int64_t mtsecs,\n"
28720 " int64_t mtnsecs);\n"
28725 #: ../src/guestfs-actions.pod:7337 ../src/guestfs-structs.pod:175
28726 msgid "guestfs_version"
28730 #: ../src/guestfs-actions.pod:7339
28733 " struct guestfs_version *\n"
28734 " guestfs_version (guestfs_h *g);\n"
28739 #: ../src/guestfs-actions.pod:7367
28741 "I<Note:> Don't use this call to test for availability of features. In "
28742 "enterprise distributions we backport features from later versions into "
28743 "earlier versions, making this an unreliable way to test for features. Use "
28744 "C<guestfs_available> instead."
28748 #: ../src/guestfs-actions.pod:7373
28750 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
28751 "error. I<The caller must call C<guestfs_free_version> after use>."
28755 #: ../src/guestfs-actions.pod:7377
28756 msgid "(Added in 1.0.58)"
28760 #: ../src/guestfs-actions.pod:7379
28761 msgid "guestfs_vfs_label"
28765 #: ../src/guestfs-actions.pod:7381
28769 " guestfs_vfs_label (guestfs_h *g,\n"
28770 " const char *device);\n"
28775 #: ../src/guestfs-actions.pod:7390
28776 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
28780 #: ../src/guestfs-actions.pod:7395 ../src/guestfs-actions.pod:7432
28781 msgid "(Added in 1.3.18)"
28785 #: ../src/guestfs-actions.pod:7397
28786 msgid "guestfs_vfs_type"
28790 #: ../src/guestfs-actions.pod:7399
28794 " guestfs_vfs_type (guestfs_h *g,\n"
28795 " const char *device);\n"
28800 #: ../src/guestfs-actions.pod:7416
28801 msgid "guestfs_vfs_uuid"
28805 #: ../src/guestfs-actions.pod:7418
28809 " guestfs_vfs_uuid (guestfs_h *g,\n"
28810 " const char *device);\n"
28815 #: ../src/guestfs-actions.pod:7427
28816 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
28820 #: ../src/guestfs-actions.pod:7434
28821 msgid "guestfs_vg_activate"
28825 #: ../src/guestfs-actions.pod:7436
28829 " guestfs_vg_activate (guestfs_h *g,\n"
28831 " char *const *volgroups);\n"
28836 #: ../src/guestfs-actions.pod:7453
28837 msgid "guestfs_vg_activate_all"
28841 #: ../src/guestfs-actions.pod:7455
28845 " guestfs_vg_activate_all (guestfs_h *g,\n"
28846 " int activate);\n"
28851 #: ../src/guestfs-actions.pod:7468
28852 msgid "guestfs_vgcreate"
28856 #: ../src/guestfs-actions.pod:7470
28860 " guestfs_vgcreate (guestfs_h *g,\n"
28861 " const char *volgroup,\n"
28862 " char *const *physvols);\n"
28867 #: ../src/guestfs-actions.pod:7482
28868 msgid "guestfs_vglvuuids"
28872 #: ../src/guestfs-actions.pod:7484
28876 " guestfs_vglvuuids (guestfs_h *g,\n"
28877 " const char *vgname);\n"
28882 #: ../src/guestfs-actions.pod:7491
28884 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
28885 "associate logical volumes and volume groups."
28889 #: ../src/guestfs-actions.pod:7494
28890 msgid "See also C<guestfs_vgpvuuids>."
28894 #: ../src/guestfs-actions.pod:7502
28895 msgid "guestfs_vgpvuuids"
28899 #: ../src/guestfs-actions.pod:7504
28903 " guestfs_vgpvuuids (guestfs_h *g,\n"
28904 " const char *vgname);\n"
28909 #: ../src/guestfs-actions.pod:7511
28911 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
28912 "associate physical volumes and volume groups."
28916 #: ../src/guestfs-actions.pod:7514
28917 msgid "See also C<guestfs_vglvuuids>."
28921 #: ../src/guestfs-actions.pod:7522
28922 msgid "guestfs_vgremove"
28926 #: ../src/guestfs-actions.pod:7524
28930 " guestfs_vgremove (guestfs_h *g,\n"
28931 " const char *vgname);\n"
28936 #: ../src/guestfs-actions.pod:7537
28937 msgid "guestfs_vgrename"
28941 #: ../src/guestfs-actions.pod:7539
28945 " guestfs_vgrename (guestfs_h *g,\n"
28946 " const char *volgroup,\n"
28947 " const char *newvolgroup);\n"
28952 #: ../src/guestfs-actions.pod:7550
28953 msgid "guestfs_vgs"
28957 #: ../src/guestfs-actions.pod:7552
28961 " guestfs_vgs (guestfs_h *g);\n"
28966 #: ../src/guestfs-actions.pod:7561
28967 msgid "See also C<guestfs_vgs_full>."
28971 #: ../src/guestfs-actions.pod:7569
28972 msgid "guestfs_vgs_full"
28976 #: ../src/guestfs-actions.pod:7571
28979 " struct guestfs_lvm_vg_list *\n"
28980 " guestfs_vgs_full (guestfs_h *g);\n"
28985 #: ../src/guestfs-actions.pod:7577
28987 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
28988 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
28993 #: ../src/guestfs-actions.pod:7583
28994 msgid "guestfs_vgscan"
28998 #: ../src/guestfs-actions.pod:7585
29002 " guestfs_vgscan (guestfs_h *g);\n"
29007 #: ../src/guestfs-actions.pod:7595
29008 msgid "guestfs_vguuid"
29012 #: ../src/guestfs-actions.pod:7597
29016 " guestfs_vguuid (guestfs_h *g,\n"
29017 " const char *vgname);\n"
29022 #: ../src/guestfs-actions.pod:7608
29023 msgid "guestfs_wait_ready"
29027 #: ../src/guestfs-actions.pod:7610
29031 " guestfs_wait_ready (guestfs_h *g);\n"
29036 #: ../src/guestfs-actions.pod:7613
29037 msgid "This function is a no op."
29041 #: ../src/guestfs-actions.pod:7615
29043 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
29044 "calling C<guestfs_launch> to wait for the launch to complete. However this "
29045 "is no longer necessary because C<guestfs_launch> now does the waiting."
29049 #: ../src/guestfs-actions.pod:7620
29051 "If you see any calls to this function in code then you can just remove them, "
29052 "unless you want to retain compatibility with older versions of the API."
29056 #: ../src/guestfs-actions.pod:7626
29058 "This function is deprecated. In new code, use the L</guestfs_launch> call "
29063 #: ../src/guestfs-actions.pod:7635
29064 msgid "guestfs_wc_c"
29068 #: ../src/guestfs-actions.pod:7637
29072 " guestfs_wc_c (guestfs_h *g,\n"
29073 " const char *path);\n"
29078 #: ../src/guestfs-actions.pod:7648
29079 msgid "guestfs_wc_l"
29083 #: ../src/guestfs-actions.pod:7650
29087 " guestfs_wc_l (guestfs_h *g,\n"
29088 " const char *path);\n"
29093 #: ../src/guestfs-actions.pod:7661
29094 msgid "guestfs_wc_w"
29098 #: ../src/guestfs-actions.pod:7663
29102 " guestfs_wc_w (guestfs_h *g,\n"
29103 " const char *path);\n"
29108 #: ../src/guestfs-actions.pod:7674
29109 msgid "guestfs_write"
29113 #: ../src/guestfs-actions.pod:7676
29117 " guestfs_write (guestfs_h *g,\n"
29118 " const char *path,\n"
29119 " const char *content,\n"
29120 " size_t content_size);\n"
29125 #: ../src/guestfs-actions.pod:7685
29126 msgid "See also C<guestfs_write_append>."
29130 #: ../src/guestfs-actions.pod:7694
29131 msgid "guestfs_write_append"
29135 #: ../src/guestfs-actions.pod:7696
29139 " guestfs_write_append (guestfs_h *g,\n"
29140 " const char *path,\n"
29141 " const char *content,\n"
29142 " size_t content_size);\n"
29147 #: ../src/guestfs-actions.pod:7705
29148 msgid "See also C<guestfs_write>."
29152 #: ../src/guestfs-actions.pod:7714
29153 msgid "guestfs_write_file"
29157 #: ../src/guestfs-actions.pod:7716
29161 " guestfs_write_file (guestfs_h *g,\n"
29162 " const char *path,\n"
29163 " const char *content,\n"
29169 #: ../src/guestfs-actions.pod:7738
29171 "This function is deprecated. In new code, use the L</guestfs_write> call "
29176 #: ../src/guestfs-actions.pod:7747
29177 msgid "guestfs_zegrep"
29181 #: ../src/guestfs-actions.pod:7749
29185 " guestfs_zegrep (guestfs_h *g,\n"
29186 " const char *regex,\n"
29187 " const char *path);\n"
29192 #: ../src/guestfs-actions.pod:7766
29193 msgid "guestfs_zegrepi"
29197 #: ../src/guestfs-actions.pod:7768
29201 " guestfs_zegrepi (guestfs_h *g,\n"
29202 " const char *regex,\n"
29203 " const char *path);\n"
29208 #: ../src/guestfs-actions.pod:7785
29209 msgid "guestfs_zero"
29213 #: ../src/guestfs-actions.pod:7787
29217 " guestfs_zero (guestfs_h *g,\n"
29218 " const char *device);\n"
29223 #: ../src/guestfs-actions.pod:7801
29225 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
29226 "C<guestfs_is_zero_device>"
29230 #: ../src/guestfs-actions.pod:7813
29231 msgid "guestfs_zero_device"
29235 #: ../src/guestfs-actions.pod:7815
29239 " guestfs_zero_device (guestfs_h *g,\n"
29240 " const char *device);\n"
29245 #: ../src/guestfs-actions.pod:7819
29247 "This command writes zeroes over the entire C<device>. Compare with "
29248 "C<guestfs_zero> which just zeroes the first few blocks of a device."
29252 #: ../src/guestfs-actions.pod:7837
29253 msgid "(Added in 1.3.1)"
29257 #: ../src/guestfs-actions.pod:7839
29258 msgid "guestfs_zerofree"
29262 #: ../src/guestfs-actions.pod:7841
29266 " guestfs_zerofree (guestfs_h *g,\n"
29267 " const char *device);\n"
29272 #: ../src/guestfs-actions.pod:7860
29273 msgid "guestfs_zfgrep"
29277 #: ../src/guestfs-actions.pod:7862
29281 " guestfs_zfgrep (guestfs_h *g,\n"
29282 " const char *pattern,\n"
29283 " const char *path);\n"
29288 #: ../src/guestfs-actions.pod:7879
29289 msgid "guestfs_zfgrepi"
29293 #: ../src/guestfs-actions.pod:7881
29297 " guestfs_zfgrepi (guestfs_h *g,\n"
29298 " const char *pattern,\n"
29299 " const char *path);\n"
29304 #: ../src/guestfs-actions.pod:7898
29305 msgid "guestfs_zfile"
29309 #: ../src/guestfs-actions.pod:7900
29313 " guestfs_zfile (guestfs_h *g,\n"
29314 " const char *meth,\n"
29315 " const char *path);\n"
29320 #: ../src/guestfs-actions.pod:7910
29322 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
29327 #: ../src/guestfs-actions.pod:7916
29329 "This function is deprecated. In new code, use the L</guestfs_file> call "
29334 #: ../src/guestfs-actions.pod:7925
29335 msgid "guestfs_zgrep"
29339 #: ../src/guestfs-actions.pod:7927
29343 " guestfs_zgrep (guestfs_h *g,\n"
29344 " const char *regex,\n"
29345 " const char *path);\n"
29350 #: ../src/guestfs-actions.pod:7944
29351 msgid "guestfs_zgrepi"
29355 #: ../src/guestfs-actions.pod:7946
29359 " guestfs_zgrepi (guestfs_h *g,\n"
29360 " const char *regex,\n"
29361 " const char *path);\n"
29366 #: ../src/guestfs-availability.pod:3
29371 #: ../src/guestfs-availability.pod:5
29373 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
29374 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
29375 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
29376 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
29377 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
29381 #: ../src/guestfs-availability.pod:21
29386 #: ../src/guestfs-availability.pod:23
29387 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
29391 #: ../src/guestfs-availability.pod:26
29396 #: ../src/guestfs-availability.pod:28
29397 msgid "The following functions: L</guestfs_grub_install>"
29401 #: ../src/guestfs-availability.pod:31
29406 #: ../src/guestfs-availability.pod:33
29408 "The following functions: L</guestfs_inotify_add_watch> "
29409 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
29410 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
29414 #: ../src/guestfs-availability.pod:41
29415 msgid "B<linuxfsuuid>"
29419 #: ../src/guestfs-availability.pod:43
29421 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
29422 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
29426 #: ../src/guestfs-availability.pod:50
29427 msgid "B<linuxmodules>"
29431 #: ../src/guestfs-availability.pod:52
29432 msgid "The following functions: L</guestfs_modprobe>"
29436 #: ../src/guestfs-availability.pod:55
29437 msgid "B<linuxxattrs>"
29441 #: ../src/guestfs-availability.pod:57
29443 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
29444 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
29445 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
29446 "L</guestfs_setxattr>"
29450 #: ../src/guestfs-availability.pod:68
29455 #: ../src/guestfs-availability.pod:70
29457 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
29458 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
29459 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
29463 #: ../src/guestfs-availability.pod:79
29468 #: ../src/guestfs-availability.pod:81
29470 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
29471 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
29472 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
29473 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
29474 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
29475 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
29476 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
29477 "L</guestfs_vgs_full>"
29481 #: ../src/guestfs-availability.pod:104
29486 #: ../src/guestfs-availability.pod:106
29488 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
29489 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
29493 #: ../src/guestfs-availability.pod:112
29498 #: ../src/guestfs-availability.pod:114
29499 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
29503 #: ../src/guestfs-availability.pod:117
29504 msgid "B<ntfsprogs>"
29508 #: ../src/guestfs-availability.pod:119
29510 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
29511 "L</guestfs_ntfsresize_size>"
29515 #: ../src/guestfs-availability.pod:124
29516 msgid "B<realpath>"
29520 #: ../src/guestfs-availability.pod:126
29521 msgid "The following functions: L</guestfs_realpath>"
29525 #: ../src/guestfs-availability.pod:129
29530 #: ../src/guestfs-availability.pod:131
29532 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
29533 "L</guestfs_scrub_freespace>"
29537 #: ../src/guestfs-availability.pod:136
29542 #: ../src/guestfs-availability.pod:138
29543 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
29547 #: ../src/guestfs-availability.pod:142
29552 #: ../src/guestfs-availability.pod:144
29553 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
29557 #: ../src/guestfs-availability.pod:148
29558 msgid "B<zerofree>"
29562 #: ../src/guestfs-availability.pod:150
29563 msgid "The following functions: L</guestfs_zerofree>"
29567 #: ../src/guestfs-structs.pod:1
29568 msgid "guestfs_int_bool"
29572 #: ../src/guestfs-structs.pod:3
29575 " struct guestfs_int_bool {\n"
29583 #: ../src/guestfs-structs.pod:8
29586 " struct guestfs_int_bool_list {\n"
29587 " uint32_t len; /* Number of elements in list. */\n"
29588 " struct guestfs_int_bool *val; /* Elements. */\n"
29594 #: ../src/guestfs-structs.pod:13
29597 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
29598 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
29603 #: ../src/guestfs-structs.pod:16
29604 msgid "guestfs_lvm_pv"
29608 #: ../src/guestfs-structs.pod:18
29611 " struct guestfs_lvm_pv {\n"
29612 " char *pv_name;\n"
29613 " /* The next field is NOT nul-terminated, be careful when printing it: "
29615 " char pv_uuid[32];\n"
29617 " uint64_t pv_size;\n"
29618 " uint64_t dev_size;\n"
29619 " uint64_t pv_free;\n"
29620 " uint64_t pv_used;\n"
29621 " char *pv_attr;\n"
29622 " int64_t pv_pe_count;\n"
29623 " int64_t pv_pe_alloc_count;\n"
29624 " char *pv_tags;\n"
29625 " uint64_t pe_start;\n"
29626 " int64_t pv_mda_count;\n"
29627 " uint64_t pv_mda_free;\n"
29633 #: ../src/guestfs-structs.pod:36
29636 " struct guestfs_lvm_pv_list {\n"
29637 " uint32_t len; /* Number of elements in list. */\n"
29638 " struct guestfs_lvm_pv *val; /* Elements. */\n"
29644 #: ../src/guestfs-structs.pod:41
29647 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
29648 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
29653 #: ../src/guestfs-structs.pod:44
29654 msgid "guestfs_lvm_vg"
29658 #: ../src/guestfs-structs.pod:46
29661 " struct guestfs_lvm_vg {\n"
29662 " char *vg_name;\n"
29663 " /* The next field is NOT nul-terminated, be careful when printing it: "
29665 " char vg_uuid[32];\n"
29667 " char *vg_attr;\n"
29668 " uint64_t vg_size;\n"
29669 " uint64_t vg_free;\n"
29670 " char *vg_sysid;\n"
29671 " uint64_t vg_extent_size;\n"
29672 " int64_t vg_extent_count;\n"
29673 " int64_t vg_free_count;\n"
29674 " int64_t max_lv;\n"
29675 " int64_t max_pv;\n"
29676 " int64_t pv_count;\n"
29677 " int64_t lv_count;\n"
29678 " int64_t snap_count;\n"
29679 " int64_t vg_seqno;\n"
29680 " char *vg_tags;\n"
29681 " int64_t vg_mda_count;\n"
29682 " uint64_t vg_mda_free;\n"
29688 #: ../src/guestfs-structs.pod:69
29691 " struct guestfs_lvm_vg_list {\n"
29692 " uint32_t len; /* Number of elements in list. */\n"
29693 " struct guestfs_lvm_vg *val; /* Elements. */\n"
29699 #: ../src/guestfs-structs.pod:74
29702 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
29703 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
29708 #: ../src/guestfs-structs.pod:77
29709 msgid "guestfs_lvm_lv"
29713 #: ../src/guestfs-structs.pod:79
29716 " struct guestfs_lvm_lv {\n"
29717 " char *lv_name;\n"
29718 " /* The next field is NOT nul-terminated, be careful when printing it: "
29720 " char lv_uuid[32];\n"
29721 " char *lv_attr;\n"
29722 " int64_t lv_major;\n"
29723 " int64_t lv_minor;\n"
29724 " int64_t lv_kernel_major;\n"
29725 " int64_t lv_kernel_minor;\n"
29726 " uint64_t lv_size;\n"
29727 " int64_t seg_count;\n"
29729 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
29730 " float snap_percent;\n"
29731 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
29732 " float copy_percent;\n"
29733 " char *move_pv;\n"
29734 " char *lv_tags;\n"
29735 " char *mirror_log;\n"
29736 " char *modules;\n"
29742 #: ../src/guestfs-structs.pod:101
29745 " struct guestfs_lvm_lv_list {\n"
29746 " uint32_t len; /* Number of elements in list. */\n"
29747 " struct guestfs_lvm_lv *val; /* Elements. */\n"
29753 #: ../src/guestfs-structs.pod:106
29756 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
29757 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
29762 #: ../src/guestfs-structs.pod:111
29765 " struct guestfs_stat {\n"
29769 " int64_t nlink;\n"
29774 " int64_t blksize;\n"
29775 " int64_t blocks;\n"
29776 " int64_t atime;\n"
29777 " int64_t mtime;\n"
29778 " int64_t ctime;\n"
29784 #: ../src/guestfs-structs.pod:127
29787 " struct guestfs_stat_list {\n"
29788 " uint32_t len; /* Number of elements in list. */\n"
29789 " struct guestfs_stat *val; /* Elements. */\n"
29795 #: ../src/guestfs-structs.pod:132
29798 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
29799 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
29804 #: ../src/guestfs-structs.pod:137
29807 " struct guestfs_statvfs {\n"
29808 " int64_t bsize;\n"
29809 " int64_t frsize;\n"
29810 " int64_t blocks;\n"
29811 " int64_t bfree;\n"
29812 " int64_t bavail;\n"
29813 " int64_t files;\n"
29814 " int64_t ffree;\n"
29815 " int64_t favail;\n"
29818 " int64_t namemax;\n"
29824 #: ../src/guestfs-structs.pod:151
29827 " struct guestfs_statvfs_list {\n"
29828 " uint32_t len; /* Number of elements in list. */\n"
29829 " struct guestfs_statvfs *val; /* Elements. */\n"
29835 #: ../src/guestfs-structs.pod:156
29838 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
29839 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
29844 #: ../src/guestfs-structs.pod:159
29845 msgid "guestfs_dirent"
29849 #: ../src/guestfs-structs.pod:161
29852 " struct guestfs_dirent {\n"
29861 #: ../src/guestfs-structs.pod:167
29864 " struct guestfs_dirent_list {\n"
29865 " uint32_t len; /* Number of elements in list. */\n"
29866 " struct guestfs_dirent *val; /* Elements. */\n"
29872 #: ../src/guestfs-structs.pod:172
29875 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
29876 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
29881 #: ../src/guestfs-structs.pod:177
29884 " struct guestfs_version {\n"
29885 " int64_t major;\n"
29886 " int64_t minor;\n"
29887 " int64_t release;\n"
29894 #: ../src/guestfs-structs.pod:184
29897 " struct guestfs_version_list {\n"
29898 " uint32_t len; /* Number of elements in list. */\n"
29899 " struct guestfs_version *val; /* Elements. */\n"
29905 #: ../src/guestfs-structs.pod:189
29908 " void guestfs_free_version (struct guestfs_free_version *);\n"
29909 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
29914 #: ../src/guestfs-structs.pod:192
29915 msgid "guestfs_xattr"
29919 #: ../src/guestfs-structs.pod:194
29922 " struct guestfs_xattr {\n"
29923 " char *attrname;\n"
29924 " /* The next two fields describe a byte array. */\n"
29925 " uint32_t attrval_len;\n"
29926 " char *attrval;\n"
29932 #: ../src/guestfs-structs.pod:201
29935 " struct guestfs_xattr_list {\n"
29936 " uint32_t len; /* Number of elements in list. */\n"
29937 " struct guestfs_xattr *val; /* Elements. */\n"
29943 #: ../src/guestfs-structs.pod:206
29946 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
29947 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
29952 #: ../src/guestfs-structs.pod:209
29953 msgid "guestfs_inotify_event"
29957 #: ../src/guestfs-structs.pod:211
29960 " struct guestfs_inotify_event {\n"
29961 " int64_t in_wd;\n"
29962 " uint32_t in_mask;\n"
29963 " uint32_t in_cookie;\n"
29964 " char *in_name;\n"
29970 #: ../src/guestfs-structs.pod:218
29973 " struct guestfs_inotify_event_list {\n"
29974 " uint32_t len; /* Number of elements in list. */\n"
29975 " struct guestfs_inotify_event *val; /* Elements. */\n"
29981 #: ../src/guestfs-structs.pod:223
29984 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
29985 " void guestfs_free_inotify_event_list (struct "
29986 "guestfs_free_inotify_event_list *);\n"
29991 #: ../src/guestfs-structs.pod:226
29992 msgid "guestfs_partition"
29996 #: ../src/guestfs-structs.pod:228
29999 " struct guestfs_partition {\n"
30000 " int32_t part_num;\n"
30001 " uint64_t part_start;\n"
30002 " uint64_t part_end;\n"
30003 " uint64_t part_size;\n"
30009 #: ../src/guestfs-structs.pod:235
30012 " struct guestfs_partition_list {\n"
30013 " uint32_t len; /* Number of elements in list. */\n"
30014 " struct guestfs_partition *val; /* Elements. */\n"
30020 #: ../src/guestfs-structs.pod:240
30023 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
30024 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
30029 #: ../src/guestfs-structs.pod:243
30030 msgid "guestfs_application"
30034 #: ../src/guestfs-structs.pod:245
30037 " struct guestfs_application {\n"
30038 " char *app_name;\n"
30039 " char *app_display_name;\n"
30040 " int32_t app_epoch;\n"
30041 " char *app_version;\n"
30042 " char *app_release;\n"
30043 " char *app_install_path;\n"
30044 " char *app_trans_path;\n"
30045 " char *app_publisher;\n"
30046 " char *app_url;\n"
30047 " char *app_source_package;\n"
30048 " char *app_summary;\n"
30049 " char *app_description;\n"
30055 #: ../src/guestfs-structs.pod:260
30058 " struct guestfs_application_list {\n"
30059 " uint32_t len; /* Number of elements in list. */\n"
30060 " struct guestfs_application *val; /* Elements. */\n"
30066 #: ../src/guestfs-structs.pod:265
30069 " void guestfs_free_application (struct guestfs_free_application *);\n"
30070 " void guestfs_free_application_list (struct guestfs_free_application_list "
30076 #: ../src/guestfs.pod:5
30077 msgid "guestfs - Library for accessing and modifying virtual machine images"
30081 #: ../src/guestfs.pod:11
30084 " guestfs_h *g = guestfs_create ();\n"
30085 " guestfs_add_drive (g, \"guest.img\");\n"
30086 " guestfs_launch (g);\n"
30087 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30088 " guestfs_touch (g, \"/hello\");\n"
30089 " guestfs_umount (g, \"/\");\n"
30090 " guestfs_close (g);\n"
30095 #: ../src/guestfs.pod:25
30097 "Libguestfs is a library for accessing and modifying guest disk images. "
30098 "Amongst the things this is good for: making batch configuration changes to "
30099 "guests, getting disk used/free statistics (see also: virt-df), migrating "
30100 "between virtualization systems (see also: virt-p2v), performing partial "
30101 "backups, performing partial guest clones, cloning guests and changing "
30102 "registry/UUID/hostname info, and much else besides."
30106 #: ../src/guestfs.pod:33
30108 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
30109 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
30110 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
30115 #: ../src/guestfs.pod:38
30117 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
30118 "what filesystem is in each LV, etc.). It can also run commands in the "
30119 "context of the guest. Also you can access filesystems over FUSE."
30123 #: ../src/guestfs.pod:43
30125 "Libguestfs is a library that can be linked with C and C++ management "
30126 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
30127 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
30132 #: ../src/guestfs.pod:48
30134 "You don't need to be root to use libguestfs, although obviously you do need "
30135 "enough permissions to access the disk images."
30139 #: ../src/guestfs.pod:51
30141 "Libguestfs is a large API because it can do many things. For a gentle "
30142 "introduction, please read the L</API OVERVIEW> section next."
30146 #: ../src/guestfs.pod:54
30148 "There are also some example programs in the L<guestfs-examples(3)> manual "
30153 #: ../src/guestfs.pod:57
30154 msgid "API OVERVIEW"
30158 #: ../src/guestfs.pod:59
30160 "This section provides a gentler overview of the libguestfs API. We also try "
30161 "to group API calls together, where that may not be obvious from reading "
30162 "about the individual calls in the main section of this manual."
30166 #: ../src/guestfs.pod:64
30171 #: ../src/guestfs.pod:66
30173 "Before you can use libguestfs calls, you have to create a handle. Then you "
30174 "must add at least one disk image to the handle, followed by launching the "
30175 "handle, then performing whatever operations you want, and finally closing "
30176 "the handle. By convention we use the single letter C<g> for the name of the "
30177 "handle variable, although of course you can use any name you want."
30181 #: ../src/guestfs.pod:73
30182 msgid "The general structure of all libguestfs-using programs looks like this:"
30186 #: ../src/guestfs.pod:76
30189 " guestfs_h *g = guestfs_create ();\n"
30194 #: ../src/guestfs.pod:78
30197 " /* Call guestfs_add_drive additional times if there are\n"
30198 " * multiple disk images.\n"
30200 " guestfs_add_drive (g, \"guest.img\");\n"
30205 #: ../src/guestfs.pod:83
30208 " /* Most manipulation calls won't work until you've launched\n"
30209 " * the handle 'g'. You have to do this _after_ adding drives\n"
30210 " * and _before_ other commands.\n"
30212 " guestfs_launch (g);\n"
30217 #: ../src/guestfs.pod:89
30220 " /* Now you can examine what partitions, LVs etc are available.\n"
30222 " char **partitions = guestfs_list_partitions (g);\n"
30223 " char **logvols = guestfs_lvs (g);\n"
30228 #: ../src/guestfs.pod:94
30231 " /* To access a filesystem in the image, you must mount it.\n"
30233 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30238 #: ../src/guestfs.pod:98
30241 " /* Now you can perform filesystem actions on the guest\n"
30244 " guestfs_touch (g, \"/hello\");\n"
30249 #: ../src/guestfs.pod:103
30252 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
30253 " * it is done automatically when you close the handle. See\n"
30254 " * discussion of autosync in this page.\n"
30256 " guestfs_sync (g);\n"
30261 #: ../src/guestfs.pod:109
30264 " /* Close the handle 'g'. */\n"
30265 " guestfs_close (g);\n"
30270 #: ../src/guestfs.pod:112
30272 "The code above doesn't include any error checking. In real code you should "
30273 "check return values carefully for errors. In general all functions that "
30274 "return integers return C<-1> on error, and all functions that return "
30275 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
30276 "how to handle errors, and consult the documentation for each function call "
30277 "below to see precisely how they return error indications. See "
30278 "L<guestfs-examples(3)> for fully worked examples."
30282 #: ../src/guestfs.pod:121
30283 msgid "DISK IMAGES"
30287 #: ../src/guestfs.pod:123
30289 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
30290 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
30291 "actual block device, or simply an empty file of zeroes that you have created "
30292 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
30297 #: ../src/guestfs.pod:129
30299 "The call you should use in modern code for adding drives is "
30300 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
30301 "specifying that the format is raw, do:"
30305 #: ../src/guestfs.pod:133
30308 " guestfs_add_drive_opts (g, filename,\n"
30309 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30315 #: ../src/guestfs.pod:137
30316 msgid "You can add a disk read-only using:"
30320 #: ../src/guestfs.pod:139
30323 " guestfs_add_drive_opts (g, filename,\n"
30324 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30325 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
30331 #: ../src/guestfs.pod:144
30333 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
30334 "libguestfs won't modify the file."
30338 #: ../src/guestfs.pod:147
30340 "Be extremely cautious if the disk image is in use, eg. if it is being used "
30341 "by a virtual machine. Adding it read-write will almost certainly cause disk "
30342 "corruption, but adding it read-only is safe."
30346 #: ../src/guestfs.pod:151
30348 "You must add at least one disk image, and you may add multiple disk images. "
30349 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
30350 "first one you added), C</dev/sdb> (for the second one you added), etc."
30354 #: ../src/guestfs.pod:156
30356 "Once L</guestfs_launch> has been called you cannot add any more images. You "
30357 "can call L</guestfs_list_devices> to get a list of the device names, in the "
30358 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
30362 #: ../src/guestfs.pod:161
30367 #: ../src/guestfs.pod:163
30369 "Before you can read or write files, create directories and so on in a disk "
30370 "image that contains filesystems, you have to mount those filesystems using "
30371 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
30372 "a disk image contains (for example) one partition with a filesystem on that "
30373 "partition, then you can mount it directly:"
30377 #: ../src/guestfs.pod:170
30380 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
30385 #: ../src/guestfs.pod:172
30387 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
30388 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
30389 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
30390 "that these are libguestfs virtual devices, and are nothing to do with host "
30395 #: ../src/guestfs.pod:178
30397 "If you are given a disk image and you don't know what it contains then you "
30398 "have to find out. Libguestfs can do that too: use "
30399 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
30400 "and LVs, and either try mounting each to see what is mountable, or else "
30401 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
30402 "filesystems, use L</guestfs_list_filesystems>."
30406 #: ../src/guestfs.pod:186
30408 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
30409 "L</INSPECTION> below). But you might find it easier to look at higher level "
30410 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
30414 #: ../src/guestfs.pod:191
30416 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
30417 "several other variations of the C<guestfs_mount_*> call."
30421 #: ../src/guestfs.pod:194
30422 msgid "FILESYSTEM ACCESS AND MODIFICATION"
30426 #: ../src/guestfs.pod:196
30428 "The majority of the libguestfs API consists of fairly low-level calls for "
30429 "accessing and modifying the files, directories, symlinks etc on mounted "
30430 "filesystems. There are over a hundred such calls which you can find listed "
30431 "in detail below in this man page, and we don't even pretend to cover them "
30432 "all in this overview."
30436 #: ../src/guestfs.pod:202
30438 "Specify filenames as full paths, starting with C<\"/\"> and including the "
30443 #: ../src/guestfs.pod:205
30445 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
30446 "the file called C<\"etc/passwd\"> then you could do:"
30450 #: ../src/guestfs.pod:208
30453 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
30458 #: ../src/guestfs.pod:210
30460 "This would return C<data> as a newly allocated buffer containing the full "
30461 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
30462 "or C<NULL> if there was an error."
30466 #: ../src/guestfs.pod:214
30468 "As another example, to create a top-level directory on that filesystem "
30469 "called C<\"var\"> you would do:"
30473 #: ../src/guestfs.pod:217
30476 " guestfs_mkdir (g, \"/var\");\n"
30481 #: ../src/guestfs.pod:219
30482 msgid "To create a symlink you could do:"
30486 #: ../src/guestfs.pod:221
30489 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
30490 " \"/etc/rc3.d/S30portmap\");\n"
30495 #: ../src/guestfs.pod:224
30497 "Libguestfs will reject attempts to use relative paths and there is no "
30498 "concept of a current working directory."
30502 #: ../src/guestfs.pod:227
30504 "Libguestfs can return errors in many situations: for example if the "
30505 "filesystem isn't writable, or if a file or directory that you requested "
30506 "doesn't exist. If you are using the C API (documented here) you have to "
30507 "check for those error conditions after each call. (Other language bindings "
30508 "turn these errors into exceptions)."
30512 #: ../src/guestfs.pod:233
30514 "File writes are affected by the per-handle umask, set by calling "
30515 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
30519 #: ../src/guestfs.pod:236
30520 msgid "PARTITIONING"
30524 #: ../src/guestfs.pod:238
30526 "Libguestfs contains API calls to read, create and modify partition tables on "
30531 #: ../src/guestfs.pod:241
30533 "In the common case where you want to create a single partition covering the "
30534 "whole disk, you should use the L</guestfs_part_disk> call:"
30538 #: ../src/guestfs.pod:245
30541 " const char *parttype = \"mbr\";\n"
30542 " if (disk_is_larger_than_2TB)\n"
30543 " parttype = \"gpt\";\n"
30544 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
30549 #: ../src/guestfs.pod:250
30551 "Obviously this effectively wipes anything that was on that disk image "
30556 #: ../src/guestfs.pod:253
30561 #: ../src/guestfs.pod:255
30563 "Libguestfs provides access to a large part of the LVM2 API, such as "
30564 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
30565 "unless you familiarize yourself with the concepts of physical volumes, "
30566 "volume groups and logical volumes."
30570 #: ../src/guestfs.pod:260
30572 "This author strongly recommends reading the LVM HOWTO, online at "
30573 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
30577 #: ../src/guestfs.pod:263
30578 msgid "DOWNLOADING"
30582 #: ../src/guestfs.pod:265
30584 "Use L</guestfs_cat> to download small, text only files. This call is "
30585 "limited to files which are less than 2 MB and which cannot contain any ASCII "
30586 "NUL (C<\\0>) characters. However the API is very simple to use."
30590 #: ../src/guestfs.pod:269
30592 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
30593 "bit data, since it returns a (pointer, size) pair. However it is still "
30594 "limited to \"small\" files, less than 2 MB."
30598 #: ../src/guestfs.pod:273
30600 "L</guestfs_download> can be used to download any file, with no limits on "
30601 "content or size (even files larger than 4 GB)."
30605 #: ../src/guestfs.pod:276
30606 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
30610 #: ../src/guestfs.pod:279
30615 #: ../src/guestfs.pod:281
30617 "It's often the case that you want to write a file or files to the disk "
30622 #: ../src/guestfs.pod:284
30624 "To write a small file with fixed content, use L</guestfs_write>. To create "
30625 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
30626 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
30627 "variety of other functions for creating test files, for example "
30628 "L</guestfs_fill> and L</guestfs_fill_pattern>."
30632 #: ../src/guestfs.pod:290
30634 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
30635 "file content or size (even files larger than 4 GB)."
30639 #: ../src/guestfs.pod:293
30640 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
30644 #: ../src/guestfs.pod:295
30646 "However the fastest way to upload I<large numbers of arbitrary files> is to "
30647 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
30648 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
30649 "the drive in a predictable way (eg. adding it last after all other drives) "
30650 "then you can get the device name from L</guestfs_list_devices> and mount it "
30651 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
30652 "sometimes non-portable between kernel versions, and they don't support "
30653 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
30654 "using a label or UUID, use an ISO image instead."
30658 #: ../src/guestfs.pod:306
30663 #: ../src/guestfs.pod:308
30665 "There are various different commands for copying between files and devices "
30666 "and in and out of the guest filesystem. These are summarised in the table "
30671 #: ../src/guestfs.pod:314
30672 msgid "B<file> to B<file>"
30676 #: ../src/guestfs.pod:316
30678 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
30679 "directories recursively."
30683 #: ../src/guestfs.pod:319
30684 msgid "B<file or device> to B<file or device>"
30688 #: ../src/guestfs.pod:321
30690 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
30691 "devices in the guest."
30695 #: ../src/guestfs.pod:324
30696 msgid "Example: duplicate the contents of an LV:"
30700 #: ../src/guestfs.pod:326
30703 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
30708 #: ../src/guestfs.pod:328
30710 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
30711 "(C</dev/VG/Original>). To copy less than the whole source device, use "
30712 "L</guestfs_copy_size>."
30716 #: ../src/guestfs.pod:332
30717 msgid "B<file on the host> to B<file or device>"
30721 #: ../src/guestfs.pod:334
30722 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
30726 #: ../src/guestfs.pod:336
30727 msgid "B<file or device> to B<file on the host>"
30731 #: ../src/guestfs.pod:338
30732 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
30736 #: ../src/guestfs.pod:342
30737 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
30741 #: ../src/guestfs.pod:344
30743 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
30744 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
30745 "appears you can only upload and download to files. However many Un*x-like "
30746 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
30747 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
30748 "stderr, and arbitrary file descriptor N."
30752 #: ../src/guestfs.pod:352
30753 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
30757 #: ../src/guestfs.pod:355
30760 " guestfs_download (g, filename, \"/dev/stdout\");\n"
30765 #: ../src/guestfs.pod:357
30766 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
30770 #: ../src/guestfs.pod:359
30773 " char devfd[64];\n"
30774 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
30775 " guestfs_tar_out (g, \"/\", devfd);\n"
30780 #: ../src/guestfs.pod:363
30781 msgid "LISTING FILES"
30785 #: ../src/guestfs.pod:365
30787 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
30788 "L<guestfish(1)>-equivalent command C<ll>)."
30792 #: ../src/guestfs.pod:368
30794 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
30795 "programs, as a flat list of strings."
30799 #: ../src/guestfs.pod:371
30801 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
30802 "directory, plus additional information about each one. It is more "
30803 "equivalent to using the L<readdir(3)> call on a local filesystem."
30807 #: ../src/guestfs.pod:375
30809 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
30814 #: ../src/guestfs.pod:378
30815 msgid "RUNNING COMMANDS"
30819 #: ../src/guestfs.pod:380
30821 "Although libguestfs is primarily an API for manipulating files inside guest "
30822 "images, we also provide some limited facilities for running commands inside "
30827 #: ../src/guestfs.pod:384
30828 msgid "There are many limitations to this:"
30832 #: ../src/guestfs.pod:390
30834 "The kernel version that the command runs under will be different from what "
30839 #: ../src/guestfs.pod:395
30841 "If the command needs to communicate with daemons, then most likely they "
30842 "won't be running."
30846 #: ../src/guestfs.pod:400
30847 msgid "The command will be running in limited memory."
30851 #: ../src/guestfs.pod:404
30853 "The network may not be available unless you enable it (see "
30854 "L</guestfs_set_network>)."
30858 #: ../src/guestfs.pod:409
30859 msgid "Only supports Linux guests (not Windows, BSD, etc)."
30863 #: ../src/guestfs.pod:413
30864 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
30868 #: ../src/guestfs.pod:418
30870 "For SELinux guests, you may need to enable SELinux and load policy first. "
30871 "See L</SELINUX> in this manpage."
30875 #: ../src/guestfs.pod:423
30877 "I<Security:> It is not safe to run commands from untrusted, possibly "
30878 "malicious guests. These commands may attempt to exploit your program by "
30879 "sending unexpected output. They could also try to exploit the Linux kernel "
30880 "or qemu provided by the libguestfs appliance. They could use the network "
30881 "provided by the libguestfs appliance to bypass ordinary network partitions "
30882 "and firewalls. They could use the elevated privileges or different SELinux "
30883 "context of your program to their advantage."
30887 #: ../src/guestfs.pod:432
30889 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
30890 "(a script which runs when the guest next boots normally), and to have this "
30891 "script run the commands you want in the normal context of the running guest, "
30892 "network security and so on. For information about other security issues, "
30893 "see L</SECURITY>."
30897 #: ../src/guestfs.pod:440
30899 "The two main API calls to run commands are L</guestfs_command> and "
30900 "L</guestfs_sh> (there are also variations)."
30904 #: ../src/guestfs.pod:443
30906 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
30907 "shell globs, redirections, etc will work."
30911 #: ../src/guestfs.pod:446
30912 msgid "CONFIGURATION FILES"
30916 #: ../src/guestfs.pod:448
30918 "To read and write configuration files in Linux guest filesystems, we "
30919 "strongly recommend using Augeas. For example, Augeas understands how to "
30920 "read and write, say, a Linux shadow password file or X.org configuration "
30921 "file, and so avoids you having to write that code."
30925 #: ../src/guestfs.pod:453
30927 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
30928 "document Augeas itself here because there is excellent documentation on the "
30929 "L<http://augeas.net/> website."
30933 #: ../src/guestfs.pod:457
30935 "If you don't want to use Augeas (you fool!) then try calling "
30936 "L</guestfs_read_lines> to get the file as a list of lines which you can "
30941 #: ../src/guestfs.pod:461
30946 #: ../src/guestfs.pod:463
30948 "We support SELinux guests. To ensure that labeling happens correctly in "
30949 "SELinux guests, you need to enable SELinux and load the guest's policy:"
30953 #: ../src/guestfs.pod:471
30954 msgid "Before launching, do:"
30958 #: ../src/guestfs.pod:473
30961 " guestfs_set_selinux (g, 1);\n"
30966 #: ../src/guestfs.pod:477
30968 "After mounting the guest's filesystem(s), load the policy. This is best "
30969 "done by running the L<load_policy(8)> command in the guest itself:"
30973 #: ../src/guestfs.pod:481
30976 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
30981 #: ../src/guestfs.pod:483
30983 "(Older versions of C<load_policy> require you to specify the name of the "
30988 #: ../src/guestfs.pod:488
30990 "Optionally, set the security context for the API. The correct security "
30991 "context to use can only be known by inspecting the guest. As an example:"
30995 #: ../src/guestfs.pod:492
30998 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
31003 #: ../src/guestfs.pod:496
31004 msgid "This will work for running commands and editing existing files."
31008 #: ../src/guestfs.pod:498
31010 "When new files are created, you may need to label them explicitly, for "
31011 "example by running the external command C<restorecon pathname>."
31015 #: ../src/guestfs.pod:502
31020 #: ../src/guestfs.pod:504
31022 "Certain calls are affected by the current file mode creation mask (the "
31023 "\"umask\"). In particular ones which create files or directories, such as "
31024 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
31025 "either the default mode that the file is created with or modifies the mode "
31030 #: ../src/guestfs.pod:510
31032 "The default umask is C<022>, so files are created with modes such as C<0644> "
31033 "and directories with C<0755>."
31037 #: ../src/guestfs.pod:513
31039 "There are two ways to avoid being affected by umask. Either set umask to 0 "
31040 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
31041 "L</guestfs_chmod> after creating each file or directory."
31045 #: ../src/guestfs.pod:517
31046 msgid "For more information about umask, see L<umask(2)>."
31050 #: ../src/guestfs.pod:521
31052 "Libguestfs allows you to access Linux guests which have been encrypted using "
31053 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
31054 "standard. This includes nearly all whole disk encryption systems used by "
31055 "modern Linux guests."
31059 #: ../src/guestfs.pod:527
31061 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
31062 "returns the string C<crypto_LUKS>)."
31066 #: ../src/guestfs.pod:530
31068 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
31069 "will require the passphrase!"
31073 #: ../src/guestfs.pod:533
31075 "Opening a LUKS device creates a new device mapper device called "
31076 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
31077 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
31078 "decrypted from and encrypted to the underlying block device respectively."
31082 #: ../src/guestfs.pod:539
31084 "LVM volume groups on the device can be made visible by calling "
31085 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
31086 "volume(s) can now be mounted in the usual way."
31090 #: ../src/guestfs.pod:543
31092 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
31093 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
31094 "[\"/dev/VG\"])>. Then close the mapper device by calling "
31095 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
31096 "underlying encrypted block device)."
31100 #: ../src/guestfs.pod:550
31105 #: ../src/guestfs.pod:552
31107 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
31108 "contains operating systems, an install CD or a live CD. (These APIs used to "
31109 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
31110 "version 1.5.3 the most frequently used part of this library has been "
31111 "rewritten in C and moved into the core code)."
31115 #: ../src/guestfs.pod:559
31117 "Add all disks belonging to the unknown virtual machine and call "
31118 "L</guestfs_launch> in the usual way."
31122 #: ../src/guestfs.pod:562
31124 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
31125 "and certain heuristics, and returns a list of operating systems that were "
31126 "found. An empty list means none were found. A single element is the root "
31127 "filesystem of the operating system. For dual- or multi-boot guests, "
31128 "multiple roots can be returned, each one corresponding to a separate "
31129 "operating system. (Multi-boot virtual machines are extremely rare in the "
31130 "world of virtualization, but since this scenario can happen, we have built "
31131 "libguestfs to deal with it.)"
31135 #: ../src/guestfs.pod:571
31137 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
31138 "to get additional details about that operating system. For example, call "
31139 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
31140 "Windows and Linux-based operating systems respectively."
31144 #: ../src/guestfs.pod:577
31146 "Un*x-like and Linux-based operating systems usually consist of several "
31147 "filesystems which are mounted at boot time (for example, a separate boot "
31148 "partition mounted on C</boot>). The inspection rules are able to detect how "
31149 "filesystems correspond to mount points. Call "
31150 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
31151 "hash table like this example:"
31155 #: ../src/guestfs.pod:584
31158 " /boot => /dev/sda1\n"
31159 " / => /dev/vg_guest/lv_root\n"
31160 " /usr => /dev/vg_guest/lv_usr\n"
31165 #: ../src/guestfs.pod:588
31167 "The caller can then make calls to L</guestfs_mount_options> to mount the "
31168 "filesystems as suggested."
31172 #: ../src/guestfs.pod:591
31174 "Be careful to mount filesystems in the right order (eg. C</> before "
31175 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
31180 #: ../src/guestfs.pod:595
31182 "Inspection currently only works for some common operating systems. "
31183 "Contributors are welcome to send patches for other operating systems that we "
31184 "currently cannot detect."
31188 #: ../src/guestfs.pod:599
31190 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
31191 "for more details. The L</guestfs_inspect_os> function just ignores any "
31192 "encrypted devices."
31196 #: ../src/guestfs.pod:603
31198 "A note on the implementation: The call L</guestfs_inspect_os> performs "
31199 "inspection and caches the results in the guest handle. Subsequent calls to "
31200 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
31201 "re-read the disks. If you change the content of the guest disks, you can "
31202 "redo inspection by calling L</guestfs_inspect_os> again. "
31203 "(L</guestfs_inspect_list_applications> works a little differently from the "
31204 "other calls and does read the disks. See documentation for that function "
31209 #: ../src/guestfs.pod:612
31210 msgid "INSPECTING INSTALL DISKS"
31214 #: ../src/guestfs.pod:614
31216 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
31221 #: ../src/guestfs.pod:617
31223 "Call L</guestfs_inspect_get_format> to return the format of the operating "
31224 "system, which currently can be C<installed> (a regular operating system) or "
31225 "C<installer> (some sort of install disk)."
31229 #: ../src/guestfs.pod:621
31231 "Further information is available about the operating system that can be "
31232 "installed using the regular inspection APIs like "
31233 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
31238 #: ../src/guestfs.pod:626
31240 "Some additional information specific to installer disks is also available "
31241 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
31242 "L</guestfs_inspect_is_multipart> calls."
31246 #: ../src/guestfs.pod:631
31247 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
31251 #: ../src/guestfs.pod:633
31253 "Libguestfs can mount NTFS partitions. It does this using the "
31254 "L<http://www.ntfs-3g.org/> driver."
31258 #: ../src/guestfs.pod:636
31259 msgid "DRIVE LETTERS AND PATHS"
31263 #: ../src/guestfs.pod:638
31265 "DOS and Windows still use drive letters, and the filesystems are always "
31266 "treated as case insensitive by Windows itself, and therefore you might find "
31267 "a Windows configuration file referring to a path like "
31268 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
31269 "that directory might be referred to as C</WINDOWS/System32>."
31273 #: ../src/guestfs.pod:644
31275 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
31276 "L</guestfs_inspect_get_drive_mappings>)"
31280 #: ../src/guestfs.pod:647
31282 "Dealing with separator characters (backslash vs forward slash) is outside "
31283 "the scope of libguestfs, but usually a simple character replacement will "
31288 #: ../src/guestfs.pod:651
31290 "To resolve the case insensitivity of paths, call "
31291 "L</guestfs_case_sensitive_path>."
31295 #: ../src/guestfs.pod:654
31296 msgid "ACCESSING THE WINDOWS REGISTRY"
31300 #: ../src/guestfs.pod:656
31302 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
31303 "files, through the library C<hivex> which is part of the libguestfs project "
31304 "although ships as a separate tarball. You have to locate and download the "
31305 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
31306 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
31307 "L<virt-win-reg(1)> for more help on this issue."
31311 #: ../src/guestfs.pod:664
31312 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
31316 #: ../src/guestfs.pod:666
31318 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
31319 "provide something which looks like a Linux symlink. The way it tries to do "
31320 "the rewriting is described here:"
31324 #: ../src/guestfs.pod:670
31325 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
31329 #: ../src/guestfs.pod:672
31331 "The essential problem is that ntfs-3g simply does not have enough "
31332 "information to do a correct job. NTFS links can contain drive letters and "
31333 "references to external device GUIDs that ntfs-3g has no way of resolving. "
31334 "It is almost certainly the case that libguestfs callers should ignore what "
31335 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
31339 #: ../src/guestfs.pod:679
31341 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
31342 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
31343 "attribute, and read the raw reparse data from that (you can find the format "
31344 "documented in various places around the web)."
31348 #: ../src/guestfs.pod:684
31349 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
31353 #: ../src/guestfs.pod:686
31355 "There are other useful extended attributes that can be read from ntfs-3g "
31356 "filesystems (using L</guestfs_getxattr>). See:"
31360 #: ../src/guestfs.pod:689
31361 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
31365 #: ../src/guestfs.pod:691
31366 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
31370 #: ../src/guestfs.pod:693
31372 "Although we don't want to discourage you from using the C API, we will "
31373 "mention here that the same API is also available in other languages."
31377 #: ../src/guestfs.pod:696
31379 "The API is broadly identical in all supported languages. This means that "
31380 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
31381 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
31382 "OCaml. In other words, a straightforward, predictable isomorphism between "
31387 #: ../src/guestfs.pod:702
31389 "Error messages are automatically transformed into exceptions if the language "
31394 #: ../src/guestfs.pod:705
31396 "We don't try to \"object orientify\" parts of the API in OO languages, "
31397 "although contributors are welcome to write higher level APIs above what we "
31398 "provide in their favourite languages if they wish."
31402 #: ../src/guestfs.pod:711
31407 #: ../src/guestfs.pod:713
31409 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
31410 "identical to the C API. C++ classes and exceptions are not used."
31414 #: ../src/guestfs.pod:717
31419 #: ../src/guestfs.pod:719
31421 "The C# bindings are highly experimental. Please read the warnings at the "
31422 "top of C<csharp/Libguestfs.cs>."
31426 #: ../src/guestfs.pod:722
31431 #: ../src/guestfs.pod:724
31433 "This is the only language binding that is working but incomplete. Only "
31434 "calls which return simple integers have been bound in Haskell, and we are "
31435 "looking for help to complete this binding."
31439 #: ../src/guestfs.pod:728
31444 #: ../src/guestfs.pod:730
31446 "Full documentation is contained in the Javadoc which is distributed with "
31447 "libguestfs. For examples, see L<guestfs-java(3)>."
31451 #: ../src/guestfs.pod:733
31456 #: ../src/guestfs.pod:735
31457 msgid "See L<guestfs-ocaml(3)>."
31461 #: ../src/guestfs.pod:737
31466 #: ../src/guestfs.pod:739
31467 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
31471 #: ../src/guestfs.pod:741
31476 #: ../src/guestfs.pod:743
31478 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
31479 "the php-libguestfs package for your distribution."
31483 #: ../src/guestfs.pod:746
31484 msgid "The PHP binding only works correctly on 64 bit machines."
31488 #: ../src/guestfs.pod:748
31493 #: ../src/guestfs.pod:750
31494 msgid "See L<guestfs-python(3)>."
31498 #: ../src/guestfs.pod:752
31503 #: ../src/guestfs.pod:754
31504 msgid "See L<guestfs-ruby(3)>."
31508 #: ../src/guestfs.pod:756
31509 msgid "B<shell scripts>"
31513 #: ../src/guestfs.pod:758
31514 msgid "See L<guestfish(1)>."
31518 #: ../src/guestfs.pod:762
31519 msgid "LIBGUESTFS GOTCHAS"
31523 #: ../src/guestfs.pod:764
31525 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
31526 "system [...] that works in the way it is documented but is counterintuitive "
31527 "and almost invites mistakes.\""
31531 #: ../src/guestfs.pod:768
31533 "Since we developed libguestfs and the associated tools, there are several "
31534 "things we would have designed differently, but are now stuck with for "
31535 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
31536 "release, you can expect these to change. Beware of them."
31540 #: ../src/guestfs.pod:776
31541 msgid "Autosync / forgetting to sync."
31545 #: ../src/guestfs.pod:778
31547 "I<Update:> Autosync is enabled by default for all API users starting from "
31548 "libguestfs 1.5.24. This section only applies to older versions."
31552 #: ../src/guestfs.pod:781
31554 "When modifying a filesystem from C or another language, you B<must> unmount "
31555 "all filesystems and call L</guestfs_sync> explicitly before you close the "
31556 "libguestfs handle. You can also call:"
31560 #: ../src/guestfs.pod:785
31563 " guestfs_set_autosync (g, 1);\n"
31568 #: ../src/guestfs.pod:787
31570 "to have the unmount/sync done automatically for you when the handle 'g' is "
31571 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
31576 #: ../src/guestfs.pod:791
31578 "If you forget to do this, then it is entirely possible that your changes "
31579 "won't be written out, or will be partially written, or (very rarely) that "
31580 "you'll get disk corruption."
31584 #: ../src/guestfs.pod:795
31586 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
31587 "guestfish scripts that forget to sync will work just fine, which can make "
31588 "this very puzzling if you are trying to debug a problem."
31592 #: ../src/guestfs.pod:799
31593 msgid "Mount option C<-o sync> should not be the default."
31597 #: ../src/guestfs.pod:801
31599 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
31600 "However C<-o sync> does not add any reliability benefit, but does have a "
31601 "very large performance impact."
31605 #: ../src/guestfs.pod:805
31607 "The work around is to use L</guestfs_mount_options> and set the mount "
31608 "options that you actually want to use."
31612 #: ../src/guestfs.pod:808
31613 msgid "Read-only should be the default."
31617 #: ../src/guestfs.pod:810
31619 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
31620 "specify I<--rw> if you want to make changes to the image."
31624 #: ../src/guestfs.pod:813
31625 msgid "This would reduce the potential to corrupt live VM images."
31629 #: ../src/guestfs.pod:815
31631 "Note that many filesystems change the disk when you just mount and unmount, "
31632 "even if you didn't perform any writes. You need to use "
31633 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
31637 #: ../src/guestfs.pod:819
31638 msgid "guestfish command line is hard to use."
31642 #: ../src/guestfs.pod:821
31644 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
31645 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
31646 "exist, so it fails. In earlier versions of guestfish the error message was "
31647 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
31648 "we should have used C<guestfish -c command> to run commands."
31652 #: ../src/guestfs.pod:828
31653 msgid "guestfish megabyte modifiers don't work right on all commands"
31657 #: ../src/guestfs.pod:830
31659 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
31660 "other modifiers). What guestfish actually does is to multiply the number "
31661 "part by the modifier part and pass the result to the C API. However this "
31662 "doesn't work for a few APIs which aren't expecting bytes, but are already "
31663 "expecting some other unit (eg. megabytes)."
31667 #: ../src/guestfs.pod:837
31668 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
31672 #: ../src/guestfs.pod:839
31675 " lvcreate LV VG 100M\n"
31680 #: ../src/guestfs.pod:841
31682 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
31683 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
31684 "megabytes * megabytes) logical volume. The error message you get from this "
31685 "is also a little obscure."
31689 #: ../src/guestfs.pod:846
31691 "This could be fixed in the generator by specially marking parameters and "
31692 "return values which take bytes or other units."
31696 #: ../src/guestfs.pod:849
31697 msgid "Ambiguity between devices and paths"
31701 #: ../src/guestfs.pod:851
31703 "There is a subtle ambiguity in the API between a device name "
31704 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
31705 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
31709 #: ../src/guestfs.pod:856
31711 "In the current API we usually resolve this ambiguity by having two separate "
31712 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
31713 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
31714 "detecting if the path supplied begins with C</dev/>."
31718 #: ../src/guestfs.pod:862
31720 "To avoid both the ambiguity and the need to duplicate some calls, we could "
31721 "make paths/devices into structured names. One way to do this would be to "
31722 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
31723 "aspect of grub. Another way would be to use a structured type, equivalent "
31724 "to this OCaml type:"
31728 #: ../src/guestfs.pod:868
31731 " type path = Path of string | Device of int | Partition of int * int\n"
31736 #: ../src/guestfs.pod:870
31737 msgid "which would allow you to pass arguments like:"
31741 #: ../src/guestfs.pod:872
31744 " Path \"/foo/bar\"\n"
31745 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
31746 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
31747 " Path \"/dev/sdb2\" (* not a device *)\n"
31752 #: ../src/guestfs.pod:877
31754 "As you can see there are still problems to resolve even with this "
31755 "representation. Also consider how it might work in guestfish."
31759 #: ../src/guestfs.pod:882
31760 msgid "KEYS AND PASSPHRASES"
31764 #: ../src/guestfs.pod:884
31766 "Certain libguestfs calls take a parameter that contains sensitive key "
31767 "material, passed in as a C string."
31771 #: ../src/guestfs.pod:887
31773 "In the future we would hope to change the libguestfs implementation so that "
31774 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
31775 "swap. However this is I<not> done at the moment, because of the complexity "
31776 "of such an implementation."
31780 #: ../src/guestfs.pod:892
31782 "Therefore you should be aware that any key parameter you pass to libguestfs "
31783 "might end up being written out to the swap partition. If this is a concern, "
31784 "scrub the swap partition or don't use libguestfs on encrypted devices."
31788 #: ../src/guestfs.pod:897
31789 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
31793 #: ../src/guestfs.pod:899
31795 "All high-level libguestfs actions are synchronous. If you want to use "
31796 "libguestfs asynchronously then you must create a thread."
31800 #: ../src/guestfs.pod:902
31802 "Only use the handle from a single thread. Either use the handle exclusively "
31803 "from one thread, or provide your own mutex so that two threads cannot issue "
31804 "calls on the same handle at the same time."
31808 #: ../src/guestfs.pod:906
31810 "See the graphical program guestfs-browser for one possible architecture for "
31811 "multithreaded programs using libvirt and libguestfs."
31815 #: ../src/guestfs.pod:909
31820 #: ../src/guestfs.pod:911
31822 "Libguestfs needs a supermin appliance, which it finds by looking along an "
31827 #: ../src/guestfs.pod:914
31829 "By default it looks for these in the directory C<$libdir/guestfs> "
31830 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
31834 #: ../src/guestfs.pod:917
31836 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
31837 "to change the directories that libguestfs will search in. The value is a "
31838 "colon-separated list of paths. The current directory is I<not> searched "
31839 "unless the path contains an empty element or C<.>. For example "
31840 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
31841 "then C</usr/lib/guestfs>."
31845 #: ../src/guestfs.pod:924
31846 msgid "QEMU WRAPPERS"
31850 #: ../src/guestfs.pod:926
31852 "If you want to compile your own qemu, run qemu from a non-standard location, "
31853 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
31858 #: ../src/guestfs.pod:930
31860 "There is one important rule to remember: you I<must C<exec qemu>> as the "
31861 "last command in the shell script (so that qemu replaces the shell and "
31862 "becomes the direct child of the libguestfs-using program). If you don't do "
31863 "this, then the qemu process won't be cleaned up correctly."
31867 #: ../src/guestfs.pod:935
31869 "Here is an example of a wrapper, where I have built my own copy of qemu from "
31874 #: ../src/guestfs.pod:938
31878 " qemudir=/home/rjones/d/qemu\n"
31879 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
31885 #: ../src/guestfs.pod:942
31887 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
31888 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
31893 #: ../src/guestfs.pod:946
31896 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
31901 #: ../src/guestfs.pod:948
31903 "Note that libguestfs also calls qemu with the -help and -version options in "
31904 "order to determine features."
31908 #: ../src/guestfs.pod:951
31909 msgid "ATTACHING TO RUNNING DAEMONS"
31913 #: ../src/guestfs.pod:953
31915 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
31916 "babies. Use with caution."
31920 #: ../src/guestfs.pod:956
31922 "I<Note (2):> This section explains how to attach to a running daemon from a "
31923 "low level perspective. For most users, simply using virt tools such as "
31924 "L<guestfish(1)> with the I<--live> option will \"just work\"."
31928 #: ../src/guestfs.pod:960
31929 msgid "Using guestfs_set_attach_method"
31933 #: ../src/guestfs.pod:962
31935 "By calling L</guestfs_set_attach_method> you can change how the library "
31936 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
31937 "L</ARCHITECTURE> for some background)."
31941 #: ../src/guestfs.pod:966
31943 "The normal attach method is C<appliance>, where a small appliance is created "
31944 "containing the daemon, and then the library connects to this."
31948 #: ../src/guestfs.pod:969
31950 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
31951 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
31952 "daemon over the Unix domain socket."
31956 #: ../src/guestfs.pod:973
31958 "The normal use for this is to connect to a running virtual machine that "
31959 "contains a C<guestfsd> daemon, and send commands so you can read and write "
31960 "files inside the live virtual machine."
31964 #: ../src/guestfs.pod:977
31965 msgid "Using guestfs_add_domain with live flag"
31969 #: ../src/guestfs.pod:979
31971 "L</guestfs_add_domain> provides some help for getting the correct attach "
31972 "method. If you pass the C<live> option to this function, then (if the "
31973 "virtual machine is running) it will examine the libvirt XML looking for a "
31974 "virtio-serial channel to connect to:"
31978 #: ../src/guestfs.pod:985
31985 " <channel type='unix'>\n"
31986 " <source mode='bind' path='/path/to/socket'/>\n"
31987 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
31996 #: ../src/guestfs.pod:997
31998 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
31999 "method to C<unix:/path/to/socket>."
32003 #: ../src/guestfs.pod:1000
32005 "Some of the libguestfs tools (including guestfish) support a I<--live> "
32006 "option which is passed through to L</guestfs_add_domain> thus allowing you "
32007 "to attach to and modify live virtual machines."
32011 #: ../src/guestfs.pod:1004
32013 "The virtual machine needs to have been set up beforehand so that it has the "
32014 "virtio-serial channel and so that guestfsd is running inside it."
32018 #: ../src/guestfs.pod:1008
32019 msgid "ABI GUARANTEE"
32023 #: ../src/guestfs.pod:1010
32025 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
32026 "actions as outlined in this section. Although we will deprecate some "
32027 "actions, for example if they get replaced by newer calls, we will keep the "
32028 "old actions forever. This allows you the developer to program in confidence "
32029 "against the libguestfs API."
32033 #: ../src/guestfs.pod:1016
32034 msgid "BLOCK DEVICE NAMING"
32038 #: ../src/guestfs.pod:1018
32040 "In the kernel there is now quite a profusion of schemata for naming block "
32041 "devices (in this context, by I<block device> I mean a physical or virtual "
32042 "hard drive). The original Linux IDE driver used names starting with "
32043 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
32044 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
32045 "replacement for the old IDE driver (particularly for SATA devices) those "
32046 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
32047 "machines with paravirtualized drivers. This has created several different "
32048 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
32053 #: ../src/guestfs.pod:1030
32055 "As discussed above, libguestfs uses a qemu appliance running an embedded "
32056 "Linux kernel to access block devices. We can run a variety of appliances "
32057 "based on a variety of Linux kernels."
32061 #: ../src/guestfs.pod:1034
32063 "This causes a problem for libguestfs because many API calls use device or "
32064 "partition names. Working scripts and the recipe (example) scripts that we "
32065 "make available over the internet could fail if the naming scheme changes."
32069 #: ../src/guestfs.pod:1039
32071 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
32072 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
32073 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
32074 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
32078 #: ../src/guestfs.pod:1045
32080 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
32081 "L</guestfs_list_partitions> and similar calls return the true names of the "
32082 "devices and partitions as known to the appliance."
32086 #: ../src/guestfs.pod:1050
32087 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
32091 #: ../src/guestfs.pod:1052
32093 "Usually this translation is transparent. However in some (very rare) cases "
32094 "you may need to know the exact algorithm. Such cases include where you use "
32095 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
32096 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
32101 #: ../src/guestfs.pod:1058
32103 "The algorithm is applied only to I<parameters> which are known to be either "
32104 "device or partition names. Return values from functions such as "
32105 "L</guestfs_list_devices> are never changed."
32109 #: ../src/guestfs.pod:1066
32110 msgid "Is the string a parameter which is a device or partition name?"
32114 #: ../src/guestfs.pod:1070
32115 msgid "Does the string begin with C</dev/sd>?"
32119 #: ../src/guestfs.pod:1074
32121 "Does the named device exist? If so, we use that device. However if I<not> "
32122 "then we continue with this algorithm."
32126 #: ../src/guestfs.pod:1079
32127 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
32131 #: ../src/guestfs.pod:1081
32132 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
32136 #: ../src/guestfs.pod:1083
32137 msgid "If that named device exists, use it. If not, continue."
32141 #: ../src/guestfs.pod:1087
32142 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
32146 #: ../src/guestfs.pod:1089
32147 msgid "If that named device exists, use it. If not, return an error."
32151 #: ../src/guestfs.pod:1093
32152 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
32156 #: ../src/guestfs.pod:1095
32158 "Although the standard naming scheme and automatic translation is useful for "
32159 "simple programs and guestfish scripts, for larger programs it is best not to "
32160 "rely on this mechanism."
32164 #: ../src/guestfs.pod:1099
32166 "Where possible for maximum future portability programs using libguestfs "
32167 "should use these future-proof techniques:"
32171 #: ../src/guestfs.pod:1106
32173 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
32174 "device names, and then use those names directly."
32178 #: ../src/guestfs.pod:1109
32179 msgid "Since those device names exist by definition, they will never be translated."
32183 #: ../src/guestfs.pod:1114
32185 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
32186 "filesystem labels."
32190 #: ../src/guestfs.pod:1119
32195 #: ../src/guestfs.pod:1121
32197 "This section discusses security implications of using libguestfs, "
32198 "particularly with untrusted or malicious guests or disk images."
32202 #: ../src/guestfs.pod:1124
32203 msgid "GENERAL SECURITY CONSIDERATIONS"
32207 #: ../src/guestfs.pod:1126
32209 "Be careful with any files or data that you download from a guest (by "
32210 "\"download\" we mean not just the L</guestfs_download> command but any "
32211 "command that reads files, filenames, directories or anything else from a "
32212 "disk image). An attacker could manipulate the data to fool your program "
32213 "into doing the wrong thing. Consider cases such as:"
32217 #: ../src/guestfs.pod:1136
32218 msgid "the data (file etc) not being present"
32222 #: ../src/guestfs.pod:1140
32223 msgid "being present but empty"
32227 #: ../src/guestfs.pod:1144
32228 msgid "being much larger than normal"
32232 #: ../src/guestfs.pod:1148
32233 msgid "containing arbitrary 8 bit data"
32237 #: ../src/guestfs.pod:1152
32238 msgid "being in an unexpected character encoding"
32242 #: ../src/guestfs.pod:1156
32243 msgid "containing homoglyphs."
32247 #: ../src/guestfs.pod:1160
32248 msgid "SECURITY OF MOUNTING FILESYSTEMS"
32252 #: ../src/guestfs.pod:1162
32254 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
32255 "(VFS) module can sometimes be escalated into exploits by deliberately "
32256 "creating a malicious, malformed filesystem. These exploits are very severe "
32257 "for two reasons. Firstly there are very many filesystem drivers in the "
32258 "kernel, and many of them are infrequently used and not much developer "
32259 "attention has been paid to the code. Linux userspace helps potential "
32260 "crackers by detecting the filesystem type and automatically choosing the "
32261 "right VFS driver, even if that filesystem type is obscure or unexpected for "
32262 "the administrator. Secondly, a kernel-level exploit is like a local root "
32263 "exploit (worse in some ways), giving immediate and total access to the "
32264 "system right down to the hardware level."
32268 #: ../src/guestfs.pod:1175
32270 "That explains why you should never mount a filesystem from an untrusted "
32271 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
32272 "inside a qemu virtual machine, usually running as a non-root user. The "
32273 "attacker would need to write a filesystem which first exploited the kernel, "
32274 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
32275 "the libguestfs protocol, and finally to be as serious as the host kernel "
32276 "exploit it would need to escalate its privileges to root. This multi-step "
32277 "escalation, performed by a static piece of data, is thought to be extremely "
32278 "hard to do, although we never say 'never' about security issues."
32282 #: ../src/guestfs.pod:1186
32284 "In any case callers can reduce the attack surface by forcing the filesystem "
32285 "type when mounting (use L</guestfs_mount_vfs>)."
32289 #: ../src/guestfs.pod:1189
32290 msgid "PROTOCOL SECURITY"
32294 #: ../src/guestfs.pod:1191
32296 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
32297 "defined upper message size. However a program that uses libguestfs must "
32298 "also take care - for example you can write a program that downloads a binary "
32299 "from a disk image and executes it locally, and no amount of protocol "
32300 "security will save you from the consequences."
32304 #: ../src/guestfs.pod:1197
32305 msgid "INSPECTION SECURITY"
32309 #: ../src/guestfs.pod:1199
32311 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
32312 "directly from the guest, and these could contain any 8 bit data. Callers "
32313 "should be careful to escape these before printing them to a structured file "
32314 "(for example, use HTML escaping if creating a web page)."
32318 #: ../src/guestfs.pod:1205
32320 "Guest configuration may be altered in unusual ways by the administrator of "
32321 "the virtual machine, and may not reflect reality (particularly for untrusted "
32322 "or actively malicious guests). For example we parse the hostname from "
32323 "configuration files like C</etc/sysconfig/network> that we find in the "
32324 "guest, but the guest administrator can easily manipulate these files to "
32325 "provide the wrong hostname."
32329 #: ../src/guestfs.pod:1213
32331 "The inspection API parses guest configuration using two external libraries: "
32332 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
32333 "designed to be robust in the face of malicious data, although denial of "
32334 "service attacks are still possible, for example with oversized configuration "
32339 #: ../src/guestfs.pod:1219
32340 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
32344 #: ../src/guestfs.pod:1221
32346 "Be very cautious about running commands from the guest. By running a "
32347 "command in the guest, you are giving CPU time to a binary that you do not "
32348 "control, under the same user account as the library, albeit wrapped in qemu "
32349 "virtualization. More information and alternatives can be found in the "
32350 "section L</RUNNING COMMANDS>."
32354 #: ../src/guestfs.pod:1227
32355 msgid "CVE-2010-3851"
32359 #: ../src/guestfs.pod:1229
32360 msgid "https://bugzilla.redhat.com/642934"
32364 #: ../src/guestfs.pod:1231
32366 "This security bug concerns the automatic disk format detection that qemu "
32367 "does on disk images."
32371 #: ../src/guestfs.pod:1234
32373 "A raw disk image is just the raw bytes, there is no header. Other disk "
32374 "images like qcow2 contain a special header. Qemu deals with this by looking "
32375 "for one of the known headers, and if none is found then assuming the disk "
32376 "image must be raw."
32380 #: ../src/guestfs.pod:1239
32382 "This allows a guest which has been given a raw disk image to write some "
32383 "other header. At next boot (or when the disk image is accessed by "
32384 "libguestfs) qemu would do autodetection and think the disk image format was, "
32385 "say, qcow2 based on the header written by the guest."
32389 #: ../src/guestfs.pod:1244
32391 "This in itself would not be a problem, but qcow2 offers many features, one "
32392 "of which is to allow a disk image to refer to another image (called the "
32393 "\"backing disk\"). It does this by placing the path to the backing disk "
32394 "into the qcow2 header. This path is not validated and could point to any "
32395 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
32396 "\"holes\" in the qcow2 disk image, which of course is completely under the "
32397 "control of the attacker."
32401 #: ../src/guestfs.pod:1252
32402 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
32406 #: ../src/guestfs.pod:1259
32407 msgid "You have enabled the network or have opened the disk in write mode."
32411 #: ../src/guestfs.pod:1263
32413 "You are also running untrusted code from the guest (see L</RUNNING "
32418 #: ../src/guestfs.pod:1268
32420 "The way to avoid this is to specify the expected disk format when adding "
32421 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
32422 "should always do this if the disk is raw format, and it's a good idea for "
32427 #: ../src/guestfs.pod:1273
32429 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
32430 "format is fetched from libvirt and passed through."
32434 #: ../src/guestfs.pod:1276
32436 "For libguestfs tools, use the I<--format> command line parameter as "
32441 #: ../src/guestfs.pod:1279
32442 msgid "CONNECTION MANAGEMENT"
32446 #: ../src/guestfs.pod:1281
32447 msgid "guestfs_h *"
32451 #: ../src/guestfs.pod:1283
32453 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
32454 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
32455 "handle and release all resources used."
32459 #: ../src/guestfs.pod:1287
32461 "For information on using multiple handles and threads, see the section "
32462 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
32466 #: ../src/guestfs.pod:1290
32467 msgid "guestfs_create"
32471 #: ../src/guestfs.pod:1292
32474 " guestfs_h *guestfs_create (void);\n"
32479 #: ../src/guestfs.pod:1294
32480 msgid "Create a connection handle."
32484 #: ../src/guestfs.pod:1296
32486 "On success this returns a non-NULL pointer to a handle. On error it returns "
32491 #: ../src/guestfs.pod:1299
32493 "You have to \"configure\" the handle after creating it. This includes "
32494 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
32495 "handle at least once."
32499 #: ../src/guestfs.pod:1303
32500 msgid "After configuring the handle, you have to call L</guestfs_launch>."
32504 #: ../src/guestfs.pod:1305
32506 "You may also want to configure error handling for the handle. See the "
32507 "L</ERROR HANDLING> section below."
32511 #: ../src/guestfs.pod:1308
32512 msgid "guestfs_close"
32516 #: ../src/guestfs.pod:1310
32519 " void guestfs_close (guestfs_h *g);\n"
32524 #: ../src/guestfs.pod:1312
32525 msgid "This closes the connection handle and frees up all resources used."
32529 #: ../src/guestfs.pod:1314
32531 "If autosync was set on the handle and the handle was launched, then this "
32532 "implicitly calls various functions to unmount filesystems and sync the "
32533 "disk. See L</guestfs_set_autosync> for more details."
32537 #: ../src/guestfs.pod:1318
32538 msgid "If a close callback was set on the handle, then it is called."
32542 #: ../src/guestfs.pod:1320
32543 msgid "ERROR HANDLING"
32547 #: ../src/guestfs.pod:1322
32549 "API functions can return errors. For example, almost all functions that "
32550 "return C<int> will return C<-1> to indicate an error."
32554 #: ../src/guestfs.pod:1325
32556 "Additional information is available for errors: an error message string and "
32557 "optionally an error number (errno) if the thing that failed was a system "
32562 #: ../src/guestfs.pod:1329
32564 "You can get at the additional information about the last error on the handle "
32565 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
32566 "up an error handler with L</guestfs_set_error_handler>."
32570 #: ../src/guestfs.pod:1334
32572 "When the handle is created, a default error handler is installed which "
32573 "prints the error message string to C<stderr>. For small short-running "
32574 "command line programs it is sufficient to do:"
32578 #: ../src/guestfs.pod:1338
32581 " if (guestfs_launch (g) == -1)\n"
32582 " exit (EXIT_FAILURE);\n"
32587 #: ../src/guestfs.pod:1341
32589 "since the default error handler will ensure that an error message has been "
32590 "printed to C<stderr> before the program exits."
32594 #: ../src/guestfs.pod:1344
32596 "For other programs the caller will almost certainly want to install an "
32597 "alternate error handler or do error handling in-line like this:"
32601 #: ../src/guestfs.pod:1347
32604 " g = guestfs_create ();\n"
32609 #: ../src/guestfs.pod:1349
32612 " /* This disables the default behaviour of printing errors\n"
32614 " guestfs_set_error_handler (g, NULL, NULL);\n"
32619 #: ../src/guestfs.pod:1353
32622 " if (guestfs_launch (g) == -1) {\n"
32623 " /* Examine the error message and print it etc. */\n"
32624 " char *msg = guestfs_last_error (g);\n"
32625 " int errnum = guestfs_last_errno (g);\n"
32626 " fprintf (stderr, \"%s\\n\", msg);\n"
32633 #: ../src/guestfs.pod:1361
32635 "Out of memory errors are handled differently. The default action is to call "
32636 "L<abort(3)>. If this is undesirable, then you can set a handler using "
32637 "L</guestfs_set_out_of_memory_handler>."
32641 #: ../src/guestfs.pod:1365
32643 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
32644 "because there is no handle if this happens there is no way to get additional "
32645 "error information. However L</guestfs_create> is supposed to be a "
32646 "lightweight operation which can only fail because of insufficient memory (it "
32647 "returns NULL in this case)."
32651 #: ../src/guestfs.pod:1371
32652 msgid "guestfs_last_error"
32656 #: ../src/guestfs.pod:1373
32659 " const char *guestfs_last_error (guestfs_h *g);\n"
32664 #: ../src/guestfs.pod:1375
32666 "This returns the last error message that happened on C<g>. If there has not "
32667 "been an error since the handle was created, then this returns C<NULL>."
32671 #: ../src/guestfs.pod:1379
32673 "The lifetime of the returned string is until the next error occurs, or "
32674 "L</guestfs_close> is called."
32678 #: ../src/guestfs.pod:1382
32679 msgid "guestfs_last_errno"
32683 #: ../src/guestfs.pod:1384
32686 " int guestfs_last_errno (guestfs_h *g);\n"
32691 #: ../src/guestfs.pod:1386
32692 msgid "This returns the last error number (errno) that happened on C<g>."
32696 #: ../src/guestfs.pod:1388
32697 msgid "If successful, an errno integer not equal to zero is returned."
32701 #: ../src/guestfs.pod:1390
32702 msgid "If no error, this returns 0. This call can return 0 in three situations:"
32706 #: ../src/guestfs.pod:1397
32707 msgid "There has not been any error on the handle."
32711 #: ../src/guestfs.pod:1401
32713 "There has been an error but the errno was meaningless. This corresponds to "
32714 "the case where the error did not come from a failed system call, but for "
32715 "some other reason."
32719 #: ../src/guestfs.pod:1407
32721 "There was an error from a failed system call, but for some reason the errno "
32722 "was not captured and returned. This usually indicates a bug in libguestfs."
32726 #: ../src/guestfs.pod:1413
32728 "Libguestfs tries to convert the errno from inside the applicance into a "
32729 "corresponding errno for the caller (not entirely trivial: the appliance "
32730 "might be running a completely different operating system from the library "
32731 "and error numbers are not standardized across Un*xen). If this could not be "
32732 "done, then the error is translated to C<EINVAL>. In practice this should "
32733 "only happen in very rare circumstances."
32737 #: ../src/guestfs.pod:1421
32738 msgid "guestfs_set_error_handler"
32742 #: ../src/guestfs.pod:1423
32745 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
32747 " const char *msg);\n"
32748 " void guestfs_set_error_handler (guestfs_h *g,\n"
32749 " guestfs_error_handler_cb cb,\n"
32750 " void *opaque);\n"
32755 #: ../src/guestfs.pod:1430
32757 "The callback C<cb> will be called if there is an error. The parameters "
32758 "passed to the callback are an opaque data pointer and the error message "
32763 #: ../src/guestfs.pod:1434
32765 "C<errno> is not passed to the callback. To get that the callback must call "
32766 "L</guestfs_last_errno>."
32770 #: ../src/guestfs.pod:1437
32772 "Note that the message string C<msg> is freed as soon as the callback "
32773 "function returns, so if you want to stash it somewhere you must make your "
32778 #: ../src/guestfs.pod:1441
32779 msgid "The default handler prints messages on C<stderr>."
32783 #: ../src/guestfs.pod:1443
32784 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
32788 #: ../src/guestfs.pod:1445
32789 msgid "guestfs_get_error_handler"
32793 #: ../src/guestfs.pod:1447
32796 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
32797 " void **opaque_rtn);\n"
32802 #: ../src/guestfs.pod:1450
32803 msgid "Returns the current error handler callback."
32807 #: ../src/guestfs.pod:1452
32808 msgid "guestfs_set_out_of_memory_handler"
32812 #: ../src/guestfs.pod:1454
32815 " typedef void (*guestfs_abort_cb) (void);\n"
32816 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
32817 " guestfs_abort_cb);\n"
32822 #: ../src/guestfs.pod:1458
32824 "The callback C<cb> will be called if there is an out of memory situation. "
32825 "I<Note this callback must not return>."
32829 #: ../src/guestfs.pod:1461
32830 msgid "The default is to call L<abort(3)>."
32834 #: ../src/guestfs.pod:1463
32835 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
32839 #: ../src/guestfs.pod:1466
32840 msgid "guestfs_get_out_of_memory_handler"
32844 #: ../src/guestfs.pod:1468
32847 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
32852 #: ../src/guestfs.pod:1470
32853 msgid "This returns the current out of memory handler."
32857 #: ../src/guestfs.pod:1472
32862 #: ../src/guestfs.pod:1476
32867 #: ../src/guestfs.pod:1478
32872 #: ../src/guestfs.pod:1480
32873 msgid "AVAILABILITY"
32877 #: ../src/guestfs.pod:1482
32878 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
32882 #: ../src/guestfs.pod:1484
32884 "Using L</guestfs_available> you can test availability of the following "
32885 "groups of functions. This test queries the appliance to see if the "
32886 "appliance you are currently using supports the functionality."
32890 #: ../src/guestfs.pod:1489
32891 msgid "@AVAILABILITY@"
32895 #: ../src/guestfs.pod:1491
32896 msgid "GUESTFISH supported COMMAND"
32900 #: ../src/guestfs.pod:1493
32902 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
32903 "prints out the available groups and whether they are supported by this build "
32904 "of libguestfs. Note however that you have to do C<run> first."
32908 #: ../src/guestfs.pod:1498
32909 msgid "SINGLE CALLS AT COMPILE TIME"
32913 #: ../src/guestfs.pod:1500
32915 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
32916 "function, such as:"
32920 #: ../src/guestfs.pod:1503
32923 " #define LIBGUESTFS_HAVE_DD 1\n"
32928 #: ../src/guestfs.pod:1505
32929 msgid "if L</guestfs_dd> is available."
32933 #: ../src/guestfs.pod:1507
32935 "Before version 1.5.8, if you needed to test whether a single libguestfs "
32936 "function is available at compile time, we recommended using build tools such "
32937 "as autoconf or cmake. For example in autotools you could use:"
32941 #: ../src/guestfs.pod:1512
32944 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
32945 " AC_CHECK_FUNCS([guestfs_dd])\n"
32950 #: ../src/guestfs.pod:1515
32952 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
32957 #: ../src/guestfs.pod:1518
32958 msgid "SINGLE CALLS AT RUN TIME"
32962 #: ../src/guestfs.pod:1520
32964 "Testing at compile time doesn't guarantee that a function really exists in "
32965 "the library. The reason is that you might be dynamically linked against a "
32966 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
32967 "This situation unfortunately results in a segmentation fault, which is a "
32968 "shortcoming of the C dynamic linking system itself."
32972 #: ../src/guestfs.pod:1527
32974 "You can use L<dlopen(3)> to test if a function is available at run time, as "
32975 "in this example program (note that you still need the compile time check as "
32980 #: ../src/guestfs.pod:1531
32983 " #include <stdio.h>\n"
32984 " #include <stdlib.h>\n"
32985 " #include <unistd.h>\n"
32986 " #include <dlfcn.h>\n"
32987 " #include <guestfs.h>\n"
32992 #: ../src/guestfs.pod:1537
32997 " #ifdef LIBGUESTFS_HAVE_DD\n"
32999 " int has_function;\n"
33004 #: ../src/guestfs.pod:1543
33007 " /* Test if the function guestfs_dd is really available. */\n"
33008 " dl = dlopen (NULL, RTLD_LAZY);\n"
33010 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
33011 " exit (EXIT_FAILURE);\n"
33013 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
33019 #: ../src/guestfs.pod:1552
33022 " if (!has_function)\n"
33023 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
33025 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
33026 " /* Now it's safe to call\n"
33027 " guestfs_dd (g, \"foo\", \"bar\");\n"
33031 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
33038 #: ../src/guestfs.pod:1565
33040 "You may think the above is an awful lot of hassle, and it is. There are "
33041 "other ways outside of the C linking system to ensure that this kind of "
33042 "incompatibility never arises, such as using package versioning:"
33046 #: ../src/guestfs.pod:1570
33049 " Requires: libguestfs >= 1.0.80\n"
33054 #: ../src/guestfs.pod:1572
33055 msgid "CALLS WITH OPTIONAL ARGUMENTS"
33059 #: ../src/guestfs.pod:1574
33061 "A recent feature of the API is the introduction of calls which take optional "
33062 "arguments. In C these are declared 3 ways. The main way is as a call which "
33063 "takes variable arguments (ie. C<...>), as in this example:"
33067 #: ../src/guestfs.pod:1579
33070 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
33075 #: ../src/guestfs.pod:1581
33077 "Call this with a list of optional arguments, terminated by C<-1>. So to "
33078 "call with no optional arguments specified:"
33082 #: ../src/guestfs.pod:1584
33085 " guestfs_add_drive_opts (g, filename, -1);\n"
33090 #: ../src/guestfs.pod:1586
33091 msgid "With a single optional argument:"
33095 #: ../src/guestfs.pod:1588
33098 " guestfs_add_drive_opts (g, filename,\n"
33099 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33105 #: ../src/guestfs.pod:1592
33110 #: ../src/guestfs.pod:1594
33113 " guestfs_add_drive_opts (g, filename,\n"
33114 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33115 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33121 #: ../src/guestfs.pod:1599
33123 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
33128 #: ../src/guestfs.pod:1602
33129 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
33133 #: ../src/guestfs.pod:1604
33135 "The second variant has the same name with the suffix C<_va>, which works the "
33136 "same way but takes a C<va_list>. See the C manual for details. For the "
33137 "example function, this is declared:"
33141 #: ../src/guestfs.pod:1608
33144 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
33145 " va_list args);\n"
33150 #: ../src/guestfs.pod:1611
33151 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
33155 #: ../src/guestfs.pod:1613
33157 "The third variant is useful where you need to construct these calls. You "
33158 "pass in a structure where you fill in the optional fields. The structure "
33159 "has a bitmask as the first element which you must set to indicate which "
33160 "fields you have filled in. For our example function the structure and call "
33165 #: ../src/guestfs.pod:1619
33168 " struct guestfs_add_drive_opts_argv {\n"
33169 " uint64_t bitmask;\n"
33171 " const char *format;\n"
33174 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
33175 " const struct guestfs_add_drive_opts_argv *optargs);\n"
33180 #: ../src/guestfs.pod:1628
33181 msgid "You could call it like this:"
33185 #: ../src/guestfs.pod:1630
33188 " struct guestfs_add_drive_opts_argv optargs = {\n"
33189 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
33190 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
33191 " .readonly = 1,\n"
33192 " .format = \"qcow2\"\n"
33198 #: ../src/guestfs.pod:1637
33201 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
33206 #: ../src/guestfs.pod:1645
33207 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
33211 #: ../src/guestfs.pod:1650
33212 msgid "You do not need to fill in all fields of the structure."
33216 #: ../src/guestfs.pod:1654
33218 "There must be a one-to-one correspondence between fields of the structure "
33219 "that are filled in, and bits set in the bitmask."
33223 #: ../src/guestfs.pod:1659
33224 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
33228 #: ../src/guestfs.pod:1661
33230 "In other languages, optional arguments are expressed in the way that is "
33231 "natural for that language. We refer you to the language-specific "
33232 "documentation for more details on that."
33236 #: ../src/guestfs.pod:1665
33237 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
33241 #: ../src/guestfs.pod:1667
33242 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
33246 #: ../src/guestfs.pod:1669
33248 "B<Note:> This section documents the generic event mechanism introduced in "
33249 "libguestfs 1.10, which you should use in new code if possible. The old "
33250 "functions C<guestfs_set_log_message_callback>, "
33251 "C<guestfs_set_subprocess_quit_callback>, "
33252 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
33253 "C<guestfs_set_progress_callback> are no longer documented in this manual "
33254 "page. Because of the ABI guarantee, the old functions continue to work."
33258 #: ../src/guestfs.pod:1678
33260 "Handles generate events when certain things happen, such as log messages "
33261 "being generated, progress messages during long-running operations, or the "
33262 "handle being closed. The API calls described below let you register a "
33263 "callback to be called when events happen. You can register multiple "
33264 "callbacks (for the same, different or overlapping sets of events), and "
33265 "individually remove callbacks. If callbacks are not removed, then they "
33266 "remain in force until the handle is closed."
33270 #: ../src/guestfs.pod:1686
33272 "In the current implementation, events are only generated synchronously: that "
33273 "means that events (and hence callbacks) can only happen while you are in the "
33274 "middle of making another libguestfs call. The callback is called in the "
33279 #: ../src/guestfs.pod:1691
33281 "Events may contain a payload, usually nothing (void), an array of 64 bit "
33282 "unsigned integers, or a message buffer. Payloads are discussed later on."
33286 #: ../src/guestfs.pod:1695
33287 msgid "CLASSES OF EVENTS"
33291 #: ../src/guestfs.pod:1699
33292 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
33296 #: ../src/guestfs.pod:1702
33298 "The callback function will be called while the handle is being closed "
33299 "(synchronously from L</guestfs_close>)."
33303 #: ../src/guestfs.pod:1705
33305 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
33306 "handles that are open when the program exits. This means that this callback "
33307 "might be called indirectly from L<exit(3)>, which can cause unexpected "
33308 "problems in higher-level languages (eg. if your HLL interpreter has already "
33309 "been cleaned up by the time this is called, and if your callback then jumps "
33310 "into some HLL function)."
33314 #: ../src/guestfs.pod:1712
33316 "If no callback is registered: the handle is closed without any callback "
33321 #: ../src/guestfs.pod:1715
33322 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
33326 #: ../src/guestfs.pod:1718
33328 "The callback function will be called when the child process quits, either "
33329 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
33330 "corresponds to a transition from any state to the CONFIG state)."
33334 #: ../src/guestfs.pod:1722 ../src/guestfs.pod:1731
33335 msgid "If no callback is registered: the event is ignored."
33339 #: ../src/guestfs.pod:1724
33340 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
33344 #: ../src/guestfs.pod:1727
33346 "The callback function will be called when the child process becomes ready "
33347 "first time after it has been launched. (This corresponds to a transition "
33348 "from LAUNCHING to the READY state)."
33352 #: ../src/guestfs.pod:1733
33353 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
33357 #: ../src/guestfs.pod:1736
33359 "Some long-running operations can generate progress messages. If this "
33360 "callback is registered, then it will be called each time a progress message "
33361 "is generated (usually two seconds after the operation started, and three "
33362 "times per second thereafter until it completes, although the frequency may "
33363 "change in future versions)."
33367 #: ../src/guestfs.pod:1742
33369 "The callback receives in the payload four unsigned 64 bit numbers which are "
33370 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
33374 #: ../src/guestfs.pod:1745
33376 "The units of C<total> are not defined, although for some operations C<total> "
33377 "may relate in some way to the amount of data to be transferred (eg. in bytes "
33378 "or megabytes), and C<position> may be the portion which has been "
33383 #: ../src/guestfs.pod:1750
33384 msgid "The only defined and stable parts of the API are:"
33388 #: ../src/guestfs.pod:1756
33390 "The callback can display to the user some type of progress bar or indicator "
33391 "which shows the ratio of C<position>:C<total>."
33395 #: ../src/guestfs.pod:1761
33396 msgid "0 E<lt>= C<position> E<lt>= C<total>"
33400 #: ../src/guestfs.pod:1765
33402 "If any progress notification is sent during a call, then a final progress "
33403 "notification is always sent when C<position> = C<total> (I<unless> the call "
33404 "fails with an error)."
33408 #: ../src/guestfs.pod:1769
33410 "This is to simplify caller code, so callers can easily set the progress "
33411 "indicator to \"100%\" at the end of the operation, without requiring special "
33412 "code to detect this case."
33416 #: ../src/guestfs.pod:1775
33418 "For some calls we are unable to estimate the progress of the call, but we "
33419 "can still generate progress messages to indicate activity. This is known as "
33420 "\"pulse mode\", and is directly supported by certain progress bar "
33421 "implementations (eg. GtkProgressBar)."
33425 #: ../src/guestfs.pod:1780
33427 "For these calls, zero or more progress messages are generated with "
33428 "C<position = 0> and C<total = 1>, followed by a final message with "
33429 "C<position = total = 1>."
33433 #: ../src/guestfs.pod:1784
33435 "As noted above, if the call fails with an error then the final message may "
33436 "not be generated."
33440 #: ../src/guestfs.pod:1789
33442 "The callback also receives the procedure number (C<proc_nr>) and serial "
33443 "number (C<serial>) of the call. These are only useful for debugging "
33444 "protocol issues, and the callback can normally ignore them. The callback "
33445 "may want to print these numbers in error messages or debugging messages."
33449 #: ../src/guestfs.pod:1795
33450 msgid "If no callback is registered: progress messages are discarded."
33454 #: ../src/guestfs.pod:1797
33455 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
33459 #: ../src/guestfs.pod:1800
33461 "The callback function is called whenever a log message is generated by qemu, "
33462 "the appliance kernel, guestfsd (daemon), or utility programs."
33466 #: ../src/guestfs.pod:1803
33468 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
33469 "(L</guestfs_launch>) then additional debug messages are generated."
33473 #: ../src/guestfs.pod:1806 ../src/guestfs.pod:1820
33475 "If no callback is registered: the messages are discarded unless the verbose "
33476 "flag is set in which case they are sent to stderr. You can override the "
33477 "printing of verbose messages to stderr by setting up a callback."
33481 #: ../src/guestfs.pod:1811
33482 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
33486 #: ../src/guestfs.pod:1814
33488 "The callback function is called whenever a log message is generated by the "
33489 "library part of libguestfs."
33493 #: ../src/guestfs.pod:1817
33495 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
33496 "messages are generated."
33500 #: ../src/guestfs.pod:1825
33501 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
33505 #: ../src/guestfs.pod:1828
33507 "The callback function is called whenever a trace message is generated. This "
33508 "only applies if the trace flag (L</guestfs_set_trace>) is set."
33512 #: ../src/guestfs.pod:1831
33514 "If no callback is registered: the messages are sent to stderr. You can "
33515 "override the printing of trace messages to stderr by setting up a callback."
33519 #: ../src/guestfs.pod:1837
33520 msgid "guestfs_set_event_callback"
33524 #: ../src/guestfs.pod:1839
33527 " int guestfs_set_event_callback (guestfs_h *g,\n"
33528 " guestfs_event_callback cb,\n"
33529 " uint64_t event_bitmask,\n"
33531 " void *opaque);\n"
33536 #: ../src/guestfs.pod:1845
33538 "This function registers a callback (C<cb>) for all event classes in the "
33539 "C<event_bitmask>."
33543 #: ../src/guestfs.pod:1848
33545 "For example, to register for all log message events, you could call this "
33546 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
33547 "To register a single callback for all possible classes of events, use "
33548 "C<GUESTFS_EVENT_ALL>."
33552 #: ../src/guestfs.pod:1854
33553 msgid "C<flags> should always be passed as 0."
33557 #: ../src/guestfs.pod:1856
33559 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
33560 "it for any purpose."
33564 #: ../src/guestfs.pod:1859
33566 "The return value is the event handle (an integer) which you can use to "
33567 "delete the callback (see below)."
33571 #: ../src/guestfs.pod:1862
33573 "If there is an error, this function returns C<-1>, and sets the error in the "
33574 "handle in the usual way (see L</guestfs_last_error> etc.)"
33578 #: ../src/guestfs.pod:1865
33580 "Callbacks remain in effect until they are deleted, or until the handle is "
33585 #: ../src/guestfs.pod:1868
33587 "In the case where multiple callbacks are registered for a particular event "
33588 "class, all of the callbacks are called. The order in which multiple "
33589 "callbacks are called is not defined."
33593 #: ../src/guestfs.pod:1872
33594 msgid "guestfs_delete_event_callback"
33598 #: ../src/guestfs.pod:1874
33601 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
33606 #: ../src/guestfs.pod:1876
33608 "Delete a callback that was previously registered. C<event_handle> should be "
33609 "the integer that was returned by a previous call to "
33610 "C<guestfs_set_event_callback> on the same handle."
33614 #: ../src/guestfs.pod:1880
33615 msgid "guestfs_event_callback"
33619 #: ../src/guestfs.pod:1882
33622 " typedef void (*guestfs_event_callback) (\n"
33625 " uint64_t event,\n"
33626 " int event_handle,\n"
33628 " const char *buf, size_t buf_len,\n"
33629 " const uint64_t *array, size_t array_len);\n"
33634 #: ../src/guestfs.pod:1891
33635 msgid "This is the type of the event callback function that you have to provide."
33639 #: ../src/guestfs.pod:1894
33641 "The basic parameters are: the handle (C<g>), the opaque user pointer "
33642 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
33643 "handle, and C<flags> which in the current API you should ignore."
33647 #: ../src/guestfs.pod:1898
33649 "The remaining parameters contain the event payload (if any). Each event may "
33650 "contain a payload, which usually relates to the event class, but for future "
33651 "proofing your code should be written to handle any payload for any event "
33656 #: ../src/guestfs.pod:1903
33658 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
33659 "there is no message buffer). Note that this message buffer can contain "
33660 "arbitrary 8 bit data, including NUL bytes."
33664 #: ../src/guestfs.pod:1907
33666 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
33667 "moment this is only used for progress messages."
33671 #: ../src/guestfs.pod:1910
33672 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
33676 #: ../src/guestfs.pod:1912
33678 "One motivation for the generic event API was to allow GUI programs to "
33679 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
33680 "unconditionally to C<stderr>."
33684 #: ../src/guestfs.pod:1916
33686 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
33687 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
33688 "messages are not events; you must capture error messages separately)."
33692 #: ../src/guestfs.pod:1921
33694 "Programs have to set up a callback to capture the classes of events of "
33699 #: ../src/guestfs.pod:1924
33703 " guestfs_set_event_callback\n"
33704 " (g, message_callback,\n"
33705 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
33706 " GUESTFS_EVENT_TRACE,\n"
33707 " 0, NULL) == -1)\n"
33708 " if (eh == -1) {\n"
33709 " // handle error in the usual way\n"
33715 #: ../src/guestfs.pod:1934
33717 "The callback can then direct messages to the appropriate place. In this "
33718 "example, messages are directed to syslog:"
33722 #: ../src/guestfs.pod:1937
33726 " message_callback (\n"
33729 " uint64_t event,\n"
33730 " int event_handle,\n"
33732 " const char *buf, size_t buf_len,\n"
33733 " const uint64_t *array, size_t array_len)\n"
33735 " const int priority = LOG_USER|LOG_INFO;\n"
33736 " if (buf_len > 0)\n"
33737 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
33743 #: ../src/guestfs.pod:1952
33744 msgid "CANCELLING LONG TRANSFERS"
33748 #: ../src/guestfs.pod:1954
33750 "Some operations can be cancelled by the caller while they are in progress. "
33751 "Currently only operations that involve uploading or downloading data can be "
33752 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
33753 "parameters in the generator)."
33757 #: ../src/guestfs.pod:1959
33758 msgid "guestfs_user_cancel"
33762 #: ../src/guestfs.pod:1961
33765 " void guestfs_user_cancel (guestfs_h *g);\n"
33770 #: ../src/guestfs.pod:1963
33771 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
33775 #: ../src/guestfs.pod:1966
33777 "Unlike most other libguestfs calls, this function is signal safe and thread "
33778 "safe. You can call it from a signal handler or from another thread, without "
33779 "needing to do any locking."
33783 #: ../src/guestfs.pod:1970
33785 "The transfer that was in progress (if there is one) will stop shortly "
33786 "afterwards, and will return an error. The errno (see "
33787 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
33788 "out if the operation was cancelled or failed because of another error."
33792 #: ../src/guestfs.pod:1976
33794 "No cleanup is performed: for example, if a file was being uploaded then "
33795 "after cancellation there may be a partially uploaded file. It is the "
33796 "caller's responsibility to clean up if necessary."
33800 #: ../src/guestfs.pod:1980
33801 msgid "There are two common places that you might call C<guestfs_user_cancel>."
33805 #: ../src/guestfs.pod:1982
33807 "In an interactive text-based program, you might call it from a C<SIGINT> "
33808 "signal handler so that pressing C<^C> cancels the current operation. (You "
33809 "also need to call L</guestfs_set_pgroup> so that child processes don't "
33810 "receive the C<^C> signal)."
33814 #: ../src/guestfs.pod:1987
33816 "In a graphical program, when the main thread is displaying a progress bar "
33817 "with a cancel button, wire up the cancel button to call this function."
33821 #: ../src/guestfs.pod:1991
33822 msgid "PRIVATE DATA AREA"
33826 #: ../src/guestfs.pod:1993
33828 "You can attach named pieces of private data to the libguestfs handle, fetch "
33829 "them by name, and walk over them, for the lifetime of the handle. This is "
33830 "called the private data area and is only available from the C API."
33834 #: ../src/guestfs.pod:1998
33835 msgid "To attach a named piece of data, use the following call:"
33839 #: ../src/guestfs.pod:2000
33842 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
33847 #: ../src/guestfs.pod:2002
33849 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
33850 "pointer (which can be C<NULL>). Any previous item with the same key is "
33855 #: ../src/guestfs.pod:2006
33857 "You can use any C<key> you want, but your key should I<not> start with an "
33858 "underscore character. Keys beginning with an underscore character are "
33859 "reserved for internal libguestfs purposes (eg. for implementing language "
33860 "bindings). It is recommended that you prefix the key with some unique "
33861 "string to avoid collisions with other users."
33865 #: ../src/guestfs.pod:2012
33866 msgid "To retrieve the pointer, use:"
33870 #: ../src/guestfs.pod:2014
33873 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
33878 #: ../src/guestfs.pod:2016
33880 "This function returns C<NULL> if either no data is found associated with "
33881 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
33886 #: ../src/guestfs.pod:2020
33888 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
33889 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
33890 "all. In particular, libguestfs does I<not> try to free the data when the "
33891 "handle is closed. If the data must be freed, then the caller must either "
33892 "free it before calling L</guestfs_close> or must set up a close callback to "
33893 "do it (see L</GUESTFS_EVENT_CLOSE>)."
33897 #: ../src/guestfs.pod:2027
33898 msgid "To walk over all entries, use these two functions:"
33902 #: ../src/guestfs.pod:2029
33905 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
33910 #: ../src/guestfs.pod:2031
33913 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
33918 #: ../src/guestfs.pod:2033
33920 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
33921 "not have any particular meaning -- keys are not returned in any defined "
33922 "order). A pointer to the key is returned in C<*key_rtn> and the "
33923 "corresponding data pointer is returned from the function. C<NULL> is "
33924 "returned if there are no keys stored in the handle."
33928 #: ../src/guestfs.pod:2039
33930 "C<guestfs_next_private> returns the next key, pointer pair. The return "
33931 "value of this function is also C<NULL> is there are no further entries to "
33936 #: ../src/guestfs.pod:2043
33937 msgid "Notes about walking over entries:"
33941 #: ../src/guestfs.pod:2049
33942 msgid "You must not call C<guestfs_set_private> while walking over the entries."
33946 #: ../src/guestfs.pod:2054
33948 "The handle maintains an internal iterator which is reset when you call "
33949 "C<guestfs_first_private>. This internal iterator is invalidated when you "
33950 "call C<guestfs_set_private>."
33954 #: ../src/guestfs.pod:2060
33955 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
33959 #: ../src/guestfs.pod:2062
33962 " guestfs_set_private (g, key, NULL);\n"
33967 #: ../src/guestfs.pod:2064
33968 msgid "then that C<key> is not returned when walking."
33972 #: ../src/guestfs.pod:2068
33974 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
33975 "C<guestfs_next_private> or C<guestfs_set_private>."
33979 #: ../src/guestfs.pod:2074
33981 "The following example code shows how to print all keys and data pointers "
33982 "that are associated with the handle C<g>:"
33986 #: ../src/guestfs.pod:2077
33989 " const char *key;\n"
33990 " void *data = guestfs_first_private (g, &key);\n"
33991 " while (data != NULL)\n"
33993 " printf (\"key = %s, data = %p\\n\", key, data);\n"
33994 " data = guestfs_next_private (g, &key);\n"
34000 #: ../src/guestfs.pod:2085
34002 "More commonly you are only interested in keys that begin with an "
34003 "application-specific prefix C<foo_>. Modify the loop like so:"
34007 #: ../src/guestfs.pod:2088
34010 " const char *key;\n"
34011 " void *data = guestfs_first_private (g, &key);\n"
34012 " while (data != NULL)\n"
34014 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34015 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34016 " data = guestfs_next_private (g, &key);\n"
34022 #: ../src/guestfs.pod:2097
34024 "If you need to modify keys while walking, then you have to jump back to the "
34025 "beginning of the loop. For example, to delete all keys prefixed with "
34030 #: ../src/guestfs.pod:2101
34033 " const char *key;\n"
34036 " data = guestfs_first_private (g, &key);\n"
34037 " while (data != NULL)\n"
34039 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34041 " guestfs_set_private (g, key, NULL);\n"
34042 " /* note that 'key' pointer is now invalid, and so is\n"
34043 " the internal iterator */\n"
34046 " data = guestfs_next_private (g, &key);\n"
34052 #: ../src/guestfs.pod:2117
34054 "Note that the above loop is guaranteed to terminate because the keys are "
34055 "being deleted, but other manipulations of keys within the loop might not "
34056 "terminate unless you also maintain an indication of which keys have been "
34061 #: ../src/guestfs.pod:2122 ../src/guestfs.pod:2127
34066 #: ../src/guestfs.pod:2124
34068 "<!-- old anchor for the next section --> <a "
34069 "name=\"state_machine_and_low_level_event_api\"/>"
34073 #: ../src/guestfs.pod:2129
34074 msgid "ARCHITECTURE"
34078 #: ../src/guestfs.pod:2131
34080 "Internally, libguestfs is implemented by running an appliance (a special "
34081 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
34082 "process of the main program."
34086 #: ../src/guestfs.pod:2135
34089 " ___________________\n"
34091 " | main program |\n"
34093 " | | child process / appliance\n"
34094 " | | __________________________\n"
34096 " +-------------------+ RPC | +-----------------+ |\n"
34097 " | libguestfs <--------------------> guestfsd | |\n"
34098 " | | | +-----------------+ |\n"
34099 " \\___________________/ | | Linux kernel | |\n"
34100 " | +--^--------------+ |\n"
34101 " \\_________|________________/\n"
34103 " _______v______\n"
34106 " | disk image |\n"
34107 " \\______________/\n"
34112 #: ../src/guestfs.pod:2155
34114 "The library, linked to the main program, creates the child process and hence "
34115 "the appliance in the L</guestfs_launch> function."
34119 #: ../src/guestfs.pod:2158
34121 "Inside the appliance is a Linux kernel and a complete stack of userspace "
34122 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
34123 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
34124 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
34125 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
34126 "attached to the qemu process which translates device access by the "
34127 "appliance's Linux kernel into accesses to the image."
34131 #: ../src/guestfs.pod:2167
34133 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
34134 "Although the disk image you are attached to might also be used by some "
34135 "virtual machine, libguestfs doesn't know or care about this. (But you will "
34136 "care if both libguestfs's qemu process and your virtual machine are trying "
34137 "to update the disk image at the same time, since these usually results in "
34138 "massive disk corruption)."
34142 #: ../src/guestfs.pod:2174
34143 msgid "STATE MACHINE"
34147 #: ../src/guestfs.pod:2176
34148 msgid "libguestfs uses a state machine to model the child process:"
34152 #: ../src/guestfs.pod:2178
34156 " guestfs_create\n"
34164 " / | \\ \\ guestfs_launch\n"
34165 " / | _\\__V______\n"
34167 " / | | LAUNCHING |\n"
34168 " / | \\___________/\n"
34170 " / | guestfs_launch\n"
34172 " ______ / __|____V\n"
34173 " / \\ ------> / \\\n"
34174 " | BUSY | | READY |\n"
34175 " \\______/ <------ \\________/\n"
34180 #: ../src/guestfs.pod:2200
34182 "The normal transitions are (1) CONFIG (when the handle is created, but there "
34183 "is no child process), (2) LAUNCHING (when the child process is booting up), "
34184 "(3) alternating between READY and BUSY as commands are issued to, and "
34185 "carried out by, the child process."
34189 #: ../src/guestfs.pod:2205
34191 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
34192 "asynchronously at any time (eg. due to some internal error), and that causes "
34193 "the state to transition back to CONFIG."
34197 #: ../src/guestfs.pod:2209
34199 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
34200 "issued when in the CONFIG state."
34204 #: ../src/guestfs.pod:2212
34206 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
34207 "L</guestfs_launch> blocks until the child process is READY to accept "
34208 "commands (or until some failure or timeout). L</guestfs_launch> internally "
34209 "moves the state from CONFIG to LAUNCHING while it is running."
34213 #: ../src/guestfs.pod:2218
34215 "API actions such as L</guestfs_mount> can only be issued when in the READY "
34216 "state. These API calls block waiting for the command to be carried out "
34217 "(ie. the state to transition to BUSY and then back to READY). There are no "
34218 "non-blocking versions, and no way to issue more than one command per handle "
34219 "at the same time."
34223 #: ../src/guestfs.pod:2224
34225 "Finally, the child process sends asynchronous messages back to the main "
34226 "program, such as kernel log messages. You can register a callback to "
34227 "receive these messages."
34231 #: ../src/guestfs.pod:2228
34236 #: ../src/guestfs.pod:2230
34237 msgid "APPLIANCE BOOT PROCESS"
34241 #: ../src/guestfs.pod:2232
34243 "This process has evolved and continues to evolve. The description here "
34244 "corresponds only to the current version of libguestfs and is provided for "
34245 "information only."
34249 #: ../src/guestfs.pod:2236
34251 "In order to follow the stages involved below, enable libguestfs debugging "
34252 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
34256 #: ../src/guestfs.pod:2241
34257 msgid "Create the appliance"
34261 #: ../src/guestfs.pod:2243
34263 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
34264 "initrd and the appliance."
34268 #: ../src/guestfs.pod:2246
34270 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
34271 "directory if C<TMPDIR> is set)."
34275 #: ../src/guestfs.pod:2249
34277 "For a complete description of how the appliance is created and cached, read "
34278 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
34282 #: ../src/guestfs.pod:2253
34283 msgid "Start qemu and boot the kernel"
34287 #: ../src/guestfs.pod:2255
34288 msgid "qemu is invoked to boot the kernel."
34292 #: ../src/guestfs.pod:2257
34293 msgid "Run the initrd"
34297 #: ../src/guestfs.pod:2259
34299 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
34300 "appliance. The purpose of the initrd is to load enough kernel modules in "
34301 "order that the appliance itself can be mounted and started."
34305 #: ../src/guestfs.pod:2263
34307 "The initrd is a cpio archive called "
34308 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
34312 #: ../src/guestfs.pod:2266
34314 "When the initrd has started you will see messages showing that kernel "
34315 "modules are being loaded, similar to this:"
34319 #: ../src/guestfs.pod:2269
34322 " febootstrap: ext2 mini initrd starting up\n"
34323 " febootstrap: mounting /sys\n"
34324 " febootstrap: internal insmod libcrc32c.ko\n"
34325 " febootstrap: internal insmod crc32c-intel.ko\n"
34330 #: ../src/guestfs.pod:2274
34331 msgid "Find and mount the appliance device"
34335 #: ../src/guestfs.pod:2276
34337 "The appliance is a sparse file containing an ext2 filesystem which contains "
34338 "a familiar (although reduced in size) Linux operating system. It would "
34339 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
34343 #: ../src/guestfs.pod:2280
34345 "The regular disks being inspected by libguestfs are the first devices "
34346 "exposed by qemu (eg. as C</dev/vda>)."
34350 #: ../src/guestfs.pod:2283
34352 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
34353 "there was only one regular disk)."
34357 #: ../src/guestfs.pod:2286
34359 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
34360 "and switch root into the appliance, and run C</init> from the appliance."
34364 #: ../src/guestfs.pod:2290
34365 msgid "If this works successfully you will see messages such as:"
34369 #: ../src/guestfs.pod:2292
34372 " febootstrap: picked /sys/block/vdb/dev as root device\n"
34373 " febootstrap: creating /dev/root as block special 252:16\n"
34374 " febootstrap: mounting new root on /root\n"
34375 " febootstrap: chroot\n"
34376 " Starting /init script ...\n"
34381 #: ../src/guestfs.pod:2298
34383 "Note that C<Starting /init script ...> indicates that the appliance's init "
34384 "script is now running."
34388 #: ../src/guestfs.pod:2301
34389 msgid "Initialize the appliance"
34393 #: ../src/guestfs.pod:2303
34395 "The appliance itself now initializes itself. This involves starting certain "
34396 "processes like C<udev>, possibly printing some debug information, and "
34397 "finally running the daemon (C<guestfsd>)."
34401 #: ../src/guestfs.pod:2307
34406 #: ../src/guestfs.pod:2309
34408 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
34413 #: ../src/guestfs.pod:2312
34416 " verbose daemon enabled\n"
34421 #: ../src/guestfs.pod:2314
34423 "The daemon expects to see a named virtio-serial port exposed by qemu and "
34424 "connected on the other end to the library."
34428 #: ../src/guestfs.pod:2317
34430 "The daemon connects to this port (and hence to the library) and sends a four "
34431 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
34432 "protocol (see below)."
34436 #: ../src/guestfs.pod:2323
34437 msgid "COMMUNICATION PROTOCOL"
34441 #: ../src/guestfs.pod:2325
34443 "Don't rely on using this protocol directly. This section documents how it "
34444 "currently works, but it may change at any time."
34448 #: ../src/guestfs.pod:2328
34450 "The protocol used to talk between the library and the daemon running inside "
34451 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
34452 "1014, RFC 1832, RFC 4506)."
34456 #: ../src/guestfs.pod:2332
34458 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
34459 "this file is automatically generated)."
34463 #: ../src/guestfs.pod:2335
34465 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
34466 "and C<FileOut> parameters, which are handled with very simple request/reply "
34467 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
34468 "parameters, which use the same request and reply messages, but they may also "
34469 "be followed by files sent using a chunked encoding."
34473 #: ../src/guestfs.pod:2342
34474 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
34478 #: ../src/guestfs.pod:2344
34479 msgid "For ordinary functions, the request message is:"
34483 #: ../src/guestfs.pod:2346
34486 " total length (header + arguments,\n"
34487 " but not including the length word itself)\n"
34488 " struct guestfs_message_header (encoded as XDR)\n"
34489 " struct guestfs_<foo>_args (encoded as XDR)\n"
34494 #: ../src/guestfs.pod:2351
34496 "The total length field allows the daemon to allocate a fixed size buffer "
34497 "into which it slurps the rest of the message. As a result, the total length "
34498 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
34499 "effective size of any request is limited to somewhere under this size."
34503 #: ../src/guestfs.pod:2357
34505 "Note also that many functions don't take any arguments, in which case the "
34506 "C<guestfs_I<foo>_args> is completely omitted."
34510 #: ../src/guestfs.pod:2360
34512 "The header contains the procedure number (C<guestfs_proc>) which is how the "
34513 "receiver knows what type of args structure to expect, or none at all."
34517 #: ../src/guestfs.pod:2364
34519 "For functions that take optional arguments, the optional arguments are "
34520 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
34521 "arguments. A bitmask in the header indicates which optional arguments are "
34522 "meaningful. The bitmask is also checked to see if it contains bits set "
34523 "which the daemon does not know about (eg. if more optional arguments were "
34524 "added in a later version of the library), and this causes the call to be "
34529 #: ../src/guestfs.pod:2372
34530 msgid "The reply message for ordinary functions is:"
34534 #: ../src/guestfs.pod:2374
34537 " total length (header + ret,\n"
34538 " but not including the length word itself)\n"
34539 " struct guestfs_message_header (encoded as XDR)\n"
34540 " struct guestfs_<foo>_ret (encoded as XDR)\n"
34545 #: ../src/guestfs.pod:2379
34547 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
34548 "functions that return no formal return values."
34552 #: ../src/guestfs.pod:2382
34553 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
34557 #: ../src/guestfs.pod:2385
34559 "In the case of an error, a flag is set in the header, and the reply message "
34560 "is slightly changed:"
34564 #: ../src/guestfs.pod:2388
34567 " total length (header + error,\n"
34568 " but not including the length word itself)\n"
34569 " struct guestfs_message_header (encoded as XDR)\n"
34570 " struct guestfs_message_error (encoded as XDR)\n"
34575 #: ../src/guestfs.pod:2393
34577 "The C<guestfs_message_error> structure contains the error message as a "
34582 #: ../src/guestfs.pod:2396
34583 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
34587 #: ../src/guestfs.pod:2398
34589 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
34590 "The normal request message is sent (see above). However this is followed by "
34591 "a sequence of file chunks."
34595 #: ../src/guestfs.pod:2402
34598 " total length (header + arguments,\n"
34599 " but not including the length word itself,\n"
34600 " and not including the chunks)\n"
34601 " struct guestfs_message_header (encoded as XDR)\n"
34602 " struct guestfs_<foo>_args (encoded as XDR)\n"
34603 " sequence of chunks for FileIn param #0\n"
34604 " sequence of chunks for FileIn param #1 etc.\n"
34609 #: ../src/guestfs.pod:2410
34610 msgid "The \"sequence of chunks\" is:"
34614 #: ../src/guestfs.pod:2412
34617 " length of chunk (not including length word itself)\n"
34618 " struct guestfs_chunk (encoded as XDR)\n"
34619 " length of chunk\n"
34620 " struct guestfs_chunk (encoded as XDR)\n"
34622 " length of chunk\n"
34623 " struct guestfs_chunk (with data.data_len == 0)\n"
34628 #: ../src/guestfs.pod:2420
34630 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
34631 "is set in the final chunk to indicate either successful completion or early "
34636 #: ../src/guestfs.pod:2424
34638 "At time of writing there are no functions that have more than one FileIn "
34639 "parameter. However this is (theoretically) supported, by sending the "
34640 "sequence of chunks for each FileIn parameter one after another (from left to "
34645 #: ../src/guestfs.pod:2429
34647 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
34648 "transfer. The library does this by sending a chunk with a special flag set "
34649 "to indicate cancellation. When the daemon sees this, it cancels the whole "
34650 "RPC, does I<not> send any reply, and goes back to reading the next request."
34654 #: ../src/guestfs.pod:2435
34656 "The daemon may also cancel. It does this by writing a special word "
34657 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
34658 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
34659 "cancel chunk). The special word is chosen so that even if cancellation "
34660 "happens right at the end of the transfer (after the library has finished "
34661 "writing and has started listening for the reply), the \"spurious\" cancel "
34662 "flag will not be confused with the reply message."
34666 #: ../src/guestfs.pod:2444
34668 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
34669 "limit), and also files where the size is not known in advance (eg. from "
34670 "pipes or sockets). However the chunks are rather small "
34671 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
34672 "to keep much in memory."
34676 #: ../src/guestfs.pod:2450
34677 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
34681 #: ../src/guestfs.pod:2452
34683 "The protocol for FileOut parameters is exactly the same as for FileIn "
34684 "parameters, but with the roles of daemon and library reversed."
34688 #: ../src/guestfs.pod:2455
34691 " total length (header + ret,\n"
34692 " but not including the length word itself,\n"
34693 " and not including the chunks)\n"
34694 " struct guestfs_message_header (encoded as XDR)\n"
34695 " struct guestfs_<foo>_ret (encoded as XDR)\n"
34696 " sequence of chunks for FileOut param #0\n"
34697 " sequence of chunks for FileOut param #1 etc.\n"
34702 #: ../src/guestfs.pod:2463
34703 msgid "INITIAL MESSAGE"
34707 #: ../src/guestfs.pod:2465
34709 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
34710 "which indicates that the guest and daemon is alive. This is what "
34711 "L</guestfs_launch> waits for."
34715 #: ../src/guestfs.pod:2469
34716 msgid "PROGRESS NOTIFICATION MESSAGES"
34720 #: ../src/guestfs.pod:2471
34722 "The daemon may send progress notification messages at any time. These are "
34723 "distinguished by the normal length word being replaced by "
34724 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
34728 #: ../src/guestfs.pod:2475
34730 "The library turns them into progress callbacks (see "
34731 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
34736 #: ../src/guestfs.pod:2479
34738 "The daemon self-limits the frequency of progress messages it sends (see "
34739 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
34744 #: ../src/guestfs.pod:2483
34745 msgid "LIBGUESTFS VERSION NUMBERS"
34749 #: ../src/guestfs.pod:2485
34751 "Since April 2010, libguestfs has started to make separate development and "
34752 "stable releases, along with corresponding branches in our git repository. "
34753 "These separate releases can be identified by version number:"
34757 #: ../src/guestfs.pod:2490
34760 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
34761 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
34767 " | `-------- sub-version\n"
34769 " `------ always '1' because we don't change the ABI\n"
34774 #: ../src/guestfs.pod:2501
34775 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
34779 #: ../src/guestfs.pod:2503
34781 "As time passes we cherry pick fixes from the development branch and backport "
34782 "those into the stable branch, the effect being that the stable branch should "
34783 "get more stable and less buggy over time. So the stable releases are ideal "
34784 "for people who don't need new features but would just like the software to "
34789 #: ../src/guestfs.pod:2509
34790 msgid "Our criteria for backporting changes are:"
34794 #: ../src/guestfs.pod:2515
34796 "Documentation changes which don't affect any code are backported unless the "
34797 "documentation refers to a future feature which is not in stable."
34801 #: ../src/guestfs.pod:2521
34803 "Bug fixes which are not controversial, fix obvious problems, and have been "
34804 "well tested are backported."
34808 #: ../src/guestfs.pod:2526
34810 "Simple rearrangements of code which shouldn't affect how it works get "
34811 "backported. This is so that the code in the two branches doesn't get too "
34812 "far out of step, allowing us to backport future fixes more easily."
34816 #: ../src/guestfs.pod:2532
34818 "We I<don't> backport new features, new APIs, new tools etc, except in one "
34819 "exceptional case: the new feature is required in order to implement an "
34820 "important bug fix."
34824 #: ../src/guestfs.pod:2538
34826 "A new stable branch starts when we think the new features in development are "
34827 "substantial and compelling enough over the current stable branch to warrant "
34828 "it. When that happens we create new stable and development versions 1.N.0 "
34829 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
34830 "stable at this point, but by backporting fixes from development, that branch "
34831 "will stabilize over time."
34835 #: ../src/guestfs.pod:2546
34836 msgid "EXTENDING LIBGUESTFS"
34840 #: ../src/guestfs.pod:2548
34841 msgid "ADDING A NEW API ACTION"
34845 #: ../src/guestfs.pod:2550
34847 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
34848 "documentation) are generated, and this makes it easy to extend the "
34853 #: ../src/guestfs.pod:2554
34854 msgid "To add a new API action there are two changes:"
34858 #: ../src/guestfs.pod:2560
34860 "You need to add a description of the call (name, parameters, return type, "
34861 "tests, documentation) to C<generator/generator_actions.ml>."
34865 #: ../src/guestfs.pod:2563
34867 "There are two sorts of API action, depending on whether the call goes "
34868 "through to the daemon in the appliance, or is serviced entirely by the "
34869 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
34870 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
34871 "an example of the latter, since a trace flag is maintained in the handle and "
34872 "all tracing is done on the library side."
34876 #: ../src/guestfs.pod:2571
34878 "Most new actions are of the first type, and get added to the "
34879 "C<daemon_functions> list. Each function has a unique procedure number used "
34880 "in the RPC protocol which is assigned to that action when we publish "
34881 "libguestfs and cannot be reused. Take the latest procedure number and "
34886 #: ../src/guestfs.pod:2577
34888 "For library-only actions of the second type, add to the "
34889 "C<non_daemon_functions> list. Since these functions are serviced by the "
34890 "library and do not travel over the RPC mechanism to the daemon, these "
34891 "functions do not need a procedure number, and so the procedure number is set "
34896 #: ../src/guestfs.pod:2585
34897 msgid "Implement the action (in C):"
34901 #: ../src/guestfs.pod:2587
34903 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
34904 "C<daemon/> directory."
34908 #: ../src/guestfs.pod:2590
34910 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
34911 "(note: double underscore) in the C<src/> directory."
34915 #: ../src/guestfs.pod:2593
34916 msgid "In either case, use another function as an example of what to do."
34920 #: ../src/guestfs.pod:2597
34921 msgid "After making these changes, use C<make> to compile."
34925 #: ../src/guestfs.pod:2599
34927 "Note that you don't need to implement the RPC, language bindings, manual "
34928 "pages or anything else. It's all automatically generated from the OCaml "
34933 #: ../src/guestfs.pod:2603
34934 msgid "ADDING TESTS FOR AN API ACTION"
34938 #: ../src/guestfs.pod:2605
34940 "You can supply zero or as many tests as you want per API call. The tests "
34941 "can either be added as part of the API description "
34942 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
34943 "drop a script into C<regressions/>. Note that adding a script to "
34944 "C<regressions/> is slower, so if possible use the first method."
34948 #: ../src/guestfs.pod:2611
34950 "The following describes the test environment used when you add an API test "
34951 "in C<generator_actions.ml>."
34955 #: ../src/guestfs.pod:2614
34956 msgid "The test environment has 4 block devices:"
34960 #: ../src/guestfs.pod:2618
34961 msgid "C</dev/sda> 500MB"
34965 #: ../src/guestfs.pod:2620
34966 msgid "General block device for testing."
34970 #: ../src/guestfs.pod:2622
34971 msgid "C</dev/sdb> 50MB"
34975 #: ../src/guestfs.pod:2624
34977 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
34982 #: ../src/guestfs.pod:2627
34983 msgid "C</dev/sdc> 10MB"
34987 #: ../src/guestfs.pod:2629
34988 msgid "Used in a few tests where two block devices are needed."
34992 #: ../src/guestfs.pod:2631
34993 msgid "C</dev/sdd>"
34997 #: ../src/guestfs.pod:2633
34998 msgid "ISO with fixed content (see C<images/test.iso>)."
35002 #: ../src/guestfs.pod:2637
35004 "To be able to run the tests in a reasonable amount of time, the libguestfs "
35005 "appliance and block devices are reused between tests. So don't try testing "
35006 "L</guestfs_kill_subprocess> :-x"
35010 #: ../src/guestfs.pod:2641
35012 "Each test starts with an initial scenario, selected using one of the "
35013 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
35014 "initialize the disks mentioned above in a particular way as documented in "
35015 "C<generator_types.ml>. You should not assume anything about the previous "
35016 "contents of other disks that are not initialized."
35020 #: ../src/guestfs.pod:2647
35022 "You can add a prerequisite clause to any individual test. This is a "
35023 "run-time check, which, if it fails, causes the test to be skipped. Useful "
35024 "if testing a command which might not work on all variations of libguestfs "
35025 "builds. A test that has prerequisite of C<Always> means to run "
35030 #: ../src/guestfs.pod:2653
35032 "In addition, packagers can skip individual tests by setting environment "
35033 "variables before running C<make check>."
35037 #: ../src/guestfs.pod:2656
35040 " SKIP_TEST_<CMD>_<NUM>=1\n"
35045 #: ../src/guestfs.pod:2658
35046 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
35050 #: ../src/guestfs.pod:2660
35055 #: ../src/guestfs.pod:2662
35058 " SKIP_TEST_<CMD>=1\n"
35063 #: ../src/guestfs.pod:2664
35064 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
35068 #: ../src/guestfs.pod:2666
35069 msgid "Packagers can run only certain tests by setting for example:"
35073 #: ../src/guestfs.pod:2668
35076 " TEST_ONLY=\"vfs_type zerofree\"\n"
35081 #: ../src/guestfs.pod:2670
35083 "See C<capitests/tests.c> for more details of how these environment variables "
35088 #: ../src/guestfs.pod:2673
35089 msgid "DEBUGGING NEW API ACTIONS"
35093 #: ../src/guestfs.pod:2675
35094 msgid "Test new actions work before submitting them."
35098 #: ../src/guestfs.pod:2677
35099 msgid "You can use guestfish to try out new commands."
35103 #: ../src/guestfs.pod:2679
35105 "Debugging the daemon is a problem because it runs inside a minimal "
35106 "environment. However you can fprintf messages in the daemon to stderr, and "
35107 "they will show up if you use C<guestfish -v>."
35111 #: ../src/guestfs.pod:2683
35112 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
35116 #: ../src/guestfs.pod:2685
35118 "Our C source code generally adheres to some basic code-formatting "
35119 "conventions. The existing code base is not totally consistent on this "
35120 "front, but we do prefer that contributed code be formatted similarly. In "
35121 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
35122 "indentation level, and other than that, follow the K&R style."
35126 #: ../src/guestfs.pod:2691
35128 "If you use Emacs, add the following to one of one of your start-up files "
35129 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
35133 #: ../src/guestfs.pod:2694
35136 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
35137 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
35138 " (add-hook 'find-file-hook\n"
35139 " '(lambda () (if (and buffer-file-name\n"
35140 " (string-match \"/libguestfs\\\\>\"\n"
35141 " (buffer-file-name))\n"
35142 " (not (string-equal mode-name \"Change Log\"))\n"
35143 " (not (string-equal mode-name \"Makefile\")))\n"
35144 " (setq indent-tabs-mode nil))))\n"
35149 #: ../src/guestfs.pod:2704
35152 " ;;; When editing C sources in libguestfs, use this style.\n"
35153 " (defun libguestfs-c-mode ()\n"
35154 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
35156 " (c-set-style \"K&R\")\n"
35157 " (setq c-indent-level 2)\n"
35158 " (setq c-basic-offset 2))\n"
35159 " (add-hook 'c-mode-hook\n"
35160 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
35161 " (buffer-file-name))\n"
35162 " (libguestfs-c-mode))))\n"
35167 #: ../src/guestfs.pod:2716
35168 msgid "Enable warnings when compiling (and fix any problems this finds):"
35172 #: ../src/guestfs.pod:2719
35175 " ./configure --enable-gcc-warnings\n"
35180 #: ../src/guestfs.pod:2721
35181 msgid "Useful targets are:"
35185 #: ../src/guestfs.pod:2723
35188 " make syntax-check # checks the syntax of the C code\n"
35189 " make check # runs the test suite\n"
35194 #: ../src/guestfs.pod:2726
35195 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
35199 #: ../src/guestfs.pod:2728
35201 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
35202 "which are used to do shell quoting."
35206 #: ../src/guestfs.pod:2733
35211 #: ../src/guestfs.pod:2735
35213 "Simple shell quoted string. Any spaces or other shell characters are "
35218 #: ../src/guestfs.pod:2738
35223 #: ../src/guestfs.pod:2740
35225 "Same as C<%Q> except the string is treated as a path which is prefixed by "
35230 #: ../src/guestfs.pod:2747
35233 " asprintf (&cmd, \"cat %R\", path);\n"
35238 #: ../src/guestfs.pod:2749
35239 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
35243 #: ../src/guestfs.pod:2751
35245 "I<Note:> Do I<not> use these when you are passing parameters to the "
35246 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
35247 "because they are not passed via the shell (instead, straight to exec). You "
35248 "probably want to use the C<sysroot_path()> function however."
35252 #: ../src/guestfs.pod:2757
35253 msgid "SUBMITTING YOUR NEW API ACTIONS"
35257 #: ../src/guestfs.pod:2759
35259 "Submit patches to the mailing list: "
35260 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
35261 "L<rjones@redhat.com>."
35265 #: ../src/guestfs.pod:2763
35266 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
35270 #: ../src/guestfs.pod:2765
35271 msgid "We support i18n (gettext anyhow) in the library."
35275 #: ../src/guestfs.pod:2767
35277 "However many messages come from the daemon, and we don't translate those at "
35278 "the moment. One reason is that the appliance generally has all locale files "
35279 "removed from it, because they take up a lot of space. So we'd have to readd "
35280 "some of those, as well as copying our PO files into the appliance."
35284 #: ../src/guestfs.pod:2773
35286 "Debugging messages are never translated, since they are intended for the "
35291 #: ../src/guestfs.pod:2776
35292 msgid "SOURCE CODE SUBDIRECTORIES"
35296 #: ../src/guestfs.pod:2782
35297 msgid "The libguestfs appliance, build scripts and so on."
35301 #: ../src/guestfs.pod:2784
35302 msgid "C<capitests>"
35306 #: ../src/guestfs.pod:2786
35307 msgid "Automated tests of the C API."
35311 #: ../src/guestfs.pod:2788
35316 #: ../src/guestfs.pod:2790
35318 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
35323 #: ../src/guestfs.pod:2793
35328 #: ../src/guestfs.pod:2795
35330 "Safety and liveness tests of components that libguestfs depends upon (not of "
35331 "libguestfs itself). Mainly this is for qemu and the kernel."
35335 #: ../src/guestfs.pod:2798
35340 #: ../src/guestfs.pod:2800
35341 msgid "Outside contributions, experimental parts."
35345 #: ../src/guestfs.pod:2802
35350 #: ../src/guestfs.pod:2804
35352 "The daemon that runs inside the libguestfs appliance and carries out "
35357 #: ../src/guestfs.pod:2807
35362 #: ../src/guestfs.pod:2809
35363 msgid "L<virt-df(1)> command and documentation."
35367 #: ../src/guestfs.pod:2811
35372 #: ../src/guestfs.pod:2813
35373 msgid "L<virt-edit(1)> command and documentation."
35377 #: ../src/guestfs.pod:2815
35378 msgid "C<examples>"
35382 #: ../src/guestfs.pod:2817
35383 msgid "C API example code."
35387 #: ../src/guestfs.pod:2819
35392 #: ../src/guestfs.pod:2821
35394 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
35395 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
35396 "L<virt-tar-out(1)>."
35400 #: ../src/guestfs.pod:2825
35405 #: ../src/guestfs.pod:2827
35406 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
35410 #: ../src/guestfs.pod:2829
35411 msgid "C<generator>"
35415 #: ../src/guestfs.pod:2831
35417 "The crucially important generator, used to automatically generate large "
35418 "amounts of boilerplate C code for things like RPC and bindings."
35422 #: ../src/guestfs.pod:2834
35427 #: ../src/guestfs.pod:2836
35428 msgid "Files used by the test suite."
35432 #: ../src/guestfs.pod:2838
35433 msgid "Some \"phony\" guest images which we test against."
35437 #: ../src/guestfs.pod:2840
35438 msgid "C<inspector>"
35442 #: ../src/guestfs.pod:2842
35443 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
35447 #: ../src/guestfs.pod:2844
35452 #: ../src/guestfs.pod:2846
35453 msgid "Logo used on the website. The fish is called Arthur by the way."
35457 #: ../src/guestfs.pod:2848
35462 #: ../src/guestfs.pod:2850
35463 msgid "M4 macros used by autoconf."
35467 #: ../src/guestfs.pod:2852
35472 #: ../src/guestfs.pod:2854
35473 msgid "Translations of simple gettext strings."
35477 #: ../src/guestfs.pod:2856
35482 #: ../src/guestfs.pod:2858
35484 "The build infrastructure and PO files for translations of manpages and POD "
35485 "files. Eventually this will be combined with the C<po> directory, but that "
35486 "is rather complicated."
35490 #: ../src/guestfs.pod:2862
35491 msgid "C<regressions>"
35495 #: ../src/guestfs.pod:2864
35496 msgid "Regression tests."
35500 #: ../src/guestfs.pod:2866
35505 #: ../src/guestfs.pod:2868
35506 msgid "L<virt-rescue(1)> command and documentation."
35510 #: ../src/guestfs.pod:2870
35515 #: ../src/guestfs.pod:2872
35516 msgid "Source code to the C library."
35520 #: ../src/guestfs.pod:2874
35525 #: ../src/guestfs.pod:2876
35526 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
35530 #: ../src/guestfs.pod:2878
35531 msgid "C<test-tool>"
35535 #: ../src/guestfs.pod:2880
35537 "Test tool for end users to test if their qemu/kernel combination will work "
35542 #: ../src/guestfs.pod:2883
35547 #: ../src/guestfs.pod:2885
35552 #: ../src/guestfs.pod:2887
35557 #: ../src/guestfs.pod:2889
35562 #: ../src/guestfs.pod:2891
35567 #: ../src/guestfs.pod:2893
35572 #: ../src/guestfs.pod:2895
35577 #: ../src/guestfs.pod:2897
35582 #: ../src/guestfs.pod:2899
35583 msgid "Language bindings."
35587 #: ../src/guestfs.pod:2903
35588 msgid "MAKING A STABLE RELEASE"
35592 #: ../src/guestfs.pod:2905
35594 "When we make a stable release, there are several steps documented here. See "
35595 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
35600 #: ../src/guestfs.pod:2913
35601 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
35605 #: ../src/guestfs.pod:2918
35606 msgid "Finalize RELEASE-NOTES."
35610 #: ../src/guestfs.pod:2922
35611 msgid "Update ROADMAP."
35615 #: ../src/guestfs.pod:2926
35616 msgid "Run C<src/api-support/update-from-tarballs.sh>."
35620 #: ../src/guestfs.pod:2930
35621 msgid "Push and pull from Transifex."
35625 #: ../src/guestfs.pod:2932
35630 #: ../src/guestfs.pod:2934
35638 #: ../src/guestfs.pod:2936
35639 msgid "to push the latest POT files to Transifex. Then run:"
35643 #: ../src/guestfs.pod:2938
35651 #: ../src/guestfs.pod:2940
35652 msgid "which is a wrapper to pull the latest translated C<*.po> files."
35656 #: ../src/guestfs.pod:2944
35658 "Create new stable and development directories under "
35659 "L<http://libguestfs.org/download>."
35663 #: ../src/guestfs.pod:2949
35664 msgid "Create the branch in git:"
35668 #: ../src/guestfs.pod:2951
35671 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
35672 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
35673 " git branch stable-1.XX\n"
35674 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
35679 #: ../src/guestfs.pod:2958
35684 #: ../src/guestfs.pod:2960
35685 msgid "PROTOCOL LIMITS"
35689 #: ../src/guestfs.pod:2962
35691 "Internally libguestfs uses a message-based protocol to pass API calls and "
35692 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
35693 "plenty more detail about this). The maximum message size used by the "
35694 "protocol is slightly less than 4 MB. For some API calls you may need to be "
35695 "aware of this limit. The API calls which may be affected are individually "
35696 "documented, with a link back to this section of the documentation."
35700 #: ../src/guestfs.pod:2970
35702 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
35703 "a simple string. Because this string is at some point internally encoded as "
35704 "a message, the maximum size that it can return is slightly under 4 MB. If "
35705 "the requested file is larger than this then you will get an error."
35709 #: ../src/guestfs.pod:2976
35711 "In order to transfer large files into and out of the guest filesystem, you "
35712 "need to use particular calls that support this. The sections L</UPLOADING> "
35713 "and L</DOWNLOADING> document how to do this."
35717 #: ../src/guestfs.pod:2980
35719 "You might also consider mounting the disk image using our FUSE filesystem "
35720 "support (L<guestmount(1)>)."
35724 #: ../src/guestfs.pod:2983
35725 msgid "MAXIMUM NUMBER OF DISKS"
35729 #: ../src/guestfs.pod:2985
35730 msgid "When using virtio disks (the default) the current limit is B<25> disks."
35734 #: ../src/guestfs.pod:2988
35736 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
35737 "slots. However febootstrap only understands disks with names C</dev/vda> "
35738 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
35743 #: ../src/guestfs.pod:2993
35745 "We are working to substantially raise this limit in future versions but it "
35746 "requires complex changes to qemu."
35750 #: ../src/guestfs.pod:2996
35752 "In future versions of libguestfs it should also be possible to \"hot plug\" "
35753 "disks (add and remove disks after calling L</guestfs_launch>). This also "
35754 "requires changes to qemu."
35758 #: ../src/guestfs.pod:3000
35759 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
35763 #: ../src/guestfs.pod:3002
35764 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
35768 #: ../src/guestfs.pod:3004
35770 "This is because it reserves 4 bits for the minor device number (thus "
35771 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
35775 #: ../src/guestfs.pod:3007
35777 "If you attach a disk with more than 15 partitions, the extra partitions are "
35778 "ignored by libguestfs."
35782 #: ../src/guestfs.pod:3010
35783 msgid "MAXIMUM SIZE OF A DISK"
35787 #: ../src/guestfs.pod:3012
35788 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
35792 #: ../src/guestfs.pod:3014
35794 "We have tested block devices up to 1 exabyte (2**60 or "
35795 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
35800 #: ../src/guestfs.pod:3018
35802 "Although libguestfs probably does not impose any limit, the underlying host "
35803 "storage will. If you store disk images on a host ext4 filesystem, then the "
35804 "maximum size will be limited by the maximum ext4 file size (currently 16 "
35805 "TB). If you store disk images as host logical volumes then you are limited "
35806 "by the maximum size of an LV."
35810 #: ../src/guestfs.pod:3024
35812 "For the hugest disk image files, we recommend using XFS on the host for "
35817 #: ../src/guestfs.pod:3027
35818 msgid "MAXIMUM SIZE OF A PARTITION"
35822 #: ../src/guestfs.pod:3029
35824 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
35825 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
35826 "address a partition located beyond 2 TB on the disk."
35830 #: ../src/guestfs.pod:3033
35832 "It is recommended that you use GPT partitions on disks which are larger than "
35833 "this size. GPT uses 64 bit sector numbers and so can address partitions "
35834 "which are theoretically larger than the largest disk we could support."
35838 #: ../src/guestfs.pod:3038
35839 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
35843 #: ../src/guestfs.pod:3040
35845 "This depends on the filesystem type. libguestfs itself does not impose any "
35846 "known limit. Consult Wikipedia or the filesystem documentation to find out "
35847 "what these limits are."
35851 #: ../src/guestfs.pod:3044
35852 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
35856 #: ../src/guestfs.pod:3046
35858 "The API functions L</guestfs_upload>, L</guestfs_download>, "
35859 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
35860 "uploads and downloads."
35864 #: ../src/guestfs.pod:3050
35865 msgid "INSPECTION LIMITS"
35869 #: ../src/guestfs.pod:3052
35871 "The inspection code has several arbitrary limits on things like the size of "
35872 "Windows Registry hive it will read, and the length of product name. These "
35873 "are intended to stop a malicious guest from consuming arbitrary amounts of "
35874 "memory and disk space on the host, and should not be reached in practice. "
35875 "See the source code for more information."
35879 #: ../src/guestfs.pod:3078
35881 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
35882 "effect as calling C<guestfs_set_verbose (g, 1)>."
35886 #: ../src/guestfs.pod:3090
35888 "Set the path that libguestfs uses to search for a supermin appliance. See "
35889 "the discussion of paths in section L</PATH> above."
35893 #: ../src/guestfs.pod:3099
35894 msgid "See also L</QEMU WRAPPERS> above."
35898 #: ../src/guestfs.pod:3103
35900 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
35901 "effect as calling C<guestfs_set_trace (g, 1)>."
35905 #: ../src/guestfs.pod:3121
35907 "L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
35908 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
35909 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
35910 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
35911 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
35912 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
35913 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
35914 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
35915 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
35919 #: ../src/guestfs.pod:3151
35921 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
35922 "L<lvm(8)>, L<disktype(1)>."
35926 #: ../src/guestfs.pod:3158 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
35931 #: ../src/guestfs.pod:3160
35932 msgid "To get a list of bugs against libguestfs use this link:"
35936 #: ../src/guestfs.pod:3162
35937 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
35941 #: ../src/guestfs.pod:3164
35942 msgid "To report a new bug against libguestfs use this link:"
35946 #: ../src/guestfs.pod:3166
35947 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
35951 #: ../src/guestfs.pod:3168
35952 msgid "When reporting a bug, please check:"
35956 #: ../src/guestfs.pod:3174
35957 msgid "That the bug hasn't been reported already."
35961 #: ../src/guestfs.pod:3178
35962 msgid "That you are testing a recent version."
35966 #: ../src/guestfs.pod:3182
35967 msgid "Describe the bug accurately, and give a way to reproduce it."
35971 #: ../src/guestfs.pod:3186
35973 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
35978 #: ../test-tool/libguestfs-test-tool.pod:5
35979 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
35983 #: ../test-tool/libguestfs-test-tool.pod:9
35986 " libguestfs-test-tool [--options]\n"
35991 #: ../test-tool/libguestfs-test-tool.pod:13
35993 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
35994 "to check basic libguestfs functionality is working. This is needed because "
35995 "libguestfs occasionally breaks for reasons beyond our control: usually "
35996 "because of changes in the underlying qemu or kernel packages, or the host "
36001 #: ../test-tool/libguestfs-test-tool.pod:19
36002 msgid "If you suspect a problem in libguestfs, then just run:"
36006 #: ../test-tool/libguestfs-test-tool.pod:21
36009 " libguestfs-test-tool\n"
36014 #: ../test-tool/libguestfs-test-tool.pod:23
36015 msgid "It will print lots of diagnostic messages."
36019 #: ../test-tool/libguestfs-test-tool.pod:25
36020 msgid "If it runs to completion successfully, you will see this near the end:"
36024 #: ../test-tool/libguestfs-test-tool.pod:27
36027 " ===== TEST FINISHED OK =====\n"
36032 #: ../test-tool/libguestfs-test-tool.pod:29
36033 msgid "and the test tool will exit with code 0."
36037 #: ../test-tool/libguestfs-test-tool.pod:31
36039 "If it fails (and/or exits with non-zero error code), please paste the "
36040 "I<complete, unedited> output of the test tool into a bug report. More "
36041 "information about reporting bugs can be found on the "
36042 "L<http://libguestfs.org/> website."
36046 #: ../test-tool/libguestfs-test-tool.pod:42
36047 msgid "Display short usage information and exit."
36051 #: ../test-tool/libguestfs-test-tool.pod:44
36052 msgid "B<--qemu qemu_binary>"
36056 #: ../test-tool/libguestfs-test-tool.pod:46
36058 "If you have downloaded another qemu binary, point this option at the full "
36059 "path of the binary to try it."
36063 #: ../test-tool/libguestfs-test-tool.pod:49
36064 msgid "B<--qemudir qemu_source_dir>"
36068 #: ../test-tool/libguestfs-test-tool.pod:51
36070 "If you have compiled qemu from source, point this option at the source "
36071 "directory to try it."
36075 #: ../test-tool/libguestfs-test-tool.pod:54
36080 #: ../test-tool/libguestfs-test-tool.pod:56
36081 msgid "B<--timeout N>"
36085 #: ../test-tool/libguestfs-test-tool.pod:58
36087 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
36088 "minutes) which does not usually need to be adjusted."
36092 #: ../test-tool/libguestfs-test-tool.pod:63
36093 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
36097 #: ../test-tool/libguestfs-test-tool.pod:65
36099 "If you have compiled another version of qemu from source and would like to "
36100 "try that, then you can use the I<--qemudir> option to point to the qemu "
36101 "source directory."
36105 #: ../test-tool/libguestfs-test-tool.pod:69
36107 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
36108 "option to point to the binary."
36112 #: ../test-tool/libguestfs-test-tool.pod:72
36114 "Note when using these options, you can ignore the business of qemu wrapper "
36115 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
36116 "wrapper script for you if one is needed."
36120 #: ../test-tool/libguestfs-test-tool.pod:76
36121 msgid "TRYING OUT A DIFFERENT KERNEL"
36125 #: ../test-tool/libguestfs-test-tool.pod:78
36127 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
36128 "libguestfs tries. You do this by setting the environment variables "
36129 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
36133 #: ../test-tool/libguestfs-test-tool.pod:82
36135 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
36140 #: ../test-tool/libguestfs-test-tool.pod:85
36141 msgid "SELF-DIAGNOSIS"
36145 #: ../test-tool/libguestfs-test-tool.pod:87
36147 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
36148 "produced by libguestfs-test-tool and/or possible errors."
36152 #: ../test-tool/libguestfs-test-tool.pod:92
36154 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
36155 "I<1> if there was an error."
36159 #: ../test-tool/libguestfs-test-tool.pod:97
36161 "For the full list of environment variables which may affect libguestfs, "
36162 "please see the L<guestfs(3)> manual page."
36166 #: ../test-tool/libguestfs-test-tool.pod:102
36167 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
36171 #: ../tools/virt-list-filesystems.pl:32
36172 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
36176 #: ../tools/virt-list-filesystems.pl:36
36179 " virt-list-filesystems [--options] domname\n"
36184 #: ../tools/virt-list-filesystems.pl:38
36187 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
36192 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
36194 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
36199 #: ../tools/virt-list-filesystems.pl:45
36201 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
36202 "are contained in a virtual machine or disk image."
36206 #: ../tools/virt-list-filesystems.pl:49
36208 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
36209 "functionality. For more complex cases you should look at the "
36210 "L<guestfish(1)> tool."
36214 #: ../tools/virt-list-filesystems.pl:112
36216 "With this option, C<virt-list-filesystems> displays the type of each "
36217 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
36221 #: ../tools/virt-list-filesystems.pl:119
36226 #: ../tools/virt-list-filesystems.pl:123
36228 "Normally we only show mountable filesystems. If this option is given then "
36229 "swap devices are shown too."
36233 #: ../tools/virt-list-filesystems.pl:197
36235 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
36236 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
36237 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36241 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
36242 msgid "Copyright (C) 2009 Red Hat Inc."
36246 #: ../tools/virt-list-partitions.pl:32
36247 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
36251 #: ../tools/virt-list-partitions.pl:36
36254 " virt-list-partitions [--options] domname\n"
36259 #: ../tools/virt-list-partitions.pl:38
36262 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
36267 #: ../tools/virt-list-partitions.pl:45
36269 "C<virt-list-partitions> is a command line tool to list the partitions that "
36270 "are contained in a virtual machine or disk image. It is mainly useful as a "
36271 "first step to using L<virt-resize(1)>."
36275 #: ../tools/virt-list-partitions.pl:50
36277 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
36278 "functionality. For more complex cases you should look at the "
36279 "L<guestfish(1)> tool."
36283 #: ../tools/virt-list-partitions.pl:113
36284 msgid "Show sizes in human-readable form (eg. \"1G\")."
36288 #: ../tools/virt-list-partitions.pl:123
36290 "With this option, C<virt-list-partitions> displays the type and size of each "
36291 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
36295 #: ../tools/virt-list-partitions.pl:130
36300 #: ../tools/virt-list-partitions.pl:132
36305 #: ../tools/virt-list-partitions.pl:134
36306 msgid "Display the total size of each block device (as a separate row or rows)."
36310 #: ../tools/virt-list-partitions.pl:267
36312 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
36313 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
36314 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36318 #: ../tools/virt-list-partitions.pl:283
36319 msgid "Copyright (C) 2009-2010 Red Hat Inc."
36323 #: ../tools/virt-make-fs.pl:37
36324 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
36328 #: ../tools/virt-make-fs.pl:41
36331 " virt-make-fs [--options] input.tar output.img\n"
36336 #: ../tools/virt-make-fs.pl:43
36339 " virt-make-fs [--options] input.tar.gz output.img\n"
36344 #: ../tools/virt-make-fs.pl:45
36347 " virt-make-fs [--options] directory output.img\n"
36352 #: ../tools/virt-make-fs.pl:49
36354 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
36355 "archive or some files in a directory. It is similar to tools like "
36356 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
36357 "it can create common filesystem types like ext2/3 or NTFS, which can be "
36358 "useful if you want to attach these filesystems to existing virtual machines "
36359 "(eg. to import large amounts of read-only data to a VM)."
36363 #: ../tools/virt-make-fs.pl:57
36364 msgid "Basic usage is:"
36368 #: ../tools/virt-make-fs.pl:59
36371 " virt-make-fs input output\n"
36376 #: ../tools/virt-make-fs.pl:61
36378 "where C<input> is either a directory containing files that you want to add, "
36379 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
36380 "C<output> is a disk image. The input type is detected automatically. The "
36381 "output disk image defaults to a raw ext2 image unless you specify extra "
36382 "flags (see L</OPTIONS> below)."
36386 #: ../tools/virt-make-fs.pl:67
36387 msgid "EXTRA SPACE"
36391 #: ../tools/virt-make-fs.pl:69
36393 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
36394 "the files that it contains, but might have extra space. Depending on how "
36395 "you are going to use the output, you might think this extra space is wasted "
36396 "and want to minimize it, or you might want to leave space so that more files "
36397 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
36398 "but you can use the I<--size> flag to leave space in the filesystem if you "
36403 #: ../tools/virt-make-fs.pl:77
36405 "An alternative way to leave extra space but not make the output image any "
36406 "bigger is to use an alternative disk image format (instead of the default "
36407 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
36408 "image format (check your hypervisor supports this before using it). This "
36409 "allows you to choose a large I<--size> but the extra space won't actually be "
36410 "allocated in the image until you try to store something in it."
36414 #: ../tools/virt-make-fs.pl:85
36416 "Don't forget that you can also use local commands including L<resize2fs(8)> "
36417 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
36418 "to build another image from scratch."
36422 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
36427 #: ../tools/virt-make-fs.pl:91
36430 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
36435 #: ../tools/virt-make-fs.pl:93
36436 msgid "FILESYSTEM TYPE"
36440 #: ../tools/virt-make-fs.pl:95
36442 "The default filesystem type is C<ext2>. Just about any filesystem type that "
36443 "libguestfs supports can be used (but I<not> read-only formats like "
36444 "ISO9660). Here are some of the more common choices:"
36448 #: ../tools/virt-make-fs.pl:101
36453 #: ../tools/virt-make-fs.pl:103
36455 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
36456 "you are not going to use the filesystem in a way that requires the journal, "
36457 "then this is just wasted overhead."
36461 #: ../tools/virt-make-fs.pl:107
36462 msgid "I<ntfs> or I<vfat>"
36466 #: ../tools/virt-make-fs.pl:109
36467 msgid "Useful if exporting data to a Windows guest."
36471 #: ../tools/virt-make-fs.pl:111
36473 "I<Note for vfat>: The tar archive or local directory must only contain files "
36474 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
36475 "program running within libguestfs is unable to change the ownership of "
36476 "non-root files, since vfat itself does not support this."
36480 #: ../tools/virt-make-fs.pl:116
36485 #: ../tools/virt-make-fs.pl:118
36487 "Lower overhead than C<ext2>, but certain limitations on filename length and "
36488 "total filesystem size."
36492 #: ../tools/virt-make-fs.pl:125
36495 " virt-make-fs --type=minix input minixfs.img\n"
36500 #: ../tools/virt-make-fs.pl:127
36501 msgid "TO PARTITION OR NOT TO PARTITION"
36505 #: ../tools/virt-make-fs.pl:129
36506 msgid "Optionally virt-make-fs can add a partition table to the output disk."
36510 #: ../tools/virt-make-fs.pl:131
36512 "Adding a partition can make the disk image more compatible with certain "
36513 "virtualized operating systems which don't expect to see a filesystem "
36514 "directly located on a block device (Linux doesn't care and will happily "
36515 "handle both types)."
36519 #: ../tools/virt-make-fs.pl:136
36521 "On the other hand, if you have a partition table then the output image is no "
36522 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
36523 "directly on a partitioned disk image. (However libguestfs tools such as "
36524 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
36528 #: ../tools/virt-make-fs.pl:144
36529 msgid "Add an MBR partition:"
36533 #: ../tools/virt-make-fs.pl:146
36536 " virt-make-fs --partition -- input disk.img\n"
36541 #: ../tools/virt-make-fs.pl:148
36543 "If the output disk image could be terabyte-sized or larger, it's better to "
36544 "use an EFI/GPT-compatible partition table:"
36548 #: ../tools/virt-make-fs.pl:151
36551 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
36556 #: ../tools/virt-make-fs.pl:179
36557 msgid "Enable debugging information."
36561 #: ../tools/virt-make-fs.pl:185
36562 msgid "B<--size=E<lt>NE<gt>>"
36566 #: ../tools/virt-make-fs.pl:187
36567 msgid "B<--size=+E<lt>NE<gt>>"
36571 #: ../tools/virt-make-fs.pl:189
36572 msgid "B<-s E<lt>NE<gt>>"
36576 #: ../tools/virt-make-fs.pl:191
36577 msgid "B<-s +E<lt>NE<gt>>"
36581 #: ../tools/virt-make-fs.pl:193
36582 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
36586 #: ../tools/virt-make-fs.pl:196
36588 "If this option is I<not> given, then the output image will be just large "
36589 "enough to contain all the files, with not much wasted space."
36593 #: ../tools/virt-make-fs.pl:199
36595 "To choose a fixed size output disk, specify an absolute number followed by "
36596 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
36597 "Petabytes or Exabytes. This must be large enough to contain all the input "
36598 "files, else you will get an error."
36602 #: ../tools/virt-make-fs.pl:204
36604 "To leave extra space, specify C<+> (plus sign) and a number followed by "
36605 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
36606 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
36607 "the input files, and (approximately) an extra 200 MB free space."
36611 #: ../tools/virt-make-fs.pl:210
36613 "Note that virt-make-fs estimates free space, and therefore will not produce "
36614 "filesystems containing precisely the free space requested. (It is much more "
36615 "expensive and time-consuming to produce a filesystem which has precisely the "
36616 "desired free space)."
36620 #: ../tools/virt-make-fs.pl:219
36621 msgid "B<--format=E<lt>fmtE<gt>>"
36625 #: ../tools/virt-make-fs.pl:221
36626 msgid "B<-F E<lt>fmtE<gt>>"
36630 #: ../tools/virt-make-fs.pl:223
36631 msgid "Choose the output disk image format."
36635 #: ../tools/virt-make-fs.pl:225
36636 msgid "The default is C<raw> (raw disk image)."
36640 #: ../tools/virt-make-fs.pl:227
36642 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
36643 "that would really make sense here is C<qcow2>."
36647 #: ../tools/virt-make-fs.pl:234
36648 msgid "B<--type=E<lt>fsE<gt>>"
36652 #: ../tools/virt-make-fs.pl:236
36653 msgid "B<-t E<lt>fsE<gt>>"
36657 #: ../tools/virt-make-fs.pl:238
36658 msgid "Choose the output filesystem type."
36662 #: ../tools/virt-make-fs.pl:240
36663 msgid "The default is C<ext2>."
36667 #: ../tools/virt-make-fs.pl:242
36668 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
36672 #: ../tools/virt-make-fs.pl:249
36673 msgid "B<--partition>"
36677 #: ../tools/virt-make-fs.pl:251
36678 msgid "B<--partition=E<lt>parttypeE<gt>>"
36682 #: ../tools/virt-make-fs.pl:253
36684 "If specified, this flag adds an MBR partition table to the output disk "
36689 #: ../tools/virt-make-fs.pl:256
36691 "You can change the partition table type, eg. I<--partition=gpt> for large "
36696 #: ../tools/virt-make-fs.pl:259
36698 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
36699 "might consider the next parameter to be the partition type. For example:"
36703 #: ../tools/virt-make-fs.pl:263
36706 " virt-make-fs --partition input.tar ...\n"
36711 #: ../tools/virt-make-fs.pl:265
36713 "would cause virt-make-fs to think you wanted to use a partition type of "
36714 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
36715 "dash) between options and the input file argument:"
36719 #: ../tools/virt-make-fs.pl:269
36722 " virt-make-fs --partition -- input.tar ...\n"
36727 #: ../tools/virt-make-fs.pl:541
36729 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
36730 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
36731 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
36735 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
36737 "When reporting bugs, please enable debugging and capture the I<complete> "
36742 #: ../tools/virt-make-fs.pl:558
36745 " export LIBGUESTFS_DEBUG=1\n"
36746 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
36751 #: ../tools/virt-make-fs.pl:561
36753 "Attach /tmp/virt-make-fs.log to a new bug report at "
36754 "L<https://bugzilla.redhat.com/>"
36758 #: ../tools/virt-tar.pl:33
36759 msgid "virt-tar - Extract or upload files to a virtual machine"
36763 #: ../tools/virt-tar.pl:37
36766 " virt-tar [--options] -x domname directory tarball\n"
36771 #: ../tools/virt-tar.pl:39
36774 " virt-tar [--options] -u domname tarball directory\n"
36779 #: ../tools/virt-tar.pl:41
36782 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
36787 #: ../tools/virt-tar.pl:43
36790 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
36795 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
36800 #: ../tools/virt-tar.pl:47
36802 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
36803 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
36807 #: ../tools/virt-tar.pl:52
36808 msgid "Download C</home> from the VM into a local tarball:"
36812 #: ../tools/virt-tar.pl:54
36815 " virt-tar -x domname /home home.tar\n"
36820 #: ../tools/virt-tar.pl:56
36823 " virt-tar -zx domname /home home.tar.gz\n"
36828 #: ../tools/virt-tar.pl:58
36829 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
36833 #: ../tools/virt-tar.pl:60
36836 " virt-tar -u domname uploadstuff.tar /tmp\n"
36841 #: ../tools/virt-tar.pl:62
36844 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
36849 #: ../tools/virt-tar.pl:66
36851 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
36852 "virtual machines. If you do this, you risk disk corruption in the VM. "
36853 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
36857 #: ../tools/virt-tar.pl:71
36859 "You can use I<-x> (extract) on live virtual machines, but you might get "
36860 "inconsistent results or errors if there is filesystem activity inside the "
36861 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
36862 "work, but the only way to guarantee consistent results is if the virtual "
36863 "machine is shut down."
36867 #: ../tools/virt-tar.pl:79
36869 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
36870 "parts of a guest filesystem. There are many possibilities: making backups, "
36871 "uploading data files, snooping on guest activity, fixing or customizing "
36876 #: ../tools/virt-tar.pl:84
36878 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
36879 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
36880 "should look at the L<guestfish(1)> tool."
36884 #: ../tools/virt-tar.pl:88
36886 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
36887 "its contents (recursively) from the virtual machine into a local tarball. "
36888 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
36889 "virtual machine. You cannot use these two options together."
36893 #: ../tools/virt-tar.pl:94
36895 "In addition, you may need to use the I<-z> (gZip) option to enable "
36896 "compression. When uploading, you have to specify I<-z> if the upload file "
36897 "is compressed because virt-tar won't detect this on its own."
36901 #: ../tools/virt-tar.pl:98
36903 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
36904 "example it cannot do PKZip files or bzip2 compression. If you want that "
36905 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
36906 "the L<libguestfs(3)> API)."
36910 #: ../tools/virt-tar.pl:160
36911 msgid "B<--extract>"
36915 #: ../tools/virt-tar.pl:162
36916 msgid "B<--download>"
36920 #: ../tools/virt-tar.pl:164
36925 #: ../tools/virt-tar.pl:166
36926 msgid "B<--upload>"
36930 #: ../tools/virt-tar.pl:168
36932 "Use I<-x> to extract (download) a directory from a virtual machine to a "
36937 #: ../tools/virt-tar.pl:171
36939 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
36940 "Please read the L</WARNING> section above before using this option."
36944 #: ../tools/virt-tar.pl:175
36945 msgid "You must specify exactly one of these options."
36949 #: ../tools/virt-tar.pl:181
36954 #: ../tools/virt-tar.pl:183
36959 #: ../tools/virt-tar.pl:185
36960 msgid "Specify that the input or output tarball is gzip-compressed."
36964 #: ../tools/virt-tar.pl:298
36966 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
36967 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
36968 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
36969 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36973 #: ../tools/virt-win-reg.pl:37
36975 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
36980 #: ../tools/virt-win-reg.pl:41
36983 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
36988 #: ../tools/virt-win-reg.pl:43
36991 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
36996 #: ../tools/virt-win-reg.pl:45
36999 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
37004 #: ../tools/virt-win-reg.pl:47
37007 " virt-win-reg --merge domname [input.reg ...]\n"
37012 #: ../tools/virt-win-reg.pl:49
37015 " virt-win-reg [--options] disk.img ... # instead of domname\n"
37020 #: ../tools/virt-win-reg.pl:53
37022 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
37023 "virtual machines. If you do this, you I<will> get irreversible disk "
37024 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
37025 "but doesn't catch all cases."
37029 #: ../tools/virt-win-reg.pl:58
37031 "Modifying the Windows Registry is an inherently risky operation. The format "
37032 "is deliberately obscure and undocumented, and Registry changes can leave the "
37033 "system unbootable. Therefore when using the I<--merge> option, make sure "
37034 "you have a reliable backup first."
37038 #: ../tools/virt-win-reg.pl:65
37040 "This program can export and merge Windows Registry entries from a Windows "
37045 #: ../tools/virt-win-reg.pl:68
37047 "The first parameter is the libvirt guest name or the raw disk image of a "
37052 #: ../tools/virt-win-reg.pl:71
37054 "If I<--merge> is I<not> specified, then the chosen registry key is "
37055 "displayed/exported (recursively). For example:"
37059 #: ../tools/virt-win-reg.pl:74
37062 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
37067 #: ../tools/virt-win-reg.pl:76
37068 msgid "You can also display single values from within registry keys, for example:"
37072 #: ../tools/virt-win-reg.pl:79
37075 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
37076 " $ virt-win-reg Windows7 $cvkey ProductName\n"
37077 " Windows 7 Enterprise\n"
37082 #: ../tools/virt-win-reg.pl:83
37084 "With I<--merge>, you can merge a textual regedit file into the Windows "
37089 #: ../tools/virt-win-reg.pl:86
37092 " $ virt-win-reg --merge Windows7 changes.reg\n"
37097 #: ../tools/virt-win-reg.pl:90
37099 "This program is only meant for simple access to the registry. If you want "
37100 "to do complicated things with the registry, we suggest you download the "
37101 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
37102 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
37103 "L<hivexregedit(1)>."
37107 #: ../tools/virt-win-reg.pl:159
37112 #: ../tools/virt-win-reg.pl:161
37114 "In merge mode, this merges a textual regedit file into the Windows Registry "
37115 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
37116 "displays or exports Registry entries instead."
37120 #: ../tools/virt-win-reg.pl:165
37122 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
37123 "result in disk corruption. However exporting (without this flag) is always "
37128 #: ../tools/virt-win-reg.pl:173
37129 msgid "B<--encoding> UTF-16LE|ASCII"
37133 #: ../tools/virt-win-reg.pl:175
37135 "When merging (only), you may need to specify the encoding for strings to be "
37136 "used in the hive file. This is explained in detail in "
37137 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
37141 #: ../tools/virt-win-reg.pl:179
37143 "The default is to use UTF-16LE, which should work with recent versions of "
37148 #: ../tools/virt-win-reg.pl:186
37149 msgid "B<--unsafe-printable-strings>"
37153 #: ../tools/virt-win-reg.pl:188
37155 "When exporting (only), assume strings are UTF-16LE and print them as strings "
37156 "instead of hex sequences. Remove the final zero codepoint from strings if "
37161 #: ../tools/virt-win-reg.pl:192
37163 "This is unsafe and does not preserve the fidelity of strings in the original "
37164 "Registry for various reasons:"
37168 #: ../tools/virt-win-reg.pl:199
37170 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
37171 "other encodings will be corrupted by this transformation."
37175 #: ../tools/virt-win-reg.pl:204
37177 "Assumes that everything which has type 1 or 2 is really a string and that "
37178 "everything else is not a string, but the type field in real Registries is "
37183 #: ../tools/virt-win-reg.pl:210
37185 "Loses information about whether a zero codepoint followed the string in the "
37190 #: ../tools/virt-win-reg.pl:215
37192 "This all happens because the Registry itself contains no information about "
37193 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
37197 #: ../tools/virt-win-reg.pl:219
37199 "You should only use this option for quick hacking and debugging of the "
37200 "Registry contents, and I<never> use it if the output is going to be passed "
37201 "into another program or stored in another Registry."
37205 #: ../tools/virt-win-reg.pl:556
37206 msgid "SUPPORTED SYSTEMS"
37210 #: ../tools/virt-win-reg.pl:558
37212 "The program currently supports Windows NT-derived guests starting with "
37213 "Windows XP through to at least Windows 7."
37217 #: ../tools/virt-win-reg.pl:561
37218 msgid "The following Registry keys are supported:"
37222 #: ../tools/virt-win-reg.pl:565
37223 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
37227 #: ../tools/virt-win-reg.pl:567
37228 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
37232 #: ../tools/virt-win-reg.pl:569
37233 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
37237 #: ../tools/virt-win-reg.pl:571
37238 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
37242 #: ../tools/virt-win-reg.pl:573
37243 msgid "C<HKEY_USERS\\.DEFAULT>"
37247 #: ../tools/virt-win-reg.pl:575
37248 msgid "C<HKEY_USERS\\I<SID>>"
37252 #: ../tools/virt-win-reg.pl:577
37253 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
37257 #: ../tools/virt-win-reg.pl:579
37258 msgid "C<HKEY_USERS\\I<username>>"
37262 #: ../tools/virt-win-reg.pl:581
37263 msgid "where I<username> is a local user name (this is a libguestfs extension)."
37267 #: ../tools/virt-win-reg.pl:585
37269 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
37274 #: ../tools/virt-win-reg.pl:588
37276 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
37277 "supported (there is no \"current user\")."
37281 #: ../tools/virt-win-reg.pl:591
37286 #: ../tools/virt-win-reg.pl:593
37288 "C<virt-win-reg> expects that regedit files have already been reencoded in "
37289 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
37290 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
37291 "with Windows-style line endings, you may need to reencode the whole file "
37292 "before or after processing."
37296 #: ../tools/virt-win-reg.pl:599
37298 "To reencode a file from Windows format to Linux (before processing it with "
37299 "the I<--merge> option), you would do something like this:"
37303 #: ../tools/virt-win-reg.pl:602
37306 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
37311 #: ../tools/virt-win-reg.pl:604
37313 "To go in the opposite direction, after exporting and before sending the file "
37314 "to a Windows user, do something like this:"
37318 #: ../tools/virt-win-reg.pl:607
37321 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
37326 #: ../tools/virt-win-reg.pl:609
37327 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
37331 #: ../tools/virt-win-reg.pl:611
37333 "If you are unsure about the current encoding, use the L<file(1)> command. "
37334 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
37335 "Windows-style (CRLF) line endings, like this:"
37339 #: ../tools/virt-win-reg.pl:615
37342 " $ file software.reg\n"
37343 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
37344 " with CRLF line terminators\n"
37349 #: ../tools/virt-win-reg.pl:619
37350 msgid "This file would need conversion before you could I<--merge> it."
37354 #: ../tools/virt-win-reg.pl:621
37355 msgid "CurrentControlSet etc."
37359 #: ../tools/virt-win-reg.pl:623
37361 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
37362 "Registry at the level of the hive file, and therefore you cannot modify "
37367 #: ../tools/virt-win-reg.pl:627
37369 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
37370 "circumstances it might refer to another control set. The way to find out is "
37371 "to look at the C<HKLM\\SYSTEM\\Select> key:"
37375 #: ../tools/virt-win-reg.pl:631
37378 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
37379 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
37380 " \"Current\"=dword:00000001\n"
37381 " \"Default\"=dword:00000001\n"
37382 " \"Failed\"=dword:00000000\n"
37383 " \"LastKnownGood\"=dword:00000002\n"
37388 #: ../tools/virt-win-reg.pl:638
37389 msgid "\"Current\" is the one which Windows will choose when it boots."
37393 #: ../tools/virt-win-reg.pl:640
37394 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
37398 #: ../tools/virt-win-reg.pl:643
37399 msgid "WINDOWS TIPS"
37403 #: ../tools/virt-win-reg.pl:645
37405 "Note that some of these tips modify the guest disk image. The guest I<must> "
37406 "be shut off, else you will get disk corruption."
37410 #: ../tools/virt-win-reg.pl:648
37411 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
37415 #: ../tools/virt-win-reg.pl:650
37417 "Prepare a DOS batch script, VBScript or executable. Upload this using "
37418 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
37419 "is uploaded into C<C:\\>:"
37423 #: ../tools/virt-win-reg.pl:654
37426 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
37431 #: ../tools/virt-win-reg.pl:656
37432 msgid "Prepare a regedit file containing the registry change:"
37436 #: ../tools/virt-win-reg.pl:658
37439 " cat > test.reg <<'EOF'\n"
37440 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
37441 " \"Test\"=\"c:\\\\test.bat\"\n"
37447 #: ../tools/virt-win-reg.pl:663
37449 "In this example we use the key C<RunOnce> which means that the script will "
37450 "run precisely once when the first user logs in. If you want it to run every "
37451 "time a user logs in, replace C<RunOnce> with C<Run>."
37455 #: ../tools/virt-win-reg.pl:667
37456 msgid "Now update the registry:"
37460 #: ../tools/virt-win-reg.pl:669
37463 " virt-win-reg --merge WindowsGuest test.reg\n"
37468 #: ../tools/virt-win-reg.pl:671
37469 msgid "INSTALLING A SERVICE"
37473 #: ../tools/virt-win-reg.pl:673
37475 "This section assumes you are familiar with Windows services, and you either "
37476 "have a program which handles the Windows Service Control Protocol directly "
37477 "or you want to run any program using a service wrapper like SrvAny or the "
37482 #: ../tools/virt-win-reg.pl:678
37484 "First upload the program and optionally the service wrapper. In this case "
37485 "the test program is called C<test.exe> and we are using the RHSrvAny "
37490 #: ../tools/virt-win-reg.pl:682
37493 " guestfish -i -d WindowsGuest <<EOF\n"
37494 " upload rhsrvany.exe /rhsrvany.exe\n"
37495 " upload test.exe /test.exe\n"
37501 #: ../tools/virt-win-reg.pl:687
37503 "Prepare a regedit file containing the registry changes. In this example, "
37504 "the first registry change is needed for the service itself or the service "
37505 "wrapper (if used). The second registry change is only needed because I am "
37506 "using the RHSrvAny service wrapper."
37510 #: ../tools/virt-win-reg.pl:692
37513 " cat > service.reg <<'EOF'\n"
37514 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
37515 " \"Type\"=dword:00000010\n"
37516 " \"Start\"=dword:00000002\n"
37517 " \"ErrorControl\"=dword:00000001\n"
37518 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
37519 " \"DisplayName\"=\"RHSrvAny\"\n"
37520 " \"ObjectName\"=\"NetworkService\"\n"
37525 #: ../tools/virt-win-reg.pl:701
37528 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
37529 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
37530 " \"PWD\"=\"c:\\\\Temp\"\n"
37536 #: ../tools/virt-win-reg.pl:712
37538 "For use of C<ControlSet001> see the section above in this manual page. You "
37539 "may need to adjust this according to the control set that is in use by the "
37544 #: ../tools/virt-win-reg.pl:718
37546 "C<\"ObjectName\"> controls the privileges that the service will have. An "
37547 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
37548 "privileged account."
37552 #: ../tools/virt-win-reg.pl:724
37554 "For the meaning of the magic numbers, see this Microsoft KB article: "
37555 "L<http://support.microsoft.com/kb/103000>."
37559 #: ../tools/virt-win-reg.pl:729
37560 msgid "Update the registry:"
37564 #: ../tools/virt-win-reg.pl:731
37567 " virt-win-reg --merge WindowsGuest service.reg\n"
37572 #: ../tools/virt-win-reg.pl:735
37574 "Be careful when passing parameters containing C<\\> (backslash) in the "
37575 "shell. Usually you will have to use 'single quotes' or double backslashes "
37576 "(but not both) to protect them from the shell."
37580 #: ../tools/virt-win-reg.pl:739
37581 msgid "Paths and value names are case-insensitive."
37585 #: ../tools/virt-win-reg.pl:748
37587 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
37588 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
37589 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
37590 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37594 #: ../tools/virt-win-reg.pl:766
37597 " export LIBGUESTFS_DEBUG=1\n"
37598 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
37603 #: ../tools/virt-win-reg.pl:769
37605 "Attach /tmp/virt-win-reg.log to a new bug report at "
37606 "L<https://bugzilla.redhat.com/>"