1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.13.9\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-08-26 22:52+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:37 ../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 ../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:335 ../rescue/virt-rescue.pod:133 ../src/guestfs.pod:2668
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 to edit, and C<file> is the full path to the file."
493 #: ../cat/virt-cat.pod:192 ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:349 ../rescue/virt-rescue.pod:262 ../resize/virt-resize.pod:601 ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532 ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
494 msgid "SHELL QUOTING"
498 #: ../cat/virt-cat.pod:194 ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:351 ../rescue/virt-rescue.pod:264 ../resize/virt-resize.pod:603 ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534 ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
500 "Libvirt guest names can contain arbitrary characters, some of which have "
501 "meaning to the shell such as C<#> and space. You may need to quote or "
502 "escape these characters on the command line. See the shell manual page "
503 "L<sh(1)> for details."
507 #: ../cat/virt-cat.pod:199 ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../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:303 ../inspector/virt-inspector.pod:372 ../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:608 ../ruby/examples/guestfs-ruby.pod:36 ../src/guestfs.pod:3042 ../test-tool/libguestfs-test-tool.pod:87 ../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
512 #: ../cat/virt-cat.pod:201
514 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
515 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
519 #: ../cat/virt-cat.pod:208 ../cat/virt-filesystems.pod:383 ../cat/virt-ls.pod:502 ../df/virt-df.pod:230 ../edit/virt-edit.pod:363 ../rescue/virt-rescue.pod:292 ../resize/virt-resize.pod:629 ../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
524 #: ../cat/virt-cat.pod:210 ../cat/virt-filesystems.pod:385 ../cat/virt-ls.pod:504 ../df/virt-df.pod:232 ../edit/virt-edit.pod:365 ../inspector/virt-inspector.pod:386 ../rescue/virt-rescue.pod:294 ../resize/virt-resize.pod:631 ../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
525 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
529 #: ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:387 ../cat/virt-ls.pod:506 ../df/virt-df.pod:234 ../edit/virt-edit.pod:367 ../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:318 ../inspector/virt-inspector.pod:394 ../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:633 ../ruby/examples/guestfs-ruby.pod:51 ../src/guestfs.pod:3118 ../test-tool/libguestfs-test-tool.pod:97 ../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
534 #: ../cat/virt-cat.pod:214 ../inspector/virt-inspector.pod:396 ../resize/virt-resize.pod:635
535 msgid "Copyright (C) 2010-2011 Red Hat Inc."
539 #: ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:391 ../cat/virt-ls.pod:510 ../df/virt-df.pod:238 ../edit/virt-edit.pod:371 ../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:323 ../inspector/virt-inspector.pod:398 ../rescue/virt-rescue.pod:300 ../resize/virt-resize.pod:637 ../test-tool/libguestfs-test-tool.pod:102 ../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
541 "This program is free software; you can redistribute it and/or modify it "
542 "under the terms of the GNU General Public License as published by the Free "
543 "Software Foundation; either version 2 of the License, or (at your option) "
548 #: ../cat/virt-cat.pod:221 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376 ../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:328 ../inspector/virt-inspector.pod:403 ../rescue/virt-rescue.pod:305 ../resize/virt-resize.pod:642 ../test-tool/libguestfs-test-tool.pod:107 ../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
550 "This program is distributed in the hope that it will be useful, but WITHOUT "
551 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
552 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
557 #: ../cat/virt-cat.pod:226 ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381 ../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:333 ../inspector/virt-inspector.pod:408 ../rescue/virt-rescue.pod:310 ../resize/virt-resize.pod:647 ../test-tool/libguestfs-test-tool.pod:112 ../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
559 "You should have received a copy of the GNU General Public License along with "
560 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
561 "Ave, Cambridge, MA 02139, USA."
565 #: ../cat/virt-filesystems.pod:5
567 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
568 "virtual machine or disk image"
572 #: ../cat/virt-filesystems.pod:9
575 " virt-filesystems [--options] -d domname\n"
580 #: ../cat/virt-filesystems.pod:11
583 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
588 #: ../cat/virt-filesystems.pod:15
590 "This tool allows you to discover filesystems, partitions, logical volumes, "
591 "and their sizes in a disk image or virtual machine. It is a replacement for "
592 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
596 #: ../cat/virt-filesystems.pod:20
598 "One use for this tool is from shell scripts to iterate over all filesystems "
603 #: ../cat/virt-filesystems.pod:23
606 " for fs in $(virt-filesystems -a disk.img); do\n"
613 #: ../cat/virt-filesystems.pod:27
615 "Another use is to list partitions before using another tool to modify those "
616 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
617 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
621 #: ../cat/virt-filesystems.pod:32
623 "Various command line options control what this program displays. You need "
624 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
625 "guest respectively. If you just specify that then the program shows "
626 "filesystems found, one per line, like this:"
630 #: ../cat/virt-filesystems.pod:37
633 " $ virt-filesystems -a disk.img\n"
635 " /dev/vg_guest/lv_root\n"
640 #: ../cat/virt-filesystems.pod:41
641 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
645 #: ../cat/virt-filesystems.pod:44
648 " $ virt-filesystems -a disk.img -l\n"
649 " Name Type VFS Label Size\n"
650 " /dev/sda1 filesystem ext4 boot 524288000\n"
651 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
656 #: ../cat/virt-filesystems.pod:49
658 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
663 #: ../cat/virt-filesystems.pod:52
666 " $ virt-filesystems -a disk.img --extra\n"
668 " /dev/vg_guest/lv_root\n"
669 " /dev/vg_guest/lv_swap\n"
670 " /dev/vg_guest/lv_data\n"
675 #: ../cat/virt-filesystems.pod:58
676 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
680 #: ../cat/virt-filesystems.pod:60
683 " $ virt-filesystems -a disk.img --partitions\n"
690 #: ../cat/virt-filesystems.pod:64
692 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
693 "I<--physical-volumes>, I<--block-devices> to list those items."
697 #: ../cat/virt-filesystems.pod:67
699 "You can use these options in combination as well (if you want a combination "
700 "including filesystems, you have to add I<--filesystems>). Notice that some "
701 "items fall into several categories (eg. C</dev/sda1> might be both a "
702 "partition and a filesystem). These items are listed several times. To get "
703 "a list which includes absolutely everything that virt-filesystems knows "
704 "about, use the I<--all> option."
708 #: ../cat/virt-filesystems.pod:74
710 "UUIDs (because they are quite long) are not shown by default. Add the "
711 "I<--uuid> option to display device and filesystem UUIDs in the long output."
715 #: ../cat/virt-filesystems.pod:78
717 "I<--all --long --uuid> is a useful combination to display all possible "
718 "information about everything."
722 #: ../cat/virt-filesystems.pod:81
725 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
726 " Name Type VFS Label Size Parent UUID\n"
727 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
728 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
729 " /dev/sda1 partition - - 100M /dev/sda -\n"
730 " /dev/sda2 partition - - 20G /dev/sda -\n"
731 " /dev/sda device - - 20G - -\n"
736 #: ../cat/virt-filesystems.pod:89
737 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
741 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
746 #: ../cat/virt-filesystems.pod:112
748 "Display everything. This is currently the same as specifying these options: "
749 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
750 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
751 "be added to this list in future)."
755 #: ../cat/virt-filesystems.pod:117
756 msgid "See also I<--long>."
760 #: ../cat/virt-filesystems.pod:119
765 #: ../cat/virt-filesystems.pod:121
766 msgid "B<--block-devices>"
770 #: ../cat/virt-filesystems.pod:123
771 msgid "Display block devices."
775 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
780 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
782 "Write out the results in CSV format (comma-separated values). This format "
783 "can be imported easily into databases and spreadsheets, but read L</NOTE "
784 "ABOUT CSV FORMAT> below."
788 #: ../cat/virt-filesystems.pod:150
790 "When prompting for keys and passphrases, virt-filesystems normally turns "
791 "echoing off so you cannot see what you are typing. If you are not worried "
792 "about Tempest attacks and there is no one else in the room you can specify "
793 "this flag to see what you are typing."
797 #: ../cat/virt-filesystems.pod:155
802 #: ../cat/virt-filesystems.pod:157
804 "This causes filesystems that are not ordinary, mountable filesystems to be "
805 "displayed. This category includes swapspace, and filesystems that are empty "
806 "or contain unknown data."
810 #: ../cat/virt-filesystems.pod:161
811 msgid "This option implies I<--filesystems>."
815 #: ../cat/virt-filesystems.pod:163
816 msgid "B<--filesystems>"
820 #: ../cat/virt-filesystems.pod:165
822 "Display mountable filesystems. If no display option was selected then this "
827 #: ../cat/virt-filesystems.pod:168
828 msgid "With I<--extra>, non-mountable filesystems are shown too."
832 #: ../cat/virt-filesystems.pod:181
835 " virt-filesystems --format=raw -a disk.img\n"
840 #: ../cat/virt-filesystems.pod:185
843 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
848 #: ../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
853 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
854 msgid "B<--human-readable>"
858 #: ../cat/virt-filesystems.pod:198
859 msgid "In I<--long> mode, display sizes in human-readable format."
863 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
868 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
873 #: ../cat/virt-filesystems.pod:209
874 msgid "Display extra columns of data (\"long format\")."
878 #: ../cat/virt-filesystems.pod:211
879 msgid "A title row is added unless you also specify I<--no-title>."
883 #: ../cat/virt-filesystems.pod:213
885 "The extra columns displayed depend on what output you select, and the "
886 "ordering of columns may change in future versions. Use the title row, "
887 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
892 #: ../cat/virt-filesystems.pod:218
894 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
895 "default is to show raw numbers of I<bytes>."
899 #: ../cat/virt-filesystems.pod:221
900 msgid "Use I<--uuid> to display UUIDs too."
904 #: ../cat/virt-filesystems.pod:223
909 #: ../cat/virt-filesystems.pod:225
914 #: ../cat/virt-filesystems.pod:227
915 msgid "B<--logical-volumes>"
919 #: ../cat/virt-filesystems.pod:229
921 "Display LVM logical volumes. In this mode, these are displayed irrespective "
922 "of whether the LVs contain filesystems."
926 #: ../cat/virt-filesystems.pod:232
927 msgid "B<--no-title>"
931 #: ../cat/virt-filesystems.pod:234
932 msgid "In I<--long> mode, don't add a title row."
936 #: ../cat/virt-filesystems.pod:236
938 "Note that the order of the columns is not fixed, and may change in future "
939 "versions of virt-filesystems, so using this option may give you unexpected "
944 #: ../cat/virt-filesystems.pod:240
949 #: ../cat/virt-filesystems.pod:242
950 msgid "B<--partitions>"
954 #: ../cat/virt-filesystems.pod:244
956 "Display partitions. In this mode, these are displayed irrespective of "
957 "whether the partitions contain filesystems."
961 #: ../cat/virt-filesystems.pod:247
966 #: ../cat/virt-filesystems.pod:249
967 msgid "B<--physvols>"
971 #: ../cat/virt-filesystems.pod:251
972 msgid "B<--physical-volumes>"
976 #: ../cat/virt-filesystems.pod:253
977 msgid "Display LVM physical volumes."
981 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
986 #: ../cat/virt-filesystems.pod:257
991 #: ../cat/virt-filesystems.pod:259
992 msgid "In I<--long> mode, display UUIDs as well."
996 #: ../cat/virt-filesystems.pod:273
1001 #: ../cat/virt-filesystems.pod:275
1002 msgid "B<--volgroups>"
1006 #: ../cat/virt-filesystems.pod:277
1007 msgid "B<--volume-groups>"
1011 #: ../cat/virt-filesystems.pod:279
1012 msgid "Display LVM volume groups."
1016 #: ../cat/virt-filesystems.pod:287
1021 #: ../cat/virt-filesystems.pod:289
1023 "Note that columns in the output are subject to reordering and change in "
1024 "future versions of this tool."
1028 #: ../cat/virt-filesystems.pod:294
1033 #: ../cat/virt-filesystems.pod:296
1034 msgid "The filesystem, partition, block device or LVM name."
1038 #: ../cat/virt-filesystems.pod:298
1040 "For device and partition names these are displayed as canonical libguestfs "
1041 "names, so that for example C</dev/sda2> is the second partition on the first "
1046 #: ../cat/virt-filesystems.pod:302
1048 "If the I<--long> option is B<not> specified, then only the name column is "
1049 "shown in the output."
1053 #: ../cat/virt-filesystems.pod:305
1058 #: ../cat/virt-filesystems.pod:307
1059 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1063 #: ../cat/virt-filesystems.pod:309
1068 #: ../cat/virt-filesystems.pod:311
1070 "If there is a filesystem, then this column displays the filesystem type if "
1071 "one could be detected, eg. C<ext4>."
1075 #: ../cat/virt-filesystems.pod:314
1080 #: ../cat/virt-filesystems.pod:316
1082 "If the object has a label (used for identifying and mounting filesystems) "
1083 "then this column contains the label."
1087 #: ../cat/virt-filesystems.pod:319
1092 #: ../cat/virt-filesystems.pod:321
1094 "The size of the object in bytes. If the I<--human> option is used then the "
1095 "size is displayed in a human-readable form."
1099 #: ../cat/virt-filesystems.pod:324
1104 #: ../cat/virt-filesystems.pod:326
1106 "The parent column records the parent relationship between objects. For "
1107 "example, if the object is a partition, then this column contains the name of "
1108 "the containing device. If the object is a logical volume, then this column "
1109 "is the name of the volume group."
1113 #: ../cat/virt-filesystems.pod:331
1118 #: ../cat/virt-filesystems.pod:333
1120 "If the object has a UUID (used for identifying and mounting filesystems and "
1121 "block devices) then this column contains the UUID as a string."
1125 #: ../cat/virt-filesystems.pod:337
1126 msgid "The UUID is only displayed if the I<--uuid> option is given."
1130 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459 ../df/virt-df.pod:191
1131 msgid "NOTE ABOUT CSV FORMAT"
1135 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461 ../df/virt-df.pod:193
1137 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1138 "should be easy to parse, but it is definitely not easy to parse."
1142 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464 ../df/virt-df.pod:196
1144 "Myth: Just split fields at commas. Reality: This does I<not> work "
1145 "reliably. This example has two columns:"
1149 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467 ../df/virt-df.pod:199
1152 " \"foo,bar\",baz\n"
1157 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469 ../df/virt-df.pod:201
1159 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1160 "reliably. This example has one row:"
1164 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472 ../df/virt-df.pod:204
1173 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475 ../df/virt-df.pod:207
1175 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1176 "packaged in major Linux distributions)."
1180 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478 ../df/virt-df.pod:210
1182 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1183 "or Python's built-in csv library)."
1187 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481 ../df/virt-df.pod:213
1188 msgid "Most spreadsheets and databases can import CSV directly."
1192 #: ../cat/virt-filesystems.pod:374
1194 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1195 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1196 "L<http://libguestfs.org/>."
1200 #: ../cat/virt-filesystems.pod:389 ../tools/virt-make-fs.pl:570 ../tools/virt-win-reg.pl:778
1201 msgid "Copyright (C) 2010 Red Hat Inc."
1205 #: ../cat/virt-ls.pod:5
1206 msgid "virt-ls - List files in a virtual machine"
1210 #: ../cat/virt-ls.pod:9
1213 " virt-ls [--options] -d domname directory [directory ...]\n"
1218 #: ../cat/virt-ls.pod:11
1221 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1227 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1232 #: ../cat/virt-ls.pod:15
1235 " virt-ls [--options] domname directory\n"
1240 #: ../cat/virt-ls.pod:17
1243 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1248 #: ../cat/virt-ls.pod:21
1250 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1251 "more from a virtual machine or disk image."
1255 #: ../cat/virt-ls.pod:24
1257 "Multiple directory names can be given, in which case the output from each is "
1262 #: ../cat/virt-ls.pod:27
1264 "To list directories from a libvirt guest use the I<-d> option to specify the "
1265 "name of the guest. For a disk image, use the I<-a> option."
1269 #: ../cat/virt-ls.pod:31
1271 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1272 "may need to use L<guestfish(1)>, or write a program directly to the "
1273 "L<guestfs(3)> API."
1277 #: ../cat/virt-ls.pod:37
1278 msgid "Get a list of all files and directories in a virtual machine:"
1282 #: ../cat/virt-ls.pod:39
1285 " virt-ls -R -d guest /\n"
1290 #: ../cat/virt-ls.pod:41
1291 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1295 #: ../cat/virt-ls.pod:43
1298 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1303 #: ../cat/virt-ls.pod:45
1304 msgid "List all public-writable directories in a Linux virtual machine:"
1308 #: ../cat/virt-ls.pod:47
1311 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1316 #: ../cat/virt-ls.pod:49
1317 msgid "List all Unix domain sockets in a Linux virtual machine:"
1321 #: ../cat/virt-ls.pod:51
1324 " virt-ls -lR -d guest / | grep '^s'\n"
1329 #: ../cat/virt-ls.pod:53
1330 msgid "List all regular files with filenames ending in '.png':"
1334 #: ../cat/virt-ls.pod:55
1337 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1342 #: ../cat/virt-ls.pod:57
1343 msgid "To display files larger than 10MB in home directories:"
1347 #: ../cat/virt-ls.pod:59
1350 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1355 #: ../cat/virt-ls.pod:61
1356 msgid "Find everything modified in the last 7 days:"
1360 #: ../cat/virt-ls.pod:63
1363 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1368 #: ../cat/virt-ls.pod:65
1369 msgid "Find regular files modified in the last 24 hours:"
1373 #: ../cat/virt-ls.pod:67
1376 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1381 #: ../cat/virt-ls.pod:69
1382 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1386 #: ../cat/virt-ls.pod:71
1388 "Find the differences between files in a guest and an earlier snapshot of the "
1393 #: ../cat/virt-ls.pod:74
1396 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1397 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1398 " diff -u old new | less\n"
1403 #: ../cat/virt-ls.pod:78
1405 "The commands above won't find files where the content has changed but the "
1406 "metadata (eg. file size and modification date) is the same. To do that, you "
1407 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
1408 "I<--checksum> can be quite slow since it has to read and compute a checksum "
1409 "of every regular file in the virtual machine."
1413 #: ../cat/virt-ls.pod:84
1414 msgid "OUTPUT MODES"
1418 #: ../cat/virt-ls.pod:86
1420 "C<virt-ls> has four output modes, controlled by different combinations of "
1421 "the I<-l> and I<-R> options."
1425 #: ../cat/virt-ls.pod:89
1426 msgid "SIMPLE LISTING"
1430 #: ../cat/virt-ls.pod:91
1431 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1435 #: ../cat/virt-ls.pod:93
1438 " $ virt-ls -d guest /\n"
1446 #: ../cat/virt-ls.pod:98
1447 msgid "LONG LISTING"
1451 #: ../cat/virt-ls.pod:100
1453 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1454 "(more specifically, like the C<guestfs_ll> function)."
1458 #: ../cat/virt-ls.pod:103
1461 " $ virt-ls -l -d guest /\n"
1463 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
1464 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
1470 #: ../cat/virt-ls.pod:109
1472 "Note that while this is useful for displaying a directory, do not try "
1473 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
1478 #: ../cat/virt-ls.pod:113
1479 msgid "RECURSIVE LISTING"
1483 #: ../cat/virt-ls.pod:115
1485 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
1486 "and directories recursively:"
1490 #: ../cat/virt-ls.pod:118
1493 " $ virt-ls -R -d guest /tmp\n"
1501 #: ../cat/virt-ls.pod:123
1503 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
1504 "converts C<\\0> characters to C<\\n>."
1508 #: ../cat/virt-ls.pod:126
1509 msgid "RECURSIVE LONG LISTING"
1513 #: ../cat/virt-ls.pod:128
1515 "Using I<-lR> options together changes the output to display directories "
1516 "recursively, with file stats, and optionally other features such as "
1517 "checksums and extended attributes."
1521 #: ../cat/virt-ls.pod:132
1523 "Most of the interesting features of C<virt-ls> are only available when using "
1528 #: ../cat/virt-ls.pod:135
1530 "The fields are normally space-separated. Filenames are B<not> quoted, so "
1531 "you cannot use the output in another program (because filenames can contain "
1532 "spaces and other unsafe characters). If the guest was untrusted and someone "
1533 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
1534 "on you by creating filenames with embedded newline characters. To B<safely> "
1535 "parse the output in another program, use the I<--csv> (Comma-Separated "
1540 #: ../cat/virt-ls.pod:143
1542 "Note that this output format is completely unrelated to the C<ls -lR> "
1547 #: ../cat/virt-ls.pod:146
1550 " $ virt-ls -lR -d guest /bin\n"
1551 " d 0555 4096 /bin\n"
1552 " - 0755 123 /bin/alsaunmute\n"
1553 " - 0755 28328 /bin/arch\n"
1554 " l 0777 4 /bin/awk -> gawk\n"
1555 " - 0755 27216 /bin/basename\n"
1556 " - 0755 943360 /bin/bash\n"
1562 #: ../cat/virt-ls.pod:155
1563 msgid "These basic fields are always shown:"
1567 #: ../cat/virt-ls.pod:159
1572 #: ../cat/virt-ls.pod:161
1574 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
1575 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
1576 "link), C<s> (socket) or C<u> (unknown)."
1580 #: ../cat/virt-ls.pod:171
1585 #: ../cat/virt-ls.pod:173
1586 msgid "The Unix permissions, displayed as a 4 digit octal number."
1590 #: ../cat/virt-ls.pod:175
1595 #: ../cat/virt-ls.pod:177
1597 "The size of the file. This is shown in bytes unless I<-h> or "
1598 "I<--human-readable> option is given, in which case this is shown as a "
1599 "human-readable number."
1603 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4188
1608 #: ../cat/virt-ls.pod:183
1609 msgid "The full path of the file or directory."
1613 #: ../cat/virt-ls.pod:185
1618 #: ../cat/virt-ls.pod:187
1619 msgid "For symbolic links only, the link target."
1623 #: ../cat/virt-ls.pod:191
1625 "In I<-lR> mode, additional command line options enable the display of more "
1630 #: ../cat/virt-ls.pod:194
1632 "With the I<--uids> flag, these additional fields are displayed before the "
1637 #: ../cat/virt-ls.pod:199
1642 #: ../cat/virt-ls.pod:201
1647 #: ../cat/virt-ls.pod:203
1649 "The UID and GID of the owner of the file (displayed numerically). Note "
1650 "these only make sense in the context of a Unix-like guest."
1654 #: ../cat/virt-ls.pod:208
1655 msgid "With the I<--times> flag, these additional fields are displayed:"
1659 #: ../cat/virt-ls.pod:212
1664 #: ../cat/virt-ls.pod:214
1665 msgid "The time of last access."
1669 #: ../cat/virt-ls.pod:216
1674 #: ../cat/virt-ls.pod:218
1675 msgid "The time of last modification."
1679 #: ../cat/virt-ls.pod:220
1684 #: ../cat/virt-ls.pod:222
1685 msgid "The time of last status change."
1689 #: ../cat/virt-ls.pod:226
1691 "The time fields are displayed as string dates and times, unless one of the "
1692 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
1696 #: ../cat/virt-ls.pod:229
1697 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
1701 #: ../cat/virt-ls.pod:233
1706 #: ../cat/virt-ls.pod:235
1708 "The device containing the file (displayed as major:minor). This may not "
1709 "match devices as known to the guest."
1713 #: ../cat/virt-ls.pod:238
1718 #: ../cat/virt-ls.pod:240
1719 msgid "The inode number."
1723 #: ../cat/virt-ls.pod:242
1728 #: ../cat/virt-ls.pod:244
1729 msgid "The number of hard links."
1733 #: ../cat/virt-ls.pod:246
1738 #: ../cat/virt-ls.pod:248
1739 msgid "For block and char special files, the device (displayed as major:minor)."
1743 #: ../cat/virt-ls.pod:251
1748 #: ../cat/virt-ls.pod:253
1749 msgid "The number of 512 byte blocks allocated to the file."
1753 #: ../cat/virt-ls.pod:257
1755 "With the I<--checksum> flag, the checksum of the file contents is shown "
1756 "(only for regular files). Computing file checksums can take a considerable "
1761 #: ../cat/virt-ls.pod:280
1762 msgid "B<--checksum>"
1766 #: ../cat/virt-ls.pod:282
1767 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
1771 #: ../cat/virt-ls.pod:284
1773 "Display checksum over file contents for regular files. With no argument, "
1774 "this defaults to using I<md5>. Using an argument, you can select the "
1775 "checksum type to use."
1779 #: ../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
1781 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
1786 #: ../cat/virt-ls.pod:316
1788 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
1789 "so you cannot see what you are typing. If you are not worried about Tempest "
1790 "attacks and there is no one else in the room you can specify this flag to "
1791 "see what you are typing."
1795 #: ../cat/virt-ls.pod:321
1796 msgid "B<--extra-stats>"
1800 #: ../cat/virt-ls.pod:323
1801 msgid "Display extra stats."
1805 #: ../cat/virt-ls.pod:339
1808 " virt-ls --format=raw -a disk.img /dir\n"
1813 #: ../cat/virt-ls.pod:343
1816 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
1821 #: ../cat/virt-ls.pod:356
1822 msgid "Display file sizes in human-readable format."
1826 #: ../cat/virt-ls.pod:370
1831 #: ../cat/virt-ls.pod:372
1832 msgid "B<--recursive>"
1836 #: ../cat/virt-ls.pod:374
1838 "Select the mode. With neither of these options, C<virt-ls> produces a "
1839 "simple, flat list of the files in the named directory. See L</SIMPLE "
1844 #: ../cat/virt-ls.pod:378
1846 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
1851 #: ../cat/virt-ls.pod:381
1853 "C<virt-ls -R> produces a recursive list of files starting at the named "
1854 "directory. See L</RECURSIVE LISTING>."
1858 #: ../cat/virt-ls.pod:384
1860 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
1861 "parsed. See L</RECURSIVE LONG LISTING>."
1865 #: ../cat/virt-ls.pod:387
1870 #: ../cat/virt-ls.pod:389
1871 msgid "Display time fields."
1875 #: ../cat/virt-ls.pod:394
1876 msgid "B<--time-days>"
1880 #: ../cat/virt-ls.pod:396
1881 msgid "Display time fields as days before now (negative if in the future)."
1885 #: ../cat/virt-ls.pod:398
1887 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
1888 "of the file is between 0 and 86399 seconds."
1892 #: ../cat/virt-ls.pod:404
1893 msgid "B<--time-relative>"
1897 #: ../cat/virt-ls.pod:406
1898 msgid "Display time fields as seconds before now (negative if in the future)."
1902 #: ../cat/virt-ls.pod:411
1907 #: ../cat/virt-ls.pod:413
1908 msgid "Display time fields as seconds since the Unix epoch."
1912 #: ../cat/virt-ls.pod:418
1917 #: ../cat/virt-ls.pod:420
1918 msgid "Display UID and GID fields."
1922 #: ../cat/virt-ls.pod:445
1923 msgid "Previous versions of virt-ls allowed you to write either:"
1927 #: ../cat/virt-ls.pod:447
1930 " virt-ls disk.img [disk.img ...] /dir\n"
1935 #: ../cat/virt-ls.pod:451
1938 " virt-ls guestname /dir\n"
1943 #: ../cat/virt-ls.pod:492
1945 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
1946 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
1947 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
1951 #: ../cat/virt-ls.pod:508 ../df/virt-df.pod:236 ../edit/virt-edit.pod:369 ../rescue/virt-rescue.pod:298
1952 msgid "Copyright (C) 2009-2011 Red Hat Inc."
1956 #: ../df/virt-df.pod:5
1957 msgid "virt-df - Display free space on virtual filesystems"
1961 #: ../df/virt-df.pod:9
1964 " virt-df [--options]\n"
1969 #: ../df/virt-df.pod:11
1972 " virt-df [--options] -d domname\n"
1977 #: ../df/virt-df.pod:13
1980 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
1985 #: ../df/virt-df.pod:17
1988 " virt-df [--options] domname\n"
1993 #: ../df/virt-df.pod:19
1996 " virt-df [--options] disk.img [disk.img ...]\n"
2001 #: ../df/virt-df.pod:23
2003 "C<virt-df> is a command line tool to display free space on virtual machine "
2004 "filesystems. Unlike other tools, it doesn't just display the size of disk "
2005 "allocated to a virtual machine, but can look inside disk images to see how "
2006 "much space is really being used."
2010 #: ../df/virt-df.pod:28
2012 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
2013 "to get a list of all active and inactive guests, and performs a C<df>-type "
2014 "operation on each one in turn, printing out the results."
2018 #: ../df/virt-df.pod:32
2020 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
2021 "C<df>-type operation on either the single named libvirt domain, or on the "
2022 "disk image(s) listed on the command line (which must all belong to a single "
2023 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
2024 "single guest>. If you want to run on multiple guests, then you have to "
2025 "invoke C<virt-df> multiple times."
2029 #: ../df/virt-df.pod:39
2031 "Use the I<--csv> option to get a format which can be easily parsed by other "
2032 "programs. Other options are similar to the standard L<df(1)> command."
2036 #: ../df/virt-df.pod:45
2038 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
2039 "output human-readable:"
2043 #: ../df/virt-df.pod:48
2046 " # virt-df -d F14x64 -h\n"
2047 " Filesystem Size Used Available Use%\n"
2048 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
2049 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
2054 #: ../df/virt-df.pod:53
2055 msgid "Show disk usage for a disk image file called C<test.img>:"
2059 #: ../df/virt-df.pod:55
2062 " $ virt-df -a test1.img\n"
2063 " Filesystem 1K-blocks Used Available Use%\n"
2064 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
2069 #: ../df/virt-df.pod:112
2072 " virt-df --format=raw -a disk.img\n"
2077 #: ../df/virt-df.pod:116
2080 " virt-df --format=raw -a disk.img --format -a another.img\n"
2085 #: ../df/virt-df.pod:129
2086 msgid "Print sizes in human-readable format."
2090 #: ../df/virt-df.pod:131
2091 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
2095 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
2100 #: ../df/virt-df.pod:135
2105 #: ../df/virt-df.pod:137
2106 msgid "Print inodes instead of blocks."
2110 #: ../df/virt-df.pod:139
2111 msgid "B<--one-per-guest>"
2115 #: ../df/virt-df.pod:141
2117 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
2118 "disks from several guests to a single libguestfs appliance."
2122 #: ../df/virt-df.pod:144
2123 msgid "You might use this option in the following circumstances:"
2127 #: ../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:1938 ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1952 ../fish/guestfish-actions.pod:1959 ../fish/guestfish-actions.pod:1966 ../fish/guestfish.pod:445 ../fish/guestfish.pod:449 ../fish/guestfish.pod:453 ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:384 ../inspector/virt-inspector.pod:388 ../resize/virt-resize.pod:282 ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295 ../resize/virt-resize.pod:301 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596 ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod: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:2864 ../src/guestfs-actions.pod:2870 ../src/guestfs-actions.pod:2878 ../src/guestfs-actions.pod:2885 ../src/guestfs-actions.pod:2892 ../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:1644 ../src/guestfs.pod:1649 ../src/guestfs.pod:1653 ../src/guestfs.pod:1755 ../src/guestfs.pod:1760 ../src/guestfs.pod:1764 ../src/guestfs.pod:1774 ../src/guestfs.pod:2063 ../src/guestfs.pod:2068 ../src/guestfs.pod:2074 ../src/guestfs.pod:2082 ../src/guestfs.pod:2436 ../src/guestfs.pod:2442 ../src/guestfs.pod:2447 ../src/guestfs.pod:2453 ../src/guestfs.pod:2834 ../src/guestfs.pod:2839 ../src/guestfs.pod:2843 ../src/guestfs.pod:2847 ../src/guestfs.pod:2851 ../src/guestfs.pod:2865 ../src/guestfs.pod:2870 ../src/guestfs.pod:3095 ../src/guestfs.pod:3099 ../src/guestfs.pod:3103 ../src/guestfs.pod:3107 ../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
2132 #: ../df/virt-df.pod:150
2134 "If you think an untrusted guest might actively try to exploit the libguestfs "
2135 "appliance kernel, then this prevents one guest from interfering with the "
2136 "stats printed for another guest."
2140 #: ../df/virt-df.pod:156
2142 "If the kernel has a bug which stops it from accessing a filesystem in one "
2143 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
2144 "and report stats for further guests."
2148 #: ../df/virt-df.pod:165
2150 "Print UUIDs instead of names. This is useful for following a guest even "
2151 "when the guest is migrated or renamed, or when two guests happen to have the "
2156 #: ../df/virt-df.pod:169
2158 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
2159 "images, we still print the disk image name even when this option is "
2164 #: ../df/virt-df.pod:224
2166 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
2167 "L<http://libguestfs.org/>."
2171 #: ../edit/virt-edit.pod:5
2172 msgid "virt-edit - Edit a file in a virtual machine"
2176 #: ../edit/virt-edit.pod:9
2179 " virt-edit [--options] -d domname file [file ...]\n"
2184 #: ../edit/virt-edit.pod:11
2187 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
2192 #: ../edit/virt-edit.pod:13
2195 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
2200 #: ../edit/virt-edit.pod:17
2203 " virt-edit domname file\n"
2208 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
2211 " virt-edit disk.img [disk.img ...] file\n"
2216 #: ../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
2221 #: ../edit/virt-edit.pod:23
2223 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
2224 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
2225 "doing this, but doesn't catch all cases."
2229 #: ../edit/virt-edit.pod:29
2231 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
2232 "exists in the named virtual machine (or disk image)."
2236 #: ../edit/virt-edit.pod:32
2238 "Multiple filenames can be given, in which case they are each edited in "
2239 "turn. Each filename must be a full path, starting at the root directory "
2240 "(starting with '/')."
2244 #: ../edit/virt-edit.pod:36
2245 msgid "If you want to just view a file, use L<virt-cat(1)>."
2249 #: ../edit/virt-edit.pod:38
2251 "For more complex cases you should look at the L<guestfish(1)> tool (see "
2252 "L</USING GUESTFISH> below)."
2256 #: ../edit/virt-edit.pod:41
2258 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
2259 "that and much more."
2263 #: ../edit/virt-edit.pod:46
2264 msgid "Edit the named files interactively:"
2268 #: ../edit/virt-edit.pod:48
2271 " virt-edit -d mydomain /boot/grub/grub.conf\n"
2276 #: ../edit/virt-edit.pod:50
2279 " virt-edit -d mydomain /etc/passwd\n"
2284 #: ../edit/virt-edit.pod:52
2285 msgid "For Windows guests, some Windows paths are understood:"
2289 #: ../edit/virt-edit.pod:54
2292 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
2297 #: ../edit/virt-edit.pod:56
2299 "If Perl is installed, you can also edit files non-interactively (see "
2300 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
2304 #: ../edit/virt-edit.pod:60
2307 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
2312 #: ../edit/virt-edit.pod:81
2313 msgid "B<-b> extension"
2317 #: ../edit/virt-edit.pod:83
2318 msgid "B<--backup> extension"
2322 #: ../edit/virt-edit.pod:85
2324 "Create a backup of the original file I<in the guest disk image>. The backup "
2325 "has the original filename with C<extension> added."
2329 #: ../edit/virt-edit.pod:88
2331 "Usually the first character of C<extension> would be a dot C<.> so you would "
2336 #: ../edit/virt-edit.pod:91
2339 " virt-edit -b .orig [etc]\n"
2344 #: ../edit/virt-edit.pod:93
2345 msgid "By default, no backup file is made."
2349 #: ../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
2354 #: ../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
2355 msgid "B<--connect URI>"
2359 #: ../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
2361 "If you specify guest block devices directly, then libvirt is not used at "
2366 #: ../edit/virt-edit.pod:114
2368 "When prompting for keys and passphrases, virt-edit normally turns echoing "
2369 "off so you cannot see what you are typing. If you are not worried about "
2370 "Tempest attacks and there is no one else in the room you can specify this "
2371 "flag to see what you are typing."
2375 #: ../edit/virt-edit.pod:119
2380 #: ../edit/virt-edit.pod:121
2381 msgid "B<--expr> EXPR"
2385 #: ../edit/virt-edit.pod:123
2387 "Instead of launching the external editor, non-interactively apply the Perl "
2388 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
2393 #: ../edit/virt-edit.pod:127
2395 "Be careful to properly quote the expression to prevent it from being altered "
2400 #: ../edit/virt-edit.pod:130
2401 msgid "Note that this option is only available when Perl 5 is installed."
2405 #: ../edit/virt-edit.pod:132
2406 msgid "B<--format> raw|qcow2|..."
2410 #: ../edit/virt-edit.pod:143
2413 " virt-edit --format=raw -a disk.img file\n"
2418 #: ../edit/virt-edit.pod:147
2421 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
2426 #: ../edit/virt-edit.pod:181
2427 msgid "Previous versions of virt-edit allowed you to write either:"
2431 #: ../edit/virt-edit.pod:187
2434 " virt-edit guestname file\n"
2439 #: ../edit/virt-edit.pod:195
2440 msgid "NON-INTERACTIVE EDITING"
2444 #: ../edit/virt-edit.pod:197
2446 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
2447 "administrator can interactively edit the file."
2451 #: ../edit/virt-edit.pod:200
2453 "There are two ways also to use C<virt-edit> from scripts in order to make "
2454 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
2455 "like this, it's less error-prone to write scripts directly using the "
2456 "libguestfs API and Augeas for configuration file editing.)"
2460 #: ../edit/virt-edit.pod:206
2462 "The first method is to temporarily set C<$EDITOR> to any script or program "
2463 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
2464 "update C<tmpfile> in place however it likes."
2468 #: ../edit/virt-edit.pod:210
2470 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
2471 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
2472 "instances of C<foo> with C<bar> in a file:"
2476 #: ../edit/virt-edit.pod:214
2479 " virt-edit -d domname filename -e 's/foo/bar/'\n"
2484 #: ../edit/virt-edit.pod:216
2486 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
2487 "For example to delete root's password you could do:"
2491 #: ../edit/virt-edit.pod:219
2494 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
2499 #: ../edit/virt-edit.pod:221
2501 "What really happens is that the snippet is evaluated as a Perl expression "
2502 "for each line of the file. The line, including the final C<\\n>, is passed "
2503 "in C<$_> and the expression should update C<$_> or leave it unchanged."
2507 #: ../edit/virt-edit.pod:226
2509 "To delete a line, set C<$_> to the empty string. For example, to delete the "
2510 "C<apache> user account from the password file you can do:"
2514 #: ../edit/virt-edit.pod:229
2517 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
2522 #: ../edit/virt-edit.pod:231
2524 "To insert a line, prepend or append it to C<$_>. However appending lines to "
2525 "the end of the file is rather difficult this way since there is no concept "
2526 "of \"last line of the file\" - your expression just doesn't get called "
2527 "again. You might want to use the first method (setting C<$EDITOR>) if you "
2532 #: ../edit/virt-edit.pod:237
2534 "The variable C<$lineno> contains the current line number. As is "
2535 "traditional, the first line in the file is number C<1>."
2539 #: ../edit/virt-edit.pod:240
2541 "The return value from the expression is ignored, but the expression may call "
2542 "C<die> in order to abort the whole program, leaving the original file "
2547 #: ../edit/virt-edit.pod:244
2549 "Remember when matching the end of a line that C<$_> may contain the final "
2550 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
2551 "newline then neither of these. Thus to match or substitute some text at the "
2552 "end of a line, use this regular expression:"
2556 #: ../edit/virt-edit.pod:249
2559 " /some text(\\r?\\n)?$/\n"
2564 #: ../edit/virt-edit.pod:251
2566 "Alternately, use the perl C<chomp> function, being careful not to chomp "
2567 "C<$_> itself (since that would remove all newlines from the file):"
2571 #: ../edit/virt-edit.pod:255
2574 " my $m = $_; chomp $m; $m =~ /some text$/\n"
2579 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
2580 msgid "WINDOWS PATHS"
2584 #: ../edit/virt-edit.pod:259
2586 "C<virt-edit> has a limited ability to understand Windows drive letters and "
2587 "paths (eg. C<E:\\foo\\bar.txt>)."
2591 #: ../edit/virt-edit.pod:262
2592 msgid "If and only if the guest is running Windows then:"
2596 #: ../edit/virt-edit.pod:268
2598 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
2599 "to the correct filesystem."
2603 #: ../edit/virt-edit.pod:273
2605 "Any backslash (C<\\>) characters in the path are replaced with forward "
2606 "slashes so that libguestfs can process it."
2610 #: ../edit/virt-edit.pod:278
2612 "The path is resolved case insensitively to locate the file that should be "
2617 #: ../edit/virt-edit.pod:283
2618 msgid "There are some known shortcomings:"
2622 #: ../edit/virt-edit.pod:289
2623 msgid "Some NTFS symbolic links may not be followed correctly."
2627 #: ../edit/virt-edit.pod:293
2628 msgid "NTFS junction points that cross filesystems are not followed."
2632 #: ../edit/virt-edit.pod:299
2634 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
2635 "C<virt-edit> doesn't work."
2639 #: ../edit/virt-edit.pod:302
2640 msgid "Using C<virt-edit> is approximately equivalent to doing:"
2644 #: ../edit/virt-edit.pod:304
2647 " guestfish --rw -i -d domname edit /file\n"
2652 #: ../edit/virt-edit.pod:306
2654 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
2659 #: ../edit/virt-edit.pod:309
2661 "The command above uses libguestfs's guest inspection feature and so does not "
2662 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
2663 "disk images that don't contain guests. To edit a file on a disk image "
2668 #: ../edit/virt-edit.pod:314
2671 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
2676 #: ../edit/virt-edit.pod:316
2678 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
2679 "the disk image to edit, and C</file> is the full path to the file."
2683 #: ../edit/virt-edit.pod:320
2685 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
2686 "C<write> or C<upload> instead:"
2690 #: ../edit/virt-edit.pod:323
2693 " guestfish --rw -i -d domname touch /newfile\n"
2698 #: ../edit/virt-edit.pod:325
2701 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
2706 #: ../edit/virt-edit.pod:327
2709 " guestfish --rw -i -d domname upload localfile /newfile\n"
2714 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1086 ../rescue/virt-rescue.pod:257 ../src/guestfs.pod:2981 ../test-tool/libguestfs-test-tool.pod:82
2715 msgid "ENVIRONMENT VARIABLES"
2719 #: ../edit/virt-edit.pod:333
2724 #: ../edit/virt-edit.pod:335
2726 "If set, this string is used as the editor. It may contain arguments, "
2727 "eg. C<\"emacs -nw\">"
2731 #: ../edit/virt-edit.pod:338
2732 msgid "If not set, C<vi> is used."
2736 #: ../edit/virt-edit.pod:351
2738 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
2739 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2740 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
2744 #: ../examples/guestfs-examples.pod:5
2745 msgid "guestfs-examples - Examples of using libguestfs from C"
2749 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
2752 " #include <guestfs.h>\n"
2757 #: ../examples/guestfs-examples.pod:11
2760 " guestfs_h *g = guestfs_create ();\n"
2761 " guestfs_add_drive_ro (g, \"disk.img\");\n"
2762 " guestfs_launch (g);\n"
2767 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
2770 " cc prog.c -o prog -lguestfs\n"
2772 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
2777 #: ../examples/guestfs-examples.pod:21
2779 "This manual page contains examples of calling libguestfs from the C "
2780 "programming language. If you are not familiar with using libguestfs, you "
2781 "also need to read L<guestfs(3)>."
2785 #: ../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
2786 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
2790 #: ../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
2795 #: ../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
2796 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
2800 #: ../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
2805 #: ../examples/guestfs-examples.pod:35
2807 "L<guestfs(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
2808 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
2809 "L<http://libguestfs.org/>."
2813 #: ../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:314 ../inspector/virt-inspector.pod:380 ../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:3114 ../test-tool/libguestfs-test-tool.pod:93
2818 #: ../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:316 ../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:3116 ../test-tool/libguestfs-test-tool.pod:95
2819 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
2823 #: ../examples/guestfs-examples.pod:50 ../ocaml/examples/guestfs-ocaml.pod:96 ../python/examples/guestfs-python.pod:59 ../ruby/examples/guestfs-ruby.pod:53
2824 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
2828 #: ../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
2830 "The examples in this manual page may be freely copied, modified and "
2831 "distributed without any restrictions."
2835 #: ../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:3123
2837 "This library is free software; you can redistribute it and/or modify it "
2838 "under the terms of the GNU Lesser General Public License as published by the "
2839 "Free Software Foundation; either version 2 of the License, or (at your "
2840 "option) any later version."
2844 #: ../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:3128
2846 "This library is distributed in the hope that it will be useful, but WITHOUT "
2847 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
2848 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
2853 #: ../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:3133
2855 "You should have received a copy of the GNU Lesser General Public License "
2856 "along with this library; if not, write to the Free Software Foundation, "
2857 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
2861 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
2866 #: ../examples/guestfs-recipes.pod:5
2868 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
2869 "here. The only way which works for both sorts of output is to just write "
2870 "the URL directly. Do NOT use L<...> for URLs."
2874 #: ../examples/guestfs-recipes.pod:9
2876 "We break with tradition here and don't use ALL CAPS for the section "
2877 "headings, as this makes them much easier to read."
2881 #: ../examples/guestfs-recipes.pod:16
2882 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
2886 #: ../examples/guestfs-recipes.pod:20
2888 "This page contains recipes for and links to things you can do using "
2889 "libguestfs, L<guestfish(1)> and the virt tools."
2893 #: ../examples/guestfs-recipes.pod:23
2894 msgid "Audit a virtual machine for setuid files"
2898 #: ../examples/guestfs-recipes.pod:25
2900 "The link below contains a small program which can be used to audit a Linux "
2901 "virtual machine to see what setuid and setgid files it contains."
2905 #: ../examples/guestfs-recipes.pod:28
2906 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
2910 #: ../examples/guestfs-recipes.pod:30
2911 msgid "Change the background image in a Windows XP VM"
2915 #: ../examples/guestfs-recipes.pod:32
2917 "The links below explain how to use L<guestfish(1)> to change the background "
2918 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
2919 "be substantially different for each version of Windows."
2923 #: ../examples/guestfs-recipes.pod:37
2925 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
2926 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
2930 #: ../examples/guestfs-recipes.pod:40
2931 msgid "Cloning a virtual machine (Linux)"
2935 #: ../examples/guestfs-recipes.pod:42
2937 "The guestfish technique described in the link below works well for most "
2938 "Linux VMs. Depending on the Linux distro you may need to change the paths "
2943 #: ../examples/guestfs-recipes.pod:46
2944 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
2948 #: ../examples/guestfs-recipes.pod:48
2950 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
2955 #: ../examples/guestfs-recipes.pod:51
2956 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
2960 #: ../examples/guestfs-recipes.pod:53
2961 msgid "Cloning a virtual machine (Windows)"
2965 #: ../examples/guestfs-recipes.pod:55
2967 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
2968 "straightforward. Currently there is code in the Aeolus Oz project which "
2969 "does this (using libguestfs). As part of our review of the virt-clone tool, "
2970 "we may add sysprepping ability."
2974 #: ../examples/guestfs-recipes.pod:60
2976 "https://github.com/clalancette/oz "
2977 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
2981 #: ../examples/guestfs-recipes.pod:63
2982 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
2986 #: ../examples/guestfs-recipes.pod:65
2987 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
2991 #: ../examples/guestfs-recipes.pod:67
2994 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
2999 #: ../examples/guestfs-recipes.pod:69
3000 msgid "To export just a subdirectory, eg. C</files>, do:"
3004 #: ../examples/guestfs-recipes.pod:71
3007 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3012 #: ../examples/guestfs-recipes.pod:73
3013 msgid "Create empty disk images"
3017 #: ../examples/guestfs-recipes.pod:75
3019 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3020 "The useful guide below explains the options available."
3024 #: ../examples/guestfs-recipes.pod:78
3025 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
3029 #: ../examples/guestfs-recipes.pod:80
3030 msgid "Dump raw filesystem content from inside a disk image or VM"
3034 #: ../examples/guestfs-recipes.pod:82
3036 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3037 "filesystem content from any filesystem in a disk image or a VM (even one "
3038 "which is encrypted or buried inside an LV):"
3042 #: ../examples/guestfs-recipes.pod:86
3045 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3050 #: ../examples/guestfs-recipes.pod:88
3053 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3058 #: ../examples/guestfs-recipes.pod:90
3059 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
3063 #: ../examples/guestfs-recipes.pod:92
3064 msgid "Edit grub configuration in a VM"
3068 #: ../examples/guestfs-recipes.pod:94
3069 msgid "You can use this to:"
3073 #: ../examples/guestfs-recipes.pod:100
3074 msgid "Fix a virtual machine that does not boot."
3078 #: ../examples/guestfs-recipes.pod:104
3079 msgid "Change which kernel is used to boot the VM."
3083 #: ../examples/guestfs-recipes.pod:108
3084 msgid "Change kernel command line options."
3088 #: ../examples/guestfs-recipes.pod:112
3089 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
3093 #: ../examples/guestfs-recipes.pod:114
3096 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
3101 #: ../examples/guestfs-recipes.pod:116
3103 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
3108 #: ../examples/guestfs-recipes.pod:119
3111 " virt-rescue -d BrokenGuest\n"
3116 #: ../examples/guestfs-recipes.pod:121
3117 msgid "Export any directory from a VM"
3121 #: ../examples/guestfs-recipes.pod:123
3122 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
3126 #: ../examples/guestfs-recipes.pod:126
3129 " virt-copy-out -d Guest /home .\n"
3134 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1292 ../fish/guestfish-actions.pod:1934 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:1922 ../src/guestfs-actions.pod:2860 ../src/guestfs.pod:1640 ../tools/virt-win-reg.pl:706
3139 #: ../examples/guestfs-recipes.pod:134
3141 "The final dot of the command is not a printing error. It means we want to "
3142 "copy out to the current directory."
3146 #: ../examples/guestfs-recipes.pod:139
3147 msgid "This creates a directory called C<home> under the current directory."
3151 #: ../examples/guestfs-recipes.pod:143
3153 "If the guest is a Windows guest then you can use drive letters and "
3154 "backslashes, but you must prefix the path with C<win:> and quote it to "
3155 "protect it from the shell, like this:"
3159 #: ../examples/guestfs-recipes.pod:147
3162 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
3167 #: ../examples/guestfs-recipes.pod:149
3168 msgid "To get the output as a compressed tarball, do:"
3172 #: ../examples/guestfs-recipes.pod:151
3175 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
3180 #: ../examples/guestfs-recipes.pod:153
3182 "Although it sounds tempting, this is usually not a reliable way to get a "
3183 "backup from a running guest. See the entry in the FAQ: "
3184 "http://libguestfs.org/FAQ.html#backup"
3188 #: ../examples/guestfs-recipes.pod:157
3189 msgid "Find out which user is using the most space"
3193 #: ../examples/guestfs-recipes.pod:159
3195 "This simple script examines a Linux guest to find out which user is using "
3196 "the most space in their home directory:"
3200 #: ../examples/guestfs-recipes.pod:162
3208 #: ../examples/guestfs-recipes.pod:164
3216 #: ../examples/guestfs-recipes.pod:166
3225 #: ../examples/guestfs-recipes.pod:169
3228 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
3233 #: ../examples/guestfs-recipes.pod:171
3236 " for d in $(guestfish --remote ls \"$dir\"); do\n"
3237 " echo -n \"$dir/$d\"\n"
3239 " guestfish --remote du \"$dir/$d\";\n"
3240 " done | sort -nr -k 2\n"
3245 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
3248 " guestfish --remote exit\n"
3253 #: ../examples/guestfs-recipes.pod:179
3254 msgid "Get DHCP address from a VM"
3258 #: ../examples/guestfs-recipes.pod:181
3260 "The link below explains the many different possible techniques for getting "
3261 "the last assigned DHCP address of a virtual machine."
3265 #: ../examples/guestfs-recipes.pod:184
3266 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
3270 #: ../examples/guestfs-recipes.pod:186
3272 "In the libguestfs source examples directory you will find the latest version "
3273 "of the C<virt-dhcp-address.c> program."
3277 #: ../examples/guestfs-recipes.pod:189
3278 msgid "Get the operating system product name string"
3282 #: ../examples/guestfs-recipes.pod:191
3283 msgid "Save the following script into a file called C<product-name.sh>:"
3287 #: ../examples/guestfs-recipes.pod:193
3292 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3293 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3294 " guestfish --remote inspect-get-product-name \"$root\"\n"
3295 " guestfish --remote exit\n"
3300 #: ../examples/guestfs-recipes.pod:200
3301 msgid "Make the script executable and run it on a named guest:"
3305 #: ../examples/guestfs-recipes.pod:202
3308 " # product-name.sh RHEL60x64\n"
3309 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
3314 #: ../examples/guestfs-recipes.pod:205
3316 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
3317 "C<xpath> command line tool or from your favourite programming language:"
3321 #: ../examples/guestfs-recipes.pod:209
3324 " # virt-inspector RHEL60x64 > xml\n"
3325 " # xpath '//product_name' < xml\n"
3328 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
3329 "(Santiago)</product_name>\n"
3334 #: ../examples/guestfs-recipes.pod:215
3335 msgid "Get the default boot kernel for a Linux VM"
3339 #: ../examples/guestfs-recipes.pod:217
3341 "The link below contains a program to print the default boot kernel for a "
3346 #: ../examples/guestfs-recipes.pod:220
3347 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
3351 #: ../examples/guestfs-recipes.pod:222
3353 "It uses Augeas, and the technique is generally applicable for many different "
3358 #: ../examples/guestfs-recipes.pod:229
3359 msgid "listing the user accounts in the guest"
3363 #: ../examples/guestfs-recipes.pod:233
3364 msgid "what repositories is it configured to use"
3368 #: ../examples/guestfs-recipes.pod:237
3369 msgid "what NTP servers does it connect to"
3373 #: ../examples/guestfs-recipes.pod:241
3374 msgid "what were the boot messages last time it booted"
3378 #: ../examples/guestfs-recipes.pod:245
3379 msgid "listing who was logged in recently"
3383 #: ../examples/guestfs-recipes.pod:249
3384 msgid "http://augeas.net/"
3388 #: ../examples/guestfs-recipes.pod:251
3389 msgid "Install RPMs in a guest"
3393 #: ../examples/guestfs-recipes.pod:253
3395 "The link below contains a method to install RPMs in a guest. In fact the "
3396 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
3397 "installs them next time the guest is booted. You could use this technique "
3398 "to install vital security updates in an offline guest."
3402 #: ../examples/guestfs-recipes.pod:259
3403 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
3407 #: ../examples/guestfs-recipes.pod:261
3408 msgid "List applications installed in a VM"
3412 #: ../examples/guestfs-recipes.pod:263
3413 msgid "Save the following to a file C<list-apps.sh>:"
3417 #: ../examples/guestfs-recipes.pod:265
3422 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3423 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3424 " guestfish --remote inspect-list-applications \"$root\"\n"
3425 " guestfish --remote exit\n"
3430 #: ../examples/guestfs-recipes.pod:272
3432 "Make the file executable and then you can run it on any named virtual "
3437 #: ../examples/guestfs-recipes.pod:275
3440 " # list-apps.sh WinGuest\n"
3442 " app_name: Mozilla Firefox (3.6.12)\n"
3443 " app_display_name: Mozilla Firefox (3.6.12)\n"
3445 " app_version: 3.6.12 (en-GB)\n"
3447 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
3448 " app_trans_path:\n"
3449 " app_publisher: Mozilla\n"
3450 " app_url: http://www.mozilla.com/en-GB/\n"
3451 " app_source_package:\n"
3453 " app_description: Mozilla Firefox\n"
3456 " app_name: VLC media player\n"
3457 " app_display_name: VLC media player 1.1.5\n"
3459 " app_version: 1.1.5\n"
3461 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
3462 " app_trans_path:\n"
3463 " app_publisher: VideoLAN\n"
3464 " app_url: http://www.videolan.org/\n"
3465 " app_source_package:\n"
3467 " app_description:\n"
3473 #: ../examples/guestfs-recipes.pod:305
3475 "If you want to run the script on disk images (instead of libvirt virtual "
3476 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
3477 "L<virt-inspector(1)>."
3481 #: ../examples/guestfs-recipes.pod:309
3482 msgid "List files and directories in a VM"
3486 #: ../examples/guestfs-recipes.pod:311
3487 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
3491 #: ../examples/guestfs-recipes.pod:313
3494 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
3499 #: ../examples/guestfs-recipes.pod:315
3500 msgid "List services in a Windows VM"
3504 #: ../examples/guestfs-recipes.pod:317
3506 "The link below contains a script that can be used to list out the services "
3507 "from a Windows VM, and whether those services run at boot time or are loaded "
3512 #: ../examples/guestfs-recipes.pod:321
3513 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
3517 #: ../examples/guestfs-recipes.pod:323
3518 msgid "Make a disk image sparse"
3522 #: ../examples/guestfs-recipes.pod:325
3524 "The link below contains some guides for making a disk image sparse (or "
3525 "reintroducing sparseness)."
3529 #: ../examples/guestfs-recipes.pod:328
3530 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
3534 #: ../examples/guestfs-recipes.pod:330
3535 msgid "Monitor disk usage over time"
3539 #: ../examples/guestfs-recipes.pod:332
3541 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
3542 "The link below contains a guide."
3546 #: ../examples/guestfs-recipes.pod:335
3547 msgid "http://virt-tools.org/learning/advanced-virt-df/"
3551 #: ../examples/guestfs-recipes.pod:337
3552 msgid "Reading the Windows Event Log from Windows Vista (or later)"
3556 #: ../examples/guestfs-recipes.pod:339
3558 "L<guestfish(1)> plus the tools described in the link below can be used to "
3559 "read out the Windows Event Log from any virtual machine running Windows "
3560 "Vista or a later version."
3564 #: ../examples/guestfs-recipes.pod:343
3565 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
3569 #: ../examples/guestfs-recipes.pod:345
3570 msgid "Remove root password (Linux)"
3574 #: ../examples/guestfs-recipes.pod:347
3576 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
3577 "files. One use is to remove the root password from a Linux guest:"
3581 #: ../examples/guestfs-recipes.pod:350
3584 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3589 #: ../examples/guestfs-recipes.pod:352
3590 msgid "Remove Administrator password (Windows)"
3594 #: ../examples/guestfs-recipes.pod:354
3596 "The link below contains one technique for removing the Administrator "
3597 "password from a Windows VM, or to be more precise, it gives you a command "
3598 "prompt the next time you log in which you can use to bypass any security:"
3602 #: ../examples/guestfs-recipes.pod:359
3603 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
3607 #: ../examples/guestfs-recipes.pod:361
3608 msgid "Unpack a live CD"
3612 #: ../examples/guestfs-recipes.pod:363
3614 "Linux live CDs often contain multiple layers of disk images wrapped like a "
3615 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
3616 "layers, as outlined in the guide below."
3620 #: ../examples/guestfs-recipes.pod:367
3621 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
3625 #: ../examples/guestfs-recipes.pod:369
3626 msgid "Uploading and downloading files"
3630 #: ../examples/guestfs-recipes.pod:371
3632 "The link below contains general tips on uploading (copying in) and "
3633 "downloading (copying out) files from VMs."
3637 #: ../examples/guestfs-recipes.pod:374
3638 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
3642 #: ../examples/guestfs-recipes.pod:376
3643 msgid "Use libguestfs tools on VMware ESX guests"
3647 #: ../examples/guestfs-recipes.pod:378
3649 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
3650 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
3654 #: ../examples/guestfs-recipes.pod:382
3655 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
3659 #: ../examples/guestfs-recipes.pod:386
3661 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
3662 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
3663 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
3667 #: ../examples/guestfs-recipes.pod:402
3668 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
3672 #: ../fish/guestfish-actions.pod:1
3677 #: ../fish/guestfish-actions.pod:3
3680 " add-cdrom filename\n"
3685 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
3686 msgid "This function adds a virtual CD-ROM disk image to the guest."
3690 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
3691 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
3695 #: ../fish/guestfish-actions.pod:15
3697 "This call checks for the existence of C<filename>. This stops you from "
3698 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3699 "and C<http:> URLs. To specify those, use the general L</config> call "
3704 #: ../fish/guestfish-actions.pod:22
3706 "If you just want to add an ISO file (often you use this as an efficient way "
3707 "to transfer large files into the guest), then you should probably use "
3708 "L</add-drive-ro> instead."
3712 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163 ../fish/guestfish-actions.pod:177
3714 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
3719 #: ../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:3090 ../fish/guestfish-actions.pod:3297 ../fish/guestfish-actions.pod:3411 ../fish/guestfish-actions.pod:3459 ../fish/guestfish-actions.pod:4360 ../fish/guestfish-actions.pod:4383 ../fish/guestfish-actions.pod:4405 ../fish/guestfish-actions.pod:4443 ../fish/guestfish-actions.pod:5092 ../fish/guestfish-actions.pod:5198 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273 ../src/guestfs-actions.pod:1508 ../src/guestfs-actions.pod:2007 ../src/guestfs-actions.pod:2028 ../src/guestfs-actions.pod:4623 ../src/guestfs-actions.pod:4926 ../src/guestfs-actions.pod:5155 ../src/guestfs-actions.pod:5255 ../src/guestfs-actions.pod:6521 ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6599 ../src/guestfs-actions.pod:6662 ../src/guestfs-actions.pod:7594 ../src/guestfs-actions.pod:7703 ../src/guestfs-actions.pod:7886
3721 "Deprecated functions will not be removed from the API, but the fact that "
3722 "they are deprecated indicates that there are problems with correct use of "
3727 #: ../fish/guestfish-actions.pod:35
3732 #: ../fish/guestfish-actions.pod:37
3737 #: ../fish/guestfish-actions.pod:39
3740 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
3746 #: ../fish/guestfish-actions.pod:41
3748 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
3749 "It works by connecting to libvirt, requesting the domain and domain XML from "
3750 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
3754 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
3756 "The number of disks added is returned. This operation is atomic: if an "
3757 "error is returned, then no disks are added."
3761 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
3763 "This function does some minimal checks to make sure the libvirt domain is "
3764 "not running (unless C<readonly> is true). In a future version we will try "
3765 "to acquire the libvirt lock on each disk."
3769 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
3771 "Disks must be accessible locally. This often means that adding disks from a "
3772 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
3773 "unless those disks are accessible via the same device path locally too."
3777 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
3779 "The optional C<libvirturi> parameter sets the libvirt URI (see "
3780 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
3781 "default libvirt URI (or one set through an environment variable, see the "
3782 "libvirt documentation for full details)."
3786 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
3788 "The optional C<live> flag controls whether this call will try to connect to "
3789 "a running virtual machine C<guestfsd> process if it sees a suitable "
3790 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
3791 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
3792 "DAEMONS> for more information."
3796 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
3798 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
3799 "passed instead of the domain name. The C<dom> string is treated as a UUID "
3800 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
3805 #: ../fish/guestfish-actions.pod:76
3807 "The other optional parameters are passed directly through to "
3808 "L</add-drive-opts>."
3812 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143 ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:1973 ../fish/guestfish-actions.pod:3139 ../fish/guestfish-actions.pod:3312 ../fish/guestfish-actions.pod:3447
3814 "This command has one or more optional arguments. See L</OPTIONAL "
3819 #: ../fish/guestfish-actions.pod:81
3824 #: ../fish/guestfish-actions.pod:83
3827 " add-drive filename\n"
3832 #: ../fish/guestfish-actions.pod:85
3834 "This function is the equivalent of calling L</add-drive-opts> with no "
3835 "optional parameters, so the disk is added writable, with the format being "
3836 "detected automatically."
3840 #: ../fish/guestfish-actions.pod:89
3842 "Automatic detection of the format opens you up to a potential security hole "
3843 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3844 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
3845 "you should think about replacing calls to this function with calls to "
3846 "L</add-drive-opts>, and specifying the format."
3850 #: ../fish/guestfish-actions.pod:96
3851 msgid "add-drive-opts"
3855 #: ../fish/guestfish-actions.pod:98
3860 #: ../fish/guestfish-actions.pod:100
3863 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
3868 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
3870 "This function adds a virtual machine disk image C<filename> to libguestfs. "
3871 "The first time you call this function, the disk appears as C</dev/sda>, the "
3872 "second time as C</dev/sdb>, and so on."
3876 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
3878 "You don't necessarily need to be root when using libguestfs. However you "
3879 "obviously do need sufficient permissions to access the filename for whatever "
3880 "operations you want to perform (ie. read access if you just want to read the "
3881 "image or write access if you want to modify the image)."
3885 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
3886 msgid "This call checks that C<filename> exists."
3890 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3101 ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4660
3891 msgid "The optional arguments are:"
3895 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
3900 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
3902 "If true then the image is treated as read-only. Writes are still allowed, "
3903 "but they are stored in a temporary snapshot overlay which is discarded at "
3904 "the end. The disk that you add is not modified."
3908 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
3913 #: ../fish/guestfish-actions.pod:127
3915 "This forces the image format. If you omit this (or use L</add-drive> or "
3916 "L</add-drive-ro>) then the format is automatically detected. Possible "
3917 "formats include C<raw> and C<qcow2>."
3921 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
3923 "Automatic detection of the format opens you up to a potential security hole "
3924 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3925 "RHBZ#642934. Specifying the format closes this security hole."
3929 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
3934 #: ../fish/guestfish-actions.pod:138
3936 "This rarely-used option lets you emulate the behaviour of the deprecated "
3937 "L</add-drive-with-if> call (q.v.)"
3941 #: ../fish/guestfish-actions.pod:145
3942 msgid "add-drive-ro"
3946 #: ../fish/guestfish-actions.pod:147
3951 #: ../fish/guestfish-actions.pod:149
3954 " add-drive-ro filename\n"
3959 #: ../fish/guestfish-actions.pod:151
3961 "This function is the equivalent of calling L</add-drive-opts> with the "
3962 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
3963 "is added read-only, with the format being detected automatically."
3967 #: ../fish/guestfish-actions.pod:156
3968 msgid "add-drive-ro-with-if"
3972 #: ../fish/guestfish-actions.pod:158
3975 " add-drive-ro-with-if filename iface\n"
3980 #: ../fish/guestfish-actions.pod:160
3982 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
3983 "interface emulation to use at run time."
3987 #: ../fish/guestfish-actions.pod:170
3988 msgid "add-drive-with-if"
3992 #: ../fish/guestfish-actions.pod:172
3995 " add-drive-with-if filename iface\n"
4000 #: ../fish/guestfish-actions.pod:174
4002 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4003 "interface emulation to use at run time."
4007 #: ../fish/guestfish-actions.pod:184
4012 #: ../fish/guestfish-actions.pod:186
4015 " aug-clear augpath\n"
4020 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
4022 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4023 "L<augtool(1)> C<clear> command."
4027 #: ../fish/guestfish-actions.pod:191
4032 #: ../fish/guestfish-actions.pod:193
4040 #: ../fish/guestfish-actions.pod:195
4042 "Close the current Augeas handle and free up any resources used by it. After "
4043 "calling this, you have to call L</aug-init> again before you can use any "
4044 "other Augeas functions."
4048 #: ../fish/guestfish-actions.pod:200
4053 #: ../fish/guestfish-actions.pod:202
4056 " aug-defnode name expr val\n"
4061 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
4062 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4066 #: ../fish/guestfish-actions.pod:207
4068 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4069 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
4070 "containing that single node."
4074 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
4076 "On success this returns a pair containing the number of nodes in the "
4077 "nodeset, and a boolean flag if a node was created."
4081 #: ../fish/guestfish-actions.pod:215
4086 #: ../fish/guestfish-actions.pod:217
4089 " aug-defvar name expr\n"
4094 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
4096 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4097 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4101 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
4103 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4104 "evaluates to something which is not a nodeset."
4108 #: ../fish/guestfish-actions.pod:226
4113 #: ../fish/guestfish-actions.pod:228
4116 " aug-get augpath\n"
4121 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
4123 "Look up the value associated with C<path>. If C<path> matches exactly one "
4124 "node, the C<value> is returned."
4128 #: ../fish/guestfish-actions.pod:233
4133 #: ../fish/guestfish-actions.pod:235
4136 " aug-init root flags\n"
4141 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
4143 "Create a new Augeas handle for editing configuration files. If there was "
4144 "any previous Augeas handle associated with this guestfs session, then it is "
4149 #: ../fish/guestfish-actions.pod:241
4150 msgid "You must call this before using any other L</aug-*> commands."
4154 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
4155 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4159 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
4161 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4162 "logical I<or> of the following integers:"
4166 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
4167 msgid "C<AUG_SAVE_BACKUP> = 1"
4171 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
4172 msgid "Keep the original file with a C<.augsave> extension."
4176 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
4177 msgid "C<AUG_SAVE_NEWFILE> = 2"
4181 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
4183 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4184 "original. Overrides C<AUG_SAVE_BACKUP>."
4188 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
4189 msgid "C<AUG_TYPE_CHECK> = 4"
4193 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
4194 msgid "Typecheck lenses."
4198 #: ../fish/guestfish-actions.pod:266
4200 "This option is only useful when debugging Augeas lenses. Use of this option "
4201 "may require additional memory for the libguestfs appliance. You may need to "
4202 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
4206 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
4207 msgid "C<AUG_NO_STDINC> = 8"
4211 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
4212 msgid "Do not use standard load path for modules."
4216 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
4217 msgid "C<AUG_SAVE_NOOP> = 16"
4221 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
4222 msgid "Make save a no-op, just record what would have been changed."
4226 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
4227 msgid "C<AUG_NO_LOAD> = 32"
4231 #: ../fish/guestfish-actions.pod:281
4232 msgid "Do not load the tree in L</aug-init>."
4236 #: ../fish/guestfish-actions.pod:285
4237 msgid "To close the handle, you can call L</aug-close>."
4241 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
4242 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4246 #: ../fish/guestfish-actions.pod:289
4251 #: ../fish/guestfish-actions.pod:291
4254 " aug-insert augpath label true|false\n"
4259 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
4261 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4262 "or after C<path> (depending on the boolean flag C<before>)."
4266 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
4268 "C<path> must match exactly one existing node in the tree, and C<label> must "
4269 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4273 #: ../fish/guestfish-actions.pod:301
4278 #: ../fish/guestfish-actions.pod:303
4286 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
4287 msgid "Load files into the tree."
4291 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
4292 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4296 #: ../fish/guestfish-actions.pod:310
4301 #: ../fish/guestfish-actions.pod:312
4309 #: ../fish/guestfish-actions.pod:314
4311 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4312 "resulting nodes into alphabetical order."
4316 #: ../fish/guestfish-actions.pod:317
4321 #: ../fish/guestfish-actions.pod:319
4324 " aug-match augpath\n"
4329 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
4331 "Returns a list of paths which match the path expression C<path>. The "
4332 "returned paths are sufficiently qualified so that they match exactly one "
4333 "node in the current tree."
4337 #: ../fish/guestfish-actions.pod:325
4342 #: ../fish/guestfish-actions.pod:327
4345 " aug-mv src dest\n"
4350 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
4352 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4353 "C<dest> is overwritten if it exists."
4357 #: ../fish/guestfish-actions.pod:332
4362 #: ../fish/guestfish-actions.pod:334
4370 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
4371 msgid "Remove C<path> and all of its children."
4375 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
4376 msgid "On success this returns the number of entries which were removed."
4380 #: ../fish/guestfish-actions.pod:340
4385 #: ../fish/guestfish-actions.pod:342
4393 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
4394 msgid "This writes all pending changes to disk."
4398 #: ../fish/guestfish-actions.pod:346
4400 "The flags which were passed to L</aug-init> affect exactly how files are "
4405 #: ../fish/guestfish-actions.pod:349
4410 #: ../fish/guestfish-actions.pod:351
4413 " aug-set augpath val\n"
4418 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
4419 msgid "Set the value associated with C<path> to C<val>."
4423 #: ../fish/guestfish-actions.pod:355
4425 "In the Augeas API, it is possible to clear a node by setting the value to "
4426 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4427 "this call. Instead you must use the L</aug-clear> call."
4431 #: ../fish/guestfish-actions.pod:360
4436 #: ../fish/guestfish-actions.pod:362
4439 " available 'groups ...'\n"
4444 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
4446 "This command is used to check the availability of some groups of "
4447 "functionality in the appliance, which not all builds of the libguestfs "
4448 "appliance will be able to provide."
4452 #: ../fish/guestfish-actions.pod:368
4454 "The libguestfs groups, and the functions that those groups correspond to, "
4455 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4456 "runtime by calling L</available-all-groups>."
4460 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
4462 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4463 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4464 "and Augeas (configuration file editing) functions."
4468 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
4469 msgid "The command returns no error if I<all> requested groups are available."
4473 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
4475 "It fails with an error if one or more of the requested groups is unavailable "
4480 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
4482 "If an unknown group name is included in the list of groups then an error is "
4487 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
4492 #: ../fish/guestfish-actions.pod:392
4493 msgid "You must call L</launch> before calling this function."
4497 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
4499 "The reason is because we don't know what groups are supported by the "
4500 "appliance/daemon until it is running and can be queried."
4504 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
4506 "If a group of functions is available, this does not necessarily mean that "
4507 "they will work. You still have to check for errors when calling individual "
4508 "API functions even if they are available."
4512 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
4514 "It is usually the job of distro packagers to build complete functionality "
4515 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4516 "with all requirements satisfied, will support everything."
4520 #: ../fish/guestfish-actions.pod:414
4522 "This call was added in version C<1.0.80>. In previous versions of "
4523 "libguestfs all you could do would be to speculatively execute a command to "
4524 "find out if the daemon implemented it. See also L</version>."
4528 #: ../fish/guestfish-actions.pod:421
4529 msgid "available-all-groups"
4533 #: ../fish/guestfish-actions.pod:423
4536 " available-all-groups\n"
4541 #: ../fish/guestfish-actions.pod:425
4543 "This command returns a list of all optional groups that this daemon knows "
4544 "about. Note this returns both supported and unsupported groups. To find "
4545 "out which ones the daemon can actually support you have to call "
4546 "L</available> on each member of the returned list."
4550 #: ../fish/guestfish-actions.pod:431
4551 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
4555 #: ../fish/guestfish-actions.pod:433
4560 #: ../fish/guestfish-actions.pod:435
4563 " base64-in (base64file|-) filename\n"
4568 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
4569 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4573 #: ../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:4663 ../fish/guestfish-actions.pod:4675 ../fish/guestfish-actions.pod:4686 ../fish/guestfish-actions.pod:4697 ../fish/guestfish-actions.pod:4749 ../fish/guestfish-actions.pod:4758 ../fish/guestfish-actions.pod:4812 ../fish/guestfish-actions.pod:4835
4574 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
4578 #: ../fish/guestfish-actions.pod:442
4583 #: ../fish/guestfish-actions.pod:444
4586 " base64-out filename (base64file|-)\n"
4591 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
4593 "This command downloads the contents of C<filename>, writing it out to local "
4594 "file C<base64file> encoded as base64."
4598 #: ../fish/guestfish-actions.pod:451
4599 msgid "blockdev-flushbufs"
4603 #: ../fish/guestfish-actions.pod:453
4606 " blockdev-flushbufs device\n"
4611 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
4612 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4616 #: ../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
4617 msgid "This uses the L<blockdev(8)> command."
4621 #: ../fish/guestfish-actions.pod:460
4622 msgid "blockdev-getbsz"
4626 #: ../fish/guestfish-actions.pod:462
4629 " blockdev-getbsz device\n"
4634 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
4635 msgid "This returns the block size of a device."
4639 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529 ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
4641 "(Note this is different from both I<size in blocks> and I<filesystem block "
4646 #: ../fish/guestfish-actions.pod:471
4647 msgid "blockdev-getro"
4651 #: ../fish/guestfish-actions.pod:473
4654 " blockdev-getro device\n"
4659 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
4661 "Returns a boolean indicating if the block device is read-only (true if "
4662 "read-only, false if not)."
4666 #: ../fish/guestfish-actions.pod:480
4667 msgid "blockdev-getsize64"
4671 #: ../fish/guestfish-actions.pod:482
4674 " blockdev-getsize64 device\n"
4679 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
4680 msgid "This returns the size of the device in bytes."
4684 #: ../fish/guestfish-actions.pod:486
4685 msgid "See also L</blockdev-getsz>."
4689 #: ../fish/guestfish-actions.pod:490
4690 msgid "blockdev-getss"
4694 #: ../fish/guestfish-actions.pod:492
4697 " blockdev-getss device\n"
4702 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
4704 "This returns the size of sectors on a block device. Usually 512, but can be "
4705 "larger for modern devices."
4709 #: ../fish/guestfish-actions.pod:497
4710 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
4714 #: ../fish/guestfish-actions.pod:502
4715 msgid "blockdev-getsz"
4719 #: ../fish/guestfish-actions.pod:504
4722 " blockdev-getsz device\n"
4727 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
4729 "This returns the size of the device in units of 512-byte sectors (even if "
4730 "the sectorsize isn't 512 bytes ... weird)."
4734 #: ../fish/guestfish-actions.pod:509
4736 "See also L</blockdev-getss> for the real sector size of the device, and "
4737 "L</blockdev-getsize64> for the more useful I<size in bytes>."
4741 #: ../fish/guestfish-actions.pod:515
4742 msgid "blockdev-rereadpt"
4746 #: ../fish/guestfish-actions.pod:517
4749 " blockdev-rereadpt device\n"
4754 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
4755 msgid "Reread the partition table on C<device>."
4759 #: ../fish/guestfish-actions.pod:523
4760 msgid "blockdev-setbsz"
4764 #: ../fish/guestfish-actions.pod:525
4767 " blockdev-setbsz device blocksize\n"
4772 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
4773 msgid "This sets the block size of a device."
4777 #: ../fish/guestfish-actions.pod:534
4778 msgid "blockdev-setro"
4782 #: ../fish/guestfish-actions.pod:536
4785 " blockdev-setro device\n"
4790 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
4791 msgid "Sets the block device named C<device> to read-only."
4795 #: ../fish/guestfish-actions.pod:542
4796 msgid "blockdev-setrw"
4800 #: ../fish/guestfish-actions.pod:544
4803 " blockdev-setrw device\n"
4808 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
4809 msgid "Sets the block device named C<device> to read-write."
4813 #: ../fish/guestfish-actions.pod:550
4814 msgid "btrfs-filesystem-resize"
4818 #: ../fish/guestfish-actions.pod:552
4821 " btrfs-filesystem-resize mountpoint [size:..]\n"
4826 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
4827 msgid "This command resizes a btrfs filesystem."
4831 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
4833 "Note that unlike other resize calls, the filesystem has to be mounted and "
4834 "the parameter is the mountpoint not the device (this is a requirement of "
4839 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3422 ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5194
4840 msgid "The optional parameters are:"
4844 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3426 ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5198
4849 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
4851 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
4852 "resized to the maximum size."
4856 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
4857 msgid "See also L<btrfs(8)>."
4861 #: ../fish/guestfish-actions.pod:575
4862 msgid "case-sensitive-path"
4866 #: ../fish/guestfish-actions.pod:577
4869 " case-sensitive-path path\n"
4874 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
4876 "This can be used to resolve case insensitive paths on a filesystem which is "
4877 "case sensitive. The use case is to resolve paths which you have read from "
4878 "Windows configuration files or the Windows Registry, to the true path."
4882 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
4884 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4885 "(and probably others), which is that although the underlying filesystem is "
4886 "case-insensitive, the driver exports the filesystem to Linux as "
4891 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
4893 "One consequence of this is that special directories such as C<c:\\windows> "
4894 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4895 "precise details of how they were created. In Windows itself this would not "
4900 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
4902 "Bug or feature? You decide: "
4903 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
4907 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
4909 "This function resolves the true case of each element in the path and returns "
4910 "the case-sensitive path."
4914 #: ../fish/guestfish-actions.pod:601
4916 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
4917 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4918 "how the directories were originally created under Windows)."
4922 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
4923 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4927 #: ../fish/guestfish-actions.pod:609
4928 msgid "See also L</realpath>."
4932 #: ../fish/guestfish-actions.pod:611
4937 #: ../fish/guestfish-actions.pod:613
4945 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3842 ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5837
4946 msgid "Return the contents of the file named C<path>."
4950 #: ../fish/guestfish-actions.pod:617
4952 "Note that this function cannot correctly handle binary files (specifically, "
4953 "files containing C<\\0> character which is treated as end of string). For "
4954 "those you need to use the L</read-file> or L</download> functions which have "
4955 "a more complex interface."
4959 #: ../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:1569 ../fish/guestfish-actions.pod:1584 ../fish/guestfish-actions.pod:1594 ../fish/guestfish-actions.pod:1613 ../fish/guestfish-actions.pod:3712 ../fish/guestfish-actions.pod:3727 ../fish/guestfish-actions.pod:3803 ../fish/guestfish-actions.pod:3820 ../fish/guestfish-actions.pod:3835 ../fish/guestfish-actions.pod:4504 ../fish/guestfish-actions.pod:4550 ../fish/guestfish-actions.pod:4635 ../fish/guestfish-actions.pod:4650 ../fish/guestfish-actions.pod:5056 ../fish/guestfish-actions.pod:5068 ../fish/guestfish-actions.pod:5086 ../fish/guestfish-actions.pod:5103 ../fish/guestfish-actions.pod:5113 ../fish/guestfish-actions.pod:5170 ../fish/guestfish-actions.pod:5180 ../fish/guestfish-actions.pod:5209 ../fish/guestfish-actions.pod:5219 ../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:2363 ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2404 ../src/guestfs-actions.pod:2433 ../src/guestfs-actions.pod:5619 ../src/guestfs-actions.pod:5645 ../src/guestfs-actions.pod:5776 ../src/guestfs-actions.pod:5802 ../src/guestfs-actions.pod:5826 ../src/guestfs-actions.pod:6777 ../src/guestfs-actions.pod:6832 ../src/guestfs-actions.pod:6978 ../src/guestfs-actions.pod:7002 ../src/guestfs-actions.pod:7667 ../src/guestfs-actions.pod:7687 ../src/guestfs-actions.pod:7720 ../src/guestfs-actions.pod:7739 ../src/guestfs-actions.pod:7758 ../src/guestfs-actions.pod:7852 ../src/guestfs-actions.pod:7871 ../src/guestfs-actions.pod:7917 ../src/guestfs-actions.pod:7936
4961 "Because of the message protocol, there is a transfer limit of somewhere "
4962 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4966 #: ../fish/guestfish-actions.pod:625
4971 #: ../fish/guestfish-actions.pod:627
4974 " checksum csumtype path\n"
4979 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
4980 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
4984 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
4986 "The type of checksum to compute is given by the C<csumtype> parameter which "
4987 "must have one of the following values:"
4991 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
4996 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
4998 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5003 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
5008 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
5009 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5013 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
5018 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
5019 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5023 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
5028 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
5029 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5033 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
5038 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
5039 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5043 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
5048 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
5049 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5053 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
5058 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
5059 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5063 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
5064 msgid "The checksum is returned as a printable string."
5068 #: ../fish/guestfish-actions.pod:670
5069 msgid "To get the checksum for a device, use L</checksum-device>."
5073 #: ../fish/guestfish-actions.pod:672
5074 msgid "To get the checksums for many files, use L</checksums-out>."
5078 #: ../fish/guestfish-actions.pod:674
5079 msgid "checksum-device"
5083 #: ../fish/guestfish-actions.pod:676
5086 " checksum-device csumtype device\n"
5091 #: ../fish/guestfish-actions.pod:678
5093 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5094 "device named C<device>. For the types of checksums supported see the "
5095 "L</checksum> command."
5099 #: ../fish/guestfish-actions.pod:682
5100 msgid "checksums-out"
5104 #: ../fish/guestfish-actions.pod:684
5107 " checksums-out csumtype directory (sumsfile|-)\n"
5112 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
5114 "This command computes the checksums of all regular files in C<directory> and "
5115 "then emits a list of those checksums to the local output file C<sumsfile>."
5119 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
5121 "This can be used for verifying the integrity of a virtual machine. However "
5122 "to be properly secure you should pay attention to the output of the checksum "
5123 "command (it uses the ones from GNU coreutils). In particular when the "
5124 "filename is not printable, coreutils uses a special backslash syntax. For "
5125 "more information, see the GNU coreutils info file."
5129 #: ../fish/guestfish-actions.pod:700
5134 #: ../fish/guestfish-actions.pod:702
5137 " chmod mode path\n"
5142 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
5144 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5149 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
5151 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5152 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5157 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3065 ../fish/guestfish-actions.pod:3204 ../fish/guestfish-actions.pod:3214 ../fish/guestfish-actions.pod:3224 ../src/guestfs-actions.pod:1064 ../src/guestfs-actions.pod:4591 ../src/guestfs-actions.pod:4800 ../src/guestfs-actions.pod:4819 ../src/guestfs-actions.pod:4838
5158 msgid "The mode actually set is affected by the umask."
5162 #: ../fish/guestfish-actions.pod:713
5167 #: ../fish/guestfish-actions.pod:715
5170 " chown owner group path\n"
5175 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
5176 msgid "Change the file owner to C<owner> and group to C<group>."
5180 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2500 ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3662
5182 "Only numeric uid and gid are supported. If you want to use names, you will "
5183 "need to locate and parse the password file yourself (Augeas support makes "
5184 "this relatively easy)."
5188 #: ../fish/guestfish-actions.pod:723
5193 #: ../fish/guestfish-actions.pod:725
5196 " command 'arguments ...'\n"
5201 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
5203 "This call runs a command from the guest filesystem. The filesystem must be "
5204 "mounted, and must contain a compatible operating system (ie. something "
5205 "Linux, with the same or compatible processor architecture)."
5209 #: ../fish/guestfish-actions.pod:732
5211 "The single parameter is an argv-style list of arguments. The first element "
5212 "is the name of the program to run. Subsequent elements are parameters. The "
5213 "list must be non-empty (ie. must contain a program name). Note that the "
5214 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5218 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
5219 msgid "The return value is anything printed to I<stdout> by the command."
5223 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
5225 "If the command returns a non-zero exit status, then this function returns an "
5226 "error message. The error message string is the content of I<stderr> from "
5231 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5233 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5234 "C</bin>. If you require a program from another location, you should provide "
5235 "the full path in the first parameter."
5239 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
5241 "Shared libraries and data files required by the program must be available on "
5242 "filesystems which are mounted in the correct places. It is the caller's "
5243 "responsibility to ensure all filesystems that are needed are mounted at the "
5248 #: ../fish/guestfish-actions.pod:760
5249 msgid "command-lines"
5253 #: ../fish/guestfish-actions.pod:762
5256 " command-lines 'arguments ...'\n"
5261 #: ../fish/guestfish-actions.pod:764
5262 msgid "This is the same as L</command>, but splits the result into a list of lines."
5266 #: ../fish/guestfish-actions.pod:767
5267 msgid "See also: L</sh-lines>"
5271 #: ../fish/guestfish-actions.pod:772
5276 #: ../fish/guestfish-actions.pod:774
5279 " config qemuparam qemuvalue\n"
5284 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1159
5286 "This can be used to add arbitrary qemu command line parameters of the form "
5287 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
5288 "setting some parameters which would interfere with parameters that we use."
5292 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1164
5293 msgid "The first character of C<param> string must be a C<-> (dash)."
5297 #: ../fish/guestfish-actions.pod:783 ../src/guestfs-actions.pod:1166
5298 msgid "C<value> can be NULL."
5302 #: ../fish/guestfish-actions.pod:785
5307 #: ../fish/guestfish-actions.pod:787
5310 " copy-size src dest size\n"
5315 #: ../fish/guestfish-actions.pod:789 ../src/guestfs-actions.pod:1180
5317 "This command copies exactly C<size> bytes from one source device or file "
5318 "C<src> to another destination device or file C<dest>."
5322 #: ../fish/guestfish-actions.pod:792 ../src/guestfs-actions.pod:1183
5324 "Note this will fail if the source is too short or if the destination is not "
5329 #: ../fish/guestfish-actions.pod:795
5334 #: ../fish/guestfish-actions.pod:797
5342 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1202
5344 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5345 "destination filename or destination directory."
5349 #: ../fish/guestfish-actions.pod:802
5354 #: ../fish/guestfish-actions.pod:804
5362 #: ../fish/guestfish-actions.pod:806 ../src/guestfs-actions.pod:1216
5364 "This copies a file or directory from C<src> to C<dest> recursively using the "
5369 #: ../fish/guestfish-actions.pod:809
5374 #: ../fish/guestfish-actions.pod:811
5382 #: ../fish/guestfish-actions.pod:813 ../src/guestfs-actions.pod:1230
5384 "This command copies from one source device or file C<src> to another "
5385 "destination device or file C<dest>. Normally you would use this to copy to "
5386 "or from a device or partition, for example to duplicate a filesystem."
5390 #: ../fish/guestfish-actions.pod:818
5392 "If the destination is a device, it must be as large or larger than the "
5393 "source file or device, otherwise the copy will fail. This command cannot do "
5394 "partial copies (see L</copy-size>)."
5398 #: ../fish/guestfish-actions.pod:822
5403 #: ../fish/guestfish-actions.pod:824
5411 #: ../fish/guestfish-actions.pod:826 ../src/guestfs-actions.pod:1248
5412 msgid "This command runs the C<df> command to report disk space used."
5416 #: ../fish/guestfish-actions.pod:828 ../fish/guestfish-actions.pod:839
5418 "This command is mostly useful for interactive sessions. It is I<not> "
5419 "intended that you try to parse the output string. Use L</statvfs> from "
5424 #: ../fish/guestfish-actions.pod:832
5429 #: ../fish/guestfish-actions.pod:834
5437 #: ../fish/guestfish-actions.pod:836 ../src/guestfs-actions.pod:1264
5439 "This command runs the C<df -h> command to report disk space used in "
5440 "human-readable format."
5444 #: ../fish/guestfish-actions.pod:843
5449 #: ../fish/guestfish-actions.pod:845
5457 #: ../fish/guestfish-actions.pod:847 ../src/guestfs-actions.pod:1281
5459 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5460 "This is sometimes useful for extended debugging of problems."
5464 #: ../fish/guestfish-actions.pod:851
5466 "Another way to get the same information is to enable verbose messages with "
5467 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
5468 "before running the program."
5472 #: ../fish/guestfish-actions.pod:856
5477 #: ../fish/guestfish-actions.pod:858
5480 " download remotefilename (filename|-)\n"
5485 #: ../fish/guestfish-actions.pod:860 ../fish/guestfish-actions.pod:873 ../src/guestfs-actions.pod:1302 ../src/guestfs-actions.pod:1327
5487 "Download file C<remotefilename> and save it as C<filename> on the local "
5492 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:4808 ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:7237
5493 msgid "C<filename> can also be a named pipe."
5497 #: ../fish/guestfish-actions.pod:865
5498 msgid "See also L</upload>, L</cat>."
5502 #: ../fish/guestfish-actions.pod:869
5503 msgid "download-offset"
5507 #: ../fish/guestfish-actions.pod:871
5510 " download-offset remotefilename (filename|-) offset size\n"
5515 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1330
5517 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5518 "region must be within the file or device)."
5522 #: ../fish/guestfish-actions.pod:879
5524 "Note that there is no limit on the amount of data that can be downloaded "
5525 "with this call, unlike with L</pread>, and this call always reads the full "
5526 "amount unless an error occurs."
5530 #: ../fish/guestfish-actions.pod:884
5531 msgid "See also L</download>, L</pread>."
5535 #: ../fish/guestfish-actions.pod:888
5540 #: ../fish/guestfish-actions.pod:890
5543 " drop-caches whattodrop\n"
5548 #: ../fish/guestfish-actions.pod:892 ../src/guestfs-actions.pod:1355
5550 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5551 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5552 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5556 #: ../fish/guestfish-actions.pod:897 ../src/guestfs-actions.pod:1360
5557 msgid "Setting C<whattodrop> to 3 should drop everything."
5561 #: ../fish/guestfish-actions.pod:899 ../src/guestfs-actions.pod:1362
5563 "This automatically calls L<sync(2)> before the operation, so that the "
5564 "maximum guest memory is freed."
5568 #: ../fish/guestfish-actions.pod:902
5573 #: ../fish/guestfish-actions.pod:904
5581 #: ../fish/guestfish-actions.pod:906 ../src/guestfs-actions.pod:1375
5583 "This command runs the C<du -s> command to estimate file space usage for "
5588 #: ../fish/guestfish-actions.pod:909 ../src/guestfs-actions.pod:1378
5590 "C<path> can be a file or a directory. If C<path> is a directory then the "
5591 "estimate includes the contents of the directory and all subdirectories "
5596 #: ../fish/guestfish-actions.pod:913 ../src/guestfs-actions.pod:1382
5597 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5601 #: ../fish/guestfish-actions.pod:916
5606 #: ../fish/guestfish-actions.pod:918
5609 " e2fsck-f device\n"
5614 #: ../fish/guestfish-actions.pod:920 ../src/guestfs-actions.pod:1400
5616 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5617 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
5622 #: ../fish/guestfish-actions.pod:924
5624 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
5625 "should use L</fsck>."
5629 #: ../fish/guestfish-actions.pod:927
5634 #: ../fish/guestfish-actions.pod:929
5637 " echo-daemon 'words ...'\n"
5642 #: ../fish/guestfish-actions.pod:931 ../src/guestfs-actions.pod:1417
5644 "This command concatenates the list of C<words> passed with single spaces "
5645 "between them and returns the resulting string."
5649 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1420
5650 msgid "You can use this command to test the connection through to the daemon."
5654 #: ../fish/guestfish-actions.pod:936
5655 msgid "See also L</ping-daemon>."
5659 #: ../fish/guestfish-actions.pod:938
5664 #: ../fish/guestfish-actions.pod:940
5667 " egrep regex path\n"
5672 #: ../fish/guestfish-actions.pod:942 ../src/guestfs-actions.pod:1436
5673 msgid "This calls the external C<egrep> program and returns the matching lines."
5677 #: ../fish/guestfish-actions.pod:948
5682 #: ../fish/guestfish-actions.pod:950
5685 " egrepi regex path\n"
5690 #: ../fish/guestfish-actions.pod:952 ../src/guestfs-actions.pod:1455
5691 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5695 #: ../fish/guestfish-actions.pod:958
5700 #: ../fish/guestfish-actions.pod:960
5703 " equal file1 file2\n"
5708 #: ../fish/guestfish-actions.pod:962 ../src/guestfs-actions.pod:1474
5710 "This compares the two files C<file1> and C<file2> and returns true if their "
5711 "content is exactly equal, or false otherwise."
5715 #: ../fish/guestfish-actions.pod:965 ../src/guestfs-actions.pod:1477
5716 msgid "The external L<cmp(1)> program is used for the comparison."
5720 #: ../fish/guestfish-actions.pod:967
5725 #: ../fish/guestfish-actions.pod:969
5733 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1489
5735 "This returns C<true> if and only if there is a file, directory (or anything) "
5736 "with the given C<path> name."
5740 #: ../fish/guestfish-actions.pod:974
5741 msgid "See also L</is-file>, L</is-dir>, L</stat>."
5745 #: ../fish/guestfish-actions.pod:976
5750 #: ../fish/guestfish-actions.pod:978
5753 " fallocate path len\n"
5758 #: ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:999 ../src/guestfs-actions.pod:1512 ../src/guestfs-actions.pod:1531
5760 "This command preallocates a file (containing zero bytes) named C<path> of "
5761 "size C<len> bytes. If the file exists already, it is overwritten."
5765 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1516
5767 "Do not confuse this with the guestfish-specific C<alloc> command which "
5768 "allocates a file in the host and attaches it as a device."
5772 #: ../fish/guestfish-actions.pod:988
5774 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
5779 #: ../fish/guestfish-actions.pod:995
5784 #: ../fish/guestfish-actions.pod:997
5787 " fallocate64 path len\n"
5792 #: ../fish/guestfish-actions.pod:1003
5794 "Note that this call allocates disk blocks for the file. To create a sparse "
5795 "file use L</truncate-size> instead."
5799 #: ../fish/guestfish-actions.pod:1006
5801 "The deprecated call L</fallocate> does the same, but owing to an oversight "
5802 "it only allowed 30 bit lengths to be specified, effectively limiting the "
5803 "maximum size of files created through that call to 1GB."
5807 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1543
5809 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5810 "commands which create a file in the host and attach it as a device."
5814 #: ../fish/guestfish-actions.pod:1015
5819 #: ../fish/guestfish-actions.pod:1017
5822 " fgrep pattern path\n"
5827 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1558
5828 msgid "This calls the external C<fgrep> program and returns the matching lines."
5832 #: ../fish/guestfish-actions.pod:1025
5837 #: ../fish/guestfish-actions.pod:1027
5840 " fgrepi pattern path\n"
5845 #: ../fish/guestfish-actions.pod:1029 ../src/guestfs-actions.pod:1577
5846 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
5850 #: ../fish/guestfish-actions.pod:1035
5855 #: ../fish/guestfish-actions.pod:1037
5863 #: ../fish/guestfish-actions.pod:1039 ../src/guestfs-actions.pod:1595
5865 "This call uses the standard L<file(1)> command to determine the type or "
5866 "contents of the file."
5870 #: ../fish/guestfish-actions.pod:1042 ../src/guestfs-actions.pod:1598
5872 "This call will also transparently look inside various types of compressed "
5877 #: ../fish/guestfish-actions.pod:1045 ../src/guestfs-actions.pod:1601
5879 "The exact command which runs is C<file -zb path>. Note in particular that "
5880 "the filename is not prepended to the output (the I<-b> option)."
5884 #: ../fish/guestfish-actions.pod:1049 ../src/guestfs-actions.pod:1605
5886 "The output depends on the output of the underlying L<file(1)> command and it "
5887 "can change in future in ways beyond our control. In other words, the output "
5888 "is not guaranteed by the ABI."
5892 #: ../fish/guestfish-actions.pod:1053
5894 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
5895 "(etc), L</is-zero>."
5899 #: ../fish/guestfish-actions.pod:1056
5900 msgid "file-architecture"
5904 #: ../fish/guestfish-actions.pod:1058
5907 " file-architecture filename\n"
5912 #: ../fish/guestfish-actions.pod:1060 ../src/guestfs-actions.pod:1623
5914 "This detects the architecture of the binary C<filename>, and returns it if "
5919 #: ../fish/guestfish-actions.pod:1063 ../src/guestfs-actions.pod:1626
5920 msgid "Currently defined architectures are:"
5924 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1630
5929 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1632
5931 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
5932 "irrespective of the precise processor requirements of the binary."
5936 #: ../fish/guestfish-actions.pod:1072 ../src/guestfs-actions.pod:1635
5941 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1637
5942 msgid "64 bit x86-64."
5946 #: ../fish/guestfish-actions.pod:1076 ../src/guestfs-actions.pod:1639
5951 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1641
5952 msgid "32 bit SPARC."
5956 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1643
5961 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1645
5962 msgid "64 bit SPARC V9 and above."
5966 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1647
5971 #: ../fish/guestfish-actions.pod:1086 ../src/guestfs-actions.pod:1649
5972 msgid "Intel Itanium."
5976 #: ../fish/guestfish-actions.pod:1088 ../src/guestfs-actions.pod:1651
5981 #: ../fish/guestfish-actions.pod:1090 ../src/guestfs-actions.pod:1653
5982 msgid "32 bit Power PC."
5986 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1655
5991 #: ../fish/guestfish-actions.pod:1094 ../src/guestfs-actions.pod:1657
5992 msgid "64 bit Power PC."
5996 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1661
5997 msgid "Libguestfs may return other architecture strings in future."
6001 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1663
6002 msgid "The function works on at least the following types of files:"
6006 #: ../fish/guestfish-actions.pod:1106 ../src/guestfs-actions.pod:1669
6007 msgid "many types of Un*x and Linux binary"
6011 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1673
6012 msgid "many types of Un*x and Linux shared library"
6016 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1677
6017 msgid "Windows Win32 and Win64 binaries"
6021 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1681
6022 msgid "Windows Win32 and Win64 DLLs"
6026 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1683
6027 msgid "Win32 binaries and DLLs return C<i386>."
6031 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1685
6032 msgid "Win64 binaries and DLLs return C<x86_64>."
6036 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1689
6037 msgid "Linux kernel modules"
6041 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1693
6042 msgid "Linux new-style initrd images"
6046 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1697
6047 msgid "some non-x86 Linux vmlinuz kernels"
6051 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1701
6052 msgid "What it can't do currently:"
6056 #: ../fish/guestfish-actions.pod:1144 ../src/guestfs-actions.pod:1707
6057 msgid "static libraries (libfoo.a)"
6061 #: ../fish/guestfish-actions.pod:1148 ../src/guestfs-actions.pod:1711
6062 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6066 #: ../fish/guestfish-actions.pod:1152 ../src/guestfs-actions.pod:1715
6067 msgid "x86 Linux vmlinuz kernels"
6071 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1717
6073 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6074 "compressed code, and are horribly hard to unpack. If you want to find the "
6075 "architecture of a kernel, use the architecture of the associated initrd or "
6076 "kernel module(s) instead."
6080 #: ../fish/guestfish-actions.pod:1161
6085 #: ../fish/guestfish-actions.pod:1163
6093 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1735
6094 msgid "This command returns the size of C<file> in bytes."
6098 #: ../fish/guestfish-actions.pod:1167
6100 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
6101 "L</is-file> etc. To get the size of block devices, use "
6102 "L</blockdev-getsize64>."
6106 #: ../fish/guestfish-actions.pod:1171
6111 #: ../fish/guestfish-actions.pod:1173
6114 " fill c len path\n"
6119 #: ../fish/guestfish-actions.pod:1175 ../src/guestfs-actions.pod:1753
6121 "This command creates a new file called C<path>. The initial content of the "
6122 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6127 #: ../fish/guestfish-actions.pod:1179
6129 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6130 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6135 #: ../fish/guestfish-actions.pod:1184
6136 msgid "fill-pattern"
6140 #: ../fish/guestfish-actions.pod:1186
6143 " fill-pattern pattern len path\n"
6148 #: ../fish/guestfish-actions.pod:1188
6150 "This function is like L</fill> except that it creates a new file of length "
6151 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6152 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6157 #: ../fish/guestfish-actions.pod:1193
6162 #: ../fish/guestfish-actions.pod:1195
6170 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:1799
6172 "This command lists out all files and directories, recursively, starting at "
6173 "C<directory>. It is essentially equivalent to running the shell command "
6174 "C<find directory -print> but some post-processing happens on the output, "
6179 #: ../fish/guestfish-actions.pod:1202 ../src/guestfs-actions.pod:1804
6181 "This returns a list of strings I<without any prefix>. Thus if the directory "
6186 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1807
6196 #: ../fish/guestfish-actions.pod:1209
6197 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6201 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:1814
6212 #: ../fish/guestfish-actions.pod:1217 ../src/guestfs-actions.pod:1819
6213 msgid "If C<directory> is not a directory, then this command returns an error."
6217 #: ../fish/guestfish-actions.pod:1220 ../src/guestfs-actions.pod:1822
6218 msgid "The returned list is sorted."
6222 #: ../fish/guestfish-actions.pod:1222
6223 msgid "See also L</find0>."
6227 #: ../fish/guestfish-actions.pod:1227
6232 #: ../fish/guestfish-actions.pod:1229
6235 " find0 directory (files|-)\n"
6240 #: ../fish/guestfish-actions.pod:1231 ../src/guestfs-actions.pod:1842
6242 "This command lists out all files and directories, recursively, starting at "
6243 "C<directory>, placing the resulting list in the external file called "
6248 #: ../fish/guestfish-actions.pod:1235
6249 msgid "This command works the same way as L</find> with the following exceptions:"
6253 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1853
6254 msgid "The resulting list is written to an external file."
6258 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:1857
6260 "Items (filenames) in the result are separated by C<\\0> characters. See "
6261 "L<find(1)> option I<-print0>."
6265 #: ../fish/guestfish-actions.pod:1251 ../src/guestfs-actions.pod:1862
6266 msgid "This command is not limited in the number of names that it can return."
6270 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:1867
6271 msgid "The result list is not sorted."
6275 #: ../fish/guestfish-actions.pod:1262
6276 msgid "findfs-label"
6280 #: ../fish/guestfish-actions.pod:1264
6283 " findfs-label label\n"
6288 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1881
6290 "This command searches the filesystems and returns the one which has the "
6291 "given label. An error is returned if no such filesystem can be found."
6295 #: ../fish/guestfish-actions.pod:1270
6296 msgid "To find the label of a filesystem, use L</vfs-label>."
6300 #: ../fish/guestfish-actions.pod:1272
6305 #: ../fish/guestfish-actions.pod:1274
6308 " findfs-uuid uuid\n"
6313 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:1898
6315 "This command searches the filesystems and returns the one which has the "
6316 "given UUID. An error is returned if no such filesystem can be found."
6320 #: ../fish/guestfish-actions.pod:1280
6321 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
6325 #: ../fish/guestfish-actions.pod:1282
6330 #: ../fish/guestfish-actions.pod:1284
6333 " fsck fstype device\n"
6338 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1916
6340 "This runs the filesystem checker (fsck) on C<device> which should have "
6341 "filesystem type C<fstype>."
6345 #: ../fish/guestfish-actions.pod:1289 ../src/guestfs-actions.pod:1919
6347 "The returned integer is the status. See L<fsck(8)> for the list of status "
6348 "codes from C<fsck>."
6352 #: ../fish/guestfish-actions.pod:1298 ../src/guestfs-actions.pod:1928
6353 msgid "Multiple status codes can be summed together."
6357 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:1932
6359 "A non-zero return code can mean \"success\", for example if errors have been "
6360 "corrected on the filesystem."
6364 #: ../fish/guestfish-actions.pod:1307 ../src/guestfs-actions.pod:1937
6365 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6369 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:1942
6370 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6374 #: ../fish/guestfish-actions.pod:1314
6379 #: ../fish/guestfish-actions.pod:1316
6387 #: ../fish/guestfish-actions.pod:1318 ../src/guestfs-actions.pod:1953
6389 "Return the additional kernel options which are added to the guest kernel "
6394 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:1956
6395 msgid "If C<NULL> then no options are added."
6399 #: ../fish/guestfish-actions.pod:1323
6400 msgid "get-attach-method"
6404 #: ../fish/guestfish-actions.pod:1325
6407 " get-attach-method\n"
6412 #: ../fish/guestfish-actions.pod:1327
6413 msgid "Return the current attach method. See L</set-attach-method>."
6417 #: ../fish/guestfish-actions.pod:1329
6418 msgid "get-autosync"
6422 #: ../fish/guestfish-actions.pod:1331
6430 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:1981
6431 msgid "Get the autosync flag."
6435 #: ../fish/guestfish-actions.pod:1335
6440 #: ../fish/guestfish-actions.pod:1337
6448 #: ../fish/guestfish-actions.pod:1339 ../src/guestfs-actions.pod:1992
6449 msgid "Return the direct appliance mode flag."
6453 #: ../fish/guestfish-actions.pod:1341
6458 #: ../fish/guestfish-actions.pod:1343
6461 " get-e2label device\n"
6466 #: ../fish/guestfish-actions.pod:1345 ../src/guestfs-actions.pod:2011
6467 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6471 #: ../fish/guestfish-actions.pod:1348
6473 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
6478 #: ../fish/guestfish-actions.pod:1355
6483 #: ../fish/guestfish-actions.pod:1357
6486 " get-e2uuid device\n"
6491 #: ../fish/guestfish-actions.pod:1359 ../src/guestfs-actions.pod:2032
6492 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6496 #: ../fish/guestfish-actions.pod:1362
6498 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
6503 #: ../fish/guestfish-actions.pod:1369
6508 #: ../fish/guestfish-actions.pod:1371
6516 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2045
6517 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6521 #: ../fish/guestfish-actions.pod:1376
6523 "If L</set-memsize> was not called on this handle, and if "
6524 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6525 "value for memsize."
6529 #: ../fish/guestfish-actions.pod:1380 ../fish/guestfish-actions.pod:1437 ../fish/guestfish-actions.pod:4168 ../fish/guestfish-actions.pod:4270 ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2144 ../src/guestfs-actions.pod:6298 ../src/guestfs-actions.pod:6424
6530 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6534 #: ../fish/guestfish-actions.pod:1383
6539 #: ../fish/guestfish-actions.pod:1385
6547 #: ../fish/guestfish-actions.pod:1387 ../src/guestfs-actions.pod:2064
6548 msgid "This returns the enable network flag."
6552 #: ../fish/guestfish-actions.pod:1389
6557 #: ../fish/guestfish-actions.pod:1391
6565 #: ../fish/guestfish-actions.pod:1393 ../src/guestfs-actions.pod:2075
6566 msgid "Return the current search path."
6570 #: ../fish/guestfish-actions.pod:1395 ../src/guestfs-actions.pod:2077
6572 "This is always non-NULL. If it wasn't set already, then this will return "
6577 #: ../fish/guestfish-actions.pod:1398
6582 #: ../fish/guestfish-actions.pod:1400
6590 #: ../fish/guestfish-actions.pod:1402 ../src/guestfs-actions.pod:2090
6591 msgid "This returns the process group flag."
6595 #: ../fish/guestfish-actions.pod:1404
6600 #: ../fish/guestfish-actions.pod:1406
6605 #: ../fish/guestfish-actions.pod:1408
6613 #: ../fish/guestfish-actions.pod:1410 ../src/guestfs-actions.pod:2101
6615 "Return the process ID of the qemu subprocess. If there is no qemu "
6616 "subprocess, then this will return an error."
6620 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2104
6621 msgid "This is an internal call used for debugging and testing."
6625 #: ../fish/guestfish-actions.pod:1415
6630 #: ../fish/guestfish-actions.pod:1417
6638 #: ../fish/guestfish-actions.pod:1419 ../src/guestfs-actions.pod:2115
6639 msgid "Return the current qemu binary."
6643 #: ../fish/guestfish-actions.pod:1421 ../src/guestfs-actions.pod:2117
6645 "This is always non-NULL. If it wasn't set already, then this will return "
6646 "the default qemu binary name."
6650 #: ../fish/guestfish-actions.pod:1424
6651 msgid "get-recovery-proc"
6655 #: ../fish/guestfish-actions.pod:1426
6658 " get-recovery-proc\n"
6663 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2130
6664 msgid "Return the recovery process enabled flag."
6668 #: ../fish/guestfish-actions.pod:1430
6673 #: ../fish/guestfish-actions.pod:1432
6681 #: ../fish/guestfish-actions.pod:1434
6683 "This returns the current setting of the selinux flag which is passed to the "
6684 "appliance at boot time. See L</set-selinux>."
6688 #: ../fish/guestfish-actions.pod:1440
6693 #: ../fish/guestfish-actions.pod:1442
6701 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2156
6703 "This returns the current state as an opaque integer. This is only useful "
6704 "for printing debug and internal error messages."
6708 #: ../fish/guestfish-actions.pod:1447 ../fish/guestfish-actions.pod:2367 ../fish/guestfish-actions.pod:2385 ../fish/guestfish-actions.pod:2423 ../fish/guestfish-actions.pod:2439 ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:3439 ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:3529 ../src/guestfs-actions.pod:3556
6709 msgid "For more information on states, see L<guestfs(3)>."
6713 #: ../fish/guestfish-actions.pod:1449
6718 #: ../fish/guestfish-actions.pod:1451
6726 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2170
6727 msgid "Return the command trace flag."
6731 #: ../fish/guestfish-actions.pod:1455
6736 #: ../fish/guestfish-actions.pod:1457
6744 #: ../fish/guestfish-actions.pod:1459
6746 "Return the current umask. By default the umask is C<022> unless it has been "
6747 "set by calling L</umask>."
6751 #: ../fish/guestfish-actions.pod:1462
6756 #: ../fish/guestfish-actions.pod:1464
6764 #: ../fish/guestfish-actions.pod:1466 ../src/guestfs-actions.pod:2193
6765 msgid "This returns the verbose messages flag."
6769 #: ../fish/guestfish-actions.pod:1468
6774 #: ../fish/guestfish-actions.pod:1470
6782 #: ../fish/guestfish-actions.pod:1472 ../src/guestfs-actions.pod:2204
6783 msgid "This gets the SELinux security context of the daemon."
6787 #: ../fish/guestfish-actions.pod:1474
6788 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
6792 #: ../fish/guestfish-actions.pod:1477
6797 #: ../fish/guestfish-actions.pod:1479
6800 " getxattr path name\n"
6805 #: ../fish/guestfish-actions.pod:1481
6807 "Get a single extended attribute from file C<path> named C<name>. This call "
6808 "follows symlinks. If you want to lookup an extended attribute for the "
6809 "symlink itself, use L</lgetxattr>."
6813 #: ../fish/guestfish-actions.pod:1485 ../fish/guestfish-actions.pod:2512
6815 "Normally it is better to get all extended attributes from a file in one go "
6816 "by calling L</getxattrs>. However some Linux filesystem implementations are "
6817 "buggy and do not provide a way to list out attributes. For these "
6818 "filesystems (notably ntfs-3g) you have to know the names of the extended "
6819 "attributes you want in advance and call this function."
6823 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:2519 ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:3689
6825 "Extended attribute values are blobs of binary data. If there is no extended "
6826 "attribute named C<name>, this returns an error."
6830 #: ../fish/guestfish-actions.pod:1495
6831 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
6835 #: ../fish/guestfish-actions.pod:1497
6840 #: ../fish/guestfish-actions.pod:1499
6848 #: ../fish/guestfish-actions.pod:1501 ../src/guestfs-actions.pod:2250
6849 msgid "This call lists the extended attributes of the file or directory C<path>."
6853 #: ../fish/guestfish-actions.pod:1504 ../src/guestfs-actions.pod:2253
6855 "At the system call level, this is a combination of the L<listxattr(2)> and "
6856 "L<getxattr(2)> calls."
6860 #: ../fish/guestfish-actions.pod:1507
6861 msgid "See also: L</lgetxattrs>, L<attr(5)>."
6865 #: ../fish/guestfish-actions.pod:1509
6870 #: ../fish/guestfish-actions.pod:1511
6873 " glob-expand pattern\n"
6878 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2270
6880 "This command searches for all the pathnames matching C<pattern> according to "
6881 "the wildcard expansion rules used by the shell."
6885 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2274
6886 msgid "If no paths match, then this returns an empty list (note: not an error)."
6890 #: ../fish/guestfish-actions.pod:1520 ../src/guestfs-actions.pod:2277
6892 "It is just a wrapper around the C L<glob(3)> function with flags "
6893 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
6897 #: ../fish/guestfish-actions.pod:1524
6902 #: ../fish/guestfish-actions.pod:1526
6905 " grep regex path\n"
6910 #: ../fish/guestfish-actions.pod:1528 ../src/guestfs-actions.pod:2294
6911 msgid "This calls the external C<grep> program and returns the matching lines."
6915 #: ../fish/guestfish-actions.pod:1534
6920 #: ../fish/guestfish-actions.pod:1536
6923 " grepi regex path\n"
6928 #: ../fish/guestfish-actions.pod:1538 ../src/guestfs-actions.pod:2313
6929 msgid "This calls the external C<grep -i> program and returns the matching lines."
6933 #: ../fish/guestfish-actions.pod:1544
6934 msgid "grub-install"
6938 #: ../fish/guestfish-actions.pod:1546
6941 " grub-install root device\n"
6946 #: ../fish/guestfish-actions.pod:1548 ../src/guestfs-actions.pod:2332
6948 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
6949 "the root directory being C<root>."
6953 #: ../fish/guestfish-actions.pod:1551 ../src/guestfs-actions.pod:2335
6955 "Note: If grub-install reports the error \"No suitable drive was found in the "
6956 "generated device map.\" it may be that you need to create a "
6957 "C</boot/grub/device.map> file first that contains the mapping between grub "
6958 "device names and Linux device names. It is usually sufficient to create a "
6963 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2342
6971 #: ../fish/guestfish-actions.pod:1560 ../src/guestfs-actions.pod:2344
6972 msgid "replacing C</dev/vda> with the name of the installation device."
6976 #: ../fish/guestfish-actions.pod:1562
6981 #: ../fish/guestfish-actions.pod:1564
6989 #: ../fish/guestfish-actions.pod:1566 ../src/guestfs-actions.pod:2356
6991 "This command returns up to the first 10 lines of a file as a list of "
6996 #: ../fish/guestfish-actions.pod:1572
7001 #: ../fish/guestfish-actions.pod:1574
7004 " head-n nrlines path\n"
7009 #: ../fish/guestfish-actions.pod:1576 ../src/guestfs-actions.pod:2375
7011 "If the parameter C<nrlines> is a positive number, this returns the first "
7012 "C<nrlines> lines of the file C<path>."
7016 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2378
7018 "If the parameter C<nrlines> is a negative number, this returns lines from "
7019 "the file C<path>, excluding the last C<nrlines> lines."
7023 #: ../fish/guestfish-actions.pod:1582 ../fish/guestfish-actions.pod:4648 ../src/guestfs-actions.pod:2381 ../src/guestfs-actions.pod:6996
7024 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7028 #: ../fish/guestfish-actions.pod:1587
7033 #: ../fish/guestfish-actions.pod:1589
7041 #: ../fish/guestfish-actions.pod:1591 ../src/guestfs-actions.pod:2398
7043 "This runs C<hexdump -C> on the given C<path>. The result is the "
7044 "human-readable, canonical hex dump of the file."
7048 #: ../fish/guestfish-actions.pod:1597
7053 #: ../fish/guestfish-actions.pod:1599
7056 " initrd-cat initrdpath filename\n"
7061 #: ../fish/guestfish-actions.pod:1601 ../src/guestfs-actions.pod:2417
7063 "This command unpacks the file C<filename> from the initrd file called "
7064 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7069 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2421
7071 "For example, in guestfish you could use the following command to examine the "
7072 "boot script (usually called C</init>) contained in a Linux initrd or "
7077 #: ../fish/guestfish-actions.pod:1609 ../src/guestfs-actions.pod:2425
7080 " initrd-cat /boot/initrd-<version>.img init\n"
7085 #: ../fish/guestfish-actions.pod:1611
7086 msgid "See also L</initrd-list>."
7090 #: ../fish/guestfish-actions.pod:1616
7095 #: ../fish/guestfish-actions.pod:1618
7098 " initrd-list path\n"
7103 #: ../fish/guestfish-actions.pod:1620 ../src/guestfs-actions.pod:2444
7104 msgid "This command lists out files contained in an initrd."
7108 #: ../fish/guestfish-actions.pod:1622 ../src/guestfs-actions.pod:2446
7110 "The files are listed without any initial C</> character. The files are "
7111 "listed in the order they appear (not necessarily alphabetical). Directory "
7112 "names are listed as separate items."
7116 #: ../fish/guestfish-actions.pod:1626 ../src/guestfs-actions.pod:2450
7118 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7119 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7124 #: ../fish/guestfish-actions.pod:1630
7125 msgid "inotify-add-watch"
7129 #: ../fish/guestfish-actions.pod:1632
7132 " inotify-add-watch path mask\n"
7137 #: ../fish/guestfish-actions.pod:1634 ../src/guestfs-actions.pod:2467
7138 msgid "Watch C<path> for the events listed in C<mask>."
7142 #: ../fish/guestfish-actions.pod:1636 ../src/guestfs-actions.pod:2469
7144 "Note that if C<path> is a directory then events within that directory are "
7145 "watched, but this does I<not> happen recursively (in subdirectories)."
7149 #: ../fish/guestfish-actions.pod:1640 ../src/guestfs-actions.pod:2473
7151 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7152 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7156 #: ../fish/guestfish-actions.pod:1644
7157 msgid "inotify-close"
7161 #: ../fish/guestfish-actions.pod:1646
7169 #: ../fish/guestfish-actions.pod:1648 ../src/guestfs-actions.pod:2486
7171 "This closes the inotify handle which was previously opened by inotify_init. "
7172 "It removes all watches, throws away any pending events, and deallocates all "
7177 #: ../fish/guestfish-actions.pod:1652
7178 msgid "inotify-files"
7182 #: ../fish/guestfish-actions.pod:1654
7190 #: ../fish/guestfish-actions.pod:1656
7192 "This function is a helpful wrapper around L</inotify-read> which just "
7193 "returns a list of pathnames of objects that were touched. The returned "
7194 "pathnames are sorted and deduplicated."
7198 #: ../fish/guestfish-actions.pod:1660
7199 msgid "inotify-init"
7203 #: ../fish/guestfish-actions.pod:1662
7206 " inotify-init maxevents\n"
7211 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2515
7213 "This command creates a new inotify handle. The inotify subsystem can be "
7214 "used to notify events which happen to objects in the guest filesystem."
7218 #: ../fish/guestfish-actions.pod:1668
7220 "C<maxevents> is the maximum number of events which will be queued up between "
7221 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
7222 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
7223 "default was 16384 events. Beyond this limit, the kernel throws away events, "
7224 "but records the fact that it threw them away by setting a flag "
7225 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
7229 #: ../fish/guestfish-actions.pod:1678
7231 "Before any events are generated, you have to add some watches to the "
7232 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
7233 "L</inotify-watch-all>."
7237 #: ../fish/guestfish-actions.pod:1684
7239 "Queued up events should be read periodically by calling L</inotify-read> (or "
7240 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
7241 "If you don't read the events out often enough then you risk the internal "
7242 "queue overflowing."
7246 #: ../fish/guestfish-actions.pod:1691
7248 "The handle should be closed after use by calling L</inotify-close>. This "
7249 "also removes any watches automatically."
7253 #: ../fish/guestfish-actions.pod:1695 ../src/guestfs-actions.pod:2546
7255 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7256 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7257 "that there is one global inotify handle per libguestfs instance."
7261 #: ../fish/guestfish-actions.pod:1700
7262 msgid "inotify-read"
7266 #: ../fish/guestfish-actions.pod:1702
7274 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2560
7276 "Return the complete queue of events that have happened since the previous "
7281 #: ../fish/guestfish-actions.pod:1707 ../src/guestfs-actions.pod:2563
7282 msgid "If no events have happened, this returns an empty list."
7286 #: ../fish/guestfish-actions.pod:1709 ../src/guestfs-actions.pod:2565
7288 "I<Note>: In order to make sure that all events have been read, you must call "
7289 "this function repeatedly until it returns an empty list. The reason is that "
7290 "the call will read events up to the maximum appliance-to-host message size "
7291 "and leave remaining events in the queue."
7295 #: ../fish/guestfish-actions.pod:1715
7296 msgid "inotify-rm-watch"
7300 #: ../fish/guestfish-actions.pod:1717
7303 " inotify-rm-watch wd\n"
7308 #: ../fish/guestfish-actions.pod:1719
7309 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
7313 #: ../fish/guestfish-actions.pod:1722
7314 msgid "inspect-get-arch"
7318 #: ../fish/guestfish-actions.pod:1724
7321 " inspect-get-arch root\n"
7326 #: ../fish/guestfish-actions.pod:1726
7328 "This returns the architecture of the inspected operating system. The "
7329 "possible return values are listed under L</file-architecture>."
7333 #: ../fish/guestfish-actions.pod:1730 ../src/guestfs-actions.pod:2600
7335 "If the architecture could not be determined, then the string C<unknown> is "
7340 #: ../fish/guestfish-actions.pod:1733 ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1895 ../fish/guestfish-actions.pod:1907 ../fish/guestfish-actions.pod:1991 ../fish/guestfish-actions.pod:2052 ../fish/guestfish-actions.pod:2073 ../fish/guestfish-actions.pod:2087 ../fish/guestfish-actions.pod:2127 ../fish/guestfish-actions.pod:2159 ../fish/guestfish-actions.pod:2172 ../fish/guestfish-actions.pod:2185 ../fish/guestfish-actions.pod:2195 ../fish/guestfish-actions.pod:2205 ../fish/guestfish-actions.pod:2217 ../fish/guestfish-actions.pod:2313 ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:2603 ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:2947 ../src/guestfs-actions.pod:3030 ../src/guestfs-actions.pod:3058 ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3132 ../src/guestfs-actions.pod:3172 ../src/guestfs-actions.pod:3192 ../src/guestfs-actions.pod:3212 ../src/guestfs-actions.pod:3229 ../src/guestfs-actions.pod:3245 ../src/guestfs-actions.pod:3263 ../src/guestfs-actions.pod:3365 ../src/guestfs-actions.pod:3406
7341 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7345 #: ../fish/guestfish-actions.pod:1735
7346 msgid "inspect-get-distro"
7350 #: ../fish/guestfish-actions.pod:1737
7353 " inspect-get-distro root\n"
7358 #: ../fish/guestfish-actions.pod:1739 ../src/guestfs-actions.pod:2616
7359 msgid "This returns the distro (distribution) of the inspected operating system."
7363 #: ../fish/guestfish-actions.pod:1742 ../src/guestfs-actions.pod:2619
7364 msgid "Currently defined distros are:"
7368 #: ../fish/guestfish-actions.pod:1746 ../src/guestfs-actions.pod:2623
7369 msgid "\"archlinux\""
7373 #: ../fish/guestfish-actions.pod:1748 ../src/guestfs-actions.pod:2625
7378 #: ../fish/guestfish-actions.pod:1750 ../src/guestfs-actions.pod:2627
7383 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2629
7388 #: ../fish/guestfish-actions.pod:1754 ../src/guestfs-actions.pod:2631
7393 #: ../fish/guestfish-actions.pod:1756 ../src/guestfs-actions.pod:2633
7398 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2635
7403 #: ../fish/guestfish-actions.pod:1760 ../src/guestfs-actions.pod:2637
7408 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2639
7413 #: ../fish/guestfish-actions.pod:1764 ../src/guestfs-actions.pod:2641
7418 #: ../fish/guestfish-actions.pod:1766 ../src/guestfs-actions.pod:2643
7419 msgid "\"linuxmint\""
7423 #: ../fish/guestfish-actions.pod:1768 ../src/guestfs-actions.pod:2645
7428 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2647
7429 msgid "\"mandriva\""
7433 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2649
7438 #: ../fish/guestfish-actions.pod:1774 ../src/guestfs-actions.pod:2651
7443 #: ../fish/guestfish-actions.pod:1776 ../src/guestfs-actions.pod:2653
7448 #: ../fish/guestfish-actions.pod:1778 ../src/guestfs-actions.pod:2655
7453 #: ../fish/guestfish-actions.pod:1780 ../src/guestfs-actions.pod:2657
7458 #: ../fish/guestfish-actions.pod:1782 ../src/guestfs-actions.pod:2659
7459 msgid "\"redhat-based\""
7463 #: ../fish/guestfish-actions.pod:1784 ../src/guestfs-actions.pod:2661
7464 msgid "Some Red Hat-derived distro."
7468 #: ../fish/guestfish-actions.pod:1786 ../src/guestfs-actions.pod:2663
7473 #: ../fish/guestfish-actions.pod:1788 ../src/guestfs-actions.pod:2665
7474 msgid "Red Hat Enterprise Linux."
7478 #: ../fish/guestfish-actions.pod:1790 ../src/guestfs-actions.pod:2667
7479 msgid "\"scientificlinux\""
7483 #: ../fish/guestfish-actions.pod:1792 ../src/guestfs-actions.pod:2669
7484 msgid "Scientific Linux."
7488 #: ../fish/guestfish-actions.pod:1794 ../src/guestfs-actions.pod:2671
7489 msgid "\"slackware\""
7493 #: ../fish/guestfish-actions.pod:1796 ../src/guestfs-actions.pod:2673
7498 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2675
7503 #: ../fish/guestfish-actions.pod:1800 ../src/guestfs-actions.pod:2677
7508 #: ../fish/guestfish-actions.pod:1802 ../fish/guestfish-actions.pod:1886 ../fish/guestfish-actions.pod:2150 ../src/guestfs-actions.pod:2679 ../src/guestfs-actions.pod:2788 ../src/guestfs-actions.pod:3163
7513 #: ../fish/guestfish-actions.pod:1804 ../src/guestfs-actions.pod:2681
7514 msgid "The distro could not be determined."
7518 #: ../fish/guestfish-actions.pod:1806 ../fish/guestfish-actions.pod:2142 ../src/guestfs-actions.pod:2683 ../src/guestfs-actions.pod:3155
7523 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2685
7525 "Windows does not have distributions. This string is returned if the OS type "
7530 #: ../fish/guestfish-actions.pod:1813 ../fish/guestfish-actions.pod:1892 ../fish/guestfish-actions.pod:2156 ../src/guestfs-actions.pod:2690 ../src/guestfs-actions.pod:2794 ../src/guestfs-actions.pod:3169
7532 "Future versions of libguestfs may return other strings here. The caller "
7533 "should be prepared to handle any string."
7537 #: ../fish/guestfish-actions.pod:1818
7538 msgid "inspect-get-drive-mappings"
7542 #: ../fish/guestfish-actions.pod:1820
7545 " inspect-get-drive-mappings root\n"
7550 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2706
7552 "This call is useful for Windows which uses a primitive system of assigning "
7553 "drive letters (like \"C:\") to partitions. This inspection API examines the "
7554 "Windows Registry to find out how disks/partitions are mapped to drive "
7555 "letters, and returns a hash table as in the example below:"
7559 #: ../fish/guestfish-actions.pod:1828 ../src/guestfs-actions.pod:2712
7569 #: ../fish/guestfish-actions.pod:1832 ../src/guestfs-actions.pod:2716
7571 "Note that keys are drive letters. For Windows, the key is case insensitive "
7572 "and just contains the drive letter, without the customary colon separator "
7577 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2720
7579 "In future we may support other operating systems that also used drive "
7580 "letters, but the keys for those might not be case insensitive and might be "
7581 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
7586 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2725
7588 "For Windows guests, currently only hard drive mappings are returned. "
7589 "Removable disks (eg. DVD-ROMs) are ignored."
7593 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2728
7595 "For guests that do not use drive mappings, or if the drive mappings could "
7596 "not be determined, this returns an empty hash table."
7600 #: ../fish/guestfish-actions.pod:1847
7602 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7603 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
7607 #: ../fish/guestfish-actions.pod:1851
7608 msgid "inspect-get-filesystems"
7612 #: ../fish/guestfish-actions.pod:1853
7615 " inspect-get-filesystems root\n"
7620 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2749
7622 "This returns a list of all the filesystems that we think are associated with "
7623 "this operating system. This includes the root filesystem, other ordinary "
7624 "filesystems, and non-mounted devices like swap partitions."
7628 #: ../fish/guestfish-actions.pod:1860 ../src/guestfs-actions.pod:2754
7630 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7631 "to be shared between operating systems."
7635 #: ../fish/guestfish-actions.pod:1863
7637 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7638 "L</inspect-get-mountpoints>."
7642 #: ../fish/guestfish-actions.pod:1866
7643 msgid "inspect-get-format"
7647 #: ../fish/guestfish-actions.pod:1868
7650 " inspect-get-format root\n"
7655 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2772
7657 "This returns the format of the inspected operating system. You can use it "
7658 "to detect install images, live CDs and similar."
7662 #: ../fish/guestfish-actions.pod:1873 ../src/guestfs-actions.pod:2775
7663 msgid "Currently defined formats are:"
7667 #: ../fish/guestfish-actions.pod:1877 ../src/guestfs-actions.pod:2779
7668 msgid "\"installed\""
7672 #: ../fish/guestfish-actions.pod:1879 ../src/guestfs-actions.pod:2781
7673 msgid "This is an installed operating system."
7677 #: ../fish/guestfish-actions.pod:1881 ../src/guestfs-actions.pod:2783
7678 msgid "\"installer\""
7682 #: ../fish/guestfish-actions.pod:1883 ../src/guestfs-actions.pod:2785
7684 "The disk image being inspected is not an installed operating system, but a "
7685 "I<bootable> install disk, live CD, or similar."
7689 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:2790
7690 msgid "The format of this disk image is not known."
7694 #: ../fish/guestfish-actions.pod:1897
7695 msgid "inspect-get-hostname"
7699 #: ../fish/guestfish-actions.pod:1899
7702 " inspect-get-hostname root\n"
7707 #: ../fish/guestfish-actions.pod:1901 ../src/guestfs-actions.pod:2810
7709 "This function returns the hostname of the operating system as found by "
7710 "inspection of the guest's configuration files."
7714 #: ../fish/guestfish-actions.pod:1904 ../src/guestfs-actions.pod:2813
7716 "If the hostname could not be determined, then the string C<unknown> is "
7721 #: ../fish/guestfish-actions.pod:1909
7722 msgid "inspect-get-icon"
7726 #: ../fish/guestfish-actions.pod:1911
7729 " inspect-get-icon root [favicon:..] [highquality:..]\n"
7734 #: ../fish/guestfish-actions.pod:1913 ../src/guestfs-actions.pod:2839
7736 "This function returns an icon corresponding to the inspected operating "
7737 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
7738 "to PNG if necessary)."
7742 #: ../fish/guestfish-actions.pod:1917 ../src/guestfs-actions.pod:2843
7744 "If it was not possible to get an icon this function returns a zero-length "
7745 "(non-NULL) buffer. I<Callers must check for this case>."
7749 #: ../fish/guestfish-actions.pod:1920 ../src/guestfs-actions.pod:2846
7751 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
7752 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
7753 "this file will be returned. You can disable favicons by passing the "
7754 "optional C<favicon> boolean as false (default is true)."
7758 #: ../fish/guestfish-actions.pod:1926 ../src/guestfs-actions.pod:2852
7760 "If finding the favicon fails, then we look in other places in the guest for "
7765 #: ../fish/guestfish-actions.pod:1929 ../src/guestfs-actions.pod:2855
7767 "If the optional C<highquality> boolean is true then only high quality icons "
7768 "are returned, which means only icons of high resolution with an alpha "
7769 "channel. The default (false) is to return any icon we can, even if it is of "
7770 "substandard quality."
7774 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2866
7776 "Unlike most other inspection API calls, the guest's disks must be mounted up "
7777 "before you call this, since it needs to read information from the guest "
7778 "filesystem during the call."
7782 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:2872
7784 "B<Security:> The icon data comes from the untrusted guest, and should be "
7785 "treated with caution. PNG files have been known to contain exploits. "
7786 "Ensure that libpng (or other relevant libraries) are fully up to date before "
7787 "trying to process or display the icon."
7791 #: ../fish/guestfish-actions.pod:1954 ../src/guestfs-actions.pod:2880
7793 "The PNG image returned can be any size. It might not be square. Libguestfs "
7794 "tries to return the largest, highest quality icon available. The "
7795 "application must scale the icon to the required size."
7799 #: ../fish/guestfish-actions.pod:1961 ../src/guestfs-actions.pod:2887
7801 "Extracting icons from Windows guests requires the external C<wrestool> "
7802 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
7803 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
7804 "installed separately."
7808 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2894
7810 "Operating system icons are usually trademarks. Seek legal advice before "
7811 "using trademarks in applications."
7815 #: ../fish/guestfish-actions.pod:1975
7816 msgid "inspect-get-major-version"
7820 #: ../fish/guestfish-actions.pod:1977
7823 " inspect-get-major-version root\n"
7828 #: ../fish/guestfish-actions.pod:1979 ../src/guestfs-actions.pod:2935
7829 msgid "This returns the major version number of the inspected operating system."
7833 #: ../fish/guestfish-actions.pod:1982 ../src/guestfs-actions.pod:2938
7835 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7836 "popular public names used by the operating system. Notably the operating "
7837 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7838 "1). You can find out the real versions corresponding to releases of Windows "
7839 "by consulting Wikipedia or MSDN."
7843 #: ../fish/guestfish-actions.pod:1989 ../fish/guestfish-actions.pod:2000 ../src/guestfs-actions.pod:2945 ../src/guestfs-actions.pod:2962
7844 msgid "If the version could not be determined, then C<0> is returned."
7848 #: ../fish/guestfish-actions.pod:1993
7849 msgid "inspect-get-minor-version"
7853 #: ../fish/guestfish-actions.pod:1995
7856 " inspect-get-minor-version root\n"
7861 #: ../fish/guestfish-actions.pod:1997 ../src/guestfs-actions.pod:2959
7862 msgid "This returns the minor version number of the inspected operating system."
7866 #: ../fish/guestfish-actions.pod:2002
7868 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7869 "L</inspect-get-major-version>."
7873 #: ../fish/guestfish-actions.pod:2005
7874 msgid "inspect-get-mountpoints"
7878 #: ../fish/guestfish-actions.pod:2007
7881 " inspect-get-mountpoints root\n"
7886 #: ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:2977
7888 "This returns a hash of where we think the filesystems associated with this "
7889 "operating system should be mounted. Callers should note that this is at "
7890 "best an educated guess made by reading configuration files such as "
7891 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
7892 "are non-existent or not mountable and callers should be prepared to handle "
7893 "or ignore failures if they try to mount them."
7897 #: ../fish/guestfish-actions.pod:2018 ../src/guestfs-actions.pod:2986
7899 "Each element in the returned hashtable has a key which is the path of the "
7900 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7901 "mounted there (eg. C</dev/sda1>)."
7905 #: ../fish/guestfish-actions.pod:2023 ../src/guestfs-actions.pod:2991
7906 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
7910 #: ../fish/guestfish-actions.pod:2026
7912 "For operating systems like Windows which still use drive letters, this call "
7913 "will only return an entry for the first drive \"mounted on\" C</>. For "
7914 "information about the mapping of drive letters to partitions, see "
7915 "L</inspect-get-drive-mappings>."
7919 #: ../fish/guestfish-actions.pod:2032
7921 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7922 "L</inspect-get-filesystems>."
7926 #: ../fish/guestfish-actions.pod:2035
7927 msgid "inspect-get-package-format"
7931 #: ../fish/guestfish-actions.pod:2037
7934 " inspect-get-package-format root\n"
7939 #: ../fish/guestfish-actions.pod:2039
7941 "This function and L</inspect-get-package-management> return the package "
7942 "format and package management tool used by the inspected operating system. "
7943 "For example for Fedora these functions would return C<rpm> (package format) "
7944 "and C<yum> (package management)."
7948 #: ../fish/guestfish-actions.pod:2045 ../src/guestfs-actions.pod:3023
7950 "This returns the string C<unknown> if we could not determine the package "
7951 "format I<or> if the operating system does not have a real packaging system "
7956 #: ../fish/guestfish-actions.pod:2049 ../src/guestfs-actions.pod:3027
7958 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
7959 "Future versions of libguestfs may return other strings."
7963 #: ../fish/guestfish-actions.pod:2054
7964 msgid "inspect-get-package-management"
7968 #: ../fish/guestfish-actions.pod:2056
7971 " inspect-get-package-management root\n"
7976 #: ../fish/guestfish-actions.pod:2058
7978 "L</inspect-get-package-format> and this function return the package format "
7979 "and package management tool used by the inspected operating system. For "
7980 "example for Fedora these functions would return C<rpm> (package format) and "
7981 "C<yum> (package management)."
7985 #: ../fish/guestfish-actions.pod:2064 ../src/guestfs-actions.pod:3049
7987 "This returns the string C<unknown> if we could not determine the package "
7988 "management tool I<or> if the operating system does not have a real packaging "
7989 "system (eg. Windows)."
7993 #: ../fish/guestfish-actions.pod:2068 ../src/guestfs-actions.pod:3053
7995 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
7996 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
7997 "libguestfs may return other strings."
8001 #: ../fish/guestfish-actions.pod:2075
8002 msgid "inspect-get-product-name"
8006 #: ../fish/guestfish-actions.pod:2077
8009 " inspect-get-product-name root\n"
8014 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3071
8016 "This returns the product name of the inspected operating system. The "
8017 "product name is generally some freeform string which can be displayed to the "
8018 "user, but should not be parsed by programs."
8022 #: ../fish/guestfish-actions.pod:2084 ../src/guestfs-actions.pod:3076
8024 "If the product name could not be determined, then the string C<unknown> is "
8029 #: ../fish/guestfish-actions.pod:2089
8030 msgid "inspect-get-product-variant"
8034 #: ../fish/guestfish-actions.pod:2091
8037 " inspect-get-product-variant root\n"
8042 #: ../fish/guestfish-actions.pod:2093 ../src/guestfs-actions.pod:3092
8043 msgid "This returns the product variant of the inspected operating system."
8047 #: ../fish/guestfish-actions.pod:2096 ../src/guestfs-actions.pod:3095
8049 "For Windows guests, this returns the contents of the Registry key "
8050 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
8051 "which is usually a string such as C<Client> or C<Server> (other values are "
8052 "possible). This can be used to distinguish consumer and enterprise versions "
8053 "of Windows that have the same version number (for example, Windows 7 and "
8054 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8055 "the latter is C<Server>)."
8059 #: ../fish/guestfish-actions.pod:2105 ../src/guestfs-actions.pod:3104
8061 "For enterprise Linux guests, in future we intend this to return the product "
8062 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8063 "implemented at present."
8067 #: ../fish/guestfish-actions.pod:2109 ../src/guestfs-actions.pod:3108
8069 "If the product variant could not be determined, then the string C<unknown> "
8074 #: ../fish/guestfish-actions.pod:2112
8076 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8077 "L</inspect-get-product-name>, L</inspect-get-major-version>."
8081 #: ../fish/guestfish-actions.pod:2116
8082 msgid "inspect-get-roots"
8086 #: ../fish/guestfish-actions.pod:2118
8089 " inspect-get-roots\n"
8094 #: ../fish/guestfish-actions.pod:2120
8096 "This function is a convenient way to get the list of root devices, as "
8097 "returned from a previous call to L</inspect-os>, but without redoing the "
8098 "whole inspection process."
8102 #: ../fish/guestfish-actions.pod:2124
8104 "This returns an empty list if either no root devices were found or the "
8105 "caller has not called L</inspect-os>."
8109 #: ../fish/guestfish-actions.pod:2129
8110 msgid "inspect-get-type"
8114 #: ../fish/guestfish-actions.pod:2131
8117 " inspect-get-type root\n"
8122 #: ../fish/guestfish-actions.pod:2133 ../src/guestfs-actions.pod:3146
8124 "This returns the type of the inspected operating system. Currently defined "
8129 #: ../fish/guestfish-actions.pod:2138 ../src/guestfs-actions.pod:3151
8134 #: ../fish/guestfish-actions.pod:2140 ../src/guestfs-actions.pod:3153
8135 msgid "Any Linux-based operating system."
8139 #: ../fish/guestfish-actions.pod:2144 ../src/guestfs-actions.pod:3157
8140 msgid "Any Microsoft Windows operating system."
8144 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3159
8149 #: ../fish/guestfish-actions.pod:2148 ../src/guestfs-actions.pod:3161
8154 #: ../fish/guestfish-actions.pod:2152 ../src/guestfs-actions.pod:3165
8155 msgid "The operating system type could not be determined."
8159 #: ../fish/guestfish-actions.pod:2161
8160 msgid "inspect-get-windows-current-control-set"
8164 #: ../fish/guestfish-actions.pod:2163
8167 " inspect-get-windows-current-control-set root\n"
8172 #: ../fish/guestfish-actions.pod:2165 ../src/guestfs-actions.pod:3185
8174 "This returns the Windows CurrentControlSet of the inspected guest. The "
8175 "CurrentControlSet is a registry key name such as C<ControlSet001>."
8179 #: ../fish/guestfish-actions.pod:2168 ../src/guestfs-actions.pod:3188
8181 "This call assumes that the guest is Windows and that the Registry could be "
8182 "examined by inspection. If this is not the case then an error is returned."
8186 #: ../fish/guestfish-actions.pod:2174
8187 msgid "inspect-get-windows-systemroot"
8191 #: ../fish/guestfish-actions.pod:2176
8194 " inspect-get-windows-systemroot root\n"
8199 #: ../fish/guestfish-actions.pod:2178 ../src/guestfs-actions.pod:3205
8201 "This returns the Windows systemroot of the inspected guest. The systemroot "
8202 "is a directory path such as C</WINDOWS>."
8206 #: ../fish/guestfish-actions.pod:2181 ../src/guestfs-actions.pod:3208
8208 "This call assumes that the guest is Windows and that the systemroot could be "
8209 "determined by inspection. If this is not the case then an error is "
8214 #: ../fish/guestfish-actions.pod:2187
8215 msgid "inspect-is-live"
8219 #: ../fish/guestfish-actions.pod:2189
8222 " inspect-is-live root\n"
8227 #: ../fish/guestfish-actions.pod:2191
8229 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8230 "then this returns true if a live image was detected on the disk."
8234 #: ../fish/guestfish-actions.pod:2197
8235 msgid "inspect-is-multipart"
8239 #: ../fish/guestfish-actions.pod:2199
8242 " inspect-is-multipart root\n"
8247 #: ../fish/guestfish-actions.pod:2201
8249 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8250 "then this returns true if the disk is part of a set."
8254 #: ../fish/guestfish-actions.pod:2207
8255 msgid "inspect-is-netinst"
8259 #: ../fish/guestfish-actions.pod:2209
8262 " inspect-is-netinst root\n"
8267 #: ../fish/guestfish-actions.pod:2211
8269 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8270 "then this returns true if the disk is a network installer, ie. not a "
8271 "self-contained install CD but one which is likely to require network access "
8272 "to complete the install."
8276 #: ../fish/guestfish-actions.pod:2219
8277 msgid "inspect-list-applications"
8281 #: ../fish/guestfish-actions.pod:2221
8284 " inspect-list-applications root\n"
8289 #: ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:3275
8290 msgid "Return the list of applications installed in the operating system."
8294 #: ../fish/guestfish-actions.pod:2225
8296 "I<Note:> This call works differently from other parts of the inspection "
8297 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
8298 "then mount up the disks, before calling this. Listing applications is a "
8299 "significantly more difficult operation which requires access to the full "
8300 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
8301 "are just returning data cached in the libguestfs handle, this call actually "
8302 "reads parts of the mounted filesystems during the call."
8306 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:3287
8308 "This returns an empty list if the inspection code was not able to determine "
8309 "the list of applications."
8313 #: ../fish/guestfish-actions.pod:2238 ../src/guestfs-actions.pod:3290
8314 msgid "The application structure contains the following fields:"
8318 #: ../fish/guestfish-actions.pod:2242 ../src/guestfs-actions.pod:3294
8323 #: ../fish/guestfish-actions.pod:2244 ../src/guestfs-actions.pod:3296
8325 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8326 "guests, this is the package name."
8330 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3299
8331 msgid "C<app_display_name>"
8335 #: ../fish/guestfish-actions.pod:2249 ../src/guestfs-actions.pod:3301
8337 "The display name of the application, sometimes localized to the install "
8338 "language of the guest operating system."
8342 #: ../fish/guestfish-actions.pod:2252 ../src/guestfs-actions.pod:3304
8344 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8345 "to display something can use C<app_name> instead."
8349 #: ../fish/guestfish-actions.pod:2255 ../src/guestfs-actions.pod:3307
8350 msgid "C<app_epoch>"
8354 #: ../fish/guestfish-actions.pod:2257 ../src/guestfs-actions.pod:3309
8356 "For package managers which use epochs, this contains the epoch of the "
8357 "package (an integer). If unavailable, this is returned as C<0>."
8361 #: ../fish/guestfish-actions.pod:2260 ../src/guestfs-actions.pod:3312
8362 msgid "C<app_version>"
8366 #: ../fish/guestfish-actions.pod:2262 ../src/guestfs-actions.pod:3314
8368 "The version string of the application or package. If unavailable this is "
8369 "returned as an empty string C<\"\">."
8373 #: ../fish/guestfish-actions.pod:2265 ../src/guestfs-actions.pod:3317
8374 msgid "C<app_release>"
8378 #: ../fish/guestfish-actions.pod:2267 ../src/guestfs-actions.pod:3319
8380 "The release string of the application or package, for package managers that "
8381 "use this. If unavailable this is returned as an empty string C<\"\">."
8385 #: ../fish/guestfish-actions.pod:2271 ../src/guestfs-actions.pod:3323
8386 msgid "C<app_install_path>"
8390 #: ../fish/guestfish-actions.pod:2273 ../src/guestfs-actions.pod:3325
8392 "The installation path of the application (on operating systems such as "
8393 "Windows which use installation paths). This path is in the format used by "
8394 "the guest operating system, it is not a libguestfs path."
8398 #: ../fish/guestfish-actions.pod:2278 ../src/guestfs-actions.pod:3330
8399 msgid "If unavailable this is returned as an empty string C<\"\">."
8403 #: ../fish/guestfish-actions.pod:2280 ../src/guestfs-actions.pod:3332
8404 msgid "C<app_trans_path>"
8408 #: ../fish/guestfish-actions.pod:2282 ../src/guestfs-actions.pod:3334
8410 "The install path translated into a libguestfs path. If unavailable this is "
8411 "returned as an empty string C<\"\">."
8415 #: ../fish/guestfish-actions.pod:2285 ../src/guestfs-actions.pod:3337
8416 msgid "C<app_publisher>"
8420 #: ../fish/guestfish-actions.pod:2287 ../src/guestfs-actions.pod:3339
8422 "The name of the publisher of the application, for package managers that use "
8423 "this. If unavailable this is returned as an empty string C<\"\">."
8427 #: ../fish/guestfish-actions.pod:2291 ../src/guestfs-actions.pod:3343
8432 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3345
8434 "The URL (eg. upstream URL) of the application. If unavailable this is "
8435 "returned as an empty string C<\"\">."
8439 #: ../fish/guestfish-actions.pod:2296 ../src/guestfs-actions.pod:3348
8440 msgid "C<app_source_package>"
8444 #: ../fish/guestfish-actions.pod:2298 ../src/guestfs-actions.pod:3350
8446 "For packaging systems which support this, the name of the source package. "
8447 "If unavailable this is returned as an empty string C<\"\">."
8451 #: ../fish/guestfish-actions.pod:2301 ../src/guestfs-actions.pod:3353
8452 msgid "C<app_summary>"
8456 #: ../fish/guestfish-actions.pod:2303 ../src/guestfs-actions.pod:3355
8458 "A short (usually one line) description of the application or package. If "
8459 "unavailable this is returned as an empty string C<\"\">."
8463 #: ../fish/guestfish-actions.pod:2306 ../src/guestfs-actions.pod:3358
8464 msgid "C<app_description>"
8468 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3360
8470 "A longer description of the application or package. If unavailable this is "
8471 "returned as an empty string C<\"\">."
8475 #: ../fish/guestfish-actions.pod:2315
8480 #: ../fish/guestfish-actions.pod:2317
8488 #: ../fish/guestfish-actions.pod:2319 ../src/guestfs-actions.pod:3378
8490 "This function uses other libguestfs functions and certain heuristics to "
8491 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8492 "for operating systems."
8496 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3382
8497 msgid "The list returned is empty if no operating systems were found."
8501 #: ../fish/guestfish-actions.pod:2325 ../src/guestfs-actions.pod:3384
8503 "If one operating system was found, then this returns a list with a single "
8504 "element, which is the name of the root filesystem of this operating system. "
8505 "It is also possible for this function to return a list containing more than "
8506 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8507 "element being the root filesystem of one of the operating systems."
8511 #: ../fish/guestfish-actions.pod:2332
8513 "You can pass the root string(s) returned to other L</inspect-get-*> "
8514 "functions in order to query further information about each operating system, "
8515 "such as the name and version."
8519 #: ../fish/guestfish-actions.pod:2337
8521 "This function uses other libguestfs features such as L</mount-ro> and "
8522 "L</umount-all> in order to mount and unmount filesystems and look at the "
8523 "contents. This should be called with no disks currently mounted. The "
8524 "function may also use Augeas, so any existing Augeas handle will be closed."
8528 #: ../fish/guestfish-actions.pod:2343 ../src/guestfs-actions.pod:3402
8530 "This function cannot decrypt encrypted disks. The caller must do that first "
8531 "(supplying the necessary keys) if the disk is encrypted."
8535 #: ../fish/guestfish-actions.pod:2349 ../fish/guestfish-actions.pod:2547 ../fish/guestfish-actions.pod:2606
8536 msgid "See also L</list-filesystems>."
8540 #: ../fish/guestfish-actions.pod:2351
8545 #: ../fish/guestfish-actions.pod:2353
8548 " is-blockdev path\n"
8553 #: ../fish/guestfish-actions.pod:2355 ../src/guestfs-actions.pod:3422
8555 "This returns C<true> if and only if there is a block device with the given "
8560 #: ../fish/guestfish-actions.pod:2358 ../fish/guestfish-actions.pod:2376 ../fish/guestfish-actions.pod:2395 ../fish/guestfish-actions.pod:2404 ../fish/guestfish-actions.pod:2414 ../fish/guestfish-actions.pod:2448 ../fish/guestfish-actions.pod:2457
8561 msgid "See also L</stat>."
8565 #: ../fish/guestfish-actions.pod:2360
8570 #: ../fish/guestfish-actions.pod:2362
8578 #: ../fish/guestfish-actions.pod:2364 ../src/guestfs-actions.pod:3436
8580 "This returns true iff this handle is busy processing a command (in the "
8585 #: ../fish/guestfish-actions.pod:2369
8590 #: ../fish/guestfish-actions.pod:2371
8593 " is-chardev path\n"
8598 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3451
8600 "This returns C<true> if and only if there is a character device with the "
8601 "given C<path> name."
8605 #: ../fish/guestfish-actions.pod:2378
8610 #: ../fish/guestfish-actions.pod:2380
8618 #: ../fish/guestfish-actions.pod:2382 ../src/guestfs-actions.pod:3465
8620 "This returns true iff this handle is being configured (in the C<CONFIG> "
8625 #: ../fish/guestfish-actions.pod:2387
8630 #: ../fish/guestfish-actions.pod:2389
8638 #: ../fish/guestfish-actions.pod:2391 ../src/guestfs-actions.pod:3480
8640 "This returns C<true> if and only if there is a directory with the given "
8641 "C<path> name. Note that it returns false for other objects like files."
8645 #: ../fish/guestfish-actions.pod:2397
8650 #: ../fish/guestfish-actions.pod:2399
8658 #: ../fish/guestfish-actions.pod:2401 ../src/guestfs-actions.pod:3496
8660 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8661 "given C<path> name."
8665 #: ../fish/guestfish-actions.pod:2406
8670 #: ../fish/guestfish-actions.pod:2408
8678 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3511
8680 "This returns C<true> if and only if there is a regular file with the given "
8681 "C<path> name. Note that it returns false for other objects like "
8686 #: ../fish/guestfish-actions.pod:2416
8687 msgid "is-launching"
8691 #: ../fish/guestfish-actions.pod:2418
8699 #: ../fish/guestfish-actions.pod:2420 ../src/guestfs-actions.pod:3526
8701 "This returns true iff this handle is launching the subprocess (in the "
8702 "C<LAUNCHING> state)."
8706 #: ../fish/guestfish-actions.pod:2425
8711 #: ../fish/guestfish-actions.pod:2427
8719 #: ../fish/guestfish-actions.pod:2429 ../src/guestfs-actions.pod:3541
8721 "This command tests whether C<device> is a logical volume, and returns true "
8722 "iff this is the case."
8726 #: ../fish/guestfish-actions.pod:2432
8731 #: ../fish/guestfish-actions.pod:2434
8739 #: ../fish/guestfish-actions.pod:2436 ../src/guestfs-actions.pod:3553
8741 "This returns true iff this handle is ready to accept commands (in the "
8746 #: ../fish/guestfish-actions.pod:2441
8751 #: ../fish/guestfish-actions.pod:2443
8759 #: ../fish/guestfish-actions.pod:2445 ../src/guestfs-actions.pod:3568
8761 "This returns C<true> if and only if there is a Unix domain socket with the "
8762 "given C<path> name."
8766 #: ../fish/guestfish-actions.pod:2450
8771 #: ../fish/guestfish-actions.pod:2452
8774 " is-symlink path\n"
8779 #: ../fish/guestfish-actions.pod:2454 ../src/guestfs-actions.pod:3583
8781 "This returns C<true> if and only if there is a symbolic link with the given "
8786 #: ../fish/guestfish-actions.pod:2459
8791 #: ../fish/guestfish-actions.pod:2461
8799 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3598
8801 "This returns true iff the file exists and the file is empty or it contains "
8806 #: ../fish/guestfish-actions.pod:2466
8807 msgid "is-zero-device"
8811 #: ../fish/guestfish-actions.pod:2468
8814 " is-zero-device device\n"
8819 #: ../fish/guestfish-actions.pod:2470 ../src/guestfs-actions.pod:3611
8820 msgid "This returns true iff the device exists and contains all zero bytes."
8824 #: ../fish/guestfish-actions.pod:2472 ../src/guestfs-actions.pod:3613
8825 msgid "Note that for large devices this can take a long time to run."
8829 #: ../fish/guestfish-actions.pod:2474
8830 msgid "kill-subprocess"
8834 #: ../fish/guestfish-actions.pod:2476
8837 " kill-subprocess\n"
8842 #: ../fish/guestfish-actions.pod:2478 ../src/guestfs-actions.pod:3624
8843 msgid "This kills the qemu subprocess. You should never need to call this."
8847 #: ../fish/guestfish-actions.pod:2480
8852 #: ../fish/guestfish-actions.pod:2482
8857 #: ../fish/guestfish-actions.pod:2484
8865 #: ../fish/guestfish-actions.pod:2486 ../src/guestfs-actions.pod:3635
8867 "Internally libguestfs is implemented by running a virtual machine using "
8872 #: ../fish/guestfish-actions.pod:2489 ../src/guestfs-actions.pod:3638
8874 "You should call this after configuring the handle (eg. adding drives) but "
8875 "before performing any actions."
8879 #: ../fish/guestfish-actions.pod:2492
8884 #: ../fish/guestfish-actions.pod:2494
8887 " lchown owner group path\n"
8892 #: ../fish/guestfish-actions.pod:2496
8894 "Change the file owner to C<owner> and group to C<group>. This is like "
8895 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
8900 #: ../fish/guestfish-actions.pod:2504
8905 #: ../fish/guestfish-actions.pod:2506
8908 " lgetxattr path name\n"
8913 #: ../fish/guestfish-actions.pod:2508 ../src/guestfs-actions.pod:3678
8915 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
8916 "is a symlink, then this call returns an extended attribute from the symlink."
8920 #: ../fish/guestfish-actions.pod:2522
8921 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
8925 #: ../fish/guestfish-actions.pod:2524
8930 #: ../fish/guestfish-actions.pod:2526
8933 " lgetxattrs path\n"
8938 #: ../fish/guestfish-actions.pod:2528
8940 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
8941 "it returns the extended attributes of the link itself."
8945 #: ../fish/guestfish-actions.pod:2532
8950 #: ../fish/guestfish-actions.pod:2534
8958 #: ../fish/guestfish-actions.pod:2536 ../src/guestfs-actions.pod:3721
8960 "List all 9p filesystems attached to the guest. A list of mount tags is "
8965 #: ../fish/guestfish-actions.pod:2539
8966 msgid "list-devices"
8970 #: ../fish/guestfish-actions.pod:2541
8978 #: ../fish/guestfish-actions.pod:2543 ../src/guestfs-actions.pod:3735
8979 msgid "List all the block devices."
8983 #: ../fish/guestfish-actions.pod:2545 ../src/guestfs-actions.pod:3737
8984 msgid "The full block device names are returned, eg. C</dev/sda>."
8988 #: ../fish/guestfish-actions.pod:2549
8989 msgid "list-dm-devices"
8993 #: ../fish/guestfish-actions.pod:2551
8996 " list-dm-devices\n"
9001 #: ../fish/guestfish-actions.pod:2553 ../src/guestfs-actions.pod:3752
9002 msgid "List all device mapper devices."
9006 #: ../fish/guestfish-actions.pod:2555
9008 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
9009 "previous call to L</luks-open>."
9013 #: ../fish/guestfish-actions.pod:2558
9015 "Device mapper devices which correspond to logical volumes are I<not> "
9016 "returned in this list. Call L</lvs> if you want to list logical volumes."
9020 #: ../fish/guestfish-actions.pod:2562
9021 msgid "list-filesystems"
9025 #: ../fish/guestfish-actions.pod:2564
9028 " list-filesystems\n"
9033 #: ../fish/guestfish-actions.pod:2566 ../src/guestfs-actions.pod:3772
9035 "This inspection command looks for filesystems on partitions, block devices "
9036 "and logical volumes, returning a list of devices containing filesystems and "
9041 #: ../fish/guestfish-actions.pod:2570 ../src/guestfs-actions.pod:3776
9043 "The return value is a hash, where the keys are the devices containing "
9044 "filesystems, and the values are the filesystem types. For example:"
9048 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3780
9051 " \"/dev/sda1\" => \"ntfs\"\n"
9052 " \"/dev/sda2\" => \"ext2\"\n"
9053 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9054 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9059 #: ../fish/guestfish-actions.pod:2579 ../src/guestfs-actions.pod:3785
9061 "The value can have the special value \"unknown\", meaning the content of the "
9062 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9066 #: ../fish/guestfish-actions.pod:2583
9068 "This command runs other libguestfs commands, which might include L</mount> "
9069 "and L</umount>, and therefore you should use this soon after launch and only "
9070 "when nothing is mounted."
9074 #: ../fish/guestfish-actions.pod:2587
9076 "Not all of the filesystems returned will be mountable. In particular, swap "
9077 "partitions are returned in the list. Also this command does not check that "
9078 "each filesystem found is valid and mountable, and some filesystems might be "
9079 "mountable but require special options. Filesystems may not all belong to a "
9080 "single logical operating system (use L</inspect-os> to look for OSes)."
9084 #: ../fish/guestfish-actions.pod:2595
9085 msgid "list-partitions"
9089 #: ../fish/guestfish-actions.pod:2597
9092 " list-partitions\n"
9097 #: ../fish/guestfish-actions.pod:2599 ../src/guestfs-actions.pod:3814
9098 msgid "List all the partitions detected on all block devices."
9102 #: ../fish/guestfish-actions.pod:2601 ../src/guestfs-actions.pod:3816
9103 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9107 #: ../fish/guestfish-actions.pod:2603
9109 "This does not return logical volumes. For that you will need to call "
9114 #: ../fish/guestfish-actions.pod:2608
9119 #: ../fish/guestfish-actions.pod:2610
9127 #: ../fish/guestfish-actions.pod:2612 ../src/guestfs-actions.pod:3835
9129 "List the files in C<directory> (relative to the root directory, there is no "
9130 "cwd) in the format of 'ls -la'."
9134 #: ../fish/guestfish-actions.pod:2615 ../src/guestfs-actions.pod:3838
9136 "This command is mostly useful for interactive sessions. It is I<not> "
9137 "intended that you try to parse the output string."
9141 #: ../fish/guestfish-actions.pod:2618
9146 #: ../fish/guestfish-actions.pod:2620
9149 " ln target linkname\n"
9154 #: ../fish/guestfish-actions.pod:2622 ../src/guestfs-actions.pod:3853
9155 msgid "This command creates a hard link using the C<ln> command."
9159 #: ../fish/guestfish-actions.pod:2624
9164 #: ../fish/guestfish-actions.pod:2626
9167 " ln-f target linkname\n"
9172 #: ../fish/guestfish-actions.pod:2628 ../src/guestfs-actions.pod:3866
9174 "This command creates a hard link using the C<ln -f> command. The I<-f> "
9175 "option removes the link (C<linkname>) if it exists already."
9179 #: ../fish/guestfish-actions.pod:2631
9184 #: ../fish/guestfish-actions.pod:2633
9187 " ln-s target linkname\n"
9192 #: ../fish/guestfish-actions.pod:2635 ../src/guestfs-actions.pod:3880
9193 msgid "This command creates a symbolic link using the C<ln -s> command."
9197 #: ../fish/guestfish-actions.pod:2637
9202 #: ../fish/guestfish-actions.pod:2639
9205 " ln-sf target linkname\n"
9210 #: ../fish/guestfish-actions.pod:2641 ../src/guestfs-actions.pod:3893
9212 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
9213 "option removes the link (C<linkname>) if it exists already."
9217 #: ../fish/guestfish-actions.pod:2644
9218 msgid "lremovexattr"
9222 #: ../fish/guestfish-actions.pod:2646
9225 " lremovexattr xattr path\n"
9230 #: ../fish/guestfish-actions.pod:2648
9232 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
9233 "it removes an extended attribute of the link itself."
9237 #: ../fish/guestfish-actions.pod:2652
9242 #: ../fish/guestfish-actions.pod:2654
9250 #: ../fish/guestfish-actions.pod:2656 ../src/guestfs-actions.pod:3921
9252 "List the files in C<directory> (relative to the root directory, there is no "
9253 "cwd). The '.' and '..' entries are not returned, but hidden files are "
9258 #: ../fish/guestfish-actions.pod:2660
9260 "This command is mostly useful for interactive sessions. Programs should "
9261 "probably use L</readdir> instead."
9265 #: ../fish/guestfish-actions.pod:2663
9270 #: ../fish/guestfish-actions.pod:2665
9273 " lsetxattr xattr val vallen path\n"
9278 #: ../fish/guestfish-actions.pod:2667
9280 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
9281 "sets an extended attribute of the link itself."
9285 #: ../fish/guestfish-actions.pod:2671
9290 #: ../fish/guestfish-actions.pod:2673
9298 #: ../fish/guestfish-actions.pod:2675 ../fish/guestfish-actions.pod:4483 ../src/guestfs-actions.pod:3957 ../src/guestfs-actions.pod:6736
9299 msgid "Returns file information for the given C<path>."
9303 #: ../fish/guestfish-actions.pod:2677
9305 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
9306 "the link is stat-ed, not the file it refers to."
9310 #: ../fish/guestfish-actions.pod:2681 ../src/guestfs-actions.pod:3963
9311 msgid "This is the same as the C<lstat(2)> system call."
9315 #: ../fish/guestfish-actions.pod:2683
9320 #: ../fish/guestfish-actions.pod:2685
9323 " lstatlist path 'names ...'\n"
9328 #: ../fish/guestfish-actions.pod:2687
9330 "This call allows you to perform the L</lstat> operation on multiple files, "
9331 "where all files are in the directory C<path>. C<names> is the list of files "
9332 "from this directory."
9336 #: ../fish/guestfish-actions.pod:2691 ../src/guestfs-actions.pod:3982
9338 "On return you get a list of stat structs, with a one-to-one correspondence "
9339 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9340 "then the C<ino> field of that structure is set to C<-1>."
9344 #: ../fish/guestfish-actions.pod:2696
9346 "This call is intended for programs that want to efficiently list a directory "
9347 "contents without making many round-trips. See also L</lxattrlist> for a "
9348 "similarly efficient call for getting extended attributes. Very long "
9349 "directory listings might cause the protocol message size to be exceeded, "
9350 "causing this call to fail. The caller must split up such requests into "
9351 "smaller groups of names."
9355 #: ../fish/guestfish-actions.pod:2704
9356 msgid "luks-add-key"
9360 #: ../fish/guestfish-actions.pod:2706
9363 " luks-add-key device keyslot\n"
9368 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4010
9370 "This command adds a new key on LUKS device C<device>. C<key> is any "
9371 "existing key, and is used to access the device. C<newkey> is the new key to "
9372 "add. C<keyslot> is the key slot that will be replaced."
9376 #: ../fish/guestfish-actions.pod:2713
9378 "Note that if C<keyslot> already contains a key, then this command will "
9379 "fail. You have to use L</luks-kill-slot> first to remove that key."
9383 #: ../fish/guestfish-actions.pod:2717 ../fish/guestfish-actions.pod:2739 ../fish/guestfish-actions.pod:2752 ../fish/guestfish-actions.pod:2766 ../fish/guestfish-actions.pod:2792 ../fish/guestfish-actions.pod:2802
9385 "This command has one or more key or passphrase parameters. Guestfish will "
9386 "prompt for these separately."
9390 #: ../fish/guestfish-actions.pod:2720
9395 #: ../fish/guestfish-actions.pod:2722
9398 " luks-close device\n"
9403 #: ../fish/guestfish-actions.pod:2724
9405 "This closes a LUKS device that was created earlier by L</luks-open> or "
9406 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
9407 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9408 "underlying block device."
9412 #: ../fish/guestfish-actions.pod:2730
9417 #: ../fish/guestfish-actions.pod:2732
9420 " luks-format device keyslot\n"
9425 #: ../fish/guestfish-actions.pod:2734 ../src/guestfs-actions.pod:4051
9427 "This command erases existing data on C<device> and formats the device as a "
9428 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9429 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9433 #: ../fish/guestfish-actions.pod:2742 ../fish/guestfish-actions.pod:2755 ../fish/guestfish-actions.pod:2842 ../fish/guestfish-actions.pod:3503 ../fish/guestfish-actions.pod:4029 ../fish/guestfish-actions.pod:4354 ../fish/guestfish-actions.pod:4377 ../fish/guestfish-actions.pod:4399 ../fish/guestfish-actions.pod:5145 ../src/guestfs-actions.pod:4058 ../src/guestfs-actions.pod:4081 ../src/guestfs-actions.pod:4224 ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:6115 ../src/guestfs-actions.pod:6550 ../src/guestfs-actions.pod:6580 ../src/guestfs-actions.pod:6613 ../src/guestfs-actions.pod:7812
9435 "B<This command is dangerous. Without careful use you can easily destroy all "
9440 #: ../fish/guestfish-actions.pod:2745
9441 msgid "luks-format-cipher"
9445 #: ../fish/guestfish-actions.pod:2747
9448 " luks-format-cipher device keyslot cipher\n"
9453 #: ../fish/guestfish-actions.pod:2749
9455 "This command is the same as L</luks-format> but it also allows you to set "
9456 "the C<cipher> used."
9460 #: ../fish/guestfish-actions.pod:2758
9461 msgid "luks-kill-slot"
9465 #: ../fish/guestfish-actions.pod:2760
9468 " luks-kill-slot device keyslot\n"
9473 #: ../fish/guestfish-actions.pod:2762 ../src/guestfs-actions.pod:4098
9475 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9476 "device C<device>. C<key> must be one of the I<other> keys."
9480 #: ../fish/guestfish-actions.pod:2769
9485 #: ../fish/guestfish-actions.pod:2771
9488 " luks-open device mapname\n"
9493 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4118
9495 "This command opens a block device which has been encrypted according to the "
9496 "Linux Unified Key Setup (LUKS) standard."
9500 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4121
9501 msgid "C<device> is the encrypted block device or partition."
9505 #: ../fish/guestfish-actions.pod:2778 ../src/guestfs-actions.pod:4123
9507 "The caller must supply one of the keys associated with the LUKS block "
9508 "device, in the C<key> parameter."
9512 #: ../fish/guestfish-actions.pod:2781 ../src/guestfs-actions.pod:4126
9514 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9515 "writes to this block device are decrypted from and encrypted to the "
9516 "underlying C<device> respectively."
9520 #: ../fish/guestfish-actions.pod:2785
9522 "If this block device contains LVM volume groups, then calling L</vgscan> "
9523 "followed by L</vg-activate-all> will make them visible."
9527 #: ../fish/guestfish-actions.pod:2789
9528 msgid "Use L</list-dm-devices> to list all device mapper devices."
9532 #: ../fish/guestfish-actions.pod:2795
9533 msgid "luks-open-ro"
9537 #: ../fish/guestfish-actions.pod:2797
9540 " luks-open-ro device mapname\n"
9545 #: ../fish/guestfish-actions.pod:2799
9547 "This is the same as L</luks-open> except that a read-only mapping is "
9552 #: ../fish/guestfish-actions.pod:2805
9557 #: ../fish/guestfish-actions.pod:2807
9560 " lvcreate logvol volgroup mbytes\n"
9565 #: ../fish/guestfish-actions.pod:2809 ../src/guestfs-actions.pod:4172
9567 "This creates an LVM logical volume called C<logvol> on the volume group "
9568 "C<volgroup>, with C<size> megabytes."
9572 #: ../fish/guestfish-actions.pod:2812
9573 msgid "lvm-canonical-lv-name"
9577 #: ../fish/guestfish-actions.pod:2814
9580 " lvm-canonical-lv-name lvname\n"
9585 #: ../fish/guestfish-actions.pod:2816 ../src/guestfs-actions.pod:4185
9587 "This converts alternative naming schemes for LVs that you might find to the "
9588 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
9593 #: ../fish/guestfish-actions.pod:2820 ../src/guestfs-actions.pod:4189
9595 "This command returns an error if the C<lvname> parameter does not refer to a "
9600 #: ../fish/guestfish-actions.pod:2823
9601 msgid "See also L</is-lv>."
9605 #: ../fish/guestfish-actions.pod:2825
9606 msgid "lvm-clear-filter"
9610 #: ../fish/guestfish-actions.pod:2827
9613 " lvm-clear-filter\n"
9618 #: ../fish/guestfish-actions.pod:2829
9620 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
9625 #: ../fish/guestfish-actions.pod:2832 ../fish/guestfish-actions.pod:2863 ../src/guestfs-actions.pod:4207 ../src/guestfs-actions.pod:4249
9626 msgid "This command also clears the LVM cache and performs a volume group scan."
9630 #: ../fish/guestfish-actions.pod:2835
9631 msgid "lvm-remove-all"
9635 #: ../fish/guestfish-actions.pod:2837
9643 #: ../fish/guestfish-actions.pod:2839 ../src/guestfs-actions.pod:4219
9645 "This command removes all LVM logical volumes, volume groups and physical "
9650 #: ../fish/guestfish-actions.pod:2845
9651 msgid "lvm-set-filter"
9655 #: ../fish/guestfish-actions.pod:2847
9658 " lvm-set-filter 'devices ...'\n"
9663 #: ../fish/guestfish-actions.pod:2849 ../src/guestfs-actions.pod:4235
9665 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9666 "block devices in the list C<devices>, and will ignore all other attached "
9671 #: ../fish/guestfish-actions.pod:2853 ../src/guestfs-actions.pod:4239
9673 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9674 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9675 "there are two types of duplication possible: either cloned PVs/VGs which "
9676 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9677 "same name. In normal operation you cannot create this situation, but you "
9678 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9679 "inside the LVM metadata."
9683 #: ../fish/guestfish-actions.pod:2866 ../src/guestfs-actions.pod:4252
9684 msgid "You can filter whole block devices or individual partitions."
9688 #: ../fish/guestfish-actions.pod:2868 ../src/guestfs-actions.pod:4254
9690 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9691 "filesystem), even if you are not filtering out that VG."
9695 #: ../fish/guestfish-actions.pod:2872
9700 #: ../fish/guestfish-actions.pod:2874
9703 " lvremove device\n"
9708 #: ../fish/guestfish-actions.pod:2876 ../src/guestfs-actions.pod:4268
9710 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9711 "LV, such as C</dev/VG/LV>."
9715 #: ../fish/guestfish-actions.pod:2879 ../src/guestfs-actions.pod:4271
9717 "You can also remove all LVs in a volume group by specifying the VG name, "
9722 #: ../fish/guestfish-actions.pod:2882
9727 #: ../fish/guestfish-actions.pod:2884
9730 " lvrename logvol newlogvol\n"
9735 #: ../fish/guestfish-actions.pod:2886 ../src/guestfs-actions.pod:4285
9736 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9740 #: ../fish/guestfish-actions.pod:2888
9745 #: ../fish/guestfish-actions.pod:2890
9748 " lvresize device mbytes\n"
9753 #: ../fish/guestfish-actions.pod:2892 ../src/guestfs-actions.pod:4298
9755 "This resizes (expands or shrinks) an existing LVM logical volume to "
9756 "C<mbytes>. When reducing, data in the reduced part is lost."
9760 #: ../fish/guestfish-actions.pod:2896
9761 msgid "lvresize-free"
9765 #: ../fish/guestfish-actions.pod:2898
9768 " lvresize-free lv percent\n"
9773 #: ../fish/guestfish-actions.pod:2900 ../src/guestfs-actions.pod:4313
9775 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9776 "remaining free space in the volume group. Commonly you would call this with "
9777 "pc = 100 which expands the logical volume as much as possible, using all "
9778 "remaining free space in the volume group."
9782 #: ../fish/guestfish-actions.pod:2906
9787 #: ../fish/guestfish-actions.pod:2908
9795 #: ../fish/guestfish-actions.pod:2910 ../src/guestfs-actions.pod:4328
9797 "List all the logical volumes detected. This is the equivalent of the "
9798 "L<lvs(8)> command."
9802 #: ../fish/guestfish-actions.pod:2913 ../src/guestfs-actions.pod:4331
9804 "This returns a list of the logical volume device names "
9805 "(eg. C</dev/VolGroup00/LogVol00>)."
9809 #: ../fish/guestfish-actions.pod:2916
9810 msgid "See also L</lvs-full>, L</list-filesystems>."
9814 #: ../fish/guestfish-actions.pod:2918
9819 #: ../fish/guestfish-actions.pod:2920
9827 #: ../fish/guestfish-actions.pod:2922 ../src/guestfs-actions.pod:4347
9829 "List all the logical volumes detected. This is the equivalent of the "
9830 "L<lvs(8)> command. The \"full\" version includes all fields."
9834 #: ../fish/guestfish-actions.pod:2925
9839 #: ../fish/guestfish-actions.pod:2927
9847 #: ../fish/guestfish-actions.pod:2929 ../src/guestfs-actions.pod:4362
9848 msgid "This command returns the UUID of the LVM LV C<device>."
9852 #: ../fish/guestfish-actions.pod:2931
9857 #: ../fish/guestfish-actions.pod:2933
9860 " lxattrlist path 'names ...'\n"
9865 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4376
9867 "This call allows you to get the extended attributes of multiple files, where "
9868 "all files are in the directory C<path>. C<names> is the list of files from "
9873 #: ../fish/guestfish-actions.pod:2939 ../src/guestfs-actions.pod:4380
9875 "On return you get a flat list of xattr structs which must be interpreted "
9876 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9877 "C<attrval> in this struct is zero-length to indicate there was an error "
9878 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9879 "number (the number of following attributes for this file, which could be "
9880 "C<\"0\">). Then after the first xattr struct are the zero or more "
9881 "attributes for the first named file. This repeats for the second and "
9886 #: ../fish/guestfish-actions.pod:2949
9888 "This call is intended for programs that want to efficiently list a directory "
9889 "contents without making many round-trips. See also L</lstatlist> for a "
9890 "similarly efficient call for getting standard stats. Very long directory "
9891 "listings might cause the protocol message size to be exceeded, causing this "
9892 "call to fail. The caller must split up such requests into smaller groups of "
9897 #: ../fish/guestfish-actions.pod:2957
9902 #: ../fish/guestfish-actions.pod:2959
9910 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4410
9911 msgid "Create a directory named C<path>."
9915 #: ../fish/guestfish-actions.pod:2963
9920 #: ../fish/guestfish-actions.pod:2965
9923 " mkdir-mode path mode\n"
9928 #: ../fish/guestfish-actions.pod:2967 ../src/guestfs-actions.pod:4423
9930 "This command creates a directory, setting the initial permissions of the "
9931 "directory to C<mode>."
9935 #: ../fish/guestfish-actions.pod:2970 ../src/guestfs-actions.pod:4426
9937 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9938 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9943 #: ../fish/guestfish-actions.pod:2974
9944 msgid "See also L</mkdir>, L</umask>"
9948 #: ../fish/guestfish-actions.pod:2976
9953 #: ../fish/guestfish-actions.pod:2978
9961 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4442
9963 "Create a directory named C<path>, creating any parent directories as "
9964 "necessary. This is like the C<mkdir -p> shell command."
9968 #: ../fish/guestfish-actions.pod:2983
9973 #: ../fish/guestfish-actions.pod:2985
9976 " mkdtemp template\n"
9981 #: ../fish/guestfish-actions.pod:2987 ../src/guestfs-actions.pod:4455
9983 "This command creates a temporary directory. The C<template> parameter "
9984 "should be a full pathname for the temporary directory name with the final "
9985 "six characters being \"XXXXXX\"."
9989 #: ../fish/guestfish-actions.pod:2992 ../src/guestfs-actions.pod:4460
9991 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9992 "being suitable for Windows filesystems."
9996 #: ../fish/guestfish-actions.pod:2995 ../src/guestfs-actions.pod:4463
9997 msgid "The name of the temporary directory that was created is returned."
10001 #: ../fish/guestfish-actions.pod:2998 ../src/guestfs-actions.pod:4466
10002 msgid "The temporary directory is created with mode 0700 and is owned by root."
10006 #: ../fish/guestfish-actions.pod:3001 ../src/guestfs-actions.pod:4469
10008 "The caller is responsible for deleting the temporary directory and its "
10009 "contents after use."
10013 #: ../fish/guestfish-actions.pod:3004 ../src/guestfs-actions.pod:4472
10014 msgid "See also: L<mkdtemp(3)>"
10018 #: ../fish/guestfish-actions.pod:3006
10023 #: ../fish/guestfish-actions.pod:3008
10026 " mke2fs-J fstype blocksize device journal\n"
10031 #: ../fish/guestfish-actions.pod:3010 ../src/guestfs-actions.pod:4488
10033 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10034 "C<journal>. It is equivalent to the command:"
10038 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4492
10041 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10046 #: ../fish/guestfish-actions.pod:3016
10047 msgid "See also L</mke2journal>."
10051 #: ../fish/guestfish-actions.pod:3018
10056 #: ../fish/guestfish-actions.pod:3020
10059 " mke2fs-JL fstype blocksize device label\n"
10064 #: ../fish/guestfish-actions.pod:3022 ../src/guestfs-actions.pod:4509
10066 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10067 "the journal labeled C<label>."
10071 #: ../fish/guestfish-actions.pod:3025
10072 msgid "See also L</mke2journal-L>."
10076 #: ../fish/guestfish-actions.pod:3027
10081 #: ../fish/guestfish-actions.pod:3029
10084 " mke2fs-JU fstype blocksize device uuid\n"
10089 #: ../fish/guestfish-actions.pod:3031 ../src/guestfs-actions.pod:4527
10091 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10092 "the journal with UUID C<uuid>."
10096 #: ../fish/guestfish-actions.pod:3034
10097 msgid "See also L</mke2journal-U>."
10101 #: ../fish/guestfish-actions.pod:3036
10102 msgid "mke2journal"
10106 #: ../fish/guestfish-actions.pod:3038
10109 " mke2journal blocksize device\n"
10114 #: ../fish/guestfish-actions.pod:3040 ../src/guestfs-actions.pod:4543
10116 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10121 #: ../fish/guestfish-actions.pod:3043 ../src/guestfs-actions.pod:4546
10124 " mke2fs -O journal_dev -b blocksize device\n"
10129 #: ../fish/guestfish-actions.pod:3045
10130 msgid "mke2journal-L"
10134 #: ../fish/guestfish-actions.pod:3047
10137 " mke2journal-L blocksize label device\n"
10142 #: ../fish/guestfish-actions.pod:3049 ../src/guestfs-actions.pod:4560
10143 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10147 #: ../fish/guestfish-actions.pod:3051
10148 msgid "mke2journal-U"
10152 #: ../fish/guestfish-actions.pod:3053
10155 " mke2journal-U blocksize uuid device\n"
10160 #: ../fish/guestfish-actions.pod:3055 ../src/guestfs-actions.pod:4574
10161 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10165 #: ../fish/guestfish-actions.pod:3057
10170 #: ../fish/guestfish-actions.pod:3059
10173 " mkfifo mode path\n"
10178 #: ../fish/guestfish-actions.pod:3061
10180 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10181 "is just a convenient wrapper around L</mknod>."
10185 #: ../fish/guestfish-actions.pod:3067
10190 #: ../fish/guestfish-actions.pod:3069
10193 " mkfs fstype device\n"
10198 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4604
10200 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10201 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10205 #: ../fish/guestfish-actions.pod:3075
10210 #: ../fish/guestfish-actions.pod:3077
10213 " mkfs-b fstype blocksize device\n"
10218 #: ../fish/guestfish-actions.pod:3079
10220 "This call is similar to L</mkfs>, but it allows you to control the block "
10221 "size of the resulting filesystem. Supported block sizes depend on the "
10222 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10226 #: ../fish/guestfish-actions.pod:3084 ../fish/guestfish-actions.pod:3111 ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:4670
10228 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10233 #: ../fish/guestfish-actions.pod:3087
10235 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
10240 #: ../fish/guestfish-actions.pod:3094
10245 #: ../fish/guestfish-actions.pod:3096
10248 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
10249 "[sectorsize:..]\n"
10254 #: ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4657
10256 "This function creates a filesystem on C<device>. The filesystem type is "
10257 "C<fstype>, for example C<ext3>."
10261 #: ../fish/guestfish-actions.pod:3105 ../src/guestfs-actions.pod:4664
10262 msgid "C<blocksize>"
10266 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4666
10268 "The filesystem block size. Supported block sizes depend on the filesystem "
10269 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
10274 #: ../fish/guestfish-actions.pod:3114 ../src/guestfs-actions.pod:4673
10275 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
10279 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4675
10280 msgid "C<features>"
10284 #: ../fish/guestfish-actions.pod:3118 ../src/guestfs-actions.pod:4677
10285 msgid "This passes the I<-O> parameter to the external mkfs program."
10289 #: ../fish/guestfish-actions.pod:3120 ../src/guestfs-actions.pod:4679
10291 "For certain filesystem types, this allows extra filesystem features to be "
10292 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
10296 #: ../fish/guestfish-actions.pod:3124 ../src/guestfs-actions.pod:4683
10298 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
10303 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4686
10308 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4688
10310 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
10311 "sets the inode size (only for ext2/3/4 filesystems at present)."
10315 #: ../fish/guestfish-actions.pod:3132 ../src/guestfs-actions.pod:4691
10316 msgid "C<sectorsize>"
10320 #: ../fish/guestfish-actions.pod:3134 ../src/guestfs-actions.pod:4693
10322 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
10323 "sets sector size for ufs filesystem."
10327 #: ../fish/guestfish-actions.pod:3141
10328 msgid "mkmountpoint"
10332 #: ../fish/guestfish-actions.pod:3143
10335 " mkmountpoint exemptpath\n"
10340 #: ../fish/guestfish-actions.pod:3145
10342 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
10343 "to create extra mountpoints before mounting the first filesystem."
10347 #: ../fish/guestfish-actions.pod:3149 ../src/guestfs-actions.pod:4736
10349 "These calls are I<only> necessary in some very limited circumstances, mainly "
10350 "the case where you want to mount a mix of unrelated and/or read-only "
10351 "filesystems together."
10355 #: ../fish/guestfish-actions.pod:3153 ../src/guestfs-actions.pod:4740
10357 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10358 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10359 "inside that. You can unpack this as follows in guestfish:"
10363 #: ../fish/guestfish-actions.pod:3158 ../src/guestfs-actions.pod:4745
10366 " add-ro Fedora-11-i686-Live.iso\n"
10368 " mkmountpoint /cd\n"
10369 " mkmountpoint /sqsh\n"
10370 " mkmountpoint /ext3fs\n"
10371 " mount /dev/sda /cd\n"
10372 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10373 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10378 #: ../fish/guestfish-actions.pod:3167 ../src/guestfs-actions.pod:4754
10379 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10383 #: ../fish/guestfish-actions.pod:3169
10385 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
10386 "unexpected errors if you try to mix these calls. It is safest to manually "
10387 "unmount filesystems and remove mountpoints after use."
10391 #: ../fish/guestfish-actions.pod:3173
10393 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
10394 "for this to work for manual mountpoints, you must ensure that the innermost "
10395 "mountpoints have the longest pathnames, as in the example code above."
10399 #: ../fish/guestfish-actions.pod:3178 ../src/guestfs-actions.pod:4765
10400 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10404 #: ../fish/guestfish-actions.pod:3180
10406 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
10407 "L</umount-all> to be called when the handle is closed which can also trigger "
10412 #: ../fish/guestfish-actions.pod:3184
10417 #: ../fish/guestfish-actions.pod:3186
10420 " mknod mode devmajor devminor path\n"
10425 #: ../fish/guestfish-actions.pod:3188 ../src/guestfs-actions.pod:4784
10427 "This call creates block or character special devices, or named pipes "
10432 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4787
10434 "The C<mode> parameter should be the mode, using the standard constants. "
10435 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10436 "used when creating block and character special devices."
10440 #: ../fish/guestfish-actions.pod:3196
10442 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10443 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10444 "regular file). These constants are available in the standard Linux header "
10445 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
10446 "wrappers around this command which bitwise OR in the appropriate constant "
10451 #: ../fish/guestfish-actions.pod:3206
10456 #: ../fish/guestfish-actions.pod:3208
10459 " mknod-b mode devmajor devminor path\n"
10464 #: ../fish/guestfish-actions.pod:3210
10466 "This call creates a block device node called C<path> with mode C<mode> and "
10467 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10468 "wrapper around L</mknod>."
10472 #: ../fish/guestfish-actions.pod:3216
10477 #: ../fish/guestfish-actions.pod:3218
10480 " mknod-c mode devmajor devminor path\n"
10485 #: ../fish/guestfish-actions.pod:3220
10487 "This call creates a char device node called C<path> with mode C<mode> and "
10488 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10489 "wrapper around L</mknod>."
10493 #: ../fish/guestfish-actions.pod:3226
10498 #: ../fish/guestfish-actions.pod:3228
10506 #: ../fish/guestfish-actions.pod:3230 ../src/guestfs-actions.pod:4850
10507 msgid "Create a swap partition on C<device>."
10511 #: ../fish/guestfish-actions.pod:3232
10516 #: ../fish/guestfish-actions.pod:3234
10519 " mkswap-L label device\n"
10524 #: ../fish/guestfish-actions.pod:3236 ../src/guestfs-actions.pod:4863
10525 msgid "Create a swap partition on C<device> with label C<label>."
10529 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4865
10531 "Note that you cannot attach a swap label to a block device "
10532 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
10533 "the kernel or swap tools."
10537 #: ../fish/guestfish-actions.pod:3242
10542 #: ../fish/guestfish-actions.pod:3244
10545 " mkswap-U uuid device\n"
10550 #: ../fish/guestfish-actions.pod:3246 ../src/guestfs-actions.pod:4880
10551 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10555 #: ../fish/guestfish-actions.pod:3248
10556 msgid "mkswap-file"
10560 #: ../fish/guestfish-actions.pod:3250
10563 " mkswap-file path\n"
10568 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4892
10569 msgid "Create a swap file."
10573 #: ../fish/guestfish-actions.pod:3254
10575 "This command just writes a swap file signature to an existing file. To "
10576 "create the file itself, use something like L</fallocate>."
10580 #: ../fish/guestfish-actions.pod:3257
10585 #: ../fish/guestfish-actions.pod:3259
10588 " modprobe modulename\n"
10593 #: ../fish/guestfish-actions.pod:3261 ../src/guestfs-actions.pod:4907
10594 msgid "This loads a kernel module in the appliance."
10598 #: ../fish/guestfish-actions.pod:3263 ../src/guestfs-actions.pod:4909
10600 "The kernel module must have been whitelisted when libguestfs was built (see "
10601 "C<appliance/kmod.whitelist.in> in the source)."
10605 #: ../fish/guestfish-actions.pod:3266
10610 #: ../fish/guestfish-actions.pod:3268
10613 " mount device mountpoint\n"
10618 #: ../fish/guestfish-actions.pod:3270 ../src/guestfs-actions.pod:4930
10620 "Mount a guest disk at a position in the filesystem. Block devices are named "
10621 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10622 "those block devices contain partitions, they will have the usual names "
10623 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10627 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4936
10629 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10630 "mounted on C</> before others can be mounted. Other filesystems can only be "
10631 "mounted on directories which already exist."
10635 #: ../fish/guestfish-actions.pod:3281 ../src/guestfs-actions.pod:4941
10637 "The mounted filesystem is writable, if we have sufficient permissions on the "
10638 "underlying device."
10642 #: ../fish/guestfish-actions.pod:3284
10644 "B<Important note:> When you use this call, the filesystem options C<sync> "
10645 "and C<noatime> are set implicitly. This was originally done because we "
10646 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10647 "very large negative performance impact and negligible effect on "
10648 "reliability. Therefore we recommend that you avoid using L</mount> in any "
10649 "code that needs performance, and instead use L</mount-options> (use an empty "
10650 "string for the first parameter if you don't want any options)."
10654 #: ../fish/guestfish-actions.pod:3294
10656 "I<This function is deprecated.> In new code, use the L</mount_options> call "
10661 #: ../fish/guestfish-actions.pod:3301
10666 #: ../fish/guestfish-actions.pod:3303
10669 " mount-9p mounttag mountpoint [options:..]\n"
10674 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:4973
10676 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
10681 #: ../fish/guestfish-actions.pod:3308 ../src/guestfs-actions.pod:4976
10683 "If required, C<trans=virtio> will be automatically added to the options. "
10684 "Any other options required can be passed in the optional C<options> "
10689 #: ../fish/guestfish-actions.pod:3314
10694 #: ../fish/guestfish-actions.pod:3316
10697 " mount-loop file mountpoint\n"
10702 #: ../fish/guestfish-actions.pod:3318 ../src/guestfs-actions.pod:5015
10704 "This command lets you mount C<file> (a filesystem image in a file) on a "
10705 "mount point. It is entirely equivalent to the command C<mount -o loop file "
10710 #: ../fish/guestfish-actions.pod:3322
10711 msgid "mount-options"
10715 #: ../fish/guestfish-actions.pod:3324
10718 " mount-options options device mountpoint\n"
10723 #: ../fish/guestfish-actions.pod:3326
10725 "This is the same as the L</mount> command, but it allows you to set the "
10726 "mount options as for the L<mount(8)> I<-o> flag."
10730 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5035
10732 "If the C<options> parameter is an empty string, then no options are passed "
10733 "(all options default to whatever the filesystem uses)."
10737 #: ../fish/guestfish-actions.pod:3334
10742 #: ../fish/guestfish-actions.pod:3336
10745 " mount-ro device mountpoint\n"
10750 #: ../fish/guestfish-actions.pod:3338
10752 "This is the same as the L</mount> command, but it mounts the filesystem with "
10753 "the read-only (I<-o ro>) flag."
10757 #: ../fish/guestfish-actions.pod:3341
10762 #: ../fish/guestfish-actions.pod:3343
10765 " mount-vfs options vfstype device mountpoint\n"
10770 #: ../fish/guestfish-actions.pod:3345
10772 "This is the same as the L</mount> command, but it allows you to set both the "
10773 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
10777 #: ../fish/guestfish-actions.pod:3349
10778 msgid "mountpoints"
10782 #: ../fish/guestfish-actions.pod:3351
10790 #: ../fish/guestfish-actions.pod:3353
10792 "This call is similar to L</mounts>. That call returns a list of devices. "
10793 "This one returns a hash table (map) of device name to directory where the "
10794 "device is mounted."
10798 #: ../fish/guestfish-actions.pod:3357
10803 #: ../fish/guestfish-actions.pod:3359
10811 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5096
10813 "This returns the list of currently mounted filesystems. It returns the list "
10814 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10818 #: ../fish/guestfish-actions.pod:3364 ../src/guestfs-actions.pod:5099
10819 msgid "Some internal mounts are not shown."
10823 #: ../fish/guestfish-actions.pod:3366
10824 msgid "See also: L</mountpoints>"
10828 #: ../fish/guestfish-actions.pod:3368
10833 #: ../fish/guestfish-actions.pod:3370
10841 #: ../fish/guestfish-actions.pod:3372 ../src/guestfs-actions.pod:5116
10843 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10844 "destination filename or destination directory."
10848 #: ../fish/guestfish-actions.pod:3375
10849 msgid "ntfs-3g-probe"
10853 #: ../fish/guestfish-actions.pod:3377
10856 " ntfs-3g-probe true|false device\n"
10861 #: ../fish/guestfish-actions.pod:3379 ../src/guestfs-actions.pod:5130
10863 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10864 "C<device> for mountability. (Not all NTFS volumes can be mounted "
10865 "read-write, and some cannot be mounted at all)."
10869 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5134
10871 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10872 "can be mounted read-write. Set it to false if you want to test if the "
10873 "volume can be mounted read-only."
10877 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5138
10879 "The return value is an integer which C<0> if the operation would succeed, or "
10880 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10884 #: ../fish/guestfish-actions.pod:3391
10889 #: ../fish/guestfish-actions.pod:3393
10892 " ntfsresize device\n"
10897 #: ../fish/guestfish-actions.pod:3395 ../fish/guestfish-actions.pod:3419 ../src/guestfs-actions.pod:5159 ../src/guestfs-actions.pod:5191
10899 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10900 "size of the underlying device."
10904 #: ../fish/guestfish-actions.pod:3398 ../src/guestfs-actions.pod:5162
10906 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
10907 "consistency check (for safety). You have to boot into Windows to perform "
10908 "this check and clear this condition. Furthermore, ntfsresize refuses to "
10909 "resize filesystems which have been marked in this way. So in effect it is "
10910 "not possible to call ntfsresize multiple times on a single filesystem "
10911 "without booting into Windows between each resize."
10915 #: ../fish/guestfish-actions.pod:3406 ../fish/guestfish-actions.pod:3445 ../src/guestfs-actions.pod:5170 ../src/guestfs-actions.pod:5217
10916 msgid "See also L<ntfsresize(8)>."
10920 #: ../fish/guestfish-actions.pod:3408 ../fish/guestfish-actions.pod:3456
10922 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
10927 #: ../fish/guestfish-actions.pod:3415
10928 msgid "ntfsresize-opts"
10932 #: ../fish/guestfish-actions.pod:3417
10935 " ntfsresize-opts device [size:..] [force:..]\n"
10940 #: ../fish/guestfish-actions.pod:3428 ../src/guestfs-actions.pod:5200
10942 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
10943 "resized to fit the container (eg. partition)."
10947 #: ../fish/guestfish-actions.pod:3431 ../src/guestfs-actions.pod:5203
10952 #: ../fish/guestfish-actions.pod:3433 ../src/guestfs-actions.pod:5205
10954 "If this option is true, then force the resize of the filesystem even if the "
10955 "filesystem is marked as requiring a consistency check."
10959 #: ../fish/guestfish-actions.pod:3436
10961 "After the resize operation, the filesystem is always marked as requiring a "
10962 "consistency check (for safety). You have to boot into Windows to perform "
10963 "this check and clear this condition. If you I<don't> set the C<force> "
10964 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
10965 "a single filesystem without booting into Windows between each resize."
10969 #: ../fish/guestfish-actions.pod:3449
10970 msgid "ntfsresize-size"
10974 #: ../fish/guestfish-actions.pod:3451
10977 " ntfsresize-size device size\n"
10982 #: ../fish/guestfish-actions.pod:3453
10984 "This command is the same as L</ntfsresize> except that it allows you to "
10985 "specify the new size (in bytes) explicitly."
10989 #: ../fish/guestfish-actions.pod:3463
10994 #: ../fish/guestfish-actions.pod:3465
10997 " part-add device prlogex startsect endsect\n"
11002 #: ../fish/guestfish-actions.pod:3467
11004 "This command adds a partition to C<device>. If there is no partition table "
11005 "on the device, call L</part-init> first."
11009 #: ../fish/guestfish-actions.pod:3470 ../src/guestfs-actions.pod:5278
11011 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11012 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11013 "C<logical>) and C<e> (or C<extended>) partition types."
11017 #: ../fish/guestfish-actions.pod:3475 ../src/guestfs-actions.pod:5283
11019 "C<startsect> and C<endsect> are the start and end of the partition in "
11020 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11021 "from the end of the disk (C<-1> is the last sector)."
11025 #: ../fish/guestfish-actions.pod:3479
11027 "Creating a partition which covers the whole disk is not so easy. Use "
11028 "L</part-disk> to do that."
11032 #: ../fish/guestfish-actions.pod:3482
11037 #: ../fish/guestfish-actions.pod:3484
11040 " part-del device partnum\n"
11045 #: ../fish/guestfish-actions.pod:3486 ../src/guestfs-actions.pod:5301
11046 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11050 #: ../fish/guestfish-actions.pod:3488 ../src/guestfs-actions.pod:5303
11052 "Note that in the case of MBR partitioning, deleting an extended partition "
11053 "also deletes any logical partitions it contains."
11057 #: ../fish/guestfish-actions.pod:3492
11062 #: ../fish/guestfish-actions.pod:3494
11065 " part-disk device parttype\n"
11070 #: ../fish/guestfish-actions.pod:3496
11072 "This command is simply a combination of L</part-init> followed by "
11073 "L</part-add> to create a single primary partition covering the whole disk."
11077 #: ../fish/guestfish-actions.pod:3500
11079 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11080 "possible values are described in L</part-init>."
11084 #: ../fish/guestfish-actions.pod:3506
11085 msgid "part-get-bootable"
11089 #: ../fish/guestfish-actions.pod:3508
11092 " part-get-bootable device partnum\n"
11097 #: ../fish/guestfish-actions.pod:3510 ../src/guestfs-actions.pod:5339
11099 "This command returns true if the partition C<partnum> on C<device> has the "
11100 "bootable flag set."
11104 #: ../fish/guestfish-actions.pod:3513
11105 msgid "See also L</part-set-bootable>."
11109 #: ../fish/guestfish-actions.pod:3515
11110 msgid "part-get-mbr-id"
11114 #: ../fish/guestfish-actions.pod:3517
11117 " part-get-mbr-id device partnum\n"
11122 #: ../fish/guestfish-actions.pod:3519 ../src/guestfs-actions.pod:5355
11124 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11125 "partition C<partnum>."
11129 #: ../fish/guestfish-actions.pod:3522 ../fish/guestfish-actions.pod:3666
11131 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11132 "undefined results for other partition table types (see "
11133 "L</part-get-parttype>)."
11137 #: ../fish/guestfish-actions.pod:3526
11138 msgid "part-get-parttype"
11142 #: ../fish/guestfish-actions.pod:3528
11145 " part-get-parttype device\n"
11150 #: ../fish/guestfish-actions.pod:3530 ../src/guestfs-actions.pod:5372
11152 "This command examines the partition table on C<device> and returns the "
11153 "partition table type (format) being used."
11157 #: ../fish/guestfish-actions.pod:3533
11159 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11160 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11161 "possible, although unusual. See L</part-init> for a full list."
11165 #: ../fish/guestfish-actions.pod:3538
11170 #: ../fish/guestfish-actions.pod:3540
11173 " part-init device parttype\n"
11178 #: ../fish/guestfish-actions.pod:3542 ../src/guestfs-actions.pod:5392
11180 "This creates an empty partition table on C<device> of one of the partition "
11181 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11182 "(for large disks)."
11186 #: ../fish/guestfish-actions.pod:3546
11188 "Initially there are no partitions. Following this, you should call "
11189 "L</part-add> for each partition required."
11193 #: ../fish/guestfish-actions.pod:3549 ../src/guestfs-actions.pod:5399
11194 msgid "Possible values for C<parttype> are:"
11198 #: ../fish/guestfish-actions.pod:3553 ../src/guestfs-actions.pod:5403
11203 #: ../fish/guestfish-actions.pod:3555 ../src/guestfs-actions.pod:5405
11208 #: ../fish/guestfish-actions.pod:3557 ../src/guestfs-actions.pod:5407
11209 msgid "Intel EFI / GPT partition table."
11213 #: ../fish/guestfish-actions.pod:3559 ../src/guestfs-actions.pod:5409
11215 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11216 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11217 "the C<mbr> format."
11221 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5413
11226 #: ../fish/guestfish-actions.pod:3565 ../src/guestfs-actions.pod:5415
11231 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5417
11233 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11234 "Windows. This partition type will B<only> work for device sizes up to 2 "
11235 "TB. For large disks we recommend using C<gpt>."
11239 #: ../fish/guestfish-actions.pod:3574 ../src/guestfs-actions.pod:5424
11240 msgid "Other partition table types that may work but are not supported include:"
11244 #: ../fish/guestfish-actions.pod:3579 ../src/guestfs-actions.pod:5429
11249 #: ../fish/guestfish-actions.pod:3581 ../src/guestfs-actions.pod:5431
11250 msgid "AIX disk labels."
11254 #: ../fish/guestfish-actions.pod:3583 ../src/guestfs-actions.pod:5433
11259 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5435
11264 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5437
11265 msgid "Amiga \"Rigid Disk Block\" format."
11269 #: ../fish/guestfish-actions.pod:3589 ../src/guestfs-actions.pod:5439
11274 #: ../fish/guestfish-actions.pod:3591 ../src/guestfs-actions.pod:5441
11275 msgid "BSD disk labels."
11279 #: ../fish/guestfish-actions.pod:3593 ../src/guestfs-actions.pod:5443
11284 #: ../fish/guestfish-actions.pod:3595 ../src/guestfs-actions.pod:5445
11285 msgid "DASD, used on IBM mainframes."
11289 #: ../fish/guestfish-actions.pod:3597 ../src/guestfs-actions.pod:5447
11294 #: ../fish/guestfish-actions.pod:3599 ../src/guestfs-actions.pod:5449
11295 msgid "MIPS/SGI volumes."
11299 #: ../fish/guestfish-actions.pod:3601 ../src/guestfs-actions.pod:5451
11304 #: ../fish/guestfish-actions.pod:3603 ../src/guestfs-actions.pod:5453
11305 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11309 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5455
11314 #: ../fish/guestfish-actions.pod:3607 ../src/guestfs-actions.pod:5457
11315 msgid "NEC PC-98 format, common in Japan apparently."
11319 #: ../fish/guestfish-actions.pod:3609 ../src/guestfs-actions.pod:5459
11324 #: ../fish/guestfish-actions.pod:3611 ../src/guestfs-actions.pod:5461
11325 msgid "Sun disk labels."
11329 #: ../fish/guestfish-actions.pod:3615
11334 #: ../fish/guestfish-actions.pod:3617
11337 " part-list device\n"
11342 #: ../fish/guestfish-actions.pod:3619 ../src/guestfs-actions.pod:5475
11344 "This command parses the partition table on C<device> and returns the list of "
11345 "partitions found."
11349 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5478
11350 msgid "The fields in the returned structure are:"
11354 #: ../fish/guestfish-actions.pod:3626 ../src/guestfs-actions.pod:5482
11355 msgid "B<part_num>"
11359 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5484
11360 msgid "Partition number, counting from 1."
11364 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5486
11365 msgid "B<part_start>"
11369 #: ../fish/guestfish-actions.pod:3632
11371 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11372 "the device's sector size, see L</blockdev-getss>."
11376 #: ../fish/guestfish-actions.pod:3635 ../src/guestfs-actions.pod:5491
11377 msgid "B<part_end>"
11381 #: ../fish/guestfish-actions.pod:3637 ../src/guestfs-actions.pod:5493
11382 msgid "End of the partition in bytes."
11386 #: ../fish/guestfish-actions.pod:3639 ../src/guestfs-actions.pod:5495
11387 msgid "B<part_size>"
11391 #: ../fish/guestfish-actions.pod:3641 ../src/guestfs-actions.pod:5497
11392 msgid "Size of the partition in bytes."
11396 #: ../fish/guestfish-actions.pod:3645
11397 msgid "part-set-bootable"
11401 #: ../fish/guestfish-actions.pod:3647
11404 " part-set-bootable device partnum true|false\n"
11409 #: ../fish/guestfish-actions.pod:3649 ../src/guestfs-actions.pod:5515
11411 "This sets the bootable flag on partition numbered C<partnum> on device "
11412 "C<device>. Note that partitions are numbered from 1."
11416 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5518
11418 "The bootable flag is used by some operating systems (notably Windows) to "
11419 "determine which partition to boot from. It is by no means universally "
11424 #: ../fish/guestfish-actions.pod:3656
11425 msgid "part-set-mbr-id"
11429 #: ../fish/guestfish-actions.pod:3658
11432 " part-set-mbr-id device partnum idbyte\n"
11437 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5534
11439 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11440 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11441 "documentation are in fact hexadecimal numbers, but usually documented "
11442 "without any leading \"0x\" which might be confusing."
11446 #: ../fish/guestfish-actions.pod:3670
11447 msgid "part-set-name"
11451 #: ../fish/guestfish-actions.pod:3672
11454 " part-set-name device partnum name\n"
11459 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5556
11461 "This sets the partition name on partition numbered C<partnum> on device "
11462 "C<device>. Note that partitions are numbered from 1."
11466 #: ../fish/guestfish-actions.pod:3677 ../src/guestfs-actions.pod:5559
11468 "The partition name can only be set on certain types of partition table. "
11469 "This works on C<gpt> but not on C<mbr> partitions."
11473 #: ../fish/guestfish-actions.pod:3680
11474 msgid "part-to-dev"
11478 #: ../fish/guestfish-actions.pod:3682
11481 " part-to-dev partition\n"
11486 #: ../fish/guestfish-actions.pod:3684 ../src/guestfs-actions.pod:5572
11488 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11489 "partition number, returning the device name (eg. \"/dev/sdb\")."
11493 #: ../fish/guestfish-actions.pod:3688
11495 "The named partition must exist, for example as a string returned from "
11496 "L</list-partitions>."
11500 #: ../fish/guestfish-actions.pod:3691
11501 msgid "ping-daemon"
11505 #: ../fish/guestfish-actions.pod:3693
11513 #: ../fish/guestfish-actions.pod:3695 ../src/guestfs-actions.pod:5589
11515 "This is a test probe into the guestfs daemon running inside the qemu "
11516 "subprocess. Calling this function checks that the daemon responds to the "
11517 "ping message, without affecting the daemon or attached block device(s) in "
11522 #: ../fish/guestfish-actions.pod:3700
11527 #: ../fish/guestfish-actions.pod:3702
11530 " pread path count offset\n"
11535 #: ../fish/guestfish-actions.pod:3704 ../src/guestfs-actions.pod:5607
11537 "This command lets you read part of a file. It reads C<count> bytes of the "
11538 "file, starting at C<offset>, from file C<path>."
11542 #: ../fish/guestfish-actions.pod:3707 ../fish/guestfish-actions.pod:3722 ../src/guestfs-actions.pod:5610 ../src/guestfs-actions.pod:5636
11544 "This may read fewer bytes than requested. For further details see the "
11545 "L<pread(2)> system call."
11549 #: ../fish/guestfish-actions.pod:3710
11550 msgid "See also L</pwrite>, L</pread-device>."
11554 #: ../fish/guestfish-actions.pod:3715
11555 msgid "pread-device"
11559 #: ../fish/guestfish-actions.pod:3717
11562 " pread-device device count offset\n"
11567 #: ../fish/guestfish-actions.pod:3719 ../src/guestfs-actions.pod:5633
11569 "This command lets you read part of a file. It reads C<count> bytes of "
11570 "C<device>, starting at C<offset>."
11574 #: ../fish/guestfish-actions.pod:3725
11575 msgid "See also L</pread>."
11579 #: ../fish/guestfish-actions.pod:3730
11584 #: ../fish/guestfish-actions.pod:3732
11587 " pvcreate device\n"
11592 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5656
11594 "This creates an LVM physical volume on the named C<device>, where C<device> "
11595 "should usually be a partition name such as C</dev/sda1>."
11599 #: ../fish/guestfish-actions.pod:3738
11604 #: ../fish/guestfish-actions.pod:3740
11607 " pvremove device\n"
11612 #: ../fish/guestfish-actions.pod:3742 ../src/guestfs-actions.pod:5670
11614 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11619 #: ../fish/guestfish-actions.pod:3745 ../src/guestfs-actions.pod:5673
11621 "The implementation uses the C<pvremove> command which refuses to wipe "
11622 "physical volumes that contain any volume groups, so you have to remove those "
11627 #: ../fish/guestfish-actions.pod:3749
11632 #: ../fish/guestfish-actions.pod:3751
11635 " pvresize device\n"
11640 #: ../fish/guestfish-actions.pod:3753 ../src/guestfs-actions.pod:5687
11642 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11643 "the new size of the underlying device."
11647 #: ../fish/guestfish-actions.pod:3756
11648 msgid "pvresize-size"
11652 #: ../fish/guestfish-actions.pod:3758
11655 " pvresize-size device size\n"
11660 #: ../fish/guestfish-actions.pod:3760
11662 "This command is the same as L</pvresize> except that it allows you to "
11663 "specify the new size (in bytes) explicitly."
11667 #: ../fish/guestfish-actions.pod:3763
11672 #: ../fish/guestfish-actions.pod:3765
11680 #: ../fish/guestfish-actions.pod:3767 ../src/guestfs-actions.pod:5713
11682 "List all the physical volumes detected. This is the equivalent of the "
11683 "L<pvs(8)> command."
11687 #: ../fish/guestfish-actions.pod:3770 ../src/guestfs-actions.pod:5716
11689 "This returns a list of just the device names that contain PVs "
11690 "(eg. C</dev/sda2>)."
11694 #: ../fish/guestfish-actions.pod:3773
11695 msgid "See also L</pvs-full>."
11699 #: ../fish/guestfish-actions.pod:3775
11704 #: ../fish/guestfish-actions.pod:3777
11712 #: ../fish/guestfish-actions.pod:3779 ../src/guestfs-actions.pod:5732
11714 "List all the physical volumes detected. This is the equivalent of the "
11715 "L<pvs(8)> command. The \"full\" version includes all fields."
11719 #: ../fish/guestfish-actions.pod:3782
11724 #: ../fish/guestfish-actions.pod:3784
11732 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5747
11733 msgid "This command returns the UUID of the LVM PV C<device>."
11737 #: ../fish/guestfish-actions.pod:3788
11742 #: ../fish/guestfish-actions.pod:3790
11745 " pwrite path content offset\n"
11750 #: ../fish/guestfish-actions.pod:3792 ../src/guestfs-actions.pod:5763
11752 "This command writes to part of a file. It writes the data buffer C<content> "
11753 "to the file C<path> starting at offset C<offset>."
11757 #: ../fish/guestfish-actions.pod:3795 ../src/guestfs-actions.pod:5766
11759 "This command implements the L<pwrite(2)> system call, and like that system "
11760 "call it may not write the full data requested. The return value is the "
11761 "number of bytes that were actually written to the file. This could even be "
11762 "0, although short writes are unlikely for regular files in ordinary "
11767 #: ../fish/guestfish-actions.pod:3801
11768 msgid "See also L</pread>, L</pwrite-device>."
11772 #: ../fish/guestfish-actions.pod:3806
11773 msgid "pwrite-device"
11777 #: ../fish/guestfish-actions.pod:3808
11780 " pwrite-device device content offset\n"
11785 #: ../fish/guestfish-actions.pod:3810 ../src/guestfs-actions.pod:5790
11787 "This command writes to part of a device. It writes the data buffer "
11788 "C<content> to C<device> starting at offset C<offset>."
11792 #: ../fish/guestfish-actions.pod:3813 ../src/guestfs-actions.pod:5793
11794 "This command implements the L<pwrite(2)> system call, and like that system "
11795 "call it may not write the full data requested (although short writes to disk "
11796 "devices and partitions are probably impossible with standard Linux kernels)."
11800 #: ../fish/guestfish-actions.pod:3818
11801 msgid "See also L</pwrite>."
11805 #: ../fish/guestfish-actions.pod:3823
11810 #: ../fish/guestfish-actions.pod:3825
11813 " read-file path\n"
11818 #: ../fish/guestfish-actions.pod:3827 ../src/guestfs-actions.pod:5814
11819 msgid "This calls returns the contents of the file C<path> as a buffer."
11823 #: ../fish/guestfish-actions.pod:3830
11825 "Unlike L</cat>, this function can correctly handle files that contain "
11826 "embedded ASCII NUL characters. However unlike L</download>, this function "
11827 "is limited in the total size of file that can be handled."
11831 #: ../fish/guestfish-actions.pod:3838
11836 #: ../fish/guestfish-actions.pod:3840
11839 " read-lines path\n"
11844 #: ../fish/guestfish-actions.pod:3844 ../src/guestfs-actions.pod:5839
11846 "The file contents are returned as a list of lines. Trailing C<LF> and "
11847 "C<CRLF> character sequences are I<not> returned."
11851 #: ../fish/guestfish-actions.pod:3847
11853 "Note that this function cannot correctly handle binary files (specifically, "
11854 "files containing C<\\0> character which is treated as end of line). For "
11855 "those you need to use the L</read-file> function which has a more complex "
11860 #: ../fish/guestfish-actions.pod:3852
11865 #: ../fish/guestfish-actions.pod:3854
11873 #: ../fish/guestfish-actions.pod:3856 ../src/guestfs-actions.pod:5859
11874 msgid "This returns the list of directory entries in directory C<dir>."
11878 #: ../fish/guestfish-actions.pod:3858 ../src/guestfs-actions.pod:5861
11880 "All entries in the directory are returned, including C<.> and C<..>. The "
11881 "entries are I<not> sorted, but returned in the same order as the underlying "
11886 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:5865
11888 "Also this call returns basic file type information about each file. The "
11889 "C<ftyp> field will contain one of the following characters:"
11893 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5870
11898 #: ../fish/guestfish-actions.pod:3869 ../src/guestfs-actions.pod:5872
11899 msgid "Block special"
11903 #: ../fish/guestfish-actions.pod:3871 ../src/guestfs-actions.pod:5874
11908 #: ../fish/guestfish-actions.pod:3873 ../src/guestfs-actions.pod:5876
11909 msgid "Char special"
11913 #: ../fish/guestfish-actions.pod:3875 ../src/guestfs-actions.pod:5878
11918 #: ../fish/guestfish-actions.pod:3877 ../src/guestfs-actions.pod:5880
11923 #: ../fish/guestfish-actions.pod:3879 ../src/guestfs-actions.pod:5882
11928 #: ../fish/guestfish-actions.pod:3881 ../src/guestfs-actions.pod:5884
11929 msgid "FIFO (named pipe)"
11933 #: ../fish/guestfish-actions.pod:3883 ../src/guestfs-actions.pod:5886
11938 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:5888
11939 msgid "Symbolic link"
11943 #: ../fish/guestfish-actions.pod:3887 ../src/guestfs-actions.pod:5890
11948 #: ../fish/guestfish-actions.pod:3889 ../src/guestfs-actions.pod:5892
11949 msgid "Regular file"
11953 #: ../fish/guestfish-actions.pod:3891 ../src/guestfs-actions.pod:5894
11958 #: ../fish/guestfish-actions.pod:3893 ../src/guestfs-actions.pod:5896
11963 #: ../fish/guestfish-actions.pod:3895 ../src/guestfs-actions.pod:5898
11968 #: ../fish/guestfish-actions.pod:3897 ../src/guestfs-actions.pod:5900
11969 msgid "Unknown file type"
11973 #: ../fish/guestfish-actions.pod:3899 ../src/guestfs-actions.pod:5902
11978 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5904
11979 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
11983 #: ../fish/guestfish-actions.pod:3906
11985 "This function is primarily intended for use by programs. To get a simple "
11986 "list of names, use L</ls>. To get a printable directory for human "
11987 "consumption, use L</ll>."
11991 #: ../fish/guestfish-actions.pod:3910
11996 #: ../fish/guestfish-actions.pod:3912
12004 #: ../fish/guestfish-actions.pod:3914 ../src/guestfs-actions.pod:5925
12005 msgid "This command reads the target of a symbolic link."
12009 #: ../fish/guestfish-actions.pod:3916
12010 msgid "readlinklist"
12014 #: ../fish/guestfish-actions.pod:3918
12017 " readlinklist path 'names ...'\n"
12022 #: ../fish/guestfish-actions.pod:3920 ../src/guestfs-actions.pod:5939
12024 "This call allows you to do a C<readlink> operation on multiple files, where "
12025 "all files are in the directory C<path>. C<names> is the list of files from "
12030 #: ../fish/guestfish-actions.pod:3924 ../src/guestfs-actions.pod:5943
12032 "On return you get a list of strings, with a one-to-one correspondence to the "
12033 "C<names> list. Each string is the value of the symbolic link."
12037 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:5947
12039 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12040 "result string is the empty string C<\"\">. However the whole operation is "
12041 "completed even if there were C<readlink(2)> errors, and so you can call this "
12042 "function with names where you don't know if they are symbolic links already "
12043 "(albeit slightly less efficient)."
12047 #: ../fish/guestfish-actions.pod:3935 ../src/guestfs-actions.pod:5954
12049 "This call is intended for programs that want to efficiently list a directory "
12050 "contents without making many round-trips. Very long directory listings "
12051 "might cause the protocol message size to be exceeded, causing this call to "
12052 "fail. The caller must split up such requests into smaller groups of names."
12056 #: ../fish/guestfish-actions.pod:3942
12061 #: ../fish/guestfish-actions.pod:3944
12069 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:5973
12071 "Return the canonicalized absolute pathname of C<path>. The returned path "
12072 "has no C<.>, C<..> or symbolic link path elements."
12076 #: ../fish/guestfish-actions.pod:3949
12077 msgid "removexattr"
12081 #: ../fish/guestfish-actions.pod:3951
12084 " removexattr xattr path\n"
12089 #: ../fish/guestfish-actions.pod:3953 ../src/guestfs-actions.pod:5988
12090 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
12094 #: ../fish/guestfish-actions.pod:3956
12095 msgid "See also: L</lremovexattr>, L<attr(5)>."
12099 #: ../fish/guestfish-actions.pod:3958
12104 #: ../fish/guestfish-actions.pod:3960
12107 " resize2fs device\n"
12112 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6003
12114 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12115 "underlying device."
12119 #: ../fish/guestfish-actions.pod:3965
12121 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
12122 "before calling this command. For unknown reasons C<resize2fs> sometimes "
12123 "gives an error about this and sometimes not. In any case, it is always safe "
12124 "to call L</e2fsck-f> before calling this function."
12128 #: ../fish/guestfish-actions.pod:3971
12129 msgid "resize2fs-M"
12133 #: ../fish/guestfish-actions.pod:3973
12136 " resize2fs-M device\n"
12141 #: ../fish/guestfish-actions.pod:3975
12143 "This command is the same as L</resize2fs>, but the filesystem is resized to "
12144 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
12149 #: ../fish/guestfish-actions.pod:3979
12151 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
12152 "and read the C<Block size> and C<Block count> values. These two numbers, "
12153 "multiplied together, give the resulting size of the minimal filesystem in "
12158 #: ../fish/guestfish-actions.pod:3984
12159 msgid "resize2fs-size"
12163 #: ../fish/guestfish-actions.pod:3986
12166 " resize2fs-size device size\n"
12171 #: ../fish/guestfish-actions.pod:3988
12173 "This command is the same as L</resize2fs> except that it allows you to "
12174 "specify the new size (in bytes) explicitly."
12178 #: ../fish/guestfish-actions.pod:3991
12183 #: ../fish/guestfish-actions.pod:3993
12191 #: ../fish/guestfish-actions.pod:3995 ../src/guestfs-actions.pod:6055
12192 msgid "Remove the single file C<path>."
12196 #: ../fish/guestfish-actions.pod:3997
12201 #: ../fish/guestfish-actions.pod:3999
12209 #: ../fish/guestfish-actions.pod:4001 ../src/guestfs-actions.pod:6067
12211 "Remove the file or directory C<path>, recursively removing the contents if "
12212 "its a directory. This is like the C<rm -rf> shell command."
12216 #: ../fish/guestfish-actions.pod:4005
12221 #: ../fish/guestfish-actions.pod:4007
12229 #: ../fish/guestfish-actions.pod:4009 ../src/guestfs-actions.pod:6081
12230 msgid "Remove the single directory C<path>."
12234 #: ../fish/guestfish-actions.pod:4011
12235 msgid "rmmountpoint"
12239 #: ../fish/guestfish-actions.pod:4013
12242 " rmmountpoint exemptpath\n"
12247 #: ../fish/guestfish-actions.pod:4015
12249 "This calls removes a mountpoint that was previously created with "
12250 "L</mkmountpoint>. See L</mkmountpoint> for full details."
12254 #: ../fish/guestfish-actions.pod:4019
12255 msgid "scrub-device"
12259 #: ../fish/guestfish-actions.pod:4021
12262 " scrub-device device\n"
12267 #: ../fish/guestfish-actions.pod:4023 ../src/guestfs-actions.pod:6107
12269 "This command writes patterns over C<device> to make data retrieval more "
12274 #: ../fish/guestfish-actions.pod:4026 ../fish/guestfish-actions.pod:4041 ../fish/guestfish-actions.pod:4054 ../src/guestfs-actions.pod:6110 ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150
12276 "It is an interface to the L<scrub(1)> program. See that manual page for "
12281 #: ../fish/guestfish-actions.pod:4032
12286 #: ../fish/guestfish-actions.pod:4034
12289 " scrub-file file\n"
12294 #: ../fish/guestfish-actions.pod:4036 ../src/guestfs-actions.pod:6126
12296 "This command writes patterns over a file to make data retrieval more "
12301 #: ../fish/guestfish-actions.pod:4039 ../src/guestfs-actions.pod:6129
12302 msgid "The file is I<removed> after scrubbing."
12306 #: ../fish/guestfish-actions.pod:4044
12307 msgid "scrub-freespace"
12311 #: ../fish/guestfish-actions.pod:4046
12314 " scrub-freespace dir\n"
12319 #: ../fish/guestfish-actions.pod:4048
12321 "This command creates the directory C<dir> and then fills it with files until "
12322 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
12323 "deletes them. The intention is to scrub any free space on the partition "
12324 "containing C<dir>."
12328 #: ../fish/guestfish-actions.pod:4057
12333 #: ../fish/guestfish-actions.pod:4059
12338 #: ../fish/guestfish-actions.pod:4061
12341 " set-append append\n"
12346 #: ../fish/guestfish-actions.pod:4063 ../src/guestfs-actions.pod:6163
12348 "This function is used to add additional options to the guest kernel command "
12353 #: ../fish/guestfish-actions.pod:4066 ../src/guestfs-actions.pod:6166
12355 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12356 "environment variable."
12360 #: ../fish/guestfish-actions.pod:4069 ../src/guestfs-actions.pod:6169
12362 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12363 "(libguestfs always adds a few of its own)."
12367 #: ../fish/guestfish-actions.pod:4072
12368 msgid "set-attach-method"
12372 #: ../fish/guestfish-actions.pod:4074
12373 msgid "attach-method"
12377 #: ../fish/guestfish-actions.pod:4076
12380 " set-attach-method attachmethod\n"
12385 #: ../fish/guestfish-actions.pod:4078 ../src/guestfs-actions.pod:6182
12387 "Set the method that libguestfs uses to connect to the back end guestfsd "
12388 "daemon. Possible methods are:"
12392 #: ../fish/guestfish-actions.pod:4083 ../src/guestfs-actions.pod:6187 ../src/guestfs.pod:2703
12393 msgid "C<appliance>"
12397 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6189
12399 "Launch an appliance and connect to it. This is the ordinary method and the "
12404 #: ../fish/guestfish-actions.pod:4088 ../src/guestfs-actions.pod:6192
12405 msgid "C<unix:I<path>>"
12409 #: ../fish/guestfish-actions.pod:4090 ../src/guestfs-actions.pod:6194
12410 msgid "Connect to the Unix domain socket I<path>."
12414 #: ../fish/guestfish-actions.pod:4092 ../src/guestfs-actions.pod:6196
12416 "This method lets you connect to an existing daemon or (using virtio-serial) "
12417 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
12418 "RUNNING DAEMONS>."
12422 #: ../fish/guestfish-actions.pod:4098
12423 msgid "set-autosync"
12427 #: ../fish/guestfish-actions.pod:4100
12432 #: ../fish/guestfish-actions.pod:4102
12435 " set-autosync true|false\n"
12440 #: ../fish/guestfish-actions.pod:4104 ../src/guestfs-actions.pod:6212
12442 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12443 "effort attempt to make filesystems consistent and synchronized when the "
12444 "handle is closed (also if the program exits without closing handles)."
12448 #: ../fish/guestfish-actions.pod:4109 ../src/guestfs-actions.pod:6217
12450 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12451 "disabled by default)."
12455 #: ../fish/guestfish-actions.pod:4112
12460 #: ../fish/guestfish-actions.pod:4114
12465 #: ../fish/guestfish-actions.pod:4116
12468 " set-direct true|false\n"
12473 #: ../fish/guestfish-actions.pod:4118 ../src/guestfs-actions.pod:6230
12475 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12476 "passed directly through to the appliance once it is launched."
12480 #: ../fish/guestfish-actions.pod:4122
12482 "One consequence of this is that log messages aren't caught by the library "
12483 "and handled by L</set-log-message-callback>, but go straight to stdout."
12487 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6238
12488 msgid "You probably don't want to use this unless you know what you are doing."
12492 #: ../fish/guestfish-actions.pod:4129 ../src/guestfs-actions.pod:6241
12493 msgid "The default is disabled."
12497 #: ../fish/guestfish-actions.pod:4131
12498 msgid "set-e2label"
12502 #: ../fish/guestfish-actions.pod:4133
12505 " set-e2label device label\n"
12510 #: ../fish/guestfish-actions.pod:4135 ../src/guestfs-actions.pod:6254
12512 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12513 "C<label>. Filesystem labels are limited to 16 characters."
12517 #: ../fish/guestfish-actions.pod:4139
12519 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
12520 "label on a filesystem."
12524 #: ../fish/guestfish-actions.pod:4142
12529 #: ../fish/guestfish-actions.pod:4144
12532 " set-e2uuid device uuid\n"
12537 #: ../fish/guestfish-actions.pod:4146 ../src/guestfs-actions.pod:6272
12539 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12540 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12541 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12545 #: ../fish/guestfish-actions.pod:4151
12547 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
12548 "UUID of a filesystem."
12552 #: ../fish/guestfish-actions.pod:4154
12553 msgid "set-memsize"
12557 #: ../fish/guestfish-actions.pod:4156
12562 #: ../fish/guestfish-actions.pod:4158
12565 " set-memsize memsize\n"
12570 #: ../fish/guestfish-actions.pod:4160
12572 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12573 "This only has any effect if called before L</launch>."
12577 #: ../fish/guestfish-actions.pod:4164 ../src/guestfs-actions.pod:6294
12579 "You can also change this by setting the environment variable "
12580 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12584 #: ../fish/guestfish-actions.pod:4171
12585 msgid "set-network"
12589 #: ../fish/guestfish-actions.pod:4173
12594 #: ../fish/guestfish-actions.pod:4175
12597 " set-network true|false\n"
12602 #: ../fish/guestfish-actions.pod:4177 ../src/guestfs-actions.pod:6311
12604 "If C<network> is true, then the network is enabled in the libguestfs "
12605 "appliance. The default is false."
12609 #: ../fish/guestfish-actions.pod:4180 ../src/guestfs-actions.pod:6314
12611 "This affects whether commands are able to access the network (see "
12612 "L<guestfs(3)/RUNNING COMMANDS>)."
12616 #: ../fish/guestfish-actions.pod:4183
12617 msgid "You must call this before calling L</launch>, otherwise it has no effect."
12621 #: ../fish/guestfish-actions.pod:4186
12626 #: ../fish/guestfish-actions.pod:4190
12629 " set-path searchpath\n"
12634 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6330
12635 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12639 #: ../fish/guestfish-actions.pod:4194 ../src/guestfs-actions.pod:6332
12641 "The default is C<$libdir/guestfs> unless overridden by setting "
12642 "C<LIBGUESTFS_PATH> environment variable."
12646 #: ../fish/guestfish-actions.pod:4197 ../src/guestfs-actions.pod:6335
12647 msgid "Setting C<path> to C<NULL> restores the default path."
12651 #: ../fish/guestfish-actions.pod:4199
12656 #: ../fish/guestfish-actions.pod:4201
12661 #: ../fish/guestfish-actions.pod:4203
12664 " set-pgroup true|false\n"
12669 #: ../fish/guestfish-actions.pod:4205 ../src/guestfs-actions.pod:6347
12671 "If C<pgroup> is true, child processes are placed into their own process "
12676 #: ../fish/guestfish-actions.pod:4208 ../src/guestfs-actions.pod:6350
12678 "The practical upshot of this is that signals like C<SIGINT> (from users "
12679 "pressing C<^C>) won't be received by the child process."
12683 #: ../fish/guestfish-actions.pod:4211 ../src/guestfs-actions.pod:6353
12685 "The default for this flag is false, because usually you want C<^C> to kill "
12690 #: ../fish/guestfish-actions.pod:4214
12695 #: ../fish/guestfish-actions.pod:4216
12700 #: ../fish/guestfish-actions.pod:4218
12708 #: ../fish/guestfish-actions.pod:4220 ../src/guestfs-actions.pod:6366
12709 msgid "Set the qemu binary that we will use."
12713 #: ../fish/guestfish-actions.pod:4222 ../src/guestfs-actions.pod:6368
12714 msgid "The default is chosen when the library was compiled by the configure script."
12718 #: ../fish/guestfish-actions.pod:4225 ../src/guestfs-actions.pod:6371
12720 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
12725 #: ../fish/guestfish-actions.pod:4228 ../src/guestfs-actions.pod:6374
12726 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
12730 #: ../fish/guestfish-actions.pod:4230 ../src/guestfs-actions.pod:6376
12732 "Note that you should call this function as early as possible after creating "
12733 "the handle. This is because some pre-launch operations depend on testing "
12734 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
12735 "don't retest features, and so you might see inconsistent results. Using the "
12736 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
12737 "the qemu binary at the same time as the handle is created."
12741 #: ../fish/guestfish-actions.pod:4238
12742 msgid "set-recovery-proc"
12746 #: ../fish/guestfish-actions.pod:4240
12747 msgid "recovery-proc"
12751 #: ../fish/guestfish-actions.pod:4242
12754 " set-recovery-proc true|false\n"
12759 #: ../fish/guestfish-actions.pod:4244
12761 "If this is called with the parameter C<false> then L</launch> does not "
12762 "create a recovery process. The purpose of the recovery process is to stop "
12763 "runaway qemu processes in the case where the main program aborts abruptly."
12767 #: ../fish/guestfish-actions.pod:4249
12769 "This only has any effect if called before L</launch>, and the default is "
12774 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6402
12776 "About the only time when you would want to disable this is if the main "
12777 "process will fork itself into the background (\"daemonize\" itself). In "
12778 "this case the recovery process thinks that the main program has disappeared "
12779 "and so kills qemu, which is not very helpful."
12783 #: ../fish/guestfish-actions.pod:4258
12784 msgid "set-selinux"
12788 #: ../fish/guestfish-actions.pod:4260
12793 #: ../fish/guestfish-actions.pod:4262
12796 " set-selinux true|false\n"
12801 #: ../fish/guestfish-actions.pod:4264 ../src/guestfs-actions.pod:6418
12803 "This sets the selinux flag that is passed to the appliance at boot time. "
12804 "The default is C<selinux=0> (disabled)."
12808 #: ../fish/guestfish-actions.pod:4267 ../src/guestfs-actions.pod:6421
12810 "Note that if SELinux is enabled, it is always in Permissive mode "
12811 "(C<enforcing=0>)."
12815 #: ../fish/guestfish-actions.pod:4273
12820 #: ../fish/guestfish-actions.pod:4275
12825 #: ../fish/guestfish-actions.pod:4277
12828 " set-trace true|false\n"
12833 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6437
12835 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
12836 "return values are traced."
12840 #: ../fish/guestfish-actions.pod:4282 ../src/guestfs-actions.pod:6440
12842 "If you want to trace C API calls into libguestfs (and other libraries) then "
12843 "possibly a better way is to use the external ltrace(1) command."
12847 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6444
12849 "Command traces are disabled unless the environment variable "
12850 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12854 #: ../fish/guestfish-actions.pod:4289
12856 "Trace messages are normally sent to C<stderr>, unless you register a "
12857 "callback to send them somewhere else (see L</set-event-callback>)."
12861 #: ../fish/guestfish-actions.pod:4293
12862 msgid "set-verbose"
12866 #: ../fish/guestfish-actions.pod:4295
12871 #: ../fish/guestfish-actions.pod:4297
12874 " set-verbose true|false\n"
12879 #: ../fish/guestfish-actions.pod:4299 ../src/guestfs-actions.pod:6461
12880 msgid "If C<verbose> is true, this turns on verbose messages."
12884 #: ../fish/guestfish-actions.pod:4301 ../src/guestfs-actions.pod:6463
12886 "Verbose messages are disabled unless the environment variable "
12887 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12891 #: ../fish/guestfish-actions.pod:4304
12893 "Verbose messages are normally sent to C<stderr>, unless you register a "
12894 "callback to send them somewhere else (see L</set-event-callback>)."
12898 #: ../fish/guestfish-actions.pod:4308
12903 #: ../fish/guestfish-actions.pod:4310
12906 " setcon context\n"
12911 #: ../fish/guestfish-actions.pod:4312 ../src/guestfs-actions.pod:6480
12913 "This sets the SELinux security context of the daemon to the string "
12918 #: ../fish/guestfish-actions.pod:4315 ../src/guestfs-actions.pod:6483
12919 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12923 #: ../fish/guestfish-actions.pod:4317
12928 #: ../fish/guestfish-actions.pod:4319
12931 " setxattr xattr val vallen path\n"
12936 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6498
12938 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12939 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12943 #: ../fish/guestfish-actions.pod:4325
12944 msgid "See also: L</lsetxattr>, L<attr(5)>."
12948 #: ../fish/guestfish-actions.pod:4327
12953 #: ../fish/guestfish-actions.pod:4329
12956 " sfdisk device cyls heads sectors 'lines ...'\n"
12961 #: ../fish/guestfish-actions.pod:4331 ../src/guestfs-actions.pod:6525
12963 "This is a direct interface to the L<sfdisk(8)> program for creating "
12964 "partitions on block devices."
12968 #: ../fish/guestfish-actions.pod:4334 ../src/guestfs-actions.pod:6528
12969 msgid "C<device> should be a block device, for example C</dev/sda>."
12973 #: ../fish/guestfish-actions.pod:4336 ../src/guestfs-actions.pod:6530
12975 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12976 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
12977 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12978 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12979 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12980 "the kernel) cannot work out the right geometry and you will need to tell it."
12984 #: ../fish/guestfish-actions.pod:4344 ../src/guestfs-actions.pod:6538
12986 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12987 "refer to the L<sfdisk(8)> manpage."
12991 #: ../fish/guestfish-actions.pod:4347 ../src/guestfs-actions.pod:6541
12993 "To create a single partition occupying the whole disk, you would pass "
12994 "C<lines> as a single element list, when the single element being the string "
12999 #: ../fish/guestfish-actions.pod:4351
13000 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
13004 #: ../fish/guestfish-actions.pod:4357 ../fish/guestfish-actions.pod:4380 ../fish/guestfish-actions.pod:4402
13006 "I<This function is deprecated.> In new code, use the L</part_add> call "
13011 #: ../fish/guestfish-actions.pod:4364
13016 #: ../fish/guestfish-actions.pod:4366
13019 " sfdiskM device 'lines ...'\n"
13024 #: ../fish/guestfish-actions.pod:4368
13026 "This is a simplified interface to the L</sfdisk> command, where partition "
13027 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13028 "you don't need to specify the cyls, heads and sectors parameters which were "
13029 "rarely if ever used anyway."
13033 #: ../fish/guestfish-actions.pod:4374
13034 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13038 #: ../fish/guestfish-actions.pod:4387
13043 #: ../fish/guestfish-actions.pod:4389
13046 " sfdisk-N device partnum cyls heads sectors line\n"
13051 #: ../fish/guestfish-actions.pod:4391 ../src/guestfs-actions.pod:6603
13053 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13054 "(note: C<n> counts from 1)."
13058 #: ../fish/guestfish-actions.pod:4394
13060 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13061 "cyls/heads/sectors parameters."
13065 #: ../fish/guestfish-actions.pod:4397
13066 msgid "See also: L</part-add>"
13070 #: ../fish/guestfish-actions.pod:4409
13071 msgid "sfdisk-disk-geometry"
13075 #: ../fish/guestfish-actions.pod:4411
13078 " sfdisk-disk-geometry device\n"
13083 #: ../fish/guestfish-actions.pod:4413
13085 "This displays the disk geometry of C<device> read from the partition table. "
13086 "Especially in the case where the underlying block device has been resized, "
13087 "this can be different from the kernel's idea of the geometry (see "
13088 "L</sfdisk-kernel-geometry>)."
13092 #: ../fish/guestfish-actions.pod:4418 ../fish/guestfish-actions.pod:4427 ../src/guestfs-actions.pod:6629 ../src/guestfs-actions.pod:6645
13093 msgid "The result is in human-readable format, and not designed to be parsed."
13097 #: ../fish/guestfish-actions.pod:4421
13098 msgid "sfdisk-kernel-geometry"
13102 #: ../fish/guestfish-actions.pod:4423
13105 " sfdisk-kernel-geometry device\n"
13110 #: ../fish/guestfish-actions.pod:4425 ../src/guestfs-actions.pod:6643
13111 msgid "This displays the kernel's idea of the geometry of C<device>."
13115 #: ../fish/guestfish-actions.pod:4430
13120 #: ../fish/guestfish-actions.pod:4432
13123 " sfdisk-l device\n"
13128 #: ../fish/guestfish-actions.pod:4434 ../src/guestfs-actions.pod:6666
13130 "This displays the partition table on C<device>, in the human-readable output "
13131 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13135 #: ../fish/guestfish-actions.pod:4438
13136 msgid "See also: L</part-list>"
13140 #: ../fish/guestfish-actions.pod:4440
13142 "I<This function is deprecated.> In new code, use the L</part_list> call "
13147 #: ../fish/guestfish-actions.pod:4447
13152 #: ../fish/guestfish-actions.pod:4449
13160 #: ../fish/guestfish-actions.pod:4451 ../src/guestfs-actions.pod:6683
13162 "This call runs a command from the guest filesystem via the guest's "
13167 #: ../fish/guestfish-actions.pod:4454
13168 msgid "This is like L</command>, but passes the command to:"
13172 #: ../fish/guestfish-actions.pod:4456 ../src/guestfs-actions.pod:6688
13175 " /bin/sh -c \"command\"\n"
13180 #: ../fish/guestfish-actions.pod:4458 ../src/guestfs-actions.pod:6690
13182 "Depending on the guest's shell, this usually results in wildcards being "
13183 "expanded, shell expressions being interpolated and so on."
13187 #: ../fish/guestfish-actions.pod:4462
13188 msgid "All the provisos about L</command> apply to this call."
13192 #: ../fish/guestfish-actions.pod:4464
13197 #: ../fish/guestfish-actions.pod:4466
13200 " sh-lines command\n"
13205 #: ../fish/guestfish-actions.pod:4468
13206 msgid "This is the same as L</sh>, but splits the result into a list of lines."
13210 #: ../fish/guestfish-actions.pod:4471
13211 msgid "See also: L</command-lines>"
13215 #: ../fish/guestfish-actions.pod:4473
13220 #: ../fish/guestfish-actions.pod:4475
13228 #: ../fish/guestfish-actions.pod:4477 ../src/guestfs-actions.pod:6724
13229 msgid "Sleep for C<secs> seconds."
13233 #: ../fish/guestfish-actions.pod:4479
13238 #: ../fish/guestfish-actions.pod:4481
13246 #: ../fish/guestfish-actions.pod:4485 ../src/guestfs-actions.pod:6738
13247 msgid "This is the same as the C<stat(2)> system call."
13251 #: ../fish/guestfish-actions.pod:4487
13256 #: ../fish/guestfish-actions.pod:4489
13264 #: ../fish/guestfish-actions.pod:4491 ../src/guestfs-actions.pod:6752
13266 "Returns file system statistics for any mounted file system. C<path> should "
13267 "be a file or directory in the mounted file system (typically it is the mount "
13268 "point itself, but it doesn't need to be)."
13272 #: ../fish/guestfish-actions.pod:4495 ../src/guestfs-actions.pod:6756
13273 msgid "This is the same as the C<statvfs(2)> system call."
13277 #: ../fish/guestfish-actions.pod:4497
13282 #: ../fish/guestfish-actions.pod:4499
13290 #: ../fish/guestfish-actions.pod:4501 ../src/guestfs-actions.pod:6770
13292 "This runs the L<strings(1)> command on a file and returns the list of "
13293 "printable strings found."
13297 #: ../fish/guestfish-actions.pod:4507
13302 #: ../fish/guestfish-actions.pod:4509
13305 " strings-e encoding path\n"
13310 #: ../fish/guestfish-actions.pod:4511
13312 "This is like the L</strings> command, but allows you to specify the encoding "
13313 "of strings that are looked for in the source file C<path>."
13317 #: ../fish/guestfish-actions.pod:4515 ../src/guestfs-actions.pod:6793
13318 msgid "Allowed encodings are:"
13322 #: ../fish/guestfish-actions.pod:4519 ../src/guestfs-actions.pod:6797
13327 #: ../fish/guestfish-actions.pod:4521
13329 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13330 "ISO-8859-X (this is what L</strings> uses)."
13334 #: ../fish/guestfish-actions.pod:4524 ../src/guestfs-actions.pod:6802
13339 #: ../fish/guestfish-actions.pod:4526 ../src/guestfs-actions.pod:6804
13340 msgid "Single 8-bit-byte characters."
13344 #: ../fish/guestfish-actions.pod:4528 ../src/guestfs-actions.pod:6806
13349 #: ../fish/guestfish-actions.pod:4530 ../src/guestfs-actions.pod:6808
13350 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13354 #: ../fish/guestfish-actions.pod:4533 ../src/guestfs-actions.pod:6811
13355 msgid "l (lower case letter L)"
13359 #: ../fish/guestfish-actions.pod:4535 ../src/guestfs-actions.pod:6813
13361 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13362 "examining binaries in Windows guests."
13366 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:6816
13371 #: ../fish/guestfish-actions.pod:4540 ../src/guestfs-actions.pod:6818
13372 msgid "32-bit big endian such as UCS-4BE."
13376 #: ../fish/guestfish-actions.pod:4542 ../src/guestfs-actions.pod:6820
13381 #: ../fish/guestfish-actions.pod:4544 ../src/guestfs-actions.pod:6822
13382 msgid "32-bit little endian such as UCS-4LE."
13386 #: ../fish/guestfish-actions.pod:4548 ../src/guestfs-actions.pod:6826
13387 msgid "The returned strings are transcoded to UTF-8."
13391 #: ../fish/guestfish-actions.pod:4553
13392 msgid "swapoff-device"
13396 #: ../fish/guestfish-actions.pod:4555
13399 " swapoff-device device\n"
13404 #: ../fish/guestfish-actions.pod:4557
13406 "This command disables the libguestfs appliance swap device or partition "
13407 "named C<device>. See L</swapon-device>."
13411 #: ../fish/guestfish-actions.pod:4561
13412 msgid "swapoff-file"
13416 #: ../fish/guestfish-actions.pod:4563
13419 " swapoff-file file\n"
13424 #: ../fish/guestfish-actions.pod:4565 ../src/guestfs-actions.pod:6857
13425 msgid "This command disables the libguestfs appliance swap on file."
13429 #: ../fish/guestfish-actions.pod:4567
13430 msgid "swapoff-label"
13434 #: ../fish/guestfish-actions.pod:4569
13437 " swapoff-label label\n"
13442 #: ../fish/guestfish-actions.pod:4571 ../src/guestfs-actions.pod:6869
13444 "This command disables the libguestfs appliance swap on labeled swap "
13449 #: ../fish/guestfish-actions.pod:4574
13450 msgid "swapoff-uuid"
13454 #: ../fish/guestfish-actions.pod:4576
13457 " swapoff-uuid uuid\n"
13462 #: ../fish/guestfish-actions.pod:4578 ../src/guestfs-actions.pod:6882
13464 "This command disables the libguestfs appliance swap partition with the given "
13469 #: ../fish/guestfish-actions.pod:4581
13470 msgid "swapon-device"
13474 #: ../fish/guestfish-actions.pod:4583
13477 " swapon-device device\n"
13482 #: ../fish/guestfish-actions.pod:4585
13484 "This command enables the libguestfs appliance to use the swap device or "
13485 "partition named C<device>. The increased memory is made available for all "
13486 "commands, for example those run using L</command> or L</sh>."
13490 #: ../fish/guestfish-actions.pod:4590 ../src/guestfs-actions.pod:6900
13492 "Note that you should not swap to existing guest swap partitions unless you "
13493 "know what you are doing. They may contain hibernation information, or other "
13494 "information that the guest doesn't want you to trash. You also risk leaking "
13495 "information about the host to the guest this way. Instead, attach a new "
13496 "host device to the guest and swap on that."
13500 #: ../fish/guestfish-actions.pod:4597
13501 msgid "swapon-file"
13505 #: ../fish/guestfish-actions.pod:4599
13508 " swapon-file file\n"
13513 #: ../fish/guestfish-actions.pod:4601
13514 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
13518 #: ../fish/guestfish-actions.pod:4604
13519 msgid "swapon-label"
13523 #: ../fish/guestfish-actions.pod:4606
13526 " swapon-label label\n"
13531 #: ../fish/guestfish-actions.pod:4608
13533 "This command enables swap to a labeled swap partition. See "
13534 "L</swapon-device> for other notes."
13538 #: ../fish/guestfish-actions.pod:4611
13539 msgid "swapon-uuid"
13543 #: ../fish/guestfish-actions.pod:4613
13546 " swapon-uuid uuid\n"
13551 #: ../fish/guestfish-actions.pod:4615
13553 "This command enables swap to a swap partition with the given UUID. See "
13554 "L</swapon-device> for other notes."
13558 #: ../fish/guestfish-actions.pod:4618
13563 #: ../fish/guestfish-actions.pod:4620
13571 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:6955
13573 "This syncs the disk, so that any writes are flushed through to the "
13574 "underlying disk image."
13578 #: ../fish/guestfish-actions.pod:4625 ../src/guestfs-actions.pod:6958
13580 "You should always call this if you have modified a disk image, before "
13581 "closing the handle."
13585 #: ../fish/guestfish-actions.pod:4628
13590 #: ../fish/guestfish-actions.pod:4630
13598 #: ../fish/guestfish-actions.pod:4632 ../src/guestfs-actions.pod:6971
13599 msgid "This command returns up to the last 10 lines of a file as a list of strings."
13603 #: ../fish/guestfish-actions.pod:4638
13608 #: ../fish/guestfish-actions.pod:4640
13611 " tail-n nrlines path\n"
13616 #: ../fish/guestfish-actions.pod:4642 ../src/guestfs-actions.pod:6990
13618 "If the parameter C<nrlines> is a positive number, this returns the last "
13619 "C<nrlines> lines of the file C<path>."
13623 #: ../fish/guestfish-actions.pod:4645 ../src/guestfs-actions.pod:6993
13625 "If the parameter C<nrlines> is a negative number, this returns lines from "
13626 "the file C<path>, starting with the C<-nrlines>th line."
13630 #: ../fish/guestfish-actions.pod:4653
13635 #: ../fish/guestfish-actions.pod:4655
13638 " tar-in (tarfile|-) directory\n"
13643 #: ../fish/guestfish-actions.pod:4657 ../src/guestfs-actions.pod:7014
13645 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13646 "tar file) into C<directory>."
13650 #: ../fish/guestfish-actions.pod:4660
13651 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
13655 #: ../fish/guestfish-actions.pod:4665
13660 #: ../fish/guestfish-actions.pod:4667
13663 " tar-out directory (tarfile|-)\n"
13668 #: ../fish/guestfish-actions.pod:4669 ../src/guestfs-actions.pod:7031
13670 "This command packs the contents of C<directory> and downloads it to local "
13675 #: ../fish/guestfish-actions.pod:4672
13676 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
13680 #: ../fish/guestfish-actions.pod:4677
13685 #: ../fish/guestfish-actions.pod:4679
13688 " tgz-in (tarball|-) directory\n"
13693 #: ../fish/guestfish-actions.pod:4681 ../src/guestfs-actions.pod:7048
13695 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
13696 "tar file) into C<directory>."
13700 #: ../fish/guestfish-actions.pod:4684
13701 msgid "To upload an uncompressed tarball, use L</tar-in>."
13705 #: ../fish/guestfish-actions.pod:4688
13710 #: ../fish/guestfish-actions.pod:4690
13713 " tgz-out directory (tarball|-)\n"
13718 #: ../fish/guestfish-actions.pod:4692 ../src/guestfs-actions.pod:7064
13720 "This command packs the contents of C<directory> and downloads it to local "
13725 #: ../fish/guestfish-actions.pod:4695
13726 msgid "To download an uncompressed tarball, use L</tar-out>."
13730 #: ../fish/guestfish-actions.pod:4699
13735 #: ../fish/guestfish-actions.pod:4701
13743 #: ../fish/guestfish-actions.pod:4703 ../src/guestfs-actions.pod:7079
13745 "Touch acts like the L<touch(1)> command. It can be used to update the "
13746 "timestamps on a file, or, if the file does not exist, to create a new "
13747 "zero-length file."
13751 #: ../fish/guestfish-actions.pod:4707 ../src/guestfs-actions.pod:7083
13753 "This command only works on regular files, and will fail on other file types "
13754 "such as directories, symbolic links, block special etc."
13758 #: ../fish/guestfish-actions.pod:4710
13763 #: ../fish/guestfish-actions.pod:4712
13771 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7096
13773 "This command truncates C<path> to a zero-length file. The file must exist "
13778 #: ../fish/guestfish-actions.pod:4717
13779 msgid "truncate-size"
13783 #: ../fish/guestfish-actions.pod:4719
13786 " truncate-size path size\n"
13791 #: ../fish/guestfish-actions.pod:4721 ../src/guestfs-actions.pod:7110
13793 "This command truncates C<path> to size C<size> bytes. The file must exist "
13798 #: ../fish/guestfish-actions.pod:4724
13800 "If the current file size is less than C<size> then the file is extended to "
13801 "the required size with zero bytes. This creates a sparse file (ie. disk "
13802 "blocks are not allocated for the file until you write to it). To create a "
13803 "non-sparse file of zeroes, use L</fallocate64> instead."
13807 #: ../fish/guestfish-actions.pod:4730
13812 #: ../fish/guestfish-actions.pod:4732
13815 " tune2fs-l device\n"
13820 #: ../fish/guestfish-actions.pod:4734 ../src/guestfs-actions.pod:7129
13822 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13827 #: ../fish/guestfish-actions.pod:4737 ../src/guestfs-actions.pod:7132
13829 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13830 "for more details. The list of fields returned isn't clearly defined, and "
13831 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13832 "and the filesystem itself."
13836 #: ../fish/guestfish-actions.pod:4742
13841 #: ../fish/guestfish-actions.pod:4744
13844 " txz-in (tarball|-) directory\n"
13849 #: ../fish/guestfish-actions.pod:4746 ../src/guestfs-actions.pod:7152
13851 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13852 "tar file) into C<directory>."
13856 #: ../fish/guestfish-actions.pod:4751
13861 #: ../fish/guestfish-actions.pod:4753
13864 " txz-out directory (tarball|-)\n"
13869 #: ../fish/guestfish-actions.pod:4755 ../src/guestfs-actions.pod:7166
13871 "This command packs the contents of C<directory> and downloads it to local "
13872 "file C<tarball> (as an xz compressed tar archive)."
13876 #: ../fish/guestfish-actions.pod:4760
13881 #: ../fish/guestfish-actions.pod:4762
13889 #: ../fish/guestfish-actions.pod:4764 ../src/guestfs-actions.pod:7179
13891 "This function sets the mask used for creating new files and device nodes to "
13896 #: ../fish/guestfish-actions.pod:4767 ../src/guestfs-actions.pod:7182
13898 "Typical umask values would be C<022> which creates new files with "
13899 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13900 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13904 #: ../fish/guestfish-actions.pod:4772 ../src/guestfs-actions.pod:7187
13906 "The default umask is C<022>. This is important because it means that "
13907 "directories and device nodes will be created with C<0644> or C<0755> mode "
13908 "even if you specify C<0777>."
13912 #: ../fish/guestfish-actions.pod:4776
13913 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
13917 #: ../fish/guestfish-actions.pod:4779 ../src/guestfs-actions.pod:7194
13918 msgid "This call returns the previous umask."
13922 #: ../fish/guestfish-actions.pod:4781
13927 #: ../fish/guestfish-actions.pod:4783
13932 #: ../fish/guestfish-actions.pod:4785
13935 " umount pathordevice\n"
13940 #: ../fish/guestfish-actions.pod:4787 ../src/guestfs-actions.pod:7206
13942 "This unmounts the given filesystem. The filesystem may be specified either "
13943 "by its mountpoint (path) or the device which contains the filesystem."
13947 #: ../fish/guestfish-actions.pod:4791
13952 #: ../fish/guestfish-actions.pod:4793
13953 msgid "unmount-all"
13957 #: ../fish/guestfish-actions.pod:4795
13965 #: ../fish/guestfish-actions.pod:4797 ../src/guestfs-actions.pod:7219
13966 msgid "This unmounts all mounted filesystems."
13970 #: ../fish/guestfish-actions.pod:4799 ../src/guestfs-actions.pod:7221
13971 msgid "Some internal mounts are not unmounted by this call."
13975 #: ../fish/guestfish-actions.pod:4801
13980 #: ../fish/guestfish-actions.pod:4803
13983 " upload (filename|-) remotefilename\n"
13988 #: ../fish/guestfish-actions.pod:4805 ../fish/guestfish-actions.pod:4818 ../src/guestfs-actions.pod:7234 ../src/guestfs-actions.pod:7258
13989 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
13993 #: ../fish/guestfish-actions.pod:4810
13994 msgid "See also L</download>."
13998 #: ../fish/guestfish-actions.pod:4814
13999 msgid "upload-offset"
14003 #: ../fish/guestfish-actions.pod:4816
14006 " upload-offset (filename|-) remotefilename offset\n"
14011 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7261
14013 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14014 "The intention is to overwrite parts of existing files or devices, although "
14015 "if a non-existant file is specified then it is created with a \"hole\" "
14016 "before C<offset>. The size of the data written is implicit in the size of "
14017 "the source C<filename>."
14021 #: ../fish/guestfish-actions.pod:4828
14023 "Note that there is no limit on the amount of data that can be uploaded with "
14024 "this call, unlike with L</pwrite>, and this call always writes the full "
14025 "amount unless an error occurs."
14029 #: ../fish/guestfish-actions.pod:4833
14030 msgid "See also L</upload>, L</pwrite>."
14034 #: ../fish/guestfish-actions.pod:4837
14039 #: ../fish/guestfish-actions.pod:4839
14042 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14047 #: ../fish/guestfish-actions.pod:4841 ../src/guestfs-actions.pod:7294
14048 msgid "This command sets the timestamps of a file with nanosecond precision."
14052 #: ../fish/guestfish-actions.pod:4844 ../src/guestfs-actions.pod:7297
14054 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14059 #: ../fish/guestfish-actions.pod:4847 ../src/guestfs-actions.pod:7300
14061 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14062 "nanoseconds from the epoch."
14066 #: ../fish/guestfish-actions.pod:4850 ../src/guestfs-actions.pod:7303
14068 "If the C<*nsecs> field contains the special value C<-1> then the "
14069 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14070 "ignored in this case)."
14074 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7307
14076 "If the C<*nsecs> field contains the special value C<-2> then the "
14077 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14082 #: ../fish/guestfish-actions.pod:4858
14087 #: ../fish/guestfish-actions.pod:4860
14095 #: ../fish/guestfish-actions.pod:4862 ../src/guestfs-actions.pod:7320
14096 msgid "Return the libguestfs version number that the program is linked against."
14100 #: ../fish/guestfish-actions.pod:4865 ../src/guestfs-actions.pod:7323
14102 "Note that because of dynamic linking this is not necessarily the version of "
14103 "libguestfs that you compiled against. You can compile the program, and then "
14104 "at runtime dynamically link against a completely different C<libguestfs.so> "
14109 #: ../fish/guestfish-actions.pod:4870 ../src/guestfs-actions.pod:7328
14111 "This call was added in version C<1.0.58>. In previous versions of "
14112 "libguestfs there was no way to get the version number. From C code you can "
14113 "use dynamic linker functions to find out if this symbol exists (if it "
14114 "doesn't, then it's an earlier version)."
14118 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7334
14120 "The call returns a structure with four elements. The first three (C<major>, "
14121 "C<minor> and C<release>) are numbers and correspond to the usual version "
14122 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14123 "but may be used for distro-specific information."
14127 #: ../fish/guestfish-actions.pod:4882 ../src/guestfs-actions.pod:7340
14128 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
14132 #: ../fish/guestfish-actions.pod:4885 ../src/guestfs-actions.pod:7343
14133 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14137 #: ../fish/guestfish-actions.pod:4887
14139 "I<Note:> Don't use this call to test for availability of features. In "
14140 "enterprise distributions we backport features from later versions into "
14141 "earlier versions, making this an unreliable way to test for features. Use "
14142 "L</available> instead."
14146 #: ../fish/guestfish-actions.pod:4893
14151 #: ../fish/guestfish-actions.pod:4895
14154 " vfs-label device\n"
14159 #: ../fish/guestfish-actions.pod:4897 ../src/guestfs-actions.pod:7363
14160 msgid "This returns the filesystem label of the filesystem on C<device>."
14164 #: ../fish/guestfish-actions.pod:4900 ../src/guestfs-actions.pod:7366
14165 msgid "If the filesystem is unlabeled, this returns the empty string."
14169 #: ../fish/guestfish-actions.pod:4902
14170 msgid "To find a filesystem from the label, use L</findfs-label>."
14174 #: ../fish/guestfish-actions.pod:4904
14179 #: ../fish/guestfish-actions.pod:4906
14182 " vfs-type device\n"
14187 #: ../fish/guestfish-actions.pod:4908 ../src/guestfs-actions.pod:7381
14189 "This command gets the filesystem type corresponding to the filesystem on "
14194 #: ../fish/guestfish-actions.pod:4911 ../src/guestfs-actions.pod:7384
14196 "For most filesystems, the result is the name of the Linux VFS module which "
14197 "would be used to mount this filesystem if you mounted it without specifying "
14198 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14202 #: ../fish/guestfish-actions.pod:4916
14207 #: ../fish/guestfish-actions.pod:4918
14210 " vfs-uuid device\n"
14215 #: ../fish/guestfish-actions.pod:4920 ../src/guestfs-actions.pod:7400
14216 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14220 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7403
14221 msgid "If the filesystem does not have a UUID, this returns the empty string."
14225 #: ../fish/guestfish-actions.pod:4925
14226 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
14230 #: ../fish/guestfish-actions.pod:4927
14231 msgid "vg-activate"
14235 #: ../fish/guestfish-actions.pod:4929
14238 " vg-activate true|false 'volgroups ...'\n"
14243 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7419
14245 "This command activates or (if C<activate> is false) deactivates all logical "
14246 "volumes in the listed volume groups C<volgroups>."
14250 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7422
14251 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14255 #: ../fish/guestfish-actions.pod:4936 ../src/guestfs-actions.pod:7424
14257 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14258 "activated or deactivated."
14262 #: ../fish/guestfish-actions.pod:4939
14263 msgid "vg-activate-all"
14267 #: ../fish/guestfish-actions.pod:4941
14270 " vg-activate-all true|false\n"
14275 #: ../fish/guestfish-actions.pod:4943 ../src/guestfs-actions.pod:7437
14277 "This command activates or (if C<activate> is false) deactivates all logical "
14278 "volumes in all volume groups."
14282 #: ../fish/guestfish-actions.pod:4946 ../src/guestfs-actions.pod:7440
14283 msgid "This command is the same as running C<vgchange -a y|n>"
14287 #: ../fish/guestfish-actions.pod:4948
14292 #: ../fish/guestfish-actions.pod:4950
14295 " vgcreate volgroup 'physvols ...'\n"
14300 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7453
14302 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14303 "of physical volumes C<physvols>."
14307 #: ../fish/guestfish-actions.pod:4955
14312 #: ../fish/guestfish-actions.pod:4957
14315 " vglvuuids vgname\n"
14320 #: ../fish/guestfish-actions.pod:4959 ../src/guestfs-actions.pod:7466
14322 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14323 "volumes created in this volume group."
14327 #: ../fish/guestfish-actions.pod:4962
14329 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
14330 "logical volumes and volume groups."
14334 #: ../fish/guestfish-actions.pod:4965
14335 msgid "See also L</vgpvuuids>."
14339 #: ../fish/guestfish-actions.pod:4967
14344 #: ../fish/guestfish-actions.pod:4969
14347 " vgpvuuids vgname\n"
14352 #: ../fish/guestfish-actions.pod:4971 ../src/guestfs-actions.pod:7486
14354 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14355 "volumes that this volume group resides on."
14359 #: ../fish/guestfish-actions.pod:4974
14361 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
14362 "physical volumes and volume groups."
14366 #: ../fish/guestfish-actions.pod:4977
14367 msgid "See also L</vglvuuids>."
14371 #: ../fish/guestfish-actions.pod:4979
14376 #: ../fish/guestfish-actions.pod:4981
14379 " vgremove vgname\n"
14384 #: ../fish/guestfish-actions.pod:4983 ../src/guestfs-actions.pod:7506
14385 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14389 #: ../fish/guestfish-actions.pod:4985 ../src/guestfs-actions.pod:7508
14390 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
14394 #: ../fish/guestfish-actions.pod:4988
14399 #: ../fish/guestfish-actions.pod:4990
14402 " vgrename volgroup newvolgroup\n"
14407 #: ../fish/guestfish-actions.pod:4992 ../src/guestfs-actions.pod:7522
14408 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14412 #: ../fish/guestfish-actions.pod:4994
14417 #: ../fish/guestfish-actions.pod:4996
14425 #: ../fish/guestfish-actions.pod:4998 ../src/guestfs-actions.pod:7533
14427 "List all the volumes groups detected. This is the equivalent of the "
14428 "L<vgs(8)> command."
14432 #: ../fish/guestfish-actions.pod:5001 ../src/guestfs-actions.pod:7536
14434 "This returns a list of just the volume group names that were detected "
14435 "(eg. C<VolGroup00>)."
14439 #: ../fish/guestfish-actions.pod:5004
14440 msgid "See also L</vgs-full>."
14444 #: ../fish/guestfish-actions.pod:5006
14449 #: ../fish/guestfish-actions.pod:5008
14457 #: ../fish/guestfish-actions.pod:5010 ../src/guestfs-actions.pod:7552
14459 "List all the volumes groups detected. This is the equivalent of the "
14460 "L<vgs(8)> command. The \"full\" version includes all fields."
14464 #: ../fish/guestfish-actions.pod:5013
14469 #: ../fish/guestfish-actions.pod:5015
14477 #: ../fish/guestfish-actions.pod:5017 ../src/guestfs-actions.pod:7566
14479 "This rescans all block devices and rebuilds the list of LVM physical "
14480 "volumes, volume groups and logical volumes."
14484 #: ../fish/guestfish-actions.pod:5020
14489 #: ../fish/guestfish-actions.pod:5022
14497 #: ../fish/guestfish-actions.pod:5024 ../src/guestfs-actions.pod:7579
14498 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14502 #: ../fish/guestfish-actions.pod:5026
14507 #: ../fish/guestfish-actions.pod:5028
14515 #: ../fish/guestfish-actions.pod:5030 ../src/guestfs-actions.pod:7619
14517 "This command counts the characters in a file, using the C<wc -c> external "
14522 #: ../fish/guestfish-actions.pod:5033
14527 #: ../fish/guestfish-actions.pod:5035
14535 #: ../fish/guestfish-actions.pod:5037 ../src/guestfs-actions.pod:7632
14537 "This command counts the lines in a file, using the C<wc -l> external "
14542 #: ../fish/guestfish-actions.pod:5040
14547 #: ../fish/guestfish-actions.pod:5042
14555 #: ../fish/guestfish-actions.pod:5044 ../src/guestfs-actions.pod:7645
14557 "This command counts the words in a file, using the C<wc -w> external "
14562 #: ../fish/guestfish-actions.pod:5047
14567 #: ../fish/guestfish-actions.pod:5049
14570 " write path content\n"
14575 #: ../fish/guestfish-actions.pod:5051 ../src/guestfs-actions.pod:7660
14577 "This call creates a file called C<path>. The content of the file is the "
14578 "string C<content> (which can contain any 8 bit data)."
14582 #: ../fish/guestfish-actions.pod:5054
14583 msgid "See also L</write-append>."
14587 #: ../fish/guestfish-actions.pod:5059
14588 msgid "write-append"
14592 #: ../fish/guestfish-actions.pod:5061
14595 " write-append path content\n"
14600 #: ../fish/guestfish-actions.pod:5063 ../src/guestfs-actions.pod:7680
14602 "This call appends C<content> to the end of file C<path>. If C<path> does "
14603 "not exist, then a new file is created."
14607 #: ../fish/guestfish-actions.pod:5066
14608 msgid "See also L</write>."
14612 #: ../fish/guestfish-actions.pod:5071
14617 #: ../fish/guestfish-actions.pod:5073
14620 " write-file path content size\n"
14625 #: ../fish/guestfish-actions.pod:5075 ../src/guestfs-actions.pod:7707
14627 "This call creates a file called C<path>. The contents of the file is the "
14628 "string C<content> (which can contain any 8 bit data), with length C<size>."
14632 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7711
14634 "As a special case, if C<size> is C<0> then the length is calculated using "
14635 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14639 #: ../fish/guestfish-actions.pod:5083 ../src/guestfs-actions.pod:7715
14641 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14642 "I<not> work, even if the length is specified."
14646 #: ../fish/guestfish-actions.pod:5089
14647 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
14651 #: ../fish/guestfish-actions.pod:5096
14656 #: ../fish/guestfish-actions.pod:5098
14659 " zegrep regex path\n"
14664 #: ../fish/guestfish-actions.pod:5100 ../src/guestfs-actions.pod:7732
14665 msgid "This calls the external C<zegrep> program and returns the matching lines."
14669 #: ../fish/guestfish-actions.pod:5106
14674 #: ../fish/guestfish-actions.pod:5108
14677 " zegrepi regex path\n"
14682 #: ../fish/guestfish-actions.pod:5110 ../src/guestfs-actions.pod:7751
14683 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
14687 #: ../fish/guestfish-actions.pod:5116
14692 #: ../fish/guestfish-actions.pod:5118
14700 #: ../fish/guestfish-actions.pod:5120 ../src/guestfs-actions.pod:7769
14701 msgid "This command writes zeroes over the first few blocks of C<device>."
14705 #: ../fish/guestfish-actions.pod:5122 ../src/guestfs-actions.pod:7771
14707 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
14708 "securely wipe the device). It should be sufficient to remove any partition "
14709 "tables, filesystem superblocks and so on."
14713 #: ../fish/guestfish-actions.pod:5126 ../fish/guestfish-actions.pod:5141 ../src/guestfs-actions.pod:7775 ../src/guestfs-actions.pod:7801
14715 "If blocks are already zero, then this command avoids writing zeroes. This "
14716 "prevents the underlying device from becoming non-sparse or growing "
14721 #: ../fish/guestfish-actions.pod:5130
14722 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
14726 #: ../fish/guestfish-actions.pod:5133
14727 msgid "zero-device"
14731 #: ../fish/guestfish-actions.pod:5135
14734 " zero-device device\n"
14739 #: ../fish/guestfish-actions.pod:5137
14741 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
14742 "which just zeroes the first few blocks of a device."
14746 #: ../fish/guestfish-actions.pod:5148
14751 #: ../fish/guestfish-actions.pod:5150
14754 " zerofree device\n"
14759 #: ../fish/guestfish-actions.pod:5152 ../src/guestfs-actions.pod:7823
14761 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14762 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14763 "possible to compress the filesystem more effectively."
14767 #: ../fish/guestfish-actions.pod:5157 ../src/guestfs-actions.pod:7828
14768 msgid "You should B<not> run this program if the filesystem is mounted."
14772 #: ../fish/guestfish-actions.pod:5160 ../src/guestfs-actions.pod:7831
14774 "It is possible that using this program can damage the filesystem or data on "
14779 #: ../fish/guestfish-actions.pod:5163
14784 #: ../fish/guestfish-actions.pod:5165
14787 " zfgrep pattern path\n"
14792 #: ../fish/guestfish-actions.pod:5167 ../src/guestfs-actions.pod:7845
14793 msgid "This calls the external C<zfgrep> program and returns the matching lines."
14797 #: ../fish/guestfish-actions.pod:5173
14802 #: ../fish/guestfish-actions.pod:5175
14805 " zfgrepi pattern path\n"
14810 #: ../fish/guestfish-actions.pod:5177 ../src/guestfs-actions.pod:7864
14811 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
14815 #: ../fish/guestfish-actions.pod:5183
14820 #: ../fish/guestfish-actions.pod:5185
14823 " zfile meth path\n"
14828 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7890
14829 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
14833 #: ../fish/guestfish-actions.pod:5190 ../src/guestfs-actions.pod:7893
14834 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
14838 #: ../fish/guestfish-actions.pod:5192
14839 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
14843 #: ../fish/guestfish-actions.pod:5195
14844 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
14848 #: ../fish/guestfish-actions.pod:5202
14853 #: ../fish/guestfish-actions.pod:5204
14856 " zgrep regex path\n"
14861 #: ../fish/guestfish-actions.pod:5206 ../src/guestfs-actions.pod:7910
14862 msgid "This calls the external C<zgrep> program and returns the matching lines."
14866 #: ../fish/guestfish-actions.pod:5212
14871 #: ../fish/guestfish-actions.pod:5214
14874 " zgrepi regex path\n"
14879 #: ../fish/guestfish-actions.pod:5216 ../src/guestfs-actions.pod:7929
14880 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
14884 #: ../fish/guestfish-commands.pod:1
14889 #: ../fish/guestfish-commands.pod:3
14894 #: ../fish/guestfish-commands.pod:5
14897 " alloc filename size\n"
14902 #: ../fish/guestfish-commands.pod:7
14904 "This creates an empty (zeroed) file of the given size, and then adds so it "
14905 "can be further examined."
14909 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
14910 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
14914 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
14915 msgid "Size can be specified using standard suffixes, eg. C<1M>."
14919 #: ../fish/guestfish-commands.pod:14
14921 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
14922 "image, see L</PREPARED DISK IMAGES>."
14926 #: ../fish/guestfish-commands.pod:17
14931 #: ../fish/guestfish-commands.pod:19
14934 " copy-in local [local ...] /remotedir\n"
14939 #: ../fish/guestfish-commands.pod:21
14941 "C<copy-in> copies local files or directories recursively into the disk "
14942 "image, placing them in the directory called C</remotedir> (which must "
14943 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
14944 "other commands as necessary."
14948 #: ../fish/guestfish-commands.pod:26
14950 "Multiple local files and directories can be specified, but the last "
14951 "parameter must always be a remote directory. Wildcards cannot be used."
14955 #: ../fish/guestfish-commands.pod:30
14960 #: ../fish/guestfish-commands.pod:32
14963 " copy-out remote [remote ...] localdir\n"
14968 #: ../fish/guestfish-commands.pod:34
14970 "C<copy-out> copies remote files or directories recursively out of the disk "
14971 "image, placing them on the host disk in a local directory called C<localdir> "
14972 "(which must exist). This guestfish meta-command turns into a sequence of "
14973 "L</download>, L</tar-out> and other commands as necessary."
14977 #: ../fish/guestfish-commands.pod:40
14979 "Multiple remote files and directories can be specified, but the last "
14980 "parameter must always be a local directory. To download to the current "
14981 "directory, use C<.> as in:"
14985 #: ../fish/guestfish-commands.pod:44
14988 " copy-out /home .\n"
14993 #: ../fish/guestfish-commands.pod:46
14995 "Wildcards cannot be used in the ordinary command, but you can use them with "
14996 "the help of L</glob> like this:"
15000 #: ../fish/guestfish-commands.pod:49
15003 " glob copy-out /home/* .\n"
15008 #: ../fish/guestfish-commands.pod:51
15013 #: ../fish/guestfish-commands.pod:53
15016 " display filename\n"
15021 #: ../fish/guestfish-commands.pod:55
15023 "Use C<display> (a graphical display program) to display an image file. It "
15024 "downloads the file, and runs C<display> on it."
15028 #: ../fish/guestfish-commands.pod:58
15030 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15031 "environment variable. For example to use the GNOME display program:"
15035 #: ../fish/guestfish-commands.pod:61
15038 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15043 #: ../fish/guestfish-commands.pod:63
15044 msgid "See also L<display(1)>."
15048 #: ../fish/guestfish-commands.pod:65
15053 #: ../fish/guestfish-commands.pod:67
15056 " echo [params ...]\n"
15061 #: ../fish/guestfish-commands.pod:69
15062 msgid "This echos the parameters to the terminal."
15066 #: ../fish/guestfish-commands.pod:71
15071 #: ../fish/guestfish-commands.pod:73
15076 #: ../fish/guestfish-commands.pod:75
15081 #: ../fish/guestfish-commands.pod:77
15089 #: ../fish/guestfish-commands.pod:79
15091 "This is used to edit a file. It downloads the file, edits it locally using "
15092 "your editor, then uploads the result."
15096 #: ../fish/guestfish-commands.pod:82
15098 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
15099 "or C<emacs> you will get those corresponding editors."
15103 #: ../fish/guestfish-commands.pod:86
15108 #: ../fish/guestfish-commands.pod:88
15111 " glob command args...\n"
15116 #: ../fish/guestfish-commands.pod:90
15118 "Expand wildcards in any paths in the args list, and run C<command> "
15119 "repeatedly on each matching path."
15123 #: ../fish/guestfish-commands.pod:93
15124 msgid "See L</WILDCARDS AND GLOBBING>."
15128 #: ../fish/guestfish-commands.pod:95
15133 #: ../fish/guestfish-commands.pod:97
15136 " hexedit <filename|device>\n"
15137 " hexedit <filename|device> <max>\n"
15138 " hexedit <filename|device> <start> <max>\n"
15143 #: ../fish/guestfish-commands.pod:101
15145 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
15150 #: ../fish/guestfish-commands.pod:104
15152 "This command works by downloading potentially the whole file or device, "
15153 "editing it locally, then uploading it. If the file or device is large, you "
15154 "have to specify which part you wish to edit by using C<max> and/or C<start> "
15155 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
15156 "usual modifiers allowed such as C<1M> (1 megabyte)."
15160 #: ../fish/guestfish-commands.pod:111
15161 msgid "For example to edit the first few sectors of a disk you might do:"
15165 #: ../fish/guestfish-commands.pod:114
15168 " hexedit /dev/sda 1M\n"
15173 #: ../fish/guestfish-commands.pod:116
15175 "which would allow you to edit anywhere within the first megabyte of the "
15180 #: ../fish/guestfish-commands.pod:119
15181 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
15185 #: ../fish/guestfish-commands.pod:121
15188 " hexedit /dev/sda1 0x400 0x400\n"
15193 #: ../fish/guestfish-commands.pod:123
15194 msgid "(assuming the superblock is in the standard location)."
15198 #: ../fish/guestfish-commands.pod:125
15200 "This command requires the external L<hexedit(1)> program. You can specify "
15201 "another program to use by setting the C<HEXEDITOR> environment variable."
15205 #: ../fish/guestfish-commands.pod:129
15206 msgid "See also L</hexdump>."
15210 #: ../fish/guestfish-commands.pod:131
15215 #: ../fish/guestfish-commands.pod:133
15223 #: ../fish/guestfish-commands.pod:135
15224 msgid "Change the local directory, ie. the current directory of guestfish itself."
15228 #: ../fish/guestfish-commands.pod:138
15229 msgid "Note that C<!cd> won't do what you might expect."
15233 #: ../fish/guestfish-commands.pod:140
15238 #: ../fish/guestfish-commands.pod:142
15243 #: ../fish/guestfish-commands.pod:144
15251 #: ../fish/guestfish-commands.pod:146
15252 msgid "Opens the manual page for guestfish."
15256 #: ../fish/guestfish-commands.pod:148
15261 #: ../fish/guestfish-commands.pod:150
15266 #: ../fish/guestfish-commands.pod:152
15274 #: ../fish/guestfish-commands.pod:154
15282 #: ../fish/guestfish-commands.pod:156
15283 msgid "This is used to view a file."
15287 #: ../fish/guestfish-commands.pod:158
15289 "The default viewer is C<$PAGER>. However if you use the alternate command "
15290 "C<less> you will get the C<less> command specifically."
15294 #: ../fish/guestfish-commands.pod:161
15299 #: ../fish/guestfish-commands.pod:163
15307 #: ../fish/guestfish-commands.pod:165
15309 "Close and reopen the libguestfs handle. It is not necessary to use this "
15310 "normally, because the handle is closed properly when guestfish exits. "
15311 "However this is occasionally useful for testing."
15315 #: ../fish/guestfish-commands.pod:169
15320 #: ../fish/guestfish-commands.pod:171
15323 " setenv VAR value\n"
15328 #: ../fish/guestfish-commands.pod:173
15329 msgid "Set the environment variable C<VAR> to the string C<value>."
15333 #: ../fish/guestfish-commands.pod:175
15334 msgid "To print the value of an environment variable use a shell command such as:"
15338 #: ../fish/guestfish-commands.pod:178
15346 #: ../fish/guestfish-commands.pod:180
15351 #: ../fish/guestfish-commands.pod:182
15354 " sparse filename size\n"
15359 #: ../fish/guestfish-commands.pod:184
15361 "This creates an empty sparse file of the given size, and then adds so it can "
15362 "be further examined."
15366 #: ../fish/guestfish-commands.pod:187
15368 "In all respects it works the same as the L</alloc> command, except that the "
15369 "image file is allocated sparsely, which means that disk blocks are not "
15370 "assigned to the file until they are needed. Sparse disk files only use "
15371 "space when written to, but they are slower and there is a danger you could "
15372 "run out of real disk space during a write operation."
15376 #: ../fish/guestfish-commands.pod:197
15381 #: ../fish/guestfish-commands.pod:199
15389 #: ../fish/guestfish-commands.pod:201
15391 "This command returns a list of the optional groups known to the daemon, and "
15392 "indicates which ones are supported by this build of the libguestfs "
15397 #: ../fish/guestfish-commands.pod:205
15398 msgid "See also L<guestfs(3)/AVAILABILITY>."
15402 #: ../fish/guestfish-commands.pod:207
15407 #: ../fish/guestfish-commands.pod:209
15410 " time command args...\n"
15415 #: ../fish/guestfish-commands.pod:211
15417 "Run the command as usual, but print the elapsed time afterwards. This can "
15418 "be useful for benchmarking operations."
15422 #: ../fish/guestfish-commands.pod:214
15427 #: ../fish/guestfish-commands.pod:216
15435 #: ../fish/guestfish-commands.pod:218
15436 msgid "Remove C<VAR> from the environment."
15440 #: ../fish/guestfish.pod:5
15441 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15445 #: ../fish/guestfish.pod:9
15448 " guestfish [--options] [commands]\n"
15453 #: ../fish/guestfish.pod:11
15461 #: ../fish/guestfish.pod:13
15464 " guestfish [--ro|--rw] -a disk.img\n"
15469 #: ../fish/guestfish.pod:15
15472 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
15477 #: ../fish/guestfish.pod:17
15480 " guestfish -d libvirt-domain\n"
15485 #: ../fish/guestfish.pod:19
15488 " guestfish [--ro|--rw] -a disk.img -i\n"
15493 #: ../fish/guestfish.pod:21
15496 " guestfish -d libvirt-domain -i\n"
15501 #: ../fish/guestfish.pod:25
15503 "Using guestfish in read/write mode on live virtual machines can be "
15504 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15505 "option to use guestfish safely if the disk image or virtual machine might be "
15510 #: ../fish/guestfish.pod:32
15512 "Guestfish is a shell and command-line tool for examining and modifying "
15513 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15514 "functionality of the guestfs API, see L<guestfs(3)>."
15518 #: ../fish/guestfish.pod:36
15520 "Guestfish gives you structured access to the libguestfs API, from shell "
15521 "scripts or the command line or interactively. If you want to rescue a "
15522 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15527 #: ../fish/guestfish.pod:43
15528 msgid "As an interactive shell"
15532 #: ../fish/guestfish.pod:45
15540 #: ../fish/guestfish.pod:47
15543 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15544 " editing virtual machine filesystems.\n"
15549 #: ../fish/guestfish.pod:50
15552 " Type: 'help' for a list of commands\n"
15553 " 'man' to read the manual\n"
15554 " 'quit' to quit the shell\n"
15559 #: ../fish/guestfish.pod:54
15562 " ><fs> add-ro disk.img\n"
15564 " ><fs> list-filesystems\n"
15565 " /dev/sda1: ext4\n"
15566 " /dev/vg_guest/lv_root: ext4\n"
15567 " /dev/vg_guest/lv_swap: swap\n"
15568 " ><fs> mount /dev/vg_guest/lv_root /\n"
15569 " ><fs> cat /etc/fstab\n"
15571 " # Created by anaconda\n"
15578 #: ../fish/guestfish.pod:67
15579 msgid "From shell scripts"
15583 #: ../fish/guestfish.pod:69
15584 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15588 #: ../fish/guestfish.pod:71
15591 " guestfish <<_EOF_\n"
15594 " mount /dev/vg_guest/lv_root /\n"
15595 " write /etc/motd \"Welcome, new users\"\n"
15601 #: ../fish/guestfish.pod:78
15602 msgid "List the LVM logical volumes in a disk image:"
15606 #: ../fish/guestfish.pod:80
15609 " guestfish -a disk.img --ro <<_EOF_\n"
15617 #: ../fish/guestfish.pod:85
15618 msgid "List all the filesystems in a disk image:"
15622 #: ../fish/guestfish.pod:87
15625 " guestfish -a disk.img --ro <<_EOF_\n"
15627 " list-filesystems\n"
15633 #: ../fish/guestfish.pod:92
15634 msgid "On one command line"
15638 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
15639 msgid "Update C</etc/resolv.conf> in a guest:"
15643 #: ../fish/guestfish.pod:96
15647 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15648 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15653 #: ../fish/guestfish.pod:100
15654 msgid "Edit C</boot/grub/grub.conf> interactively:"
15658 #: ../fish/guestfish.pod:102
15661 " guestfish --rw --add disk.img \\\n"
15662 " --mount /dev/vg_guest/lv_root \\\n"
15663 " --mount /dev/sda1:/boot \\\n"
15664 " edit /boot/grub/grub.conf\n"
15669 #: ../fish/guestfish.pod:107
15670 msgid "Mount disks automatically"
15674 #: ../fish/guestfish.pod:109
15676 "Use the I<-i> option to automatically mount the disks from a virtual "
15681 #: ../fish/guestfish.pod:112
15684 " guestfish --ro -a disk.img -i cat /etc/group\n"
15689 #: ../fish/guestfish.pod:114
15692 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15697 #: ../fish/guestfish.pod:116
15698 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
15702 #: ../fish/guestfish.pod:118
15705 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
15710 #: ../fish/guestfish.pod:120
15711 msgid "As a script interpreter"
15715 #: ../fish/guestfish.pod:122
15716 msgid "Create a 100MB disk containing an ext2-formatted partition:"
15720 #: ../fish/guestfish.pod:124
15723 " #!/usr/bin/guestfish -f\n"
15724 " sparse test1.img 100M\n"
15726 " part-disk /dev/sda mbr\n"
15727 " mkfs ext2 /dev/sda1\n"
15732 #: ../fish/guestfish.pod:130
15733 msgid "Start with a prepared disk"
15737 #: ../fish/guestfish.pod:132
15739 "An alternate way to create a 100MB disk called C<test1.img> containing a "
15740 "single ext2-formatted partition:"
15744 #: ../fish/guestfish.pod:135
15747 " guestfish -N fs\n"
15752 #: ../fish/guestfish.pod:137
15753 msgid "To list what is available do:"
15757 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1009
15760 " guestfish -N help | less\n"
15765 #: ../fish/guestfish.pod:141
15766 msgid "Remote control"
15770 #: ../fish/guestfish.pod:143
15773 " eval \"`guestfish --listen`\"\n"
15774 " guestfish --remote add-ro disk.img\n"
15775 " guestfish --remote run\n"
15776 " guestfish --remote lvs\n"
15781 #: ../fish/guestfish.pod:154
15782 msgid "Displays general help on options."
15786 #: ../fish/guestfish.pod:158
15787 msgid "B<--cmd-help>"
15791 #: ../fish/guestfish.pod:160
15792 msgid "Lists all available guestfish commands."
15796 #: ../fish/guestfish.pod:162
15801 #: ../fish/guestfish.pod:164
15802 msgid "B<--cmd-help cmd>"
15806 #: ../fish/guestfish.pod:166
15807 msgid "Displays detailed help on a single command C<cmd>."
15811 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
15812 msgid "B<-a image>"
15816 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
15817 msgid "B<--add image>"
15821 #: ../fish/guestfish.pod:172
15822 msgid "Add a block device or virtual machine image to the shell."
15826 #: ../fish/guestfish.pod:177
15828 "Using this flag is mostly equivalent to using the C<add> command, with "
15829 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
15830 "the I<--format=...> flag was given."
15834 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
15836 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15837 "URI to use. The default is to use the default libvirt connection."
15841 #: ../fish/guestfish.pod:189
15846 #: ../fish/guestfish.pod:191
15848 "If using the I<--listen> option and a csh-like shell, use this option. See "
15849 "section L</REMOTE CONTROL AND CSH> below."
15853 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
15854 msgid "B<-d libvirt-domain>"
15858 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
15859 msgid "B<--domain libvirt-domain>"
15863 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
15865 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15866 "used, then any libvirt domain can be used. However in write mode, only "
15867 "libvirt domains which are shut down can be named here."
15871 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
15872 msgid "Domain UUIDs can be used instead of names."
15876 #: ../fish/guestfish.pod:204
15878 "Using this flag is mostly equivalent to using the C<add-domain> command, "
15879 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
15880 "if the I<--format:...> flag was given."
15884 #: ../fish/guestfish.pod:208
15889 #: ../fish/guestfish.pod:210
15890 msgid "B<--no-dest-paths>"
15894 #: ../fish/guestfish.pod:212
15896 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15897 "to hit the tab key to complete paths on the guest filesystem, but this "
15898 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15899 "allow this feature to be disabled."
15903 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
15905 "When prompting for keys and passphrases, guestfish normally turns echoing "
15906 "off so you cannot see what you are typing. If you are not worried about "
15907 "Tempest attacks and there is no one else in the room you can specify this "
15908 "flag to see what you are typing."
15912 #: ../fish/guestfish.pod:224
15917 #: ../fish/guestfish.pod:226
15918 msgid "B<--file file>"
15922 #: ../fish/guestfish.pod:228
15923 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15927 #: ../fish/guestfish.pod:231
15930 " #!/usr/bin/guestfish -f\n"
15935 #: ../fish/guestfish.pod:244
15938 " guestfish --format=raw -a disk.img\n"
15943 #: ../fish/guestfish.pod:248
15946 " guestfish --format=raw -a disk.img --format -a another.img\n"
15951 #: ../fish/guestfish.pod:253
15953 "If you have untrusted raw-format guest disk images, you should use this "
15954 "option to specify the disk format. This avoids a possible security problem "
15955 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15959 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
15960 msgid "B<--inspector>"
15964 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
15966 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15967 "system and mount filesystems as they would be mounted on the real virtual "
15972 #: ../fish/guestfish.pod:266
15973 msgid "Typical usage is either:"
15977 #: ../fish/guestfish.pod:268
15980 " guestfish -d myguest -i\n"
15985 #: ../fish/guestfish.pod:270
15986 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15990 #: ../fish/guestfish.pod:272
15993 " guestfish --ro -d myguest -i\n"
15998 #: ../fish/guestfish.pod:274
15999 msgid "(for active domains, readonly), or specify the block device directly:"
16003 #: ../fish/guestfish.pod:276
16006 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
16011 #: ../fish/guestfish.pod:278
16013 "Note that the command line syntax changed slightly over older versions of "
16014 "guestfish. You can still use the old syntax:"
16018 #: ../fish/guestfish.pod:281
16021 " guestfish [--ro] -i disk.img\n"
16026 #: ../fish/guestfish.pod:283
16029 " guestfish [--ro] -i libvirt-domain\n"
16034 #: ../fish/guestfish.pod:285
16036 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
16037 "then using other commands to mount the filesystems that were found."
16041 #: ../fish/guestfish.pod:294
16042 msgid "B<--listen>"
16046 #: ../fish/guestfish.pod:296
16048 "Fork into the background and listen for remote commands. See section "
16049 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16053 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
16058 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
16060 "Connect to a live virtual machine. (Experimental, see "
16061 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
16065 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
16066 msgid "B<-m dev[:mountpoint[:options]]>"
16070 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
16071 msgid "B<--mount dev[:mountpoint[:options]]>"
16075 #: ../fish/guestfish.pod:308
16076 msgid "Mount the named partition or logical volume on the given mountpoint."
16080 #: ../fish/guestfish.pod:310
16081 msgid "If the mountpoint is omitted, it defaults to C</>."
16085 #: ../fish/guestfish.pod:312
16086 msgid "You have to mount something on C</> before most commands will work."
16090 #: ../fish/guestfish.pod:314
16092 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16097 #: ../fish/guestfish.pod:317
16099 "If you don't know what filesystems a disk image contains, you can either run "
16100 "guestfish without this option, then list the partitions, filesystems and LVs "
16101 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
16102 "commands), or you can use the L<virt-filesystems(1)> program."
16106 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
16108 "The third (and rarely used) part of the mount parameter is the list of mount "
16109 "options used to mount the underlying filesystem. If this is not given, then "
16110 "the mount options are either the empty string or C<ro> (the latter if the "
16111 "I<--ro> flag is used). By specifying the mount options, you override this "
16112 "default choice. Probably the only time you would use this is to enable ACLs "
16113 "and/or extended attributes if the filesystem can support them:"
16117 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
16120 " -m /dev/sda1:/:acl,user_xattr\n"
16125 #: ../fish/guestfish.pod:333
16126 msgid "Using this flag is equivalent to using the C<mount-options> command."
16130 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193 ../resize/virt-resize.pod:358
16135 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
16136 msgid "B<--no-sync>"
16140 #: ../fish/guestfish.pod:339
16142 "Disable autosync. This is enabled by default. See the discussion of "
16143 "autosync in the L<guestfs(3)> manpage."
16147 #: ../fish/guestfish.pod:342
16152 #: ../fish/guestfish.pod:344
16153 msgid "B<--new type>"
16157 #: ../fish/guestfish.pod:346
16162 #: ../fish/guestfish.pod:348
16164 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16165 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16166 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16171 #: ../fish/guestfish.pod:353
16172 msgid "B<--progress-bars>"
16176 #: ../fish/guestfish.pod:355
16177 msgid "Enable progress bars, even when guestfish is used non-interactively."
16181 #: ../fish/guestfish.pod:357
16183 "Progress bars are enabled by default when guestfish is used as an "
16184 "interactive shell."
16188 #: ../fish/guestfish.pod:360
16189 msgid "B<--no-progress-bars>"
16193 #: ../fish/guestfish.pod:362
16194 msgid "Disable progress bars."
16198 #: ../fish/guestfish.pod:364
16199 msgid "B<--remote[=pid]>"
16203 #: ../fish/guestfish.pod:366
16205 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16206 "CONTROL GUESTFISH OVER A SOCKET> below."
16210 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239 ../rescue/virt-rescue.pod:161
16215 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241 ../rescue/virt-rescue.pod:163
16220 #: ../fish/guestfish.pod:373
16222 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16223 "mounts are done read-only."
16227 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
16229 "The option must always be used if the disk image or virtual machine might be "
16230 "running, and is generally recommended in cases where you don't need write "
16231 "access to the disk."
16235 #: ../fish/guestfish.pod:380
16237 "Note that prepared disk images created with I<-N> are not affected by this "
16238 "option. Also commands like C<add> are not affected - you have to specify "
16239 "the C<readonly:true> option explicitly if you need it."
16243 #: ../fish/guestfish.pod:384
16244 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16248 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253 ../rescue/virt-rescue.pod:173
16249 msgid "B<--selinux>"
16253 #: ../fish/guestfish.pod:388
16254 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16258 #: ../fish/guestfish.pod:394
16260 "Enable very verbose messages. This is particularly useful if you find a "
16265 #: ../fish/guestfish.pod:401
16266 msgid "Display the guestfish / libguestfs version number and exit."
16270 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269 ../rescue/virt-rescue.pod:190
16275 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271 ../rescue/virt-rescue.pod:192
16280 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
16282 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16283 "mounts are done read-write."
16287 #: ../fish/guestfish.pod:410
16288 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
16292 #: ../fish/guestfish.pod:414
16293 msgid "Echo each command before executing it."
16297 #: ../fish/guestfish.pod:418
16298 msgid "COMMANDS ON COMMAND LINE"
16302 #: ../fish/guestfish.pod:420
16303 msgid "Any additional (non-option) arguments are treated as commands to execute."
16307 #: ../fish/guestfish.pod:423
16309 "Commands to execute should be separated by a colon (C<:>), where the colon "
16310 "is a separate parameter. Thus:"
16314 #: ../fish/guestfish.pod:426
16317 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16322 #: ../fish/guestfish.pod:428
16324 "If there are no additional arguments, then we enter a shell, either an "
16325 "interactive shell with a prompt (if the input is a terminal) or a "
16326 "non-interactive shell."
16330 #: ../fish/guestfish.pod:432
16332 "In either command line mode or non-interactive shell, the first command that "
16333 "gives an error causes the whole shell to exit. In interactive mode (with a "
16334 "prompt) if a command fails, you can continue to enter commands."
16338 #: ../fish/guestfish.pod:437
16339 msgid "USING launch (OR run)"
16343 #: ../fish/guestfish.pod:439
16345 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16346 "then launch it, then mount any disks you need, and finally issue "
16347 "actions/commands. So the general order of the day is:"
16351 #: ../fish/guestfish.pod:447
16352 msgid "add or -a/--add"
16356 #: ../fish/guestfish.pod:451
16357 msgid "launch (aka run)"
16361 #: ../fish/guestfish.pod:455
16362 msgid "mount or -m/--mount"
16366 #: ../fish/guestfish.pod:459
16367 msgid "any other commands"
16371 #: ../fish/guestfish.pod:463
16373 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16374 "guest before mounting or performing any other commands."
16378 #: ../fish/guestfish.pod:466
16380 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16381 "I<--new> options were given then C<run> is done automatically, simply "
16382 "because guestfish can't perform the action you asked for without doing this."
16386 #: ../fish/guestfish.pod:471
16387 msgid "OPENING DISKS FOR READ AND WRITE"
16391 #: ../fish/guestfish.pod:473
16393 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
16394 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
16395 "I<-i> and I<-m> open disk images read-only or for writing."
16399 #: ../fish/guestfish.pod:478
16401 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
16402 "opening disk images supplied on the command line for write. To open a disk "
16403 "image read-only you have to do I<-a image --ro>."
16407 #: ../fish/guestfish.pod:482
16409 "This matters: If you accidentally open a live VM disk image writable then "
16410 "you will cause irreversible disk corruption."
16414 #: ../fish/guestfish.pod:485
16416 "In a future libguestfs we intend to change the default the other way. Disk "
16417 "images will be opened read-only. You will have to either specify "
16418 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
16419 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
16420 "access for disk images specified by those other command line options."
16424 #: ../fish/guestfish.pod:492
16426 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
16427 "which does nothing (it is already the default). However it is highly "
16428 "recommended that you use this option to indicate that you need write access, "
16429 "and prepare your scripts for the day when this option will be required for "
16434 #: ../fish/guestfish.pod:498
16436 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
16437 "other libguestfs program apart from guestfish and guestmount."
16441 #: ../fish/guestfish.pod:501
16446 #: ../fish/guestfish.pod:503
16448 "You can quote ordinary parameters using either single or double quotes. For "
16453 #: ../fish/guestfish.pod:506
16456 " add \"file with a space.img\"\n"
16461 #: ../fish/guestfish.pod:508
16464 " rm '/file name'\n"
16469 #: ../fish/guestfish.pod:510
16477 #: ../fish/guestfish.pod:512
16479 "A few commands require a list of strings to be passed. For these, use a "
16480 "whitespace-separated list, enclosed in quotes. Strings containing "
16481 "whitespace to be passed through must be enclosed in single quotes. A "
16482 "literal single quote must be escaped with a backslash."
16486 #: ../fish/guestfish.pod:517
16489 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16490 " command \"/bin/echo 'foo bar'\"\n"
16491 " command \"/bin/echo \\'foo\\'\"\n"
16496 #: ../fish/guestfish.pod:521
16497 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
16501 #: ../fish/guestfish.pod:523
16503 "In double-quoted arguments (only) use backslash to insert special "
16508 #: ../fish/guestfish.pod:528
16513 #: ../fish/guestfish.pod:530
16514 msgid "Alert (bell) character."
16518 #: ../fish/guestfish.pod:532
16523 #: ../fish/guestfish.pod:534
16524 msgid "Backspace character."
16528 #: ../fish/guestfish.pod:536
16533 #: ../fish/guestfish.pod:538
16534 msgid "Form feed character."
16538 #: ../fish/guestfish.pod:540
16543 #: ../fish/guestfish.pod:542
16544 msgid "Newline character."
16548 #: ../fish/guestfish.pod:544
16553 #: ../fish/guestfish.pod:546
16554 msgid "Carriage return character."
16558 #: ../fish/guestfish.pod:548
16563 #: ../fish/guestfish.pod:550
16564 msgid "Horizontal tab character."
16568 #: ../fish/guestfish.pod:552
16573 #: ../fish/guestfish.pod:554
16574 msgid "Vertical tab character."
16578 #: ../fish/guestfish.pod:556
16583 #: ../fish/guestfish.pod:558
16584 msgid "A literal double quote character."
16588 #: ../fish/guestfish.pod:560
16593 #: ../fish/guestfish.pod:562
16595 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
16600 #: ../fish/guestfish.pod:565
16605 #: ../fish/guestfish.pod:567
16606 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
16610 #: ../fish/guestfish.pod:570
16612 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
16617 #: ../fish/guestfish.pod:573
16622 #: ../fish/guestfish.pod:575
16623 msgid "A literal backslash character."
16627 #: ../fish/guestfish.pod:579
16628 msgid "OPTIONAL ARGUMENTS"
16632 #: ../fish/guestfish.pod:581
16634 "Some commands take optional arguments. These arguments appear in this "
16635 "documentation as C<[argname:..]>. You can use them as in these examples:"
16639 #: ../fish/guestfish.pod:585
16642 " add-drive-opts filename\n"
16647 #: ../fish/guestfish.pod:587
16650 " add-drive-opts filename readonly:true\n"
16655 #: ../fish/guestfish.pod:589
16658 " add-drive-opts filename format:qcow2 readonly:false\n"
16663 #: ../fish/guestfish.pod:591
16665 "Each optional argument can appear at most once. All optional arguments must "
16666 "appear after the required ones."
16670 #: ../fish/guestfish.pod:594
16675 #: ../fish/guestfish.pod:596
16676 msgid "This section applies to all commands which can take integers as parameters."
16680 #: ../fish/guestfish.pod:599
16681 msgid "SIZE SUFFIX"
16685 #: ../fish/guestfish.pod:601
16687 "When the command takes a parameter measured in bytes, you can use one of the "
16688 "following suffixes to specify kilobytes, megabytes and larger sizes:"
16692 #: ../fish/guestfish.pod:607
16693 msgid "B<k> or B<K> or B<KiB>"
16697 #: ../fish/guestfish.pod:609
16698 msgid "The size in kilobytes (multiplied by 1024)."
16702 #: ../fish/guestfish.pod:611
16707 #: ../fish/guestfish.pod:613
16708 msgid "The size in SI 1000 byte units."
16712 #: ../fish/guestfish.pod:615
16713 msgid "B<M> or B<MiB>"
16717 #: ../fish/guestfish.pod:617
16718 msgid "The size in megabytes (multiplied by 1048576)."
16722 #: ../fish/guestfish.pod:619
16727 #: ../fish/guestfish.pod:621
16728 msgid "The size in SI 1000000 byte units."
16732 #: ../fish/guestfish.pod:623
16733 msgid "B<G> or B<GiB>"
16737 #: ../fish/guestfish.pod:625
16738 msgid "The size in gigabytes (multiplied by 2**30)."
16742 #: ../fish/guestfish.pod:627
16747 #: ../fish/guestfish.pod:629
16748 msgid "The size in SI 10**9 byte units."
16752 #: ../fish/guestfish.pod:631
16753 msgid "B<T> or B<TiB>"
16757 #: ../fish/guestfish.pod:633
16758 msgid "The size in terabytes (multiplied by 2**40)."
16762 #: ../fish/guestfish.pod:635
16767 #: ../fish/guestfish.pod:637
16768 msgid "The size in SI 10**12 byte units."
16772 #: ../fish/guestfish.pod:639
16773 msgid "B<P> or B<PiB>"
16777 #: ../fish/guestfish.pod:641
16778 msgid "The size in petabytes (multiplied by 2**50)."
16782 #: ../fish/guestfish.pod:643
16787 #: ../fish/guestfish.pod:645
16788 msgid "The size in SI 10**15 byte units."
16792 #: ../fish/guestfish.pod:647
16793 msgid "B<E> or B<EiB>"
16797 #: ../fish/guestfish.pod:649
16798 msgid "The size in exabytes (multiplied by 2**60)."
16802 #: ../fish/guestfish.pod:651
16807 #: ../fish/guestfish.pod:653
16808 msgid "The size in SI 10**18 byte units."
16812 #: ../fish/guestfish.pod:655
16813 msgid "B<Z> or B<ZiB>"
16817 #: ../fish/guestfish.pod:657
16818 msgid "The size in zettabytes (multiplied by 2**70)."
16822 #: ../fish/guestfish.pod:659
16827 #: ../fish/guestfish.pod:661
16828 msgid "The size in SI 10**21 byte units."
16832 #: ../fish/guestfish.pod:663
16833 msgid "B<Y> or B<YiB>"
16837 #: ../fish/guestfish.pod:665
16838 msgid "The size in yottabytes (multiplied by 2**80)."
16842 #: ../fish/guestfish.pod:667
16847 #: ../fish/guestfish.pod:669
16848 msgid "The size in SI 10**24 byte units."
16852 #: ../fish/guestfish.pod:675
16855 " truncate-size /file 1G\n"
16860 #: ../fish/guestfish.pod:677
16861 msgid "would truncate the file to 1 gigabyte."
16865 #: ../fish/guestfish.pod:679
16867 "Be careful because a few commands take sizes in kilobytes or megabytes "
16868 "(eg. the parameter to L</memsize> is specified in megabytes already). "
16869 "Adding a suffix will probably not do what you expect."
16873 #: ../fish/guestfish.pod:683
16874 msgid "OCTAL AND HEXADECIMAL NUMBERS"
16878 #: ../fish/guestfish.pod:685
16880 "For specifying the radix (base) use the C convention: C<0> to prefix an "
16881 "octal number or C<0x> to prefix a hexadecimal number. For example:"
16885 #: ../fish/guestfish.pod:688
16888 " 1234 decimal number 1234\n"
16889 " 02322 octal number, equivalent to decimal 1234\n"
16890 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
16895 #: ../fish/guestfish.pod:692
16897 "When using the C<chmod> command, you almost always want to specify an octal "
16898 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
16899 "L<chmod(1)> program):"
16903 #: ../fish/guestfish.pod:696
16906 " chmod 0777 /public # OK\n"
16907 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
16912 #: ../fish/guestfish.pod:699
16914 "Commands that return numbers usually print them in decimal, but some "
16915 "commands print numbers in other radices (eg. C<umask> prints the mode in "
16916 "octal, preceeded by C<0>)."
16920 #: ../fish/guestfish.pod:703
16921 msgid "WILDCARDS AND GLOBBING"
16925 #: ../fish/guestfish.pod:705
16927 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
16928 "(globbing) by default. So for example the following will not do what you "
16933 #: ../fish/guestfish.pod:709
16941 #: ../fish/guestfish.pod:711
16943 "Assuming you don't have a directory called literally C</home/*> then the "
16944 "above command will return an error."
16948 #: ../fish/guestfish.pod:714
16949 msgid "To perform wildcard expansion, use the C<glob> command."
16953 #: ../fish/guestfish.pod:716
16956 " glob rm-rf /home/*\n"
16961 #: ../fish/guestfish.pod:718
16963 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
16964 "many times), equivalent to:"
16968 #: ../fish/guestfish.pod:721
16971 " rm-rf /home/jim\n"
16972 " rm-rf /home/joe\n"
16973 " rm-rf /home/mary\n"
16978 #: ../fish/guestfish.pod:725
16979 msgid "C<glob> only works on simple guest paths and not on device names."
16983 #: ../fish/guestfish.pod:727
16985 "If you have several parameters, each containing a wildcard, then glob will "
16986 "perform a Cartesian product."
16990 #: ../fish/guestfish.pod:730
16995 #: ../fish/guestfish.pod:732
16997 "Any line which starts with a I<#> character is treated as a comment and "
16998 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
16999 "a command. For example:"
17003 #: ../fish/guestfish.pod:736
17006 " # this is a comment\n"
17007 " # this is a comment\n"
17008 " foo # NOT a comment\n"
17013 #: ../fish/guestfish.pod:740
17014 msgid "Blank lines are also ignored."
17018 #: ../fish/guestfish.pod:742
17019 msgid "RUNNING COMMANDS LOCALLY"
17023 #: ../fish/guestfish.pod:744
17025 "Any line which starts with a I<!> character is treated as a command sent to "
17026 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17030 #: ../fish/guestfish.pod:748
17034 " tgz-out /remote local/remote-data.tar.gz\n"
17039 #: ../fish/guestfish.pod:751
17041 "will create a directory C<local> on the host, and then export the contents "
17042 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17043 "(See C<tgz-out>)."
17047 #: ../fish/guestfish.pod:755
17049 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17050 "effect, due to the way that subprocesses work in Unix."
17054 #: ../fish/guestfish.pod:758
17055 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
17059 #: ../fish/guestfish.pod:760
17061 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
17062 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
17063 "and executed as guestfish commands."
17067 #: ../fish/guestfish.pod:764
17069 "Thus you can use shell script to construct arbitrary guestfish commands "
17070 "which are then parsed by guestfish."
17074 #: ../fish/guestfish.pod:767
17076 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
17077 "through C</foo.100>) using guestfish commands alone. However this is simple "
17078 "if we use a shell script to create the guestfish commands for us:"
17082 #: ../fish/guestfish.pod:772
17085 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
17090 #: ../fish/guestfish.pod:774
17091 msgid "or with names like C</foo.001>:"
17095 #: ../fish/guestfish.pod:776
17098 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
17103 #: ../fish/guestfish.pod:778
17105 "When using guestfish interactively it can be helpful to just run the shell "
17106 "script first (ie. remove the initial C<E<lt>> character so it is just an "
17107 "ordinary I<!> local command), see what guestfish commands it would run, and "
17108 "when you are happy with those prepend the C<E<lt>> character to run the "
17109 "guestfish commands for real."
17113 #: ../fish/guestfish.pod:784
17118 #: ../fish/guestfish.pod:786
17120 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17121 "command (a guestfish command) to the second command (any host command). For "
17126 #: ../fish/guestfish.pod:790
17129 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17134 #: ../fish/guestfish.pod:792
17136 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17137 "program). The above command would list all accounts in the guest filesystem "
17138 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17142 #: ../fish/guestfish.pod:797
17145 " hexdump /bin/ls | head\n"
17146 " list-devices | tail -1\n"
17147 " tgz-out / - | tar ztf -\n"
17152 #: ../fish/guestfish.pod:801
17154 "The space before the pipe symbol is required, any space after the pipe "
17155 "symbol is optional. Everything after the pipe symbol is just passed "
17156 "straight to the host shell, so it can contain redirections, globs and "
17157 "anything else that makes sense on the host side."
17161 #: ../fish/guestfish.pod:806
17163 "To use a literal argument which begins with a pipe symbol, you have to quote "
17168 #: ../fish/guestfish.pod:809
17176 #: ../fish/guestfish.pod:811
17177 msgid "HOME DIRECTORIES"
17181 #: ../fish/guestfish.pod:813
17183 "If a parameter starts with the character C<~> then the tilde may be expanded "
17184 "as a home directory path (either C<~> for the current user's home directory, "
17185 "or C<~user> for another user)."
17189 #: ../fish/guestfish.pod:817
17191 "Note that home directory expansion happens for users known I<on the host>, "
17192 "not in the guest filesystem."
17196 #: ../fish/guestfish.pod:820
17198 "To use a literal argument which begins with a tilde, you have to quote it, "
17203 #: ../fish/guestfish.pod:823
17211 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
17212 msgid "ENCRYPTED DISKS"
17216 #: ../fish/guestfish.pod:827
17218 "Libguestfs has some support for Linux guests encrypted according to the "
17219 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17220 "disk encryption systems used by modern Linux guests. Currently only "
17221 "LVM-on-LUKS is supported."
17225 #: ../fish/guestfish.pod:832
17226 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17230 #: ../fish/guestfish.pod:834
17233 " ><fs> vfs-type /dev/sda2\n"
17239 #: ../fish/guestfish.pod:837
17241 "Then open those devices using L</luks-open>. This creates a device-mapper "
17242 "device called C</dev/mapper/luksdev>."
17246 #: ../fish/guestfish.pod:840
17249 " ><fs> luks-open /dev/sda2 luksdev\n"
17250 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17255 #: ../fish/guestfish.pod:843
17257 "Finally you have to tell LVM to scan for volume groups on the newly created "
17262 #: ../fish/guestfish.pod:846
17266 " vg-activate-all true\n"
17271 #: ../fish/guestfish.pod:849
17272 msgid "The logical volume(s) can now be mounted in the usual way."
17276 #: ../fish/guestfish.pod:851
17278 "Before closing a LUKS device you must unmount any logical volumes on it and "
17279 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17280 "one. Then you can close the mapper device:"
17284 #: ../fish/guestfish.pod:855
17287 " vg-activate false /dev/VG\n"
17288 " luks-close /dev/mapper/luksdev\n"
17293 #: ../fish/guestfish.pod:860
17295 "If a path is prefixed with C<win:> then you can use Windows-style drive "
17296 "letters and paths (with some limitations). The following commands are "
17301 #: ../fish/guestfish.pod:864
17304 " file /WINDOWS/system32/config/system.LOG\n"
17309 #: ../fish/guestfish.pod:866
17312 " file win:\\windows\\system32\\config\\system.log\n"
17317 #: ../fish/guestfish.pod:868
17320 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
17325 #: ../fish/guestfish.pod:870
17327 "The parameter is rewritten \"behind the scenes\" by looking up the position "
17328 "where the drive is mounted, prepending that to the path, changing all "
17329 "backslash characters to forward slash, then resolving the result using "
17330 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
17331 "then the parameter might be rewritten like this:"
17335 #: ../fish/guestfish.pod:876
17338 " win:e:\\foo\\bar => /e/FOO/bar\n"
17343 #: ../fish/guestfish.pod:878
17344 msgid "This only works in argument positions that expect a path."
17348 #: ../fish/guestfish.pod:880
17349 msgid "UPLOADING AND DOWNLOADING FILES"
17353 #: ../fish/guestfish.pod:882
17355 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17356 "others which upload from or download to a local file, you can use the "
17357 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17361 #: ../fish/guestfish.pod:886
17369 #: ../fish/guestfish.pod:888
17370 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
17374 #: ../fish/guestfish.pod:891
17377 " tar-out /etc - | tar tf -\n"
17382 #: ../fish/guestfish.pod:893
17384 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17385 "command (see L</PIPES>)."
17389 #: ../fish/guestfish.pod:896
17391 "When using C<-> to read from stdin, the input is read up to the end of "
17392 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17393 "some arbitrary end marker:"
17397 #: ../fish/guestfish.pod:900
17400 " upload -<<END /foo\n"
17409 #: ../fish/guestfish.pod:906
17411 "Any string of characters can be used instead of C<END>. The end marker must "
17412 "appear on a line of its own, without any preceeding or following characters "
17413 "(not even spaces)."
17417 #: ../fish/guestfish.pod:910
17419 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
17420 "upload local files (so-called \"FileIn\" parameters in the generator)."
17424 #: ../fish/guestfish.pod:913
17425 msgid "EXIT ON ERROR BEHAVIOUR"
17429 #: ../fish/guestfish.pod:915
17431 "By default, guestfish will ignore any errors when in interactive mode "
17432 "(ie. taking commands from a human over a tty), and will exit on the first "
17433 "error in non-interactive mode (scripts, commands given on the command line)."
17437 #: ../fish/guestfish.pod:920
17439 "If you prefix a command with a I<-> character, then that command will not "
17440 "cause guestfish to exit, even if that (one) command returns an error."
17444 #: ../fish/guestfish.pod:924
17445 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
17449 #: ../fish/guestfish.pod:926
17451 "Guestfish can be remote-controlled over a socket. This is useful "
17452 "particularly in shell scripts where you want to make several different "
17453 "changes to a filesystem, but you don't want the overhead of starting up a "
17454 "guestfish process each time."
17458 #: ../fish/guestfish.pod:931
17459 msgid "Start a guestfish server process using:"
17463 #: ../fish/guestfish.pod:933
17466 " eval \"`guestfish --listen`\"\n"
17471 #: ../fish/guestfish.pod:935
17472 msgid "and then send it commands by doing:"
17476 #: ../fish/guestfish.pod:937
17479 " guestfish --remote cmd [...]\n"
17484 #: ../fish/guestfish.pod:939
17485 msgid "To cause the server to exit, send it the exit command:"
17489 #: ../fish/guestfish.pod:943
17491 "Note that the server will normally exit if there is an error in a command. "
17492 "You can change this in the usual way. See section L</EXIT ON ERROR "
17497 #: ../fish/guestfish.pod:947
17498 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
17502 #: ../fish/guestfish.pod:949
17504 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
17505 "is how the I<--remote> option knows where to send the commands. You can "
17506 "have several guestfish listener processes running using:"
17510 #: ../fish/guestfish.pod:953
17513 " eval \"`guestfish --listen`\"\n"
17514 " pid1=$GUESTFISH_PID\n"
17515 " eval \"`guestfish --listen`\"\n"
17516 " pid2=$GUESTFISH_PID\n"
17518 " guestfish --remote=$pid1 cmd\n"
17519 " guestfish --remote=$pid2 cmd\n"
17524 #: ../fish/guestfish.pod:961
17525 msgid "REMOTE CONTROL AND CSH"
17529 #: ../fish/guestfish.pod:963
17531 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
17536 #: ../fish/guestfish.pod:966
17539 " eval \"`guestfish --listen --csh`\"\n"
17544 #: ../fish/guestfish.pod:968
17545 msgid "REMOTE CONTROL DETAILS"
17549 #: ../fish/guestfish.pod:970
17551 "Remote control happens over a Unix domain socket called "
17552 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
17553 "of the process, and C<$PID> is the process ID of the server."
17557 #: ../fish/guestfish.pod:974
17558 msgid "Guestfish client and server versions must match exactly."
17562 #: ../fish/guestfish.pod:976
17563 msgid "REMOTE CONTROL RUN COMMAND HANGING"
17567 #: ../fish/guestfish.pod:978
17569 "Using the C<run> (or C<launch>) command remotely in a command substitution "
17570 "context hangs, ie. don't do (note the backquotes):"
17574 #: ../fish/guestfish.pod:981
17577 " a=`guestfish --remote run`\n"
17582 #: ../fish/guestfish.pod:983
17584 "Since the C<run> command produces no output on stdout, this is not useful "
17585 "anyway. For further information see "
17586 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
17590 #: ../fish/guestfish.pod:987
17591 msgid "PREPARED DISK IMAGES"
17595 #: ../fish/guestfish.pod:989
17597 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
17598 "preformatted disk images that guestfish can make for you to save typing. "
17599 "This is particularly useful for testing purposes. This option is used "
17600 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
17601 "can be mixed with I<-a>)."
17605 #: ../fish/guestfish.pod:995
17607 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17608 "the second and so on. Existing files in the current directory are "
17613 #: ../fish/guestfish.pod:999
17615 "The type briefly describes how the disk should be sized, partitioned, how "
17616 "filesystem(s) should be created, and how content should be added. "
17617 "Optionally the type can be followed by extra parameters, separated by C<:> "
17618 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
17619 "sparsely-allocated disk, containing a single partition, with the partition "
17620 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
17621 "on a 1GB disk instead."
17625 #: ../fish/guestfish.pod:1007
17626 msgid "To list the available types and any extra parameters they take, run:"
17630 #: ../fish/guestfish.pod:1011
17632 "Note that the prepared filesystem is not mounted. You would usually have to "
17633 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17637 #: ../fish/guestfish.pod:1015
17639 "If any I<-N> or I<--new> options are given, the guest is automatically "
17644 #: ../fish/guestfish.pod:1020
17645 msgid "Create a 100MB disk with an ext4-formatted partition:"
17649 #: ../fish/guestfish.pod:1022
17652 " guestfish -N fs:ext4\n"
17657 #: ../fish/guestfish.pod:1024
17658 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
17662 #: ../fish/guestfish.pod:1026
17665 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
17670 #: ../fish/guestfish.pod:1028
17671 msgid "Create a blank 200MB disk:"
17675 #: ../fish/guestfish.pod:1030
17678 " guestfish -N disk:200M\n"
17683 #: ../fish/guestfish.pod:1032
17684 msgid "PROGRESS BARS"
17688 #: ../fish/guestfish.pod:1034
17690 "Some (not all) long-running commands send progress notification messages as "
17691 "they are running. Guestfish turns these messages into progress bars."
17695 #: ../fish/guestfish.pod:1038
17697 "When a command that supports progress bars takes longer than two seconds to "
17698 "run, and if progress bars are enabled, then you will see one appearing below "
17703 #: ../fish/guestfish.pod:1042
17706 " ><fs> copy-size /large-file /another-file 2048M\n"
17707 " / 10% [#####-----------------------------------------] 00:30\n"
17712 #: ../fish/guestfish.pod:1045
17714 "The spinner on the left hand side moves round once for every progress "
17715 "notification received from the backend. This is a (reasonably) golden "
17716 "assurance that the command is \"doing something\" even if the progress bar "
17717 "is not moving, because the command is able to send the progress "
17718 "notifications. When the bar reaches 100% and the command finishes, the "
17719 "spinner disappears."
17723 #: ../fish/guestfish.pod:1052
17725 "Progress bars are enabled by default when guestfish is used interactively. "
17726 "You can enable them even for non-interactive modes using I<--progress-bars>, "
17727 "and you can disable them completely using I<--no-progress-bars>."
17731 #: ../fish/guestfish.pod:1057
17732 msgid "GUESTFISH COMMANDS"
17736 #: ../fish/guestfish.pod:1059
17738 "The commands in this section are guestfish convenience commands, in other "
17739 "words, they are not part of the L<guestfs(3)> API."
17743 #: ../fish/guestfish.pod:1062
17748 #: ../fish/guestfish.pod:1064
17757 #: ../fish/guestfish.pod:1067
17758 msgid "Without any parameter, this provides general help."
17762 #: ../fish/guestfish.pod:1069
17763 msgid "With a C<cmd> parameter, this displays detailed help for that command."
17767 #: ../fish/guestfish.pod:1071
17768 msgid "quit | exit"
17772 #: ../fish/guestfish.pod:1073
17773 msgid "This exits guestfish. You can also use C<^D> key."
17777 #: ../fish/guestfish.pod:1075
17778 msgid "@FISH_COMMANDS@"
17782 #: ../fish/guestfish.pod:1077
17787 #: ../fish/guestfish.pod:1079 ../src/guestfs.pod:1475
17792 #: ../fish/guestfish.pod:1081 ../test-tool/libguestfs-test-tool.pod:77
17797 #: ../fish/guestfish.pod:1083
17799 "guestfish returns 0 if the commands completed without error, or 1 if there "
17804 #: ../fish/guestfish.pod:1090
17809 #: ../fish/guestfish.pod:1092
17811 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
17816 #: ../fish/guestfish.pod:1095 ../src/guestfs.pod:2985
17817 msgid "FEBOOTSTRAP_KERNEL"
17821 #: ../fish/guestfish.pod:1097 ../src/guestfs.pod:2987
17822 msgid "FEBOOTSTRAP_MODULES"
17826 #: ../fish/guestfish.pod:1099 ../src/guestfs.pod:2989
17828 "These two environment variables allow the kernel that libguestfs uses in the "
17829 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
17830 "most recent host kernel is chosen. For more information about kernel "
17831 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
17832 "available in febootstrap E<ge> 3.8."
17836 #: ../fish/guestfish.pod:1105
17837 msgid "GUESTFISH_DISPLAY_IMAGE"
17841 #: ../fish/guestfish.pod:1107
17843 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
17844 "If not set, it uses L<display(1)>."
17848 #: ../fish/guestfish.pod:1110
17849 msgid "GUESTFISH_PID"
17853 #: ../fish/guestfish.pod:1112
17855 "Used with the I<--remote> option to specify the remote guestfish process to "
17856 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
17860 #: ../fish/guestfish.pod:1116
17865 #: ../fish/guestfish.pod:1118
17867 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
17868 "not specified, the external L<hexedit(1)> program is used."
17872 #: ../fish/guestfish.pod:1122
17877 #: ../fish/guestfish.pod:1124
17879 "If compiled with GNU readline support, various files in the home directory "
17880 "can be used. See L</FILES>."
17884 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:2995
17885 msgid "LIBGUESTFS_APPEND"
17889 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:2997
17890 msgid "Pass additional options to the guest kernel."
17894 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:2999
17895 msgid "LIBGUESTFS_DEBUG"
17899 #: ../fish/guestfish.pod:1133
17901 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
17902 "effect as using the B<-v> option."
17906 #: ../fish/guestfish.pod:1136 ../src/guestfs.pod:3004
17907 msgid "LIBGUESTFS_MEMSIZE"
17911 #: ../fish/guestfish.pod:1138 ../src/guestfs.pod:3006
17912 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
17916 #: ../fish/guestfish.pod:1141 ../src/guestfs.pod:3009
17919 " LIBGUESTFS_MEMSIZE=700\n"
17924 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3011
17925 msgid "LIBGUESTFS_PATH"
17929 #: ../fish/guestfish.pod:1145
17931 "Set the path that guestfish uses to search for kernel and initrd.img. See "
17932 "the discussion of paths in L<guestfs(3)>."
17936 #: ../fish/guestfish.pod:1148 ../src/guestfs.pod:3016
17937 msgid "LIBGUESTFS_QEMU"
17941 #: ../fish/guestfish.pod:1150 ../src/guestfs.pod:3018
17943 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
17944 "which was found at compile time by the configure script is used."
17948 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3024
17949 msgid "LIBGUESTFS_TRACE"
17953 #: ../fish/guestfish.pod:1156
17954 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
17958 #: ../fish/guestfish.pod:1158
17963 #: ../fish/guestfish.pod:1160
17965 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
17970 #: ../fish/guestfish.pod:1163 ../src/guestfs.pod:3029
17975 #: ../fish/guestfish.pod:1165 ../src/guestfs.pod:3031
17977 "Location of temporary directory, defaults to C</tmp> except for the cached "
17978 "supermin appliance which defaults to C</var/tmp>."
17982 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3034
17984 "If libguestfs was compiled to use the supermin appliance then the real "
17985 "appliance is cached in this directory, shared between all handles belonging "
17986 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
17987 "use in case C</var/tmp> is not large enough."
17991 #: ../fish/guestfish.pod:1176 ../fuse/guestmount.pod:288 ../rescue/virt-rescue.pod:269
17996 #: ../fish/guestfish.pod:1180 ../fuse/guestmount.pod:292 ../rescue/virt-rescue.pod:273
17997 msgid "$HOME/.libguestfs-tools.rc"
18001 #: ../fish/guestfish.pod:1182 ../fuse/guestmount.pod:294 ../rescue/virt-rescue.pod:275
18002 msgid "/etc/libguestfs-tools.conf"
18006 #: ../fish/guestfish.pod:1184 ../fuse/guestmount.pod:296 ../rescue/virt-rescue.pod:277
18008 "This configuration file controls the default read-only or read-write mode "
18009 "(I<--ro> or I<--rw>)."
18013 #: ../fish/guestfish.pod:1187
18014 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
18018 #: ../fish/guestfish.pod:1189
18019 msgid "$HOME/.guestfish"
18023 #: ../fish/guestfish.pod:1191
18025 "If compiled with GNU readline support, then the command history is saved in "
18030 #: ../fish/guestfish.pod:1194
18031 msgid "$HOME/.inputrc"
18035 #: ../fish/guestfish.pod:1196
18036 msgid "/etc/inputrc"
18040 #: ../fish/guestfish.pod:1198
18042 "If compiled with GNU readline support, then these files can be used to "
18043 "configure readline. For further information, please see "
18044 "L<readline(3)/INITIALIZATION FILE>."
18048 #: ../fish/guestfish.pod:1202
18049 msgid "To write rules which only apply to guestfish, use:"
18053 #: ../fish/guestfish.pod:1204
18063 #: ../fish/guestfish.pod:1208
18065 "Variables that you can set in inputrc that change the behaviour of guestfish "
18066 "in useful ways include:"
18070 #: ../fish/guestfish.pod:1213
18071 msgid "completion-ignore-case (default: on)"
18075 #: ../fish/guestfish.pod:1215
18077 "By default, guestfish will ignore case when tab-completing paths on the "
18082 #: ../fish/guestfish.pod:1218
18085 " set completion-ignore-case off\n"
18090 #: ../fish/guestfish.pod:1220
18091 msgid "to make guestfish case sensitive."
18095 #: ../fish/guestfish.pod:1224
18100 #: ../fish/guestfish.pod:1226
18101 msgid "test2.img (etc)"
18105 #: ../fish/guestfish.pod:1228
18107 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18108 "will be created in the file C<test1.img> in the current directory. The "
18109 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18110 "the same name will be overwritten."
18114 #: ../fish/guestfish.pod:1237
18116 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, "
18117 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
18118 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
18119 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
18120 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
18121 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
18122 "L<febootstrap-supermin-helper(8)>."
18126 #: ../fish/guestfish.pod:1266 ../src/guestfs.pod:3120 ../test-tool/libguestfs-test-tool.pod:99
18127 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18131 #: ../fish/virt-copy-in.pod:5
18132 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
18136 #: ../fish/virt-copy-in.pod:9
18139 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18144 #: ../fish/virt-copy-in.pod:11
18147 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18152 #: ../fish/virt-copy-in.pod:15
18154 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18155 "causing disk corruption. The virtual machine must be shut down before you "
18156 "use this command."
18160 #: ../fish/virt-copy-in.pod:21
18162 "C<virt-copy-in> copies files and directories from the local disk into a "
18163 "virtual machine disk image or named libvirt domain."
18167 #: ../fish/virt-copy-in.pod:24
18169 "You can give one of more filenames and directories on the command line. "
18170 "Directories are copied in recursively. The final parameter must be the "
18171 "destination directory in the disk image which must be an absolute path "
18172 "starting with a C</> character."
18176 #: ../fish/virt-copy-in.pod:33
18179 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18184 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18185 msgid "Upload a home directory to a guest:"
18189 #: ../fish/virt-copy-in.pod:37
18192 " virt-copy-in -d MyGuest skel /home\n"
18197 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18198 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18202 #: ../fish/virt-copy-in.pod:41
18204 "This command is just a simple shell script wrapper around the "
18205 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
18206 "trivial copy, you are probably better off using guestfish directly."
18210 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18212 "Since the shell script just passes options straight to guestfish, read "
18213 "L<guestfish(1)> to see the full list of options."
18217 #: ../fish/virt-copy-in.pod:52
18219 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18220 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18224 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18225 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18229 #: ../fish/virt-copy-out.pod:5
18231 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18236 #: ../fish/virt-copy-out.pod:9
18239 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18244 #: ../fish/virt-copy-out.pod:11
18247 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18252 #: ../fish/virt-copy-out.pod:15
18254 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18255 "image or named libvirt domain."
18259 #: ../fish/virt-copy-out.pod:18
18261 "You can give one of more filenames and directories on the command line. "
18262 "Directories are copied out recursively."
18266 #: ../fish/virt-copy-out.pod:23
18267 msgid "Download the home directories from a virtual machine:"
18271 #: ../fish/virt-copy-out.pod:25
18275 " virt-copy-out -d MyGuest /home homes\n"
18280 #: ../fish/virt-copy-out.pod:30
18282 "This command is just a simple shell script wrapper around the "
18283 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
18284 "trivial copy, you are probably better off using guestfish directly."
18288 #: ../fish/virt-copy-out.pod:41
18290 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
18291 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18295 #: ../fish/virt-tar-in.pod:5
18296 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18300 #: ../fish/virt-tar-in.pod:9
18303 " virt-tar-in -a disk.img data.tar /destination\n"
18308 #: ../fish/virt-tar-in.pod:11
18311 " virt-tar-in -d domain data.tar /destination\n"
18316 #: ../fish/virt-tar-in.pod:13
18319 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18324 #: ../fish/virt-tar-in.pod:17
18326 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18327 "causing disk corruption. The virtual machine must be shut down before you "
18328 "use this command."
18332 #: ../fish/virt-tar-in.pod:23
18334 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18335 "image or named libvirt domain."
18339 #: ../fish/virt-tar-in.pod:26
18341 "The first parameter is the tar file. Use C<-> to read the tar file from "
18342 "standard input. The second parameter is the absolute target directory to "
18347 #: ../fish/virt-tar-in.pod:34
18350 " virt-tar-in -d MyGuest homes.tar /home\n"
18355 #: ../fish/virt-tar-in.pod:38
18357 "This command is just a simple shell script wrapper around the "
18358 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
18359 "copy, you are probably better off using guestfish directly."
18363 #: ../fish/virt-tar-in.pod:49
18365 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18366 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
18367 "L<http://libguestfs.org/>."
18371 #: ../fish/virt-tar-out.pod:5
18372 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
18376 #: ../fish/virt-tar-out.pod:9
18379 " virt-tar-out -a disk.img /dir files.tar\n"
18384 #: ../fish/virt-tar-out.pod:11
18387 " virt-tar-out -d domain /dir files.tar\n"
18392 #: ../fish/virt-tar-out.pod:13
18395 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
18400 #: ../fish/virt-tar-out.pod:17
18401 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
18405 #: ../fish/virt-tar-out.pod:20
18407 "The first parameter is the absolute path of the virtual machine directory. "
18408 "The second parameter is the tar file to write. Use C<-> to write to "
18413 #: ../fish/virt-tar-out.pod:26
18414 msgid "Download the home directories from a guest:"
18418 #: ../fish/virt-tar-out.pod:28
18421 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
18426 #: ../fish/virt-tar-out.pod:32
18428 "This command is just a simple shell script wrapper around the "
18429 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
18430 "trivial copy, you are probably better off using guestfish directly."
18434 #: ../fish/virt-tar-out.pod:43
18436 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18437 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
18441 #: ../fuse/guestmount.pod:5
18442 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
18446 #: ../fuse/guestmount.pod:9
18449 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
18454 #: ../fuse/guestmount.pod:11
18457 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
18462 #: ../fuse/guestmount.pod:13
18465 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
18470 #: ../fuse/guestmount.pod:17
18472 "You must I<not> use C<guestmount> in read-write mode on live virtual "
18473 "machines. If you do this, you risk disk corruption in the VM."
18477 #: ../fuse/guestmount.pod:22
18479 "The guestmount program can be used to mount virtual machine filesystems and "
18480 "other disk images on the host. It uses libguestfs for access to the guest "
18481 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
18482 "a mountable device."
18486 #: ../fuse/guestmount.pod:27
18488 "Along with other options, you have to give at least one device (I<-a> "
18489 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
18490 "option) or use the I<-i> inspection option. How this works is better "
18491 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
18496 #: ../fuse/guestmount.pod:33
18498 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
18499 "by you, and the filesystem will not be visible to any other users unless you "
18500 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
18501 "the filesystem, use the C<fusermount -u> command."
18505 #: ../fuse/guestmount.pod:41
18507 "For a typical Windows guest which has its main filesystem on the first "
18512 #: ../fuse/guestmount.pod:44
18515 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
18520 #: ../fuse/guestmount.pod:46
18522 "For a typical Linux guest which has a /boot filesystem on the first "
18523 "partition, and the root filesystem on a logical volume:"
18527 #: ../fuse/guestmount.pod:49
18530 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
18535 #: ../fuse/guestmount.pod:51
18536 msgid "To get libguestfs to detect guest mountpoints for you:"
18540 #: ../fuse/guestmount.pod:53
18543 " guestmount -a guest.img -i --ro /mnt\n"
18548 #: ../fuse/guestmount.pod:55
18549 msgid "For a libvirt guest called \"Guest\" you could do:"
18553 #: ../fuse/guestmount.pod:57
18556 " guestmount -d Guest -i --ro /mnt\n"
18561 #: ../fuse/guestmount.pod:59
18563 "If you don't know what filesystems are contained in a guest or disk image, "
18564 "use L<virt-filesystems(1)> first:"
18568 #: ../fuse/guestmount.pod:62
18571 " virt-filesystems MyGuest\n"
18576 #: ../fuse/guestmount.pod:64
18578 "If you want to trace the libguestfs calls but without excessive debugging "
18579 "information, we recommend:"
18583 #: ../fuse/guestmount.pod:67
18586 " guestmount [...] --trace /mnt\n"
18591 #: ../fuse/guestmount.pod:69
18592 msgid "If you want to debug the program, we recommend:"
18596 #: ../fuse/guestmount.pod:71
18599 " guestmount [...] --trace --verbose /mnt\n"
18604 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:544
18609 #: ../fuse/guestmount.pod:75
18610 msgid "Other users cannot see the filesystem by default"
18614 #: ../fuse/guestmount.pod:77
18616 "If you mount a filesystem as one user (eg. root), then other users will not "
18617 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
18618 "option when mounting:"
18622 #: ../fuse/guestmount.pod:81
18625 " sudo guestmount [...] -o allow_other /mnt\n"
18630 #: ../fuse/guestmount.pod:91
18631 msgid "Add a block device or virtual machine image."
18635 #: ../fuse/guestmount.pod:114
18636 msgid "B<--dir-cache-timeout N>"
18640 #: ../fuse/guestmount.pod:116
18642 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
18643 "seconds. The readdir cache [actually, there are several semi-independent "
18644 "caches] is populated after a readdir(2) call with the stat and extended "
18645 "attributes of the files in the directory, in anticipation that they will be "
18646 "requested soon after."
18650 #: ../fuse/guestmount.pod:122
18652 "There is also a different attribute cache implemented by FUSE (see the FUSE "
18653 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
18654 "requests, only cache existing ones."
18658 #: ../fuse/guestmount.pod:142
18660 "If you have untrusted raw-format guest disk images, you should use this "
18661 "option to specify the disk format. This avoids a possible security problem "
18662 "with malicious guests (CVE-2010-3851). See also "
18663 "L<guestfs(3)/guestfs_add_drive_opts>."
18667 #: ../fuse/guestmount.pod:147
18668 msgid "B<--fuse-help>"
18672 #: ../fuse/guestmount.pod:149
18673 msgid "Display help on special FUSE options (see I<-o> below)."
18677 #: ../fuse/guestmount.pod:153
18678 msgid "Display brief help and exit."
18682 #: ../fuse/guestmount.pod:177
18684 "Mount the named partition or logical volume on the given mountpoint B<in the "
18685 "guest> (this has nothing to do with mountpoints in the host)."
18689 #: ../fuse/guestmount.pod:180
18691 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
18692 "something on C</>."
18696 #: ../fuse/guestmount.pod:197
18698 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
18699 "unmounted. If you specify this option, then we don't attempt to sync the "
18700 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
18704 #: ../fuse/guestmount.pod:202
18705 msgid "B<-o option>"
18709 #: ../fuse/guestmount.pod:204
18710 msgid "B<--option option>"
18714 #: ../fuse/guestmount.pod:206
18715 msgid "Pass extra options to FUSE."
18719 #: ../fuse/guestmount.pod:208
18721 "To get a list of all the extra options supported by FUSE, use the command "
18722 "below. Note that only the FUSE I<-o> options can be passed, and only some "
18723 "of them are a good idea."
18727 #: ../fuse/guestmount.pod:212
18730 " guestmount --fuse-help\n"
18735 #: ../fuse/guestmount.pod:214
18736 msgid "Some potentially useful FUSE options:"
18740 #: ../fuse/guestmount.pod:218
18741 msgid "B<-o allow_other>"
18745 #: ../fuse/guestmount.pod:220
18746 msgid "Allow other users to see the filesystem."
18750 #: ../fuse/guestmount.pod:222
18751 msgid "B<-o attr_timeout=N>"
18755 #: ../fuse/guestmount.pod:224
18756 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
18760 #: ../fuse/guestmount.pod:226
18761 msgid "B<-o kernel_cache>"
18765 #: ../fuse/guestmount.pod:228
18767 "Allow the kernel to cache files (reduces the number of reads that have to go "
18768 "through the L<guestfs(3)> API). This is generally a good idea if you can "
18769 "afford the extra memory usage."
18773 #: ../fuse/guestmount.pod:232
18774 msgid "B<-o uid=N> B<-o gid=N>"
18778 #: ../fuse/guestmount.pod:234
18780 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
18781 "the chosen values."
18785 #: ../fuse/guestmount.pod:243
18787 "Add devices and mount everything read-only. Also disallow writes and make "
18788 "the disk appear read-only to FUSE."
18792 #: ../fuse/guestmount.pod:246
18794 "This is highly recommended if you are not going to edit the guest disk. If "
18795 "the guest is running and this option is I<not> supplied, then there is a "
18796 "strong risk of disk corruption in the guest. We try to prevent this from "
18797 "happening, but it is not always possible."
18801 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
18802 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
18806 #: ../fuse/guestmount.pod:255
18807 msgid "Enable SELinux support for the guest."
18811 #: ../fuse/guestmount.pod:261
18812 msgid "Enable verbose messages from underlying libguestfs."
18816 #: ../fuse/guestmount.pod:267
18817 msgid "Display the program version and exit."
18821 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299 ../rescue/virt-rescue.pod:197 ../rescue/virt-rescue.pod:280
18822 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
18826 #: ../fuse/guestmount.pod:280
18831 #: ../fuse/guestmount.pod:282
18832 msgid "Trace libguestfs calls and entry into each FUSE function."
18836 #: ../fuse/guestmount.pod:284
18837 msgid "This also stops the daemon from forking into the background."
18841 #: ../fuse/guestmount.pod:305
18843 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
18844 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
18845 "L<http://fuse.sf.net/>."
18849 #: ../fuse/guestmount.pod:320
18850 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
18854 #: ../inspector/virt-inspector.pod:5
18856 "virt-inspector - Display operating system version and other information "
18857 "about a virtual machine"
18861 #: ../inspector/virt-inspector.pod:9
18864 " virt-inspector [--options] -d domname\n"
18869 #: ../inspector/virt-inspector.pod:11
18872 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
18877 #: ../inspector/virt-inspector.pod:15
18880 " virt-inspector domname\n"
18885 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
18888 " virt-inspector disk.img [disk.img ...]\n"
18893 #: ../inspector/virt-inspector.pod:21
18895 "B<virt-inspector> examines a virtual machine or disk image and tries to "
18896 "determine the version of the operating system and other information about "
18897 "the virtual machine."
18901 #: ../inspector/virt-inspector.pod:25
18902 msgid "Virt-inspector produces XML output for feeding into other programs."
18906 #: ../inspector/virt-inspector.pod:27
18908 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
18909 "the libvirt domain (see: C<virsh list --all>)."
18913 #: ../inspector/virt-inspector.pod:30
18915 "You can also run virt-inspector directly on disk images from a single "
18916 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
18917 "has several block devices, in which case you should list several I<-a> "
18918 "options one after another, with the first corresponding to the guest's "
18919 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
18923 #: ../inspector/virt-inspector.pod:37
18925 "You can also run virt-inspector on install disks, live CDs, bootable USB "
18926 "keys and similar."
18930 #: ../inspector/virt-inspector.pod:40
18932 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
18933 "inspect several virtual machines, you have to run virt-inspector several "
18934 "times (for example, from a shell script for-loop)."
18938 #: ../inspector/virt-inspector.pod:45
18940 "Because virt-inspector needs direct access to guest images, it won't "
18941 "normally work over remote libvirt connections."
18945 #: ../inspector/virt-inspector.pod:48
18947 "All of the information available from virt-inspector is also available "
18948 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
18949 "The same information can also be fetched using guestfish or via libguestfs "
18950 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
18951 "WITH OTHER PROGRAMMING LANGUAGES>)."
18955 #: ../inspector/virt-inspector.pod:81
18957 "Libvirt is only used if you specify a C<domname> on the command line. If "
18958 "you specify guest block devices directly (I<-a>), then libvirt is not used "
18963 #: ../inspector/virt-inspector.pod:94
18965 "When prompting for keys and passphrases, virt-inspector normally turns "
18966 "echoing off so you cannot see what you are typing. If you are not worried "
18967 "about Tempest attacks and there is no one else in the room you can specify "
18968 "this flag to see what you are typing."
18972 #: ../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
18974 "Specify the format of disk images given on the command line. If this is "
18975 "omitted then the format is autodetected from the content of the disk image."
18979 #: ../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
18981 "If disk images are requested from libvirt, then this program asks libvirt "
18982 "for this information. In this case, the value of the format parameter is "
18987 #: ../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
18989 "If working with untrusted raw-format guest disk images, you should ensure "
18990 "the format is always specified."
18994 #: ../inspector/virt-inspector.pod:139
18995 msgid "Previous versions of virt-inspector allowed you to write either:"
18999 #: ../inspector/virt-inspector.pod:145
19002 " virt-inspector guestname\n"
19007 #: ../inspector/virt-inspector.pod:153
19012 #: ../inspector/virt-inspector.pod:155
19014 "The virt-inspector XML is described precisely in a RELAX NG schema file "
19015 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
19016 "just an overview."
19020 #: ../inspector/virt-inspector.pod:159
19022 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
19023 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
19024 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
19025 "which is vanishingly rare in real world VMs."
19029 #: ../inspector/virt-inspector.pod:164
19030 msgid "E<lt>operatingsystemE<gt>"
19034 #: ../inspector/virt-inspector.pod:166
19036 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
19037 "describe the operating system, its architecture, the descriptive \"product "
19038 "name\" string, the type of OS and so on, as in this example:"
19042 #: ../inspector/virt-inspector.pod:170
19045 " <operatingsystems>\n"
19046 " <operatingsystem>\n"
19047 " <root>/dev/sda2</root>\n"
19048 " <name>windows</name>\n"
19049 " <arch>i386</arch>\n"
19050 " <distro>windows</distro>\n"
19051 " <product_name>Windows 7 Enterprise</product_name>\n"
19052 " <product_variant>Client</product_variant>\n"
19053 " <major_version>6</major_version>\n"
19054 " <minor_version>1</minor_version>\n"
19055 " <windows_systemroot>/Windows</windows_systemroot>\n"
19056 " <format>installed</format>\n"
19061 #: ../inspector/virt-inspector.pod:183
19063 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
19064 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
19065 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
19066 "architecture. The other fields are fairly self-explanatory, but because "
19067 "these fields are taken directly from the libguestfs inspection API you can "
19068 "find precise information from L<guestfs(3)/INSPECTION>."
19072 #: ../inspector/virt-inspector.pod:191
19074 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
19075 "of view of libguestfs (block devices may have completely different names "
19076 "inside the VM itself)."
19080 #: ../inspector/virt-inspector.pod:195
19081 msgid "E<lt>mountpointsE<gt>"
19085 #: ../inspector/virt-inspector.pod:197
19087 "Un*x-like guests typically have multiple filesystems which are mounted at "
19088 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
19089 "element which looks like this:"
19093 #: ../inspector/virt-inspector.pod:201
19096 " <operatingsystems>\n"
19097 " <operatingsystem>\n"
19100 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19101 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19102 " </mountpoints>\n"
19107 #: ../inspector/virt-inspector.pod:209
19109 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19110 "and may have completely different names inside the guest. Only mountable "
19111 "filesystems appear in this list, not things like swap devices."
19115 #: ../inspector/virt-inspector.pod:214
19116 msgid "E<lt>filesystemsE<gt>"
19120 #: ../inspector/virt-inspector.pod:216
19122 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19123 "filesystems belonging to the guest, including swap and empty partitions. "
19124 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19125 "this OS or shared with this OS and other OSes)."
19129 #: ../inspector/virt-inspector.pod:222
19130 msgid "You might see something like this:"
19134 #: ../inspector/virt-inspector.pod:224
19137 " <operatingsystems>\n"
19138 " <operatingsystem>\n"
19141 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19142 " <type>ext4</type>\n"
19143 " <label>Fedora-13-x86_64</label>\n"
19144 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19150 #: ../inspector/virt-inspector.pod:234
19152 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19153 "the label, and the UUID."
19157 #: ../inspector/virt-inspector.pod:237
19158 msgid "E<lt>applicationsE<gt>"
19162 #: ../inspector/virt-inspector.pod:239
19164 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19165 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19170 #: ../inspector/virt-inspector.pod:243
19172 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19173 "Typical values would be C<rpm> and C<deb>."
19177 #: ../inspector/virt-inspector.pod:246
19179 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19180 "Typical values include C<yum>, C<up2date> and C<apt>"
19184 #: ../inspector/virt-inspector.pod:249
19185 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19189 #: ../inspector/virt-inspector.pod:252
19192 " <operatingsystems>\n"
19193 " <operatingsystem>\n"
19195 " <applications>\n"
19197 " <name>coreutils</name>\n"
19198 " <version>8.5</version>\n"
19199 " <release>1</release>\n"
19200 " </application>\n"
19205 #: ../inspector/virt-inspector.pod:262
19207 "The version and release fields may not be available for some types guests. "
19208 "Other fields are possible, see "
19209 "L<guestfs(3)/guestfs_inspect_list_applications>."
19213 #: ../inspector/virt-inspector.pod:266
19214 msgid "E<lt>drive_mappingsE<gt>"
19218 #: ../inspector/virt-inspector.pod:268
19220 "For operating systems like Windows which use drive letters, virt-inspector "
19221 "is able to find out how drive letters map to filesystems."
19225 #: ../inspector/virt-inspector.pod:272
19228 " <operatingsystems>\n"
19229 " <operatingsystem>\n"
19231 " <drive_mappings>\n"
19232 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19233 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19234 " </drive_mappings>\n"
19239 #: ../inspector/virt-inspector.pod:280
19241 "In the example above, drive C maps to the filesystem on the second partition "
19242 "on the first disk, and drive E maps to the filesystem on the first partition "
19243 "on the second disk."
19247 #: ../inspector/virt-inspector.pod:284
19249 "Note that this only covers permanent local filesystem mappings, not things "
19250 "like network shares. Furthermore NTFS volume mount points may not be listed "
19255 #: ../inspector/virt-inspector.pod:288
19256 msgid "E<lt>iconE<gt>"
19260 #: ../inspector/virt-inspector.pod:290
19262 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19263 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19264 "very large and high quality."
19268 #: ../inspector/virt-inspector.pod:294
19271 " <operatingsystems>\n"
19272 " <operatingsystem>\n"
19275 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19276 " [... many lines of base64 data ...]\n"
19282 #: ../inspector/virt-inspector.pod:302
19284 "To display the icon, you have to extract it and convert the base64 data back "
19285 "to a binary file. Use an XPath query or simply an editor to extract the "
19286 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19291 #: ../inspector/virt-inspector.pod:307
19294 " base64 -i -d < icon.data > icon.png\n"
19299 #: ../inspector/virt-inspector.pod:309
19300 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19304 #: ../inspector/virt-inspector.pod:311
19306 "Virt-inspector can detect some operating system installers on install disks, "
19307 "live CDs, bootable USB keys and more."
19311 #: ../inspector/virt-inspector.pod:314
19313 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19314 "fields may be present to indicate a live CD, network installer, or one part "
19315 "of a multipart CD. For example:"
19319 #: ../inspector/virt-inspector.pod:318
19322 " <operatingsystems>\n"
19323 " <operatingsystem>\n"
19324 " <root>/dev/sda</root>\n"
19325 " <name>linux</name>\n"
19326 " <arch>i386</arch>\n"
19327 " <distro>ubuntu</distro>\n"
19328 " <product_name>Ubuntu 10.10 "Maverick "
19329 "Meerkat"</product_name>\n"
19330 " <major_version>10</major_version>\n"
19331 " <minor_version>10</minor_version>\n"
19332 " <format>installer</format>\n"
19338 #: ../inspector/virt-inspector.pod:330
19339 msgid "USING XPATH"
19343 #: ../inspector/virt-inspector.pod:332
19345 "You can use the XPath query language, and/or the xpath tool, in order to "
19346 "select parts of the XML."
19350 #: ../inspector/virt-inspector.pod:337
19353 " $ virt-inspector -d Guest | xpath //filesystems\n"
19354 " Found 1 nodes:\n"
19357 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19358 " <type>ext4</type>\n"
19364 #: ../inspector/virt-inspector.pod:345
19367 " $ virt-inspector -d Guest | \\\n"
19368 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
19369 " Query didn't return a nodeset. Value: ext4\n"
19374 #: ../inspector/virt-inspector.pod:356
19375 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
19379 #: ../inspector/virt-inspector.pod:358
19381 "Early versions of libguestfs shipped with a different virt-inspector program "
19382 "written in Perl (the current version is written in C). The XML output of "
19383 "the Perl virt-inspector was different and it could also output in other "
19384 "formats like text."
19388 #: ../inspector/virt-inspector.pod:363
19389 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
19393 #: ../inspector/virt-inspector.pod:366
19395 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
19396 "versions of virt-inspector with different names:"
19400 #: ../inspector/virt-inspector.pod:369
19403 " virt-inspector Old Perl version.\n"
19404 " virt-inspector2 New C version.\n"
19409 #: ../inspector/virt-inspector.pod:374
19411 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
19412 "L<base64(1)>, L<http://libguestfs.org/>."
19416 #: ../inspector/virt-inspector.pod:390
19417 msgid "Matthew Booth L<mbooth@redhat.com>"
19421 #: ../java/examples/guestfs-java.pod:5
19422 msgid "guestfs-java - How to use libguestfs from Java"
19426 #: ../java/examples/guestfs-java.pod:9
19429 " import com.redhat.et.libguestfs.*;\n"
19434 #: ../java/examples/guestfs-java.pod:11
19437 " GuestFS g = new GuestFS ();\n"
19438 " g.add_drive_opts (\"disk.img\", null);\n"
19444 #: ../java/examples/guestfs-java.pod:17
19446 "This manual page documents how to call libguestfs from the Java programming "
19447 "language. This page just documents the differences from the C API and gives "
19448 "some examples. If you are not familiar with using libguestfs, you also need "
19449 "to read L<guestfs(3)>."
19453 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
19454 msgid "CLOSING THE HANDLE"
19458 #: ../java/examples/guestfs-java.pod:24
19460 "The handle is closed when it is reaped by the garbage collector. Because "
19461 "libguestfs handles include a lot of state, it is also possible to close (and "
19462 "hence free) them explicitly by calling the C<close> method."
19466 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
19471 #: ../java/examples/guestfs-java.pod:31
19473 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
19474 "exception. This has a single parameter which is the error message (a "
19479 #: ../java/examples/guestfs-java.pod:35
19480 msgid "Calling any method on a closed handle raises the same exception."
19484 #: ../java/examples/guestfs-java.pod:47
19486 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, "
19487 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
19488 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
19492 #: ../java/examples/guestfs-java.pod:63 ../perl/examples/guestfs-perl.pod:57
19493 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
19497 #: ../ocaml/examples/guestfs-ocaml.pod:5
19498 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
19502 #: ../ocaml/examples/guestfs-ocaml.pod:9
19503 msgid "Module style:"
19507 #: ../ocaml/examples/guestfs-ocaml.pod:11
19510 " let g = Guestfs.create () in\n"
19511 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19512 " Guestfs.launch g;\n"
19517 #: ../ocaml/examples/guestfs-ocaml.pod:15
19518 msgid "Object-oriented style:"
19522 #: ../ocaml/examples/guestfs-ocaml.pod:17
19525 " let g = new Guestfs.guestfs () in\n"
19526 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19532 #: ../ocaml/examples/guestfs-ocaml.pod:21
19535 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
19537 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
19542 #: ../ocaml/examples/guestfs-ocaml.pod:27
19544 "This manual page documents how to call libguestfs from the OCaml programming "
19545 "language. This page just documents the differences from the C API and gives "
19546 "some examples. If you are not familiar with using libguestfs, you also need "
19547 "to read L<guestfs(3)>."
19551 #: ../ocaml/examples/guestfs-ocaml.pod:32
19552 msgid "PROGRAMMING STYLES"
19556 #: ../ocaml/examples/guestfs-ocaml.pod:34
19558 "There are two different programming styles supported by the OCaml bindings. "
19559 "You can use a module style, with each C function mapped to an OCaml "
19564 #: ../ocaml/examples/guestfs-ocaml.pod:38
19567 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
19572 #: ../ocaml/examples/guestfs-ocaml.pod:40
19577 #: ../ocaml/examples/guestfs-ocaml.pod:42
19580 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
19585 #: ../ocaml/examples/guestfs-ocaml.pod:44
19587 "Alternately you can use an object-oriented style, calling methods on the "
19588 "class C<Guestfs.guestfs>:"
19592 #: ../ocaml/examples/guestfs-ocaml.pod:47
19595 " method set_verbose : bool -> unit\n"
19600 #: ../ocaml/examples/guestfs-ocaml.pod:49
19602 "The object-oriented style is usually briefer, and the minor performance "
19603 "penalty isn't noticable in the general overhead of performing libguestfs "
19608 #: ../ocaml/examples/guestfs-ocaml.pod:55
19610 "The handle is closed when it is reaped by the garbage collector. Because "
19611 "libguestfs handles include a lot of state, it is also possible to close (and "
19612 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
19617 #: ../ocaml/examples/guestfs-ocaml.pod:62
19619 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
19620 "exception. This has a single parameter which is the error message (a "
19625 #: ../ocaml/examples/guestfs-ocaml.pod:66
19627 "Calling any function/method on a closed handle raises "
19628 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
19633 #: ../ocaml/examples/guestfs-ocaml.pod:80
19635 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
19636 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
19637 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
19641 #: ../perl/examples/guestfs-perl.pod:5
19642 msgid "guestfs-perl - How to use libguestfs from Perl"
19646 #: ../perl/examples/guestfs-perl.pod:9
19649 " use Sys::Guestfs;\n"
19654 #: ../perl/examples/guestfs-perl.pod:11
19657 " my $h = Sys::Guestfs->new ();\n"
19658 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
19659 " $h->launch ();\n"
19660 " $h->mount_options ('', '/dev/sda1', '/');\n"
19661 " $h->touch ('/hello');\n"
19667 #: ../perl/examples/guestfs-perl.pod:20
19669 "This manual page documents how to call libguestfs from the Perl programming "
19670 "language. This page just documents the differences from the C API and gives "
19671 "some examples. If you are not familiar with using libguestfs, you also need "
19672 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
19676 #: ../perl/examples/guestfs-perl.pod:26
19681 #: ../perl/examples/guestfs-perl.pod:28
19683 "Errors from libguestfs functions turn into calls to C<croak> (see "
19688 #: ../perl/examples/guestfs-perl.pod:41
19690 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
19691 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
19692 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
19696 #: ../python/examples/guestfs-python.pod:5
19697 msgid "guestfs-python - How to use libguestfs from Python"
19701 #: ../python/examples/guestfs-python.pod:9
19704 " import guestfs\n"
19705 " g = guestfs.GuestFS ()\n"
19706 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
19712 #: ../python/examples/guestfs-python.pod:16
19714 "This manual page documents how to call libguestfs from the Python "
19715 "programming language. This page just documents the differences from the C "
19716 "API and gives some examples. If you are not familiar with using libguestfs, "
19717 "you also need to read L<guestfs(3)>."
19721 #: ../python/examples/guestfs-python.pod:23
19723 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
19724 "single string argument which is the error message."
19728 #: ../python/examples/guestfs-python.pod:26
19729 msgid "MORE DOCUMENTATION"
19733 #: ../python/examples/guestfs-python.pod:28
19738 #: ../python/examples/guestfs-python.pod:30
19742 " >>> import guestfs\n"
19743 " >>> help (guestfs)\n"
19748 #: ../python/examples/guestfs-python.pod:44
19750 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
19751 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
19752 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
19756 #: ../rescue/virt-rescue.pod:5
19757 msgid "virt-rescue - Run a rescue shell on a virtual machine"
19761 #: ../rescue/virt-rescue.pod:9
19764 " virt-rescue [--options] -d domname\n"
19769 #: ../rescue/virt-rescue.pod:11
19772 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
19777 #: ../rescue/virt-rescue.pod:15
19780 " virt-rescue [--options] domname\n"
19785 #: ../rescue/virt-rescue.pod:17
19788 " virt-rescue [--options] disk.img [disk.img ...]\n"
19793 #: ../rescue/virt-rescue.pod:21
19795 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
19796 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
19797 "you from doing this, but doesn't catch all cases."
19801 #: ../rescue/virt-rescue.pod:25
19803 "However if you use the I<--ro> (read only) option, then you can attach a "
19804 "shell to a live virtual machine. The results might be strange or "
19805 "inconsistent at times but you won't get disk corruption."
19809 #: ../rescue/virt-rescue.pod:31
19811 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
19812 "need for a CD. virt-rescue gives you a rescue shell and some simple "
19813 "recovery tools which you can use to examine or rescue a virtual machine or "
19818 #: ../rescue/virt-rescue.pod:36
19820 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
19821 "on disk image(s):"
19825 #: ../rescue/virt-rescue.pod:39
19828 " virt-rescue -d GuestName\n"
19833 #: ../rescue/virt-rescue.pod:41
19836 " virt-rescue --ro -a /path/to/disk.img\n"
19841 #: ../rescue/virt-rescue.pod:43
19844 " virt-rescue -a /dev/sdc\n"
19849 #: ../rescue/virt-rescue.pod:45
19850 msgid "For live VMs you I<must> use the --ro option."
19854 #: ../rescue/virt-rescue.pod:47
19856 "When you run virt-rescue on a virtual machine or disk image, you are placed "
19857 "in an interactive bash shell where you can use many ordinary Linux "
19858 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
19859 "appliance. You must mount the virtual machine's filesystems by hand. There "
19860 "is an empty directory called C</sysroot> where you can mount filesystems."
19864 #: ../rescue/virt-rescue.pod:54
19866 "In the example below, we list logical volumes, then choose one to mount "
19867 "under C</sysroot>:"
19871 #: ../rescue/virt-rescue.pod:57
19875 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
19876 " lv_root vg_f11x64 -wi-a- 8.83G\n"
19877 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
19878 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
19879 " ><rescue> ls /sysroot\n"
19884 #: ../rescue/virt-rescue.pod:64
19886 "If you don't know what filesystems are available on the virtual machine then "
19887 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
19891 #: ../rescue/virt-rescue.pod:70
19893 "Virt-rescue can be used on I<any> disk image file or device, not just a "
19894 "virtual machine. For example you can use it on a blank file if you want to "
19895 "partition that file (although we would recommend using L<guestfish(1)> "
19896 "instead as it is more suitable for this purpose). You can even use "
19897 "virt-rescue on things like SD cards."
19901 #: ../rescue/virt-rescue.pod:76
19903 "Virt-rescue does not require root. You only need to run it as root if you "
19904 "need root to open the disk image."
19908 #: ../rescue/virt-rescue.pod:79
19910 "This tool is just designed for quick interactive hacking on a virtual "
19911 "machine. For more structured access to a virtual machine disk image, you "
19912 "should use L<guestfs(3)>. To get a structured shell that you can use to "
19913 "make scripted changes to guests, use L<guestfish(1)>."
19917 #: ../rescue/virt-rescue.pod:103
19918 msgid "B<--append kernelopts>"
19922 #: ../rescue/virt-rescue.pod:105
19923 msgid "Pass additional options to the rescue kernel."
19927 #: ../rescue/virt-rescue.pod:135
19930 " virt-rescue --format=raw -a disk.img\n"
19935 #: ../rescue/virt-rescue.pod:139
19938 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
19943 #: ../rescue/virt-rescue.pod:148
19948 #: ../rescue/virt-rescue.pod:150
19949 msgid "B<--memsize MB>"
19953 #: ../rescue/virt-rescue.pod:152
19955 "Change the amount of memory allocated to the rescue system. The default is "
19956 "set by libguestfs and is small but adequate for running system tools. The "
19957 "occasional program might need more memory. The parameter is specified in "
19962 #: ../rescue/virt-rescue.pod:157
19963 msgid "B<--network>"
19967 #: ../rescue/virt-rescue.pod:159
19968 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
19972 #: ../rescue/virt-rescue.pod:165
19973 msgid "Open the image read-only."
19977 #: ../rescue/virt-rescue.pod:175
19979 "Enable SELinux in the rescue appliance. You should read "
19980 "L<guestfs(3)/SELINUX> before using this option."
19984 #: ../rescue/virt-rescue.pod:194
19986 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
19987 "are done read-write."
19991 #: ../rescue/virt-rescue.pod:207
19992 msgid "Previous versions of virt-rescue allowed you to write either:"
19996 #: ../rescue/virt-rescue.pod:209
19999 " virt-rescue disk.img [disk.img ...]\n"
20004 #: ../rescue/virt-rescue.pod:213
20007 " virt-rescue guestname\n"
20012 #: ../rescue/virt-rescue.pod:221
20017 #: ../rescue/virt-rescue.pod:223
20019 "Adding the I<--network> option enables QEMU user networking in the rescue "
20020 "appliance. There are some differences between user networking and ordinary "
20025 #: ../rescue/virt-rescue.pod:229
20026 msgid "ping does not work"
20030 #: ../rescue/virt-rescue.pod:231
20032 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
20033 "send the ping packets, and because virt-rescue must be able to run as "
20034 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
20035 "command. The ping command will appear to resolve addresses but will not be "
20036 "able to send or receive any packets. This does not mean that the network is "
20041 #: ../rescue/virt-rescue.pod:238
20042 msgid "cannot receive connections"
20046 #: ../rescue/virt-rescue.pod:240
20047 msgid "QEMU user networking cannot receive incoming connections."
20051 #: ../rescue/virt-rescue.pod:242
20052 msgid "making TCP connections"
20056 #: ../rescue/virt-rescue.pod:244
20058 "The virt-rescue appliance needs to be small and so does not include many "
20059 "network tools. In particular there is no L<telnet(1)> command. You can "
20060 "make TCP connections from the shell using the magical "
20061 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
20065 #: ../rescue/virt-rescue.pod:249
20068 " exec 3<>/dev/tcp/redhat.com/80\n"
20069 " echo \"GET /\" >&3\n"
20075 #: ../rescue/virt-rescue.pod:253
20076 msgid "See L<bash(1)> for more details."
20080 #: ../rescue/virt-rescue.pod:259
20082 "Several environment variables affect virt-rescue. See "
20083 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
20087 #: ../rescue/virt-rescue.pod:286
20089 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20090 "L<http://libguestfs.org/>."
20094 #: ../resize/virt-resize.pod:5
20095 msgid "virt-resize - Resize a virtual machine disk"
20099 #: ../resize/virt-resize.pod:9
20102 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20103 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20104 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20109 #: ../resize/virt-resize.pod:15
20111 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20112 "larger or smaller overall, and resizing or deleting any partitions contained "
20117 #: ../resize/virt-resize.pod:19
20119 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20120 "not> be used on live virtual machines - for consistent results, shut the "
20121 "virtual machine down before resizing it."
20125 #: ../resize/virt-resize.pod:23
20127 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20128 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20132 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520 ../src/guestfs.pod:469 ../src/guestfs.pod:1257 ../src/guestfs.pod:1396 ../src/guestfs.pod:2481
20137 #: ../resize/virt-resize.pod:33
20139 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20140 "fill the extra 5GB of space."
20144 #: ../resize/virt-resize.pod:36
20147 " virt-filesystems --long -h --all -a olddisk\n"
20152 #: ../resize/virt-resize.pod:38
20155 " truncate -r olddisk newdisk\n"
20156 " truncate -s +5G newdisk\n"
20161 #: ../resize/virt-resize.pod:41
20164 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20165 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20170 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527 ../src/guestfs.pod:475 ../src/guestfs.pod:1261 ../src/guestfs.pod:1400 ../src/guestfs.pod:2506
20175 #: ../resize/virt-resize.pod:46
20177 "As above, but make the /boot partition 200MB bigger, while giving the "
20178 "remaining space to /dev/sda2:"
20182 #: ../resize/virt-resize.pod:49
20185 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20186 " olddisk newdisk\n"
20191 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533 ../src/guestfs.pod:486 ../src/guestfs.pod:1406
20196 #: ../resize/virt-resize.pod:54
20198 "As in the first example, but expand a logical volume as the final step. "
20199 "This is what you would typically use for Linux guests that use LVM:"
20203 #: ../resize/virt-resize.pod:58
20206 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20207 " olddisk newdisk\n"
20212 #: ../resize/virt-resize.pod:61
20217 #: ../resize/virt-resize.pod:63
20219 "As in the first example, but the output format will be qcow2 instead of a "
20224 #: ../resize/virt-resize.pod:66
20227 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20228 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20233 #: ../resize/virt-resize.pod:71
20234 msgid "DETAILED USAGE"
20238 #: ../resize/virt-resize.pod:73
20239 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20243 #: ../resize/virt-resize.pod:77
20244 msgid "1. Shut down the virtual machine"
20248 #: ../resize/virt-resize.pod:79
20249 msgid "2. Locate input disk image"
20253 #: ../resize/virt-resize.pod:81
20255 "Locate the input disk image (ie. the file or device on the host containing "
20256 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20257 "dumpxml> like this to find the disk image name:"
20261 #: ../resize/virt-resize.pod:85
20264 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20265 " Found 1 nodes:\n"
20267 " <source dev=\"/dev/vg/lv_guest\" />\n"
20272 #: ../resize/virt-resize.pod:90
20273 msgid "3. Look at current sizing"
20277 #: ../resize/virt-resize.pod:92
20278 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20282 #: ../resize/virt-resize.pod:95
20285 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20286 " Name Type Size Parent\n"
20287 " /dev/sda1 partition 101M /dev/sda\n"
20288 " /dev/sda2 partition 7.9G /dev/sda\n"
20289 " /dev/sda device 8.0G -\n"
20294 #: ../resize/virt-resize.pod:101
20296 "(This example is a virtual machine with an 8 GB disk which we would like to "
20297 "expand up to 10 GB)."
20301 #: ../resize/virt-resize.pod:104
20302 msgid "4. Create output disk"
20306 #: ../resize/virt-resize.pod:106
20308 "Virt-resize cannot do in-place disk modifications. You have to have space "
20309 "to store the resized output disk."
20313 #: ../resize/virt-resize.pod:109
20314 msgid "To store the resized disk image in a file, create a file of a suitable size:"
20318 #: ../resize/virt-resize.pod:112
20321 " # rm -f outdisk\n"
20322 " # truncate -s 10G outdisk\n"
20327 #: ../resize/virt-resize.pod:115
20328 msgid "Or use L<lvcreate(1)> to create a logical volume:"
20332 #: ../resize/virt-resize.pod:117
20335 " # lvcreate -L 10G -n lv_name vg_name\n"
20340 #: ../resize/virt-resize.pod:119
20341 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
20345 #: ../resize/virt-resize.pod:121
20348 " # virsh pool-list\n"
20349 " # virsh vol-create-as poolname newvol 10G\n"
20354 #: ../resize/virt-resize.pod:124
20359 #: ../resize/virt-resize.pod:126
20361 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
20362 "file) and the output disk. The output disk is the one created in the "
20367 #: ../resize/virt-resize.pod:130
20370 " # virt-resize indisk outdisk\n"
20375 #: ../resize/virt-resize.pod:132
20377 "This command just copies disk image C<indisk> to disk image C<outdisk> "
20378 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
20379 "larger, then an extra, empty partition is created at the end of the disk "
20380 "covering the extra space. If C<outdisk> is smaller, then it will give an "
20385 #: ../resize/virt-resize.pod:138
20387 "More realistically you'd want to expand existing partitions in the disk "
20388 "image by passing extra options (for the full list see the L</OPTIONS> "
20393 #: ../resize/virt-resize.pod:142
20395 "L</--expand> is the most useful option. It expands the named partition "
20396 "within the disk to fill any extra space:"
20400 #: ../resize/virt-resize.pod:145
20403 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
20408 #: ../resize/virt-resize.pod:147
20410 "(In this case, an extra partition is I<not> created at the end of the disk, "
20411 "because there will be no unused space)."
20415 #: ../resize/virt-resize.pod:150
20417 "L</--resize> is the other commonly used option. The following would "
20418 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
20419 "rest of the available space:"
20423 #: ../resize/virt-resize.pod:154
20426 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20427 " indisk outdisk\n"
20432 #: ../resize/virt-resize.pod:157
20434 "If the expanded partition in the image contains a filesystem or LVM PV, then "
20435 "if virt-resize knows how, it will resize the contents, the equivalent of "
20436 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
20437 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
20438 "filesystems, so you would have to online resize them after booting the "
20443 #: ../resize/virt-resize.pod:164
20444 msgid "Other options are covered below."
20448 #: ../resize/virt-resize.pod:166
20453 #: ../resize/virt-resize.pod:168
20454 msgid "Thoroughly test the new disk image I<before> discarding the old one."
20458 #: ../resize/virt-resize.pod:170
20459 msgid "If you are using libvirt, edit the XML to point at the new disk:"
20463 #: ../resize/virt-resize.pod:172
20466 " # virsh edit guestname\n"
20471 #: ../resize/virt-resize.pod:174
20473 "Change E<lt>source ...E<gt>, see "
20474 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
20478 #: ../resize/virt-resize.pod:177
20479 msgid "Then start up the domain with the new, resized disk:"
20483 #: ../resize/virt-resize.pod:179
20486 " # virsh start guestname\n"
20491 #: ../resize/virt-resize.pod:181
20493 "and check that it still works. See also the L</NOTES> section below for "
20494 "additional information."
20498 #: ../resize/virt-resize.pod:184
20499 msgid "7. Resize LVs etc inside the guest"
20503 #: ../resize/virt-resize.pod:186
20504 msgid "(This can also be done offline using L<guestfish(1)>)"
20508 #: ../resize/virt-resize.pod:188
20510 "Once the guest has booted you should see the new space available, at least "
20511 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
20512 "may need to resize LVs inside PVs, and also resize filesystem types that "
20513 "virt-resize does not know how to expand."
20517 #: ../resize/virt-resize.pod:195
20518 msgid "SHRINKING A VIRTUAL MACHINE DISK"
20522 #: ../resize/virt-resize.pod:197
20524 "Shrinking is somewhat more complex than expanding, and only an overview is "
20529 #: ../resize/virt-resize.pod:200
20531 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
20532 "filesystems). The user has to shrink content before passing the disk image "
20533 "to virt-resize, and virt-resize will check that the content has been shrunk "
20538 #: ../resize/virt-resize.pod:205
20539 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
20543 #: ../resize/virt-resize.pod:207
20545 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
20546 "steps 3 and 4 above to allocate a new disk image."
20550 #: ../resize/virt-resize.pod:210
20551 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
20555 #: ../resize/virt-resize.pod:213
20556 msgid "IGNORING OR DELETING PARTITIONS"
20560 #: ../resize/virt-resize.pod:215
20562 "virt-resize also gives a convenient way to ignore or delete partitions when "
20563 "copying from the input disk to the output disk. Ignoring a partition speeds "
20564 "up the copy where you don't care about the existing contents of a "
20565 "partition. Deleting a partition removes it completely, but note that it "
20566 "also renumbers any partitions after the one which is deleted, which can "
20567 "leave some guests unbootable."
20571 #: ../resize/virt-resize.pod:222
20572 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
20576 #: ../resize/virt-resize.pod:224
20578 "If the input disk is in qcow2 format, then you may prefer that the output is "
20579 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
20580 "the fly. The output format is simply determined by the format of the empty "
20581 "output container that you provide. Thus to create qcow2 output, use:"
20585 #: ../resize/virt-resize.pod:230
20588 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
20593 #: ../resize/virt-resize.pod:232
20594 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
20598 #: ../resize/virt-resize.pod:234
20599 msgid "Similarly, to get non-sparse raw output use:"
20603 #: ../resize/virt-resize.pod:236
20606 " fallocate -l size outdisk\n"
20611 #: ../resize/virt-resize.pod:238
20613 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
20614 "if=/dev/zero of=outdisk bs=1M count=..>)"
20618 #: ../resize/virt-resize.pod:247
20619 msgid "Display help."
20623 #: ../resize/virt-resize.pod:249
20628 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
20633 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
20634 msgid "Enable debugging messages."
20638 #: ../resize/virt-resize.pod:255
20639 msgid "B<--delete part>"
20643 #: ../resize/virt-resize.pod:257
20645 "Delete the named partition. It would be more accurate to describe this as "
20646 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
20647 "the original disk image is left intact."
20651 #: ../resize/virt-resize.pod:261
20653 "Note that when you delete a partition, then anything contained in the "
20654 "partition is also deleted. Furthermore, this causes any partitions that "
20655 "come after to be I<renumbered>, which can easily make your guest unbootable."
20659 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327 ../resize/virt-resize.pod:454
20660 msgid "You can give this option multiple times."
20664 #: ../resize/virt-resize.pod:268
20665 msgid "B<--expand part>"
20669 #: ../resize/virt-resize.pod:270
20671 "Expand the named partition so it uses up all extra space (space left over "
20672 "after any other resize changes that you request have been done)."
20676 #: ../resize/virt-resize.pod:273
20678 "If virt-resize knows how, it will expand the direct content of the "
20679 "partition. For example, if the partition is an LVM PV, it will expand the "
20680 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
20681 "content it doesn't know about alone."
20685 #: ../resize/virt-resize.pod:278
20686 msgid "Currently virt-resize can resize:"
20690 #: ../resize/virt-resize.pod:284
20691 msgid "ext2, ext3 and ext4 filesystems."
20695 #: ../resize/virt-resize.pod:288
20696 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
20700 #: ../resize/virt-resize.pod:290
20702 "The filesystem must have been shut down consistently last time it was used. "
20703 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
20704 "consistency check, so at the first boot after resizing Windows will check "
20709 #: ../resize/virt-resize.pod:297
20711 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
20712 "inside the PV, but see the I<--LV-expand> option. The user could also "
20713 "resize LVs as desired after boot."
20717 #: ../resize/virt-resize.pod:303
20718 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
20722 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
20723 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
20727 #: ../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
20728 msgid "B<--format> raw"
20732 #: ../resize/virt-resize.pod:311
20734 "Specify the format of the input disk image. If this flag is not given then "
20735 "it is auto-detected from the image itself."
20739 #: ../resize/virt-resize.pod:317
20741 "Note that this option I<does not> affect the output format. See L</QCOW2 "
20742 "AND NON-SPARSE RAW FORMATS>."
20746 #: ../resize/virt-resize.pod:320
20747 msgid "B<--ignore part>"
20751 #: ../resize/virt-resize.pod:322
20753 "Ignore the named partition. Effectively this means the partition is "
20754 "allocated on the destination disk, but the content is not copied across from "
20755 "the source disk. The content of the partition will be blank (all zero "
20760 #: ../resize/virt-resize.pod:329
20761 msgid "B<--LV-expand logvol>"
20765 #: ../resize/virt-resize.pod:331
20767 "This takes the logical volume and, as a final step, expands it to fill all "
20768 "the space available in its volume group. A typical usage, assuming a Linux "
20769 "guest with a single PV C</dev/sda2> and a root device called "
20770 "C</dev/vg_guest/lv_root> would be:"
20774 #: ../resize/virt-resize.pod:336
20777 " virt-resize indisk outdisk \\\n"
20778 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
20783 #: ../resize/virt-resize.pod:339
20785 "This would first expand the partition (and PV), and then expand the root "
20786 "device to fill the extra space in the PV."
20790 #: ../resize/virt-resize.pod:342
20792 "The contents of the LV are also resized if virt-resize knows how to do "
20793 "that. You can stop virt-resize from trying to expand the content by using "
20794 "the option I<--no-expand-content>."
20798 #: ../resize/virt-resize.pod:346
20799 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
20803 #: ../resize/virt-resize.pod:348
20805 "You can give this option multiple times, I<but> it doesn't make sense to do "
20806 "this unless the logical volumes you specify are all in different volume "
20811 #: ../resize/virt-resize.pod:352
20812 msgid "B<--machine-readable>"
20816 #: ../resize/virt-resize.pod:354
20818 "This option is used to make the output more machine friendly when being "
20819 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
20823 #: ../resize/virt-resize.pod:360
20824 msgid "B<--dryrun>"
20828 #: ../resize/virt-resize.pod:362
20829 msgid "Print a summary of what would be done, but don't do anything."
20833 #: ../resize/virt-resize.pod:364
20834 msgid "B<--no-copy-boot-loader>"
20838 #: ../resize/virt-resize.pod:366
20840 "By default, virt-resize copies over some sectors at the start of the disk "
20841 "(up to the beginning of the first partition). Commonly these sectors "
20842 "contain the Master Boot Record (MBR) and the boot loader, and are required "
20843 "in order for the guest to boot correctly."
20847 #: ../resize/virt-resize.pod:371
20849 "If you specify this flag, then this initial copy is not done. You may need "
20850 "to reinstall the boot loader in this case."
20854 #: ../resize/virt-resize.pod:374
20855 msgid "B<--no-extra-partition>"
20859 #: ../resize/virt-resize.pod:376
20861 "By default, virt-resize creates an extra partition if there is any extra, "
20862 "unused space after all resizing has happened. Use this option to prevent "
20863 "the extra partition from being created. If you do this then the extra space "
20864 "will be inaccessible until you run fdisk, parted, or some other partitioning "
20865 "tool in the guest."
20869 #: ../resize/virt-resize.pod:382
20871 "Note that if the surplus space is smaller than 10 MB, no extra partition "
20876 #: ../resize/virt-resize.pod:385
20877 msgid "B<--no-expand-content>"
20881 #: ../resize/virt-resize.pod:387
20883 "By default, virt-resize will try to expand the direct contents of "
20884 "partitions, if it knows how (see I<--expand> option above)."
20888 #: ../resize/virt-resize.pod:390
20890 "If you give the I<--no-expand-content> option then virt-resize will not "
20895 #: ../resize/virt-resize.pod:393
20896 msgid "B<--ntfsresize-force>"
20900 #: ../resize/virt-resize.pod:395
20902 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
20903 "the NTFS disk is marked as needing a consistency check. You have to use "
20904 "this option if you want to resize a Windows guest multiple times without "
20905 "booting into Windows between each resize."
20909 #: ../resize/virt-resize.pod:401
20910 msgid "B<--output-format> raw"
20914 #: ../resize/virt-resize.pod:403
20916 "Specify the format of the output disk image. If this flag is not given then "
20917 "it is auto-detected from the image itself."
20921 #: ../resize/virt-resize.pod:409
20923 "Note that this option I<does not create> the output format. This option "
20924 "just tells libguestfs what it is so it doesn't try to guess it. You still "
20925 "need to create the output disk with the right format. See L</QCOW2 AND "
20926 "NON-SPARSE RAW FORMATS>."
20930 #: ../resize/virt-resize.pod:414
20935 #: ../resize/virt-resize.pod:416
20940 #: ../resize/virt-resize.pod:418
20941 msgid "Don't print the summary."
20945 #: ../resize/virt-resize.pod:420
20946 msgid "B<--resize part=size>"
20950 #: ../resize/virt-resize.pod:422
20952 "Resize the named partition (expanding or shrinking it) so that it has the "
20957 #: ../resize/virt-resize.pod:425
20959 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
20960 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
20961 "size; or as a relative number or percentage. For example:"
20965 #: ../resize/virt-resize.pod:431
20968 " --resize /dev/sda2=10G\n"
20973 #: ../resize/virt-resize.pod:433
20976 " --resize /dev/sda4=90%\n"
20981 #: ../resize/virt-resize.pod:435
20984 " --resize /dev/sda2=+1G\n"
20989 #: ../resize/virt-resize.pod:437
20992 " --resize /dev/sda2=-200M\n"
20997 #: ../resize/virt-resize.pod:439
21000 " --resize /dev/sda1=+128K\n"
21005 #: ../resize/virt-resize.pod:441
21008 " --resize /dev/sda1=+10%\n"
21013 #: ../resize/virt-resize.pod:443
21016 " --resize /dev/sda1=-10%\n"
21021 #: ../resize/virt-resize.pod:445
21023 "You can increase the size of any partition. Virt-resize will expand the "
21024 "direct content of the partition if it knows how (see I<--expand> below)."
21028 #: ../resize/virt-resize.pod:449
21030 "You can only I<decrease> the size of partitions that contain filesystems or "
21031 "PVs which have already been shrunk. Virt-resize will check this has been "
21032 "done before proceeding, or else will print an error (see also "
21033 "I<--resize-force>)."
21037 #: ../resize/virt-resize.pod:456
21038 msgid "B<--resize-force part=size>"
21042 #: ../resize/virt-resize.pod:458
21044 "This is the same as I<--resize> except that it will let you decrease the "
21045 "size of any partition. Generally this means you will lose any data which "
21046 "was at the end of the partition you shrink, but you may not care about that "
21047 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
21048 "as a swap partition)."
21052 #: ../resize/virt-resize.pod:464
21053 msgid "See also the I<--ignore> option."
21057 #: ../resize/virt-resize.pod:466
21058 msgid "B<--shrink part>"
21062 #: ../resize/virt-resize.pod:468
21064 "Shrink the named partition until the overall disk image fits in the "
21065 "destination. The named partition B<must> contain a filesystem or PV which "
21066 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
21067 "online tools). Virt-resize will check this and give an error if it has not "
21072 #: ../resize/virt-resize.pod:474
21074 "The amount by which the overall disk must be shrunk (after carrying out all "
21075 "other operations requested by the user) is called the \"deficit\". For "
21076 "example, a straight copy (assume no other operations) from a 5GB disk image "
21077 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
21078 "would give an error unless the user specified a partition to shrink and that "
21079 "partition had more than a gigabyte of free space."
21083 #: ../resize/virt-resize.pod:492
21084 msgid "MACHINE READABLE OUTPUT"
21088 #: ../resize/virt-resize.pod:494
21090 "The I<--machine-readable> option can be used to make the output more machine "
21091 "friendly, which is useful when calling virt-resize from other programs, GUIs "
21096 #: ../resize/virt-resize.pod:498
21097 msgid "There are two ways to use this option."
21101 #: ../resize/virt-resize.pod:500
21103 "Firstly use the option on its own to query the capabilities of the "
21104 "virt-resize binary. Typical output looks like this:"
21108 #: ../resize/virt-resize.pod:503
21111 " $ virt-resize --machine-readable\n"
21113 " ntfsresize-force\n"
21121 #: ../resize/virt-resize.pod:510
21123 "A list of features is printed, one per line, and the program exits with "
21128 #: ../resize/virt-resize.pod:513
21130 "Secondly use the option in conjunction with other options to make the "
21131 "regular program output more machine friendly."
21135 #: ../resize/virt-resize.pod:516
21136 msgid "At the moment this means:"
21140 #: ../resize/virt-resize.pod:522
21142 "Progress bar messages can be parsed from stdout by looking for this regular "
21147 #: ../resize/virt-resize.pod:525
21150 " ^[0-9]+/[0-9]+$\n"
21155 #: ../resize/virt-resize.pod:529
21157 "The calling program should treat messages sent to stdout (except for "
21158 "progress bar messages) as status messages. They can be logged and/or "
21159 "displayed to the user."
21163 #: ../resize/virt-resize.pod:535
21165 "The calling program should treat messages sent to stderr as error messages. "
21166 "In addition, virt-resize exits with a non-zero status code if there was a "
21171 #: ../resize/virt-resize.pod:541
21173 "Versions of the program prior to 1.13.9 did not support the "
21174 "I<--machine-readable> option and will return an error."
21178 #: ../resize/virt-resize.pod:546
21179 msgid "\"Partition 1 does not end on cylinder boundary.\""
21183 #: ../resize/virt-resize.pod:548
21185 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
21186 "means the partitions will not be aligned to the ancient CHS geometry. "
21187 "However CHS geometry is meaningless for disks manufactured since the early "
21188 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
21189 "cylinders is not required by any modern operating system."
21193 #: ../resize/virt-resize.pod:555
21194 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
21198 #: ../resize/virt-resize.pod:557
21200 "In Windows Vista and later versions, Microsoft switched to using a separate "
21201 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
21202 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
21203 "the boot partition. Doing so seems to break the guest completely. However "
21204 "expanding the second partition (ie. C: drive) should work."
21208 #: ../resize/virt-resize.pod:564
21210 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21211 "NTFS partitions have been expanded. This is just a safety check and (unless "
21212 "it find errors) is nothing to worry about."
21216 #: ../resize/virt-resize.pod:568
21217 msgid "GUEST BOOT STUCK AT \"GRUB\""
21221 #: ../resize/virt-resize.pod:570
21223 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21224 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21225 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21226 "although we think is to do with partition alignment."
21230 #: ../resize/virt-resize.pod:575
21233 " guestfish -i -a newdisk\n"
21234 " ><fs> cat /boot/grub/device.map\n"
21235 " # check the contents of this file are sensible or\n"
21236 " # edit the file if necessary\n"
21237 " ><fs> grub-install / /dev/vda\n"
21243 #: ../resize/virt-resize.pod:582
21245 "For more flexible guest reconfiguration, including if you need to specify "
21246 "other parameters to grub-install, use L<virt-rescue(1)>."
21250 #: ../resize/virt-resize.pod:585
21251 msgid "ALTERNATIVE TOOLS"
21255 #: ../resize/virt-resize.pod:587
21257 "There are several proprietary tools for resizing partitions. We won't "
21258 "mention any here."
21262 #: ../resize/virt-resize.pod:590
21264 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21265 "operations on disk images. They can resize and move partitions, but I don't "
21266 "think they can do anything with the contents, and they certainly don't "
21271 #: ../resize/virt-resize.pod:595
21273 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21274 "but at a much lower level. You will probably end up hand-calculating sector "
21275 "offsets, which is something that virt-resize was designed to avoid. If you "
21276 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21281 #: ../resize/virt-resize.pod:610
21283 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
21284 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
21285 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
21286 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
21287 "L<http://libguestfs.org/>."
21291 #: ../ruby/examples/guestfs-ruby.pod:5
21292 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21296 #: ../ruby/examples/guestfs-ruby.pod:9
21299 " require 'guestfs'\n"
21300 " g = Guestfs::Guestfs.new()\n"
21301 " g.add_drive_opts(\"disk.img\",\n"
21302 " :readonly => 1, :format => \"raw\")\n"
21308 #: ../ruby/examples/guestfs-ruby.pod:17
21310 "This manual page documents how to call libguestfs from the Ruby programming "
21311 "language. This page just documents the differences from the C API and gives "
21312 "some examples. If you are not familiar with using libguestfs, you also need "
21313 "to read L<guestfs(3)>."
21317 #: ../ruby/examples/guestfs-ruby.pod:24
21319 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21320 "This has a single parameter which is the error message (a string)."
21324 #: ../ruby/examples/guestfs-ruby.pod:38
21326 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
21327 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21328 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
21332 #: ../src/guestfs-actions.pod:1
21333 msgid "guestfs_add_cdrom"
21337 #: ../src/guestfs-actions.pod:3
21341 " guestfs_add_cdrom (guestfs_h *g,\n"
21342 " const char *filename);\n"
21347 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
21349 "I<This function is deprecated.> In new code, use the "
21350 "L</guestfs_add_drive_opts> call instead."
21354 #: ../src/guestfs-actions.pod:24
21356 "This call checks for the existence of C<filename>. This stops you from "
21357 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21358 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21363 #: ../src/guestfs-actions.pod:31
21365 "If you just want to add an ISO file (often you use this as an efficient way "
21366 "to transfer large files into the guest), then you should probably use "
21367 "C<guestfs_add_drive_ro> instead."
21371 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280 ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307 ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447 ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506 ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552 ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652 ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681 ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826 ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046 ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084 ../src/guestfs-actions.pod: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:1520 ../src/guestfs-actions.pod:1547 ../src/guestfs-actions.pod:1762 ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1871 ../src/guestfs-actions.pod:2346 ../src/guestfs-actions.pod:2490 ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2586 ../src/guestfs-actions.pod:3626 ../src/guestfs-actions.pod:3641 ../src/guestfs-actions.pod:3666 ../src/guestfs-actions.pod:3855 ../src/guestfs-actions.pod:3869 ../src/guestfs-actions.pod:3882 ../src/guestfs-actions.pod:3896 ../src/guestfs-actions.pod:3911 ../src/guestfs-actions.pod:3947 ../src/guestfs-actions.pod:4019 ../src/guestfs-actions.pod:4039 ../src/guestfs-actions.pod:4056 ../src/guestfs-actions.pod:4079 ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:4137 ../src/guestfs-actions.pod:4156 ../src/guestfs-actions.pod:4175 ../src/guestfs-actions.pod:4210 ../src/guestfs-actions.pod:4222 ../src/guestfs-actions.pod:4258 ../src/guestfs-actions.pod:4274 ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4302 ../src/guestfs-actions.pod:4319 ../src/guestfs-actions.pod:4412 ../src/guestfs-actions.pod:4432 ../src/guestfs-actions.pod:4445 ../src/guestfs-actions.pod:4496 ../src/guestfs-actions.pod:4514 ../src/guestfs-actions.pod:4532 ../src/guestfs-actions.pod:4548 ../src/guestfs-actions.pod:4562 ../src/guestfs-actions.pod:4576 ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4608 ../src/guestfs-actions.pod:4635 ../src/guestfs-actions.pod:4698 ../src/guestfs-actions.pod:4771 ../src/guestfs-actions.pod:4802 ../src/guestfs-actions.pod:4821 ../src/guestfs-actions.pod:4840 ../src/guestfs-actions.pod:4852 ../src/guestfs-actions.pod:4869 ../src/guestfs-actions.pod:4882 ../src/guestfs-actions.pod:4897 ../src/guestfs-actions.pod:4912 ../src/guestfs-actions.pod:4954 ../src/guestfs-actions.pod:4980 ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5053 ../src/guestfs-actions.pod:5070 ../src/guestfs-actions.pod:5119 ../src/guestfs-actions.pod:5172 ../src/guestfs-actions.pod:5219 ../src/guestfs-actions.pod:5262 ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5307 ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:5522 ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:5594 ../src/guestfs-actions.pod:5660 ../src/guestfs-actions.pod:5677 ../src/guestfs-actions.pod:5690 ../src/guestfs-actions.pod:5704 ../src/guestfs-actions.pod:5993 ../src/guestfs-actions.pod:6012 ../src/guestfs-actions.pod:6031 ../src/guestfs-actions.pod:6045 ../src/guestfs-actions.pod:6057 ../src/guestfs-actions.pod:6071 ../src/guestfs-actions.pod:6083 ../src/guestfs-actions.pod:6097 ../src/guestfs-actions.pod:6113 ../src/guestfs-actions.pod:6134 ../src/guestfs-actions.pod:6153 ../src/guestfs-actions.pod:6172 ../src/guestfs-actions.pod:6202 ../src/guestfs-actions.pod:6220 ../src/guestfs-actions.pod:6243 ../src/guestfs-actions.pod:6261 ../src/guestfs-actions.pod:6280 ../src/guestfs-actions.pod:6301 ../src/guestfs-actions.pod:6320 ../src/guestfs-actions.pod:6337 ../src/guestfs-actions.pod:6356 ../src/guestfs-actions.pod:6384 ../src/guestfs-actions.pod:6408 ../src/guestfs-actions.pod:6427 ../src/guestfs-actions.pod:6451 ../src/guestfs-actions.pod:6470 ../src/guestfs-actions.pod:6485 ../src/guestfs-actions.pod:6504 ../src/guestfs-actions.pod:6548 ../src/guestfs-actions.pod:6578 ../src/guestfs-actions.pod:6611 ../src/guestfs-actions.pod:6726 ../src/guestfs-actions.pod:6847 ../src/guestfs-actions.pod:6859 ../src/guestfs-actions.pod:6872 ../src/guestfs-actions.pod:6885 ../src/guestfs-actions.pod:6907 ../src/guestfs-actions.pod:6920 ../src/guestfs-actions.pod:6933 ../src/guestfs-actions.pod:6946 ../src/guestfs-actions.pod:6961 ../src/guestfs-actions.pod:7020 ../src/guestfs-actions.pod:7037 ../src/guestfs-actions.pod:7053 ../src/guestfs-actions.pod:7069 ../src/guestfs-actions.pod:7086 ../src/guestfs-actions.pod:7099 ../src/guestfs-actions.pod:7119 ../src/guestfs-actions.pod:7155 ../src/guestfs-actions.pod:7169 ../src/guestfs-actions.pod:7210 ../src/guestfs-actions.pod:7223 ../src/guestfs-actions.pod:7241 ../src/guestfs-actions.pod:7275 ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7427 ../src/guestfs-actions.pod:7442 ../src/guestfs-actions.pod:7456 ../src/guestfs-actions.pod:7511 ../src/guestfs-actions.pod:7524 ../src/guestfs-actions.pod:7569 ../src/guestfs-actions.pod:7609 ../src/guestfs-actions.pod:7665 ../src/guestfs-actions.pod:7685 ../src/guestfs-actions.pod:7718 ../src/guestfs-actions.pod:7782 ../src/guestfs-actions.pod:7805 ../src/guestfs-actions.pod:7834
21372 msgid "This function returns 0 on success or -1 on error."
21376 #: ../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:3628 ../src/guestfs-actions.pod:3648 ../src/guestfs-actions.pod:4956 ../src/guestfs-actions.pod:6222 ../src/guestfs-actions.pod:6339 ../src/guestfs-actions.pod:6472 ../src/guestfs-actions.pod:6963 ../src/guestfs-actions.pod:7088 ../src/guestfs-actions.pod:7611
21377 msgid "(Added in 0.3)"
21381 #: ../src/guestfs-actions.pod:41
21382 msgid "guestfs_add_domain"
21386 #: ../src/guestfs-actions.pod:43
21390 " guestfs_add_domain (guestfs_h *g,\n"
21391 " const char *dom,\n"
21397 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:4647 ../src/guestfs-actions.pod:4966 ../src/guestfs-actions.pod:5183
21399 "You may supply a list of optional arguments to this call. Use zero or more "
21400 "of the following pairs of parameters, and terminate the list with C<-1> on "
21401 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
21405 #: ../src/guestfs-actions.pod:53
21408 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
21409 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
21410 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
21411 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
21412 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
21417 #: ../src/guestfs-actions.pod:59
21419 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
21420 "It works by connecting to libvirt, requesting the domain and domain XML from "
21421 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
21426 #: ../src/guestfs-actions.pod:94
21428 "The other optional parameters are passed directly through to "
21429 "C<guestfs_add_drive_opts>."
21433 #: ../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:2477 ../src/guestfs-actions.pod:2949 ../src/guestfs-actions.pod:2967 ../src/guestfs-actions.pod:5142 ../src/guestfs-actions.pod:5362 ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:5800 ../src/guestfs-actions.pod:7196 ../src/guestfs-actions.pod:7622 ../src/guestfs-actions.pod:7635 ../src/guestfs-actions.pod:7648
21434 msgid "On error this function returns -1."
21438 #: ../src/guestfs-actions.pod:99
21439 msgid "(Added in 1.7.4)"
21443 #: ../src/guestfs-actions.pod:101
21444 msgid "guestfs_add_domain_va"
21448 #: ../src/guestfs-actions.pod:103
21452 " guestfs_add_domain_va (guestfs_h *g,\n"
21453 " const char *dom,\n"
21454 " va_list args);\n"
21459 #: ../src/guestfs-actions.pod:108
21460 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
21464 #: ../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:2915 ../src/guestfs-actions.pod:2927 ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:4994 ../src/guestfs-actions.pod:5006 ../src/guestfs-actions.pod:5232 ../src/guestfs-actions.pod:5243
21465 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
21469 #: ../src/guestfs-actions.pod:112
21470 msgid "guestfs_add_domain_argv"
21474 #: ../src/guestfs-actions.pod:114
21478 " guestfs_add_domain_argv (guestfs_h *g,\n"
21479 " const char *dom,\n"
21480 " const struct guestfs_add_domain_argv *optargs);\n"
21485 #: ../src/guestfs-actions.pod:119
21486 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
21490 #: ../src/guestfs-actions.pod:123
21491 msgid "guestfs_add_drive"
21495 #: ../src/guestfs-actions.pod:125
21499 " guestfs_add_drive (guestfs_h *g,\n"
21500 " const char *filename);\n"
21505 #: ../src/guestfs-actions.pod:129
21507 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
21508 "optional parameters, so the disk is added writable, with the format being "
21509 "detected automatically."
21513 #: ../src/guestfs-actions.pod:133
21515 "Automatic detection of the format opens you up to a potential security hole "
21516 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
21517 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
21518 "you should think about replacing calls to this function with calls to "
21519 "C<guestfs_add_drive_opts>, and specifying the format."
21523 #: ../src/guestfs-actions.pod:144
21524 msgid "guestfs_add_drive_opts"
21528 #: ../src/guestfs-actions.pod:146
21532 " guestfs_add_drive_opts (guestfs_h *g,\n"
21533 " const char *filename,\n"
21539 #: ../src/guestfs-actions.pod:156
21542 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
21543 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
21544 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
21549 #: ../src/guestfs-actions.pod:185
21551 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
21552 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
21553 "Possible formats include C<raw> and C<qcow2>."
21557 #: ../src/guestfs-actions.pod:196
21559 "This rarely-used option lets you emulate the behaviour of the deprecated "
21560 "C<guestfs_add_drive_with_if> call (q.v.)"
21564 #: ../src/guestfs-actions.pod:203
21565 msgid "(Added in 1.5.23)"
21569 #: ../src/guestfs-actions.pod:205
21570 msgid "guestfs_add_drive_opts_va"
21574 #: ../src/guestfs-actions.pod:207
21578 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
21579 " const char *filename,\n"
21580 " va_list args);\n"
21585 #: ../src/guestfs-actions.pod:212
21586 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
21590 #: ../src/guestfs-actions.pod:216
21591 msgid "guestfs_add_drive_opts_argv"
21595 #: ../src/guestfs-actions.pod:218
21599 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
21600 " const char *filename,\n"
21601 " const struct guestfs_add_drive_opts_argv "
21607 #: ../src/guestfs-actions.pod:223
21608 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
21612 #: ../src/guestfs-actions.pod:227
21613 msgid "guestfs_add_drive_ro"
21617 #: ../src/guestfs-actions.pod:229
21621 " guestfs_add_drive_ro (guestfs_h *g,\n"
21622 " const char *filename);\n"
21627 #: ../src/guestfs-actions.pod:233
21629 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
21630 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
21631 "disk is added read-only, with the format being detected automatically."
21635 #: ../src/guestfs-actions.pod:240
21636 msgid "(Added in 1.0.38)"
21640 #: ../src/guestfs-actions.pod:242
21641 msgid "guestfs_add_drive_ro_with_if"
21645 #: ../src/guestfs-actions.pod:244
21649 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
21650 " const char *filename,\n"
21651 " const char *iface);\n"
21656 #: ../src/guestfs-actions.pod:256
21658 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
21659 "QEMU interface emulation to use at run time."
21663 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282 ../src/guestfs-actions.pod:2436
21664 msgid "(Added in 1.0.84)"
21668 #: ../src/guestfs-actions.pod:263
21669 msgid "guestfs_add_drive_with_if"
21673 #: ../src/guestfs-actions.pod:265
21677 " guestfs_add_drive_with_if (guestfs_h *g,\n"
21678 " const char *filename,\n"
21679 " const char *iface);\n"
21684 #: ../src/guestfs-actions.pod:277
21686 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
21687 "QEMU interface emulation to use at run time."
21691 #: ../src/guestfs-actions.pod:284
21692 msgid "guestfs_aug_clear"
21696 #: ../src/guestfs-actions.pod:286
21700 " guestfs_aug_clear (guestfs_h *g,\n"
21701 " const char *augpath);\n"
21706 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2186
21707 msgid "(Added in 1.3.4)"
21711 #: ../src/guestfs-actions.pod:297
21712 msgid "guestfs_aug_close"
21716 #: ../src/guestfs-actions.pod:299
21720 " guestfs_aug_close (guestfs_h *g);\n"
21725 #: ../src/guestfs-actions.pod:302
21727 "Close the current Augeas handle and free up any resources used by it. After "
21728 "calling this, you have to call C<guestfs_aug_init> again before you can use "
21729 "any other Augeas functions."
21733 #: ../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:5851
21734 msgid "(Added in 0.7)"
21738 #: ../src/guestfs-actions.pod:311
21739 msgid "guestfs_aug_defnode"
21743 #: ../src/guestfs-actions.pod:313
21746 " struct guestfs_int_bool *\n"
21747 " guestfs_aug_defnode (guestfs_h *g,\n"
21748 " const char *name,\n"
21749 " const char *expr,\n"
21750 " const char *val);\n"
21755 #: ../src/guestfs-actions.pod:322
21757 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
21758 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
21759 "containing that single node."
21763 #: ../src/guestfs-actions.pod:330
21765 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
21766 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
21770 #: ../src/guestfs-actions.pod:336
21771 msgid "guestfs_aug_defvar"
21775 #: ../src/guestfs-actions.pod:338
21779 " guestfs_aug_defvar (guestfs_h *g,\n"
21780 " const char *name,\n"
21781 " const char *expr);\n"
21786 #: ../src/guestfs-actions.pod:354
21787 msgid "guestfs_aug_get"
21791 #: ../src/guestfs-actions.pod:356
21795 " guestfs_aug_get (guestfs_h *g,\n"
21796 " const char *augpath);\n"
21801 #: ../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:2014 ../src/guestfs-actions.pod:2035 ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2401 ../src/guestfs-actions.pod:2605 ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:2799 ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:3032 ../src/guestfs-actions.pod:3060 ../src/guestfs-actions.pod:3081 ../src/guestfs-actions.pod:3115 ../src/guestfs-actions.pod:3174 ../src/guestfs-actions.pod:3194 ../src/guestfs-actions.pod:3214 ../src/guestfs-actions.pod:3841 ../src/guestfs-actions.pod:4194 ../src/guestfs-actions.pod:4364 ../src/guestfs-actions.pod:4474 ../src/guestfs-actions.pod:5380 ../src/guestfs-actions.pod:5579 ../src/guestfs-actions.pod:5749 ../src/guestfs-actions.pod:5927 ../src/guestfs-actions.pod:5976 ../src/guestfs-actions.pod:6632 ../src/guestfs-actions.pod:6648 ../src/guestfs-actions.pod:6672 ../src/guestfs-actions.pod:6696 ../src/guestfs-actions.pod:7370 ../src/guestfs-actions.pod:7389 ../src/guestfs-actions.pod:7407 ../src/guestfs-actions.pod:7581 ../src/guestfs-actions.pod:7898
21803 "This function returns a string, or NULL on error. I<The caller must free "
21804 "the returned string after use>."
21808 #: ../src/guestfs-actions.pod:368
21809 msgid "guestfs_aug_init"
21813 #: ../src/guestfs-actions.pod:370
21817 " guestfs_aug_init (guestfs_h *g,\n"
21818 " const char *root,\n"
21824 #: ../src/guestfs-actions.pod:379
21825 msgid "You must call this before using any other C<guestfs_aug_*> commands."
21829 #: ../src/guestfs-actions.pod:404
21831 "This option is only useful when debugging Augeas lenses. Use of this option "
21832 "may require additional memory for the libguestfs appliance. You may need to "
21833 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
21834 "C<guestfs_set_memsize>."
21838 #: ../src/guestfs-actions.pod:419
21839 msgid "Do not load the tree in C<guestfs_aug_init>."
21843 #: ../src/guestfs-actions.pod:423
21844 msgid "To close the handle, you can call C<guestfs_aug_close>."
21848 #: ../src/guestfs-actions.pod:431
21849 msgid "guestfs_aug_insert"
21853 #: ../src/guestfs-actions.pod:433
21857 " guestfs_aug_insert (guestfs_h *g,\n"
21858 " const char *augpath,\n"
21859 " const char *label,\n"
21865 #: ../src/guestfs-actions.pod:451
21866 msgid "guestfs_aug_load"
21870 #: ../src/guestfs-actions.pod:453
21874 " guestfs_aug_load (guestfs_h *g);\n"
21879 #: ../src/guestfs-actions.pod:465
21880 msgid "guestfs_aug_ls"
21884 #: ../src/guestfs-actions.pod:467
21888 " guestfs_aug_ls (guestfs_h *g,\n"
21889 " const char *augpath);\n"
21894 #: ../src/guestfs-actions.pod:471
21896 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
21897 "sorting the resulting nodes into alphabetical order."
21901 #: ../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:2359 ../src/guestfs-actions.pod:2383 ../src/guestfs-actions.pod:2454 ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2760 ../src/guestfs-actions.pod:3134 ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3724 ../src/guestfs-actions.pod:3741 ../src/guestfs-actions.pod:3761 ../src/guestfs-actions.pod:3823 ../src/guestfs-actions.pod:3928 ../src/guestfs-actions.pod:4336 ../src/guestfs-actions.pod:5103 ../src/guestfs-actions.pod:5721 ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:5961 ../src/guestfs-actions.pod:6712 ../src/guestfs-actions.pod:6773 ../src/guestfs-actions.pod:6828 ../src/guestfs-actions.pod:6974 ../src/guestfs-actions.pod:6998 ../src/guestfs-actions.pod:7474 ../src/guestfs-actions.pod:7494 ../src/guestfs-actions.pod:7541 ../src/guestfs-actions.pod:7735 ../src/guestfs-actions.pod:7754 ../src/guestfs-actions.pod:7848 ../src/guestfs-actions.pod:7867 ../src/guestfs-actions.pod:7913 ../src/guestfs-actions.pod:7932
21903 "This function returns a NULL-terminated array of strings (like "
21904 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
21905 "strings and the array after use>."
21909 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1496 ../src/guestfs-actions.pod:3488 ../src/guestfs-actions.pod:3519 ../src/guestfs-actions.pod:4177 ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:4414 ../src/guestfs-actions.pod:4447 ../src/guestfs-actions.pod:4610 ../src/guestfs-actions.pod:5107 ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:6059 ../src/guestfs-actions.pod:6073 ../src/guestfs-actions.pod:6085 ../src/guestfs-actions.pod:6553 ../src/guestfs-actions.pod:7212 ../src/guestfs-actions.pod:7225 ../src/guestfs-actions.pod:7458 ../src/guestfs-actions.pod:7723
21910 msgid "(Added in 0.8)"
21914 #: ../src/guestfs-actions.pod:480
21915 msgid "guestfs_aug_match"
21919 #: ../src/guestfs-actions.pod:482
21923 " guestfs_aug_match (guestfs_h *g,\n"
21924 " const char *augpath);\n"
21929 #: ../src/guestfs-actions.pod:496
21930 msgid "guestfs_aug_mv"
21934 #: ../src/guestfs-actions.pod:498
21938 " guestfs_aug_mv (guestfs_h *g,\n"
21939 " const char *src,\n"
21940 " const char *dest);\n"
21945 #: ../src/guestfs-actions.pod:510
21946 msgid "guestfs_aug_rm"
21950 #: ../src/guestfs-actions.pod:512
21954 " guestfs_aug_rm (guestfs_h *g,\n"
21955 " const char *augpath);\n"
21960 #: ../src/guestfs-actions.pod:524
21961 msgid "guestfs_aug_save"
21965 #: ../src/guestfs-actions.pod:526
21969 " guestfs_aug_save (guestfs_h *g);\n"
21974 #: ../src/guestfs-actions.pod:531
21976 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
21981 #: ../src/guestfs-actions.pod:538
21982 msgid "guestfs_aug_set"
21986 #: ../src/guestfs-actions.pod:540
21990 " guestfs_aug_set (guestfs_h *g,\n"
21991 " const char *augpath,\n"
21992 " const char *val);\n"
21997 #: ../src/guestfs-actions.pod:547
21999 "In the Augeas API, it is possible to clear a node by setting the value to "
22000 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
22001 "this call. Instead you must use the C<guestfs_aug_clear> call."
22005 #: ../src/guestfs-actions.pod:556
22006 msgid "guestfs_available"
22010 #: ../src/guestfs-actions.pod:558
22014 " guestfs_available (guestfs_h *g,\n"
22015 " char *const *groups);\n"
22020 #: ../src/guestfs-actions.pod:566
22022 "The libguestfs groups, and the functions that those groups correspond to, "
22023 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
22024 "runtime by calling C<guestfs_available_all_groups>."
22028 #: ../src/guestfs-actions.pod:590
22029 msgid "You must call C<guestfs_launch> before calling this function."
22033 #: ../src/guestfs-actions.pod:612
22035 "This call was added in version C<1.0.80>. In previous versions of "
22036 "libguestfs all you could do would be to speculatively execute a command to "
22037 "find out if the daemon implemented it. See also C<guestfs_version>."
22041 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1241
22042 msgid "(Added in 1.0.80)"
22046 #: ../src/guestfs-actions.pod:623
22047 msgid "guestfs_available_all_groups"
22051 #: ../src/guestfs-actions.pod:625
22055 " guestfs_available_all_groups (guestfs_h *g);\n"
22060 #: ../src/guestfs-actions.pod:628
22062 "This command returns a list of all optional groups that this daemon knows "
22063 "about. Note this returns both supported and unsupported groups. To find "
22064 "out which ones the daemon can actually support you have to call "
22065 "C<guestfs_available> on each member of the returned list."
22069 #: ../src/guestfs-actions.pod:634
22070 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
22074 #: ../src/guestfs-actions.pod:640
22075 msgid "(Added in 1.3.15)"
22079 #: ../src/guestfs-actions.pod:642
22080 msgid "guestfs_base64_in"
22084 #: ../src/guestfs-actions.pod:644
22088 " guestfs_base64_in (guestfs_h *g,\n"
22089 " const char *base64file,\n"
22090 " const char *filename);\n"
22095 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
22096 msgid "(Added in 1.3.5)"
22100 #: ../src/guestfs-actions.pod:656
22101 msgid "guestfs_base64_out"
22105 #: ../src/guestfs-actions.pod:658
22109 " guestfs_base64_out (guestfs_h *g,\n"
22110 " const char *filename,\n"
22111 " const char *base64file);\n"
22116 #: ../src/guestfs-actions.pod:670
22117 msgid "guestfs_blockdev_flushbufs"
22121 #: ../src/guestfs-actions.pod:672
22125 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
22126 " const char *device);\n"
22131 #: ../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
22132 msgid "(Added in 0.9.3)"
22136 #: ../src/guestfs-actions.pod:685
22137 msgid "guestfs_blockdev_getbsz"
22141 #: ../src/guestfs-actions.pod:687
22145 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
22146 " const char *device);\n"
22151 #: ../src/guestfs-actions.pod:702
22152 msgid "guestfs_blockdev_getro"
22156 #: ../src/guestfs-actions.pod:704
22160 " guestfs_blockdev_getro (guestfs_h *g,\n"
22161 " const char *device);\n"
22166 #: ../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:3231 ../src/guestfs-actions.pod:3247 ../src/guestfs-actions.pod:3265 ../src/guestfs-actions.pod:3427 ../src/guestfs-actions.pod:3441 ../src/guestfs-actions.pod:3456 ../src/guestfs-actions.pod:3470 ../src/guestfs-actions.pod:3486 ../src/guestfs-actions.pod:3501 ../src/guestfs-actions.pod:3517 ../src/guestfs-actions.pod:3531 ../src/guestfs-actions.pod:3544 ../src/guestfs-actions.pod:3558 ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3588 ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3615 ../src/guestfs-actions.pod:5344
22167 msgid "This function returns a C truth value on success or -1 on error."
22171 #: ../src/guestfs-actions.pod:717
22172 msgid "guestfs_blockdev_getsize64"
22176 #: ../src/guestfs-actions.pod:719
22180 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
22181 " const char *device);\n"
22186 #: ../src/guestfs-actions.pod:725
22187 msgid "See also C<guestfs_blockdev_getsz>."
22191 #: ../src/guestfs-actions.pod:733
22192 msgid "guestfs_blockdev_getss"
22196 #: ../src/guestfs-actions.pod:735
22200 " guestfs_blockdev_getss (guestfs_h *g,\n"
22201 " const char *device);\n"
22206 #: ../src/guestfs-actions.pod:742
22208 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
22213 #: ../src/guestfs-actions.pod:751
22214 msgid "guestfs_blockdev_getsz"
22218 #: ../src/guestfs-actions.pod:753
22222 " guestfs_blockdev_getsz (guestfs_h *g,\n"
22223 " const char *device);\n"
22228 #: ../src/guestfs-actions.pod:760
22230 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
22231 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
22235 #: ../src/guestfs-actions.pod:770
22236 msgid "guestfs_blockdev_rereadpt"
22240 #: ../src/guestfs-actions.pod:772
22244 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
22245 " const char *device);\n"
22250 #: ../src/guestfs-actions.pod:784
22251 msgid "guestfs_blockdev_setbsz"
22255 #: ../src/guestfs-actions.pod:786
22259 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
22260 " const char *device,\n"
22261 " int blocksize);\n"
22266 #: ../src/guestfs-actions.pod:802
22267 msgid "guestfs_blockdev_setro"
22271 #: ../src/guestfs-actions.pod:804
22275 " guestfs_blockdev_setro (guestfs_h *g,\n"
22276 " const char *device);\n"
22281 #: ../src/guestfs-actions.pod:816
22282 msgid "guestfs_blockdev_setrw"
22286 #: ../src/guestfs-actions.pod:818
22290 " guestfs_blockdev_setrw (guestfs_h *g,\n"
22291 " const char *device);\n"
22296 #: ../src/guestfs-actions.pod:830
22297 msgid "guestfs_btrfs_filesystem_resize"
22301 #: ../src/guestfs-actions.pod:832
22305 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
22306 " const char *mountpoint,\n"
22312 #: ../src/guestfs-actions.pod:842
22315 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
22320 #: ../src/guestfs-actions.pod:865
22321 msgid "(Added in 1.11.17)"
22325 #: ../src/guestfs-actions.pod:867
22326 msgid "guestfs_btrfs_filesystem_resize_va"
22330 #: ../src/guestfs-actions.pod:869
22334 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
22335 " const char *mountpoint,\n"
22336 " va_list args);\n"
22341 #: ../src/guestfs-actions.pod:874
22342 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
22346 #: ../src/guestfs-actions.pod:878
22347 msgid "guestfs_btrfs_filesystem_resize_argv"
22351 #: ../src/guestfs-actions.pod:880
22355 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
22356 " const char *mountpoint,\n"
22358 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
22363 #: ../src/guestfs-actions.pod:885
22364 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
22368 #: ../src/guestfs-actions.pod:889
22369 msgid "guestfs_case_sensitive_path"
22373 #: ../src/guestfs-actions.pod:891
22377 " guestfs_case_sensitive_path (guestfs_h *g,\n"
22378 " const char *path);\n"
22383 #: ../src/guestfs-actions.pod:917
22385 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
22386 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
22387 "how the directories were originally created under Windows)."
22391 #: ../src/guestfs-actions.pod:925
22392 msgid "See also C<guestfs_realpath>."
22396 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7392
22397 msgid "(Added in 1.0.75)"
22401 #: ../src/guestfs-actions.pod:932
22402 msgid "guestfs_cat"
22406 #: ../src/guestfs-actions.pod:934
22410 " guestfs_cat (guestfs_h *g,\n"
22411 " const char *path);\n"
22416 #: ../src/guestfs-actions.pod:940
22418 "Note that this function cannot correctly handle binary files (specifically, "
22419 "files containing C<\\0> character which is treated as end of string). For "
22420 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
22421 "functions which have a more complex interface."
22425 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3745 ../src/guestfs-actions.pod:3827 ../src/guestfs-actions.pod:3844 ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:4340 ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:5725 ../src/guestfs-actions.pod:5739 ../src/guestfs-actions.pod:7545 ../src/guestfs-actions.pod:7559
22426 msgid "(Added in 0.4)"
22430 #: ../src/guestfs-actions.pod:953
22431 msgid "guestfs_checksum"
22435 #: ../src/guestfs-actions.pod:955
22439 " guestfs_checksum (guestfs_h *g,\n"
22440 " const char *csumtype,\n"
22441 " const char *path);\n"
22446 #: ../src/guestfs-actions.pod:1001
22447 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
22451 #: ../src/guestfs-actions.pod:1003
22452 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
22456 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1316 ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:3443 ../src/guestfs-actions.pod:3472 ../src/guestfs-actions.pod:3533 ../src/guestfs-actions.pod:3560 ../src/guestfs-actions.pod:7248
22457 msgid "(Added in 1.0.2)"
22461 #: ../src/guestfs-actions.pod:1010
22462 msgid "guestfs_checksum_device"
22466 #: ../src/guestfs-actions.pod:1012
22470 " guestfs_checksum_device (guestfs_h *g,\n"
22471 " const char *csumtype,\n"
22472 " const char *device);\n"
22477 #: ../src/guestfs-actions.pod:1017
22479 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
22480 "device named C<device>. For the types of checksums supported see the "
22481 "C<guestfs_checksum> command."
22485 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5174 ../src/guestfs-actions.pod:5309 ../src/guestfs-actions.pod:5346 ../src/guestfs-actions.pod:5364 ../src/guestfs-actions.pod:5546 ../src/guestfs-actions.pod:7157 ../src/guestfs-actions.pod:7171 ../src/guestfs-actions.pod:7571
22486 msgid "(Added in 1.3.2)"
22490 #: ../src/guestfs-actions.pod:1026
22491 msgid "guestfs_checksums_out"
22495 #: ../src/guestfs-actions.pod:1028
22499 " guestfs_checksums_out (guestfs_h *g,\n"
22500 " const char *csumtype,\n"
22501 " const char *directory,\n"
22502 " const char *sumsfile);\n"
22507 #: ../src/guestfs-actions.pod:1048
22508 msgid "(Added in 1.3.7)"
22512 #: ../src/guestfs-actions.pod:1050
22513 msgid "guestfs_chmod"
22517 #: ../src/guestfs-actions.pod:1052
22521 " guestfs_chmod (guestfs_h *g,\n"
22523 " const char *path);\n"
22528 #: ../src/guestfs-actions.pod:1070
22529 msgid "guestfs_chown"
22533 #: ../src/guestfs-actions.pod:1072
22537 " guestfs_chown (guestfs_h *g,\n"
22540 " const char *path);\n"
22545 #: ../src/guestfs-actions.pod:1088
22546 msgid "guestfs_command"
22550 #: ../src/guestfs-actions.pod:1090
22554 " guestfs_command (guestfs_h *g,\n"
22555 " char *const *arguments);\n"
22560 #: ../src/guestfs-actions.pod:1099
22562 "The single parameter is an argv-style list of arguments. The first element "
22563 "is the name of the program to run. Subsequent elements are parameters. The "
22564 "list must be non-empty (ie. must contain a program name). Note that the "
22565 "command runs directly, and is I<not> invoked via the shell (see "
22570 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150 ../src/guestfs-actions.pod:1615
22571 msgid "(Added in 0.9.1)"
22575 #: ../src/guestfs-actions.pod:1132
22576 msgid "guestfs_command_lines"
22580 #: ../src/guestfs-actions.pod:1134
22584 " guestfs_command_lines (guestfs_h *g,\n"
22585 " char *const *arguments);\n"
22590 #: ../src/guestfs-actions.pod:1138
22592 "This is the same as C<guestfs_command>, but splits the result into a list of "
22597 #: ../src/guestfs-actions.pod:1141
22598 msgid "See also: C<guestfs_sh_lines>"
22602 #: ../src/guestfs-actions.pod:1152
22603 msgid "guestfs_config"
22607 #: ../src/guestfs-actions.pod:1154
22611 " guestfs_config (guestfs_h *g,\n"
22612 " const char *qemuparam,\n"
22613 " const char *qemuvalue);\n"
22618 #: ../src/guestfs-actions.pod:1172
22619 msgid "guestfs_copy_size"
22623 #: ../src/guestfs-actions.pod:1174
22627 " guestfs_copy_size (guestfs_h *g,\n"
22628 " const char *src,\n"
22629 " const char *dest,\n"
22630 " int64_t size);\n"
22635 #: ../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:3643 ../src/guestfs-actions.pod:7243 ../src/guestfs-actions.pod:7277 ../src/guestfs-actions.pod:7784 ../src/guestfs-actions.pod:7807
22637 "This long-running command can generate progress notification messages so "
22638 "that the caller can display a progress bar or indicator. To receive these "
22639 "messages, the caller must register a progress event callback. See "
22640 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
22644 #: ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:4367 ../src/guestfs-actions.pod:5752 ../src/guestfs-actions.pod:7478 ../src/guestfs-actions.pod:7498 ../src/guestfs-actions.pod:7584
22645 msgid "(Added in 1.0.87)"
22649 #: ../src/guestfs-actions.pod:1195
22654 #: ../src/guestfs-actions.pod:1197
22658 " guestfs_cp (guestfs_h *g,\n"
22659 " const char *src,\n"
22660 " const char *dest);\n"
22665 #: ../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:5121 ../src/guestfs-actions.pod:5596
22666 msgid "(Added in 1.0.18)"
22670 #: ../src/guestfs-actions.pod:1209
22671 msgid "guestfs_cp_a"
22675 #: ../src/guestfs-actions.pod:1211
22679 " guestfs_cp_a (guestfs_h *g,\n"
22680 " const char *src,\n"
22681 " const char *dest);\n"
22686 #: ../src/guestfs-actions.pod:1223
22691 #: ../src/guestfs-actions.pod:1225
22695 " guestfs_dd (guestfs_h *g,\n"
22696 " const char *src,\n"
22697 " const char *dest);\n"
22702 #: ../src/guestfs-actions.pod:1235
22704 "If the destination is a device, it must be as large or larger than the "
22705 "source file or device, otherwise the copy will fail. This command cannot do "
22706 "partial copies (see C<guestfs_copy_size>)."
22710 #: ../src/guestfs-actions.pod:1243
22715 #: ../src/guestfs-actions.pod:1245
22719 " guestfs_df (guestfs_h *g);\n"
22724 #: ../src/guestfs-actions.pod:1250 ../src/guestfs-actions.pod:1267
22726 "This command is mostly useful for interactive sessions. It is I<not> "
22727 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
22732 #: ../src/guestfs-actions.pod:1257 ../src/guestfs-actions.pod:1274 ../src/guestfs-actions.pod:1392 ../src/guestfs-actions.pod:2366 ../src/guestfs-actions.pod:2390 ../src/guestfs-actions.pod:2458 ../src/guestfs-actions.pod:4477 ../src/guestfs-actions.pod:5021 ../src/guestfs-actions.pod:6981 ../src/guestfs-actions.pod:7005 ../src/guestfs-actions.pod:7624 ../src/guestfs-actions.pod:7637 ../src/guestfs-actions.pod:7650
22733 msgid "(Added in 1.0.54)"
22737 #: ../src/guestfs-actions.pod:1259
22738 msgid "guestfs_df_h"
22742 #: ../src/guestfs-actions.pod:1261
22746 " guestfs_df_h (guestfs_h *g);\n"
22751 #: ../src/guestfs-actions.pod:1276
22752 msgid "guestfs_dmesg"
22756 #: ../src/guestfs-actions.pod:1278
22760 " guestfs_dmesg (guestfs_h *g);\n"
22765 #: ../src/guestfs-actions.pod:1285
22767 "Another way to get the same information is to enable verbose messages with "
22768 "C<guestfs_set_verbose> or by setting the environment variable "
22769 "C<LIBGUESTFS_DEBUG=1> before running the program."
22773 #: ../src/guestfs-actions.pod:1295
22774 msgid "guestfs_download"
22778 #: ../src/guestfs-actions.pod:1297
22782 " guestfs_download (guestfs_h *g,\n"
22783 " const char *remotefilename,\n"
22784 " const char *filename);\n"
22789 #: ../src/guestfs-actions.pod:1307
22790 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
22794 #: ../src/guestfs-actions.pod:1318
22795 msgid "guestfs_download_offset"
22799 #: ../src/guestfs-actions.pod:1320
22803 " guestfs_download_offset (guestfs_h *g,\n"
22804 " const char *remotefilename,\n"
22805 " const char *filename,\n"
22806 " int64_t offset,\n"
22807 " int64_t size);\n"
22812 #: ../src/guestfs-actions.pod:1333
22814 "Note that there is no limit on the amount of data that can be downloaded "
22815 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
22816 "full amount unless an error occurs."
22820 #: ../src/guestfs-actions.pod:1338
22821 msgid "See also C<guestfs_download>, C<guestfs_pread>."
22825 #: ../src/guestfs-actions.pod:1347 ../src/guestfs-actions.pod:7282
22826 msgid "(Added in 1.5.17)"
22830 #: ../src/guestfs-actions.pod:1349
22831 msgid "guestfs_drop_caches"
22835 #: ../src/guestfs-actions.pod:1351
22839 " guestfs_drop_caches (guestfs_h *g,\n"
22840 " int whattodrop);\n"
22845 #: ../src/guestfs-actions.pod:1369
22850 #: ../src/guestfs-actions.pod:1371
22854 " guestfs_du (guestfs_h *g,\n"
22855 " const char *path);\n"
22860 #: ../src/guestfs-actions.pod:1394
22861 msgid "guestfs_e2fsck_f"
22865 #: ../src/guestfs-actions.pod:1396
22869 " guestfs_e2fsck_f (guestfs_h *g,\n"
22870 " const char *device);\n"
22875 #: ../src/guestfs-actions.pod:1404
22877 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
22878 "Normally you should use C<guestfs_fsck>."
22882 #: ../src/guestfs-actions.pod:1409
22883 msgid "(Added in 1.0.29)"
22887 #: ../src/guestfs-actions.pod:1411
22888 msgid "guestfs_echo_daemon"
22892 #: ../src/guestfs-actions.pod:1413
22896 " guestfs_echo_daemon (guestfs_h *g,\n"
22897 " char *const *words);\n"
22902 #: ../src/guestfs-actions.pod:1422
22903 msgid "See also C<guestfs_ping_daemon>."
22907 #: ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:6453
22908 msgid "(Added in 1.0.69)"
22912 #: ../src/guestfs-actions.pod:1429
22913 msgid "guestfs_egrep"
22917 #: ../src/guestfs-actions.pod:1431
22921 " guestfs_egrep (guestfs_h *g,\n"
22922 " const char *regex,\n"
22923 " const char *path);\n"
22928 #: ../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:2479 ../src/guestfs-actions.pod:2492 ../src/guestfs-actions.pod:2507 ../src/guestfs-actions.pod:2553 ../src/guestfs-actions.pod:2575 ../src/guestfs-actions.pod:2588 ../src/guestfs-actions.pod:3857 ../src/guestfs-actions.pod:3871 ../src/guestfs-actions.pod:3884 ../src/guestfs-actions.pod:3898 ../src/guestfs-actions.pod:4899 ../src/guestfs-actions.pod:5930 ../src/guestfs-actions.pod:5979 ../src/guestfs-actions.pod:6849 ../src/guestfs-actions.pod:6861 ../src/guestfs-actions.pod:6874 ../src/guestfs-actions.pod:6887 ../src/guestfs-actions.pod:6909 ../src/guestfs-actions.pod:6922 ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:6948 ../src/guestfs-actions.pod:7742 ../src/guestfs-actions.pod:7761 ../src/guestfs-actions.pod:7855 ../src/guestfs-actions.pod:7874 ../src/guestfs-actions.pod:7920 ../src/guestfs-actions.pod:7939
22929 msgid "(Added in 1.0.66)"
22933 #: ../src/guestfs-actions.pod:1448
22934 msgid "guestfs_egrepi"
22938 #: ../src/guestfs-actions.pod:1450
22942 " guestfs_egrepi (guestfs_h *g,\n"
22943 " const char *regex,\n"
22944 " const char *path);\n"
22949 #: ../src/guestfs-actions.pod:1467
22950 msgid "guestfs_equal"
22954 #: ../src/guestfs-actions.pod:1469
22958 " guestfs_equal (guestfs_h *g,\n"
22959 " const char *file1,\n"
22960 " const char *file2);\n"
22965 #: ../src/guestfs-actions.pod:1483
22966 msgid "guestfs_exists"
22970 #: ../src/guestfs-actions.pod:1485
22974 " guestfs_exists (guestfs_h *g,\n"
22975 " const char *path);\n"
22980 #: ../src/guestfs-actions.pod:1492
22981 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
22985 #: ../src/guestfs-actions.pod:1498
22986 msgid "guestfs_fallocate"
22990 #: ../src/guestfs-actions.pod:1500
22994 " guestfs_fallocate (guestfs_h *g,\n"
22995 " const char *path,\n"
23001 #: ../src/guestfs-actions.pod:1505
23003 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
23008 #: ../src/guestfs-actions.pod:1524
23009 msgid "guestfs_fallocate64"
23013 #: ../src/guestfs-actions.pod:1526
23017 " guestfs_fallocate64 (guestfs_h *g,\n"
23018 " const char *path,\n"
23024 #: ../src/guestfs-actions.pod:1535
23026 "Note that this call allocates disk blocks for the file. To create a sparse "
23027 "file use C<guestfs_truncate_size> instead."
23031 #: ../src/guestfs-actions.pod:1538
23033 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
23034 "oversight it only allowed 30 bit lengths to be specified, effectively "
23035 "limiting the maximum size of files created through that call to 1GB."
23039 #: ../src/guestfs-actions.pod:1549
23040 msgid "(Added in 1.3.17)"
23044 #: ../src/guestfs-actions.pod:1551
23045 msgid "guestfs_fgrep"
23049 #: ../src/guestfs-actions.pod:1553
23053 " guestfs_fgrep (guestfs_h *g,\n"
23054 " const char *pattern,\n"
23055 " const char *path);\n"
23060 #: ../src/guestfs-actions.pod:1570
23061 msgid "guestfs_fgrepi"
23065 #: ../src/guestfs-actions.pod:1572
23069 " guestfs_fgrepi (guestfs_h *g,\n"
23070 " const char *pattern,\n"
23071 " const char *path);\n"
23076 #: ../src/guestfs-actions.pod:1589
23077 msgid "guestfs_file"
23081 #: ../src/guestfs-actions.pod:1591
23085 " guestfs_file (guestfs_h *g,\n"
23086 " const char *path);\n"
23091 #: ../src/guestfs-actions.pod:1609
23093 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
23094 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
23098 #: ../src/guestfs-actions.pod:1617
23099 msgid "guestfs_file_architecture"
23103 #: ../src/guestfs-actions.pod:1619
23107 " guestfs_file_architecture (guestfs_h *g,\n"
23108 " const char *filename);\n"
23113 #: ../src/guestfs-actions.pod:1727 ../src/guestfs-actions.pod:1890 ../src/guestfs-actions.pod:1907 ../src/guestfs-actions.pod:2608 ../src/guestfs-actions.pod:2698 ../src/guestfs-actions.pod:2764 ../src/guestfs-actions.pod:2951 ../src/guestfs-actions.pod:2969 ../src/guestfs-actions.pod:3009 ../src/guestfs-actions.pod:3084 ../src/guestfs-actions.pod:3177 ../src/guestfs-actions.pod:3414 ../src/guestfs-actions.pod:3546
23114 msgid "(Added in 1.5.3)"
23118 #: ../src/guestfs-actions.pod:1729
23119 msgid "guestfs_filesize"
23123 #: ../src/guestfs-actions.pod:1731
23127 " guestfs_filesize (guestfs_h *g,\n"
23128 " const char *file);\n"
23133 #: ../src/guestfs-actions.pod:1737
23135 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
23136 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
23137 "devices, use C<guestfs_blockdev_getsize64>."
23141 #: ../src/guestfs-actions.pod:1743
23142 msgid "(Added in 1.0.82)"
23146 #: ../src/guestfs-actions.pod:1745
23147 msgid "guestfs_fill"
23151 #: ../src/guestfs-actions.pod:1747
23155 " guestfs_fill (guestfs_h *g,\n"
23158 " const char *path);\n"
23163 #: ../src/guestfs-actions.pod:1757
23165 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
23166 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
23167 "bytes use C<guestfs_fill_pattern>."
23171 #: ../src/guestfs-actions.pod:1769
23172 msgid "(Added in 1.0.79)"
23176 #: ../src/guestfs-actions.pod:1771
23177 msgid "guestfs_fill_pattern"
23181 #: ../src/guestfs-actions.pod:1773
23185 " guestfs_fill_pattern (guestfs_h *g,\n"
23186 " const char *pattern,\n"
23188 " const char *path);\n"
23193 #: ../src/guestfs-actions.pod:1779
23195 "This function is like C<guestfs_fill> except that it creates a new file of "
23196 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
23197 "pattern is truncated if necessary to ensure the length of the file is "
23198 "exactly C<len> bytes."
23202 #: ../src/guestfs-actions.pod:1791
23203 msgid "(Added in 1.3.12)"
23207 #: ../src/guestfs-actions.pod:1793
23208 msgid "guestfs_find"
23212 #: ../src/guestfs-actions.pod:1795
23216 " guestfs_find (guestfs_h *g,\n"
23217 " const char *directory);\n"
23222 #: ../src/guestfs-actions.pod:1811
23223 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
23227 #: ../src/guestfs-actions.pod:1824
23228 msgid "See also C<guestfs_find0>."
23232 #: ../src/guestfs-actions.pod:1833 ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:6014
23233 msgid "(Added in 1.0.27)"
23237 #: ../src/guestfs-actions.pod:1835
23238 msgid "guestfs_find0"
23242 #: ../src/guestfs-actions.pod:1837
23246 " guestfs_find0 (guestfs_h *g,\n"
23247 " const char *directory,\n"
23248 " const char *files);\n"
23253 #: ../src/guestfs-actions.pod:1846
23255 "This command works the same way as C<guestfs_find> with the following "
23260 #: ../src/guestfs-actions.pod:1873
23261 msgid "(Added in 1.0.74)"
23265 #: ../src/guestfs-actions.pod:1875
23266 msgid "guestfs_findfs_label"
23270 #: ../src/guestfs-actions.pod:1877
23274 " guestfs_findfs_label (guestfs_h *g,\n"
23275 " const char *label);\n"
23280 #: ../src/guestfs-actions.pod:1885
23281 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
23285 #: ../src/guestfs-actions.pod:1892
23286 msgid "guestfs_findfs_uuid"
23290 #: ../src/guestfs-actions.pod:1894
23294 " guestfs_findfs_uuid (guestfs_h *g,\n"
23295 " const char *uuid);\n"
23300 #: ../src/guestfs-actions.pod:1902
23301 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
23305 #: ../src/guestfs-actions.pod:1909
23306 msgid "guestfs_fsck"
23310 #: ../src/guestfs-actions.pod:1911
23314 " guestfs_fsck (guestfs_h *g,\n"
23315 " const char *fstype,\n"
23316 " const char *device);\n"
23321 #: ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:7789
23322 msgid "(Added in 1.0.16)"
23326 #: ../src/guestfs-actions.pod:1948
23327 msgid "guestfs_get_append"
23331 #: ../src/guestfs-actions.pod:1950
23335 " guestfs_get_append (guestfs_h *g);\n"
23340 #: ../src/guestfs-actions.pod:1958
23342 "This function returns a string which may be NULL. There is no way to return "
23343 "an error from this function. The string is owned by the guest handle and "
23344 "must I<not> be freed."
23348 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:5692 ../src/guestfs-actions.pod:6174 ../src/guestfs-actions.pod:6616 ../src/guestfs-actions.pod:6635 ../src/guestfs-actions.pod:6651 ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:7429 ../src/guestfs-actions.pod:7444 ../src/guestfs-actions.pod:7836
23349 msgid "(Added in 1.0.26)"
23353 #: ../src/guestfs-actions.pod:1964
23354 msgid "guestfs_get_attach_method"
23358 #: ../src/guestfs-actions.pod:1966
23362 " guestfs_get_attach_method (guestfs_h *g);\n"
23367 #: ../src/guestfs-actions.pod:1969
23368 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
23372 #: ../src/guestfs-actions.pod:1974 ../src/guestfs-actions.pod:6204
23373 msgid "(Added in 1.9.8)"
23377 #: ../src/guestfs-actions.pod:1976
23378 msgid "guestfs_get_autosync"
23382 #: ../src/guestfs-actions.pod:1978
23386 " guestfs_get_autosync (guestfs_h *g);\n"
23391 #: ../src/guestfs-actions.pod:1987
23392 msgid "guestfs_get_direct"
23396 #: ../src/guestfs-actions.pod:1989
23400 " guestfs_get_direct (guestfs_h *g);\n"
23405 #: ../src/guestfs-actions.pod:1996 ../src/guestfs-actions.pod:6245
23406 msgid "(Added in 1.0.72)"
23410 #: ../src/guestfs-actions.pod:1998
23411 msgid "guestfs_get_e2label"
23415 #: ../src/guestfs-actions.pod:2000
23419 " guestfs_get_e2label (guestfs_h *g,\n"
23420 " const char *device);\n"
23425 #: ../src/guestfs-actions.pod:2004
23427 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
23432 #: ../src/guestfs-actions.pod:2017 ../src/guestfs-actions.pod:2038 ../src/guestfs-actions.pod:6263 ../src/guestfs-actions.pod:6282
23433 msgid "(Added in 1.0.15)"
23437 #: ../src/guestfs-actions.pod:2019
23438 msgid "guestfs_get_e2uuid"
23442 #: ../src/guestfs-actions.pod:2021
23446 " guestfs_get_e2uuid (guestfs_h *g,\n"
23447 " const char *device);\n"
23452 #: ../src/guestfs-actions.pod:2025
23454 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
23459 #: ../src/guestfs-actions.pod:2040
23460 msgid "guestfs_get_memsize"
23464 #: ../src/guestfs-actions.pod:2042
23468 " guestfs_get_memsize (guestfs_h *g);\n"
23473 #: ../src/guestfs-actions.pod:2048
23475 "If C<guestfs_set_memsize> was not called on this handle, and if "
23476 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
23477 "value for memsize."
23481 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:4595 ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:4823 ../src/guestfs-actions.pod:4842 ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:4871 ../src/guestfs-actions.pod:4884 ../src/guestfs-actions.pod:5917 ../src/guestfs-actions.pod:6303 ../src/guestfs-actions.pod:6583 ../src/guestfs-actions.pod:7198
23482 msgid "(Added in 1.0.55)"
23486 #: ../src/guestfs-actions.pod:2059
23487 msgid "guestfs_get_network"
23491 #: ../src/guestfs-actions.pod:2061
23495 " guestfs_get_network (guestfs_h *g);\n"
23500 #: ../src/guestfs-actions.pod:2068 ../src/guestfs-actions.pod:6322
23501 msgid "(Added in 1.5.4)"
23505 #: ../src/guestfs-actions.pod:2070
23506 msgid "guestfs_get_path"
23510 #: ../src/guestfs-actions.pod:2072
23514 " guestfs_get_path (guestfs_h *g);\n"
23519 #: ../src/guestfs-actions.pod:2080 ../src/guestfs-actions.pod:2120
23521 "This function returns a string, or NULL on error. The string is owned by "
23522 "the guest handle and must I<not> be freed."
23526 #: ../src/guestfs-actions.pod:2085
23527 msgid "guestfs_get_pgroup"
23531 #: ../src/guestfs-actions.pod:2087
23535 " guestfs_get_pgroup (guestfs_h *g);\n"
23540 #: ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:6358 ../src/guestfs-actions.pod:7690
23541 msgid "(Added in 1.11.18)"
23545 #: ../src/guestfs-actions.pod:2096
23546 msgid "guestfs_get_pid"
23550 #: ../src/guestfs-actions.pod:2098
23554 " guestfs_get_pid (guestfs_h *g);\n"
23559 #: ../src/guestfs-actions.pod:2108
23560 msgid "(Added in 1.0.56)"
23564 #: ../src/guestfs-actions.pod:2110
23565 msgid "guestfs_get_qemu"
23569 #: ../src/guestfs-actions.pod:2112
23573 " guestfs_get_qemu (guestfs_h *g);\n"
23578 #: ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:6386
23579 msgid "(Added in 1.0.6)"
23583 #: ../src/guestfs-actions.pod:2125
23584 msgid "guestfs_get_recovery_proc"
23588 #: ../src/guestfs-actions.pod:2127
23592 " guestfs_get_recovery_proc (guestfs_h *g);\n"
23597 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:3668 ../src/guestfs-actions.pod:3999 ../src/guestfs-actions.pod:4402 ../src/guestfs-actions.pod:4434 ../src/guestfs-actions.pod:5622 ../src/guestfs-actions.pod:5965 ../src/guestfs-actions.pod:6410 ../src/guestfs-actions.pod:7101 ../src/guestfs-actions.pod:7121 ../src/guestfs-actions.pod:7313
23598 msgid "(Added in 1.0.77)"
23602 #: ../src/guestfs-actions.pod:2136
23603 msgid "guestfs_get_selinux"
23607 #: ../src/guestfs-actions.pod:2138
23611 " guestfs_get_selinux (guestfs_h *g);\n"
23616 #: ../src/guestfs-actions.pod:2141
23618 "This returns the current setting of the selinux flag which is passed to the "
23619 "appliance at boot time. See C<guestfs_set_selinux>."
23623 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2212 ../src/guestfs-actions.pod:6429 ../src/guestfs-actions.pod:6487
23624 msgid "(Added in 1.0.67)"
23628 #: ../src/guestfs-actions.pod:2151
23629 msgid "guestfs_get_state"
23633 #: ../src/guestfs-actions.pod:2153
23637 " guestfs_get_state (guestfs_h *g);\n"
23642 #: ../src/guestfs-actions.pod:2165
23643 msgid "guestfs_get_trace"
23647 #: ../src/guestfs-actions.pod:2167
23651 " guestfs_get_trace (guestfs_h *g);\n"
23656 #: ../src/guestfs-actions.pod:2176
23657 msgid "guestfs_get_umask"
23661 #: ../src/guestfs-actions.pod:2178
23665 " guestfs_get_umask (guestfs_h *g);\n"
23670 #: ../src/guestfs-actions.pod:2181
23672 "Return the current umask. By default the umask is C<022> unless it has been "
23673 "set by calling C<guestfs_umask>."
23677 #: ../src/guestfs-actions.pod:2188
23678 msgid "guestfs_get_verbose"
23682 #: ../src/guestfs-actions.pod:2190
23686 " guestfs_get_verbose (guestfs_h *g);\n"
23691 #: ../src/guestfs-actions.pod:2199
23692 msgid "guestfs_getcon"
23696 #: ../src/guestfs-actions.pod:2201
23700 " guestfs_getcon (guestfs_h *g);\n"
23705 #: ../src/guestfs-actions.pod:2206
23706 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
23710 #: ../src/guestfs-actions.pod:2214
23711 msgid "guestfs_getxattr"
23715 #: ../src/guestfs-actions.pod:2216
23719 " guestfs_getxattr (guestfs_h *g,\n"
23720 " const char *path,\n"
23721 " const char *name,\n"
23722 " size_t *size_r);\n"
23727 #: ../src/guestfs-actions.pod:2222
23729 "Get a single extended attribute from file C<path> named C<name>. This call "
23730 "follows symlinks. If you want to lookup an extended attribute for the "
23731 "symlink itself, use C<guestfs_lgetxattr>."
23735 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:3682
23737 "Normally it is better to get all extended attributes from a file in one go "
23738 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
23739 "implementations are buggy and do not provide a way to list out attributes. "
23740 "For these filesystems (notably ntfs-3g) you have to know the names of the "
23741 "extended attributes you want in advance and call this function."
23745 #: ../src/guestfs-actions.pod:2236
23746 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
23750 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2899 ../src/guestfs-actions.pod:3694 ../src/guestfs-actions.pod:5615 ../src/guestfs-actions.pod:5641 ../src/guestfs-actions.pod:5822
23752 "This function returns a buffer, or NULL on error. The size of the returned "
23753 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
23758 #: ../src/guestfs-actions.pod:2242 ../src/guestfs-actions.pod:3698
23759 msgid "(Added in 1.7.24)"
23763 #: ../src/guestfs-actions.pod:2244
23764 msgid "guestfs_getxattrs"
23768 #: ../src/guestfs-actions.pod:2246
23771 " struct guestfs_xattr_list *\n"
23772 " guestfs_getxattrs (guestfs_h *g,\n"
23773 " const char *path);\n"
23778 #: ../src/guestfs-actions.pod:2256
23779 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
23783 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:3710 ../src/guestfs-actions.pod:4398
23785 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
23786 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
23790 #: ../src/guestfs-actions.pod:2262 ../src/guestfs-actions.pod:3714 ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:3949 ../src/guestfs-actions.pod:5995 ../src/guestfs-actions.pod:6506 ../src/guestfs-actions.pod:7901
23791 msgid "(Added in 1.0.59)"
23795 #: ../src/guestfs-actions.pod:2264
23796 msgid "guestfs_glob_expand"
23800 #: ../src/guestfs-actions.pod:2266
23804 " guestfs_glob_expand (guestfs_h *g,\n"
23805 " const char *pattern);\n"
23810 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:6699 ../src/guestfs-actions.pod:6716
23811 msgid "(Added in 1.0.50)"
23815 #: ../src/guestfs-actions.pod:2287
23816 msgid "guestfs_grep"
23820 #: ../src/guestfs-actions.pod:2289
23824 " guestfs_grep (guestfs_h *g,\n"
23825 " const char *regex,\n"
23826 " const char *path);\n"
23831 #: ../src/guestfs-actions.pod:2306
23832 msgid "guestfs_grepi"
23836 #: ../src/guestfs-actions.pod:2308
23840 " guestfs_grepi (guestfs_h *g,\n"
23841 " const char *regex,\n"
23842 " const char *path);\n"
23847 #: ../src/guestfs-actions.pod:2325
23848 msgid "guestfs_grub_install"
23852 #: ../src/guestfs-actions.pod:2327
23856 " guestfs_grub_install (guestfs_h *g,\n"
23857 " const char *root,\n"
23858 " const char *device);\n"
23863 #: ../src/guestfs-actions.pod:2348
23864 msgid "(Added in 1.0.17)"
23868 #: ../src/guestfs-actions.pod:2350
23869 msgid "guestfs_head"
23873 #: ../src/guestfs-actions.pod:2352
23877 " guestfs_head (guestfs_h *g,\n"
23878 " const char *path);\n"
23883 #: ../src/guestfs-actions.pod:2368
23884 msgid "guestfs_head_n"
23888 #: ../src/guestfs-actions.pod:2370
23892 " guestfs_head_n (guestfs_h *g,\n"
23894 " const char *path);\n"
23899 #: ../src/guestfs-actions.pod:2392
23900 msgid "guestfs_hexdump"
23904 #: ../src/guestfs-actions.pod:2394
23908 " guestfs_hexdump (guestfs_h *g,\n"
23909 " const char *path);\n"
23914 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:6780 ../src/guestfs-actions.pod:6835
23915 msgid "(Added in 1.0.22)"
23919 #: ../src/guestfs-actions.pod:2409
23920 msgid "guestfs_initrd_cat"
23924 #: ../src/guestfs-actions.pod:2411
23928 " guestfs_initrd_cat (guestfs_h *g,\n"
23929 " const char *initrdpath,\n"
23930 " const char *filename,\n"
23931 " size_t *size_r);\n"
23936 #: ../src/guestfs-actions.pod:2427
23937 msgid "See also C<guestfs_initrd_list>."
23941 #: ../src/guestfs-actions.pod:2438
23942 msgid "guestfs_initrd_list"
23946 #: ../src/guestfs-actions.pod:2440
23950 " guestfs_initrd_list (guestfs_h *g,\n"
23951 " const char *path);\n"
23956 #: ../src/guestfs-actions.pod:2460
23957 msgid "guestfs_inotify_add_watch"
23961 #: ../src/guestfs-actions.pod:2462
23965 " guestfs_inotify_add_watch (guestfs_h *g,\n"
23966 " const char *path,\n"
23972 #: ../src/guestfs-actions.pod:2481
23973 msgid "guestfs_inotify_close"
23977 #: ../src/guestfs-actions.pod:2483
23981 " guestfs_inotify_close (guestfs_h *g);\n"
23986 #: ../src/guestfs-actions.pod:2494
23987 msgid "guestfs_inotify_files"
23991 #: ../src/guestfs-actions.pod:2496
23995 " guestfs_inotify_files (guestfs_h *g);\n"
24000 #: ../src/guestfs-actions.pod:2499
24002 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
24003 "returns a list of pathnames of objects that were touched. The returned "
24004 "pathnames are sorted and deduplicated."
24008 #: ../src/guestfs-actions.pod:2509
24009 msgid "guestfs_inotify_init"
24013 #: ../src/guestfs-actions.pod:2511
24017 " guestfs_inotify_init (guestfs_h *g,\n"
24018 " int maxevents);\n"
24023 #: ../src/guestfs-actions.pod:2519
24025 "C<maxevents> is the maximum number of events which will be queued up between "
24026 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
24027 "passed as C<0>, then the kernel (or previously set) default is used. For "
24028 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
24029 "throws away events, but records the fact that it threw them away by setting "
24030 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
24031 "C<guestfs_inotify_read>)."
24035 #: ../src/guestfs-actions.pod:2529
24037 "Before any events are generated, you have to add some watches to the "
24038 "internal watch list. See: C<guestfs_inotify_add_watch>, "
24039 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
24043 #: ../src/guestfs-actions.pod:2535
24045 "Queued up events should be read periodically by calling "
24046 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
24047 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
24048 "often enough then you risk the internal queue overflowing."
24052 #: ../src/guestfs-actions.pod:2542
24054 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
24055 "This also removes any watches automatically."
24059 #: ../src/guestfs-actions.pod:2555
24060 msgid "guestfs_inotify_read"
24064 #: ../src/guestfs-actions.pod:2557
24067 " struct guestfs_inotify_event_list *\n"
24068 " guestfs_inotify_read (guestfs_h *g);\n"
24073 #: ../src/guestfs-actions.pod:2571
24075 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
24076 "there was an error. I<The caller must call "
24077 "C<guestfs_free_inotify_event_list> after use>."
24081 #: ../src/guestfs-actions.pod:2577
24082 msgid "guestfs_inotify_rm_watch"
24086 #: ../src/guestfs-actions.pod:2579
24090 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
24096 #: ../src/guestfs-actions.pod:2583
24098 "Remove a previously defined inotify watch. See "
24099 "C<guestfs_inotify_add_watch>."
24103 #: ../src/guestfs-actions.pod:2590
24104 msgid "guestfs_inspect_get_arch"
24108 #: ../src/guestfs-actions.pod:2592
24112 " guestfs_inspect_get_arch (guestfs_h *g,\n"
24113 " const char *root);\n"
24118 #: ../src/guestfs-actions.pod:2596
24120 "This returns the architecture of the inspected operating system. The "
24121 "possible return values are listed under C<guestfs_file_architecture>."
24125 #: ../src/guestfs-actions.pod:2610
24126 msgid "guestfs_inspect_get_distro"
24130 #: ../src/guestfs-actions.pod:2612
24134 " guestfs_inspect_get_distro (guestfs_h *g,\n"
24135 " const char *root);\n"
24140 #: ../src/guestfs-actions.pod:2700
24141 msgid "guestfs_inspect_get_drive_mappings"
24145 #: ../src/guestfs-actions.pod:2702
24149 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
24150 " const char *root);\n"
24155 #: ../src/guestfs-actions.pod:2731
24157 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24158 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
24162 #: ../src/guestfs-actions.pod:2735 ../src/guestfs-actions.pod:3003 ../src/guestfs-actions.pod:3801 ../src/guestfs-actions.pod:5083 ../src/guestfs-actions.pod:7137
24164 "This function returns a NULL-terminated array of strings, or NULL if there "
24165 "was an error. The array of strings will always have length C<2n+1>, where "
24166 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
24167 "caller must free the strings and the array after use>."
24171 #: ../src/guestfs-actions.pod:2741 ../src/guestfs-actions.pod:3197
24172 msgid "(Added in 1.9.17)"
24176 #: ../src/guestfs-actions.pod:2743
24177 msgid "guestfs_inspect_get_filesystems"
24181 #: ../src/guestfs-actions.pod:2745
24185 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
24186 " const char *root);\n"
24191 #: ../src/guestfs-actions.pod:2757
24193 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24194 "C<guestfs_inspect_get_mountpoints>."
24198 #: ../src/guestfs-actions.pod:2766
24199 msgid "guestfs_inspect_get_format"
24203 #: ../src/guestfs-actions.pod:2768
24207 " guestfs_inspect_get_format (guestfs_h *g,\n"
24208 " const char *root);\n"
24213 #: ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:3233 ../src/guestfs-actions.pod:3249 ../src/guestfs-actions.pod:3267 ../src/guestfs-actions.pod:6033
24214 msgid "(Added in 1.9.4)"
24218 #: ../src/guestfs-actions.pod:2804
24219 msgid "guestfs_inspect_get_hostname"
24223 #: ../src/guestfs-actions.pod:2806
24227 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
24228 " const char *root);\n"
24233 #: ../src/guestfs-actions.pod:2821
24234 msgid "(Added in 1.7.9)"
24238 #: ../src/guestfs-actions.pod:2823
24239 msgid "guestfs_inspect_get_icon"
24243 #: ../src/guestfs-actions.pod:2825
24247 " guestfs_inspect_get_icon (guestfs_h *g,\n"
24248 " const char *root,\n"
24249 " size_t *size_r,\n"
24255 #: ../src/guestfs-actions.pod:2836
24258 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
24259 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
24264 #: ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:3728 ../src/guestfs-actions.pod:4982
24265 msgid "(Added in 1.11.12)"
24269 #: ../src/guestfs-actions.pod:2905
24270 msgid "guestfs_inspect_get_icon_va"
24274 #: ../src/guestfs-actions.pod:2907
24278 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
24279 " const char *root,\n"
24280 " size_t *size_r,\n"
24281 " va_list args);\n"
24286 #: ../src/guestfs-actions.pod:2913
24287 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
24291 #: ../src/guestfs-actions.pod:2917
24292 msgid "guestfs_inspect_get_icon_argv"
24296 #: ../src/guestfs-actions.pod:2919
24300 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
24301 " const char *root,\n"
24302 " size_t *size_r,\n"
24303 " const struct guestfs_inspect_get_icon_argv "
24309 #: ../src/guestfs-actions.pod:2925
24310 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
24314 #: ../src/guestfs-actions.pod:2929
24315 msgid "guestfs_inspect_get_major_version"
24319 #: ../src/guestfs-actions.pod:2931
24323 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
24324 " const char *root);\n"
24329 #: ../src/guestfs-actions.pod:2953
24330 msgid "guestfs_inspect_get_minor_version"
24334 #: ../src/guestfs-actions.pod:2955
24338 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
24339 " const char *root);\n"
24344 #: ../src/guestfs-actions.pod:2964
24346 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24347 "C<guestfs_inspect_get_major_version>."
24351 #: ../src/guestfs-actions.pod:2971
24352 msgid "guestfs_inspect_get_mountpoints"
24356 #: ../src/guestfs-actions.pod:2973
24360 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
24361 " const char *root);\n"
24366 #: ../src/guestfs-actions.pod:2994
24368 "For operating systems like Windows which still use drive letters, this call "
24369 "will only return an entry for the first drive \"mounted on\" C</>. For "
24370 "information about the mapping of drive letters to partitions, see "
24371 "C<guestfs_inspect_get_drive_mappings>."
24375 #: ../src/guestfs-actions.pod:3000
24377 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24378 "C<guestfs_inspect_get_filesystems>."
24382 #: ../src/guestfs-actions.pod:3011
24383 msgid "guestfs_inspect_get_package_format"
24387 #: ../src/guestfs-actions.pod:3013
24391 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
24392 " const char *root);\n"
24397 #: ../src/guestfs-actions.pod:3017
24399 "This function and C<guestfs_inspect_get_package_management> return the "
24400 "package format and package management tool used by the inspected operating "
24401 "system. For example for Fedora these functions would return C<rpm> (package "
24402 "format) and C<yum> (package management)."
24406 #: ../src/guestfs-actions.pod:3035 ../src/guestfs-actions.pod:3063
24407 msgid "(Added in 1.7.5)"
24411 #: ../src/guestfs-actions.pod:3037
24412 msgid "guestfs_inspect_get_package_management"
24416 #: ../src/guestfs-actions.pod:3039
24420 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
24421 " const char *root);\n"
24426 #: ../src/guestfs-actions.pod:3043
24428 "C<guestfs_inspect_get_package_format> and this function return the package "
24429 "format and package management tool used by the inspected operating system. "
24430 "For example for Fedora these functions would return C<rpm> (package format) "
24431 "and C<yum> (package management)."
24435 #: ../src/guestfs-actions.pod:3065
24436 msgid "guestfs_inspect_get_product_name"
24440 #: ../src/guestfs-actions.pod:3067
24444 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
24445 " const char *root);\n"
24450 #: ../src/guestfs-actions.pod:3086
24451 msgid "guestfs_inspect_get_product_variant"
24455 #: ../src/guestfs-actions.pod:3088
24459 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
24460 " const char *root);\n"
24465 #: ../src/guestfs-actions.pod:3111
24467 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24468 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
24472 #: ../src/guestfs-actions.pod:3118
24473 msgid "(Added in 1.9.13)"
24477 #: ../src/guestfs-actions.pod:3120
24478 msgid "guestfs_inspect_get_roots"
24482 #: ../src/guestfs-actions.pod:3122
24486 " guestfs_inspect_get_roots (guestfs_h *g);\n"
24491 #: ../src/guestfs-actions.pod:3125
24493 "This function is a convenient way to get the list of root devices, as "
24494 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
24495 "the whole inspection process."
24499 #: ../src/guestfs-actions.pod:3129
24501 "This returns an empty list if either no root devices were found or the "
24502 "caller has not called C<guestfs_inspect_os>."
24506 #: ../src/guestfs-actions.pod:3138
24507 msgid "(Added in 1.7.3)"
24511 #: ../src/guestfs-actions.pod:3140
24512 msgid "guestfs_inspect_get_type"
24516 #: ../src/guestfs-actions.pod:3142
24520 " guestfs_inspect_get_type (guestfs_h *g,\n"
24521 " const char *root);\n"
24526 #: ../src/guestfs-actions.pod:3179
24527 msgid "guestfs_inspect_get_windows_current_control_set"
24531 #: ../src/guestfs-actions.pod:3181
24535 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
24536 " const char *root);\n"
24541 #: ../src/guestfs-actions.pod:3199
24542 msgid "guestfs_inspect_get_windows_systemroot"
24546 #: ../src/guestfs-actions.pod:3201
24550 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
24551 " const char *root);\n"
24556 #: ../src/guestfs-actions.pod:3217
24557 msgid "(Added in 1.5.25)"
24561 #: ../src/guestfs-actions.pod:3219
24562 msgid "guestfs_inspect_is_live"
24566 #: ../src/guestfs-actions.pod:3221
24570 " guestfs_inspect_is_live (guestfs_h *g,\n"
24571 " const char *root);\n"
24576 #: ../src/guestfs-actions.pod:3225
24578 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24579 "disk), then this returns true if a live image was detected on the disk."
24583 #: ../src/guestfs-actions.pod:3235
24584 msgid "guestfs_inspect_is_multipart"
24588 #: ../src/guestfs-actions.pod:3237
24592 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
24593 " const char *root);\n"
24598 #: ../src/guestfs-actions.pod:3241
24600 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24601 "disk), then this returns true if the disk is part of a set."
24605 #: ../src/guestfs-actions.pod:3251
24606 msgid "guestfs_inspect_is_netinst"
24610 #: ../src/guestfs-actions.pod:3253
24614 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
24615 " const char *root);\n"
24620 #: ../src/guestfs-actions.pod:3257
24622 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24623 "disk), then this returns true if the disk is a network installer, ie. not a "
24624 "self-contained install CD but one which is likely to require network access "
24625 "to complete the install."
24629 #: ../src/guestfs-actions.pod:3269
24630 msgid "guestfs_inspect_list_applications"
24634 #: ../src/guestfs-actions.pod:3271
24637 " struct guestfs_application_list *\n"
24638 " guestfs_inspect_list_applications (guestfs_h *g,\n"
24639 " const char *root);\n"
24644 #: ../src/guestfs-actions.pod:3277
24646 "I<Note:> This call works differently from other parts of the inspection "
24647 "API. You have to call C<guestfs_inspect_os>, then "
24648 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
24649 "this. Listing applications is a significantly more difficult operation "
24650 "which requires access to the full filesystem. Also note that unlike the "
24651 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
24652 "the libguestfs handle, this call actually reads parts of the mounted "
24653 "filesystems during the call."
24657 #: ../src/guestfs-actions.pod:3367
24659 "This function returns a C<struct guestfs_application_list *>, or NULL if "
24660 "there was an error. I<The caller must call C<guestfs_free_application_list> "
24665 #: ../src/guestfs-actions.pod:3371
24666 msgid "(Added in 1.7.8)"
24670 #: ../src/guestfs-actions.pod:3373
24671 msgid "guestfs_inspect_os"
24675 #: ../src/guestfs-actions.pod:3375
24679 " guestfs_inspect_os (guestfs_h *g);\n"
24684 #: ../src/guestfs-actions.pod:3391
24686 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
24687 "functions in order to query further information about each operating system, "
24688 "such as the name and version."
24692 #: ../src/guestfs-actions.pod:3396
24694 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
24695 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
24696 "the contents. This should be called with no disks currently mounted. The "
24697 "function may also use Augeas, so any existing Augeas handle will be closed."
24701 #: ../src/guestfs-actions.pod:3408 ../src/guestfs-actions.pod:3739 ../src/guestfs-actions.pod:3821
24702 msgid "See also C<guestfs_list_filesystems>."
24706 #: ../src/guestfs-actions.pod:3416
24707 msgid "guestfs_is_blockdev"
24711 #: ../src/guestfs-actions.pod:3418
24715 " guestfs_is_blockdev (guestfs_h *g,\n"
24716 " const char *path);\n"
24721 #: ../src/guestfs-actions.pod:3425 ../src/guestfs-actions.pod:3454 ../src/guestfs-actions.pod:3484 ../src/guestfs-actions.pod:3499 ../src/guestfs-actions.pod:3515 ../src/guestfs-actions.pod:3571 ../src/guestfs-actions.pod:3586
24722 msgid "See also C<guestfs_stat>."
24726 #: ../src/guestfs-actions.pod:3429 ../src/guestfs-actions.pod:3458 ../src/guestfs-actions.pod:3503 ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3590
24727 msgid "(Added in 1.5.10)"
24731 #: ../src/guestfs-actions.pod:3431
24732 msgid "guestfs_is_busy"
24736 #: ../src/guestfs-actions.pod:3433
24740 " guestfs_is_busy (guestfs_h *g);\n"
24745 #: ../src/guestfs-actions.pod:3445
24746 msgid "guestfs_is_chardev"
24750 #: ../src/guestfs-actions.pod:3447
24754 " guestfs_is_chardev (guestfs_h *g,\n"
24755 " const char *path);\n"
24760 #: ../src/guestfs-actions.pod:3460
24761 msgid "guestfs_is_config"
24765 #: ../src/guestfs-actions.pod:3462
24769 " guestfs_is_config (guestfs_h *g);\n"
24774 #: ../src/guestfs-actions.pod:3474
24775 msgid "guestfs_is_dir"
24779 #: ../src/guestfs-actions.pod:3476
24783 " guestfs_is_dir (guestfs_h *g,\n"
24784 " const char *path);\n"
24789 #: ../src/guestfs-actions.pod:3490
24790 msgid "guestfs_is_fifo"
24794 #: ../src/guestfs-actions.pod:3492
24798 " guestfs_is_fifo (guestfs_h *g,\n"
24799 " const char *path);\n"
24804 #: ../src/guestfs-actions.pod:3505
24805 msgid "guestfs_is_file"
24809 #: ../src/guestfs-actions.pod:3507
24813 " guestfs_is_file (guestfs_h *g,\n"
24814 " const char *path);\n"
24819 #: ../src/guestfs-actions.pod:3521
24820 msgid "guestfs_is_launching"
24824 #: ../src/guestfs-actions.pod:3523
24828 " guestfs_is_launching (guestfs_h *g);\n"
24833 #: ../src/guestfs-actions.pod:3535
24834 msgid "guestfs_is_lv"
24838 #: ../src/guestfs-actions.pod:3537
24842 " guestfs_is_lv (guestfs_h *g,\n"
24843 " const char *device);\n"
24848 #: ../src/guestfs-actions.pod:3548
24849 msgid "guestfs_is_ready"
24853 #: ../src/guestfs-actions.pod:3550
24857 " guestfs_is_ready (guestfs_h *g);\n"
24862 #: ../src/guestfs-actions.pod:3562
24863 msgid "guestfs_is_socket"
24867 #: ../src/guestfs-actions.pod:3564
24871 " guestfs_is_socket (guestfs_h *g,\n"
24872 " const char *path);\n"
24877 #: ../src/guestfs-actions.pod:3577
24878 msgid "guestfs_is_symlink"
24882 #: ../src/guestfs-actions.pod:3579
24886 " guestfs_is_symlink (guestfs_h *g,\n"
24887 " const char *path);\n"
24892 #: ../src/guestfs-actions.pod:3592
24893 msgid "guestfs_is_zero"
24897 #: ../src/guestfs-actions.pod:3594
24901 " guestfs_is_zero (guestfs_h *g,\n"
24902 " const char *path);\n"
24907 #: ../src/guestfs-actions.pod:3603 ../src/guestfs-actions.pod:3617
24908 msgid "(Added in 1.11.8)"
24912 #: ../src/guestfs-actions.pod:3605
24913 msgid "guestfs_is_zero_device"
24917 #: ../src/guestfs-actions.pod:3607
24921 " guestfs_is_zero_device (guestfs_h *g,\n"
24922 " const char *device);\n"
24927 #: ../src/guestfs-actions.pod:3619
24928 msgid "guestfs_kill_subprocess"
24932 #: ../src/guestfs-actions.pod:3621
24936 " guestfs_kill_subprocess (guestfs_h *g);\n"
24941 #: ../src/guestfs-actions.pod:3630
24942 msgid "guestfs_launch"
24946 #: ../src/guestfs-actions.pod:3632
24950 " guestfs_launch (guestfs_h *g);\n"
24955 #: ../src/guestfs-actions.pod:3650
24956 msgid "guestfs_lchown"
24960 #: ../src/guestfs-actions.pod:3652
24964 " guestfs_lchown (guestfs_h *g,\n"
24967 " const char *path);\n"
24972 #: ../src/guestfs-actions.pod:3658
24974 "Change the file owner to C<owner> and group to C<group>. This is like "
24975 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
24976 "changed, not the target."
24980 #: ../src/guestfs-actions.pod:3670
24981 msgid "guestfs_lgetxattr"
24985 #: ../src/guestfs-actions.pod:3672
24989 " guestfs_lgetxattr (guestfs_h *g,\n"
24990 " const char *path,\n"
24991 " const char *name,\n"
24992 " size_t *size_r);\n"
24997 #: ../src/guestfs-actions.pod:3692
24998 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
25002 #: ../src/guestfs-actions.pod:3700
25003 msgid "guestfs_lgetxattrs"
25007 #: ../src/guestfs-actions.pod:3702
25010 " struct guestfs_xattr_list *\n"
25011 " guestfs_lgetxattrs (guestfs_h *g,\n"
25012 " const char *path);\n"
25017 #: ../src/guestfs-actions.pod:3706
25019 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
25020 "then it returns the extended attributes of the link itself."
25024 #: ../src/guestfs-actions.pod:3716
25025 msgid "guestfs_list_9p"
25029 #: ../src/guestfs-actions.pod:3718
25033 " guestfs_list_9p (guestfs_h *g);\n"
25038 #: ../src/guestfs-actions.pod:3730
25039 msgid "guestfs_list_devices"
25043 #: ../src/guestfs-actions.pod:3732
25047 " guestfs_list_devices (guestfs_h *g);\n"
25052 #: ../src/guestfs-actions.pod:3747
25053 msgid "guestfs_list_dm_devices"
25057 #: ../src/guestfs-actions.pod:3749
25061 " guestfs_list_dm_devices (guestfs_h *g);\n"
25066 #: ../src/guestfs-actions.pod:3754
25068 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
25069 "previous call to C<guestfs_luks_open>."
25073 #: ../src/guestfs-actions.pod:3757
25075 "Device mapper devices which correspond to logical volumes are I<not> "
25076 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
25081 #: ../src/guestfs-actions.pod:3765 ../src/guestfs-actions.pod:5221
25082 msgid "(Added in 1.11.15)"
25086 #: ../src/guestfs-actions.pod:3767
25087 msgid "guestfs_list_filesystems"
25091 #: ../src/guestfs-actions.pod:3769
25095 " guestfs_list_filesystems (guestfs_h *g);\n"
25100 #: ../src/guestfs-actions.pod:3789
25102 "This command runs other libguestfs commands, which might include "
25103 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
25104 "soon after launch and only when nothing is mounted."
25108 #: ../src/guestfs-actions.pod:3793
25110 "Not all of the filesystems returned will be mountable. In particular, swap "
25111 "partitions are returned in the list. Also this command does not check that "
25112 "each filesystem found is valid and mountable, and some filesystems might be "
25113 "mountable but require special options. Filesystems may not all belong to a "
25114 "single logical operating system (use C<guestfs_inspect_os> to look for "
25119 #: ../src/guestfs-actions.pod:3807 ../src/guestfs-actions.pod:5582
25120 msgid "(Added in 1.5.15)"
25124 #: ../src/guestfs-actions.pod:3809
25125 msgid "guestfs_list_partitions"
25129 #: ../src/guestfs-actions.pod:3811
25133 " guestfs_list_partitions (guestfs_h *g);\n"
25138 #: ../src/guestfs-actions.pod:3818
25140 "This does not return logical volumes. For that you will need to call "
25145 #: ../src/guestfs-actions.pod:3829
25150 #: ../src/guestfs-actions.pod:3831
25154 " guestfs_ll (guestfs_h *g,\n"
25155 " const char *directory);\n"
25160 #: ../src/guestfs-actions.pod:3846
25165 #: ../src/guestfs-actions.pod:3848
25169 " guestfs_ln (guestfs_h *g,\n"
25170 " const char *target,\n"
25171 " const char *linkname);\n"
25176 #: ../src/guestfs-actions.pod:3859
25177 msgid "guestfs_ln_f"
25181 #: ../src/guestfs-actions.pod:3861
25185 " guestfs_ln_f (guestfs_h *g,\n"
25186 " const char *target,\n"
25187 " const char *linkname);\n"
25192 #: ../src/guestfs-actions.pod:3873
25193 msgid "guestfs_ln_s"
25197 #: ../src/guestfs-actions.pod:3875
25201 " guestfs_ln_s (guestfs_h *g,\n"
25202 " const char *target,\n"
25203 " const char *linkname);\n"
25208 #: ../src/guestfs-actions.pod:3886
25209 msgid "guestfs_ln_sf"
25213 #: ../src/guestfs-actions.pod:3888
25217 " guestfs_ln_sf (guestfs_h *g,\n"
25218 " const char *target,\n"
25219 " const char *linkname);\n"
25224 #: ../src/guestfs-actions.pod:3900
25225 msgid "guestfs_lremovexattr"
25229 #: ../src/guestfs-actions.pod:3902
25233 " guestfs_lremovexattr (guestfs_h *g,\n"
25234 " const char *xattr,\n"
25235 " const char *path);\n"
25240 #: ../src/guestfs-actions.pod:3907
25242 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
25243 "link, then it removes an extended attribute of the link itself."
25247 #: ../src/guestfs-actions.pod:3915
25252 #: ../src/guestfs-actions.pod:3917
25256 " guestfs_ls (guestfs_h *g,\n"
25257 " const char *directory);\n"
25262 #: ../src/guestfs-actions.pod:3925
25264 "This command is mostly useful for interactive sessions. Programs should "
25265 "probably use C<guestfs_readdir> instead."
25269 #: ../src/guestfs-actions.pod:3934
25270 msgid "guestfs_lsetxattr"
25274 #: ../src/guestfs-actions.pod:3936
25278 " guestfs_lsetxattr (guestfs_h *g,\n"
25279 " const char *xattr,\n"
25280 " const char *val,\n"
25282 " const char *path);\n"
25287 #: ../src/guestfs-actions.pod:3943
25289 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
25290 "then it sets an extended attribute of the link itself."
25294 #: ../src/guestfs-actions.pod:3951
25295 msgid "guestfs_lstat"
25299 #: ../src/guestfs-actions.pod:3953
25302 " struct guestfs_stat *\n"
25303 " guestfs_lstat (guestfs_h *g,\n"
25304 " const char *path);\n"
25309 #: ../src/guestfs-actions.pod:3959
25311 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
25312 "link, then the link is stat-ed, not the file it refers to."
25316 #: ../src/guestfs-actions.pod:3965 ../src/guestfs-actions.pod:6740
25318 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
25319 "error. I<The caller must call C<guestfs_free_stat> after use>."
25323 #: ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:6744 ../src/guestfs-actions.pod:6762 ../src/guestfs-actions.pod:7143
25324 msgid "(Added in 0.9.2)"
25328 #: ../src/guestfs-actions.pod:3971
25329 msgid "guestfs_lstatlist"
25333 #: ../src/guestfs-actions.pod:3973
25336 " struct guestfs_stat_list *\n"
25337 " guestfs_lstatlist (guestfs_h *g,\n"
25338 " const char *path,\n"
25339 " char *const *names);\n"
25344 #: ../src/guestfs-actions.pod:3978
25346 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
25347 "files, where all files are in the directory C<path>. C<names> is the list "
25348 "of files from this directory."
25352 #: ../src/guestfs-actions.pod:3987
25354 "This call is intended for programs that want to efficiently list a directory "
25355 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
25356 "for a similarly efficient call for getting extended attributes. Very long "
25357 "directory listings might cause the protocol message size to be exceeded, "
25358 "causing this call to fail. The caller must split up such requests into "
25359 "smaller groups of names."
25363 #: ../src/guestfs-actions.pod:3995
25365 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
25366 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
25370 #: ../src/guestfs-actions.pod:4001
25371 msgid "guestfs_luks_add_key"
25375 #: ../src/guestfs-actions.pod:4003
25379 " guestfs_luks_add_key (guestfs_h *g,\n"
25380 " const char *device,\n"
25381 " const char *key,\n"
25382 " const char *newkey,\n"
25388 #: ../src/guestfs-actions.pod:4015
25390 "Note that if C<keyslot> already contains a key, then this command will "
25391 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
25395 #: ../src/guestfs-actions.pod:4021 ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4084 ../src/guestfs-actions.pod:4104 ../src/guestfs-actions.pod:4139 ../src/guestfs-actions.pod:4158
25397 "This function takes a key or passphrase parameter which could contain "
25398 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
25403 #: ../src/guestfs-actions.pod:4025 ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:4088 ../src/guestfs-actions.pod:4108
25404 msgid "(Added in 1.5.2)"
25408 #: ../src/guestfs-actions.pod:4027
25409 msgid "guestfs_luks_close"
25413 #: ../src/guestfs-actions.pod:4029
25417 " guestfs_luks_close (guestfs_h *g,\n"
25418 " const char *device);\n"
25423 #: ../src/guestfs-actions.pod:4033
25425 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
25426 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
25427 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
25428 "underlying block device."
25432 #: ../src/guestfs-actions.pod:4041 ../src/guestfs-actions.pod:4143 ../src/guestfs-actions.pod:4162 ../src/guestfs-actions.pod:4212 ../src/guestfs-actions.pod:4260
25433 msgid "(Added in 1.5.1)"
25437 #: ../src/guestfs-actions.pod:4043
25438 msgid "guestfs_luks_format"
25442 #: ../src/guestfs-actions.pod:4045
25446 " guestfs_luks_format (guestfs_h *g,\n"
25447 " const char *device,\n"
25448 " const char *key,\n"
25454 #: ../src/guestfs-actions.pod:4067
25455 msgid "guestfs_luks_format_cipher"
25459 #: ../src/guestfs-actions.pod:4069
25463 " guestfs_luks_format_cipher (guestfs_h *g,\n"
25464 " const char *device,\n"
25465 " const char *key,\n"
25467 " const char *cipher);\n"
25472 #: ../src/guestfs-actions.pod:4076
25474 "This command is the same as C<guestfs_luks_format> but it also allows you to "
25475 "set the C<cipher> used."
25479 #: ../src/guestfs-actions.pod:4090
25480 msgid "guestfs_luks_kill_slot"
25484 #: ../src/guestfs-actions.pod:4092
25488 " guestfs_luks_kill_slot (guestfs_h *g,\n"
25489 " const char *device,\n"
25490 " const char *key,\n"
25496 #: ../src/guestfs-actions.pod:4110
25497 msgid "guestfs_luks_open"
25501 #: ../src/guestfs-actions.pod:4112
25505 " guestfs_luks_open (guestfs_h *g,\n"
25506 " const char *device,\n"
25507 " const char *key,\n"
25508 " const char *mapname);\n"
25513 #: ../src/guestfs-actions.pod:4130
25515 "If this block device contains LVM volume groups, then calling "
25516 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
25521 #: ../src/guestfs-actions.pod:4134
25522 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
25526 #: ../src/guestfs-actions.pod:4145
25527 msgid "guestfs_luks_open_ro"
25531 #: ../src/guestfs-actions.pod:4147
25535 " guestfs_luks_open_ro (guestfs_h *g,\n"
25536 " const char *device,\n"
25537 " const char *key,\n"
25538 " const char *mapname);\n"
25543 #: ../src/guestfs-actions.pod:4153
25545 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
25550 #: ../src/guestfs-actions.pod:4164
25551 msgid "guestfs_lvcreate"
25555 #: ../src/guestfs-actions.pod:4166
25559 " guestfs_lvcreate (guestfs_h *g,\n"
25560 " const char *logvol,\n"
25561 " const char *volgroup,\n"
25567 #: ../src/guestfs-actions.pod:4179
25568 msgid "guestfs_lvm_canonical_lv_name"
25572 #: ../src/guestfs-actions.pod:4181
25576 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
25577 " const char *lvname);\n"
25582 #: ../src/guestfs-actions.pod:4192
25583 msgid "See also C<guestfs_is_lv>."
25587 #: ../src/guestfs-actions.pod:4197
25588 msgid "(Added in 1.5.24)"
25592 #: ../src/guestfs-actions.pod:4199
25593 msgid "guestfs_lvm_clear_filter"
25597 #: ../src/guestfs-actions.pod:4201
25601 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
25606 #: ../src/guestfs-actions.pod:4204
25608 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
25609 "see every block device."
25613 #: ../src/guestfs-actions.pod:4214
25614 msgid "guestfs_lvm_remove_all"
25618 #: ../src/guestfs-actions.pod:4216
25622 " guestfs_lvm_remove_all (guestfs_h *g);\n"
25627 #: ../src/guestfs-actions.pod:4229
25628 msgid "guestfs_lvm_set_filter"
25632 #: ../src/guestfs-actions.pod:4231
25636 " guestfs_lvm_set_filter (guestfs_h *g,\n"
25637 " char *const *devices);\n"
25642 #: ../src/guestfs-actions.pod:4262
25643 msgid "guestfs_lvremove"
25647 #: ../src/guestfs-actions.pod:4264
25651 " guestfs_lvremove (guestfs_h *g,\n"
25652 " const char *device);\n"
25657 #: ../src/guestfs-actions.pod:4276 ../src/guestfs-actions.pod:5679 ../src/guestfs-actions.pod:7513
25658 msgid "(Added in 1.0.13)"
25662 #: ../src/guestfs-actions.pod:4278
25663 msgid "guestfs_lvrename"
25667 #: ../src/guestfs-actions.pod:4280
25671 " guestfs_lvrename (guestfs_h *g,\n"
25672 " const char *logvol,\n"
25673 " const char *newlogvol);\n"
25678 #: ../src/guestfs-actions.pod:4289 ../src/guestfs-actions.pod:7526
25679 msgid "(Added in 1.0.83)"
25683 #: ../src/guestfs-actions.pod:4291
25684 msgid "guestfs_lvresize"
25688 #: ../src/guestfs-actions.pod:4293
25692 " guestfs_lvresize (guestfs_h *g,\n"
25693 " const char *device,\n"
25699 #: ../src/guestfs-actions.pod:4306
25700 msgid "guestfs_lvresize_free"
25704 #: ../src/guestfs-actions.pod:4308
25708 " guestfs_lvresize_free (guestfs_h *g,\n"
25709 " const char *lv,\n"
25715 #: ../src/guestfs-actions.pod:4321
25716 msgid "(Added in 1.3.3)"
25720 #: ../src/guestfs-actions.pod:4323
25721 msgid "guestfs_lvs"
25725 #: ../src/guestfs-actions.pod:4325
25729 " guestfs_lvs (guestfs_h *g);\n"
25734 #: ../src/guestfs-actions.pod:4334
25735 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
25739 #: ../src/guestfs-actions.pod:4342
25740 msgid "guestfs_lvs_full"
25744 #: ../src/guestfs-actions.pod:4344
25747 " struct guestfs_lvm_lv_list *\n"
25748 " guestfs_lvs_full (guestfs_h *g);\n"
25753 #: ../src/guestfs-actions.pod:4350
25755 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
25756 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
25761 #: ../src/guestfs-actions.pod:4356
25762 msgid "guestfs_lvuuid"
25766 #: ../src/guestfs-actions.pod:4358
25770 " guestfs_lvuuid (guestfs_h *g,\n"
25771 " const char *device);\n"
25776 #: ../src/guestfs-actions.pod:4369
25777 msgid "guestfs_lxattrlist"
25781 #: ../src/guestfs-actions.pod:4371
25784 " struct guestfs_xattr_list *\n"
25785 " guestfs_lxattrlist (guestfs_h *g,\n"
25786 " const char *path,\n"
25787 " char *const *names);\n"
25792 #: ../src/guestfs-actions.pod:4390
25794 "This call is intended for programs that want to efficiently list a directory "
25795 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
25796 "a similarly efficient call for getting standard stats. Very long directory "
25797 "listings might cause the protocol message size to be exceeded, causing this "
25798 "call to fail. The caller must split up such requests into smaller groups of "
25803 #: ../src/guestfs-actions.pod:4404
25804 msgid "guestfs_mkdir"
25808 #: ../src/guestfs-actions.pod:4406
25812 " guestfs_mkdir (guestfs_h *g,\n"
25813 " const char *path);\n"
25818 #: ../src/guestfs-actions.pod:4416
25819 msgid "guestfs_mkdir_mode"
25823 #: ../src/guestfs-actions.pod:4418
25827 " guestfs_mkdir_mode (guestfs_h *g,\n"
25828 " const char *path,\n"
25834 #: ../src/guestfs-actions.pod:4430
25835 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
25839 #: ../src/guestfs-actions.pod:4436
25840 msgid "guestfs_mkdir_p"
25844 #: ../src/guestfs-actions.pod:4438
25848 " guestfs_mkdir_p (guestfs_h *g,\n"
25849 " const char *path);\n"
25854 #: ../src/guestfs-actions.pod:4449
25855 msgid "guestfs_mkdtemp"
25859 #: ../src/guestfs-actions.pod:4451
25863 " guestfs_mkdtemp (guestfs_h *g,\n"
25864 " const char *template);\n"
25869 #: ../src/guestfs-actions.pod:4479
25870 msgid "guestfs_mke2fs_J"
25874 #: ../src/guestfs-actions.pod:4481
25878 " guestfs_mke2fs_J (guestfs_h *g,\n"
25879 " const char *fstype,\n"
25880 " int blocksize,\n"
25881 " const char *device,\n"
25882 " const char *journal);\n"
25887 #: ../src/guestfs-actions.pod:4494
25888 msgid "See also C<guestfs_mke2journal>."
25892 #: ../src/guestfs-actions.pod:4498 ../src/guestfs-actions.pod:4516 ../src/guestfs-actions.pod:4534 ../src/guestfs-actions.pod:4550 ../src/guestfs-actions.pod:4564 ../src/guestfs-actions.pod:4578 ../src/guestfs-actions.pod:4637 ../src/guestfs-actions.pod:4914
25893 msgid "(Added in 1.0.68)"
25897 #: ../src/guestfs-actions.pod:4500
25898 msgid "guestfs_mke2fs_JL"
25902 #: ../src/guestfs-actions.pod:4502
25906 " guestfs_mke2fs_JL (guestfs_h *g,\n"
25907 " const char *fstype,\n"
25908 " int blocksize,\n"
25909 " const char *device,\n"
25910 " const char *label);\n"
25915 #: ../src/guestfs-actions.pod:4512
25916 msgid "See also C<guestfs_mke2journal_L>."
25920 #: ../src/guestfs-actions.pod:4518
25921 msgid "guestfs_mke2fs_JU"
25925 #: ../src/guestfs-actions.pod:4520
25929 " guestfs_mke2fs_JU (guestfs_h *g,\n"
25930 " const char *fstype,\n"
25931 " int blocksize,\n"
25932 " const char *device,\n"
25933 " const char *uuid);\n"
25938 #: ../src/guestfs-actions.pod:4530
25939 msgid "See also C<guestfs_mke2journal_U>."
25943 #: ../src/guestfs-actions.pod:4536
25944 msgid "guestfs_mke2journal"
25948 #: ../src/guestfs-actions.pod:4538
25952 " guestfs_mke2journal (guestfs_h *g,\n"
25953 " int blocksize,\n"
25954 " const char *device);\n"
25959 #: ../src/guestfs-actions.pod:4552
25960 msgid "guestfs_mke2journal_L"
25964 #: ../src/guestfs-actions.pod:4554
25968 " guestfs_mke2journal_L (guestfs_h *g,\n"
25969 " int blocksize,\n"
25970 " const char *label,\n"
25971 " const char *device);\n"
25976 #: ../src/guestfs-actions.pod:4566
25977 msgid "guestfs_mke2journal_U"
25981 #: ../src/guestfs-actions.pod:4568
25985 " guestfs_mke2journal_U (guestfs_h *g,\n"
25986 " int blocksize,\n"
25987 " const char *uuid,\n"
25988 " const char *device);\n"
25993 #: ../src/guestfs-actions.pod:4580
25994 msgid "guestfs_mkfifo"
25998 #: ../src/guestfs-actions.pod:4582
26002 " guestfs_mkfifo (guestfs_h *g,\n"
26004 " const char *path);\n"
26009 #: ../src/guestfs-actions.pod:4587
26011 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
26012 "is just a convenient wrapper around C<guestfs_mknod>."
26016 #: ../src/guestfs-actions.pod:4597
26017 msgid "guestfs_mkfs"
26021 #: ../src/guestfs-actions.pod:4599
26025 " guestfs_mkfs (guestfs_h *g,\n"
26026 " const char *fstype,\n"
26027 " const char *device);\n"
26032 #: ../src/guestfs-actions.pod:4612
26033 msgid "guestfs_mkfs_b"
26037 #: ../src/guestfs-actions.pod:4614
26041 " guestfs_mkfs_b (guestfs_h *g,\n"
26042 " const char *fstype,\n"
26043 " int blocksize,\n"
26044 " const char *device);\n"
26049 #: ../src/guestfs-actions.pod:4620
26051 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
26056 #: ../src/guestfs-actions.pod:4627
26058 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
26059 "block size of the resulting filesystem. Supported block sizes depend on the "
26060 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
26064 #: ../src/guestfs-actions.pod:4639
26065 msgid "guestfs_mkfs_opts"
26069 #: ../src/guestfs-actions.pod:4641
26073 " guestfs_mkfs_opts (guestfs_h *g,\n"
26074 " const char *fstype,\n"
26075 " const char *device,\n"
26081 #: ../src/guestfs-actions.pod:4652
26084 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
26085 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
26086 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
26087 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
26092 #: ../src/guestfs-actions.pod:4700
26093 msgid "(Added in 1.7.19)"
26097 #: ../src/guestfs-actions.pod:4702
26098 msgid "guestfs_mkfs_opts_va"
26102 #: ../src/guestfs-actions.pod:4704
26106 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
26107 " const char *fstype,\n"
26108 " const char *device,\n"
26109 " va_list args);\n"
26114 #: ../src/guestfs-actions.pod:4710
26115 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
26119 #: ../src/guestfs-actions.pod:4714
26120 msgid "guestfs_mkfs_opts_argv"
26124 #: ../src/guestfs-actions.pod:4716
26128 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
26129 " const char *fstype,\n"
26130 " const char *device,\n"
26131 " const struct guestfs_mkfs_opts_argv *optargs);\n"
26136 #: ../src/guestfs-actions.pod:4722
26137 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
26141 #: ../src/guestfs-actions.pod:4726
26142 msgid "guestfs_mkmountpoint"
26146 #: ../src/guestfs-actions.pod:4728
26150 " guestfs_mkmountpoint (guestfs_h *g,\n"
26151 " const char *exemptpath);\n"
26156 #: ../src/guestfs-actions.pod:4732
26158 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
26159 "that can be used to create extra mountpoints before mounting the first "
26164 #: ../src/guestfs-actions.pod:4756
26166 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
26167 "may get unexpected errors if you try to mix these calls. It is safest to "
26168 "manually unmount filesystems and remove mountpoints after use."
26172 #: ../src/guestfs-actions.pod:4760
26174 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
26175 "first, so for this to work for manual mountpoints, you must ensure that the "
26176 "innermost mountpoints have the longest pathnames, as in the example code "
26181 #: ../src/guestfs-actions.pod:4767
26183 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
26184 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
26185 "can also trigger these issues."
26189 #: ../src/guestfs-actions.pod:4773 ../src/guestfs-actions.pod:5089 ../src/guestfs-actions.pod:6099
26190 msgid "(Added in 1.0.62)"
26194 #: ../src/guestfs-actions.pod:4775
26195 msgid "guestfs_mknod"
26199 #: ../src/guestfs-actions.pod:4777
26203 " guestfs_mknod (guestfs_h *g,\n"
26207 " const char *path);\n"
26212 #: ../src/guestfs-actions.pod:4792
26214 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
26215 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
26216 "regular file). These constants are available in the standard Linux header "
26217 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
26218 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
26219 "the appropriate constant for you."
26223 #: ../src/guestfs-actions.pod:4806
26224 msgid "guestfs_mknod_b"
26228 #: ../src/guestfs-actions.pod:4808
26232 " guestfs_mknod_b (guestfs_h *g,\n"
26236 " const char *path);\n"
26241 #: ../src/guestfs-actions.pod:4815
26243 "This call creates a block device node called C<path> with mode C<mode> and "
26244 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26245 "wrapper around C<guestfs_mknod>."
26249 #: ../src/guestfs-actions.pod:4825
26250 msgid "guestfs_mknod_c"
26254 #: ../src/guestfs-actions.pod:4827
26258 " guestfs_mknod_c (guestfs_h *g,\n"
26262 " const char *path);\n"
26267 #: ../src/guestfs-actions.pod:4834
26269 "This call creates a char device node called C<path> with mode C<mode> and "
26270 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26271 "wrapper around C<guestfs_mknod>."
26275 #: ../src/guestfs-actions.pod:4844
26276 msgid "guestfs_mkswap"
26280 #: ../src/guestfs-actions.pod:4846
26284 " guestfs_mkswap (guestfs_h *g,\n"
26285 " const char *device);\n"
26290 #: ../src/guestfs-actions.pod:4856
26291 msgid "guestfs_mkswap_L"
26295 #: ../src/guestfs-actions.pod:4858
26299 " guestfs_mkswap_L (guestfs_h *g,\n"
26300 " const char *label,\n"
26301 " const char *device);\n"
26306 #: ../src/guestfs-actions.pod:4873
26307 msgid "guestfs_mkswap_U"
26311 #: ../src/guestfs-actions.pod:4875
26315 " guestfs_mkswap_U (guestfs_h *g,\n"
26316 " const char *uuid,\n"
26317 " const char *device);\n"
26322 #: ../src/guestfs-actions.pod:4886
26323 msgid "guestfs_mkswap_file"
26327 #: ../src/guestfs-actions.pod:4888
26331 " guestfs_mkswap_file (guestfs_h *g,\n"
26332 " const char *path);\n"
26337 #: ../src/guestfs-actions.pod:4894
26339 "This command just writes a swap file signature to an existing file. To "
26340 "create the file itself, use something like C<guestfs_fallocate>."
26344 #: ../src/guestfs-actions.pod:4901
26345 msgid "guestfs_modprobe"
26349 #: ../src/guestfs-actions.pod:4903
26353 " guestfs_modprobe (guestfs_h *g,\n"
26354 " const char *modulename);\n"
26359 #: ../src/guestfs-actions.pod:4916
26360 msgid "guestfs_mount"
26364 #: ../src/guestfs-actions.pod:4918
26368 " guestfs_mount (guestfs_h *g,\n"
26369 " const char *device,\n"
26370 " const char *mountpoint);\n"
26375 #: ../src/guestfs-actions.pod:4923
26377 "I<This function is deprecated.> In new code, use the "
26378 "L</guestfs_mount_options> call instead."
26382 #: ../src/guestfs-actions.pod:4944
26384 "B<Important note:> When you use this call, the filesystem options C<sync> "
26385 "and C<noatime> are set implicitly. This was originally done because we "
26386 "thought it would improve reliability, but it turns out that I<-o sync> has a "
26387 "very large negative performance impact and negligible effect on "
26388 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
26389 "in any code that needs performance, and instead use C<guestfs_mount_options> "
26390 "(use an empty string for the first parameter if you don't want any options)."
26394 #: ../src/guestfs-actions.pod:4958
26395 msgid "guestfs_mount_9p"
26399 #: ../src/guestfs-actions.pod:4960
26403 " guestfs_mount_9p (guestfs_h *g,\n"
26404 " const char *mounttag,\n"
26405 " const char *mountpoint,\n"
26411 #: ../src/guestfs-actions.pod:4971
26414 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
26419 #: ../src/guestfs-actions.pod:4984
26420 msgid "guestfs_mount_9p_va"
26424 #: ../src/guestfs-actions.pod:4986
26428 " guestfs_mount_9p_va (guestfs_h *g,\n"
26429 " const char *mounttag,\n"
26430 " const char *mountpoint,\n"
26431 " va_list args);\n"
26436 #: ../src/guestfs-actions.pod:4992
26437 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
26441 #: ../src/guestfs-actions.pod:4996
26442 msgid "guestfs_mount_9p_argv"
26446 #: ../src/guestfs-actions.pod:4998
26450 " guestfs_mount_9p_argv (guestfs_h *g,\n"
26451 " const char *mounttag,\n"
26452 " const char *mountpoint,\n"
26453 " const struct guestfs_mount_9p_argv *optargs);\n"
26458 #: ../src/guestfs-actions.pod:5004
26459 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
26463 #: ../src/guestfs-actions.pod:5008
26464 msgid "guestfs_mount_loop"
26468 #: ../src/guestfs-actions.pod:5010
26472 " guestfs_mount_loop (guestfs_h *g,\n"
26473 " const char *file,\n"
26474 " const char *mountpoint);\n"
26479 #: ../src/guestfs-actions.pod:5023
26480 msgid "guestfs_mount_options"
26484 #: ../src/guestfs-actions.pod:5025
26488 " guestfs_mount_options (guestfs_h *g,\n"
26489 " const char *options,\n"
26490 " const char *device,\n"
26491 " const char *mountpoint);\n"
26496 #: ../src/guestfs-actions.pod:5031
26498 "This is the same as the C<guestfs_mount> command, but it allows you to set "
26499 "the mount options as for the L<mount(8)> I<-o> flag."
26503 #: ../src/guestfs-actions.pod:5041 ../src/guestfs-actions.pod:5055 ../src/guestfs-actions.pod:5072
26504 msgid "(Added in 1.0.10)"
26508 #: ../src/guestfs-actions.pod:5043
26509 msgid "guestfs_mount_ro"
26513 #: ../src/guestfs-actions.pod:5045
26517 " guestfs_mount_ro (guestfs_h *g,\n"
26518 " const char *device,\n"
26519 " const char *mountpoint);\n"
26524 #: ../src/guestfs-actions.pod:5050
26526 "This is the same as the C<guestfs_mount> command, but it mounts the "
26527 "filesystem with the read-only (I<-o ro>) flag."
26531 #: ../src/guestfs-actions.pod:5057
26532 msgid "guestfs_mount_vfs"
26536 #: ../src/guestfs-actions.pod:5059
26540 " guestfs_mount_vfs (guestfs_h *g,\n"
26541 " const char *options,\n"
26542 " const char *vfstype,\n"
26543 " const char *device,\n"
26544 " const char *mountpoint);\n"
26549 #: ../src/guestfs-actions.pod:5066
26551 "This is the same as the C<guestfs_mount> command, but it allows you to set "
26552 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
26557 #: ../src/guestfs-actions.pod:5074
26558 msgid "guestfs_mountpoints"
26562 #: ../src/guestfs-actions.pod:5076
26566 " guestfs_mountpoints (guestfs_h *g);\n"
26571 #: ../src/guestfs-actions.pod:5079
26573 "This call is similar to C<guestfs_mounts>. That call returns a list of "
26574 "devices. This one returns a hash table (map) of device name to directory "
26575 "where the device is mounted."
26579 #: ../src/guestfs-actions.pod:5091
26580 msgid "guestfs_mounts"
26584 #: ../src/guestfs-actions.pod:5093
26588 " guestfs_mounts (guestfs_h *g);\n"
26593 #: ../src/guestfs-actions.pod:5101
26594 msgid "See also: C<guestfs_mountpoints>"
26598 #: ../src/guestfs-actions.pod:5109
26603 #: ../src/guestfs-actions.pod:5111
26607 " guestfs_mv (guestfs_h *g,\n"
26608 " const char *src,\n"
26609 " const char *dest);\n"
26614 #: ../src/guestfs-actions.pod:5123
26615 msgid "guestfs_ntfs_3g_probe"
26619 #: ../src/guestfs-actions.pod:5125
26623 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
26625 " const char *device);\n"
26630 #: ../src/guestfs-actions.pod:5144
26631 msgid "(Added in 1.0.43)"
26635 #: ../src/guestfs-actions.pod:5146
26636 msgid "guestfs_ntfsresize"
26640 #: ../src/guestfs-actions.pod:5148
26644 " guestfs_ntfsresize (guestfs_h *g,\n"
26645 " const char *device);\n"
26650 #: ../src/guestfs-actions.pod:5152 ../src/guestfs-actions.pod:5252
26652 "I<This function is deprecated.> In new code, use the "
26653 "L</guestfs_ntfsresize_opts> call instead."
26657 #: ../src/guestfs-actions.pod:5176
26658 msgid "guestfs_ntfsresize_opts"
26662 #: ../src/guestfs-actions.pod:5178
26666 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
26667 " const char *device,\n"
26673 #: ../src/guestfs-actions.pod:5188
26676 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
26677 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
26682 #: ../src/guestfs-actions.pod:5208
26684 "After the resize operation, the filesystem is always marked as requiring a "
26685 "consistency check (for safety). You have to boot into Windows to perform "
26686 "this check and clear this condition. If you I<don't> set the C<force> "
26687 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
26688 "times on a single filesystem without booting into Windows between each "
26693 #: ../src/guestfs-actions.pod:5223
26694 msgid "guestfs_ntfsresize_opts_va"
26698 #: ../src/guestfs-actions.pod:5225
26702 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
26703 " const char *device,\n"
26704 " va_list args);\n"
26709 #: ../src/guestfs-actions.pod:5230
26710 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
26714 #: ../src/guestfs-actions.pod:5234
26715 msgid "guestfs_ntfsresize_opts_argv"
26719 #: ../src/guestfs-actions.pod:5236
26723 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
26724 " const char *device,\n"
26725 " const struct guestfs_ntfsresize_opts_argv "
26731 #: ../src/guestfs-actions.pod:5241
26732 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
26736 #: ../src/guestfs-actions.pod:5245
26737 msgid "guestfs_ntfsresize_size"
26741 #: ../src/guestfs-actions.pod:5247
26745 " guestfs_ntfsresize_size (guestfs_h *g,\n"
26746 " const char *device,\n"
26747 " int64_t size);\n"
26752 #: ../src/guestfs-actions.pod:5259
26754 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
26755 "to specify the new size (in bytes) explicitly."
26759 #: ../src/guestfs-actions.pod:5264 ../src/guestfs-actions.pod:5706 ../src/guestfs-actions.pod:5779 ../src/guestfs-actions.pod:6047 ../src/guestfs-actions.pod:7670
26760 msgid "(Added in 1.3.14)"
26764 #: ../src/guestfs-actions.pod:5266
26765 msgid "guestfs_part_add"
26769 #: ../src/guestfs-actions.pod:5268
26773 " guestfs_part_add (guestfs_h *g,\n"
26774 " const char *device,\n"
26775 " const char *prlogex,\n"
26776 " int64_t startsect,\n"
26777 " int64_t endsect);\n"
26782 #: ../src/guestfs-actions.pod:5275
26784 "This command adds a partition to C<device>. If there is no partition table "
26785 "on the device, call C<guestfs_part_init> first."
26789 #: ../src/guestfs-actions.pod:5287
26791 "Creating a partition which covers the whole disk is not so easy. Use "
26792 "C<guestfs_part_disk> to do that."
26796 #: ../src/guestfs-actions.pod:5292 ../src/guestfs-actions.pod:5330 ../src/guestfs-actions.pod:5383 ../src/guestfs-actions.pod:5467 ../src/guestfs-actions.pod:5505 ../src/guestfs-actions.pod:5524 ../src/guestfs-actions.pod:5564
26797 msgid "(Added in 1.0.78)"
26801 #: ../src/guestfs-actions.pod:5294
26802 msgid "guestfs_part_del"
26806 #: ../src/guestfs-actions.pod:5296
26810 " guestfs_part_del (guestfs_h *g,\n"
26811 " const char *device,\n"
26817 #: ../src/guestfs-actions.pod:5311
26818 msgid "guestfs_part_disk"
26822 #: ../src/guestfs-actions.pod:5313
26826 " guestfs_part_disk (guestfs_h *g,\n"
26827 " const char *device,\n"
26828 " const char *parttype);\n"
26833 #: ../src/guestfs-actions.pod:5318
26835 "This command is simply a combination of C<guestfs_part_init> followed by "
26836 "C<guestfs_part_add> to create a single primary partition covering the whole "
26841 #: ../src/guestfs-actions.pod:5322
26843 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
26844 "possible values are described in C<guestfs_part_init>."
26848 #: ../src/guestfs-actions.pod:5332
26849 msgid "guestfs_part_get_bootable"
26853 #: ../src/guestfs-actions.pod:5334
26857 " guestfs_part_get_bootable (guestfs_h *g,\n"
26858 " const char *device,\n"
26864 #: ../src/guestfs-actions.pod:5342
26865 msgid "See also C<guestfs_part_set_bootable>."
26869 #: ../src/guestfs-actions.pod:5348
26870 msgid "guestfs_part_get_mbr_id"
26874 #: ../src/guestfs-actions.pod:5350
26878 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
26879 " const char *device,\n"
26885 #: ../src/guestfs-actions.pod:5358 ../src/guestfs-actions.pod:5540
26887 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
26888 "undefined results for other partition table types (see "
26889 "C<guestfs_part_get_parttype>)."
26893 #: ../src/guestfs-actions.pod:5366
26894 msgid "guestfs_part_get_parttype"
26898 #: ../src/guestfs-actions.pod:5368
26902 " guestfs_part_get_parttype (guestfs_h *g,\n"
26903 " const char *device);\n"
26908 #: ../src/guestfs-actions.pod:5375
26910 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
26911 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
26912 "possible, although unusual. See C<guestfs_part_init> for a full list."
26916 #: ../src/guestfs-actions.pod:5385
26917 msgid "guestfs_part_init"
26921 #: ../src/guestfs-actions.pod:5387
26925 " guestfs_part_init (guestfs_h *g,\n"
26926 " const char *device,\n"
26927 " const char *parttype);\n"
26932 #: ../src/guestfs-actions.pod:5396
26934 "Initially there are no partitions. Following this, you should call "
26935 "C<guestfs_part_add> for each partition required."
26939 #: ../src/guestfs-actions.pod:5469
26940 msgid "guestfs_part_list"
26944 #: ../src/guestfs-actions.pod:5471
26947 " struct guestfs_partition_list *\n"
26948 " guestfs_part_list (guestfs_h *g,\n"
26949 " const char *device);\n"
26954 #: ../src/guestfs-actions.pod:5488
26956 "Start of the partition I<in bytes>. To get sectors you have to divide by "
26957 "the device's sector size, see C<guestfs_blockdev_getss>."
26961 #: ../src/guestfs-actions.pod:5501
26963 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
26964 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
26969 #: ../src/guestfs-actions.pod:5507
26970 msgid "guestfs_part_set_bootable"
26974 #: ../src/guestfs-actions.pod:5509
26978 " guestfs_part_set_bootable (guestfs_h *g,\n"
26979 " const char *device,\n"
26981 " int bootable);\n"
26986 #: ../src/guestfs-actions.pod:5526
26987 msgid "guestfs_part_set_mbr_id"
26991 #: ../src/guestfs-actions.pod:5528
26995 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
26996 " const char *device,\n"
27003 #: ../src/guestfs-actions.pod:5548
27004 msgid "guestfs_part_set_name"
27008 #: ../src/guestfs-actions.pod:5550
27012 " guestfs_part_set_name (guestfs_h *g,\n"
27013 " const char *device,\n"
27015 " const char *name);\n"
27020 #: ../src/guestfs-actions.pod:5566
27021 msgid "guestfs_part_to_dev"
27025 #: ../src/guestfs-actions.pod:5568
27029 " guestfs_part_to_dev (guestfs_h *g,\n"
27030 " const char *partition);\n"
27035 #: ../src/guestfs-actions.pod:5576
27037 "The named partition must exist, for example as a string returned from "
27038 "C<guestfs_list_partitions>."
27042 #: ../src/guestfs-actions.pod:5584
27043 msgid "guestfs_ping_daemon"
27047 #: ../src/guestfs-actions.pod:5586
27051 " guestfs_ping_daemon (guestfs_h *g);\n"
27056 #: ../src/guestfs-actions.pod:5598
27057 msgid "guestfs_pread"
27061 #: ../src/guestfs-actions.pod:5600
27065 " guestfs_pread (guestfs_h *g,\n"
27066 " const char *path,\n"
27068 " int64_t offset,\n"
27069 " size_t *size_r);\n"
27074 #: ../src/guestfs-actions.pod:5613
27075 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
27079 #: ../src/guestfs-actions.pod:5624
27080 msgid "guestfs_pread_device"
27084 #: ../src/guestfs-actions.pod:5626
27088 " guestfs_pread_device (guestfs_h *g,\n"
27089 " const char *device,\n"
27091 " int64_t offset,\n"
27092 " size_t *size_r);\n"
27097 #: ../src/guestfs-actions.pod:5639
27098 msgid "See also C<guestfs_pread>."
27102 #: ../src/guestfs-actions.pod:5648
27103 msgid "(Added in 1.5.21)"
27107 #: ../src/guestfs-actions.pod:5650
27108 msgid "guestfs_pvcreate"
27112 #: ../src/guestfs-actions.pod:5652
27116 " guestfs_pvcreate (guestfs_h *g,\n"
27117 " const char *device);\n"
27122 #: ../src/guestfs-actions.pod:5664
27123 msgid "guestfs_pvremove"
27127 #: ../src/guestfs-actions.pod:5666
27131 " guestfs_pvremove (guestfs_h *g,\n"
27132 " const char *device);\n"
27137 #: ../src/guestfs-actions.pod:5681
27138 msgid "guestfs_pvresize"
27142 #: ../src/guestfs-actions.pod:5683
27146 " guestfs_pvresize (guestfs_h *g,\n"
27147 " const char *device);\n"
27152 #: ../src/guestfs-actions.pod:5694
27153 msgid "guestfs_pvresize_size"
27157 #: ../src/guestfs-actions.pod:5696
27161 " guestfs_pvresize_size (guestfs_h *g,\n"
27162 " const char *device,\n"
27163 " int64_t size);\n"
27168 #: ../src/guestfs-actions.pod:5701
27170 "This command is the same as C<guestfs_pvresize> except that it allows you to "
27171 "specify the new size (in bytes) explicitly."
27175 #: ../src/guestfs-actions.pod:5708
27176 msgid "guestfs_pvs"
27180 #: ../src/guestfs-actions.pod:5710
27184 " guestfs_pvs (guestfs_h *g);\n"
27189 #: ../src/guestfs-actions.pod:5719
27190 msgid "See also C<guestfs_pvs_full>."
27194 #: ../src/guestfs-actions.pod:5727
27195 msgid "guestfs_pvs_full"
27199 #: ../src/guestfs-actions.pod:5729
27202 " struct guestfs_lvm_pv_list *\n"
27203 " guestfs_pvs_full (guestfs_h *g);\n"
27208 #: ../src/guestfs-actions.pod:5735
27210 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
27211 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
27216 #: ../src/guestfs-actions.pod:5741
27217 msgid "guestfs_pvuuid"
27221 #: ../src/guestfs-actions.pod:5743
27225 " guestfs_pvuuid (guestfs_h *g,\n"
27226 " const char *device);\n"
27231 #: ../src/guestfs-actions.pod:5754
27232 msgid "guestfs_pwrite"
27236 #: ../src/guestfs-actions.pod:5756
27240 " guestfs_pwrite (guestfs_h *g,\n"
27241 " const char *path,\n"
27242 " const char *content,\n"
27243 " size_t content_size,\n"
27244 " int64_t offset);\n"
27249 #: ../src/guestfs-actions.pod:5772
27250 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
27254 #: ../src/guestfs-actions.pod:5781
27255 msgid "guestfs_pwrite_device"
27259 #: ../src/guestfs-actions.pod:5783
27263 " guestfs_pwrite_device (guestfs_h *g,\n"
27264 " const char *device,\n"
27265 " const char *content,\n"
27266 " size_t content_size,\n"
27267 " int64_t offset);\n"
27272 #: ../src/guestfs-actions.pod:5798
27273 msgid "See also C<guestfs_pwrite>."
27277 #: ../src/guestfs-actions.pod:5805
27278 msgid "(Added in 1.5.20)"
27282 #: ../src/guestfs-actions.pod:5807
27283 msgid "guestfs_read_file"
27287 #: ../src/guestfs-actions.pod:5809
27291 " guestfs_read_file (guestfs_h *g,\n"
27292 " const char *path,\n"
27293 " size_t *size_r);\n"
27298 #: ../src/guestfs-actions.pod:5817
27300 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
27301 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
27302 "function is limited in the total size of file that can be handled."
27306 #: ../src/guestfs-actions.pod:5829
27307 msgid "(Added in 1.0.63)"
27311 #: ../src/guestfs-actions.pod:5831
27312 msgid "guestfs_read_lines"
27316 #: ../src/guestfs-actions.pod:5833
27320 " guestfs_read_lines (guestfs_h *g,\n"
27321 " const char *path);\n"
27326 #: ../src/guestfs-actions.pod:5842
27328 "Note that this function cannot correctly handle binary files (specifically, "
27329 "files containing C<\\0> character which is treated as end of line). For "
27330 "those you need to use the C<guestfs_read_file> function which has a more "
27331 "complex interface."
27335 #: ../src/guestfs-actions.pod:5853
27336 msgid "guestfs_readdir"
27340 #: ../src/guestfs-actions.pod:5855
27343 " struct guestfs_dirent_list *\n"
27344 " guestfs_readdir (guestfs_h *g,\n"
27345 " const char *dir);\n"
27350 #: ../src/guestfs-actions.pod:5909
27352 "This function is primarily intended for use by programs. To get a simple "
27353 "list of names, use C<guestfs_ls>. To get a printable directory for human "
27354 "consumption, use C<guestfs_ll>."
27358 #: ../src/guestfs-actions.pod:5913
27360 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
27361 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
27366 #: ../src/guestfs-actions.pod:5919
27367 msgid "guestfs_readlink"
27371 #: ../src/guestfs-actions.pod:5921
27375 " guestfs_readlink (guestfs_h *g,\n"
27376 " const char *path);\n"
27381 #: ../src/guestfs-actions.pod:5932
27382 msgid "guestfs_readlinklist"
27386 #: ../src/guestfs-actions.pod:5934
27390 " guestfs_readlinklist (guestfs_h *g,\n"
27391 " const char *path,\n"
27392 " char *const *names);\n"
27397 #: ../src/guestfs-actions.pod:5967
27398 msgid "guestfs_realpath"
27402 #: ../src/guestfs-actions.pod:5969
27406 " guestfs_realpath (guestfs_h *g,\n"
27407 " const char *path);\n"
27412 #: ../src/guestfs-actions.pod:5981
27413 msgid "guestfs_removexattr"
27417 #: ../src/guestfs-actions.pod:5983
27421 " guestfs_removexattr (guestfs_h *g,\n"
27422 " const char *xattr,\n"
27423 " const char *path);\n"
27428 #: ../src/guestfs-actions.pod:5991
27429 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
27433 #: ../src/guestfs-actions.pod:5997
27434 msgid "guestfs_resize2fs"
27438 #: ../src/guestfs-actions.pod:5999
27442 " guestfs_resize2fs (guestfs_h *g,\n"
27443 " const char *device);\n"
27448 #: ../src/guestfs-actions.pod:6006
27450 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
27451 "C<device> before calling this command. For unknown reasons C<resize2fs> "
27452 "sometimes gives an error about this and sometimes not. In any case, it is "
27453 "always safe to call C<guestfs_e2fsck_f> before calling this function."
27457 #: ../src/guestfs-actions.pod:6016
27458 msgid "guestfs_resize2fs_M"
27462 #: ../src/guestfs-actions.pod:6018
27466 " guestfs_resize2fs_M (guestfs_h *g,\n"
27467 " const char *device);\n"
27472 #: ../src/guestfs-actions.pod:6022
27474 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
27475 "resized to its minimum size. This works like the I<-M> option to the "
27476 "C<resize2fs> command."
27480 #: ../src/guestfs-actions.pod:6026
27482 "To get the resulting size of the filesystem you should call "
27483 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
27484 "These two numbers, multiplied together, give the resulting size of the "
27485 "minimal filesystem in bytes."
27489 #: ../src/guestfs-actions.pod:6035
27490 msgid "guestfs_resize2fs_size"
27494 #: ../src/guestfs-actions.pod:6037
27498 " guestfs_resize2fs_size (guestfs_h *g,\n"
27499 " const char *device,\n"
27500 " int64_t size);\n"
27505 #: ../src/guestfs-actions.pod:6042
27507 "This command is the same as C<guestfs_resize2fs> except that it allows you "
27508 "to specify the new size (in bytes) explicitly."
27512 #: ../src/guestfs-actions.pod:6049
27517 #: ../src/guestfs-actions.pod:6051
27521 " guestfs_rm (guestfs_h *g,\n"
27522 " const char *path);\n"
27527 #: ../src/guestfs-actions.pod:6061
27528 msgid "guestfs_rm_rf"
27532 #: ../src/guestfs-actions.pod:6063
27536 " guestfs_rm_rf (guestfs_h *g,\n"
27537 " const char *path);\n"
27542 #: ../src/guestfs-actions.pod:6075
27543 msgid "guestfs_rmdir"
27547 #: ../src/guestfs-actions.pod:6077
27551 " guestfs_rmdir (guestfs_h *g,\n"
27552 " const char *path);\n"
27557 #: ../src/guestfs-actions.pod:6087
27558 msgid "guestfs_rmmountpoint"
27562 #: ../src/guestfs-actions.pod:6089
27566 " guestfs_rmmountpoint (guestfs_h *g,\n"
27567 " const char *exemptpath);\n"
27572 #: ../src/guestfs-actions.pod:6093
27574 "This calls removes a mountpoint that was previously created with "
27575 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
27579 #: ../src/guestfs-actions.pod:6101
27580 msgid "guestfs_scrub_device"
27584 #: ../src/guestfs-actions.pod:6103
27588 " guestfs_scrub_device (guestfs_h *g,\n"
27589 " const char *device);\n"
27594 #: ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6136 ../src/guestfs-actions.pod:6155
27595 msgid "(Added in 1.0.52)"
27599 #: ../src/guestfs-actions.pod:6120
27600 msgid "guestfs_scrub_file"
27604 #: ../src/guestfs-actions.pod:6122
27608 " guestfs_scrub_file (guestfs_h *g,\n"
27609 " const char *file);\n"
27614 #: ../src/guestfs-actions.pod:6138
27615 msgid "guestfs_scrub_freespace"
27619 #: ../src/guestfs-actions.pod:6140
27623 " guestfs_scrub_freespace (guestfs_h *g,\n"
27624 " const char *dir);\n"
27629 #: ../src/guestfs-actions.pod:6144
27631 "This command creates the directory C<dir> and then fills it with files until "
27632 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
27633 "and deletes them. The intention is to scrub any free space on the partition "
27634 "containing C<dir>."
27638 #: ../src/guestfs-actions.pod:6157
27639 msgid "guestfs_set_append"
27643 #: ../src/guestfs-actions.pod:6159
27647 " guestfs_set_append (guestfs_h *g,\n"
27648 " const char *append);\n"
27653 #: ../src/guestfs-actions.pod:6176
27654 msgid "guestfs_set_attach_method"
27658 #: ../src/guestfs-actions.pod:6178
27662 " guestfs_set_attach_method (guestfs_h *g,\n"
27663 " const char *attachmethod);\n"
27668 #: ../src/guestfs-actions.pod:6206
27669 msgid "guestfs_set_autosync"
27673 #: ../src/guestfs-actions.pod:6208
27677 " guestfs_set_autosync (guestfs_h *g,\n"
27678 " int autosync);\n"
27683 #: ../src/guestfs-actions.pod:6224
27684 msgid "guestfs_set_direct"
27688 #: ../src/guestfs-actions.pod:6226
27692 " guestfs_set_direct (guestfs_h *g,\n"
27698 #: ../src/guestfs-actions.pod:6234
27700 "One consequence of this is that log messages aren't caught by the library "
27701 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
27706 #: ../src/guestfs-actions.pod:6247
27707 msgid "guestfs_set_e2label"
27711 #: ../src/guestfs-actions.pod:6249
27715 " guestfs_set_e2label (guestfs_h *g,\n"
27716 " const char *device,\n"
27717 " const char *label);\n"
27722 #: ../src/guestfs-actions.pod:6258
27724 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
27725 "the existing label on a filesystem."
27729 #: ../src/guestfs-actions.pod:6265
27730 msgid "guestfs_set_e2uuid"
27734 #: ../src/guestfs-actions.pod:6267
27738 " guestfs_set_e2uuid (guestfs_h *g,\n"
27739 " const char *device,\n"
27740 " const char *uuid);\n"
27745 #: ../src/guestfs-actions.pod:6277
27747 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
27748 "the existing UUID of a filesystem."
27752 #: ../src/guestfs-actions.pod:6284
27753 msgid "guestfs_set_memsize"
27757 #: ../src/guestfs-actions.pod:6286
27761 " guestfs_set_memsize (guestfs_h *g,\n"
27767 #: ../src/guestfs-actions.pod:6290
27769 "This sets the memory size in megabytes allocated to the qemu subprocess. "
27770 "This only has any effect if called before C<guestfs_launch>."
27774 #: ../src/guestfs-actions.pod:6305
27775 msgid "guestfs_set_network"
27779 #: ../src/guestfs-actions.pod:6307
27783 " guestfs_set_network (guestfs_h *g,\n"
27789 #: ../src/guestfs-actions.pod:6317
27791 "You must call this before calling C<guestfs_launch>, otherwise it has no "
27796 #: ../src/guestfs-actions.pod:6324
27797 msgid "guestfs_set_path"
27801 #: ../src/guestfs-actions.pod:6326
27805 " guestfs_set_path (guestfs_h *g,\n"
27806 " const char *searchpath);\n"
27811 #: ../src/guestfs-actions.pod:6341
27812 msgid "guestfs_set_pgroup"
27816 #: ../src/guestfs-actions.pod:6343
27820 " guestfs_set_pgroup (guestfs_h *g,\n"
27826 #: ../src/guestfs-actions.pod:6360
27827 msgid "guestfs_set_qemu"
27831 #: ../src/guestfs-actions.pod:6362
27835 " guestfs_set_qemu (guestfs_h *g,\n"
27836 " const char *qemu);\n"
27841 #: ../src/guestfs-actions.pod:6388
27842 msgid "guestfs_set_recovery_proc"
27846 #: ../src/guestfs-actions.pod:6390
27850 " guestfs_set_recovery_proc (guestfs_h *g,\n"
27851 " int recoveryproc);\n"
27856 #: ../src/guestfs-actions.pod:6394
27858 "If this is called with the parameter C<false> then C<guestfs_launch> does "
27859 "not create a recovery process. The purpose of the recovery process is to "
27860 "stop runaway qemu processes in the case where the main program aborts "
27865 #: ../src/guestfs-actions.pod:6399
27867 "This only has any effect if called before C<guestfs_launch>, and the default "
27872 #: ../src/guestfs-actions.pod:6412
27873 msgid "guestfs_set_selinux"
27877 #: ../src/guestfs-actions.pod:6414
27881 " guestfs_set_selinux (guestfs_h *g,\n"
27887 #: ../src/guestfs-actions.pod:6431
27888 msgid "guestfs_set_trace"
27892 #: ../src/guestfs-actions.pod:6433
27896 " guestfs_set_trace (guestfs_h *g,\n"
27902 #: ../src/guestfs-actions.pod:6447
27904 "Trace messages are normally sent to C<stderr>, unless you register a "
27905 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
27909 #: ../src/guestfs-actions.pod:6455
27910 msgid "guestfs_set_verbose"
27914 #: ../src/guestfs-actions.pod:6457
27918 " guestfs_set_verbose (guestfs_h *g,\n"
27924 #: ../src/guestfs-actions.pod:6466
27926 "Verbose messages are normally sent to C<stderr>, unless you register a "
27927 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
27931 #: ../src/guestfs-actions.pod:6474
27932 msgid "guestfs_setcon"
27936 #: ../src/guestfs-actions.pod:6476
27940 " guestfs_setcon (guestfs_h *g,\n"
27941 " const char *context);\n"
27946 #: ../src/guestfs-actions.pod:6489
27947 msgid "guestfs_setxattr"
27951 #: ../src/guestfs-actions.pod:6491
27955 " guestfs_setxattr (guestfs_h *g,\n"
27956 " const char *xattr,\n"
27957 " const char *val,\n"
27959 " const char *path);\n"
27964 #: ../src/guestfs-actions.pod:6502
27965 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
27969 #: ../src/guestfs-actions.pod:6508
27970 msgid "guestfs_sfdisk"
27974 #: ../src/guestfs-actions.pod:6510
27978 " guestfs_sfdisk (guestfs_h *g,\n"
27979 " const char *device,\n"
27983 " char *const *lines);\n"
27988 #: ../src/guestfs-actions.pod:6518 ../src/guestfs-actions.pod:6562 ../src/guestfs-actions.pod:6596
27990 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
27995 #: ../src/guestfs-actions.pod:6545
27996 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
28000 #: ../src/guestfs-actions.pod:6555
28001 msgid "guestfs_sfdiskM"
28005 #: ../src/guestfs-actions.pod:6557
28009 " guestfs_sfdiskM (guestfs_h *g,\n"
28010 " const char *device,\n"
28011 " char *const *lines);\n"
28016 #: ../src/guestfs-actions.pod:6569
28018 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
28019 "partition sizes are specified in megabytes only (rounded to the nearest "
28020 "cylinder) and you don't need to specify the cyls, heads and sectors "
28021 "parameters which were rarely if ever used anyway."
28025 #: ../src/guestfs-actions.pod:6575
28027 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
28028 "C<guestfs_part_disk>"
28032 #: ../src/guestfs-actions.pod:6585
28033 msgid "guestfs_sfdisk_N"
28037 #: ../src/guestfs-actions.pod:6587
28041 " guestfs_sfdisk_N (guestfs_h *g,\n"
28042 " const char *device,\n"
28047 " const char *line);\n"
28052 #: ../src/guestfs-actions.pod:6606
28054 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
28055 "for the cyls/heads/sectors parameters."
28059 #: ../src/guestfs-actions.pod:6609
28060 msgid "See also: C<guestfs_part_add>"
28064 #: ../src/guestfs-actions.pod:6618
28065 msgid "guestfs_sfdisk_disk_geometry"
28069 #: ../src/guestfs-actions.pod:6620
28073 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
28074 " const char *device);\n"
28079 #: ../src/guestfs-actions.pod:6624
28081 "This displays the disk geometry of C<device> read from the partition table. "
28082 "Especially in the case where the underlying block device has been resized, "
28083 "this can be different from the kernel's idea of the geometry (see "
28084 "C<guestfs_sfdisk_kernel_geometry>)."
28088 #: ../src/guestfs-actions.pod:6637
28089 msgid "guestfs_sfdisk_kernel_geometry"
28093 #: ../src/guestfs-actions.pod:6639
28097 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
28098 " const char *device);\n"
28103 #: ../src/guestfs-actions.pod:6653
28104 msgid "guestfs_sfdisk_l"
28108 #: ../src/guestfs-actions.pod:6655
28112 " guestfs_sfdisk_l (guestfs_h *g,\n"
28113 " const char *device);\n"
28118 #: ../src/guestfs-actions.pod:6659
28120 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
28125 #: ../src/guestfs-actions.pod:6670
28126 msgid "See also: C<guestfs_part_list>"
28130 #: ../src/guestfs-actions.pod:6677
28135 #: ../src/guestfs-actions.pod:6679
28139 " guestfs_sh (guestfs_h *g,\n"
28140 " const char *command);\n"
28145 #: ../src/guestfs-actions.pod:6686
28146 msgid "This is like C<guestfs_command>, but passes the command to:"
28150 #: ../src/guestfs-actions.pod:6694
28151 msgid "All the provisos about C<guestfs_command> apply to this call."
28155 #: ../src/guestfs-actions.pod:6701
28156 msgid "guestfs_sh_lines"
28160 #: ../src/guestfs-actions.pod:6703
28164 " guestfs_sh_lines (guestfs_h *g,\n"
28165 " const char *command);\n"
28170 #: ../src/guestfs-actions.pod:6707
28172 "This is the same as C<guestfs_sh>, but splits the result into a list of "
28177 #: ../src/guestfs-actions.pod:6710
28178 msgid "See also: C<guestfs_command_lines>"
28182 #: ../src/guestfs-actions.pod:6718
28183 msgid "guestfs_sleep"
28187 #: ../src/guestfs-actions.pod:6720
28191 " guestfs_sleep (guestfs_h *g,\n"
28197 #: ../src/guestfs-actions.pod:6728
28198 msgid "(Added in 1.0.41)"
28202 #: ../src/guestfs-actions.pod:6730 ../src/guestfs-structs.pod:109
28203 msgid "guestfs_stat"
28207 #: ../src/guestfs-actions.pod:6732
28210 " struct guestfs_stat *\n"
28211 " guestfs_stat (guestfs_h *g,\n"
28212 " const char *path);\n"
28217 #: ../src/guestfs-actions.pod:6746 ../src/guestfs-structs.pod:135
28218 msgid "guestfs_statvfs"
28222 #: ../src/guestfs-actions.pod:6748
28225 " struct guestfs_statvfs *\n"
28226 " guestfs_statvfs (guestfs_h *g,\n"
28227 " const char *path);\n"
28232 #: ../src/guestfs-actions.pod:6758
28234 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
28235 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
28239 #: ../src/guestfs-actions.pod:6764
28240 msgid "guestfs_strings"
28244 #: ../src/guestfs-actions.pod:6766
28248 " guestfs_strings (guestfs_h *g,\n"
28249 " const char *path);\n"
28254 #: ../src/guestfs-actions.pod:6782
28255 msgid "guestfs_strings_e"
28259 #: ../src/guestfs-actions.pod:6784
28263 " guestfs_strings_e (guestfs_h *g,\n"
28264 " const char *encoding,\n"
28265 " const char *path);\n"
28270 #: ../src/guestfs-actions.pod:6789
28272 "This is like the C<guestfs_strings> command, but allows you to specify the "
28273 "encoding of strings that are looked for in the source file C<path>."
28277 #: ../src/guestfs-actions.pod:6799
28279 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
28280 "ISO-8859-X (this is what C<guestfs_strings> uses)."
28284 #: ../src/guestfs-actions.pod:6837
28285 msgid "guestfs_swapoff_device"
28289 #: ../src/guestfs-actions.pod:6839
28293 " guestfs_swapoff_device (guestfs_h *g,\n"
28294 " const char *device);\n"
28299 #: ../src/guestfs-actions.pod:6843
28301 "This command disables the libguestfs appliance swap device or partition "
28302 "named C<device>. See C<guestfs_swapon_device>."
28306 #: ../src/guestfs-actions.pod:6851
28307 msgid "guestfs_swapoff_file"
28311 #: ../src/guestfs-actions.pod:6853
28315 " guestfs_swapoff_file (guestfs_h *g,\n"
28316 " const char *file);\n"
28321 #: ../src/guestfs-actions.pod:6863
28322 msgid "guestfs_swapoff_label"
28326 #: ../src/guestfs-actions.pod:6865
28330 " guestfs_swapoff_label (guestfs_h *g,\n"
28331 " const char *label);\n"
28336 #: ../src/guestfs-actions.pod:6876
28337 msgid "guestfs_swapoff_uuid"
28341 #: ../src/guestfs-actions.pod:6878
28345 " guestfs_swapoff_uuid (guestfs_h *g,\n"
28346 " const char *uuid);\n"
28351 #: ../src/guestfs-actions.pod:6889
28352 msgid "guestfs_swapon_device"
28356 #: ../src/guestfs-actions.pod:6891
28360 " guestfs_swapon_device (guestfs_h *g,\n"
28361 " const char *device);\n"
28366 #: ../src/guestfs-actions.pod:6895
28368 "This command enables the libguestfs appliance to use the swap device or "
28369 "partition named C<device>. The increased memory is made available for all "
28370 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
28374 #: ../src/guestfs-actions.pod:6911
28375 msgid "guestfs_swapon_file"
28379 #: ../src/guestfs-actions.pod:6913
28383 " guestfs_swapon_file (guestfs_h *g,\n"
28384 " const char *file);\n"
28389 #: ../src/guestfs-actions.pod:6917
28391 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
28396 #: ../src/guestfs-actions.pod:6924
28397 msgid "guestfs_swapon_label"
28401 #: ../src/guestfs-actions.pod:6926
28405 " guestfs_swapon_label (guestfs_h *g,\n"
28406 " const char *label);\n"
28411 #: ../src/guestfs-actions.pod:6930
28413 "This command enables swap to a labeled swap partition. See "
28414 "C<guestfs_swapon_device> for other notes."
28418 #: ../src/guestfs-actions.pod:6937
28419 msgid "guestfs_swapon_uuid"
28423 #: ../src/guestfs-actions.pod:6939
28427 " guestfs_swapon_uuid (guestfs_h *g,\n"
28428 " const char *uuid);\n"
28433 #: ../src/guestfs-actions.pod:6943
28435 "This command enables swap to a swap partition with the given UUID. See "
28436 "C<guestfs_swapon_device> for other notes."
28440 #: ../src/guestfs-actions.pod:6950
28441 msgid "guestfs_sync"
28445 #: ../src/guestfs-actions.pod:6952
28449 " guestfs_sync (guestfs_h *g);\n"
28454 #: ../src/guestfs-actions.pod:6965
28455 msgid "guestfs_tail"
28459 #: ../src/guestfs-actions.pod:6967
28463 " guestfs_tail (guestfs_h *g,\n"
28464 " const char *path);\n"
28469 #: ../src/guestfs-actions.pod:6983
28470 msgid "guestfs_tail_n"
28474 #: ../src/guestfs-actions.pod:6985
28478 " guestfs_tail_n (guestfs_h *g,\n"
28480 " const char *path);\n"
28485 #: ../src/guestfs-actions.pod:7007
28486 msgid "guestfs_tar_in"
28490 #: ../src/guestfs-actions.pod:7009
28494 " guestfs_tar_in (guestfs_h *g,\n"
28495 " const char *tarfile,\n"
28496 " const char *directory);\n"
28501 #: ../src/guestfs-actions.pod:7017
28502 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
28506 #: ../src/guestfs-actions.pod:7022 ../src/guestfs-actions.pod:7039 ../src/guestfs-actions.pod:7055 ../src/guestfs-actions.pod:7071
28507 msgid "(Added in 1.0.3)"
28511 #: ../src/guestfs-actions.pod:7024
28512 msgid "guestfs_tar_out"
28516 #: ../src/guestfs-actions.pod:7026
28520 " guestfs_tar_out (guestfs_h *g,\n"
28521 " const char *directory,\n"
28522 " const char *tarfile);\n"
28527 #: ../src/guestfs-actions.pod:7034
28529 "To download a compressed tarball, use C<guestfs_tgz_out> or "
28530 "C<guestfs_txz_out>."
28534 #: ../src/guestfs-actions.pod:7041
28535 msgid "guestfs_tgz_in"
28539 #: ../src/guestfs-actions.pod:7043
28543 " guestfs_tgz_in (guestfs_h *g,\n"
28544 " const char *tarball,\n"
28545 " const char *directory);\n"
28550 #: ../src/guestfs-actions.pod:7051
28551 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
28555 #: ../src/guestfs-actions.pod:7057
28556 msgid "guestfs_tgz_out"
28560 #: ../src/guestfs-actions.pod:7059
28564 " guestfs_tgz_out (guestfs_h *g,\n"
28565 " const char *directory,\n"
28566 " const char *tarball);\n"
28571 #: ../src/guestfs-actions.pod:7067
28572 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
28576 #: ../src/guestfs-actions.pod:7073
28577 msgid "guestfs_touch"
28581 #: ../src/guestfs-actions.pod:7075
28585 " guestfs_touch (guestfs_h *g,\n"
28586 " const char *path);\n"
28591 #: ../src/guestfs-actions.pod:7090
28592 msgid "guestfs_truncate"
28596 #: ../src/guestfs-actions.pod:7092
28600 " guestfs_truncate (guestfs_h *g,\n"
28601 " const char *path);\n"
28606 #: ../src/guestfs-actions.pod:7103
28607 msgid "guestfs_truncate_size"
28611 #: ../src/guestfs-actions.pod:7105
28615 " guestfs_truncate_size (guestfs_h *g,\n"
28616 " const char *path,\n"
28617 " int64_t size);\n"
28622 #: ../src/guestfs-actions.pod:7113
28624 "If the current file size is less than C<size> then the file is extended to "
28625 "the required size with zero bytes. This creates a sparse file (ie. disk "
28626 "blocks are not allocated for the file until you write to it). To create a "
28627 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
28631 #: ../src/guestfs-actions.pod:7123
28632 msgid "guestfs_tune2fs_l"
28636 #: ../src/guestfs-actions.pod:7125
28640 " guestfs_tune2fs_l (guestfs_h *g,\n"
28641 " const char *device);\n"
28646 #: ../src/guestfs-actions.pod:7145
28647 msgid "guestfs_txz_in"
28651 #: ../src/guestfs-actions.pod:7147
28655 " guestfs_txz_in (guestfs_h *g,\n"
28656 " const char *tarball,\n"
28657 " const char *directory);\n"
28662 #: ../src/guestfs-actions.pod:7159
28663 msgid "guestfs_txz_out"
28667 #: ../src/guestfs-actions.pod:7161
28671 " guestfs_txz_out (guestfs_h *g,\n"
28672 " const char *directory,\n"
28673 " const char *tarball);\n"
28678 #: ../src/guestfs-actions.pod:7173
28679 msgid "guestfs_umask"
28683 #: ../src/guestfs-actions.pod:7175
28687 " guestfs_umask (guestfs_h *g,\n"
28693 #: ../src/guestfs-actions.pod:7191
28695 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
28696 "C<guestfs_mkdir>."
28700 #: ../src/guestfs-actions.pod:7200
28701 msgid "guestfs_umount"
28705 #: ../src/guestfs-actions.pod:7202
28709 " guestfs_umount (guestfs_h *g,\n"
28710 " const char *pathordevice);\n"
28715 #: ../src/guestfs-actions.pod:7214
28716 msgid "guestfs_umount_all"
28720 #: ../src/guestfs-actions.pod:7216
28724 " guestfs_umount_all (guestfs_h *g);\n"
28729 #: ../src/guestfs-actions.pod:7227
28730 msgid "guestfs_upload"
28734 #: ../src/guestfs-actions.pod:7229
28738 " guestfs_upload (guestfs_h *g,\n"
28739 " const char *filename,\n"
28740 " const char *remotefilename);\n"
28745 #: ../src/guestfs-actions.pod:7239
28746 msgid "See also C<guestfs_download>."
28750 #: ../src/guestfs-actions.pod:7250
28751 msgid "guestfs_upload_offset"
28755 #: ../src/guestfs-actions.pod:7252
28759 " guestfs_upload_offset (guestfs_h *g,\n"
28760 " const char *filename,\n"
28761 " const char *remotefilename,\n"
28762 " int64_t offset);\n"
28767 #: ../src/guestfs-actions.pod:7268
28769 "Note that there is no limit on the amount of data that can be uploaded with "
28770 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
28771 "full amount unless an error occurs."
28775 #: ../src/guestfs-actions.pod:7273
28776 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
28780 #: ../src/guestfs-actions.pod:7284
28781 msgid "guestfs_utimens"
28785 #: ../src/guestfs-actions.pod:7286
28789 " guestfs_utimens (guestfs_h *g,\n"
28790 " const char *path,\n"
28791 " int64_t atsecs,\n"
28792 " int64_t atnsecs,\n"
28793 " int64_t mtsecs,\n"
28794 " int64_t mtnsecs);\n"
28799 #: ../src/guestfs-actions.pod:7315 ../src/guestfs-structs.pod:175
28800 msgid "guestfs_version"
28804 #: ../src/guestfs-actions.pod:7317
28807 " struct guestfs_version *\n"
28808 " guestfs_version (guestfs_h *g);\n"
28813 #: ../src/guestfs-actions.pod:7345
28815 "I<Note:> Don't use this call to test for availability of features. In "
28816 "enterprise distributions we backport features from later versions into "
28817 "earlier versions, making this an unreliable way to test for features. Use "
28818 "C<guestfs_available> instead."
28822 #: ../src/guestfs-actions.pod:7351
28824 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
28825 "error. I<The caller must call C<guestfs_free_version> after use>."
28829 #: ../src/guestfs-actions.pod:7355
28830 msgid "(Added in 1.0.58)"
28834 #: ../src/guestfs-actions.pod:7357
28835 msgid "guestfs_vfs_label"
28839 #: ../src/guestfs-actions.pod:7359
28843 " guestfs_vfs_label (guestfs_h *g,\n"
28844 " const char *device);\n"
28849 #: ../src/guestfs-actions.pod:7368
28850 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
28854 #: ../src/guestfs-actions.pod:7373 ../src/guestfs-actions.pod:7410
28855 msgid "(Added in 1.3.18)"
28859 #: ../src/guestfs-actions.pod:7375
28860 msgid "guestfs_vfs_type"
28864 #: ../src/guestfs-actions.pod:7377
28868 " guestfs_vfs_type (guestfs_h *g,\n"
28869 " const char *device);\n"
28874 #: ../src/guestfs-actions.pod:7394
28875 msgid "guestfs_vfs_uuid"
28879 #: ../src/guestfs-actions.pod:7396
28883 " guestfs_vfs_uuid (guestfs_h *g,\n"
28884 " const char *device);\n"
28889 #: ../src/guestfs-actions.pod:7405
28890 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
28894 #: ../src/guestfs-actions.pod:7412
28895 msgid "guestfs_vg_activate"
28899 #: ../src/guestfs-actions.pod:7414
28903 " guestfs_vg_activate (guestfs_h *g,\n"
28905 " char *const *volgroups);\n"
28910 #: ../src/guestfs-actions.pod:7431
28911 msgid "guestfs_vg_activate_all"
28915 #: ../src/guestfs-actions.pod:7433
28919 " guestfs_vg_activate_all (guestfs_h *g,\n"
28920 " int activate);\n"
28925 #: ../src/guestfs-actions.pod:7446
28926 msgid "guestfs_vgcreate"
28930 #: ../src/guestfs-actions.pod:7448
28934 " guestfs_vgcreate (guestfs_h *g,\n"
28935 " const char *volgroup,\n"
28936 " char *const *physvols);\n"
28941 #: ../src/guestfs-actions.pod:7460
28942 msgid "guestfs_vglvuuids"
28946 #: ../src/guestfs-actions.pod:7462
28950 " guestfs_vglvuuids (guestfs_h *g,\n"
28951 " const char *vgname);\n"
28956 #: ../src/guestfs-actions.pod:7469
28958 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
28959 "associate logical volumes and volume groups."
28963 #: ../src/guestfs-actions.pod:7472
28964 msgid "See also C<guestfs_vgpvuuids>."
28968 #: ../src/guestfs-actions.pod:7480
28969 msgid "guestfs_vgpvuuids"
28973 #: ../src/guestfs-actions.pod:7482
28977 " guestfs_vgpvuuids (guestfs_h *g,\n"
28978 " const char *vgname);\n"
28983 #: ../src/guestfs-actions.pod:7489
28985 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
28986 "associate physical volumes and volume groups."
28990 #: ../src/guestfs-actions.pod:7492
28991 msgid "See also C<guestfs_vglvuuids>."
28995 #: ../src/guestfs-actions.pod:7500
28996 msgid "guestfs_vgremove"
29000 #: ../src/guestfs-actions.pod:7502
29004 " guestfs_vgremove (guestfs_h *g,\n"
29005 " const char *vgname);\n"
29010 #: ../src/guestfs-actions.pod:7515
29011 msgid "guestfs_vgrename"
29015 #: ../src/guestfs-actions.pod:7517
29019 " guestfs_vgrename (guestfs_h *g,\n"
29020 " const char *volgroup,\n"
29021 " const char *newvolgroup);\n"
29026 #: ../src/guestfs-actions.pod:7528
29027 msgid "guestfs_vgs"
29031 #: ../src/guestfs-actions.pod:7530
29035 " guestfs_vgs (guestfs_h *g);\n"
29040 #: ../src/guestfs-actions.pod:7539
29041 msgid "See also C<guestfs_vgs_full>."
29045 #: ../src/guestfs-actions.pod:7547
29046 msgid "guestfs_vgs_full"
29050 #: ../src/guestfs-actions.pod:7549
29053 " struct guestfs_lvm_vg_list *\n"
29054 " guestfs_vgs_full (guestfs_h *g);\n"
29059 #: ../src/guestfs-actions.pod:7555
29061 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
29062 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
29067 #: ../src/guestfs-actions.pod:7561
29068 msgid "guestfs_vgscan"
29072 #: ../src/guestfs-actions.pod:7563
29076 " guestfs_vgscan (guestfs_h *g);\n"
29081 #: ../src/guestfs-actions.pod:7573
29082 msgid "guestfs_vguuid"
29086 #: ../src/guestfs-actions.pod:7575
29090 " guestfs_vguuid (guestfs_h *g,\n"
29091 " const char *vgname);\n"
29096 #: ../src/guestfs-actions.pod:7586
29097 msgid "guestfs_wait_ready"
29101 #: ../src/guestfs-actions.pod:7588
29105 " guestfs_wait_ready (guestfs_h *g);\n"
29110 #: ../src/guestfs-actions.pod:7591
29112 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
29117 #: ../src/guestfs-actions.pod:7598
29118 msgid "This function is a no op."
29122 #: ../src/guestfs-actions.pod:7600
29124 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
29125 "calling C<guestfs_launch> to wait for the launch to complete. However this "
29126 "is no longer necessary because C<guestfs_launch> now does the waiting."
29130 #: ../src/guestfs-actions.pod:7605
29132 "If you see any calls to this function in code then you can just remove them, "
29133 "unless you want to retain compatibility with older versions of the API."
29137 #: ../src/guestfs-actions.pod:7613
29138 msgid "guestfs_wc_c"
29142 #: ../src/guestfs-actions.pod:7615
29146 " guestfs_wc_c (guestfs_h *g,\n"
29147 " const char *path);\n"
29152 #: ../src/guestfs-actions.pod:7626
29153 msgid "guestfs_wc_l"
29157 #: ../src/guestfs-actions.pod:7628
29161 " guestfs_wc_l (guestfs_h *g,\n"
29162 " const char *path);\n"
29167 #: ../src/guestfs-actions.pod:7639
29168 msgid "guestfs_wc_w"
29172 #: ../src/guestfs-actions.pod:7641
29176 " guestfs_wc_w (guestfs_h *g,\n"
29177 " const char *path);\n"
29182 #: ../src/guestfs-actions.pod:7652
29183 msgid "guestfs_write"
29187 #: ../src/guestfs-actions.pod:7654
29191 " guestfs_write (guestfs_h *g,\n"
29192 " const char *path,\n"
29193 " const char *content,\n"
29194 " size_t content_size);\n"
29199 #: ../src/guestfs-actions.pod:7663
29200 msgid "See also C<guestfs_write_append>."
29204 #: ../src/guestfs-actions.pod:7672
29205 msgid "guestfs_write_append"
29209 #: ../src/guestfs-actions.pod:7674
29213 " guestfs_write_append (guestfs_h *g,\n"
29214 " const char *path,\n"
29215 " const char *content,\n"
29216 " size_t content_size);\n"
29221 #: ../src/guestfs-actions.pod:7683
29222 msgid "See also C<guestfs_write>."
29226 #: ../src/guestfs-actions.pod:7692
29227 msgid "guestfs_write_file"
29231 #: ../src/guestfs-actions.pod:7694
29235 " guestfs_write_file (guestfs_h *g,\n"
29236 " const char *path,\n"
29237 " const char *content,\n"
29243 #: ../src/guestfs-actions.pod:7700
29245 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
29250 #: ../src/guestfs-actions.pod:7725
29251 msgid "guestfs_zegrep"
29255 #: ../src/guestfs-actions.pod:7727
29259 " guestfs_zegrep (guestfs_h *g,\n"
29260 " const char *regex,\n"
29261 " const char *path);\n"
29266 #: ../src/guestfs-actions.pod:7744
29267 msgid "guestfs_zegrepi"
29271 #: ../src/guestfs-actions.pod:7746
29275 " guestfs_zegrepi (guestfs_h *g,\n"
29276 " const char *regex,\n"
29277 " const char *path);\n"
29282 #: ../src/guestfs-actions.pod:7763
29283 msgid "guestfs_zero"
29287 #: ../src/guestfs-actions.pod:7765
29291 " guestfs_zero (guestfs_h *g,\n"
29292 " const char *device);\n"
29297 #: ../src/guestfs-actions.pod:7779
29299 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
29300 "C<guestfs_is_zero_device>"
29304 #: ../src/guestfs-actions.pod:7791
29305 msgid "guestfs_zero_device"
29309 #: ../src/guestfs-actions.pod:7793
29313 " guestfs_zero_device (guestfs_h *g,\n"
29314 " const char *device);\n"
29319 #: ../src/guestfs-actions.pod:7797
29321 "This command writes zeroes over the entire C<device>. Compare with "
29322 "C<guestfs_zero> which just zeroes the first few blocks of a device."
29326 #: ../src/guestfs-actions.pod:7815
29327 msgid "(Added in 1.3.1)"
29331 #: ../src/guestfs-actions.pod:7817
29332 msgid "guestfs_zerofree"
29336 #: ../src/guestfs-actions.pod:7819
29340 " guestfs_zerofree (guestfs_h *g,\n"
29341 " const char *device);\n"
29346 #: ../src/guestfs-actions.pod:7838
29347 msgid "guestfs_zfgrep"
29351 #: ../src/guestfs-actions.pod:7840
29355 " guestfs_zfgrep (guestfs_h *g,\n"
29356 " const char *pattern,\n"
29357 " const char *path);\n"
29362 #: ../src/guestfs-actions.pod:7857
29363 msgid "guestfs_zfgrepi"
29367 #: ../src/guestfs-actions.pod:7859
29371 " guestfs_zfgrepi (guestfs_h *g,\n"
29372 " const char *pattern,\n"
29373 " const char *path);\n"
29378 #: ../src/guestfs-actions.pod:7876
29379 msgid "guestfs_zfile"
29383 #: ../src/guestfs-actions.pod:7878
29387 " guestfs_zfile (guestfs_h *g,\n"
29388 " const char *meth,\n"
29389 " const char *path);\n"
29394 #: ../src/guestfs-actions.pod:7883
29396 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
29401 #: ../src/guestfs-actions.pod:7895
29403 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
29408 #: ../src/guestfs-actions.pod:7903
29409 msgid "guestfs_zgrep"
29413 #: ../src/guestfs-actions.pod:7905
29417 " guestfs_zgrep (guestfs_h *g,\n"
29418 " const char *regex,\n"
29419 " const char *path);\n"
29424 #: ../src/guestfs-actions.pod:7922
29425 msgid "guestfs_zgrepi"
29429 #: ../src/guestfs-actions.pod:7924
29433 " guestfs_zgrepi (guestfs_h *g,\n"
29434 " const char *regex,\n"
29435 " const char *path);\n"
29440 #: ../src/guestfs-availability.pod:3
29445 #: ../src/guestfs-availability.pod:5
29447 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
29448 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
29449 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
29450 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
29451 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
29455 #: ../src/guestfs-availability.pod:21
29460 #: ../src/guestfs-availability.pod:23
29461 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
29465 #: ../src/guestfs-availability.pod:26
29470 #: ../src/guestfs-availability.pod:28
29472 "The following functions: L</guestfs_inotify_add_watch> "
29473 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
29474 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
29478 #: ../src/guestfs-availability.pod:36
29479 msgid "B<linuxfsuuid>"
29483 #: ../src/guestfs-availability.pod:38
29485 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
29486 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
29490 #: ../src/guestfs-availability.pod:45
29491 msgid "B<linuxmodules>"
29495 #: ../src/guestfs-availability.pod:47
29496 msgid "The following functions: L</guestfs_modprobe>"
29500 #: ../src/guestfs-availability.pod:50
29501 msgid "B<linuxxattrs>"
29505 #: ../src/guestfs-availability.pod:52
29507 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
29508 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
29509 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
29510 "L</guestfs_setxattr>"
29514 #: ../src/guestfs-availability.pod:63
29519 #: ../src/guestfs-availability.pod:65
29521 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
29522 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
29523 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
29527 #: ../src/guestfs-availability.pod:74
29532 #: ../src/guestfs-availability.pod:76
29534 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
29535 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
29536 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
29537 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
29538 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
29539 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
29540 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
29541 "L</guestfs_vgs_full>"
29545 #: ../src/guestfs-availability.pod:99
29550 #: ../src/guestfs-availability.pod:101
29552 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
29553 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
29557 #: ../src/guestfs-availability.pod:107
29562 #: ../src/guestfs-availability.pod:109
29563 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
29567 #: ../src/guestfs-availability.pod:112
29568 msgid "B<ntfsprogs>"
29572 #: ../src/guestfs-availability.pod:114
29574 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
29575 "L</guestfs_ntfsresize_size>"
29579 #: ../src/guestfs-availability.pod:119
29580 msgid "B<realpath>"
29584 #: ../src/guestfs-availability.pod:121
29585 msgid "The following functions: L</guestfs_realpath>"
29589 #: ../src/guestfs-availability.pod:124
29594 #: ../src/guestfs-availability.pod:126
29596 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
29597 "L</guestfs_scrub_freespace>"
29601 #: ../src/guestfs-availability.pod:131
29606 #: ../src/guestfs-availability.pod:133
29607 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
29611 #: ../src/guestfs-availability.pod:137
29616 #: ../src/guestfs-availability.pod:139
29617 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
29621 #: ../src/guestfs-availability.pod:143
29622 msgid "B<zerofree>"
29626 #: ../src/guestfs-availability.pod:145
29627 msgid "The following functions: L</guestfs_zerofree>"
29631 #: ../src/guestfs-structs.pod:1
29632 msgid "guestfs_int_bool"
29636 #: ../src/guestfs-structs.pod:3
29639 " struct guestfs_int_bool {\n"
29647 #: ../src/guestfs-structs.pod:8
29650 " struct guestfs_int_bool_list {\n"
29651 " uint32_t len; /* Number of elements in list. */\n"
29652 " struct guestfs_int_bool *val; /* Elements. */\n"
29658 #: ../src/guestfs-structs.pod:13
29661 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
29662 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
29667 #: ../src/guestfs-structs.pod:16
29668 msgid "guestfs_lvm_pv"
29672 #: ../src/guestfs-structs.pod:18
29675 " struct guestfs_lvm_pv {\n"
29676 " char *pv_name;\n"
29677 " /* The next field is NOT nul-terminated, be careful when printing it: "
29679 " char pv_uuid[32];\n"
29681 " uint64_t pv_size;\n"
29682 " uint64_t dev_size;\n"
29683 " uint64_t pv_free;\n"
29684 " uint64_t pv_used;\n"
29685 " char *pv_attr;\n"
29686 " int64_t pv_pe_count;\n"
29687 " int64_t pv_pe_alloc_count;\n"
29688 " char *pv_tags;\n"
29689 " uint64_t pe_start;\n"
29690 " int64_t pv_mda_count;\n"
29691 " uint64_t pv_mda_free;\n"
29697 #: ../src/guestfs-structs.pod:36
29700 " struct guestfs_lvm_pv_list {\n"
29701 " uint32_t len; /* Number of elements in list. */\n"
29702 " struct guestfs_lvm_pv *val; /* Elements. */\n"
29708 #: ../src/guestfs-structs.pod:41
29711 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
29712 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
29717 #: ../src/guestfs-structs.pod:44
29718 msgid "guestfs_lvm_vg"
29722 #: ../src/guestfs-structs.pod:46
29725 " struct guestfs_lvm_vg {\n"
29726 " char *vg_name;\n"
29727 " /* The next field is NOT nul-terminated, be careful when printing it: "
29729 " char vg_uuid[32];\n"
29731 " char *vg_attr;\n"
29732 " uint64_t vg_size;\n"
29733 " uint64_t vg_free;\n"
29734 " char *vg_sysid;\n"
29735 " uint64_t vg_extent_size;\n"
29736 " int64_t vg_extent_count;\n"
29737 " int64_t vg_free_count;\n"
29738 " int64_t max_lv;\n"
29739 " int64_t max_pv;\n"
29740 " int64_t pv_count;\n"
29741 " int64_t lv_count;\n"
29742 " int64_t snap_count;\n"
29743 " int64_t vg_seqno;\n"
29744 " char *vg_tags;\n"
29745 " int64_t vg_mda_count;\n"
29746 " uint64_t vg_mda_free;\n"
29752 #: ../src/guestfs-structs.pod:69
29755 " struct guestfs_lvm_vg_list {\n"
29756 " uint32_t len; /* Number of elements in list. */\n"
29757 " struct guestfs_lvm_vg *val; /* Elements. */\n"
29763 #: ../src/guestfs-structs.pod:74
29766 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
29767 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
29772 #: ../src/guestfs-structs.pod:77
29773 msgid "guestfs_lvm_lv"
29777 #: ../src/guestfs-structs.pod:79
29780 " struct guestfs_lvm_lv {\n"
29781 " char *lv_name;\n"
29782 " /* The next field is NOT nul-terminated, be careful when printing it: "
29784 " char lv_uuid[32];\n"
29785 " char *lv_attr;\n"
29786 " int64_t lv_major;\n"
29787 " int64_t lv_minor;\n"
29788 " int64_t lv_kernel_major;\n"
29789 " int64_t lv_kernel_minor;\n"
29790 " uint64_t lv_size;\n"
29791 " int64_t seg_count;\n"
29793 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
29794 " float snap_percent;\n"
29795 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
29796 " float copy_percent;\n"
29797 " char *move_pv;\n"
29798 " char *lv_tags;\n"
29799 " char *mirror_log;\n"
29800 " char *modules;\n"
29806 #: ../src/guestfs-structs.pod:101
29809 " struct guestfs_lvm_lv_list {\n"
29810 " uint32_t len; /* Number of elements in list. */\n"
29811 " struct guestfs_lvm_lv *val; /* Elements. */\n"
29817 #: ../src/guestfs-structs.pod:106
29820 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
29821 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
29826 #: ../src/guestfs-structs.pod:111
29829 " struct guestfs_stat {\n"
29833 " int64_t nlink;\n"
29838 " int64_t blksize;\n"
29839 " int64_t blocks;\n"
29840 " int64_t atime;\n"
29841 " int64_t mtime;\n"
29842 " int64_t ctime;\n"
29848 #: ../src/guestfs-structs.pod:127
29851 " struct guestfs_stat_list {\n"
29852 " uint32_t len; /* Number of elements in list. */\n"
29853 " struct guestfs_stat *val; /* Elements. */\n"
29859 #: ../src/guestfs-structs.pod:132
29862 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
29863 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
29868 #: ../src/guestfs-structs.pod:137
29871 " struct guestfs_statvfs {\n"
29872 " int64_t bsize;\n"
29873 " int64_t frsize;\n"
29874 " int64_t blocks;\n"
29875 " int64_t bfree;\n"
29876 " int64_t bavail;\n"
29877 " int64_t files;\n"
29878 " int64_t ffree;\n"
29879 " int64_t favail;\n"
29882 " int64_t namemax;\n"
29888 #: ../src/guestfs-structs.pod:151
29891 " struct guestfs_statvfs_list {\n"
29892 " uint32_t len; /* Number of elements in list. */\n"
29893 " struct guestfs_statvfs *val; /* Elements. */\n"
29899 #: ../src/guestfs-structs.pod:156
29902 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
29903 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
29908 #: ../src/guestfs-structs.pod:159
29909 msgid "guestfs_dirent"
29913 #: ../src/guestfs-structs.pod:161
29916 " struct guestfs_dirent {\n"
29925 #: ../src/guestfs-structs.pod:167
29928 " struct guestfs_dirent_list {\n"
29929 " uint32_t len; /* Number of elements in list. */\n"
29930 " struct guestfs_dirent *val; /* Elements. */\n"
29936 #: ../src/guestfs-structs.pod:172
29939 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
29940 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
29945 #: ../src/guestfs-structs.pod:177
29948 " struct guestfs_version {\n"
29949 " int64_t major;\n"
29950 " int64_t minor;\n"
29951 " int64_t release;\n"
29958 #: ../src/guestfs-structs.pod:184
29961 " struct guestfs_version_list {\n"
29962 " uint32_t len; /* Number of elements in list. */\n"
29963 " struct guestfs_version *val; /* Elements. */\n"
29969 #: ../src/guestfs-structs.pod:189
29972 " void guestfs_free_version (struct guestfs_free_version *);\n"
29973 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
29978 #: ../src/guestfs-structs.pod:192
29979 msgid "guestfs_xattr"
29983 #: ../src/guestfs-structs.pod:194
29986 " struct guestfs_xattr {\n"
29987 " char *attrname;\n"
29988 " /* The next two fields describe a byte array. */\n"
29989 " uint32_t attrval_len;\n"
29990 " char *attrval;\n"
29996 #: ../src/guestfs-structs.pod:201
29999 " struct guestfs_xattr_list {\n"
30000 " uint32_t len; /* Number of elements in list. */\n"
30001 " struct guestfs_xattr *val; /* Elements. */\n"
30007 #: ../src/guestfs-structs.pod:206
30010 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
30011 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
30016 #: ../src/guestfs-structs.pod:209
30017 msgid "guestfs_inotify_event"
30021 #: ../src/guestfs-structs.pod:211
30024 " struct guestfs_inotify_event {\n"
30025 " int64_t in_wd;\n"
30026 " uint32_t in_mask;\n"
30027 " uint32_t in_cookie;\n"
30028 " char *in_name;\n"
30034 #: ../src/guestfs-structs.pod:218
30037 " struct guestfs_inotify_event_list {\n"
30038 " uint32_t len; /* Number of elements in list. */\n"
30039 " struct guestfs_inotify_event *val; /* Elements. */\n"
30045 #: ../src/guestfs-structs.pod:223
30048 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
30049 " void guestfs_free_inotify_event_list (struct "
30050 "guestfs_free_inotify_event_list *);\n"
30055 #: ../src/guestfs-structs.pod:226
30056 msgid "guestfs_partition"
30060 #: ../src/guestfs-structs.pod:228
30063 " struct guestfs_partition {\n"
30064 " int32_t part_num;\n"
30065 " uint64_t part_start;\n"
30066 " uint64_t part_end;\n"
30067 " uint64_t part_size;\n"
30073 #: ../src/guestfs-structs.pod:235
30076 " struct guestfs_partition_list {\n"
30077 " uint32_t len; /* Number of elements in list. */\n"
30078 " struct guestfs_partition *val; /* Elements. */\n"
30084 #: ../src/guestfs-structs.pod:240
30087 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
30088 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
30093 #: ../src/guestfs-structs.pod:243
30094 msgid "guestfs_application"
30098 #: ../src/guestfs-structs.pod:245
30101 " struct guestfs_application {\n"
30102 " char *app_name;\n"
30103 " char *app_display_name;\n"
30104 " int32_t app_epoch;\n"
30105 " char *app_version;\n"
30106 " char *app_release;\n"
30107 " char *app_install_path;\n"
30108 " char *app_trans_path;\n"
30109 " char *app_publisher;\n"
30110 " char *app_url;\n"
30111 " char *app_source_package;\n"
30112 " char *app_summary;\n"
30113 " char *app_description;\n"
30119 #: ../src/guestfs-structs.pod:260
30122 " struct guestfs_application_list {\n"
30123 " uint32_t len; /* Number of elements in list. */\n"
30124 " struct guestfs_application *val; /* Elements. */\n"
30130 #: ../src/guestfs-structs.pod:265
30133 " void guestfs_free_application (struct guestfs_free_application *);\n"
30134 " void guestfs_free_application_list (struct guestfs_free_application_list "
30140 #: ../src/guestfs.pod:5
30141 msgid "guestfs - Library for accessing and modifying virtual machine images"
30145 #: ../src/guestfs.pod:11
30148 " guestfs_h *g = guestfs_create ();\n"
30149 " guestfs_add_drive (g, \"guest.img\");\n"
30150 " guestfs_launch (g);\n"
30151 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30152 " guestfs_touch (g, \"/hello\");\n"
30153 " guestfs_umount (g, \"/\");\n"
30154 " guestfs_close (g);\n"
30159 #: ../src/guestfs.pod:25
30161 "Libguestfs is a library for accessing and modifying guest disk images. "
30162 "Amongst the things this is good for: making batch configuration changes to "
30163 "guests, getting disk used/free statistics (see also: virt-df), migrating "
30164 "between virtualization systems (see also: virt-p2v), performing partial "
30165 "backups, performing partial guest clones, cloning guests and changing "
30166 "registry/UUID/hostname info, and much else besides."
30170 #: ../src/guestfs.pod:33
30172 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
30173 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
30174 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
30179 #: ../src/guestfs.pod:38
30181 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
30182 "what filesystem is in each LV, etc.). It can also run commands in the "
30183 "context of the guest. Also you can access filesystems over FUSE."
30187 #: ../src/guestfs.pod:43
30189 "Libguestfs is a library that can be linked with C and C++ management "
30190 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
30191 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
30196 #: ../src/guestfs.pod:48
30198 "You don't need to be root to use libguestfs, although obviously you do need "
30199 "enough permissions to access the disk images."
30203 #: ../src/guestfs.pod:51
30205 "Libguestfs is a large API because it can do many things. For a gentle "
30206 "introduction, please read the L</API OVERVIEW> section next."
30210 #: ../src/guestfs.pod:54
30212 "There are also some example programs in the L<guestfs-examples(3)> manual "
30217 #: ../src/guestfs.pod:57
30218 msgid "API OVERVIEW"
30222 #: ../src/guestfs.pod:59
30224 "This section provides a gentler overview of the libguestfs API. We also try "
30225 "to group API calls together, where that may not be obvious from reading "
30226 "about the individual calls in the main section of this manual."
30230 #: ../src/guestfs.pod:64
30235 #: ../src/guestfs.pod:66
30237 "Before you can use libguestfs calls, you have to create a handle. Then you "
30238 "must add at least one disk image to the handle, followed by launching the "
30239 "handle, then performing whatever operations you want, and finally closing "
30240 "the handle. By convention we use the single letter C<g> for the name of the "
30241 "handle variable, although of course you can use any name you want."
30245 #: ../src/guestfs.pod:73
30246 msgid "The general structure of all libguestfs-using programs looks like this:"
30250 #: ../src/guestfs.pod:76
30253 " guestfs_h *g = guestfs_create ();\n"
30258 #: ../src/guestfs.pod:78
30261 " /* Call guestfs_add_drive additional times if there are\n"
30262 " * multiple disk images.\n"
30264 " guestfs_add_drive (g, \"guest.img\");\n"
30269 #: ../src/guestfs.pod:83
30272 " /* Most manipulation calls won't work until you've launched\n"
30273 " * the handle 'g'. You have to do this _after_ adding drives\n"
30274 " * and _before_ other commands.\n"
30276 " guestfs_launch (g);\n"
30281 #: ../src/guestfs.pod:89
30284 " /* Now you can examine what partitions, LVs etc are available.\n"
30286 " char **partitions = guestfs_list_partitions (g);\n"
30287 " char **logvols = guestfs_lvs (g);\n"
30292 #: ../src/guestfs.pod:94
30295 " /* To access a filesystem in the image, you must mount it.\n"
30297 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30302 #: ../src/guestfs.pod:98
30305 " /* Now you can perform filesystem actions on the guest\n"
30308 " guestfs_touch (g, \"/hello\");\n"
30313 #: ../src/guestfs.pod:103
30316 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
30317 " * it is done automatically when you close the handle. See\n"
30318 " * discussion of autosync in this page.\n"
30320 " guestfs_sync (g);\n"
30325 #: ../src/guestfs.pod:109
30328 " /* Close the handle 'g'. */\n"
30329 " guestfs_close (g);\n"
30334 #: ../src/guestfs.pod:112
30336 "The code above doesn't include any error checking. In real code you should "
30337 "check return values carefully for errors. In general all functions that "
30338 "return integers return C<-1> on error, and all functions that return "
30339 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
30340 "how to handle errors, and consult the documentation for each function call "
30341 "below to see precisely how they return error indications. See "
30342 "L<guestfs-examples(3)> for fully worked examples."
30346 #: ../src/guestfs.pod:121
30347 msgid "DISK IMAGES"
30351 #: ../src/guestfs.pod:123
30353 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
30354 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
30355 "actual block device, or simply an empty file of zeroes that you have created "
30356 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
30361 #: ../src/guestfs.pod:129
30363 "The call you should use in modern code for adding drives is "
30364 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
30365 "specifying that the format is raw, do:"
30369 #: ../src/guestfs.pod:133
30372 " guestfs_add_drive_opts (g, filename,\n"
30373 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30379 #: ../src/guestfs.pod:137
30380 msgid "You can add a disk read-only using:"
30384 #: ../src/guestfs.pod:139
30387 " guestfs_add_drive_opts (g, filename,\n"
30388 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30389 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
30395 #: ../src/guestfs.pod:144
30397 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
30398 "libguestfs won't modify the file."
30402 #: ../src/guestfs.pod:147
30404 "Be extremely cautious if the disk image is in use, eg. if it is being used "
30405 "by a virtual machine. Adding it read-write will almost certainly cause disk "
30406 "corruption, but adding it read-only is safe."
30410 #: ../src/guestfs.pod:151
30412 "You must add at least one disk image, and you may add multiple disk images. "
30413 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
30414 "first one you added), C</dev/sdb> (for the second one you added), etc."
30418 #: ../src/guestfs.pod:156
30420 "Once L</guestfs_launch> has been called you cannot add any more images. You "
30421 "can call L</guestfs_list_devices> to get a list of the device names, in the "
30422 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
30426 #: ../src/guestfs.pod:161
30431 #: ../src/guestfs.pod:163
30433 "Before you can read or write files, create directories and so on in a disk "
30434 "image that contains filesystems, you have to mount those filesystems using "
30435 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
30436 "a disk image contains (for example) one partition with a filesystem on that "
30437 "partition, then you can mount it directly:"
30441 #: ../src/guestfs.pod:170
30444 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
30449 #: ../src/guestfs.pod:172
30451 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
30452 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
30453 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
30454 "that these are libguestfs virtual devices, and are nothing to do with host "
30459 #: ../src/guestfs.pod:178
30461 "If you are given a disk image and you don't know what it contains then you "
30462 "have to find out. Libguestfs can do that too: use "
30463 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
30464 "and LVs, and either try mounting each to see what is mountable, or else "
30465 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
30466 "filesystems, use L</guestfs_list_filesystems>."
30470 #: ../src/guestfs.pod:186
30472 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
30473 "L</INSPECTION> below). But you might find it easier to look at higher level "
30474 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
30478 #: ../src/guestfs.pod:191
30480 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
30481 "several other variations of the C<guestfs_mount_*> call."
30485 #: ../src/guestfs.pod:194
30486 msgid "FILESYSTEM ACCESS AND MODIFICATION"
30490 #: ../src/guestfs.pod:196
30492 "The majority of the libguestfs API consists of fairly low-level calls for "
30493 "accessing and modifying the files, directories, symlinks etc on mounted "
30494 "filesystems. There are over a hundred such calls which you can find listed "
30495 "in detail below in this man page, and we don't even pretend to cover them "
30496 "all in this overview."
30500 #: ../src/guestfs.pod:202
30502 "Specify filenames as full paths, starting with C<\"/\"> and including the "
30507 #: ../src/guestfs.pod:205
30509 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
30510 "the file called C<\"etc/passwd\"> then you could do:"
30514 #: ../src/guestfs.pod:208
30517 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
30522 #: ../src/guestfs.pod:210
30524 "This would return C<data> as a newly allocated buffer containing the full "
30525 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
30526 "or C<NULL> if there was an error."
30530 #: ../src/guestfs.pod:214
30532 "As another example, to create a top-level directory on that filesystem "
30533 "called C<\"var\"> you would do:"
30537 #: ../src/guestfs.pod:217
30540 " guestfs_mkdir (g, \"/var\");\n"
30545 #: ../src/guestfs.pod:219
30546 msgid "To create a symlink you could do:"
30550 #: ../src/guestfs.pod:221
30553 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
30554 " \"/etc/rc3.d/S30portmap\");\n"
30559 #: ../src/guestfs.pod:224
30561 "Libguestfs will reject attempts to use relative paths and there is no "
30562 "concept of a current working directory."
30566 #: ../src/guestfs.pod:227
30568 "Libguestfs can return errors in many situations: for example if the "
30569 "filesystem isn't writable, or if a file or directory that you requested "
30570 "doesn't exist. If you are using the C API (documented here) you have to "
30571 "check for those error conditions after each call. (Other language bindings "
30572 "turn these errors into exceptions)."
30576 #: ../src/guestfs.pod:233
30578 "File writes are affected by the per-handle umask, set by calling "
30579 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
30583 #: ../src/guestfs.pod:236
30584 msgid "PARTITIONING"
30588 #: ../src/guestfs.pod:238
30590 "Libguestfs contains API calls to read, create and modify partition tables on "
30595 #: ../src/guestfs.pod:241
30597 "In the common case where you want to create a single partition covering the "
30598 "whole disk, you should use the L</guestfs_part_disk> call:"
30602 #: ../src/guestfs.pod:245
30605 " const char *parttype = \"mbr\";\n"
30606 " if (disk_is_larger_than_2TB)\n"
30607 " parttype = \"gpt\";\n"
30608 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
30613 #: ../src/guestfs.pod:250
30615 "Obviously this effectively wipes anything that was on that disk image "
30620 #: ../src/guestfs.pod:253
30625 #: ../src/guestfs.pod:255
30627 "Libguestfs provides access to a large part of the LVM2 API, such as "
30628 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
30629 "unless you familiarize yourself with the concepts of physical volumes, "
30630 "volume groups and logical volumes."
30634 #: ../src/guestfs.pod:260
30636 "This author strongly recommends reading the LVM HOWTO, online at "
30637 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
30641 #: ../src/guestfs.pod:263
30642 msgid "DOWNLOADING"
30646 #: ../src/guestfs.pod:265
30648 "Use L</guestfs_cat> to download small, text only files. This call is "
30649 "limited to files which are less than 2 MB and which cannot contain any ASCII "
30650 "NUL (C<\\0>) characters. However the API is very simple to use."
30654 #: ../src/guestfs.pod:269
30656 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
30657 "bit data, since it returns a (pointer, size) pair. However it is still "
30658 "limited to \"small\" files, less than 2 MB."
30662 #: ../src/guestfs.pod:273
30664 "L</guestfs_download> can be used to download any file, with no limits on "
30665 "content or size (even files larger than 4 GB)."
30669 #: ../src/guestfs.pod:276
30670 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
30674 #: ../src/guestfs.pod:279
30679 #: ../src/guestfs.pod:281
30681 "It's often the case that you want to write a file or files to the disk "
30686 #: ../src/guestfs.pod:284
30688 "To write a small file with fixed content, use L</guestfs_write>. To create "
30689 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
30690 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
30691 "variety of other functions for creating test files, for example "
30692 "L</guestfs_fill> and L</guestfs_fill_pattern>."
30696 #: ../src/guestfs.pod:290
30698 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
30699 "file content or size (even files larger than 4 GB)."
30703 #: ../src/guestfs.pod:293
30704 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
30708 #: ../src/guestfs.pod:295
30710 "However the fastest way to upload I<large numbers of arbitrary files> is to "
30711 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
30712 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
30713 "the drive in a predictable way (eg. adding it last after all other drives) "
30714 "then you can get the device name from L</guestfs_list_devices> and mount it "
30715 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
30716 "sometimes non-portable between kernel versions, and they don't support "
30717 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
30718 "using a label or UUID, use an ISO image instead."
30722 #: ../src/guestfs.pod:306
30727 #: ../src/guestfs.pod:308
30729 "There are various different commands for copying between files and devices "
30730 "and in and out of the guest filesystem. These are summarised in the table "
30735 #: ../src/guestfs.pod:314
30736 msgid "B<file> to B<file>"
30740 #: ../src/guestfs.pod:316
30742 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
30743 "directories recursively."
30747 #: ../src/guestfs.pod:319
30748 msgid "B<file or device> to B<file or device>"
30752 #: ../src/guestfs.pod:321
30754 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
30755 "devices in the guest."
30759 #: ../src/guestfs.pod:324
30760 msgid "Example: duplicate the contents of an LV:"
30764 #: ../src/guestfs.pod:326
30767 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
30772 #: ../src/guestfs.pod:328
30774 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
30775 "(C</dev/VG/Original>). To copy less than the whole source device, use "
30776 "L</guestfs_copy_size>."
30780 #: ../src/guestfs.pod:332
30781 msgid "B<file on the host> to B<file or device>"
30785 #: ../src/guestfs.pod:334
30786 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
30790 #: ../src/guestfs.pod:336
30791 msgid "B<file or device> to B<file on the host>"
30795 #: ../src/guestfs.pod:338
30796 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
30800 #: ../src/guestfs.pod:342
30801 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
30805 #: ../src/guestfs.pod:344
30807 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
30808 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
30809 "appears you can only upload and download to files. However many Un*x-like "
30810 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
30811 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
30812 "stderr, and arbitrary file descriptor N."
30816 #: ../src/guestfs.pod:352
30817 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
30821 #: ../src/guestfs.pod:355
30824 " guestfs_download (g, filename, \"/dev/stdout\");\n"
30829 #: ../src/guestfs.pod:357
30830 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
30834 #: ../src/guestfs.pod:359
30837 " char devfd[64];\n"
30838 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
30839 " guestfs_tar_out (g, \"/\", devfd);\n"
30844 #: ../src/guestfs.pod:363
30845 msgid "LISTING FILES"
30849 #: ../src/guestfs.pod:365
30851 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
30852 "L<guestfish(1)>-equivalent command C<ll>)."
30856 #: ../src/guestfs.pod:368
30858 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
30859 "programs, as a flat list of strings."
30863 #: ../src/guestfs.pod:371
30865 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
30866 "directory, plus additional information about each one. It is more "
30867 "equivalent to using the L<readdir(3)> call on a local filesystem."
30871 #: ../src/guestfs.pod:375
30873 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
30878 #: ../src/guestfs.pod:378
30879 msgid "RUNNING COMMANDS"
30883 #: ../src/guestfs.pod:380
30885 "Although libguestfs is primarily an API for manipulating files inside guest "
30886 "images, we also provide some limited facilities for running commands inside "
30891 #: ../src/guestfs.pod:384
30892 msgid "There are many limitations to this:"
30896 #: ../src/guestfs.pod:390
30898 "The kernel version that the command runs under will be different from what "
30903 #: ../src/guestfs.pod:395
30905 "If the command needs to communicate with daemons, then most likely they "
30906 "won't be running."
30910 #: ../src/guestfs.pod:400
30911 msgid "The command will be running in limited memory."
30915 #: ../src/guestfs.pod:404
30917 "The network may not be available unless you enable it (see "
30918 "L</guestfs_set_network>)."
30922 #: ../src/guestfs.pod:409
30923 msgid "Only supports Linux guests (not Windows, BSD, etc)."
30927 #: ../src/guestfs.pod:413
30928 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
30932 #: ../src/guestfs.pod:418
30934 "For SELinux guests, you may need to enable SELinux and load policy first. "
30935 "See L</SELINUX> in this manpage."
30939 #: ../src/guestfs.pod:423
30941 "I<Security:> It is not safe to run commands from untrusted, possibly "
30942 "malicious guests. These commands may attempt to exploit your program by "
30943 "sending unexpected output. They could also try to exploit the Linux kernel "
30944 "or qemu provided by the libguestfs appliance. They could use the network "
30945 "provided by the libguestfs appliance to bypass ordinary network partitions "
30946 "and firewalls. They could use the elevated privileges or different SELinux "
30947 "context of your program to their advantage."
30951 #: ../src/guestfs.pod:432
30953 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
30954 "(a script which runs when the guest next boots normally), and to have this "
30955 "script run the commands you want in the normal context of the running guest, "
30956 "network security and so on. For information about other security issues, "
30957 "see L</SECURITY>."
30961 #: ../src/guestfs.pod:440
30963 "The two main API calls to run commands are L</guestfs_command> and "
30964 "L</guestfs_sh> (there are also variations)."
30968 #: ../src/guestfs.pod:443
30970 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
30971 "shell globs, redirections, etc will work."
30975 #: ../src/guestfs.pod:446
30976 msgid "CONFIGURATION FILES"
30980 #: ../src/guestfs.pod:448
30982 "To read and write configuration files in Linux guest filesystems, we "
30983 "strongly recommend using Augeas. For example, Augeas understands how to "
30984 "read and write, say, a Linux shadow password file or X.org configuration "
30985 "file, and so avoids you having to write that code."
30989 #: ../src/guestfs.pod:453
30991 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
30992 "document Augeas itself here because there is excellent documentation on the "
30993 "L<http://augeas.net/> website."
30997 #: ../src/guestfs.pod:457
30999 "If you don't want to use Augeas (you fool!) then try calling "
31000 "L</guestfs_read_lines> to get the file as a list of lines which you can "
31005 #: ../src/guestfs.pod:461
31010 #: ../src/guestfs.pod:463
31012 "We support SELinux guests. To ensure that labeling happens correctly in "
31013 "SELinux guests, you need to enable SELinux and load the guest's policy:"
31017 #: ../src/guestfs.pod:471
31018 msgid "Before launching, do:"
31022 #: ../src/guestfs.pod:473
31025 " guestfs_set_selinux (g, 1);\n"
31030 #: ../src/guestfs.pod:477
31032 "After mounting the guest's filesystem(s), load the policy. This is best "
31033 "done by running the L<load_policy(8)> command in the guest itself:"
31037 #: ../src/guestfs.pod:481
31040 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
31045 #: ../src/guestfs.pod:483
31047 "(Older versions of C<load_policy> require you to specify the name of the "
31052 #: ../src/guestfs.pod:488
31054 "Optionally, set the security context for the API. The correct security "
31055 "context to use can only be known by inspecting the guest. As an example:"
31059 #: ../src/guestfs.pod:492
31062 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
31067 #: ../src/guestfs.pod:496
31068 msgid "This will work for running commands and editing existing files."
31072 #: ../src/guestfs.pod:498
31074 "When new files are created, you may need to label them explicitly, for "
31075 "example by running the external command C<restorecon pathname>."
31079 #: ../src/guestfs.pod:502
31084 #: ../src/guestfs.pod:504
31086 "Certain calls are affected by the current file mode creation mask (the "
31087 "\"umask\"). In particular ones which create files or directories, such as "
31088 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
31089 "either the default mode that the file is created with or modifies the mode "
31094 #: ../src/guestfs.pod:510
31096 "The default umask is C<022>, so files are created with modes such as C<0644> "
31097 "and directories with C<0755>."
31101 #: ../src/guestfs.pod:513
31103 "There are two ways to avoid being affected by umask. Either set umask to 0 "
31104 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
31105 "L</guestfs_chmod> after creating each file or directory."
31109 #: ../src/guestfs.pod:517
31110 msgid "For more information about umask, see L<umask(2)>."
31114 #: ../src/guestfs.pod:521
31116 "Libguestfs allows you to access Linux guests which have been encrypted using "
31117 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
31118 "standard. This includes nearly all whole disk encryption systems used by "
31119 "modern Linux guests."
31123 #: ../src/guestfs.pod:527
31125 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
31126 "returns the string C<crypto_LUKS>)."
31130 #: ../src/guestfs.pod:530
31132 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
31133 "will require the passphrase!"
31137 #: ../src/guestfs.pod:533
31139 "Opening a LUKS device creates a new device mapper device called "
31140 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
31141 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
31142 "decrypted from and encrypted to the underlying block device respectively."
31146 #: ../src/guestfs.pod:539
31148 "LVM volume groups on the device can be made visible by calling "
31149 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
31150 "volume(s) can now be mounted in the usual way."
31154 #: ../src/guestfs.pod:543
31156 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
31157 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
31158 "[\"/dev/VG\"])>. Then close the mapper device by calling "
31159 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
31160 "underlying encrypted block device)."
31164 #: ../src/guestfs.pod:550
31169 #: ../src/guestfs.pod:552
31171 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
31172 "contains operating systems, an install CD or a live CD. (These APIs used to "
31173 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
31174 "version 1.5.3 the most frequently used part of this library has been "
31175 "rewritten in C and moved into the core code)."
31179 #: ../src/guestfs.pod:559
31181 "Add all disks belonging to the unknown virtual machine and call "
31182 "L</guestfs_launch> in the usual way."
31186 #: ../src/guestfs.pod:562
31188 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
31189 "and certain heuristics, and returns a list of operating systems that were "
31190 "found. An empty list means none were found. A single element is the root "
31191 "filesystem of the operating system. For dual- or multi-boot guests, "
31192 "multiple roots can be returned, each one corresponding to a separate "
31193 "operating system. (Multi-boot virtual machines are extremely rare in the "
31194 "world of virtualization, but since this scenario can happen, we have built "
31195 "libguestfs to deal with it.)"
31199 #: ../src/guestfs.pod:571
31201 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
31202 "to get additional details about that operating system. For example, call "
31203 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
31204 "Windows and Linux-based operating systems respectively."
31208 #: ../src/guestfs.pod:577
31210 "Un*x-like and Linux-based operating systems usually consist of several "
31211 "filesystems which are mounted at boot time (for example, a separate boot "
31212 "partition mounted on C</boot>). The inspection rules are able to detect how "
31213 "filesystems correspond to mount points. Call "
31214 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
31215 "hash table like this example:"
31219 #: ../src/guestfs.pod:584
31222 " /boot => /dev/sda1\n"
31223 " / => /dev/vg_guest/lv_root\n"
31224 " /usr => /dev/vg_guest/lv_usr\n"
31229 #: ../src/guestfs.pod:588
31231 "The caller can then make calls to L</guestfs_mount_options> to mount the "
31232 "filesystems as suggested."
31236 #: ../src/guestfs.pod:591
31238 "Be careful to mount filesystems in the right order (eg. C</> before "
31239 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
31244 #: ../src/guestfs.pod:595
31246 "Inspection currently only works for some common operating systems. "
31247 "Contributors are welcome to send patches for other operating systems that we "
31248 "currently cannot detect."
31252 #: ../src/guestfs.pod:599
31254 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
31255 "for more details. The L</guestfs_inspect_os> function just ignores any "
31256 "encrypted devices."
31260 #: ../src/guestfs.pod:603
31262 "A note on the implementation: The call L</guestfs_inspect_os> performs "
31263 "inspection and caches the results in the guest handle. Subsequent calls to "
31264 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
31265 "re-read the disks. If you change the content of the guest disks, you can "
31266 "redo inspection by calling L</guestfs_inspect_os> again. "
31267 "(L</guestfs_inspect_list_applications> works a little differently from the "
31268 "other calls and does read the disks. See documentation for that function "
31273 #: ../src/guestfs.pod:612
31274 msgid "INSPECTING INSTALL DISKS"
31278 #: ../src/guestfs.pod:614
31280 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
31285 #: ../src/guestfs.pod:617
31287 "Call L</guestfs_inspect_get_format> to return the format of the operating "
31288 "system, which currently can be C<installed> (a regular operating system) or "
31289 "C<installer> (some sort of install disk)."
31293 #: ../src/guestfs.pod:621
31295 "Further information is available about the operating system that can be "
31296 "installed using the regular inspection APIs like "
31297 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
31302 #: ../src/guestfs.pod:626
31304 "Some additional information specific to installer disks is also available "
31305 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
31306 "L</guestfs_inspect_is_multipart> calls."
31310 #: ../src/guestfs.pod:631
31311 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
31315 #: ../src/guestfs.pod:633
31317 "Libguestfs can mount NTFS partitions. It does this using the "
31318 "L<http://www.ntfs-3g.org/> driver."
31322 #: ../src/guestfs.pod:636
31323 msgid "DRIVE LETTERS AND PATHS"
31327 #: ../src/guestfs.pod:638
31329 "DOS and Windows still use drive letters, and the filesystems are always "
31330 "treated as case insensitive by Windows itself, and therefore you might find "
31331 "a Windows configuration file referring to a path like "
31332 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
31333 "that directory might be referred to as C</WINDOWS/System32>."
31337 #: ../src/guestfs.pod:644
31339 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
31340 "L</guestfs_inspect_get_drive_mappings>)"
31344 #: ../src/guestfs.pod:647
31346 "Dealing with separator characters (backslash vs forward slash) is outside "
31347 "the scope of libguestfs, but usually a simple character replacement will "
31352 #: ../src/guestfs.pod:651
31354 "To resolve the case insensitivity of paths, call "
31355 "L</guestfs_case_sensitive_path>."
31359 #: ../src/guestfs.pod:654
31360 msgid "ACCESSING THE WINDOWS REGISTRY"
31364 #: ../src/guestfs.pod:656
31366 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
31367 "files, through the library C<hivex> which is part of the libguestfs project "
31368 "although ships as a separate tarball. You have to locate and download the "
31369 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
31370 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
31371 "L<virt-win-reg(1)> for more help on this issue."
31375 #: ../src/guestfs.pod:664
31376 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
31380 #: ../src/guestfs.pod:666
31382 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
31383 "provide something which looks like a Linux symlink. The way it tries to do "
31384 "the rewriting is described here:"
31388 #: ../src/guestfs.pod:670
31389 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
31393 #: ../src/guestfs.pod:672
31395 "The essential problem is that ntfs-3g simply does not have enough "
31396 "information to do a correct job. NTFS links can contain drive letters and "
31397 "references to external device GUIDs that ntfs-3g has no way of resolving. "
31398 "It is almost certainly the case that libguestfs callers should ignore what "
31399 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
31403 #: ../src/guestfs.pod:679
31405 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
31406 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
31407 "attribute, and read the raw reparse data from that (you can find the format "
31408 "documented in various places around the web)."
31412 #: ../src/guestfs.pod:684
31413 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
31417 #: ../src/guestfs.pod:686
31419 "There are other useful extended attributes that can be read from ntfs-3g "
31420 "filesystems (using L</guestfs_getxattr>). See:"
31424 #: ../src/guestfs.pod:689
31425 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
31429 #: ../src/guestfs.pod:691
31430 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
31434 #: ../src/guestfs.pod:693
31436 "Although we don't want to discourage you from using the C API, we will "
31437 "mention here that the same API is also available in other languages."
31441 #: ../src/guestfs.pod:696
31443 "The API is broadly identical in all supported languages. This means that "
31444 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
31445 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
31446 "OCaml. In other words, a straightforward, predictable isomorphism between "
31451 #: ../src/guestfs.pod:702
31453 "Error messages are automatically transformed into exceptions if the language "
31458 #: ../src/guestfs.pod:705
31460 "We don't try to \"object orientify\" parts of the API in OO languages, "
31461 "although contributors are welcome to write higher level APIs above what we "
31462 "provide in their favourite languages if they wish."
31466 #: ../src/guestfs.pod:711
31471 #: ../src/guestfs.pod:713
31473 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
31474 "identical to the C API. C++ classes and exceptions are not used."
31478 #: ../src/guestfs.pod:717
31483 #: ../src/guestfs.pod:719
31485 "The C# bindings are highly experimental. Please read the warnings at the "
31486 "top of C<csharp/Libguestfs.cs>."
31490 #: ../src/guestfs.pod:722
31495 #: ../src/guestfs.pod:724
31497 "This is the only language binding that is working but incomplete. Only "
31498 "calls which return simple integers have been bound in Haskell, and we are "
31499 "looking for help to complete this binding."
31503 #: ../src/guestfs.pod:728
31508 #: ../src/guestfs.pod:730
31510 "Full documentation is contained in the Javadoc which is distributed with "
31511 "libguestfs. For examples, see L<guestfs-java(3)>."
31515 #: ../src/guestfs.pod:733
31520 #: ../src/guestfs.pod:735
31521 msgid "See L<guestfs-ocaml(3)>."
31525 #: ../src/guestfs.pod:737
31530 #: ../src/guestfs.pod:739
31531 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
31535 #: ../src/guestfs.pod:741
31540 #: ../src/guestfs.pod:743
31542 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
31543 "the php-libguestfs package for your distribution."
31547 #: ../src/guestfs.pod:746
31548 msgid "The PHP binding only works correctly on 64 bit machines."
31552 #: ../src/guestfs.pod:748
31557 #: ../src/guestfs.pod:750
31558 msgid "See L<guestfs-python(3)>."
31562 #: ../src/guestfs.pod:752
31567 #: ../src/guestfs.pod:754
31568 msgid "See L<guestfs-ruby(3)>."
31572 #: ../src/guestfs.pod:756
31573 msgid "B<shell scripts>"
31577 #: ../src/guestfs.pod:758
31578 msgid "See L<guestfish(1)>."
31582 #: ../src/guestfs.pod:762
31583 msgid "LIBGUESTFS GOTCHAS"
31587 #: ../src/guestfs.pod:764
31589 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
31590 "system [...] that works in the way it is documented but is counterintuitive "
31591 "and almost invites mistakes.\""
31595 #: ../src/guestfs.pod:768
31597 "Since we developed libguestfs and the associated tools, there are several "
31598 "things we would have designed differently, but are now stuck with for "
31599 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
31600 "release, you can expect these to change. Beware of them."
31604 #: ../src/guestfs.pod:776
31605 msgid "Autosync / forgetting to sync."
31609 #: ../src/guestfs.pod:778
31611 "I<Update:> Autosync is enabled by default for all API users starting from "
31612 "libguestfs 1.5.24. This section only applies to older versions."
31616 #: ../src/guestfs.pod:781
31618 "When modifying a filesystem from C or another language, you B<must> unmount "
31619 "all filesystems and call L</guestfs_sync> explicitly before you close the "
31620 "libguestfs handle. You can also call:"
31624 #: ../src/guestfs.pod:785
31627 " guestfs_set_autosync (g, 1);\n"
31632 #: ../src/guestfs.pod:787
31634 "to have the unmount/sync done automatically for you when the handle 'g' is "
31635 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
31640 #: ../src/guestfs.pod:791
31642 "If you forget to do this, then it is entirely possible that your changes "
31643 "won't be written out, or will be partially written, or (very rarely) that "
31644 "you'll get disk corruption."
31648 #: ../src/guestfs.pod:795
31650 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
31651 "guestfish scripts that forget to sync will work just fine, which can make "
31652 "this very puzzling if you are trying to debug a problem."
31656 #: ../src/guestfs.pod:799
31657 msgid "Mount option C<-o sync> should not be the default."
31661 #: ../src/guestfs.pod:801
31663 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
31664 "However C<-o sync> does not add any reliability benefit, but does have a "
31665 "very large performance impact."
31669 #: ../src/guestfs.pod:805
31671 "The work around is to use L</guestfs_mount_options> and set the mount "
31672 "options that you actually want to use."
31676 #: ../src/guestfs.pod:808
31677 msgid "Read-only should be the default."
31681 #: ../src/guestfs.pod:810
31683 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
31684 "specify I<--rw> if you want to make changes to the image."
31688 #: ../src/guestfs.pod:813
31689 msgid "This would reduce the potential to corrupt live VM images."
31693 #: ../src/guestfs.pod:815
31695 "Note that many filesystems change the disk when you just mount and unmount, "
31696 "even if you didn't perform any writes. You need to use "
31697 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
31701 #: ../src/guestfs.pod:819
31702 msgid "guestfish command line is hard to use."
31706 #: ../src/guestfs.pod:821
31708 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
31709 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
31710 "exist, so it fails. In earlier versions of guestfish the error message was "
31711 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
31712 "we should have used C<guestfish -c command> to run commands."
31716 #: ../src/guestfs.pod:828
31717 msgid "guestfish megabyte modifiers don't work right on all commands"
31721 #: ../src/guestfs.pod:830
31723 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
31724 "other modifiers). What guestfish actually does is to multiply the number "
31725 "part by the modifier part and pass the result to the C API. However this "
31726 "doesn't work for a few APIs which aren't expecting bytes, but are already "
31727 "expecting some other unit (eg. megabytes)."
31731 #: ../src/guestfs.pod:837
31732 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
31736 #: ../src/guestfs.pod:839
31739 " lvcreate LV VG 100M\n"
31744 #: ../src/guestfs.pod:841
31746 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
31747 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
31748 "megabytes * megabytes) logical volume. The error message you get from this "
31749 "is also a little obscure."
31753 #: ../src/guestfs.pod:846
31755 "This could be fixed in the generator by specially marking parameters and "
31756 "return values which take bytes or other units."
31760 #: ../src/guestfs.pod:849
31761 msgid "Ambiguity between devices and paths"
31765 #: ../src/guestfs.pod:851
31767 "There is a subtle ambiguity in the API between a device name "
31768 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
31769 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
31773 #: ../src/guestfs.pod:856
31775 "In the current API we usually resolve this ambiguity by having two separate "
31776 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
31777 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
31778 "detecting if the path supplied begins with C</dev/>."
31782 #: ../src/guestfs.pod:862
31784 "To avoid both the ambiguity and the need to duplicate some calls, we could "
31785 "make paths/devices into structured names. One way to do this would be to "
31786 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
31787 "aspect of grub. Another way would be to use a structured type, equivalent "
31788 "to this OCaml type:"
31792 #: ../src/guestfs.pod:868
31795 " type path = Path of string | Device of int | Partition of int * int\n"
31800 #: ../src/guestfs.pod:870
31801 msgid "which would allow you to pass arguments like:"
31805 #: ../src/guestfs.pod:872
31808 " Path \"/foo/bar\"\n"
31809 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
31810 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
31811 " Path \"/dev/sdb2\" (* not a device *)\n"
31816 #: ../src/guestfs.pod:877
31818 "As you can see there are still problems to resolve even with this "
31819 "representation. Also consider how it might work in guestfish."
31823 #: ../src/guestfs.pod:882
31824 msgid "KEYS AND PASSPHRASES"
31828 #: ../src/guestfs.pod:884
31830 "Certain libguestfs calls take a parameter that contains sensitive key "
31831 "material, passed in as a C string."
31835 #: ../src/guestfs.pod:887
31837 "In the future we would hope to change the libguestfs implementation so that "
31838 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
31839 "swap. However this is I<not> done at the moment, because of the complexity "
31840 "of such an implementation."
31844 #: ../src/guestfs.pod:892
31846 "Therefore you should be aware that any key parameter you pass to libguestfs "
31847 "might end up being written out to the swap partition. If this is a concern, "
31848 "scrub the swap partition or don't use libguestfs on encrypted devices."
31852 #: ../src/guestfs.pod:897
31853 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
31857 #: ../src/guestfs.pod:899
31859 "All high-level libguestfs actions are synchronous. If you want to use "
31860 "libguestfs asynchronously then you must create a thread."
31864 #: ../src/guestfs.pod:902
31866 "Only use the handle from a single thread. Either use the handle exclusively "
31867 "from one thread, or provide your own mutex so that two threads cannot issue "
31868 "calls on the same handle at the same time."
31872 #: ../src/guestfs.pod:906
31874 "See the graphical program guestfs-browser for one possible architecture for "
31875 "multithreaded programs using libvirt and libguestfs."
31879 #: ../src/guestfs.pod:909
31884 #: ../src/guestfs.pod:911
31886 "Libguestfs needs a supermin appliance, which it finds by looking along an "
31891 #: ../src/guestfs.pod:914
31893 "By default it looks for these in the directory C<$libdir/guestfs> "
31894 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
31898 #: ../src/guestfs.pod:917
31900 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
31901 "to change the directories that libguestfs will search in. The value is a "
31902 "colon-separated list of paths. The current directory is I<not> searched "
31903 "unless the path contains an empty element or C<.>. For example "
31904 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
31905 "then C</usr/lib/guestfs>."
31909 #: ../src/guestfs.pod:924
31910 msgid "QEMU WRAPPERS"
31914 #: ../src/guestfs.pod:926
31916 "If you want to compile your own qemu, run qemu from a non-standard location, "
31917 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
31922 #: ../src/guestfs.pod:930
31924 "There is one important rule to remember: you I<must C<exec qemu>> as the "
31925 "last command in the shell script (so that qemu replaces the shell and "
31926 "becomes the direct child of the libguestfs-using program). If you don't do "
31927 "this, then the qemu process won't be cleaned up correctly."
31931 #: ../src/guestfs.pod:935
31933 "Here is an example of a wrapper, where I have built my own copy of qemu from "
31938 #: ../src/guestfs.pod:938
31942 " qemudir=/home/rjones/d/qemu\n"
31943 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
31949 #: ../src/guestfs.pod:942
31951 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
31952 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
31957 #: ../src/guestfs.pod:946
31960 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
31965 #: ../src/guestfs.pod:948
31967 "Note that libguestfs also calls qemu with the -help and -version options in "
31968 "order to determine features."
31972 #: ../src/guestfs.pod:951
31973 msgid "ATTACHING TO RUNNING DAEMONS"
31977 #: ../src/guestfs.pod:953
31979 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
31980 "babies. Use with caution."
31984 #: ../src/guestfs.pod:956
31986 "I<Note (2):> This section explains how to attach to a running daemon from a "
31987 "low level perspective. For most users, simply using virt tools such as "
31988 "L<guestfish(1)> with the I<--live> option will \"just work\"."
31992 #: ../src/guestfs.pod:960
31993 msgid "Using guestfs_set_attach_method"
31997 #: ../src/guestfs.pod:962
31999 "By calling L</guestfs_set_attach_method> you can change how the library "
32000 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
32001 "L</ARCHITECTURE> for some background)."
32005 #: ../src/guestfs.pod:966
32007 "The normal attach method is C<appliance>, where a small appliance is created "
32008 "containing the daemon, and then the library connects to this."
32012 #: ../src/guestfs.pod:969
32014 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
32015 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
32016 "daemon over the Unix domain socket."
32020 #: ../src/guestfs.pod:973
32022 "The normal use for this is to connect to a running virtual machine that "
32023 "contains a C<guestfsd> daemon, and send commands so you can read and write "
32024 "files inside the live virtual machine."
32028 #: ../src/guestfs.pod:977
32029 msgid "Using guestfs_add_domain with live flag"
32033 #: ../src/guestfs.pod:979
32035 "L</guestfs_add_domain> provides some help for getting the correct attach "
32036 "method. If you pass the C<live> option to this function, then (if the "
32037 "virtual machine is running) it will examine the libvirt XML looking for a "
32038 "virtio-serial channel to connect to:"
32042 #: ../src/guestfs.pod:985
32049 " <channel type='unix'>\n"
32050 " <source mode='bind' path='/path/to/socket'/>\n"
32051 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
32060 #: ../src/guestfs.pod:997
32062 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
32063 "method to C<unix:/path/to/socket>."
32067 #: ../src/guestfs.pod:1000
32069 "Some of the libguestfs tools (including guestfish) support a I<--live> "
32070 "option which is passed through to L</guestfs_add_domain> thus allowing you "
32071 "to attach to and modify live virtual machines."
32075 #: ../src/guestfs.pod:1004
32077 "The virtual machine needs to have been set up beforehand so that it has the "
32078 "virtio-serial channel and so that guestfsd is running inside it."
32082 #: ../src/guestfs.pod:1008
32083 msgid "ABI GUARANTEE"
32087 #: ../src/guestfs.pod:1010
32089 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
32090 "actions as outlined in this section. Although we will deprecate some "
32091 "actions, for example if they get replaced by newer calls, we will keep the "
32092 "old actions forever. This allows you the developer to program in confidence "
32093 "against the libguestfs API."
32097 #: ../src/guestfs.pod:1016
32098 msgid "BLOCK DEVICE NAMING"
32102 #: ../src/guestfs.pod:1018
32104 "In the kernel there is now quite a profusion of schemata for naming block "
32105 "devices (in this context, by I<block device> I mean a physical or virtual "
32106 "hard drive). The original Linux IDE driver used names starting with "
32107 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
32108 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
32109 "replacement for the old IDE driver (particularly for SATA devices) those "
32110 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
32111 "machines with paravirtualized drivers. This has created several different "
32112 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
32117 #: ../src/guestfs.pod:1030
32119 "As discussed above, libguestfs uses a qemu appliance running an embedded "
32120 "Linux kernel to access block devices. We can run a variety of appliances "
32121 "based on a variety of Linux kernels."
32125 #: ../src/guestfs.pod:1034
32127 "This causes a problem for libguestfs because many API calls use device or "
32128 "partition names. Working scripts and the recipe (example) scripts that we "
32129 "make available over the internet could fail if the naming scheme changes."
32133 #: ../src/guestfs.pod:1039
32135 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
32136 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
32137 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
32138 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
32142 #: ../src/guestfs.pod:1045
32144 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
32145 "L</guestfs_list_partitions> and similar calls return the true names of the "
32146 "devices and partitions as known to the appliance."
32150 #: ../src/guestfs.pod:1050
32151 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
32155 #: ../src/guestfs.pod:1052
32157 "Usually this translation is transparent. However in some (very rare) cases "
32158 "you may need to know the exact algorithm. Such cases include where you use "
32159 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
32160 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
32165 #: ../src/guestfs.pod:1058
32167 "The algorithm is applied only to I<parameters> which are known to be either "
32168 "device or partition names. Return values from functions such as "
32169 "L</guestfs_list_devices> are never changed."
32173 #: ../src/guestfs.pod:1066
32174 msgid "Is the string a parameter which is a device or partition name?"
32178 #: ../src/guestfs.pod:1070
32179 msgid "Does the string begin with C</dev/sd>?"
32183 #: ../src/guestfs.pod:1074
32185 "Does the named device exist? If so, we use that device. However if I<not> "
32186 "then we continue with this algorithm."
32190 #: ../src/guestfs.pod:1079
32191 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
32195 #: ../src/guestfs.pod:1081
32196 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
32200 #: ../src/guestfs.pod:1083
32201 msgid "If that named device exists, use it. If not, continue."
32205 #: ../src/guestfs.pod:1087
32206 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
32210 #: ../src/guestfs.pod:1089
32211 msgid "If that named device exists, use it. If not, return an error."
32215 #: ../src/guestfs.pod:1093
32216 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
32220 #: ../src/guestfs.pod:1095
32222 "Although the standard naming scheme and automatic translation is useful for "
32223 "simple programs and guestfish scripts, for larger programs it is best not to "
32224 "rely on this mechanism."
32228 #: ../src/guestfs.pod:1099
32230 "Where possible for maximum future portability programs using libguestfs "
32231 "should use these future-proof techniques:"
32235 #: ../src/guestfs.pod:1106
32237 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
32238 "device names, and then use those names directly."
32242 #: ../src/guestfs.pod:1109
32243 msgid "Since those device names exist by definition, they will never be translated."
32247 #: ../src/guestfs.pod:1114
32249 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
32250 "filesystem labels."
32254 #: ../src/guestfs.pod:1119
32259 #: ../src/guestfs.pod:1121
32261 "This section discusses security implications of using libguestfs, "
32262 "particularly with untrusted or malicious guests or disk images."
32266 #: ../src/guestfs.pod:1124
32267 msgid "GENERAL SECURITY CONSIDERATIONS"
32271 #: ../src/guestfs.pod:1126
32273 "Be careful with any files or data that you download from a guest (by "
32274 "\"download\" we mean not just the L</guestfs_download> command but any "
32275 "command that reads files, filenames, directories or anything else from a "
32276 "disk image). An attacker could manipulate the data to fool your program "
32277 "into doing the wrong thing. Consider cases such as:"
32281 #: ../src/guestfs.pod:1136
32282 msgid "the data (file etc) not being present"
32286 #: ../src/guestfs.pod:1140
32287 msgid "being present but empty"
32291 #: ../src/guestfs.pod:1144
32292 msgid "being much larger than normal"
32296 #: ../src/guestfs.pod:1148
32297 msgid "containing arbitrary 8 bit data"
32301 #: ../src/guestfs.pod:1152
32302 msgid "being in an unexpected character encoding"
32306 #: ../src/guestfs.pod:1156
32307 msgid "containing homoglyphs."
32311 #: ../src/guestfs.pod:1160
32312 msgid "SECURITY OF MOUNTING FILESYSTEMS"
32316 #: ../src/guestfs.pod:1162
32318 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
32319 "(VFS) module can sometimes be escalated into exploits by deliberately "
32320 "creating a malicious, malformed filesystem. These exploits are very severe "
32321 "for two reasons. Firstly there are very many filesystem drivers in the "
32322 "kernel, and many of them are infrequently used and not much developer "
32323 "attention has been paid to the code. Linux userspace helps potential "
32324 "crackers by detecting the filesystem type and automatically choosing the "
32325 "right VFS driver, even if that filesystem type is obscure or unexpected for "
32326 "the administrator. Secondly, a kernel-level exploit is like a local root "
32327 "exploit (worse in some ways), giving immediate and total access to the "
32328 "system right down to the hardware level."
32332 #: ../src/guestfs.pod:1175
32334 "That explains why you should never mount a filesystem from an untrusted "
32335 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
32336 "inside a qemu virtual machine, usually running as a non-root user. The "
32337 "attacker would need to write a filesystem which first exploited the kernel, "
32338 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
32339 "the libguestfs protocol, and finally to be as serious as the host kernel "
32340 "exploit it would need to escalate its privileges to root. This multi-step "
32341 "escalation, performed by a static piece of data, is thought to be extremely "
32342 "hard to do, although we never say 'never' about security issues."
32346 #: ../src/guestfs.pod:1186
32348 "In any case callers can reduce the attack surface by forcing the filesystem "
32349 "type when mounting (use L</guestfs_mount_vfs>)."
32353 #: ../src/guestfs.pod:1189
32354 msgid "PROTOCOL SECURITY"
32358 #: ../src/guestfs.pod:1191
32360 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
32361 "defined upper message size. However a program that uses libguestfs must "
32362 "also take care - for example you can write a program that downloads a binary "
32363 "from a disk image and executes it locally, and no amount of protocol "
32364 "security will save you from the consequences."
32368 #: ../src/guestfs.pod:1197
32369 msgid "INSPECTION SECURITY"
32373 #: ../src/guestfs.pod:1199
32375 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
32376 "directly from the guest, and these could contain any 8 bit data. Callers "
32377 "should be careful to escape these before printing them to a structured file "
32378 "(for example, use HTML escaping if creating a web page)."
32382 #: ../src/guestfs.pod:1205
32384 "Guest configuration may be altered in unusual ways by the administrator of "
32385 "the virtual machine, and may not reflect reality (particularly for untrusted "
32386 "or actively malicious guests). For example we parse the hostname from "
32387 "configuration files like C</etc/sysconfig/network> that we find in the "
32388 "guest, but the guest administrator can easily manipulate these files to "
32389 "provide the wrong hostname."
32393 #: ../src/guestfs.pod:1213
32395 "The inspection API parses guest configuration using two external libraries: "
32396 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
32397 "designed to be robust in the face of malicious data, although denial of "
32398 "service attacks are still possible, for example with oversized configuration "
32403 #: ../src/guestfs.pod:1219
32404 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
32408 #: ../src/guestfs.pod:1221
32410 "Be very cautious about running commands from the guest. By running a "
32411 "command in the guest, you are giving CPU time to a binary that you do not "
32412 "control, under the same user account as the library, albeit wrapped in qemu "
32413 "virtualization. More information and alternatives can be found in the "
32414 "section L</RUNNING COMMANDS>."
32418 #: ../src/guestfs.pod:1227
32419 msgid "CVE-2010-3851"
32423 #: ../src/guestfs.pod:1229
32424 msgid "https://bugzilla.redhat.com/642934"
32428 #: ../src/guestfs.pod:1231
32430 "This security bug concerns the automatic disk format detection that qemu "
32431 "does on disk images."
32435 #: ../src/guestfs.pod:1234
32437 "A raw disk image is just the raw bytes, there is no header. Other disk "
32438 "images like qcow2 contain a special header. Qemu deals with this by looking "
32439 "for one of the known headers, and if none is found then assuming the disk "
32440 "image must be raw."
32444 #: ../src/guestfs.pod:1239
32446 "This allows a guest which has been given a raw disk image to write some "
32447 "other header. At next boot (or when the disk image is accessed by "
32448 "libguestfs) qemu would do autodetection and think the disk image format was, "
32449 "say, qcow2 based on the header written by the guest."
32453 #: ../src/guestfs.pod:1244
32455 "This in itself would not be a problem, but qcow2 offers many features, one "
32456 "of which is to allow a disk image to refer to another image (called the "
32457 "\"backing disk\"). It does this by placing the path to the backing disk "
32458 "into the qcow2 header. This path is not validated and could point to any "
32459 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
32460 "\"holes\" in the qcow2 disk image, which of course is completely under the "
32461 "control of the attacker."
32465 #: ../src/guestfs.pod:1252
32466 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
32470 #: ../src/guestfs.pod:1259
32471 msgid "You have enabled the network or have opened the disk in write mode."
32475 #: ../src/guestfs.pod:1263
32477 "You are also running untrusted code from the guest (see L</RUNNING "
32482 #: ../src/guestfs.pod:1268
32484 "The way to avoid this is to specify the expected disk format when adding "
32485 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
32486 "should always do this if the disk is raw format, and it's a good idea for "
32491 #: ../src/guestfs.pod:1273
32493 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
32494 "format is fetched from libvirt and passed through."
32498 #: ../src/guestfs.pod:1276
32500 "For libguestfs tools, use the I<--format> command line parameter as "
32505 #: ../src/guestfs.pod:1279
32506 msgid "CONNECTION MANAGEMENT"
32510 #: ../src/guestfs.pod:1281
32511 msgid "guestfs_h *"
32515 #: ../src/guestfs.pod:1283
32517 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
32518 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
32519 "handle and release all resources used."
32523 #: ../src/guestfs.pod:1287
32525 "For information on using multiple handles and threads, see the section "
32526 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
32530 #: ../src/guestfs.pod:1290
32531 msgid "guestfs_create"
32535 #: ../src/guestfs.pod:1292
32538 " guestfs_h *guestfs_create (void);\n"
32543 #: ../src/guestfs.pod:1294
32544 msgid "Create a connection handle."
32548 #: ../src/guestfs.pod:1296
32550 "On success this returns a non-NULL pointer to a handle. On error it returns "
32555 #: ../src/guestfs.pod:1299
32557 "You have to \"configure\" the handle after creating it. This includes "
32558 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
32559 "handle at least once."
32563 #: ../src/guestfs.pod:1303
32564 msgid "After configuring the handle, you have to call L</guestfs_launch>."
32568 #: ../src/guestfs.pod:1305
32570 "You may also want to configure error handling for the handle. See the "
32571 "L</ERROR HANDLING> section below."
32575 #: ../src/guestfs.pod:1308
32576 msgid "guestfs_close"
32580 #: ../src/guestfs.pod:1310
32583 " void guestfs_close (guestfs_h *g);\n"
32588 #: ../src/guestfs.pod:1312
32589 msgid "This closes the connection handle and frees up all resources used."
32593 #: ../src/guestfs.pod:1314
32595 "If autosync was set on the handle and the handle was launched, then this "
32596 "implicitly calls various functions to unmount filesystems and sync the "
32597 "disk. See L</guestfs_set_autosync> for more details."
32601 #: ../src/guestfs.pod:1318
32602 msgid "If a close callback was set on the handle, then it is called."
32606 #: ../src/guestfs.pod:1320
32607 msgid "ERROR HANDLING"
32611 #: ../src/guestfs.pod:1322
32613 "API functions can return errors. For example, almost all functions that "
32614 "return C<int> will return C<-1> to indicate an error."
32618 #: ../src/guestfs.pod:1325
32620 "Additional information is available for errors: an error message string and "
32621 "optionally an error number (errno) if the thing that failed was a system "
32626 #: ../src/guestfs.pod:1329
32628 "You can get at the additional information about the last error on the handle "
32629 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
32630 "up an error handler with L</guestfs_set_error_handler>."
32634 #: ../src/guestfs.pod:1334
32636 "When the handle is created, a default error handler is installed which "
32637 "prints the error message string to C<stderr>. For small short-running "
32638 "command line programs it is sufficient to do:"
32642 #: ../src/guestfs.pod:1338
32645 " if (guestfs_launch (g) == -1)\n"
32646 " exit (EXIT_FAILURE);\n"
32651 #: ../src/guestfs.pod:1341
32653 "since the default error handler will ensure that an error message has been "
32654 "printed to C<stderr> before the program exits."
32658 #: ../src/guestfs.pod:1344
32660 "For other programs the caller will almost certainly want to install an "
32661 "alternate error handler or do error handling in-line like this:"
32665 #: ../src/guestfs.pod:1347
32668 " /* This disables the default behaviour of printing errors\n"
32670 " guestfs_set_error_handler (g, NULL, NULL);\n"
32675 #: ../src/guestfs.pod:1351
32678 " if (guestfs_launch (g) == -1) {\n"
32679 " /* Examine the error message and print it etc. */\n"
32680 " char *msg = guestfs_last_error (g);\n"
32681 " int errnum = guestfs_last_errno (g);\n"
32682 " fprintf (stderr, \"%s\", msg);\n"
32683 " if (errnum != 0)\n"
32684 " fprintf (stderr, \": %s\", strerror (errnum));\n"
32685 " fprintf (stderr, \"\\n\");\n"
32692 #: ../src/guestfs.pod:1362
32694 "Out of memory errors are handled differently. The default action is to call "
32695 "L<abort(3)>. If this is undesirable, then you can set a handler using "
32696 "L</guestfs_set_out_of_memory_handler>."
32700 #: ../src/guestfs.pod:1366
32702 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
32703 "because there is no handle if this happens there is no way to get additional "
32704 "error information. However L</guestfs_create> is supposed to be a "
32705 "lightweight operation which can only fail because of insufficient memory (it "
32706 "returns NULL in this case)."
32710 #: ../src/guestfs.pod:1372
32711 msgid "guestfs_last_error"
32715 #: ../src/guestfs.pod:1374
32718 " const char *guestfs_last_error (guestfs_h *g);\n"
32723 #: ../src/guestfs.pod:1376
32725 "This returns the last error message that happened on C<g>. If there has not "
32726 "been an error since the handle was created, then this returns C<NULL>."
32730 #: ../src/guestfs.pod:1380
32732 "The lifetime of the returned string is until the next error occurs, or "
32733 "L</guestfs_close> is called."
32737 #: ../src/guestfs.pod:1383
32738 msgid "guestfs_last_errno"
32742 #: ../src/guestfs.pod:1385
32745 " int guestfs_last_errno (guestfs_h *g);\n"
32750 #: ../src/guestfs.pod:1387
32751 msgid "This returns the last error number (errno) that happened on C<g>."
32755 #: ../src/guestfs.pod:1389
32756 msgid "If successful, an errno integer not equal to zero is returned."
32760 #: ../src/guestfs.pod:1391
32761 msgid "If no error, this returns 0. This call can return 0 in three situations:"
32765 #: ../src/guestfs.pod:1398
32766 msgid "There has not been any error on the handle."
32770 #: ../src/guestfs.pod:1402
32772 "There has been an error but the errno was meaningless. This corresponds to "
32773 "the case where the error did not come from a failed system call, but for "
32774 "some other reason."
32778 #: ../src/guestfs.pod:1408
32780 "There was an error from a failed system call, but for some reason the errno "
32781 "was not captured and returned. This usually indicates a bug in libguestfs."
32785 #: ../src/guestfs.pod:1414
32787 "Libguestfs tries to convert the errno from inside the applicance into a "
32788 "corresponding errno for the caller (not entirely trivial: the appliance "
32789 "might be running a completely different operating system from the library "
32790 "and error numbers are not standardized across Un*xen). If this could not be "
32791 "done, then the error is translated to C<EINVAL>. In practice this should "
32792 "only happen in very rare circumstances."
32796 #: ../src/guestfs.pod:1422
32797 msgid "guestfs_set_error_handler"
32801 #: ../src/guestfs.pod:1424
32804 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
32806 " const char *msg);\n"
32807 " void guestfs_set_error_handler (guestfs_h *g,\n"
32808 " guestfs_error_handler_cb cb,\n"
32809 " void *opaque);\n"
32814 #: ../src/guestfs.pod:1431
32816 "The callback C<cb> will be called if there is an error. The parameters "
32817 "passed to the callback are an opaque data pointer and the error message "
32822 #: ../src/guestfs.pod:1435
32824 "C<errno> is not passed to the callback. To get that the callback must call "
32825 "L</guestfs_last_errno>."
32829 #: ../src/guestfs.pod:1438
32831 "Note that the message string C<msg> is freed as soon as the callback "
32832 "function returns, so if you want to stash it somewhere you must make your "
32837 #: ../src/guestfs.pod:1442
32838 msgid "The default handler prints messages on C<stderr>."
32842 #: ../src/guestfs.pod:1444
32843 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
32847 #: ../src/guestfs.pod:1446
32848 msgid "guestfs_get_error_handler"
32852 #: ../src/guestfs.pod:1448
32855 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
32856 " void **opaque_rtn);\n"
32861 #: ../src/guestfs.pod:1451
32862 msgid "Returns the current error handler callback."
32866 #: ../src/guestfs.pod:1453
32867 msgid "guestfs_set_out_of_memory_handler"
32871 #: ../src/guestfs.pod:1455
32874 " typedef void (*guestfs_abort_cb) (void);\n"
32875 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
32876 " guestfs_abort_cb);\n"
32881 #: ../src/guestfs.pod:1459
32883 "The callback C<cb> will be called if there is an out of memory situation. "
32884 "I<Note this callback must not return>."
32888 #: ../src/guestfs.pod:1462
32889 msgid "The default is to call L<abort(3)>."
32893 #: ../src/guestfs.pod:1464
32894 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
32898 #: ../src/guestfs.pod:1467
32899 msgid "guestfs_get_out_of_memory_handler"
32903 #: ../src/guestfs.pod:1469
32906 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
32911 #: ../src/guestfs.pod:1471
32912 msgid "This returns the current out of memory handler."
32916 #: ../src/guestfs.pod:1473
32921 #: ../src/guestfs.pod:1477
32926 #: ../src/guestfs.pod:1479
32931 #: ../src/guestfs.pod:1481
32932 msgid "AVAILABILITY"
32936 #: ../src/guestfs.pod:1483
32937 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
32941 #: ../src/guestfs.pod:1485
32943 "Using L</guestfs_available> you can test availability of the following "
32944 "groups of functions. This test queries the appliance to see if the "
32945 "appliance you are currently using supports the functionality."
32949 #: ../src/guestfs.pod:1490
32950 msgid "@AVAILABILITY@"
32954 #: ../src/guestfs.pod:1492
32955 msgid "GUESTFISH supported COMMAND"
32959 #: ../src/guestfs.pod:1494
32961 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
32962 "prints out the available groups and whether they are supported by this build "
32963 "of libguestfs. Note however that you have to do C<run> first."
32967 #: ../src/guestfs.pod:1499
32968 msgid "SINGLE CALLS AT COMPILE TIME"
32972 #: ../src/guestfs.pod:1501
32974 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
32975 "function, such as:"
32979 #: ../src/guestfs.pod:1504
32982 " #define LIBGUESTFS_HAVE_DD 1\n"
32987 #: ../src/guestfs.pod:1506
32988 msgid "if L</guestfs_dd> is available."
32992 #: ../src/guestfs.pod:1508
32994 "Before version 1.5.8, if you needed to test whether a single libguestfs "
32995 "function is available at compile time, we recommended using build tools such "
32996 "as autoconf or cmake. For example in autotools you could use:"
33000 #: ../src/guestfs.pod:1513
33003 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
33004 " AC_CHECK_FUNCS([guestfs_dd])\n"
33009 #: ../src/guestfs.pod:1516
33011 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
33016 #: ../src/guestfs.pod:1519
33017 msgid "SINGLE CALLS AT RUN TIME"
33021 #: ../src/guestfs.pod:1521
33023 "Testing at compile time doesn't guarantee that a function really exists in "
33024 "the library. The reason is that you might be dynamically linked against a "
33025 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
33026 "This situation unfortunately results in a segmentation fault, which is a "
33027 "shortcoming of the C dynamic linking system itself."
33031 #: ../src/guestfs.pod:1528
33033 "You can use L<dlopen(3)> to test if a function is available at run time, as "
33034 "in this example program (note that you still need the compile time check as "
33039 #: ../src/guestfs.pod:1532
33042 " #include <stdio.h>\n"
33043 " #include <stdlib.h>\n"
33044 " #include <unistd.h>\n"
33045 " #include <dlfcn.h>\n"
33046 " #include <guestfs.h>\n"
33051 #: ../src/guestfs.pod:1538
33056 " #ifdef LIBGUESTFS_HAVE_DD\n"
33058 " int has_function;\n"
33063 #: ../src/guestfs.pod:1544
33066 " /* Test if the function guestfs_dd is really available. */\n"
33067 " dl = dlopen (NULL, RTLD_LAZY);\n"
33069 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
33070 " exit (EXIT_FAILURE);\n"
33072 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
33078 #: ../src/guestfs.pod:1553
33081 " if (!has_function)\n"
33082 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
33084 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
33085 " /* Now it's safe to call\n"
33086 " guestfs_dd (g, \"foo\", \"bar\");\n"
33090 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
33097 #: ../src/guestfs.pod:1566
33099 "You may think the above is an awful lot of hassle, and it is. There are "
33100 "other ways outside of the C linking system to ensure that this kind of "
33101 "incompatibility never arises, such as using package versioning:"
33105 #: ../src/guestfs.pod:1571
33108 " Requires: libguestfs >= 1.0.80\n"
33113 #: ../src/guestfs.pod:1573
33114 msgid "CALLS WITH OPTIONAL ARGUMENTS"
33118 #: ../src/guestfs.pod:1575
33120 "A recent feature of the API is the introduction of calls which take optional "
33121 "arguments. In C these are declared 3 ways. The main way is as a call which "
33122 "takes variable arguments (ie. C<...>), as in this example:"
33126 #: ../src/guestfs.pod:1580
33129 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
33134 #: ../src/guestfs.pod:1582
33136 "Call this with a list of optional arguments, terminated by C<-1>. So to "
33137 "call with no optional arguments specified:"
33141 #: ../src/guestfs.pod:1585
33144 " guestfs_add_drive_opts (g, filename, -1);\n"
33149 #: ../src/guestfs.pod:1587
33150 msgid "With a single optional argument:"
33154 #: ../src/guestfs.pod:1589
33157 " guestfs_add_drive_opts (g, filename,\n"
33158 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33164 #: ../src/guestfs.pod:1593
33169 #: ../src/guestfs.pod:1595
33172 " guestfs_add_drive_opts (g, filename,\n"
33173 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33174 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33180 #: ../src/guestfs.pod:1600
33182 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
33187 #: ../src/guestfs.pod:1603
33188 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
33192 #: ../src/guestfs.pod:1605
33194 "The second variant has the same name with the suffix C<_va>, which works the "
33195 "same way but takes a C<va_list>. See the C manual for details. For the "
33196 "example function, this is declared:"
33200 #: ../src/guestfs.pod:1609
33203 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
33204 " va_list args);\n"
33209 #: ../src/guestfs.pod:1612
33210 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
33214 #: ../src/guestfs.pod:1614
33216 "The third variant is useful where you need to construct these calls. You "
33217 "pass in a structure where you fill in the optional fields. The structure "
33218 "has a bitmask as the first element which you must set to indicate which "
33219 "fields you have filled in. For our example function the structure and call "
33224 #: ../src/guestfs.pod:1620
33227 " struct guestfs_add_drive_opts_argv {\n"
33228 " uint64_t bitmask;\n"
33230 " const char *format;\n"
33233 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
33234 " const struct guestfs_add_drive_opts_argv *optargs);\n"
33239 #: ../src/guestfs.pod:1629
33240 msgid "You could call it like this:"
33244 #: ../src/guestfs.pod:1631
33247 " struct guestfs_add_drive_opts_argv optargs = {\n"
33248 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
33249 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
33250 " .readonly = 1,\n"
33251 " .format = \"qcow2\"\n"
33257 #: ../src/guestfs.pod:1638
33260 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
33265 #: ../src/guestfs.pod:1646
33266 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
33270 #: ../src/guestfs.pod:1651
33271 msgid "You do not need to fill in all fields of the structure."
33275 #: ../src/guestfs.pod:1655
33277 "There must be a one-to-one correspondence between fields of the structure "
33278 "that are filled in, and bits set in the bitmask."
33282 #: ../src/guestfs.pod:1660
33283 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
33287 #: ../src/guestfs.pod:1662
33289 "In other languages, optional arguments are expressed in the way that is "
33290 "natural for that language. We refer you to the language-specific "
33291 "documentation for more details on that."
33295 #: ../src/guestfs.pod:1666
33296 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
33300 #: ../src/guestfs.pod:1668
33301 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
33305 #: ../src/guestfs.pod:1670
33307 "B<Note:> This section documents the generic event mechanism introduced in "
33308 "libguestfs 1.10, which you should use in new code if possible. The old "
33309 "functions C<guestfs_set_log_message_callback>, "
33310 "C<guestfs_set_subprocess_quit_callback>, "
33311 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
33312 "C<guestfs_set_progress_callback> are no longer documented in this manual "
33313 "page. Because of the ABI guarantee, the old functions continue to work."
33317 #: ../src/guestfs.pod:1679
33319 "Handles generate events when certain things happen, such as log messages "
33320 "being generated, progress messages during long-running operations, or the "
33321 "handle being closed. The API calls described below let you register a "
33322 "callback to be called when events happen. You can register multiple "
33323 "callbacks (for the same, different or overlapping sets of events), and "
33324 "individually remove callbacks. If callbacks are not removed, then they "
33325 "remain in force until the handle is closed."
33329 #: ../src/guestfs.pod:1687
33331 "In the current implementation, events are only generated synchronously: that "
33332 "means that events (and hence callbacks) can only happen while you are in the "
33333 "middle of making another libguestfs call. The callback is called in the "
33338 #: ../src/guestfs.pod:1692
33340 "Events may contain a payload, usually nothing (void), an array of 64 bit "
33341 "unsigned integers, or a message buffer. Payloads are discussed later on."
33345 #: ../src/guestfs.pod:1696
33346 msgid "CLASSES OF EVENTS"
33350 #: ../src/guestfs.pod:1700
33351 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
33355 #: ../src/guestfs.pod:1703
33357 "The callback function will be called while the handle is being closed "
33358 "(synchronously from L</guestfs_close>)."
33362 #: ../src/guestfs.pod:1706
33364 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
33365 "handles that are open when the program exits. This means that this callback "
33366 "might be called indirectly from L<exit(3)>, which can cause unexpected "
33367 "problems in higher-level languages (eg. if your HLL interpreter has already "
33368 "been cleaned up by the time this is called, and if your callback then jumps "
33369 "into some HLL function)."
33373 #: ../src/guestfs.pod:1713
33375 "If no callback is registered: the handle is closed without any callback "
33380 #: ../src/guestfs.pod:1716
33381 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
33385 #: ../src/guestfs.pod:1719
33387 "The callback function will be called when the child process quits, either "
33388 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
33389 "corresponds to a transition from any state to the CONFIG state)."
33393 #: ../src/guestfs.pod:1723 ../src/guestfs.pod:1732 ../src/guestfs.pod:1849
33394 msgid "If no callback is registered: the event is ignored."
33398 #: ../src/guestfs.pod:1725
33399 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
33403 #: ../src/guestfs.pod:1728
33405 "The callback function will be called when the child process becomes ready "
33406 "first time after it has been launched. (This corresponds to a transition "
33407 "from LAUNCHING to the READY state)."
33411 #: ../src/guestfs.pod:1734
33412 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
33416 #: ../src/guestfs.pod:1737
33418 "Some long-running operations can generate progress messages. If this "
33419 "callback is registered, then it will be called each time a progress message "
33420 "is generated (usually two seconds after the operation started, and three "
33421 "times per second thereafter until it completes, although the frequency may "
33422 "change in future versions)."
33426 #: ../src/guestfs.pod:1743
33428 "The callback receives in the payload four unsigned 64 bit numbers which are "
33429 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
33433 #: ../src/guestfs.pod:1746
33435 "The units of C<total> are not defined, although for some operations C<total> "
33436 "may relate in some way to the amount of data to be transferred (eg. in bytes "
33437 "or megabytes), and C<position> may be the portion which has been "
33442 #: ../src/guestfs.pod:1751
33443 msgid "The only defined and stable parts of the API are:"
33447 #: ../src/guestfs.pod:1757
33449 "The callback can display to the user some type of progress bar or indicator "
33450 "which shows the ratio of C<position>:C<total>."
33454 #: ../src/guestfs.pod:1762
33455 msgid "0 E<lt>= C<position> E<lt>= C<total>"
33459 #: ../src/guestfs.pod:1766
33461 "If any progress notification is sent during a call, then a final progress "
33462 "notification is always sent when C<position> = C<total> (I<unless> the call "
33463 "fails with an error)."
33467 #: ../src/guestfs.pod:1770
33469 "This is to simplify caller code, so callers can easily set the progress "
33470 "indicator to \"100%\" at the end of the operation, without requiring special "
33471 "code to detect this case."
33475 #: ../src/guestfs.pod:1776
33477 "For some calls we are unable to estimate the progress of the call, but we "
33478 "can still generate progress messages to indicate activity. This is known as "
33479 "\"pulse mode\", and is directly supported by certain progress bar "
33480 "implementations (eg. GtkProgressBar)."
33484 #: ../src/guestfs.pod:1781
33486 "For these calls, zero or more progress messages are generated with "
33487 "C<position = 0> and C<total = 1>, followed by a final message with "
33488 "C<position = total = 1>."
33492 #: ../src/guestfs.pod:1785
33494 "As noted above, if the call fails with an error then the final message may "
33495 "not be generated."
33499 #: ../src/guestfs.pod:1790
33501 "The callback also receives the procedure number (C<proc_nr>) and serial "
33502 "number (C<serial>) of the call. These are only useful for debugging "
33503 "protocol issues, and the callback can normally ignore them. The callback "
33504 "may want to print these numbers in error messages or debugging messages."
33508 #: ../src/guestfs.pod:1796
33509 msgid "If no callback is registered: progress messages are discarded."
33513 #: ../src/guestfs.pod:1798
33514 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
33518 #: ../src/guestfs.pod:1801
33520 "The callback function is called whenever a log message is generated by qemu, "
33521 "the appliance kernel, guestfsd (daemon), or utility programs."
33525 #: ../src/guestfs.pod:1804
33527 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
33528 "(L</guestfs_launch>) then additional debug messages are generated."
33532 #: ../src/guestfs.pod:1807 ../src/guestfs.pod:1821
33534 "If no callback is registered: the messages are discarded unless the verbose "
33535 "flag is set in which case they are sent to stderr. You can override the "
33536 "printing of verbose messages to stderr by setting up a callback."
33540 #: ../src/guestfs.pod:1812
33541 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
33545 #: ../src/guestfs.pod:1815
33547 "The callback function is called whenever a log message is generated by the "
33548 "library part of libguestfs."
33552 #: ../src/guestfs.pod:1818
33554 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
33555 "messages are generated."
33559 #: ../src/guestfs.pod:1826
33560 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
33564 #: ../src/guestfs.pod:1829
33566 "The callback function is called whenever a trace message is generated. This "
33567 "only applies if the trace flag (L</guestfs_set_trace>) is set."
33571 #: ../src/guestfs.pod:1832
33573 "If no callback is registered: the messages are sent to stderr. You can "
33574 "override the printing of trace messages to stderr by setting up a callback."
33578 #: ../src/guestfs.pod:1836
33579 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
33583 #: ../src/guestfs.pod:1839
33584 msgid "The callback function is called whenever a libguestfs function is entered."
33588 #: ../src/guestfs.pod:1842
33590 "The payload is a string which contains the name of the function that we are "
33591 "entering (not including C<guestfs_> prefix)."
33595 #: ../src/guestfs.pod:1845
33597 "Note that libguestfs functions can call themselves, so you may see many "
33598 "events from a single call. A few libguestfs functions do not generate this "
33603 #: ../src/guestfs.pod:1853
33604 msgid "guestfs_set_event_callback"
33608 #: ../src/guestfs.pod:1855
33611 " int guestfs_set_event_callback (guestfs_h *g,\n"
33612 " guestfs_event_callback cb,\n"
33613 " uint64_t event_bitmask,\n"
33615 " void *opaque);\n"
33620 #: ../src/guestfs.pod:1861
33622 "This function registers a callback (C<cb>) for all event classes in the "
33623 "C<event_bitmask>."
33627 #: ../src/guestfs.pod:1864
33629 "For example, to register for all log message events, you could call this "
33630 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
33631 "To register a single callback for all possible classes of events, use "
33632 "C<GUESTFS_EVENT_ALL>."
33636 #: ../src/guestfs.pod:1870
33637 msgid "C<flags> should always be passed as 0."
33641 #: ../src/guestfs.pod:1872
33643 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
33644 "it for any purpose."
33648 #: ../src/guestfs.pod:1875
33650 "The return value is the event handle (an integer) which you can use to "
33651 "delete the callback (see below)."
33655 #: ../src/guestfs.pod:1878
33657 "If there is an error, this function returns C<-1>, and sets the error in the "
33658 "handle in the usual way (see L</guestfs_last_error> etc.)"
33662 #: ../src/guestfs.pod:1881
33664 "Callbacks remain in effect until they are deleted, or until the handle is "
33669 #: ../src/guestfs.pod:1884
33671 "In the case where multiple callbacks are registered for a particular event "
33672 "class, all of the callbacks are called. The order in which multiple "
33673 "callbacks are called is not defined."
33677 #: ../src/guestfs.pod:1888
33678 msgid "guestfs_delete_event_callback"
33682 #: ../src/guestfs.pod:1890
33685 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
33690 #: ../src/guestfs.pod:1892
33692 "Delete a callback that was previously registered. C<event_handle> should be "
33693 "the integer that was returned by a previous call to "
33694 "C<guestfs_set_event_callback> on the same handle."
33698 #: ../src/guestfs.pod:1896
33699 msgid "guestfs_event_callback"
33703 #: ../src/guestfs.pod:1898
33706 " typedef void (*guestfs_event_callback) (\n"
33709 " uint64_t event,\n"
33710 " int event_handle,\n"
33712 " const char *buf, size_t buf_len,\n"
33713 " const uint64_t *array, size_t array_len);\n"
33718 #: ../src/guestfs.pod:1907
33719 msgid "This is the type of the event callback function that you have to provide."
33723 #: ../src/guestfs.pod:1910
33725 "The basic parameters are: the handle (C<g>), the opaque user pointer "
33726 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
33727 "handle, and C<flags> which in the current API you should ignore."
33731 #: ../src/guestfs.pod:1914
33733 "The remaining parameters contain the event payload (if any). Each event may "
33734 "contain a payload, which usually relates to the event class, but for future "
33735 "proofing your code should be written to handle any payload for any event "
33740 #: ../src/guestfs.pod:1919
33742 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
33743 "there is no message buffer). Note that this message buffer can contain "
33744 "arbitrary 8 bit data, including NUL bytes."
33748 #: ../src/guestfs.pod:1923
33750 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
33751 "moment this is only used for progress messages."
33755 #: ../src/guestfs.pod:1926
33756 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
33760 #: ../src/guestfs.pod:1928
33762 "One motivation for the generic event API was to allow GUI programs to "
33763 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
33764 "unconditionally to C<stderr>."
33768 #: ../src/guestfs.pod:1932
33770 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
33771 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
33772 "messages are not events; you must capture error messages separately)."
33776 #: ../src/guestfs.pod:1937
33778 "Programs have to set up a callback to capture the classes of events of "
33783 #: ../src/guestfs.pod:1940
33787 " guestfs_set_event_callback\n"
33788 " (g, message_callback,\n"
33789 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
33790 " GUESTFS_EVENT_TRACE,\n"
33791 " 0, NULL) == -1)\n"
33792 " if (eh == -1) {\n"
33793 " // handle error in the usual way\n"
33799 #: ../src/guestfs.pod:1950
33801 "The callback can then direct messages to the appropriate place. In this "
33802 "example, messages are directed to syslog:"
33806 #: ../src/guestfs.pod:1953
33810 " message_callback (\n"
33813 " uint64_t event,\n"
33814 " int event_handle,\n"
33816 " const char *buf, size_t buf_len,\n"
33817 " const uint64_t *array, size_t array_len)\n"
33819 " const int priority = LOG_USER|LOG_INFO;\n"
33820 " if (buf_len > 0)\n"
33821 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
33827 #: ../src/guestfs.pod:1968
33828 msgid "CANCELLING LONG TRANSFERS"
33832 #: ../src/guestfs.pod:1970
33834 "Some operations can be cancelled by the caller while they are in progress. "
33835 "Currently only operations that involve uploading or downloading data can be "
33836 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
33837 "parameters in the generator)."
33841 #: ../src/guestfs.pod:1975
33842 msgid "guestfs_user_cancel"
33846 #: ../src/guestfs.pod:1977
33849 " void guestfs_user_cancel (guestfs_h *g);\n"
33854 #: ../src/guestfs.pod:1979
33855 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
33859 #: ../src/guestfs.pod:1982
33861 "Unlike most other libguestfs calls, this function is signal safe and thread "
33862 "safe. You can call it from a signal handler or from another thread, without "
33863 "needing to do any locking."
33867 #: ../src/guestfs.pod:1986
33869 "The transfer that was in progress (if there is one) will stop shortly "
33870 "afterwards, and will return an error. The errno (see "
33871 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
33872 "out if the operation was cancelled or failed because of another error."
33876 #: ../src/guestfs.pod:1992
33878 "No cleanup is performed: for example, if a file was being uploaded then "
33879 "after cancellation there may be a partially uploaded file. It is the "
33880 "caller's responsibility to clean up if necessary."
33884 #: ../src/guestfs.pod:1996
33885 msgid "There are two common places that you might call C<guestfs_user_cancel>."
33889 #: ../src/guestfs.pod:1998
33891 "In an interactive text-based program, you might call it from a C<SIGINT> "
33892 "signal handler so that pressing C<^C> cancels the current operation. (You "
33893 "also need to call L</guestfs_set_pgroup> so that child processes don't "
33894 "receive the C<^C> signal)."
33898 #: ../src/guestfs.pod:2003
33900 "In a graphical program, when the main thread is displaying a progress bar "
33901 "with a cancel button, wire up the cancel button to call this function."
33905 #: ../src/guestfs.pod:2007
33906 msgid "PRIVATE DATA AREA"
33910 #: ../src/guestfs.pod:2009
33912 "You can attach named pieces of private data to the libguestfs handle, fetch "
33913 "them by name, and walk over them, for the lifetime of the handle. This is "
33914 "called the private data area and is only available from the C API."
33918 #: ../src/guestfs.pod:2014
33919 msgid "To attach a named piece of data, use the following call:"
33923 #: ../src/guestfs.pod:2016
33926 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
33931 #: ../src/guestfs.pod:2018
33933 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
33934 "pointer (which can be C<NULL>). Any previous item with the same key is "
33939 #: ../src/guestfs.pod:2022
33941 "You can use any C<key> you want, but your key should I<not> start with an "
33942 "underscore character. Keys beginning with an underscore character are "
33943 "reserved for internal libguestfs purposes (eg. for implementing language "
33944 "bindings). It is recommended that you prefix the key with some unique "
33945 "string to avoid collisions with other users."
33949 #: ../src/guestfs.pod:2028
33950 msgid "To retrieve the pointer, use:"
33954 #: ../src/guestfs.pod:2030
33957 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
33962 #: ../src/guestfs.pod:2032
33964 "This function returns C<NULL> if either no data is found associated with "
33965 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
33970 #: ../src/guestfs.pod:2036
33972 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
33973 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
33974 "all. In particular, libguestfs does I<not> try to free the data when the "
33975 "handle is closed. If the data must be freed, then the caller must either "
33976 "free it before calling L</guestfs_close> or must set up a close callback to "
33977 "do it (see L</GUESTFS_EVENT_CLOSE>)."
33981 #: ../src/guestfs.pod:2043
33982 msgid "To walk over all entries, use these two functions:"
33986 #: ../src/guestfs.pod:2045
33989 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
33994 #: ../src/guestfs.pod:2047
33997 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
34002 #: ../src/guestfs.pod:2049
34004 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
34005 "not have any particular meaning -- keys are not returned in any defined "
34006 "order). A pointer to the key is returned in C<*key_rtn> and the "
34007 "corresponding data pointer is returned from the function. C<NULL> is "
34008 "returned if there are no keys stored in the handle."
34012 #: ../src/guestfs.pod:2055
34014 "C<guestfs_next_private> returns the next key, pointer pair. The return "
34015 "value of this function is also C<NULL> is there are no further entries to "
34020 #: ../src/guestfs.pod:2059
34021 msgid "Notes about walking over entries:"
34025 #: ../src/guestfs.pod:2065
34026 msgid "You must not call C<guestfs_set_private> while walking over the entries."
34030 #: ../src/guestfs.pod:2070
34032 "The handle maintains an internal iterator which is reset when you call "
34033 "C<guestfs_first_private>. This internal iterator is invalidated when you "
34034 "call C<guestfs_set_private>."
34038 #: ../src/guestfs.pod:2076
34039 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
34043 #: ../src/guestfs.pod:2078
34046 " guestfs_set_private (g, key, NULL);\n"
34051 #: ../src/guestfs.pod:2080
34052 msgid "then that C<key> is not returned when walking."
34056 #: ../src/guestfs.pod:2084
34058 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
34059 "C<guestfs_next_private> or C<guestfs_set_private>."
34063 #: ../src/guestfs.pod:2090
34065 "The following example code shows how to print all keys and data pointers "
34066 "that are associated with the handle C<g>:"
34070 #: ../src/guestfs.pod:2093
34073 " const char *key;\n"
34074 " void *data = guestfs_first_private (g, &key);\n"
34075 " while (data != NULL)\n"
34077 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34078 " data = guestfs_next_private (g, &key);\n"
34084 #: ../src/guestfs.pod:2101
34086 "More commonly you are only interested in keys that begin with an "
34087 "application-specific prefix C<foo_>. Modify the loop like so:"
34091 #: ../src/guestfs.pod:2104
34094 " const char *key;\n"
34095 " void *data = guestfs_first_private (g, &key);\n"
34096 " while (data != NULL)\n"
34098 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34099 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34100 " data = guestfs_next_private (g, &key);\n"
34106 #: ../src/guestfs.pod:2113
34108 "If you need to modify keys while walking, then you have to jump back to the "
34109 "beginning of the loop. For example, to delete all keys prefixed with "
34114 #: ../src/guestfs.pod:2117
34117 " const char *key;\n"
34120 " data = guestfs_first_private (g, &key);\n"
34121 " while (data != NULL)\n"
34123 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34125 " guestfs_set_private (g, key, NULL);\n"
34126 " /* note that 'key' pointer is now invalid, and so is\n"
34127 " the internal iterator */\n"
34130 " data = guestfs_next_private (g, &key);\n"
34136 #: ../src/guestfs.pod:2133
34138 "Note that the above loop is guaranteed to terminate because the keys are "
34139 "being deleted, but other manipulations of keys within the loop might not "
34140 "terminate unless you also maintain an indication of which keys have been "
34145 #: ../src/guestfs.pod:2138 ../src/guestfs.pod:2143
34150 #: ../src/guestfs.pod:2140
34152 "<!-- old anchor for the next section --> <a "
34153 "name=\"state_machine_and_low_level_event_api\"/>"
34157 #: ../src/guestfs.pod:2145
34158 msgid "ARCHITECTURE"
34162 #: ../src/guestfs.pod:2147
34164 "Internally, libguestfs is implemented by running an appliance (a special "
34165 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
34166 "process of the main program."
34170 #: ../src/guestfs.pod:2151
34173 " ___________________\n"
34175 " | main program |\n"
34177 " | | child process / appliance\n"
34178 " | | __________________________\n"
34180 " +-------------------+ RPC | +-----------------+ |\n"
34181 " | libguestfs <--------------------> guestfsd | |\n"
34182 " | | | +-----------------+ |\n"
34183 " \\___________________/ | | Linux kernel | |\n"
34184 " | +--^--------------+ |\n"
34185 " \\_________|________________/\n"
34187 " _______v______\n"
34190 " | disk image |\n"
34191 " \\______________/\n"
34196 #: ../src/guestfs.pod:2171
34198 "The library, linked to the main program, creates the child process and hence "
34199 "the appliance in the L</guestfs_launch> function."
34203 #: ../src/guestfs.pod:2174
34205 "Inside the appliance is a Linux kernel and a complete stack of userspace "
34206 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
34207 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
34208 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
34209 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
34210 "attached to the qemu process which translates device access by the "
34211 "appliance's Linux kernel into accesses to the image."
34215 #: ../src/guestfs.pod:2183
34217 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
34218 "Although the disk image you are attached to might also be used by some "
34219 "virtual machine, libguestfs doesn't know or care about this. (But you will "
34220 "care if both libguestfs's qemu process and your virtual machine are trying "
34221 "to update the disk image at the same time, since these usually results in "
34222 "massive disk corruption)."
34226 #: ../src/guestfs.pod:2190
34227 msgid "STATE MACHINE"
34231 #: ../src/guestfs.pod:2192
34232 msgid "libguestfs uses a state machine to model the child process:"
34236 #: ../src/guestfs.pod:2194
34240 " guestfs_create\n"
34248 " / | \\ \\ guestfs_launch\n"
34249 " / | _\\__V______\n"
34251 " / | | LAUNCHING |\n"
34252 " / | \\___________/\n"
34254 " / | guestfs_launch\n"
34256 " ______ / __|____V\n"
34257 " / \\ ------> / \\\n"
34258 " | BUSY | | READY |\n"
34259 " \\______/ <------ \\________/\n"
34264 #: ../src/guestfs.pod:2216
34266 "The normal transitions are (1) CONFIG (when the handle is created, but there "
34267 "is no child process), (2) LAUNCHING (when the child process is booting up), "
34268 "(3) alternating between READY and BUSY as commands are issued to, and "
34269 "carried out by, the child process."
34273 #: ../src/guestfs.pod:2221
34275 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
34276 "asynchronously at any time (eg. due to some internal error), and that causes "
34277 "the state to transition back to CONFIG."
34281 #: ../src/guestfs.pod:2225
34283 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
34284 "issued when in the CONFIG state."
34288 #: ../src/guestfs.pod:2228
34290 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
34291 "L</guestfs_launch> blocks until the child process is READY to accept "
34292 "commands (or until some failure or timeout). L</guestfs_launch> internally "
34293 "moves the state from CONFIG to LAUNCHING while it is running."
34297 #: ../src/guestfs.pod:2234
34299 "API actions such as L</guestfs_mount> can only be issued when in the READY "
34300 "state. These API calls block waiting for the command to be carried out "
34301 "(ie. the state to transition to BUSY and then back to READY). There are no "
34302 "non-blocking versions, and no way to issue more than one command per handle "
34303 "at the same time."
34307 #: ../src/guestfs.pod:2240
34309 "Finally, the child process sends asynchronous messages back to the main "
34310 "program, such as kernel log messages. You can register a callback to "
34311 "receive these messages."
34315 #: ../src/guestfs.pod:2244
34320 #: ../src/guestfs.pod:2246
34321 msgid "COMMUNICATION PROTOCOL"
34325 #: ../src/guestfs.pod:2248
34327 "Don't rely on using this protocol directly. This section documents how it "
34328 "currently works, but it may change at any time."
34332 #: ../src/guestfs.pod:2251
34334 "The protocol used to talk between the library and the daemon running inside "
34335 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
34336 "1014, RFC 1832, RFC 4506)."
34340 #: ../src/guestfs.pod:2255
34342 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
34343 "this file is automatically generated)."
34347 #: ../src/guestfs.pod:2258
34349 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
34350 "and C<FileOut> parameters, which are handled with very simple request/reply "
34351 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
34352 "parameters, which use the same request and reply messages, but they may also "
34353 "be followed by files sent using a chunked encoding."
34357 #: ../src/guestfs.pod:2265
34358 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
34362 #: ../src/guestfs.pod:2267
34363 msgid "For ordinary functions, the request message is:"
34367 #: ../src/guestfs.pod:2269
34370 " total length (header + arguments,\n"
34371 " but not including the length word itself)\n"
34372 " struct guestfs_message_header (encoded as XDR)\n"
34373 " struct guestfs_<foo>_args (encoded as XDR)\n"
34378 #: ../src/guestfs.pod:2274
34380 "The total length field allows the daemon to allocate a fixed size buffer "
34381 "into which it slurps the rest of the message. As a result, the total length "
34382 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
34383 "effective size of any request is limited to somewhere under this size."
34387 #: ../src/guestfs.pod:2280
34389 "Note also that many functions don't take any arguments, in which case the "
34390 "C<guestfs_I<foo>_args> is completely omitted."
34394 #: ../src/guestfs.pod:2283
34396 "The header contains the procedure number (C<guestfs_proc>) which is how the "
34397 "receiver knows what type of args structure to expect, or none at all."
34401 #: ../src/guestfs.pod:2287
34403 "For functions that take optional arguments, the optional arguments are "
34404 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
34405 "arguments. A bitmask in the header indicates which optional arguments are "
34406 "meaningful. The bitmask is also checked to see if it contains bits set "
34407 "which the daemon does not know about (eg. if more optional arguments were "
34408 "added in a later version of the library), and this causes the call to be "
34413 #: ../src/guestfs.pod:2295
34414 msgid "The reply message for ordinary functions is:"
34418 #: ../src/guestfs.pod:2297
34421 " total length (header + ret,\n"
34422 " but not including the length word itself)\n"
34423 " struct guestfs_message_header (encoded as XDR)\n"
34424 " struct guestfs_<foo>_ret (encoded as XDR)\n"
34429 #: ../src/guestfs.pod:2302
34431 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
34432 "functions that return no formal return values."
34436 #: ../src/guestfs.pod:2305
34437 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
34441 #: ../src/guestfs.pod:2308
34443 "In the case of an error, a flag is set in the header, and the reply message "
34444 "is slightly changed:"
34448 #: ../src/guestfs.pod:2311
34451 " total length (header + error,\n"
34452 " but not including the length word itself)\n"
34453 " struct guestfs_message_header (encoded as XDR)\n"
34454 " struct guestfs_message_error (encoded as XDR)\n"
34459 #: ../src/guestfs.pod:2316
34461 "The C<guestfs_message_error> structure contains the error message as a "
34466 #: ../src/guestfs.pod:2319
34467 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
34471 #: ../src/guestfs.pod:2321
34473 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
34474 "The normal request message is sent (see above). However this is followed by "
34475 "a sequence of file chunks."
34479 #: ../src/guestfs.pod:2325
34482 " total length (header + arguments,\n"
34483 " but not including the length word itself,\n"
34484 " and not including the chunks)\n"
34485 " struct guestfs_message_header (encoded as XDR)\n"
34486 " struct guestfs_<foo>_args (encoded as XDR)\n"
34487 " sequence of chunks for FileIn param #0\n"
34488 " sequence of chunks for FileIn param #1 etc.\n"
34493 #: ../src/guestfs.pod:2333
34494 msgid "The \"sequence of chunks\" is:"
34498 #: ../src/guestfs.pod:2335
34501 " length of chunk (not including length word itself)\n"
34502 " struct guestfs_chunk (encoded as XDR)\n"
34503 " length of chunk\n"
34504 " struct guestfs_chunk (encoded as XDR)\n"
34506 " length of chunk\n"
34507 " struct guestfs_chunk (with data.data_len == 0)\n"
34512 #: ../src/guestfs.pod:2343
34514 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
34515 "is set in the final chunk to indicate either successful completion or early "
34520 #: ../src/guestfs.pod:2347
34522 "At time of writing there are no functions that have more than one FileIn "
34523 "parameter. However this is (theoretically) supported, by sending the "
34524 "sequence of chunks for each FileIn parameter one after another (from left to "
34529 #: ../src/guestfs.pod:2352
34531 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
34532 "transfer. The library does this by sending a chunk with a special flag set "
34533 "to indicate cancellation. When the daemon sees this, it cancels the whole "
34534 "RPC, does I<not> send any reply, and goes back to reading the next request."
34538 #: ../src/guestfs.pod:2358
34540 "The daemon may also cancel. It does this by writing a special word "
34541 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
34542 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
34543 "cancel chunk). The special word is chosen so that even if cancellation "
34544 "happens right at the end of the transfer (after the library has finished "
34545 "writing and has started listening for the reply), the \"spurious\" cancel "
34546 "flag will not be confused with the reply message."
34550 #: ../src/guestfs.pod:2367
34552 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
34553 "limit), and also files where the size is not known in advance (eg. from "
34554 "pipes or sockets). However the chunks are rather small "
34555 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
34556 "to keep much in memory."
34560 #: ../src/guestfs.pod:2373
34561 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
34565 #: ../src/guestfs.pod:2375
34567 "The protocol for FileOut parameters is exactly the same as for FileIn "
34568 "parameters, but with the roles of daemon and library reversed."
34572 #: ../src/guestfs.pod:2378
34575 " total length (header + ret,\n"
34576 " but not including the length word itself,\n"
34577 " and not including the chunks)\n"
34578 " struct guestfs_message_header (encoded as XDR)\n"
34579 " struct guestfs_<foo>_ret (encoded as XDR)\n"
34580 " sequence of chunks for FileOut param #0\n"
34581 " sequence of chunks for FileOut param #1 etc.\n"
34586 #: ../src/guestfs.pod:2386
34587 msgid "INITIAL MESSAGE"
34591 #: ../src/guestfs.pod:2388
34593 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
34594 "which indicates that the guest and daemon is alive. This is what "
34595 "L</guestfs_launch> waits for."
34599 #: ../src/guestfs.pod:2392
34600 msgid "PROGRESS NOTIFICATION MESSAGES"
34604 #: ../src/guestfs.pod:2394
34606 "The daemon may send progress notification messages at any time. These are "
34607 "distinguished by the normal length word being replaced by "
34608 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
34612 #: ../src/guestfs.pod:2398
34614 "The library turns them into progress callbacks (see "
34615 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
34620 #: ../src/guestfs.pod:2402
34622 "The daemon self-limits the frequency of progress messages it sends (see "
34623 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
34628 #: ../src/guestfs.pod:2406
34629 msgid "LIBGUESTFS VERSION NUMBERS"
34633 #: ../src/guestfs.pod:2408
34635 "Since April 2010, libguestfs has started to make separate development and "
34636 "stable releases, along with corresponding branches in our git repository. "
34637 "These separate releases can be identified by version number:"
34641 #: ../src/guestfs.pod:2413
34644 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
34645 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
34651 " | `-------- sub-version\n"
34653 " `------ always '1' because we don't change the ABI\n"
34658 #: ../src/guestfs.pod:2424
34659 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
34663 #: ../src/guestfs.pod:2426
34665 "As time passes we cherry pick fixes from the development branch and backport "
34666 "those into the stable branch, the effect being that the stable branch should "
34667 "get more stable and less buggy over time. So the stable releases are ideal "
34668 "for people who don't need new features but would just like the software to "
34673 #: ../src/guestfs.pod:2432
34674 msgid "Our criteria for backporting changes are:"
34678 #: ../src/guestfs.pod:2438
34680 "Documentation changes which don't affect any code are backported unless the "
34681 "documentation refers to a future feature which is not in stable."
34685 #: ../src/guestfs.pod:2444
34687 "Bug fixes which are not controversial, fix obvious problems, and have been "
34688 "well tested are backported."
34692 #: ../src/guestfs.pod:2449
34694 "Simple rearrangements of code which shouldn't affect how it works get "
34695 "backported. This is so that the code in the two branches doesn't get too "
34696 "far out of step, allowing us to backport future fixes more easily."
34700 #: ../src/guestfs.pod:2455
34702 "We I<don't> backport new features, new APIs, new tools etc, except in one "
34703 "exceptional case: the new feature is required in order to implement an "
34704 "important bug fix."
34708 #: ../src/guestfs.pod:2461
34710 "A new stable branch starts when we think the new features in development are "
34711 "substantial and compelling enough over the current stable branch to warrant "
34712 "it. When that happens we create new stable and development versions 1.N.0 "
34713 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
34714 "stable at this point, but by backporting fixes from development, that branch "
34715 "will stabilize over time."
34719 #: ../src/guestfs.pod:2469
34720 msgid "EXTENDING LIBGUESTFS"
34724 #: ../src/guestfs.pod:2471
34725 msgid "ADDING A NEW API ACTION"
34729 #: ../src/guestfs.pod:2473
34731 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
34732 "documentation) are generated, and this makes it easy to extend the "
34737 #: ../src/guestfs.pod:2477
34738 msgid "To add a new API action there are two changes:"
34742 #: ../src/guestfs.pod:2483
34744 "You need to add a description of the call (name, parameters, return type, "
34745 "tests, documentation) to C<generator/generator_actions.ml>."
34749 #: ../src/guestfs.pod:2486
34751 "There are two sorts of API action, depending on whether the call goes "
34752 "through to the daemon in the appliance, or is serviced entirely by the "
34753 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
34754 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
34755 "an example of the latter, since a trace flag is maintained in the handle and "
34756 "all tracing is done on the library side."
34760 #: ../src/guestfs.pod:2494
34762 "Most new actions are of the first type, and get added to the "
34763 "C<daemon_functions> list. Each function has a unique procedure number used "
34764 "in the RPC protocol which is assigned to that action when we publish "
34765 "libguestfs and cannot be reused. Take the latest procedure number and "
34770 #: ../src/guestfs.pod:2500
34772 "For library-only actions of the second type, add to the "
34773 "C<non_daemon_functions> list. Since these functions are serviced by the "
34774 "library and do not travel over the RPC mechanism to the daemon, these "
34775 "functions do not need a procedure number, and so the procedure number is set "
34780 #: ../src/guestfs.pod:2508
34781 msgid "Implement the action (in C):"
34785 #: ../src/guestfs.pod:2510
34787 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
34788 "C<daemon/> directory."
34792 #: ../src/guestfs.pod:2513
34794 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
34795 "(note: double underscore) in the C<src/> directory."
34799 #: ../src/guestfs.pod:2516
34800 msgid "In either case, use another function as an example of what to do."
34804 #: ../src/guestfs.pod:2520
34805 msgid "After making these changes, use C<make> to compile."
34809 #: ../src/guestfs.pod:2522
34811 "Note that you don't need to implement the RPC, language bindings, manual "
34812 "pages or anything else. It's all automatically generated from the OCaml "
34817 #: ../src/guestfs.pod:2526
34818 msgid "ADDING TESTS FOR AN API ACTION"
34822 #: ../src/guestfs.pod:2528
34824 "You can supply zero or as many tests as you want per API call. The tests "
34825 "can either be added as part of the API description "
34826 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
34827 "drop a script into C<regressions/>. Note that adding a script to "
34828 "C<regressions/> is slower, so if possible use the first method."
34832 #: ../src/guestfs.pod:2534
34834 "The following describes the test environment used when you add an API test "
34835 "in C<generator_actions.ml>."
34839 #: ../src/guestfs.pod:2537
34840 msgid "The test environment has 4 block devices:"
34844 #: ../src/guestfs.pod:2541
34845 msgid "C</dev/sda> 500MB"
34849 #: ../src/guestfs.pod:2543
34850 msgid "General block device for testing."
34854 #: ../src/guestfs.pod:2545
34855 msgid "C</dev/sdb> 50MB"
34859 #: ../src/guestfs.pod:2547
34861 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
34866 #: ../src/guestfs.pod:2550
34867 msgid "C</dev/sdc> 10MB"
34871 #: ../src/guestfs.pod:2552
34872 msgid "Used in a few tests where two block devices are needed."
34876 #: ../src/guestfs.pod:2554
34877 msgid "C</dev/sdd>"
34881 #: ../src/guestfs.pod:2556
34882 msgid "ISO with fixed content (see C<images/test.iso>)."
34886 #: ../src/guestfs.pod:2560
34888 "To be able to run the tests in a reasonable amount of time, the libguestfs "
34889 "appliance and block devices are reused between tests. So don't try testing "
34890 "L</guestfs_kill_subprocess> :-x"
34894 #: ../src/guestfs.pod:2564
34896 "Each test starts with an initial scenario, selected using one of the "
34897 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
34898 "initialize the disks mentioned above in a particular way as documented in "
34899 "C<generator_types.ml>. You should not assume anything about the previous "
34900 "contents of other disks that are not initialized."
34904 #: ../src/guestfs.pod:2570
34906 "You can add a prerequisite clause to any individual test. This is a "
34907 "run-time check, which, if it fails, causes the test to be skipped. Useful "
34908 "if testing a command which might not work on all variations of libguestfs "
34909 "builds. A test that has prerequisite of C<Always> means to run "
34914 #: ../src/guestfs.pod:2576
34916 "In addition, packagers can skip individual tests by setting environment "
34917 "variables before running C<make check>."
34921 #: ../src/guestfs.pod:2579
34924 " SKIP_TEST_<CMD>_<NUM>=1\n"
34929 #: ../src/guestfs.pod:2581
34930 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
34934 #: ../src/guestfs.pod:2583
34939 #: ../src/guestfs.pod:2585
34942 " SKIP_TEST_<CMD>=1\n"
34947 #: ../src/guestfs.pod:2587
34948 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
34952 #: ../src/guestfs.pod:2589
34953 msgid "Packagers can run only certain tests by setting for example:"
34957 #: ../src/guestfs.pod:2591
34960 " TEST_ONLY=\"vfs_type zerofree\"\n"
34965 #: ../src/guestfs.pod:2593
34967 "See C<capitests/tests.c> for more details of how these environment variables "
34972 #: ../src/guestfs.pod:2596
34973 msgid "DEBUGGING NEW API ACTIONS"
34977 #: ../src/guestfs.pod:2598
34978 msgid "Test new actions work before submitting them."
34982 #: ../src/guestfs.pod:2600
34983 msgid "You can use guestfish to try out new commands."
34987 #: ../src/guestfs.pod:2602
34989 "Debugging the daemon is a problem because it runs inside a minimal "
34990 "environment. However you can fprintf messages in the daemon to stderr, and "
34991 "they will show up if you use C<guestfish -v>."
34995 #: ../src/guestfs.pod:2606
34996 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
35000 #: ../src/guestfs.pod:2608
35002 "Our C source code generally adheres to some basic code-formatting "
35003 "conventions. The existing code base is not totally consistent on this "
35004 "front, but we do prefer that contributed code be formatted similarly. In "
35005 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
35006 "indentation level, and other than that, follow the K&R style."
35010 #: ../src/guestfs.pod:2614
35012 "If you use Emacs, add the following to one of one of your start-up files "
35013 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
35017 #: ../src/guestfs.pod:2617
35020 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
35021 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
35022 " (add-hook 'find-file-hook\n"
35023 " '(lambda () (if (and buffer-file-name\n"
35024 " (string-match \"/libguestfs\\\\>\"\n"
35025 " (buffer-file-name))\n"
35026 " (not (string-equal mode-name \"Change Log\"))\n"
35027 " (not (string-equal mode-name \"Makefile\")))\n"
35028 " (setq indent-tabs-mode nil))))\n"
35033 #: ../src/guestfs.pod:2627
35036 " ;;; When editing C sources in libguestfs, use this style.\n"
35037 " (defun libguestfs-c-mode ()\n"
35038 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
35040 " (c-set-style \"K&R\")\n"
35041 " (setq c-indent-level 2)\n"
35042 " (setq c-basic-offset 2))\n"
35043 " (add-hook 'c-mode-hook\n"
35044 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
35045 " (buffer-file-name))\n"
35046 " (libguestfs-c-mode))))\n"
35051 #: ../src/guestfs.pod:2639
35052 msgid "Enable warnings when compiling (and fix any problems this finds):"
35056 #: ../src/guestfs.pod:2642
35059 " ./configure --enable-gcc-warnings\n"
35064 #: ../src/guestfs.pod:2644
35065 msgid "Useful targets are:"
35069 #: ../src/guestfs.pod:2646
35072 " make syntax-check # checks the syntax of the C code\n"
35073 " make check # runs the test suite\n"
35078 #: ../src/guestfs.pod:2649
35079 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
35083 #: ../src/guestfs.pod:2651
35085 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
35086 "which are used to do shell quoting."
35090 #: ../src/guestfs.pod:2656
35095 #: ../src/guestfs.pod:2658
35097 "Simple shell quoted string. Any spaces or other shell characters are "
35102 #: ../src/guestfs.pod:2661
35107 #: ../src/guestfs.pod:2663
35109 "Same as C<%Q> except the string is treated as a path which is prefixed by "
35114 #: ../src/guestfs.pod:2670
35117 " asprintf (&cmd, \"cat %R\", path);\n"
35122 #: ../src/guestfs.pod:2672
35123 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
35127 #: ../src/guestfs.pod:2674
35129 "I<Note:> Do I<not> use these when you are passing parameters to the "
35130 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
35131 "because they are not passed via the shell (instead, straight to exec). You "
35132 "probably want to use the C<sysroot_path()> function however."
35136 #: ../src/guestfs.pod:2680
35137 msgid "SUBMITTING YOUR NEW API ACTIONS"
35141 #: ../src/guestfs.pod:2682
35143 "Submit patches to the mailing list: "
35144 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
35145 "L<rjones@redhat.com>."
35149 #: ../src/guestfs.pod:2686
35150 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
35154 #: ../src/guestfs.pod:2688
35155 msgid "We support i18n (gettext anyhow) in the library."
35159 #: ../src/guestfs.pod:2690
35161 "However many messages come from the daemon, and we don't translate those at "
35162 "the moment. One reason is that the appliance generally has all locale files "
35163 "removed from it, because they take up a lot of space. So we'd have to readd "
35164 "some of those, as well as copying our PO files into the appliance."
35168 #: ../src/guestfs.pod:2696
35170 "Debugging messages are never translated, since they are intended for the "
35175 #: ../src/guestfs.pod:2699
35176 msgid "SOURCE CODE SUBDIRECTORIES"
35180 #: ../src/guestfs.pod:2705
35181 msgid "The libguestfs appliance, build scripts and so on."
35185 #: ../src/guestfs.pod:2707
35186 msgid "C<capitests>"
35190 #: ../src/guestfs.pod:2709
35191 msgid "Automated tests of the C API."
35195 #: ../src/guestfs.pod:2711
35200 #: ../src/guestfs.pod:2713
35202 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
35207 #: ../src/guestfs.pod:2716
35212 #: ../src/guestfs.pod:2718
35214 "Safety and liveness tests of components that libguestfs depends upon (not of "
35215 "libguestfs itself). Mainly this is for qemu and the kernel."
35219 #: ../src/guestfs.pod:2721
35224 #: ../src/guestfs.pod:2723
35225 msgid "Outside contributions, experimental parts."
35229 #: ../src/guestfs.pod:2725
35234 #: ../src/guestfs.pod:2727
35236 "The daemon that runs inside the libguestfs appliance and carries out "
35241 #: ../src/guestfs.pod:2730
35246 #: ../src/guestfs.pod:2732
35247 msgid "L<virt-df(1)> command and documentation."
35251 #: ../src/guestfs.pod:2734
35256 #: ../src/guestfs.pod:2736
35257 msgid "L<virt-edit(1)> command and documentation."
35261 #: ../src/guestfs.pod:2738
35262 msgid "C<examples>"
35266 #: ../src/guestfs.pod:2740
35267 msgid "C API example code."
35271 #: ../src/guestfs.pod:2742
35276 #: ../src/guestfs.pod:2744
35278 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
35279 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
35280 "L<virt-tar-out(1)>."
35284 #: ../src/guestfs.pod:2748
35289 #: ../src/guestfs.pod:2750
35290 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
35294 #: ../src/guestfs.pod:2752
35295 msgid "C<generator>"
35299 #: ../src/guestfs.pod:2754
35301 "The crucially important generator, used to automatically generate large "
35302 "amounts of boilerplate C code for things like RPC and bindings."
35306 #: ../src/guestfs.pod:2757
35311 #: ../src/guestfs.pod:2759
35312 msgid "Files used by the test suite."
35316 #: ../src/guestfs.pod:2761
35317 msgid "Some \"phony\" guest images which we test against."
35321 #: ../src/guestfs.pod:2763
35322 msgid "C<inspector>"
35326 #: ../src/guestfs.pod:2765
35327 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
35331 #: ../src/guestfs.pod:2767
35336 #: ../src/guestfs.pod:2769
35337 msgid "Logo used on the website. The fish is called Arthur by the way."
35341 #: ../src/guestfs.pod:2771
35346 #: ../src/guestfs.pod:2773
35347 msgid "M4 macros used by autoconf."
35351 #: ../src/guestfs.pod:2775
35356 #: ../src/guestfs.pod:2777
35357 msgid "Translations of simple gettext strings."
35361 #: ../src/guestfs.pod:2779
35366 #: ../src/guestfs.pod:2781
35368 "The build infrastructure and PO files for translations of manpages and POD "
35369 "files. Eventually this will be combined with the C<po> directory, but that "
35370 "is rather complicated."
35374 #: ../src/guestfs.pod:2785
35375 msgid "C<regressions>"
35379 #: ../src/guestfs.pod:2787
35380 msgid "Regression tests."
35384 #: ../src/guestfs.pod:2789
35389 #: ../src/guestfs.pod:2791
35390 msgid "L<virt-rescue(1)> command and documentation."
35394 #: ../src/guestfs.pod:2793
35399 #: ../src/guestfs.pod:2795
35400 msgid "Source code to the C library."
35404 #: ../src/guestfs.pod:2797
35409 #: ../src/guestfs.pod:2799
35410 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
35414 #: ../src/guestfs.pod:2801
35415 msgid "C<test-tool>"
35419 #: ../src/guestfs.pod:2803
35421 "Test tool for end users to test if their qemu/kernel combination will work "
35426 #: ../src/guestfs.pod:2806
35431 #: ../src/guestfs.pod:2808
35436 #: ../src/guestfs.pod:2810
35441 #: ../src/guestfs.pod:2812
35446 #: ../src/guestfs.pod:2814
35451 #: ../src/guestfs.pod:2816
35456 #: ../src/guestfs.pod:2818
35461 #: ../src/guestfs.pod:2820
35466 #: ../src/guestfs.pod:2822
35467 msgid "Language bindings."
35471 #: ../src/guestfs.pod:2826
35472 msgid "MAKING A STABLE RELEASE"
35476 #: ../src/guestfs.pod:2828
35478 "When we make a stable release, there are several steps documented here. See "
35479 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
35484 #: ../src/guestfs.pod:2836
35485 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
35489 #: ../src/guestfs.pod:2841
35490 msgid "Finalize RELEASE-NOTES."
35494 #: ../src/guestfs.pod:2845
35495 msgid "Update ROADMAP."
35499 #: ../src/guestfs.pod:2849
35500 msgid "Run C<src/api-support/update-from-tarballs.sh>."
35504 #: ../src/guestfs.pod:2853
35505 msgid "Push and pull from Transifex."
35509 #: ../src/guestfs.pod:2855
35514 #: ../src/guestfs.pod:2857
35522 #: ../src/guestfs.pod:2859
35523 msgid "to push the latest POT files to Transifex. Then run:"
35527 #: ../src/guestfs.pod:2861
35535 #: ../src/guestfs.pod:2863
35536 msgid "which is a wrapper to pull the latest translated C<*.po> files."
35540 #: ../src/guestfs.pod:2867
35542 "Create new stable and development directories under "
35543 "L<http://libguestfs.org/download>."
35547 #: ../src/guestfs.pod:2872
35548 msgid "Create the branch in git:"
35552 #: ../src/guestfs.pod:2874
35555 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
35556 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
35557 " git branch stable-1.XX\n"
35558 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
35563 #: ../src/guestfs.pod:2881
35568 #: ../src/guestfs.pod:2883
35569 msgid "PROTOCOL LIMITS"
35573 #: ../src/guestfs.pod:2885
35575 "Internally libguestfs uses a message-based protocol to pass API calls and "
35576 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
35577 "plenty more detail about this). The maximum message size used by the "
35578 "protocol is slightly less than 4 MB. For some API calls you may need to be "
35579 "aware of this limit. The API calls which may be affected are individually "
35580 "documented, with a link back to this section of the documentation."
35584 #: ../src/guestfs.pod:2893
35586 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
35587 "a simple string. Because this string is at some point internally encoded as "
35588 "a message, the maximum size that it can return is slightly under 4 MB. If "
35589 "the requested file is larger than this then you will get an error."
35593 #: ../src/guestfs.pod:2899
35595 "In order to transfer large files into and out of the guest filesystem, you "
35596 "need to use particular calls that support this. The sections L</UPLOADING> "
35597 "and L</DOWNLOADING> document how to do this."
35601 #: ../src/guestfs.pod:2903
35603 "You might also consider mounting the disk image using our FUSE filesystem "
35604 "support (L<guestmount(1)>)."
35608 #: ../src/guestfs.pod:2906
35609 msgid "MAXIMUM NUMBER OF DISKS"
35613 #: ../src/guestfs.pod:2908
35614 msgid "When using virtio disks (the default) the current limit is B<25> disks."
35618 #: ../src/guestfs.pod:2911
35620 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
35621 "slots. However febootstrap only understands disks with names C</dev/vda> "
35622 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
35627 #: ../src/guestfs.pod:2916
35629 "We are working to substantially raise this limit in future versions but it "
35630 "requires complex changes to qemu."
35634 #: ../src/guestfs.pod:2919
35636 "In future versions of libguestfs it should also be possible to \"hot plug\" "
35637 "disks (add and remove disks after calling L</guestfs_launch>). This also "
35638 "requires changes to qemu."
35642 #: ../src/guestfs.pod:2923
35643 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
35647 #: ../src/guestfs.pod:2925
35648 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
35652 #: ../src/guestfs.pod:2927
35654 "This is because it reserves 4 bits for the minor device number (thus "
35655 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
35659 #: ../src/guestfs.pod:2930
35661 "If you attach a disk with more than 15 partitions, the extra partitions are "
35662 "ignored by libguestfs."
35666 #: ../src/guestfs.pod:2933
35667 msgid "MAXIMUM SIZE OF A DISK"
35671 #: ../src/guestfs.pod:2935
35672 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
35676 #: ../src/guestfs.pod:2937
35678 "We have tested block devices up to 1 exabyte (2**60 or "
35679 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
35684 #: ../src/guestfs.pod:2941
35686 "Although libguestfs probably does not impose any limit, the underlying host "
35687 "storage will. If you store disk images on a host ext4 filesystem, then the "
35688 "maximum size will be limited by the maximum ext4 file size (currently 16 "
35689 "TB). If you store disk images as host logical volumes then you are limited "
35690 "by the maximum size of an LV."
35694 #: ../src/guestfs.pod:2947
35696 "For the hugest disk image files, we recommend using XFS on the host for "
35701 #: ../src/guestfs.pod:2950
35702 msgid "MAXIMUM SIZE OF A PARTITION"
35706 #: ../src/guestfs.pod:2952
35708 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
35709 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
35710 "address a partition located beyond 2 TB on the disk."
35714 #: ../src/guestfs.pod:2956
35716 "It is recommended that you use GPT partitions on disks which are larger than "
35717 "this size. GPT uses 64 bit sector numbers and so can address partitions "
35718 "which are theoretically larger than the largest disk we could support."
35722 #: ../src/guestfs.pod:2961
35723 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
35727 #: ../src/guestfs.pod:2963
35729 "This depends on the filesystem type. libguestfs itself does not impose any "
35730 "known limit. Consult Wikipedia or the filesystem documentation to find out "
35731 "what these limits are."
35735 #: ../src/guestfs.pod:2967
35736 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
35740 #: ../src/guestfs.pod:2969
35742 "The API functions L</guestfs_upload>, L</guestfs_download>, "
35743 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
35744 "uploads and downloads."
35748 #: ../src/guestfs.pod:2973
35749 msgid "INSPECTION LIMITS"
35753 #: ../src/guestfs.pod:2975
35755 "The inspection code has several arbitrary limits on things like the size of "
35756 "Windows Registry hive it will read, and the length of product name. These "
35757 "are intended to stop a malicious guest from consuming arbitrary amounts of "
35758 "memory and disk space on the host, and should not be reached in practice. "
35759 "See the source code for more information."
35763 #: ../src/guestfs.pod:3001
35765 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
35766 "effect as calling C<guestfs_set_verbose (g, 1)>."
35770 #: ../src/guestfs.pod:3013
35772 "Set the path that libguestfs uses to search for a supermin appliance. See "
35773 "the discussion of paths in section L</PATH> above."
35777 #: ../src/guestfs.pod:3022
35778 msgid "See also L</QEMU WRAPPERS> above."
35782 #: ../src/guestfs.pod:3026
35784 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
35785 "effect as calling C<guestfs_set_trace (g, 1)>."
35789 #: ../src/guestfs.pod:3044
35791 "L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
35792 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
35793 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
35794 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
35795 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
35796 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
35797 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
35798 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
35799 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
35803 #: ../src/guestfs.pod:3074
35805 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
35806 "L<lvm(8)>, L<disktype(1)>."
35810 #: ../src/guestfs.pod:3081 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
35815 #: ../src/guestfs.pod:3083
35816 msgid "To get a list of bugs against libguestfs use this link:"
35820 #: ../src/guestfs.pod:3085
35821 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
35825 #: ../src/guestfs.pod:3087
35826 msgid "To report a new bug against libguestfs use this link:"
35830 #: ../src/guestfs.pod:3089
35831 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
35835 #: ../src/guestfs.pod:3091
35836 msgid "When reporting a bug, please check:"
35840 #: ../src/guestfs.pod:3097
35841 msgid "That the bug hasn't been reported already."
35845 #: ../src/guestfs.pod:3101
35846 msgid "That you are testing a recent version."
35850 #: ../src/guestfs.pod:3105
35851 msgid "Describe the bug accurately, and give a way to reproduce it."
35855 #: ../src/guestfs.pod:3109
35857 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
35862 #: ../test-tool/libguestfs-test-tool.pod:5
35863 msgid "libguestfs-test-tool - End user tests for libguestfs"
35867 #: ../test-tool/libguestfs-test-tool.pod:9
35870 " libguestfs-test-tool [--options]\n"
35875 #: ../test-tool/libguestfs-test-tool.pod:13
35877 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
35878 "and developers, to allow them to check basic libguestfs functionality is "
35879 "working. This is needed because libguestfs occasionally breaks for reasons "
35880 "beyond our control: usually because of changes in the underlying qemu or "
35881 "kernel packages, or the host environment."
35885 #: ../test-tool/libguestfs-test-tool.pod:20
35886 msgid "If you suspect a problem in libguestfs, then just run:"
35890 #: ../test-tool/libguestfs-test-tool.pod:22
35893 " libguestfs-test-tool\n"
35898 #: ../test-tool/libguestfs-test-tool.pod:24
35899 msgid "It will print lots of diagnostic messages."
35903 #: ../test-tool/libguestfs-test-tool.pod:26
35904 msgid "If it runs to completion successfully, you will see this near the end:"
35908 #: ../test-tool/libguestfs-test-tool.pod:28
35911 " ===== TEST FINISHED OK =====\n"
35916 #: ../test-tool/libguestfs-test-tool.pod:30
35917 msgid "and the test tool will exit with code 0."
35921 #: ../test-tool/libguestfs-test-tool.pod:32
35923 "If it fails (and/or exits with non-zero error code), please paste the "
35924 "B<complete, unedited> output of the test tool into a bug report. More "
35925 "information about reporting bugs can be found on the "
35926 "L<http://libguestfs.org/> website."
35930 #: ../test-tool/libguestfs-test-tool.pod:41
35935 #: ../test-tool/libguestfs-test-tool.pod:43
35936 msgid "Display short usage information and exit."
35940 #: ../test-tool/libguestfs-test-tool.pod:45
35941 msgid "I<--qemu qemu_binary>"
35945 #: ../test-tool/libguestfs-test-tool.pod:47
35947 "If you have downloaded another qemu binary, point this option at the full "
35948 "path of the binary to try it."
35952 #: ../test-tool/libguestfs-test-tool.pod:50
35953 msgid "I<--qemudir qemu_source_dir>"
35957 #: ../test-tool/libguestfs-test-tool.pod:52
35959 "If you have compiled qemu from source, point this option at the source "
35960 "directory to try it."
35964 #: ../test-tool/libguestfs-test-tool.pod:55
35965 msgid "I<--timeout N>"
35969 #: ../test-tool/libguestfs-test-tool.pod:57
35971 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
35972 "does not usually need to be adjusted unless your machine is very slow."
35976 #: ../test-tool/libguestfs-test-tool.pod:63
35977 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
35981 #: ../test-tool/libguestfs-test-tool.pod:65
35983 "If you have compiled another version of qemu from source and would like to "
35984 "try that, then you can use the I<--qemudir> option to point to the qemu "
35985 "source directory."
35989 #: ../test-tool/libguestfs-test-tool.pod:69
35991 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
35992 "option to point to the binary."
35996 #: ../test-tool/libguestfs-test-tool.pod:72
35998 "When using an alternate qemu with libguestfs, usually you would need to "
35999 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
36000 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
36001 "when you use either of the I<--qemudir> or I<--qemu> options."
36005 #: ../test-tool/libguestfs-test-tool.pod:79
36007 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
36008 "I<1> if there was an error."
36012 #: ../test-tool/libguestfs-test-tool.pod:84
36014 "For the full list of environment variables which may affect libguestfs, "
36015 "please see the L<guestfs(3)> manual page."
36019 #: ../test-tool/libguestfs-test-tool.pod:89
36020 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
36024 #: ../tools/virt-list-filesystems.pl:32
36025 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
36029 #: ../tools/virt-list-filesystems.pl:36
36032 " virt-list-filesystems [--options] domname\n"
36037 #: ../tools/virt-list-filesystems.pl:38
36040 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
36045 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
36047 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
36052 #: ../tools/virt-list-filesystems.pl:45
36054 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
36055 "are contained in a virtual machine or disk image."
36059 #: ../tools/virt-list-filesystems.pl:49
36061 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
36062 "functionality. For more complex cases you should look at the "
36063 "L<guestfish(1)> tool."
36067 #: ../tools/virt-list-filesystems.pl:112
36069 "With this option, C<virt-list-filesystems> displays the type of each "
36070 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
36074 #: ../tools/virt-list-filesystems.pl:119
36079 #: ../tools/virt-list-filesystems.pl:123
36081 "Normally we only show mountable filesystems. If this option is given then "
36082 "swap devices are shown too."
36086 #: ../tools/virt-list-filesystems.pl:197
36088 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
36089 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
36090 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36094 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
36095 msgid "Copyright (C) 2009 Red Hat Inc."
36099 #: ../tools/virt-list-partitions.pl:32
36100 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
36104 #: ../tools/virt-list-partitions.pl:36
36107 " virt-list-partitions [--options] domname\n"
36112 #: ../tools/virt-list-partitions.pl:38
36115 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
36120 #: ../tools/virt-list-partitions.pl:45
36122 "C<virt-list-partitions> is a command line tool to list the partitions that "
36123 "are contained in a virtual machine or disk image. It is mainly useful as a "
36124 "first step to using L<virt-resize(1)>."
36128 #: ../tools/virt-list-partitions.pl:50
36130 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
36131 "functionality. For more complex cases you should look at the "
36132 "L<guestfish(1)> tool."
36136 #: ../tools/virt-list-partitions.pl:113
36137 msgid "Show sizes in human-readable form (eg. \"1G\")."
36141 #: ../tools/virt-list-partitions.pl:123
36143 "With this option, C<virt-list-partitions> displays the type and size of each "
36144 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
36148 #: ../tools/virt-list-partitions.pl:130
36153 #: ../tools/virt-list-partitions.pl:132
36158 #: ../tools/virt-list-partitions.pl:134
36159 msgid "Display the total size of each block device (as a separate row or rows)."
36163 #: ../tools/virt-list-partitions.pl:267
36165 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
36166 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
36167 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36171 #: ../tools/virt-list-partitions.pl:283
36172 msgid "Copyright (C) 2009-2010 Red Hat Inc."
36176 #: ../tools/virt-make-fs.pl:37
36177 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
36181 #: ../tools/virt-make-fs.pl:41
36184 " virt-make-fs [--options] input.tar output.img\n"
36189 #: ../tools/virt-make-fs.pl:43
36192 " virt-make-fs [--options] input.tar.gz output.img\n"
36197 #: ../tools/virt-make-fs.pl:45
36200 " virt-make-fs [--options] directory output.img\n"
36205 #: ../tools/virt-make-fs.pl:49
36207 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
36208 "archive or some files in a directory. It is similar to tools like "
36209 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
36210 "it can create common filesystem types like ext2/3 or NTFS, which can be "
36211 "useful if you want to attach these filesystems to existing virtual machines "
36212 "(eg. to import large amounts of read-only data to a VM)."
36216 #: ../tools/virt-make-fs.pl:57
36217 msgid "Basic usage is:"
36221 #: ../tools/virt-make-fs.pl:59
36224 " virt-make-fs input output\n"
36229 #: ../tools/virt-make-fs.pl:61
36231 "where C<input> is either a directory containing files that you want to add, "
36232 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
36233 "C<output> is a disk image. The input type is detected automatically. The "
36234 "output disk image defaults to a raw ext2 image unless you specify extra "
36235 "flags (see L</OPTIONS> below)."
36239 #: ../tools/virt-make-fs.pl:67
36240 msgid "EXTRA SPACE"
36244 #: ../tools/virt-make-fs.pl:69
36246 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
36247 "the files that it contains, but might have extra space. Depending on how "
36248 "you are going to use the output, you might think this extra space is wasted "
36249 "and want to minimize it, or you might want to leave space so that more files "
36250 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
36251 "but you can use the I<--size> flag to leave space in the filesystem if you "
36256 #: ../tools/virt-make-fs.pl:77
36258 "An alternative way to leave extra space but not make the output image any "
36259 "bigger is to use an alternative disk image format (instead of the default "
36260 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
36261 "image format (check your hypervisor supports this before using it). This "
36262 "allows you to choose a large I<--size> but the extra space won't actually be "
36263 "allocated in the image until you try to store something in it."
36267 #: ../tools/virt-make-fs.pl:85
36269 "Don't forget that you can also use local commands including L<resize2fs(8)> "
36270 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
36271 "to build another image from scratch."
36275 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
36280 #: ../tools/virt-make-fs.pl:91
36283 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
36288 #: ../tools/virt-make-fs.pl:93
36289 msgid "FILESYSTEM TYPE"
36293 #: ../tools/virt-make-fs.pl:95
36295 "The default filesystem type is C<ext2>. Just about any filesystem type that "
36296 "libguestfs supports can be used (but I<not> read-only formats like "
36297 "ISO9660). Here are some of the more common choices:"
36301 #: ../tools/virt-make-fs.pl:101
36306 #: ../tools/virt-make-fs.pl:103
36308 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
36309 "you are not going to use the filesystem in a way that requires the journal, "
36310 "then this is just wasted overhead."
36314 #: ../tools/virt-make-fs.pl:107
36315 msgid "I<ntfs> or I<vfat>"
36319 #: ../tools/virt-make-fs.pl:109
36320 msgid "Useful if exporting data to a Windows guest."
36324 #: ../tools/virt-make-fs.pl:111
36326 "I<Note for vfat>: The tar archive or local directory must only contain files "
36327 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
36328 "program running within libguestfs is unable to change the ownership of "
36329 "non-root files, since vfat itself does not support this."
36333 #: ../tools/virt-make-fs.pl:116
36338 #: ../tools/virt-make-fs.pl:118
36340 "Lower overhead than C<ext2>, but certain limitations on filename length and "
36341 "total filesystem size."
36345 #: ../tools/virt-make-fs.pl:125
36348 " virt-make-fs --type=minix input minixfs.img\n"
36353 #: ../tools/virt-make-fs.pl:127
36354 msgid "TO PARTITION OR NOT TO PARTITION"
36358 #: ../tools/virt-make-fs.pl:129
36359 msgid "Optionally virt-make-fs can add a partition table to the output disk."
36363 #: ../tools/virt-make-fs.pl:131
36365 "Adding a partition can make the disk image more compatible with certain "
36366 "virtualized operating systems which don't expect to see a filesystem "
36367 "directly located on a block device (Linux doesn't care and will happily "
36368 "handle both types)."
36372 #: ../tools/virt-make-fs.pl:136
36374 "On the other hand, if you have a partition table then the output image is no "
36375 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
36376 "directly on a partitioned disk image. (However libguestfs tools such as "
36377 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
36381 #: ../tools/virt-make-fs.pl:144
36382 msgid "Add an MBR partition:"
36386 #: ../tools/virt-make-fs.pl:146
36389 " virt-make-fs --partition -- input disk.img\n"
36394 #: ../tools/virt-make-fs.pl:148
36396 "If the output disk image could be terabyte-sized or larger, it's better to "
36397 "use an EFI/GPT-compatible partition table:"
36401 #: ../tools/virt-make-fs.pl:151
36404 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
36409 #: ../tools/virt-make-fs.pl:179
36410 msgid "Enable debugging information."
36414 #: ../tools/virt-make-fs.pl:185
36415 msgid "B<--size=E<lt>NE<gt>>"
36419 #: ../tools/virt-make-fs.pl:187
36420 msgid "B<--size=+E<lt>NE<gt>>"
36424 #: ../tools/virt-make-fs.pl:189
36425 msgid "B<-s E<lt>NE<gt>>"
36429 #: ../tools/virt-make-fs.pl:191
36430 msgid "B<-s +E<lt>NE<gt>>"
36434 #: ../tools/virt-make-fs.pl:193
36435 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
36439 #: ../tools/virt-make-fs.pl:196
36441 "If this option is I<not> given, then the output image will be just large "
36442 "enough to contain all the files, with not much wasted space."
36446 #: ../tools/virt-make-fs.pl:199
36448 "To choose a fixed size output disk, specify an absolute number followed by "
36449 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
36450 "Petabytes or Exabytes. This must be large enough to contain all the input "
36451 "files, else you will get an error."
36455 #: ../tools/virt-make-fs.pl:204
36457 "To leave extra space, specify C<+> (plus sign) and a number followed by "
36458 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
36459 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
36460 "the input files, and (approximately) an extra 200 MB free space."
36464 #: ../tools/virt-make-fs.pl:210
36466 "Note that virt-make-fs estimates free space, and therefore will not produce "
36467 "filesystems containing precisely the free space requested. (It is much more "
36468 "expensive and time-consuming to produce a filesystem which has precisely the "
36469 "desired free space)."
36473 #: ../tools/virt-make-fs.pl:219
36474 msgid "B<--format=E<lt>fmtE<gt>>"
36478 #: ../tools/virt-make-fs.pl:221
36479 msgid "B<-F E<lt>fmtE<gt>>"
36483 #: ../tools/virt-make-fs.pl:223
36484 msgid "Choose the output disk image format."
36488 #: ../tools/virt-make-fs.pl:225
36489 msgid "The default is C<raw> (raw disk image)."
36493 #: ../tools/virt-make-fs.pl:227
36495 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
36496 "that would really make sense here is C<qcow2>."
36500 #: ../tools/virt-make-fs.pl:234
36501 msgid "B<--type=E<lt>fsE<gt>>"
36505 #: ../tools/virt-make-fs.pl:236
36506 msgid "B<-t E<lt>fsE<gt>>"
36510 #: ../tools/virt-make-fs.pl:238
36511 msgid "Choose the output filesystem type."
36515 #: ../tools/virt-make-fs.pl:240
36516 msgid "The default is C<ext2>."
36520 #: ../tools/virt-make-fs.pl:242
36521 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
36525 #: ../tools/virt-make-fs.pl:249
36526 msgid "B<--partition>"
36530 #: ../tools/virt-make-fs.pl:251
36531 msgid "B<--partition=E<lt>parttypeE<gt>>"
36535 #: ../tools/virt-make-fs.pl:253
36537 "If specified, this flag adds an MBR partition table to the output disk "
36542 #: ../tools/virt-make-fs.pl:256
36544 "You can change the partition table type, eg. I<--partition=gpt> for large "
36549 #: ../tools/virt-make-fs.pl:259
36551 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
36552 "might consider the next parameter to be the partition type. For example:"
36556 #: ../tools/virt-make-fs.pl:263
36559 " virt-make-fs --partition input.tar ...\n"
36564 #: ../tools/virt-make-fs.pl:265
36566 "would cause virt-make-fs to think you wanted to use a partition type of "
36567 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
36568 "dash) between options and the input file argument:"
36572 #: ../tools/virt-make-fs.pl:269
36575 " virt-make-fs --partition -- input.tar ...\n"
36580 #: ../tools/virt-make-fs.pl:541
36582 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
36583 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
36584 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
36588 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
36590 "When reporting bugs, please enable debugging and capture the I<complete> "
36595 #: ../tools/virt-make-fs.pl:558
36598 " export LIBGUESTFS_DEBUG=1\n"
36599 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
36604 #: ../tools/virt-make-fs.pl:561
36606 "Attach /tmp/virt-make-fs.log to a new bug report at "
36607 "L<https://bugzilla.redhat.com/>"
36611 #: ../tools/virt-tar.pl:33
36612 msgid "virt-tar - Extract or upload files to a virtual machine"
36616 #: ../tools/virt-tar.pl:37
36619 " virt-tar [--options] -x domname directory tarball\n"
36624 #: ../tools/virt-tar.pl:39
36627 " virt-tar [--options] -u domname tarball directory\n"
36632 #: ../tools/virt-tar.pl:41
36635 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
36640 #: ../tools/virt-tar.pl:43
36643 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
36648 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
36653 #: ../tools/virt-tar.pl:47
36655 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
36656 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
36660 #: ../tools/virt-tar.pl:52
36661 msgid "Download C</home> from the VM into a local tarball:"
36665 #: ../tools/virt-tar.pl:54
36668 " virt-tar -x domname /home home.tar\n"
36673 #: ../tools/virt-tar.pl:56
36676 " virt-tar -zx domname /home home.tar.gz\n"
36681 #: ../tools/virt-tar.pl:58
36682 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
36686 #: ../tools/virt-tar.pl:60
36689 " virt-tar -u domname uploadstuff.tar /tmp\n"
36694 #: ../tools/virt-tar.pl:62
36697 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
36702 #: ../tools/virt-tar.pl:66
36704 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
36705 "virtual machines. If you do this, you risk disk corruption in the VM. "
36706 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
36710 #: ../tools/virt-tar.pl:71
36712 "You can use I<-x> (extract) on live virtual machines, but you might get "
36713 "inconsistent results or errors if there is filesystem activity inside the "
36714 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
36715 "work, but the only way to guarantee consistent results is if the virtual "
36716 "machine is shut down."
36720 #: ../tools/virt-tar.pl:79
36722 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
36723 "parts of a guest filesystem. There are many possibilities: making backups, "
36724 "uploading data files, snooping on guest activity, fixing or customizing "
36729 #: ../tools/virt-tar.pl:84
36731 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
36732 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
36733 "should look at the L<guestfish(1)> tool."
36737 #: ../tools/virt-tar.pl:88
36739 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
36740 "its contents (recursively) from the virtual machine into a local tarball. "
36741 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
36742 "virtual machine. You cannot use these two options together."
36746 #: ../tools/virt-tar.pl:94
36748 "In addition, you may need to use the I<-z> (gZip) option to enable "
36749 "compression. When uploading, you have to specify I<-z> if the upload file "
36750 "is compressed because virt-tar won't detect this on its own."
36754 #: ../tools/virt-tar.pl:98
36756 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
36757 "example it cannot do PKZip files or bzip2 compression. If you want that "
36758 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
36759 "the L<libguestfs(3)> API)."
36763 #: ../tools/virt-tar.pl:160
36764 msgid "B<--extract>"
36768 #: ../tools/virt-tar.pl:162
36769 msgid "B<--download>"
36773 #: ../tools/virt-tar.pl:164
36778 #: ../tools/virt-tar.pl:166
36779 msgid "B<--upload>"
36783 #: ../tools/virt-tar.pl:168
36785 "Use I<-x> to extract (download) a directory from a virtual machine to a "
36790 #: ../tools/virt-tar.pl:171
36792 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
36793 "Please read the L</WARNING> section above before using this option."
36797 #: ../tools/virt-tar.pl:175
36798 msgid "You must specify exactly one of these options."
36802 #: ../tools/virt-tar.pl:181
36807 #: ../tools/virt-tar.pl:183
36812 #: ../tools/virt-tar.pl:185
36813 msgid "Specify that the input or output tarball is gzip-compressed."
36817 #: ../tools/virt-tar.pl:298
36819 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
36820 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
36821 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
36822 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36826 #: ../tools/virt-win-reg.pl:37
36828 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
36833 #: ../tools/virt-win-reg.pl:41
36836 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
36841 #: ../tools/virt-win-reg.pl:43
36844 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
36849 #: ../tools/virt-win-reg.pl:45
36852 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
36857 #: ../tools/virt-win-reg.pl:47
36860 " virt-win-reg --merge domname [input.reg ...]\n"
36865 #: ../tools/virt-win-reg.pl:49
36868 " virt-win-reg [--options] disk.img ... # instead of domname\n"
36873 #: ../tools/virt-win-reg.pl:53
36875 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
36876 "virtual machines. If you do this, you I<will> get irreversible disk "
36877 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
36878 "but doesn't catch all cases."
36882 #: ../tools/virt-win-reg.pl:58
36884 "Modifying the Windows Registry is an inherently risky operation. The format "
36885 "is deliberately obscure and undocumented, and Registry changes can leave the "
36886 "system unbootable. Therefore when using the I<--merge> option, make sure "
36887 "you have a reliable backup first."
36891 #: ../tools/virt-win-reg.pl:65
36893 "This program can export and merge Windows Registry entries from a Windows "
36898 #: ../tools/virt-win-reg.pl:68
36900 "The first parameter is the libvirt guest name or the raw disk image of a "
36905 #: ../tools/virt-win-reg.pl:71
36907 "If I<--merge> is I<not> specified, then the chosen registry key is "
36908 "displayed/exported (recursively). For example:"
36912 #: ../tools/virt-win-reg.pl:74
36915 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
36920 #: ../tools/virt-win-reg.pl:76
36921 msgid "You can also display single values from within registry keys, for example:"
36925 #: ../tools/virt-win-reg.pl:79
36928 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
36929 " $ virt-win-reg Windows7 $cvkey ProductName\n"
36930 " Windows 7 Enterprise\n"
36935 #: ../tools/virt-win-reg.pl:83
36937 "With I<--merge>, you can merge a textual regedit file into the Windows "
36942 #: ../tools/virt-win-reg.pl:86
36945 " $ virt-win-reg --merge Windows7 changes.reg\n"
36950 #: ../tools/virt-win-reg.pl:90
36952 "This program is only meant for simple access to the registry. If you want "
36953 "to do complicated things with the registry, we suggest you download the "
36954 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
36955 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
36956 "L<hivexregedit(1)>."
36960 #: ../tools/virt-win-reg.pl:159
36965 #: ../tools/virt-win-reg.pl:161
36967 "In merge mode, this merges a textual regedit file into the Windows Registry "
36968 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
36969 "displays or exports Registry entries instead."
36973 #: ../tools/virt-win-reg.pl:165
36975 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
36976 "result in disk corruption. However exporting (without this flag) is always "
36981 #: ../tools/virt-win-reg.pl:173
36982 msgid "B<--encoding> UTF-16LE|ASCII"
36986 #: ../tools/virt-win-reg.pl:175
36988 "When merging (only), you may need to specify the encoding for strings to be "
36989 "used in the hive file. This is explained in detail in "
36990 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
36994 #: ../tools/virt-win-reg.pl:179
36996 "The default is to use UTF-16LE, which should work with recent versions of "
37001 #: ../tools/virt-win-reg.pl:186
37002 msgid "B<--unsafe-printable-strings>"
37006 #: ../tools/virt-win-reg.pl:188
37008 "When exporting (only), assume strings are UTF-16LE and print them as strings "
37009 "instead of hex sequences. Remove the final zero codepoint from strings if "
37014 #: ../tools/virt-win-reg.pl:192
37016 "This is unsafe and does not preserve the fidelity of strings in the original "
37017 "Registry for various reasons:"
37021 #: ../tools/virt-win-reg.pl:199
37023 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
37024 "other encodings will be corrupted by this transformation."
37028 #: ../tools/virt-win-reg.pl:204
37030 "Assumes that everything which has type 1 or 2 is really a string and that "
37031 "everything else is not a string, but the type field in real Registries is "
37036 #: ../tools/virt-win-reg.pl:210
37038 "Loses information about whether a zero codepoint followed the string in the "
37043 #: ../tools/virt-win-reg.pl:215
37045 "This all happens because the Registry itself contains no information about "
37046 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
37050 #: ../tools/virt-win-reg.pl:219
37052 "You should only use this option for quick hacking and debugging of the "
37053 "Registry contents, and I<never> use it if the output is going to be passed "
37054 "into another program or stored in another Registry."
37058 #: ../tools/virt-win-reg.pl:556
37059 msgid "SUPPORTED SYSTEMS"
37063 #: ../tools/virt-win-reg.pl:558
37065 "The program currently supports Windows NT-derived guests starting with "
37066 "Windows XP through to at least Windows 7."
37070 #: ../tools/virt-win-reg.pl:561
37071 msgid "The following Registry keys are supported:"
37075 #: ../tools/virt-win-reg.pl:565
37076 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
37080 #: ../tools/virt-win-reg.pl:567
37081 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
37085 #: ../tools/virt-win-reg.pl:569
37086 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
37090 #: ../tools/virt-win-reg.pl:571
37091 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
37095 #: ../tools/virt-win-reg.pl:573
37096 msgid "C<HKEY_USERS\\.DEFAULT>"
37100 #: ../tools/virt-win-reg.pl:575
37101 msgid "C<HKEY_USERS\\I<SID>>"
37105 #: ../tools/virt-win-reg.pl:577
37106 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
37110 #: ../tools/virt-win-reg.pl:579
37111 msgid "C<HKEY_USERS\\I<username>>"
37115 #: ../tools/virt-win-reg.pl:581
37116 msgid "where I<username> is a local user name (this is a libguestfs extension)."
37120 #: ../tools/virt-win-reg.pl:585
37122 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
37127 #: ../tools/virt-win-reg.pl:588
37129 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
37130 "supported (there is no \"current user\")."
37134 #: ../tools/virt-win-reg.pl:591
37139 #: ../tools/virt-win-reg.pl:593
37141 "C<virt-win-reg> expects that regedit files have already been reencoded in "
37142 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
37143 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
37144 "with Windows-style line endings, you may need to reencode the whole file "
37145 "before or after processing."
37149 #: ../tools/virt-win-reg.pl:599
37151 "To reencode a file from Windows format to Linux (before processing it with "
37152 "the I<--merge> option), you would do something like this:"
37156 #: ../tools/virt-win-reg.pl:602
37159 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
37164 #: ../tools/virt-win-reg.pl:604
37166 "To go in the opposite direction, after exporting and before sending the file "
37167 "to a Windows user, do something like this:"
37171 #: ../tools/virt-win-reg.pl:607
37174 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
37179 #: ../tools/virt-win-reg.pl:609
37180 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
37184 #: ../tools/virt-win-reg.pl:611
37186 "If you are unsure about the current encoding, use the L<file(1)> command. "
37187 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
37188 "Windows-style (CRLF) line endings, like this:"
37192 #: ../tools/virt-win-reg.pl:615
37195 " $ file software.reg\n"
37196 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
37197 " with CRLF line terminators\n"
37202 #: ../tools/virt-win-reg.pl:619
37203 msgid "This file would need conversion before you could I<--merge> it."
37207 #: ../tools/virt-win-reg.pl:621
37208 msgid "CurrentControlSet etc."
37212 #: ../tools/virt-win-reg.pl:623
37214 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
37215 "Registry at the level of the hive file, and therefore you cannot modify "
37220 #: ../tools/virt-win-reg.pl:627
37222 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
37223 "circumstances it might refer to another control set. The way to find out is "
37224 "to look at the C<HKLM\\SYSTEM\\Select> key:"
37228 #: ../tools/virt-win-reg.pl:631
37231 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
37232 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
37233 " \"Current\"=dword:00000001\n"
37234 " \"Default\"=dword:00000001\n"
37235 " \"Failed\"=dword:00000000\n"
37236 " \"LastKnownGood\"=dword:00000002\n"
37241 #: ../tools/virt-win-reg.pl:638
37242 msgid "\"Current\" is the one which Windows will choose when it boots."
37246 #: ../tools/virt-win-reg.pl:640
37247 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
37251 #: ../tools/virt-win-reg.pl:643
37252 msgid "WINDOWS TIPS"
37256 #: ../tools/virt-win-reg.pl:645
37258 "Note that some of these tips modify the guest disk image. The guest I<must> "
37259 "be shut off, else you will get disk corruption."
37263 #: ../tools/virt-win-reg.pl:648
37264 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
37268 #: ../tools/virt-win-reg.pl:650
37270 "Prepare a DOS batch script, VBScript or executable. Upload this using "
37271 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
37272 "is uploaded into C<C:\\>:"
37276 #: ../tools/virt-win-reg.pl:654
37279 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
37284 #: ../tools/virt-win-reg.pl:656
37285 msgid "Prepare a regedit file containing the registry change:"
37289 #: ../tools/virt-win-reg.pl:658
37292 " cat > test.reg <<'EOF'\n"
37293 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
37294 " \"Test\"=\"c:\\\\test.bat\"\n"
37300 #: ../tools/virt-win-reg.pl:663
37302 "In this example we use the key C<RunOnce> which means that the script will "
37303 "run precisely once when the first user logs in. If you want it to run every "
37304 "time a user logs in, replace C<RunOnce> with C<Run>."
37308 #: ../tools/virt-win-reg.pl:667
37309 msgid "Now update the registry:"
37313 #: ../tools/virt-win-reg.pl:669
37316 " virt-win-reg --merge WindowsGuest test.reg\n"
37321 #: ../tools/virt-win-reg.pl:671
37322 msgid "INSTALLING A SERVICE"
37326 #: ../tools/virt-win-reg.pl:673
37328 "This section assumes you are familiar with Windows services, and you either "
37329 "have a program which handles the Windows Service Control Protocol directly "
37330 "or you want to run any program using a service wrapper like SrvAny or the "
37335 #: ../tools/virt-win-reg.pl:678
37337 "First upload the program and optionally the service wrapper. In this case "
37338 "the test program is called C<test.exe> and we are using the RHSrvAny "
37343 #: ../tools/virt-win-reg.pl:682
37346 " guestfish -i -d WindowsGuest <<EOF\n"
37347 " upload rhsrvany.exe /rhsrvany.exe\n"
37348 " upload test.exe /test.exe\n"
37354 #: ../tools/virt-win-reg.pl:687
37356 "Prepare a regedit file containing the registry changes. In this example, "
37357 "the first registry change is needed for the service itself or the service "
37358 "wrapper (if used). The second registry change is only needed because I am "
37359 "using the RHSrvAny service wrapper."
37363 #: ../tools/virt-win-reg.pl:692
37366 " cat > service.reg <<'EOF'\n"
37367 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
37368 " \"Type\"=dword:00000010\n"
37369 " \"Start\"=dword:00000002\n"
37370 " \"ErrorControl\"=dword:00000001\n"
37371 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
37372 " \"DisplayName\"=\"RHSrvAny\"\n"
37373 " \"ObjectName\"=\"NetworkService\"\n"
37378 #: ../tools/virt-win-reg.pl:701
37381 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
37382 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
37383 " \"PWD\"=\"c:\\\\Temp\"\n"
37389 #: ../tools/virt-win-reg.pl:712
37391 "For use of C<ControlSet001> see the section above in this manual page. You "
37392 "may need to adjust this according to the control set that is in use by the "
37397 #: ../tools/virt-win-reg.pl:718
37399 "C<\"ObjectName\"> controls the privileges that the service will have. An "
37400 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
37401 "privileged account."
37405 #: ../tools/virt-win-reg.pl:724
37407 "For the meaning of the magic numbers, see this Microsoft KB article: "
37408 "L<http://support.microsoft.com/kb/103000>."
37412 #: ../tools/virt-win-reg.pl:729
37413 msgid "Update the registry:"
37417 #: ../tools/virt-win-reg.pl:731
37420 " virt-win-reg --merge WindowsGuest service.reg\n"
37425 #: ../tools/virt-win-reg.pl:735
37427 "Be careful when passing parameters containing C<\\> (backslash) in the "
37428 "shell. Usually you will have to use 'single quotes' or double backslashes "
37429 "(but not both) to protect them from the shell."
37433 #: ../tools/virt-win-reg.pl:739
37434 msgid "Paths and value names are case-insensitive."
37438 #: ../tools/virt-win-reg.pl:748
37440 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
37441 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
37442 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
37443 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37447 #: ../tools/virt-win-reg.pl:766
37450 " export LIBGUESTFS_DEBUG=1\n"
37451 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
37456 #: ../tools/virt-win-reg.pl:769
37458 "Attach /tmp/virt-win-reg.log to a new bug report at "
37459 "L<https://bugzilla.redhat.com/>"