1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.12.2\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-07-27 15:59+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:1007 ../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:2652
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:478
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:480 ../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:482 ../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:543 ../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:545 ../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:1224 ../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:550 ../ruby/examples/guestfs-ruby.pod:36 ../src/guestfs.pod:3026 ../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:571 ../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:573 ../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:1253 ../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:575 ../ruby/examples/guestfs-ruby.pod:51 ../src/guestfs.pod:3102 ../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:577
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:1258 ../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:579 ../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:1263 ../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:584 ../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:1268 ../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:589 ../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:4183
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:385 ../fish/guestfish-actions.pod:393 ../fish/guestfish-actions.pod:400 ../fish/guestfish-actions.pod:407 ../fish/guestfish-actions.pod:1099 ../fish/guestfish-actions.pod:1103 ../fish/guestfish-actions.pod:1107 ../fish/guestfish-actions.pod:1111 ../fish/guestfish-actions.pod:1119 ../fish/guestfish-actions.pod:1123 ../fish/guestfish-actions.pod:1127 ../fish/guestfish-actions.pod:1137 ../fish/guestfish-actions.pod:1141 ../fish/guestfish-actions.pod:1145 ../fish/guestfish-actions.pod:1235 ../fish/guestfish-actions.pod:1239 ../fish/guestfish-actions.pod:1244 ../fish/guestfish-actions.pod:1249 ../fish/guestfish-actions.pod:1291 ../fish/guestfish-actions.pod:1295 ../fish/guestfish-actions.pod:1300 ../fish/guestfish-actions.pod:1933 ../fish/guestfish-actions.pod:1939 ../fish/guestfish-actions.pod:1947 ../fish/guestfish-actions.pod:1954 ../fish/guestfish-actions.pod:1961 ../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:15 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:583 ../src/guestfs-actions.pod:591 ../src/guestfs-actions.pod:598 ../src/guestfs-actions.pod:605 ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:1666 ../src/guestfs-actions.pod:1670 ../src/guestfs-actions.pod:1674 ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1686 ../src/guestfs-actions.pod:1690 ../src/guestfs-actions.pod:1700 ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:1708 ../src/guestfs-actions.pod:1846 ../src/guestfs-actions.pod:1850 ../src/guestfs-actions.pod:1855 ../src/guestfs-actions.pod:1860 ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1930 ../src/guestfs-actions.pod:2859 ../src/guestfs-actions.pod:2865 ../src/guestfs-actions.pod:2873 ../src/guestfs-actions.pod:2880 ../src/guestfs-actions.pod:2887 ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1064 ../src/guestfs.pod:1068 ../src/guestfs.pod:1072 ../src/guestfs.pod:1077 ../src/guestfs.pod:1085 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112 ../src/guestfs.pod:1134 ../src/guestfs.pod:1138 ../src/guestfs.pod:1142 ../src/guestfs.pod:1146 ../src/guestfs.pod:1150 ../src/guestfs.pod:1154 ../src/guestfs.pod:1643 ../src/guestfs.pod:1648 ../src/guestfs.pod:1652 ../src/guestfs.pod:1754 ../src/guestfs.pod:1759 ../src/guestfs.pod:1763 ../src/guestfs.pod:1773 ../src/guestfs.pod:2047 ../src/guestfs.pod:2052 ../src/guestfs.pod:2058 ../src/guestfs.pod:2066 ../src/guestfs.pod:2420 ../src/guestfs.pod:2426 ../src/guestfs.pod:2431 ../src/guestfs.pod:2437 ../src/guestfs.pod:2818 ../src/guestfs.pod:2823 ../src/guestfs.pod:2827 ../src/guestfs.pod:2831 ../src/guestfs.pod:2835 ../src/guestfs.pod:2849 ../src/guestfs.pod:2854 ../src/guestfs.pod:3079 ../src/guestfs.pod:3083 ../src/guestfs.pod:3087 ../src/guestfs.pod:3091 ../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:1075 ../rescue/virt-rescue.pod:257 ../src/guestfs.pod:2965 ../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:1249 ../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:3098 ../test-tool/libguestfs-test-tool.pod:93
2818 #: ../examples/guestfs-examples.pod:46 ../examples/guestfs-recipes.pod:398 ../fish/guestfish.pod:1251 ../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:3100 ../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:3107
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:3112
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:3117
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:1287 ../fish/guestfish-actions.pod:1929 ../src/guestfs-actions.pod:11 ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:2855 ../src/guestfs.pod:1639 ../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:7
3686 msgid "This function adds a virtual CD-ROM disk image to the guest."
3690 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:9
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 ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:254 ../src/guestfs-actions.pod:275
3714 "This function is deprecated. In new code, use the C<add_drive_opts> call "
3719 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166 ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:986 ../fish/guestfish-actions.pod:1346 ../fish/guestfish-actions.pod:1360 ../fish/guestfish-actions.pod:3085 ../fish/guestfish-actions.pod:3292 ../fish/guestfish-actions.pod:3406 ../fish/guestfish-actions.pod:3454 ../fish/guestfish-actions.pod:4355 ../fish/guestfish-actions.pod:4378 ../fish/guestfish-actions.pod:4400 ../fish/guestfish-actions.pod:4438 ../fish/guestfish-actions.pod:5087 ../fish/guestfish-actions.pod:5185 ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:257 ../src/guestfs-actions.pod:278 ../src/guestfs-actions.pod:1513 ../src/guestfs-actions.pod:2008 ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:4628 ../src/guestfs-actions.pod:4947 ../src/guestfs-actions.pod:5165 ../src/guestfs-actions.pod:5255 ../src/guestfs-actions.pod:6544 ../src/guestfs-actions.pod:6574 ../src/guestfs-actions.pod:6607 ../src/guestfs-actions.pod:6666 ../src/guestfs-actions.pod:7602 ../src/guestfs-actions.pod:7714 ../src/guestfs-actions.pod:7884
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:568 ../fish/guestfish-actions.pod:1968 ../fish/guestfish-actions.pod:3134 ../fish/guestfish-actions.pod:3307 ../fish/guestfish-actions.pod:3442
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:3096 ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4655
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 (can be expensive)."
4198 #: ../fish/guestfish-actions.pod:266 ../src/guestfs-actions.pod:404
4199 msgid "C<AUG_NO_STDINC> = 8"
4203 #: ../fish/guestfish-actions.pod:268 ../src/guestfs-actions.pod:406
4204 msgid "Do not use standard load path for modules."
4208 #: ../fish/guestfish-actions.pod:270 ../src/guestfs-actions.pod:408
4209 msgid "C<AUG_SAVE_NOOP> = 16"
4213 #: ../fish/guestfish-actions.pod:272 ../src/guestfs-actions.pod:410
4214 msgid "Make save a no-op, just record what would have been changed."
4218 #: ../fish/guestfish-actions.pod:274 ../src/guestfs-actions.pod:412
4219 msgid "C<AUG_NO_LOAD> = 32"
4223 #: ../fish/guestfish-actions.pod:276
4224 msgid "Do not load the tree in L</aug-init>."
4228 #: ../fish/guestfish-actions.pod:280
4229 msgid "To close the handle, you can call L</aug-close>."
4233 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:420
4234 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4238 #: ../fish/guestfish-actions.pod:284
4243 #: ../fish/guestfish-actions.pod:286
4246 " aug-insert augpath label true|false\n"
4251 #: ../fish/guestfish-actions.pod:288 ../src/guestfs-actions.pod:434
4253 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4254 "or after C<path> (depending on the boolean flag C<before>)."
4258 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:438
4260 "C<path> must match exactly one existing node in the tree, and C<label> must "
4261 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4265 #: ../fish/guestfish-actions.pod:296
4270 #: ../fish/guestfish-actions.pod:298
4278 #: ../fish/guestfish-actions.pod:300 ../src/guestfs-actions.pod:451
4279 msgid "Load files into the tree."
4283 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:453
4284 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4288 #: ../fish/guestfish-actions.pod:305
4293 #: ../fish/guestfish-actions.pod:307
4301 #: ../fish/guestfish-actions.pod:309
4303 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4304 "resulting nodes into alphabetical order."
4308 #: ../fish/guestfish-actions.pod:312
4313 #: ../fish/guestfish-actions.pod:314
4316 " aug-match augpath\n"
4321 #: ../fish/guestfish-actions.pod:316 ../src/guestfs-actions.pod:481
4323 "Returns a list of paths which match the path expression C<path>. The "
4324 "returned paths are sufficiently qualified so that they match exactly one "
4325 "node in the current tree."
4329 #: ../fish/guestfish-actions.pod:320
4334 #: ../fish/guestfish-actions.pod:322
4337 " aug-mv src dest\n"
4342 #: ../fish/guestfish-actions.pod:324 ../src/guestfs-actions.pod:498
4344 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4345 "C<dest> is overwritten if it exists."
4349 #: ../fish/guestfish-actions.pod:327
4354 #: ../fish/guestfish-actions.pod:329
4362 #: ../fish/guestfish-actions.pod:331 ../src/guestfs-actions.pod:511
4363 msgid "Remove C<path> and all of its children."
4367 #: ../fish/guestfish-actions.pod:333 ../src/guestfs-actions.pod:513
4368 msgid "On success this returns the number of entries which were removed."
4372 #: ../fish/guestfish-actions.pod:335
4377 #: ../fish/guestfish-actions.pod:337
4385 #: ../fish/guestfish-actions.pod:339 ../src/guestfs-actions.pod:524
4386 msgid "This writes all pending changes to disk."
4390 #: ../fish/guestfish-actions.pod:341
4392 "The flags which were passed to L</aug-init> affect exactly how files are "
4397 #: ../fish/guestfish-actions.pod:344
4402 #: ../fish/guestfish-actions.pod:346
4405 " aug-set augpath val\n"
4410 #: ../fish/guestfish-actions.pod:348 ../src/guestfs-actions.pod:540
4411 msgid "Set the value associated with C<path> to C<val>."
4415 #: ../fish/guestfish-actions.pod:350
4417 "In the Augeas API, it is possible to clear a node by setting the value to "
4418 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4419 "this call. Instead you must use the L</aug-clear> call."
4423 #: ../fish/guestfish-actions.pod:355
4428 #: ../fish/guestfish-actions.pod:357
4431 " available 'groups ...'\n"
4436 #: ../fish/guestfish-actions.pod:359 ../src/guestfs-actions.pod:557
4438 "This command is used to check the availability of some groups of "
4439 "functionality in the appliance, which not all builds of the libguestfs "
4440 "appliance will be able to provide."
4444 #: ../fish/guestfish-actions.pod:363
4446 "The libguestfs groups, and the functions that those groups correspond to, "
4447 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4448 "runtime by calling L</available-all-groups>."
4452 #: ../fish/guestfish-actions.pod:368 ../src/guestfs-actions.pod:566
4454 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4455 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4456 "and Augeas (configuration file editing) functions."
4460 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
4461 msgid "The command returns no error if I<all> requested groups are available."
4465 #: ../fish/guestfish-actions.pod:375 ../src/guestfs-actions.pod:573
4467 "It fails with an error if one or more of the requested groups is unavailable "
4472 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
4474 "If an unknown group name is included in the list of groups then an error is "
4479 #: ../fish/guestfish-actions.pod:381 ../src/guestfs-actions.pod:579
4484 #: ../fish/guestfish-actions.pod:387
4485 msgid "You must call L</launch> before calling this function."
4489 #: ../fish/guestfish-actions.pod:389 ../src/guestfs-actions.pod:587
4491 "The reason is because we don't know what groups are supported by the "
4492 "appliance/daemon until it is running and can be queried."
4496 #: ../fish/guestfish-actions.pod:395 ../src/guestfs-actions.pod:593
4498 "If a group of functions is available, this does not necessarily mean that "
4499 "they will work. You still have to check for errors when calling individual "
4500 "API functions even if they are available."
4504 #: ../fish/guestfish-actions.pod:402 ../src/guestfs-actions.pod:600
4506 "It is usually the job of distro packagers to build complete functionality "
4507 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4508 "with all requirements satisfied, will support everything."
4512 #: ../fish/guestfish-actions.pod:409
4514 "This call was added in version C<1.0.80>. In previous versions of "
4515 "libguestfs all you could do would be to speculatively execute a command to "
4516 "find out if the daemon implemented it. See also L</version>."
4520 #: ../fish/guestfish-actions.pod:416
4521 msgid "available-all-groups"
4525 #: ../fish/guestfish-actions.pod:418
4528 " available-all-groups\n"
4533 #: ../fish/guestfish-actions.pod:420
4535 "This command returns a list of all optional groups that this daemon knows "
4536 "about. Note this returns both supported and unsupported groups. To find "
4537 "out which ones the daemon can actually support you have to call "
4538 "L</available> on each member of the returned list."
4542 #: ../fish/guestfish-actions.pod:426
4543 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
4547 #: ../fish/guestfish-actions.pod:428
4552 #: ../fish/guestfish-actions.pod:430
4555 " base64-in (base64file|-) filename\n"
4560 #: ../fish/guestfish-actions.pod:432 ../src/guestfs-actions.pod:644
4561 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4565 #: ../fish/guestfish-actions.pod:435 ../fish/guestfish-actions.pod:444 ../fish/guestfish-actions.pod:693 ../fish/guestfish-actions.pod:862 ../fish/guestfish-actions.pod:881 ../fish/guestfish-actions.pod:1255 ../fish/guestfish-actions.pod:4658 ../fish/guestfish-actions.pod:4670 ../fish/guestfish-actions.pod:4681 ../fish/guestfish-actions.pod:4692 ../fish/guestfish-actions.pod:4744 ../fish/guestfish-actions.pod:4753 ../fish/guestfish-actions.pod:4807 ../fish/guestfish-actions.pod:4830
4566 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
4570 #: ../fish/guestfish-actions.pod:437
4575 #: ../fish/guestfish-actions.pod:439
4578 " base64-out filename (base64file|-)\n"
4583 #: ../fish/guestfish-actions.pod:441 ../src/guestfs-actions.pod:658
4585 "This command downloads the contents of C<filename>, writing it out to local "
4586 "file C<base64file> encoded as base64."
4590 #: ../fish/guestfish-actions.pod:446
4591 msgid "blockdev-flushbufs"
4595 #: ../fish/guestfish-actions.pod:448
4598 " blockdev-flushbufs device\n"
4603 #: ../fish/guestfish-actions.pod:450 ../src/guestfs-actions.pod:671
4604 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4608 #: ../fish/guestfish-actions.pod:453 ../fish/guestfish-actions.pod:464 ../fish/guestfish-actions.pod:473 ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:495 ../fish/guestfish-actions.pod:508 ../fish/guestfish-actions.pod:516 ../fish/guestfish-actions.pod:527 ../fish/guestfish-actions.pod:535 ../fish/guestfish-actions.pod:543 ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:691 ../src/guestfs-actions.pod:706 ../src/guestfs-actions.pod:722 ../src/guestfs-actions.pod:740 ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:773 ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805 ../src/guestfs-actions.pod:819
4609 msgid "This uses the L<blockdev(8)> command."
4613 #: ../fish/guestfish-actions.pod:455
4614 msgid "blockdev-getbsz"
4618 #: ../fish/guestfish-actions.pod:457
4621 " blockdev-getbsz device\n"
4626 #: ../fish/guestfish-actions.pod:459 ../src/guestfs-actions.pod:686
4627 msgid "This returns the block size of a device."
4631 #: ../fish/guestfish-actions.pod:461 ../fish/guestfish-actions.pod:524 ../src/guestfs-actions.pod:688 ../src/guestfs-actions.pod:788
4633 "(Note this is different from both I<size in blocks> and I<filesystem block "
4638 #: ../fish/guestfish-actions.pod:466
4639 msgid "blockdev-getro"
4643 #: ../fish/guestfish-actions.pod:468
4646 " blockdev-getro device\n"
4651 #: ../fish/guestfish-actions.pod:470 ../src/guestfs-actions.pod:703
4653 "Returns a boolean indicating if the block device is read-only (true if "
4654 "read-only, false if not)."
4658 #: ../fish/guestfish-actions.pod:475
4659 msgid "blockdev-getsize64"
4663 #: ../fish/guestfish-actions.pod:477
4666 " blockdev-getsize64 device\n"
4671 #: ../fish/guestfish-actions.pod:479 ../src/guestfs-actions.pod:718
4672 msgid "This returns the size of the device in bytes."
4676 #: ../fish/guestfish-actions.pod:481
4677 msgid "See also L</blockdev-getsz>."
4681 #: ../fish/guestfish-actions.pod:485
4682 msgid "blockdev-getss"
4686 #: ../fish/guestfish-actions.pod:487
4689 " blockdev-getss device\n"
4694 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:734
4696 "This returns the size of sectors on a block device. Usually 512, but can be "
4697 "larger for modern devices."
4701 #: ../fish/guestfish-actions.pod:492
4702 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
4706 #: ../fish/guestfish-actions.pod:497
4707 msgid "blockdev-getsz"
4711 #: ../fish/guestfish-actions.pod:499
4714 " blockdev-getsz device\n"
4719 #: ../fish/guestfish-actions.pod:501 ../src/guestfs-actions.pod:752
4721 "This returns the size of the device in units of 512-byte sectors (even if "
4722 "the sectorsize isn't 512 bytes ... weird)."
4726 #: ../fish/guestfish-actions.pod:504
4728 "See also L</blockdev-getss> for the real sector size of the device, and "
4729 "L</blockdev-getsize64> for the more useful I<size in bytes>."
4733 #: ../fish/guestfish-actions.pod:510
4734 msgid "blockdev-rereadpt"
4738 #: ../fish/guestfish-actions.pod:512
4741 " blockdev-rereadpt device\n"
4746 #: ../fish/guestfish-actions.pod:514 ../src/guestfs-actions.pod:771
4747 msgid "Reread the partition table on C<device>."
4751 #: ../fish/guestfish-actions.pod:518
4752 msgid "blockdev-setbsz"
4756 #: ../fish/guestfish-actions.pod:520
4759 " blockdev-setbsz device blocksize\n"
4764 #: ../fish/guestfish-actions.pod:522 ../src/guestfs-actions.pod:786
4765 msgid "This sets the block size of a device."
4769 #: ../fish/guestfish-actions.pod:529
4770 msgid "blockdev-setro"
4774 #: ../fish/guestfish-actions.pod:531
4777 " blockdev-setro device\n"
4782 #: ../fish/guestfish-actions.pod:533 ../src/guestfs-actions.pod:803
4783 msgid "Sets the block device named C<device> to read-only."
4787 #: ../fish/guestfish-actions.pod:537
4788 msgid "blockdev-setrw"
4792 #: ../fish/guestfish-actions.pod:539
4795 " blockdev-setrw device\n"
4800 #: ../fish/guestfish-actions.pod:541 ../src/guestfs-actions.pod:817
4801 msgid "Sets the block device named C<device> to read-write."
4805 #: ../fish/guestfish-actions.pod:545
4806 msgid "btrfs-filesystem-resize"
4810 #: ../fish/guestfish-actions.pod:547
4813 " btrfs-filesystem-resize mountpoint [size:..]\n"
4818 #: ../fish/guestfish-actions.pod:549 ../src/guestfs-actions.pod:839
4819 msgid "This command resizes a btrfs filesystem."
4823 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:841
4825 "Note that unlike other resize calls, the filesystem has to be mounted and "
4826 "the parameter is the mountpoint not the device (this is a requirement of "
4831 #: ../fish/guestfish-actions.pod:555 ../fish/guestfish-actions.pod:3417 ../src/guestfs-actions.pod:845 ../src/guestfs-actions.pod:5189
4832 msgid "The optional parameters are:"
4836 #: ../fish/guestfish-actions.pod:559 ../fish/guestfish-actions.pod:3421 ../src/guestfs-actions.pod:849 ../src/guestfs-actions.pod:5193
4841 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:851
4843 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
4844 "resized to the maximum size."
4848 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
4849 msgid "See also L<btrfs(8)>."
4853 #: ../fish/guestfish-actions.pod:570
4854 msgid "case-sensitive-path"
4858 #: ../fish/guestfish-actions.pod:572
4861 " case-sensitive-path path\n"
4866 #: ../fish/guestfish-actions.pod:574 ../src/guestfs-actions.pod:890
4868 "This can be used to resolve case insensitive paths on a filesystem which is "
4869 "case sensitive. The use case is to resolve paths which you have read from "
4870 "Windows configuration files or the Windows Registry, to the true path."
4874 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
4876 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4877 "(and probably others), which is that although the underlying filesystem is "
4878 "case-insensitive, the driver exports the filesystem to Linux as "
4883 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
4885 "One consequence of this is that special directories such as C<c:\\windows> "
4886 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4887 "precise details of how they were created. In Windows itself this would not "
4892 #: ../fish/guestfish-actions.pod:590 ../src/guestfs-actions.pod:906
4894 "Bug or feature? You decide: "
4895 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
4899 #: ../fish/guestfish-actions.pod:593 ../src/guestfs-actions.pod:909
4901 "This function resolves the true case of each element in the path and returns "
4902 "the case-sensitive path."
4906 #: ../fish/guestfish-actions.pod:596
4908 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
4909 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4910 "how the directories were originally created under Windows)."
4914 #: ../fish/guestfish-actions.pod:601 ../src/guestfs-actions.pod:917
4915 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4919 #: ../fish/guestfish-actions.pod:604
4920 msgid "See also L</realpath>."
4924 #: ../fish/guestfish-actions.pod:606
4929 #: ../fish/guestfish-actions.pod:608
4937 #: ../fish/guestfish-actions.pod:610 ../fish/guestfish-actions.pod:3837 ../src/guestfs-actions.pod:933 ../src/guestfs-actions.pod:5832
4938 msgid "Return the contents of the file named C<path>."
4942 #: ../fish/guestfish-actions.pod:612
4944 "Note that this function cannot correctly handle binary files (specifically, "
4945 "files containing C<\\0> character which is treated as end of string). For "
4946 "those you need to use the L</read-file> or L</download> functions which have "
4947 "a more complex interface."
4951 #: ../fish/guestfish-actions.pod:617 ../fish/guestfish-actions.pod:752 ../fish/guestfish-actions.pod:764 ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:950 ../fish/guestfish-actions.pod:1017 ../fish/guestfish-actions.pod:1027 ../fish/guestfish-actions.pod:1219 ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:1536 ../fish/guestfish-actions.pod:1564 ../fish/guestfish-actions.pod:1579 ../fish/guestfish-actions.pod:1589 ../fish/guestfish-actions.pod:1608 ../fish/guestfish-actions.pod:3707 ../fish/guestfish-actions.pod:3722 ../fish/guestfish-actions.pod:3798 ../fish/guestfish-actions.pod:3815 ../fish/guestfish-actions.pod:3830 ../fish/guestfish-actions.pod:4499 ../fish/guestfish-actions.pod:4545 ../fish/guestfish-actions.pod:4630 ../fish/guestfish-actions.pod:4645 ../fish/guestfish-actions.pod:5051 ../fish/guestfish-actions.pod:5063 ../fish/guestfish-actions.pod:5081 ../fish/guestfish-actions.pod:5098 ../fish/guestfish-actions.pod:5108 ../fish/guestfish-actions.pod:5157 ../fish/guestfish-actions.pod:5167 ../fish/guestfish-actions.pod:5196 ../fish/guestfish-actions.pod:5206 ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1122 ../src/guestfs-actions.pod:1142 ../src/guestfs-actions.pod:1438 ../src/guestfs-actions.pod:1457 ../src/guestfs-actions.pod:1560 ../src/guestfs-actions.pod:1579 ../src/guestfs-actions.pod:1825 ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:2315 ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:2382 ../src/guestfs-actions.pod:2399 ../src/guestfs-actions.pod:2428 ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:5640 ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5797 ../src/guestfs-actions.pod:5821 ../src/guestfs-actions.pod:6772 ../src/guestfs-actions.pod:6827 ../src/guestfs-actions.pod:6973 ../src/guestfs-actions.pod:6997 ../src/guestfs-actions.pod:7662 ../src/guestfs-actions.pod:7682 ../src/guestfs-actions.pod:7708 ../src/guestfs-actions.pod:7734 ../src/guestfs-actions.pod:7753 ../src/guestfs-actions.pod:7839 ../src/guestfs-actions.pod:7858 ../src/guestfs-actions.pod:7904 ../src/guestfs-actions.pod:7923
4953 "Because of the message protocol, there is a transfer limit of somewhere "
4954 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4958 #: ../fish/guestfish-actions.pod:620
4963 #: ../fish/guestfish-actions.pod:622
4966 " checksum csumtype path\n"
4971 #: ../fish/guestfish-actions.pod:624 ../src/guestfs-actions.pod:955
4972 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
4976 #: ../fish/guestfish-actions.pod:627 ../src/guestfs-actions.pod:958
4978 "The type of checksum to compute is given by the C<csumtype> parameter which "
4979 "must have one of the following values:"
4983 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
4988 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:965
4990 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
4995 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
5000 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
5001 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5005 #: ../fish/guestfish-actions.pod:641 ../src/guestfs-actions.pod:972
5010 #: ../fish/guestfish-actions.pod:643 ../src/guestfs-actions.pod:974
5011 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5015 #: ../fish/guestfish-actions.pod:645 ../src/guestfs-actions.pod:976
5020 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:978
5021 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5025 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:980
5030 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:982
5031 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5035 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:984
5040 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:986
5041 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5045 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:988
5050 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:990
5051 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5055 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:994
5056 msgid "The checksum is returned as a printable string."
5060 #: ../fish/guestfish-actions.pod:665
5061 msgid "To get the checksum for a device, use L</checksum-device>."
5065 #: ../fish/guestfish-actions.pod:667
5066 msgid "To get the checksums for many files, use L</checksums-out>."
5070 #: ../fish/guestfish-actions.pod:669
5071 msgid "checksum-device"
5075 #: ../fish/guestfish-actions.pod:671
5078 " checksum-device csumtype device\n"
5083 #: ../fish/guestfish-actions.pod:673
5085 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5086 "device named C<device>. For the types of checksums supported see the "
5087 "L</checksum> command."
5091 #: ../fish/guestfish-actions.pod:677
5092 msgid "checksums-out"
5096 #: ../fish/guestfish-actions.pod:679
5099 " checksums-out csumtype directory (sumsfile|-)\n"
5104 #: ../fish/guestfish-actions.pod:681 ../src/guestfs-actions.pod:1029
5106 "This command computes the checksums of all regular files in C<directory> and "
5107 "then emits a list of those checksums to the local output file C<sumsfile>."
5111 #: ../fish/guestfish-actions.pod:685 ../src/guestfs-actions.pod:1033
5113 "This can be used for verifying the integrity of a virtual machine. However "
5114 "to be properly secure you should pay attention to the output of the checksum "
5115 "command (it uses the ones from GNU coreutils). In particular when the "
5116 "filename is not printable, coreutils uses a special backslash syntax. For "
5117 "more information, see the GNU coreutils info file."
5121 #: ../fish/guestfish-actions.pod:695
5126 #: ../fish/guestfish-actions.pod:697
5129 " chmod mode path\n"
5134 #: ../fish/guestfish-actions.pod:699 ../src/guestfs-actions.pod:1052
5136 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5141 #: ../fish/guestfish-actions.pod:702 ../src/guestfs-actions.pod:1055
5143 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5144 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5149 #: ../fish/guestfish-actions.pod:706 ../fish/guestfish-actions.pod:3060 ../fish/guestfish-actions.pod:3199 ../fish/guestfish-actions.pod:3209 ../fish/guestfish-actions.pod:3219 ../src/guestfs-actions.pod:1059 ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:4814 ../src/guestfs-actions.pod:4833
5150 msgid "The mode actually set is affected by the umask."
5154 #: ../fish/guestfish-actions.pod:708
5159 #: ../fish/guestfish-actions.pod:710
5162 " chown owner group path\n"
5167 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1073
5168 msgid "Change the file owner to C<owner> and group to C<group>."
5172 #: ../fish/guestfish-actions.pod:714 ../fish/guestfish-actions.pod:2495 ../src/guestfs-actions.pod:1075 ../src/guestfs-actions.pod:3657
5174 "Only numeric uid and gid are supported. If you want to use names, you will "
5175 "need to locate and parse the password file yourself (Augeas support makes "
5176 "this relatively easy)."
5180 #: ../fish/guestfish-actions.pod:718
5185 #: ../fish/guestfish-actions.pod:720
5188 " command 'arguments ...'\n"
5193 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1089
5195 "This call runs a command from the guest filesystem. The filesystem must be "
5196 "mounted, and must contain a compatible operating system (ie. something "
5197 "Linux, with the same or compatible processor architecture)."
5201 #: ../fish/guestfish-actions.pod:727
5203 "The single parameter is an argv-style list of arguments. The first element "
5204 "is the name of the program to run. Subsequent elements are parameters. The "
5205 "list must be non-empty (ie. must contain a program name). Note that the "
5206 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5210 #: ../fish/guestfish-actions.pod:734 ../src/guestfs-actions.pod:1101
5211 msgid "The return value is anything printed to I<stdout> by the command."
5215 #: ../fish/guestfish-actions.pod:737 ../src/guestfs-actions.pod:1104
5217 "If the command returns a non-zero exit status, then this function returns an "
5218 "error message. The error message string is the content of I<stderr> from "
5223 #: ../fish/guestfish-actions.pod:741 ../src/guestfs-actions.pod:1108
5225 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5226 "C</bin>. If you require a program from another location, you should provide "
5227 "the full path in the first parameter."
5231 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5233 "Shared libraries and data files required by the program must be available on "
5234 "filesystems which are mounted in the correct places. It is the caller's "
5235 "responsibility to ensure all filesystems that are needed are mounted at the "
5240 #: ../fish/guestfish-actions.pod:755
5241 msgid "command-lines"
5245 #: ../fish/guestfish-actions.pod:757
5248 " command-lines 'arguments ...'\n"
5253 #: ../fish/guestfish-actions.pod:759
5254 msgid "This is the same as L</command>, but splits the result into a list of lines."
5258 #: ../fish/guestfish-actions.pod:762
5259 msgid "See also: L</sh-lines>"
5263 #: ../fish/guestfish-actions.pod:767
5268 #: ../fish/guestfish-actions.pod:769
5271 " config qemuparam qemuvalue\n"
5276 #: ../fish/guestfish-actions.pod:771 ../src/guestfs-actions.pod:1154
5278 "This can be used to add arbitrary qemu command line parameters of the form "
5279 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
5280 "setting some parameters which would interfere with parameters that we use."
5284 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1159
5285 msgid "The first character of C<param> string must be a C<-> (dash)."
5289 #: ../fish/guestfish-actions.pod:778 ../src/guestfs-actions.pod:1161
5290 msgid "C<value> can be NULL."
5294 #: ../fish/guestfish-actions.pod:780
5299 #: ../fish/guestfish-actions.pod:782
5302 " copy-size src dest size\n"
5307 #: ../fish/guestfish-actions.pod:784 ../src/guestfs-actions.pod:1175
5309 "This command copies exactly C<size> bytes from one source device or file "
5310 "C<src> to another destination device or file C<dest>."
5314 #: ../fish/guestfish-actions.pod:787 ../src/guestfs-actions.pod:1178
5316 "Note this will fail if the source is too short or if the destination is not "
5321 #: ../fish/guestfish-actions.pod:790
5326 #: ../fish/guestfish-actions.pod:792
5334 #: ../fish/guestfish-actions.pod:794 ../src/guestfs-actions.pod:1197
5336 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5337 "destination filename or destination directory."
5341 #: ../fish/guestfish-actions.pod:797
5346 #: ../fish/guestfish-actions.pod:799
5354 #: ../fish/guestfish-actions.pod:801 ../src/guestfs-actions.pod:1211
5356 "This copies a file or directory from C<src> to C<dest> recursively using the "
5361 #: ../fish/guestfish-actions.pod:804
5366 #: ../fish/guestfish-actions.pod:806
5374 #: ../fish/guestfish-actions.pod:808 ../src/guestfs-actions.pod:1225
5376 "This command copies from one source device or file C<src> to another "
5377 "destination device or file C<dest>. Normally you would use this to copy to "
5378 "or from a device or partition, for example to duplicate a filesystem."
5382 #: ../fish/guestfish-actions.pod:813
5384 "If the destination is a device, it must be as large or larger than the "
5385 "source file or device, otherwise the copy will fail. This command cannot do "
5386 "partial copies (see L</copy-size>)."
5390 #: ../fish/guestfish-actions.pod:817
5395 #: ../fish/guestfish-actions.pod:819
5403 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1243
5404 msgid "This command runs the C<df> command to report disk space used."
5408 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:834
5410 "This command is mostly useful for interactive sessions. It is I<not> "
5411 "intended that you try to parse the output string. Use L</statvfs> from "
5416 #: ../fish/guestfish-actions.pod:827
5421 #: ../fish/guestfish-actions.pod:829
5429 #: ../fish/guestfish-actions.pod:831 ../src/guestfs-actions.pod:1259
5431 "This command runs the C<df -h> command to report disk space used in "
5432 "human-readable format."
5436 #: ../fish/guestfish-actions.pod:838
5441 #: ../fish/guestfish-actions.pod:840
5449 #: ../fish/guestfish-actions.pod:842 ../src/guestfs-actions.pod:1276
5451 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5452 "This is sometimes useful for extended debugging of problems."
5456 #: ../fish/guestfish-actions.pod:846
5458 "Another way to get the same information is to enable verbose messages with "
5459 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
5460 "before running the program."
5464 #: ../fish/guestfish-actions.pod:851
5469 #: ../fish/guestfish-actions.pod:853
5472 " download remotefilename (filename|-)\n"
5477 #: ../fish/guestfish-actions.pod:855 ../fish/guestfish-actions.pod:868 ../src/guestfs-actions.pod:1297 ../src/guestfs-actions.pod:1322
5479 "Download file C<remotefilename> and save it as C<filename> on the local "
5484 #: ../fish/guestfish-actions.pod:858 ../fish/guestfish-actions.pod:4803 ../src/guestfs-actions.pod:1300 ../src/guestfs-actions.pod:7232
5485 msgid "C<filename> can also be a named pipe."
5489 #: ../fish/guestfish-actions.pod:860
5490 msgid "See also L</upload>, L</cat>."
5494 #: ../fish/guestfish-actions.pod:864
5495 msgid "download-offset"
5499 #: ../fish/guestfish-actions.pod:866
5502 " download-offset remotefilename (filename|-) offset size\n"
5507 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1325
5509 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5510 "region must be within the file or device)."
5514 #: ../fish/guestfish-actions.pod:874
5516 "Note that there is no limit on the amount of data that can be downloaded "
5517 "with this call, unlike with L</pread>, and this call always reads the full "
5518 "amount unless an error occurs."
5522 #: ../fish/guestfish-actions.pod:879
5523 msgid "See also L</download>, L</pread>."
5527 #: ../fish/guestfish-actions.pod:883
5532 #: ../fish/guestfish-actions.pod:885
5535 " drop-caches whattodrop\n"
5540 #: ../fish/guestfish-actions.pod:887 ../src/guestfs-actions.pod:1350
5542 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5543 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5544 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5548 #: ../fish/guestfish-actions.pod:892 ../src/guestfs-actions.pod:1355
5549 msgid "Setting C<whattodrop> to 3 should drop everything."
5553 #: ../fish/guestfish-actions.pod:894 ../src/guestfs-actions.pod:1357
5555 "This automatically calls L<sync(2)> before the operation, so that the "
5556 "maximum guest memory is freed."
5560 #: ../fish/guestfish-actions.pod:897
5565 #: ../fish/guestfish-actions.pod:899
5573 #: ../fish/guestfish-actions.pod:901 ../src/guestfs-actions.pod:1370
5575 "This command runs the C<du -s> command to estimate file space usage for "
5580 #: ../fish/guestfish-actions.pod:904 ../src/guestfs-actions.pod:1373
5582 "C<path> can be a file or a directory. If C<path> is a directory then the "
5583 "estimate includes the contents of the directory and all subdirectories "
5588 #: ../fish/guestfish-actions.pod:908 ../src/guestfs-actions.pod:1377
5589 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5593 #: ../fish/guestfish-actions.pod:911
5598 #: ../fish/guestfish-actions.pod:913
5601 " e2fsck-f device\n"
5606 #: ../fish/guestfish-actions.pod:915 ../src/guestfs-actions.pod:1395
5608 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5609 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
5614 #: ../fish/guestfish-actions.pod:919
5616 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
5617 "should use L</fsck>."
5621 #: ../fish/guestfish-actions.pod:922
5626 #: ../fish/guestfish-actions.pod:924
5629 " echo-daemon 'words ...'\n"
5634 #: ../fish/guestfish-actions.pod:926 ../src/guestfs-actions.pod:1412
5636 "This command concatenates the list of C<words> passed with single spaces "
5637 "between them and returns the resulting string."
5641 #: ../fish/guestfish-actions.pod:929 ../src/guestfs-actions.pod:1415
5642 msgid "You can use this command to test the connection through to the daemon."
5646 #: ../fish/guestfish-actions.pod:931
5647 msgid "See also L</ping-daemon>."
5651 #: ../fish/guestfish-actions.pod:933
5656 #: ../fish/guestfish-actions.pod:935
5659 " egrep regex path\n"
5664 #: ../fish/guestfish-actions.pod:937 ../src/guestfs-actions.pod:1431
5665 msgid "This calls the external C<egrep> program and returns the matching lines."
5669 #: ../fish/guestfish-actions.pod:943
5674 #: ../fish/guestfish-actions.pod:945
5677 " egrepi regex path\n"
5682 #: ../fish/guestfish-actions.pod:947 ../src/guestfs-actions.pod:1450
5683 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5687 #: ../fish/guestfish-actions.pod:953
5692 #: ../fish/guestfish-actions.pod:955
5695 " equal file1 file2\n"
5700 #: ../fish/guestfish-actions.pod:957 ../src/guestfs-actions.pod:1469
5702 "This compares the two files C<file1> and C<file2> and returns true if their "
5703 "content is exactly equal, or false otherwise."
5707 #: ../fish/guestfish-actions.pod:960 ../src/guestfs-actions.pod:1472
5708 msgid "The external L<cmp(1)> program is used for the comparison."
5712 #: ../fish/guestfish-actions.pod:962
5717 #: ../fish/guestfish-actions.pod:964
5725 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1484
5727 "This returns C<true> if and only if there is a file, directory (or anything) "
5728 "with the given C<path> name."
5732 #: ../fish/guestfish-actions.pod:969
5733 msgid "See also L</is-file>, L</is-dir>, L</stat>."
5737 #: ../fish/guestfish-actions.pod:971
5742 #: ../fish/guestfish-actions.pod:973
5745 " fallocate path len\n"
5750 #: ../fish/guestfish-actions.pod:975 ../fish/guestfish-actions.pod:994 ../src/guestfs-actions.pod:1500 ../src/guestfs-actions.pod:1526
5752 "This command preallocates a file (containing zero bytes) named C<path> of "
5753 "size C<len> bytes. If the file exists already, it is overwritten."
5757 #: ../fish/guestfish-actions.pod:979 ../src/guestfs-actions.pod:1504
5759 "Do not confuse this with the guestfish-specific C<alloc> command which "
5760 "allocates a file in the host and attaches it as a device."
5764 #: ../fish/guestfish-actions.pod:983 ../src/guestfs-actions.pod:1510
5766 "This function is deprecated. In new code, use the C<fallocate64> call "
5771 #: ../fish/guestfish-actions.pod:990
5776 #: ../fish/guestfish-actions.pod:992
5779 " fallocate64 path len\n"
5784 #: ../fish/guestfish-actions.pod:998
5786 "Note that this call allocates disk blocks for the file. To create a sparse "
5787 "file use L</truncate-size> instead."
5791 #: ../fish/guestfish-actions.pod:1001
5793 "The deprecated call L</fallocate> does the same, but owing to an oversight "
5794 "it only allowed 30 bit lengths to be specified, effectively limiting the "
5795 "maximum size of files created through that call to 1GB."
5799 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1538
5801 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5802 "commands which create a file in the host and attach it as a device."
5806 #: ../fish/guestfish-actions.pod:1010
5811 #: ../fish/guestfish-actions.pod:1012
5814 " fgrep pattern path\n"
5819 #: ../fish/guestfish-actions.pod:1014 ../src/guestfs-actions.pod:1553
5820 msgid "This calls the external C<fgrep> program and returns the matching lines."
5824 #: ../fish/guestfish-actions.pod:1020
5829 #: ../fish/guestfish-actions.pod:1022
5832 " fgrepi pattern path\n"
5837 #: ../fish/guestfish-actions.pod:1024 ../src/guestfs-actions.pod:1572
5838 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
5842 #: ../fish/guestfish-actions.pod:1030
5847 #: ../fish/guestfish-actions.pod:1032
5855 #: ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1590
5857 "This call uses the standard L<file(1)> command to determine the type or "
5858 "contents of the file."
5862 #: ../fish/guestfish-actions.pod:1037 ../src/guestfs-actions.pod:1593
5864 "This call will also transparently look inside various types of compressed "
5869 #: ../fish/guestfish-actions.pod:1040 ../src/guestfs-actions.pod:1596
5871 "The exact command which runs is C<file -zb path>. Note in particular that "
5872 "the filename is not prepended to the output (the I<-b> option)."
5876 #: ../fish/guestfish-actions.pod:1044 ../src/guestfs-actions.pod:1600
5878 "The output depends on the output of the underlying L<file(1)> command and it "
5879 "can change in future in ways beyond our control. In other words, the output "
5880 "is not guaranteed by the ABI."
5884 #: ../fish/guestfish-actions.pod:1048
5886 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
5887 "(etc), L</is-zero>."
5891 #: ../fish/guestfish-actions.pod:1051
5892 msgid "file-architecture"
5896 #: ../fish/guestfish-actions.pod:1053
5899 " file-architecture filename\n"
5904 #: ../fish/guestfish-actions.pod:1055 ../src/guestfs-actions.pod:1618
5906 "This detects the architecture of the binary C<filename>, and returns it if "
5911 #: ../fish/guestfish-actions.pod:1058 ../src/guestfs-actions.pod:1621
5912 msgid "Currently defined architectures are:"
5916 #: ../fish/guestfish-actions.pod:1062 ../src/guestfs-actions.pod:1625
5921 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1627
5923 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
5924 "irrespective of the precise processor requirements of the binary."
5928 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1630
5933 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1632
5934 msgid "64 bit x86-64."
5938 #: ../fish/guestfish-actions.pod:1071 ../src/guestfs-actions.pod:1634
5943 #: ../fish/guestfish-actions.pod:1073 ../src/guestfs-actions.pod:1636
5944 msgid "32 bit SPARC."
5948 #: ../fish/guestfish-actions.pod:1075 ../src/guestfs-actions.pod:1638
5953 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1640
5954 msgid "64 bit SPARC V9 and above."
5958 #: ../fish/guestfish-actions.pod:1079 ../src/guestfs-actions.pod:1642
5963 #: ../fish/guestfish-actions.pod:1081 ../src/guestfs-actions.pod:1644
5964 msgid "Intel Itanium."
5968 #: ../fish/guestfish-actions.pod:1083 ../src/guestfs-actions.pod:1646
5973 #: ../fish/guestfish-actions.pod:1085 ../src/guestfs-actions.pod:1648
5974 msgid "32 bit Power PC."
5978 #: ../fish/guestfish-actions.pod:1087 ../src/guestfs-actions.pod:1650
5983 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1652
5984 msgid "64 bit Power PC."
5988 #: ../fish/guestfish-actions.pod:1093 ../src/guestfs-actions.pod:1656
5989 msgid "Libguestfs may return other architecture strings in future."
5993 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1658
5994 msgid "The function works on at least the following types of files:"
5998 #: ../fish/guestfish-actions.pod:1101 ../src/guestfs-actions.pod:1664
5999 msgid "many types of Un*x and Linux binary"
6003 #: ../fish/guestfish-actions.pod:1105 ../src/guestfs-actions.pod:1668
6004 msgid "many types of Un*x and Linux shared library"
6008 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1672
6009 msgid "Windows Win32 and Win64 binaries"
6013 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1676
6014 msgid "Windows Win32 and Win64 DLLs"
6018 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1678
6019 msgid "Win32 binaries and DLLs return C<i386>."
6023 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1680
6024 msgid "Win64 binaries and DLLs return C<x86_64>."
6028 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1684
6029 msgid "Linux kernel modules"
6033 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1688
6034 msgid "Linux new-style initrd images"
6038 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1692
6039 msgid "some non-x86 Linux vmlinuz kernels"
6043 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1696
6044 msgid "What it can't do currently:"
6048 #: ../fish/guestfish-actions.pod:1139 ../src/guestfs-actions.pod:1702
6049 msgid "static libraries (libfoo.a)"
6053 #: ../fish/guestfish-actions.pod:1143 ../src/guestfs-actions.pod:1706
6054 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6058 #: ../fish/guestfish-actions.pod:1147 ../src/guestfs-actions.pod:1710
6059 msgid "x86 Linux vmlinuz kernels"
6063 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1712
6065 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6066 "compressed code, and are horribly hard to unpack. If you want to find the "
6067 "architecture of a kernel, use the architecture of the associated initrd or "
6068 "kernel module(s) instead."
6072 #: ../fish/guestfish-actions.pod:1156
6077 #: ../fish/guestfish-actions.pod:1158
6085 #: ../fish/guestfish-actions.pod:1160 ../src/guestfs-actions.pod:1730
6086 msgid "This command returns the size of C<file> in bytes."
6090 #: ../fish/guestfish-actions.pod:1162
6092 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
6093 "L</is-file> etc. To get the size of block devices, use "
6094 "L</blockdev-getsize64>."
6098 #: ../fish/guestfish-actions.pod:1166
6103 #: ../fish/guestfish-actions.pod:1168
6106 " fill c len path\n"
6111 #: ../fish/guestfish-actions.pod:1170 ../src/guestfs-actions.pod:1748
6113 "This command creates a new file called C<path>. The initial content of the "
6114 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6119 #: ../fish/guestfish-actions.pod:1174
6121 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6122 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6127 #: ../fish/guestfish-actions.pod:1179
6128 msgid "fill-pattern"
6132 #: ../fish/guestfish-actions.pod:1181
6135 " fill-pattern pattern len path\n"
6140 #: ../fish/guestfish-actions.pod:1183
6142 "This function is like L</fill> except that it creates a new file of length "
6143 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6144 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6149 #: ../fish/guestfish-actions.pod:1188
6154 #: ../fish/guestfish-actions.pod:1190
6162 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:1794
6164 "This command lists out all files and directories, recursively, starting at "
6165 "C<directory>. It is essentially equivalent to running the shell command "
6166 "C<find directory -print> but some post-processing happens on the output, "
6171 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:1799
6173 "This returns a list of strings I<without any prefix>. Thus if the directory "
6178 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1802
6188 #: ../fish/guestfish-actions.pod:1204
6189 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6193 #: ../fish/guestfish-actions.pod:1207 ../src/guestfs-actions.pod:1809
6204 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:1814
6205 msgid "If C<directory> is not a directory, then this command returns an error."
6209 #: ../fish/guestfish-actions.pod:1215 ../src/guestfs-actions.pod:1817
6210 msgid "The returned list is sorted."
6214 #: ../fish/guestfish-actions.pod:1217
6215 msgid "See also L</find0>."
6219 #: ../fish/guestfish-actions.pod:1222
6224 #: ../fish/guestfish-actions.pod:1224
6227 " find0 directory (files|-)\n"
6232 #: ../fish/guestfish-actions.pod:1226 ../src/guestfs-actions.pod:1837
6234 "This command lists out all files and directories, recursively, starting at "
6235 "C<directory>, placing the resulting list in the external file called "
6240 #: ../fish/guestfish-actions.pod:1230
6241 msgid "This command works the same way as L</find> with the following exceptions:"
6245 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1848
6246 msgid "The resulting list is written to an external file."
6250 #: ../fish/guestfish-actions.pod:1241 ../src/guestfs-actions.pod:1852
6252 "Items (filenames) in the result are separated by C<\\0> characters. See "
6253 "L<find(1)> option I<-print0>."
6257 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:1857
6258 msgid "This command is not limited in the number of names that it can return."
6262 #: ../fish/guestfish-actions.pod:1251 ../src/guestfs-actions.pod:1862
6263 msgid "The result list is not sorted."
6267 #: ../fish/guestfish-actions.pod:1257
6268 msgid "findfs-label"
6272 #: ../fish/guestfish-actions.pod:1259
6275 " findfs-label label\n"
6280 #: ../fish/guestfish-actions.pod:1261 ../src/guestfs-actions.pod:1876
6282 "This command searches the filesystems and returns the one which has the "
6283 "given label. An error is returned if no such filesystem can be found."
6287 #: ../fish/guestfish-actions.pod:1265
6288 msgid "To find the label of a filesystem, use L</vfs-label>."
6292 #: ../fish/guestfish-actions.pod:1267
6297 #: ../fish/guestfish-actions.pod:1269
6300 " findfs-uuid uuid\n"
6305 #: ../fish/guestfish-actions.pod:1271 ../src/guestfs-actions.pod:1893
6307 "This command searches the filesystems and returns the one which has the "
6308 "given UUID. An error is returned if no such filesystem can be found."
6312 #: ../fish/guestfish-actions.pod:1275
6313 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
6317 #: ../fish/guestfish-actions.pod:1277
6322 #: ../fish/guestfish-actions.pod:1279
6325 " fsck fstype device\n"
6330 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1911
6332 "This runs the filesystem checker (fsck) on C<device> which should have "
6333 "filesystem type C<fstype>."
6337 #: ../fish/guestfish-actions.pod:1284 ../src/guestfs-actions.pod:1914
6339 "The returned integer is the status. See L<fsck(8)> for the list of status "
6340 "codes from C<fsck>."
6344 #: ../fish/guestfish-actions.pod:1293 ../src/guestfs-actions.pod:1923
6345 msgid "Multiple status codes can be summed together."
6349 #: ../fish/guestfish-actions.pod:1297 ../src/guestfs-actions.pod:1927
6351 "A non-zero return code can mean \"success\", for example if errors have been "
6352 "corrected on the filesystem."
6356 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:1932
6357 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6361 #: ../fish/guestfish-actions.pod:1307 ../src/guestfs-actions.pod:1937
6362 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6366 #: ../fish/guestfish-actions.pod:1309
6371 #: ../fish/guestfish-actions.pod:1311
6379 #: ../fish/guestfish-actions.pod:1313 ../src/guestfs-actions.pod:1948
6381 "Return the additional kernel options which are added to the guest kernel "
6386 #: ../fish/guestfish-actions.pod:1316 ../src/guestfs-actions.pod:1951
6387 msgid "If C<NULL> then no options are added."
6391 #: ../fish/guestfish-actions.pod:1318
6392 msgid "get-attach-method"
6396 #: ../fish/guestfish-actions.pod:1320
6399 " get-attach-method\n"
6404 #: ../fish/guestfish-actions.pod:1322
6405 msgid "Return the current attach method. See L</set-attach-method>."
6409 #: ../fish/guestfish-actions.pod:1324
6410 msgid "get-autosync"
6414 #: ../fish/guestfish-actions.pod:1326
6422 #: ../fish/guestfish-actions.pod:1328 ../src/guestfs-actions.pod:1976
6423 msgid "Get the autosync flag."
6427 #: ../fish/guestfish-actions.pod:1330
6432 #: ../fish/guestfish-actions.pod:1332
6440 #: ../fish/guestfish-actions.pod:1334 ../src/guestfs-actions.pod:1987
6441 msgid "Return the direct appliance mode flag."
6445 #: ../fish/guestfish-actions.pod:1336
6450 #: ../fish/guestfish-actions.pod:1338
6453 " get-e2label device\n"
6458 #: ../fish/guestfish-actions.pod:1340 ../src/guestfs-actions.pod:1999
6459 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6463 #: ../fish/guestfish-actions.pod:1343 ../src/guestfs-actions.pod:2005
6465 "This function is deprecated. In new code, use the C<vfs_label> call "
6470 #: ../fish/guestfish-actions.pod:1350
6475 #: ../fish/guestfish-actions.pod:1352
6478 " get-e2uuid device\n"
6483 #: ../fish/guestfish-actions.pod:1354 ../src/guestfs-actions.pod:2020
6484 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6488 #: ../fish/guestfish-actions.pod:1357 ../src/guestfs-actions.pod:2026
6489 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
6493 #: ../fish/guestfish-actions.pod:1364
6498 #: ../fish/guestfish-actions.pod:1366
6506 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2040
6507 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6511 #: ../fish/guestfish-actions.pod:1371
6513 "If L</set-memsize> was not called on this handle, and if "
6514 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6515 "value for memsize."
6519 #: ../fish/guestfish-actions.pod:1375 ../fish/guestfish-actions.pod:1432 ../fish/guestfish-actions.pod:4163 ../fish/guestfish-actions.pod:4265 ../src/guestfs-actions.pod:2047 ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:6293 ../src/guestfs-actions.pod:6419
6520 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6524 #: ../fish/guestfish-actions.pod:1378
6529 #: ../fish/guestfish-actions.pod:1380
6537 #: ../fish/guestfish-actions.pod:1382 ../src/guestfs-actions.pod:2059
6538 msgid "This returns the enable network flag."
6542 #: ../fish/guestfish-actions.pod:1384
6547 #: ../fish/guestfish-actions.pod:1386
6555 #: ../fish/guestfish-actions.pod:1388 ../src/guestfs-actions.pod:2070
6556 msgid "Return the current search path."
6560 #: ../fish/guestfish-actions.pod:1390 ../src/guestfs-actions.pod:2072
6562 "This is always non-NULL. If it wasn't set already, then this will return "
6567 #: ../fish/guestfish-actions.pod:1393
6572 #: ../fish/guestfish-actions.pod:1395
6580 #: ../fish/guestfish-actions.pod:1397 ../src/guestfs-actions.pod:2085
6581 msgid "This returns the process group flag."
6585 #: ../fish/guestfish-actions.pod:1399
6590 #: ../fish/guestfish-actions.pod:1401
6595 #: ../fish/guestfish-actions.pod:1403
6603 #: ../fish/guestfish-actions.pod:1405 ../src/guestfs-actions.pod:2096
6605 "Return the process ID of the qemu subprocess. If there is no qemu "
6606 "subprocess, then this will return an error."
6610 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2099
6611 msgid "This is an internal call used for debugging and testing."
6615 #: ../fish/guestfish-actions.pod:1410
6620 #: ../fish/guestfish-actions.pod:1412
6628 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2110
6629 msgid "Return the current qemu binary."
6633 #: ../fish/guestfish-actions.pod:1416 ../src/guestfs-actions.pod:2112
6635 "This is always non-NULL. If it wasn't set already, then this will return "
6636 "the default qemu binary name."
6640 #: ../fish/guestfish-actions.pod:1419
6641 msgid "get-recovery-proc"
6645 #: ../fish/guestfish-actions.pod:1421
6648 " get-recovery-proc\n"
6653 #: ../fish/guestfish-actions.pod:1423 ../src/guestfs-actions.pod:2125
6654 msgid "Return the recovery process enabled flag."
6658 #: ../fish/guestfish-actions.pod:1425
6663 #: ../fish/guestfish-actions.pod:1427
6671 #: ../fish/guestfish-actions.pod:1429
6673 "This returns the current setting of the selinux flag which is passed to the "
6674 "appliance at boot time. See L</set-selinux>."
6678 #: ../fish/guestfish-actions.pod:1435
6683 #: ../fish/guestfish-actions.pod:1437
6691 #: ../fish/guestfish-actions.pod:1439 ../src/guestfs-actions.pod:2151
6693 "This returns the current state as an opaque integer. This is only useful "
6694 "for printing debug and internal error messages."
6698 #: ../fish/guestfish-actions.pod:1442 ../fish/guestfish-actions.pod:2362 ../fish/guestfish-actions.pod:2380 ../fish/guestfish-actions.pod:2418 ../fish/guestfish-actions.pod:2434 ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:3434 ../src/guestfs-actions.pod:3463 ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:3551
6699 msgid "For more information on states, see L<guestfs(3)>."
6703 #: ../fish/guestfish-actions.pod:1444
6708 #: ../fish/guestfish-actions.pod:1446
6716 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2165
6717 msgid "Return the command trace flag."
6721 #: ../fish/guestfish-actions.pod:1450
6726 #: ../fish/guestfish-actions.pod:1452
6734 #: ../fish/guestfish-actions.pod:1454
6736 "Return the current umask. By default the umask is C<022> unless it has been "
6737 "set by calling L</umask>."
6741 #: ../fish/guestfish-actions.pod:1457
6746 #: ../fish/guestfish-actions.pod:1459
6754 #: ../fish/guestfish-actions.pod:1461 ../src/guestfs-actions.pod:2188
6755 msgid "This returns the verbose messages flag."
6759 #: ../fish/guestfish-actions.pod:1463
6764 #: ../fish/guestfish-actions.pod:1465
6772 #: ../fish/guestfish-actions.pod:1467 ../src/guestfs-actions.pod:2199
6773 msgid "This gets the SELinux security context of the daemon."
6777 #: ../fish/guestfish-actions.pod:1469
6778 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
6782 #: ../fish/guestfish-actions.pod:1472
6787 #: ../fish/guestfish-actions.pod:1474
6790 " getxattr path name\n"
6795 #: ../fish/guestfish-actions.pod:1476
6797 "Get a single extended attribute from file C<path> named C<name>. This call "
6798 "follows symlinks. If you want to lookup an extended attribute for the "
6799 "symlink itself, use L</lgetxattr>."
6803 #: ../fish/guestfish-actions.pod:1480 ../fish/guestfish-actions.pod:2507
6805 "Normally it is better to get all extended attributes from a file in one go "
6806 "by calling L</getxattrs>. However some Linux filesystem implementations are "
6807 "buggy and do not provide a way to list out attributes. For these "
6808 "filesystems (notably ntfs-3g) you have to know the names of the extended "
6809 "attributes you want in advance and call this function."
6813 #: ../fish/guestfish-actions.pod:1487 ../fish/guestfish-actions.pod:2514 ../src/guestfs-actions.pod:2228 ../src/guestfs-actions.pod:3684
6815 "Extended attribute values are blobs of binary data. If there is no extended "
6816 "attribute named C<name>, this returns an error."
6820 #: ../fish/guestfish-actions.pod:1490
6821 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
6825 #: ../fish/guestfish-actions.pod:1492
6830 #: ../fish/guestfish-actions.pod:1494
6838 #: ../fish/guestfish-actions.pod:1496 ../src/guestfs-actions.pod:2245
6839 msgid "This call lists the extended attributes of the file or directory C<path>."
6843 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2248
6845 "At the system call level, this is a combination of the L<listxattr(2)> and "
6846 "L<getxattr(2)> calls."
6850 #: ../fish/guestfish-actions.pod:1502
6851 msgid "See also: L</lgetxattrs>, L<attr(5)>."
6855 #: ../fish/guestfish-actions.pod:1504
6860 #: ../fish/guestfish-actions.pod:1506
6863 " glob-expand pattern\n"
6868 #: ../fish/guestfish-actions.pod:1508 ../src/guestfs-actions.pod:2265
6870 "This command searches for all the pathnames matching C<pattern> according to "
6871 "the wildcard expansion rules used by the shell."
6875 #: ../fish/guestfish-actions.pod:1512 ../src/guestfs-actions.pod:2269
6876 msgid "If no paths match, then this returns an empty list (note: not an error)."
6880 #: ../fish/guestfish-actions.pod:1515 ../src/guestfs-actions.pod:2272
6882 "It is just a wrapper around the C L<glob(3)> function with flags "
6883 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
6887 #: ../fish/guestfish-actions.pod:1519
6892 #: ../fish/guestfish-actions.pod:1521
6895 " grep regex path\n"
6900 #: ../fish/guestfish-actions.pod:1523 ../src/guestfs-actions.pod:2289
6901 msgid "This calls the external C<grep> program and returns the matching lines."
6905 #: ../fish/guestfish-actions.pod:1529
6910 #: ../fish/guestfish-actions.pod:1531
6913 " grepi regex path\n"
6918 #: ../fish/guestfish-actions.pod:1533 ../src/guestfs-actions.pod:2308
6919 msgid "This calls the external C<grep -i> program and returns the matching lines."
6923 #: ../fish/guestfish-actions.pod:1539
6924 msgid "grub-install"
6928 #: ../fish/guestfish-actions.pod:1541
6931 " grub-install root device\n"
6936 #: ../fish/guestfish-actions.pod:1543 ../src/guestfs-actions.pod:2327
6938 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
6939 "the root directory being C<root>."
6943 #: ../fish/guestfish-actions.pod:1546 ../src/guestfs-actions.pod:2330
6945 "Note: If grub-install reports the error \"No suitable drive was found in the "
6946 "generated device map.\" it may be that you need to create a "
6947 "C</boot/grub/device.map> file first that contains the mapping between grub "
6948 "device names and Linux device names. It is usually sufficient to create a "
6953 #: ../fish/guestfish-actions.pod:1553 ../src/guestfs-actions.pod:2337
6961 #: ../fish/guestfish-actions.pod:1555 ../src/guestfs-actions.pod:2339
6962 msgid "replacing C</dev/vda> with the name of the installation device."
6966 #: ../fish/guestfish-actions.pod:1557
6971 #: ../fish/guestfish-actions.pod:1559
6979 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2351
6981 "This command returns up to the first 10 lines of a file as a list of "
6986 #: ../fish/guestfish-actions.pod:1567
6991 #: ../fish/guestfish-actions.pod:1569
6994 " head-n nrlines path\n"
6999 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2370
7001 "If the parameter C<nrlines> is a positive number, this returns the first "
7002 "C<nrlines> lines of the file C<path>."
7006 #: ../fish/guestfish-actions.pod:1574 ../src/guestfs-actions.pod:2373
7008 "If the parameter C<nrlines> is a negative number, this returns lines from "
7009 "the file C<path>, excluding the last C<nrlines> lines."
7013 #: ../fish/guestfish-actions.pod:1577 ../fish/guestfish-actions.pod:4643 ../src/guestfs-actions.pod:2376 ../src/guestfs-actions.pod:6991
7014 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7018 #: ../fish/guestfish-actions.pod:1582
7023 #: ../fish/guestfish-actions.pod:1584
7031 #: ../fish/guestfish-actions.pod:1586 ../src/guestfs-actions.pod:2393
7033 "This runs C<hexdump -C> on the given C<path>. The result is the "
7034 "human-readable, canonical hex dump of the file."
7038 #: ../fish/guestfish-actions.pod:1592
7043 #: ../fish/guestfish-actions.pod:1594
7046 " initrd-cat initrdpath filename\n"
7051 #: ../fish/guestfish-actions.pod:1596 ../src/guestfs-actions.pod:2412
7053 "This command unpacks the file C<filename> from the initrd file called "
7054 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7059 #: ../fish/guestfish-actions.pod:1600 ../src/guestfs-actions.pod:2416
7061 "For example, in guestfish you could use the following command to examine the "
7062 "boot script (usually called C</init>) contained in a Linux initrd or "
7067 #: ../fish/guestfish-actions.pod:1604 ../src/guestfs-actions.pod:2420
7070 " initrd-cat /boot/initrd-<version>.img init\n"
7075 #: ../fish/guestfish-actions.pod:1606
7076 msgid "See also L</initrd-list>."
7080 #: ../fish/guestfish-actions.pod:1611
7085 #: ../fish/guestfish-actions.pod:1613
7088 " initrd-list path\n"
7093 #: ../fish/guestfish-actions.pod:1615 ../src/guestfs-actions.pod:2439
7094 msgid "This command lists out files contained in an initrd."
7098 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2441
7100 "The files are listed without any initial C</> character. The files are "
7101 "listed in the order they appear (not necessarily alphabetical). Directory "
7102 "names are listed as separate items."
7106 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2445
7108 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7109 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7114 #: ../fish/guestfish-actions.pod:1625
7115 msgid "inotify-add-watch"
7119 #: ../fish/guestfish-actions.pod:1627
7122 " inotify-add-watch path mask\n"
7127 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2462
7128 msgid "Watch C<path> for the events listed in C<mask>."
7132 #: ../fish/guestfish-actions.pod:1631 ../src/guestfs-actions.pod:2464
7134 "Note that if C<path> is a directory then events within that directory are "
7135 "watched, but this does I<not> happen recursively (in subdirectories)."
7139 #: ../fish/guestfish-actions.pod:1635 ../src/guestfs-actions.pod:2468
7141 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7142 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7146 #: ../fish/guestfish-actions.pod:1639
7147 msgid "inotify-close"
7151 #: ../fish/guestfish-actions.pod:1641
7159 #: ../fish/guestfish-actions.pod:1643 ../src/guestfs-actions.pod:2481
7161 "This closes the inotify handle which was previously opened by inotify_init. "
7162 "It removes all watches, throws away any pending events, and deallocates all "
7167 #: ../fish/guestfish-actions.pod:1647
7168 msgid "inotify-files"
7172 #: ../fish/guestfish-actions.pod:1649
7180 #: ../fish/guestfish-actions.pod:1651
7182 "This function is a helpful wrapper around L</inotify-read> which just "
7183 "returns a list of pathnames of objects that were touched. The returned "
7184 "pathnames are sorted and deduplicated."
7188 #: ../fish/guestfish-actions.pod:1655
7189 msgid "inotify-init"
7193 #: ../fish/guestfish-actions.pod:1657
7196 " inotify-init maxevents\n"
7201 #: ../fish/guestfish-actions.pod:1659 ../src/guestfs-actions.pod:2510
7203 "This command creates a new inotify handle. The inotify subsystem can be "
7204 "used to notify events which happen to objects in the guest filesystem."
7208 #: ../fish/guestfish-actions.pod:1663
7210 "C<maxevents> is the maximum number of events which will be queued up between "
7211 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
7212 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
7213 "default was 16384 events. Beyond this limit, the kernel throws away events, "
7214 "but records the fact that it threw them away by setting a flag "
7215 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
7219 #: ../fish/guestfish-actions.pod:1673
7221 "Before any events are generated, you have to add some watches to the "
7222 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
7223 "L</inotify-watch-all>."
7227 #: ../fish/guestfish-actions.pod:1679
7229 "Queued up events should be read periodically by calling L</inotify-read> (or "
7230 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
7231 "If you don't read the events out often enough then you risk the internal "
7232 "queue overflowing."
7236 #: ../fish/guestfish-actions.pod:1686
7238 "The handle should be closed after use by calling L</inotify-close>. This "
7239 "also removes any watches automatically."
7243 #: ../fish/guestfish-actions.pod:1690 ../src/guestfs-actions.pod:2541
7245 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7246 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7247 "that there is one global inotify handle per libguestfs instance."
7251 #: ../fish/guestfish-actions.pod:1695
7252 msgid "inotify-read"
7256 #: ../fish/guestfish-actions.pod:1697
7264 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2555
7266 "Return the complete queue of events that have happened since the previous "
7271 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2558
7272 msgid "If no events have happened, this returns an empty list."
7276 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2560
7278 "I<Note>: In order to make sure that all events have been read, you must call "
7279 "this function repeatedly until it returns an empty list. The reason is that "
7280 "the call will read events up to the maximum appliance-to-host message size "
7281 "and leave remaining events in the queue."
7285 #: ../fish/guestfish-actions.pod:1710
7286 msgid "inotify-rm-watch"
7290 #: ../fish/guestfish-actions.pod:1712
7293 " inotify-rm-watch wd\n"
7298 #: ../fish/guestfish-actions.pod:1714
7299 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
7303 #: ../fish/guestfish-actions.pod:1717
7304 msgid "inspect-get-arch"
7308 #: ../fish/guestfish-actions.pod:1719
7311 " inspect-get-arch root\n"
7316 #: ../fish/guestfish-actions.pod:1721
7318 "This returns the architecture of the inspected operating system. The "
7319 "possible return values are listed under L</file-architecture>."
7323 #: ../fish/guestfish-actions.pod:1725 ../src/guestfs-actions.pod:2595
7325 "If the architecture could not be determined, then the string C<unknown> is "
7330 #: ../fish/guestfish-actions.pod:1728 ../fish/guestfish-actions.pod:1811 ../fish/guestfish-actions.pod:1890 ../fish/guestfish-actions.pod:1902 ../fish/guestfish-actions.pod:1986 ../fish/guestfish-actions.pod:2047 ../fish/guestfish-actions.pod:2068 ../fish/guestfish-actions.pod:2082 ../fish/guestfish-actions.pod:2122 ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2167 ../fish/guestfish-actions.pod:2180 ../fish/guestfish-actions.pod:2190 ../fish/guestfish-actions.pod:2200 ../fish/guestfish-actions.pod:2212 ../fish/guestfish-actions.pod:2308 ../fish/guestfish-actions.pod:2342 ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:2792 ../src/guestfs-actions.pod:2811 ../src/guestfs-actions.pod:2942 ../src/guestfs-actions.pod:3025 ../src/guestfs-actions.pod:3053 ../src/guestfs-actions.pod:3074 ../src/guestfs-actions.pod:3127 ../src/guestfs-actions.pod:3167 ../src/guestfs-actions.pod:3187 ../src/guestfs-actions.pod:3207 ../src/guestfs-actions.pod:3224 ../src/guestfs-actions.pod:3240 ../src/guestfs-actions.pod:3258 ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:3401
7331 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7335 #: ../fish/guestfish-actions.pod:1730
7336 msgid "inspect-get-distro"
7340 #: ../fish/guestfish-actions.pod:1732
7343 " inspect-get-distro root\n"
7348 #: ../fish/guestfish-actions.pod:1734 ../src/guestfs-actions.pod:2611
7349 msgid "This returns the distro (distribution) of the inspected operating system."
7353 #: ../fish/guestfish-actions.pod:1737 ../src/guestfs-actions.pod:2614
7354 msgid "Currently defined distros are:"
7358 #: ../fish/guestfish-actions.pod:1741 ../src/guestfs-actions.pod:2618
7359 msgid "\"archlinux\""
7363 #: ../fish/guestfish-actions.pod:1743 ../src/guestfs-actions.pod:2620
7368 #: ../fish/guestfish-actions.pod:1745 ../src/guestfs-actions.pod:2622
7373 #: ../fish/guestfish-actions.pod:1747 ../src/guestfs-actions.pod:2624
7378 #: ../fish/guestfish-actions.pod:1749 ../src/guestfs-actions.pod:2626
7383 #: ../fish/guestfish-actions.pod:1751 ../src/guestfs-actions.pod:2628
7388 #: ../fish/guestfish-actions.pod:1753 ../src/guestfs-actions.pod:2630
7393 #: ../fish/guestfish-actions.pod:1755 ../src/guestfs-actions.pod:2632
7398 #: ../fish/guestfish-actions.pod:1757 ../src/guestfs-actions.pod:2634
7403 #: ../fish/guestfish-actions.pod:1759 ../src/guestfs-actions.pod:2636
7408 #: ../fish/guestfish-actions.pod:1761 ../src/guestfs-actions.pod:2638
7409 msgid "\"linuxmint\""
7413 #: ../fish/guestfish-actions.pod:1763 ../src/guestfs-actions.pod:2640
7418 #: ../fish/guestfish-actions.pod:1765 ../src/guestfs-actions.pod:2642
7419 msgid "\"mandriva\""
7423 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2644
7428 #: ../fish/guestfish-actions.pod:1769 ../src/guestfs-actions.pod:2646
7433 #: ../fish/guestfish-actions.pod:1771 ../src/guestfs-actions.pod:2648
7438 #: ../fish/guestfish-actions.pod:1773 ../src/guestfs-actions.pod:2650
7443 #: ../fish/guestfish-actions.pod:1775 ../src/guestfs-actions.pod:2652
7448 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2654
7449 msgid "\"redhat-based\""
7453 #: ../fish/guestfish-actions.pod:1779 ../src/guestfs-actions.pod:2656
7454 msgid "Some Red Hat-derived distro."
7458 #: ../fish/guestfish-actions.pod:1781 ../src/guestfs-actions.pod:2658
7463 #: ../fish/guestfish-actions.pod:1783 ../src/guestfs-actions.pod:2660
7464 msgid "Red Hat Enterprise Linux."
7468 #: ../fish/guestfish-actions.pod:1785 ../src/guestfs-actions.pod:2662
7469 msgid "\"scientificlinux\""
7473 #: ../fish/guestfish-actions.pod:1787 ../src/guestfs-actions.pod:2664
7474 msgid "Scientific Linux."
7478 #: ../fish/guestfish-actions.pod:1789 ../src/guestfs-actions.pod:2666
7479 msgid "\"slackware\""
7483 #: ../fish/guestfish-actions.pod:1791 ../src/guestfs-actions.pod:2668
7488 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2670
7493 #: ../fish/guestfish-actions.pod:1795 ../src/guestfs-actions.pod:2672
7498 #: ../fish/guestfish-actions.pod:1797 ../fish/guestfish-actions.pod:1881 ../fish/guestfish-actions.pod:2145 ../src/guestfs-actions.pod:2674 ../src/guestfs-actions.pod:2783 ../src/guestfs-actions.pod:3158
7503 #: ../fish/guestfish-actions.pod:1799 ../src/guestfs-actions.pod:2676
7504 msgid "The distro could not be determined."
7508 #: ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:2137 ../src/guestfs-actions.pod:2678 ../src/guestfs-actions.pod:3150
7513 #: ../fish/guestfish-actions.pod:1803 ../src/guestfs-actions.pod:2680
7515 "Windows does not have distributions. This string is returned if the OS type "
7520 #: ../fish/guestfish-actions.pod:1808 ../fish/guestfish-actions.pod:1887 ../fish/guestfish-actions.pod:2151 ../src/guestfs-actions.pod:2685 ../src/guestfs-actions.pod:2789 ../src/guestfs-actions.pod:3164
7522 "Future versions of libguestfs may return other strings here. The caller "
7523 "should be prepared to handle any string."
7527 #: ../fish/guestfish-actions.pod:1813
7528 msgid "inspect-get-drive-mappings"
7532 #: ../fish/guestfish-actions.pod:1815
7535 " inspect-get-drive-mappings root\n"
7540 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2701
7542 "This call is useful for Windows which uses a primitive system of assigning "
7543 "drive letters (like \"C:\") to partitions. This inspection API examines the "
7544 "Windows Registry to find out how disks/partitions are mapped to drive "
7545 "letters, and returns a hash table as in the example below:"
7549 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2707
7559 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2711
7561 "Note that keys are drive letters. For Windows, the key is case insensitive "
7562 "and just contains the drive letter, without the customary colon separator "
7567 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2715
7569 "In future we may support other operating systems that also used drive "
7570 "letters, but the keys for those might not be case insensitive and might be "
7571 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
7576 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2720
7578 "For Windows guests, currently only hard drive mappings are returned. "
7579 "Removable disks (eg. DVD-ROMs) are ignored."
7583 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2723
7585 "For guests that do not use drive mappings, or if the drive mappings could "
7586 "not be determined, this returns an empty hash table."
7590 #: ../fish/guestfish-actions.pod:1842
7592 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7593 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
7597 #: ../fish/guestfish-actions.pod:1846
7598 msgid "inspect-get-filesystems"
7602 #: ../fish/guestfish-actions.pod:1848
7605 " inspect-get-filesystems root\n"
7610 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2744
7612 "This returns a list of all the filesystems that we think are associated with "
7613 "this operating system. This includes the root filesystem, other ordinary "
7614 "filesystems, and non-mounted devices like swap partitions."
7618 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2749
7620 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7621 "to be shared between operating systems."
7625 #: ../fish/guestfish-actions.pod:1858
7627 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7628 "L</inspect-get-mountpoints>."
7632 #: ../fish/guestfish-actions.pod:1861
7633 msgid "inspect-get-format"
7637 #: ../fish/guestfish-actions.pod:1863
7640 " inspect-get-format root\n"
7645 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2767
7647 "This returns the format of the inspected operating system. You can use it "
7648 "to detect install images, live CDs and similar."
7652 #: ../fish/guestfish-actions.pod:1868 ../src/guestfs-actions.pod:2770
7653 msgid "Currently defined formats are:"
7657 #: ../fish/guestfish-actions.pod:1872 ../src/guestfs-actions.pod:2774
7658 msgid "\"installed\""
7662 #: ../fish/guestfish-actions.pod:1874 ../src/guestfs-actions.pod:2776
7663 msgid "This is an installed operating system."
7667 #: ../fish/guestfish-actions.pod:1876 ../src/guestfs-actions.pod:2778
7668 msgid "\"installer\""
7672 #: ../fish/guestfish-actions.pod:1878 ../src/guestfs-actions.pod:2780
7674 "The disk image being inspected is not an installed operating system, but a "
7675 "I<bootable> install disk, live CD, or similar."
7679 #: ../fish/guestfish-actions.pod:1883 ../src/guestfs-actions.pod:2785
7680 msgid "The format of this disk image is not known."
7684 #: ../fish/guestfish-actions.pod:1892
7685 msgid "inspect-get-hostname"
7689 #: ../fish/guestfish-actions.pod:1894
7692 " inspect-get-hostname root\n"
7697 #: ../fish/guestfish-actions.pod:1896 ../src/guestfs-actions.pod:2805
7699 "This function returns the hostname of the operating system as found by "
7700 "inspection of the guest's configuration files."
7704 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2808
7706 "If the hostname could not be determined, then the string C<unknown> is "
7711 #: ../fish/guestfish-actions.pod:1904
7712 msgid "inspect-get-icon"
7716 #: ../fish/guestfish-actions.pod:1906
7719 " inspect-get-icon root [favicon:..] [highquality:..]\n"
7724 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2834
7726 "This function returns an icon corresponding to the inspected operating "
7727 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
7728 "to PNG if necessary)."
7732 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:2838
7734 "If it was not possible to get an icon this function returns a zero-length "
7735 "(non-NULL) buffer. I<Callers must check for this case>."
7739 #: ../fish/guestfish-actions.pod:1915 ../src/guestfs-actions.pod:2841
7741 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
7742 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
7743 "this file will be returned. You can disable favicons by passing the "
7744 "optional C<favicon> boolean as false (default is true)."
7748 #: ../fish/guestfish-actions.pod:1921 ../src/guestfs-actions.pod:2847
7750 "If finding the favicon fails, then we look in other places in the guest for "
7755 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:2850
7757 "If the optional C<highquality> boolean is true then only high quality icons "
7758 "are returned, which means only icons of high resolution with an alpha "
7759 "channel. The default (false) is to return any icon we can, even if it is of "
7760 "substandard quality."
7764 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2861
7766 "Unlike most other inspection API calls, the guest's disks must be mounted up "
7767 "before you call this, since it needs to read information from the guest "
7768 "filesystem during the call."
7772 #: ../fish/guestfish-actions.pod:1941 ../src/guestfs-actions.pod:2867
7774 "B<Security:> The icon data comes from the untrusted guest, and should be "
7775 "treated with caution. PNG files have been known to contain exploits. "
7776 "Ensure that libpng (or other relevant libraries) are fully up to date before "
7777 "trying to process or display the icon."
7781 #: ../fish/guestfish-actions.pod:1949 ../src/guestfs-actions.pod:2875
7783 "The PNG image returned can be any size. It might not be square. Libguestfs "
7784 "tries to return the largest, highest quality icon available. The "
7785 "application must scale the icon to the required size."
7789 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:2882
7791 "Extracting icons from Windows guests requires the external C<wrestool> "
7792 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
7793 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
7794 "installed separately."
7798 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:2889
7800 "Operating system icons are usually trademarks. Seek legal advice before "
7801 "using trademarks in applications."
7805 #: ../fish/guestfish-actions.pod:1970
7806 msgid "inspect-get-major-version"
7810 #: ../fish/guestfish-actions.pod:1972
7813 " inspect-get-major-version root\n"
7818 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:2930
7819 msgid "This returns the major version number of the inspected operating system."
7823 #: ../fish/guestfish-actions.pod:1977 ../src/guestfs-actions.pod:2933
7825 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7826 "popular public names used by the operating system. Notably the operating "
7827 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7828 "1). You can find out the real versions corresponding to releases of Windows "
7829 "by consulting Wikipedia or MSDN."
7833 #: ../fish/guestfish-actions.pod:1984 ../fish/guestfish-actions.pod:1995 ../src/guestfs-actions.pod:2940 ../src/guestfs-actions.pod:2957
7834 msgid "If the version could not be determined, then C<0> is returned."
7838 #: ../fish/guestfish-actions.pod:1988
7839 msgid "inspect-get-minor-version"
7843 #: ../fish/guestfish-actions.pod:1990
7846 " inspect-get-minor-version root\n"
7851 #: ../fish/guestfish-actions.pod:1992 ../src/guestfs-actions.pod:2954
7852 msgid "This returns the minor version number of the inspected operating system."
7856 #: ../fish/guestfish-actions.pod:1997
7858 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7859 "L</inspect-get-major-version>."
7863 #: ../fish/guestfish-actions.pod:2000
7864 msgid "inspect-get-mountpoints"
7868 #: ../fish/guestfish-actions.pod:2002
7871 " inspect-get-mountpoints root\n"
7876 #: ../fish/guestfish-actions.pod:2004 ../src/guestfs-actions.pod:2972
7878 "This returns a hash of where we think the filesystems associated with this "
7879 "operating system should be mounted. Callers should note that this is at "
7880 "best an educated guess made by reading configuration files such as "
7881 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
7882 "are non-existent or not mountable and callers should be prepared to handle "
7883 "or ignore failures if they try to mount them."
7887 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:2981
7889 "Each element in the returned hashtable has a key which is the path of the "
7890 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7891 "mounted there (eg. C</dev/sda1>)."
7895 #: ../fish/guestfish-actions.pod:2018 ../src/guestfs-actions.pod:2986
7896 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
7900 #: ../fish/guestfish-actions.pod:2021
7902 "For operating systems like Windows which still use drive letters, this call "
7903 "will only return an entry for the first drive \"mounted on\" C</>. For "
7904 "information about the mapping of drive letters to partitions, see "
7905 "L</inspect-get-drive-mappings>."
7909 #: ../fish/guestfish-actions.pod:2027
7911 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7912 "L</inspect-get-filesystems>."
7916 #: ../fish/guestfish-actions.pod:2030
7917 msgid "inspect-get-package-format"
7921 #: ../fish/guestfish-actions.pod:2032
7924 " inspect-get-package-format root\n"
7929 #: ../fish/guestfish-actions.pod:2034
7931 "This function and L</inspect-get-package-management> return the package "
7932 "format and package management tool used by the inspected operating system. "
7933 "For example for Fedora these functions would return C<rpm> (package format) "
7934 "and C<yum> (package management)."
7938 #: ../fish/guestfish-actions.pod:2040 ../src/guestfs-actions.pod:3018
7940 "This returns the string C<unknown> if we could not determine the package "
7941 "format I<or> if the operating system does not have a real packaging system "
7946 #: ../fish/guestfish-actions.pod:2044 ../src/guestfs-actions.pod:3022
7948 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
7949 "Future versions of libguestfs may return other strings."
7953 #: ../fish/guestfish-actions.pod:2049
7954 msgid "inspect-get-package-management"
7958 #: ../fish/guestfish-actions.pod:2051
7961 " inspect-get-package-management root\n"
7966 #: ../fish/guestfish-actions.pod:2053
7968 "L</inspect-get-package-format> and this function return the package format "
7969 "and package management tool used by the inspected operating system. For "
7970 "example for Fedora these functions would return C<rpm> (package format) and "
7971 "C<yum> (package management)."
7975 #: ../fish/guestfish-actions.pod:2059 ../src/guestfs-actions.pod:3044
7977 "This returns the string C<unknown> if we could not determine the package "
7978 "management tool I<or> if the operating system does not have a real packaging "
7979 "system (eg. Windows)."
7983 #: ../fish/guestfish-actions.pod:2063 ../src/guestfs-actions.pod:3048
7985 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
7986 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
7987 "libguestfs may return other strings."
7991 #: ../fish/guestfish-actions.pod:2070
7992 msgid "inspect-get-product-name"
7996 #: ../fish/guestfish-actions.pod:2072
7999 " inspect-get-product-name root\n"
8004 #: ../fish/guestfish-actions.pod:2074 ../src/guestfs-actions.pod:3066
8006 "This returns the product name of the inspected operating system. The "
8007 "product name is generally some freeform string which can be displayed to the "
8008 "user, but should not be parsed by programs."
8012 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3071
8014 "If the product name could not be determined, then the string C<unknown> is "
8019 #: ../fish/guestfish-actions.pod:2084
8020 msgid "inspect-get-product-variant"
8024 #: ../fish/guestfish-actions.pod:2086
8027 " inspect-get-product-variant root\n"
8032 #: ../fish/guestfish-actions.pod:2088 ../src/guestfs-actions.pod:3087
8033 msgid "This returns the product variant of the inspected operating system."
8037 #: ../fish/guestfish-actions.pod:2091 ../src/guestfs-actions.pod:3090
8039 "For Windows guests, this returns the contents of the Registry key "
8040 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
8041 "which is usually a string such as C<Client> or C<Server> (other values are "
8042 "possible). This can be used to distinguish consumer and enterprise versions "
8043 "of Windows that have the same version number (for example, Windows 7 and "
8044 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8045 "the latter is C<Server>)."
8049 #: ../fish/guestfish-actions.pod:2100 ../src/guestfs-actions.pod:3099
8051 "For enterprise Linux guests, in future we intend this to return the product "
8052 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8053 "implemented at present."
8057 #: ../fish/guestfish-actions.pod:2104 ../src/guestfs-actions.pod:3103
8059 "If the product variant could not be determined, then the string C<unknown> "
8064 #: ../fish/guestfish-actions.pod:2107
8066 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8067 "L</inspect-get-product-name>, L</inspect-get-major-version>."
8071 #: ../fish/guestfish-actions.pod:2111
8072 msgid "inspect-get-roots"
8076 #: ../fish/guestfish-actions.pod:2113
8079 " inspect-get-roots\n"
8084 #: ../fish/guestfish-actions.pod:2115
8086 "This function is a convenient way to get the list of root devices, as "
8087 "returned from a previous call to L</inspect-os>, but without redoing the "
8088 "whole inspection process."
8092 #: ../fish/guestfish-actions.pod:2119
8094 "This returns an empty list if either no root devices were found or the "
8095 "caller has not called L</inspect-os>."
8099 #: ../fish/guestfish-actions.pod:2124
8100 msgid "inspect-get-type"
8104 #: ../fish/guestfish-actions.pod:2126
8107 " inspect-get-type root\n"
8112 #: ../fish/guestfish-actions.pod:2128 ../src/guestfs-actions.pod:3141
8114 "This returns the type of the inspected operating system. Currently defined "
8119 #: ../fish/guestfish-actions.pod:2133 ../src/guestfs-actions.pod:3146
8124 #: ../fish/guestfish-actions.pod:2135 ../src/guestfs-actions.pod:3148
8125 msgid "Any Linux-based operating system."
8129 #: ../fish/guestfish-actions.pod:2139 ../src/guestfs-actions.pod:3152
8130 msgid "Any Microsoft Windows operating system."
8134 #: ../fish/guestfish-actions.pod:2141 ../src/guestfs-actions.pod:3154
8139 #: ../fish/guestfish-actions.pod:2143 ../src/guestfs-actions.pod:3156
8144 #: ../fish/guestfish-actions.pod:2147 ../src/guestfs-actions.pod:3160
8145 msgid "The operating system type could not be determined."
8149 #: ../fish/guestfish-actions.pod:2156
8150 msgid "inspect-get-windows-current-control-set"
8154 #: ../fish/guestfish-actions.pod:2158
8157 " inspect-get-windows-current-control-set root\n"
8162 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3180
8164 "This returns the Windows CurrentControlSet of the inspected guest. The "
8165 "CurrentControlSet is a registry key name such as C<ControlSet001>."
8169 #: ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:3183
8171 "This call assumes that the guest is Windows and that the Registry could be "
8172 "examined by inspection. If this is not the case then an error is returned."
8176 #: ../fish/guestfish-actions.pod:2169
8177 msgid "inspect-get-windows-systemroot"
8181 #: ../fish/guestfish-actions.pod:2171
8184 " inspect-get-windows-systemroot root\n"
8189 #: ../fish/guestfish-actions.pod:2173 ../src/guestfs-actions.pod:3200
8191 "This returns the Windows systemroot of the inspected guest. The systemroot "
8192 "is a directory path such as C</WINDOWS>."
8196 #: ../fish/guestfish-actions.pod:2176 ../src/guestfs-actions.pod:3203
8198 "This call assumes that the guest is Windows and that the systemroot could be "
8199 "determined by inspection. If this is not the case then an error is "
8204 #: ../fish/guestfish-actions.pod:2182
8205 msgid "inspect-is-live"
8209 #: ../fish/guestfish-actions.pod:2184
8212 " inspect-is-live root\n"
8217 #: ../fish/guestfish-actions.pod:2186
8219 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8220 "then this returns true if a live image was detected on the disk."
8224 #: ../fish/guestfish-actions.pod:2192
8225 msgid "inspect-is-multipart"
8229 #: ../fish/guestfish-actions.pod:2194
8232 " inspect-is-multipart root\n"
8237 #: ../fish/guestfish-actions.pod:2196
8239 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8240 "then this returns true if the disk is part of a set."
8244 #: ../fish/guestfish-actions.pod:2202
8245 msgid "inspect-is-netinst"
8249 #: ../fish/guestfish-actions.pod:2204
8252 " inspect-is-netinst root\n"
8257 #: ../fish/guestfish-actions.pod:2206
8259 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8260 "then this returns true if the disk is a network installer, ie. not a "
8261 "self-contained install CD but one which is likely to require network access "
8262 "to complete the install."
8266 #: ../fish/guestfish-actions.pod:2214
8267 msgid "inspect-list-applications"
8271 #: ../fish/guestfish-actions.pod:2216
8274 " inspect-list-applications root\n"
8279 #: ../fish/guestfish-actions.pod:2218 ../src/guestfs-actions.pod:3270
8280 msgid "Return the list of applications installed in the operating system."
8284 #: ../fish/guestfish-actions.pod:2220
8286 "I<Note:> This call works differently from other parts of the inspection "
8287 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
8288 "then mount up the disks, before calling this. Listing applications is a "
8289 "significantly more difficult operation which requires access to the full "
8290 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
8291 "are just returning data cached in the libguestfs handle, this call actually "
8292 "reads parts of the mounted filesystems during the call."
8296 #: ../fish/guestfish-actions.pod:2230 ../src/guestfs-actions.pod:3282
8298 "This returns an empty list if the inspection code was not able to determine "
8299 "the list of applications."
8303 #: ../fish/guestfish-actions.pod:2233 ../src/guestfs-actions.pod:3285
8304 msgid "The application structure contains the following fields:"
8308 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3289
8313 #: ../fish/guestfish-actions.pod:2239 ../src/guestfs-actions.pod:3291
8315 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8316 "guests, this is the package name."
8320 #: ../fish/guestfish-actions.pod:2242 ../src/guestfs-actions.pod:3294
8321 msgid "C<app_display_name>"
8325 #: ../fish/guestfish-actions.pod:2244 ../src/guestfs-actions.pod:3296
8327 "The display name of the application, sometimes localized to the install "
8328 "language of the guest operating system."
8332 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3299
8334 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8335 "to display something can use C<app_name> instead."
8339 #: ../fish/guestfish-actions.pod:2250 ../src/guestfs-actions.pod:3302
8340 msgid "C<app_epoch>"
8344 #: ../fish/guestfish-actions.pod:2252 ../src/guestfs-actions.pod:3304
8346 "For package managers which use epochs, this contains the epoch of the "
8347 "package (an integer). If unavailable, this is returned as C<0>."
8351 #: ../fish/guestfish-actions.pod:2255 ../src/guestfs-actions.pod:3307
8352 msgid "C<app_version>"
8356 #: ../fish/guestfish-actions.pod:2257 ../src/guestfs-actions.pod:3309
8358 "The version string of the application or package. If unavailable this is "
8359 "returned as an empty string C<\"\">."
8363 #: ../fish/guestfish-actions.pod:2260 ../src/guestfs-actions.pod:3312
8364 msgid "C<app_release>"
8368 #: ../fish/guestfish-actions.pod:2262 ../src/guestfs-actions.pod:3314
8370 "The release string of the application or package, for package managers that "
8371 "use this. If unavailable this is returned as an empty string C<\"\">."
8375 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3318
8376 msgid "C<app_install_path>"
8380 #: ../fish/guestfish-actions.pod:2268 ../src/guestfs-actions.pod:3320
8382 "The installation path of the application (on operating systems such as "
8383 "Windows which use installation paths). This path is in the format used by "
8384 "the guest operating system, it is not a libguestfs path."
8388 #: ../fish/guestfish-actions.pod:2273 ../src/guestfs-actions.pod:3325
8389 msgid "If unavailable this is returned as an empty string C<\"\">."
8393 #: ../fish/guestfish-actions.pod:2275 ../src/guestfs-actions.pod:3327
8394 msgid "C<app_trans_path>"
8398 #: ../fish/guestfish-actions.pod:2277 ../src/guestfs-actions.pod:3329
8400 "The install path translated into a libguestfs path. If unavailable this is "
8401 "returned as an empty string C<\"\">."
8405 #: ../fish/guestfish-actions.pod:2280 ../src/guestfs-actions.pod:3332
8406 msgid "C<app_publisher>"
8410 #: ../fish/guestfish-actions.pod:2282 ../src/guestfs-actions.pod:3334
8412 "The name of the publisher of the application, for package managers that use "
8413 "this. If unavailable this is returned as an empty string C<\"\">."
8417 #: ../fish/guestfish-actions.pod:2286 ../src/guestfs-actions.pod:3338
8422 #: ../fish/guestfish-actions.pod:2288 ../src/guestfs-actions.pod:3340
8424 "The URL (eg. upstream URL) of the application. If unavailable this is "
8425 "returned as an empty string C<\"\">."
8429 #: ../fish/guestfish-actions.pod:2291 ../src/guestfs-actions.pod:3343
8430 msgid "C<app_source_package>"
8434 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3345
8436 "For packaging systems which support this, the name of the source package. "
8437 "If unavailable this is returned as an empty string C<\"\">."
8441 #: ../fish/guestfish-actions.pod:2296 ../src/guestfs-actions.pod:3348
8442 msgid "C<app_summary>"
8446 #: ../fish/guestfish-actions.pod:2298 ../src/guestfs-actions.pod:3350
8448 "A short (usually one line) description of the application or package. If "
8449 "unavailable this is returned as an empty string C<\"\">."
8453 #: ../fish/guestfish-actions.pod:2301 ../src/guestfs-actions.pod:3353
8454 msgid "C<app_description>"
8458 #: ../fish/guestfish-actions.pod:2303 ../src/guestfs-actions.pod:3355
8460 "A longer description of the application or package. If unavailable this is "
8461 "returned as an empty string C<\"\">."
8465 #: ../fish/guestfish-actions.pod:2310
8470 #: ../fish/guestfish-actions.pod:2312
8478 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3373
8480 "This function uses other libguestfs functions and certain heuristics to "
8481 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
8482 "for operating systems."
8486 #: ../fish/guestfish-actions.pod:2318 ../src/guestfs-actions.pod:3377
8487 msgid "The list returned is empty if no operating systems were found."
8491 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3379
8493 "If one operating system was found, then this returns a list with a single "
8494 "element, which is the name of the root filesystem of this operating system. "
8495 "It is also possible for this function to return a list containing more than "
8496 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
8497 "element being the root filesystem of one of the operating systems."
8501 #: ../fish/guestfish-actions.pod:2327
8503 "You can pass the root string(s) returned to other L</inspect-get-*> "
8504 "functions in order to query further information about each operating system, "
8505 "such as the name and version."
8509 #: ../fish/guestfish-actions.pod:2332
8511 "This function uses other libguestfs features such as L</mount-ro> and "
8512 "L</umount-all> in order to mount and unmount filesystems and look at the "
8513 "contents. This should be called with no disks currently mounted. The "
8514 "function may also use Augeas, so any existing Augeas handle will be closed."
8518 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3397
8520 "This function cannot decrypt encrypted disks. The caller must do that first "
8521 "(supplying the necessary keys) if the disk is encrypted."
8525 #: ../fish/guestfish-actions.pod:2344 ../fish/guestfish-actions.pod:2542 ../fish/guestfish-actions.pod:2601
8526 msgid "See also L</list-filesystems>."
8530 #: ../fish/guestfish-actions.pod:2346
8535 #: ../fish/guestfish-actions.pod:2348
8538 " is-blockdev path\n"
8543 #: ../fish/guestfish-actions.pod:2350 ../src/guestfs-actions.pod:3417
8545 "This returns C<true> if and only if there is a block device with the given "
8550 #: ../fish/guestfish-actions.pod:2353 ../fish/guestfish-actions.pod:2371 ../fish/guestfish-actions.pod:2390 ../fish/guestfish-actions.pod:2399 ../fish/guestfish-actions.pod:2409 ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2452
8551 msgid "See also L</stat>."
8555 #: ../fish/guestfish-actions.pod:2355
8560 #: ../fish/guestfish-actions.pod:2357
8568 #: ../fish/guestfish-actions.pod:2359 ../src/guestfs-actions.pod:3431
8570 "This returns true iff this handle is busy processing a command (in the "
8575 #: ../fish/guestfish-actions.pod:2364
8580 #: ../fish/guestfish-actions.pod:2366
8583 " is-chardev path\n"
8588 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3446
8590 "This returns C<true> if and only if there is a character device with the "
8591 "given C<path> name."
8595 #: ../fish/guestfish-actions.pod:2373
8600 #: ../fish/guestfish-actions.pod:2375
8608 #: ../fish/guestfish-actions.pod:2377 ../src/guestfs-actions.pod:3460
8610 "This returns true iff this handle is being configured (in the C<CONFIG> "
8615 #: ../fish/guestfish-actions.pod:2382
8620 #: ../fish/guestfish-actions.pod:2384
8628 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3475
8630 "This returns C<true> if and only if there is a directory with the given "
8631 "C<path> name. Note that it returns false for other objects like files."
8635 #: ../fish/guestfish-actions.pod:2392
8640 #: ../fish/guestfish-actions.pod:2394
8648 #: ../fish/guestfish-actions.pod:2396 ../src/guestfs-actions.pod:3491
8650 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8651 "given C<path> name."
8655 #: ../fish/guestfish-actions.pod:2401
8660 #: ../fish/guestfish-actions.pod:2403
8668 #: ../fish/guestfish-actions.pod:2405 ../src/guestfs-actions.pod:3506
8670 "This returns C<true> if and only if there is a regular file with the given "
8671 "C<path> name. Note that it returns false for other objects like "
8676 #: ../fish/guestfish-actions.pod:2411
8677 msgid "is-launching"
8681 #: ../fish/guestfish-actions.pod:2413
8689 #: ../fish/guestfish-actions.pod:2415 ../src/guestfs-actions.pod:3521
8691 "This returns true iff this handle is launching the subprocess (in the "
8692 "C<LAUNCHING> state)."
8696 #: ../fish/guestfish-actions.pod:2420
8701 #: ../fish/guestfish-actions.pod:2422
8709 #: ../fish/guestfish-actions.pod:2424 ../src/guestfs-actions.pod:3536
8711 "This command tests whether C<device> is a logical volume, and returns true "
8712 "iff this is the case."
8716 #: ../fish/guestfish-actions.pod:2427
8721 #: ../fish/guestfish-actions.pod:2429
8729 #: ../fish/guestfish-actions.pod:2431 ../src/guestfs-actions.pod:3548
8731 "This returns true iff this handle is ready to accept commands (in the "
8736 #: ../fish/guestfish-actions.pod:2436
8741 #: ../fish/guestfish-actions.pod:2438
8749 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3563
8751 "This returns C<true> if and only if there is a Unix domain socket with the "
8752 "given C<path> name."
8756 #: ../fish/guestfish-actions.pod:2445
8761 #: ../fish/guestfish-actions.pod:2447
8764 " is-symlink path\n"
8769 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3578
8771 "This returns C<true> if and only if there is a symbolic link with the given "
8776 #: ../fish/guestfish-actions.pod:2454
8781 #: ../fish/guestfish-actions.pod:2456
8789 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3593
8791 "This returns true iff the file exists and the file is empty or it contains "
8796 #: ../fish/guestfish-actions.pod:2461
8797 msgid "is-zero-device"
8801 #: ../fish/guestfish-actions.pod:2463
8804 " is-zero-device device\n"
8809 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3606
8810 msgid "This returns true iff the device exists and contains all zero bytes."
8814 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3608
8815 msgid "Note that for large devices this can take a long time to run."
8819 #: ../fish/guestfish-actions.pod:2469
8820 msgid "kill-subprocess"
8824 #: ../fish/guestfish-actions.pod:2471
8827 " kill-subprocess\n"
8832 #: ../fish/guestfish-actions.pod:2473 ../src/guestfs-actions.pod:3619
8833 msgid "This kills the qemu subprocess. You should never need to call this."
8837 #: ../fish/guestfish-actions.pod:2475
8842 #: ../fish/guestfish-actions.pod:2477
8847 #: ../fish/guestfish-actions.pod:2479
8855 #: ../fish/guestfish-actions.pod:2481 ../src/guestfs-actions.pod:3630
8857 "Internally libguestfs is implemented by running a virtual machine using "
8862 #: ../fish/guestfish-actions.pod:2484 ../src/guestfs-actions.pod:3633
8864 "You should call this after configuring the handle (eg. adding drives) but "
8865 "before performing any actions."
8869 #: ../fish/guestfish-actions.pod:2487
8874 #: ../fish/guestfish-actions.pod:2489
8877 " lchown owner group path\n"
8882 #: ../fish/guestfish-actions.pod:2491
8884 "Change the file owner to C<owner> and group to C<group>. This is like "
8885 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
8890 #: ../fish/guestfish-actions.pod:2499
8895 #: ../fish/guestfish-actions.pod:2501
8898 " lgetxattr path name\n"
8903 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3673
8905 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
8906 "is a symlink, then this call returns an extended attribute from the symlink."
8910 #: ../fish/guestfish-actions.pod:2517
8911 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
8915 #: ../fish/guestfish-actions.pod:2519
8920 #: ../fish/guestfish-actions.pod:2521
8923 " lgetxattrs path\n"
8928 #: ../fish/guestfish-actions.pod:2523
8930 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
8931 "it returns the extended attributes of the link itself."
8935 #: ../fish/guestfish-actions.pod:2527
8940 #: ../fish/guestfish-actions.pod:2529
8948 #: ../fish/guestfish-actions.pod:2531 ../src/guestfs-actions.pod:3716
8950 "List all 9p filesystems attached to the guest. A list of mount tags is "
8955 #: ../fish/guestfish-actions.pod:2534
8956 msgid "list-devices"
8960 #: ../fish/guestfish-actions.pod:2536
8968 #: ../fish/guestfish-actions.pod:2538 ../src/guestfs-actions.pod:3730
8969 msgid "List all the block devices."
8973 #: ../fish/guestfish-actions.pod:2540 ../src/guestfs-actions.pod:3732
8974 msgid "The full block device names are returned, eg. C</dev/sda>."
8978 #: ../fish/guestfish-actions.pod:2544
8979 msgid "list-dm-devices"
8983 #: ../fish/guestfish-actions.pod:2546
8986 " list-dm-devices\n"
8991 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3747
8992 msgid "List all device mapper devices."
8996 #: ../fish/guestfish-actions.pod:2550
8998 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
8999 "previous call to L</luks-open>."
9003 #: ../fish/guestfish-actions.pod:2553
9005 "Device mapper devices which correspond to logical volumes are I<not> "
9006 "returned in this list. Call L</lvs> if you want to list logical volumes."
9010 #: ../fish/guestfish-actions.pod:2557
9011 msgid "list-filesystems"
9015 #: ../fish/guestfish-actions.pod:2559
9018 " list-filesystems\n"
9023 #: ../fish/guestfish-actions.pod:2561 ../src/guestfs-actions.pod:3767
9025 "This inspection command looks for filesystems on partitions, block devices "
9026 "and logical volumes, returning a list of devices containing filesystems and "
9031 #: ../fish/guestfish-actions.pod:2565 ../src/guestfs-actions.pod:3771
9033 "The return value is a hash, where the keys are the devices containing "
9034 "filesystems, and the values are the filesystem types. For example:"
9038 #: ../fish/guestfish-actions.pod:2569 ../src/guestfs-actions.pod:3775
9041 " \"/dev/sda1\" => \"ntfs\"\n"
9042 " \"/dev/sda2\" => \"ext2\"\n"
9043 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9044 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9049 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3780
9051 "The value can have the special value \"unknown\", meaning the content of the "
9052 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9056 #: ../fish/guestfish-actions.pod:2578
9058 "This command runs other libguestfs commands, which might include L</mount> "
9059 "and L</umount>, and therefore you should use this soon after launch and only "
9060 "when nothing is mounted."
9064 #: ../fish/guestfish-actions.pod:2582
9066 "Not all of the filesystems returned will be mountable. In particular, swap "
9067 "partitions are returned in the list. Also this command does not check that "
9068 "each filesystem found is valid and mountable, and some filesystems might be "
9069 "mountable but require special options. Filesystems may not all belong to a "
9070 "single logical operating system (use L</inspect-os> to look for OSes)."
9074 #: ../fish/guestfish-actions.pod:2590
9075 msgid "list-partitions"
9079 #: ../fish/guestfish-actions.pod:2592
9082 " list-partitions\n"
9087 #: ../fish/guestfish-actions.pod:2594 ../src/guestfs-actions.pod:3809
9088 msgid "List all the partitions detected on all block devices."
9092 #: ../fish/guestfish-actions.pod:2596 ../src/guestfs-actions.pod:3811
9093 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9097 #: ../fish/guestfish-actions.pod:2598
9099 "This does not return logical volumes. For that you will need to call "
9104 #: ../fish/guestfish-actions.pod:2603
9109 #: ../fish/guestfish-actions.pod:2605
9117 #: ../fish/guestfish-actions.pod:2607 ../src/guestfs-actions.pod:3830
9119 "List the files in C<directory> (relative to the root directory, there is no "
9120 "cwd) in the format of 'ls -la'."
9124 #: ../fish/guestfish-actions.pod:2610 ../src/guestfs-actions.pod:3833
9126 "This command is mostly useful for interactive sessions. It is I<not> "
9127 "intended that you try to parse the output string."
9131 #: ../fish/guestfish-actions.pod:2613
9136 #: ../fish/guestfish-actions.pod:2615
9139 " ln target linkname\n"
9144 #: ../fish/guestfish-actions.pod:2617 ../src/guestfs-actions.pod:3848
9145 msgid "This command creates a hard link using the C<ln> command."
9149 #: ../fish/guestfish-actions.pod:2619
9154 #: ../fish/guestfish-actions.pod:2621
9157 " ln-f target linkname\n"
9162 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3861
9164 "This command creates a hard link using the C<ln -f> command. The I<-f> "
9165 "option removes the link (C<linkname>) if it exists already."
9169 #: ../fish/guestfish-actions.pod:2626
9174 #: ../fish/guestfish-actions.pod:2628
9177 " ln-s target linkname\n"
9182 #: ../fish/guestfish-actions.pod:2630 ../src/guestfs-actions.pod:3875
9183 msgid "This command creates a symbolic link using the C<ln -s> command."
9187 #: ../fish/guestfish-actions.pod:2632
9192 #: ../fish/guestfish-actions.pod:2634
9195 " ln-sf target linkname\n"
9200 #: ../fish/guestfish-actions.pod:2636 ../src/guestfs-actions.pod:3888
9202 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
9203 "option removes the link (C<linkname>) if it exists already."
9207 #: ../fish/guestfish-actions.pod:2639
9208 msgid "lremovexattr"
9212 #: ../fish/guestfish-actions.pod:2641
9215 " lremovexattr xattr path\n"
9220 #: ../fish/guestfish-actions.pod:2643
9222 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
9223 "it removes an extended attribute of the link itself."
9227 #: ../fish/guestfish-actions.pod:2647
9232 #: ../fish/guestfish-actions.pod:2649
9240 #: ../fish/guestfish-actions.pod:2651 ../src/guestfs-actions.pod:3916
9242 "List the files in C<directory> (relative to the root directory, there is no "
9243 "cwd). The '.' and '..' entries are not returned, but hidden files are "
9248 #: ../fish/guestfish-actions.pod:2655
9250 "This command is mostly useful for interactive sessions. Programs should "
9251 "probably use L</readdir> instead."
9255 #: ../fish/guestfish-actions.pod:2658
9260 #: ../fish/guestfish-actions.pod:2660
9263 " lsetxattr xattr val vallen path\n"
9268 #: ../fish/guestfish-actions.pod:2662
9270 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
9271 "sets an extended attribute of the link itself."
9275 #: ../fish/guestfish-actions.pod:2666
9280 #: ../fish/guestfish-actions.pod:2668
9288 #: ../fish/guestfish-actions.pod:2670 ../fish/guestfish-actions.pod:4478 ../src/guestfs-actions.pod:3952 ../src/guestfs-actions.pod:6731
9289 msgid "Returns file information for the given C<path>."
9293 #: ../fish/guestfish-actions.pod:2672
9295 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
9296 "the link is stat-ed, not the file it refers to."
9300 #: ../fish/guestfish-actions.pod:2676 ../src/guestfs-actions.pod:3958
9301 msgid "This is the same as the C<lstat(2)> system call."
9305 #: ../fish/guestfish-actions.pod:2678
9310 #: ../fish/guestfish-actions.pod:2680
9313 " lstatlist path 'names ...'\n"
9318 #: ../fish/guestfish-actions.pod:2682
9320 "This call allows you to perform the L</lstat> operation on multiple files, "
9321 "where all files are in the directory C<path>. C<names> is the list of files "
9322 "from this directory."
9326 #: ../fish/guestfish-actions.pod:2686 ../src/guestfs-actions.pod:3977
9328 "On return you get a list of stat structs, with a one-to-one correspondence "
9329 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9330 "then the C<ino> field of that structure is set to C<-1>."
9334 #: ../fish/guestfish-actions.pod:2691
9336 "This call is intended for programs that want to efficiently list a directory "
9337 "contents without making many round-trips. See also L</lxattrlist> for a "
9338 "similarly efficient call for getting extended attributes. Very long "
9339 "directory listings might cause the protocol message size to be exceeded, "
9340 "causing this call to fail. The caller must split up such requests into "
9341 "smaller groups of names."
9345 #: ../fish/guestfish-actions.pod:2699
9346 msgid "luks-add-key"
9350 #: ../fish/guestfish-actions.pod:2701
9353 " luks-add-key device keyslot\n"
9358 #: ../fish/guestfish-actions.pod:2703 ../src/guestfs-actions.pod:4005
9360 "This command adds a new key on LUKS device C<device>. C<key> is any "
9361 "existing key, and is used to access the device. C<newkey> is the new key to "
9362 "add. C<keyslot> is the key slot that will be replaced."
9366 #: ../fish/guestfish-actions.pod:2708
9368 "Note that if C<keyslot> already contains a key, then this command will "
9369 "fail. You have to use L</luks-kill-slot> first to remove that key."
9373 #: ../fish/guestfish-actions.pod:2712 ../fish/guestfish-actions.pod:2734 ../fish/guestfish-actions.pod:2747 ../fish/guestfish-actions.pod:2761 ../fish/guestfish-actions.pod:2787 ../fish/guestfish-actions.pod:2797
9375 "This command has one or more key or passphrase parameters. Guestfish will "
9376 "prompt for these separately."
9380 #: ../fish/guestfish-actions.pod:2715
9385 #: ../fish/guestfish-actions.pod:2717
9388 " luks-close device\n"
9393 #: ../fish/guestfish-actions.pod:2719
9395 "This closes a LUKS device that was created earlier by L</luks-open> or "
9396 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
9397 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
9398 "underlying block device."
9402 #: ../fish/guestfish-actions.pod:2725
9407 #: ../fish/guestfish-actions.pod:2727
9410 " luks-format device keyslot\n"
9415 #: ../fish/guestfish-actions.pod:2729 ../src/guestfs-actions.pod:4046
9417 "This command erases existing data on C<device> and formats the device as a "
9418 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9419 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9423 #: ../fish/guestfish-actions.pod:2737 ../fish/guestfish-actions.pod:2750 ../fish/guestfish-actions.pod:2837 ../fish/guestfish-actions.pod:3498 ../fish/guestfish-actions.pod:4024 ../fish/guestfish-actions.pod:4349 ../fish/guestfish-actions.pod:4372 ../fish/guestfish-actions.pod:4394 ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:4053 ../src/guestfs-actions.pod:4076 ../src/guestfs-actions.pod:4219 ../src/guestfs-actions.pod:5322 ../src/guestfs-actions.pod:6110 ../src/guestfs-actions.pod:6538 ../src/guestfs-actions.pod:6568 ../src/guestfs-actions.pod:6601 ../src/guestfs-actions.pod:7799
9425 "B<This command is dangerous. Without careful use you can easily destroy all "
9430 #: ../fish/guestfish-actions.pod:2740
9431 msgid "luks-format-cipher"
9435 #: ../fish/guestfish-actions.pod:2742
9438 " luks-format-cipher device keyslot cipher\n"
9443 #: ../fish/guestfish-actions.pod:2744
9445 "This command is the same as L</luks-format> but it also allows you to set "
9446 "the C<cipher> used."
9450 #: ../fish/guestfish-actions.pod:2753
9451 msgid "luks-kill-slot"
9455 #: ../fish/guestfish-actions.pod:2755
9458 " luks-kill-slot device keyslot\n"
9463 #: ../fish/guestfish-actions.pod:2757 ../src/guestfs-actions.pod:4093
9465 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
9466 "device C<device>. C<key> must be one of the I<other> keys."
9470 #: ../fish/guestfish-actions.pod:2764
9475 #: ../fish/guestfish-actions.pod:2766
9478 " luks-open device mapname\n"
9483 #: ../fish/guestfish-actions.pod:2768 ../src/guestfs-actions.pod:4113
9485 "This command opens a block device which has been encrypted according to the "
9486 "Linux Unified Key Setup (LUKS) standard."
9490 #: ../fish/guestfish-actions.pod:2771 ../src/guestfs-actions.pod:4116
9491 msgid "C<device> is the encrypted block device or partition."
9495 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4118
9497 "The caller must supply one of the keys associated with the LUKS block "
9498 "device, in the C<key> parameter."
9502 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4121
9504 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
9505 "writes to this block device are decrypted from and encrypted to the "
9506 "underlying C<device> respectively."
9510 #: ../fish/guestfish-actions.pod:2780
9512 "If this block device contains LVM volume groups, then calling L</vgscan> "
9513 "followed by L</vg-activate-all> will make them visible."
9517 #: ../fish/guestfish-actions.pod:2784
9518 msgid "Use L</list-dm-devices> to list all device mapper devices."
9522 #: ../fish/guestfish-actions.pod:2790
9523 msgid "luks-open-ro"
9527 #: ../fish/guestfish-actions.pod:2792
9530 " luks-open-ro device mapname\n"
9535 #: ../fish/guestfish-actions.pod:2794
9537 "This is the same as L</luks-open> except that a read-only mapping is "
9542 #: ../fish/guestfish-actions.pod:2800
9547 #: ../fish/guestfish-actions.pod:2802
9550 " lvcreate logvol volgroup mbytes\n"
9555 #: ../fish/guestfish-actions.pod:2804 ../src/guestfs-actions.pod:4167
9557 "This creates an LVM logical volume called C<logvol> on the volume group "
9558 "C<volgroup>, with C<size> megabytes."
9562 #: ../fish/guestfish-actions.pod:2807
9563 msgid "lvm-canonical-lv-name"
9567 #: ../fish/guestfish-actions.pod:2809
9570 " lvm-canonical-lv-name lvname\n"
9575 #: ../fish/guestfish-actions.pod:2811 ../src/guestfs-actions.pod:4180
9577 "This converts alternative naming schemes for LVs that you might find to the "
9578 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
9583 #: ../fish/guestfish-actions.pod:2815 ../src/guestfs-actions.pod:4184
9585 "This command returns an error if the C<lvname> parameter does not refer to a "
9590 #: ../fish/guestfish-actions.pod:2818
9591 msgid "See also L</is-lv>."
9595 #: ../fish/guestfish-actions.pod:2820
9596 msgid "lvm-clear-filter"
9600 #: ../fish/guestfish-actions.pod:2822
9603 " lvm-clear-filter\n"
9608 #: ../fish/guestfish-actions.pod:2824
9610 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
9615 #: ../fish/guestfish-actions.pod:2827 ../fish/guestfish-actions.pod:2858 ../src/guestfs-actions.pod:4202 ../src/guestfs-actions.pod:4244
9616 msgid "This command also clears the LVM cache and performs a volume group scan."
9620 #: ../fish/guestfish-actions.pod:2830
9621 msgid "lvm-remove-all"
9625 #: ../fish/guestfish-actions.pod:2832
9633 #: ../fish/guestfish-actions.pod:2834 ../src/guestfs-actions.pod:4214
9635 "This command removes all LVM logical volumes, volume groups and physical "
9640 #: ../fish/guestfish-actions.pod:2840
9641 msgid "lvm-set-filter"
9645 #: ../fish/guestfish-actions.pod:2842
9648 " lvm-set-filter 'devices ...'\n"
9653 #: ../fish/guestfish-actions.pod:2844 ../src/guestfs-actions.pod:4230
9655 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9656 "block devices in the list C<devices>, and will ignore all other attached "
9661 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4234
9663 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9664 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9665 "there are two types of duplication possible: either cloned PVs/VGs which "
9666 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9667 "same name. In normal operation you cannot create this situation, but you "
9668 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9669 "inside the LVM metadata."
9673 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4247
9674 msgid "You can filter whole block devices or individual partitions."
9678 #: ../fish/guestfish-actions.pod:2863 ../src/guestfs-actions.pod:4249
9680 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9681 "filesystem), even if you are not filtering out that VG."
9685 #: ../fish/guestfish-actions.pod:2867
9690 #: ../fish/guestfish-actions.pod:2869
9693 " lvremove device\n"
9698 #: ../fish/guestfish-actions.pod:2871 ../src/guestfs-actions.pod:4263
9700 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9701 "LV, such as C</dev/VG/LV>."
9705 #: ../fish/guestfish-actions.pod:2874 ../src/guestfs-actions.pod:4266
9707 "You can also remove all LVs in a volume group by specifying the VG name, "
9712 #: ../fish/guestfish-actions.pod:2877
9717 #: ../fish/guestfish-actions.pod:2879
9720 " lvrename logvol newlogvol\n"
9725 #: ../fish/guestfish-actions.pod:2881 ../src/guestfs-actions.pod:4280
9726 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9730 #: ../fish/guestfish-actions.pod:2883
9735 #: ../fish/guestfish-actions.pod:2885
9738 " lvresize device mbytes\n"
9743 #: ../fish/guestfish-actions.pod:2887 ../src/guestfs-actions.pod:4293
9745 "This resizes (expands or shrinks) an existing LVM logical volume to "
9746 "C<mbytes>. When reducing, data in the reduced part is lost."
9750 #: ../fish/guestfish-actions.pod:2891
9751 msgid "lvresize-free"
9755 #: ../fish/guestfish-actions.pod:2893
9758 " lvresize-free lv percent\n"
9763 #: ../fish/guestfish-actions.pod:2895 ../src/guestfs-actions.pod:4308
9765 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9766 "remaining free space in the volume group. Commonly you would call this with "
9767 "pc = 100 which expands the logical volume as much as possible, using all "
9768 "remaining free space in the volume group."
9772 #: ../fish/guestfish-actions.pod:2901
9777 #: ../fish/guestfish-actions.pod:2903
9785 #: ../fish/guestfish-actions.pod:2905 ../src/guestfs-actions.pod:4323
9787 "List all the logical volumes detected. This is the equivalent of the "
9788 "L<lvs(8)> command."
9792 #: ../fish/guestfish-actions.pod:2908 ../src/guestfs-actions.pod:4326
9794 "This returns a list of the logical volume device names "
9795 "(eg. C</dev/VolGroup00/LogVol00>)."
9799 #: ../fish/guestfish-actions.pod:2911
9800 msgid "See also L</lvs-full>, L</list-filesystems>."
9804 #: ../fish/guestfish-actions.pod:2913
9809 #: ../fish/guestfish-actions.pod:2915
9817 #: ../fish/guestfish-actions.pod:2917 ../src/guestfs-actions.pod:4342
9819 "List all the logical volumes detected. This is the equivalent of the "
9820 "L<lvs(8)> command. The \"full\" version includes all fields."
9824 #: ../fish/guestfish-actions.pod:2920
9829 #: ../fish/guestfish-actions.pod:2922
9837 #: ../fish/guestfish-actions.pod:2924 ../src/guestfs-actions.pod:4357
9838 msgid "This command returns the UUID of the LVM LV C<device>."
9842 #: ../fish/guestfish-actions.pod:2926
9847 #: ../fish/guestfish-actions.pod:2928
9850 " lxattrlist path 'names ...'\n"
9855 #: ../fish/guestfish-actions.pod:2930 ../src/guestfs-actions.pod:4371
9857 "This call allows you to get the extended attributes of multiple files, where "
9858 "all files are in the directory C<path>. C<names> is the list of files from "
9863 #: ../fish/guestfish-actions.pod:2934 ../src/guestfs-actions.pod:4375
9865 "On return you get a flat list of xattr structs which must be interpreted "
9866 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9867 "C<attrval> in this struct is zero-length to indicate there was an error "
9868 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9869 "number (the number of following attributes for this file, which could be "
9870 "C<\"0\">). Then after the first xattr struct are the zero or more "
9871 "attributes for the first named file. This repeats for the second and "
9876 #: ../fish/guestfish-actions.pod:2944
9878 "This call is intended for programs that want to efficiently list a directory "
9879 "contents without making many round-trips. See also L</lstatlist> for a "
9880 "similarly efficient call for getting standard stats. Very long directory "
9881 "listings might cause the protocol message size to be exceeded, causing this "
9882 "call to fail. The caller must split up such requests into smaller groups of "
9887 #: ../fish/guestfish-actions.pod:2952
9892 #: ../fish/guestfish-actions.pod:2954
9900 #: ../fish/guestfish-actions.pod:2956 ../src/guestfs-actions.pod:4405
9901 msgid "Create a directory named C<path>."
9905 #: ../fish/guestfish-actions.pod:2958
9910 #: ../fish/guestfish-actions.pod:2960
9913 " mkdir-mode path mode\n"
9918 #: ../fish/guestfish-actions.pod:2962 ../src/guestfs-actions.pod:4418
9920 "This command creates a directory, setting the initial permissions of the "
9921 "directory to C<mode>."
9925 #: ../fish/guestfish-actions.pod:2965 ../src/guestfs-actions.pod:4421
9927 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9928 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9933 #: ../fish/guestfish-actions.pod:2969
9934 msgid "See also L</mkdir>, L</umask>"
9938 #: ../fish/guestfish-actions.pod:2971
9943 #: ../fish/guestfish-actions.pod:2973
9951 #: ../fish/guestfish-actions.pod:2975 ../src/guestfs-actions.pod:4437
9953 "Create a directory named C<path>, creating any parent directories as "
9954 "necessary. This is like the C<mkdir -p> shell command."
9958 #: ../fish/guestfish-actions.pod:2978
9963 #: ../fish/guestfish-actions.pod:2980
9966 " mkdtemp template\n"
9971 #: ../fish/guestfish-actions.pod:2982 ../src/guestfs-actions.pod:4450
9973 "This command creates a temporary directory. The C<template> parameter "
9974 "should be a full pathname for the temporary directory name with the final "
9975 "six characters being \"XXXXXX\"."
9979 #: ../fish/guestfish-actions.pod:2987 ../src/guestfs-actions.pod:4455
9981 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9982 "being suitable for Windows filesystems."
9986 #: ../fish/guestfish-actions.pod:2990 ../src/guestfs-actions.pod:4458
9987 msgid "The name of the temporary directory that was created is returned."
9991 #: ../fish/guestfish-actions.pod:2993 ../src/guestfs-actions.pod:4461
9992 msgid "The temporary directory is created with mode 0700 and is owned by root."
9996 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4464
9998 "The caller is responsible for deleting the temporary directory and its "
9999 "contents after use."
10003 #: ../fish/guestfish-actions.pod:2999 ../src/guestfs-actions.pod:4467
10004 msgid "See also: L<mkdtemp(3)>"
10008 #: ../fish/guestfish-actions.pod:3001
10013 #: ../fish/guestfish-actions.pod:3003
10016 " mke2fs-J fstype blocksize device journal\n"
10021 #: ../fish/guestfish-actions.pod:3005 ../src/guestfs-actions.pod:4483
10023 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10024 "C<journal>. It is equivalent to the command:"
10028 #: ../fish/guestfish-actions.pod:3009 ../src/guestfs-actions.pod:4487
10031 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10036 #: ../fish/guestfish-actions.pod:3011
10037 msgid "See also L</mke2journal>."
10041 #: ../fish/guestfish-actions.pod:3013
10046 #: ../fish/guestfish-actions.pod:3015
10049 " mke2fs-JL fstype blocksize device label\n"
10054 #: ../fish/guestfish-actions.pod:3017 ../src/guestfs-actions.pod:4504
10056 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10057 "the journal labeled C<label>."
10061 #: ../fish/guestfish-actions.pod:3020
10062 msgid "See also L</mke2journal-L>."
10066 #: ../fish/guestfish-actions.pod:3022
10071 #: ../fish/guestfish-actions.pod:3024
10074 " mke2fs-JU fstype blocksize device uuid\n"
10079 #: ../fish/guestfish-actions.pod:3026 ../src/guestfs-actions.pod:4522
10081 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10082 "the journal with UUID C<uuid>."
10086 #: ../fish/guestfish-actions.pod:3029
10087 msgid "See also L</mke2journal-U>."
10091 #: ../fish/guestfish-actions.pod:3031
10092 msgid "mke2journal"
10096 #: ../fish/guestfish-actions.pod:3033
10099 " mke2journal blocksize device\n"
10104 #: ../fish/guestfish-actions.pod:3035 ../src/guestfs-actions.pod:4538
10106 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10111 #: ../fish/guestfish-actions.pod:3038 ../src/guestfs-actions.pod:4541
10114 " mke2fs -O journal_dev -b blocksize device\n"
10119 #: ../fish/guestfish-actions.pod:3040
10120 msgid "mke2journal-L"
10124 #: ../fish/guestfish-actions.pod:3042
10127 " mke2journal-L blocksize label device\n"
10132 #: ../fish/guestfish-actions.pod:3044 ../src/guestfs-actions.pod:4555
10133 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10137 #: ../fish/guestfish-actions.pod:3046
10138 msgid "mke2journal-U"
10142 #: ../fish/guestfish-actions.pod:3048
10145 " mke2journal-U blocksize uuid device\n"
10150 #: ../fish/guestfish-actions.pod:3050 ../src/guestfs-actions.pod:4569
10151 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10155 #: ../fish/guestfish-actions.pod:3052
10160 #: ../fish/guestfish-actions.pod:3054
10163 " mkfifo mode path\n"
10168 #: ../fish/guestfish-actions.pod:3056
10170 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10171 "is just a convenient wrapper around L</mknod>."
10175 #: ../fish/guestfish-actions.pod:3062
10180 #: ../fish/guestfish-actions.pod:3064
10183 " mkfs fstype device\n"
10188 #: ../fish/guestfish-actions.pod:3066 ../src/guestfs-actions.pod:4599
10190 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10191 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10195 #: ../fish/guestfish-actions.pod:3070
10200 #: ../fish/guestfish-actions.pod:3072
10203 " mkfs-b fstype blocksize device\n"
10208 #: ../fish/guestfish-actions.pod:3074
10210 "This call is similar to L</mkfs>, but it allows you to control the block "
10211 "size of the resulting filesystem. Supported block sizes depend on the "
10212 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10216 #: ../fish/guestfish-actions.pod:3079 ../fish/guestfish-actions.pod:3106 ../src/guestfs-actions.pod:4620 ../src/guestfs-actions.pod:4665
10218 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10223 #: ../fish/guestfish-actions.pod:3082 ../src/guestfs-actions.pod:4625
10225 "This function is deprecated. In new code, use the C<mkfs_opts> call "
10230 #: ../fish/guestfish-actions.pod:3089
10235 #: ../fish/guestfish-actions.pod:3091
10238 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
10239 "[sectorsize:..]\n"
10244 #: ../fish/guestfish-actions.pod:3093 ../src/guestfs-actions.pod:4652
10246 "This function creates a filesystem on C<device>. The filesystem type is "
10247 "C<fstype>, for example C<ext3>."
10251 #: ../fish/guestfish-actions.pod:3100 ../src/guestfs-actions.pod:4659
10252 msgid "C<blocksize>"
10256 #: ../fish/guestfish-actions.pod:3102 ../src/guestfs-actions.pod:4661
10258 "The filesystem block size. Supported block sizes depend on the filesystem "
10259 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
10264 #: ../fish/guestfish-actions.pod:3109 ../src/guestfs-actions.pod:4668
10265 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
10269 #: ../fish/guestfish-actions.pod:3111 ../src/guestfs-actions.pod:4670
10270 msgid "C<features>"
10274 #: ../fish/guestfish-actions.pod:3113 ../src/guestfs-actions.pod:4672
10275 msgid "This passes the I<-O> parameter to the external mkfs program."
10279 #: ../fish/guestfish-actions.pod:3115 ../src/guestfs-actions.pod:4674
10281 "For certain filesystem types, this allows extra filesystem features to be "
10282 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
10286 #: ../fish/guestfish-actions.pod:3119 ../src/guestfs-actions.pod:4678
10288 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
10293 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4681
10298 #: ../fish/guestfish-actions.pod:3124 ../src/guestfs-actions.pod:4683
10300 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
10301 "sets the inode size (only for ext2/3/4 filesystems at present)."
10305 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4686
10306 msgid "C<sectorsize>"
10310 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4688
10312 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
10313 "sets sector size for ufs filesystem."
10317 #: ../fish/guestfish-actions.pod:3136
10318 msgid "mkmountpoint"
10322 #: ../fish/guestfish-actions.pod:3138
10325 " mkmountpoint exemptpath\n"
10330 #: ../fish/guestfish-actions.pod:3140
10332 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
10333 "to create extra mountpoints before mounting the first filesystem."
10337 #: ../fish/guestfish-actions.pod:3144 ../src/guestfs-actions.pod:4731
10339 "These calls are I<only> necessary in some very limited circumstances, mainly "
10340 "the case where you want to mount a mix of unrelated and/or read-only "
10341 "filesystems together."
10345 #: ../fish/guestfish-actions.pod:3148 ../src/guestfs-actions.pod:4735
10347 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10348 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10349 "inside that. You can unpack this as follows in guestfish:"
10353 #: ../fish/guestfish-actions.pod:3153 ../src/guestfs-actions.pod:4740
10356 " add-ro Fedora-11-i686-Live.iso\n"
10358 " mkmountpoint /cd\n"
10359 " mkmountpoint /sqsh\n"
10360 " mkmountpoint /ext3fs\n"
10361 " mount /dev/sda /cd\n"
10362 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10363 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10368 #: ../fish/guestfish-actions.pod:3162 ../src/guestfs-actions.pod:4749
10369 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10373 #: ../fish/guestfish-actions.pod:3164
10375 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
10376 "unexpected errors if you try to mix these calls. It is safest to manually "
10377 "unmount filesystems and remove mountpoints after use."
10381 #: ../fish/guestfish-actions.pod:3168
10383 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
10384 "for this to work for manual mountpoints, you must ensure that the innermost "
10385 "mountpoints have the longest pathnames, as in the example code above."
10389 #: ../fish/guestfish-actions.pod:3173 ../src/guestfs-actions.pod:4760
10390 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10394 #: ../fish/guestfish-actions.pod:3175
10396 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
10397 "L</umount-all> to be called when the handle is closed which can also trigger "
10402 #: ../fish/guestfish-actions.pod:3179
10407 #: ../fish/guestfish-actions.pod:3181
10410 " mknod mode devmajor devminor path\n"
10415 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4779
10417 "This call creates block or character special devices, or named pipes "
10422 #: ../fish/guestfish-actions.pod:3186 ../src/guestfs-actions.pod:4782
10424 "The C<mode> parameter should be the mode, using the standard constants. "
10425 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10426 "used when creating block and character special devices."
10430 #: ../fish/guestfish-actions.pod:3191
10432 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10433 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10434 "regular file). These constants are available in the standard Linux header "
10435 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
10436 "wrappers around this command which bitwise OR in the appropriate constant "
10441 #: ../fish/guestfish-actions.pod:3201
10446 #: ../fish/guestfish-actions.pod:3203
10449 " mknod-b mode devmajor devminor path\n"
10454 #: ../fish/guestfish-actions.pod:3205
10456 "This call creates a block device node called C<path> with mode C<mode> and "
10457 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10458 "wrapper around L</mknod>."
10462 #: ../fish/guestfish-actions.pod:3211
10467 #: ../fish/guestfish-actions.pod:3213
10470 " mknod-c mode devmajor devminor path\n"
10475 #: ../fish/guestfish-actions.pod:3215
10477 "This call creates a char device node called C<path> with mode C<mode> and "
10478 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10479 "wrapper around L</mknod>."
10483 #: ../fish/guestfish-actions.pod:3221
10488 #: ../fish/guestfish-actions.pod:3223
10496 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4845
10497 msgid "Create a swap partition on C<device>."
10501 #: ../fish/guestfish-actions.pod:3227
10506 #: ../fish/guestfish-actions.pod:3229
10509 " mkswap-L label device\n"
10514 #: ../fish/guestfish-actions.pod:3231 ../src/guestfs-actions.pod:4858
10515 msgid "Create a swap partition on C<device> with label C<label>."
10519 #: ../fish/guestfish-actions.pod:3233 ../src/guestfs-actions.pod:4860
10521 "Note that you cannot attach a swap label to a block device "
10522 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
10523 "the kernel or swap tools."
10527 #: ../fish/guestfish-actions.pod:3237
10532 #: ../fish/guestfish-actions.pod:3239
10535 " mkswap-U uuid device\n"
10540 #: ../fish/guestfish-actions.pod:3241 ../src/guestfs-actions.pod:4875
10541 msgid "Create a swap partition on C<device> with UUID C<uuid>."
10545 #: ../fish/guestfish-actions.pod:3243
10546 msgid "mkswap-file"
10550 #: ../fish/guestfish-actions.pod:3245
10553 " mkswap-file path\n"
10558 #: ../fish/guestfish-actions.pod:3247 ../src/guestfs-actions.pod:4887
10559 msgid "Create a swap file."
10563 #: ../fish/guestfish-actions.pod:3249
10565 "This command just writes a swap file signature to an existing file. To "
10566 "create the file itself, use something like L</fallocate>."
10570 #: ../fish/guestfish-actions.pod:3252
10575 #: ../fish/guestfish-actions.pod:3254
10578 " modprobe modulename\n"
10583 #: ../fish/guestfish-actions.pod:3256 ../src/guestfs-actions.pod:4902
10584 msgid "This loads a kernel module in the appliance."
10588 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4904
10590 "The kernel module must have been whitelisted when libguestfs was built (see "
10591 "C<appliance/kmod.whitelist.in> in the source)."
10595 #: ../fish/guestfish-actions.pod:3261
10600 #: ../fish/guestfish-actions.pod:3263
10603 " mount device mountpoint\n"
10608 #: ../fish/guestfish-actions.pod:3265 ../src/guestfs-actions.pod:4918
10610 "Mount a guest disk at a position in the filesystem. Block devices are named "
10611 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
10612 "those block devices contain partitions, they will have the usual names "
10613 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
10617 #: ../fish/guestfish-actions.pod:3271 ../src/guestfs-actions.pod:4924
10619 "The rules are the same as for L<mount(2)>: A filesystem must first be "
10620 "mounted on C</> before others can be mounted. Other filesystems can only be "
10621 "mounted on directories which already exist."
10625 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4929
10627 "The mounted filesystem is writable, if we have sufficient permissions on the "
10628 "underlying device."
10632 #: ../fish/guestfish-actions.pod:3279
10634 "B<Important note:> When you use this call, the filesystem options C<sync> "
10635 "and C<noatime> are set implicitly. This was originally done because we "
10636 "thought it would improve reliability, but it turns out that I<-o sync> has a "
10637 "very large negative performance impact and negligible effect on "
10638 "reliability. Therefore we recommend that you avoid using L</mount> in any "
10639 "code that needs performance, and instead use L</mount-options> (use an empty "
10640 "string for the first parameter if you don't want any options)."
10644 #: ../fish/guestfish-actions.pod:3289 ../src/guestfs-actions.pod:4944
10646 "This function is deprecated. In new code, use the C<mount_options> call "
10651 #: ../fish/guestfish-actions.pod:3296
10656 #: ../fish/guestfish-actions.pod:3298
10659 " mount-9p mounttag mountpoint [options:..]\n"
10664 #: ../fish/guestfish-actions.pod:3300 ../src/guestfs-actions.pod:4968
10666 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
10671 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:4971
10673 "If required, C<trans=virtio> will be automatically added to the options. "
10674 "Any other options required can be passed in the optional C<options> "
10679 #: ../fish/guestfish-actions.pod:3309
10684 #: ../fish/guestfish-actions.pod:3311
10687 " mount-loop file mountpoint\n"
10692 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5010
10694 "This command lets you mount C<file> (a filesystem image in a file) on a "
10695 "mount point. It is entirely equivalent to the command C<mount -o loop file "
10700 #: ../fish/guestfish-actions.pod:3317
10701 msgid "mount-options"
10705 #: ../fish/guestfish-actions.pod:3319
10708 " mount-options options device mountpoint\n"
10713 #: ../fish/guestfish-actions.pod:3321
10715 "This is the same as the L</mount> command, but it allows you to set the "
10716 "mount options as for the L<mount(8)> I<-o> flag."
10720 #: ../fish/guestfish-actions.pod:3325 ../src/guestfs-actions.pod:5030
10722 "If the C<options> parameter is an empty string, then no options are passed "
10723 "(all options default to whatever the filesystem uses)."
10727 #: ../fish/guestfish-actions.pod:3329
10732 #: ../fish/guestfish-actions.pod:3331
10735 " mount-ro device mountpoint\n"
10740 #: ../fish/guestfish-actions.pod:3333
10742 "This is the same as the L</mount> command, but it mounts the filesystem with "
10743 "the read-only (I<-o ro>) flag."
10747 #: ../fish/guestfish-actions.pod:3336
10752 #: ../fish/guestfish-actions.pod:3338
10755 " mount-vfs options vfstype device mountpoint\n"
10760 #: ../fish/guestfish-actions.pod:3340
10762 "This is the same as the L</mount> command, but it allows you to set both the "
10763 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
10767 #: ../fish/guestfish-actions.pod:3344
10768 msgid "mountpoints"
10772 #: ../fish/guestfish-actions.pod:3346
10780 #: ../fish/guestfish-actions.pod:3348
10782 "This call is similar to L</mounts>. That call returns a list of devices. "
10783 "This one returns a hash table (map) of device name to directory where the "
10784 "device is mounted."
10788 #: ../fish/guestfish-actions.pod:3352
10793 #: ../fish/guestfish-actions.pod:3354
10801 #: ../fish/guestfish-actions.pod:3356 ../src/guestfs-actions.pod:5091
10803 "This returns the list of currently mounted filesystems. It returns the list "
10804 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10808 #: ../fish/guestfish-actions.pod:3359 ../src/guestfs-actions.pod:5094
10809 msgid "Some internal mounts are not shown."
10813 #: ../fish/guestfish-actions.pod:3361
10814 msgid "See also: L</mountpoints>"
10818 #: ../fish/guestfish-actions.pod:3363
10823 #: ../fish/guestfish-actions.pod:3365
10831 #: ../fish/guestfish-actions.pod:3367 ../src/guestfs-actions.pod:5111
10833 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10834 "destination filename or destination directory."
10838 #: ../fish/guestfish-actions.pod:3370
10839 msgid "ntfs-3g-probe"
10843 #: ../fish/guestfish-actions.pod:3372
10846 " ntfs-3g-probe true|false device\n"
10851 #: ../fish/guestfish-actions.pod:3374 ../src/guestfs-actions.pod:5125
10853 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10854 "C<device> for mountability. (Not all NTFS volumes can be mounted "
10855 "read-write, and some cannot be mounted at all)."
10859 #: ../fish/guestfish-actions.pod:3378 ../src/guestfs-actions.pod:5129
10861 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10862 "can be mounted read-write. Set it to false if you want to test if the "
10863 "volume can be mounted read-only."
10867 #: ../fish/guestfish-actions.pod:3382 ../src/guestfs-actions.pod:5133
10869 "The return value is an integer which C<0> if the operation would succeed, or "
10870 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10874 #: ../fish/guestfish-actions.pod:3386
10879 #: ../fish/guestfish-actions.pod:3388
10882 " ntfsresize device\n"
10887 #: ../fish/guestfish-actions.pod:3390 ../fish/guestfish-actions.pod:3414 ../src/guestfs-actions.pod:5147 ../src/guestfs-actions.pod:5186
10889 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10890 "size of the underlying device."
10894 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5150
10896 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
10897 "consistency check (for safety). You have to boot into Windows to perform "
10898 "this check and clear this condition. Furthermore, ntfsresize refuses to "
10899 "resize filesystems which have been marked in this way. So in effect it is "
10900 "not possible to call ntfsresize multiple times on a single filesystem "
10901 "without booting into Windows between each resize."
10905 #: ../fish/guestfish-actions.pod:3401 ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5158 ../src/guestfs-actions.pod:5212
10906 msgid "See also L<ntfsresize(8)>."
10910 #: ../fish/guestfish-actions.pod:3403 ../fish/guestfish-actions.pod:3451 ../src/guestfs-actions.pod:5162 ../src/guestfs-actions.pod:5252
10912 "This function is deprecated. In new code, use the C<ntfsresize_opts> call "
10917 #: ../fish/guestfish-actions.pod:3410
10918 msgid "ntfsresize-opts"
10922 #: ../fish/guestfish-actions.pod:3412
10925 " ntfsresize-opts device [size:..] [force:..]\n"
10930 #: ../fish/guestfish-actions.pod:3423 ../src/guestfs-actions.pod:5195
10932 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
10933 "resized to fit the container (eg. partition)."
10937 #: ../fish/guestfish-actions.pod:3426 ../src/guestfs-actions.pod:5198
10942 #: ../fish/guestfish-actions.pod:3428 ../src/guestfs-actions.pod:5200
10944 "If this option is true, then force the resize of the filesystem even if the "
10945 "filesystem is marked as requiring a consistency check."
10949 #: ../fish/guestfish-actions.pod:3431
10951 "After the resize operation, the filesystem is always marked as requiring a "
10952 "consistency check (for safety). You have to boot into Windows to perform "
10953 "this check and clear this condition. If you I<don't> set the C<force> "
10954 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
10955 "a single filesystem without booting into Windows between each resize."
10959 #: ../fish/guestfish-actions.pod:3444
10960 msgid "ntfsresize-size"
10964 #: ../fish/guestfish-actions.pod:3446
10967 " ntfsresize-size device size\n"
10972 #: ../fish/guestfish-actions.pod:3448
10974 "This command is the same as L</ntfsresize> except that it allows you to "
10975 "specify the new size (in bytes) explicitly."
10979 #: ../fish/guestfish-actions.pod:3458
10984 #: ../fish/guestfish-actions.pod:3460
10987 " part-add device prlogex startsect endsect\n"
10992 #: ../fish/guestfish-actions.pod:3462
10994 "This command adds a partition to C<device>. If there is no partition table "
10995 "on the device, call L</part-init> first."
10999 #: ../fish/guestfish-actions.pod:3465 ../src/guestfs-actions.pod:5273
11001 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11002 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11003 "C<logical>) and C<e> (or C<extended>) partition types."
11007 #: ../fish/guestfish-actions.pod:3470 ../src/guestfs-actions.pod:5278
11009 "C<startsect> and C<endsect> are the start and end of the partition in "
11010 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11011 "from the end of the disk (C<-1> is the last sector)."
11015 #: ../fish/guestfish-actions.pod:3474
11017 "Creating a partition which covers the whole disk is not so easy. Use "
11018 "L</part-disk> to do that."
11022 #: ../fish/guestfish-actions.pod:3477
11027 #: ../fish/guestfish-actions.pod:3479
11030 " part-del device partnum\n"
11035 #: ../fish/guestfish-actions.pod:3481 ../src/guestfs-actions.pod:5296
11036 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11040 #: ../fish/guestfish-actions.pod:3483 ../src/guestfs-actions.pod:5298
11042 "Note that in the case of MBR partitioning, deleting an extended partition "
11043 "also deletes any logical partitions it contains."
11047 #: ../fish/guestfish-actions.pod:3487
11052 #: ../fish/guestfish-actions.pod:3489
11055 " part-disk device parttype\n"
11060 #: ../fish/guestfish-actions.pod:3491
11062 "This command is simply a combination of L</part-init> followed by "
11063 "L</part-add> to create a single primary partition covering the whole disk."
11067 #: ../fish/guestfish-actions.pod:3495
11069 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11070 "possible values are described in L</part-init>."
11074 #: ../fish/guestfish-actions.pod:3501
11075 msgid "part-get-bootable"
11079 #: ../fish/guestfish-actions.pod:3503
11082 " part-get-bootable device partnum\n"
11087 #: ../fish/guestfish-actions.pod:3505 ../src/guestfs-actions.pod:5334
11089 "This command returns true if the partition C<partnum> on C<device> has the "
11090 "bootable flag set."
11094 #: ../fish/guestfish-actions.pod:3508
11095 msgid "See also L</part-set-bootable>."
11099 #: ../fish/guestfish-actions.pod:3510
11100 msgid "part-get-mbr-id"
11104 #: ../fish/guestfish-actions.pod:3512
11107 " part-get-mbr-id device partnum\n"
11112 #: ../fish/guestfish-actions.pod:3514 ../src/guestfs-actions.pod:5350
11114 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11115 "partition C<partnum>."
11119 #: ../fish/guestfish-actions.pod:3517 ../fish/guestfish-actions.pod:3661
11121 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11122 "undefined results for other partition table types (see "
11123 "L</part-get-parttype>)."
11127 #: ../fish/guestfish-actions.pod:3521
11128 msgid "part-get-parttype"
11132 #: ../fish/guestfish-actions.pod:3523
11135 " part-get-parttype device\n"
11140 #: ../fish/guestfish-actions.pod:3525 ../src/guestfs-actions.pod:5367
11142 "This command examines the partition table on C<device> and returns the "
11143 "partition table type (format) being used."
11147 #: ../fish/guestfish-actions.pod:3528
11149 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11150 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11151 "possible, although unusual. See L</part-init> for a full list."
11155 #: ../fish/guestfish-actions.pod:3533
11160 #: ../fish/guestfish-actions.pod:3535
11163 " part-init device parttype\n"
11168 #: ../fish/guestfish-actions.pod:3537 ../src/guestfs-actions.pod:5387
11170 "This creates an empty partition table on C<device> of one of the partition "
11171 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11172 "(for large disks)."
11176 #: ../fish/guestfish-actions.pod:3541
11178 "Initially there are no partitions. Following this, you should call "
11179 "L</part-add> for each partition required."
11183 #: ../fish/guestfish-actions.pod:3544 ../src/guestfs-actions.pod:5394
11184 msgid "Possible values for C<parttype> are:"
11188 #: ../fish/guestfish-actions.pod:3548 ../src/guestfs-actions.pod:5398
11193 #: ../fish/guestfish-actions.pod:3550 ../src/guestfs-actions.pod:5400
11198 #: ../fish/guestfish-actions.pod:3552 ../src/guestfs-actions.pod:5402
11199 msgid "Intel EFI / GPT partition table."
11203 #: ../fish/guestfish-actions.pod:3554 ../src/guestfs-actions.pod:5404
11205 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11206 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11207 "the C<mbr> format."
11211 #: ../fish/guestfish-actions.pod:3558 ../src/guestfs-actions.pod:5408
11216 #: ../fish/guestfish-actions.pod:3560 ../src/guestfs-actions.pod:5410
11221 #: ../fish/guestfish-actions.pod:3562 ../src/guestfs-actions.pod:5412
11223 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11224 "Windows. This partition type will B<only> work for device sizes up to 2 "
11225 "TB. For large disks we recommend using C<gpt>."
11229 #: ../fish/guestfish-actions.pod:3569 ../src/guestfs-actions.pod:5419
11230 msgid "Other partition table types that may work but are not supported include:"
11234 #: ../fish/guestfish-actions.pod:3574 ../src/guestfs-actions.pod:5424
11239 #: ../fish/guestfish-actions.pod:3576 ../src/guestfs-actions.pod:5426
11240 msgid "AIX disk labels."
11244 #: ../fish/guestfish-actions.pod:3578 ../src/guestfs-actions.pod:5428
11249 #: ../fish/guestfish-actions.pod:3580 ../src/guestfs-actions.pod:5430
11254 #: ../fish/guestfish-actions.pod:3582 ../src/guestfs-actions.pod:5432
11255 msgid "Amiga \"Rigid Disk Block\" format."
11259 #: ../fish/guestfish-actions.pod:3584 ../src/guestfs-actions.pod:5434
11264 #: ../fish/guestfish-actions.pod:3586 ../src/guestfs-actions.pod:5436
11265 msgid "BSD disk labels."
11269 #: ../fish/guestfish-actions.pod:3588 ../src/guestfs-actions.pod:5438
11274 #: ../fish/guestfish-actions.pod:3590 ../src/guestfs-actions.pod:5440
11275 msgid "DASD, used on IBM mainframes."
11279 #: ../fish/guestfish-actions.pod:3592 ../src/guestfs-actions.pod:5442
11284 #: ../fish/guestfish-actions.pod:3594 ../src/guestfs-actions.pod:5444
11285 msgid "MIPS/SGI volumes."
11289 #: ../fish/guestfish-actions.pod:3596 ../src/guestfs-actions.pod:5446
11294 #: ../fish/guestfish-actions.pod:3598 ../src/guestfs-actions.pod:5448
11295 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11299 #: ../fish/guestfish-actions.pod:3600 ../src/guestfs-actions.pod:5450
11304 #: ../fish/guestfish-actions.pod:3602 ../src/guestfs-actions.pod:5452
11305 msgid "NEC PC-98 format, common in Japan apparently."
11309 #: ../fish/guestfish-actions.pod:3604 ../src/guestfs-actions.pod:5454
11314 #: ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:5456
11315 msgid "Sun disk labels."
11319 #: ../fish/guestfish-actions.pod:3610
11324 #: ../fish/guestfish-actions.pod:3612
11327 " part-list device\n"
11332 #: ../fish/guestfish-actions.pod:3614 ../src/guestfs-actions.pod:5470
11334 "This command parses the partition table on C<device> and returns the list of "
11335 "partitions found."
11339 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5473
11340 msgid "The fields in the returned structure are:"
11344 #: ../fish/guestfish-actions.pod:3621 ../src/guestfs-actions.pod:5477
11345 msgid "B<part_num>"
11349 #: ../fish/guestfish-actions.pod:3623 ../src/guestfs-actions.pod:5479
11350 msgid "Partition number, counting from 1."
11354 #: ../fish/guestfish-actions.pod:3625 ../src/guestfs-actions.pod:5481
11355 msgid "B<part_start>"
11359 #: ../fish/guestfish-actions.pod:3627
11361 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11362 "the device's sector size, see L</blockdev-getss>."
11366 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5486
11367 msgid "B<part_end>"
11371 #: ../fish/guestfish-actions.pod:3632 ../src/guestfs-actions.pod:5488
11372 msgid "End of the partition in bytes."
11376 #: ../fish/guestfish-actions.pod:3634 ../src/guestfs-actions.pod:5490
11377 msgid "B<part_size>"
11381 #: ../fish/guestfish-actions.pod:3636 ../src/guestfs-actions.pod:5492
11382 msgid "Size of the partition in bytes."
11386 #: ../fish/guestfish-actions.pod:3640
11387 msgid "part-set-bootable"
11391 #: ../fish/guestfish-actions.pod:3642
11394 " part-set-bootable device partnum true|false\n"
11399 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5510
11401 "This sets the bootable flag on partition numbered C<partnum> on device "
11402 "C<device>. Note that partitions are numbered from 1."
11406 #: ../fish/guestfish-actions.pod:3647 ../src/guestfs-actions.pod:5513
11408 "The bootable flag is used by some operating systems (notably Windows) to "
11409 "determine which partition to boot from. It is by no means universally "
11414 #: ../fish/guestfish-actions.pod:3651
11415 msgid "part-set-mbr-id"
11419 #: ../fish/guestfish-actions.pod:3653
11422 " part-set-mbr-id device partnum idbyte\n"
11427 #: ../fish/guestfish-actions.pod:3655 ../src/guestfs-actions.pod:5529
11429 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11430 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11431 "documentation are in fact hexadecimal numbers, but usually documented "
11432 "without any leading \"0x\" which might be confusing."
11436 #: ../fish/guestfish-actions.pod:3665
11437 msgid "part-set-name"
11441 #: ../fish/guestfish-actions.pod:3667
11444 " part-set-name device partnum name\n"
11449 #: ../fish/guestfish-actions.pod:3669 ../src/guestfs-actions.pod:5551
11451 "This sets the partition name on partition numbered C<partnum> on device "
11452 "C<device>. Note that partitions are numbered from 1."
11456 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5554
11458 "The partition name can only be set on certain types of partition table. "
11459 "This works on C<gpt> but not on C<mbr> partitions."
11463 #: ../fish/guestfish-actions.pod:3675
11464 msgid "part-to-dev"
11468 #: ../fish/guestfish-actions.pod:3677
11471 " part-to-dev partition\n"
11476 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5567
11478 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
11479 "partition number, returning the device name (eg. \"/dev/sdb\")."
11483 #: ../fish/guestfish-actions.pod:3683
11485 "The named partition must exist, for example as a string returned from "
11486 "L</list-partitions>."
11490 #: ../fish/guestfish-actions.pod:3686
11491 msgid "ping-daemon"
11495 #: ../fish/guestfish-actions.pod:3688
11503 #: ../fish/guestfish-actions.pod:3690 ../src/guestfs-actions.pod:5584
11505 "This is a test probe into the guestfs daemon running inside the qemu "
11506 "subprocess. Calling this function checks that the daemon responds to the "
11507 "ping message, without affecting the daemon or attached block device(s) in "
11512 #: ../fish/guestfish-actions.pod:3695
11517 #: ../fish/guestfish-actions.pod:3697
11520 " pread path count offset\n"
11525 #: ../fish/guestfish-actions.pod:3699 ../src/guestfs-actions.pod:5602
11527 "This command lets you read part of a file. It reads C<count> bytes of the "
11528 "file, starting at C<offset>, from file C<path>."
11532 #: ../fish/guestfish-actions.pod:3702 ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5605 ../src/guestfs-actions.pod:5631
11534 "This may read fewer bytes than requested. For further details see the "
11535 "L<pread(2)> system call."
11539 #: ../fish/guestfish-actions.pod:3705
11540 msgid "See also L</pwrite>, L</pread-device>."
11544 #: ../fish/guestfish-actions.pod:3710
11545 msgid "pread-device"
11549 #: ../fish/guestfish-actions.pod:3712
11552 " pread-device device count offset\n"
11557 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5628
11559 "This command lets you read part of a file. It reads C<count> bytes of "
11560 "C<device>, starting at C<offset>."
11564 #: ../fish/guestfish-actions.pod:3720
11565 msgid "See also L</pread>."
11569 #: ../fish/guestfish-actions.pod:3725
11574 #: ../fish/guestfish-actions.pod:3727
11577 " pvcreate device\n"
11582 #: ../fish/guestfish-actions.pod:3729 ../src/guestfs-actions.pod:5651
11584 "This creates an LVM physical volume on the named C<device>, where C<device> "
11585 "should usually be a partition name such as C</dev/sda1>."
11589 #: ../fish/guestfish-actions.pod:3733
11594 #: ../fish/guestfish-actions.pod:3735
11597 " pvremove device\n"
11602 #: ../fish/guestfish-actions.pod:3737 ../src/guestfs-actions.pod:5665
11604 "This wipes a physical volume C<device> so that LVM will no longer recognise "
11609 #: ../fish/guestfish-actions.pod:3740 ../src/guestfs-actions.pod:5668
11611 "The implementation uses the C<pvremove> command which refuses to wipe "
11612 "physical volumes that contain any volume groups, so you have to remove those "
11617 #: ../fish/guestfish-actions.pod:3744
11622 #: ../fish/guestfish-actions.pod:3746
11625 " pvresize device\n"
11630 #: ../fish/guestfish-actions.pod:3748 ../src/guestfs-actions.pod:5682
11632 "This resizes (expands or shrinks) an existing LVM physical volume to match "
11633 "the new size of the underlying device."
11637 #: ../fish/guestfish-actions.pod:3751
11638 msgid "pvresize-size"
11642 #: ../fish/guestfish-actions.pod:3753
11645 " pvresize-size device size\n"
11650 #: ../fish/guestfish-actions.pod:3755
11652 "This command is the same as L</pvresize> except that it allows you to "
11653 "specify the new size (in bytes) explicitly."
11657 #: ../fish/guestfish-actions.pod:3758
11662 #: ../fish/guestfish-actions.pod:3760
11670 #: ../fish/guestfish-actions.pod:3762 ../src/guestfs-actions.pod:5708
11672 "List all the physical volumes detected. This is the equivalent of the "
11673 "L<pvs(8)> command."
11677 #: ../fish/guestfish-actions.pod:3765 ../src/guestfs-actions.pod:5711
11679 "This returns a list of just the device names that contain PVs "
11680 "(eg. C</dev/sda2>)."
11684 #: ../fish/guestfish-actions.pod:3768
11685 msgid "See also L</pvs-full>."
11689 #: ../fish/guestfish-actions.pod:3770
11694 #: ../fish/guestfish-actions.pod:3772
11702 #: ../fish/guestfish-actions.pod:3774 ../src/guestfs-actions.pod:5727
11704 "List all the physical volumes detected. This is the equivalent of the "
11705 "L<pvs(8)> command. The \"full\" version includes all fields."
11709 #: ../fish/guestfish-actions.pod:3777
11714 #: ../fish/guestfish-actions.pod:3779
11722 #: ../fish/guestfish-actions.pod:3781 ../src/guestfs-actions.pod:5742
11723 msgid "This command returns the UUID of the LVM PV C<device>."
11727 #: ../fish/guestfish-actions.pod:3783
11732 #: ../fish/guestfish-actions.pod:3785
11735 " pwrite path content offset\n"
11740 #: ../fish/guestfish-actions.pod:3787 ../src/guestfs-actions.pod:5758
11742 "This command writes to part of a file. It writes the data buffer C<content> "
11743 "to the file C<path> starting at offset C<offset>."
11747 #: ../fish/guestfish-actions.pod:3790 ../src/guestfs-actions.pod:5761
11749 "This command implements the L<pwrite(2)> system call, and like that system "
11750 "call it may not write the full data requested. The return value is the "
11751 "number of bytes that were actually written to the file. This could even be "
11752 "0, although short writes are unlikely for regular files in ordinary "
11757 #: ../fish/guestfish-actions.pod:3796
11758 msgid "See also L</pread>, L</pwrite-device>."
11762 #: ../fish/guestfish-actions.pod:3801
11763 msgid "pwrite-device"
11767 #: ../fish/guestfish-actions.pod:3803
11770 " pwrite-device device content offset\n"
11775 #: ../fish/guestfish-actions.pod:3805 ../src/guestfs-actions.pod:5785
11777 "This command writes to part of a device. It writes the data buffer "
11778 "C<content> to C<device> starting at offset C<offset>."
11782 #: ../fish/guestfish-actions.pod:3808 ../src/guestfs-actions.pod:5788
11784 "This command implements the L<pwrite(2)> system call, and like that system "
11785 "call it may not write the full data requested (although short writes to disk "
11786 "devices and partitions are probably impossible with standard Linux kernels)."
11790 #: ../fish/guestfish-actions.pod:3813
11791 msgid "See also L</pwrite>."
11795 #: ../fish/guestfish-actions.pod:3818
11800 #: ../fish/guestfish-actions.pod:3820
11803 " read-file path\n"
11808 #: ../fish/guestfish-actions.pod:3822 ../src/guestfs-actions.pod:5809
11809 msgid "This calls returns the contents of the file C<path> as a buffer."
11813 #: ../fish/guestfish-actions.pod:3825
11815 "Unlike L</cat>, this function can correctly handle files that contain "
11816 "embedded ASCII NUL characters. However unlike L</download>, this function "
11817 "is limited in the total size of file that can be handled."
11821 #: ../fish/guestfish-actions.pod:3833
11826 #: ../fish/guestfish-actions.pod:3835
11829 " read-lines path\n"
11834 #: ../fish/guestfish-actions.pod:3839 ../src/guestfs-actions.pod:5834
11836 "The file contents are returned as a list of lines. Trailing C<LF> and "
11837 "C<CRLF> character sequences are I<not> returned."
11841 #: ../fish/guestfish-actions.pod:3842
11843 "Note that this function cannot correctly handle binary files (specifically, "
11844 "files containing C<\\0> character which is treated as end of line). For "
11845 "those you need to use the L</read-file> function which has a more complex "
11850 #: ../fish/guestfish-actions.pod:3847
11855 #: ../fish/guestfish-actions.pod:3849
11863 #: ../fish/guestfish-actions.pod:3851 ../src/guestfs-actions.pod:5854
11864 msgid "This returns the list of directory entries in directory C<dir>."
11868 #: ../fish/guestfish-actions.pod:3853 ../src/guestfs-actions.pod:5856
11870 "All entries in the directory are returned, including C<.> and C<..>. The "
11871 "entries are I<not> sorted, but returned in the same order as the underlying "
11876 #: ../fish/guestfish-actions.pod:3857 ../src/guestfs-actions.pod:5860
11878 "Also this call returns basic file type information about each file. The "
11879 "C<ftyp> field will contain one of the following characters:"
11883 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:5865
11888 #: ../fish/guestfish-actions.pod:3864 ../src/guestfs-actions.pod:5867
11889 msgid "Block special"
11893 #: ../fish/guestfish-actions.pod:3866 ../src/guestfs-actions.pod:5869
11898 #: ../fish/guestfish-actions.pod:3868 ../src/guestfs-actions.pod:5871
11899 msgid "Char special"
11903 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5873
11908 #: ../fish/guestfish-actions.pod:3872 ../src/guestfs-actions.pod:5875
11913 #: ../fish/guestfish-actions.pod:3874 ../src/guestfs-actions.pod:5877
11918 #: ../fish/guestfish-actions.pod:3876 ../src/guestfs-actions.pod:5879
11919 msgid "FIFO (named pipe)"
11923 #: ../fish/guestfish-actions.pod:3878 ../src/guestfs-actions.pod:5881
11928 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:5883
11929 msgid "Symbolic link"
11933 #: ../fish/guestfish-actions.pod:3882 ../src/guestfs-actions.pod:5885
11938 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5887
11939 msgid "Regular file"
11943 #: ../fish/guestfish-actions.pod:3886 ../src/guestfs-actions.pod:5889
11948 #: ../fish/guestfish-actions.pod:3888 ../src/guestfs-actions.pod:5891
11953 #: ../fish/guestfish-actions.pod:3890 ../src/guestfs-actions.pod:5893
11958 #: ../fish/guestfish-actions.pod:3892 ../src/guestfs-actions.pod:5895
11959 msgid "Unknown file type"
11963 #: ../fish/guestfish-actions.pod:3894 ../src/guestfs-actions.pod:5897
11968 #: ../fish/guestfish-actions.pod:3896 ../src/guestfs-actions.pod:5899
11969 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
11973 #: ../fish/guestfish-actions.pod:3901
11975 "This function is primarily intended for use by programs. To get a simple "
11976 "list of names, use L</ls>. To get a printable directory for human "
11977 "consumption, use L</ll>."
11981 #: ../fish/guestfish-actions.pod:3905
11986 #: ../fish/guestfish-actions.pod:3907
11994 #: ../fish/guestfish-actions.pod:3909 ../src/guestfs-actions.pod:5920
11995 msgid "This command reads the target of a symbolic link."
11999 #: ../fish/guestfish-actions.pod:3911
12000 msgid "readlinklist"
12004 #: ../fish/guestfish-actions.pod:3913
12007 " readlinklist path 'names ...'\n"
12012 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5934
12014 "This call allows you to do a C<readlink> operation on multiple files, where "
12015 "all files are in the directory C<path>. C<names> is the list of files from "
12020 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5938
12022 "On return you get a list of strings, with a one-to-one correspondence to the "
12023 "C<names> list. Each string is the value of the symbolic link."
12027 #: ../fish/guestfish-actions.pod:3923 ../src/guestfs-actions.pod:5942
12029 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12030 "result string is the empty string C<\"\">. However the whole operation is "
12031 "completed even if there were C<readlink(2)> errors, and so you can call this "
12032 "function with names where you don't know if they are symbolic links already "
12033 "(albeit slightly less efficient)."
12037 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:5949
12039 "This call is intended for programs that want to efficiently list a directory "
12040 "contents without making many round-trips. Very long directory listings "
12041 "might cause the protocol message size to be exceeded, causing this call to "
12042 "fail. The caller must split up such requests into smaller groups of names."
12046 #: ../fish/guestfish-actions.pod:3937
12051 #: ../fish/guestfish-actions.pod:3939
12059 #: ../fish/guestfish-actions.pod:3941 ../src/guestfs-actions.pod:5968
12061 "Return the canonicalized absolute pathname of C<path>. The returned path "
12062 "has no C<.>, C<..> or symbolic link path elements."
12066 #: ../fish/guestfish-actions.pod:3944
12067 msgid "removexattr"
12071 #: ../fish/guestfish-actions.pod:3946
12074 " removexattr xattr path\n"
12079 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:5983
12080 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
12084 #: ../fish/guestfish-actions.pod:3951
12085 msgid "See also: L</lremovexattr>, L<attr(5)>."
12089 #: ../fish/guestfish-actions.pod:3953
12094 #: ../fish/guestfish-actions.pod:3955
12097 " resize2fs device\n"
12102 #: ../fish/guestfish-actions.pod:3957 ../src/guestfs-actions.pod:5998
12104 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12105 "underlying device."
12109 #: ../fish/guestfish-actions.pod:3960
12111 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
12112 "before calling this command. For unknown reasons C<resize2fs> sometimes "
12113 "gives an error about this and sometimes not. In any case, it is always safe "
12114 "to call L</e2fsck-f> before calling this function."
12118 #: ../fish/guestfish-actions.pod:3966
12119 msgid "resize2fs-M"
12123 #: ../fish/guestfish-actions.pod:3968
12126 " resize2fs-M device\n"
12131 #: ../fish/guestfish-actions.pod:3970
12133 "This command is the same as L</resize2fs>, but the filesystem is resized to "
12134 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
12139 #: ../fish/guestfish-actions.pod:3974
12141 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
12142 "and read the C<Block size> and C<Block count> values. These two numbers, "
12143 "multiplied together, give the resulting size of the minimal filesystem in "
12148 #: ../fish/guestfish-actions.pod:3979
12149 msgid "resize2fs-size"
12153 #: ../fish/guestfish-actions.pod:3981
12156 " resize2fs-size device size\n"
12161 #: ../fish/guestfish-actions.pod:3983
12163 "This command is the same as L</resize2fs> except that it allows you to "
12164 "specify the new size (in bytes) explicitly."
12168 #: ../fish/guestfish-actions.pod:3986
12173 #: ../fish/guestfish-actions.pod:3988
12181 #: ../fish/guestfish-actions.pod:3990 ../src/guestfs-actions.pod:6050
12182 msgid "Remove the single file C<path>."
12186 #: ../fish/guestfish-actions.pod:3992
12191 #: ../fish/guestfish-actions.pod:3994
12199 #: ../fish/guestfish-actions.pod:3996 ../src/guestfs-actions.pod:6062
12201 "Remove the file or directory C<path>, recursively removing the contents if "
12202 "its a directory. This is like the C<rm -rf> shell command."
12206 #: ../fish/guestfish-actions.pod:4000
12211 #: ../fish/guestfish-actions.pod:4002
12219 #: ../fish/guestfish-actions.pod:4004 ../src/guestfs-actions.pod:6076
12220 msgid "Remove the single directory C<path>."
12224 #: ../fish/guestfish-actions.pod:4006
12225 msgid "rmmountpoint"
12229 #: ../fish/guestfish-actions.pod:4008
12232 " rmmountpoint exemptpath\n"
12237 #: ../fish/guestfish-actions.pod:4010
12239 "This calls removes a mountpoint that was previously created with "
12240 "L</mkmountpoint>. See L</mkmountpoint> for full details."
12244 #: ../fish/guestfish-actions.pod:4014
12245 msgid "scrub-device"
12249 #: ../fish/guestfish-actions.pod:4016
12252 " scrub-device device\n"
12257 #: ../fish/guestfish-actions.pod:4018 ../src/guestfs-actions.pod:6102
12259 "This command writes patterns over C<device> to make data retrieval more "
12264 #: ../fish/guestfish-actions.pod:4021 ../fish/guestfish-actions.pod:4036 ../fish/guestfish-actions.pod:4049 ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6126 ../src/guestfs-actions.pod:6145
12266 "It is an interface to the L<scrub(1)> program. See that manual page for "
12271 #: ../fish/guestfish-actions.pod:4027
12276 #: ../fish/guestfish-actions.pod:4029
12279 " scrub-file file\n"
12284 #: ../fish/guestfish-actions.pod:4031 ../src/guestfs-actions.pod:6121
12286 "This command writes patterns over a file to make data retrieval more "
12291 #: ../fish/guestfish-actions.pod:4034 ../src/guestfs-actions.pod:6124
12292 msgid "The file is I<removed> after scrubbing."
12296 #: ../fish/guestfish-actions.pod:4039
12297 msgid "scrub-freespace"
12301 #: ../fish/guestfish-actions.pod:4041
12304 " scrub-freespace dir\n"
12309 #: ../fish/guestfish-actions.pod:4043
12311 "This command creates the directory C<dir> and then fills it with files until "
12312 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
12313 "deletes them. The intention is to scrub any free space on the partition "
12314 "containing C<dir>."
12318 #: ../fish/guestfish-actions.pod:4052
12323 #: ../fish/guestfish-actions.pod:4054
12328 #: ../fish/guestfish-actions.pod:4056
12331 " set-append append\n"
12336 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6158
12338 "This function is used to add additional options to the guest kernel command "
12343 #: ../fish/guestfish-actions.pod:4061 ../src/guestfs-actions.pod:6161
12345 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12346 "environment variable."
12350 #: ../fish/guestfish-actions.pod:4064 ../src/guestfs-actions.pod:6164
12352 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12353 "(libguestfs always adds a few of its own)."
12357 #: ../fish/guestfish-actions.pod:4067
12358 msgid "set-attach-method"
12362 #: ../fish/guestfish-actions.pod:4069
12363 msgid "attach-method"
12367 #: ../fish/guestfish-actions.pod:4071
12370 " set-attach-method attachmethod\n"
12375 #: ../fish/guestfish-actions.pod:4073 ../src/guestfs-actions.pod:6177
12377 "Set the method that libguestfs uses to connect to the back end guestfsd "
12378 "daemon. Possible methods are:"
12382 #: ../fish/guestfish-actions.pod:4078 ../src/guestfs-actions.pod:6182 ../src/guestfs.pod:2687
12383 msgid "C<appliance>"
12387 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6184
12389 "Launch an appliance and connect to it. This is the ordinary method and the "
12394 #: ../fish/guestfish-actions.pod:4083 ../src/guestfs-actions.pod:6187
12395 msgid "C<unix:I<path>>"
12399 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6189
12400 msgid "Connect to the Unix domain socket I<path>."
12404 #: ../fish/guestfish-actions.pod:4087 ../src/guestfs-actions.pod:6191
12406 "This method lets you connect to an existing daemon or (using virtio-serial) "
12407 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
12408 "RUNNING DAEMONS>."
12412 #: ../fish/guestfish-actions.pod:4093
12413 msgid "set-autosync"
12417 #: ../fish/guestfish-actions.pod:4095
12422 #: ../fish/guestfish-actions.pod:4097
12425 " set-autosync true|false\n"
12430 #: ../fish/guestfish-actions.pod:4099 ../src/guestfs-actions.pod:6207
12432 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12433 "effort attempt to make filesystems consistent and synchronized when the "
12434 "handle is closed (also if the program exits without closing handles)."
12438 #: ../fish/guestfish-actions.pod:4104 ../src/guestfs-actions.pod:6212
12440 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12441 "disabled by default)."
12445 #: ../fish/guestfish-actions.pod:4107
12450 #: ../fish/guestfish-actions.pod:4109
12455 #: ../fish/guestfish-actions.pod:4111
12458 " set-direct true|false\n"
12463 #: ../fish/guestfish-actions.pod:4113 ../src/guestfs-actions.pod:6225
12465 "If the direct appliance mode flag is enabled, then stdin and stdout are "
12466 "passed directly through to the appliance once it is launched."
12470 #: ../fish/guestfish-actions.pod:4117
12472 "One consequence of this is that log messages aren't caught by the library "
12473 "and handled by L</set-log-message-callback>, but go straight to stdout."
12477 #: ../fish/guestfish-actions.pod:4121 ../src/guestfs-actions.pod:6233
12478 msgid "You probably don't want to use this unless you know what you are doing."
12482 #: ../fish/guestfish-actions.pod:4124 ../src/guestfs-actions.pod:6236
12483 msgid "The default is disabled."
12487 #: ../fish/guestfish-actions.pod:4126
12488 msgid "set-e2label"
12492 #: ../fish/guestfish-actions.pod:4128
12495 " set-e2label device label\n"
12500 #: ../fish/guestfish-actions.pod:4130 ../src/guestfs-actions.pod:6249
12502 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
12503 "C<label>. Filesystem labels are limited to 16 characters."
12507 #: ../fish/guestfish-actions.pod:4134
12509 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
12510 "label on a filesystem."
12514 #: ../fish/guestfish-actions.pod:4137
12519 #: ../fish/guestfish-actions.pod:4139
12522 " set-e2uuid device uuid\n"
12527 #: ../fish/guestfish-actions.pod:4141 ../src/guestfs-actions.pod:6267
12529 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
12530 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
12531 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
12535 #: ../fish/guestfish-actions.pod:4146
12537 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
12538 "UUID of a filesystem."
12542 #: ../fish/guestfish-actions.pod:4149
12543 msgid "set-memsize"
12547 #: ../fish/guestfish-actions.pod:4151
12552 #: ../fish/guestfish-actions.pod:4153
12555 " set-memsize memsize\n"
12560 #: ../fish/guestfish-actions.pod:4155
12562 "This sets the memory size in megabytes allocated to the qemu subprocess. "
12563 "This only has any effect if called before L</launch>."
12567 #: ../fish/guestfish-actions.pod:4159 ../src/guestfs-actions.pod:6289
12569 "You can also change this by setting the environment variable "
12570 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
12574 #: ../fish/guestfish-actions.pod:4166
12575 msgid "set-network"
12579 #: ../fish/guestfish-actions.pod:4168
12584 #: ../fish/guestfish-actions.pod:4170
12587 " set-network true|false\n"
12592 #: ../fish/guestfish-actions.pod:4172 ../src/guestfs-actions.pod:6306
12594 "If C<network> is true, then the network is enabled in the libguestfs "
12595 "appliance. The default is false."
12599 #: ../fish/guestfish-actions.pod:4175 ../src/guestfs-actions.pod:6309
12601 "This affects whether commands are able to access the network (see "
12602 "L<guestfs(3)/RUNNING COMMANDS>)."
12606 #: ../fish/guestfish-actions.pod:4178
12607 msgid "You must call this before calling L</launch>, otherwise it has no effect."
12611 #: ../fish/guestfish-actions.pod:4181
12616 #: ../fish/guestfish-actions.pod:4185
12619 " set-path searchpath\n"
12624 #: ../fish/guestfish-actions.pod:4187 ../src/guestfs-actions.pod:6325
12625 msgid "Set the path that libguestfs searches for kernel and initrd.img."
12629 #: ../fish/guestfish-actions.pod:4189 ../src/guestfs-actions.pod:6327
12631 "The default is C<$libdir/guestfs> unless overridden by setting "
12632 "C<LIBGUESTFS_PATH> environment variable."
12636 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6330
12637 msgid "Setting C<path> to C<NULL> restores the default path."
12641 #: ../fish/guestfish-actions.pod:4194
12646 #: ../fish/guestfish-actions.pod:4196
12651 #: ../fish/guestfish-actions.pod:4198
12654 " set-pgroup true|false\n"
12659 #: ../fish/guestfish-actions.pod:4200 ../src/guestfs-actions.pod:6342
12661 "If C<pgroup> is true, child processes are placed into their own process "
12666 #: ../fish/guestfish-actions.pod:4203 ../src/guestfs-actions.pod:6345
12668 "The practical upshot of this is that signals like C<SIGINT> (from users "
12669 "pressing C<^C>) won't be received by the child process."
12673 #: ../fish/guestfish-actions.pod:4206 ../src/guestfs-actions.pod:6348
12675 "The default for this flag is false, because usually you want C<^C> to kill "
12680 #: ../fish/guestfish-actions.pod:4209
12685 #: ../fish/guestfish-actions.pod:4211
12690 #: ../fish/guestfish-actions.pod:4213
12698 #: ../fish/guestfish-actions.pod:4215 ../src/guestfs-actions.pod:6361
12699 msgid "Set the qemu binary that we will use."
12703 #: ../fish/guestfish-actions.pod:4217 ../src/guestfs-actions.pod:6363
12704 msgid "The default is chosen when the library was compiled by the configure script."
12708 #: ../fish/guestfish-actions.pod:4220 ../src/guestfs-actions.pod:6366
12710 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
12715 #: ../fish/guestfish-actions.pod:4223 ../src/guestfs-actions.pod:6369
12716 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
12720 #: ../fish/guestfish-actions.pod:4225 ../src/guestfs-actions.pod:6371
12722 "Note that you should call this function as early as possible after creating "
12723 "the handle. This is because some pre-launch operations depend on testing "
12724 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
12725 "don't retest features, and so you might see inconsistent results. Using the "
12726 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
12727 "the qemu binary at the same time as the handle is created."
12731 #: ../fish/guestfish-actions.pod:4233
12732 msgid "set-recovery-proc"
12736 #: ../fish/guestfish-actions.pod:4235
12737 msgid "recovery-proc"
12741 #: ../fish/guestfish-actions.pod:4237
12744 " set-recovery-proc true|false\n"
12749 #: ../fish/guestfish-actions.pod:4239
12751 "If this is called with the parameter C<false> then L</launch> does not "
12752 "create a recovery process. The purpose of the recovery process is to stop "
12753 "runaway qemu processes in the case where the main program aborts abruptly."
12757 #: ../fish/guestfish-actions.pod:4244
12759 "This only has any effect if called before L</launch>, and the default is "
12764 #: ../fish/guestfish-actions.pod:4247 ../src/guestfs-actions.pod:6397
12766 "About the only time when you would want to disable this is if the main "
12767 "process will fork itself into the background (\"daemonize\" itself). In "
12768 "this case the recovery process thinks that the main program has disappeared "
12769 "and so kills qemu, which is not very helpful."
12773 #: ../fish/guestfish-actions.pod:4253
12774 msgid "set-selinux"
12778 #: ../fish/guestfish-actions.pod:4255
12783 #: ../fish/guestfish-actions.pod:4257
12786 " set-selinux true|false\n"
12791 #: ../fish/guestfish-actions.pod:4259 ../src/guestfs-actions.pod:6413
12793 "This sets the selinux flag that is passed to the appliance at boot time. "
12794 "The default is C<selinux=0> (disabled)."
12798 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6416
12800 "Note that if SELinux is enabled, it is always in Permissive mode "
12801 "(C<enforcing=0>)."
12805 #: ../fish/guestfish-actions.pod:4268
12810 #: ../fish/guestfish-actions.pod:4270
12815 #: ../fish/guestfish-actions.pod:4272
12818 " set-trace true|false\n"
12823 #: ../fish/guestfish-actions.pod:4274 ../src/guestfs-actions.pod:6432
12825 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
12826 "return values are traced."
12830 #: ../fish/guestfish-actions.pod:4277 ../src/guestfs-actions.pod:6435
12832 "If you want to trace C API calls into libguestfs (and other libraries) then "
12833 "possibly a better way is to use the external ltrace(1) command."
12837 #: ../fish/guestfish-actions.pod:4281 ../src/guestfs-actions.pod:6439
12839 "Command traces are disabled unless the environment variable "
12840 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12844 #: ../fish/guestfish-actions.pod:4284
12846 "Trace messages are normally sent to C<stderr>, unless you register a "
12847 "callback to send them somewhere else (see L</set-event-callback>)."
12851 #: ../fish/guestfish-actions.pod:4288
12852 msgid "set-verbose"
12856 #: ../fish/guestfish-actions.pod:4290
12861 #: ../fish/guestfish-actions.pod:4292
12864 " set-verbose true|false\n"
12869 #: ../fish/guestfish-actions.pod:4294 ../src/guestfs-actions.pod:6456
12870 msgid "If C<verbose> is true, this turns on verbose messages."
12874 #: ../fish/guestfish-actions.pod:4296 ../src/guestfs-actions.pod:6458
12876 "Verbose messages are disabled unless the environment variable "
12877 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12881 #: ../fish/guestfish-actions.pod:4299
12883 "Verbose messages are normally sent to C<stderr>, unless you register a "
12884 "callback to send them somewhere else (see L</set-event-callback>)."
12888 #: ../fish/guestfish-actions.pod:4303
12893 #: ../fish/guestfish-actions.pod:4305
12896 " setcon context\n"
12901 #: ../fish/guestfish-actions.pod:4307 ../src/guestfs-actions.pod:6475
12903 "This sets the SELinux security context of the daemon to the string "
12908 #: ../fish/guestfish-actions.pod:4310 ../src/guestfs-actions.pod:6478
12909 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12913 #: ../fish/guestfish-actions.pod:4312
12918 #: ../fish/guestfish-actions.pod:4314
12921 " setxattr xattr val vallen path\n"
12926 #: ../fish/guestfish-actions.pod:4316 ../src/guestfs-actions.pod:6493
12928 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12929 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12933 #: ../fish/guestfish-actions.pod:4320
12934 msgid "See also: L</lsetxattr>, L<attr(5)>."
12938 #: ../fish/guestfish-actions.pod:4322
12943 #: ../fish/guestfish-actions.pod:4324
12946 " sfdisk device cyls heads sectors 'lines ...'\n"
12951 #: ../fish/guestfish-actions.pod:4326 ../src/guestfs-actions.pod:6513
12953 "This is a direct interface to the L<sfdisk(8)> program for creating "
12954 "partitions on block devices."
12958 #: ../fish/guestfish-actions.pod:4329 ../src/guestfs-actions.pod:6516
12959 msgid "C<device> should be a block device, for example C</dev/sda>."
12963 #: ../fish/guestfish-actions.pod:4331 ../src/guestfs-actions.pod:6518
12965 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12966 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
12967 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12968 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12969 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12970 "the kernel) cannot work out the right geometry and you will need to tell it."
12974 #: ../fish/guestfish-actions.pod:4339 ../src/guestfs-actions.pod:6526
12976 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12977 "refer to the L<sfdisk(8)> manpage."
12981 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6529
12983 "To create a single partition occupying the whole disk, you would pass "
12984 "C<lines> as a single element list, when the single element being the string "
12989 #: ../fish/guestfish-actions.pod:4346
12990 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
12994 #: ../fish/guestfish-actions.pod:4352 ../fish/guestfish-actions.pod:4375 ../fish/guestfish-actions.pod:4397 ../src/guestfs-actions.pod:6541 ../src/guestfs-actions.pod:6571 ../src/guestfs-actions.pod:6604
12995 msgid "This function is deprecated. In new code, use the C<part_add> call instead."
12999 #: ../fish/guestfish-actions.pod:4359
13004 #: ../fish/guestfish-actions.pod:4361
13007 " sfdiskM device 'lines ...'\n"
13012 #: ../fish/guestfish-actions.pod:4363
13014 "This is a simplified interface to the L</sfdisk> command, where partition "
13015 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13016 "you don't need to specify the cyls, heads and sectors parameters which were "
13017 "rarely if ever used anyway."
13021 #: ../fish/guestfish-actions.pod:4369
13022 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13026 #: ../fish/guestfish-actions.pod:4382
13031 #: ../fish/guestfish-actions.pod:4384
13034 " sfdisk-N device partnum cyls heads sectors line\n"
13039 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6591
13041 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13042 "(note: C<n> counts from 1)."
13046 #: ../fish/guestfish-actions.pod:4389
13048 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13049 "cyls/heads/sectors parameters."
13053 #: ../fish/guestfish-actions.pod:4392
13054 msgid "See also: L</part-add>"
13058 #: ../fish/guestfish-actions.pod:4404
13059 msgid "sfdisk-disk-geometry"
13063 #: ../fish/guestfish-actions.pod:4406
13066 " sfdisk-disk-geometry device\n"
13071 #: ../fish/guestfish-actions.pod:4408
13073 "This displays the disk geometry of C<device> read from the partition table. "
13074 "Especially in the case where the underlying block device has been resized, "
13075 "this can be different from the kernel's idea of the geometry (see "
13076 "L</sfdisk-kernel-geometry>)."
13080 #: ../fish/guestfish-actions.pod:4413 ../fish/guestfish-actions.pod:4422 ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6640
13081 msgid "The result is in human-readable format, and not designed to be parsed."
13085 #: ../fish/guestfish-actions.pod:4416
13086 msgid "sfdisk-kernel-geometry"
13090 #: ../fish/guestfish-actions.pod:4418
13093 " sfdisk-kernel-geometry device\n"
13098 #: ../fish/guestfish-actions.pod:4420 ../src/guestfs-actions.pod:6638
13099 msgid "This displays the kernel's idea of the geometry of C<device>."
13103 #: ../fish/guestfish-actions.pod:4425
13108 #: ../fish/guestfish-actions.pod:4427
13111 " sfdisk-l device\n"
13116 #: ../fish/guestfish-actions.pod:4429 ../src/guestfs-actions.pod:6654
13118 "This displays the partition table on C<device>, in the human-readable output "
13119 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13123 #: ../fish/guestfish-actions.pod:4433
13124 msgid "See also: L</part-list>"
13128 #: ../fish/guestfish-actions.pod:4435 ../src/guestfs-actions.pod:6663
13130 "This function is deprecated. In new code, use the C<part_list> call "
13135 #: ../fish/guestfish-actions.pod:4442
13140 #: ../fish/guestfish-actions.pod:4444
13148 #: ../fish/guestfish-actions.pod:4446 ../src/guestfs-actions.pod:6678
13150 "This call runs a command from the guest filesystem via the guest's "
13155 #: ../fish/guestfish-actions.pod:4449
13156 msgid "This is like L</command>, but passes the command to:"
13160 #: ../fish/guestfish-actions.pod:4451 ../src/guestfs-actions.pod:6683
13163 " /bin/sh -c \"command\"\n"
13168 #: ../fish/guestfish-actions.pod:4453 ../src/guestfs-actions.pod:6685
13170 "Depending on the guest's shell, this usually results in wildcards being "
13171 "expanded, shell expressions being interpolated and so on."
13175 #: ../fish/guestfish-actions.pod:4457
13176 msgid "All the provisos about L</command> apply to this call."
13180 #: ../fish/guestfish-actions.pod:4459
13185 #: ../fish/guestfish-actions.pod:4461
13188 " sh-lines command\n"
13193 #: ../fish/guestfish-actions.pod:4463
13194 msgid "This is the same as L</sh>, but splits the result into a list of lines."
13198 #: ../fish/guestfish-actions.pod:4466
13199 msgid "See also: L</command-lines>"
13203 #: ../fish/guestfish-actions.pod:4468
13208 #: ../fish/guestfish-actions.pod:4470
13216 #: ../fish/guestfish-actions.pod:4472 ../src/guestfs-actions.pod:6719
13217 msgid "Sleep for C<secs> seconds."
13221 #: ../fish/guestfish-actions.pod:4474
13226 #: ../fish/guestfish-actions.pod:4476
13234 #: ../fish/guestfish-actions.pod:4480 ../src/guestfs-actions.pod:6733
13235 msgid "This is the same as the C<stat(2)> system call."
13239 #: ../fish/guestfish-actions.pod:4482
13244 #: ../fish/guestfish-actions.pod:4484
13252 #: ../fish/guestfish-actions.pod:4486 ../src/guestfs-actions.pod:6747
13254 "Returns file system statistics for any mounted file system. C<path> should "
13255 "be a file or directory in the mounted file system (typically it is the mount "
13256 "point itself, but it doesn't need to be)."
13260 #: ../fish/guestfish-actions.pod:4490 ../src/guestfs-actions.pod:6751
13261 msgid "This is the same as the C<statvfs(2)> system call."
13265 #: ../fish/guestfish-actions.pod:4492
13270 #: ../fish/guestfish-actions.pod:4494
13278 #: ../fish/guestfish-actions.pod:4496 ../src/guestfs-actions.pod:6765
13280 "This runs the L<strings(1)> command on a file and returns the list of "
13281 "printable strings found."
13285 #: ../fish/guestfish-actions.pod:4502
13290 #: ../fish/guestfish-actions.pod:4504
13293 " strings-e encoding path\n"
13298 #: ../fish/guestfish-actions.pod:4506
13300 "This is like the L</strings> command, but allows you to specify the encoding "
13301 "of strings that are looked for in the source file C<path>."
13305 #: ../fish/guestfish-actions.pod:4510 ../src/guestfs-actions.pod:6788
13306 msgid "Allowed encodings are:"
13310 #: ../fish/guestfish-actions.pod:4514 ../src/guestfs-actions.pod:6792
13315 #: ../fish/guestfish-actions.pod:4516
13317 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13318 "ISO-8859-X (this is what L</strings> uses)."
13322 #: ../fish/guestfish-actions.pod:4519 ../src/guestfs-actions.pod:6797
13327 #: ../fish/guestfish-actions.pod:4521 ../src/guestfs-actions.pod:6799
13328 msgid "Single 8-bit-byte characters."
13332 #: ../fish/guestfish-actions.pod:4523 ../src/guestfs-actions.pod:6801
13337 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6803
13338 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13342 #: ../fish/guestfish-actions.pod:4528 ../src/guestfs-actions.pod:6806
13343 msgid "l (lower case letter L)"
13347 #: ../fish/guestfish-actions.pod:4530 ../src/guestfs-actions.pod:6808
13349 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13350 "examining binaries in Windows guests."
13354 #: ../fish/guestfish-actions.pod:4533 ../src/guestfs-actions.pod:6811
13359 #: ../fish/guestfish-actions.pod:4535 ../src/guestfs-actions.pod:6813
13360 msgid "32-bit big endian such as UCS-4BE."
13364 #: ../fish/guestfish-actions.pod:4537 ../src/guestfs-actions.pod:6815
13369 #: ../fish/guestfish-actions.pod:4539 ../src/guestfs-actions.pod:6817
13370 msgid "32-bit little endian such as UCS-4LE."
13374 #: ../fish/guestfish-actions.pod:4543 ../src/guestfs-actions.pod:6821
13375 msgid "The returned strings are transcoded to UTF-8."
13379 #: ../fish/guestfish-actions.pod:4548
13380 msgid "swapoff-device"
13384 #: ../fish/guestfish-actions.pod:4550
13387 " swapoff-device device\n"
13392 #: ../fish/guestfish-actions.pod:4552
13394 "This command disables the libguestfs appliance swap device or partition "
13395 "named C<device>. See L</swapon-device>."
13399 #: ../fish/guestfish-actions.pod:4556
13400 msgid "swapoff-file"
13404 #: ../fish/guestfish-actions.pod:4558
13407 " swapoff-file file\n"
13412 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6852
13413 msgid "This command disables the libguestfs appliance swap on file."
13417 #: ../fish/guestfish-actions.pod:4562
13418 msgid "swapoff-label"
13422 #: ../fish/guestfish-actions.pod:4564
13425 " swapoff-label label\n"
13430 #: ../fish/guestfish-actions.pod:4566 ../src/guestfs-actions.pod:6864
13432 "This command disables the libguestfs appliance swap on labeled swap "
13437 #: ../fish/guestfish-actions.pod:4569
13438 msgid "swapoff-uuid"
13442 #: ../fish/guestfish-actions.pod:4571
13445 " swapoff-uuid uuid\n"
13450 #: ../fish/guestfish-actions.pod:4573 ../src/guestfs-actions.pod:6877
13452 "This command disables the libguestfs appliance swap partition with the given "
13457 #: ../fish/guestfish-actions.pod:4576
13458 msgid "swapon-device"
13462 #: ../fish/guestfish-actions.pod:4578
13465 " swapon-device device\n"
13470 #: ../fish/guestfish-actions.pod:4580
13472 "This command enables the libguestfs appliance to use the swap device or "
13473 "partition named C<device>. The increased memory is made available for all "
13474 "commands, for example those run using L</command> or L</sh>."
13478 #: ../fish/guestfish-actions.pod:4585 ../src/guestfs-actions.pod:6895
13480 "Note that you should not swap to existing guest swap partitions unless you "
13481 "know what you are doing. They may contain hibernation information, or other "
13482 "information that the guest doesn't want you to trash. You also risk leaking "
13483 "information about the host to the guest this way. Instead, attach a new "
13484 "host device to the guest and swap on that."
13488 #: ../fish/guestfish-actions.pod:4592
13489 msgid "swapon-file"
13493 #: ../fish/guestfish-actions.pod:4594
13496 " swapon-file file\n"
13501 #: ../fish/guestfish-actions.pod:4596
13502 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
13506 #: ../fish/guestfish-actions.pod:4599
13507 msgid "swapon-label"
13511 #: ../fish/guestfish-actions.pod:4601
13514 " swapon-label label\n"
13519 #: ../fish/guestfish-actions.pod:4603
13521 "This command enables swap to a labeled swap partition. See "
13522 "L</swapon-device> for other notes."
13526 #: ../fish/guestfish-actions.pod:4606
13527 msgid "swapon-uuid"
13531 #: ../fish/guestfish-actions.pod:4608
13534 " swapon-uuid uuid\n"
13539 #: ../fish/guestfish-actions.pod:4610
13541 "This command enables swap to a swap partition with the given UUID. See "
13542 "L</swapon-device> for other notes."
13546 #: ../fish/guestfish-actions.pod:4613
13551 #: ../fish/guestfish-actions.pod:4615
13559 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6950
13561 "This syncs the disk, so that any writes are flushed through to the "
13562 "underlying disk image."
13566 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:6953
13568 "You should always call this if you have modified a disk image, before "
13569 "closing the handle."
13573 #: ../fish/guestfish-actions.pod:4623
13578 #: ../fish/guestfish-actions.pod:4625
13586 #: ../fish/guestfish-actions.pod:4627 ../src/guestfs-actions.pod:6966
13587 msgid "This command returns up to the last 10 lines of a file as a list of strings."
13591 #: ../fish/guestfish-actions.pod:4633
13596 #: ../fish/guestfish-actions.pod:4635
13599 " tail-n nrlines path\n"
13604 #: ../fish/guestfish-actions.pod:4637 ../src/guestfs-actions.pod:6985
13606 "If the parameter C<nrlines> is a positive number, this returns the last "
13607 "C<nrlines> lines of the file C<path>."
13611 #: ../fish/guestfish-actions.pod:4640 ../src/guestfs-actions.pod:6988
13613 "If the parameter C<nrlines> is a negative number, this returns lines from "
13614 "the file C<path>, starting with the C<-nrlines>th line."
13618 #: ../fish/guestfish-actions.pod:4648
13623 #: ../fish/guestfish-actions.pod:4650
13626 " tar-in (tarfile|-) directory\n"
13631 #: ../fish/guestfish-actions.pod:4652 ../src/guestfs-actions.pod:7009
13633 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
13634 "tar file) into C<directory>."
13638 #: ../fish/guestfish-actions.pod:4655
13639 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
13643 #: ../fish/guestfish-actions.pod:4660
13648 #: ../fish/guestfish-actions.pod:4662
13651 " tar-out directory (tarfile|-)\n"
13656 #: ../fish/guestfish-actions.pod:4664 ../src/guestfs-actions.pod:7026
13658 "This command packs the contents of C<directory> and downloads it to local "
13663 #: ../fish/guestfish-actions.pod:4667
13664 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
13668 #: ../fish/guestfish-actions.pod:4672
13673 #: ../fish/guestfish-actions.pod:4674
13676 " tgz-in (tarball|-) directory\n"
13681 #: ../fish/guestfish-actions.pod:4676 ../src/guestfs-actions.pod:7043
13683 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
13684 "tar file) into C<directory>."
13688 #: ../fish/guestfish-actions.pod:4679
13689 msgid "To upload an uncompressed tarball, use L</tar-in>."
13693 #: ../fish/guestfish-actions.pod:4683
13698 #: ../fish/guestfish-actions.pod:4685
13701 " tgz-out directory (tarball|-)\n"
13706 #: ../fish/guestfish-actions.pod:4687 ../src/guestfs-actions.pod:7059
13708 "This command packs the contents of C<directory> and downloads it to local "
13713 #: ../fish/guestfish-actions.pod:4690
13714 msgid "To download an uncompressed tarball, use L</tar-out>."
13718 #: ../fish/guestfish-actions.pod:4694
13723 #: ../fish/guestfish-actions.pod:4696
13731 #: ../fish/guestfish-actions.pod:4698 ../src/guestfs-actions.pod:7074
13733 "Touch acts like the L<touch(1)> command. It can be used to update the "
13734 "timestamps on a file, or, if the file does not exist, to create a new "
13735 "zero-length file."
13739 #: ../fish/guestfish-actions.pod:4702 ../src/guestfs-actions.pod:7078
13741 "This command only works on regular files, and will fail on other file types "
13742 "such as directories, symbolic links, block special etc."
13746 #: ../fish/guestfish-actions.pod:4705
13751 #: ../fish/guestfish-actions.pod:4707
13759 #: ../fish/guestfish-actions.pod:4709 ../src/guestfs-actions.pod:7091
13761 "This command truncates C<path> to a zero-length file. The file must exist "
13766 #: ../fish/guestfish-actions.pod:4712
13767 msgid "truncate-size"
13771 #: ../fish/guestfish-actions.pod:4714
13774 " truncate-size path size\n"
13779 #: ../fish/guestfish-actions.pod:4716 ../src/guestfs-actions.pod:7105
13781 "This command truncates C<path> to size C<size> bytes. The file must exist "
13786 #: ../fish/guestfish-actions.pod:4719
13788 "If the current file size is less than C<size> then the file is extended to "
13789 "the required size with zero bytes. This creates a sparse file (ie. disk "
13790 "blocks are not allocated for the file until you write to it). To create a "
13791 "non-sparse file of zeroes, use L</fallocate64> instead."
13795 #: ../fish/guestfish-actions.pod:4725
13800 #: ../fish/guestfish-actions.pod:4727
13803 " tune2fs-l device\n"
13808 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7124
13810 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13815 #: ../fish/guestfish-actions.pod:4732 ../src/guestfs-actions.pod:7127
13817 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13818 "for more details. The list of fields returned isn't clearly defined, and "
13819 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13820 "and the filesystem itself."
13824 #: ../fish/guestfish-actions.pod:4737
13829 #: ../fish/guestfish-actions.pod:4739
13832 " txz-in (tarball|-) directory\n"
13837 #: ../fish/guestfish-actions.pod:4741 ../src/guestfs-actions.pod:7147
13839 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13840 "tar file) into C<directory>."
13844 #: ../fish/guestfish-actions.pod:4746
13849 #: ../fish/guestfish-actions.pod:4748
13852 " txz-out directory (tarball|-)\n"
13857 #: ../fish/guestfish-actions.pod:4750 ../src/guestfs-actions.pod:7161
13859 "This command packs the contents of C<directory> and downloads it to local "
13860 "file C<tarball> (as an xz compressed tar archive)."
13864 #: ../fish/guestfish-actions.pod:4755
13869 #: ../fish/guestfish-actions.pod:4757
13877 #: ../fish/guestfish-actions.pod:4759 ../src/guestfs-actions.pod:7174
13879 "This function sets the mask used for creating new files and device nodes to "
13884 #: ../fish/guestfish-actions.pod:4762 ../src/guestfs-actions.pod:7177
13886 "Typical umask values would be C<022> which creates new files with "
13887 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13888 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13892 #: ../fish/guestfish-actions.pod:4767 ../src/guestfs-actions.pod:7182
13894 "The default umask is C<022>. This is important because it means that "
13895 "directories and device nodes will be created with C<0644> or C<0755> mode "
13896 "even if you specify C<0777>."
13900 #: ../fish/guestfish-actions.pod:4771
13901 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
13905 #: ../fish/guestfish-actions.pod:4774 ../src/guestfs-actions.pod:7189
13906 msgid "This call returns the previous umask."
13910 #: ../fish/guestfish-actions.pod:4776
13915 #: ../fish/guestfish-actions.pod:4778
13920 #: ../fish/guestfish-actions.pod:4780
13923 " umount pathordevice\n"
13928 #: ../fish/guestfish-actions.pod:4782 ../src/guestfs-actions.pod:7201
13930 "This unmounts the given filesystem. The filesystem may be specified either "
13931 "by its mountpoint (path) or the device which contains the filesystem."
13935 #: ../fish/guestfish-actions.pod:4786
13940 #: ../fish/guestfish-actions.pod:4788
13941 msgid "unmount-all"
13945 #: ../fish/guestfish-actions.pod:4790
13953 #: ../fish/guestfish-actions.pod:4792 ../src/guestfs-actions.pod:7214
13954 msgid "This unmounts all mounted filesystems."
13958 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7216
13959 msgid "Some internal mounts are not unmounted by this call."
13963 #: ../fish/guestfish-actions.pod:4796
13968 #: ../fish/guestfish-actions.pod:4798
13971 " upload (filename|-) remotefilename\n"
13976 #: ../fish/guestfish-actions.pod:4800 ../fish/guestfish-actions.pod:4813 ../src/guestfs-actions.pod:7229 ../src/guestfs-actions.pod:7253
13977 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
13981 #: ../fish/guestfish-actions.pod:4805
13982 msgid "See also L</download>."
13986 #: ../fish/guestfish-actions.pod:4809
13987 msgid "upload-offset"
13991 #: ../fish/guestfish-actions.pod:4811
13994 " upload-offset (filename|-) remotefilename offset\n"
13999 #: ../fish/guestfish-actions.pod:4816 ../src/guestfs-actions.pod:7256
14001 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14002 "The intention is to overwrite parts of existing files or devices, although "
14003 "if a non-existant file is specified then it is created with a \"hole\" "
14004 "before C<offset>. The size of the data written is implicit in the size of "
14005 "the source C<filename>."
14009 #: ../fish/guestfish-actions.pod:4823
14011 "Note that there is no limit on the amount of data that can be uploaded with "
14012 "this call, unlike with L</pwrite>, and this call always writes the full "
14013 "amount unless an error occurs."
14017 #: ../fish/guestfish-actions.pod:4828
14018 msgid "See also L</upload>, L</pwrite>."
14022 #: ../fish/guestfish-actions.pod:4832
14027 #: ../fish/guestfish-actions.pod:4834
14030 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14035 #: ../fish/guestfish-actions.pod:4836 ../src/guestfs-actions.pod:7289
14036 msgid "This command sets the timestamps of a file with nanosecond precision."
14040 #: ../fish/guestfish-actions.pod:4839 ../src/guestfs-actions.pod:7292
14042 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14047 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7295
14049 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14050 "nanoseconds from the epoch."
14054 #: ../fish/guestfish-actions.pod:4845 ../src/guestfs-actions.pod:7298
14056 "If the C<*nsecs> field contains the special value C<-1> then the "
14057 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14058 "ignored in this case)."
14062 #: ../fish/guestfish-actions.pod:4849 ../src/guestfs-actions.pod:7302
14064 "If the C<*nsecs> field contains the special value C<-2> then the "
14065 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14070 #: ../fish/guestfish-actions.pod:4853
14075 #: ../fish/guestfish-actions.pod:4855
14083 #: ../fish/guestfish-actions.pod:4857 ../src/guestfs-actions.pod:7315
14084 msgid "Return the libguestfs version number that the program is linked against."
14088 #: ../fish/guestfish-actions.pod:4860 ../src/guestfs-actions.pod:7318
14090 "Note that because of dynamic linking this is not necessarily the version of "
14091 "libguestfs that you compiled against. You can compile the program, and then "
14092 "at runtime dynamically link against a completely different C<libguestfs.so> "
14097 #: ../fish/guestfish-actions.pod:4865 ../src/guestfs-actions.pod:7323
14099 "This call was added in version C<1.0.58>. In previous versions of "
14100 "libguestfs there was no way to get the version number. From C code you can "
14101 "use dynamic linker functions to find out if this symbol exists (if it "
14102 "doesn't, then it's an earlier version)."
14106 #: ../fish/guestfish-actions.pod:4871 ../src/guestfs-actions.pod:7329
14108 "The call returns a structure with four elements. The first three (C<major>, "
14109 "C<minor> and C<release>) are numbers and correspond to the usual version "
14110 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14111 "but may be used for distro-specific information."
14115 #: ../fish/guestfish-actions.pod:4877 ../src/guestfs-actions.pod:7335
14116 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
14120 #: ../fish/guestfish-actions.pod:4880 ../src/guestfs-actions.pod:7338
14121 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14125 #: ../fish/guestfish-actions.pod:4882
14127 "I<Note:> Don't use this call to test for availability of features. In "
14128 "enterprise distributions we backport features from later versions into "
14129 "earlier versions, making this an unreliable way to test for features. Use "
14130 "L</available> instead."
14134 #: ../fish/guestfish-actions.pod:4888
14139 #: ../fish/guestfish-actions.pod:4890
14142 " vfs-label device\n"
14147 #: ../fish/guestfish-actions.pod:4892 ../src/guestfs-actions.pod:7358
14148 msgid "This returns the filesystem label of the filesystem on C<device>."
14152 #: ../fish/guestfish-actions.pod:4895 ../src/guestfs-actions.pod:7361
14153 msgid "If the filesystem is unlabeled, this returns the empty string."
14157 #: ../fish/guestfish-actions.pod:4897
14158 msgid "To find a filesystem from the label, use L</findfs-label>."
14162 #: ../fish/guestfish-actions.pod:4899
14167 #: ../fish/guestfish-actions.pod:4901
14170 " vfs-type device\n"
14175 #: ../fish/guestfish-actions.pod:4903 ../src/guestfs-actions.pod:7376
14177 "This command gets the filesystem type corresponding to the filesystem on "
14182 #: ../fish/guestfish-actions.pod:4906 ../src/guestfs-actions.pod:7379
14184 "For most filesystems, the result is the name of the Linux VFS module which "
14185 "would be used to mount this filesystem if you mounted it without specifying "
14186 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14190 #: ../fish/guestfish-actions.pod:4911
14195 #: ../fish/guestfish-actions.pod:4913
14198 " vfs-uuid device\n"
14203 #: ../fish/guestfish-actions.pod:4915 ../src/guestfs-actions.pod:7395
14204 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14208 #: ../fish/guestfish-actions.pod:4918 ../src/guestfs-actions.pod:7398
14209 msgid "If the filesystem does not have a UUID, this returns the empty string."
14213 #: ../fish/guestfish-actions.pod:4920
14214 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
14218 #: ../fish/guestfish-actions.pod:4922
14219 msgid "vg-activate"
14223 #: ../fish/guestfish-actions.pod:4924
14226 " vg-activate true|false 'volgroups ...'\n"
14231 #: ../fish/guestfish-actions.pod:4926 ../src/guestfs-actions.pod:7414
14233 "This command activates or (if C<activate> is false) deactivates all logical "
14234 "volumes in the listed volume groups C<volgroups>."
14238 #: ../fish/guestfish-actions.pod:4929 ../src/guestfs-actions.pod:7417
14239 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14243 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7419
14245 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14246 "activated or deactivated."
14250 #: ../fish/guestfish-actions.pod:4934
14251 msgid "vg-activate-all"
14255 #: ../fish/guestfish-actions.pod:4936
14258 " vg-activate-all true|false\n"
14263 #: ../fish/guestfish-actions.pod:4938 ../src/guestfs-actions.pod:7432
14265 "This command activates or (if C<activate> is false) deactivates all logical "
14266 "volumes in all volume groups."
14270 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7435
14271 msgid "This command is the same as running C<vgchange -a y|n>"
14275 #: ../fish/guestfish-actions.pod:4943
14280 #: ../fish/guestfish-actions.pod:4945
14283 " vgcreate volgroup 'physvols ...'\n"
14288 #: ../fish/guestfish-actions.pod:4947 ../src/guestfs-actions.pod:7448
14290 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14291 "of physical volumes C<physvols>."
14295 #: ../fish/guestfish-actions.pod:4950
14300 #: ../fish/guestfish-actions.pod:4952
14303 " vglvuuids vgname\n"
14308 #: ../fish/guestfish-actions.pod:4954 ../src/guestfs-actions.pod:7461
14310 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14311 "volumes created in this volume group."
14315 #: ../fish/guestfish-actions.pod:4957
14317 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
14318 "logical volumes and volume groups."
14322 #: ../fish/guestfish-actions.pod:4960
14323 msgid "See also L</vgpvuuids>."
14327 #: ../fish/guestfish-actions.pod:4962
14332 #: ../fish/guestfish-actions.pod:4964
14335 " vgpvuuids vgname\n"
14340 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7481
14342 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14343 "volumes that this volume group resides on."
14347 #: ../fish/guestfish-actions.pod:4969
14349 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
14350 "physical volumes and volume groups."
14354 #: ../fish/guestfish-actions.pod:4972
14355 msgid "See also L</vglvuuids>."
14359 #: ../fish/guestfish-actions.pod:4974
14364 #: ../fish/guestfish-actions.pod:4976
14367 " vgremove vgname\n"
14372 #: ../fish/guestfish-actions.pod:4978 ../src/guestfs-actions.pod:7501
14373 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14377 #: ../fish/guestfish-actions.pod:4980 ../src/guestfs-actions.pod:7503
14378 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
14382 #: ../fish/guestfish-actions.pod:4983
14387 #: ../fish/guestfish-actions.pod:4985
14390 " vgrename volgroup newvolgroup\n"
14395 #: ../fish/guestfish-actions.pod:4987 ../src/guestfs-actions.pod:7517
14396 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14400 #: ../fish/guestfish-actions.pod:4989
14405 #: ../fish/guestfish-actions.pod:4991
14413 #: ../fish/guestfish-actions.pod:4993 ../src/guestfs-actions.pod:7528
14415 "List all the volumes groups detected. This is the equivalent of the "
14416 "L<vgs(8)> command."
14420 #: ../fish/guestfish-actions.pod:4996 ../src/guestfs-actions.pod:7531
14422 "This returns a list of just the volume group names that were detected "
14423 "(eg. C<VolGroup00>)."
14427 #: ../fish/guestfish-actions.pod:4999
14428 msgid "See also L</vgs-full>."
14432 #: ../fish/guestfish-actions.pod:5001
14437 #: ../fish/guestfish-actions.pod:5003
14445 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7547
14447 "List all the volumes groups detected. This is the equivalent of the "
14448 "L<vgs(8)> command. The \"full\" version includes all fields."
14452 #: ../fish/guestfish-actions.pod:5008
14457 #: ../fish/guestfish-actions.pod:5010
14465 #: ../fish/guestfish-actions.pod:5012 ../src/guestfs-actions.pod:7561
14467 "This rescans all block devices and rebuilds the list of LVM physical "
14468 "volumes, volume groups and logical volumes."
14472 #: ../fish/guestfish-actions.pod:5015
14477 #: ../fish/guestfish-actions.pod:5017
14485 #: ../fish/guestfish-actions.pod:5019 ../src/guestfs-actions.pod:7574
14486 msgid "This command returns the UUID of the LVM VG named C<vgname>."
14490 #: ../fish/guestfish-actions.pod:5021
14495 #: ../fish/guestfish-actions.pod:5023
14503 #: ../fish/guestfish-actions.pod:5025 ../src/guestfs-actions.pod:7614
14505 "This command counts the characters in a file, using the C<wc -c> external "
14510 #: ../fish/guestfish-actions.pod:5028
14515 #: ../fish/guestfish-actions.pod:5030
14523 #: ../fish/guestfish-actions.pod:5032 ../src/guestfs-actions.pod:7627
14525 "This command counts the lines in a file, using the C<wc -l> external "
14530 #: ../fish/guestfish-actions.pod:5035
14535 #: ../fish/guestfish-actions.pod:5037
14543 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7640
14545 "This command counts the words in a file, using the C<wc -w> external "
14550 #: ../fish/guestfish-actions.pod:5042
14555 #: ../fish/guestfish-actions.pod:5044
14558 " write path content\n"
14563 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7655
14565 "This call creates a file called C<path>. The content of the file is the "
14566 "string C<content> (which can contain any 8 bit data)."
14570 #: ../fish/guestfish-actions.pod:5049
14571 msgid "See also L</write-append>."
14575 #: ../fish/guestfish-actions.pod:5054
14576 msgid "write-append"
14580 #: ../fish/guestfish-actions.pod:5056
14583 " write-append path content\n"
14588 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7675
14590 "This call appends C<content> to the end of file C<path>. If C<path> does "
14591 "not exist, then a new file is created."
14595 #: ../fish/guestfish-actions.pod:5061
14596 msgid "See also L</write>."
14600 #: ../fish/guestfish-actions.pod:5066
14605 #: ../fish/guestfish-actions.pod:5068
14608 " write-file path content size\n"
14613 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7695
14615 "This call creates a file called C<path>. The contents of the file is the "
14616 "string C<content> (which can contain any 8 bit data), with length C<size>."
14620 #: ../fish/guestfish-actions.pod:5074 ../src/guestfs-actions.pod:7699
14622 "As a special case, if C<size> is C<0> then the length is calculated using "
14623 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
14627 #: ../fish/guestfish-actions.pod:5078 ../src/guestfs-actions.pod:7703
14629 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
14630 "I<not> work, even if the length is specified."
14634 #: ../fish/guestfish-actions.pod:5084 ../src/guestfs-actions.pod:7711
14635 msgid "This function is deprecated. In new code, use the C<write> call instead."
14639 #: ../fish/guestfish-actions.pod:5091
14644 #: ../fish/guestfish-actions.pod:5093
14647 " zegrep regex path\n"
14652 #: ../fish/guestfish-actions.pod:5095 ../src/guestfs-actions.pod:7727
14653 msgid "This calls the external C<zegrep> program and returns the matching lines."
14657 #: ../fish/guestfish-actions.pod:5101
14662 #: ../fish/guestfish-actions.pod:5103
14665 " zegrepi regex path\n"
14670 #: ../fish/guestfish-actions.pod:5105 ../src/guestfs-actions.pod:7746
14671 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
14675 #: ../fish/guestfish-actions.pod:5111
14680 #: ../fish/guestfish-actions.pod:5113
14688 #: ../fish/guestfish-actions.pod:5115 ../src/guestfs-actions.pod:7764
14689 msgid "This command writes zeroes over the first few blocks of C<device>."
14693 #: ../fish/guestfish-actions.pod:5117 ../src/guestfs-actions.pod:7766
14695 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
14696 "securely wipe the device). It should be sufficient to remove any partition "
14697 "tables, filesystem superblocks and so on."
14701 #: ../fish/guestfish-actions.pod:5121
14702 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
14706 #: ../fish/guestfish-actions.pod:5124
14707 msgid "zero-device"
14711 #: ../fish/guestfish-actions.pod:5126
14714 " zero-device device\n"
14719 #: ../fish/guestfish-actions.pod:5128
14721 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
14722 "which just zeroes the first few blocks of a device."
14726 #: ../fish/guestfish-actions.pod:5135
14731 #: ../fish/guestfish-actions.pod:5137
14734 " zerofree device\n"
14739 #: ../fish/guestfish-actions.pod:5139 ../src/guestfs-actions.pod:7810
14741 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14742 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14743 "possible to compress the filesystem more effectively."
14747 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7815
14748 msgid "You should B<not> run this program if the filesystem is mounted."
14752 #: ../fish/guestfish-actions.pod:5147 ../src/guestfs-actions.pod:7818
14754 "It is possible that using this program can damage the filesystem or data on "
14759 #: ../fish/guestfish-actions.pod:5150
14764 #: ../fish/guestfish-actions.pod:5152
14767 " zfgrep pattern path\n"
14772 #: ../fish/guestfish-actions.pod:5154 ../src/guestfs-actions.pod:7832
14773 msgid "This calls the external C<zfgrep> program and returns the matching lines."
14777 #: ../fish/guestfish-actions.pod:5160
14782 #: ../fish/guestfish-actions.pod:5162
14785 " zfgrepi pattern path\n"
14790 #: ../fish/guestfish-actions.pod:5164 ../src/guestfs-actions.pod:7851
14791 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
14795 #: ../fish/guestfish-actions.pod:5170
14800 #: ../fish/guestfish-actions.pod:5172
14803 " zfile meth path\n"
14808 #: ../fish/guestfish-actions.pod:5174 ../src/guestfs-actions.pod:7870
14809 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
14813 #: ../fish/guestfish-actions.pod:5177 ../src/guestfs-actions.pod:7873
14814 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
14818 #: ../fish/guestfish-actions.pod:5179
14819 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
14823 #: ../fish/guestfish-actions.pod:5182 ../src/guestfs-actions.pod:7881
14824 msgid "This function is deprecated. In new code, use the C<file> call instead."
14828 #: ../fish/guestfish-actions.pod:5189
14833 #: ../fish/guestfish-actions.pod:5191
14836 " zgrep regex path\n"
14841 #: ../fish/guestfish-actions.pod:5193 ../src/guestfs-actions.pod:7897
14842 msgid "This calls the external C<zgrep> program and returns the matching lines."
14846 #: ../fish/guestfish-actions.pod:5199
14851 #: ../fish/guestfish-actions.pod:5201
14854 " zgrepi regex path\n"
14859 #: ../fish/guestfish-actions.pod:5203 ../src/guestfs-actions.pod:7916
14860 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
14864 #: ../fish/guestfish-commands.pod:1
14869 #: ../fish/guestfish-commands.pod:3
14874 #: ../fish/guestfish-commands.pod:5
14877 " alloc filename size\n"
14882 #: ../fish/guestfish-commands.pod:7
14884 "This creates an empty (zeroed) file of the given size, and then adds so it "
14885 "can be further examined."
14889 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:182
14890 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
14894 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:184
14895 msgid "Size can be specified using standard suffixes, eg. C<1M>."
14899 #: ../fish/guestfish-commands.pod:14
14901 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
14902 "image, see L</PREPARED DISK IMAGES>."
14906 #: ../fish/guestfish-commands.pod:17
14911 #: ../fish/guestfish-commands.pod:19
14914 " copy-in local [local ...] /remotedir\n"
14919 #: ../fish/guestfish-commands.pod:21
14921 "C<copy-in> copies local files or directories recursively into the disk "
14922 "image, placing them in the directory called C</remotedir> (which must "
14923 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
14924 "other commands as necessary."
14928 #: ../fish/guestfish-commands.pod:26
14930 "Multiple local files and directories can be specified, but the last "
14931 "parameter must always be a remote directory. Wildcards cannot be used."
14935 #: ../fish/guestfish-commands.pod:30
14940 #: ../fish/guestfish-commands.pod:32
14943 " copy-out remote [remote ...] localdir\n"
14948 #: ../fish/guestfish-commands.pod:34
14950 "C<copy-out> copies remote files or directories recursively out of the disk "
14951 "image, placing them on the host disk in a local directory called C<localdir> "
14952 "(which must exist). This guestfish meta-command turns into a sequence of "
14953 "L</download>, L</tar-out> and other commands as necessary."
14957 #: ../fish/guestfish-commands.pod:40
14959 "Multiple remote files and directories can be specified, but the last "
14960 "parameter must always be a local directory. To download to the current "
14961 "directory, use C<.> as in:"
14965 #: ../fish/guestfish-commands.pod:44
14968 " copy-out /home .\n"
14973 #: ../fish/guestfish-commands.pod:46
14975 "Wildcards cannot be used in the ordinary command, but you can use them with "
14976 "the help of L</glob> like this:"
14980 #: ../fish/guestfish-commands.pod:49
14983 " glob copy-out /home/* .\n"
14988 #: ../fish/guestfish-commands.pod:51
14993 #: ../fish/guestfish-commands.pod:53
14996 " display filename\n"
15001 #: ../fish/guestfish-commands.pod:55
15003 "Use C<display> (a graphical display program) to display an image file. It "
15004 "downloads the file, and runs C<display> on it."
15008 #: ../fish/guestfish-commands.pod:58
15010 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15011 "environment variable. For example to use the GNOME display program:"
15015 #: ../fish/guestfish-commands.pod:61
15018 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15023 #: ../fish/guestfish-commands.pod:63
15024 msgid "See also L<display(1)>."
15028 #: ../fish/guestfish-commands.pod:65
15033 #: ../fish/guestfish-commands.pod:67
15036 " echo [params ...]\n"
15041 #: ../fish/guestfish-commands.pod:69
15042 msgid "This echos the parameters to the terminal."
15046 #: ../fish/guestfish-commands.pod:71
15051 #: ../fish/guestfish-commands.pod:73
15056 #: ../fish/guestfish-commands.pod:75
15061 #: ../fish/guestfish-commands.pod:77
15069 #: ../fish/guestfish-commands.pod:79
15071 "This is used to edit a file. It downloads the file, edits it locally using "
15072 "your editor, then uploads the result."
15076 #: ../fish/guestfish-commands.pod:82
15078 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
15079 "or C<emacs> you will get those corresponding editors."
15083 #: ../fish/guestfish-commands.pod:86
15088 #: ../fish/guestfish-commands.pod:88
15091 " glob command args...\n"
15096 #: ../fish/guestfish-commands.pod:90
15098 "Expand wildcards in any paths in the args list, and run C<command> "
15099 "repeatedly on each matching path."
15103 #: ../fish/guestfish-commands.pod:93
15104 msgid "See L</WILDCARDS AND GLOBBING>."
15108 #: ../fish/guestfish-commands.pod:95
15113 #: ../fish/guestfish-commands.pod:97
15116 " hexedit <filename|device>\n"
15117 " hexedit <filename|device> <max>\n"
15118 " hexedit <filename|device> <start> <max>\n"
15123 #: ../fish/guestfish-commands.pod:101
15125 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
15130 #: ../fish/guestfish-commands.pod:104
15132 "This command works by downloading potentially the whole file or device, "
15133 "editing it locally, then uploading it. If the file or device is large, you "
15134 "have to specify which part you wish to edit by using C<max> and/or C<start> "
15135 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
15136 "usual modifiers allowed such as C<1M> (1 megabyte)."
15140 #: ../fish/guestfish-commands.pod:111
15141 msgid "For example to edit the first few sectors of a disk you might do:"
15145 #: ../fish/guestfish-commands.pod:114
15148 " hexedit /dev/sda 1M\n"
15153 #: ../fish/guestfish-commands.pod:116
15155 "which would allow you to edit anywhere within the first megabyte of the "
15160 #: ../fish/guestfish-commands.pod:119
15161 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
15165 #: ../fish/guestfish-commands.pod:121
15168 " hexedit /dev/sda1 0x400 0x400\n"
15173 #: ../fish/guestfish-commands.pod:123
15174 msgid "(assuming the superblock is in the standard location)."
15178 #: ../fish/guestfish-commands.pod:125
15180 "This command requires the external L<hexedit(1)> program. You can specify "
15181 "another program to use by setting the C<HEXEDITOR> environment variable."
15185 #: ../fish/guestfish-commands.pod:129
15186 msgid "See also L</hexdump>."
15190 #: ../fish/guestfish-commands.pod:131
15195 #: ../fish/guestfish-commands.pod:133
15203 #: ../fish/guestfish-commands.pod:135
15204 msgid "Change the local directory, ie. the current directory of guestfish itself."
15208 #: ../fish/guestfish-commands.pod:138
15209 msgid "Note that C<!cd> won't do what you might expect."
15213 #: ../fish/guestfish-commands.pod:140
15218 #: ../fish/guestfish-commands.pod:142
15223 #: ../fish/guestfish-commands.pod:144
15231 #: ../fish/guestfish-commands.pod:146
15232 msgid "Opens the manual page for guestfish."
15236 #: ../fish/guestfish-commands.pod:148
15241 #: ../fish/guestfish-commands.pod:150
15246 #: ../fish/guestfish-commands.pod:152
15254 #: ../fish/guestfish-commands.pod:154
15262 #: ../fish/guestfish-commands.pod:156
15263 msgid "This is used to view a file."
15267 #: ../fish/guestfish-commands.pod:158
15269 "The default viewer is C<$PAGER>. However if you use the alternate command "
15270 "C<less> you will get the C<less> command specifically."
15274 #: ../fish/guestfish-commands.pod:161
15279 #: ../fish/guestfish-commands.pod:163
15287 #: ../fish/guestfish-commands.pod:165
15289 "Close and reopen the libguestfs handle. It is not necessary to use this "
15290 "normally, because the handle is closed properly when guestfish exits. "
15291 "However this is occasionally useful for testing."
15295 #: ../fish/guestfish-commands.pod:169
15300 #: ../fish/guestfish-commands.pod:171
15303 " sparse filename size\n"
15308 #: ../fish/guestfish-commands.pod:173
15310 "This creates an empty sparse file of the given size, and then adds so it can "
15311 "be further examined."
15315 #: ../fish/guestfish-commands.pod:176
15317 "In all respects it works the same as the L</alloc> command, except that the "
15318 "image file is allocated sparsely, which means that disk blocks are not "
15319 "assigned to the file until they are needed. Sparse disk files only use "
15320 "space when written to, but they are slower and there is a danger you could "
15321 "run out of real disk space during a write operation."
15325 #: ../fish/guestfish-commands.pod:186
15330 #: ../fish/guestfish-commands.pod:188
15338 #: ../fish/guestfish-commands.pod:190
15340 "This command returns a list of the optional groups known to the daemon, and "
15341 "indicates which ones are supported by this build of the libguestfs "
15346 #: ../fish/guestfish-commands.pod:194
15347 msgid "See also L<guestfs(3)/AVAILABILITY>."
15351 #: ../fish/guestfish-commands.pod:196
15356 #: ../fish/guestfish-commands.pod:198
15359 " time command args...\n"
15364 #: ../fish/guestfish-commands.pod:200
15366 "Run the command as usual, but print the elapsed time afterwards. This can "
15367 "be useful for benchmarking operations."
15371 #: ../fish/guestfish.pod:5
15372 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15376 #: ../fish/guestfish.pod:9
15379 " guestfish [--options] [commands]\n"
15384 #: ../fish/guestfish.pod:11
15392 #: ../fish/guestfish.pod:13
15395 " guestfish [--ro|--rw] -a disk.img\n"
15400 #: ../fish/guestfish.pod:15
15403 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
15408 #: ../fish/guestfish.pod:17
15411 " guestfish -d libvirt-domain\n"
15416 #: ../fish/guestfish.pod:19
15419 " guestfish [--ro|--rw] -a disk.img -i\n"
15424 #: ../fish/guestfish.pod:21
15427 " guestfish -d libvirt-domain -i\n"
15432 #: ../fish/guestfish.pod:25
15434 "Using guestfish in read/write mode on live virtual machines can be "
15435 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
15436 "option to use guestfish safely if the disk image or virtual machine might be "
15441 #: ../fish/guestfish.pod:32
15443 "Guestfish is a shell and command-line tool for examining and modifying "
15444 "virtual machine filesystems. It uses libguestfs and exposes all of the "
15445 "functionality of the guestfs API, see L<guestfs(3)>."
15449 #: ../fish/guestfish.pod:36
15451 "Guestfish gives you structured access to the libguestfs API, from shell "
15452 "scripts or the command line or interactively. If you want to rescue a "
15453 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
15458 #: ../fish/guestfish.pod:43
15459 msgid "As an interactive shell"
15463 #: ../fish/guestfish.pod:45
15471 #: ../fish/guestfish.pod:47
15474 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
15475 " editing virtual machine filesystems.\n"
15480 #: ../fish/guestfish.pod:50
15483 " Type: 'help' for a list of commands\n"
15484 " 'man' to read the manual\n"
15485 " 'quit' to quit the shell\n"
15490 #: ../fish/guestfish.pod:54
15493 " ><fs> add-ro disk.img\n"
15495 " ><fs> list-filesystems\n"
15496 " /dev/sda1: ext4\n"
15497 " /dev/vg_guest/lv_root: ext4\n"
15498 " /dev/vg_guest/lv_swap: swap\n"
15499 " ><fs> mount /dev/vg_guest/lv_root /\n"
15500 " ><fs> cat /etc/fstab\n"
15502 " # Created by anaconda\n"
15509 #: ../fish/guestfish.pod:67
15510 msgid "From shell scripts"
15514 #: ../fish/guestfish.pod:69
15515 msgid "Create a new C</etc/motd> file in a guest or disk image:"
15519 #: ../fish/guestfish.pod:71
15522 " guestfish <<_EOF_\n"
15525 " mount /dev/vg_guest/lv_root /\n"
15526 " write /etc/motd \"Welcome, new users\"\n"
15532 #: ../fish/guestfish.pod:78
15533 msgid "List the LVM logical volumes in a disk image:"
15537 #: ../fish/guestfish.pod:80
15540 " guestfish -a disk.img --ro <<_EOF_\n"
15548 #: ../fish/guestfish.pod:85
15549 msgid "List all the filesystems in a disk image:"
15553 #: ../fish/guestfish.pod:87
15556 " guestfish -a disk.img --ro <<_EOF_\n"
15558 " list-filesystems\n"
15564 #: ../fish/guestfish.pod:92
15565 msgid "On one command line"
15569 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
15570 msgid "Update C</etc/resolv.conf> in a guest:"
15574 #: ../fish/guestfish.pod:96
15578 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15579 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15584 #: ../fish/guestfish.pod:100
15585 msgid "Edit C</boot/grub/grub.conf> interactively:"
15589 #: ../fish/guestfish.pod:102
15592 " guestfish --rw --add disk.img \\\n"
15593 " --mount /dev/vg_guest/lv_root \\\n"
15594 " --mount /dev/sda1:/boot \\\n"
15595 " edit /boot/grub/grub.conf\n"
15600 #: ../fish/guestfish.pod:107
15601 msgid "Mount disks automatically"
15605 #: ../fish/guestfish.pod:109
15607 "Use the I<-i> option to automatically mount the disks from a virtual "
15612 #: ../fish/guestfish.pod:112
15615 " guestfish --ro -a disk.img -i cat /etc/group\n"
15620 #: ../fish/guestfish.pod:114
15623 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15628 #: ../fish/guestfish.pod:116
15629 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
15633 #: ../fish/guestfish.pod:118
15636 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
15641 #: ../fish/guestfish.pod:120
15642 msgid "As a script interpreter"
15646 #: ../fish/guestfish.pod:122
15647 msgid "Create a 100MB disk containing an ext2-formatted partition:"
15651 #: ../fish/guestfish.pod:124
15654 " #!/usr/bin/guestfish -f\n"
15655 " sparse test1.img 100M\n"
15657 " part-disk /dev/sda mbr\n"
15658 " mkfs ext2 /dev/sda1\n"
15663 #: ../fish/guestfish.pod:130
15664 msgid "Start with a prepared disk"
15668 #: ../fish/guestfish.pod:132
15670 "An alternate way to create a 100MB disk called C<test1.img> containing a "
15671 "single ext2-formatted partition:"
15675 #: ../fish/guestfish.pod:135
15678 " guestfish -N fs\n"
15683 #: ../fish/guestfish.pod:137
15684 msgid "To list what is available do:"
15688 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:998
15691 " guestfish -N help | less\n"
15696 #: ../fish/guestfish.pod:141
15697 msgid "Remote control"
15701 #: ../fish/guestfish.pod:143
15704 " eval \"`guestfish --listen`\"\n"
15705 " guestfish --remote add-ro disk.img\n"
15706 " guestfish --remote run\n"
15707 " guestfish --remote lvs\n"
15712 #: ../fish/guestfish.pod:154
15713 msgid "Displays general help on options."
15717 #: ../fish/guestfish.pod:158
15718 msgid "B<--cmd-help>"
15722 #: ../fish/guestfish.pod:160
15723 msgid "Lists all available guestfish commands."
15727 #: ../fish/guestfish.pod:162
15732 #: ../fish/guestfish.pod:164
15733 msgid "B<--cmd-help cmd>"
15737 #: ../fish/guestfish.pod:166
15738 msgid "Displays detailed help on a single command C<cmd>."
15742 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
15743 msgid "B<-a image>"
15747 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
15748 msgid "B<--add image>"
15752 #: ../fish/guestfish.pod:172
15753 msgid "Add a block device or virtual machine image to the shell."
15757 #: ../fish/guestfish.pod:177
15759 "Using this flag is mostly equivalent to using the C<add> command, with "
15760 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
15761 "the I<--format=...> flag was given."
15765 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
15767 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15768 "URI to use. The default is to use the default libvirt connection."
15772 #: ../fish/guestfish.pod:189
15777 #: ../fish/guestfish.pod:191
15779 "If using the I<--listen> option and a csh-like shell, use this option. See "
15780 "section L</REMOTE CONTROL AND CSH> below."
15784 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
15785 msgid "B<-d libvirt-domain>"
15789 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
15790 msgid "B<--domain libvirt-domain>"
15794 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
15796 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15797 "used, then any libvirt domain can be used. However in write mode, only "
15798 "libvirt domains which are shut down can be named here."
15802 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
15803 msgid "Domain UUIDs can be used instead of names."
15807 #: ../fish/guestfish.pod:204
15809 "Using this flag is mostly equivalent to using the C<add-domain> command, "
15810 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
15811 "if the I<--format:...> flag was given."
15815 #: ../fish/guestfish.pod:208
15820 #: ../fish/guestfish.pod:210
15821 msgid "B<--no-dest-paths>"
15825 #: ../fish/guestfish.pod:212
15827 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15828 "to hit the tab key to complete paths on the guest filesystem, but this "
15829 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15830 "allow this feature to be disabled."
15834 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
15836 "When prompting for keys and passphrases, guestfish normally turns echoing "
15837 "off so you cannot see what you are typing. If you are not worried about "
15838 "Tempest attacks and there is no one else in the room you can specify this "
15839 "flag to see what you are typing."
15843 #: ../fish/guestfish.pod:224
15848 #: ../fish/guestfish.pod:226
15849 msgid "B<--file file>"
15853 #: ../fish/guestfish.pod:228
15854 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15858 #: ../fish/guestfish.pod:231
15861 " #!/usr/bin/guestfish -f\n"
15866 #: ../fish/guestfish.pod:244
15869 " guestfish --format=raw -a disk.img\n"
15874 #: ../fish/guestfish.pod:248
15877 " guestfish --format=raw -a disk.img --format -a another.img\n"
15882 #: ../fish/guestfish.pod:253
15884 "If you have untrusted raw-format guest disk images, you should use this "
15885 "option to specify the disk format. This avoids a possible security problem "
15886 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15890 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
15891 msgid "B<--inspector>"
15895 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
15897 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15898 "system and mount filesystems as they would be mounted on the real virtual "
15903 #: ../fish/guestfish.pod:266
15904 msgid "Typical usage is either:"
15908 #: ../fish/guestfish.pod:268
15911 " guestfish -d myguest -i\n"
15916 #: ../fish/guestfish.pod:270
15917 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15921 #: ../fish/guestfish.pod:272
15924 " guestfish --ro -d myguest -i\n"
15929 #: ../fish/guestfish.pod:274
15930 msgid "(for active domains, readonly), or specify the block device directly:"
15934 #: ../fish/guestfish.pod:276
15937 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
15942 #: ../fish/guestfish.pod:278
15944 "Note that the command line syntax changed slightly over older versions of "
15945 "guestfish. You can still use the old syntax:"
15949 #: ../fish/guestfish.pod:281
15952 " guestfish [--ro] -i disk.img\n"
15957 #: ../fish/guestfish.pod:283
15960 " guestfish [--ro] -i libvirt-domain\n"
15965 #: ../fish/guestfish.pod:285
15967 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
15968 "then using other commands to mount the filesystems that were found."
15972 #: ../fish/guestfish.pod:294
15973 msgid "B<--listen>"
15977 #: ../fish/guestfish.pod:296
15979 "Fork into the background and listen for remote commands. See section "
15980 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15984 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
15989 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
15991 "Connect to a live virtual machine. (Experimental, see "
15992 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
15996 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
15997 msgid "B<-m dev[:mountpoint[:options]]>"
16001 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
16002 msgid "B<--mount dev[:mountpoint[:options]]>"
16006 #: ../fish/guestfish.pod:308
16007 msgid "Mount the named partition or logical volume on the given mountpoint."
16011 #: ../fish/guestfish.pod:310
16012 msgid "If the mountpoint is omitted, it defaults to C</>."
16016 #: ../fish/guestfish.pod:312
16017 msgid "You have to mount something on C</> before most commands will work."
16021 #: ../fish/guestfish.pod:314
16023 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16028 #: ../fish/guestfish.pod:317
16030 "If you don't know what filesystems a disk image contains, you can either run "
16031 "guestfish without this option, then list the partitions, filesystems and LVs "
16032 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
16033 "commands), or you can use the L<virt-filesystems(1)> program."
16037 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
16039 "The third (and rarely used) part of the mount parameter is the list of mount "
16040 "options used to mount the underlying filesystem. If this is not given, then "
16041 "the mount options are either the empty string or C<ro> (the latter if the "
16042 "I<--ro> flag is used). By specifying the mount options, you override this "
16043 "default choice. Probably the only time you would use this is to enable ACLs "
16044 "and/or extended attributes if the filesystem can support them:"
16048 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
16051 " -m /dev/sda1:/:acl,user_xattr\n"
16056 #: ../fish/guestfish.pod:333
16057 msgid "Using this flag is equivalent to using the C<mount-options> command."
16061 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193 ../resize/virt-resize.pod:352
16066 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
16067 msgid "B<--no-sync>"
16071 #: ../fish/guestfish.pod:339
16073 "Disable autosync. This is enabled by default. See the discussion of "
16074 "autosync in the L<guestfs(3)> manpage."
16078 #: ../fish/guestfish.pod:342
16083 #: ../fish/guestfish.pod:344
16084 msgid "B<--new type>"
16088 #: ../fish/guestfish.pod:346
16093 #: ../fish/guestfish.pod:348
16095 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16096 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16097 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16102 #: ../fish/guestfish.pod:353
16103 msgid "B<--progress-bars>"
16107 #: ../fish/guestfish.pod:355
16108 msgid "Enable progress bars, even when guestfish is used non-interactively."
16112 #: ../fish/guestfish.pod:357
16114 "Progress bars are enabled by default when guestfish is used as an "
16115 "interactive shell."
16119 #: ../fish/guestfish.pod:360
16120 msgid "B<--no-progress-bars>"
16124 #: ../fish/guestfish.pod:362
16125 msgid "Disable progress bars."
16129 #: ../fish/guestfish.pod:364
16130 msgid "B<--remote[=pid]>"
16134 #: ../fish/guestfish.pod:366
16136 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16137 "CONTROL GUESTFISH OVER A SOCKET> below."
16141 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239 ../rescue/virt-rescue.pod:161
16146 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241 ../rescue/virt-rescue.pod:163
16151 #: ../fish/guestfish.pod:373
16153 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16154 "mounts are done read-only."
16158 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
16160 "The option must always be used if the disk image or virtual machine might be "
16161 "running, and is generally recommended in cases where you don't need write "
16162 "access to the disk."
16166 #: ../fish/guestfish.pod:380
16168 "Note that prepared disk images created with I<-N> are not affected by this "
16169 "option. Also commands like C<add> are not affected - you have to specify "
16170 "the C<readonly:true> option explicitly if you need it."
16174 #: ../fish/guestfish.pod:384
16175 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16179 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253 ../rescue/virt-rescue.pod:173
16180 msgid "B<--selinux>"
16184 #: ../fish/guestfish.pod:388
16185 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16189 #: ../fish/guestfish.pod:394
16191 "Enable very verbose messages. This is particularly useful if you find a "
16196 #: ../fish/guestfish.pod:401
16197 msgid "Display the guestfish / libguestfs version number and exit."
16201 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269 ../rescue/virt-rescue.pod:190
16206 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271 ../rescue/virt-rescue.pod:192
16211 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
16213 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16214 "mounts are done read-write."
16218 #: ../fish/guestfish.pod:410
16219 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
16223 #: ../fish/guestfish.pod:414
16224 msgid "Echo each command before executing it."
16228 #: ../fish/guestfish.pod:418
16229 msgid "COMMANDS ON COMMAND LINE"
16233 #: ../fish/guestfish.pod:420
16234 msgid "Any additional (non-option) arguments are treated as commands to execute."
16238 #: ../fish/guestfish.pod:423
16240 "Commands to execute should be separated by a colon (C<:>), where the colon "
16241 "is a separate parameter. Thus:"
16245 #: ../fish/guestfish.pod:426
16248 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16253 #: ../fish/guestfish.pod:428
16255 "If there are no additional arguments, then we enter a shell, either an "
16256 "interactive shell with a prompt (if the input is a terminal) or a "
16257 "non-interactive shell."
16261 #: ../fish/guestfish.pod:432
16263 "In either command line mode or non-interactive shell, the first command that "
16264 "gives an error causes the whole shell to exit. In interactive mode (with a "
16265 "prompt) if a command fails, you can continue to enter commands."
16269 #: ../fish/guestfish.pod:437
16270 msgid "USING launch (OR run)"
16274 #: ../fish/guestfish.pod:439
16276 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16277 "then launch it, then mount any disks you need, and finally issue "
16278 "actions/commands. So the general order of the day is:"
16282 #: ../fish/guestfish.pod:447
16283 msgid "add or -a/--add"
16287 #: ../fish/guestfish.pod:451
16288 msgid "launch (aka run)"
16292 #: ../fish/guestfish.pod:455
16293 msgid "mount or -m/--mount"
16297 #: ../fish/guestfish.pod:459
16298 msgid "any other commands"
16302 #: ../fish/guestfish.pod:463
16304 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16305 "guest before mounting or performing any other commands."
16309 #: ../fish/guestfish.pod:466
16311 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16312 "I<--new> options were given then C<run> is done automatically, simply "
16313 "because guestfish can't perform the action you asked for without doing this."
16317 #: ../fish/guestfish.pod:471
16318 msgid "OPENING DISKS FOR READ AND WRITE"
16322 #: ../fish/guestfish.pod:473
16324 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
16325 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
16326 "I<-i> and I<-m> open disk images read-only or for writing."
16330 #: ../fish/guestfish.pod:478
16332 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
16333 "opening disk images supplied on the command line for write. To open a disk "
16334 "image read-only you have to do I<-a image --ro>."
16338 #: ../fish/guestfish.pod:482
16340 "This matters: If you accidentally open a live VM disk image writable then "
16341 "you will cause irreversible disk corruption."
16345 #: ../fish/guestfish.pod:485
16347 "In a future libguestfs we intend to change the default the other way. Disk "
16348 "images will be opened read-only. You will have to either specify "
16349 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
16350 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
16351 "access for disk images specified by those other command line options."
16355 #: ../fish/guestfish.pod:492
16357 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
16358 "which does nothing (it is already the default). However it is highly "
16359 "recommended that you use this option to indicate that you need write access, "
16360 "and prepare your scripts for the day when this option will be required for "
16365 #: ../fish/guestfish.pod:498
16367 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
16368 "other libguestfs program apart from guestfish and guestmount."
16372 #: ../fish/guestfish.pod:501
16377 #: ../fish/guestfish.pod:503
16379 "You can quote ordinary parameters using either single or double quotes. For "
16384 #: ../fish/guestfish.pod:506
16387 " add \"file with a space.img\"\n"
16392 #: ../fish/guestfish.pod:508
16395 " rm '/file name'\n"
16400 #: ../fish/guestfish.pod:510
16408 #: ../fish/guestfish.pod:512
16410 "A few commands require a list of strings to be passed. For these, use a "
16411 "whitespace-separated list, enclosed in quotes. Strings containing "
16412 "whitespace to be passed through must be enclosed in single quotes. A "
16413 "literal single quote must be escaped with a backslash."
16417 #: ../fish/guestfish.pod:517
16420 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
16421 " command \"/bin/echo 'foo bar'\"\n"
16422 " command \"/bin/echo \\'foo\\'\"\n"
16427 #: ../fish/guestfish.pod:521
16428 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
16432 #: ../fish/guestfish.pod:523
16434 "In double-quoted arguments (only) use backslash to insert special "
16439 #: ../fish/guestfish.pod:528
16444 #: ../fish/guestfish.pod:530
16445 msgid "Alert (bell) character."
16449 #: ../fish/guestfish.pod:532
16454 #: ../fish/guestfish.pod:534
16455 msgid "Backspace character."
16459 #: ../fish/guestfish.pod:536
16464 #: ../fish/guestfish.pod:538
16465 msgid "Form feed character."
16469 #: ../fish/guestfish.pod:540
16474 #: ../fish/guestfish.pod:542
16475 msgid "Newline character."
16479 #: ../fish/guestfish.pod:544
16484 #: ../fish/guestfish.pod:546
16485 msgid "Carriage return character."
16489 #: ../fish/guestfish.pod:548
16494 #: ../fish/guestfish.pod:550
16495 msgid "Horizontal tab character."
16499 #: ../fish/guestfish.pod:552
16504 #: ../fish/guestfish.pod:554
16505 msgid "Vertical tab character."
16509 #: ../fish/guestfish.pod:556
16514 #: ../fish/guestfish.pod:558
16515 msgid "A literal double quote character."
16519 #: ../fish/guestfish.pod:560
16524 #: ../fish/guestfish.pod:562
16526 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
16531 #: ../fish/guestfish.pod:565
16536 #: ../fish/guestfish.pod:567
16537 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
16541 #: ../fish/guestfish.pod:570
16543 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
16548 #: ../fish/guestfish.pod:573
16553 #: ../fish/guestfish.pod:575
16554 msgid "A literal backslash character."
16558 #: ../fish/guestfish.pod:579
16559 msgid "OPTIONAL ARGUMENTS"
16563 #: ../fish/guestfish.pod:581
16565 "Some commands take optional arguments. These arguments appear in this "
16566 "documentation as C<[argname:..]>. You can use them as in these examples:"
16570 #: ../fish/guestfish.pod:585
16573 " add-drive-opts filename\n"
16578 #: ../fish/guestfish.pod:587
16581 " add-drive-opts filename readonly:true\n"
16586 #: ../fish/guestfish.pod:589
16589 " add-drive-opts filename format:qcow2 readonly:false\n"
16594 #: ../fish/guestfish.pod:591
16596 "Each optional argument can appear at most once. All optional arguments must "
16597 "appear after the required ones."
16601 #: ../fish/guestfish.pod:594
16606 #: ../fish/guestfish.pod:596
16607 msgid "This section applies to all commands which can take integers as parameters."
16611 #: ../fish/guestfish.pod:599
16612 msgid "SIZE SUFFIX"
16616 #: ../fish/guestfish.pod:601
16618 "When the command takes a parameter measured in bytes, you can use one of the "
16619 "following suffixes to specify kilobytes, megabytes and larger sizes:"
16623 #: ../fish/guestfish.pod:607
16624 msgid "B<k> or B<K> or B<KiB>"
16628 #: ../fish/guestfish.pod:609
16629 msgid "The size in kilobytes (multiplied by 1024)."
16633 #: ../fish/guestfish.pod:611
16638 #: ../fish/guestfish.pod:613
16639 msgid "The size in SI 1000 byte units."
16643 #: ../fish/guestfish.pod:615
16644 msgid "B<M> or B<MiB>"
16648 #: ../fish/guestfish.pod:617
16649 msgid "The size in megabytes (multiplied by 1048576)."
16653 #: ../fish/guestfish.pod:619
16658 #: ../fish/guestfish.pod:621
16659 msgid "The size in SI 1000000 byte units."
16663 #: ../fish/guestfish.pod:623
16664 msgid "B<G> or B<GiB>"
16668 #: ../fish/guestfish.pod:625
16669 msgid "The size in gigabytes (multiplied by 2**30)."
16673 #: ../fish/guestfish.pod:627
16678 #: ../fish/guestfish.pod:629
16679 msgid "The size in SI 10**9 byte units."
16683 #: ../fish/guestfish.pod:631
16684 msgid "B<T> or B<TiB>"
16688 #: ../fish/guestfish.pod:633
16689 msgid "The size in terabytes (multiplied by 2**40)."
16693 #: ../fish/guestfish.pod:635
16698 #: ../fish/guestfish.pod:637
16699 msgid "The size in SI 10**12 byte units."
16703 #: ../fish/guestfish.pod:639
16704 msgid "B<P> or B<PiB>"
16708 #: ../fish/guestfish.pod:641
16709 msgid "The size in petabytes (multiplied by 2**50)."
16713 #: ../fish/guestfish.pod:643
16718 #: ../fish/guestfish.pod:645
16719 msgid "The size in SI 10**15 byte units."
16723 #: ../fish/guestfish.pod:647
16724 msgid "B<E> or B<EiB>"
16728 #: ../fish/guestfish.pod:649
16729 msgid "The size in exabytes (multiplied by 2**60)."
16733 #: ../fish/guestfish.pod:651
16738 #: ../fish/guestfish.pod:653
16739 msgid "The size in SI 10**18 byte units."
16743 #: ../fish/guestfish.pod:655
16744 msgid "B<Z> or B<ZiB>"
16748 #: ../fish/guestfish.pod:657
16749 msgid "The size in zettabytes (multiplied by 2**70)."
16753 #: ../fish/guestfish.pod:659
16758 #: ../fish/guestfish.pod:661
16759 msgid "The size in SI 10**21 byte units."
16763 #: ../fish/guestfish.pod:663
16764 msgid "B<Y> or B<YiB>"
16768 #: ../fish/guestfish.pod:665
16769 msgid "The size in yottabytes (multiplied by 2**80)."
16773 #: ../fish/guestfish.pod:667
16778 #: ../fish/guestfish.pod:669
16779 msgid "The size in SI 10**24 byte units."
16783 #: ../fish/guestfish.pod:675
16786 " truncate-size /file 1G\n"
16791 #: ../fish/guestfish.pod:677
16792 msgid "would truncate the file to 1 gigabyte."
16796 #: ../fish/guestfish.pod:679
16798 "Be careful because a few commands take sizes in kilobytes or megabytes "
16799 "(eg. the parameter to L</memsize> is specified in megabytes already). "
16800 "Adding a suffix will probably not do what you expect."
16804 #: ../fish/guestfish.pod:683
16805 msgid "OCTAL AND HEXADECIMAL NUMBERS"
16809 #: ../fish/guestfish.pod:685
16811 "For specifying the radix (base) use the C convention: C<0> to prefix an "
16812 "octal number or C<0x> to prefix a hexadecimal number. For example:"
16816 #: ../fish/guestfish.pod:688
16819 " 1234 decimal number 1234\n"
16820 " 02322 octal number, equivalent to decimal 1234\n"
16821 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
16826 #: ../fish/guestfish.pod:692
16828 "When using the C<chmod> command, you almost always want to specify an octal "
16829 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
16830 "L<chmod(1)> program):"
16834 #: ../fish/guestfish.pod:696
16837 " chmod 0777 /public # OK\n"
16838 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
16843 #: ../fish/guestfish.pod:699
16845 "Commands that return numbers usually print them in decimal, but some "
16846 "commands print numbers in other radices (eg. C<umask> prints the mode in "
16847 "octal, preceeded by C<0>)."
16851 #: ../fish/guestfish.pod:703
16852 msgid "WILDCARDS AND GLOBBING"
16856 #: ../fish/guestfish.pod:705
16858 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
16859 "(globbing) by default. So for example the following will not do what you "
16864 #: ../fish/guestfish.pod:709
16872 #: ../fish/guestfish.pod:711
16874 "Assuming you don't have a directory called literally C</home/*> then the "
16875 "above command will return an error."
16879 #: ../fish/guestfish.pod:714
16880 msgid "To perform wildcard expansion, use the C<glob> command."
16884 #: ../fish/guestfish.pod:716
16887 " glob rm-rf /home/*\n"
16892 #: ../fish/guestfish.pod:718
16894 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
16895 "many times), equivalent to:"
16899 #: ../fish/guestfish.pod:721
16902 " rm-rf /home/jim\n"
16903 " rm-rf /home/joe\n"
16904 " rm-rf /home/mary\n"
16909 #: ../fish/guestfish.pod:725
16910 msgid "C<glob> only works on simple guest paths and not on device names."
16914 #: ../fish/guestfish.pod:727
16916 "If you have several parameters, each containing a wildcard, then glob will "
16917 "perform a Cartesian product."
16921 #: ../fish/guestfish.pod:730
16926 #: ../fish/guestfish.pod:732
16928 "Any line which starts with a I<#> character is treated as a comment and "
16929 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
16930 "a command. For example:"
16934 #: ../fish/guestfish.pod:736
16937 " # this is a comment\n"
16938 " # this is a comment\n"
16939 " foo # NOT a comment\n"
16944 #: ../fish/guestfish.pod:740
16945 msgid "Blank lines are also ignored."
16949 #: ../fish/guestfish.pod:742
16950 msgid "RUNNING COMMANDS LOCALLY"
16954 #: ../fish/guestfish.pod:744
16956 "Any line which starts with a I<!> character is treated as a command sent to "
16957 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
16961 #: ../fish/guestfish.pod:748
16965 " tgz-out /remote local/remote-data.tar.gz\n"
16970 #: ../fish/guestfish.pod:751
16972 "will create a directory C<local> on the host, and then export the contents "
16973 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
16974 "(See C<tgz-out>)."
16978 #: ../fish/guestfish.pod:755
16980 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
16981 "effect, due to the way that subprocesses work in Unix."
16985 #: ../fish/guestfish.pod:758
16986 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
16990 #: ../fish/guestfish.pod:760
16992 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
16993 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
16994 "and executed as guestfish commands."
16998 #: ../fish/guestfish.pod:764
17000 "Thus you can use shell script to construct arbitrary guestfish commands "
17001 "which are then parsed by guestfish."
17005 #: ../fish/guestfish.pod:767
17007 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
17008 "through C</foo.100>) using guestfish commands alone. However this is simple "
17009 "if we use a shell script to create the guestfish commands for us:"
17013 #: ../fish/guestfish.pod:772
17016 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
17021 #: ../fish/guestfish.pod:774
17022 msgid "or with names like C</foo.001>:"
17026 #: ../fish/guestfish.pod:776
17029 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
17034 #: ../fish/guestfish.pod:778
17036 "When using guestfish interactively it can be helpful to just run the shell "
17037 "script first (ie. remove the initial C<E<lt>> character so it is just an "
17038 "ordinary I<!> local command), see what guestfish commands it would run, and "
17039 "when you are happy with those prepend the C<E<lt>> character to run the "
17040 "guestfish commands for real."
17044 #: ../fish/guestfish.pod:784
17049 #: ../fish/guestfish.pod:786
17051 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17052 "command (a guestfish command) to the second command (any host command). For "
17057 #: ../fish/guestfish.pod:790
17060 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17065 #: ../fish/guestfish.pod:792
17067 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17068 "program). The above command would list all accounts in the guest filesystem "
17069 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17073 #: ../fish/guestfish.pod:797
17076 " hexdump /bin/ls | head\n"
17077 " list-devices | tail -1\n"
17078 " tgz-out / - | tar ztf -\n"
17083 #: ../fish/guestfish.pod:801
17085 "The space before the pipe symbol is required, any space after the pipe "
17086 "symbol is optional. Everything after the pipe symbol is just passed "
17087 "straight to the host shell, so it can contain redirections, globs and "
17088 "anything else that makes sense on the host side."
17092 #: ../fish/guestfish.pod:806
17094 "To use a literal argument which begins with a pipe symbol, you have to quote "
17099 #: ../fish/guestfish.pod:809
17107 #: ../fish/guestfish.pod:811
17108 msgid "HOME DIRECTORIES"
17112 #: ../fish/guestfish.pod:813
17114 "If a parameter starts with the character C<~> then the tilde may be expanded "
17115 "as a home directory path (either C<~> for the current user's home directory, "
17116 "or C<~user> for another user)."
17120 #: ../fish/guestfish.pod:817
17122 "Note that home directory expansion happens for users known I<on the host>, "
17123 "not in the guest filesystem."
17127 #: ../fish/guestfish.pod:820
17129 "To use a literal argument which begins with a tilde, you have to quote it, "
17134 #: ../fish/guestfish.pod:823
17142 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
17143 msgid "ENCRYPTED DISKS"
17147 #: ../fish/guestfish.pod:827
17149 "Libguestfs has some support for Linux guests encrypted according to the "
17150 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17151 "disk encryption systems used by modern Linux guests. Currently only "
17152 "LVM-on-LUKS is supported."
17156 #: ../fish/guestfish.pod:832
17157 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17161 #: ../fish/guestfish.pod:834
17164 " ><fs> vfs-type /dev/sda2\n"
17170 #: ../fish/guestfish.pod:837
17172 "Then open those devices using L</luks-open>. This creates a device-mapper "
17173 "device called C</dev/mapper/luksdev>."
17177 #: ../fish/guestfish.pod:840
17180 " ><fs> luks-open /dev/sda2 luksdev\n"
17181 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17186 #: ../fish/guestfish.pod:843
17188 "Finally you have to tell LVM to scan for volume groups on the newly created "
17193 #: ../fish/guestfish.pod:846
17197 " vg-activate-all true\n"
17202 #: ../fish/guestfish.pod:849
17203 msgid "The logical volume(s) can now be mounted in the usual way."
17207 #: ../fish/guestfish.pod:851
17209 "Before closing a LUKS device you must unmount any logical volumes on it and "
17210 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17211 "one. Then you can close the mapper device:"
17215 #: ../fish/guestfish.pod:855
17218 " vg-activate false /dev/VG\n"
17219 " luks-close /dev/mapper/luksdev\n"
17224 #: ../fish/guestfish.pod:860
17226 "If a path is prefixed with C<win:> then you can use Windows-style drive "
17227 "letters and paths (with some limitations). The following commands are "
17232 #: ../fish/guestfish.pod:864
17235 " file /WINDOWS/system32/config/system.LOG\n"
17240 #: ../fish/guestfish.pod:866
17243 " file win:\\windows\\system32\\config\\system.log\n"
17248 #: ../fish/guestfish.pod:868
17251 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
17256 #: ../fish/guestfish.pod:870
17258 "The parameter is rewritten \"behind the scenes\" by looking up the position "
17259 "where the drive is mounted, prepending that to the path, changing all "
17260 "backslash characters to forward slash, then resolving the result using "
17261 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
17262 "then the parameter might be rewritten like this:"
17266 #: ../fish/guestfish.pod:876
17269 " win:e:\\foo\\bar => /e/FOO/bar\n"
17274 #: ../fish/guestfish.pod:878
17275 msgid "This only works in argument positions that expect a path."
17279 #: ../fish/guestfish.pod:880
17280 msgid "UPLOADING AND DOWNLOADING FILES"
17284 #: ../fish/guestfish.pod:882
17286 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17287 "others which upload from or download to a local file, you can use the "
17288 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17292 #: ../fish/guestfish.pod:886
17300 #: ../fish/guestfish.pod:888
17301 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
17305 #: ../fish/guestfish.pod:891
17308 " tar-out /etc - | tar tf -\n"
17313 #: ../fish/guestfish.pod:893
17315 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17316 "command (see L</PIPES>)."
17320 #: ../fish/guestfish.pod:896
17322 "When using C<-> to read from stdin, the input is read up to the end of "
17323 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17324 "some arbitrary end marker:"
17328 #: ../fish/guestfish.pod:900
17331 " upload -<<END /foo\n"
17340 #: ../fish/guestfish.pod:906
17342 "Any string of characters can be used instead of C<END>. The end marker must "
17343 "appear on a line of its own, without any preceeding or following characters "
17344 "(not even spaces)."
17348 #: ../fish/guestfish.pod:910
17350 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
17351 "upload local files (so-called \"FileIn\" parameters in the generator)."
17355 #: ../fish/guestfish.pod:913
17356 msgid "EXIT ON ERROR BEHAVIOUR"
17360 #: ../fish/guestfish.pod:915
17362 "By default, guestfish will ignore any errors when in interactive mode "
17363 "(ie. taking commands from a human over a tty), and will exit on the first "
17364 "error in non-interactive mode (scripts, commands given on the command line)."
17368 #: ../fish/guestfish.pod:920
17370 "If you prefix a command with a I<-> character, then that command will not "
17371 "cause guestfish to exit, even if that (one) command returns an error."
17375 #: ../fish/guestfish.pod:924
17376 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
17380 #: ../fish/guestfish.pod:926
17382 "Guestfish can be remote-controlled over a socket. This is useful "
17383 "particularly in shell scripts where you want to make several different "
17384 "changes to a filesystem, but you don't want the overhead of starting up a "
17385 "guestfish process each time."
17389 #: ../fish/guestfish.pod:931
17390 msgid "Start a guestfish server process using:"
17394 #: ../fish/guestfish.pod:933
17397 " eval \"`guestfish --listen`\"\n"
17402 #: ../fish/guestfish.pod:935
17403 msgid "and then send it commands by doing:"
17407 #: ../fish/guestfish.pod:937
17410 " guestfish --remote cmd [...]\n"
17415 #: ../fish/guestfish.pod:939
17416 msgid "To cause the server to exit, send it the exit command:"
17420 #: ../fish/guestfish.pod:943
17422 "Note that the server will normally exit if there is an error in a command. "
17423 "You can change this in the usual way. See section L</EXIT ON ERROR "
17428 #: ../fish/guestfish.pod:947
17429 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
17433 #: ../fish/guestfish.pod:949
17435 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
17436 "is how the I<--remote> option knows where to send the commands. You can "
17437 "have several guestfish listener processes running using:"
17441 #: ../fish/guestfish.pod:953
17444 " eval \"`guestfish --listen`\"\n"
17445 " pid1=$GUESTFISH_PID\n"
17446 " eval \"`guestfish --listen`\"\n"
17447 " pid2=$GUESTFISH_PID\n"
17449 " guestfish --remote=$pid1 cmd\n"
17450 " guestfish --remote=$pid2 cmd\n"
17455 #: ../fish/guestfish.pod:961
17456 msgid "REMOTE CONTROL AND CSH"
17460 #: ../fish/guestfish.pod:963
17462 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
17467 #: ../fish/guestfish.pod:966
17470 " eval \"`guestfish --listen --csh`\"\n"
17475 #: ../fish/guestfish.pod:968
17476 msgid "REMOTE CONTROL DETAILS"
17480 #: ../fish/guestfish.pod:970
17482 "Remote control happens over a Unix domain socket called "
17483 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
17484 "of the process, and C<$PID> is the process ID of the server."
17488 #: ../fish/guestfish.pod:974
17489 msgid "Guestfish client and server versions must match exactly."
17493 #: ../fish/guestfish.pod:976
17494 msgid "PREPARED DISK IMAGES"
17498 #: ../fish/guestfish.pod:978
17500 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
17501 "preformatted disk images that guestfish can make for you to save typing. "
17502 "This is particularly useful for testing purposes. This option is used "
17503 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
17504 "can be mixed with I<-a>)."
17508 #: ../fish/guestfish.pod:984
17510 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
17511 "the second and so on. Existing files in the current directory are "
17516 #: ../fish/guestfish.pod:988
17518 "The type briefly describes how the disk should be sized, partitioned, how "
17519 "filesystem(s) should be created, and how content should be added. "
17520 "Optionally the type can be followed by extra parameters, separated by C<:> "
17521 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
17522 "sparsely-allocated disk, containing a single partition, with the partition "
17523 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
17524 "on a 1GB disk instead."
17528 #: ../fish/guestfish.pod:996
17529 msgid "To list the available types and any extra parameters they take, run:"
17533 #: ../fish/guestfish.pod:1000
17535 "Note that the prepared filesystem is not mounted. You would usually have to "
17536 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
17540 #: ../fish/guestfish.pod:1004
17542 "If any I<-N> or I<--new> options are given, the guest is automatically "
17547 #: ../fish/guestfish.pod:1009
17548 msgid "Create a 100MB disk with an ext4-formatted partition:"
17552 #: ../fish/guestfish.pod:1011
17555 " guestfish -N fs:ext4\n"
17560 #: ../fish/guestfish.pod:1013
17561 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
17565 #: ../fish/guestfish.pod:1015
17568 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
17573 #: ../fish/guestfish.pod:1017
17574 msgid "Create a blank 200MB disk:"
17578 #: ../fish/guestfish.pod:1019
17581 " guestfish -N disk:200M\n"
17586 #: ../fish/guestfish.pod:1021
17587 msgid "PROGRESS BARS"
17591 #: ../fish/guestfish.pod:1023
17593 "Some (not all) long-running commands send progress notification messages as "
17594 "they are running. Guestfish turns these messages into progress bars."
17598 #: ../fish/guestfish.pod:1027
17600 "When a command that supports progress bars takes longer than two seconds to "
17601 "run, and if progress bars are enabled, then you will see one appearing below "
17606 #: ../fish/guestfish.pod:1031
17609 " ><fs> copy-size /large-file /another-file 2048M\n"
17610 " / 10% [#####-----------------------------------------] 00:30\n"
17615 #: ../fish/guestfish.pod:1034
17617 "The spinner on the left hand side moves round once for every progress "
17618 "notification received from the backend. This is a (reasonably) golden "
17619 "assurance that the command is \"doing something\" even if the progress bar "
17620 "is not moving, because the command is able to send the progress "
17621 "notifications. When the bar reaches 100% and the command finishes, the "
17622 "spinner disappears."
17626 #: ../fish/guestfish.pod:1041
17628 "Progress bars are enabled by default when guestfish is used interactively. "
17629 "You can enable them even for non-interactive modes using I<--progress-bars>, "
17630 "and you can disable them completely using I<--no-progress-bars>."
17634 #: ../fish/guestfish.pod:1046
17635 msgid "GUESTFISH COMMANDS"
17639 #: ../fish/guestfish.pod:1048
17641 "The commands in this section are guestfish convenience commands, in other "
17642 "words, they are not part of the L<guestfs(3)> API."
17646 #: ../fish/guestfish.pod:1051
17651 #: ../fish/guestfish.pod:1053
17660 #: ../fish/guestfish.pod:1056
17661 msgid "Without any parameter, this provides general help."
17665 #: ../fish/guestfish.pod:1058
17666 msgid "With a C<cmd> parameter, this displays detailed help for that command."
17670 #: ../fish/guestfish.pod:1060
17671 msgid "quit | exit"
17675 #: ../fish/guestfish.pod:1062
17676 msgid "This exits guestfish. You can also use C<^D> key."
17680 #: ../fish/guestfish.pod:1064
17681 msgid "@FISH_COMMANDS@"
17685 #: ../fish/guestfish.pod:1066
17690 #: ../fish/guestfish.pod:1068 ../src/guestfs.pod:1474
17695 #: ../fish/guestfish.pod:1070 ../test-tool/libguestfs-test-tool.pod:77
17700 #: ../fish/guestfish.pod:1072
17702 "guestfish returns 0 if the commands completed without error, or 1 if there "
17707 #: ../fish/guestfish.pod:1079
17712 #: ../fish/guestfish.pod:1081
17714 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
17719 #: ../fish/guestfish.pod:1084 ../src/guestfs.pod:2969
17720 msgid "FEBOOTSTRAP_KERNEL"
17724 #: ../fish/guestfish.pod:1086 ../src/guestfs.pod:2971
17725 msgid "FEBOOTSTRAP_MODULES"
17729 #: ../fish/guestfish.pod:1088 ../src/guestfs.pod:2973
17731 "These two environment variables allow the kernel that libguestfs uses in the "
17732 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
17733 "most recent host kernel is chosen. For more information about kernel "
17734 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
17735 "available in febootstrap E<ge> 3.8."
17739 #: ../fish/guestfish.pod:1094
17740 msgid "GUESTFISH_DISPLAY_IMAGE"
17744 #: ../fish/guestfish.pod:1096
17746 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
17747 "If not set, it uses L<display(1)>."
17751 #: ../fish/guestfish.pod:1099
17752 msgid "GUESTFISH_PID"
17756 #: ../fish/guestfish.pod:1101
17758 "Used with the I<--remote> option to specify the remote guestfish process to "
17759 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
17763 #: ../fish/guestfish.pod:1105
17768 #: ../fish/guestfish.pod:1107
17770 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
17771 "not specified, the external L<hexedit(1)> program is used."
17775 #: ../fish/guestfish.pod:1111
17780 #: ../fish/guestfish.pod:1113
17782 "If compiled with GNU readline support, various files in the home directory "
17783 "can be used. See L</FILES>."
17787 #: ../fish/guestfish.pod:1116 ../src/guestfs.pod:2979
17788 msgid "LIBGUESTFS_APPEND"
17792 #: ../fish/guestfish.pod:1118 ../src/guestfs.pod:2981
17793 msgid "Pass additional options to the guest kernel."
17797 #: ../fish/guestfish.pod:1120 ../src/guestfs.pod:2983
17798 msgid "LIBGUESTFS_DEBUG"
17802 #: ../fish/guestfish.pod:1122
17804 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
17805 "effect as using the B<-v> option."
17809 #: ../fish/guestfish.pod:1125 ../src/guestfs.pod:2988
17810 msgid "LIBGUESTFS_MEMSIZE"
17814 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:2990
17815 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
17819 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:2993
17822 " LIBGUESTFS_MEMSIZE=700\n"
17827 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:2995
17828 msgid "LIBGUESTFS_PATH"
17832 #: ../fish/guestfish.pod:1134
17834 "Set the path that guestfish uses to search for kernel and initrd.img. See "
17835 "the discussion of paths in L<guestfs(3)>."
17839 #: ../fish/guestfish.pod:1137 ../src/guestfs.pod:3000
17840 msgid "LIBGUESTFS_QEMU"
17844 #: ../fish/guestfish.pod:1139 ../src/guestfs.pod:3002
17846 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
17847 "which was found at compile time by the configure script is used."
17851 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3008
17852 msgid "LIBGUESTFS_TRACE"
17856 #: ../fish/guestfish.pod:1145
17857 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
17861 #: ../fish/guestfish.pod:1147
17866 #: ../fish/guestfish.pod:1149
17868 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
17873 #: ../fish/guestfish.pod:1152 ../src/guestfs.pod:3013
17878 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3015
17880 "Location of temporary directory, defaults to C</tmp> except for the cached "
17881 "supermin appliance which defaults to C</var/tmp>."
17885 #: ../fish/guestfish.pod:1157 ../src/guestfs.pod:3018
17887 "If libguestfs was compiled to use the supermin appliance then the real "
17888 "appliance is cached in this directory, shared between all handles belonging "
17889 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
17890 "use in case C</var/tmp> is not large enough."
17894 #: ../fish/guestfish.pod:1165 ../fuse/guestmount.pod:288 ../rescue/virt-rescue.pod:269
17899 #: ../fish/guestfish.pod:1169 ../fuse/guestmount.pod:292 ../rescue/virt-rescue.pod:273
17900 msgid "$HOME/.libguestfs-tools.rc"
17904 #: ../fish/guestfish.pod:1171 ../fuse/guestmount.pod:294 ../rescue/virt-rescue.pod:275
17905 msgid "/etc/libguestfs-tools.conf"
17909 #: ../fish/guestfish.pod:1173 ../fuse/guestmount.pod:296 ../rescue/virt-rescue.pod:277
17911 "This configuration file controls the default read-only or read-write mode "
17912 "(I<--ro> or I<--rw>)."
17916 #: ../fish/guestfish.pod:1176
17917 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
17921 #: ../fish/guestfish.pod:1178
17922 msgid "$HOME/.guestfish"
17926 #: ../fish/guestfish.pod:1180
17928 "If compiled with GNU readline support, then the command history is saved in "
17933 #: ../fish/guestfish.pod:1183
17934 msgid "$HOME/.inputrc"
17938 #: ../fish/guestfish.pod:1185
17939 msgid "/etc/inputrc"
17943 #: ../fish/guestfish.pod:1187
17945 "If compiled with GNU readline support, then these files can be used to "
17946 "configure readline. For further information, please see "
17947 "L<readline(3)/INITIALIZATION FILE>."
17951 #: ../fish/guestfish.pod:1191
17952 msgid "To write rules which only apply to guestfish, use:"
17956 #: ../fish/guestfish.pod:1193
17966 #: ../fish/guestfish.pod:1197
17968 "Variables that you can set in inputrc that change the behaviour of guestfish "
17969 "in useful ways include:"
17973 #: ../fish/guestfish.pod:1202
17974 msgid "completion-ignore-case (default: on)"
17978 #: ../fish/guestfish.pod:1204
17980 "By default, guestfish will ignore case when tab-completing paths on the "
17985 #: ../fish/guestfish.pod:1207
17988 " set completion-ignore-case off\n"
17993 #: ../fish/guestfish.pod:1209
17994 msgid "to make guestfish case sensitive."
17998 #: ../fish/guestfish.pod:1213
18003 #: ../fish/guestfish.pod:1215
18004 msgid "test2.img (etc)"
18008 #: ../fish/guestfish.pod:1217
18010 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18011 "will be created in the file C<test1.img> in the current directory. The "
18012 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18013 "the same name will be overwritten."
18017 #: ../fish/guestfish.pod:1226
18019 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, "
18020 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
18021 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
18022 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
18023 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
18024 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
18025 "L<febootstrap-supermin-helper(8)>."
18029 #: ../fish/guestfish.pod:1255 ../src/guestfs.pod:3104 ../test-tool/libguestfs-test-tool.pod:99
18030 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18034 #: ../fish/virt-copy-in.pod:5
18035 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
18039 #: ../fish/virt-copy-in.pod:9
18042 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18047 #: ../fish/virt-copy-in.pod:11
18050 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18055 #: ../fish/virt-copy-in.pod:15
18057 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18058 "causing disk corruption. The virtual machine must be shut down before you "
18059 "use this command."
18063 #: ../fish/virt-copy-in.pod:21
18065 "C<virt-copy-in> copies files and directories from the local disk into a "
18066 "virtual machine disk image or named libvirt domain."
18070 #: ../fish/virt-copy-in.pod:24
18072 "You can give one of more filenames and directories on the command line. "
18073 "Directories are copied in recursively. The final parameter must be the "
18074 "destination directory in the disk image which must be an absolute path "
18075 "starting with a C</> character."
18079 #: ../fish/virt-copy-in.pod:33
18082 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18087 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18088 msgid "Upload a home directory to a guest:"
18092 #: ../fish/virt-copy-in.pod:37
18095 " virt-copy-in -d MyGuest skel /home\n"
18100 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18101 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18105 #: ../fish/virt-copy-in.pod:41
18107 "This command is just a simple shell script wrapper around the "
18108 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
18109 "trivial copy, you are probably better off using guestfish directly."
18113 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18115 "Since the shell script just passes options straight to guestfish, read "
18116 "L<guestfish(1)> to see the full list of options."
18120 #: ../fish/virt-copy-in.pod:52
18122 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18123 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18127 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18128 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18132 #: ../fish/virt-copy-out.pod:5
18134 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18139 #: ../fish/virt-copy-out.pod:9
18142 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18147 #: ../fish/virt-copy-out.pod:11
18150 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18155 #: ../fish/virt-copy-out.pod:15
18157 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18158 "image or named libvirt domain."
18162 #: ../fish/virt-copy-out.pod:18
18164 "You can give one of more filenames and directories on the command line. "
18165 "Directories are copied out recursively."
18169 #: ../fish/virt-copy-out.pod:23
18170 msgid "Download the home directories from a virtual machine:"
18174 #: ../fish/virt-copy-out.pod:25
18178 " virt-copy-out -d MyGuest /home homes\n"
18183 #: ../fish/virt-copy-out.pod:30
18185 "This command is just a simple shell script wrapper around the "
18186 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
18187 "trivial copy, you are probably better off using guestfish directly."
18191 #: ../fish/virt-copy-out.pod:41
18193 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
18194 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18198 #: ../fish/virt-tar-in.pod:5
18199 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18203 #: ../fish/virt-tar-in.pod:9
18206 " virt-tar-in -a disk.img data.tar /destination\n"
18211 #: ../fish/virt-tar-in.pod:11
18214 " virt-tar-in -d domain data.tar /destination\n"
18219 #: ../fish/virt-tar-in.pod:13
18222 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18227 #: ../fish/virt-tar-in.pod:17
18229 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18230 "causing disk corruption. The virtual machine must be shut down before you "
18231 "use this command."
18235 #: ../fish/virt-tar-in.pod:23
18237 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18238 "image or named libvirt domain."
18242 #: ../fish/virt-tar-in.pod:26
18244 "The first parameter is the tar file. Use C<-> to read the tar file from "
18245 "standard input. The second parameter is the absolute target directory to "
18250 #: ../fish/virt-tar-in.pod:34
18253 " virt-tar-in -d MyGuest homes.tar /home\n"
18258 #: ../fish/virt-tar-in.pod:38
18260 "This command is just a simple shell script wrapper around the "
18261 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
18262 "copy, you are probably better off using guestfish directly."
18266 #: ../fish/virt-tar-in.pod:49
18268 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18269 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
18270 "L<http://libguestfs.org/>."
18274 #: ../fish/virt-tar-out.pod:5
18275 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
18279 #: ../fish/virt-tar-out.pod:9
18282 " virt-tar-out -a disk.img /dir files.tar\n"
18287 #: ../fish/virt-tar-out.pod:11
18290 " virt-tar-out -d domain /dir files.tar\n"
18295 #: ../fish/virt-tar-out.pod:13
18298 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
18303 #: ../fish/virt-tar-out.pod:17
18304 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
18308 #: ../fish/virt-tar-out.pod:20
18310 "The first parameter is the absolute path of the virtual machine directory. "
18311 "The second parameter is the tar file to write. Use C<-> to write to "
18316 #: ../fish/virt-tar-out.pod:26
18317 msgid "Download the home directories from a guest:"
18321 #: ../fish/virt-tar-out.pod:28
18324 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
18329 #: ../fish/virt-tar-out.pod:32
18331 "This command is just a simple shell script wrapper around the "
18332 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
18333 "trivial copy, you are probably better off using guestfish directly."
18337 #: ../fish/virt-tar-out.pod:43
18339 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18340 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
18344 #: ../fuse/guestmount.pod:5
18345 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
18349 #: ../fuse/guestmount.pod:9
18352 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
18357 #: ../fuse/guestmount.pod:11
18360 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
18365 #: ../fuse/guestmount.pod:13
18368 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
18373 #: ../fuse/guestmount.pod:17
18375 "You must I<not> use C<guestmount> in read-write mode on live virtual "
18376 "machines. If you do this, you risk disk corruption in the VM."
18380 #: ../fuse/guestmount.pod:22
18382 "The guestmount program can be used to mount virtual machine filesystems and "
18383 "other disk images on the host. It uses libguestfs for access to the guest "
18384 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
18385 "a mountable device."
18389 #: ../fuse/guestmount.pod:27
18391 "Along with other options, you have to give at least one device (I<-a> "
18392 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
18393 "option) or use the I<-i> inspection option. How this works is better "
18394 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
18399 #: ../fuse/guestmount.pod:33
18401 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
18402 "by you, and the filesystem will not be visible to any other users unless you "
18403 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
18404 "the filesystem, use the C<fusermount -u> command."
18408 #: ../fuse/guestmount.pod:41
18410 "For a typical Windows guest which has its main filesystem on the first "
18415 #: ../fuse/guestmount.pod:44
18418 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
18423 #: ../fuse/guestmount.pod:46
18425 "For a typical Linux guest which has a /boot filesystem on the first "
18426 "partition, and the root filesystem on a logical volume:"
18430 #: ../fuse/guestmount.pod:49
18433 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
18438 #: ../fuse/guestmount.pod:51
18439 msgid "To get libguestfs to detect guest mountpoints for you:"
18443 #: ../fuse/guestmount.pod:53
18446 " guestmount -a guest.img -i --ro /mnt\n"
18451 #: ../fuse/guestmount.pod:55
18452 msgid "For a libvirt guest called \"Guest\" you could do:"
18456 #: ../fuse/guestmount.pod:57
18459 " guestmount -d Guest -i --ro /mnt\n"
18464 #: ../fuse/guestmount.pod:59
18466 "If you don't know what filesystems are contained in a guest or disk image, "
18467 "use L<virt-filesystems(1)> first:"
18471 #: ../fuse/guestmount.pod:62
18474 " virt-filesystems MyGuest\n"
18479 #: ../fuse/guestmount.pod:64
18481 "If you want to trace the libguestfs calls but without excessive debugging "
18482 "information, we recommend:"
18486 #: ../fuse/guestmount.pod:67
18489 " guestmount [...] --trace /mnt\n"
18494 #: ../fuse/guestmount.pod:69
18495 msgid "If you want to debug the program, we recommend:"
18499 #: ../fuse/guestmount.pod:71
18502 " guestmount [...] --trace --verbose /mnt\n"
18507 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:486
18512 #: ../fuse/guestmount.pod:75
18513 msgid "Other users cannot see the filesystem by default"
18517 #: ../fuse/guestmount.pod:77
18519 "If you mount a filesystem as one user (eg. root), then other users will not "
18520 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
18521 "option when mounting:"
18525 #: ../fuse/guestmount.pod:81
18528 " sudo guestmount [...] -o allow_other /mnt\n"
18533 #: ../fuse/guestmount.pod:91
18534 msgid "Add a block device or virtual machine image."
18538 #: ../fuse/guestmount.pod:114
18539 msgid "B<--dir-cache-timeout N>"
18543 #: ../fuse/guestmount.pod:116
18545 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
18546 "seconds. The readdir cache [actually, there are several semi-independent "
18547 "caches] is populated after a readdir(2) call with the stat and extended "
18548 "attributes of the files in the directory, in anticipation that they will be "
18549 "requested soon after."
18553 #: ../fuse/guestmount.pod:122
18555 "There is also a different attribute cache implemented by FUSE (see the FUSE "
18556 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
18557 "requests, only cache existing ones."
18561 #: ../fuse/guestmount.pod:142
18563 "If you have untrusted raw-format guest disk images, you should use this "
18564 "option to specify the disk format. This avoids a possible security problem "
18565 "with malicious guests (CVE-2010-3851). See also "
18566 "L<guestfs(3)/guestfs_add_drive_opts>."
18570 #: ../fuse/guestmount.pod:147
18571 msgid "B<--fuse-help>"
18575 #: ../fuse/guestmount.pod:149
18576 msgid "Display help on special FUSE options (see I<-o> below)."
18580 #: ../fuse/guestmount.pod:153
18581 msgid "Display brief help and exit."
18585 #: ../fuse/guestmount.pod:177
18587 "Mount the named partition or logical volume on the given mountpoint B<in the "
18588 "guest> (this has nothing to do with mountpoints in the host)."
18592 #: ../fuse/guestmount.pod:180
18594 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
18595 "something on C</>."
18599 #: ../fuse/guestmount.pod:197
18601 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
18602 "unmounted. If you specify this option, then we don't attempt to sync the "
18603 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
18607 #: ../fuse/guestmount.pod:202
18608 msgid "B<-o option>"
18612 #: ../fuse/guestmount.pod:204
18613 msgid "B<--option option>"
18617 #: ../fuse/guestmount.pod:206
18618 msgid "Pass extra options to FUSE."
18622 #: ../fuse/guestmount.pod:208
18624 "To get a list of all the extra options supported by FUSE, use the command "
18625 "below. Note that only the FUSE I<-o> options can be passed, and only some "
18626 "of them are a good idea."
18630 #: ../fuse/guestmount.pod:212
18633 " guestmount --fuse-help\n"
18638 #: ../fuse/guestmount.pod:214
18639 msgid "Some potentially useful FUSE options:"
18643 #: ../fuse/guestmount.pod:218
18644 msgid "B<-o allow_other>"
18648 #: ../fuse/guestmount.pod:220
18649 msgid "Allow other users to see the filesystem."
18653 #: ../fuse/guestmount.pod:222
18654 msgid "B<-o attr_timeout=N>"
18658 #: ../fuse/guestmount.pod:224
18659 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
18663 #: ../fuse/guestmount.pod:226
18664 msgid "B<-o kernel_cache>"
18668 #: ../fuse/guestmount.pod:228
18670 "Allow the kernel to cache files (reduces the number of reads that have to go "
18671 "through the L<guestfs(3)> API). This is generally a good idea if you can "
18672 "afford the extra memory usage."
18676 #: ../fuse/guestmount.pod:232
18677 msgid "B<-o uid=N> B<-o gid=N>"
18681 #: ../fuse/guestmount.pod:234
18683 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
18684 "the chosen values."
18688 #: ../fuse/guestmount.pod:243
18690 "Add devices and mount everything read-only. Also disallow writes and make "
18691 "the disk appear read-only to FUSE."
18695 #: ../fuse/guestmount.pod:246
18697 "This is highly recommended if you are not going to edit the guest disk. If "
18698 "the guest is running and this option is I<not> supplied, then there is a "
18699 "strong risk of disk corruption in the guest. We try to prevent this from "
18700 "happening, but it is not always possible."
18704 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
18705 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
18709 #: ../fuse/guestmount.pod:255
18710 msgid "Enable SELinux support for the guest."
18714 #: ../fuse/guestmount.pod:261
18715 msgid "Enable verbose messages from underlying libguestfs."
18719 #: ../fuse/guestmount.pod:267
18720 msgid "Display the program version and exit."
18724 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299 ../rescue/virt-rescue.pod:197 ../rescue/virt-rescue.pod:280
18725 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
18729 #: ../fuse/guestmount.pod:280
18734 #: ../fuse/guestmount.pod:282
18735 msgid "Trace libguestfs calls and entry into each FUSE function."
18739 #: ../fuse/guestmount.pod:284
18740 msgid "This also stops the daemon from forking into the background."
18744 #: ../fuse/guestmount.pod:305
18746 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
18747 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
18748 "L<http://fuse.sf.net/>."
18752 #: ../fuse/guestmount.pod:320
18753 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
18757 #: ../inspector/virt-inspector.pod:5
18759 "virt-inspector - Display operating system version and other information "
18760 "about a virtual machine"
18764 #: ../inspector/virt-inspector.pod:9
18767 " virt-inspector [--options] -d domname\n"
18772 #: ../inspector/virt-inspector.pod:11
18775 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
18780 #: ../inspector/virt-inspector.pod:15
18783 " virt-inspector domname\n"
18788 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
18791 " virt-inspector disk.img [disk.img ...]\n"
18796 #: ../inspector/virt-inspector.pod:21
18798 "B<virt-inspector> examines a virtual machine or disk image and tries to "
18799 "determine the version of the operating system and other information about "
18800 "the virtual machine."
18804 #: ../inspector/virt-inspector.pod:25
18805 msgid "Virt-inspector produces XML output for feeding into other programs."
18809 #: ../inspector/virt-inspector.pod:27
18811 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
18812 "the libvirt domain (see: C<virsh list --all>)."
18816 #: ../inspector/virt-inspector.pod:30
18818 "You can also run virt-inspector directly on disk images from a single "
18819 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
18820 "has several block devices, in which case you should list several I<-a> "
18821 "options one after another, with the first corresponding to the guest's "
18822 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
18826 #: ../inspector/virt-inspector.pod:37
18828 "You can also run virt-inspector on install disks, live CDs, bootable USB "
18829 "keys and similar."
18833 #: ../inspector/virt-inspector.pod:40
18835 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
18836 "inspect several virtual machines, you have to run virt-inspector several "
18837 "times (for example, from a shell script for-loop)."
18841 #: ../inspector/virt-inspector.pod:45
18843 "Because virt-inspector needs direct access to guest images, it won't "
18844 "normally work over remote libvirt connections."
18848 #: ../inspector/virt-inspector.pod:48
18850 "All of the information available from virt-inspector is also available "
18851 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
18852 "The same information can also be fetched using guestfish or via libguestfs "
18853 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
18854 "WITH OTHER PROGRAMMING LANGUAGES>)."
18858 #: ../inspector/virt-inspector.pod:81
18860 "Libvirt is only used if you specify a C<domname> on the command line. If "
18861 "you specify guest block devices directly (I<-a>), then libvirt is not used "
18866 #: ../inspector/virt-inspector.pod:94
18868 "When prompting for keys and passphrases, virt-inspector normally turns "
18869 "echoing off so you cannot see what you are typing. If you are not worried "
18870 "about Tempest attacks and there is no one else in the room you can specify "
18871 "this flag to see what you are typing."
18875 #: ../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
18877 "Specify the format of disk images given on the command line. If this is "
18878 "omitted then the format is autodetected from the content of the disk image."
18882 #: ../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
18884 "If disk images are requested from libvirt, then this program asks libvirt "
18885 "for this information. In this case, the value of the format parameter is "
18890 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314 ../resize/virt-resize.pod:400 ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
18892 "If working with untrusted raw-format guest disk images, you should ensure "
18893 "the format is always specified."
18897 #: ../inspector/virt-inspector.pod:139
18898 msgid "Previous versions of virt-inspector allowed you to write either:"
18902 #: ../inspector/virt-inspector.pod:145
18905 " virt-inspector guestname\n"
18910 #: ../inspector/virt-inspector.pod:153
18915 #: ../inspector/virt-inspector.pod:155
18917 "The virt-inspector XML is described precisely in a RELAX NG schema file "
18918 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
18919 "just an overview."
18923 #: ../inspector/virt-inspector.pod:159
18925 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
18926 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
18927 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
18928 "which is vanishingly rare in real world VMs."
18932 #: ../inspector/virt-inspector.pod:164
18933 msgid "E<lt>operatingsystemE<gt>"
18937 #: ../inspector/virt-inspector.pod:166
18939 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
18940 "describe the operating system, its architecture, the descriptive \"product "
18941 "name\" string, the type of OS and so on, as in this example:"
18945 #: ../inspector/virt-inspector.pod:170
18948 " <operatingsystems>\n"
18949 " <operatingsystem>\n"
18950 " <root>/dev/sda2</root>\n"
18951 " <name>windows</name>\n"
18952 " <arch>i386</arch>\n"
18953 " <distro>windows</distro>\n"
18954 " <product_name>Windows 7 Enterprise</product_name>\n"
18955 " <product_variant>Client</product_variant>\n"
18956 " <major_version>6</major_version>\n"
18957 " <minor_version>1</minor_version>\n"
18958 " <windows_systemroot>/Windows</windows_systemroot>\n"
18959 " <format>installed</format>\n"
18964 #: ../inspector/virt-inspector.pod:183
18966 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
18967 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
18968 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
18969 "architecture. The other fields are fairly self-explanatory, but because "
18970 "these fields are taken directly from the libguestfs inspection API you can "
18971 "find precise information from L<guestfs(3)/INSPECTION>."
18975 #: ../inspector/virt-inspector.pod:191
18977 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
18978 "of view of libguestfs (block devices may have completely different names "
18979 "inside the VM itself)."
18983 #: ../inspector/virt-inspector.pod:195
18984 msgid "E<lt>mountpointsE<gt>"
18988 #: ../inspector/virt-inspector.pod:197
18990 "Un*x-like guests typically have multiple filesystems which are mounted at "
18991 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
18992 "element which looks like this:"
18996 #: ../inspector/virt-inspector.pod:201
18999 " <operatingsystems>\n"
19000 " <operatingsystem>\n"
19003 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19004 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19005 " </mountpoints>\n"
19010 #: ../inspector/virt-inspector.pod:209
19012 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19013 "and may have completely different names inside the guest. Only mountable "
19014 "filesystems appear in this list, not things like swap devices."
19018 #: ../inspector/virt-inspector.pod:214
19019 msgid "E<lt>filesystemsE<gt>"
19023 #: ../inspector/virt-inspector.pod:216
19025 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19026 "filesystems belonging to the guest, including swap and empty partitions. "
19027 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19028 "this OS or shared with this OS and other OSes)."
19032 #: ../inspector/virt-inspector.pod:222
19033 msgid "You might see something like this:"
19037 #: ../inspector/virt-inspector.pod:224
19040 " <operatingsystems>\n"
19041 " <operatingsystem>\n"
19044 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19045 " <type>ext4</type>\n"
19046 " <label>Fedora-13-x86_64</label>\n"
19047 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19053 #: ../inspector/virt-inspector.pod:234
19055 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19056 "the label, and the UUID."
19060 #: ../inspector/virt-inspector.pod:237
19061 msgid "E<lt>applicationsE<gt>"
19065 #: ../inspector/virt-inspector.pod:239
19067 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19068 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19073 #: ../inspector/virt-inspector.pod:243
19075 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19076 "Typical values would be C<rpm> and C<deb>."
19080 #: ../inspector/virt-inspector.pod:246
19082 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19083 "Typical values include C<yum>, C<up2date> and C<apt>"
19087 #: ../inspector/virt-inspector.pod:249
19088 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19092 #: ../inspector/virt-inspector.pod:252
19095 " <operatingsystems>\n"
19096 " <operatingsystem>\n"
19098 " <applications>\n"
19100 " <name>coreutils</name>\n"
19101 " <version>8.5</version>\n"
19102 " <release>1</release>\n"
19103 " </application>\n"
19108 #: ../inspector/virt-inspector.pod:262
19110 "The version and release fields may not be available for some types guests. "
19111 "Other fields are possible, see "
19112 "L<guestfs(3)/guestfs_inspect_list_applications>."
19116 #: ../inspector/virt-inspector.pod:266
19117 msgid "E<lt>drive_mappingsE<gt>"
19121 #: ../inspector/virt-inspector.pod:268
19123 "For operating systems like Windows which use drive letters, virt-inspector "
19124 "is able to find out how drive letters map to filesystems."
19128 #: ../inspector/virt-inspector.pod:272
19131 " <operatingsystems>\n"
19132 " <operatingsystem>\n"
19134 " <drive_mappings>\n"
19135 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19136 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19137 " </drive_mappings>\n"
19142 #: ../inspector/virt-inspector.pod:280
19144 "In the example above, drive C maps to the filesystem on the second partition "
19145 "on the first disk, and drive E maps to the filesystem on the first partition "
19146 "on the second disk."
19150 #: ../inspector/virt-inspector.pod:284
19152 "Note that this only covers permanent local filesystem mappings, not things "
19153 "like network shares. Furthermore NTFS volume mount points may not be listed "
19158 #: ../inspector/virt-inspector.pod:288
19159 msgid "E<lt>iconE<gt>"
19163 #: ../inspector/virt-inspector.pod:290
19165 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19166 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19167 "very large and high quality."
19171 #: ../inspector/virt-inspector.pod:294
19174 " <operatingsystems>\n"
19175 " <operatingsystem>\n"
19178 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19179 " [... many lines of base64 data ...]\n"
19185 #: ../inspector/virt-inspector.pod:302
19187 "To display the icon, you have to extract it and convert the base64 data back "
19188 "to a binary file. Use an XPath query or simply an editor to extract the "
19189 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19194 #: ../inspector/virt-inspector.pod:307
19197 " base64 -i -d < icon.data > icon.png\n"
19202 #: ../inspector/virt-inspector.pod:309
19203 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19207 #: ../inspector/virt-inspector.pod:311
19209 "Virt-inspector can detect some operating system installers on install disks, "
19210 "live CDs, bootable USB keys and more."
19214 #: ../inspector/virt-inspector.pod:314
19216 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19217 "fields may be present to indicate a live CD, network installer, or one part "
19218 "of a multipart CD. For example:"
19222 #: ../inspector/virt-inspector.pod:318
19225 " <operatingsystems>\n"
19226 " <operatingsystem>\n"
19227 " <root>/dev/sda</root>\n"
19228 " <name>linux</name>\n"
19229 " <arch>i386</arch>\n"
19230 " <distro>ubuntu</distro>\n"
19231 " <product_name>Ubuntu 10.10 "Maverick "
19232 "Meerkat"</product_name>\n"
19233 " <major_version>10</major_version>\n"
19234 " <minor_version>10</minor_version>\n"
19235 " <format>installer</format>\n"
19241 #: ../inspector/virt-inspector.pod:330
19242 msgid "USING XPATH"
19246 #: ../inspector/virt-inspector.pod:332
19248 "You can use the XPath query language, and/or the xpath tool, in order to "
19249 "select parts of the XML."
19253 #: ../inspector/virt-inspector.pod:337
19256 " $ virt-inspector -d Guest | xpath //filesystems\n"
19257 " Found 1 nodes:\n"
19260 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19261 " <type>ext4</type>\n"
19267 #: ../inspector/virt-inspector.pod:345
19270 " $ virt-inspector -d Guest | \\\n"
19271 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
19272 " Query didn't return a nodeset. Value: ext4\n"
19277 #: ../inspector/virt-inspector.pod:356
19278 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
19282 #: ../inspector/virt-inspector.pod:358
19284 "Early versions of libguestfs shipped with a different virt-inspector program "
19285 "written in Perl (the current version is written in C). The XML output of "
19286 "the Perl virt-inspector was different and it could also output in other "
19287 "formats like text."
19291 #: ../inspector/virt-inspector.pod:363
19292 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
19296 #: ../inspector/virt-inspector.pod:366
19298 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
19299 "versions of virt-inspector with different names:"
19303 #: ../inspector/virt-inspector.pod:369
19306 " virt-inspector Old Perl version.\n"
19307 " virt-inspector2 New C version.\n"
19312 #: ../inspector/virt-inspector.pod:374
19314 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
19315 "L<base64(1)>, L<http://libguestfs.org/>."
19319 #: ../inspector/virt-inspector.pod:390
19320 msgid "Matthew Booth L<mbooth@redhat.com>"
19324 #: ../java/examples/guestfs-java.pod:5
19325 msgid "guestfs-java - How to use libguestfs from Java"
19329 #: ../java/examples/guestfs-java.pod:9
19332 " import com.redhat.et.libguestfs.*;\n"
19337 #: ../java/examples/guestfs-java.pod:11
19340 " GuestFS g = new GuestFS ();\n"
19341 " g.add_drive_opts (\"disk.img\", null);\n"
19347 #: ../java/examples/guestfs-java.pod:17
19349 "This manual page documents how to call libguestfs from the Java programming "
19350 "language. This page just documents the differences from the C API and gives "
19351 "some examples. If you are not familiar with using libguestfs, you also need "
19352 "to read L<guestfs(3)>."
19356 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
19357 msgid "CLOSING THE HANDLE"
19361 #: ../java/examples/guestfs-java.pod:24
19363 "The handle is closed when it is reaped by the garbage collector. Because "
19364 "libguestfs handles include a lot of state, it is also possible to close (and "
19365 "hence free) them explicitly by calling the C<close> method."
19369 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
19374 #: ../java/examples/guestfs-java.pod:31
19376 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
19377 "exception. This has a single parameter which is the error message (a "
19382 #: ../java/examples/guestfs-java.pod:35
19383 msgid "Calling any method on a closed handle raises the same exception."
19387 #: ../java/examples/guestfs-java.pod:47
19389 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, "
19390 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
19391 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
19395 #: ../java/examples/guestfs-java.pod:63 ../perl/examples/guestfs-perl.pod:57
19396 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
19400 #: ../ocaml/examples/guestfs-ocaml.pod:5
19401 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
19405 #: ../ocaml/examples/guestfs-ocaml.pod:9
19406 msgid "Module style:"
19410 #: ../ocaml/examples/guestfs-ocaml.pod:11
19413 " let g = Guestfs.create () in\n"
19414 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19415 " Guestfs.launch g;\n"
19420 #: ../ocaml/examples/guestfs-ocaml.pod:15
19421 msgid "Object-oriented style:"
19425 #: ../ocaml/examples/guestfs-ocaml.pod:17
19428 " let g = new Guestfs.guestfs () in\n"
19429 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
19435 #: ../ocaml/examples/guestfs-ocaml.pod:21
19438 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
19440 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
19445 #: ../ocaml/examples/guestfs-ocaml.pod:27
19447 "This manual page documents how to call libguestfs from the OCaml programming "
19448 "language. This page just documents the differences from the C API and gives "
19449 "some examples. If you are not familiar with using libguestfs, you also need "
19450 "to read L<guestfs(3)>."
19454 #: ../ocaml/examples/guestfs-ocaml.pod:32
19455 msgid "PROGRAMMING STYLES"
19459 #: ../ocaml/examples/guestfs-ocaml.pod:34
19461 "There are two different programming styles supported by the OCaml bindings. "
19462 "You can use a module style, with each C function mapped to an OCaml "
19467 #: ../ocaml/examples/guestfs-ocaml.pod:38
19470 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
19475 #: ../ocaml/examples/guestfs-ocaml.pod:40
19480 #: ../ocaml/examples/guestfs-ocaml.pod:42
19483 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
19488 #: ../ocaml/examples/guestfs-ocaml.pod:44
19490 "Alternately you can use an object-oriented style, calling methods on the "
19491 "class C<Guestfs.guestfs>:"
19495 #: ../ocaml/examples/guestfs-ocaml.pod:47
19498 " method set_verbose : bool -> unit\n"
19503 #: ../ocaml/examples/guestfs-ocaml.pod:49
19505 "The object-oriented style is usually briefer, and the minor performance "
19506 "penalty isn't noticable in the general overhead of performing libguestfs "
19511 #: ../ocaml/examples/guestfs-ocaml.pod:55
19513 "The handle is closed when it is reaped by the garbage collector. Because "
19514 "libguestfs handles include a lot of state, it is also possible to close (and "
19515 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
19520 #: ../ocaml/examples/guestfs-ocaml.pod:62
19522 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
19523 "exception. This has a single parameter which is the error message (a "
19528 #: ../ocaml/examples/guestfs-ocaml.pod:66
19530 "Calling any function/method on a closed handle raises "
19531 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
19536 #: ../ocaml/examples/guestfs-ocaml.pod:80
19538 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
19539 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
19540 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
19544 #: ../perl/examples/guestfs-perl.pod:5
19545 msgid "guestfs-perl - How to use libguestfs from Perl"
19549 #: ../perl/examples/guestfs-perl.pod:9
19552 " use Sys::Guestfs;\n"
19557 #: ../perl/examples/guestfs-perl.pod:11
19560 " my $h = Sys::Guestfs->new ();\n"
19561 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
19562 " $h->launch ();\n"
19563 " $h->mount_options ('', '/dev/sda1', '/');\n"
19564 " $h->touch ('/hello');\n"
19570 #: ../perl/examples/guestfs-perl.pod:20
19572 "This manual page documents how to call libguestfs from the Perl programming "
19573 "language. This page just documents the differences from the C API and gives "
19574 "some examples. If you are not familiar with using libguestfs, you also need "
19575 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
19579 #: ../perl/examples/guestfs-perl.pod:26
19584 #: ../perl/examples/guestfs-perl.pod:28
19586 "Errors from libguestfs functions turn into calls to C<croak> (see "
19591 #: ../perl/examples/guestfs-perl.pod:41
19593 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
19594 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
19595 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
19599 #: ../python/examples/guestfs-python.pod:5
19600 msgid "guestfs-python - How to use libguestfs from Python"
19604 #: ../python/examples/guestfs-python.pod:9
19607 " import guestfs\n"
19608 " g = guestfs.GuestFS ()\n"
19609 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
19615 #: ../python/examples/guestfs-python.pod:16
19617 "This manual page documents how to call libguestfs from the Python "
19618 "programming language. This page just documents the differences from the C "
19619 "API and gives some examples. If you are not familiar with using libguestfs, "
19620 "you also need to read L<guestfs(3)>."
19624 #: ../python/examples/guestfs-python.pod:23
19626 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
19627 "single string argument which is the error message."
19631 #: ../python/examples/guestfs-python.pod:26
19632 msgid "MORE DOCUMENTATION"
19636 #: ../python/examples/guestfs-python.pod:28
19641 #: ../python/examples/guestfs-python.pod:30
19645 " >>> import guestfs\n"
19646 " >>> help (guestfs)\n"
19651 #: ../python/examples/guestfs-python.pod:44
19653 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
19654 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
19655 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
19659 #: ../rescue/virt-rescue.pod:5
19660 msgid "virt-rescue - Run a rescue shell on a virtual machine"
19664 #: ../rescue/virt-rescue.pod:9
19667 " virt-rescue [--options] -d domname\n"
19672 #: ../rescue/virt-rescue.pod:11
19675 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
19680 #: ../rescue/virt-rescue.pod:15
19683 " virt-rescue [--options] domname\n"
19688 #: ../rescue/virt-rescue.pod:17
19691 " virt-rescue [--options] disk.img [disk.img ...]\n"
19696 #: ../rescue/virt-rescue.pod:21
19698 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
19699 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
19700 "you from doing this, but doesn't catch all cases."
19704 #: ../rescue/virt-rescue.pod:25
19706 "However if you use the I<--ro> (read only) option, then you can attach a "
19707 "shell to a live virtual machine. The results might be strange or "
19708 "inconsistent at times but you won't get disk corruption."
19712 #: ../rescue/virt-rescue.pod:31
19714 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
19715 "need for a CD. virt-rescue gives you a rescue shell and some simple "
19716 "recovery tools which you can use to examine or rescue a virtual machine or "
19721 #: ../rescue/virt-rescue.pod:36
19723 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
19724 "on disk image(s):"
19728 #: ../rescue/virt-rescue.pod:39
19731 " virt-rescue -d GuestName\n"
19736 #: ../rescue/virt-rescue.pod:41
19739 " virt-rescue --ro -a /path/to/disk.img\n"
19744 #: ../rescue/virt-rescue.pod:43
19747 " virt-rescue -a /dev/sdc\n"
19752 #: ../rescue/virt-rescue.pod:45
19753 msgid "For live VMs you I<must> use the --ro option."
19757 #: ../rescue/virt-rescue.pod:47
19759 "When you run virt-rescue on a virtual machine or disk image, you are placed "
19760 "in an interactive bash shell where you can use many ordinary Linux "
19761 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
19762 "appliance. You must mount the virtual machine's filesystems by hand. There "
19763 "is an empty directory called C</sysroot> where you can mount filesystems."
19767 #: ../rescue/virt-rescue.pod:54
19769 "In the example below, we list logical volumes, then choose one to mount "
19770 "under C</sysroot>:"
19774 #: ../rescue/virt-rescue.pod:57
19778 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
19779 " lv_root vg_f11x64 -wi-a- 8.83G\n"
19780 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
19781 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
19782 " ><rescue> ls /sysroot\n"
19787 #: ../rescue/virt-rescue.pod:64
19789 "If you don't know what filesystems are available on the virtual machine then "
19790 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
19794 #: ../rescue/virt-rescue.pod:70
19796 "Virt-rescue can be used on I<any> disk image file or device, not just a "
19797 "virtual machine. For example you can use it on a blank file if you want to "
19798 "partition that file (although we would recommend using L<guestfish(1)> "
19799 "instead as it is more suitable for this purpose). You can even use "
19800 "virt-rescue on things like SD cards."
19804 #: ../rescue/virt-rescue.pod:76
19806 "Virt-rescue does not require root. You only need to run it as root if you "
19807 "need root to open the disk image."
19811 #: ../rescue/virt-rescue.pod:79
19813 "This tool is just designed for quick interactive hacking on a virtual "
19814 "machine. For more structured access to a virtual machine disk image, you "
19815 "should use L<guestfs(3)>. To get a structured shell that you can use to "
19816 "make scripted changes to guests, use L<guestfish(1)>."
19820 #: ../rescue/virt-rescue.pod:103
19821 msgid "B<--append kernelopts>"
19825 #: ../rescue/virt-rescue.pod:105
19826 msgid "Pass additional options to the rescue kernel."
19830 #: ../rescue/virt-rescue.pod:135
19833 " virt-rescue --format=raw -a disk.img\n"
19838 #: ../rescue/virt-rescue.pod:139
19841 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
19846 #: ../rescue/virt-rescue.pod:148
19851 #: ../rescue/virt-rescue.pod:150
19852 msgid "B<--memsize MB>"
19856 #: ../rescue/virt-rescue.pod:152
19858 "Change the amount of memory allocated to the rescue system. The default is "
19859 "set by libguestfs and is small but adequate for running system tools. The "
19860 "occasional program might need more memory. The parameter is specified in "
19865 #: ../rescue/virt-rescue.pod:157
19866 msgid "B<--network>"
19870 #: ../rescue/virt-rescue.pod:159
19871 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
19875 #: ../rescue/virt-rescue.pod:165
19876 msgid "Open the image read-only."
19880 #: ../rescue/virt-rescue.pod:175
19882 "Enable SELinux in the rescue appliance. You should read "
19883 "L<guestfs(3)/SELINUX> before using this option."
19887 #: ../rescue/virt-rescue.pod:194
19889 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
19890 "are done read-write."
19894 #: ../rescue/virt-rescue.pod:207
19895 msgid "Previous versions of virt-rescue allowed you to write either:"
19899 #: ../rescue/virt-rescue.pod:209
19902 " virt-rescue disk.img [disk.img ...]\n"
19907 #: ../rescue/virt-rescue.pod:213
19910 " virt-rescue guestname\n"
19915 #: ../rescue/virt-rescue.pod:221
19920 #: ../rescue/virt-rescue.pod:223
19922 "Adding the I<--network> option enables QEMU user networking in the rescue "
19923 "appliance. There are some differences between user networking and ordinary "
19928 #: ../rescue/virt-rescue.pod:229
19929 msgid "ping does not work"
19933 #: ../rescue/virt-rescue.pod:231
19935 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
19936 "send the ping packets, and because virt-rescue must be able to run as "
19937 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
19938 "command. The ping command will appear to resolve addresses but will not be "
19939 "able to send or receive any packets. This does not mean that the network is "
19944 #: ../rescue/virt-rescue.pod:238
19945 msgid "cannot receive connections"
19949 #: ../rescue/virt-rescue.pod:240
19950 msgid "QEMU user networking cannot receive incoming connections."
19954 #: ../rescue/virt-rescue.pod:242
19955 msgid "making TCP connections"
19959 #: ../rescue/virt-rescue.pod:244
19961 "The virt-rescue appliance needs to be small and so does not include many "
19962 "network tools. In particular there is no L<telnet(1)> command. You can "
19963 "make TCP connections from the shell using the magical "
19964 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
19968 #: ../rescue/virt-rescue.pod:249
19971 " exec 3<>/dev/tcp/redhat.com/80\n"
19972 " echo \"GET /\" >&3\n"
19978 #: ../rescue/virt-rescue.pod:253
19979 msgid "See L<bash(1)> for more details."
19983 #: ../rescue/virt-rescue.pod:259
19985 "Several environment variables affect virt-rescue. See "
19986 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
19990 #: ../rescue/virt-rescue.pod:286
19992 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
19993 "L<http://libguestfs.org/>."
19997 #: ../resize/virt-resize.pod:5
19998 msgid "virt-resize - Resize a virtual machine disk"
20002 #: ../resize/virt-resize.pod:9
20005 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20006 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20007 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20012 #: ../resize/virt-resize.pod:15
20014 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20015 "larger or smaller overall, and resizing or deleting any partitions contained "
20020 #: ../resize/virt-resize.pod:19
20022 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20023 "not> be used on live virtual machines - for consistent results, shut the "
20024 "virtual machine down before resizing it."
20028 #: ../resize/virt-resize.pod:23
20030 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20031 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20035 #: ../resize/virt-resize.pod:31 ../src/guestfs.pod:469 ../src/guestfs.pod:1257 ../src/guestfs.pod:1395 ../src/guestfs.pod:2465
20040 #: ../resize/virt-resize.pod:33
20042 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20043 "fill the extra 5GB of space."
20047 #: ../resize/virt-resize.pod:36
20050 " virt-filesystems --long -h --all -a olddisk\n"
20055 #: ../resize/virt-resize.pod:38
20058 " truncate -r olddisk newdisk\n"
20059 " truncate -s +5G newdisk\n"
20064 #: ../resize/virt-resize.pod:41
20067 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20068 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20073 #: ../resize/virt-resize.pod:44 ../src/guestfs.pod:475 ../src/guestfs.pod:1261 ../src/guestfs.pod:1399 ../src/guestfs.pod:2490
20078 #: ../resize/virt-resize.pod:46
20080 "As above, but make the /boot partition 200MB bigger, while giving the "
20081 "remaining space to /dev/sda2:"
20085 #: ../resize/virt-resize.pod:49
20088 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20089 " olddisk newdisk\n"
20094 #: ../resize/virt-resize.pod:52 ../src/guestfs.pod:486 ../src/guestfs.pod:1405
20099 #: ../resize/virt-resize.pod:54
20101 "As in the first example, but expand a logical volume as the final step. "
20102 "This is what you would typically use for Linux guests that use LVM:"
20106 #: ../resize/virt-resize.pod:58
20109 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20110 " olddisk newdisk\n"
20115 #: ../resize/virt-resize.pod:61
20120 #: ../resize/virt-resize.pod:63
20122 "As in the first example, but the output format will be qcow2 instead of a "
20127 #: ../resize/virt-resize.pod:66
20130 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20131 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20136 #: ../resize/virt-resize.pod:71
20137 msgid "DETAILED USAGE"
20141 #: ../resize/virt-resize.pod:73
20142 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20146 #: ../resize/virt-resize.pod:77
20147 msgid "1. Shut down the virtual machine"
20151 #: ../resize/virt-resize.pod:79
20152 msgid "2. Locate input disk image"
20156 #: ../resize/virt-resize.pod:81
20158 "Locate the input disk image (ie. the file or device on the host containing "
20159 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20160 "dumpxml> like this to find the disk image name:"
20164 #: ../resize/virt-resize.pod:85
20167 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20168 " Found 1 nodes:\n"
20170 " <source dev=\"/dev/vg/lv_guest\" />\n"
20175 #: ../resize/virt-resize.pod:90
20176 msgid "3. Look at current sizing"
20180 #: ../resize/virt-resize.pod:92
20181 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20185 #: ../resize/virt-resize.pod:95
20188 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20189 " Name Type Size Parent\n"
20190 " /dev/sda1 partition 101M /dev/sda\n"
20191 " /dev/sda2 partition 7.9G /dev/sda\n"
20192 " /dev/sda device 8.0G -\n"
20197 #: ../resize/virt-resize.pod:101
20199 "(This example is a virtual machine with an 8 GB disk which we would like to "
20200 "expand up to 10 GB)."
20204 #: ../resize/virt-resize.pod:104
20205 msgid "4. Create output disk"
20209 #: ../resize/virt-resize.pod:106
20211 "Virt-resize cannot do in-place disk modifications. You have to have space "
20212 "to store the resized output disk."
20216 #: ../resize/virt-resize.pod:109
20217 msgid "To store the resized disk image in a file, create a file of a suitable size:"
20221 #: ../resize/virt-resize.pod:112
20224 " # rm -f outdisk\n"
20225 " # truncate -s 10G outdisk\n"
20230 #: ../resize/virt-resize.pod:115
20231 msgid "Or use L<lvcreate(1)> to create a logical volume:"
20235 #: ../resize/virt-resize.pod:117
20238 " # lvcreate -L 10G -n lv_name vg_name\n"
20243 #: ../resize/virt-resize.pod:119
20244 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
20248 #: ../resize/virt-resize.pod:121
20251 " # virsh pool-list\n"
20252 " # virsh vol-create-as poolname newvol 10G\n"
20257 #: ../resize/virt-resize.pod:124
20262 #: ../resize/virt-resize.pod:126
20264 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
20265 "file) and the output disk. The output disk is the one created in the "
20270 #: ../resize/virt-resize.pod:130
20273 " # virt-resize indisk outdisk\n"
20278 #: ../resize/virt-resize.pod:132
20280 "This command just copies disk image C<indisk> to disk image C<outdisk> "
20281 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
20282 "larger, then an extra, empty partition is created at the end of the disk "
20283 "covering the extra space. If C<outdisk> is smaller, then it will give an "
20288 #: ../resize/virt-resize.pod:138
20290 "More realistically you'd want to expand existing partitions in the disk "
20291 "image by passing extra options (for the full list see the L</OPTIONS> "
20296 #: ../resize/virt-resize.pod:142
20298 "L</--expand> is the most useful option. It expands the named partition "
20299 "within the disk to fill any extra space:"
20303 #: ../resize/virt-resize.pod:145
20306 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
20311 #: ../resize/virt-resize.pod:147
20313 "(In this case, an extra partition is I<not> created at the end of the disk, "
20314 "because there will be no unused space)."
20318 #: ../resize/virt-resize.pod:150
20320 "L</--resize> is the other commonly used option. The following would "
20321 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
20322 "rest of the available space:"
20326 #: ../resize/virt-resize.pod:154
20329 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20330 " indisk outdisk\n"
20335 #: ../resize/virt-resize.pod:157
20337 "If the expanded partition in the image contains a filesystem or LVM PV, then "
20338 "if virt-resize knows how, it will resize the contents, the equivalent of "
20339 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
20340 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
20341 "filesystems, so you would have to online resize them after booting the "
20346 #: ../resize/virt-resize.pod:164
20347 msgid "Other options are covered below."
20351 #: ../resize/virt-resize.pod:166
20356 #: ../resize/virt-resize.pod:168
20357 msgid "Thoroughly test the new disk image I<before> discarding the old one."
20361 #: ../resize/virt-resize.pod:170
20362 msgid "If you are using libvirt, edit the XML to point at the new disk:"
20366 #: ../resize/virt-resize.pod:172
20369 " # virsh edit guestname\n"
20374 #: ../resize/virt-resize.pod:174
20376 "Change E<lt>source ...E<gt>, see "
20377 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
20381 #: ../resize/virt-resize.pod:177
20382 msgid "Then start up the domain with the new, resized disk:"
20386 #: ../resize/virt-resize.pod:179
20389 " # virsh start guestname\n"
20394 #: ../resize/virt-resize.pod:181
20396 "and check that it still works. See also the L</NOTES> section below for "
20397 "additional information."
20401 #: ../resize/virt-resize.pod:184
20402 msgid "7. Resize LVs etc inside the guest"
20406 #: ../resize/virt-resize.pod:186
20407 msgid "(This can also be done offline using L<guestfish(1)>)"
20411 #: ../resize/virt-resize.pod:188
20413 "Once the guest has booted you should see the new space available, at least "
20414 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
20415 "may need to resize LVs inside PVs, and also resize filesystem types that "
20416 "virt-resize does not know how to expand."
20420 #: ../resize/virt-resize.pod:195
20421 msgid "SHRINKING A VIRTUAL MACHINE DISK"
20425 #: ../resize/virt-resize.pod:197
20427 "Shrinking is somewhat more complex than expanding, and only an overview is "
20432 #: ../resize/virt-resize.pod:200
20434 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
20435 "filesystems). The user has to shrink content before passing the disk image "
20436 "to virt-resize, and virt-resize will check that the content has been shrunk "
20441 #: ../resize/virt-resize.pod:205
20442 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
20446 #: ../resize/virt-resize.pod:207
20448 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
20449 "steps 3 and 4 above to allocate a new disk image."
20453 #: ../resize/virt-resize.pod:210
20454 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
20458 #: ../resize/virt-resize.pod:213
20459 msgid "IGNORING OR DELETING PARTITIONS"
20463 #: ../resize/virt-resize.pod:215
20465 "virt-resize also gives a convenient way to ignore or delete partitions when "
20466 "copying from the input disk to the output disk. Ignoring a partition speeds "
20467 "up the copy where you don't care about the existing contents of a "
20468 "partition. Deleting a partition removes it completely, but note that it "
20469 "also renumbers any partitions after the one which is deleted, which can "
20470 "leave some guests unbootable."
20474 #: ../resize/virt-resize.pod:222
20475 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
20479 #: ../resize/virt-resize.pod:224
20481 "If the input disk is in qcow2 format, then you may prefer that the output is "
20482 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
20483 "the fly. The output format is simply determined by the format of the empty "
20484 "output container that you provide. Thus to create qcow2 output, use:"
20488 #: ../resize/virt-resize.pod:230
20491 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
20496 #: ../resize/virt-resize.pod:232
20497 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
20501 #: ../resize/virt-resize.pod:234
20502 msgid "Similarly, to get non-sparse raw output use:"
20506 #: ../resize/virt-resize.pod:236
20509 " fallocate -l size outdisk\n"
20514 #: ../resize/virt-resize.pod:238
20516 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
20517 "if=/dev/zero of=outdisk bs=1M count=..>)"
20521 #: ../resize/virt-resize.pod:247
20522 msgid "Display help."
20526 #: ../resize/virt-resize.pod:249
20531 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
20536 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
20537 msgid "Enable debugging messages."
20541 #: ../resize/virt-resize.pod:255
20542 msgid "B<--delete part>"
20546 #: ../resize/virt-resize.pod:257
20548 "Delete the named partition. It would be more accurate to describe this as "
20549 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
20550 "the original disk image is left intact."
20554 #: ../resize/virt-resize.pod:261
20556 "Note that when you delete a partition, then anything contained in the "
20557 "partition is also deleted. Furthermore, this causes any partitions that "
20558 "come after to be I<renumbered>, which can easily make your guest unbootable."
20562 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327 ../resize/virt-resize.pod:448
20563 msgid "You can give this option multiple times."
20567 #: ../resize/virt-resize.pod:268
20568 msgid "B<--expand part>"
20572 #: ../resize/virt-resize.pod:270
20574 "Expand the named partition so it uses up all extra space (space left over "
20575 "after any other resize changes that you request have been done)."
20579 #: ../resize/virt-resize.pod:273
20581 "If virt-resize knows how, it will expand the direct content of the "
20582 "partition. For example, if the partition is an LVM PV, it will expand the "
20583 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
20584 "content it doesn't know about alone."
20588 #: ../resize/virt-resize.pod:278
20589 msgid "Currently virt-resize can resize:"
20593 #: ../resize/virt-resize.pod:284
20594 msgid "ext2, ext3 and ext4 filesystems."
20598 #: ../resize/virt-resize.pod:288
20599 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
20603 #: ../resize/virt-resize.pod:290
20605 "The filesystem must have been shut down consistently last time it was used. "
20606 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
20607 "consistency check, so at the first boot after resizing Windows will check "
20612 #: ../resize/virt-resize.pod:297
20614 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
20615 "inside the PV, but see the I<--LV-expand> option. The user could also "
20616 "resize LVs as desired after boot."
20620 #: ../resize/virt-resize.pod:303
20621 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
20625 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:476
20626 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
20630 #: ../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
20631 msgid "B<--format> raw"
20635 #: ../resize/virt-resize.pod:311
20637 "Specify the format of the input disk image. If this flag is not given then "
20638 "it is auto-detected from the image itself."
20642 #: ../resize/virt-resize.pod:317
20644 "Note that this option I<does not> affect the output format. See L</QCOW2 "
20645 "AND NON-SPARSE RAW FORMATS>."
20649 #: ../resize/virt-resize.pod:320
20650 msgid "B<--ignore part>"
20654 #: ../resize/virt-resize.pod:322
20656 "Ignore the named partition. Effectively this means the partition is "
20657 "allocated on the destination disk, but the content is not copied across from "
20658 "the source disk. The content of the partition will be blank (all zero "
20663 #: ../resize/virt-resize.pod:329
20664 msgid "B<--LV-expand logvol>"
20668 #: ../resize/virt-resize.pod:331
20670 "This takes the logical volume and, as a final step, expands it to fill all "
20671 "the space available in its volume group. A typical usage, assuming a Linux "
20672 "guest with a single PV C</dev/sda2> and a root device called "
20673 "C</dev/vg_guest/lv_root> would be:"
20677 #: ../resize/virt-resize.pod:336
20680 " virt-resize indisk outdisk \\\n"
20681 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
20686 #: ../resize/virt-resize.pod:339
20688 "This would first expand the partition (and PV), and then expand the root "
20689 "device to fill the extra space in the PV."
20693 #: ../resize/virt-resize.pod:342
20695 "The contents of the LV are also resized if virt-resize knows how to do "
20696 "that. You can stop virt-resize from trying to expand the content by using "
20697 "the option I<--no-expand-content>."
20701 #: ../resize/virt-resize.pod:346
20702 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
20706 #: ../resize/virt-resize.pod:348
20708 "You can give this option multiple times, I<but> it doesn't make sense to do "
20709 "this unless the logical volumes you specify are all in different volume "
20714 #: ../resize/virt-resize.pod:354
20715 msgid "B<--dryrun>"
20719 #: ../resize/virt-resize.pod:356
20720 msgid "Print a summary of what would be done, but don't do anything."
20724 #: ../resize/virt-resize.pod:358
20725 msgid "B<--no-copy-boot-loader>"
20729 #: ../resize/virt-resize.pod:360
20731 "By default, virt-resize copies over some sectors at the start of the disk "
20732 "(up to the beginning of the first partition). Commonly these sectors "
20733 "contain the Master Boot Record (MBR) and the boot loader, and are required "
20734 "in order for the guest to boot correctly."
20738 #: ../resize/virt-resize.pod:365
20740 "If you specify this flag, then this initial copy is not done. You may need "
20741 "to reinstall the boot loader in this case."
20745 #: ../resize/virt-resize.pod:368
20746 msgid "B<--no-extra-partition>"
20750 #: ../resize/virt-resize.pod:370
20752 "By default, virt-resize creates an extra partition if there is any extra, "
20753 "unused space after all resizing has happened. Use this option to prevent "
20754 "the extra partition from being created. If you do this then the extra space "
20755 "will be inaccessible until you run fdisk, parted, or some other partitioning "
20756 "tool in the guest."
20760 #: ../resize/virt-resize.pod:376
20762 "Note that if the surplus space is smaller than 10 MB, no extra partition "
20767 #: ../resize/virt-resize.pod:379
20768 msgid "B<--no-expand-content>"
20772 #: ../resize/virt-resize.pod:381
20774 "By default, virt-resize will try to expand the direct contents of "
20775 "partitions, if it knows how (see I<--expand> option above)."
20779 #: ../resize/virt-resize.pod:384
20781 "If you give the I<--no-expand-content> option then virt-resize will not "
20786 #: ../resize/virt-resize.pod:387
20787 msgid "B<--ntfsresize-force>"
20791 #: ../resize/virt-resize.pod:389
20793 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
20794 "the NTFS disk is marked as needing a consistency check. You have to use "
20795 "this option if you want to resize a Windows guest multiple times without "
20796 "booting into Windows between each resize."
20800 #: ../resize/virt-resize.pod:395
20801 msgid "B<--output-format> raw"
20805 #: ../resize/virt-resize.pod:397
20807 "Specify the format of the output disk image. If this flag is not given then "
20808 "it is auto-detected from the image itself."
20812 #: ../resize/virt-resize.pod:403
20814 "Note that this option I<does not create> the output format. This option "
20815 "just tells libguestfs what it is so it doesn't try to guess it. You still "
20816 "need to create the output disk with the right format. See L</QCOW2 AND "
20817 "NON-SPARSE RAW FORMATS>."
20821 #: ../resize/virt-resize.pod:408
20826 #: ../resize/virt-resize.pod:410
20831 #: ../resize/virt-resize.pod:412
20832 msgid "Don't print the summary."
20836 #: ../resize/virt-resize.pod:414
20837 msgid "B<--resize part=size>"
20841 #: ../resize/virt-resize.pod:416
20843 "Resize the named partition (expanding or shrinking it) so that it has the "
20848 #: ../resize/virt-resize.pod:419
20850 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
20851 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
20852 "size; or as a relative number or percentage. For example:"
20856 #: ../resize/virt-resize.pod:425
20859 " --resize /dev/sda2=10G\n"
20864 #: ../resize/virt-resize.pod:427
20867 " --resize /dev/sda4=90%\n"
20872 #: ../resize/virt-resize.pod:429
20875 " --resize /dev/sda2=+1G\n"
20880 #: ../resize/virt-resize.pod:431
20883 " --resize /dev/sda2=-200M\n"
20888 #: ../resize/virt-resize.pod:433
20891 " --resize /dev/sda1=+128K\n"
20896 #: ../resize/virt-resize.pod:435
20899 " --resize /dev/sda1=+10%\n"
20904 #: ../resize/virt-resize.pod:437
20907 " --resize /dev/sda1=-10%\n"
20912 #: ../resize/virt-resize.pod:439
20914 "You can increase the size of any partition. Virt-resize will expand the "
20915 "direct content of the partition if it knows how (see I<--expand> below)."
20919 #: ../resize/virt-resize.pod:443
20921 "You can only I<decrease> the size of partitions that contain filesystems or "
20922 "PVs which have already been shrunk. Virt-resize will check this has been "
20923 "done before proceeding, or else will print an error (see also "
20924 "I<--resize-force>)."
20928 #: ../resize/virt-resize.pod:450
20929 msgid "B<--resize-force part=size>"
20933 #: ../resize/virt-resize.pod:452
20935 "This is the same as I<--resize> except that it will let you decrease the "
20936 "size of any partition. Generally this means you will lose any data which "
20937 "was at the end of the partition you shrink, but you may not care about that "
20938 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
20939 "as a swap partition)."
20943 #: ../resize/virt-resize.pod:458
20944 msgid "See also the I<--ignore> option."
20948 #: ../resize/virt-resize.pod:460
20949 msgid "B<--shrink part>"
20953 #: ../resize/virt-resize.pod:462
20955 "Shrink the named partition until the overall disk image fits in the "
20956 "destination. The named partition B<must> contain a filesystem or PV which "
20957 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
20958 "online tools). Virt-resize will check this and give an error if it has not "
20963 #: ../resize/virt-resize.pod:468
20965 "The amount by which the overall disk must be shrunk (after carrying out all "
20966 "other operations requested by the user) is called the \"deficit\". For "
20967 "example, a straight copy (assume no other operations) from a 5GB disk image "
20968 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
20969 "would give an error unless the user specified a partition to shrink and that "
20970 "partition had more than a gigabyte of free space."
20974 #: ../resize/virt-resize.pod:488
20975 msgid "\"Partition 1 does not end on cylinder boundary.\""
20979 #: ../resize/virt-resize.pod:490
20981 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
20982 "means the partitions will not be aligned to the ancient CHS geometry. "
20983 "However CHS geometry is meaningless for disks manufactured since the early "
20984 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
20985 "cylinders is not required by any modern operating system."
20989 #: ../resize/virt-resize.pod:497
20990 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
20994 #: ../resize/virt-resize.pod:499
20996 "In Windows Vista and later versions, Microsoft switched to using a separate "
20997 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
20998 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
20999 "the boot partition. Doing so seems to break the guest completely. However "
21000 "expanding the second partition (ie. C: drive) should work."
21004 #: ../resize/virt-resize.pod:506
21006 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21007 "NTFS partitions have been expanded. This is just a safety check and (unless "
21008 "it find errors) is nothing to worry about."
21012 #: ../resize/virt-resize.pod:510
21013 msgid "GUEST BOOT STUCK AT \"GRUB\""
21017 #: ../resize/virt-resize.pod:512
21019 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21020 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21021 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21022 "although we think is to do with partition alignment."
21026 #: ../resize/virt-resize.pod:517
21029 " guestfish -i -a newdisk\n"
21030 " ><fs> cat /boot/grub/device.map\n"
21031 " # check the contents of this file are sensible or\n"
21032 " # edit the file if necessary\n"
21033 " ><fs> grub-install / /dev/vda\n"
21039 #: ../resize/virt-resize.pod:524
21041 "For more flexible guest reconfiguration, including if you need to specify "
21042 "other parameters to grub-install, use L<virt-rescue(1)>."
21046 #: ../resize/virt-resize.pod:527
21047 msgid "ALTERNATIVE TOOLS"
21051 #: ../resize/virt-resize.pod:529
21053 "There are several proprietary tools for resizing partitions. We won't "
21054 "mention any here."
21058 #: ../resize/virt-resize.pod:532
21060 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21061 "operations on disk images. They can resize and move partitions, but I don't "
21062 "think they can do anything with the contents, and they certainly don't "
21067 #: ../resize/virt-resize.pod:537
21069 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21070 "but at a much lower level. You will probably end up hand-calculating sector "
21071 "offsets, which is something that virt-resize was designed to avoid. If you "
21072 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21077 #: ../resize/virt-resize.pod:552
21079 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
21080 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
21081 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
21082 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
21083 "L<http://libguestfs.org/>."
21087 #: ../ruby/examples/guestfs-ruby.pod:5
21088 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21092 #: ../ruby/examples/guestfs-ruby.pod:9
21095 " require 'guestfs'\n"
21096 " g = Guestfs::Guestfs.new()\n"
21097 " g.add_drive_opts(\"disk.img\",\n"
21098 " :readonly => 1, :format => \"raw\")\n"
21104 #: ../ruby/examples/guestfs-ruby.pod:17
21106 "This manual page documents how to call libguestfs from the Ruby programming "
21107 "language. This page just documents the differences from the C API and gives "
21108 "some examples. If you are not familiar with using libguestfs, you also need "
21109 "to read L<guestfs(3)>."
21113 #: ../ruby/examples/guestfs-ruby.pod:24
21115 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21116 "This has a single parameter which is the error message (a string)."
21120 #: ../ruby/examples/guestfs-ruby.pod:38
21122 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
21123 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21124 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
21128 #: ../src/guestfs-actions.pod:1
21129 msgid "guestfs_add_cdrom"
21133 #: ../src/guestfs-actions.pod:3
21137 " guestfs_add_cdrom (guestfs_h *g,\n"
21138 " const char *filename);\n"
21143 #: ../src/guestfs-actions.pod:17
21145 "This call checks for the existence of C<filename>. This stops you from "
21146 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21147 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21152 #: ../src/guestfs-actions.pod:24
21154 "If you just want to add an ISO file (often you use this as an efficient way "
21155 "to transfer large files into the guest), then you should probably use "
21156 "C<guestfs_add_drive_ro> instead."
21160 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273 ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307 ../src/guestfs-actions.pod:422 ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:456 ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:529 ../src/guestfs-actions.pod:547 ../src/guestfs-actions.pod:614 ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:661 ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:775 ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807 ../src/guestfs-actions.pod:821 ../src/guestfs-actions.pod:858 ../src/guestfs-actions.pod:1041 ../src/guestfs-actions.pod:1061 ../src/guestfs-actions.pod:1079 ../src/guestfs-actions.pod:1163 ../src/guestfs-actions.pod:1181 ../src/guestfs-actions.pod:1200 ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1234 ../src/guestfs-actions.pod:1304 ../src/guestfs-actions.pod:1335 ../src/guestfs-actions.pod:1360 ../src/guestfs-actions.pod:1402 ../src/guestfs-actions.pod:1508 ../src/guestfs-actions.pod:1542 ../src/guestfs-actions.pod:1757 ../src/guestfs-actions.pod:1779 ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:2341 ../src/guestfs-actions.pod:2485 ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:2581 ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3661 ../src/guestfs-actions.pod:3850 ../src/guestfs-actions.pod:3864 ../src/guestfs-actions.pod:3877 ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:3942 ../src/guestfs-actions.pod:4014 ../src/guestfs-actions.pod:4034 ../src/guestfs-actions.pod:4051 ../src/guestfs-actions.pod:4074 ../src/guestfs-actions.pod:4097 ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:4151 ../src/guestfs-actions.pod:4170 ../src/guestfs-actions.pod:4205 ../src/guestfs-actions.pod:4217 ../src/guestfs-actions.pod:4253 ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:4282 ../src/guestfs-actions.pod:4297 ../src/guestfs-actions.pod:4314 ../src/guestfs-actions.pod:4407 ../src/guestfs-actions.pod:4427 ../src/guestfs-actions.pod:4440 ../src/guestfs-actions.pod:4491 ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4527 ../src/guestfs-actions.pod:4543 ../src/guestfs-actions.pod:4557 ../src/guestfs-actions.pod:4571 ../src/guestfs-actions.pod:4588 ../src/guestfs-actions.pod:4603 ../src/guestfs-actions.pod:4623 ../src/guestfs-actions.pod:4693 ../src/guestfs-actions.pod:4766 ../src/guestfs-actions.pod:4797 ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:4835 ../src/guestfs-actions.pod:4847 ../src/guestfs-actions.pod:4864 ../src/guestfs-actions.pod:4877 ../src/guestfs-actions.pod:4892 ../src/guestfs-actions.pod:4907 ../src/guestfs-actions.pod:4942 ../src/guestfs-actions.pod:4975 ../src/guestfs-actions.pod:5014 ../src/guestfs-actions.pod:5034 ../src/guestfs-actions.pod:5048 ../src/guestfs-actions.pod:5065 ../src/guestfs-actions.pod:5114 ../src/guestfs-actions.pod:5160 ../src/guestfs-actions.pod:5214 ../src/guestfs-actions.pod:5250 ../src/guestfs-actions.pod:5285 ../src/guestfs-actions.pod:5302 ../src/guestfs-actions.pod:5320 ../src/guestfs-actions.pod:5460 ../src/guestfs-actions.pod:5517 ../src/guestfs-actions.pod:5539 ../src/guestfs-actions.pod:5557 ../src/guestfs-actions.pod:5589 ../src/guestfs-actions.pod:5655 ../src/guestfs-actions.pod:5672 ../src/guestfs-actions.pod:5685 ../src/guestfs-actions.pod:5699 ../src/guestfs-actions.pod:5988 ../src/guestfs-actions.pod:6007 ../src/guestfs-actions.pod:6026 ../src/guestfs-actions.pod:6040 ../src/guestfs-actions.pod:6052 ../src/guestfs-actions.pod:6066 ../src/guestfs-actions.pod:6078 ../src/guestfs-actions.pod:6092 ../src/guestfs-actions.pod:6108 ../src/guestfs-actions.pod:6129 ../src/guestfs-actions.pod:6148 ../src/guestfs-actions.pod:6167 ../src/guestfs-actions.pod:6197 ../src/guestfs-actions.pod:6215 ../src/guestfs-actions.pod:6238 ../src/guestfs-actions.pod:6256 ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6296 ../src/guestfs-actions.pod:6315 ../src/guestfs-actions.pod:6332 ../src/guestfs-actions.pod:6351 ../src/guestfs-actions.pod:6379 ../src/guestfs-actions.pod:6403 ../src/guestfs-actions.pod:6422 ../src/guestfs-actions.pod:6446 ../src/guestfs-actions.pod:6465 ../src/guestfs-actions.pod:6480 ../src/guestfs-actions.pod:6499 ../src/guestfs-actions.pod:6536 ../src/guestfs-actions.pod:6566 ../src/guestfs-actions.pod:6599 ../src/guestfs-actions.pod:6721 ../src/guestfs-actions.pod:6842 ../src/guestfs-actions.pod:6854 ../src/guestfs-actions.pod:6867 ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:6902 ../src/guestfs-actions.pod:6915 ../src/guestfs-actions.pod:6928 ../src/guestfs-actions.pod:6941 ../src/guestfs-actions.pod:6956 ../src/guestfs-actions.pod:7015 ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7048 ../src/guestfs-actions.pod:7064 ../src/guestfs-actions.pod:7081 ../src/guestfs-actions.pod:7094 ../src/guestfs-actions.pod:7114 ../src/guestfs-actions.pod:7150 ../src/guestfs-actions.pod:7164 ../src/guestfs-actions.pod:7205 ../src/guestfs-actions.pod:7218 ../src/guestfs-actions.pod:7236 ../src/guestfs-actions.pod:7270 ../src/guestfs-actions.pod:7306 ../src/guestfs-actions.pod:7422 ../src/guestfs-actions.pod:7437 ../src/guestfs-actions.pod:7451 ../src/guestfs-actions.pod:7506 ../src/guestfs-actions.pod:7519 ../src/guestfs-actions.pod:7564 ../src/guestfs-actions.pod:7597 ../src/guestfs-actions.pod:7660 ../src/guestfs-actions.pod:7680 ../src/guestfs-actions.pod:7706 ../src/guestfs-actions.pod:7773 ../src/guestfs-actions.pod:7792 ../src/guestfs-actions.pod:7821
21161 msgid "This function returns 0 on success or -1 on error."
21165 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1165 ../src/guestfs-actions.pod:1980 ../src/guestfs-actions.pod:2078 ../src/guestfs-actions.pod:2192 ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:4951 ../src/guestfs-actions.pod:6217 ../src/guestfs-actions.pod:6334 ../src/guestfs-actions.pod:6467 ../src/guestfs-actions.pod:6958 ../src/guestfs-actions.pod:7083 ../src/guestfs-actions.pod:7606
21166 msgid "(Added in 0.3)"
21170 #: ../src/guestfs-actions.pod:41
21171 msgid "guestfs_add_domain"
21175 #: ../src/guestfs-actions.pod:43
21179 " guestfs_add_domain (guestfs_h *g,\n"
21180 " const char *dom,\n"
21186 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:832 ../src/guestfs-actions.pod:2826 ../src/guestfs-actions.pod:4642 ../src/guestfs-actions.pod:4961 ../src/guestfs-actions.pod:5178
21188 "You may supply a list of optional arguments to this call. Use zero or more "
21189 "of the following pairs of parameters, and terminate the list with C<-1> on "
21190 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
21194 #: ../src/guestfs-actions.pod:53
21197 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
21198 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
21199 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
21200 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
21201 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
21206 #: ../src/guestfs-actions.pod:59
21208 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
21209 "It works by connecting to libvirt, requesting the domain and domain XML from "
21210 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
21215 #: ../src/guestfs-actions.pod:94
21217 "The other optional parameters are passed directly through to "
21218 "C<guestfs_add_drive_opts>."
21222 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350 ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:724 ../src/guestfs-actions.pod:742 ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:1380 ../src/guestfs-actions.pod:1736 ../src/guestfs-actions.pod:1939 ../src/guestfs-actions.pod:2050 ../src/guestfs-actions.pod:2101 ../src/guestfs-actions.pod:2156 ../src/guestfs-actions.pod:2179 ../src/guestfs-actions.pod:2472 ../src/guestfs-actions.pod:2944 ../src/guestfs-actions.pod:2962 ../src/guestfs-actions.pod:5137 ../src/guestfs-actions.pod:5357 ../src/guestfs-actions.pod:5769 ../src/guestfs-actions.pod:5795 ../src/guestfs-actions.pod:7191 ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:7630 ../src/guestfs-actions.pod:7643
21223 msgid "On error this function returns -1."
21227 #: ../src/guestfs-actions.pod:99
21228 msgid "(Added in 1.7.4)"
21232 #: ../src/guestfs-actions.pod:101
21233 msgid "guestfs_add_domain_va"
21237 #: ../src/guestfs-actions.pod:103
21241 " guestfs_add_domain_va (guestfs_h *g,\n"
21242 " const char *dom,\n"
21243 " va_list args);\n"
21248 #: ../src/guestfs-actions.pod:108
21249 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
21253 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225 ../src/guestfs-actions.pod:871 ../src/guestfs-actions.pod:882 ../src/guestfs-actions.pod:2910 ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:4707 ../src/guestfs-actions.pod:4719 ../src/guestfs-actions.pod:4989 ../src/guestfs-actions.pod:5001 ../src/guestfs-actions.pod:5227 ../src/guestfs-actions.pod:5238
21254 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
21258 #: ../src/guestfs-actions.pod:112
21259 msgid "guestfs_add_domain_argv"
21263 #: ../src/guestfs-actions.pod:114
21267 " guestfs_add_domain_argv (guestfs_h *g,\n"
21268 " const char *dom,\n"
21269 " const struct guestfs_add_domain_argv *optargs);\n"
21274 #: ../src/guestfs-actions.pod:119
21275 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
21279 #: ../src/guestfs-actions.pod:123
21280 msgid "guestfs_add_drive"
21284 #: ../src/guestfs-actions.pod:125
21288 " guestfs_add_drive (guestfs_h *g,\n"
21289 " const char *filename);\n"
21294 #: ../src/guestfs-actions.pod:129
21296 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
21297 "optional parameters, so the disk is added writable, with the format being "
21298 "detected automatically."
21302 #: ../src/guestfs-actions.pod:133
21304 "Automatic detection of the format opens you up to a potential security hole "
21305 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
21306 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
21307 "you should think about replacing calls to this function with calls to "
21308 "C<guestfs_add_drive_opts>, and specifying the format."
21312 #: ../src/guestfs-actions.pod:144
21313 msgid "guestfs_add_drive_opts"
21317 #: ../src/guestfs-actions.pod:146
21321 " guestfs_add_drive_opts (guestfs_h *g,\n"
21322 " const char *filename,\n"
21328 #: ../src/guestfs-actions.pod:156
21331 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
21332 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
21333 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
21338 #: ../src/guestfs-actions.pod:185
21340 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
21341 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
21342 "Possible formats include C<raw> and C<qcow2>."
21346 #: ../src/guestfs-actions.pod:196
21348 "This rarely-used option lets you emulate the behaviour of the deprecated "
21349 "C<guestfs_add_drive_with_if> call (q.v.)"
21353 #: ../src/guestfs-actions.pod:203
21354 msgid "(Added in 1.5.23)"
21358 #: ../src/guestfs-actions.pod:205
21359 msgid "guestfs_add_drive_opts_va"
21363 #: ../src/guestfs-actions.pod:207
21367 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
21368 " const char *filename,\n"
21369 " va_list args);\n"
21374 #: ../src/guestfs-actions.pod:212
21375 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
21379 #: ../src/guestfs-actions.pod:216
21380 msgid "guestfs_add_drive_opts_argv"
21384 #: ../src/guestfs-actions.pod:218
21388 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
21389 " const char *filename,\n"
21390 " const struct guestfs_add_drive_opts_argv "
21396 #: ../src/guestfs-actions.pod:223
21397 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
21401 #: ../src/guestfs-actions.pod:227
21402 msgid "guestfs_add_drive_ro"
21406 #: ../src/guestfs-actions.pod:229
21410 " guestfs_add_drive_ro (guestfs_h *g,\n"
21411 " const char *filename);\n"
21416 #: ../src/guestfs-actions.pod:233
21418 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
21419 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
21420 "disk is added read-only, with the format being detected automatically."
21424 #: ../src/guestfs-actions.pod:240
21425 msgid "(Added in 1.0.38)"
21429 #: ../src/guestfs-actions.pod:242
21430 msgid "guestfs_add_drive_ro_with_if"
21434 #: ../src/guestfs-actions.pod:244
21438 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
21439 " const char *filename,\n"
21440 " const char *iface);\n"
21445 #: ../src/guestfs-actions.pod:249
21447 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
21448 "QEMU interface emulation to use at run time."
21452 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282 ../src/guestfs-actions.pod:2431
21453 msgid "(Added in 1.0.84)"
21457 #: ../src/guestfs-actions.pod:263
21458 msgid "guestfs_add_drive_with_if"
21462 #: ../src/guestfs-actions.pod:265
21466 " guestfs_add_drive_with_if (guestfs_h *g,\n"
21467 " const char *filename,\n"
21468 " const char *iface);\n"
21473 #: ../src/guestfs-actions.pod:270
21475 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
21476 "QEMU interface emulation to use at run time."
21480 #: ../src/guestfs-actions.pod:284
21481 msgid "guestfs_aug_clear"
21485 #: ../src/guestfs-actions.pod:286
21489 " guestfs_aug_clear (guestfs_h *g,\n"
21490 " const char *augpath);\n"
21495 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2181
21496 msgid "(Added in 1.3.4)"
21500 #: ../src/guestfs-actions.pod:297
21501 msgid "guestfs_aug_close"
21505 #: ../src/guestfs-actions.pod:299
21509 " guestfs_aug_close (guestfs_h *g);\n"
21514 #: ../src/guestfs-actions.pod:302
21516 "Close the current Augeas handle and free up any resources used by it. After "
21517 "calling this, you have to call C<guestfs_aug_init> again before you can use "
21518 "any other Augeas functions."
21522 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334 ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366 ../src/guestfs-actions.pod:424 ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:458 ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:549 ../src/guestfs-actions.pod:5846
21523 msgid "(Added in 0.7)"
21527 #: ../src/guestfs-actions.pod:311
21528 msgid "guestfs_aug_defnode"
21532 #: ../src/guestfs-actions.pod:313
21535 " struct guestfs_int_bool *\n"
21536 " guestfs_aug_defnode (guestfs_h *g,\n"
21537 " const char *name,\n"
21538 " const char *expr,\n"
21539 " const char *val);\n"
21544 #: ../src/guestfs-actions.pod:322
21546 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
21547 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
21548 "containing that single node."
21552 #: ../src/guestfs-actions.pod:330
21554 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
21555 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
21559 #: ../src/guestfs-actions.pod:336
21560 msgid "guestfs_aug_defvar"
21564 #: ../src/guestfs-actions.pod:338
21568 " guestfs_aug_defvar (guestfs_h *g,\n"
21569 " const char *name,\n"
21570 " const char *expr);\n"
21575 #: ../src/guestfs-actions.pod:354
21576 msgid "guestfs_aug_get"
21580 #: ../src/guestfs-actions.pod:356
21584 " guestfs_aug_get (guestfs_h *g,\n"
21585 " const char *augpath);\n"
21590 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:922 ../src/guestfs-actions.pod:940 ../src/guestfs-actions.pod:1000 ../src/guestfs-actions.pod:1016 ../src/guestfs-actions.pod:1119 ../src/guestfs-actions.pod:1249 ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1419 ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1719 ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:1899 ../src/guestfs-actions.pod:1966 ../src/guestfs-actions.pod:2002 ../src/guestfs-actions.pod:2023 ../src/guestfs-actions.pod:2204 ../src/guestfs-actions.pod:2396 ../src/guestfs-actions.pod:2600 ../src/guestfs-actions.pod:2690 ../src/guestfs-actions.pod:2794 ../src/guestfs-actions.pod:2813 ../src/guestfs-actions.pod:3027 ../src/guestfs-actions.pod:3055 ../src/guestfs-actions.pod:3076 ../src/guestfs-actions.pod:3110 ../src/guestfs-actions.pod:3169 ../src/guestfs-actions.pod:3189 ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3836 ../src/guestfs-actions.pod:4189 ../src/guestfs-actions.pod:4359 ../src/guestfs-actions.pod:4469 ../src/guestfs-actions.pod:5375 ../src/guestfs-actions.pod:5574 ../src/guestfs-actions.pod:5744 ../src/guestfs-actions.pod:5922 ../src/guestfs-actions.pod:5971 ../src/guestfs-actions.pod:6627 ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6660 ../src/guestfs-actions.pod:6691 ../src/guestfs-actions.pod:7365 ../src/guestfs-actions.pod:7384 ../src/guestfs-actions.pod:7402 ../src/guestfs-actions.pod:7576 ../src/guestfs-actions.pod:7878
21592 "This function returns a string, or NULL on error. I<The caller must free "
21593 "the returned string after use>."
21597 #: ../src/guestfs-actions.pod:368
21598 msgid "guestfs_aug_init"
21602 #: ../src/guestfs-actions.pod:370
21606 " guestfs_aug_init (guestfs_h *g,\n"
21607 " const char *root,\n"
21613 #: ../src/guestfs-actions.pod:379
21614 msgid "You must call this before using any other C<guestfs_aug_*> commands."
21618 #: ../src/guestfs-actions.pod:414
21619 msgid "Do not load the tree in C<guestfs_aug_init>."
21623 #: ../src/guestfs-actions.pod:418
21624 msgid "To close the handle, you can call C<guestfs_aug_close>."
21628 #: ../src/guestfs-actions.pod:426
21629 msgid "guestfs_aug_insert"
21633 #: ../src/guestfs-actions.pod:428
21637 " guestfs_aug_insert (guestfs_h *g,\n"
21638 " const char *augpath,\n"
21639 " const char *label,\n"
21645 #: ../src/guestfs-actions.pod:446
21646 msgid "guestfs_aug_load"
21650 #: ../src/guestfs-actions.pod:448
21654 " guestfs_aug_load (guestfs_h *g);\n"
21659 #: ../src/guestfs-actions.pod:460
21660 msgid "guestfs_aug_ls"
21664 #: ../src/guestfs-actions.pod:462
21668 " guestfs_aug_ls (guestfs_h *g,\n"
21669 " const char *augpath);\n"
21674 #: ../src/guestfs-actions.pod:466
21676 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
21677 "sorting the resulting nodes into alphabetical order."
21681 #: ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:485 ../src/guestfs-actions.pod:631 ../src/guestfs-actions.pod:1138 ../src/guestfs-actions.pod:1434 ../src/guestfs-actions.pod:1453 ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1575 ../src/guestfs-actions.pod:1821 ../src/guestfs-actions.pod:2276 ../src/guestfs-actions.pod:2292 ../src/guestfs-actions.pod:2311 ../src/guestfs-actions.pod:2354 ../src/guestfs-actions.pod:2378 ../src/guestfs-actions.pod:2449 ../src/guestfs-actions.pod:2498 ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:3129 ../src/guestfs-actions.pod:3405 ../src/guestfs-actions.pod:3719 ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3756 ../src/guestfs-actions.pod:3818 ../src/guestfs-actions.pod:3923 ../src/guestfs-actions.pod:4331 ../src/guestfs-actions.pod:5098 ../src/guestfs-actions.pod:5716 ../src/guestfs-actions.pod:5842 ../src/guestfs-actions.pod:5956 ../src/guestfs-actions.pod:6707 ../src/guestfs-actions.pod:6768 ../src/guestfs-actions.pod:6823 ../src/guestfs-actions.pod:6969 ../src/guestfs-actions.pod:6993 ../src/guestfs-actions.pod:7469 ../src/guestfs-actions.pod:7489 ../src/guestfs-actions.pod:7536 ../src/guestfs-actions.pod:7730 ../src/guestfs-actions.pod:7749 ../src/guestfs-actions.pod:7835 ../src/guestfs-actions.pod:7854 ../src/guestfs-actions.pod:7900 ../src/guestfs-actions.pod:7919
21683 "This function returns a NULL-terminated array of strings (like "
21684 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
21685 "strings and the array after use>."
21689 #: ../src/guestfs-actions.pod:473 ../src/guestfs-actions.pod:1063 ../src/guestfs-actions.pod:1081 ../src/guestfs-actions.pod:1491 ../src/guestfs-actions.pod:3483 ../src/guestfs-actions.pod:3514 ../src/guestfs-actions.pod:4172 ../src/guestfs-actions.pod:4222 ../src/guestfs-actions.pod:4409 ../src/guestfs-actions.pod:4442 ../src/guestfs-actions.pod:4605 ../src/guestfs-actions.pod:5102 ../src/guestfs-actions.pod:5657 ../src/guestfs-actions.pod:6054 ../src/guestfs-actions.pod:6068 ../src/guestfs-actions.pod:6080 ../src/guestfs-actions.pod:6548 ../src/guestfs-actions.pod:7207 ../src/guestfs-actions.pod:7220 ../src/guestfs-actions.pod:7453 ../src/guestfs-actions.pod:7718
21690 msgid "(Added in 0.8)"
21694 #: ../src/guestfs-actions.pod:475
21695 msgid "guestfs_aug_match"
21699 #: ../src/guestfs-actions.pod:477
21703 " guestfs_aug_match (guestfs_h *g,\n"
21704 " const char *augpath);\n"
21709 #: ../src/guestfs-actions.pod:491
21710 msgid "guestfs_aug_mv"
21714 #: ../src/guestfs-actions.pod:493
21718 " guestfs_aug_mv (guestfs_h *g,\n"
21719 " const char *src,\n"
21720 " const char *dest);\n"
21725 #: ../src/guestfs-actions.pod:505
21726 msgid "guestfs_aug_rm"
21730 #: ../src/guestfs-actions.pod:507
21734 " guestfs_aug_rm (guestfs_h *g,\n"
21735 " const char *augpath);\n"
21740 #: ../src/guestfs-actions.pod:519
21741 msgid "guestfs_aug_save"
21745 #: ../src/guestfs-actions.pod:521
21749 " guestfs_aug_save (guestfs_h *g);\n"
21754 #: ../src/guestfs-actions.pod:526
21756 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
21761 #: ../src/guestfs-actions.pod:533
21762 msgid "guestfs_aug_set"
21766 #: ../src/guestfs-actions.pod:535
21770 " guestfs_aug_set (guestfs_h *g,\n"
21771 " const char *augpath,\n"
21772 " const char *val);\n"
21777 #: ../src/guestfs-actions.pod:542
21779 "In the Augeas API, it is possible to clear a node by setting the value to "
21780 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
21781 "this call. Instead you must use the C<guestfs_aug_clear> call."
21785 #: ../src/guestfs-actions.pod:551
21786 msgid "guestfs_available"
21790 #: ../src/guestfs-actions.pod:553
21794 " guestfs_available (guestfs_h *g,\n"
21795 " char *const *groups);\n"
21800 #: ../src/guestfs-actions.pod:561
21802 "The libguestfs groups, and the functions that those groups correspond to, "
21803 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
21804 "runtime by calling C<guestfs_available_all_groups>."
21808 #: ../src/guestfs-actions.pod:585
21809 msgid "You must call C<guestfs_launch> before calling this function."
21813 #: ../src/guestfs-actions.pod:607
21815 "This call was added in version C<1.0.80>. In previous versions of "
21816 "libguestfs all you could do would be to speculatively execute a command to "
21817 "find out if the daemon implemented it. See also C<guestfs_version>."
21821 #: ../src/guestfs-actions.pod:616 ../src/guestfs-actions.pod:1236
21822 msgid "(Added in 1.0.80)"
21826 #: ../src/guestfs-actions.pod:618
21827 msgid "guestfs_available_all_groups"
21831 #: ../src/guestfs-actions.pod:620
21835 " guestfs_available_all_groups (guestfs_h *g);\n"
21840 #: ../src/guestfs-actions.pod:623
21842 "This command returns a list of all optional groups that this daemon knows "
21843 "about. Note this returns both supported and unsupported groups. To find "
21844 "out which ones the daemon can actually support you have to call "
21845 "C<guestfs_available> on each member of the returned list."
21849 #: ../src/guestfs-actions.pod:629
21850 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
21854 #: ../src/guestfs-actions.pod:635
21855 msgid "(Added in 1.3.15)"
21859 #: ../src/guestfs-actions.pod:637
21860 msgid "guestfs_base64_in"
21864 #: ../src/guestfs-actions.pod:639
21868 " guestfs_base64_in (guestfs_h *g,\n"
21869 " const char *base64file,\n"
21870 " const char *filename);\n"
21875 #: ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:663
21876 msgid "(Added in 1.3.5)"
21880 #: ../src/guestfs-actions.pod:651
21881 msgid "guestfs_base64_out"
21885 #: ../src/guestfs-actions.pod:653
21889 " guestfs_base64_out (guestfs_h *g,\n"
21890 " const char *filename,\n"
21891 " const char *base64file);\n"
21896 #: ../src/guestfs-actions.pod:665
21897 msgid "guestfs_blockdev_flushbufs"
21901 #: ../src/guestfs-actions.pod:667
21905 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
21906 " const char *device);\n"
21911 #: ../src/guestfs-actions.pod:678 ../src/guestfs-actions.pod:695 ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:744 ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:777 ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809 ../src/guestfs-actions.pod:823
21912 msgid "(Added in 0.9.3)"
21916 #: ../src/guestfs-actions.pod:680
21917 msgid "guestfs_blockdev_getbsz"
21921 #: ../src/guestfs-actions.pod:682
21925 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
21926 " const char *device);\n"
21931 #: ../src/guestfs-actions.pod:697
21932 msgid "guestfs_blockdev_getro"
21936 #: ../src/guestfs-actions.pod:699
21940 " guestfs_blockdev_getro (guestfs_h *g,\n"
21941 " const char *device);\n"
21946 #: ../src/guestfs-actions.pod:708 ../src/guestfs-actions.pod:1474 ../src/guestfs-actions.pod:1489 ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:1989 ../src/guestfs-actions.pod:2061 ../src/guestfs-actions.pod:2087 ../src/guestfs-actions.pod:2127 ../src/guestfs-actions.pod:2142 ../src/guestfs-actions.pod:2167 ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:3226 ../src/guestfs-actions.pod:3242 ../src/guestfs-actions.pod:3260 ../src/guestfs-actions.pod:3422 ../src/guestfs-actions.pod:3436 ../src/guestfs-actions.pod:3451 ../src/guestfs-actions.pod:3465 ../src/guestfs-actions.pod:3481 ../src/guestfs-actions.pod:3496 ../src/guestfs-actions.pod:3512 ../src/guestfs-actions.pod:3526 ../src/guestfs-actions.pod:3539 ../src/guestfs-actions.pod:3553 ../src/guestfs-actions.pod:3568 ../src/guestfs-actions.pod:3583 ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:5339
21947 msgid "This function returns a C truth value on success or -1 on error."
21951 #: ../src/guestfs-actions.pod:712
21952 msgid "guestfs_blockdev_getsize64"
21956 #: ../src/guestfs-actions.pod:714
21960 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
21961 " const char *device);\n"
21966 #: ../src/guestfs-actions.pod:720
21967 msgid "See also C<guestfs_blockdev_getsz>."
21971 #: ../src/guestfs-actions.pod:728
21972 msgid "guestfs_blockdev_getss"
21976 #: ../src/guestfs-actions.pod:730
21980 " guestfs_blockdev_getss (guestfs_h *g,\n"
21981 " const char *device);\n"
21986 #: ../src/guestfs-actions.pod:737
21988 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
21993 #: ../src/guestfs-actions.pod:746
21994 msgid "guestfs_blockdev_getsz"
21998 #: ../src/guestfs-actions.pod:748
22002 " guestfs_blockdev_getsz (guestfs_h *g,\n"
22003 " const char *device);\n"
22008 #: ../src/guestfs-actions.pod:755
22010 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
22011 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
22015 #: ../src/guestfs-actions.pod:765
22016 msgid "guestfs_blockdev_rereadpt"
22020 #: ../src/guestfs-actions.pod:767
22024 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
22025 " const char *device);\n"
22030 #: ../src/guestfs-actions.pod:779
22031 msgid "guestfs_blockdev_setbsz"
22035 #: ../src/guestfs-actions.pod:781
22039 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
22040 " const char *device,\n"
22041 " int blocksize);\n"
22046 #: ../src/guestfs-actions.pod:797
22047 msgid "guestfs_blockdev_setro"
22051 #: ../src/guestfs-actions.pod:799
22055 " guestfs_blockdev_setro (guestfs_h *g,\n"
22056 " const char *device);\n"
22061 #: ../src/guestfs-actions.pod:811
22062 msgid "guestfs_blockdev_setrw"
22066 #: ../src/guestfs-actions.pod:813
22070 " guestfs_blockdev_setrw (guestfs_h *g,\n"
22071 " const char *device);\n"
22076 #: ../src/guestfs-actions.pod:825
22077 msgid "guestfs_btrfs_filesystem_resize"
22081 #: ../src/guestfs-actions.pod:827
22085 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
22086 " const char *mountpoint,\n"
22092 #: ../src/guestfs-actions.pod:837
22095 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
22100 #: ../src/guestfs-actions.pod:860
22101 msgid "(Added in 1.11.17)"
22105 #: ../src/guestfs-actions.pod:862
22106 msgid "guestfs_btrfs_filesystem_resize_va"
22110 #: ../src/guestfs-actions.pod:864
22114 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
22115 " const char *mountpoint,\n"
22116 " va_list args);\n"
22121 #: ../src/guestfs-actions.pod:869
22122 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
22126 #: ../src/guestfs-actions.pod:873
22127 msgid "guestfs_btrfs_filesystem_resize_argv"
22131 #: ../src/guestfs-actions.pod:875
22135 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
22136 " const char *mountpoint,\n"
22138 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
22143 #: ../src/guestfs-actions.pod:880
22144 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
22148 #: ../src/guestfs-actions.pod:884
22149 msgid "guestfs_case_sensitive_path"
22153 #: ../src/guestfs-actions.pod:886
22157 " guestfs_case_sensitive_path (guestfs_h *g,\n"
22158 " const char *path);\n"
22163 #: ../src/guestfs-actions.pod:912
22165 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
22166 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
22167 "how the directories were originally created under Windows)."
22171 #: ../src/guestfs-actions.pod:920
22172 msgid "See also C<guestfs_realpath>."
22176 #: ../src/guestfs-actions.pod:925 ../src/guestfs-actions.pod:7387
22177 msgid "(Added in 1.0.75)"
22181 #: ../src/guestfs-actions.pod:927
22182 msgid "guestfs_cat"
22186 #: ../src/guestfs-actions.pod:929
22190 " guestfs_cat (guestfs_h *g,\n"
22191 " const char *path);\n"
22196 #: ../src/guestfs-actions.pod:935
22198 "Note that this function cannot correctly handle binary files (specifically, "
22199 "files containing C<\\0> character which is treated as end of string). For "
22200 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
22201 "functions which have a more complex interface."
22205 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:3740 ../src/guestfs-actions.pod:3822 ../src/guestfs-actions.pod:3839 ../src/guestfs-actions.pod:3927 ../src/guestfs-actions.pod:4335 ../src/guestfs-actions.pod:4349 ../src/guestfs-actions.pod:5720 ../src/guestfs-actions.pod:5734 ../src/guestfs-actions.pod:7540 ../src/guestfs-actions.pod:7554
22206 msgid "(Added in 0.4)"
22210 #: ../src/guestfs-actions.pod:948
22211 msgid "guestfs_checksum"
22215 #: ../src/guestfs-actions.pod:950
22219 " guestfs_checksum (guestfs_h *g,\n"
22220 " const char *csumtype,\n"
22221 " const char *path);\n"
22226 #: ../src/guestfs-actions.pod:996
22227 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
22231 #: ../src/guestfs-actions.pod:998
22232 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
22236 #: ../src/guestfs-actions.pod:1003 ../src/guestfs-actions.pod:1311 ../src/guestfs-actions.pod:2158 ../src/guestfs-actions.pod:3438 ../src/guestfs-actions.pod:3467 ../src/guestfs-actions.pod:3528 ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:7243
22237 msgid "(Added in 1.0.2)"
22241 #: ../src/guestfs-actions.pod:1005
22242 msgid "guestfs_checksum_device"
22246 #: ../src/guestfs-actions.pod:1007
22250 " guestfs_checksum_device (guestfs_h *g,\n"
22251 " const char *csumtype,\n"
22252 " const char *device);\n"
22257 #: ../src/guestfs-actions.pod:1012
22259 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
22260 "device named C<device>. For the types of checksums supported see the "
22261 "C<guestfs_checksum> command."
22265 #: ../src/guestfs-actions.pod:1019 ../src/guestfs-actions.pod:5169 ../src/guestfs-actions.pod:5304 ../src/guestfs-actions.pod:5341 ../src/guestfs-actions.pod:5359 ../src/guestfs-actions.pod:5541 ../src/guestfs-actions.pod:7152 ../src/guestfs-actions.pod:7166 ../src/guestfs-actions.pod:7566
22266 msgid "(Added in 1.3.2)"
22270 #: ../src/guestfs-actions.pod:1021
22271 msgid "guestfs_checksums_out"
22275 #: ../src/guestfs-actions.pod:1023
22279 " guestfs_checksums_out (guestfs_h *g,\n"
22280 " const char *csumtype,\n"
22281 " const char *directory,\n"
22282 " const char *sumsfile);\n"
22287 #: ../src/guestfs-actions.pod:1043
22288 msgid "(Added in 1.3.7)"
22292 #: ../src/guestfs-actions.pod:1045
22293 msgid "guestfs_chmod"
22297 #: ../src/guestfs-actions.pod:1047
22301 " guestfs_chmod (guestfs_h *g,\n"
22303 " const char *path);\n"
22308 #: ../src/guestfs-actions.pod:1065
22309 msgid "guestfs_chown"
22313 #: ../src/guestfs-actions.pod:1067
22317 " guestfs_chown (guestfs_h *g,\n"
22320 " const char *path);\n"
22325 #: ../src/guestfs-actions.pod:1083
22326 msgid "guestfs_command"
22330 #: ../src/guestfs-actions.pod:1085
22334 " guestfs_command (guestfs_h *g,\n"
22335 " char *const *arguments);\n"
22340 #: ../src/guestfs-actions.pod:1094
22342 "The single parameter is an argv-style list of arguments. The first element "
22343 "is the name of the program to run. Subsequent elements are parameters. The "
22344 "list must be non-empty (ie. must contain a program name). Note that the "
22345 "command runs directly, and is I<not> invoked via the shell (see "
22350 #: ../src/guestfs-actions.pod:1125 ../src/guestfs-actions.pod:1145 ../src/guestfs-actions.pod:1610
22351 msgid "(Added in 0.9.1)"
22355 #: ../src/guestfs-actions.pod:1127
22356 msgid "guestfs_command_lines"
22360 #: ../src/guestfs-actions.pod:1129
22364 " guestfs_command_lines (guestfs_h *g,\n"
22365 " char *const *arguments);\n"
22370 #: ../src/guestfs-actions.pod:1133
22372 "This is the same as C<guestfs_command>, but splits the result into a list of "
22377 #: ../src/guestfs-actions.pod:1136
22378 msgid "See also: C<guestfs_sh_lines>"
22382 #: ../src/guestfs-actions.pod:1147
22383 msgid "guestfs_config"
22387 #: ../src/guestfs-actions.pod:1149
22391 " guestfs_config (guestfs_h *g,\n"
22392 " const char *qemuparam,\n"
22393 " const char *qemuvalue);\n"
22398 #: ../src/guestfs-actions.pod:1167
22399 msgid "guestfs_copy_size"
22403 #: ../src/guestfs-actions.pod:1169
22407 " guestfs_copy_size (guestfs_h *g,\n"
22408 " const char *src,\n"
22409 " const char *dest,\n"
22410 " int64_t size);\n"
22415 #: ../src/guestfs-actions.pod:1183 ../src/guestfs-actions.pod:1306 ../src/guestfs-actions.pod:1337 ../src/guestfs-actions.pod:1382 ../src/guestfs-actions.pod:1759 ../src/guestfs-actions.pod:1781 ../src/guestfs-actions.pod:3638 ../src/guestfs-actions.pod:7238 ../src/guestfs-actions.pod:7272 ../src/guestfs-actions.pod:7775 ../src/guestfs-actions.pod:7794
22417 "This long-running command can generate progress notification messages so "
22418 "that the caller can display a progress bar or indicator. To receive these "
22419 "messages, the caller must register a progress event callback. See "
22420 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
22424 #: ../src/guestfs-actions.pod:1188 ../src/guestfs-actions.pod:4362 ../src/guestfs-actions.pod:5747 ../src/guestfs-actions.pod:7473 ../src/guestfs-actions.pod:7493 ../src/guestfs-actions.pod:7579
22425 msgid "(Added in 1.0.87)"
22429 #: ../src/guestfs-actions.pod:1190
22434 #: ../src/guestfs-actions.pod:1192
22438 " guestfs_cp (guestfs_h *g,\n"
22439 " const char *src,\n"
22440 " const char *dest);\n"
22445 #: ../src/guestfs-actions.pod:1202 ../src/guestfs-actions.pod:1216 ../src/guestfs-actions.pod:1288 ../src/guestfs-actions.pod:1362 ../src/guestfs-actions.pod:1476 ../src/guestfs-actions.pod:5116 ../src/guestfs-actions.pod:5591
22446 msgid "(Added in 1.0.18)"
22450 #: ../src/guestfs-actions.pod:1204
22451 msgid "guestfs_cp_a"
22455 #: ../src/guestfs-actions.pod:1206
22459 " guestfs_cp_a (guestfs_h *g,\n"
22460 " const char *src,\n"
22461 " const char *dest);\n"
22466 #: ../src/guestfs-actions.pod:1218
22471 #: ../src/guestfs-actions.pod:1220
22475 " guestfs_dd (guestfs_h *g,\n"
22476 " const char *src,\n"
22477 " const char *dest);\n"
22482 #: ../src/guestfs-actions.pod:1230
22484 "If the destination is a device, it must be as large or larger than the "
22485 "source file or device, otherwise the copy will fail. This command cannot do "
22486 "partial copies (see C<guestfs_copy_size>)."
22490 #: ../src/guestfs-actions.pod:1238
22495 #: ../src/guestfs-actions.pod:1240
22499 " guestfs_df (guestfs_h *g);\n"
22504 #: ../src/guestfs-actions.pod:1245 ../src/guestfs-actions.pod:1262
22506 "This command is mostly useful for interactive sessions. It is I<not> "
22507 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
22512 #: ../src/guestfs-actions.pod:1252 ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:1387 ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:2385 ../src/guestfs-actions.pod:2453 ../src/guestfs-actions.pod:4472 ../src/guestfs-actions.pod:5016 ../src/guestfs-actions.pod:6976 ../src/guestfs-actions.pod:7000 ../src/guestfs-actions.pod:7619 ../src/guestfs-actions.pod:7632 ../src/guestfs-actions.pod:7645
22513 msgid "(Added in 1.0.54)"
22517 #: ../src/guestfs-actions.pod:1254
22518 msgid "guestfs_df_h"
22522 #: ../src/guestfs-actions.pod:1256
22526 " guestfs_df_h (guestfs_h *g);\n"
22531 #: ../src/guestfs-actions.pod:1271
22532 msgid "guestfs_dmesg"
22536 #: ../src/guestfs-actions.pod:1273
22540 " guestfs_dmesg (guestfs_h *g);\n"
22545 #: ../src/guestfs-actions.pod:1280
22547 "Another way to get the same information is to enable verbose messages with "
22548 "C<guestfs_set_verbose> or by setting the environment variable "
22549 "C<LIBGUESTFS_DEBUG=1> before running the program."
22553 #: ../src/guestfs-actions.pod:1290
22554 msgid "guestfs_download"
22558 #: ../src/guestfs-actions.pod:1292
22562 " guestfs_download (guestfs_h *g,\n"
22563 " const char *remotefilename,\n"
22564 " const char *filename);\n"
22569 #: ../src/guestfs-actions.pod:1302
22570 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
22574 #: ../src/guestfs-actions.pod:1313
22575 msgid "guestfs_download_offset"
22579 #: ../src/guestfs-actions.pod:1315
22583 " guestfs_download_offset (guestfs_h *g,\n"
22584 " const char *remotefilename,\n"
22585 " const char *filename,\n"
22586 " int64_t offset,\n"
22587 " int64_t size);\n"
22592 #: ../src/guestfs-actions.pod:1328
22594 "Note that there is no limit on the amount of data that can be downloaded "
22595 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
22596 "full amount unless an error occurs."
22600 #: ../src/guestfs-actions.pod:1333
22601 msgid "See also C<guestfs_download>, C<guestfs_pread>."
22605 #: ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:7277
22606 msgid "(Added in 1.5.17)"
22610 #: ../src/guestfs-actions.pod:1344
22611 msgid "guestfs_drop_caches"
22615 #: ../src/guestfs-actions.pod:1346
22619 " guestfs_drop_caches (guestfs_h *g,\n"
22620 " int whattodrop);\n"
22625 #: ../src/guestfs-actions.pod:1364
22630 #: ../src/guestfs-actions.pod:1366
22634 " guestfs_du (guestfs_h *g,\n"
22635 " const char *path);\n"
22640 #: ../src/guestfs-actions.pod:1389
22641 msgid "guestfs_e2fsck_f"
22645 #: ../src/guestfs-actions.pod:1391
22649 " guestfs_e2fsck_f (guestfs_h *g,\n"
22650 " const char *device);\n"
22655 #: ../src/guestfs-actions.pod:1399
22657 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
22658 "Normally you should use C<guestfs_fsck>."
22662 #: ../src/guestfs-actions.pod:1404
22663 msgid "(Added in 1.0.29)"
22667 #: ../src/guestfs-actions.pod:1406
22668 msgid "guestfs_echo_daemon"
22672 #: ../src/guestfs-actions.pod:1408
22676 " guestfs_echo_daemon (guestfs_h *g,\n"
22677 " char *const *words);\n"
22682 #: ../src/guestfs-actions.pod:1417
22683 msgid "See also C<guestfs_ping_daemon>."
22687 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:2169 ../src/guestfs-actions.pod:6448
22688 msgid "(Added in 1.0.69)"
22692 #: ../src/guestfs-actions.pod:1424
22693 msgid "guestfs_egrep"
22697 #: ../src/guestfs-actions.pod:1426
22701 " guestfs_egrep (guestfs_h *g,\n"
22702 " const char *regex,\n"
22703 " const char *path);\n"
22708 #: ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1460 ../src/guestfs-actions.pod:1517 ../src/guestfs-actions.pod:1563 ../src/guestfs-actions.pod:1582 ../src/guestfs-actions.pod:2299 ../src/guestfs-actions.pod:2318 ../src/guestfs-actions.pod:2474 ../src/guestfs-actions.pod:2487 ../src/guestfs-actions.pod:2502 ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:3852 ../src/guestfs-actions.pod:3866 ../src/guestfs-actions.pod:3879 ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:4894 ../src/guestfs-actions.pod:5925 ../src/guestfs-actions.pod:5974 ../src/guestfs-actions.pod:6844 ../src/guestfs-actions.pod:6856 ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:6882 ../src/guestfs-actions.pod:6904 ../src/guestfs-actions.pod:6917 ../src/guestfs-actions.pod:6930 ../src/guestfs-actions.pod:6943 ../src/guestfs-actions.pod:7737 ../src/guestfs-actions.pod:7756 ../src/guestfs-actions.pod:7842 ../src/guestfs-actions.pod:7861 ../src/guestfs-actions.pod:7907 ../src/guestfs-actions.pod:7926
22709 msgid "(Added in 1.0.66)"
22713 #: ../src/guestfs-actions.pod:1443
22714 msgid "guestfs_egrepi"
22718 #: ../src/guestfs-actions.pod:1445
22722 " guestfs_egrepi (guestfs_h *g,\n"
22723 " const char *regex,\n"
22724 " const char *path);\n"
22729 #: ../src/guestfs-actions.pod:1462
22730 msgid "guestfs_equal"
22734 #: ../src/guestfs-actions.pod:1464
22738 " guestfs_equal (guestfs_h *g,\n"
22739 " const char *file1,\n"
22740 " const char *file2);\n"
22745 #: ../src/guestfs-actions.pod:1478
22746 msgid "guestfs_exists"
22750 #: ../src/guestfs-actions.pod:1480
22754 " guestfs_exists (guestfs_h *g,\n"
22755 " const char *path);\n"
22760 #: ../src/guestfs-actions.pod:1487
22761 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
22765 #: ../src/guestfs-actions.pod:1493
22766 msgid "guestfs_fallocate"
22770 #: ../src/guestfs-actions.pod:1495
22774 " guestfs_fallocate (guestfs_h *g,\n"
22775 " const char *path,\n"
22781 #: ../src/guestfs-actions.pod:1519
22782 msgid "guestfs_fallocate64"
22786 #: ../src/guestfs-actions.pod:1521
22790 " guestfs_fallocate64 (guestfs_h *g,\n"
22791 " const char *path,\n"
22797 #: ../src/guestfs-actions.pod:1530
22799 "Note that this call allocates disk blocks for the file. To create a sparse "
22800 "file use C<guestfs_truncate_size> instead."
22804 #: ../src/guestfs-actions.pod:1533
22806 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
22807 "oversight it only allowed 30 bit lengths to be specified, effectively "
22808 "limiting the maximum size of files created through that call to 1GB."
22812 #: ../src/guestfs-actions.pod:1544
22813 msgid "(Added in 1.3.17)"
22817 #: ../src/guestfs-actions.pod:1546
22818 msgid "guestfs_fgrep"
22822 #: ../src/guestfs-actions.pod:1548
22826 " guestfs_fgrep (guestfs_h *g,\n"
22827 " const char *pattern,\n"
22828 " const char *path);\n"
22833 #: ../src/guestfs-actions.pod:1565
22834 msgid "guestfs_fgrepi"
22838 #: ../src/guestfs-actions.pod:1567
22842 " guestfs_fgrepi (guestfs_h *g,\n"
22843 " const char *pattern,\n"
22844 " const char *path);\n"
22849 #: ../src/guestfs-actions.pod:1584
22850 msgid "guestfs_file"
22854 #: ../src/guestfs-actions.pod:1586
22858 " guestfs_file (guestfs_h *g,\n"
22859 " const char *path);\n"
22864 #: ../src/guestfs-actions.pod:1604
22866 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
22867 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
22871 #: ../src/guestfs-actions.pod:1612
22872 msgid "guestfs_file_architecture"
22876 #: ../src/guestfs-actions.pod:1614
22880 " guestfs_file_architecture (guestfs_h *g,\n"
22881 " const char *filename);\n"
22886 #: ../src/guestfs-actions.pod:1722 ../src/guestfs-actions.pod:1885 ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:2603 ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2759 ../src/guestfs-actions.pod:2946 ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3004 ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3172 ../src/guestfs-actions.pod:3409 ../src/guestfs-actions.pod:3541
22887 msgid "(Added in 1.5.3)"
22891 #: ../src/guestfs-actions.pod:1724
22892 msgid "guestfs_filesize"
22896 #: ../src/guestfs-actions.pod:1726
22900 " guestfs_filesize (guestfs_h *g,\n"
22901 " const char *file);\n"
22906 #: ../src/guestfs-actions.pod:1732
22908 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
22909 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
22910 "devices, use C<guestfs_blockdev_getsize64>."
22914 #: ../src/guestfs-actions.pod:1738
22915 msgid "(Added in 1.0.82)"
22919 #: ../src/guestfs-actions.pod:1740
22920 msgid "guestfs_fill"
22924 #: ../src/guestfs-actions.pod:1742
22928 " guestfs_fill (guestfs_h *g,\n"
22931 " const char *path);\n"
22936 #: ../src/guestfs-actions.pod:1752
22938 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
22939 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
22940 "bytes use C<guestfs_fill_pattern>."
22944 #: ../src/guestfs-actions.pod:1764
22945 msgid "(Added in 1.0.79)"
22949 #: ../src/guestfs-actions.pod:1766
22950 msgid "guestfs_fill_pattern"
22954 #: ../src/guestfs-actions.pod:1768
22958 " guestfs_fill_pattern (guestfs_h *g,\n"
22959 " const char *pattern,\n"
22961 " const char *path);\n"
22966 #: ../src/guestfs-actions.pod:1774
22968 "This function is like C<guestfs_fill> except that it creates a new file of "
22969 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
22970 "pattern is truncated if necessary to ensure the length of the file is "
22971 "exactly C<len> bytes."
22975 #: ../src/guestfs-actions.pod:1786
22976 msgid "(Added in 1.3.12)"
22980 #: ../src/guestfs-actions.pod:1788
22981 msgid "guestfs_find"
22985 #: ../src/guestfs-actions.pod:1790
22989 " guestfs_find (guestfs_h *g,\n"
22990 " const char *directory);\n"
22995 #: ../src/guestfs-actions.pod:1806
22996 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
23000 #: ../src/guestfs-actions.pod:1819
23001 msgid "See also C<guestfs_find0>."
23005 #: ../src/guestfs-actions.pod:1828 ../src/guestfs-actions.pod:4299 ../src/guestfs-actions.pod:6009
23006 msgid "(Added in 1.0.27)"
23010 #: ../src/guestfs-actions.pod:1830
23011 msgid "guestfs_find0"
23015 #: ../src/guestfs-actions.pod:1832
23019 " guestfs_find0 (guestfs_h *g,\n"
23020 " const char *directory,\n"
23021 " const char *files);\n"
23026 #: ../src/guestfs-actions.pod:1841
23028 "This command works the same way as C<guestfs_find> with the following "
23033 #: ../src/guestfs-actions.pod:1868
23034 msgid "(Added in 1.0.74)"
23038 #: ../src/guestfs-actions.pod:1870
23039 msgid "guestfs_findfs_label"
23043 #: ../src/guestfs-actions.pod:1872
23047 " guestfs_findfs_label (guestfs_h *g,\n"
23048 " const char *label);\n"
23053 #: ../src/guestfs-actions.pod:1880
23054 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
23058 #: ../src/guestfs-actions.pod:1887
23059 msgid "guestfs_findfs_uuid"
23063 #: ../src/guestfs-actions.pod:1889
23067 " guestfs_findfs_uuid (guestfs_h *g,\n"
23068 " const char *uuid);\n"
23073 #: ../src/guestfs-actions.pod:1897
23074 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
23078 #: ../src/guestfs-actions.pod:1904
23079 msgid "guestfs_fsck"
23083 #: ../src/guestfs-actions.pod:1906
23087 " guestfs_fsck (guestfs_h *g,\n"
23088 " const char *fstype,\n"
23089 " const char *device);\n"
23094 #: ../src/guestfs-actions.pod:1941 ../src/guestfs-actions.pod:7780
23095 msgid "(Added in 1.0.16)"
23099 #: ../src/guestfs-actions.pod:1943
23100 msgid "guestfs_get_append"
23104 #: ../src/guestfs-actions.pod:1945
23108 " guestfs_get_append (guestfs_h *g);\n"
23113 #: ../src/guestfs-actions.pod:1953
23115 "This function returns a string which may be NULL. There is no way to return "
23116 "an error from this function. The string is owned by the guest handle and "
23117 "must I<not> be freed."
23121 #: ../src/guestfs-actions.pod:1957 ../src/guestfs-actions.pod:5687 ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6611 ../src/guestfs-actions.pod:6630 ../src/guestfs-actions.pod:6646 ../src/guestfs-actions.pod:6670 ../src/guestfs-actions.pod:7424 ../src/guestfs-actions.pod:7439 ../src/guestfs-actions.pod:7823
23122 msgid "(Added in 1.0.26)"
23126 #: ../src/guestfs-actions.pod:1959
23127 msgid "guestfs_get_attach_method"
23131 #: ../src/guestfs-actions.pod:1961
23135 " guestfs_get_attach_method (guestfs_h *g);\n"
23140 #: ../src/guestfs-actions.pod:1964
23141 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
23145 #: ../src/guestfs-actions.pod:1969 ../src/guestfs-actions.pod:6199
23146 msgid "(Added in 1.9.8)"
23150 #: ../src/guestfs-actions.pod:1971
23151 msgid "guestfs_get_autosync"
23155 #: ../src/guestfs-actions.pod:1973
23159 " guestfs_get_autosync (guestfs_h *g);\n"
23164 #: ../src/guestfs-actions.pod:1982
23165 msgid "guestfs_get_direct"
23169 #: ../src/guestfs-actions.pod:1984
23173 " guestfs_get_direct (guestfs_h *g);\n"
23178 #: ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:6240
23179 msgid "(Added in 1.0.72)"
23183 #: ../src/guestfs-actions.pod:1993
23184 msgid "guestfs_get_e2label"
23188 #: ../src/guestfs-actions.pod:1995
23192 " guestfs_get_e2label (guestfs_h *g,\n"
23193 " const char *device);\n"
23198 #: ../src/guestfs-actions.pod:2012 ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:6258 ../src/guestfs-actions.pod:6277
23199 msgid "(Added in 1.0.15)"
23203 #: ../src/guestfs-actions.pod:2014
23204 msgid "guestfs_get_e2uuid"
23208 #: ../src/guestfs-actions.pod:2016
23212 " guestfs_get_e2uuid (guestfs_h *g,\n"
23213 " const char *device);\n"
23218 #: ../src/guestfs-actions.pod:2035
23219 msgid "guestfs_get_memsize"
23223 #: ../src/guestfs-actions.pod:2037
23227 " guestfs_get_memsize (guestfs_h *g);\n"
23232 #: ../src/guestfs-actions.pod:2043
23234 "If C<guestfs_set_memsize> was not called on this handle, and if "
23235 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
23236 "value for memsize."
23240 #: ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:4590 ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4818 ../src/guestfs-actions.pod:4837 ../src/guestfs-actions.pod:4849 ../src/guestfs-actions.pod:4866 ../src/guestfs-actions.pod:4879 ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:6298 ../src/guestfs-actions.pod:6578 ../src/guestfs-actions.pod:7193
23241 msgid "(Added in 1.0.55)"
23245 #: ../src/guestfs-actions.pod:2054
23246 msgid "guestfs_get_network"
23250 #: ../src/guestfs-actions.pod:2056
23254 " guestfs_get_network (guestfs_h *g);\n"
23259 #: ../src/guestfs-actions.pod:2063 ../src/guestfs-actions.pod:6317
23260 msgid "(Added in 1.5.4)"
23264 #: ../src/guestfs-actions.pod:2065
23265 msgid "guestfs_get_path"
23269 #: ../src/guestfs-actions.pod:2067
23273 " guestfs_get_path (guestfs_h *g);\n"
23278 #: ../src/guestfs-actions.pod:2075 ../src/guestfs-actions.pod:2115
23280 "This function returns a string, or NULL on error. The string is owned by "
23281 "the guest handle and must I<not> be freed."
23285 #: ../src/guestfs-actions.pod:2080
23286 msgid "guestfs_get_pgroup"
23290 #: ../src/guestfs-actions.pod:2082
23294 " guestfs_get_pgroup (guestfs_h *g);\n"
23299 #: ../src/guestfs-actions.pod:2089 ../src/guestfs-actions.pod:6353 ../src/guestfs-actions.pod:7685
23300 msgid "(Added in 1.11.18)"
23304 #: ../src/guestfs-actions.pod:2091
23305 msgid "guestfs_get_pid"
23309 #: ../src/guestfs-actions.pod:2093
23313 " guestfs_get_pid (guestfs_h *g);\n"
23318 #: ../src/guestfs-actions.pod:2103
23319 msgid "(Added in 1.0.56)"
23323 #: ../src/guestfs-actions.pod:2105
23324 msgid "guestfs_get_qemu"
23328 #: ../src/guestfs-actions.pod:2107
23332 " guestfs_get_qemu (guestfs_h *g);\n"
23337 #: ../src/guestfs-actions.pod:2118 ../src/guestfs-actions.pod:6381
23338 msgid "(Added in 1.0.6)"
23342 #: ../src/guestfs-actions.pod:2120
23343 msgid "guestfs_get_recovery_proc"
23347 #: ../src/guestfs-actions.pod:2122
23351 " guestfs_get_recovery_proc (guestfs_h *g);\n"
23356 #: ../src/guestfs-actions.pod:2129 ../src/guestfs-actions.pod:3663 ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4397 ../src/guestfs-actions.pod:4429 ../src/guestfs-actions.pod:5617 ../src/guestfs-actions.pod:5960 ../src/guestfs-actions.pod:6405 ../src/guestfs-actions.pod:7096 ../src/guestfs-actions.pod:7116 ../src/guestfs-actions.pod:7308
23357 msgid "(Added in 1.0.77)"
23361 #: ../src/guestfs-actions.pod:2131
23362 msgid "guestfs_get_selinux"
23366 #: ../src/guestfs-actions.pod:2133
23370 " guestfs_get_selinux (guestfs_h *g);\n"
23375 #: ../src/guestfs-actions.pod:2136
23377 "This returns the current setting of the selinux flag which is passed to the "
23378 "appliance at boot time. See C<guestfs_set_selinux>."
23382 #: ../src/guestfs-actions.pod:2144 ../src/guestfs-actions.pod:2207 ../src/guestfs-actions.pod:6424 ../src/guestfs-actions.pod:6482
23383 msgid "(Added in 1.0.67)"
23387 #: ../src/guestfs-actions.pod:2146
23388 msgid "guestfs_get_state"
23392 #: ../src/guestfs-actions.pod:2148
23396 " guestfs_get_state (guestfs_h *g);\n"
23401 #: ../src/guestfs-actions.pod:2160
23402 msgid "guestfs_get_trace"
23406 #: ../src/guestfs-actions.pod:2162
23410 " guestfs_get_trace (guestfs_h *g);\n"
23415 #: ../src/guestfs-actions.pod:2171
23416 msgid "guestfs_get_umask"
23420 #: ../src/guestfs-actions.pod:2173
23424 " guestfs_get_umask (guestfs_h *g);\n"
23429 #: ../src/guestfs-actions.pod:2176
23431 "Return the current umask. By default the umask is C<022> unless it has been "
23432 "set by calling C<guestfs_umask>."
23436 #: ../src/guestfs-actions.pod:2183
23437 msgid "guestfs_get_verbose"
23441 #: ../src/guestfs-actions.pod:2185
23445 " guestfs_get_verbose (guestfs_h *g);\n"
23450 #: ../src/guestfs-actions.pod:2194
23451 msgid "guestfs_getcon"
23455 #: ../src/guestfs-actions.pod:2196
23459 " guestfs_getcon (guestfs_h *g);\n"
23464 #: ../src/guestfs-actions.pod:2201
23465 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
23469 #: ../src/guestfs-actions.pod:2209
23470 msgid "guestfs_getxattr"
23474 #: ../src/guestfs-actions.pod:2211
23478 " guestfs_getxattr (guestfs_h *g,\n"
23479 " const char *path,\n"
23480 " const char *name,\n"
23481 " size_t *size_r);\n"
23486 #: ../src/guestfs-actions.pod:2217
23488 "Get a single extended attribute from file C<path> named C<name>. This call "
23489 "follows symlinks. If you want to lookup an extended attribute for the "
23490 "symlink itself, use C<guestfs_lgetxattr>."
23494 #: ../src/guestfs-actions.pod:2221 ../src/guestfs-actions.pod:3677
23496 "Normally it is better to get all extended attributes from a file in one go "
23497 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
23498 "implementations are buggy and do not provide a way to list out attributes. "
23499 "For these filesystems (notably ntfs-3g) you have to know the names of the "
23500 "extended attributes you want in advance and call this function."
23504 #: ../src/guestfs-actions.pod:2231
23505 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
23509 #: ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:2424 ../src/guestfs-actions.pod:2894 ../src/guestfs-actions.pod:3689 ../src/guestfs-actions.pod:5610 ../src/guestfs-actions.pod:5636 ../src/guestfs-actions.pod:5817
23511 "This function returns a buffer, or NULL on error. The size of the returned "
23512 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
23517 #: ../src/guestfs-actions.pod:2237 ../src/guestfs-actions.pod:3693
23518 msgid "(Added in 1.7.24)"
23522 #: ../src/guestfs-actions.pod:2239
23523 msgid "guestfs_getxattrs"
23527 #: ../src/guestfs-actions.pod:2241
23530 " struct guestfs_xattr_list *\n"
23531 " guestfs_getxattrs (guestfs_h *g,\n"
23532 " const char *path);\n"
23537 #: ../src/guestfs-actions.pod:2251
23538 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
23542 #: ../src/guestfs-actions.pod:2253 ../src/guestfs-actions.pod:3705 ../src/guestfs-actions.pod:4393
23544 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
23545 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
23549 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:3709 ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3944 ../src/guestfs-actions.pod:5990 ../src/guestfs-actions.pod:6501 ../src/guestfs-actions.pod:7888
23550 msgid "(Added in 1.0.59)"
23554 #: ../src/guestfs-actions.pod:2259
23555 msgid "guestfs_glob_expand"
23559 #: ../src/guestfs-actions.pod:2261
23563 " guestfs_glob_expand (guestfs_h *g,\n"
23564 " const char *pattern);\n"
23569 #: ../src/guestfs-actions.pod:2280 ../src/guestfs-actions.pod:6694 ../src/guestfs-actions.pod:6711
23570 msgid "(Added in 1.0.50)"
23574 #: ../src/guestfs-actions.pod:2282
23575 msgid "guestfs_grep"
23579 #: ../src/guestfs-actions.pod:2284
23583 " guestfs_grep (guestfs_h *g,\n"
23584 " const char *regex,\n"
23585 " const char *path);\n"
23590 #: ../src/guestfs-actions.pod:2301
23591 msgid "guestfs_grepi"
23595 #: ../src/guestfs-actions.pod:2303
23599 " guestfs_grepi (guestfs_h *g,\n"
23600 " const char *regex,\n"
23601 " const char *path);\n"
23606 #: ../src/guestfs-actions.pod:2320
23607 msgid "guestfs_grub_install"
23611 #: ../src/guestfs-actions.pod:2322
23615 " guestfs_grub_install (guestfs_h *g,\n"
23616 " const char *root,\n"
23617 " const char *device);\n"
23622 #: ../src/guestfs-actions.pod:2343
23623 msgid "(Added in 1.0.17)"
23627 #: ../src/guestfs-actions.pod:2345
23628 msgid "guestfs_head"
23632 #: ../src/guestfs-actions.pod:2347
23636 " guestfs_head (guestfs_h *g,\n"
23637 " const char *path);\n"
23642 #: ../src/guestfs-actions.pod:2363
23643 msgid "guestfs_head_n"
23647 #: ../src/guestfs-actions.pod:2365
23651 " guestfs_head_n (guestfs_h *g,\n"
23653 " const char *path);\n"
23658 #: ../src/guestfs-actions.pod:2387
23659 msgid "guestfs_hexdump"
23663 #: ../src/guestfs-actions.pod:2389
23667 " guestfs_hexdump (guestfs_h *g,\n"
23668 " const char *path);\n"
23673 #: ../src/guestfs-actions.pod:2402 ../src/guestfs-actions.pod:6775 ../src/guestfs-actions.pod:6830
23674 msgid "(Added in 1.0.22)"
23678 #: ../src/guestfs-actions.pod:2404
23679 msgid "guestfs_initrd_cat"
23683 #: ../src/guestfs-actions.pod:2406
23687 " guestfs_initrd_cat (guestfs_h *g,\n"
23688 " const char *initrdpath,\n"
23689 " const char *filename,\n"
23690 " size_t *size_r);\n"
23695 #: ../src/guestfs-actions.pod:2422
23696 msgid "See also C<guestfs_initrd_list>."
23700 #: ../src/guestfs-actions.pod:2433
23701 msgid "guestfs_initrd_list"
23705 #: ../src/guestfs-actions.pod:2435
23709 " guestfs_initrd_list (guestfs_h *g,\n"
23710 " const char *path);\n"
23715 #: ../src/guestfs-actions.pod:2455
23716 msgid "guestfs_inotify_add_watch"
23720 #: ../src/guestfs-actions.pod:2457
23724 " guestfs_inotify_add_watch (guestfs_h *g,\n"
23725 " const char *path,\n"
23731 #: ../src/guestfs-actions.pod:2476
23732 msgid "guestfs_inotify_close"
23736 #: ../src/guestfs-actions.pod:2478
23740 " guestfs_inotify_close (guestfs_h *g);\n"
23745 #: ../src/guestfs-actions.pod:2489
23746 msgid "guestfs_inotify_files"
23750 #: ../src/guestfs-actions.pod:2491
23754 " guestfs_inotify_files (guestfs_h *g);\n"
23759 #: ../src/guestfs-actions.pod:2494
23761 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
23762 "returns a list of pathnames of objects that were touched. The returned "
23763 "pathnames are sorted and deduplicated."
23767 #: ../src/guestfs-actions.pod:2504
23768 msgid "guestfs_inotify_init"
23772 #: ../src/guestfs-actions.pod:2506
23776 " guestfs_inotify_init (guestfs_h *g,\n"
23777 " int maxevents);\n"
23782 #: ../src/guestfs-actions.pod:2514
23784 "C<maxevents> is the maximum number of events which will be queued up between "
23785 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
23786 "passed as C<0>, then the kernel (or previously set) default is used. For "
23787 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
23788 "throws away events, but records the fact that it threw them away by setting "
23789 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
23790 "C<guestfs_inotify_read>)."
23794 #: ../src/guestfs-actions.pod:2524
23796 "Before any events are generated, you have to add some watches to the "
23797 "internal watch list. See: C<guestfs_inotify_add_watch>, "
23798 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
23802 #: ../src/guestfs-actions.pod:2530
23804 "Queued up events should be read periodically by calling "
23805 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
23806 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
23807 "often enough then you risk the internal queue overflowing."
23811 #: ../src/guestfs-actions.pod:2537
23813 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
23814 "This also removes any watches automatically."
23818 #: ../src/guestfs-actions.pod:2550
23819 msgid "guestfs_inotify_read"
23823 #: ../src/guestfs-actions.pod:2552
23826 " struct guestfs_inotify_event_list *\n"
23827 " guestfs_inotify_read (guestfs_h *g);\n"
23832 #: ../src/guestfs-actions.pod:2566
23834 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
23835 "there was an error. I<The caller must call "
23836 "C<guestfs_free_inotify_event_list> after use>."
23840 #: ../src/guestfs-actions.pod:2572
23841 msgid "guestfs_inotify_rm_watch"
23845 #: ../src/guestfs-actions.pod:2574
23849 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
23855 #: ../src/guestfs-actions.pod:2578
23857 "Remove a previously defined inotify watch. See "
23858 "C<guestfs_inotify_add_watch>."
23862 #: ../src/guestfs-actions.pod:2585
23863 msgid "guestfs_inspect_get_arch"
23867 #: ../src/guestfs-actions.pod:2587
23871 " guestfs_inspect_get_arch (guestfs_h *g,\n"
23872 " const char *root);\n"
23877 #: ../src/guestfs-actions.pod:2591
23879 "This returns the architecture of the inspected operating system. The "
23880 "possible return values are listed under C<guestfs_file_architecture>."
23884 #: ../src/guestfs-actions.pod:2605
23885 msgid "guestfs_inspect_get_distro"
23889 #: ../src/guestfs-actions.pod:2607
23893 " guestfs_inspect_get_distro (guestfs_h *g,\n"
23894 " const char *root);\n"
23899 #: ../src/guestfs-actions.pod:2695
23900 msgid "guestfs_inspect_get_drive_mappings"
23904 #: ../src/guestfs-actions.pod:2697
23908 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
23909 " const char *root);\n"
23914 #: ../src/guestfs-actions.pod:2726
23916 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23917 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
23921 #: ../src/guestfs-actions.pod:2730 ../src/guestfs-actions.pod:2998 ../src/guestfs-actions.pod:3796 ../src/guestfs-actions.pod:5078 ../src/guestfs-actions.pod:7132
23923 "This function returns a NULL-terminated array of strings, or NULL if there "
23924 "was an error. The array of strings will always have length C<2n+1>, where "
23925 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
23926 "caller must free the strings and the array after use>."
23930 #: ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:3192
23931 msgid "(Added in 1.9.17)"
23935 #: ../src/guestfs-actions.pod:2738
23936 msgid "guestfs_inspect_get_filesystems"
23940 #: ../src/guestfs-actions.pod:2740
23944 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
23945 " const char *root);\n"
23950 #: ../src/guestfs-actions.pod:2752
23952 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23953 "C<guestfs_inspect_get_mountpoints>."
23957 #: ../src/guestfs-actions.pod:2761
23958 msgid "guestfs_inspect_get_format"
23962 #: ../src/guestfs-actions.pod:2763
23966 " guestfs_inspect_get_format (guestfs_h *g,\n"
23967 " const char *root);\n"
23972 #: ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:3228 ../src/guestfs-actions.pod:3244 ../src/guestfs-actions.pod:3262 ../src/guestfs-actions.pod:6028
23973 msgid "(Added in 1.9.4)"
23977 #: ../src/guestfs-actions.pod:2799
23978 msgid "guestfs_inspect_get_hostname"
23982 #: ../src/guestfs-actions.pod:2801
23986 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
23987 " const char *root);\n"
23992 #: ../src/guestfs-actions.pod:2816
23993 msgid "(Added in 1.7.9)"
23997 #: ../src/guestfs-actions.pod:2818
23998 msgid "guestfs_inspect_get_icon"
24002 #: ../src/guestfs-actions.pod:2820
24006 " guestfs_inspect_get_icon (guestfs_h *g,\n"
24007 " const char *root,\n"
24008 " size_t *size_r,\n"
24014 #: ../src/guestfs-actions.pod:2831
24017 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
24018 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
24023 #: ../src/guestfs-actions.pod:2898 ../src/guestfs-actions.pod:3723 ../src/guestfs-actions.pod:4977
24024 msgid "(Added in 1.11.12)"
24028 #: ../src/guestfs-actions.pod:2900
24029 msgid "guestfs_inspect_get_icon_va"
24033 #: ../src/guestfs-actions.pod:2902
24037 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
24038 " const char *root,\n"
24039 " size_t *size_r,\n"
24040 " va_list args);\n"
24045 #: ../src/guestfs-actions.pod:2908
24046 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
24050 #: ../src/guestfs-actions.pod:2912
24051 msgid "guestfs_inspect_get_icon_argv"
24055 #: ../src/guestfs-actions.pod:2914
24059 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
24060 " const char *root,\n"
24061 " size_t *size_r,\n"
24062 " const struct guestfs_inspect_get_icon_argv "
24068 #: ../src/guestfs-actions.pod:2920
24069 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
24073 #: ../src/guestfs-actions.pod:2924
24074 msgid "guestfs_inspect_get_major_version"
24078 #: ../src/guestfs-actions.pod:2926
24082 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
24083 " const char *root);\n"
24088 #: ../src/guestfs-actions.pod:2948
24089 msgid "guestfs_inspect_get_minor_version"
24093 #: ../src/guestfs-actions.pod:2950
24097 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
24098 " const char *root);\n"
24103 #: ../src/guestfs-actions.pod:2959
24105 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24106 "C<guestfs_inspect_get_major_version>."
24110 #: ../src/guestfs-actions.pod:2966
24111 msgid "guestfs_inspect_get_mountpoints"
24115 #: ../src/guestfs-actions.pod:2968
24119 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
24120 " const char *root);\n"
24125 #: ../src/guestfs-actions.pod:2989
24127 "For operating systems like Windows which still use drive letters, this call "
24128 "will only return an entry for the first drive \"mounted on\" C</>. For "
24129 "information about the mapping of drive letters to partitions, see "
24130 "C<guestfs_inspect_get_drive_mappings>."
24134 #: ../src/guestfs-actions.pod:2995
24136 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24137 "C<guestfs_inspect_get_filesystems>."
24141 #: ../src/guestfs-actions.pod:3006
24142 msgid "guestfs_inspect_get_package_format"
24146 #: ../src/guestfs-actions.pod:3008
24150 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
24151 " const char *root);\n"
24156 #: ../src/guestfs-actions.pod:3012
24158 "This function and C<guestfs_inspect_get_package_management> return the "
24159 "package format and package management tool used by the inspected operating "
24160 "system. For example for Fedora these functions would return C<rpm> (package "
24161 "format) and C<yum> (package management)."
24165 #: ../src/guestfs-actions.pod:3030 ../src/guestfs-actions.pod:3058
24166 msgid "(Added in 1.7.5)"
24170 #: ../src/guestfs-actions.pod:3032
24171 msgid "guestfs_inspect_get_package_management"
24175 #: ../src/guestfs-actions.pod:3034
24179 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
24180 " const char *root);\n"
24185 #: ../src/guestfs-actions.pod:3038
24187 "C<guestfs_inspect_get_package_format> and this function return the package "
24188 "format and package management tool used by the inspected operating system. "
24189 "For example for Fedora these functions would return C<rpm> (package format) "
24190 "and C<yum> (package management)."
24194 #: ../src/guestfs-actions.pod:3060
24195 msgid "guestfs_inspect_get_product_name"
24199 #: ../src/guestfs-actions.pod:3062
24203 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
24204 " const char *root);\n"
24209 #: ../src/guestfs-actions.pod:3081
24210 msgid "guestfs_inspect_get_product_variant"
24214 #: ../src/guestfs-actions.pod:3083
24218 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
24219 " const char *root);\n"
24224 #: ../src/guestfs-actions.pod:3106
24226 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24227 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
24231 #: ../src/guestfs-actions.pod:3113
24232 msgid "(Added in 1.9.13)"
24236 #: ../src/guestfs-actions.pod:3115
24237 msgid "guestfs_inspect_get_roots"
24241 #: ../src/guestfs-actions.pod:3117
24245 " guestfs_inspect_get_roots (guestfs_h *g);\n"
24250 #: ../src/guestfs-actions.pod:3120
24252 "This function is a convenient way to get the list of root devices, as "
24253 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
24254 "the whole inspection process."
24258 #: ../src/guestfs-actions.pod:3124
24260 "This returns an empty list if either no root devices were found or the "
24261 "caller has not called C<guestfs_inspect_os>."
24265 #: ../src/guestfs-actions.pod:3133
24266 msgid "(Added in 1.7.3)"
24270 #: ../src/guestfs-actions.pod:3135
24271 msgid "guestfs_inspect_get_type"
24275 #: ../src/guestfs-actions.pod:3137
24279 " guestfs_inspect_get_type (guestfs_h *g,\n"
24280 " const char *root);\n"
24285 #: ../src/guestfs-actions.pod:3174
24286 msgid "guestfs_inspect_get_windows_current_control_set"
24290 #: ../src/guestfs-actions.pod:3176
24294 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
24295 " const char *root);\n"
24300 #: ../src/guestfs-actions.pod:3194
24301 msgid "guestfs_inspect_get_windows_systemroot"
24305 #: ../src/guestfs-actions.pod:3196
24309 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
24310 " const char *root);\n"
24315 #: ../src/guestfs-actions.pod:3212
24316 msgid "(Added in 1.5.25)"
24320 #: ../src/guestfs-actions.pod:3214
24321 msgid "guestfs_inspect_is_live"
24325 #: ../src/guestfs-actions.pod:3216
24329 " guestfs_inspect_is_live (guestfs_h *g,\n"
24330 " const char *root);\n"
24335 #: ../src/guestfs-actions.pod:3220
24337 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24338 "disk), then this returns true if a live image was detected on the disk."
24342 #: ../src/guestfs-actions.pod:3230
24343 msgid "guestfs_inspect_is_multipart"
24347 #: ../src/guestfs-actions.pod:3232
24351 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
24352 " const char *root);\n"
24357 #: ../src/guestfs-actions.pod:3236
24359 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24360 "disk), then this returns true if the disk is part of a set."
24364 #: ../src/guestfs-actions.pod:3246
24365 msgid "guestfs_inspect_is_netinst"
24369 #: ../src/guestfs-actions.pod:3248
24373 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
24374 " const char *root);\n"
24379 #: ../src/guestfs-actions.pod:3252
24381 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
24382 "disk), then this returns true if the disk is a network installer, ie. not a "
24383 "self-contained install CD but one which is likely to require network access "
24384 "to complete the install."
24388 #: ../src/guestfs-actions.pod:3264
24389 msgid "guestfs_inspect_list_applications"
24393 #: ../src/guestfs-actions.pod:3266
24396 " struct guestfs_application_list *\n"
24397 " guestfs_inspect_list_applications (guestfs_h *g,\n"
24398 " const char *root);\n"
24403 #: ../src/guestfs-actions.pod:3272
24405 "I<Note:> This call works differently from other parts of the inspection "
24406 "API. You have to call C<guestfs_inspect_os>, then "
24407 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
24408 "this. Listing applications is a significantly more difficult operation "
24409 "which requires access to the full filesystem. Also note that unlike the "
24410 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
24411 "the libguestfs handle, this call actually reads parts of the mounted "
24412 "filesystems during the call."
24416 #: ../src/guestfs-actions.pod:3362
24418 "This function returns a C<struct guestfs_application_list *>, or NULL if "
24419 "there was an error. I<The caller must call C<guestfs_free_application_list> "
24424 #: ../src/guestfs-actions.pod:3366
24425 msgid "(Added in 1.7.8)"
24429 #: ../src/guestfs-actions.pod:3368
24430 msgid "guestfs_inspect_os"
24434 #: ../src/guestfs-actions.pod:3370
24438 " guestfs_inspect_os (guestfs_h *g);\n"
24443 #: ../src/guestfs-actions.pod:3386
24445 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
24446 "functions in order to query further information about each operating system, "
24447 "such as the name and version."
24451 #: ../src/guestfs-actions.pod:3391
24453 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
24454 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
24455 "the contents. This should be called with no disks currently mounted. The "
24456 "function may also use Augeas, so any existing Augeas handle will be closed."
24460 #: ../src/guestfs-actions.pod:3403 ../src/guestfs-actions.pod:3734 ../src/guestfs-actions.pod:3816
24461 msgid "See also C<guestfs_list_filesystems>."
24465 #: ../src/guestfs-actions.pod:3411
24466 msgid "guestfs_is_blockdev"
24470 #: ../src/guestfs-actions.pod:3413
24474 " guestfs_is_blockdev (guestfs_h *g,\n"
24475 " const char *path);\n"
24480 #: ../src/guestfs-actions.pod:3420 ../src/guestfs-actions.pod:3449 ../src/guestfs-actions.pod:3479 ../src/guestfs-actions.pod:3494 ../src/guestfs-actions.pod:3510 ../src/guestfs-actions.pod:3566 ../src/guestfs-actions.pod:3581
24481 msgid "See also C<guestfs_stat>."
24485 #: ../src/guestfs-actions.pod:3424 ../src/guestfs-actions.pod:3453 ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3570 ../src/guestfs-actions.pod:3585
24486 msgid "(Added in 1.5.10)"
24490 #: ../src/guestfs-actions.pod:3426
24491 msgid "guestfs_is_busy"
24495 #: ../src/guestfs-actions.pod:3428
24499 " guestfs_is_busy (guestfs_h *g);\n"
24504 #: ../src/guestfs-actions.pod:3440
24505 msgid "guestfs_is_chardev"
24509 #: ../src/guestfs-actions.pod:3442
24513 " guestfs_is_chardev (guestfs_h *g,\n"
24514 " const char *path);\n"
24519 #: ../src/guestfs-actions.pod:3455
24520 msgid "guestfs_is_config"
24524 #: ../src/guestfs-actions.pod:3457
24528 " guestfs_is_config (guestfs_h *g);\n"
24533 #: ../src/guestfs-actions.pod:3469
24534 msgid "guestfs_is_dir"
24538 #: ../src/guestfs-actions.pod:3471
24542 " guestfs_is_dir (guestfs_h *g,\n"
24543 " const char *path);\n"
24548 #: ../src/guestfs-actions.pod:3485
24549 msgid "guestfs_is_fifo"
24553 #: ../src/guestfs-actions.pod:3487
24557 " guestfs_is_fifo (guestfs_h *g,\n"
24558 " const char *path);\n"
24563 #: ../src/guestfs-actions.pod:3500
24564 msgid "guestfs_is_file"
24568 #: ../src/guestfs-actions.pod:3502
24572 " guestfs_is_file (guestfs_h *g,\n"
24573 " const char *path);\n"
24578 #: ../src/guestfs-actions.pod:3516
24579 msgid "guestfs_is_launching"
24583 #: ../src/guestfs-actions.pod:3518
24587 " guestfs_is_launching (guestfs_h *g);\n"
24592 #: ../src/guestfs-actions.pod:3530
24593 msgid "guestfs_is_lv"
24597 #: ../src/guestfs-actions.pod:3532
24601 " guestfs_is_lv (guestfs_h *g,\n"
24602 " const char *device);\n"
24607 #: ../src/guestfs-actions.pod:3543
24608 msgid "guestfs_is_ready"
24612 #: ../src/guestfs-actions.pod:3545
24616 " guestfs_is_ready (guestfs_h *g);\n"
24621 #: ../src/guestfs-actions.pod:3557
24622 msgid "guestfs_is_socket"
24626 #: ../src/guestfs-actions.pod:3559
24630 " guestfs_is_socket (guestfs_h *g,\n"
24631 " const char *path);\n"
24636 #: ../src/guestfs-actions.pod:3572
24637 msgid "guestfs_is_symlink"
24641 #: ../src/guestfs-actions.pod:3574
24645 " guestfs_is_symlink (guestfs_h *g,\n"
24646 " const char *path);\n"
24651 #: ../src/guestfs-actions.pod:3587
24652 msgid "guestfs_is_zero"
24656 #: ../src/guestfs-actions.pod:3589
24660 " guestfs_is_zero (guestfs_h *g,\n"
24661 " const char *path);\n"
24666 #: ../src/guestfs-actions.pod:3598 ../src/guestfs-actions.pod:3612
24667 msgid "(Added in 1.11.8)"
24671 #: ../src/guestfs-actions.pod:3600
24672 msgid "guestfs_is_zero_device"
24676 #: ../src/guestfs-actions.pod:3602
24680 " guestfs_is_zero_device (guestfs_h *g,\n"
24681 " const char *device);\n"
24686 #: ../src/guestfs-actions.pod:3614
24687 msgid "guestfs_kill_subprocess"
24691 #: ../src/guestfs-actions.pod:3616
24695 " guestfs_kill_subprocess (guestfs_h *g);\n"
24700 #: ../src/guestfs-actions.pod:3625
24701 msgid "guestfs_launch"
24705 #: ../src/guestfs-actions.pod:3627
24709 " guestfs_launch (guestfs_h *g);\n"
24714 #: ../src/guestfs-actions.pod:3645
24715 msgid "guestfs_lchown"
24719 #: ../src/guestfs-actions.pod:3647
24723 " guestfs_lchown (guestfs_h *g,\n"
24726 " const char *path);\n"
24731 #: ../src/guestfs-actions.pod:3653
24733 "Change the file owner to C<owner> and group to C<group>. This is like "
24734 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
24735 "changed, not the target."
24739 #: ../src/guestfs-actions.pod:3665
24740 msgid "guestfs_lgetxattr"
24744 #: ../src/guestfs-actions.pod:3667
24748 " guestfs_lgetxattr (guestfs_h *g,\n"
24749 " const char *path,\n"
24750 " const char *name,\n"
24751 " size_t *size_r);\n"
24756 #: ../src/guestfs-actions.pod:3687
24757 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
24761 #: ../src/guestfs-actions.pod:3695
24762 msgid "guestfs_lgetxattrs"
24766 #: ../src/guestfs-actions.pod:3697
24769 " struct guestfs_xattr_list *\n"
24770 " guestfs_lgetxattrs (guestfs_h *g,\n"
24771 " const char *path);\n"
24776 #: ../src/guestfs-actions.pod:3701
24778 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
24779 "then it returns the extended attributes of the link itself."
24783 #: ../src/guestfs-actions.pod:3711
24784 msgid "guestfs_list_9p"
24788 #: ../src/guestfs-actions.pod:3713
24792 " guestfs_list_9p (guestfs_h *g);\n"
24797 #: ../src/guestfs-actions.pod:3725
24798 msgid "guestfs_list_devices"
24802 #: ../src/guestfs-actions.pod:3727
24806 " guestfs_list_devices (guestfs_h *g);\n"
24811 #: ../src/guestfs-actions.pod:3742
24812 msgid "guestfs_list_dm_devices"
24816 #: ../src/guestfs-actions.pod:3744
24820 " guestfs_list_dm_devices (guestfs_h *g);\n"
24825 #: ../src/guestfs-actions.pod:3749
24827 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
24828 "previous call to C<guestfs_luks_open>."
24832 #: ../src/guestfs-actions.pod:3752
24834 "Device mapper devices which correspond to logical volumes are I<not> "
24835 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
24840 #: ../src/guestfs-actions.pod:3760 ../src/guestfs-actions.pod:5216
24841 msgid "(Added in 1.11.15)"
24845 #: ../src/guestfs-actions.pod:3762
24846 msgid "guestfs_list_filesystems"
24850 #: ../src/guestfs-actions.pod:3764
24854 " guestfs_list_filesystems (guestfs_h *g);\n"
24859 #: ../src/guestfs-actions.pod:3784
24861 "This command runs other libguestfs commands, which might include "
24862 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
24863 "soon after launch and only when nothing is mounted."
24867 #: ../src/guestfs-actions.pod:3788
24869 "Not all of the filesystems returned will be mountable. In particular, swap "
24870 "partitions are returned in the list. Also this command does not check that "
24871 "each filesystem found is valid and mountable, and some filesystems might be "
24872 "mountable but require special options. Filesystems may not all belong to a "
24873 "single logical operating system (use C<guestfs_inspect_os> to look for "
24878 #: ../src/guestfs-actions.pod:3802 ../src/guestfs-actions.pod:5577
24879 msgid "(Added in 1.5.15)"
24883 #: ../src/guestfs-actions.pod:3804
24884 msgid "guestfs_list_partitions"
24888 #: ../src/guestfs-actions.pod:3806
24892 " guestfs_list_partitions (guestfs_h *g);\n"
24897 #: ../src/guestfs-actions.pod:3813
24899 "This does not return logical volumes. For that you will need to call "
24904 #: ../src/guestfs-actions.pod:3824
24909 #: ../src/guestfs-actions.pod:3826
24913 " guestfs_ll (guestfs_h *g,\n"
24914 " const char *directory);\n"
24919 #: ../src/guestfs-actions.pod:3841
24924 #: ../src/guestfs-actions.pod:3843
24928 " guestfs_ln (guestfs_h *g,\n"
24929 " const char *target,\n"
24930 " const char *linkname);\n"
24935 #: ../src/guestfs-actions.pod:3854
24936 msgid "guestfs_ln_f"
24940 #: ../src/guestfs-actions.pod:3856
24944 " guestfs_ln_f (guestfs_h *g,\n"
24945 " const char *target,\n"
24946 " const char *linkname);\n"
24951 #: ../src/guestfs-actions.pod:3868
24952 msgid "guestfs_ln_s"
24956 #: ../src/guestfs-actions.pod:3870
24960 " guestfs_ln_s (guestfs_h *g,\n"
24961 " const char *target,\n"
24962 " const char *linkname);\n"
24967 #: ../src/guestfs-actions.pod:3881
24968 msgid "guestfs_ln_sf"
24972 #: ../src/guestfs-actions.pod:3883
24976 " guestfs_ln_sf (guestfs_h *g,\n"
24977 " const char *target,\n"
24978 " const char *linkname);\n"
24983 #: ../src/guestfs-actions.pod:3895
24984 msgid "guestfs_lremovexattr"
24988 #: ../src/guestfs-actions.pod:3897
24992 " guestfs_lremovexattr (guestfs_h *g,\n"
24993 " const char *xattr,\n"
24994 " const char *path);\n"
24999 #: ../src/guestfs-actions.pod:3902
25001 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
25002 "link, then it removes an extended attribute of the link itself."
25006 #: ../src/guestfs-actions.pod:3910
25011 #: ../src/guestfs-actions.pod:3912
25015 " guestfs_ls (guestfs_h *g,\n"
25016 " const char *directory);\n"
25021 #: ../src/guestfs-actions.pod:3920
25023 "This command is mostly useful for interactive sessions. Programs should "
25024 "probably use C<guestfs_readdir> instead."
25028 #: ../src/guestfs-actions.pod:3929
25029 msgid "guestfs_lsetxattr"
25033 #: ../src/guestfs-actions.pod:3931
25037 " guestfs_lsetxattr (guestfs_h *g,\n"
25038 " const char *xattr,\n"
25039 " const char *val,\n"
25041 " const char *path);\n"
25046 #: ../src/guestfs-actions.pod:3938
25048 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
25049 "then it sets an extended attribute of the link itself."
25053 #: ../src/guestfs-actions.pod:3946
25054 msgid "guestfs_lstat"
25058 #: ../src/guestfs-actions.pod:3948
25061 " struct guestfs_stat *\n"
25062 " guestfs_lstat (guestfs_h *g,\n"
25063 " const char *path);\n"
25068 #: ../src/guestfs-actions.pod:3954
25070 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
25071 "link, then the link is stat-ed, not the file it refers to."
25075 #: ../src/guestfs-actions.pod:3960 ../src/guestfs-actions.pod:6735
25077 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
25078 "error. I<The caller must call C<guestfs_free_stat> after use>."
25082 #: ../src/guestfs-actions.pod:3964 ../src/guestfs-actions.pod:6739 ../src/guestfs-actions.pod:6757 ../src/guestfs-actions.pod:7138
25083 msgid "(Added in 0.9.2)"
25087 #: ../src/guestfs-actions.pod:3966
25088 msgid "guestfs_lstatlist"
25092 #: ../src/guestfs-actions.pod:3968
25095 " struct guestfs_stat_list *\n"
25096 " guestfs_lstatlist (guestfs_h *g,\n"
25097 " const char *path,\n"
25098 " char *const *names);\n"
25103 #: ../src/guestfs-actions.pod:3973
25105 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
25106 "files, where all files are in the directory C<path>. C<names> is the list "
25107 "of files from this directory."
25111 #: ../src/guestfs-actions.pod:3982
25113 "This call is intended for programs that want to efficiently list a directory "
25114 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
25115 "for a similarly efficient call for getting extended attributes. Very long "
25116 "directory listings might cause the protocol message size to be exceeded, "
25117 "causing this call to fail. The caller must split up such requests into "
25118 "smaller groups of names."
25122 #: ../src/guestfs-actions.pod:3990
25124 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
25125 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
25129 #: ../src/guestfs-actions.pod:3996
25130 msgid "guestfs_luks_add_key"
25134 #: ../src/guestfs-actions.pod:3998
25138 " guestfs_luks_add_key (guestfs_h *g,\n"
25139 " const char *device,\n"
25140 " const char *key,\n"
25141 " const char *newkey,\n"
25147 #: ../src/guestfs-actions.pod:4010
25149 "Note that if C<keyslot> already contains a key, then this command will "
25150 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
25154 #: ../src/guestfs-actions.pod:4016 ../src/guestfs-actions.pod:4056 ../src/guestfs-actions.pod:4079 ../src/guestfs-actions.pod:4099 ../src/guestfs-actions.pod:4134 ../src/guestfs-actions.pod:4153
25156 "This function takes a key or passphrase parameter which could contain "
25157 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
25162 #: ../src/guestfs-actions.pod:4020 ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4083 ../src/guestfs-actions.pod:4103
25163 msgid "(Added in 1.5.2)"
25167 #: ../src/guestfs-actions.pod:4022
25168 msgid "guestfs_luks_close"
25172 #: ../src/guestfs-actions.pod:4024
25176 " guestfs_luks_close (guestfs_h *g,\n"
25177 " const char *device);\n"
25182 #: ../src/guestfs-actions.pod:4028
25184 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
25185 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
25186 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
25187 "underlying block device."
25191 #: ../src/guestfs-actions.pod:4036 ../src/guestfs-actions.pod:4138 ../src/guestfs-actions.pod:4157 ../src/guestfs-actions.pod:4207 ../src/guestfs-actions.pod:4255
25192 msgid "(Added in 1.5.1)"
25196 #: ../src/guestfs-actions.pod:4038
25197 msgid "guestfs_luks_format"
25201 #: ../src/guestfs-actions.pod:4040
25205 " guestfs_luks_format (guestfs_h *g,\n"
25206 " const char *device,\n"
25207 " const char *key,\n"
25213 #: ../src/guestfs-actions.pod:4062
25214 msgid "guestfs_luks_format_cipher"
25218 #: ../src/guestfs-actions.pod:4064
25222 " guestfs_luks_format_cipher (guestfs_h *g,\n"
25223 " const char *device,\n"
25224 " const char *key,\n"
25226 " const char *cipher);\n"
25231 #: ../src/guestfs-actions.pod:4071
25233 "This command is the same as C<guestfs_luks_format> but it also allows you to "
25234 "set the C<cipher> used."
25238 #: ../src/guestfs-actions.pod:4085
25239 msgid "guestfs_luks_kill_slot"
25243 #: ../src/guestfs-actions.pod:4087
25247 " guestfs_luks_kill_slot (guestfs_h *g,\n"
25248 " const char *device,\n"
25249 " const char *key,\n"
25255 #: ../src/guestfs-actions.pod:4105
25256 msgid "guestfs_luks_open"
25260 #: ../src/guestfs-actions.pod:4107
25264 " guestfs_luks_open (guestfs_h *g,\n"
25265 " const char *device,\n"
25266 " const char *key,\n"
25267 " const char *mapname);\n"
25272 #: ../src/guestfs-actions.pod:4125
25274 "If this block device contains LVM volume groups, then calling "
25275 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
25280 #: ../src/guestfs-actions.pod:4129
25281 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
25285 #: ../src/guestfs-actions.pod:4140
25286 msgid "guestfs_luks_open_ro"
25290 #: ../src/guestfs-actions.pod:4142
25294 " guestfs_luks_open_ro (guestfs_h *g,\n"
25295 " const char *device,\n"
25296 " const char *key,\n"
25297 " const char *mapname);\n"
25302 #: ../src/guestfs-actions.pod:4148
25304 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
25309 #: ../src/guestfs-actions.pod:4159
25310 msgid "guestfs_lvcreate"
25314 #: ../src/guestfs-actions.pod:4161
25318 " guestfs_lvcreate (guestfs_h *g,\n"
25319 " const char *logvol,\n"
25320 " const char *volgroup,\n"
25326 #: ../src/guestfs-actions.pod:4174
25327 msgid "guestfs_lvm_canonical_lv_name"
25331 #: ../src/guestfs-actions.pod:4176
25335 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
25336 " const char *lvname);\n"
25341 #: ../src/guestfs-actions.pod:4187
25342 msgid "See also C<guestfs_is_lv>."
25346 #: ../src/guestfs-actions.pod:4192
25347 msgid "(Added in 1.5.24)"
25351 #: ../src/guestfs-actions.pod:4194
25352 msgid "guestfs_lvm_clear_filter"
25356 #: ../src/guestfs-actions.pod:4196
25360 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
25365 #: ../src/guestfs-actions.pod:4199
25367 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
25368 "see every block device."
25372 #: ../src/guestfs-actions.pod:4209
25373 msgid "guestfs_lvm_remove_all"
25377 #: ../src/guestfs-actions.pod:4211
25381 " guestfs_lvm_remove_all (guestfs_h *g);\n"
25386 #: ../src/guestfs-actions.pod:4224
25387 msgid "guestfs_lvm_set_filter"
25391 #: ../src/guestfs-actions.pod:4226
25395 " guestfs_lvm_set_filter (guestfs_h *g,\n"
25396 " char *const *devices);\n"
25401 #: ../src/guestfs-actions.pod:4257
25402 msgid "guestfs_lvremove"
25406 #: ../src/guestfs-actions.pod:4259
25410 " guestfs_lvremove (guestfs_h *g,\n"
25411 " const char *device);\n"
25416 #: ../src/guestfs-actions.pod:4271 ../src/guestfs-actions.pod:5674 ../src/guestfs-actions.pod:7508
25417 msgid "(Added in 1.0.13)"
25421 #: ../src/guestfs-actions.pod:4273
25422 msgid "guestfs_lvrename"
25426 #: ../src/guestfs-actions.pod:4275
25430 " guestfs_lvrename (guestfs_h *g,\n"
25431 " const char *logvol,\n"
25432 " const char *newlogvol);\n"
25437 #: ../src/guestfs-actions.pod:4284 ../src/guestfs-actions.pod:7521
25438 msgid "(Added in 1.0.83)"
25442 #: ../src/guestfs-actions.pod:4286
25443 msgid "guestfs_lvresize"
25447 #: ../src/guestfs-actions.pod:4288
25451 " guestfs_lvresize (guestfs_h *g,\n"
25452 " const char *device,\n"
25458 #: ../src/guestfs-actions.pod:4301
25459 msgid "guestfs_lvresize_free"
25463 #: ../src/guestfs-actions.pod:4303
25467 " guestfs_lvresize_free (guestfs_h *g,\n"
25468 " const char *lv,\n"
25474 #: ../src/guestfs-actions.pod:4316
25475 msgid "(Added in 1.3.3)"
25479 #: ../src/guestfs-actions.pod:4318
25480 msgid "guestfs_lvs"
25484 #: ../src/guestfs-actions.pod:4320
25488 " guestfs_lvs (guestfs_h *g);\n"
25493 #: ../src/guestfs-actions.pod:4329
25494 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
25498 #: ../src/guestfs-actions.pod:4337
25499 msgid "guestfs_lvs_full"
25503 #: ../src/guestfs-actions.pod:4339
25506 " struct guestfs_lvm_lv_list *\n"
25507 " guestfs_lvs_full (guestfs_h *g);\n"
25512 #: ../src/guestfs-actions.pod:4345
25514 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
25515 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
25520 #: ../src/guestfs-actions.pod:4351
25521 msgid "guestfs_lvuuid"
25525 #: ../src/guestfs-actions.pod:4353
25529 " guestfs_lvuuid (guestfs_h *g,\n"
25530 " const char *device);\n"
25535 #: ../src/guestfs-actions.pod:4364
25536 msgid "guestfs_lxattrlist"
25540 #: ../src/guestfs-actions.pod:4366
25543 " struct guestfs_xattr_list *\n"
25544 " guestfs_lxattrlist (guestfs_h *g,\n"
25545 " const char *path,\n"
25546 " char *const *names);\n"
25551 #: ../src/guestfs-actions.pod:4385
25553 "This call is intended for programs that want to efficiently list a directory "
25554 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
25555 "a similarly efficient call for getting standard stats. Very long directory "
25556 "listings might cause the protocol message size to be exceeded, causing this "
25557 "call to fail. The caller must split up such requests into smaller groups of "
25562 #: ../src/guestfs-actions.pod:4399
25563 msgid "guestfs_mkdir"
25567 #: ../src/guestfs-actions.pod:4401
25571 " guestfs_mkdir (guestfs_h *g,\n"
25572 " const char *path);\n"
25577 #: ../src/guestfs-actions.pod:4411
25578 msgid "guestfs_mkdir_mode"
25582 #: ../src/guestfs-actions.pod:4413
25586 " guestfs_mkdir_mode (guestfs_h *g,\n"
25587 " const char *path,\n"
25593 #: ../src/guestfs-actions.pod:4425
25594 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
25598 #: ../src/guestfs-actions.pod:4431
25599 msgid "guestfs_mkdir_p"
25603 #: ../src/guestfs-actions.pod:4433
25607 " guestfs_mkdir_p (guestfs_h *g,\n"
25608 " const char *path);\n"
25613 #: ../src/guestfs-actions.pod:4444
25614 msgid "guestfs_mkdtemp"
25618 #: ../src/guestfs-actions.pod:4446
25622 " guestfs_mkdtemp (guestfs_h *g,\n"
25623 " const char *template);\n"
25628 #: ../src/guestfs-actions.pod:4474
25629 msgid "guestfs_mke2fs_J"
25633 #: ../src/guestfs-actions.pod:4476
25637 " guestfs_mke2fs_J (guestfs_h *g,\n"
25638 " const char *fstype,\n"
25639 " int blocksize,\n"
25640 " const char *device,\n"
25641 " const char *journal);\n"
25646 #: ../src/guestfs-actions.pod:4489
25647 msgid "See also C<guestfs_mke2journal>."
25651 #: ../src/guestfs-actions.pod:4493 ../src/guestfs-actions.pod:4511 ../src/guestfs-actions.pod:4529 ../src/guestfs-actions.pod:4545 ../src/guestfs-actions.pod:4559 ../src/guestfs-actions.pod:4573 ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:4909
25652 msgid "(Added in 1.0.68)"
25656 #: ../src/guestfs-actions.pod:4495
25657 msgid "guestfs_mke2fs_JL"
25661 #: ../src/guestfs-actions.pod:4497
25665 " guestfs_mke2fs_JL (guestfs_h *g,\n"
25666 " const char *fstype,\n"
25667 " int blocksize,\n"
25668 " const char *device,\n"
25669 " const char *label);\n"
25674 #: ../src/guestfs-actions.pod:4507
25675 msgid "See also C<guestfs_mke2journal_L>."
25679 #: ../src/guestfs-actions.pod:4513
25680 msgid "guestfs_mke2fs_JU"
25684 #: ../src/guestfs-actions.pod:4515
25688 " guestfs_mke2fs_JU (guestfs_h *g,\n"
25689 " const char *fstype,\n"
25690 " int blocksize,\n"
25691 " const char *device,\n"
25692 " const char *uuid);\n"
25697 #: ../src/guestfs-actions.pod:4525
25698 msgid "See also C<guestfs_mke2journal_U>."
25702 #: ../src/guestfs-actions.pod:4531
25703 msgid "guestfs_mke2journal"
25707 #: ../src/guestfs-actions.pod:4533
25711 " guestfs_mke2journal (guestfs_h *g,\n"
25712 " int blocksize,\n"
25713 " const char *device);\n"
25718 #: ../src/guestfs-actions.pod:4547
25719 msgid "guestfs_mke2journal_L"
25723 #: ../src/guestfs-actions.pod:4549
25727 " guestfs_mke2journal_L (guestfs_h *g,\n"
25728 " int blocksize,\n"
25729 " const char *label,\n"
25730 " const char *device);\n"
25735 #: ../src/guestfs-actions.pod:4561
25736 msgid "guestfs_mke2journal_U"
25740 #: ../src/guestfs-actions.pod:4563
25744 " guestfs_mke2journal_U (guestfs_h *g,\n"
25745 " int blocksize,\n"
25746 " const char *uuid,\n"
25747 " const char *device);\n"
25752 #: ../src/guestfs-actions.pod:4575
25753 msgid "guestfs_mkfifo"
25757 #: ../src/guestfs-actions.pod:4577
25761 " guestfs_mkfifo (guestfs_h *g,\n"
25763 " const char *path);\n"
25768 #: ../src/guestfs-actions.pod:4582
25770 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
25771 "is just a convenient wrapper around C<guestfs_mknod>."
25775 #: ../src/guestfs-actions.pod:4592
25776 msgid "guestfs_mkfs"
25780 #: ../src/guestfs-actions.pod:4594
25784 " guestfs_mkfs (guestfs_h *g,\n"
25785 " const char *fstype,\n"
25786 " const char *device);\n"
25791 #: ../src/guestfs-actions.pod:4607
25792 msgid "guestfs_mkfs_b"
25796 #: ../src/guestfs-actions.pod:4609
25800 " guestfs_mkfs_b (guestfs_h *g,\n"
25801 " const char *fstype,\n"
25802 " int blocksize,\n"
25803 " const char *device);\n"
25808 #: ../src/guestfs-actions.pod:4615
25810 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
25811 "block size of the resulting filesystem. Supported block sizes depend on the "
25812 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
25816 #: ../src/guestfs-actions.pod:4634
25817 msgid "guestfs_mkfs_opts"
25821 #: ../src/guestfs-actions.pod:4636
25825 " guestfs_mkfs_opts (guestfs_h *g,\n"
25826 " const char *fstype,\n"
25827 " const char *device,\n"
25833 #: ../src/guestfs-actions.pod:4647
25836 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
25837 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
25838 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
25839 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
25844 #: ../src/guestfs-actions.pod:4695
25845 msgid "(Added in 1.7.19)"
25849 #: ../src/guestfs-actions.pod:4697
25850 msgid "guestfs_mkfs_opts_va"
25854 #: ../src/guestfs-actions.pod:4699
25858 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
25859 " const char *fstype,\n"
25860 " const char *device,\n"
25861 " va_list args);\n"
25866 #: ../src/guestfs-actions.pod:4705
25867 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
25871 #: ../src/guestfs-actions.pod:4709
25872 msgid "guestfs_mkfs_opts_argv"
25876 #: ../src/guestfs-actions.pod:4711
25880 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
25881 " const char *fstype,\n"
25882 " const char *device,\n"
25883 " const struct guestfs_mkfs_opts_argv *optargs);\n"
25888 #: ../src/guestfs-actions.pod:4717
25889 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
25893 #: ../src/guestfs-actions.pod:4721
25894 msgid "guestfs_mkmountpoint"
25898 #: ../src/guestfs-actions.pod:4723
25902 " guestfs_mkmountpoint (guestfs_h *g,\n"
25903 " const char *exemptpath);\n"
25908 #: ../src/guestfs-actions.pod:4727
25910 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
25911 "that can be used to create extra mountpoints before mounting the first "
25916 #: ../src/guestfs-actions.pod:4751
25918 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
25919 "may get unexpected errors if you try to mix these calls. It is safest to "
25920 "manually unmount filesystems and remove mountpoints after use."
25924 #: ../src/guestfs-actions.pod:4755
25926 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
25927 "first, so for this to work for manual mountpoints, you must ensure that the "
25928 "innermost mountpoints have the longest pathnames, as in the example code "
25933 #: ../src/guestfs-actions.pod:4762
25935 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
25936 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
25937 "can also trigger these issues."
25941 #: ../src/guestfs-actions.pod:4768 ../src/guestfs-actions.pod:5084 ../src/guestfs-actions.pod:6094
25942 msgid "(Added in 1.0.62)"
25946 #: ../src/guestfs-actions.pod:4770
25947 msgid "guestfs_mknod"
25951 #: ../src/guestfs-actions.pod:4772
25955 " guestfs_mknod (guestfs_h *g,\n"
25959 " const char *path);\n"
25964 #: ../src/guestfs-actions.pod:4787
25966 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
25967 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
25968 "regular file). These constants are available in the standard Linux header "
25969 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
25970 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
25971 "the appropriate constant for you."
25975 #: ../src/guestfs-actions.pod:4801
25976 msgid "guestfs_mknod_b"
25980 #: ../src/guestfs-actions.pod:4803
25984 " guestfs_mknod_b (guestfs_h *g,\n"
25988 " const char *path);\n"
25993 #: ../src/guestfs-actions.pod:4810
25995 "This call creates a block device node called C<path> with mode C<mode> and "
25996 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
25997 "wrapper around C<guestfs_mknod>."
26001 #: ../src/guestfs-actions.pod:4820
26002 msgid "guestfs_mknod_c"
26006 #: ../src/guestfs-actions.pod:4822
26010 " guestfs_mknod_c (guestfs_h *g,\n"
26014 " const char *path);\n"
26019 #: ../src/guestfs-actions.pod:4829
26021 "This call creates a char device node called C<path> with mode C<mode> and "
26022 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26023 "wrapper around C<guestfs_mknod>."
26027 #: ../src/guestfs-actions.pod:4839
26028 msgid "guestfs_mkswap"
26032 #: ../src/guestfs-actions.pod:4841
26036 " guestfs_mkswap (guestfs_h *g,\n"
26037 " const char *device);\n"
26042 #: ../src/guestfs-actions.pod:4851
26043 msgid "guestfs_mkswap_L"
26047 #: ../src/guestfs-actions.pod:4853
26051 " guestfs_mkswap_L (guestfs_h *g,\n"
26052 " const char *label,\n"
26053 " const char *device);\n"
26058 #: ../src/guestfs-actions.pod:4868
26059 msgid "guestfs_mkswap_U"
26063 #: ../src/guestfs-actions.pod:4870
26067 " guestfs_mkswap_U (guestfs_h *g,\n"
26068 " const char *uuid,\n"
26069 " const char *device);\n"
26074 #: ../src/guestfs-actions.pod:4881
26075 msgid "guestfs_mkswap_file"
26079 #: ../src/guestfs-actions.pod:4883
26083 " guestfs_mkswap_file (guestfs_h *g,\n"
26084 " const char *path);\n"
26089 #: ../src/guestfs-actions.pod:4889
26091 "This command just writes a swap file signature to an existing file. To "
26092 "create the file itself, use something like C<guestfs_fallocate>."
26096 #: ../src/guestfs-actions.pod:4896
26097 msgid "guestfs_modprobe"
26101 #: ../src/guestfs-actions.pod:4898
26105 " guestfs_modprobe (guestfs_h *g,\n"
26106 " const char *modulename);\n"
26111 #: ../src/guestfs-actions.pod:4911
26112 msgid "guestfs_mount"
26116 #: ../src/guestfs-actions.pod:4913
26120 " guestfs_mount (guestfs_h *g,\n"
26121 " const char *device,\n"
26122 " const char *mountpoint);\n"
26127 #: ../src/guestfs-actions.pod:4932
26129 "B<Important note:> When you use this call, the filesystem options C<sync> "
26130 "and C<noatime> are set implicitly. This was originally done because we "
26131 "thought it would improve reliability, but it turns out that I<-o sync> has a "
26132 "very large negative performance impact and negligible effect on "
26133 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
26134 "in any code that needs performance, and instead use C<guestfs_mount_options> "
26135 "(use an empty string for the first parameter if you don't want any options)."
26139 #: ../src/guestfs-actions.pod:4953
26140 msgid "guestfs_mount_9p"
26144 #: ../src/guestfs-actions.pod:4955
26148 " guestfs_mount_9p (guestfs_h *g,\n"
26149 " const char *mounttag,\n"
26150 " const char *mountpoint,\n"
26156 #: ../src/guestfs-actions.pod:4966
26159 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
26164 #: ../src/guestfs-actions.pod:4979
26165 msgid "guestfs_mount_9p_va"
26169 #: ../src/guestfs-actions.pod:4981
26173 " guestfs_mount_9p_va (guestfs_h *g,\n"
26174 " const char *mounttag,\n"
26175 " const char *mountpoint,\n"
26176 " va_list args);\n"
26181 #: ../src/guestfs-actions.pod:4987
26182 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
26186 #: ../src/guestfs-actions.pod:4991
26187 msgid "guestfs_mount_9p_argv"
26191 #: ../src/guestfs-actions.pod:4993
26195 " guestfs_mount_9p_argv (guestfs_h *g,\n"
26196 " const char *mounttag,\n"
26197 " const char *mountpoint,\n"
26198 " const struct guestfs_mount_9p_argv *optargs);\n"
26203 #: ../src/guestfs-actions.pod:4999
26204 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
26208 #: ../src/guestfs-actions.pod:5003
26209 msgid "guestfs_mount_loop"
26213 #: ../src/guestfs-actions.pod:5005
26217 " guestfs_mount_loop (guestfs_h *g,\n"
26218 " const char *file,\n"
26219 " const char *mountpoint);\n"
26224 #: ../src/guestfs-actions.pod:5018
26225 msgid "guestfs_mount_options"
26229 #: ../src/guestfs-actions.pod:5020
26233 " guestfs_mount_options (guestfs_h *g,\n"
26234 " const char *options,\n"
26235 " const char *device,\n"
26236 " const char *mountpoint);\n"
26241 #: ../src/guestfs-actions.pod:5026
26243 "This is the same as the C<guestfs_mount> command, but it allows you to set "
26244 "the mount options as for the L<mount(8)> I<-o> flag."
26248 #: ../src/guestfs-actions.pod:5036 ../src/guestfs-actions.pod:5050 ../src/guestfs-actions.pod:5067
26249 msgid "(Added in 1.0.10)"
26253 #: ../src/guestfs-actions.pod:5038
26254 msgid "guestfs_mount_ro"
26258 #: ../src/guestfs-actions.pod:5040
26262 " guestfs_mount_ro (guestfs_h *g,\n"
26263 " const char *device,\n"
26264 " const char *mountpoint);\n"
26269 #: ../src/guestfs-actions.pod:5045
26271 "This is the same as the C<guestfs_mount> command, but it mounts the "
26272 "filesystem with the read-only (I<-o ro>) flag."
26276 #: ../src/guestfs-actions.pod:5052
26277 msgid "guestfs_mount_vfs"
26281 #: ../src/guestfs-actions.pod:5054
26285 " guestfs_mount_vfs (guestfs_h *g,\n"
26286 " const char *options,\n"
26287 " const char *vfstype,\n"
26288 " const char *device,\n"
26289 " const char *mountpoint);\n"
26294 #: ../src/guestfs-actions.pod:5061
26296 "This is the same as the C<guestfs_mount> command, but it allows you to set "
26297 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
26302 #: ../src/guestfs-actions.pod:5069
26303 msgid "guestfs_mountpoints"
26307 #: ../src/guestfs-actions.pod:5071
26311 " guestfs_mountpoints (guestfs_h *g);\n"
26316 #: ../src/guestfs-actions.pod:5074
26318 "This call is similar to C<guestfs_mounts>. That call returns a list of "
26319 "devices. This one returns a hash table (map) of device name to directory "
26320 "where the device is mounted."
26324 #: ../src/guestfs-actions.pod:5086
26325 msgid "guestfs_mounts"
26329 #: ../src/guestfs-actions.pod:5088
26333 " guestfs_mounts (guestfs_h *g);\n"
26338 #: ../src/guestfs-actions.pod:5096
26339 msgid "See also: C<guestfs_mountpoints>"
26343 #: ../src/guestfs-actions.pod:5104
26348 #: ../src/guestfs-actions.pod:5106
26352 " guestfs_mv (guestfs_h *g,\n"
26353 " const char *src,\n"
26354 " const char *dest);\n"
26359 #: ../src/guestfs-actions.pod:5118
26360 msgid "guestfs_ntfs_3g_probe"
26364 #: ../src/guestfs-actions.pod:5120
26368 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
26370 " const char *device);\n"
26375 #: ../src/guestfs-actions.pod:5139
26376 msgid "(Added in 1.0.43)"
26380 #: ../src/guestfs-actions.pod:5141
26381 msgid "guestfs_ntfsresize"
26385 #: ../src/guestfs-actions.pod:5143
26389 " guestfs_ntfsresize (guestfs_h *g,\n"
26390 " const char *device);\n"
26395 #: ../src/guestfs-actions.pod:5171
26396 msgid "guestfs_ntfsresize_opts"
26400 #: ../src/guestfs-actions.pod:5173
26404 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
26405 " const char *device,\n"
26411 #: ../src/guestfs-actions.pod:5183
26414 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
26415 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
26420 #: ../src/guestfs-actions.pod:5203
26422 "After the resize operation, the filesystem is always marked as requiring a "
26423 "consistency check (for safety). You have to boot into Windows to perform "
26424 "this check and clear this condition. If you I<don't> set the C<force> "
26425 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
26426 "times on a single filesystem without booting into Windows between each "
26431 #: ../src/guestfs-actions.pod:5218
26432 msgid "guestfs_ntfsresize_opts_va"
26436 #: ../src/guestfs-actions.pod:5220
26440 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
26441 " const char *device,\n"
26442 " va_list args);\n"
26447 #: ../src/guestfs-actions.pod:5225
26448 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
26452 #: ../src/guestfs-actions.pod:5229
26453 msgid "guestfs_ntfsresize_opts_argv"
26457 #: ../src/guestfs-actions.pod:5231
26461 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
26462 " const char *device,\n"
26463 " const struct guestfs_ntfsresize_opts_argv "
26469 #: ../src/guestfs-actions.pod:5236
26470 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
26474 #: ../src/guestfs-actions.pod:5240
26475 msgid "guestfs_ntfsresize_size"
26479 #: ../src/guestfs-actions.pod:5242
26483 " guestfs_ntfsresize_size (guestfs_h *g,\n"
26484 " const char *device,\n"
26485 " int64_t size);\n"
26490 #: ../src/guestfs-actions.pod:5247
26492 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
26493 "to specify the new size (in bytes) explicitly."
26497 #: ../src/guestfs-actions.pod:5259 ../src/guestfs-actions.pod:5701 ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:6042 ../src/guestfs-actions.pod:7665
26498 msgid "(Added in 1.3.14)"
26502 #: ../src/guestfs-actions.pod:5261
26503 msgid "guestfs_part_add"
26507 #: ../src/guestfs-actions.pod:5263
26511 " guestfs_part_add (guestfs_h *g,\n"
26512 " const char *device,\n"
26513 " const char *prlogex,\n"
26514 " int64_t startsect,\n"
26515 " int64_t endsect);\n"
26520 #: ../src/guestfs-actions.pod:5270
26522 "This command adds a partition to C<device>. If there is no partition table "
26523 "on the device, call C<guestfs_part_init> first."
26527 #: ../src/guestfs-actions.pod:5282
26529 "Creating a partition which covers the whole disk is not so easy. Use "
26530 "C<guestfs_part_disk> to do that."
26534 #: ../src/guestfs-actions.pod:5287 ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5378 ../src/guestfs-actions.pod:5462 ../src/guestfs-actions.pod:5500 ../src/guestfs-actions.pod:5519 ../src/guestfs-actions.pod:5559
26535 msgid "(Added in 1.0.78)"
26539 #: ../src/guestfs-actions.pod:5289
26540 msgid "guestfs_part_del"
26544 #: ../src/guestfs-actions.pod:5291
26548 " guestfs_part_del (guestfs_h *g,\n"
26549 " const char *device,\n"
26555 #: ../src/guestfs-actions.pod:5306
26556 msgid "guestfs_part_disk"
26560 #: ../src/guestfs-actions.pod:5308
26564 " guestfs_part_disk (guestfs_h *g,\n"
26565 " const char *device,\n"
26566 " const char *parttype);\n"
26571 #: ../src/guestfs-actions.pod:5313
26573 "This command is simply a combination of C<guestfs_part_init> followed by "
26574 "C<guestfs_part_add> to create a single primary partition covering the whole "
26579 #: ../src/guestfs-actions.pod:5317
26581 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
26582 "possible values are described in C<guestfs_part_init>."
26586 #: ../src/guestfs-actions.pod:5327
26587 msgid "guestfs_part_get_bootable"
26591 #: ../src/guestfs-actions.pod:5329
26595 " guestfs_part_get_bootable (guestfs_h *g,\n"
26596 " const char *device,\n"
26602 #: ../src/guestfs-actions.pod:5337
26603 msgid "See also C<guestfs_part_set_bootable>."
26607 #: ../src/guestfs-actions.pod:5343
26608 msgid "guestfs_part_get_mbr_id"
26612 #: ../src/guestfs-actions.pod:5345
26616 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
26617 " const char *device,\n"
26623 #: ../src/guestfs-actions.pod:5353 ../src/guestfs-actions.pod:5535
26625 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
26626 "undefined results for other partition table types (see "
26627 "C<guestfs_part_get_parttype>)."
26631 #: ../src/guestfs-actions.pod:5361
26632 msgid "guestfs_part_get_parttype"
26636 #: ../src/guestfs-actions.pod:5363
26640 " guestfs_part_get_parttype (guestfs_h *g,\n"
26641 " const char *device);\n"
26646 #: ../src/guestfs-actions.pod:5370
26648 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
26649 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
26650 "possible, although unusual. See C<guestfs_part_init> for a full list."
26654 #: ../src/guestfs-actions.pod:5380
26655 msgid "guestfs_part_init"
26659 #: ../src/guestfs-actions.pod:5382
26663 " guestfs_part_init (guestfs_h *g,\n"
26664 " const char *device,\n"
26665 " const char *parttype);\n"
26670 #: ../src/guestfs-actions.pod:5391
26672 "Initially there are no partitions. Following this, you should call "
26673 "C<guestfs_part_add> for each partition required."
26677 #: ../src/guestfs-actions.pod:5464
26678 msgid "guestfs_part_list"
26682 #: ../src/guestfs-actions.pod:5466
26685 " struct guestfs_partition_list *\n"
26686 " guestfs_part_list (guestfs_h *g,\n"
26687 " const char *device);\n"
26692 #: ../src/guestfs-actions.pod:5483
26694 "Start of the partition I<in bytes>. To get sectors you have to divide by "
26695 "the device's sector size, see C<guestfs_blockdev_getss>."
26699 #: ../src/guestfs-actions.pod:5496
26701 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
26702 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
26707 #: ../src/guestfs-actions.pod:5502
26708 msgid "guestfs_part_set_bootable"
26712 #: ../src/guestfs-actions.pod:5504
26716 " guestfs_part_set_bootable (guestfs_h *g,\n"
26717 " const char *device,\n"
26719 " int bootable);\n"
26724 #: ../src/guestfs-actions.pod:5521
26725 msgid "guestfs_part_set_mbr_id"
26729 #: ../src/guestfs-actions.pod:5523
26733 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
26734 " const char *device,\n"
26741 #: ../src/guestfs-actions.pod:5543
26742 msgid "guestfs_part_set_name"
26746 #: ../src/guestfs-actions.pod:5545
26750 " guestfs_part_set_name (guestfs_h *g,\n"
26751 " const char *device,\n"
26753 " const char *name);\n"
26758 #: ../src/guestfs-actions.pod:5561
26759 msgid "guestfs_part_to_dev"
26763 #: ../src/guestfs-actions.pod:5563
26767 " guestfs_part_to_dev (guestfs_h *g,\n"
26768 " const char *partition);\n"
26773 #: ../src/guestfs-actions.pod:5571
26775 "The named partition must exist, for example as a string returned from "
26776 "C<guestfs_list_partitions>."
26780 #: ../src/guestfs-actions.pod:5579
26781 msgid "guestfs_ping_daemon"
26785 #: ../src/guestfs-actions.pod:5581
26789 " guestfs_ping_daemon (guestfs_h *g);\n"
26794 #: ../src/guestfs-actions.pod:5593
26795 msgid "guestfs_pread"
26799 #: ../src/guestfs-actions.pod:5595
26803 " guestfs_pread (guestfs_h *g,\n"
26804 " const char *path,\n"
26806 " int64_t offset,\n"
26807 " size_t *size_r);\n"
26812 #: ../src/guestfs-actions.pod:5608
26813 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
26817 #: ../src/guestfs-actions.pod:5619
26818 msgid "guestfs_pread_device"
26822 #: ../src/guestfs-actions.pod:5621
26826 " guestfs_pread_device (guestfs_h *g,\n"
26827 " const char *device,\n"
26829 " int64_t offset,\n"
26830 " size_t *size_r);\n"
26835 #: ../src/guestfs-actions.pod:5634
26836 msgid "See also C<guestfs_pread>."
26840 #: ../src/guestfs-actions.pod:5643
26841 msgid "(Added in 1.5.21)"
26845 #: ../src/guestfs-actions.pod:5645
26846 msgid "guestfs_pvcreate"
26850 #: ../src/guestfs-actions.pod:5647
26854 " guestfs_pvcreate (guestfs_h *g,\n"
26855 " const char *device);\n"
26860 #: ../src/guestfs-actions.pod:5659
26861 msgid "guestfs_pvremove"
26865 #: ../src/guestfs-actions.pod:5661
26869 " guestfs_pvremove (guestfs_h *g,\n"
26870 " const char *device);\n"
26875 #: ../src/guestfs-actions.pod:5676
26876 msgid "guestfs_pvresize"
26880 #: ../src/guestfs-actions.pod:5678
26884 " guestfs_pvresize (guestfs_h *g,\n"
26885 " const char *device);\n"
26890 #: ../src/guestfs-actions.pod:5689
26891 msgid "guestfs_pvresize_size"
26895 #: ../src/guestfs-actions.pod:5691
26899 " guestfs_pvresize_size (guestfs_h *g,\n"
26900 " const char *device,\n"
26901 " int64_t size);\n"
26906 #: ../src/guestfs-actions.pod:5696
26908 "This command is the same as C<guestfs_pvresize> except that it allows you to "
26909 "specify the new size (in bytes) explicitly."
26913 #: ../src/guestfs-actions.pod:5703
26914 msgid "guestfs_pvs"
26918 #: ../src/guestfs-actions.pod:5705
26922 " guestfs_pvs (guestfs_h *g);\n"
26927 #: ../src/guestfs-actions.pod:5714
26928 msgid "See also C<guestfs_pvs_full>."
26932 #: ../src/guestfs-actions.pod:5722
26933 msgid "guestfs_pvs_full"
26937 #: ../src/guestfs-actions.pod:5724
26940 " struct guestfs_lvm_pv_list *\n"
26941 " guestfs_pvs_full (guestfs_h *g);\n"
26946 #: ../src/guestfs-actions.pod:5730
26948 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
26949 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
26954 #: ../src/guestfs-actions.pod:5736
26955 msgid "guestfs_pvuuid"
26959 #: ../src/guestfs-actions.pod:5738
26963 " guestfs_pvuuid (guestfs_h *g,\n"
26964 " const char *device);\n"
26969 #: ../src/guestfs-actions.pod:5749
26970 msgid "guestfs_pwrite"
26974 #: ../src/guestfs-actions.pod:5751
26978 " guestfs_pwrite (guestfs_h *g,\n"
26979 " const char *path,\n"
26980 " const char *content,\n"
26981 " size_t content_size,\n"
26982 " int64_t offset);\n"
26987 #: ../src/guestfs-actions.pod:5767
26988 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
26992 #: ../src/guestfs-actions.pod:5776
26993 msgid "guestfs_pwrite_device"
26997 #: ../src/guestfs-actions.pod:5778
27001 " guestfs_pwrite_device (guestfs_h *g,\n"
27002 " const char *device,\n"
27003 " const char *content,\n"
27004 " size_t content_size,\n"
27005 " int64_t offset);\n"
27010 #: ../src/guestfs-actions.pod:5793
27011 msgid "See also C<guestfs_pwrite>."
27015 #: ../src/guestfs-actions.pod:5800
27016 msgid "(Added in 1.5.20)"
27020 #: ../src/guestfs-actions.pod:5802
27021 msgid "guestfs_read_file"
27025 #: ../src/guestfs-actions.pod:5804
27029 " guestfs_read_file (guestfs_h *g,\n"
27030 " const char *path,\n"
27031 " size_t *size_r);\n"
27036 #: ../src/guestfs-actions.pod:5812
27038 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
27039 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
27040 "function is limited in the total size of file that can be handled."
27044 #: ../src/guestfs-actions.pod:5824
27045 msgid "(Added in 1.0.63)"
27049 #: ../src/guestfs-actions.pod:5826
27050 msgid "guestfs_read_lines"
27054 #: ../src/guestfs-actions.pod:5828
27058 " guestfs_read_lines (guestfs_h *g,\n"
27059 " const char *path);\n"
27064 #: ../src/guestfs-actions.pod:5837
27066 "Note that this function cannot correctly handle binary files (specifically, "
27067 "files containing C<\\0> character which is treated as end of line). For "
27068 "those you need to use the C<guestfs_read_file> function which has a more "
27069 "complex interface."
27073 #: ../src/guestfs-actions.pod:5848
27074 msgid "guestfs_readdir"
27078 #: ../src/guestfs-actions.pod:5850
27081 " struct guestfs_dirent_list *\n"
27082 " guestfs_readdir (guestfs_h *g,\n"
27083 " const char *dir);\n"
27088 #: ../src/guestfs-actions.pod:5904
27090 "This function is primarily intended for use by programs. To get a simple "
27091 "list of names, use C<guestfs_ls>. To get a printable directory for human "
27092 "consumption, use C<guestfs_ll>."
27096 #: ../src/guestfs-actions.pod:5908
27098 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
27099 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
27104 #: ../src/guestfs-actions.pod:5914
27105 msgid "guestfs_readlink"
27109 #: ../src/guestfs-actions.pod:5916
27113 " guestfs_readlink (guestfs_h *g,\n"
27114 " const char *path);\n"
27119 #: ../src/guestfs-actions.pod:5927
27120 msgid "guestfs_readlinklist"
27124 #: ../src/guestfs-actions.pod:5929
27128 " guestfs_readlinklist (guestfs_h *g,\n"
27129 " const char *path,\n"
27130 " char *const *names);\n"
27135 #: ../src/guestfs-actions.pod:5962
27136 msgid "guestfs_realpath"
27140 #: ../src/guestfs-actions.pod:5964
27144 " guestfs_realpath (guestfs_h *g,\n"
27145 " const char *path);\n"
27150 #: ../src/guestfs-actions.pod:5976
27151 msgid "guestfs_removexattr"
27155 #: ../src/guestfs-actions.pod:5978
27159 " guestfs_removexattr (guestfs_h *g,\n"
27160 " const char *xattr,\n"
27161 " const char *path);\n"
27166 #: ../src/guestfs-actions.pod:5986
27167 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
27171 #: ../src/guestfs-actions.pod:5992
27172 msgid "guestfs_resize2fs"
27176 #: ../src/guestfs-actions.pod:5994
27180 " guestfs_resize2fs (guestfs_h *g,\n"
27181 " const char *device);\n"
27186 #: ../src/guestfs-actions.pod:6001
27188 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
27189 "C<device> before calling this command. For unknown reasons C<resize2fs> "
27190 "sometimes gives an error about this and sometimes not. In any case, it is "
27191 "always safe to call C<guestfs_e2fsck_f> before calling this function."
27195 #: ../src/guestfs-actions.pod:6011
27196 msgid "guestfs_resize2fs_M"
27200 #: ../src/guestfs-actions.pod:6013
27204 " guestfs_resize2fs_M (guestfs_h *g,\n"
27205 " const char *device);\n"
27210 #: ../src/guestfs-actions.pod:6017
27212 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
27213 "resized to its minimum size. This works like the I<-M> option to the "
27214 "C<resize2fs> command."
27218 #: ../src/guestfs-actions.pod:6021
27220 "To get the resulting size of the filesystem you should call "
27221 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
27222 "These two numbers, multiplied together, give the resulting size of the "
27223 "minimal filesystem in bytes."
27227 #: ../src/guestfs-actions.pod:6030
27228 msgid "guestfs_resize2fs_size"
27232 #: ../src/guestfs-actions.pod:6032
27236 " guestfs_resize2fs_size (guestfs_h *g,\n"
27237 " const char *device,\n"
27238 " int64_t size);\n"
27243 #: ../src/guestfs-actions.pod:6037
27245 "This command is the same as C<guestfs_resize2fs> except that it allows you "
27246 "to specify the new size (in bytes) explicitly."
27250 #: ../src/guestfs-actions.pod:6044
27255 #: ../src/guestfs-actions.pod:6046
27259 " guestfs_rm (guestfs_h *g,\n"
27260 " const char *path);\n"
27265 #: ../src/guestfs-actions.pod:6056
27266 msgid "guestfs_rm_rf"
27270 #: ../src/guestfs-actions.pod:6058
27274 " guestfs_rm_rf (guestfs_h *g,\n"
27275 " const char *path);\n"
27280 #: ../src/guestfs-actions.pod:6070
27281 msgid "guestfs_rmdir"
27285 #: ../src/guestfs-actions.pod:6072
27289 " guestfs_rmdir (guestfs_h *g,\n"
27290 " const char *path);\n"
27295 #: ../src/guestfs-actions.pod:6082
27296 msgid "guestfs_rmmountpoint"
27300 #: ../src/guestfs-actions.pod:6084
27304 " guestfs_rmmountpoint (guestfs_h *g,\n"
27305 " const char *exemptpath);\n"
27310 #: ../src/guestfs-actions.pod:6088
27312 "This calls removes a mountpoint that was previously created with "
27313 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
27317 #: ../src/guestfs-actions.pod:6096
27318 msgid "guestfs_scrub_device"
27322 #: ../src/guestfs-actions.pod:6098
27326 " guestfs_scrub_device (guestfs_h *g,\n"
27327 " const char *device);\n"
27332 #: ../src/guestfs-actions.pod:6113 ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150
27333 msgid "(Added in 1.0.52)"
27337 #: ../src/guestfs-actions.pod:6115
27338 msgid "guestfs_scrub_file"
27342 #: ../src/guestfs-actions.pod:6117
27346 " guestfs_scrub_file (guestfs_h *g,\n"
27347 " const char *file);\n"
27352 #: ../src/guestfs-actions.pod:6133
27353 msgid "guestfs_scrub_freespace"
27357 #: ../src/guestfs-actions.pod:6135
27361 " guestfs_scrub_freespace (guestfs_h *g,\n"
27362 " const char *dir);\n"
27367 #: ../src/guestfs-actions.pod:6139
27369 "This command creates the directory C<dir> and then fills it with files until "
27370 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
27371 "and deletes them. The intention is to scrub any free space on the partition "
27372 "containing C<dir>."
27376 #: ../src/guestfs-actions.pod:6152
27377 msgid "guestfs_set_append"
27381 #: ../src/guestfs-actions.pod:6154
27385 " guestfs_set_append (guestfs_h *g,\n"
27386 " const char *append);\n"
27391 #: ../src/guestfs-actions.pod:6171
27392 msgid "guestfs_set_attach_method"
27396 #: ../src/guestfs-actions.pod:6173
27400 " guestfs_set_attach_method (guestfs_h *g,\n"
27401 " const char *attachmethod);\n"
27406 #: ../src/guestfs-actions.pod:6201
27407 msgid "guestfs_set_autosync"
27411 #: ../src/guestfs-actions.pod:6203
27415 " guestfs_set_autosync (guestfs_h *g,\n"
27416 " int autosync);\n"
27421 #: ../src/guestfs-actions.pod:6219
27422 msgid "guestfs_set_direct"
27426 #: ../src/guestfs-actions.pod:6221
27430 " guestfs_set_direct (guestfs_h *g,\n"
27436 #: ../src/guestfs-actions.pod:6229
27438 "One consequence of this is that log messages aren't caught by the library "
27439 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
27444 #: ../src/guestfs-actions.pod:6242
27445 msgid "guestfs_set_e2label"
27449 #: ../src/guestfs-actions.pod:6244
27453 " guestfs_set_e2label (guestfs_h *g,\n"
27454 " const char *device,\n"
27455 " const char *label);\n"
27460 #: ../src/guestfs-actions.pod:6253
27462 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
27463 "the existing label on a filesystem."
27467 #: ../src/guestfs-actions.pod:6260
27468 msgid "guestfs_set_e2uuid"
27472 #: ../src/guestfs-actions.pod:6262
27476 " guestfs_set_e2uuid (guestfs_h *g,\n"
27477 " const char *device,\n"
27478 " const char *uuid);\n"
27483 #: ../src/guestfs-actions.pod:6272
27485 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
27486 "the existing UUID of a filesystem."
27490 #: ../src/guestfs-actions.pod:6279
27491 msgid "guestfs_set_memsize"
27495 #: ../src/guestfs-actions.pod:6281
27499 " guestfs_set_memsize (guestfs_h *g,\n"
27505 #: ../src/guestfs-actions.pod:6285
27507 "This sets the memory size in megabytes allocated to the qemu subprocess. "
27508 "This only has any effect if called before C<guestfs_launch>."
27512 #: ../src/guestfs-actions.pod:6300
27513 msgid "guestfs_set_network"
27517 #: ../src/guestfs-actions.pod:6302
27521 " guestfs_set_network (guestfs_h *g,\n"
27527 #: ../src/guestfs-actions.pod:6312
27529 "You must call this before calling C<guestfs_launch>, otherwise it has no "
27534 #: ../src/guestfs-actions.pod:6319
27535 msgid "guestfs_set_path"
27539 #: ../src/guestfs-actions.pod:6321
27543 " guestfs_set_path (guestfs_h *g,\n"
27544 " const char *searchpath);\n"
27549 #: ../src/guestfs-actions.pod:6336
27550 msgid "guestfs_set_pgroup"
27554 #: ../src/guestfs-actions.pod:6338
27558 " guestfs_set_pgroup (guestfs_h *g,\n"
27564 #: ../src/guestfs-actions.pod:6355
27565 msgid "guestfs_set_qemu"
27569 #: ../src/guestfs-actions.pod:6357
27573 " guestfs_set_qemu (guestfs_h *g,\n"
27574 " const char *qemu);\n"
27579 #: ../src/guestfs-actions.pod:6383
27580 msgid "guestfs_set_recovery_proc"
27584 #: ../src/guestfs-actions.pod:6385
27588 " guestfs_set_recovery_proc (guestfs_h *g,\n"
27589 " int recoveryproc);\n"
27594 #: ../src/guestfs-actions.pod:6389
27596 "If this is called with the parameter C<false> then C<guestfs_launch> does "
27597 "not create a recovery process. The purpose of the recovery process is to "
27598 "stop runaway qemu processes in the case where the main program aborts "
27603 #: ../src/guestfs-actions.pod:6394
27605 "This only has any effect if called before C<guestfs_launch>, and the default "
27610 #: ../src/guestfs-actions.pod:6407
27611 msgid "guestfs_set_selinux"
27615 #: ../src/guestfs-actions.pod:6409
27619 " guestfs_set_selinux (guestfs_h *g,\n"
27625 #: ../src/guestfs-actions.pod:6426
27626 msgid "guestfs_set_trace"
27630 #: ../src/guestfs-actions.pod:6428
27634 " guestfs_set_trace (guestfs_h *g,\n"
27640 #: ../src/guestfs-actions.pod:6442
27642 "Trace messages are normally sent to C<stderr>, unless you register a "
27643 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
27647 #: ../src/guestfs-actions.pod:6450
27648 msgid "guestfs_set_verbose"
27652 #: ../src/guestfs-actions.pod:6452
27656 " guestfs_set_verbose (guestfs_h *g,\n"
27662 #: ../src/guestfs-actions.pod:6461
27664 "Verbose messages are normally sent to C<stderr>, unless you register a "
27665 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
27669 #: ../src/guestfs-actions.pod:6469
27670 msgid "guestfs_setcon"
27674 #: ../src/guestfs-actions.pod:6471
27678 " guestfs_setcon (guestfs_h *g,\n"
27679 " const char *context);\n"
27684 #: ../src/guestfs-actions.pod:6484
27685 msgid "guestfs_setxattr"
27689 #: ../src/guestfs-actions.pod:6486
27693 " guestfs_setxattr (guestfs_h *g,\n"
27694 " const char *xattr,\n"
27695 " const char *val,\n"
27697 " const char *path);\n"
27702 #: ../src/guestfs-actions.pod:6497
27703 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
27707 #: ../src/guestfs-actions.pod:6503
27708 msgid "guestfs_sfdisk"
27712 #: ../src/guestfs-actions.pod:6505
27716 " guestfs_sfdisk (guestfs_h *g,\n"
27717 " const char *device,\n"
27721 " char *const *lines);\n"
27726 #: ../src/guestfs-actions.pod:6533
27727 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
27731 #: ../src/guestfs-actions.pod:6550
27732 msgid "guestfs_sfdiskM"
27736 #: ../src/guestfs-actions.pod:6552
27740 " guestfs_sfdiskM (guestfs_h *g,\n"
27741 " const char *device,\n"
27742 " char *const *lines);\n"
27747 #: ../src/guestfs-actions.pod:6557
27749 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
27750 "partition sizes are specified in megabytes only (rounded to the nearest "
27751 "cylinder) and you don't need to specify the cyls, heads and sectors "
27752 "parameters which were rarely if ever used anyway."
27756 #: ../src/guestfs-actions.pod:6563
27758 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
27759 "C<guestfs_part_disk>"
27763 #: ../src/guestfs-actions.pod:6580
27764 msgid "guestfs_sfdisk_N"
27768 #: ../src/guestfs-actions.pod:6582
27772 " guestfs_sfdisk_N (guestfs_h *g,\n"
27773 " const char *device,\n"
27778 " const char *line);\n"
27783 #: ../src/guestfs-actions.pod:6594
27785 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
27786 "for the cyls/heads/sectors parameters."
27790 #: ../src/guestfs-actions.pod:6597
27791 msgid "See also: C<guestfs_part_add>"
27795 #: ../src/guestfs-actions.pod:6613
27796 msgid "guestfs_sfdisk_disk_geometry"
27800 #: ../src/guestfs-actions.pod:6615
27804 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
27805 " const char *device);\n"
27810 #: ../src/guestfs-actions.pod:6619
27812 "This displays the disk geometry of C<device> read from the partition table. "
27813 "Especially in the case where the underlying block device has been resized, "
27814 "this can be different from the kernel's idea of the geometry (see "
27815 "C<guestfs_sfdisk_kernel_geometry>)."
27819 #: ../src/guestfs-actions.pod:6632
27820 msgid "guestfs_sfdisk_kernel_geometry"
27824 #: ../src/guestfs-actions.pod:6634
27828 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
27829 " const char *device);\n"
27834 #: ../src/guestfs-actions.pod:6648
27835 msgid "guestfs_sfdisk_l"
27839 #: ../src/guestfs-actions.pod:6650
27843 " guestfs_sfdisk_l (guestfs_h *g,\n"
27844 " const char *device);\n"
27849 #: ../src/guestfs-actions.pod:6658
27850 msgid "See also: C<guestfs_part_list>"
27854 #: ../src/guestfs-actions.pod:6672
27859 #: ../src/guestfs-actions.pod:6674
27863 " guestfs_sh (guestfs_h *g,\n"
27864 " const char *command);\n"
27869 #: ../src/guestfs-actions.pod:6681
27870 msgid "This is like C<guestfs_command>, but passes the command to:"
27874 #: ../src/guestfs-actions.pod:6689
27875 msgid "All the provisos about C<guestfs_command> apply to this call."
27879 #: ../src/guestfs-actions.pod:6696
27880 msgid "guestfs_sh_lines"
27884 #: ../src/guestfs-actions.pod:6698
27888 " guestfs_sh_lines (guestfs_h *g,\n"
27889 " const char *command);\n"
27894 #: ../src/guestfs-actions.pod:6702
27896 "This is the same as C<guestfs_sh>, but splits the result into a list of "
27901 #: ../src/guestfs-actions.pod:6705
27902 msgid "See also: C<guestfs_command_lines>"
27906 #: ../src/guestfs-actions.pod:6713
27907 msgid "guestfs_sleep"
27911 #: ../src/guestfs-actions.pod:6715
27915 " guestfs_sleep (guestfs_h *g,\n"
27921 #: ../src/guestfs-actions.pod:6723
27922 msgid "(Added in 1.0.41)"
27926 #: ../src/guestfs-actions.pod:6725 ../src/guestfs-structs.pod:109
27927 msgid "guestfs_stat"
27931 #: ../src/guestfs-actions.pod:6727
27934 " struct guestfs_stat *\n"
27935 " guestfs_stat (guestfs_h *g,\n"
27936 " const char *path);\n"
27941 #: ../src/guestfs-actions.pod:6741 ../src/guestfs-structs.pod:135
27942 msgid "guestfs_statvfs"
27946 #: ../src/guestfs-actions.pod:6743
27949 " struct guestfs_statvfs *\n"
27950 " guestfs_statvfs (guestfs_h *g,\n"
27951 " const char *path);\n"
27956 #: ../src/guestfs-actions.pod:6753
27958 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
27959 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
27963 #: ../src/guestfs-actions.pod:6759
27964 msgid "guestfs_strings"
27968 #: ../src/guestfs-actions.pod:6761
27972 " guestfs_strings (guestfs_h *g,\n"
27973 " const char *path);\n"
27978 #: ../src/guestfs-actions.pod:6777
27979 msgid "guestfs_strings_e"
27983 #: ../src/guestfs-actions.pod:6779
27987 " guestfs_strings_e (guestfs_h *g,\n"
27988 " const char *encoding,\n"
27989 " const char *path);\n"
27994 #: ../src/guestfs-actions.pod:6784
27996 "This is like the C<guestfs_strings> command, but allows you to specify the "
27997 "encoding of strings that are looked for in the source file C<path>."
28001 #: ../src/guestfs-actions.pod:6794
28003 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
28004 "ISO-8859-X (this is what C<guestfs_strings> uses)."
28008 #: ../src/guestfs-actions.pod:6832
28009 msgid "guestfs_swapoff_device"
28013 #: ../src/guestfs-actions.pod:6834
28017 " guestfs_swapoff_device (guestfs_h *g,\n"
28018 " const char *device);\n"
28023 #: ../src/guestfs-actions.pod:6838
28025 "This command disables the libguestfs appliance swap device or partition "
28026 "named C<device>. See C<guestfs_swapon_device>."
28030 #: ../src/guestfs-actions.pod:6846
28031 msgid "guestfs_swapoff_file"
28035 #: ../src/guestfs-actions.pod:6848
28039 " guestfs_swapoff_file (guestfs_h *g,\n"
28040 " const char *file);\n"
28045 #: ../src/guestfs-actions.pod:6858
28046 msgid "guestfs_swapoff_label"
28050 #: ../src/guestfs-actions.pod:6860
28054 " guestfs_swapoff_label (guestfs_h *g,\n"
28055 " const char *label);\n"
28060 #: ../src/guestfs-actions.pod:6871
28061 msgid "guestfs_swapoff_uuid"
28065 #: ../src/guestfs-actions.pod:6873
28069 " guestfs_swapoff_uuid (guestfs_h *g,\n"
28070 " const char *uuid);\n"
28075 #: ../src/guestfs-actions.pod:6884
28076 msgid "guestfs_swapon_device"
28080 #: ../src/guestfs-actions.pod:6886
28084 " guestfs_swapon_device (guestfs_h *g,\n"
28085 " const char *device);\n"
28090 #: ../src/guestfs-actions.pod:6890
28092 "This command enables the libguestfs appliance to use the swap device or "
28093 "partition named C<device>. The increased memory is made available for all "
28094 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
28098 #: ../src/guestfs-actions.pod:6906
28099 msgid "guestfs_swapon_file"
28103 #: ../src/guestfs-actions.pod:6908
28107 " guestfs_swapon_file (guestfs_h *g,\n"
28108 " const char *file);\n"
28113 #: ../src/guestfs-actions.pod:6912
28115 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
28120 #: ../src/guestfs-actions.pod:6919
28121 msgid "guestfs_swapon_label"
28125 #: ../src/guestfs-actions.pod:6921
28129 " guestfs_swapon_label (guestfs_h *g,\n"
28130 " const char *label);\n"
28135 #: ../src/guestfs-actions.pod:6925
28137 "This command enables swap to a labeled swap partition. See "
28138 "C<guestfs_swapon_device> for other notes."
28142 #: ../src/guestfs-actions.pod:6932
28143 msgid "guestfs_swapon_uuid"
28147 #: ../src/guestfs-actions.pod:6934
28151 " guestfs_swapon_uuid (guestfs_h *g,\n"
28152 " const char *uuid);\n"
28157 #: ../src/guestfs-actions.pod:6938
28159 "This command enables swap to a swap partition with the given UUID. See "
28160 "C<guestfs_swapon_device> for other notes."
28164 #: ../src/guestfs-actions.pod:6945
28165 msgid "guestfs_sync"
28169 #: ../src/guestfs-actions.pod:6947
28173 " guestfs_sync (guestfs_h *g);\n"
28178 #: ../src/guestfs-actions.pod:6960
28179 msgid "guestfs_tail"
28183 #: ../src/guestfs-actions.pod:6962
28187 " guestfs_tail (guestfs_h *g,\n"
28188 " const char *path);\n"
28193 #: ../src/guestfs-actions.pod:6978
28194 msgid "guestfs_tail_n"
28198 #: ../src/guestfs-actions.pod:6980
28202 " guestfs_tail_n (guestfs_h *g,\n"
28204 " const char *path);\n"
28209 #: ../src/guestfs-actions.pod:7002
28210 msgid "guestfs_tar_in"
28214 #: ../src/guestfs-actions.pod:7004
28218 " guestfs_tar_in (guestfs_h *g,\n"
28219 " const char *tarfile,\n"
28220 " const char *directory);\n"
28225 #: ../src/guestfs-actions.pod:7012
28226 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
28230 #: ../src/guestfs-actions.pod:7017 ../src/guestfs-actions.pod:7034 ../src/guestfs-actions.pod:7050 ../src/guestfs-actions.pod:7066
28231 msgid "(Added in 1.0.3)"
28235 #: ../src/guestfs-actions.pod:7019
28236 msgid "guestfs_tar_out"
28240 #: ../src/guestfs-actions.pod:7021
28244 " guestfs_tar_out (guestfs_h *g,\n"
28245 " const char *directory,\n"
28246 " const char *tarfile);\n"
28251 #: ../src/guestfs-actions.pod:7029
28253 "To download a compressed tarball, use C<guestfs_tgz_out> or "
28254 "C<guestfs_txz_out>."
28258 #: ../src/guestfs-actions.pod:7036
28259 msgid "guestfs_tgz_in"
28263 #: ../src/guestfs-actions.pod:7038
28267 " guestfs_tgz_in (guestfs_h *g,\n"
28268 " const char *tarball,\n"
28269 " const char *directory);\n"
28274 #: ../src/guestfs-actions.pod:7046
28275 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
28279 #: ../src/guestfs-actions.pod:7052
28280 msgid "guestfs_tgz_out"
28284 #: ../src/guestfs-actions.pod:7054
28288 " guestfs_tgz_out (guestfs_h *g,\n"
28289 " const char *directory,\n"
28290 " const char *tarball);\n"
28295 #: ../src/guestfs-actions.pod:7062
28296 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
28300 #: ../src/guestfs-actions.pod:7068
28301 msgid "guestfs_touch"
28305 #: ../src/guestfs-actions.pod:7070
28309 " guestfs_touch (guestfs_h *g,\n"
28310 " const char *path);\n"
28315 #: ../src/guestfs-actions.pod:7085
28316 msgid "guestfs_truncate"
28320 #: ../src/guestfs-actions.pod:7087
28324 " guestfs_truncate (guestfs_h *g,\n"
28325 " const char *path);\n"
28330 #: ../src/guestfs-actions.pod:7098
28331 msgid "guestfs_truncate_size"
28335 #: ../src/guestfs-actions.pod:7100
28339 " guestfs_truncate_size (guestfs_h *g,\n"
28340 " const char *path,\n"
28341 " int64_t size);\n"
28346 #: ../src/guestfs-actions.pod:7108
28348 "If the current file size is less than C<size> then the file is extended to "
28349 "the required size with zero bytes. This creates a sparse file (ie. disk "
28350 "blocks are not allocated for the file until you write to it). To create a "
28351 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
28355 #: ../src/guestfs-actions.pod:7118
28356 msgid "guestfs_tune2fs_l"
28360 #: ../src/guestfs-actions.pod:7120
28364 " guestfs_tune2fs_l (guestfs_h *g,\n"
28365 " const char *device);\n"
28370 #: ../src/guestfs-actions.pod:7140
28371 msgid "guestfs_txz_in"
28375 #: ../src/guestfs-actions.pod:7142
28379 " guestfs_txz_in (guestfs_h *g,\n"
28380 " const char *tarball,\n"
28381 " const char *directory);\n"
28386 #: ../src/guestfs-actions.pod:7154
28387 msgid "guestfs_txz_out"
28391 #: ../src/guestfs-actions.pod:7156
28395 " guestfs_txz_out (guestfs_h *g,\n"
28396 " const char *directory,\n"
28397 " const char *tarball);\n"
28402 #: ../src/guestfs-actions.pod:7168
28403 msgid "guestfs_umask"
28407 #: ../src/guestfs-actions.pod:7170
28411 " guestfs_umask (guestfs_h *g,\n"
28417 #: ../src/guestfs-actions.pod:7186
28419 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
28420 "C<guestfs_mkdir>."
28424 #: ../src/guestfs-actions.pod:7195
28425 msgid "guestfs_umount"
28429 #: ../src/guestfs-actions.pod:7197
28433 " guestfs_umount (guestfs_h *g,\n"
28434 " const char *pathordevice);\n"
28439 #: ../src/guestfs-actions.pod:7209
28440 msgid "guestfs_umount_all"
28444 #: ../src/guestfs-actions.pod:7211
28448 " guestfs_umount_all (guestfs_h *g);\n"
28453 #: ../src/guestfs-actions.pod:7222
28454 msgid "guestfs_upload"
28458 #: ../src/guestfs-actions.pod:7224
28462 " guestfs_upload (guestfs_h *g,\n"
28463 " const char *filename,\n"
28464 " const char *remotefilename);\n"
28469 #: ../src/guestfs-actions.pod:7234
28470 msgid "See also C<guestfs_download>."
28474 #: ../src/guestfs-actions.pod:7245
28475 msgid "guestfs_upload_offset"
28479 #: ../src/guestfs-actions.pod:7247
28483 " guestfs_upload_offset (guestfs_h *g,\n"
28484 " const char *filename,\n"
28485 " const char *remotefilename,\n"
28486 " int64_t offset);\n"
28491 #: ../src/guestfs-actions.pod:7263
28493 "Note that there is no limit on the amount of data that can be uploaded with "
28494 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
28495 "full amount unless an error occurs."
28499 #: ../src/guestfs-actions.pod:7268
28500 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
28504 #: ../src/guestfs-actions.pod:7279
28505 msgid "guestfs_utimens"
28509 #: ../src/guestfs-actions.pod:7281
28513 " guestfs_utimens (guestfs_h *g,\n"
28514 " const char *path,\n"
28515 " int64_t atsecs,\n"
28516 " int64_t atnsecs,\n"
28517 " int64_t mtsecs,\n"
28518 " int64_t mtnsecs);\n"
28523 #: ../src/guestfs-actions.pod:7310 ../src/guestfs-structs.pod:175
28524 msgid "guestfs_version"
28528 #: ../src/guestfs-actions.pod:7312
28531 " struct guestfs_version *\n"
28532 " guestfs_version (guestfs_h *g);\n"
28537 #: ../src/guestfs-actions.pod:7340
28539 "I<Note:> Don't use this call to test for availability of features. In "
28540 "enterprise distributions we backport features from later versions into "
28541 "earlier versions, making this an unreliable way to test for features. Use "
28542 "C<guestfs_available> instead."
28546 #: ../src/guestfs-actions.pod:7346
28548 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
28549 "error. I<The caller must call C<guestfs_free_version> after use>."
28553 #: ../src/guestfs-actions.pod:7350
28554 msgid "(Added in 1.0.58)"
28558 #: ../src/guestfs-actions.pod:7352
28559 msgid "guestfs_vfs_label"
28563 #: ../src/guestfs-actions.pod:7354
28567 " guestfs_vfs_label (guestfs_h *g,\n"
28568 " const char *device);\n"
28573 #: ../src/guestfs-actions.pod:7363
28574 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
28578 #: ../src/guestfs-actions.pod:7368 ../src/guestfs-actions.pod:7405
28579 msgid "(Added in 1.3.18)"
28583 #: ../src/guestfs-actions.pod:7370
28584 msgid "guestfs_vfs_type"
28588 #: ../src/guestfs-actions.pod:7372
28592 " guestfs_vfs_type (guestfs_h *g,\n"
28593 " const char *device);\n"
28598 #: ../src/guestfs-actions.pod:7389
28599 msgid "guestfs_vfs_uuid"
28603 #: ../src/guestfs-actions.pod:7391
28607 " guestfs_vfs_uuid (guestfs_h *g,\n"
28608 " const char *device);\n"
28613 #: ../src/guestfs-actions.pod:7400
28614 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
28618 #: ../src/guestfs-actions.pod:7407
28619 msgid "guestfs_vg_activate"
28623 #: ../src/guestfs-actions.pod:7409
28627 " guestfs_vg_activate (guestfs_h *g,\n"
28629 " char *const *volgroups);\n"
28634 #: ../src/guestfs-actions.pod:7426
28635 msgid "guestfs_vg_activate_all"
28639 #: ../src/guestfs-actions.pod:7428
28643 " guestfs_vg_activate_all (guestfs_h *g,\n"
28644 " int activate);\n"
28649 #: ../src/guestfs-actions.pod:7441
28650 msgid "guestfs_vgcreate"
28654 #: ../src/guestfs-actions.pod:7443
28658 " guestfs_vgcreate (guestfs_h *g,\n"
28659 " const char *volgroup,\n"
28660 " char *const *physvols);\n"
28665 #: ../src/guestfs-actions.pod:7455
28666 msgid "guestfs_vglvuuids"
28670 #: ../src/guestfs-actions.pod:7457
28674 " guestfs_vglvuuids (guestfs_h *g,\n"
28675 " const char *vgname);\n"
28680 #: ../src/guestfs-actions.pod:7464
28682 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
28683 "associate logical volumes and volume groups."
28687 #: ../src/guestfs-actions.pod:7467
28688 msgid "See also C<guestfs_vgpvuuids>."
28692 #: ../src/guestfs-actions.pod:7475
28693 msgid "guestfs_vgpvuuids"
28697 #: ../src/guestfs-actions.pod:7477
28701 " guestfs_vgpvuuids (guestfs_h *g,\n"
28702 " const char *vgname);\n"
28707 #: ../src/guestfs-actions.pod:7484
28709 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
28710 "associate physical volumes and volume groups."
28714 #: ../src/guestfs-actions.pod:7487
28715 msgid "See also C<guestfs_vglvuuids>."
28719 #: ../src/guestfs-actions.pod:7495
28720 msgid "guestfs_vgremove"
28724 #: ../src/guestfs-actions.pod:7497
28728 " guestfs_vgremove (guestfs_h *g,\n"
28729 " const char *vgname);\n"
28734 #: ../src/guestfs-actions.pod:7510
28735 msgid "guestfs_vgrename"
28739 #: ../src/guestfs-actions.pod:7512
28743 " guestfs_vgrename (guestfs_h *g,\n"
28744 " const char *volgroup,\n"
28745 " const char *newvolgroup);\n"
28750 #: ../src/guestfs-actions.pod:7523
28751 msgid "guestfs_vgs"
28755 #: ../src/guestfs-actions.pod:7525
28759 " guestfs_vgs (guestfs_h *g);\n"
28764 #: ../src/guestfs-actions.pod:7534
28765 msgid "See also C<guestfs_vgs_full>."
28769 #: ../src/guestfs-actions.pod:7542
28770 msgid "guestfs_vgs_full"
28774 #: ../src/guestfs-actions.pod:7544
28777 " struct guestfs_lvm_vg_list *\n"
28778 " guestfs_vgs_full (guestfs_h *g);\n"
28783 #: ../src/guestfs-actions.pod:7550
28785 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
28786 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
28791 #: ../src/guestfs-actions.pod:7556
28792 msgid "guestfs_vgscan"
28796 #: ../src/guestfs-actions.pod:7558
28800 " guestfs_vgscan (guestfs_h *g);\n"
28805 #: ../src/guestfs-actions.pod:7568
28806 msgid "guestfs_vguuid"
28810 #: ../src/guestfs-actions.pod:7570
28814 " guestfs_vguuid (guestfs_h *g,\n"
28815 " const char *vgname);\n"
28820 #: ../src/guestfs-actions.pod:7581
28821 msgid "guestfs_wait_ready"
28825 #: ../src/guestfs-actions.pod:7583
28829 " guestfs_wait_ready (guestfs_h *g);\n"
28834 #: ../src/guestfs-actions.pod:7586
28835 msgid "This function is a no op."
28839 #: ../src/guestfs-actions.pod:7588
28841 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
28842 "calling C<guestfs_launch> to wait for the launch to complete. However this "
28843 "is no longer necessary because C<guestfs_launch> now does the waiting."
28847 #: ../src/guestfs-actions.pod:7593
28849 "If you see any calls to this function in code then you can just remove them, "
28850 "unless you want to retain compatibility with older versions of the API."
28854 #: ../src/guestfs-actions.pod:7599
28855 msgid "This function is deprecated. In new code, use the C<launch> call instead."
28859 #: ../src/guestfs-actions.pod:7608
28860 msgid "guestfs_wc_c"
28864 #: ../src/guestfs-actions.pod:7610
28868 " guestfs_wc_c (guestfs_h *g,\n"
28869 " const char *path);\n"
28874 #: ../src/guestfs-actions.pod:7621
28875 msgid "guestfs_wc_l"
28879 #: ../src/guestfs-actions.pod:7623
28883 " guestfs_wc_l (guestfs_h *g,\n"
28884 " const char *path);\n"
28889 #: ../src/guestfs-actions.pod:7634
28890 msgid "guestfs_wc_w"
28894 #: ../src/guestfs-actions.pod:7636
28898 " guestfs_wc_w (guestfs_h *g,\n"
28899 " const char *path);\n"
28904 #: ../src/guestfs-actions.pod:7647
28905 msgid "guestfs_write"
28909 #: ../src/guestfs-actions.pod:7649
28913 " guestfs_write (guestfs_h *g,\n"
28914 " const char *path,\n"
28915 " const char *content,\n"
28916 " size_t content_size);\n"
28921 #: ../src/guestfs-actions.pod:7658
28922 msgid "See also C<guestfs_write_append>."
28926 #: ../src/guestfs-actions.pod:7667
28927 msgid "guestfs_write_append"
28931 #: ../src/guestfs-actions.pod:7669
28935 " guestfs_write_append (guestfs_h *g,\n"
28936 " const char *path,\n"
28937 " const char *content,\n"
28938 " size_t content_size);\n"
28943 #: ../src/guestfs-actions.pod:7678
28944 msgid "See also C<guestfs_write>."
28948 #: ../src/guestfs-actions.pod:7687
28949 msgid "guestfs_write_file"
28953 #: ../src/guestfs-actions.pod:7689
28957 " guestfs_write_file (guestfs_h *g,\n"
28958 " const char *path,\n"
28959 " const char *content,\n"
28965 #: ../src/guestfs-actions.pod:7720
28966 msgid "guestfs_zegrep"
28970 #: ../src/guestfs-actions.pod:7722
28974 " guestfs_zegrep (guestfs_h *g,\n"
28975 " const char *regex,\n"
28976 " const char *path);\n"
28981 #: ../src/guestfs-actions.pod:7739
28982 msgid "guestfs_zegrepi"
28986 #: ../src/guestfs-actions.pod:7741
28990 " guestfs_zegrepi (guestfs_h *g,\n"
28991 " const char *regex,\n"
28992 " const char *path);\n"
28997 #: ../src/guestfs-actions.pod:7758
28998 msgid "guestfs_zero"
29002 #: ../src/guestfs-actions.pod:7760
29006 " guestfs_zero (guestfs_h *g,\n"
29007 " const char *device);\n"
29012 #: ../src/guestfs-actions.pod:7770
29014 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
29015 "C<guestfs_is_zero_device>"
29019 #: ../src/guestfs-actions.pod:7782
29020 msgid "guestfs_zero_device"
29024 #: ../src/guestfs-actions.pod:7784
29028 " guestfs_zero_device (guestfs_h *g,\n"
29029 " const char *device);\n"
29034 #: ../src/guestfs-actions.pod:7788
29036 "This command writes zeroes over the entire C<device>. Compare with "
29037 "C<guestfs_zero> which just zeroes the first few blocks of a device."
29041 #: ../src/guestfs-actions.pod:7802
29042 msgid "(Added in 1.3.1)"
29046 #: ../src/guestfs-actions.pod:7804
29047 msgid "guestfs_zerofree"
29051 #: ../src/guestfs-actions.pod:7806
29055 " guestfs_zerofree (guestfs_h *g,\n"
29056 " const char *device);\n"
29061 #: ../src/guestfs-actions.pod:7825
29062 msgid "guestfs_zfgrep"
29066 #: ../src/guestfs-actions.pod:7827
29070 " guestfs_zfgrep (guestfs_h *g,\n"
29071 " const char *pattern,\n"
29072 " const char *path);\n"
29077 #: ../src/guestfs-actions.pod:7844
29078 msgid "guestfs_zfgrepi"
29082 #: ../src/guestfs-actions.pod:7846
29086 " guestfs_zfgrepi (guestfs_h *g,\n"
29087 " const char *pattern,\n"
29088 " const char *path);\n"
29093 #: ../src/guestfs-actions.pod:7863
29094 msgid "guestfs_zfile"
29098 #: ../src/guestfs-actions.pod:7865
29102 " guestfs_zfile (guestfs_h *g,\n"
29103 " const char *meth,\n"
29104 " const char *path);\n"
29109 #: ../src/guestfs-actions.pod:7875
29111 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
29116 #: ../src/guestfs-actions.pod:7890
29117 msgid "guestfs_zgrep"
29121 #: ../src/guestfs-actions.pod:7892
29125 " guestfs_zgrep (guestfs_h *g,\n"
29126 " const char *regex,\n"
29127 " const char *path);\n"
29132 #: ../src/guestfs-actions.pod:7909
29133 msgid "guestfs_zgrepi"
29137 #: ../src/guestfs-actions.pod:7911
29141 " guestfs_zgrepi (guestfs_h *g,\n"
29142 " const char *regex,\n"
29143 " const char *path);\n"
29148 #: ../src/guestfs-availability.pod:3
29153 #: ../src/guestfs-availability.pod:5
29155 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
29156 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
29157 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
29158 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
29159 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
29163 #: ../src/guestfs-availability.pod:21
29168 #: ../src/guestfs-availability.pod:23
29169 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
29173 #: ../src/guestfs-availability.pod:26
29178 #: ../src/guestfs-availability.pod:28
29180 "The following functions: L</guestfs_inotify_add_watch> "
29181 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
29182 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
29186 #: ../src/guestfs-availability.pod:36
29187 msgid "B<linuxfsuuid>"
29191 #: ../src/guestfs-availability.pod:38
29193 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
29194 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
29198 #: ../src/guestfs-availability.pod:45
29199 msgid "B<linuxmodules>"
29203 #: ../src/guestfs-availability.pod:47
29204 msgid "The following functions: L</guestfs_modprobe>"
29208 #: ../src/guestfs-availability.pod:50
29209 msgid "B<linuxxattrs>"
29213 #: ../src/guestfs-availability.pod:52
29215 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
29216 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
29217 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
29218 "L</guestfs_setxattr>"
29222 #: ../src/guestfs-availability.pod:63
29227 #: ../src/guestfs-availability.pod:65
29229 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
29230 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
29231 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
29235 #: ../src/guestfs-availability.pod:74
29240 #: ../src/guestfs-availability.pod:76
29242 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
29243 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
29244 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
29245 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
29246 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
29247 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
29248 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
29249 "L</guestfs_vgs_full>"
29253 #: ../src/guestfs-availability.pod:99
29258 #: ../src/guestfs-availability.pod:101
29260 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
29261 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
29265 #: ../src/guestfs-availability.pod:107
29270 #: ../src/guestfs-availability.pod:109
29271 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
29275 #: ../src/guestfs-availability.pod:112
29276 msgid "B<ntfsprogs>"
29280 #: ../src/guestfs-availability.pod:114
29282 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
29283 "L</guestfs_ntfsresize_size>"
29287 #: ../src/guestfs-availability.pod:119
29288 msgid "B<realpath>"
29292 #: ../src/guestfs-availability.pod:121
29293 msgid "The following functions: L</guestfs_realpath>"
29297 #: ../src/guestfs-availability.pod:124
29302 #: ../src/guestfs-availability.pod:126
29304 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
29305 "L</guestfs_scrub_freespace>"
29309 #: ../src/guestfs-availability.pod:131
29314 #: ../src/guestfs-availability.pod:133
29315 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
29319 #: ../src/guestfs-availability.pod:137
29324 #: ../src/guestfs-availability.pod:139
29325 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
29329 #: ../src/guestfs-availability.pod:143
29330 msgid "B<zerofree>"
29334 #: ../src/guestfs-availability.pod:145
29335 msgid "The following functions: L</guestfs_zerofree>"
29339 #: ../src/guestfs-structs.pod:1
29340 msgid "guestfs_int_bool"
29344 #: ../src/guestfs-structs.pod:3
29347 " struct guestfs_int_bool {\n"
29355 #: ../src/guestfs-structs.pod:8
29358 " struct guestfs_int_bool_list {\n"
29359 " uint32_t len; /* Number of elements in list. */\n"
29360 " struct guestfs_int_bool *val; /* Elements. */\n"
29366 #: ../src/guestfs-structs.pod:13
29369 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
29370 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
29375 #: ../src/guestfs-structs.pod:16
29376 msgid "guestfs_lvm_pv"
29380 #: ../src/guestfs-structs.pod:18
29383 " struct guestfs_lvm_pv {\n"
29384 " char *pv_name;\n"
29385 " /* The next field is NOT nul-terminated, be careful when printing it: "
29387 " char pv_uuid[32];\n"
29389 " uint64_t pv_size;\n"
29390 " uint64_t dev_size;\n"
29391 " uint64_t pv_free;\n"
29392 " uint64_t pv_used;\n"
29393 " char *pv_attr;\n"
29394 " int64_t pv_pe_count;\n"
29395 " int64_t pv_pe_alloc_count;\n"
29396 " char *pv_tags;\n"
29397 " uint64_t pe_start;\n"
29398 " int64_t pv_mda_count;\n"
29399 " uint64_t pv_mda_free;\n"
29405 #: ../src/guestfs-structs.pod:36
29408 " struct guestfs_lvm_pv_list {\n"
29409 " uint32_t len; /* Number of elements in list. */\n"
29410 " struct guestfs_lvm_pv *val; /* Elements. */\n"
29416 #: ../src/guestfs-structs.pod:41
29419 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
29420 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
29425 #: ../src/guestfs-structs.pod:44
29426 msgid "guestfs_lvm_vg"
29430 #: ../src/guestfs-structs.pod:46
29433 " struct guestfs_lvm_vg {\n"
29434 " char *vg_name;\n"
29435 " /* The next field is NOT nul-terminated, be careful when printing it: "
29437 " char vg_uuid[32];\n"
29439 " char *vg_attr;\n"
29440 " uint64_t vg_size;\n"
29441 " uint64_t vg_free;\n"
29442 " char *vg_sysid;\n"
29443 " uint64_t vg_extent_size;\n"
29444 " int64_t vg_extent_count;\n"
29445 " int64_t vg_free_count;\n"
29446 " int64_t max_lv;\n"
29447 " int64_t max_pv;\n"
29448 " int64_t pv_count;\n"
29449 " int64_t lv_count;\n"
29450 " int64_t snap_count;\n"
29451 " int64_t vg_seqno;\n"
29452 " char *vg_tags;\n"
29453 " int64_t vg_mda_count;\n"
29454 " uint64_t vg_mda_free;\n"
29460 #: ../src/guestfs-structs.pod:69
29463 " struct guestfs_lvm_vg_list {\n"
29464 " uint32_t len; /* Number of elements in list. */\n"
29465 " struct guestfs_lvm_vg *val; /* Elements. */\n"
29471 #: ../src/guestfs-structs.pod:74
29474 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
29475 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
29480 #: ../src/guestfs-structs.pod:77
29481 msgid "guestfs_lvm_lv"
29485 #: ../src/guestfs-structs.pod:79
29488 " struct guestfs_lvm_lv {\n"
29489 " char *lv_name;\n"
29490 " /* The next field is NOT nul-terminated, be careful when printing it: "
29492 " char lv_uuid[32];\n"
29493 " char *lv_attr;\n"
29494 " int64_t lv_major;\n"
29495 " int64_t lv_minor;\n"
29496 " int64_t lv_kernel_major;\n"
29497 " int64_t lv_kernel_minor;\n"
29498 " uint64_t lv_size;\n"
29499 " int64_t seg_count;\n"
29501 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
29502 " float snap_percent;\n"
29503 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
29504 " float copy_percent;\n"
29505 " char *move_pv;\n"
29506 " char *lv_tags;\n"
29507 " char *mirror_log;\n"
29508 " char *modules;\n"
29514 #: ../src/guestfs-structs.pod:101
29517 " struct guestfs_lvm_lv_list {\n"
29518 " uint32_t len; /* Number of elements in list. */\n"
29519 " struct guestfs_lvm_lv *val; /* Elements. */\n"
29525 #: ../src/guestfs-structs.pod:106
29528 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
29529 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
29534 #: ../src/guestfs-structs.pod:111
29537 " struct guestfs_stat {\n"
29541 " int64_t nlink;\n"
29546 " int64_t blksize;\n"
29547 " int64_t blocks;\n"
29548 " int64_t atime;\n"
29549 " int64_t mtime;\n"
29550 " int64_t ctime;\n"
29556 #: ../src/guestfs-structs.pod:127
29559 " struct guestfs_stat_list {\n"
29560 " uint32_t len; /* Number of elements in list. */\n"
29561 " struct guestfs_stat *val; /* Elements. */\n"
29567 #: ../src/guestfs-structs.pod:132
29570 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
29571 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
29576 #: ../src/guestfs-structs.pod:137
29579 " struct guestfs_statvfs {\n"
29580 " int64_t bsize;\n"
29581 " int64_t frsize;\n"
29582 " int64_t blocks;\n"
29583 " int64_t bfree;\n"
29584 " int64_t bavail;\n"
29585 " int64_t files;\n"
29586 " int64_t ffree;\n"
29587 " int64_t favail;\n"
29590 " int64_t namemax;\n"
29596 #: ../src/guestfs-structs.pod:151
29599 " struct guestfs_statvfs_list {\n"
29600 " uint32_t len; /* Number of elements in list. */\n"
29601 " struct guestfs_statvfs *val; /* Elements. */\n"
29607 #: ../src/guestfs-structs.pod:156
29610 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
29611 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
29616 #: ../src/guestfs-structs.pod:159
29617 msgid "guestfs_dirent"
29621 #: ../src/guestfs-structs.pod:161
29624 " struct guestfs_dirent {\n"
29633 #: ../src/guestfs-structs.pod:167
29636 " struct guestfs_dirent_list {\n"
29637 " uint32_t len; /* Number of elements in list. */\n"
29638 " struct guestfs_dirent *val; /* Elements. */\n"
29644 #: ../src/guestfs-structs.pod:172
29647 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
29648 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
29653 #: ../src/guestfs-structs.pod:177
29656 " struct guestfs_version {\n"
29657 " int64_t major;\n"
29658 " int64_t minor;\n"
29659 " int64_t release;\n"
29666 #: ../src/guestfs-structs.pod:184
29669 " struct guestfs_version_list {\n"
29670 " uint32_t len; /* Number of elements in list. */\n"
29671 " struct guestfs_version *val; /* Elements. */\n"
29677 #: ../src/guestfs-structs.pod:189
29680 " void guestfs_free_version (struct guestfs_free_version *);\n"
29681 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
29686 #: ../src/guestfs-structs.pod:192
29687 msgid "guestfs_xattr"
29691 #: ../src/guestfs-structs.pod:194
29694 " struct guestfs_xattr {\n"
29695 " char *attrname;\n"
29696 " /* The next two fields describe a byte array. */\n"
29697 " uint32_t attrval_len;\n"
29698 " char *attrval;\n"
29704 #: ../src/guestfs-structs.pod:201
29707 " struct guestfs_xattr_list {\n"
29708 " uint32_t len; /* Number of elements in list. */\n"
29709 " struct guestfs_xattr *val; /* Elements. */\n"
29715 #: ../src/guestfs-structs.pod:206
29718 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
29719 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
29724 #: ../src/guestfs-structs.pod:209
29725 msgid "guestfs_inotify_event"
29729 #: ../src/guestfs-structs.pod:211
29732 " struct guestfs_inotify_event {\n"
29733 " int64_t in_wd;\n"
29734 " uint32_t in_mask;\n"
29735 " uint32_t in_cookie;\n"
29736 " char *in_name;\n"
29742 #: ../src/guestfs-structs.pod:218
29745 " struct guestfs_inotify_event_list {\n"
29746 " uint32_t len; /* Number of elements in list. */\n"
29747 " struct guestfs_inotify_event *val; /* Elements. */\n"
29753 #: ../src/guestfs-structs.pod:223
29756 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
29757 " void guestfs_free_inotify_event_list (struct "
29758 "guestfs_free_inotify_event_list *);\n"
29763 #: ../src/guestfs-structs.pod:226
29764 msgid "guestfs_partition"
29768 #: ../src/guestfs-structs.pod:228
29771 " struct guestfs_partition {\n"
29772 " int32_t part_num;\n"
29773 " uint64_t part_start;\n"
29774 " uint64_t part_end;\n"
29775 " uint64_t part_size;\n"
29781 #: ../src/guestfs-structs.pod:235
29784 " struct guestfs_partition_list {\n"
29785 " uint32_t len; /* Number of elements in list. */\n"
29786 " struct guestfs_partition *val; /* Elements. */\n"
29792 #: ../src/guestfs-structs.pod:240
29795 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
29796 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
29801 #: ../src/guestfs-structs.pod:243
29802 msgid "guestfs_application"
29806 #: ../src/guestfs-structs.pod:245
29809 " struct guestfs_application {\n"
29810 " char *app_name;\n"
29811 " char *app_display_name;\n"
29812 " int32_t app_epoch;\n"
29813 " char *app_version;\n"
29814 " char *app_release;\n"
29815 " char *app_install_path;\n"
29816 " char *app_trans_path;\n"
29817 " char *app_publisher;\n"
29818 " char *app_url;\n"
29819 " char *app_source_package;\n"
29820 " char *app_summary;\n"
29821 " char *app_description;\n"
29827 #: ../src/guestfs-structs.pod:260
29830 " struct guestfs_application_list {\n"
29831 " uint32_t len; /* Number of elements in list. */\n"
29832 " struct guestfs_application *val; /* Elements. */\n"
29838 #: ../src/guestfs-structs.pod:265
29841 " void guestfs_free_application (struct guestfs_free_application *);\n"
29842 " void guestfs_free_application_list (struct guestfs_free_application_list "
29848 #: ../src/guestfs.pod:5
29849 msgid "guestfs - Library for accessing and modifying virtual machine images"
29853 #: ../src/guestfs.pod:11
29856 " guestfs_h *g = guestfs_create ();\n"
29857 " guestfs_add_drive (g, \"guest.img\");\n"
29858 " guestfs_launch (g);\n"
29859 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
29860 " guestfs_touch (g, \"/hello\");\n"
29861 " guestfs_umount (g, \"/\");\n"
29862 " guestfs_close (g);\n"
29867 #: ../src/guestfs.pod:25
29869 "Libguestfs is a library for accessing and modifying guest disk images. "
29870 "Amongst the things this is good for: making batch configuration changes to "
29871 "guests, getting disk used/free statistics (see also: virt-df), migrating "
29872 "between virtualization systems (see also: virt-p2v), performing partial "
29873 "backups, performing partial guest clones, cloning guests and changing "
29874 "registry/UUID/hostname info, and much else besides."
29878 #: ../src/guestfs.pod:33
29880 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
29881 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
29882 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
29887 #: ../src/guestfs.pod:38
29889 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
29890 "what filesystem is in each LV, etc.). It can also run commands in the "
29891 "context of the guest. Also you can access filesystems over FUSE."
29895 #: ../src/guestfs.pod:43
29897 "Libguestfs is a library that can be linked with C and C++ management "
29898 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
29899 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
29904 #: ../src/guestfs.pod:48
29906 "You don't need to be root to use libguestfs, although obviously you do need "
29907 "enough permissions to access the disk images."
29911 #: ../src/guestfs.pod:51
29913 "Libguestfs is a large API because it can do many things. For a gentle "
29914 "introduction, please read the L</API OVERVIEW> section next."
29918 #: ../src/guestfs.pod:54
29920 "There are also some example programs in the L<guestfs-examples(3)> manual "
29925 #: ../src/guestfs.pod:57
29926 msgid "API OVERVIEW"
29930 #: ../src/guestfs.pod:59
29932 "This section provides a gentler overview of the libguestfs API. We also try "
29933 "to group API calls together, where that may not be obvious from reading "
29934 "about the individual calls in the main section of this manual."
29938 #: ../src/guestfs.pod:64
29943 #: ../src/guestfs.pod:66
29945 "Before you can use libguestfs calls, you have to create a handle. Then you "
29946 "must add at least one disk image to the handle, followed by launching the "
29947 "handle, then performing whatever operations you want, and finally closing "
29948 "the handle. By convention we use the single letter C<g> for the name of the "
29949 "handle variable, although of course you can use any name you want."
29953 #: ../src/guestfs.pod:73
29954 msgid "The general structure of all libguestfs-using programs looks like this:"
29958 #: ../src/guestfs.pod:76
29961 " guestfs_h *g = guestfs_create ();\n"
29966 #: ../src/guestfs.pod:78
29969 " /* Call guestfs_add_drive additional times if there are\n"
29970 " * multiple disk images.\n"
29972 " guestfs_add_drive (g, \"guest.img\");\n"
29977 #: ../src/guestfs.pod:83
29980 " /* Most manipulation calls won't work until you've launched\n"
29981 " * the handle 'g'. You have to do this _after_ adding drives\n"
29982 " * and _before_ other commands.\n"
29984 " guestfs_launch (g);\n"
29989 #: ../src/guestfs.pod:89
29992 " /* Now you can examine what partitions, LVs etc are available.\n"
29994 " char **partitions = guestfs_list_partitions (g);\n"
29995 " char **logvols = guestfs_lvs (g);\n"
30000 #: ../src/guestfs.pod:94
30003 " /* To access a filesystem in the image, you must mount it.\n"
30005 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30010 #: ../src/guestfs.pod:98
30013 " /* Now you can perform filesystem actions on the guest\n"
30016 " guestfs_touch (g, \"/hello\");\n"
30021 #: ../src/guestfs.pod:103
30024 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
30025 " * it is done automatically when you close the handle. See\n"
30026 " * discussion of autosync in this page.\n"
30028 " guestfs_sync (g);\n"
30033 #: ../src/guestfs.pod:109
30036 " /* Close the handle 'g'. */\n"
30037 " guestfs_close (g);\n"
30042 #: ../src/guestfs.pod:112
30044 "The code above doesn't include any error checking. In real code you should "
30045 "check return values carefully for errors. In general all functions that "
30046 "return integers return C<-1> on error, and all functions that return "
30047 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
30048 "how to handle errors, and consult the documentation for each function call "
30049 "below to see precisely how they return error indications. See "
30050 "L<guestfs-examples(3)> for fully worked examples."
30054 #: ../src/guestfs.pod:121
30055 msgid "DISK IMAGES"
30059 #: ../src/guestfs.pod:123
30061 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
30062 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
30063 "actual block device, or simply an empty file of zeroes that you have created "
30064 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
30069 #: ../src/guestfs.pod:129
30071 "The call you should use in modern code for adding drives is "
30072 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
30073 "specifying that the format is raw, do:"
30077 #: ../src/guestfs.pod:133
30080 " guestfs_add_drive_opts (g, filename,\n"
30081 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30087 #: ../src/guestfs.pod:137
30088 msgid "You can add a disk read-only using:"
30092 #: ../src/guestfs.pod:139
30095 " guestfs_add_drive_opts (g, filename,\n"
30096 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
30097 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
30103 #: ../src/guestfs.pod:144
30105 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
30106 "libguestfs won't modify the file."
30110 #: ../src/guestfs.pod:147
30112 "Be extremely cautious if the disk image is in use, eg. if it is being used "
30113 "by a virtual machine. Adding it read-write will almost certainly cause disk "
30114 "corruption, but adding it read-only is safe."
30118 #: ../src/guestfs.pod:151
30120 "You must add at least one disk image, and you may add multiple disk images. "
30121 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
30122 "first one you added), C</dev/sdb> (for the second one you added), etc."
30126 #: ../src/guestfs.pod:156
30128 "Once L</guestfs_launch> has been called you cannot add any more images. You "
30129 "can call L</guestfs_list_devices> to get a list of the device names, in the "
30130 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
30134 #: ../src/guestfs.pod:161
30139 #: ../src/guestfs.pod:163
30141 "Before you can read or write files, create directories and so on in a disk "
30142 "image that contains filesystems, you have to mount those filesystems using "
30143 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
30144 "a disk image contains (for example) one partition with a filesystem on that "
30145 "partition, then you can mount it directly:"
30149 #: ../src/guestfs.pod:170
30152 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
30157 #: ../src/guestfs.pod:172
30159 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
30160 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
30161 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
30162 "that these are libguestfs virtual devices, and are nothing to do with host "
30167 #: ../src/guestfs.pod:178
30169 "If you are given a disk image and you don't know what it contains then you "
30170 "have to find out. Libguestfs can do that too: use "
30171 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
30172 "and LVs, and either try mounting each to see what is mountable, or else "
30173 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
30174 "filesystems, use L</guestfs_list_filesystems>."
30178 #: ../src/guestfs.pod:186
30180 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
30181 "L</INSPECTION> below). But you might find it easier to look at higher level "
30182 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
30186 #: ../src/guestfs.pod:191
30188 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
30189 "several other variations of the C<guestfs_mount_*> call."
30193 #: ../src/guestfs.pod:194
30194 msgid "FILESYSTEM ACCESS AND MODIFICATION"
30198 #: ../src/guestfs.pod:196
30200 "The majority of the libguestfs API consists of fairly low-level calls for "
30201 "accessing and modifying the files, directories, symlinks etc on mounted "
30202 "filesystems. There are over a hundred such calls which you can find listed "
30203 "in detail below in this man page, and we don't even pretend to cover them "
30204 "all in this overview."
30208 #: ../src/guestfs.pod:202
30210 "Specify filenames as full paths, starting with C<\"/\"> and including the "
30215 #: ../src/guestfs.pod:205
30217 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
30218 "the file called C<\"etc/passwd\"> then you could do:"
30222 #: ../src/guestfs.pod:208
30225 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
30230 #: ../src/guestfs.pod:210
30232 "This would return C<data> as a newly allocated buffer containing the full "
30233 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
30234 "or C<NULL> if there was an error."
30238 #: ../src/guestfs.pod:214
30240 "As another example, to create a top-level directory on that filesystem "
30241 "called C<\"var\"> you would do:"
30245 #: ../src/guestfs.pod:217
30248 " guestfs_mkdir (g, \"/var\");\n"
30253 #: ../src/guestfs.pod:219
30254 msgid "To create a symlink you could do:"
30258 #: ../src/guestfs.pod:221
30261 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
30262 " \"/etc/rc3.d/S30portmap\");\n"
30267 #: ../src/guestfs.pod:224
30269 "Libguestfs will reject attempts to use relative paths and there is no "
30270 "concept of a current working directory."
30274 #: ../src/guestfs.pod:227
30276 "Libguestfs can return errors in many situations: for example if the "
30277 "filesystem isn't writable, or if a file or directory that you requested "
30278 "doesn't exist. If you are using the C API (documented here) you have to "
30279 "check for those error conditions after each call. (Other language bindings "
30280 "turn these errors into exceptions)."
30284 #: ../src/guestfs.pod:233
30286 "File writes are affected by the per-handle umask, set by calling "
30287 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
30291 #: ../src/guestfs.pod:236
30292 msgid "PARTITIONING"
30296 #: ../src/guestfs.pod:238
30298 "Libguestfs contains API calls to read, create and modify partition tables on "
30303 #: ../src/guestfs.pod:241
30305 "In the common case where you want to create a single partition covering the "
30306 "whole disk, you should use the L</guestfs_part_disk> call:"
30310 #: ../src/guestfs.pod:245
30313 " const char *parttype = \"mbr\";\n"
30314 " if (disk_is_larger_than_2TB)\n"
30315 " parttype = \"gpt\";\n"
30316 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
30321 #: ../src/guestfs.pod:250
30323 "Obviously this effectively wipes anything that was on that disk image "
30328 #: ../src/guestfs.pod:253
30333 #: ../src/guestfs.pod:255
30335 "Libguestfs provides access to a large part of the LVM2 API, such as "
30336 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
30337 "unless you familiarize yourself with the concepts of physical volumes, "
30338 "volume groups and logical volumes."
30342 #: ../src/guestfs.pod:260
30344 "This author strongly recommends reading the LVM HOWTO, online at "
30345 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
30349 #: ../src/guestfs.pod:263
30350 msgid "DOWNLOADING"
30354 #: ../src/guestfs.pod:265
30356 "Use L</guestfs_cat> to download small, text only files. This call is "
30357 "limited to files which are less than 2 MB and which cannot contain any ASCII "
30358 "NUL (C<\\0>) characters. However the API is very simple to use."
30362 #: ../src/guestfs.pod:269
30364 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
30365 "bit data, since it returns a (pointer, size) pair. However it is still "
30366 "limited to \"small\" files, less than 2 MB."
30370 #: ../src/guestfs.pod:273
30372 "L</guestfs_download> can be used to download any file, with no limits on "
30373 "content or size (even files larger than 4 GB)."
30377 #: ../src/guestfs.pod:276
30378 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
30382 #: ../src/guestfs.pod:279
30387 #: ../src/guestfs.pod:281
30389 "It's often the case that you want to write a file or files to the disk "
30394 #: ../src/guestfs.pod:284
30396 "To write a small file with fixed content, use L</guestfs_write>. To create "
30397 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
30398 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
30399 "variety of other functions for creating test files, for example "
30400 "L</guestfs_fill> and L</guestfs_fill_pattern>."
30404 #: ../src/guestfs.pod:290
30406 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
30407 "file content or size (even files larger than 4 GB)."
30411 #: ../src/guestfs.pod:293
30412 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
30416 #: ../src/guestfs.pod:295
30418 "However the fastest way to upload I<large numbers of arbitrary files> is to "
30419 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
30420 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
30421 "the drive in a predictable way (eg. adding it last after all other drives) "
30422 "then you can get the device name from L</guestfs_list_devices> and mount it "
30423 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
30424 "sometimes non-portable between kernel versions, and they don't support "
30425 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
30426 "using a label or UUID, use an ISO image instead."
30430 #: ../src/guestfs.pod:306
30435 #: ../src/guestfs.pod:308
30437 "There are various different commands for copying between files and devices "
30438 "and in and out of the guest filesystem. These are summarised in the table "
30443 #: ../src/guestfs.pod:314
30444 msgid "B<file> to B<file>"
30448 #: ../src/guestfs.pod:316
30450 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
30451 "directories recursively."
30455 #: ../src/guestfs.pod:319
30456 msgid "B<file or device> to B<file or device>"
30460 #: ../src/guestfs.pod:321
30462 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
30463 "devices in the guest."
30467 #: ../src/guestfs.pod:324
30468 msgid "Example: duplicate the contents of an LV:"
30472 #: ../src/guestfs.pod:326
30475 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
30480 #: ../src/guestfs.pod:328
30482 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
30483 "(C</dev/VG/Original>). To copy less than the whole source device, use "
30484 "L</guestfs_copy_size>."
30488 #: ../src/guestfs.pod:332
30489 msgid "B<file on the host> to B<file or device>"
30493 #: ../src/guestfs.pod:334
30494 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
30498 #: ../src/guestfs.pod:336
30499 msgid "B<file or device> to B<file on the host>"
30503 #: ../src/guestfs.pod:338
30504 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
30508 #: ../src/guestfs.pod:342
30509 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
30513 #: ../src/guestfs.pod:344
30515 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
30516 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
30517 "appears you can only upload and download to files. However many Un*x-like "
30518 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
30519 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
30520 "stderr, and arbitrary file descriptor N."
30524 #: ../src/guestfs.pod:352
30525 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
30529 #: ../src/guestfs.pod:355
30532 " guestfs_download (g, filename, \"/dev/stdout\");\n"
30537 #: ../src/guestfs.pod:357
30538 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
30542 #: ../src/guestfs.pod:359
30545 " char devfd[64];\n"
30546 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
30547 " guestfs_tar_out (g, \"/\", devfd);\n"
30552 #: ../src/guestfs.pod:363
30553 msgid "LISTING FILES"
30557 #: ../src/guestfs.pod:365
30559 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
30560 "L<guestfish(1)>-equivalent command C<ll>)."
30564 #: ../src/guestfs.pod:368
30566 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
30567 "programs, as a flat list of strings."
30571 #: ../src/guestfs.pod:371
30573 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
30574 "directory, plus additional information about each one. It is more "
30575 "equivalent to using the L<readdir(3)> call on a local filesystem."
30579 #: ../src/guestfs.pod:375
30581 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
30586 #: ../src/guestfs.pod:378
30587 msgid "RUNNING COMMANDS"
30591 #: ../src/guestfs.pod:380
30593 "Although libguestfs is primarily an API for manipulating files inside guest "
30594 "images, we also provide some limited facilities for running commands inside "
30599 #: ../src/guestfs.pod:384
30600 msgid "There are many limitations to this:"
30604 #: ../src/guestfs.pod:390
30606 "The kernel version that the command runs under will be different from what "
30611 #: ../src/guestfs.pod:395
30613 "If the command needs to communicate with daemons, then most likely they "
30614 "won't be running."
30618 #: ../src/guestfs.pod:400
30619 msgid "The command will be running in limited memory."
30623 #: ../src/guestfs.pod:404
30625 "The network may not be available unless you enable it (see "
30626 "L</guestfs_set_network>)."
30630 #: ../src/guestfs.pod:409
30631 msgid "Only supports Linux guests (not Windows, BSD, etc)."
30635 #: ../src/guestfs.pod:413
30636 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
30640 #: ../src/guestfs.pod:418
30642 "For SELinux guests, you may need to enable SELinux and load policy first. "
30643 "See L</SELINUX> in this manpage."
30647 #: ../src/guestfs.pod:423
30649 "I<Security:> It is not safe to run commands from untrusted, possibly "
30650 "malicious guests. These commands may attempt to exploit your program by "
30651 "sending unexpected output. They could also try to exploit the Linux kernel "
30652 "or qemu provided by the libguestfs appliance. They could use the network "
30653 "provided by the libguestfs appliance to bypass ordinary network partitions "
30654 "and firewalls. They could use the elevated privileges or different SELinux "
30655 "context of your program to their advantage."
30659 #: ../src/guestfs.pod:432
30661 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
30662 "(a script which runs when the guest next boots normally), and to have this "
30663 "script run the commands you want in the normal context of the running guest, "
30664 "network security and so on. For information about other security issues, "
30665 "see L</SECURITY>."
30669 #: ../src/guestfs.pod:440
30671 "The two main API calls to run commands are L</guestfs_command> and "
30672 "L</guestfs_sh> (there are also variations)."
30676 #: ../src/guestfs.pod:443
30678 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
30679 "shell globs, redirections, etc will work."
30683 #: ../src/guestfs.pod:446
30684 msgid "CONFIGURATION FILES"
30688 #: ../src/guestfs.pod:448
30690 "To read and write configuration files in Linux guest filesystems, we "
30691 "strongly recommend using Augeas. For example, Augeas understands how to "
30692 "read and write, say, a Linux shadow password file or X.org configuration "
30693 "file, and so avoids you having to write that code."
30697 #: ../src/guestfs.pod:453
30699 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
30700 "document Augeas itself here because there is excellent documentation on the "
30701 "L<http://augeas.net/> website."
30705 #: ../src/guestfs.pod:457
30707 "If you don't want to use Augeas (you fool!) then try calling "
30708 "L</guestfs_read_lines> to get the file as a list of lines which you can "
30713 #: ../src/guestfs.pod:461
30718 #: ../src/guestfs.pod:463
30720 "We support SELinux guests. To ensure that labeling happens correctly in "
30721 "SELinux guests, you need to enable SELinux and load the guest's policy:"
30725 #: ../src/guestfs.pod:471
30726 msgid "Before launching, do:"
30730 #: ../src/guestfs.pod:473
30733 " guestfs_set_selinux (g, 1);\n"
30738 #: ../src/guestfs.pod:477
30740 "After mounting the guest's filesystem(s), load the policy. This is best "
30741 "done by running the L<load_policy(8)> command in the guest itself:"
30745 #: ../src/guestfs.pod:481
30748 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
30753 #: ../src/guestfs.pod:483
30755 "(Older versions of C<load_policy> require you to specify the name of the "
30760 #: ../src/guestfs.pod:488
30762 "Optionally, set the security context for the API. The correct security "
30763 "context to use can only be known by inspecting the guest. As an example:"
30767 #: ../src/guestfs.pod:492
30770 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
30775 #: ../src/guestfs.pod:496
30776 msgid "This will work for running commands and editing existing files."
30780 #: ../src/guestfs.pod:498
30782 "When new files are created, you may need to label them explicitly, for "
30783 "example by running the external command C<restorecon pathname>."
30787 #: ../src/guestfs.pod:502
30792 #: ../src/guestfs.pod:504
30794 "Certain calls are affected by the current file mode creation mask (the "
30795 "\"umask\"). In particular ones which create files or directories, such as "
30796 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
30797 "either the default mode that the file is created with or modifies the mode "
30802 #: ../src/guestfs.pod:510
30804 "The default umask is C<022>, so files are created with modes such as C<0644> "
30805 "and directories with C<0755>."
30809 #: ../src/guestfs.pod:513
30811 "There are two ways to avoid being affected by umask. Either set umask to 0 "
30812 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
30813 "L</guestfs_chmod> after creating each file or directory."
30817 #: ../src/guestfs.pod:517
30818 msgid "For more information about umask, see L<umask(2)>."
30822 #: ../src/guestfs.pod:521
30824 "Libguestfs allows you to access Linux guests which have been encrypted using "
30825 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
30826 "standard. This includes nearly all whole disk encryption systems used by "
30827 "modern Linux guests."
30831 #: ../src/guestfs.pod:527
30833 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
30834 "returns the string C<crypto_LUKS>)."
30838 #: ../src/guestfs.pod:530
30840 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
30841 "will require the passphrase!"
30845 #: ../src/guestfs.pod:533
30847 "Opening a LUKS device creates a new device mapper device called "
30848 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
30849 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
30850 "decrypted from and encrypted to the underlying block device respectively."
30854 #: ../src/guestfs.pod:539
30856 "LVM volume groups on the device can be made visible by calling "
30857 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
30858 "volume(s) can now be mounted in the usual way."
30862 #: ../src/guestfs.pod:543
30864 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
30865 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
30866 "[\"/dev/VG\"])>. Then close the mapper device by calling "
30867 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
30868 "underlying encrypted block device)."
30872 #: ../src/guestfs.pod:550
30877 #: ../src/guestfs.pod:552
30879 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
30880 "contains operating systems, an install CD or a live CD. (These APIs used to "
30881 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
30882 "version 1.5.3 the most frequently used part of this library has been "
30883 "rewritten in C and moved into the core code)."
30887 #: ../src/guestfs.pod:559
30889 "Add all disks belonging to the unknown virtual machine and call "
30890 "L</guestfs_launch> in the usual way."
30894 #: ../src/guestfs.pod:562
30896 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
30897 "and certain heuristics, and returns a list of operating systems that were "
30898 "found. An empty list means none were found. A single element is the root "
30899 "filesystem of the operating system. For dual- or multi-boot guests, "
30900 "multiple roots can be returned, each one corresponding to a separate "
30901 "operating system. (Multi-boot virtual machines are extremely rare in the "
30902 "world of virtualization, but since this scenario can happen, we have built "
30903 "libguestfs to deal with it.)"
30907 #: ../src/guestfs.pod:571
30909 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
30910 "to get additional details about that operating system. For example, call "
30911 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
30912 "Windows and Linux-based operating systems respectively."
30916 #: ../src/guestfs.pod:577
30918 "Un*x-like and Linux-based operating systems usually consist of several "
30919 "filesystems which are mounted at boot time (for example, a separate boot "
30920 "partition mounted on C</boot>). The inspection rules are able to detect how "
30921 "filesystems correspond to mount points. Call "
30922 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
30923 "hash table like this example:"
30927 #: ../src/guestfs.pod:584
30930 " /boot => /dev/sda1\n"
30931 " / => /dev/vg_guest/lv_root\n"
30932 " /usr => /dev/vg_guest/lv_usr\n"
30937 #: ../src/guestfs.pod:588
30939 "The caller can then make calls to L</guestfs_mount_options> to mount the "
30940 "filesystems as suggested."
30944 #: ../src/guestfs.pod:591
30946 "Be careful to mount filesystems in the right order (eg. C</> before "
30947 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
30952 #: ../src/guestfs.pod:595
30954 "Inspection currently only works for some common operating systems. "
30955 "Contributors are welcome to send patches for other operating systems that we "
30956 "currently cannot detect."
30960 #: ../src/guestfs.pod:599
30962 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
30963 "for more details. The L</guestfs_inspect_os> function just ignores any "
30964 "encrypted devices."
30968 #: ../src/guestfs.pod:603
30970 "A note on the implementation: The call L</guestfs_inspect_os> performs "
30971 "inspection and caches the results in the guest handle. Subsequent calls to "
30972 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
30973 "re-read the disks. If you change the content of the guest disks, you can "
30974 "redo inspection by calling L</guestfs_inspect_os> again. "
30975 "(L</guestfs_inspect_list_applications> works a little differently from the "
30976 "other calls and does read the disks. See documentation for that function "
30981 #: ../src/guestfs.pod:612
30982 msgid "INSPECTING INSTALL DISKS"
30986 #: ../src/guestfs.pod:614
30988 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
30993 #: ../src/guestfs.pod:617
30995 "Call L</guestfs_inspect_get_format> to return the format of the operating "
30996 "system, which currently can be C<installed> (a regular operating system) or "
30997 "C<installer> (some sort of install disk)."
31001 #: ../src/guestfs.pod:621
31003 "Further information is available about the operating system that can be "
31004 "installed using the regular inspection APIs like "
31005 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
31010 #: ../src/guestfs.pod:626
31012 "Some additional information specific to installer disks is also available "
31013 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
31014 "L</guestfs_inspect_is_multipart> calls."
31018 #: ../src/guestfs.pod:631
31019 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
31023 #: ../src/guestfs.pod:633
31025 "Libguestfs can mount NTFS partitions. It does this using the "
31026 "L<http://www.ntfs-3g.org/> driver."
31030 #: ../src/guestfs.pod:636
31031 msgid "DRIVE LETTERS AND PATHS"
31035 #: ../src/guestfs.pod:638
31037 "DOS and Windows still use drive letters, and the filesystems are always "
31038 "treated as case insensitive by Windows itself, and therefore you might find "
31039 "a Windows configuration file referring to a path like "
31040 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
31041 "that directory might be referred to as C</WINDOWS/System32>."
31045 #: ../src/guestfs.pod:644
31047 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
31048 "L</guestfs_inspect_get_drive_mappings>)"
31052 #: ../src/guestfs.pod:647
31054 "Dealing with separator characters (backslash vs forward slash) is outside "
31055 "the scope of libguestfs, but usually a simple character replacement will "
31060 #: ../src/guestfs.pod:651
31062 "To resolve the case insensitivity of paths, call "
31063 "L</guestfs_case_sensitive_path>."
31067 #: ../src/guestfs.pod:654
31068 msgid "ACCESSING THE WINDOWS REGISTRY"
31072 #: ../src/guestfs.pod:656
31074 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
31075 "files, through the library C<hivex> which is part of the libguestfs project "
31076 "although ships as a separate tarball. You have to locate and download the "
31077 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
31078 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
31079 "L<virt-win-reg(1)> for more help on this issue."
31083 #: ../src/guestfs.pod:664
31084 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
31088 #: ../src/guestfs.pod:666
31090 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
31091 "provide something which looks like a Linux symlink. The way it tries to do "
31092 "the rewriting is described here:"
31096 #: ../src/guestfs.pod:670
31097 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
31101 #: ../src/guestfs.pod:672
31103 "The essential problem is that ntfs-3g simply does not have enough "
31104 "information to do a correct job. NTFS links can contain drive letters and "
31105 "references to external device GUIDs that ntfs-3g has no way of resolving. "
31106 "It is almost certainly the case that libguestfs callers should ignore what "
31107 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
31111 #: ../src/guestfs.pod:679
31113 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
31114 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
31115 "attribute, and read the raw reparse data from that (you can find the format "
31116 "documented in various places around the web)."
31120 #: ../src/guestfs.pod:684
31121 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
31125 #: ../src/guestfs.pod:686
31127 "There are other useful extended attributes that can be read from ntfs-3g "
31128 "filesystems (using L</guestfs_getxattr>). See:"
31132 #: ../src/guestfs.pod:689
31133 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
31137 #: ../src/guestfs.pod:691
31138 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
31142 #: ../src/guestfs.pod:693
31144 "Although we don't want to discourage you from using the C API, we will "
31145 "mention here that the same API is also available in other languages."
31149 #: ../src/guestfs.pod:696
31151 "The API is broadly identical in all supported languages. This means that "
31152 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
31153 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
31154 "OCaml. In other words, a straightforward, predictable isomorphism between "
31159 #: ../src/guestfs.pod:702
31161 "Error messages are automatically transformed into exceptions if the language "
31166 #: ../src/guestfs.pod:705
31168 "We don't try to \"object orientify\" parts of the API in OO languages, "
31169 "although contributors are welcome to write higher level APIs above what we "
31170 "provide in their favourite languages if they wish."
31174 #: ../src/guestfs.pod:711
31179 #: ../src/guestfs.pod:713
31181 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
31182 "identical to the C API. C++ classes and exceptions are not used."
31186 #: ../src/guestfs.pod:717
31191 #: ../src/guestfs.pod:719
31193 "The C# bindings are highly experimental. Please read the warnings at the "
31194 "top of C<csharp/Libguestfs.cs>."
31198 #: ../src/guestfs.pod:722
31203 #: ../src/guestfs.pod:724
31205 "This is the only language binding that is working but incomplete. Only "
31206 "calls which return simple integers have been bound in Haskell, and we are "
31207 "looking for help to complete this binding."
31211 #: ../src/guestfs.pod:728
31216 #: ../src/guestfs.pod:730
31218 "Full documentation is contained in the Javadoc which is distributed with "
31219 "libguestfs. For examples, see L<guestfs-java(3)>."
31223 #: ../src/guestfs.pod:733
31228 #: ../src/guestfs.pod:735
31229 msgid "See L<guestfs-ocaml(3)>."
31233 #: ../src/guestfs.pod:737
31238 #: ../src/guestfs.pod:739
31239 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
31243 #: ../src/guestfs.pod:741
31248 #: ../src/guestfs.pod:743
31250 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
31251 "the php-libguestfs package for your distribution."
31255 #: ../src/guestfs.pod:746
31256 msgid "The PHP binding only works correctly on 64 bit machines."
31260 #: ../src/guestfs.pod:748
31265 #: ../src/guestfs.pod:750
31266 msgid "See L<guestfs-python(3)>."
31270 #: ../src/guestfs.pod:752
31275 #: ../src/guestfs.pod:754
31276 msgid "See L<guestfs-ruby(3)>."
31280 #: ../src/guestfs.pod:756
31281 msgid "B<shell scripts>"
31285 #: ../src/guestfs.pod:758
31286 msgid "See L<guestfish(1)>."
31290 #: ../src/guestfs.pod:762
31291 msgid "LIBGUESTFS GOTCHAS"
31295 #: ../src/guestfs.pod:764
31297 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
31298 "system [...] that works in the way it is documented but is counterintuitive "
31299 "and almost invites mistakes.\""
31303 #: ../src/guestfs.pod:768
31305 "Since we developed libguestfs and the associated tools, there are several "
31306 "things we would have designed differently, but are now stuck with for "
31307 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
31308 "release, you can expect these to change. Beware of them."
31312 #: ../src/guestfs.pod:776
31313 msgid "Autosync / forgetting to sync."
31317 #: ../src/guestfs.pod:778
31319 "I<Update:> Autosync is enabled by default for all API users starting from "
31320 "libguestfs 1.5.24. This section only applies to older versions."
31324 #: ../src/guestfs.pod:781
31326 "When modifying a filesystem from C or another language, you B<must> unmount "
31327 "all filesystems and call L</guestfs_sync> explicitly before you close the "
31328 "libguestfs handle. You can also call:"
31332 #: ../src/guestfs.pod:785
31335 " guestfs_set_autosync (g, 1);\n"
31340 #: ../src/guestfs.pod:787
31342 "to have the unmount/sync done automatically for you when the handle 'g' is "
31343 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
31348 #: ../src/guestfs.pod:791
31350 "If you forget to do this, then it is entirely possible that your changes "
31351 "won't be written out, or will be partially written, or (very rarely) that "
31352 "you'll get disk corruption."
31356 #: ../src/guestfs.pod:795
31358 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
31359 "guestfish scripts that forget to sync will work just fine, which can make "
31360 "this very puzzling if you are trying to debug a problem."
31364 #: ../src/guestfs.pod:799
31365 msgid "Mount option C<-o sync> should not be the default."
31369 #: ../src/guestfs.pod:801
31371 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
31372 "However C<-o sync> does not add any reliability benefit, but does have a "
31373 "very large performance impact."
31377 #: ../src/guestfs.pod:805
31379 "The work around is to use L</guestfs_mount_options> and set the mount "
31380 "options that you actually want to use."
31384 #: ../src/guestfs.pod:808
31385 msgid "Read-only should be the default."
31389 #: ../src/guestfs.pod:810
31391 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
31392 "specify I<--rw> if you want to make changes to the image."
31396 #: ../src/guestfs.pod:813
31397 msgid "This would reduce the potential to corrupt live VM images."
31401 #: ../src/guestfs.pod:815
31403 "Note that many filesystems change the disk when you just mount and unmount, "
31404 "even if you didn't perform any writes. You need to use "
31405 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
31409 #: ../src/guestfs.pod:819
31410 msgid "guestfish command line is hard to use."
31414 #: ../src/guestfs.pod:821
31416 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
31417 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
31418 "exist, so it fails. In earlier versions of guestfish the error message was "
31419 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
31420 "we should have used C<guestfish -c command> to run commands."
31424 #: ../src/guestfs.pod:828
31425 msgid "guestfish megabyte modifiers don't work right on all commands"
31429 #: ../src/guestfs.pod:830
31431 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
31432 "other modifiers). What guestfish actually does is to multiply the number "
31433 "part by the modifier part and pass the result to the C API. However this "
31434 "doesn't work for a few APIs which aren't expecting bytes, but are already "
31435 "expecting some other unit (eg. megabytes)."
31439 #: ../src/guestfs.pod:837
31440 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
31444 #: ../src/guestfs.pod:839
31447 " lvcreate LV VG 100M\n"
31452 #: ../src/guestfs.pod:841
31454 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
31455 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
31456 "megabytes * megabytes) logical volume. The error message you get from this "
31457 "is also a little obscure."
31461 #: ../src/guestfs.pod:846
31463 "This could be fixed in the generator by specially marking parameters and "
31464 "return values which take bytes or other units."
31468 #: ../src/guestfs.pod:849
31469 msgid "Ambiguity between devices and paths"
31473 #: ../src/guestfs.pod:851
31475 "There is a subtle ambiguity in the API between a device name "
31476 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
31477 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
31481 #: ../src/guestfs.pod:856
31483 "In the current API we usually resolve this ambiguity by having two separate "
31484 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
31485 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
31486 "detecting if the path supplied begins with C</dev/>."
31490 #: ../src/guestfs.pod:862
31492 "To avoid both the ambiguity and the need to duplicate some calls, we could "
31493 "make paths/devices into structured names. One way to do this would be to "
31494 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
31495 "aspect of grub. Another way would be to use a structured type, equivalent "
31496 "to this OCaml type:"
31500 #: ../src/guestfs.pod:868
31503 " type path = Path of string | Device of int | Partition of int * int\n"
31508 #: ../src/guestfs.pod:870
31509 msgid "which would allow you to pass arguments like:"
31513 #: ../src/guestfs.pod:872
31516 " Path \"/foo/bar\"\n"
31517 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
31518 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
31519 " Path \"/dev/sdb2\" (* not a device *)\n"
31524 #: ../src/guestfs.pod:877
31526 "As you can see there are still problems to resolve even with this "
31527 "representation. Also consider how it might work in guestfish."
31531 #: ../src/guestfs.pod:882
31532 msgid "KEYS AND PASSPHRASES"
31536 #: ../src/guestfs.pod:884
31538 "Certain libguestfs calls take a parameter that contains sensitive key "
31539 "material, passed in as a C string."
31543 #: ../src/guestfs.pod:887
31545 "In the future we would hope to change the libguestfs implementation so that "
31546 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
31547 "swap. However this is I<not> done at the moment, because of the complexity "
31548 "of such an implementation."
31552 #: ../src/guestfs.pod:892
31554 "Therefore you should be aware that any key parameter you pass to libguestfs "
31555 "might end up being written out to the swap partition. If this is a concern, "
31556 "scrub the swap partition or don't use libguestfs on encrypted devices."
31560 #: ../src/guestfs.pod:897
31561 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
31565 #: ../src/guestfs.pod:899
31567 "All high-level libguestfs actions are synchronous. If you want to use "
31568 "libguestfs asynchronously then you must create a thread."
31572 #: ../src/guestfs.pod:902
31574 "Only use the handle from a single thread. Either use the handle exclusively "
31575 "from one thread, or provide your own mutex so that two threads cannot issue "
31576 "calls on the same handle at the same time."
31580 #: ../src/guestfs.pod:906
31582 "See the graphical program guestfs-browser for one possible architecture for "
31583 "multithreaded programs using libvirt and libguestfs."
31587 #: ../src/guestfs.pod:909
31592 #: ../src/guestfs.pod:911
31594 "Libguestfs needs a supermin appliance, which it finds by looking along an "
31599 #: ../src/guestfs.pod:914
31601 "By default it looks for these in the directory C<$libdir/guestfs> "
31602 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
31606 #: ../src/guestfs.pod:917
31608 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
31609 "to change the directories that libguestfs will search in. The value is a "
31610 "colon-separated list of paths. The current directory is I<not> searched "
31611 "unless the path contains an empty element or C<.>. For example "
31612 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
31613 "then C</usr/lib/guestfs>."
31617 #: ../src/guestfs.pod:924
31618 msgid "QEMU WRAPPERS"
31622 #: ../src/guestfs.pod:926
31624 "If you want to compile your own qemu, run qemu from a non-standard location, "
31625 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
31630 #: ../src/guestfs.pod:930
31632 "There is one important rule to remember: you I<must C<exec qemu>> as the "
31633 "last command in the shell script (so that qemu replaces the shell and "
31634 "becomes the direct child of the libguestfs-using program). If you don't do "
31635 "this, then the qemu process won't be cleaned up correctly."
31639 #: ../src/guestfs.pod:935
31641 "Here is an example of a wrapper, where I have built my own copy of qemu from "
31646 #: ../src/guestfs.pod:938
31650 " qemudir=/home/rjones/d/qemu\n"
31651 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
31657 #: ../src/guestfs.pod:942
31659 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
31660 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
31665 #: ../src/guestfs.pod:946
31668 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
31673 #: ../src/guestfs.pod:948
31675 "Note that libguestfs also calls qemu with the -help and -version options in "
31676 "order to determine features."
31680 #: ../src/guestfs.pod:951
31681 msgid "ATTACHING TO RUNNING DAEMONS"
31685 #: ../src/guestfs.pod:953
31687 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
31688 "babies. Use with caution."
31692 #: ../src/guestfs.pod:956
31694 "I<Note (2):> This section explains how to attach to a running daemon from a "
31695 "low level perspective. For most users, simply using virt tools such as "
31696 "L<guestfish(1)> with the I<--live> option will \"just work\"."
31700 #: ../src/guestfs.pod:960
31701 msgid "Using guestfs_set_attach_method"
31705 #: ../src/guestfs.pod:962
31707 "By calling L</guestfs_set_attach_method> you can change how the library "
31708 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
31709 "L</ARCHITECTURE> for some background)."
31713 #: ../src/guestfs.pod:966
31715 "The normal attach method is C<appliance>, where a small appliance is created "
31716 "containing the daemon, and then the library connects to this."
31720 #: ../src/guestfs.pod:969
31722 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
31723 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
31724 "daemon over the Unix domain socket."
31728 #: ../src/guestfs.pod:973
31730 "The normal use for this is to connect to a running virtual machine that "
31731 "contains a C<guestfsd> daemon, and send commands so you can read and write "
31732 "files inside the live virtual machine."
31736 #: ../src/guestfs.pod:977
31737 msgid "Using guestfs_add_domain with live flag"
31741 #: ../src/guestfs.pod:979
31743 "L</guestfs_add_domain> provides some help for getting the correct attach "
31744 "method. If you pass the C<live> option to this function, then (if the "
31745 "virtual machine is running) it will examine the libvirt XML looking for a "
31746 "virtio-serial channel to connect to:"
31750 #: ../src/guestfs.pod:985
31757 " <channel type='unix'>\n"
31758 " <source mode='bind' path='/path/to/socket'/>\n"
31759 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
31768 #: ../src/guestfs.pod:997
31770 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
31771 "method to C<unix:/path/to/socket>."
31775 #: ../src/guestfs.pod:1000
31777 "Some of the libguestfs tools (including guestfish) support a I<--live> "
31778 "option which is passed through to L</guestfs_add_domain> thus allowing you "
31779 "to attach to and modify live virtual machines."
31783 #: ../src/guestfs.pod:1004
31785 "The virtual machine needs to have been set up beforehand so that it has the "
31786 "virtio-serial channel and so that guestfsd is running inside it."
31790 #: ../src/guestfs.pod:1008
31791 msgid "ABI GUARANTEE"
31795 #: ../src/guestfs.pod:1010
31797 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
31798 "actions as outlined in this section. Although we will deprecate some "
31799 "actions, for example if they get replaced by newer calls, we will keep the "
31800 "old actions forever. This allows you the developer to program in confidence "
31801 "against the libguestfs API."
31805 #: ../src/guestfs.pod:1016
31806 msgid "BLOCK DEVICE NAMING"
31810 #: ../src/guestfs.pod:1018
31812 "In the kernel there is now quite a profusion of schemata for naming block "
31813 "devices (in this context, by I<block device> I mean a physical or virtual "
31814 "hard drive). The original Linux IDE driver used names starting with "
31815 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
31816 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
31817 "replacement for the old IDE driver (particularly for SATA devices) those "
31818 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
31819 "machines with paravirtualized drivers. This has created several different "
31820 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
31825 #: ../src/guestfs.pod:1030
31827 "As discussed above, libguestfs uses a qemu appliance running an embedded "
31828 "Linux kernel to access block devices. We can run a variety of appliances "
31829 "based on a variety of Linux kernels."
31833 #: ../src/guestfs.pod:1034
31835 "This causes a problem for libguestfs because many API calls use device or "
31836 "partition names. Working scripts and the recipe (example) scripts that we "
31837 "make available over the internet could fail if the naming scheme changes."
31841 #: ../src/guestfs.pod:1039
31843 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
31844 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
31845 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
31846 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
31850 #: ../src/guestfs.pod:1045
31852 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
31853 "L</guestfs_list_partitions> and similar calls return the true names of the "
31854 "devices and partitions as known to the appliance."
31858 #: ../src/guestfs.pod:1050
31859 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
31863 #: ../src/guestfs.pod:1052
31865 "Usually this translation is transparent. However in some (very rare) cases "
31866 "you may need to know the exact algorithm. Such cases include where you use "
31867 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
31868 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
31873 #: ../src/guestfs.pod:1058
31875 "The algorithm is applied only to I<parameters> which are known to be either "
31876 "device or partition names. Return values from functions such as "
31877 "L</guestfs_list_devices> are never changed."
31881 #: ../src/guestfs.pod:1066
31882 msgid "Is the string a parameter which is a device or partition name?"
31886 #: ../src/guestfs.pod:1070
31887 msgid "Does the string begin with C</dev/sd>?"
31891 #: ../src/guestfs.pod:1074
31893 "Does the named device exist? If so, we use that device. However if I<not> "
31894 "then we continue with this algorithm."
31898 #: ../src/guestfs.pod:1079
31899 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
31903 #: ../src/guestfs.pod:1081
31904 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
31908 #: ../src/guestfs.pod:1083
31909 msgid "If that named device exists, use it. If not, continue."
31913 #: ../src/guestfs.pod:1087
31914 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
31918 #: ../src/guestfs.pod:1089
31919 msgid "If that named device exists, use it. If not, return an error."
31923 #: ../src/guestfs.pod:1093
31924 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
31928 #: ../src/guestfs.pod:1095
31930 "Although the standard naming scheme and automatic translation is useful for "
31931 "simple programs and guestfish scripts, for larger programs it is best not to "
31932 "rely on this mechanism."
31936 #: ../src/guestfs.pod:1099
31938 "Where possible for maximum future portability programs using libguestfs "
31939 "should use these future-proof techniques:"
31943 #: ../src/guestfs.pod:1106
31945 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
31946 "device names, and then use those names directly."
31950 #: ../src/guestfs.pod:1109
31951 msgid "Since those device names exist by definition, they will never be translated."
31955 #: ../src/guestfs.pod:1114
31957 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
31958 "filesystem labels."
31962 #: ../src/guestfs.pod:1119
31967 #: ../src/guestfs.pod:1121
31969 "This section discusses security implications of using libguestfs, "
31970 "particularly with untrusted or malicious guests or disk images."
31974 #: ../src/guestfs.pod:1124
31975 msgid "GENERAL SECURITY CONSIDERATIONS"
31979 #: ../src/guestfs.pod:1126
31981 "Be careful with any files or data that you download from a guest (by "
31982 "\"download\" we mean not just the L</guestfs_download> command but any "
31983 "command that reads files, filenames, directories or anything else from a "
31984 "disk image). An attacker could manipulate the data to fool your program "
31985 "into doing the wrong thing. Consider cases such as:"
31989 #: ../src/guestfs.pod:1136
31990 msgid "the data (file etc) not being present"
31994 #: ../src/guestfs.pod:1140
31995 msgid "being present but empty"
31999 #: ../src/guestfs.pod:1144
32000 msgid "being much larger than normal"
32004 #: ../src/guestfs.pod:1148
32005 msgid "containing arbitrary 8 bit data"
32009 #: ../src/guestfs.pod:1152
32010 msgid "being in an unexpected character encoding"
32014 #: ../src/guestfs.pod:1156
32015 msgid "containing homoglyphs."
32019 #: ../src/guestfs.pod:1160
32020 msgid "SECURITY OF MOUNTING FILESYSTEMS"
32024 #: ../src/guestfs.pod:1162
32026 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
32027 "(VFS) module can sometimes be escalated into exploits by deliberately "
32028 "creating a malicious, malformed filesystem. These exploits are very severe "
32029 "for two reasons. Firstly there are very many filesystem drivers in the "
32030 "kernel, and many of them are infrequently used and not much developer "
32031 "attention has been paid to the code. Linux userspace helps potential "
32032 "crackers by detecting the filesystem type and automatically choosing the "
32033 "right VFS driver, even if that filesystem type is obscure or unexpected for "
32034 "the administrator. Secondly, a kernel-level exploit is like a local root "
32035 "exploit (worse in some ways), giving immediate and total access to the "
32036 "system right down to the hardware level."
32040 #: ../src/guestfs.pod:1175
32042 "That explains why you should never mount a filesystem from an untrusted "
32043 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
32044 "inside a qemu virtual machine, usually running as a non-root user. The "
32045 "attacker would need to write a filesystem which first exploited the kernel, "
32046 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
32047 "the libguestfs protocol, and finally to be as serious as the host kernel "
32048 "exploit it would need to escalate its privileges to root. This multi-step "
32049 "escalation, performed by a static piece of data, is thought to be extremely "
32050 "hard to do, although we never say 'never' about security issues."
32054 #: ../src/guestfs.pod:1186
32056 "In any case callers can reduce the attack surface by forcing the filesystem "
32057 "type when mounting (use L</guestfs_mount_vfs>)."
32061 #: ../src/guestfs.pod:1189
32062 msgid "PROTOCOL SECURITY"
32066 #: ../src/guestfs.pod:1191
32068 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
32069 "defined upper message size. However a program that uses libguestfs must "
32070 "also take care - for example you can write a program that downloads a binary "
32071 "from a disk image and executes it locally, and no amount of protocol "
32072 "security will save you from the consequences."
32076 #: ../src/guestfs.pod:1197
32077 msgid "INSPECTION SECURITY"
32081 #: ../src/guestfs.pod:1199
32083 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
32084 "directly from the guest, and these could contain any 8 bit data. Callers "
32085 "should be careful to escape these before printing them to a structured file "
32086 "(for example, use HTML escaping if creating a web page)."
32090 #: ../src/guestfs.pod:1205
32092 "Guest configuration may be altered in unusual ways by the administrator of "
32093 "the virtual machine, and may not reflect reality (particularly for untrusted "
32094 "or actively malicious guests). For example we parse the hostname from "
32095 "configuration files like C</etc/sysconfig/network> that we find in the "
32096 "guest, but the guest administrator can easily manipulate these files to "
32097 "provide the wrong hostname."
32101 #: ../src/guestfs.pod:1213
32103 "The inspection API parses guest configuration using two external libraries: "
32104 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
32105 "designed to be robust in the face of malicious data, although denial of "
32106 "service attacks are still possible, for example with oversized configuration "
32111 #: ../src/guestfs.pod:1219
32112 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
32116 #: ../src/guestfs.pod:1221
32118 "Be very cautious about running commands from the guest. By running a "
32119 "command in the guest, you are giving CPU time to a binary that you do not "
32120 "control, under the same user account as the library, albeit wrapped in qemu "
32121 "virtualization. More information and alternatives can be found in the "
32122 "section L</RUNNING COMMANDS>."
32126 #: ../src/guestfs.pod:1227
32127 msgid "CVE-2010-3851"
32131 #: ../src/guestfs.pod:1229
32132 msgid "https://bugzilla.redhat.com/642934"
32136 #: ../src/guestfs.pod:1231
32138 "This security bug concerns the automatic disk format detection that qemu "
32139 "does on disk images."
32143 #: ../src/guestfs.pod:1234
32145 "A raw disk image is just the raw bytes, there is no header. Other disk "
32146 "images like qcow2 contain a special header. Qemu deals with this by looking "
32147 "for one of the known headers, and if none is found then assuming the disk "
32148 "image must be raw."
32152 #: ../src/guestfs.pod:1239
32154 "This allows a guest which has been given a raw disk image to write some "
32155 "other header. At next boot (or when the disk image is accessed by "
32156 "libguestfs) qemu would do autodetection and think the disk image format was, "
32157 "say, qcow2 based on the header written by the guest."
32161 #: ../src/guestfs.pod:1244
32163 "This in itself would not be a problem, but qcow2 offers many features, one "
32164 "of which is to allow a disk image to refer to another image (called the "
32165 "\"backing disk\"). It does this by placing the path to the backing disk "
32166 "into the qcow2 header. This path is not validated and could point to any "
32167 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
32168 "\"holes\" in the qcow2 disk image, which of course is completely under the "
32169 "control of the attacker."
32173 #: ../src/guestfs.pod:1252
32174 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
32178 #: ../src/guestfs.pod:1259
32179 msgid "You have enabled the network or have opened the disk in write mode."
32183 #: ../src/guestfs.pod:1263
32185 "You are also running untrusted code from the guest (see L</RUNNING "
32190 #: ../src/guestfs.pod:1268
32192 "The way to avoid this is to specify the expected disk format when adding "
32193 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
32194 "should always do this if the disk is raw format, and it's a good idea for "
32199 #: ../src/guestfs.pod:1273
32201 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
32202 "format is fetched from libvirt and passed through."
32206 #: ../src/guestfs.pod:1276
32208 "For libguestfs tools, use the I<--format> command line parameter as "
32213 #: ../src/guestfs.pod:1279
32214 msgid "CONNECTION MANAGEMENT"
32218 #: ../src/guestfs.pod:1281
32219 msgid "guestfs_h *"
32223 #: ../src/guestfs.pod:1283
32225 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
32226 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
32227 "handle and release all resources used."
32231 #: ../src/guestfs.pod:1287
32233 "For information on using multiple handles and threads, see the section "
32234 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
32238 #: ../src/guestfs.pod:1290
32239 msgid "guestfs_create"
32243 #: ../src/guestfs.pod:1292
32246 " guestfs_h *guestfs_create (void);\n"
32251 #: ../src/guestfs.pod:1294
32252 msgid "Create a connection handle."
32256 #: ../src/guestfs.pod:1296
32258 "On success this returns a non-NULL pointer to a handle. On error it returns "
32263 #: ../src/guestfs.pod:1299
32265 "You have to \"configure\" the handle after creating it. This includes "
32266 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
32267 "handle at least once."
32271 #: ../src/guestfs.pod:1303
32272 msgid "After configuring the handle, you have to call L</guestfs_launch>."
32276 #: ../src/guestfs.pod:1305
32278 "You may also want to configure error handling for the handle. See the "
32279 "L</ERROR HANDLING> section below."
32283 #: ../src/guestfs.pod:1308
32284 msgid "guestfs_close"
32288 #: ../src/guestfs.pod:1310
32291 " void guestfs_close (guestfs_h *g);\n"
32296 #: ../src/guestfs.pod:1312
32297 msgid "This closes the connection handle and frees up all resources used."
32301 #: ../src/guestfs.pod:1314
32303 "If autosync was set on the handle and the handle was launched, then this "
32304 "implicitly calls various functions to unmount filesystems and sync the "
32305 "disk. See L</guestfs_set_autosync> for more details."
32309 #: ../src/guestfs.pod:1318
32310 msgid "If a close callback was set on the handle, then it is called."
32314 #: ../src/guestfs.pod:1320
32315 msgid "ERROR HANDLING"
32319 #: ../src/guestfs.pod:1322
32321 "API functions can return errors. For example, almost all functions that "
32322 "return C<int> will return C<-1> to indicate an error."
32326 #: ../src/guestfs.pod:1325
32328 "Additional information is available for errors: an error message string and "
32329 "optionally an error number (errno) if the thing that failed was a system "
32334 #: ../src/guestfs.pod:1329
32336 "You can get at the additional information about the last error on the handle "
32337 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
32338 "up an error handler with L</guestfs_set_error_handler>."
32342 #: ../src/guestfs.pod:1334
32344 "When the handle is created, a default error handler is installed which "
32345 "prints the error message string to C<stderr>. For small short-running "
32346 "command line programs it is sufficient to do:"
32350 #: ../src/guestfs.pod:1338
32353 " if (guestfs_launch (g) == -1)\n"
32354 " exit (EXIT_FAILURE);\n"
32359 #: ../src/guestfs.pod:1341
32361 "since the default error handler will ensure that an error message has been "
32362 "printed to C<stderr> before the program exits."
32366 #: ../src/guestfs.pod:1344
32368 "For other programs the caller will almost certainly want to install an "
32369 "alternate error handler or do error handling in-line like this:"
32373 #: ../src/guestfs.pod:1347
32376 " g = guestfs_create ();\n"
32381 #: ../src/guestfs.pod:1349
32384 " /* This disables the default behaviour of printing errors\n"
32386 " guestfs_set_error_handler (g, NULL, NULL);\n"
32391 #: ../src/guestfs.pod:1353
32394 " if (guestfs_launch (g) == -1) {\n"
32395 " /* Examine the error message and print it etc. */\n"
32396 " char *msg = guestfs_last_error (g);\n"
32397 " int errnum = guestfs_last_errno (g);\n"
32398 " fprintf (stderr, \"%s\\n\", msg);\n"
32405 #: ../src/guestfs.pod:1361
32407 "Out of memory errors are handled differently. The default action is to call "
32408 "L<abort(3)>. If this is undesirable, then you can set a handler using "
32409 "L</guestfs_set_out_of_memory_handler>."
32413 #: ../src/guestfs.pod:1365
32415 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
32416 "because there is no handle if this happens there is no way to get additional "
32417 "error information. However L</guestfs_create> is supposed to be a "
32418 "lightweight operation which can only fail because of insufficient memory (it "
32419 "returns NULL in this case)."
32423 #: ../src/guestfs.pod:1371
32424 msgid "guestfs_last_error"
32428 #: ../src/guestfs.pod:1373
32431 " const char *guestfs_last_error (guestfs_h *g);\n"
32436 #: ../src/guestfs.pod:1375
32438 "This returns the last error message that happened on C<g>. If there has not "
32439 "been an error since the handle was created, then this returns C<NULL>."
32443 #: ../src/guestfs.pod:1379
32445 "The lifetime of the returned string is until the next error occurs, or "
32446 "L</guestfs_close> is called."
32450 #: ../src/guestfs.pod:1382
32451 msgid "guestfs_last_errno"
32455 #: ../src/guestfs.pod:1384
32458 " int guestfs_last_errno (guestfs_h *g);\n"
32463 #: ../src/guestfs.pod:1386
32464 msgid "This returns the last error number (errno) that happened on C<g>."
32468 #: ../src/guestfs.pod:1388
32469 msgid "If successful, an errno integer not equal to zero is returned."
32473 #: ../src/guestfs.pod:1390
32474 msgid "If no error, this returns 0. This call can return 0 in three situations:"
32478 #: ../src/guestfs.pod:1397
32479 msgid "There has not been any error on the handle."
32483 #: ../src/guestfs.pod:1401
32485 "There has been an error but the errno was meaningless. This corresponds to "
32486 "the case where the error did not come from a failed system call, but for "
32487 "some other reason."
32491 #: ../src/guestfs.pod:1407
32493 "There was an error from a failed system call, but for some reason the errno "
32494 "was not captured and returned. This usually indicates a bug in libguestfs."
32498 #: ../src/guestfs.pod:1413
32500 "Libguestfs tries to convert the errno from inside the applicance into a "
32501 "corresponding errno for the caller (not entirely trivial: the appliance "
32502 "might be running a completely different operating system from the library "
32503 "and error numbers are not standardized across Un*xen). If this could not be "
32504 "done, then the error is translated to C<EINVAL>. In practice this should "
32505 "only happen in very rare circumstances."
32509 #: ../src/guestfs.pod:1421
32510 msgid "guestfs_set_error_handler"
32514 #: ../src/guestfs.pod:1423
32517 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
32519 " const char *msg);\n"
32520 " void guestfs_set_error_handler (guestfs_h *g,\n"
32521 " guestfs_error_handler_cb cb,\n"
32522 " void *opaque);\n"
32527 #: ../src/guestfs.pod:1430
32529 "The callback C<cb> will be called if there is an error. The parameters "
32530 "passed to the callback are an opaque data pointer and the error message "
32535 #: ../src/guestfs.pod:1434
32537 "C<errno> is not passed to the callback. To get that the callback must call "
32538 "L</guestfs_last_errno>."
32542 #: ../src/guestfs.pod:1437
32544 "Note that the message string C<msg> is freed as soon as the callback "
32545 "function returns, so if you want to stash it somewhere you must make your "
32550 #: ../src/guestfs.pod:1441
32551 msgid "The default handler prints messages on C<stderr>."
32555 #: ../src/guestfs.pod:1443
32556 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
32560 #: ../src/guestfs.pod:1445
32561 msgid "guestfs_get_error_handler"
32565 #: ../src/guestfs.pod:1447
32568 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
32569 " void **opaque_rtn);\n"
32574 #: ../src/guestfs.pod:1450
32575 msgid "Returns the current error handler callback."
32579 #: ../src/guestfs.pod:1452
32580 msgid "guestfs_set_out_of_memory_handler"
32584 #: ../src/guestfs.pod:1454
32587 " typedef void (*guestfs_abort_cb) (void);\n"
32588 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
32589 " guestfs_abort_cb);\n"
32594 #: ../src/guestfs.pod:1458
32596 "The callback C<cb> will be called if there is an out of memory situation. "
32597 "I<Note this callback must not return>."
32601 #: ../src/guestfs.pod:1461
32602 msgid "The default is to call L<abort(3)>."
32606 #: ../src/guestfs.pod:1463
32607 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
32611 #: ../src/guestfs.pod:1466
32612 msgid "guestfs_get_out_of_memory_handler"
32616 #: ../src/guestfs.pod:1468
32619 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
32624 #: ../src/guestfs.pod:1470
32625 msgid "This returns the current out of memory handler."
32629 #: ../src/guestfs.pod:1472
32634 #: ../src/guestfs.pod:1476
32639 #: ../src/guestfs.pod:1478
32644 #: ../src/guestfs.pod:1480
32645 msgid "AVAILABILITY"
32649 #: ../src/guestfs.pod:1482
32650 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
32654 #: ../src/guestfs.pod:1484
32656 "Using L</guestfs_available> you can test availability of the following "
32657 "groups of functions. This test queries the appliance to see if the "
32658 "appliance you are currently using supports the functionality."
32662 #: ../src/guestfs.pod:1489
32663 msgid "@AVAILABILITY@"
32667 #: ../src/guestfs.pod:1491
32668 msgid "GUESTFISH supported COMMAND"
32672 #: ../src/guestfs.pod:1493
32674 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
32675 "prints out the available groups and whether they are supported by this build "
32676 "of libguestfs. Note however that you have to do C<run> first."
32680 #: ../src/guestfs.pod:1498
32681 msgid "SINGLE CALLS AT COMPILE TIME"
32685 #: ../src/guestfs.pod:1500
32687 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
32688 "function, such as:"
32692 #: ../src/guestfs.pod:1503
32695 " #define LIBGUESTFS_HAVE_DD 1\n"
32700 #: ../src/guestfs.pod:1505
32701 msgid "if L</guestfs_dd> is available."
32705 #: ../src/guestfs.pod:1507
32707 "Before version 1.5.8, if you needed to test whether a single libguestfs "
32708 "function is available at compile time, we recommended using build tools such "
32709 "as autoconf or cmake. For example in autotools you could use:"
32713 #: ../src/guestfs.pod:1512
32716 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
32717 " AC_CHECK_FUNCS([guestfs_dd])\n"
32722 #: ../src/guestfs.pod:1515
32724 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
32729 #: ../src/guestfs.pod:1518
32730 msgid "SINGLE CALLS AT RUN TIME"
32734 #: ../src/guestfs.pod:1520
32736 "Testing at compile time doesn't guarantee that a function really exists in "
32737 "the library. The reason is that you might be dynamically linked against a "
32738 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
32739 "This situation unfortunately results in a segmentation fault, which is a "
32740 "shortcoming of the C dynamic linking system itself."
32744 #: ../src/guestfs.pod:1527
32746 "You can use L<dlopen(3)> to test if a function is available at run time, as "
32747 "in this example program (note that you still need the compile time check as "
32752 #: ../src/guestfs.pod:1531
32755 " #include <stdio.h>\n"
32756 " #include <stdlib.h>\n"
32757 " #include <unistd.h>\n"
32758 " #include <dlfcn.h>\n"
32759 " #include <guestfs.h>\n"
32764 #: ../src/guestfs.pod:1537
32769 " #ifdef LIBGUESTFS_HAVE_DD\n"
32771 " int has_function;\n"
32776 #: ../src/guestfs.pod:1543
32779 " /* Test if the function guestfs_dd is really available. */\n"
32780 " dl = dlopen (NULL, RTLD_LAZY);\n"
32782 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
32783 " exit (EXIT_FAILURE);\n"
32785 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
32791 #: ../src/guestfs.pod:1552
32794 " if (!has_function)\n"
32795 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
32797 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
32798 " /* Now it's safe to call\n"
32799 " guestfs_dd (g, \"foo\", \"bar\");\n"
32803 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
32810 #: ../src/guestfs.pod:1565
32812 "You may think the above is an awful lot of hassle, and it is. There are "
32813 "other ways outside of the C linking system to ensure that this kind of "
32814 "incompatibility never arises, such as using package versioning:"
32818 #: ../src/guestfs.pod:1570
32821 " Requires: libguestfs >= 1.0.80\n"
32826 #: ../src/guestfs.pod:1572
32827 msgid "CALLS WITH OPTIONAL ARGUMENTS"
32831 #: ../src/guestfs.pod:1574
32833 "A recent feature of the API is the introduction of calls which take optional "
32834 "arguments. In C these are declared 3 ways. The main way is as a call which "
32835 "takes variable arguments (ie. C<...>), as in this example:"
32839 #: ../src/guestfs.pod:1579
32842 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
32847 #: ../src/guestfs.pod:1581
32849 "Call this with a list of optional arguments, terminated by C<-1>. So to "
32850 "call with no optional arguments specified:"
32854 #: ../src/guestfs.pod:1584
32857 " guestfs_add_drive_opts (g, filename, -1);\n"
32862 #: ../src/guestfs.pod:1586
32863 msgid "With a single optional argument:"
32867 #: ../src/guestfs.pod:1588
32870 " guestfs_add_drive_opts (g, filename,\n"
32871 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
32877 #: ../src/guestfs.pod:1592
32882 #: ../src/guestfs.pod:1594
32885 " guestfs_add_drive_opts (g, filename,\n"
32886 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
32887 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
32893 #: ../src/guestfs.pod:1599
32895 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
32900 #: ../src/guestfs.pod:1602
32901 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
32905 #: ../src/guestfs.pod:1604
32907 "The second variant has the same name with the suffix C<_va>, which works the "
32908 "same way but takes a C<va_list>. See the C manual for details. For the "
32909 "example function, this is declared:"
32913 #: ../src/guestfs.pod:1608
32916 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
32917 " va_list args);\n"
32922 #: ../src/guestfs.pod:1611
32923 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
32927 #: ../src/guestfs.pod:1613
32929 "The third variant is useful where you need to construct these calls. You "
32930 "pass in a structure where you fill in the optional fields. The structure "
32931 "has a bitmask as the first element which you must set to indicate which "
32932 "fields you have filled in. For our example function the structure and call "
32937 #: ../src/guestfs.pod:1619
32940 " struct guestfs_add_drive_opts_argv {\n"
32941 " uint64_t bitmask;\n"
32943 " const char *format;\n"
32946 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
32947 " const struct guestfs_add_drive_opts_argv *optargs);\n"
32952 #: ../src/guestfs.pod:1628
32953 msgid "You could call it like this:"
32957 #: ../src/guestfs.pod:1630
32960 " struct guestfs_add_drive_opts_argv optargs = {\n"
32961 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
32962 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
32963 " .readonly = 1,\n"
32964 " .format = \"qcow2\"\n"
32970 #: ../src/guestfs.pod:1637
32973 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
32978 #: ../src/guestfs.pod:1645
32979 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
32983 #: ../src/guestfs.pod:1650
32984 msgid "You do not need to fill in all fields of the structure."
32988 #: ../src/guestfs.pod:1654
32990 "There must be a one-to-one correspondence between fields of the structure "
32991 "that are filled in, and bits set in the bitmask."
32995 #: ../src/guestfs.pod:1659
32996 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
33000 #: ../src/guestfs.pod:1661
33002 "In other languages, optional arguments are expressed in the way that is "
33003 "natural for that language. We refer you to the language-specific "
33004 "documentation for more details on that."
33008 #: ../src/guestfs.pod:1665
33009 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
33013 #: ../src/guestfs.pod:1667
33014 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
33018 #: ../src/guestfs.pod:1669
33020 "B<Note:> This section documents the generic event mechanism introduced in "
33021 "libguestfs 1.10, which you should use in new code if possible. The old "
33022 "functions C<guestfs_set_log_message_callback>, "
33023 "C<guestfs_set_subprocess_quit_callback>, "
33024 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
33025 "C<guestfs_set_progress_callback> are no longer documented in this manual "
33026 "page. Because of the ABI guarantee, the old functions continue to work."
33030 #: ../src/guestfs.pod:1678
33032 "Handles generate events when certain things happen, such as log messages "
33033 "being generated, progress messages during long-running operations, or the "
33034 "handle being closed. The API calls described below let you register a "
33035 "callback to be called when events happen. You can register multiple "
33036 "callbacks (for the same, different or overlapping sets of events), and "
33037 "individually remove callbacks. If callbacks are not removed, then they "
33038 "remain in force until the handle is closed."
33042 #: ../src/guestfs.pod:1686
33044 "In the current implementation, events are only generated synchronously: that "
33045 "means that events (and hence callbacks) can only happen while you are in the "
33046 "middle of making another libguestfs call. The callback is called in the "
33051 #: ../src/guestfs.pod:1691
33053 "Events may contain a payload, usually nothing (void), an array of 64 bit "
33054 "unsigned integers, or a message buffer. Payloads are discussed later on."
33058 #: ../src/guestfs.pod:1695
33059 msgid "CLASSES OF EVENTS"
33063 #: ../src/guestfs.pod:1699
33064 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
33068 #: ../src/guestfs.pod:1702
33070 "The callback function will be called while the handle is being closed "
33071 "(synchronously from L</guestfs_close>)."
33075 #: ../src/guestfs.pod:1705
33077 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
33078 "handles that are open when the program exits. This means that this callback "
33079 "might be called indirectly from L<exit(3)>, which can cause unexpected "
33080 "problems in higher-level languages (eg. if your HLL interpreter has already "
33081 "been cleaned up by the time this is called, and if your callback then jumps "
33082 "into some HLL function)."
33086 #: ../src/guestfs.pod:1712
33088 "If no callback is registered: the handle is closed without any callback "
33093 #: ../src/guestfs.pod:1715
33094 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
33098 #: ../src/guestfs.pod:1718
33100 "The callback function will be called when the child process quits, either "
33101 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
33102 "corresponds to a transition from any state to the CONFIG state)."
33106 #: ../src/guestfs.pod:1722 ../src/guestfs.pod:1731
33107 msgid "If no callback is registered: the event is ignored."
33111 #: ../src/guestfs.pod:1724
33112 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
33116 #: ../src/guestfs.pod:1727
33118 "The callback function will be called when the child process becomes ready "
33119 "first time after it has been launched. (This corresponds to a transition "
33120 "from LAUNCHING to the READY state)."
33124 #: ../src/guestfs.pod:1733
33125 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
33129 #: ../src/guestfs.pod:1736
33131 "Some long-running operations can generate progress messages. If this "
33132 "callback is registered, then it will be called each time a progress message "
33133 "is generated (usually two seconds after the operation started, and three "
33134 "times per second thereafter until it completes, although the frequency may "
33135 "change in future versions)."
33139 #: ../src/guestfs.pod:1742
33141 "The callback receives in the payload four unsigned 64 bit numbers which are "
33142 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
33146 #: ../src/guestfs.pod:1745
33148 "The units of C<total> are not defined, although for some operations C<total> "
33149 "may relate in some way to the amount of data to be transferred (eg. in bytes "
33150 "or megabytes), and C<position> may be the portion which has been "
33155 #: ../src/guestfs.pod:1750
33156 msgid "The only defined and stable parts of the API are:"
33160 #: ../src/guestfs.pod:1756
33162 "The callback can display to the user some type of progress bar or indicator "
33163 "which shows the ratio of C<position>:C<total>."
33167 #: ../src/guestfs.pod:1761
33168 msgid "0 E<lt>= C<position> E<lt>= C<total>"
33172 #: ../src/guestfs.pod:1765
33174 "If any progress notification is sent during a call, then a final progress "
33175 "notification is always sent when C<position> = C<total> (I<unless> the call "
33176 "fails with an error)."
33180 #: ../src/guestfs.pod:1769
33182 "This is to simplify caller code, so callers can easily set the progress "
33183 "indicator to \"100%\" at the end of the operation, without requiring special "
33184 "code to detect this case."
33188 #: ../src/guestfs.pod:1775
33190 "For some calls we are unable to estimate the progress of the call, but we "
33191 "can still generate progress messages to indicate activity. This is known as "
33192 "\"pulse mode\", and is directly supported by certain progress bar "
33193 "implementations (eg. GtkProgressBar)."
33197 #: ../src/guestfs.pod:1780
33199 "For these calls, zero or more progress messages are generated with "
33200 "C<position = 0> and C<total = 1>, followed by a final message with "
33201 "C<position = total = 1>."
33205 #: ../src/guestfs.pod:1784
33207 "As noted above, if the call fails with an error then the final message may "
33208 "not be generated."
33212 #: ../src/guestfs.pod:1789
33214 "The callback also receives the procedure number (C<proc_nr>) and serial "
33215 "number (C<serial>) of the call. These are only useful for debugging "
33216 "protocol issues, and the callback can normally ignore them. The callback "
33217 "may want to print these numbers in error messages or debugging messages."
33221 #: ../src/guestfs.pod:1795
33222 msgid "If no callback is registered: progress messages are discarded."
33226 #: ../src/guestfs.pod:1797
33227 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
33231 #: ../src/guestfs.pod:1800
33233 "The callback function is called whenever a log message is generated by qemu, "
33234 "the appliance kernel, guestfsd (daemon), or utility programs."
33238 #: ../src/guestfs.pod:1803
33240 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
33241 "(L</guestfs_launch>) then additional debug messages are generated."
33245 #: ../src/guestfs.pod:1806 ../src/guestfs.pod:1820
33247 "If no callback is registered: the messages are discarded unless the verbose "
33248 "flag is set in which case they are sent to stderr. You can override the "
33249 "printing of verbose messages to stderr by setting up a callback."
33253 #: ../src/guestfs.pod:1811
33254 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
33258 #: ../src/guestfs.pod:1814
33260 "The callback function is called whenever a log message is generated by the "
33261 "library part of libguestfs."
33265 #: ../src/guestfs.pod:1817
33267 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
33268 "messages are generated."
33272 #: ../src/guestfs.pod:1825
33273 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
33277 #: ../src/guestfs.pod:1828
33279 "The callback function is called whenever a trace message is generated. This "
33280 "only applies if the trace flag (L</guestfs_set_trace>) is set."
33284 #: ../src/guestfs.pod:1831
33286 "If no callback is registered: the messages are sent to stderr. You can "
33287 "override the printing of trace messages to stderr by setting up a callback."
33291 #: ../src/guestfs.pod:1837
33292 msgid "guestfs_set_event_callback"
33296 #: ../src/guestfs.pod:1839
33299 " int guestfs_set_event_callback (guestfs_h *g,\n"
33300 " guestfs_event_callback cb,\n"
33301 " uint64_t event_bitmask,\n"
33303 " void *opaque);\n"
33308 #: ../src/guestfs.pod:1845
33310 "This function registers a callback (C<cb>) for all event classes in the "
33311 "C<event_bitmask>."
33315 #: ../src/guestfs.pod:1848
33317 "For example, to register for all log message events, you could call this "
33318 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
33319 "To register a single callback for all possible classes of events, use "
33320 "C<GUESTFS_EVENT_ALL>."
33324 #: ../src/guestfs.pod:1854
33325 msgid "C<flags> should always be passed as 0."
33329 #: ../src/guestfs.pod:1856
33331 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
33332 "it for any purpose."
33336 #: ../src/guestfs.pod:1859
33338 "The return value is the event handle (an integer) which you can use to "
33339 "delete the callback (see below)."
33343 #: ../src/guestfs.pod:1862
33345 "If there is an error, this function returns C<-1>, and sets the error in the "
33346 "handle in the usual way (see L</guestfs_last_error> etc.)"
33350 #: ../src/guestfs.pod:1865
33352 "Callbacks remain in effect until they are deleted, or until the handle is "
33357 #: ../src/guestfs.pod:1868
33359 "In the case where multiple callbacks are registered for a particular event "
33360 "class, all of the callbacks are called. The order in which multiple "
33361 "callbacks are called is not defined."
33365 #: ../src/guestfs.pod:1872
33366 msgid "guestfs_delete_event_callback"
33370 #: ../src/guestfs.pod:1874
33373 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
33378 #: ../src/guestfs.pod:1876
33380 "Delete a callback that was previously registered. C<event_handle> should be "
33381 "the integer that was returned by a previous call to "
33382 "C<guestfs_set_event_callback> on the same handle."
33386 #: ../src/guestfs.pod:1880
33387 msgid "guestfs_event_callback"
33391 #: ../src/guestfs.pod:1882
33394 " typedef void (*guestfs_event_callback) (\n"
33397 " uint64_t event,\n"
33398 " int event_handle,\n"
33400 " const char *buf, size_t buf_len,\n"
33401 " const uint64_t *array, size_t array_len);\n"
33406 #: ../src/guestfs.pod:1891
33407 msgid "This is the type of the event callback function that you have to provide."
33411 #: ../src/guestfs.pod:1894
33413 "The basic parameters are: the handle (C<g>), the opaque user pointer "
33414 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
33415 "handle, and C<flags> which in the current API you should ignore."
33419 #: ../src/guestfs.pod:1898
33421 "The remaining parameters contain the event payload (if any). Each event may "
33422 "contain a payload, which usually relates to the event class, but for future "
33423 "proofing your code should be written to handle any payload for any event "
33428 #: ../src/guestfs.pod:1903
33430 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
33431 "there is no message buffer). Note that this message buffer can contain "
33432 "arbitrary 8 bit data, including NUL bytes."
33436 #: ../src/guestfs.pod:1907
33438 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
33439 "moment this is only used for progress messages."
33443 #: ../src/guestfs.pod:1910
33444 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
33448 #: ../src/guestfs.pod:1912
33450 "One motivation for the generic event API was to allow GUI programs to "
33451 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
33452 "unconditionally to C<stderr>."
33456 #: ../src/guestfs.pod:1916
33458 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
33459 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
33460 "messages are not events; you must capture error messages separately)."
33464 #: ../src/guestfs.pod:1921
33466 "Programs have to set up a callback to capture the classes of events of "
33471 #: ../src/guestfs.pod:1924
33475 " guestfs_set_event_callback\n"
33476 " (g, message_callback,\n"
33477 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
33478 " GUESTFS_EVENT_TRACE,\n"
33479 " 0, NULL) == -1)\n"
33480 " if (eh == -1) {\n"
33481 " // handle error in the usual way\n"
33487 #: ../src/guestfs.pod:1934
33489 "The callback can then direct messages to the appropriate place. In this "
33490 "example, messages are directed to syslog:"
33494 #: ../src/guestfs.pod:1937
33498 " message_callback (\n"
33501 " uint64_t event,\n"
33502 " int event_handle,\n"
33504 " const char *buf, size_t buf_len,\n"
33505 " const uint64_t *array, size_t array_len)\n"
33507 " const int priority = LOG_USER|LOG_INFO;\n"
33508 " if (buf_len > 0)\n"
33509 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
33515 #: ../src/guestfs.pod:1952
33516 msgid "CANCELLING LONG TRANSFERS"
33520 #: ../src/guestfs.pod:1954
33522 "Some operations can be cancelled by the caller while they are in progress. "
33523 "Currently only operations that involve uploading or downloading data can be "
33524 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
33525 "parameters in the generator)."
33529 #: ../src/guestfs.pod:1959
33530 msgid "guestfs_user_cancel"
33534 #: ../src/guestfs.pod:1961
33537 " void guestfs_user_cancel (guestfs_h *g);\n"
33542 #: ../src/guestfs.pod:1963
33543 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
33547 #: ../src/guestfs.pod:1966
33549 "Unlike most other libguestfs calls, this function is signal safe and thread "
33550 "safe. You can call it from a signal handler or from another thread, without "
33551 "needing to do any locking."
33555 #: ../src/guestfs.pod:1970
33557 "The transfer that was in progress (if there is one) will stop shortly "
33558 "afterwards, and will return an error. The errno (see "
33559 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
33560 "out if the operation was cancelled or failed because of another error."
33564 #: ../src/guestfs.pod:1976
33566 "No cleanup is performed: for example, if a file was being uploaded then "
33567 "after cancellation there may be a partially uploaded file. It is the "
33568 "caller's responsibility to clean up if necessary."
33572 #: ../src/guestfs.pod:1980
33573 msgid "There are two common places that you might call C<guestfs_user_cancel>."
33577 #: ../src/guestfs.pod:1982
33579 "In an interactive text-based program, you might call it from a C<SIGINT> "
33580 "signal handler so that pressing C<^C> cancels the current operation. (You "
33581 "also need to call L</guestfs_set_pgroup> so that child processes don't "
33582 "receive the C<^C> signal)."
33586 #: ../src/guestfs.pod:1987
33588 "In a graphical program, when the main thread is displaying a progress bar "
33589 "with a cancel button, wire up the cancel button to call this function."
33593 #: ../src/guestfs.pod:1991
33594 msgid "PRIVATE DATA AREA"
33598 #: ../src/guestfs.pod:1993
33600 "You can attach named pieces of private data to the libguestfs handle, fetch "
33601 "them by name, and walk over them, for the lifetime of the handle. This is "
33602 "called the private data area and is only available from the C API."
33606 #: ../src/guestfs.pod:1998
33607 msgid "To attach a named piece of data, use the following call:"
33611 #: ../src/guestfs.pod:2000
33614 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
33619 #: ../src/guestfs.pod:2002
33621 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
33622 "pointer (which can be C<NULL>). Any previous item with the same key is "
33627 #: ../src/guestfs.pod:2006
33629 "You can use any C<key> you want, but your key should I<not> start with an "
33630 "underscore character. Keys beginning with an underscore character are "
33631 "reserved for internal libguestfs purposes (eg. for implementing language "
33632 "bindings). It is recommended that you prefix the key with some unique "
33633 "string to avoid collisions with other users."
33637 #: ../src/guestfs.pod:2012
33638 msgid "To retrieve the pointer, use:"
33642 #: ../src/guestfs.pod:2014
33645 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
33650 #: ../src/guestfs.pod:2016
33652 "This function returns C<NULL> if either no data is found associated with "
33653 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
33658 #: ../src/guestfs.pod:2020
33660 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
33661 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
33662 "all. In particular, libguestfs does I<not> try to free the data when the "
33663 "handle is closed. If the data must be freed, then the caller must either "
33664 "free it before calling L</guestfs_close> or must set up a close callback to "
33665 "do it (see L</GUESTFS_EVENT_CLOSE>)."
33669 #: ../src/guestfs.pod:2027
33670 msgid "To walk over all entries, use these two functions:"
33674 #: ../src/guestfs.pod:2029
33677 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
33682 #: ../src/guestfs.pod:2031
33685 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
33690 #: ../src/guestfs.pod:2033
33692 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
33693 "not have any particular meaning -- keys are not returned in any defined "
33694 "order). A pointer to the key is returned in C<*key_rtn> and the "
33695 "corresponding data pointer is returned from the function. C<NULL> is "
33696 "returned if there are no keys stored in the handle."
33700 #: ../src/guestfs.pod:2039
33702 "C<guestfs_next_private> returns the next key, pointer pair. The return "
33703 "value of this function is also C<NULL> is there are no further entries to "
33708 #: ../src/guestfs.pod:2043
33709 msgid "Notes about walking over entries:"
33713 #: ../src/guestfs.pod:2049
33714 msgid "You must not call C<guestfs_set_private> while walking over the entries."
33718 #: ../src/guestfs.pod:2054
33720 "The handle maintains an internal iterator which is reset when you call "
33721 "C<guestfs_first_private>. This internal iterator is invalidated when you "
33722 "call C<guestfs_set_private>."
33726 #: ../src/guestfs.pod:2060
33727 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
33731 #: ../src/guestfs.pod:2062
33734 " guestfs_set_private (g, key, NULL);\n"
33739 #: ../src/guestfs.pod:2064
33740 msgid "then that C<key> is not returned when walking."
33744 #: ../src/guestfs.pod:2068
33746 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
33747 "C<guestfs_next_private> or C<guestfs_set_private>."
33751 #: ../src/guestfs.pod:2074
33753 "The following example code shows how to print all keys and data pointers "
33754 "that are associated with the handle C<g>:"
33758 #: ../src/guestfs.pod:2077
33761 " const char *key;\n"
33762 " void *data = guestfs_first_private (g, &key);\n"
33763 " while (data != NULL)\n"
33765 " printf (\"key = %s, data = %p\\n\", key, data);\n"
33766 " data = guestfs_next_private (g, &key);\n"
33772 #: ../src/guestfs.pod:2085
33774 "More commonly you are only interested in keys that begin with an "
33775 "application-specific prefix C<foo_>. Modify the loop like so:"
33779 #: ../src/guestfs.pod:2088
33782 " const char *key;\n"
33783 " void *data = guestfs_first_private (g, &key);\n"
33784 " while (data != NULL)\n"
33786 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
33787 " printf (\"key = %s, data = %p\\n\", key, data);\n"
33788 " data = guestfs_next_private (g, &key);\n"
33794 #: ../src/guestfs.pod:2097
33796 "If you need to modify keys while walking, then you have to jump back to the "
33797 "beginning of the loop. For example, to delete all keys prefixed with "
33802 #: ../src/guestfs.pod:2101
33805 " const char *key;\n"
33808 " data = guestfs_first_private (g, &key);\n"
33809 " while (data != NULL)\n"
33811 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
33813 " guestfs_set_private (g, key, NULL);\n"
33814 " /* note that 'key' pointer is now invalid, and so is\n"
33815 " the internal iterator */\n"
33818 " data = guestfs_next_private (g, &key);\n"
33824 #: ../src/guestfs.pod:2117
33826 "Note that the above loop is guaranteed to terminate because the keys are "
33827 "being deleted, but other manipulations of keys within the loop might not "
33828 "terminate unless you also maintain an indication of which keys have been "
33833 #: ../src/guestfs.pod:2122 ../src/guestfs.pod:2127
33838 #: ../src/guestfs.pod:2124
33840 "<!-- old anchor for the next section --> <a "
33841 "name=\"state_machine_and_low_level_event_api\"/>"
33845 #: ../src/guestfs.pod:2129
33846 msgid "ARCHITECTURE"
33850 #: ../src/guestfs.pod:2131
33852 "Internally, libguestfs is implemented by running an appliance (a special "
33853 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
33854 "process of the main program."
33858 #: ../src/guestfs.pod:2135
33861 " ___________________\n"
33863 " | main program |\n"
33865 " | | child process / appliance\n"
33866 " | | __________________________\n"
33868 " +-------------------+ RPC | +-----------------+ |\n"
33869 " | libguestfs <--------------------> guestfsd | |\n"
33870 " | | | +-----------------+ |\n"
33871 " \\___________________/ | | Linux kernel | |\n"
33872 " | +--^--------------+ |\n"
33873 " \\_________|________________/\n"
33875 " _______v______\n"
33878 " | disk image |\n"
33879 " \\______________/\n"
33884 #: ../src/guestfs.pod:2155
33886 "The library, linked to the main program, creates the child process and hence "
33887 "the appliance in the L</guestfs_launch> function."
33891 #: ../src/guestfs.pod:2158
33893 "Inside the appliance is a Linux kernel and a complete stack of userspace "
33894 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
33895 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
33896 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
33897 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
33898 "attached to the qemu process which translates device access by the "
33899 "appliance's Linux kernel into accesses to the image."
33903 #: ../src/guestfs.pod:2167
33905 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
33906 "Although the disk image you are attached to might also be used by some "
33907 "virtual machine, libguestfs doesn't know or care about this. (But you will "
33908 "care if both libguestfs's qemu process and your virtual machine are trying "
33909 "to update the disk image at the same time, since these usually results in "
33910 "massive disk corruption)."
33914 #: ../src/guestfs.pod:2174
33915 msgid "STATE MACHINE"
33919 #: ../src/guestfs.pod:2176
33920 msgid "libguestfs uses a state machine to model the child process:"
33924 #: ../src/guestfs.pod:2178
33928 " guestfs_create\n"
33936 " / | \\ \\ guestfs_launch\n"
33937 " / | _\\__V______\n"
33939 " / | | LAUNCHING |\n"
33940 " / | \\___________/\n"
33942 " / | guestfs_launch\n"
33944 " ______ / __|____V\n"
33945 " / \\ ------> / \\\n"
33946 " | BUSY | | READY |\n"
33947 " \\______/ <------ \\________/\n"
33952 #: ../src/guestfs.pod:2200
33954 "The normal transitions are (1) CONFIG (when the handle is created, but there "
33955 "is no child process), (2) LAUNCHING (when the child process is booting up), "
33956 "(3) alternating between READY and BUSY as commands are issued to, and "
33957 "carried out by, the child process."
33961 #: ../src/guestfs.pod:2205
33963 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
33964 "asynchronously at any time (eg. due to some internal error), and that causes "
33965 "the state to transition back to CONFIG."
33969 #: ../src/guestfs.pod:2209
33971 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
33972 "issued when in the CONFIG state."
33976 #: ../src/guestfs.pod:2212
33978 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
33979 "L</guestfs_launch> blocks until the child process is READY to accept "
33980 "commands (or until some failure or timeout). L</guestfs_launch> internally "
33981 "moves the state from CONFIG to LAUNCHING while it is running."
33985 #: ../src/guestfs.pod:2218
33987 "API actions such as L</guestfs_mount> can only be issued when in the READY "
33988 "state. These API calls block waiting for the command to be carried out "
33989 "(ie. the state to transition to BUSY and then back to READY). There are no "
33990 "non-blocking versions, and no way to issue more than one command per handle "
33991 "at the same time."
33995 #: ../src/guestfs.pod:2224
33997 "Finally, the child process sends asynchronous messages back to the main "
33998 "program, such as kernel log messages. You can register a callback to "
33999 "receive these messages."
34003 #: ../src/guestfs.pod:2228
34008 #: ../src/guestfs.pod:2230
34009 msgid "COMMUNICATION PROTOCOL"
34013 #: ../src/guestfs.pod:2232
34015 "Don't rely on using this protocol directly. This section documents how it "
34016 "currently works, but it may change at any time."
34020 #: ../src/guestfs.pod:2235
34022 "The protocol used to talk between the library and the daemon running inside "
34023 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
34024 "1014, RFC 1832, RFC 4506)."
34028 #: ../src/guestfs.pod:2239
34030 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
34031 "this file is automatically generated)."
34035 #: ../src/guestfs.pod:2242
34037 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
34038 "and C<FileOut> parameters, which are handled with very simple request/reply "
34039 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
34040 "parameters, which use the same request and reply messages, but they may also "
34041 "be followed by files sent using a chunked encoding."
34045 #: ../src/guestfs.pod:2249
34046 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
34050 #: ../src/guestfs.pod:2251
34051 msgid "For ordinary functions, the request message is:"
34055 #: ../src/guestfs.pod:2253
34058 " total length (header + arguments,\n"
34059 " but not including the length word itself)\n"
34060 " struct guestfs_message_header (encoded as XDR)\n"
34061 " struct guestfs_<foo>_args (encoded as XDR)\n"
34066 #: ../src/guestfs.pod:2258
34068 "The total length field allows the daemon to allocate a fixed size buffer "
34069 "into which it slurps the rest of the message. As a result, the total length "
34070 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
34071 "effective size of any request is limited to somewhere under this size."
34075 #: ../src/guestfs.pod:2264
34077 "Note also that many functions don't take any arguments, in which case the "
34078 "C<guestfs_I<foo>_args> is completely omitted."
34082 #: ../src/guestfs.pod:2267
34084 "The header contains the procedure number (C<guestfs_proc>) which is how the "
34085 "receiver knows what type of args structure to expect, or none at all."
34089 #: ../src/guestfs.pod:2271
34091 "For functions that take optional arguments, the optional arguments are "
34092 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
34093 "arguments. A bitmask in the header indicates which optional arguments are "
34094 "meaningful. The bitmask is also checked to see if it contains bits set "
34095 "which the daemon does not know about (eg. if more optional arguments were "
34096 "added in a later version of the library), and this causes the call to be "
34101 #: ../src/guestfs.pod:2279
34102 msgid "The reply message for ordinary functions is:"
34106 #: ../src/guestfs.pod:2281
34109 " total length (header + ret,\n"
34110 " but not including the length word itself)\n"
34111 " struct guestfs_message_header (encoded as XDR)\n"
34112 " struct guestfs_<foo>_ret (encoded as XDR)\n"
34117 #: ../src/guestfs.pod:2286
34119 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
34120 "functions that return no formal return values."
34124 #: ../src/guestfs.pod:2289
34125 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
34129 #: ../src/guestfs.pod:2292
34131 "In the case of an error, a flag is set in the header, and the reply message "
34132 "is slightly changed:"
34136 #: ../src/guestfs.pod:2295
34139 " total length (header + error,\n"
34140 " but not including the length word itself)\n"
34141 " struct guestfs_message_header (encoded as XDR)\n"
34142 " struct guestfs_message_error (encoded as XDR)\n"
34147 #: ../src/guestfs.pod:2300
34149 "The C<guestfs_message_error> structure contains the error message as a "
34154 #: ../src/guestfs.pod:2303
34155 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
34159 #: ../src/guestfs.pod:2305
34161 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
34162 "The normal request message is sent (see above). However this is followed by "
34163 "a sequence of file chunks."
34167 #: ../src/guestfs.pod:2309
34170 " total length (header + arguments,\n"
34171 " but not including the length word itself,\n"
34172 " and not including the chunks)\n"
34173 " struct guestfs_message_header (encoded as XDR)\n"
34174 " struct guestfs_<foo>_args (encoded as XDR)\n"
34175 " sequence of chunks for FileIn param #0\n"
34176 " sequence of chunks for FileIn param #1 etc.\n"
34181 #: ../src/guestfs.pod:2317
34182 msgid "The \"sequence of chunks\" is:"
34186 #: ../src/guestfs.pod:2319
34189 " length of chunk (not including length word itself)\n"
34190 " struct guestfs_chunk (encoded as XDR)\n"
34191 " length of chunk\n"
34192 " struct guestfs_chunk (encoded as XDR)\n"
34194 " length of chunk\n"
34195 " struct guestfs_chunk (with data.data_len == 0)\n"
34200 #: ../src/guestfs.pod:2327
34202 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
34203 "is set in the final chunk to indicate either successful completion or early "
34208 #: ../src/guestfs.pod:2331
34210 "At time of writing there are no functions that have more than one FileIn "
34211 "parameter. However this is (theoretically) supported, by sending the "
34212 "sequence of chunks for each FileIn parameter one after another (from left to "
34217 #: ../src/guestfs.pod:2336
34219 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
34220 "transfer. The library does this by sending a chunk with a special flag set "
34221 "to indicate cancellation. When the daemon sees this, it cancels the whole "
34222 "RPC, does I<not> send any reply, and goes back to reading the next request."
34226 #: ../src/guestfs.pod:2342
34228 "The daemon may also cancel. It does this by writing a special word "
34229 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
34230 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
34231 "cancel chunk). The special word is chosen so that even if cancellation "
34232 "happens right at the end of the transfer (after the library has finished "
34233 "writing and has started listening for the reply), the \"spurious\" cancel "
34234 "flag will not be confused with the reply message."
34238 #: ../src/guestfs.pod:2351
34240 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
34241 "limit), and also files where the size is not known in advance (eg. from "
34242 "pipes or sockets). However the chunks are rather small "
34243 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
34244 "to keep much in memory."
34248 #: ../src/guestfs.pod:2357
34249 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
34253 #: ../src/guestfs.pod:2359
34255 "The protocol for FileOut parameters is exactly the same as for FileIn "
34256 "parameters, but with the roles of daemon and library reversed."
34260 #: ../src/guestfs.pod:2362
34263 " total length (header + ret,\n"
34264 " but not including the length word itself,\n"
34265 " and not including the chunks)\n"
34266 " struct guestfs_message_header (encoded as XDR)\n"
34267 " struct guestfs_<foo>_ret (encoded as XDR)\n"
34268 " sequence of chunks for FileOut param #0\n"
34269 " sequence of chunks for FileOut param #1 etc.\n"
34274 #: ../src/guestfs.pod:2370
34275 msgid "INITIAL MESSAGE"
34279 #: ../src/guestfs.pod:2372
34281 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
34282 "which indicates that the guest and daemon is alive. This is what "
34283 "L</guestfs_launch> waits for."
34287 #: ../src/guestfs.pod:2376
34288 msgid "PROGRESS NOTIFICATION MESSAGES"
34292 #: ../src/guestfs.pod:2378
34294 "The daemon may send progress notification messages at any time. These are "
34295 "distinguished by the normal length word being replaced by "
34296 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
34300 #: ../src/guestfs.pod:2382
34302 "The library turns them into progress callbacks (see "
34303 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
34308 #: ../src/guestfs.pod:2386
34310 "The daemon self-limits the frequency of progress messages it sends (see "
34311 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
34316 #: ../src/guestfs.pod:2390
34317 msgid "LIBGUESTFS VERSION NUMBERS"
34321 #: ../src/guestfs.pod:2392
34323 "Since April 2010, libguestfs has started to make separate development and "
34324 "stable releases, along with corresponding branches in our git repository. "
34325 "These separate releases can be identified by version number:"
34329 #: ../src/guestfs.pod:2397
34332 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
34333 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
34339 " | `-------- sub-version\n"
34341 " `------ always '1' because we don't change the ABI\n"
34346 #: ../src/guestfs.pod:2408
34347 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
34351 #: ../src/guestfs.pod:2410
34353 "As time passes we cherry pick fixes from the development branch and backport "
34354 "those into the stable branch, the effect being that the stable branch should "
34355 "get more stable and less buggy over time. So the stable releases are ideal "
34356 "for people who don't need new features but would just like the software to "
34361 #: ../src/guestfs.pod:2416
34362 msgid "Our criteria for backporting changes are:"
34366 #: ../src/guestfs.pod:2422
34368 "Documentation changes which don't affect any code are backported unless the "
34369 "documentation refers to a future feature which is not in stable."
34373 #: ../src/guestfs.pod:2428
34375 "Bug fixes which are not controversial, fix obvious problems, and have been "
34376 "well tested are backported."
34380 #: ../src/guestfs.pod:2433
34382 "Simple rearrangements of code which shouldn't affect how it works get "
34383 "backported. This is so that the code in the two branches doesn't get too "
34384 "far out of step, allowing us to backport future fixes more easily."
34388 #: ../src/guestfs.pod:2439
34390 "We I<don't> backport new features, new APIs, new tools etc, except in one "
34391 "exceptional case: the new feature is required in order to implement an "
34392 "important bug fix."
34396 #: ../src/guestfs.pod:2445
34398 "A new stable branch starts when we think the new features in development are "
34399 "substantial and compelling enough over the current stable branch to warrant "
34400 "it. When that happens we create new stable and development versions 1.N.0 "
34401 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
34402 "stable at this point, but by backporting fixes from development, that branch "
34403 "will stabilize over time."
34407 #: ../src/guestfs.pod:2453
34408 msgid "EXTENDING LIBGUESTFS"
34412 #: ../src/guestfs.pod:2455
34413 msgid "ADDING A NEW API ACTION"
34417 #: ../src/guestfs.pod:2457
34419 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
34420 "documentation) are generated, and this makes it easy to extend the "
34425 #: ../src/guestfs.pod:2461
34426 msgid "To add a new API action there are two changes:"
34430 #: ../src/guestfs.pod:2467
34432 "You need to add a description of the call (name, parameters, return type, "
34433 "tests, documentation) to C<generator/generator_actions.ml>."
34437 #: ../src/guestfs.pod:2470
34439 "There are two sorts of API action, depending on whether the call goes "
34440 "through to the daemon in the appliance, or is serviced entirely by the "
34441 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
34442 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
34443 "an example of the latter, since a trace flag is maintained in the handle and "
34444 "all tracing is done on the library side."
34448 #: ../src/guestfs.pod:2478
34450 "Most new actions are of the first type, and get added to the "
34451 "C<daemon_functions> list. Each function has a unique procedure number used "
34452 "in the RPC protocol which is assigned to that action when we publish "
34453 "libguestfs and cannot be reused. Take the latest procedure number and "
34458 #: ../src/guestfs.pod:2484
34460 "For library-only actions of the second type, add to the "
34461 "C<non_daemon_functions> list. Since these functions are serviced by the "
34462 "library and do not travel over the RPC mechanism to the daemon, these "
34463 "functions do not need a procedure number, and so the procedure number is set "
34468 #: ../src/guestfs.pod:2492
34469 msgid "Implement the action (in C):"
34473 #: ../src/guestfs.pod:2494
34475 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
34476 "C<daemon/> directory."
34480 #: ../src/guestfs.pod:2497
34482 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
34483 "(note: double underscore) in the C<src/> directory."
34487 #: ../src/guestfs.pod:2500
34488 msgid "In either case, use another function as an example of what to do."
34492 #: ../src/guestfs.pod:2504
34493 msgid "After making these changes, use C<make> to compile."
34497 #: ../src/guestfs.pod:2506
34499 "Note that you don't need to implement the RPC, language bindings, manual "
34500 "pages or anything else. It's all automatically generated from the OCaml "
34505 #: ../src/guestfs.pod:2510
34506 msgid "ADDING TESTS FOR AN API ACTION"
34510 #: ../src/guestfs.pod:2512
34512 "You can supply zero or as many tests as you want per API call. The tests "
34513 "can either be added as part of the API description "
34514 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
34515 "drop a script into C<regressions/>. Note that adding a script to "
34516 "C<regressions/> is slower, so if possible use the first method."
34520 #: ../src/guestfs.pod:2518
34522 "The following describes the test environment used when you add an API test "
34523 "in C<generator_actions.ml>."
34527 #: ../src/guestfs.pod:2521
34528 msgid "The test environment has 4 block devices:"
34532 #: ../src/guestfs.pod:2525
34533 msgid "C</dev/sda> 500MB"
34537 #: ../src/guestfs.pod:2527
34538 msgid "General block device for testing."
34542 #: ../src/guestfs.pod:2529
34543 msgid "C</dev/sdb> 50MB"
34547 #: ../src/guestfs.pod:2531
34549 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
34554 #: ../src/guestfs.pod:2534
34555 msgid "C</dev/sdc> 10MB"
34559 #: ../src/guestfs.pod:2536
34560 msgid "Used in a few tests where two block devices are needed."
34564 #: ../src/guestfs.pod:2538
34565 msgid "C</dev/sdd>"
34569 #: ../src/guestfs.pod:2540
34570 msgid "ISO with fixed content (see C<images/test.iso>)."
34574 #: ../src/guestfs.pod:2544
34576 "To be able to run the tests in a reasonable amount of time, the libguestfs "
34577 "appliance and block devices are reused between tests. So don't try testing "
34578 "L</guestfs_kill_subprocess> :-x"
34582 #: ../src/guestfs.pod:2548
34584 "Each test starts with an initial scenario, selected using one of the "
34585 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
34586 "initialize the disks mentioned above in a particular way as documented in "
34587 "C<generator_types.ml>. You should not assume anything about the previous "
34588 "contents of other disks that are not initialized."
34592 #: ../src/guestfs.pod:2554
34594 "You can add a prerequisite clause to any individual test. This is a "
34595 "run-time check, which, if it fails, causes the test to be skipped. Useful "
34596 "if testing a command which might not work on all variations of libguestfs "
34597 "builds. A test that has prerequisite of C<Always> means to run "
34602 #: ../src/guestfs.pod:2560
34604 "In addition, packagers can skip individual tests by setting environment "
34605 "variables before running C<make check>."
34609 #: ../src/guestfs.pod:2563
34612 " SKIP_TEST_<CMD>_<NUM>=1\n"
34617 #: ../src/guestfs.pod:2565
34618 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
34622 #: ../src/guestfs.pod:2567
34627 #: ../src/guestfs.pod:2569
34630 " SKIP_TEST_<CMD>=1\n"
34635 #: ../src/guestfs.pod:2571
34636 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
34640 #: ../src/guestfs.pod:2573
34641 msgid "Packagers can run only certain tests by setting for example:"
34645 #: ../src/guestfs.pod:2575
34648 " TEST_ONLY=\"vfs_type zerofree\"\n"
34653 #: ../src/guestfs.pod:2577
34655 "See C<capitests/tests.c> for more details of how these environment variables "
34660 #: ../src/guestfs.pod:2580
34661 msgid "DEBUGGING NEW API ACTIONS"
34665 #: ../src/guestfs.pod:2582
34666 msgid "Test new actions work before submitting them."
34670 #: ../src/guestfs.pod:2584
34671 msgid "You can use guestfish to try out new commands."
34675 #: ../src/guestfs.pod:2586
34677 "Debugging the daemon is a problem because it runs inside a minimal "
34678 "environment. However you can fprintf messages in the daemon to stderr, and "
34679 "they will show up if you use C<guestfish -v>."
34683 #: ../src/guestfs.pod:2590
34684 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
34688 #: ../src/guestfs.pod:2592
34690 "Our C source code generally adheres to some basic code-formatting "
34691 "conventions. The existing code base is not totally consistent on this "
34692 "front, but we do prefer that contributed code be formatted similarly. In "
34693 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
34694 "indentation level, and other than that, follow the K&R style."
34698 #: ../src/guestfs.pod:2598
34700 "If you use Emacs, add the following to one of one of your start-up files "
34701 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
34705 #: ../src/guestfs.pod:2601
34708 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
34709 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
34710 " (add-hook 'find-file-hook\n"
34711 " '(lambda () (if (and buffer-file-name\n"
34712 " (string-match \"/libguestfs\\\\>\"\n"
34713 " (buffer-file-name))\n"
34714 " (not (string-equal mode-name \"Change Log\"))\n"
34715 " (not (string-equal mode-name \"Makefile\")))\n"
34716 " (setq indent-tabs-mode nil))))\n"
34721 #: ../src/guestfs.pod:2611
34724 " ;;; When editing C sources in libguestfs, use this style.\n"
34725 " (defun libguestfs-c-mode ()\n"
34726 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
34728 " (c-set-style \"K&R\")\n"
34729 " (setq c-indent-level 2)\n"
34730 " (setq c-basic-offset 2))\n"
34731 " (add-hook 'c-mode-hook\n"
34732 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
34733 " (buffer-file-name))\n"
34734 " (libguestfs-c-mode))))\n"
34739 #: ../src/guestfs.pod:2623
34740 msgid "Enable warnings when compiling (and fix any problems this finds):"
34744 #: ../src/guestfs.pod:2626
34747 " ./configure --enable-gcc-warnings\n"
34752 #: ../src/guestfs.pod:2628
34753 msgid "Useful targets are:"
34757 #: ../src/guestfs.pod:2630
34760 " make syntax-check # checks the syntax of the C code\n"
34761 " make check # runs the test suite\n"
34766 #: ../src/guestfs.pod:2633
34767 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
34771 #: ../src/guestfs.pod:2635
34773 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
34774 "which are used to do shell quoting."
34778 #: ../src/guestfs.pod:2640
34783 #: ../src/guestfs.pod:2642
34785 "Simple shell quoted string. Any spaces or other shell characters are "
34790 #: ../src/guestfs.pod:2645
34795 #: ../src/guestfs.pod:2647
34797 "Same as C<%Q> except the string is treated as a path which is prefixed by "
34802 #: ../src/guestfs.pod:2654
34805 " asprintf (&cmd, \"cat %R\", path);\n"
34810 #: ../src/guestfs.pod:2656
34811 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
34815 #: ../src/guestfs.pod:2658
34817 "I<Note:> Do I<not> use these when you are passing parameters to the "
34818 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
34819 "because they are not passed via the shell (instead, straight to exec). You "
34820 "probably want to use the C<sysroot_path()> function however."
34824 #: ../src/guestfs.pod:2664
34825 msgid "SUBMITTING YOUR NEW API ACTIONS"
34829 #: ../src/guestfs.pod:2666
34831 "Submit patches to the mailing list: "
34832 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
34833 "L<rjones@redhat.com>."
34837 #: ../src/guestfs.pod:2670
34838 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
34842 #: ../src/guestfs.pod:2672
34843 msgid "We support i18n (gettext anyhow) in the library."
34847 #: ../src/guestfs.pod:2674
34849 "However many messages come from the daemon, and we don't translate those at "
34850 "the moment. One reason is that the appliance generally has all locale files "
34851 "removed from it, because they take up a lot of space. So we'd have to readd "
34852 "some of those, as well as copying our PO files into the appliance."
34856 #: ../src/guestfs.pod:2680
34858 "Debugging messages are never translated, since they are intended for the "
34863 #: ../src/guestfs.pod:2683
34864 msgid "SOURCE CODE SUBDIRECTORIES"
34868 #: ../src/guestfs.pod:2689
34869 msgid "The libguestfs appliance, build scripts and so on."
34873 #: ../src/guestfs.pod:2691
34874 msgid "C<capitests>"
34878 #: ../src/guestfs.pod:2693
34879 msgid "Automated tests of the C API."
34883 #: ../src/guestfs.pod:2695
34888 #: ../src/guestfs.pod:2697
34890 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
34895 #: ../src/guestfs.pod:2700
34900 #: ../src/guestfs.pod:2702
34902 "Safety and liveness tests of components that libguestfs depends upon (not of "
34903 "libguestfs itself). Mainly this is for qemu and the kernel."
34907 #: ../src/guestfs.pod:2705
34912 #: ../src/guestfs.pod:2707
34913 msgid "Outside contributions, experimental parts."
34917 #: ../src/guestfs.pod:2709
34922 #: ../src/guestfs.pod:2711
34924 "The daemon that runs inside the libguestfs appliance and carries out "
34929 #: ../src/guestfs.pod:2714
34934 #: ../src/guestfs.pod:2716
34935 msgid "L<virt-df(1)> command and documentation."
34939 #: ../src/guestfs.pod:2718
34944 #: ../src/guestfs.pod:2720
34945 msgid "L<virt-edit(1)> command and documentation."
34949 #: ../src/guestfs.pod:2722
34950 msgid "C<examples>"
34954 #: ../src/guestfs.pod:2724
34955 msgid "C API example code."
34959 #: ../src/guestfs.pod:2726
34964 #: ../src/guestfs.pod:2728
34966 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
34967 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
34968 "L<virt-tar-out(1)>."
34972 #: ../src/guestfs.pod:2732
34977 #: ../src/guestfs.pod:2734
34978 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
34982 #: ../src/guestfs.pod:2736
34983 msgid "C<generator>"
34987 #: ../src/guestfs.pod:2738
34989 "The crucially important generator, used to automatically generate large "
34990 "amounts of boilerplate C code for things like RPC and bindings."
34994 #: ../src/guestfs.pod:2741
34999 #: ../src/guestfs.pod:2743
35000 msgid "Files used by the test suite."
35004 #: ../src/guestfs.pod:2745
35005 msgid "Some \"phony\" guest images which we test against."
35009 #: ../src/guestfs.pod:2747
35010 msgid "C<inspector>"
35014 #: ../src/guestfs.pod:2749
35015 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
35019 #: ../src/guestfs.pod:2751
35024 #: ../src/guestfs.pod:2753
35025 msgid "Logo used on the website. The fish is called Arthur by the way."
35029 #: ../src/guestfs.pod:2755
35034 #: ../src/guestfs.pod:2757
35035 msgid "M4 macros used by autoconf."
35039 #: ../src/guestfs.pod:2759
35044 #: ../src/guestfs.pod:2761
35045 msgid "Translations of simple gettext strings."
35049 #: ../src/guestfs.pod:2763
35054 #: ../src/guestfs.pod:2765
35056 "The build infrastructure and PO files for translations of manpages and POD "
35057 "files. Eventually this will be combined with the C<po> directory, but that "
35058 "is rather complicated."
35062 #: ../src/guestfs.pod:2769
35063 msgid "C<regressions>"
35067 #: ../src/guestfs.pod:2771
35068 msgid "Regression tests."
35072 #: ../src/guestfs.pod:2773
35077 #: ../src/guestfs.pod:2775
35078 msgid "L<virt-rescue(1)> command and documentation."
35082 #: ../src/guestfs.pod:2777
35087 #: ../src/guestfs.pod:2779
35088 msgid "Source code to the C library."
35092 #: ../src/guestfs.pod:2781
35097 #: ../src/guestfs.pod:2783
35098 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
35102 #: ../src/guestfs.pod:2785
35103 msgid "C<test-tool>"
35107 #: ../src/guestfs.pod:2787
35109 "Test tool for end users to test if their qemu/kernel combination will work "
35114 #: ../src/guestfs.pod:2790
35119 #: ../src/guestfs.pod:2792
35124 #: ../src/guestfs.pod:2794
35129 #: ../src/guestfs.pod:2796
35134 #: ../src/guestfs.pod:2798
35139 #: ../src/guestfs.pod:2800
35144 #: ../src/guestfs.pod:2802
35149 #: ../src/guestfs.pod:2804
35154 #: ../src/guestfs.pod:2806
35155 msgid "Language bindings."
35159 #: ../src/guestfs.pod:2810
35160 msgid "MAKING A STABLE RELEASE"
35164 #: ../src/guestfs.pod:2812
35166 "When we make a stable release, there are several steps documented here. See "
35167 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
35172 #: ../src/guestfs.pod:2820
35173 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
35177 #: ../src/guestfs.pod:2825
35178 msgid "Finalize RELEASE-NOTES."
35182 #: ../src/guestfs.pod:2829
35183 msgid "Update ROADMAP."
35187 #: ../src/guestfs.pod:2833
35188 msgid "Run C<src/api-support/update-from-tarballs.sh>."
35192 #: ../src/guestfs.pod:2837
35193 msgid "Push and pull from Transifex."
35197 #: ../src/guestfs.pod:2839
35202 #: ../src/guestfs.pod:2841
35210 #: ../src/guestfs.pod:2843
35211 msgid "to push the latest POT files to Transifex. Then run:"
35215 #: ../src/guestfs.pod:2845
35223 #: ../src/guestfs.pod:2847
35224 msgid "which is a wrapper to pull the latest translated C<*.po> files."
35228 #: ../src/guestfs.pod:2851
35230 "Create new stable and development directories under "
35231 "L<http://libguestfs.org/download>."
35235 #: ../src/guestfs.pod:2856
35236 msgid "Create the branch in git:"
35240 #: ../src/guestfs.pod:2858
35243 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
35244 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
35245 " git branch stable-1.XX\n"
35246 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
35251 #: ../src/guestfs.pod:2865
35256 #: ../src/guestfs.pod:2867
35257 msgid "PROTOCOL LIMITS"
35261 #: ../src/guestfs.pod:2869
35263 "Internally libguestfs uses a message-based protocol to pass API calls and "
35264 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
35265 "plenty more detail about this). The maximum message size used by the "
35266 "protocol is slightly less than 4 MB. For some API calls you may need to be "
35267 "aware of this limit. The API calls which may be affected are individually "
35268 "documented, with a link back to this section of the documentation."
35272 #: ../src/guestfs.pod:2877
35274 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
35275 "a simple string. Because this string is at some point internally encoded as "
35276 "a message, the maximum size that it can return is slightly under 4 MB. If "
35277 "the requested file is larger than this then you will get an error."
35281 #: ../src/guestfs.pod:2883
35283 "In order to transfer large files into and out of the guest filesystem, you "
35284 "need to use particular calls that support this. The sections L</UPLOADING> "
35285 "and L</DOWNLOADING> document how to do this."
35289 #: ../src/guestfs.pod:2887
35291 "You might also consider mounting the disk image using our FUSE filesystem "
35292 "support (L<guestmount(1)>)."
35296 #: ../src/guestfs.pod:2890
35297 msgid "MAXIMUM NUMBER OF DISKS"
35301 #: ../src/guestfs.pod:2892
35302 msgid "When using virtio disks (the default) the current limit is B<25> disks."
35306 #: ../src/guestfs.pod:2895
35308 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
35309 "slots. However febootstrap only understands disks with names C</dev/vda> "
35310 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
35315 #: ../src/guestfs.pod:2900
35317 "We are working to substantially raise this limit in future versions but it "
35318 "requires complex changes to qemu."
35322 #: ../src/guestfs.pod:2903
35324 "In future versions of libguestfs it should also be possible to \"hot plug\" "
35325 "disks (add and remove disks after calling L</guestfs_launch>). This also "
35326 "requires changes to qemu."
35330 #: ../src/guestfs.pod:2907
35331 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
35335 #: ../src/guestfs.pod:2909
35336 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
35340 #: ../src/guestfs.pod:2911
35342 "This is because it reserves 4 bits for the minor device number (thus "
35343 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
35347 #: ../src/guestfs.pod:2914
35349 "If you attach a disk with more than 15 partitions, the extra partitions are "
35350 "ignored by libguestfs."
35354 #: ../src/guestfs.pod:2917
35355 msgid "MAXIMUM SIZE OF A DISK"
35359 #: ../src/guestfs.pod:2919
35360 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
35364 #: ../src/guestfs.pod:2921
35366 "We have tested block devices up to 1 exabyte (2**60 or "
35367 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
35372 #: ../src/guestfs.pod:2925
35374 "Although libguestfs probably does not impose any limit, the underlying host "
35375 "storage will. If you store disk images on a host ext4 filesystem, then the "
35376 "maximum size will be limited by the maximum ext4 file size (currently 16 "
35377 "TB). If you store disk images as host logical volumes then you are limited "
35378 "by the maximum size of an LV."
35382 #: ../src/guestfs.pod:2931
35384 "For the hugest disk image files, we recommend using XFS on the host for "
35389 #: ../src/guestfs.pod:2934
35390 msgid "MAXIMUM SIZE OF A PARTITION"
35394 #: ../src/guestfs.pod:2936
35396 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
35397 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
35398 "address a partition located beyond 2 TB on the disk."
35402 #: ../src/guestfs.pod:2940
35404 "It is recommended that you use GPT partitions on disks which are larger than "
35405 "this size. GPT uses 64 bit sector numbers and so can address partitions "
35406 "which are theoretically larger than the largest disk we could support."
35410 #: ../src/guestfs.pod:2945
35411 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
35415 #: ../src/guestfs.pod:2947
35417 "This depends on the filesystem type. libguestfs itself does not impose any "
35418 "known limit. Consult Wikipedia or the filesystem documentation to find out "
35419 "what these limits are."
35423 #: ../src/guestfs.pod:2951
35424 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
35428 #: ../src/guestfs.pod:2953
35430 "The API functions L</guestfs_upload>, L</guestfs_download>, "
35431 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
35432 "uploads and downloads."
35436 #: ../src/guestfs.pod:2957
35437 msgid "INSPECTION LIMITS"
35441 #: ../src/guestfs.pod:2959
35443 "The inspection code has several arbitrary limits on things like the size of "
35444 "Windows Registry hive it will read, and the length of product name. These "
35445 "are intended to stop a malicious guest from consuming arbitrary amounts of "
35446 "memory and disk space on the host, and should not be reached in practice. "
35447 "See the source code for more information."
35451 #: ../src/guestfs.pod:2985
35453 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
35454 "effect as calling C<guestfs_set_verbose (g, 1)>."
35458 #: ../src/guestfs.pod:2997
35460 "Set the path that libguestfs uses to search for a supermin appliance. See "
35461 "the discussion of paths in section L</PATH> above."
35465 #: ../src/guestfs.pod:3006
35466 msgid "See also L</QEMU WRAPPERS> above."
35470 #: ../src/guestfs.pod:3010
35472 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
35473 "effect as calling C<guestfs_set_trace (g, 1)>."
35477 #: ../src/guestfs.pod:3028
35479 "L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
35480 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
35481 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
35482 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
35483 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
35484 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
35485 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
35486 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
35487 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
35491 #: ../src/guestfs.pod:3058
35493 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
35494 "L<lvm(8)>, L<disktype(1)>."
35498 #: ../src/guestfs.pod:3065 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
35503 #: ../src/guestfs.pod:3067
35504 msgid "To get a list of bugs against libguestfs use this link:"
35508 #: ../src/guestfs.pod:3069
35509 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
35513 #: ../src/guestfs.pod:3071
35514 msgid "To report a new bug against libguestfs use this link:"
35518 #: ../src/guestfs.pod:3073
35519 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
35523 #: ../src/guestfs.pod:3075
35524 msgid "When reporting a bug, please check:"
35528 #: ../src/guestfs.pod:3081
35529 msgid "That the bug hasn't been reported already."
35533 #: ../src/guestfs.pod:3085
35534 msgid "That you are testing a recent version."
35538 #: ../src/guestfs.pod:3089
35539 msgid "Describe the bug accurately, and give a way to reproduce it."
35543 #: ../src/guestfs.pod:3093
35545 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
35550 #: ../test-tool/libguestfs-test-tool.pod:5
35551 msgid "libguestfs-test-tool - End user tests for libguestfs"
35555 #: ../test-tool/libguestfs-test-tool.pod:9
35558 " libguestfs-test-tool [--options]\n"
35563 #: ../test-tool/libguestfs-test-tool.pod:13
35565 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
35566 "and developers, to allow them to check basic libguestfs functionality is "
35567 "working. This is needed because libguestfs occasionally breaks for reasons "
35568 "beyond our control: usually because of changes in the underlying qemu or "
35569 "kernel packages, or the host environment."
35573 #: ../test-tool/libguestfs-test-tool.pod:20
35574 msgid "If you suspect a problem in libguestfs, then just run:"
35578 #: ../test-tool/libguestfs-test-tool.pod:22
35581 " libguestfs-test-tool\n"
35586 #: ../test-tool/libguestfs-test-tool.pod:24
35587 msgid "It will print lots of diagnostic messages."
35591 #: ../test-tool/libguestfs-test-tool.pod:26
35592 msgid "If it runs to completion successfully, you will see this near the end:"
35596 #: ../test-tool/libguestfs-test-tool.pod:28
35599 " ===== TEST FINISHED OK =====\n"
35604 #: ../test-tool/libguestfs-test-tool.pod:30
35605 msgid "and the test tool will exit with code 0."
35609 #: ../test-tool/libguestfs-test-tool.pod:32
35611 "If it fails (and/or exits with non-zero error code), please paste the "
35612 "B<complete, unedited> output of the test tool into a bug report. More "
35613 "information about reporting bugs can be found on the "
35614 "L<http://libguestfs.org/> website."
35618 #: ../test-tool/libguestfs-test-tool.pod:41
35623 #: ../test-tool/libguestfs-test-tool.pod:43
35624 msgid "Display short usage information and exit."
35628 #: ../test-tool/libguestfs-test-tool.pod:45
35629 msgid "I<--qemu qemu_binary>"
35633 #: ../test-tool/libguestfs-test-tool.pod:47
35635 "If you have downloaded another qemu binary, point this option at the full "
35636 "path of the binary to try it."
35640 #: ../test-tool/libguestfs-test-tool.pod:50
35641 msgid "I<--qemudir qemu_source_dir>"
35645 #: ../test-tool/libguestfs-test-tool.pod:52
35647 "If you have compiled qemu from source, point this option at the source "
35648 "directory to try it."
35652 #: ../test-tool/libguestfs-test-tool.pod:55
35653 msgid "I<--timeout N>"
35657 #: ../test-tool/libguestfs-test-tool.pod:57
35659 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
35660 "does not usually need to be adjusted unless your machine is very slow."
35664 #: ../test-tool/libguestfs-test-tool.pod:63
35665 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
35669 #: ../test-tool/libguestfs-test-tool.pod:65
35671 "If you have compiled another version of qemu from source and would like to "
35672 "try that, then you can use the I<--qemudir> option to point to the qemu "
35673 "source directory."
35677 #: ../test-tool/libguestfs-test-tool.pod:69
35679 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
35680 "option to point to the binary."
35684 #: ../test-tool/libguestfs-test-tool.pod:72
35686 "When using an alternate qemu with libguestfs, usually you would need to "
35687 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
35688 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
35689 "when you use either of the I<--qemudir> or I<--qemu> options."
35693 #: ../test-tool/libguestfs-test-tool.pod:79
35695 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
35696 "I<1> if there was an error."
35700 #: ../test-tool/libguestfs-test-tool.pod:84
35702 "For the full list of environment variables which may affect libguestfs, "
35703 "please see the L<guestfs(3)> manual page."
35707 #: ../test-tool/libguestfs-test-tool.pod:89
35708 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
35712 #: ../tools/virt-list-filesystems.pl:32
35713 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
35717 #: ../tools/virt-list-filesystems.pl:36
35720 " virt-list-filesystems [--options] domname\n"
35725 #: ../tools/virt-list-filesystems.pl:38
35728 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
35733 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
35735 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
35740 #: ../tools/virt-list-filesystems.pl:45
35742 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
35743 "are contained in a virtual machine or disk image."
35747 #: ../tools/virt-list-filesystems.pl:49
35749 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
35750 "functionality. For more complex cases you should look at the "
35751 "L<guestfish(1)> tool."
35755 #: ../tools/virt-list-filesystems.pl:112
35757 "With this option, C<virt-list-filesystems> displays the type of each "
35758 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
35762 #: ../tools/virt-list-filesystems.pl:119
35767 #: ../tools/virt-list-filesystems.pl:123
35769 "Normally we only show mountable filesystems. If this option is given then "
35770 "swap devices are shown too."
35774 #: ../tools/virt-list-filesystems.pl:197
35776 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
35777 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
35778 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
35782 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
35783 msgid "Copyright (C) 2009 Red Hat Inc."
35787 #: ../tools/virt-list-partitions.pl:32
35788 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
35792 #: ../tools/virt-list-partitions.pl:36
35795 " virt-list-partitions [--options] domname\n"
35800 #: ../tools/virt-list-partitions.pl:38
35803 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
35808 #: ../tools/virt-list-partitions.pl:45
35810 "C<virt-list-partitions> is a command line tool to list the partitions that "
35811 "are contained in a virtual machine or disk image. It is mainly useful as a "
35812 "first step to using L<virt-resize(1)>."
35816 #: ../tools/virt-list-partitions.pl:50
35818 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
35819 "functionality. For more complex cases you should look at the "
35820 "L<guestfish(1)> tool."
35824 #: ../tools/virt-list-partitions.pl:113
35825 msgid "Show sizes in human-readable form (eg. \"1G\")."
35829 #: ../tools/virt-list-partitions.pl:123
35831 "With this option, C<virt-list-partitions> displays the type and size of each "
35832 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
35836 #: ../tools/virt-list-partitions.pl:130
35841 #: ../tools/virt-list-partitions.pl:132
35846 #: ../tools/virt-list-partitions.pl:134
35847 msgid "Display the total size of each block device (as a separate row or rows)."
35851 #: ../tools/virt-list-partitions.pl:267
35853 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
35854 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
35855 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
35859 #: ../tools/virt-list-partitions.pl:283
35860 msgid "Copyright (C) 2009-2010 Red Hat Inc."
35864 #: ../tools/virt-make-fs.pl:37
35865 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
35869 #: ../tools/virt-make-fs.pl:41
35872 " virt-make-fs [--options] input.tar output.img\n"
35877 #: ../tools/virt-make-fs.pl:43
35880 " virt-make-fs [--options] input.tar.gz output.img\n"
35885 #: ../tools/virt-make-fs.pl:45
35888 " virt-make-fs [--options] directory output.img\n"
35893 #: ../tools/virt-make-fs.pl:49
35895 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
35896 "archive or some files in a directory. It is similar to tools like "
35897 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
35898 "it can create common filesystem types like ext2/3 or NTFS, which can be "
35899 "useful if you want to attach these filesystems to existing virtual machines "
35900 "(eg. to import large amounts of read-only data to a VM)."
35904 #: ../tools/virt-make-fs.pl:57
35905 msgid "Basic usage is:"
35909 #: ../tools/virt-make-fs.pl:59
35912 " virt-make-fs input output\n"
35917 #: ../tools/virt-make-fs.pl:61
35919 "where C<input> is either a directory containing files that you want to add, "
35920 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
35921 "C<output> is a disk image. The input type is detected automatically. The "
35922 "output disk image defaults to a raw ext2 image unless you specify extra "
35923 "flags (see L</OPTIONS> below)."
35927 #: ../tools/virt-make-fs.pl:67
35928 msgid "EXTRA SPACE"
35932 #: ../tools/virt-make-fs.pl:69
35934 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
35935 "the files that it contains, but might have extra space. Depending on how "
35936 "you are going to use the output, you might think this extra space is wasted "
35937 "and want to minimize it, or you might want to leave space so that more files "
35938 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
35939 "but you can use the I<--size> flag to leave space in the filesystem if you "
35944 #: ../tools/virt-make-fs.pl:77
35946 "An alternative way to leave extra space but not make the output image any "
35947 "bigger is to use an alternative disk image format (instead of the default "
35948 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
35949 "image format (check your hypervisor supports this before using it). This "
35950 "allows you to choose a large I<--size> but the extra space won't actually be "
35951 "allocated in the image until you try to store something in it."
35955 #: ../tools/virt-make-fs.pl:85
35957 "Don't forget that you can also use local commands including L<resize2fs(8)> "
35958 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
35959 "to build another image from scratch."
35963 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
35968 #: ../tools/virt-make-fs.pl:91
35971 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
35976 #: ../tools/virt-make-fs.pl:93
35977 msgid "FILESYSTEM TYPE"
35981 #: ../tools/virt-make-fs.pl:95
35983 "The default filesystem type is C<ext2>. Just about any filesystem type that "
35984 "libguestfs supports can be used (but I<not> read-only formats like "
35985 "ISO9660). Here are some of the more common choices:"
35989 #: ../tools/virt-make-fs.pl:101
35994 #: ../tools/virt-make-fs.pl:103
35996 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
35997 "you are not going to use the filesystem in a way that requires the journal, "
35998 "then this is just wasted overhead."
36002 #: ../tools/virt-make-fs.pl:107
36003 msgid "I<ntfs> or I<vfat>"
36007 #: ../tools/virt-make-fs.pl:109
36008 msgid "Useful if exporting data to a Windows guest."
36012 #: ../tools/virt-make-fs.pl:111
36014 "I<Note for vfat>: The tar archive or local directory must only contain files "
36015 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
36016 "program running within libguestfs is unable to change the ownership of "
36017 "non-root files, since vfat itself does not support this."
36021 #: ../tools/virt-make-fs.pl:116
36026 #: ../tools/virt-make-fs.pl:118
36028 "Lower overhead than C<ext2>, but certain limitations on filename length and "
36029 "total filesystem size."
36033 #: ../tools/virt-make-fs.pl:125
36036 " virt-make-fs --type=minix input minixfs.img\n"
36041 #: ../tools/virt-make-fs.pl:127
36042 msgid "TO PARTITION OR NOT TO PARTITION"
36046 #: ../tools/virt-make-fs.pl:129
36047 msgid "Optionally virt-make-fs can add a partition table to the output disk."
36051 #: ../tools/virt-make-fs.pl:131
36053 "Adding a partition can make the disk image more compatible with certain "
36054 "virtualized operating systems which don't expect to see a filesystem "
36055 "directly located on a block device (Linux doesn't care and will happily "
36056 "handle both types)."
36060 #: ../tools/virt-make-fs.pl:136
36062 "On the other hand, if you have a partition table then the output image is no "
36063 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
36064 "directly on a partitioned disk image. (However libguestfs tools such as "
36065 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
36069 #: ../tools/virt-make-fs.pl:144
36070 msgid "Add an MBR partition:"
36074 #: ../tools/virt-make-fs.pl:146
36077 " virt-make-fs --partition -- input disk.img\n"
36082 #: ../tools/virt-make-fs.pl:148
36084 "If the output disk image could be terabyte-sized or larger, it's better to "
36085 "use an EFI/GPT-compatible partition table:"
36089 #: ../tools/virt-make-fs.pl:151
36092 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
36097 #: ../tools/virt-make-fs.pl:179
36098 msgid "Enable debugging information."
36102 #: ../tools/virt-make-fs.pl:185
36103 msgid "B<--size=E<lt>NE<gt>>"
36107 #: ../tools/virt-make-fs.pl:187
36108 msgid "B<--size=+E<lt>NE<gt>>"
36112 #: ../tools/virt-make-fs.pl:189
36113 msgid "B<-s E<lt>NE<gt>>"
36117 #: ../tools/virt-make-fs.pl:191
36118 msgid "B<-s +E<lt>NE<gt>>"
36122 #: ../tools/virt-make-fs.pl:193
36123 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
36127 #: ../tools/virt-make-fs.pl:196
36129 "If this option is I<not> given, then the output image will be just large "
36130 "enough to contain all the files, with not much wasted space."
36134 #: ../tools/virt-make-fs.pl:199
36136 "To choose a fixed size output disk, specify an absolute number followed by "
36137 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
36138 "Petabytes or Exabytes. This must be large enough to contain all the input "
36139 "files, else you will get an error."
36143 #: ../tools/virt-make-fs.pl:204
36145 "To leave extra space, specify C<+> (plus sign) and a number followed by "
36146 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
36147 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
36148 "the input files, and (approximately) an extra 200 MB free space."
36152 #: ../tools/virt-make-fs.pl:210
36154 "Note that virt-make-fs estimates free space, and therefore will not produce "
36155 "filesystems containing precisely the free space requested. (It is much more "
36156 "expensive and time-consuming to produce a filesystem which has precisely the "
36157 "desired free space)."
36161 #: ../tools/virt-make-fs.pl:219
36162 msgid "B<--format=E<lt>fmtE<gt>>"
36166 #: ../tools/virt-make-fs.pl:221
36167 msgid "B<-F E<lt>fmtE<gt>>"
36171 #: ../tools/virt-make-fs.pl:223
36172 msgid "Choose the output disk image format."
36176 #: ../tools/virt-make-fs.pl:225
36177 msgid "The default is C<raw> (raw disk image)."
36181 #: ../tools/virt-make-fs.pl:227
36183 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
36184 "that would really make sense here is C<qcow2>."
36188 #: ../tools/virt-make-fs.pl:234
36189 msgid "B<--type=E<lt>fsE<gt>>"
36193 #: ../tools/virt-make-fs.pl:236
36194 msgid "B<-t E<lt>fsE<gt>>"
36198 #: ../tools/virt-make-fs.pl:238
36199 msgid "Choose the output filesystem type."
36203 #: ../tools/virt-make-fs.pl:240
36204 msgid "The default is C<ext2>."
36208 #: ../tools/virt-make-fs.pl:242
36209 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
36213 #: ../tools/virt-make-fs.pl:249
36214 msgid "B<--partition>"
36218 #: ../tools/virt-make-fs.pl:251
36219 msgid "B<--partition=E<lt>parttypeE<gt>>"
36223 #: ../tools/virt-make-fs.pl:253
36225 "If specified, this flag adds an MBR partition table to the output disk "
36230 #: ../tools/virt-make-fs.pl:256
36232 "You can change the partition table type, eg. I<--partition=gpt> for large "
36237 #: ../tools/virt-make-fs.pl:259
36239 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
36240 "might consider the next parameter to be the partition type. For example:"
36244 #: ../tools/virt-make-fs.pl:263
36247 " virt-make-fs --partition input.tar ...\n"
36252 #: ../tools/virt-make-fs.pl:265
36254 "would cause virt-make-fs to think you wanted to use a partition type of "
36255 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
36256 "dash) between options and the input file argument:"
36260 #: ../tools/virt-make-fs.pl:269
36263 " virt-make-fs --partition -- input.tar ...\n"
36268 #: ../tools/virt-make-fs.pl:541
36270 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
36271 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
36272 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
36276 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
36278 "When reporting bugs, please enable debugging and capture the I<complete> "
36283 #: ../tools/virt-make-fs.pl:558
36286 " export LIBGUESTFS_DEBUG=1\n"
36287 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
36292 #: ../tools/virt-make-fs.pl:561
36294 "Attach /tmp/virt-make-fs.log to a new bug report at "
36295 "L<https://bugzilla.redhat.com/>"
36299 #: ../tools/virt-tar.pl:33
36300 msgid "virt-tar - Extract or upload files to a virtual machine"
36304 #: ../tools/virt-tar.pl:37
36307 " virt-tar [--options] -x domname directory tarball\n"
36312 #: ../tools/virt-tar.pl:39
36315 " virt-tar [--options] -u domname tarball directory\n"
36320 #: ../tools/virt-tar.pl:41
36323 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
36328 #: ../tools/virt-tar.pl:43
36331 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
36336 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
36341 #: ../tools/virt-tar.pl:47
36343 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
36344 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
36348 #: ../tools/virt-tar.pl:52
36349 msgid "Download C</home> from the VM into a local tarball:"
36353 #: ../tools/virt-tar.pl:54
36356 " virt-tar -x domname /home home.tar\n"
36361 #: ../tools/virt-tar.pl:56
36364 " virt-tar -zx domname /home home.tar.gz\n"
36369 #: ../tools/virt-tar.pl:58
36370 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
36374 #: ../tools/virt-tar.pl:60
36377 " virt-tar -u domname uploadstuff.tar /tmp\n"
36382 #: ../tools/virt-tar.pl:62
36385 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
36390 #: ../tools/virt-tar.pl:66
36392 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
36393 "virtual machines. If you do this, you risk disk corruption in the VM. "
36394 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
36398 #: ../tools/virt-tar.pl:71
36400 "You can use I<-x> (extract) on live virtual machines, but you might get "
36401 "inconsistent results or errors if there is filesystem activity inside the "
36402 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
36403 "work, but the only way to guarantee consistent results is if the virtual "
36404 "machine is shut down."
36408 #: ../tools/virt-tar.pl:79
36410 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
36411 "parts of a guest filesystem. There are many possibilities: making backups, "
36412 "uploading data files, snooping on guest activity, fixing or customizing "
36417 #: ../tools/virt-tar.pl:84
36419 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
36420 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
36421 "should look at the L<guestfish(1)> tool."
36425 #: ../tools/virt-tar.pl:88
36427 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
36428 "its contents (recursively) from the virtual machine into a local tarball. "
36429 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
36430 "virtual machine. You cannot use these two options together."
36434 #: ../tools/virt-tar.pl:94
36436 "In addition, you may need to use the I<-z> (gZip) option to enable "
36437 "compression. When uploading, you have to specify I<-z> if the upload file "
36438 "is compressed because virt-tar won't detect this on its own."
36442 #: ../tools/virt-tar.pl:98
36444 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
36445 "example it cannot do PKZip files or bzip2 compression. If you want that "
36446 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
36447 "the L<libguestfs(3)> API)."
36451 #: ../tools/virt-tar.pl:160
36452 msgid "B<--extract>"
36456 #: ../tools/virt-tar.pl:162
36457 msgid "B<--download>"
36461 #: ../tools/virt-tar.pl:164
36466 #: ../tools/virt-tar.pl:166
36467 msgid "B<--upload>"
36471 #: ../tools/virt-tar.pl:168
36473 "Use I<-x> to extract (download) a directory from a virtual machine to a "
36478 #: ../tools/virt-tar.pl:171
36480 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
36481 "Please read the L</WARNING> section above before using this option."
36485 #: ../tools/virt-tar.pl:175
36486 msgid "You must specify exactly one of these options."
36490 #: ../tools/virt-tar.pl:181
36495 #: ../tools/virt-tar.pl:183
36500 #: ../tools/virt-tar.pl:185
36501 msgid "Specify that the input or output tarball is gzip-compressed."
36505 #: ../tools/virt-tar.pl:298
36507 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
36508 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
36509 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
36510 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36514 #: ../tools/virt-win-reg.pl:37
36516 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
36521 #: ../tools/virt-win-reg.pl:41
36524 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
36529 #: ../tools/virt-win-reg.pl:43
36532 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
36537 #: ../tools/virt-win-reg.pl:45
36540 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
36545 #: ../tools/virt-win-reg.pl:47
36548 " virt-win-reg --merge domname [input.reg ...]\n"
36553 #: ../tools/virt-win-reg.pl:49
36556 " virt-win-reg [--options] disk.img ... # instead of domname\n"
36561 #: ../tools/virt-win-reg.pl:53
36563 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
36564 "virtual machines. If you do this, you I<will> get irreversible disk "
36565 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
36566 "but doesn't catch all cases."
36570 #: ../tools/virt-win-reg.pl:58
36572 "Modifying the Windows Registry is an inherently risky operation. The format "
36573 "is deliberately obscure and undocumented, and Registry changes can leave the "
36574 "system unbootable. Therefore when using the I<--merge> option, make sure "
36575 "you have a reliable backup first."
36579 #: ../tools/virt-win-reg.pl:65
36581 "This program can export and merge Windows Registry entries from a Windows "
36586 #: ../tools/virt-win-reg.pl:68
36588 "The first parameter is the libvirt guest name or the raw disk image of a "
36593 #: ../tools/virt-win-reg.pl:71
36595 "If I<--merge> is I<not> specified, then the chosen registry key is "
36596 "displayed/exported (recursively). For example:"
36600 #: ../tools/virt-win-reg.pl:74
36603 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
36608 #: ../tools/virt-win-reg.pl:76
36609 msgid "You can also display single values from within registry keys, for example:"
36613 #: ../tools/virt-win-reg.pl:79
36616 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
36617 " $ virt-win-reg Windows7 $cvkey ProductName\n"
36618 " Windows 7 Enterprise\n"
36623 #: ../tools/virt-win-reg.pl:83
36625 "With I<--merge>, you can merge a textual regedit file into the Windows "
36630 #: ../tools/virt-win-reg.pl:86
36633 " $ virt-win-reg --merge Windows7 changes.reg\n"
36638 #: ../tools/virt-win-reg.pl:90
36640 "This program is only meant for simple access to the registry. If you want "
36641 "to do complicated things with the registry, we suggest you download the "
36642 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
36643 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
36644 "L<hivexregedit(1)>."
36648 #: ../tools/virt-win-reg.pl:159
36653 #: ../tools/virt-win-reg.pl:161
36655 "In merge mode, this merges a textual regedit file into the Windows Registry "
36656 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
36657 "displays or exports Registry entries instead."
36661 #: ../tools/virt-win-reg.pl:165
36663 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
36664 "result in disk corruption. However exporting (without this flag) is always "
36669 #: ../tools/virt-win-reg.pl:173
36670 msgid "B<--encoding> UTF-16LE|ASCII"
36674 #: ../tools/virt-win-reg.pl:175
36676 "When merging (only), you may need to specify the encoding for strings to be "
36677 "used in the hive file. This is explained in detail in "
36678 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
36682 #: ../tools/virt-win-reg.pl:179
36684 "The default is to use UTF-16LE, which should work with recent versions of "
36689 #: ../tools/virt-win-reg.pl:186
36690 msgid "B<--unsafe-printable-strings>"
36694 #: ../tools/virt-win-reg.pl:188
36696 "When exporting (only), assume strings are UTF-16LE and print them as strings "
36697 "instead of hex sequences. Remove the final zero codepoint from strings if "
36702 #: ../tools/virt-win-reg.pl:192
36704 "This is unsafe and does not preserve the fidelity of strings in the original "
36705 "Registry for various reasons:"
36709 #: ../tools/virt-win-reg.pl:199
36711 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
36712 "other encodings will be corrupted by this transformation."
36716 #: ../tools/virt-win-reg.pl:204
36718 "Assumes that everything which has type 1 or 2 is really a string and that "
36719 "everything else is not a string, but the type field in real Registries is "
36724 #: ../tools/virt-win-reg.pl:210
36726 "Loses information about whether a zero codepoint followed the string in the "
36731 #: ../tools/virt-win-reg.pl:215
36733 "This all happens because the Registry itself contains no information about "
36734 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
36738 #: ../tools/virt-win-reg.pl:219
36740 "You should only use this option for quick hacking and debugging of the "
36741 "Registry contents, and I<never> use it if the output is going to be passed "
36742 "into another program or stored in another Registry."
36746 #: ../tools/virt-win-reg.pl:556
36747 msgid "SUPPORTED SYSTEMS"
36751 #: ../tools/virt-win-reg.pl:558
36753 "The program currently supports Windows NT-derived guests starting with "
36754 "Windows XP through to at least Windows 7."
36758 #: ../tools/virt-win-reg.pl:561
36759 msgid "The following Registry keys are supported:"
36763 #: ../tools/virt-win-reg.pl:565
36764 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
36768 #: ../tools/virt-win-reg.pl:567
36769 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
36773 #: ../tools/virt-win-reg.pl:569
36774 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
36778 #: ../tools/virt-win-reg.pl:571
36779 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
36783 #: ../tools/virt-win-reg.pl:573
36784 msgid "C<HKEY_USERS\\.DEFAULT>"
36788 #: ../tools/virt-win-reg.pl:575
36789 msgid "C<HKEY_USERS\\I<SID>>"
36793 #: ../tools/virt-win-reg.pl:577
36794 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
36798 #: ../tools/virt-win-reg.pl:579
36799 msgid "C<HKEY_USERS\\I<username>>"
36803 #: ../tools/virt-win-reg.pl:581
36804 msgid "where I<username> is a local user name (this is a libguestfs extension)."
36808 #: ../tools/virt-win-reg.pl:585
36810 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
36815 #: ../tools/virt-win-reg.pl:588
36817 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
36818 "supported (there is no \"current user\")."
36822 #: ../tools/virt-win-reg.pl:591
36827 #: ../tools/virt-win-reg.pl:593
36829 "C<virt-win-reg> expects that regedit files have already been reencoded in "
36830 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
36831 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
36832 "with Windows-style line endings, you may need to reencode the whole file "
36833 "before or after processing."
36837 #: ../tools/virt-win-reg.pl:599
36839 "To reencode a file from Windows format to Linux (before processing it with "
36840 "the I<--merge> option), you would do something like this:"
36844 #: ../tools/virt-win-reg.pl:602
36847 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
36852 #: ../tools/virt-win-reg.pl:604
36854 "To go in the opposite direction, after exporting and before sending the file "
36855 "to a Windows user, do something like this:"
36859 #: ../tools/virt-win-reg.pl:607
36862 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
36867 #: ../tools/virt-win-reg.pl:609
36868 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
36872 #: ../tools/virt-win-reg.pl:611
36874 "If you are unsure about the current encoding, use the L<file(1)> command. "
36875 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
36876 "Windows-style (CRLF) line endings, like this:"
36880 #: ../tools/virt-win-reg.pl:615
36883 " $ file software.reg\n"
36884 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
36885 " with CRLF line terminators\n"
36890 #: ../tools/virt-win-reg.pl:619
36891 msgid "This file would need conversion before you could I<--merge> it."
36895 #: ../tools/virt-win-reg.pl:621
36896 msgid "CurrentControlSet etc."
36900 #: ../tools/virt-win-reg.pl:623
36902 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
36903 "Registry at the level of the hive file, and therefore you cannot modify "
36908 #: ../tools/virt-win-reg.pl:627
36910 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
36911 "circumstances it might refer to another control set. The way to find out is "
36912 "to look at the C<HKLM\\SYSTEM\\Select> key:"
36916 #: ../tools/virt-win-reg.pl:631
36919 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
36920 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
36921 " \"Current\"=dword:00000001\n"
36922 " \"Default\"=dword:00000001\n"
36923 " \"Failed\"=dword:00000000\n"
36924 " \"LastKnownGood\"=dword:00000002\n"
36929 #: ../tools/virt-win-reg.pl:638
36930 msgid "\"Current\" is the one which Windows will choose when it boots."
36934 #: ../tools/virt-win-reg.pl:640
36935 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
36939 #: ../tools/virt-win-reg.pl:643
36940 msgid "WINDOWS TIPS"
36944 #: ../tools/virt-win-reg.pl:645
36946 "Note that some of these tips modify the guest disk image. The guest I<must> "
36947 "be shut off, else you will get disk corruption."
36951 #: ../tools/virt-win-reg.pl:648
36952 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
36956 #: ../tools/virt-win-reg.pl:650
36958 "Prepare a DOS batch script, VBScript or executable. Upload this using "
36959 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
36960 "is uploaded into C<C:\\>:"
36964 #: ../tools/virt-win-reg.pl:654
36967 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
36972 #: ../tools/virt-win-reg.pl:656
36973 msgid "Prepare a regedit file containing the registry change:"
36977 #: ../tools/virt-win-reg.pl:658
36980 " cat > test.reg <<'EOF'\n"
36981 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
36982 " \"Test\"=\"c:\\\\test.bat\"\n"
36988 #: ../tools/virt-win-reg.pl:663
36990 "In this example we use the key C<RunOnce> which means that the script will "
36991 "run precisely once when the first user logs in. If you want it to run every "
36992 "time a user logs in, replace C<RunOnce> with C<Run>."
36996 #: ../tools/virt-win-reg.pl:667
36997 msgid "Now update the registry:"
37001 #: ../tools/virt-win-reg.pl:669
37004 " virt-win-reg --merge WindowsGuest test.reg\n"
37009 #: ../tools/virt-win-reg.pl:671
37010 msgid "INSTALLING A SERVICE"
37014 #: ../tools/virt-win-reg.pl:673
37016 "This section assumes you are familiar with Windows services, and you either "
37017 "have a program which handles the Windows Service Control Protocol directly "
37018 "or you want to run any program using a service wrapper like SrvAny or the "
37023 #: ../tools/virt-win-reg.pl:678
37025 "First upload the program and optionally the service wrapper. In this case "
37026 "the test program is called C<test.exe> and we are using the RHSrvAny "
37031 #: ../tools/virt-win-reg.pl:682
37034 " guestfish -i -d WindowsGuest <<EOF\n"
37035 " upload rhsrvany.exe /rhsrvany.exe\n"
37036 " upload test.exe /test.exe\n"
37042 #: ../tools/virt-win-reg.pl:687
37044 "Prepare a regedit file containing the registry changes. In this example, "
37045 "the first registry change is needed for the service itself or the service "
37046 "wrapper (if used). The second registry change is only needed because I am "
37047 "using the RHSrvAny service wrapper."
37051 #: ../tools/virt-win-reg.pl:692
37054 " cat > service.reg <<'EOF'\n"
37055 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
37056 " \"Type\"=dword:00000010\n"
37057 " \"Start\"=dword:00000002\n"
37058 " \"ErrorControl\"=dword:00000001\n"
37059 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
37060 " \"DisplayName\"=\"RHSrvAny\"\n"
37061 " \"ObjectName\"=\"NetworkService\"\n"
37066 #: ../tools/virt-win-reg.pl:701
37069 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
37070 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
37071 " \"PWD\"=\"c:\\\\Temp\"\n"
37077 #: ../tools/virt-win-reg.pl:712
37079 "For use of C<ControlSet001> see the section above in this manual page. You "
37080 "may need to adjust this according to the control set that is in use by the "
37085 #: ../tools/virt-win-reg.pl:718
37087 "C<\"ObjectName\"> controls the privileges that the service will have. An "
37088 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
37089 "privileged account."
37093 #: ../tools/virt-win-reg.pl:724
37095 "For the meaning of the magic numbers, see this Microsoft KB article: "
37096 "L<http://support.microsoft.com/kb/103000>."
37100 #: ../tools/virt-win-reg.pl:729
37101 msgid "Update the registry:"
37105 #: ../tools/virt-win-reg.pl:731
37108 " virt-win-reg --merge WindowsGuest service.reg\n"
37113 #: ../tools/virt-win-reg.pl:735
37115 "Be careful when passing parameters containing C<\\> (backslash) in the "
37116 "shell. Usually you will have to use 'single quotes' or double backslashes "
37117 "(but not both) to protect them from the shell."
37121 #: ../tools/virt-win-reg.pl:739
37122 msgid "Paths and value names are case-insensitive."
37126 #: ../tools/virt-win-reg.pl:748
37128 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
37129 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
37130 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
37131 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37135 #: ../tools/virt-win-reg.pl:766
37138 " export LIBGUESTFS_DEBUG=1\n"
37139 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
37144 #: ../tools/virt-win-reg.pl:769
37146 "Attach /tmp/virt-win-reg.log to a new bug report at "
37147 "L<https://bugzilla.redhat.com/>"