1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
5 # rjones <rjones@redhat.com>, 2011.
8 "Project-Id-Version: libguestfs\n"
9 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
10 "POT-Creation-Date: 2011-09-14 18:20+0200\n"
11 "PO-Revision-Date: 2011-07-17 20:50+0000\n"
12 "Last-Translator: rjones <rjones@redhat.com>\n"
13 "Language-Team: Japanese (http://www.transifex.net/projects/p/fedora/team/"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=1; plural=0\n"
22 #: ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3
23 #: ../df/virt-df.pod:3 ../edit/virt-edit.pod:3
24 #: ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14
25 #: ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3
26 #: ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3
27 #: ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3
28 #: ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3
29 #: ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3
30 #: ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3
31 #: ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3
32 #: ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3
33 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
34 #: ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31
35 #: ../tools/virt-win-reg.pl:35
40 #: ../cat/virt-cat.pod:5
41 msgid "virt-cat - Display files in a virtual machine"
45 #: ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7
46 #: ../df/virt-df.pod:7 ../edit/virt-edit.pod:7
47 #: ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7
48 #: ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7
49 #: ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7
50 #: ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7
51 #: ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7
52 #: ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7
53 #: ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7
54 #: ../ruby/examples/guestfs-ruby.pod:7 ../src/guestfs.pod:7
55 #: ../test-tool/libguestfs-test-tool.pod:7
56 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
57 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
58 #: ../tools/virt-win-reg.pl:39
63 #: ../cat/virt-cat.pod:9
66 " virt-cat [--options] -d domname file [file ...]\n"
71 #: ../cat/virt-cat.pod:11
74 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
79 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
80 #: ../inspector/virt-inspector.pod:13
85 #: ../cat/virt-cat.pod:15
88 " virt-cat domname file\n"
93 #: ../cat/virt-cat.pod:17
96 " virt-cat disk.img file\n"
101 #: ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19
102 #: ../df/virt-df.pod:21 ../edit/virt-edit.pod:27
103 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
104 #: ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19
105 #: ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21
106 #: ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20
107 #: ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15
108 #: ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18
109 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29
110 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
111 #: ../src/guestfs.pod:23 ../test-tool/libguestfs-test-tool.pod:11
112 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
113 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
114 #: ../tools/virt-win-reg.pl:63
119 #: ../cat/virt-cat.pod:21
121 "C<virt-cat> is a command line tool to display the contents of C<file> where "
122 "C<file> exists in the named virtual machine (or disk image)."
126 #: ../cat/virt-cat.pod:24
128 "Multiple filenames can be given, in which case they are concatenated "
129 "together. Each filename must be a full path, starting at the root directory "
130 "(starting with '/')."
134 #: ../cat/virt-cat.pod:28
136 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
137 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
138 "(see L</USING GUESTFISH> below)."
142 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
143 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
144 #: ../fish/guestfish.pod:1018 ../fish/virt-copy-in.pod:29
145 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
146 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
147 #: ../resize/virt-resize.pod:27 ../tools/virt-tar.pl:50
152 #: ../cat/virt-cat.pod:34
154 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
158 #: ../cat/virt-cat.pod:37
161 " virt-cat -d mydomain /etc/fstab\n"
166 #: ../cat/virt-cat.pod:39
167 msgid "List syslog messages from a VM disk image file:"
171 #: ../cat/virt-cat.pod:41
174 " virt-cat -a disk.img /var/log/messages | tail\n"
179 #: ../cat/virt-cat.pod:43
180 msgid "Find out what DHCP IP address a VM acquired:"
184 #: ../cat/virt-cat.pod:45
187 " virt-cat -d mydomain /var/log/messages | \\\n"
188 " grep 'dhclient: bound to' | tail\n"
193 #: ../cat/virt-cat.pod:48
194 msgid "Find out what packages were recently installed:"
198 #: ../cat/virt-cat.pod:50
201 " virt-cat -d mydomain /var/log/yum.log | tail\n"
206 #: ../cat/virt-cat.pod:52
207 msgid "Find out who is logged on inside a virtual machine:"
211 #: ../cat/virt-cat.pod:54
214 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
220 #: ../cat/virt-cat.pod:57
221 msgid "or who was logged on:"
225 #: ../cat/virt-cat.pod:59
228 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
229 " last -f /tmp/wtmp\n"
234 #: ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91
235 #: ../cat/virt-ls.pod:261 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62
236 #: ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45
237 #: ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42
238 #: ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:83
239 #: ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84
240 #: ../resize/virt-resize.pod:241 ../test-tool/libguestfs-test-tool.pod:36
241 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
242 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
243 #: ../tools/virt-win-reg.pl:96
248 #: ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95
249 #: ../cat/virt-ls.pod:265 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66
250 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:151
251 #: ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88
252 #: ../resize/virt-resize.pod:245 ../test-tool/libguestfs-test-tool.pod:40
253 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62
254 #: ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111
255 #: ../tools/virt-win-reg.pl:104
260 #: ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97
261 #: ../cat/virt-ls.pod:267 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68
262 #: ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90
263 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64
264 #: ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113
265 #: ../tools/virt-win-reg.pl:106
266 msgid "Display brief help."
270 #: ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99
271 #: ../cat/virt-ls.pod:269 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70
272 #: ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
277 #: ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101
278 #: ../cat/virt-ls.pod:271 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72
279 #: ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
280 msgid "B<--add> file"
284 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
285 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
286 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
288 "Add I<file> which should be a disk image from a virtual machine. If the "
289 "virtual machine has multiple block devices, you must supply all of them with "
290 "separate I<-a> options."
294 #: ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107
295 #: ../cat/virt-ls.pod:277 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78
296 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:93
297 #: ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
299 "The format of the disk image is auto-detected. To override this and force a "
300 "particular format use the I<--format=..> option."
304 #: ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125
305 #: ../cat/virt-ls.pod:291 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
310 #: ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127
311 #: ../cat/virt-ls.pod:293 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
312 msgid "B<--connect> URI"
316 #: ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129
317 #: ../cat/virt-ls.pod:295 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99
318 #: ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111
319 #: ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82
320 #: ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
322 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
323 "to the default libvirt hypervisor."
327 #: ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132
328 #: ../cat/virt-ls.pod:298 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
330 "If you specify guest block devices directly (I<-a>), then libvirt is not "
335 #: ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141
336 #: ../cat/virt-ls.pod:307 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105
337 #: ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
342 #: ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143
343 #: ../cat/virt-ls.pod:309 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107
344 #: ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
345 msgid "B<--domain> guest"
349 #: ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145
350 #: ../cat/virt-ls.pod:311 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109
351 #: ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
353 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
358 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
359 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
360 #: ../fuse/guestmount.pod:126 ../inspector/virt-inspector.pod:92
361 msgid "B<--echo-keys>"
365 #: ../cat/virt-cat.pod:100
367 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
368 "so you cannot see what you are typing. If you are not worried about Tempest "
369 "attacks and there is no one else in the room you can specify this flag to "
370 "see what you are typing."
374 #: ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170
375 #: ../cat/virt-ls.pod:328 ../df/virt-df.pod:101 ../fish/guestfish.pod:233
376 #: ../fuse/guestmount.pod:133 ../inspector/virt-inspector.pod:99
377 #: ../rescue/virt-rescue.pod:124
378 msgid "B<--format=raw|qcow2|..>"
382 #: ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172
383 #: ../cat/virt-ls.pod:330 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134
384 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:135
385 #: ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
390 #: ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174
391 #: ../cat/virt-ls.pod:332 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136
392 #: ../fish/guestfish.pod:237 ../fuse/guestmount.pod:137
393 #: ../rescue/virt-rescue.pod:128
395 "The default for the I<-a> option is to auto-detect the format of the disk "
396 "image. Using this forces the disk format for I<-a> options which follow on "
397 "the command line. Using I<--format> with no argument switches back to auto-"
398 "detection for subsequent I<-a> options."
402 #: ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179
403 #: ../cat/virt-ls.pod:337 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141
404 #: ../fish/guestfish.pod:242 ../fish/guestfish.pod:673
405 #: ../inspector/virt-inspector.pod:336 ../rescue/virt-rescue.pod:133
406 #: ../src/guestfs.pod:2761
411 #: ../cat/virt-cat.pod:116
414 " virt-cat --format=raw -a disk.img file\n"
419 #: ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183
420 #: ../cat/virt-ls.pod:341 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145
421 #: ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
422 msgid "forces raw format (no auto-detection) for C<disk.img>."
426 #: ../cat/virt-cat.pod:120
429 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
434 #: ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187
435 #: ../cat/virt-ls.pod:345 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149
436 #: ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
438 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
439 "detection for C<another.img>."
443 #: ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190
444 #: ../cat/virt-ls.pod:348 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152
445 #: ../rescue/virt-rescue.pod:144
447 "If you have untrusted raw-format guest disk images, you should use this "
448 "option to specify the disk format. This avoids a possible security problem "
449 "with malicious guests (CVE-2010-3851)."
453 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
454 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
455 #: ../fuse/guestmount.pod:163 ../inspector/virt-inspector.pod:114
456 msgid "B<--keys-from-stdin>"
460 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
461 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
462 #: ../fuse/guestmount.pod:165 ../inspector/virt-inspector.pod:116
464 "Read key or passphrase parameters from stdin. The default is to try to read "
465 "passphrases from the user by opening C</dev/tty>."
469 #: ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261
470 #: ../cat/virt-ls.pod:425 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161
471 #: ../fish/guestfish.pod:390 ../fuse/guestmount.pod:257
472 #: ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:178
477 #: ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263
478 #: ../cat/virt-ls.pod:427 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163
479 #: ../fish/guestfish.pod:392 ../fuse/guestmount.pod:259
480 #: ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:180
485 #: ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265
486 #: ../cat/virt-ls.pod:429 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165
487 #: ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:182
488 msgid "Enable verbose messages for debugging."
492 #: ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267
493 #: ../cat/virt-ls.pod:431 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167
494 #: ../fish/guestfish.pod:397 ../fuse/guestmount.pod:263
495 #: ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:184
496 #: ../resize/virt-resize.pod:484
501 #: ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269
502 #: ../cat/virt-ls.pod:433 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169
503 #: ../fish/guestfish.pod:399 ../fuse/guestmount.pod:265
504 #: ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:186
505 #: ../resize/virt-resize.pod:486 ../tools/virt-list-filesystems.pl:69
506 #: ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169
507 #: ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
512 #: ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271
513 #: ../cat/virt-ls.pod:435 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171
514 #: ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:188
515 #: ../resize/virt-resize.pod:488 ../tools/virt-list-filesystems.pl:71
516 #: ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171
517 #: ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
518 msgid "Display version number and exit."
522 #: ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281
523 #: ../cat/virt-ls.pod:437 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173
524 #: ../fish/guestfish.pod:412 ../fuse/guestmount.pod:278
525 #: ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:199
526 #: ../tools/virt-tar.pl:158
531 #: ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283
532 #: ../cat/virt-ls.pod:439 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175
533 #: ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:201
534 msgid "Enable tracing of libguestfs API calls."
538 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
539 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:205
540 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
544 #: ../cat/virt-cat.pod:154
545 msgid "Previous versions of virt-cat allowed you to write either:"
549 #: ../cat/virt-cat.pod:156
552 " virt-cat disk.img [disk.img ...] file\n"
557 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
558 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:211
563 #: ../cat/virt-cat.pod:160
566 " virt-cat guestname file\n"
571 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
572 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:215
574 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
575 "the confusing case where a disk image might have the same name as a guest."
579 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
580 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:219
581 msgid "For compatibility the old style is still supported."
585 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
586 msgid "USING GUESTFISH"
590 #: ../cat/virt-cat.pod:170
592 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
593 "C<virt-cat> doesn't work."
597 #: ../cat/virt-cat.pod:173
598 msgid "Using C<virt-cat> is approximately equivalent to doing:"
602 #: ../cat/virt-cat.pod:175
605 " guestfish --ro -i -d domname download file -\n"
610 #: ../cat/virt-cat.pod:177
612 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
613 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
617 #: ../cat/virt-cat.pod:181
619 "The command above uses libguestfs's guest inspection feature and so does not "
620 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
621 "disk images that don't contain guests. To display a file from a disk image "
626 #: ../cat/virt-cat.pod:186
629 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
634 #: ../cat/virt-cat.pod:188
636 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
637 "the disk image, and C<file> is the full path to the file."
641 #: ../cat/virt-cat.pod:191 ../cat/virt-filesystems.pod:365
642 #: ../cat/virt-ls.pod:483 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342
643 #: ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:262
644 #: ../resize/virt-resize.pod:601 ../tools/virt-list-filesystems.pl:188
645 #: ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532
646 #: ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
647 msgid "SHELL QUOTING"
651 #: ../cat/virt-cat.pod:193 ../cat/virt-filesystems.pod:367
652 #: ../cat/virt-ls.pod:485 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344
653 #: ../inspector/virt-inspector.pod:354 ../rescue/virt-rescue.pod:264
654 #: ../resize/virt-resize.pod:603 ../tools/virt-list-filesystems.pl:190
655 #: ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534
656 #: ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
658 "Libvirt guest names can contain arbitrary characters, some of which have "
659 "meaning to the shell such as C<#> and space. You may need to quote or "
660 "escape these characters on the command line. See the shell manual page L<sh"
665 #: ../cat/virt-cat.pod:198 ../cat/virt-filesystems.pod:372
666 #: ../cat/virt-ls.pod:490 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349
667 #: ../fish/guestfish.pod:1081 ../fuse/guestmount.pod:303
668 #: ../inspector/virt-inspector.pod:375 ../resize/virt-resize.pod:608
669 #: ../test-tool/libguestfs-test-tool.pod:90
674 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374
675 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
676 #: ../fuse/guestmount.pod:305 ../inspector/virt-inspector.pod:377
677 #: ../resize/virt-resize.pod:610
679 "This program returns 0 if successful, or non-zero if there was an error."
683 #: ../cat/virt-cat.pod:203 ../cat/virt-filesystems.pod:377
684 #: ../cat/virt-ls.pod:495 ../df/virt-df.pod:227 ../edit/virt-edit.pod:354
685 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
686 #: ../fish/guestfish.pod:1235 ../fish/virt-copy-in.pod:50
687 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
688 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:308
689 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
690 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
691 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:284
692 #: ../resize/virt-resize.pod:613 ../ruby/examples/guestfs-ruby.pod:36
693 #: ../src/guestfs.pod:3135 ../test-tool/libguestfs-test-tool.pod:100
694 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
695 #: ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296
696 #: ../tools/virt-win-reg.pl:746
701 #: ../cat/virt-cat.pod:205
703 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
704 "tar-out(1)>, L<http://libguestfs.org/>."
708 #: ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:388
709 #: ../cat/virt-ls.pod:507 ../df/virt-df.pod:235 ../edit/virt-edit.pod:368
710 #: ../rescue/virt-rescue.pod:292 ../resize/virt-resize.pod:634
711 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277
712 #: ../tools/virt-make-fs.pl:564 ../tools/virt-tar.pl:311
713 #: ../tools/virt-win-reg.pl:772
718 #: ../cat/virt-cat.pod:214 ../cat/virt-filesystems.pod:390
719 #: ../cat/virt-ls.pod:509 ../df/virt-df.pod:237 ../edit/virt-edit.pod:370
720 #: ../inspector/virt-inspector.pod:395 ../rescue/virt-rescue.pod:294
721 #: ../resize/virt-resize.pod:636 ../tools/virt-list-filesystems.pl:210
722 #: ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:566
723 #: ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:774
724 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
728 #: ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:392
729 #: ../cat/virt-ls.pod:511 ../df/virt-df.pod:239 ../edit/virt-edit.pod:372
730 #: ../examples/guestfs-examples.pod:48 ../examples/guestfs-recipes.pod:400
731 #: ../fish/guestfish.pod:1264 ../fish/virt-copy-in.pod:64
732 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
733 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:323
734 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:61
735 #: ../ocaml/examples/guestfs-ocaml.pod:94 ../perl/examples/guestfs-perl.pod:55
736 #: ../python/examples/guestfs-python.pod:57 ../rescue/virt-rescue.pod:296
737 #: ../resize/virt-resize.pod:638 ../ruby/examples/guestfs-ruby.pod:51
738 #: ../src/guestfs.pod:3211 ../test-tool/libguestfs-test-tool.pod:110
739 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
740 #: ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315
741 #: ../tools/virt-win-reg.pl:776
746 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405
747 #: ../resize/virt-resize.pod:640
748 msgid "Copyright (C) 2010-2011 Red Hat Inc."
752 #: ../cat/virt-cat.pod:220 ../cat/virt-filesystems.pod:396
753 #: ../cat/virt-ls.pod:515 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376
754 #: ../fish/guestfish.pod:1269 ../fish/virt-copy-in.pod:69
755 #: ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67
756 #: ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:328
757 #: ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:300
758 #: ../resize/virt-resize.pod:642 ../test-tool/libguestfs-test-tool.pod:115
759 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
760 #: ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319
761 #: ../tools/virt-win-reg.pl:780
763 "This program is free software; you can redistribute it and/or modify it "
764 "under the terms of the GNU General Public License as published by the Free "
765 "Software Foundation; either version 2 of the License, or (at your option) "
770 #: ../cat/virt-cat.pod:225 ../cat/virt-filesystems.pod:401
771 #: ../cat/virt-ls.pod:520 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381
772 #: ../fish/guestfish.pod:1274 ../fish/virt-copy-in.pod:74
773 #: ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72
774 #: ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:333
775 #: ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:305
776 #: ../resize/virt-resize.pod:647 ../test-tool/libguestfs-test-tool.pod:120
777 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
778 #: ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324
779 #: ../tools/virt-win-reg.pl:785
781 "This program is distributed in the hope that it will be useful, but WITHOUT "
782 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
783 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
788 #: ../cat/virt-cat.pod:230 ../cat/virt-filesystems.pod:406
789 #: ../cat/virt-ls.pod:525 ../df/virt-df.pod:253 ../edit/virt-edit.pod:386
790 #: ../fish/guestfish.pod:1279 ../fish/virt-copy-in.pod:79
791 #: ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77
792 #: ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:338
793 #: ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:310
794 #: ../resize/virt-resize.pod:652 ../test-tool/libguestfs-test-tool.pod:125
795 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
796 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329
797 #: ../tools/virt-win-reg.pl:790
799 "You should have received a copy of the GNU General Public License along with "
800 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
801 "Ave, Cambridge, MA 02139, USA."
805 #: ../cat/virt-filesystems.pod:5
807 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
808 "virtual machine or disk image"
812 #: ../cat/virt-filesystems.pod:9
815 " virt-filesystems [--options] -d domname\n"
820 #: ../cat/virt-filesystems.pod:11
823 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
828 #: ../cat/virt-filesystems.pod:15
830 "This tool allows you to discover filesystems, partitions, logical volumes, "
831 "and their sizes in a disk image or virtual machine. It is a replacement for "
832 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
836 #: ../cat/virt-filesystems.pod:20
838 "One use for this tool is from shell scripts to iterate over all filesystems "
843 #: ../cat/virt-filesystems.pod:23
846 " for fs in $(virt-filesystems -a disk.img); do\n"
853 #: ../cat/virt-filesystems.pod:27
855 "Another use is to list partitions before using another tool to modify those "
856 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
857 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
861 #: ../cat/virt-filesystems.pod:32
863 "Various command line options control what this program displays. You need "
864 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
865 "guest respectively. If you just specify that then the program shows "
866 "filesystems found, one per line, like this:"
870 #: ../cat/virt-filesystems.pod:37
873 " $ virt-filesystems -a disk.img\n"
875 " /dev/vg_guest/lv_root\n"
880 #: ../cat/virt-filesystems.pod:41
882 "If you add I<-l> or I<--long> then the output includes extra information:"
886 #: ../cat/virt-filesystems.pod:44
889 " $ virt-filesystems -a disk.img -l\n"
890 " Name Type VFS Label Size\n"
891 " /dev/sda1 filesystem ext4 boot 524288000\n"
892 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
897 #: ../cat/virt-filesystems.pod:49
899 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
904 #: ../cat/virt-filesystems.pod:52
907 " $ virt-filesystems -a disk.img --extra\n"
909 " /dev/vg_guest/lv_root\n"
910 " /dev/vg_guest/lv_swap\n"
911 " /dev/vg_guest/lv_data\n"
916 #: ../cat/virt-filesystems.pod:58
918 "If you add I<--partitions> then partitions are shown instead of filesystems:"
922 #: ../cat/virt-filesystems.pod:60
925 " $ virt-filesystems -a disk.img --partitions\n"
932 #: ../cat/virt-filesystems.pod:64
934 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
935 "volumes>, I<--block-devices> to list those items."
939 #: ../cat/virt-filesystems.pod:67
941 "You can use these options in combination as well (if you want a combination "
942 "including filesystems, you have to add I<--filesystems>). Notice that some "
943 "items fall into several categories (eg. C</dev/sda1> might be both a "
944 "partition and a filesystem). These items are listed several times. To get "
945 "a list which includes absolutely everything that virt-filesystems knows "
946 "about, use the I<--all> option."
950 #: ../cat/virt-filesystems.pod:74
952 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
953 "uuid> option to display device and filesystem UUIDs in the long output."
957 #: ../cat/virt-filesystems.pod:78
959 "I<--all --long --uuid> is a useful combination to display all possible "
960 "information about everything."
964 #: ../cat/virt-filesystems.pod:81
967 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
968 " Name Type VFS Label Size Parent UUID\n"
969 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
970 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
971 " /dev/sda1 partition - - 100M /dev/sda -\n"
972 " /dev/sda2 partition - - 20G /dev/sda -\n"
973 " /dev/sda device - - 20G - -\n"
978 #: ../cat/virt-filesystems.pod:89
980 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
984 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
989 #: ../cat/virt-filesystems.pod:112
991 "Display everything. This is currently the same as specifying these options: "
992 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
993 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
994 "added to this list in future)."
998 #: ../cat/virt-filesystems.pod:117
999 msgid "See also I<--long>."
1003 #: ../cat/virt-filesystems.pod:119
1004 msgid "B<--blkdevs>"
1008 #: ../cat/virt-filesystems.pod:121
1009 msgid "B<--block-devices>"
1013 #: ../cat/virt-filesystems.pod:123
1014 msgid "Display block devices."
1018 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1023 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1025 "Write out the results in CSV format (comma-separated values). This format "
1026 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1027 "ABOUT CSV FORMAT> below."
1031 #: ../cat/virt-filesystems.pod:150
1033 "When prompting for keys and passphrases, virt-filesystems normally turns "
1034 "echoing off so you cannot see what you are typing. If you are not worried "
1035 "about Tempest attacks and there is no one else in the room you can specify "
1036 "this flag to see what you are typing."
1040 #: ../cat/virt-filesystems.pod:155
1045 #: ../cat/virt-filesystems.pod:157
1047 "This causes filesystems that are not ordinary, mountable filesystems to be "
1048 "displayed. This category includes swapspace, and filesystems that are empty "
1049 "or contain unknown data."
1053 #: ../cat/virt-filesystems.pod:161
1054 msgid "This option implies I<--filesystems>."
1058 #: ../cat/virt-filesystems.pod:163
1059 msgid "B<--filesystems>"
1063 #: ../cat/virt-filesystems.pod:165
1065 "Display mountable filesystems. If no display option was selected then this "
1066 "option is implied."
1070 #: ../cat/virt-filesystems.pod:168
1071 msgid "With I<--extra>, non-mountable filesystems are shown too."
1075 #: ../cat/virt-filesystems.pod:181
1078 " virt-filesystems --format=raw -a disk.img\n"
1083 #: ../cat/virt-filesystems.pod:185
1086 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1091 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1092 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1093 #: ../tools/virt-list-partitions.pl:109
1098 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1099 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1100 msgid "B<--human-readable>"
1104 #: ../cat/virt-filesystems.pod:198
1105 msgid "In I<--long> mode, display sizes in human-readable format."
1109 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1110 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1115 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1116 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1121 #: ../cat/virt-filesystems.pod:209
1122 msgid "Display extra columns of data (\"long format\")."
1126 #: ../cat/virt-filesystems.pod:211
1127 msgid "A title row is added unless you also specify I<--no-title>."
1131 #: ../cat/virt-filesystems.pod:213
1133 "The extra columns displayed depend on what output you select, and the "
1134 "ordering of columns may change in future versions. Use the title row, I<--"
1135 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1140 #: ../cat/virt-filesystems.pod:218
1142 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1143 "default is to show raw numbers of I<bytes>."
1147 #: ../cat/virt-filesystems.pod:221
1148 msgid "Use I<--uuid> to display UUIDs too."
1152 #: ../cat/virt-filesystems.pod:223
1157 #: ../cat/virt-filesystems.pod:225
1158 msgid "B<--logvols>"
1162 #: ../cat/virt-filesystems.pod:227
1163 msgid "B<--logical-volumes>"
1167 #: ../cat/virt-filesystems.pod:229
1169 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1170 "of whether the LVs contain filesystems."
1174 #: ../cat/virt-filesystems.pod:232
1175 msgid "B<--no-title>"
1179 #: ../cat/virt-filesystems.pod:234
1180 msgid "In I<--long> mode, don't add a title row."
1184 #: ../cat/virt-filesystems.pod:236
1186 "Note that the order of the columns is not fixed, and may change in future "
1187 "versions of virt-filesystems, so using this option may give you unexpected "
1192 #: ../cat/virt-filesystems.pod:240
1197 #: ../cat/virt-filesystems.pod:242
1198 msgid "B<--partitions>"
1202 #: ../cat/virt-filesystems.pod:244
1204 "Display partitions. In this mode, these are displayed irrespective of "
1205 "whether the partitions contain filesystems."
1209 #: ../cat/virt-filesystems.pod:247
1214 #: ../cat/virt-filesystems.pod:249
1215 msgid "B<--physvols>"
1219 #: ../cat/virt-filesystems.pod:251
1220 msgid "B<--physical-volumes>"
1224 #: ../cat/virt-filesystems.pod:253
1225 msgid "Display LVM physical volumes."
1229 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1234 #: ../cat/virt-filesystems.pod:257
1239 #: ../cat/virt-filesystems.pod:259
1240 msgid "In I<--long> mode, display UUIDs as well."
1244 #: ../cat/virt-filesystems.pod:273
1249 #: ../cat/virt-filesystems.pod:275
1250 msgid "B<--volgroups>"
1254 #: ../cat/virt-filesystems.pod:277
1255 msgid "B<--volume-groups>"
1259 #: ../cat/virt-filesystems.pod:279
1260 msgid "Display LVM volume groups."
1264 #: ../cat/virt-filesystems.pod:287
1269 #: ../cat/virt-filesystems.pod:289
1271 "Note that columns in the output are subject to reordering and change in "
1272 "future versions of this tool."
1276 #: ../cat/virt-filesystems.pod:294
1281 #: ../cat/virt-filesystems.pod:296
1282 msgid "The filesystem, partition, block device or LVM name."
1286 #: ../cat/virt-filesystems.pod:298
1288 "For device and partition names these are displayed as canonical libguestfs "
1289 "names, so that for example C</dev/sda2> is the second partition on the first "
1294 #: ../cat/virt-filesystems.pod:302
1296 "If the I<--long> option is B<not> specified, then only the name column is "
1297 "shown in the output."
1301 #: ../cat/virt-filesystems.pod:305
1306 #: ../cat/virt-filesystems.pod:307
1307 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1311 #: ../cat/virt-filesystems.pod:309
1316 #: ../cat/virt-filesystems.pod:311
1318 "If there is a filesystem, then this column displays the filesystem type if "
1319 "one could be detected, eg. C<ext4>."
1323 #: ../cat/virt-filesystems.pod:314
1328 #: ../cat/virt-filesystems.pod:316
1330 "If the object has a label (used for identifying and mounting filesystems) "
1331 "then this column contains the label."
1335 #: ../cat/virt-filesystems.pod:319
1340 #: ../cat/virt-filesystems.pod:321
1342 "The size of the object in bytes. If the I<--human> option is used then the "
1343 "size is displayed in a human-readable form."
1347 #: ../cat/virt-filesystems.pod:324
1352 #: ../cat/virt-filesystems.pod:326
1354 "The parent column records the parent relationship between objects. For "
1355 "example, if the object is a partition, then this column contains the name of "
1356 "the containing device. If the object is a logical volume, then this column "
1357 "is the name of the volume group."
1361 #: ../cat/virt-filesystems.pod:331
1366 #: ../cat/virt-filesystems.pod:333
1368 "If the object has a UUID (used for identifying and mounting filesystems and "
1369 "block devices) then this column contains the UUID as a string."
1373 #: ../cat/virt-filesystems.pod:337
1374 msgid "The UUID is only displayed if the I<--uuid> option is given."
1378 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459
1379 #: ../df/virt-df.pod:191
1380 msgid "NOTE ABOUT CSV FORMAT"
1384 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461
1385 #: ../df/virt-df.pod:193
1387 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1388 "should be easy to parse, but it is definitely not easy to parse."
1392 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464
1393 #: ../df/virt-df.pod:196
1395 "Myth: Just split fields at commas. Reality: This does I<not> work "
1396 "reliably. This example has two columns:"
1400 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467
1401 #: ../df/virt-df.pod:199
1404 " \"foo,bar\",baz\n"
1409 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469
1410 #: ../df/virt-df.pod:201
1412 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1413 "reliably. This example has one row:"
1417 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472
1418 #: ../df/virt-df.pod:204
1427 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475
1428 #: ../df/virt-df.pod:207
1430 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1431 "packaged in major Linux distributions)."
1435 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478
1436 #: ../df/virt-df.pod:210
1438 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1439 "or Python's built-in csv library)."
1443 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481
1444 #: ../df/virt-df.pod:213
1445 msgid "Most spreadsheets and databases can import CSV directly."
1449 #: ../cat/virt-filesystems.pod:379
1451 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
1452 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
1457 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570
1458 #: ../tools/virt-win-reg.pl:778
1459 msgid "Copyright (C) 2010 Red Hat Inc."
1463 #: ../cat/virt-ls.pod:5
1464 msgid "virt-ls - List files in a virtual machine"
1468 #: ../cat/virt-ls.pod:9
1471 " virt-ls [--options] -d domname directory [directory ...]\n"
1476 #: ../cat/virt-ls.pod:11
1479 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
1484 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1489 #: ../cat/virt-ls.pod:15
1492 " virt-ls [--options] domname directory\n"
1497 #: ../cat/virt-ls.pod:17
1500 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1505 #: ../cat/virt-ls.pod:21
1507 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1508 "more from a virtual machine or disk image."
1512 #: ../cat/virt-ls.pod:24
1514 "Multiple directory names can be given, in which case the output from each is "
1519 #: ../cat/virt-ls.pod:27
1521 "To list directories from a libvirt guest use the I<-d> option to specify the "
1522 "name of the guest. For a disk image, use the I<-a> option."
1526 #: ../cat/virt-ls.pod:31
1528 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1529 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
1534 #: ../cat/virt-ls.pod:37
1535 msgid "Get a list of all files and directories in a virtual machine:"
1539 #: ../cat/virt-ls.pod:39
1542 " virt-ls -R -d guest /\n"
1547 #: ../cat/virt-ls.pod:41
1548 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1552 #: ../cat/virt-ls.pod:43
1555 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1560 #: ../cat/virt-ls.pod:45
1561 msgid "List all public-writable directories in a Linux virtual machine:"
1565 #: ../cat/virt-ls.pod:47
1568 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1573 #: ../cat/virt-ls.pod:49
1574 msgid "List all Unix domain sockets in a Linux virtual machine:"
1578 #: ../cat/virt-ls.pod:51
1581 " virt-ls -lR -d guest / | grep '^s'\n"
1586 #: ../cat/virt-ls.pod:53
1587 msgid "List all regular files with filenames ending in '.png':"
1591 #: ../cat/virt-ls.pod:55
1594 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1599 #: ../cat/virt-ls.pod:57
1600 msgid "To display files larger than 10MB in home directories:"
1604 #: ../cat/virt-ls.pod:59
1607 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1612 #: ../cat/virt-ls.pod:61
1613 msgid "Find everything modified in the last 7 days:"
1617 #: ../cat/virt-ls.pod:63
1620 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1625 #: ../cat/virt-ls.pod:65
1626 msgid "Find regular files modified in the last 24 hours:"
1630 #: ../cat/virt-ls.pod:67
1633 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1638 #: ../cat/virt-ls.pod:69
1639 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1643 #: ../cat/virt-ls.pod:71
1645 "Find the differences between files in a guest and an earlier snapshot of the "
1650 #: ../cat/virt-ls.pod:74
1653 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1654 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1655 " diff -u old new | less\n"
1660 #: ../cat/virt-ls.pod:78
1662 "The commands above won't find files where the content has changed but the "
1663 "metadata (eg. file size and modification date) is the same. To do that, you "
1664 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
1665 "checksum> can be quite slow since it has to read and compute a checksum of "
1666 "every regular file in the virtual machine."
1670 #: ../cat/virt-ls.pod:84
1671 msgid "OUTPUT MODES"
1675 #: ../cat/virt-ls.pod:86
1677 "C<virt-ls> has four output modes, controlled by different combinations of "
1678 "the I<-l> and I<-R> options."
1682 #: ../cat/virt-ls.pod:89
1683 msgid "SIMPLE LISTING"
1687 #: ../cat/virt-ls.pod:91
1688 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1692 #: ../cat/virt-ls.pod:93
1695 " $ virt-ls -d guest /\n"
1703 #: ../cat/virt-ls.pod:98
1704 msgid "LONG LISTING"
1708 #: ../cat/virt-ls.pod:100
1710 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1711 "(more specifically, like the C<guestfs_ll> function)."
1715 #: ../cat/virt-ls.pod:103
1718 " $ virt-ls -l -d guest /\n"
1720 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
1721 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
1727 #: ../cat/virt-ls.pod:109
1729 "Note that while this is useful for displaying a directory, do not try "
1730 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
1735 #: ../cat/virt-ls.pod:113
1736 msgid "RECURSIVE LISTING"
1740 #: ../cat/virt-ls.pod:115
1742 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
1743 "and directories recursively:"
1747 #: ../cat/virt-ls.pod:118
1750 " $ virt-ls -R -d guest /tmp\n"
1758 #: ../cat/virt-ls.pod:123
1760 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
1761 "converts C<\\0> characters to C<\\n>."
1765 #: ../cat/virt-ls.pod:126
1766 msgid "RECURSIVE LONG LISTING"
1770 #: ../cat/virt-ls.pod:128
1772 "Using I<-lR> options together changes the output to display directories "
1773 "recursively, with file stats, and optionally other features such as "
1774 "checksums and extended attributes."
1778 #: ../cat/virt-ls.pod:132
1780 "Most of the interesting features of C<virt-ls> are only available when using "
1785 #: ../cat/virt-ls.pod:135
1787 "The fields are normally space-separated. Filenames are B<not> quoted, so "
1788 "you cannot use the output in another program (because filenames can contain "
1789 "spaces and other unsafe characters). If the guest was untrusted and someone "
1790 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
1791 "on you by creating filenames with embedded newline characters. To B<safely> "
1792 "parse the output in another program, use the I<--csv> (Comma-Separated "
1797 #: ../cat/virt-ls.pod:143
1799 "Note that this output format is completely unrelated to the C<ls -lR> "
1804 #: ../cat/virt-ls.pod:146
1807 " $ virt-ls -lR -d guest /bin\n"
1808 " d 0555 4096 /bin\n"
1809 " - 0755 123 /bin/alsaunmute\n"
1810 " - 0755 28328 /bin/arch\n"
1811 " l 0777 4 /bin/awk -> gawk\n"
1812 " - 0755 27216 /bin/basename\n"
1813 " - 0755 943360 /bin/bash\n"
1819 #: ../cat/virt-ls.pod:155
1820 msgid "These basic fields are always shown:"
1824 #: ../cat/virt-ls.pod:159
1829 #: ../cat/virt-ls.pod:161
1831 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
1832 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
1833 "link), C<s> (socket) or C<u> (unknown)."
1837 #: ../cat/virt-ls.pod:171
1842 #: ../cat/virt-ls.pod:173
1843 msgid "The Unix permissions, displayed as a 4 digit octal number."
1847 #: ../cat/virt-ls.pod:175
1852 #: ../cat/virt-ls.pod:177
1854 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
1855 "readable> option is given, in which case this is shown as a human-readable "
1860 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4188
1865 #: ../cat/virt-ls.pod:183
1866 msgid "The full path of the file or directory."
1870 #: ../cat/virt-ls.pod:185
1875 #: ../cat/virt-ls.pod:187
1876 msgid "For symbolic links only, the link target."
1880 #: ../cat/virt-ls.pod:191
1882 "In I<-lR> mode, additional command line options enable the display of more "
1887 #: ../cat/virt-ls.pod:194
1889 "With the I<--uids> flag, these additional fields are displayed before the "
1894 #: ../cat/virt-ls.pod:199
1899 #: ../cat/virt-ls.pod:201
1904 #: ../cat/virt-ls.pod:203
1906 "The UID and GID of the owner of the file (displayed numerically). Note "
1907 "these only make sense in the context of a Unix-like guest."
1911 #: ../cat/virt-ls.pod:208
1912 msgid "With the I<--times> flag, these additional fields are displayed:"
1916 #: ../cat/virt-ls.pod:212
1921 #: ../cat/virt-ls.pod:214
1922 msgid "The time of last access."
1926 #: ../cat/virt-ls.pod:216
1931 #: ../cat/virt-ls.pod:218
1932 msgid "The time of last modification."
1936 #: ../cat/virt-ls.pod:220
1941 #: ../cat/virt-ls.pod:222
1942 msgid "The time of last status change."
1946 #: ../cat/virt-ls.pod:226
1948 "The time fields are displayed as string dates and times, unless one of the "
1949 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
1953 #: ../cat/virt-ls.pod:229
1954 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
1958 #: ../cat/virt-ls.pod:233
1963 #: ../cat/virt-ls.pod:235
1965 "The device containing the file (displayed as major:minor). This may not "
1966 "match devices as known to the guest."
1970 #: ../cat/virt-ls.pod:238
1975 #: ../cat/virt-ls.pod:240
1976 msgid "The inode number."
1980 #: ../cat/virt-ls.pod:242
1985 #: ../cat/virt-ls.pod:244
1986 msgid "The number of hard links."
1990 #: ../cat/virt-ls.pod:246
1995 #: ../cat/virt-ls.pod:248
1997 "For block and char special files, the device (displayed as major:minor)."
2001 #: ../cat/virt-ls.pod:251
2006 #: ../cat/virt-ls.pod:253
2007 msgid "The number of 512 byte blocks allocated to the file."
2011 #: ../cat/virt-ls.pod:257
2013 "With the I<--checksum> flag, the checksum of the file contents is shown "
2014 "(only for regular files). Computing file checksums can take a considerable "
2019 #: ../cat/virt-ls.pod:280
2020 msgid "B<--checksum>"
2024 #: ../cat/virt-ls.pod:282
2025 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2029 #: ../cat/virt-ls.pod:284
2031 "Display checksum over file contents for regular files. With no argument, "
2032 "this defaults to using I<md5>. Using an argument, you can select the "
2033 "checksum type to use."
2037 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2038 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2039 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2041 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2046 #: ../cat/virt-ls.pod:316
2048 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2049 "so you cannot see what you are typing. If you are not worried about Tempest "
2050 "attacks and there is no one else in the room you can specify this flag to "
2051 "see what you are typing."
2055 #: ../cat/virt-ls.pod:321
2056 msgid "B<--extra-stats>"
2060 #: ../cat/virt-ls.pod:323
2061 msgid "Display extra stats."
2065 #: ../cat/virt-ls.pod:339
2068 " virt-ls --format=raw -a disk.img /dir\n"
2073 #: ../cat/virt-ls.pod:343
2076 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2081 #: ../cat/virt-ls.pod:356
2082 msgid "Display file sizes in human-readable format."
2086 #: ../cat/virt-ls.pod:370
2091 #: ../cat/virt-ls.pod:372
2092 msgid "B<--recursive>"
2096 #: ../cat/virt-ls.pod:374
2098 "Select the mode. With neither of these options, C<virt-ls> produces a "
2099 "simple, flat list of the files in the named directory. See L</SIMPLE "
2104 #: ../cat/virt-ls.pod:378
2106 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2111 #: ../cat/virt-ls.pod:381
2113 "C<virt-ls -R> produces a recursive list of files starting at the named "
2114 "directory. See L</RECURSIVE LISTING>."
2118 #: ../cat/virt-ls.pod:384
2120 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2121 "parsed. See L</RECURSIVE LONG LISTING>."
2125 #: ../cat/virt-ls.pod:387
2130 #: ../cat/virt-ls.pod:389
2131 msgid "Display time fields."
2135 #: ../cat/virt-ls.pod:394
2136 msgid "B<--time-days>"
2140 #: ../cat/virt-ls.pod:396
2141 msgid "Display time fields as days before now (negative if in the future)."
2145 #: ../cat/virt-ls.pod:398
2147 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2148 "of the file is between 0 and 86399 seconds."
2152 #: ../cat/virt-ls.pod:404
2153 msgid "B<--time-relative>"
2157 #: ../cat/virt-ls.pod:406
2158 msgid "Display time fields as seconds before now (negative if in the future)."
2162 #: ../cat/virt-ls.pod:411
2167 #: ../cat/virt-ls.pod:413
2168 msgid "Display time fields as seconds since the Unix epoch."
2172 #: ../cat/virt-ls.pod:418
2177 #: ../cat/virt-ls.pod:420
2178 msgid "Display UID and GID fields."
2182 #: ../cat/virt-ls.pod:445
2183 msgid "Previous versions of virt-ls allowed you to write either:"
2187 #: ../cat/virt-ls.pod:447
2190 " virt-ls disk.img [disk.img ...] /dir\n"
2195 #: ../cat/virt-ls.pod:451
2198 " virt-ls guestname /dir\n"
2203 #: ../cat/virt-ls.pod:497
2205 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2206 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2207 "L<http://libguestfs.org/>."
2211 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2212 #: ../rescue/virt-rescue.pod:298
2213 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2217 #: ../df/virt-df.pod:5
2218 msgid "virt-df - Display free space on virtual filesystems"
2222 #: ../df/virt-df.pod:9
2225 " virt-df [--options]\n"
2230 #: ../df/virt-df.pod:11
2233 " virt-df [--options] -d domname\n"
2238 #: ../df/virt-df.pod:13
2241 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
2246 #: ../df/virt-df.pod:17
2249 " virt-df [--options] domname\n"
2254 #: ../df/virt-df.pod:19
2257 " virt-df [--options] disk.img [disk.img ...]\n"
2262 #: ../df/virt-df.pod:23
2264 "C<virt-df> is a command line tool to display free space on virtual machine "
2265 "filesystems. Unlike other tools, it doesn't just display the size of disk "
2266 "allocated to a virtual machine, but can look inside disk images to see how "
2267 "much space is really being used."
2271 #: ../df/virt-df.pod:28
2273 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
2274 "to get a list of all active and inactive guests, and performs a C<df>-type "
2275 "operation on each one in turn, printing out the results."
2279 #: ../df/virt-df.pod:32
2281 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
2282 "type operation on either the single named libvirt domain, or on the disk "
2283 "image(s) listed on the command line (which must all belong to a single VM). "
2284 "In this mode (with arguments), C<virt-df> will I<only work for a single "
2285 "guest>. If you want to run on multiple guests, then you have to invoke "
2286 "C<virt-df> multiple times."
2290 #: ../df/virt-df.pod:39
2292 "Use the I<--csv> option to get a format which can be easily parsed by other "
2293 "programs. Other options are similar to the standard L<df(1)> command."
2297 #: ../df/virt-df.pod:45
2299 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
2300 "output human-readable:"
2304 #: ../df/virt-df.pod:48
2307 " # virt-df -d F14x64 -h\n"
2308 " Filesystem Size Used Available Use%\n"
2309 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
2310 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
2315 #: ../df/virt-df.pod:53
2316 msgid "Show disk usage for a disk image file called C<test.img>:"
2320 #: ../df/virt-df.pod:55
2323 " $ virt-df -a test1.img\n"
2324 " Filesystem 1K-blocks Used Available Use%\n"
2325 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
2330 #: ../df/virt-df.pod:112
2333 " virt-df --format=raw -a disk.img\n"
2338 #: ../df/virt-df.pod:116
2341 " virt-df --format=raw -a disk.img --format -a another.img\n"
2346 #: ../df/virt-df.pod:129
2347 msgid "Print sizes in human-readable format."
2351 #: ../df/virt-df.pod:131
2352 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
2356 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
2361 #: ../df/virt-df.pod:135
2366 #: ../df/virt-df.pod:137
2367 msgid "Print inodes instead of blocks."
2371 #: ../df/virt-df.pod:139
2372 msgid "B<--one-per-guest>"
2376 #: ../df/virt-df.pod:141
2378 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
2379 "disks from several guests to a single libguestfs appliance."
2383 #: ../df/virt-df.pod:144
2384 msgid "You might use this option in the following circumstances:"
2388 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
2389 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
2390 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
2391 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
2392 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
2393 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
2394 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
2395 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
2396 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
2397 #: ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:398
2398 #: ../fish/guestfish-actions.pod:405 ../fish/guestfish-actions.pod:412
2399 #: ../fish/guestfish-actions.pod:1104 ../fish/guestfish-actions.pod:1108
2400 #: ../fish/guestfish-actions.pod:1112 ../fish/guestfish-actions.pod:1116
2401 #: ../fish/guestfish-actions.pod:1124 ../fish/guestfish-actions.pod:1128
2402 #: ../fish/guestfish-actions.pod:1132 ../fish/guestfish-actions.pod:1142
2403 #: ../fish/guestfish-actions.pod:1146 ../fish/guestfish-actions.pod:1150
2404 #: ../fish/guestfish-actions.pod:1240 ../fish/guestfish-actions.pod:1244
2405 #: ../fish/guestfish-actions.pod:1249 ../fish/guestfish-actions.pod:1254
2406 #: ../fish/guestfish-actions.pod:1296 ../fish/guestfish-actions.pod:1300
2407 #: ../fish/guestfish-actions.pod:1305 ../fish/guestfish-actions.pod:1938
2408 #: ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1952
2409 #: ../fish/guestfish-actions.pod:1959 ../fish/guestfish-actions.pod:1966
2410 #: ../fish/guestfish.pod:445 ../fish/guestfish.pod:449
2411 #: ../fish/guestfish.pod:453 ../fish/guestfish.pod:457
2412 #: ../inspector/virt-inspector.pod:393 ../inspector/virt-inspector.pod:397
2413 #: ../resize/virt-resize.pod:282 ../resize/virt-resize.pod:286
2414 #: ../resize/virt-resize.pod:295 ../resize/virt-resize.pod:301
2415 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
2416 #: ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596
2417 #: ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610
2418 #: ../src/guestfs-actions.pod:1667 ../src/guestfs-actions.pod:1671
2419 #: ../src/guestfs-actions.pod:1675 ../src/guestfs-actions.pod:1679
2420 #: ../src/guestfs-actions.pod:1687 ../src/guestfs-actions.pod:1691
2421 #: ../src/guestfs-actions.pod:1695 ../src/guestfs-actions.pod:1705
2422 #: ../src/guestfs-actions.pod:1709 ../src/guestfs-actions.pod:1713
2423 #: ../src/guestfs-actions.pod:1851 ../src/guestfs-actions.pod:1855
2424 #: ../src/guestfs-actions.pod:1860 ../src/guestfs-actions.pod:1865
2425 #: ../src/guestfs-actions.pod:1926 ../src/guestfs-actions.pod:1930
2426 #: ../src/guestfs-actions.pod:1935 ../src/guestfs-actions.pod:2864
2427 #: ../src/guestfs-actions.pod:2870 ../src/guestfs-actions.pod:2878
2428 #: ../src/guestfs-actions.pod:2885 ../src/guestfs-actions.pod:2892
2429 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398
2430 #: ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411
2431 #: ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1064
2432 #: ../src/guestfs.pod:1068 ../src/guestfs.pod:1072 ../src/guestfs.pod:1077
2433 #: ../src/guestfs.pod:1085 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112
2434 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1138 ../src/guestfs.pod:1142
2435 #: ../src/guestfs.pod:1146 ../src/guestfs.pod:1150 ../src/guestfs.pod:1154
2436 #: ../src/guestfs.pod:1644 ../src/guestfs.pod:1649 ../src/guestfs.pod:1653
2437 #: ../src/guestfs.pod:1755 ../src/guestfs.pod:1760 ../src/guestfs.pod:1764
2438 #: ../src/guestfs.pod:1774 ../src/guestfs.pod:2063 ../src/guestfs.pod:2068
2439 #: ../src/guestfs.pod:2074 ../src/guestfs.pod:2082 ../src/guestfs.pod:2529
2440 #: ../src/guestfs.pod:2535 ../src/guestfs.pod:2540 ../src/guestfs.pod:2546
2441 #: ../src/guestfs.pod:2927 ../src/guestfs.pod:2932 ../src/guestfs.pod:2936
2442 #: ../src/guestfs.pod:2940 ../src/guestfs.pod:2944 ../src/guestfs.pod:2958
2443 #: ../src/guestfs.pod:2963 ../src/guestfs.pod:3188 ../src/guestfs.pod:3192
2444 #: ../src/guestfs.pod:3196 ../src/guestfs.pod:3200
2445 #: ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202
2446 #: ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:710
2447 #: ../tools/virt-win-reg.pl:716 ../tools/virt-win-reg.pl:722
2452 #: ../df/virt-df.pod:150
2454 "If you think an untrusted guest might actively try to exploit the libguestfs "
2455 "appliance kernel, then this prevents one guest from interfering with the "
2456 "stats printed for another guest."
2460 #: ../df/virt-df.pod:156
2462 "If the kernel has a bug which stops it from accessing a filesystem in one "
2463 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
2464 "and report stats for further guests."
2468 #: ../df/virt-df.pod:165
2470 "Print UUIDs instead of names. This is useful for following a guest even "
2471 "when the guest is migrated or renamed, or when two guests happen to have the "
2476 #: ../df/virt-df.pod:169
2478 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
2479 "images, we still print the disk image name even when this option is "
2484 #: ../df/virt-df.pod:229
2486 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
2491 #: ../edit/virt-edit.pod:5
2492 msgid "virt-edit - Edit a file in a virtual machine"
2496 #: ../edit/virt-edit.pod:9
2499 " virt-edit [--options] -d domname file [file ...]\n"
2504 #: ../edit/virt-edit.pod:11
2507 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
2512 #: ../edit/virt-edit.pod:13
2515 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
2520 #: ../edit/virt-edit.pod:17
2523 " virt-edit domname file\n"
2528 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
2531 " virt-edit disk.img [disk.img ...] file\n"
2536 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
2537 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
2538 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
2539 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
2544 #: ../edit/virt-edit.pod:23
2546 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
2547 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
2548 "doing this, but doesn't catch all cases."
2552 #: ../edit/virt-edit.pod:29
2554 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
2555 "exists in the named virtual machine (or disk image)."
2559 #: ../edit/virt-edit.pod:32
2561 "Multiple filenames can be given, in which case they are each edited in "
2562 "turn. Each filename must be a full path, starting at the root directory "
2563 "(starting with '/')."
2567 #: ../edit/virt-edit.pod:36
2568 msgid "If you want to just view a file, use L<virt-cat(1)>."
2572 #: ../edit/virt-edit.pod:38
2574 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
2575 "USING GUESTFISH> below)."
2579 #: ../edit/virt-edit.pod:41
2581 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
2582 "that and much more."
2586 #: ../edit/virt-edit.pod:46
2587 msgid "Edit the named files interactively:"
2591 #: ../edit/virt-edit.pod:48
2594 " virt-edit -d mydomain /boot/grub/grub.conf\n"
2599 #: ../edit/virt-edit.pod:50
2602 " virt-edit -d mydomain /etc/passwd\n"
2607 #: ../edit/virt-edit.pod:52
2608 msgid "For Windows guests, some Windows paths are understood:"
2612 #: ../edit/virt-edit.pod:54
2615 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
2620 #: ../edit/virt-edit.pod:56
2622 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
2623 "INTERACTIVE EDITING> below). To change the init default level to 5:"
2627 #: ../edit/virt-edit.pod:60
2630 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
2635 #: ../edit/virt-edit.pod:81
2636 msgid "B<-b> extension"
2640 #: ../edit/virt-edit.pod:83
2641 msgid "B<--backup> extension"
2645 #: ../edit/virt-edit.pod:85
2647 "Create a backup of the original file I<in the guest disk image>. The backup "
2648 "has the original filename with C<extension> added."
2652 #: ../edit/virt-edit.pod:88
2654 "Usually the first character of C<extension> would be a dot C<.> so you would "
2659 #: ../edit/virt-edit.pod:91
2662 " virt-edit -b .orig [etc]\n"
2667 #: ../edit/virt-edit.pod:93
2668 msgid "By default, no backup file is made."
2672 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
2673 #: ../fuse/guestmount.pod:96 ../inspector/virt-inspector.pod:74
2674 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
2675 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
2680 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
2681 #: ../fuse/guestmount.pod:98 ../inspector/virt-inspector.pod:76
2682 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
2683 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
2684 msgid "B<--connect URI>"
2688 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
2689 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
2690 #: ../tools/virt-win-reg.pl:135
2692 "If you specify guest block devices directly, then libvirt is not used at all."
2696 #: ../edit/virt-edit.pod:114
2698 "When prompting for keys and passphrases, virt-edit normally turns echoing "
2699 "off so you cannot see what you are typing. If you are not worried about "
2700 "Tempest attacks and there is no one else in the room you can specify this "
2701 "flag to see what you are typing."
2705 #: ../edit/virt-edit.pod:119
2710 #: ../edit/virt-edit.pod:121
2711 msgid "B<--expr> EXPR"
2715 #: ../edit/virt-edit.pod:123
2717 "Instead of launching the external editor, non-interactively apply the Perl "
2718 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
2723 #: ../edit/virt-edit.pod:127
2725 "Be careful to properly quote the expression to prevent it from being altered "
2730 #: ../edit/virt-edit.pod:130
2731 msgid "Note that this option is only available when Perl 5 is installed."
2735 #: ../edit/virt-edit.pod:132
2736 msgid "B<--format> raw|qcow2|..."
2740 #: ../edit/virt-edit.pod:143
2743 " virt-edit --format=raw -a disk.img file\n"
2748 #: ../edit/virt-edit.pod:147
2751 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
2756 #: ../edit/virt-edit.pod:181
2757 msgid "Previous versions of virt-edit allowed you to write either:"
2761 #: ../edit/virt-edit.pod:187
2764 " virt-edit guestname file\n"
2769 #: ../edit/virt-edit.pod:195
2770 msgid "NON-INTERACTIVE EDITING"
2774 #: ../edit/virt-edit.pod:197
2776 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
2777 "administrator can interactively edit the file."
2781 #: ../edit/virt-edit.pod:200
2783 "There are two ways also to use C<virt-edit> from scripts in order to make "
2784 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
2785 "like this, it's less error-prone to write scripts directly using the "
2786 "libguestfs API and Augeas for configuration file editing.)"
2790 #: ../edit/virt-edit.pod:206
2792 "The first method is to temporarily set C<$EDITOR> to any script or program "
2793 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
2794 "update C<tmpfile> in place however it likes."
2798 #: ../edit/virt-edit.pod:210
2800 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
2801 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
2802 "instances of C<foo> with C<bar> in a file:"
2806 #: ../edit/virt-edit.pod:214
2809 " virt-edit -d domname filename -e 's/foo/bar/'\n"
2814 #: ../edit/virt-edit.pod:216
2816 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
2817 "For example to delete root's password you could do:"
2821 #: ../edit/virt-edit.pod:219
2824 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
2829 #: ../edit/virt-edit.pod:221
2831 "What really happens is that the snippet is evaluated as a Perl expression "
2832 "for each line of the file. The line, including the final C<\\n>, is passed "
2833 "in C<$_> and the expression should update C<$_> or leave it unchanged."
2837 #: ../edit/virt-edit.pod:226
2839 "To delete a line, set C<$_> to the empty string. For example, to delete the "
2840 "C<apache> user account from the password file you can do:"
2844 #: ../edit/virt-edit.pod:229
2847 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
2852 #: ../edit/virt-edit.pod:231
2854 "To insert a line, prepend or append it to C<$_>. However appending lines to "
2855 "the end of the file is rather difficult this way since there is no concept "
2856 "of \"last line of the file\" - your expression just doesn't get called "
2857 "again. You might want to use the first method (setting C<$EDITOR>) if you "
2862 #: ../edit/virt-edit.pod:237
2864 "The variable C<$lineno> contains the current line number. As is "
2865 "traditional, the first line in the file is number C<1>."
2869 #: ../edit/virt-edit.pod:240
2871 "The return value from the expression is ignored, but the expression may call "
2872 "C<die> in order to abort the whole program, leaving the original file "
2877 #: ../edit/virt-edit.pod:244
2879 "Remember when matching the end of a line that C<$_> may contain the final C<"
2880 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
2881 "newline then neither of these. Thus to match or substitute some text at the "
2882 "end of a line, use this regular expression:"
2886 #: ../edit/virt-edit.pod:249
2889 " /some text(\\r?\\n)?$/\n"
2894 #: ../edit/virt-edit.pod:251
2896 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
2897 "$_> itself (since that would remove all newlines from the file):"
2901 #: ../edit/virt-edit.pod:255
2904 " my $m = $_; chomp $m; $m =~ /some text$/\n"
2909 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
2910 msgid "WINDOWS PATHS"
2914 #: ../edit/virt-edit.pod:259
2916 "C<virt-edit> has a limited ability to understand Windows drive letters and "
2917 "paths (eg. C<E:\\foo\\bar.txt>)."
2921 #: ../edit/virt-edit.pod:262
2922 msgid "If and only if the guest is running Windows then:"
2926 #: ../edit/virt-edit.pod:268
2928 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
2929 "to the correct filesystem."
2933 #: ../edit/virt-edit.pod:273
2935 "Any backslash (C<\\>) characters in the path are replaced with forward "
2936 "slashes so that libguestfs can process it."
2940 #: ../edit/virt-edit.pod:278
2942 "The path is resolved case insensitively to locate the file that should be "
2947 #: ../edit/virt-edit.pod:283
2948 msgid "There are some known shortcomings:"
2952 #: ../edit/virt-edit.pod:289
2953 msgid "Some NTFS symbolic links may not be followed correctly."
2957 #: ../edit/virt-edit.pod:293
2958 msgid "NTFS junction points that cross filesystems are not followed."
2962 #: ../edit/virt-edit.pod:299
2964 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
2965 "C<virt-edit> doesn't work."
2969 #: ../edit/virt-edit.pod:302
2970 msgid "Using C<virt-edit> is approximately equivalent to doing:"
2974 #: ../edit/virt-edit.pod:304
2977 " guestfish --rw -i -d domname edit /file\n"
2982 #: ../edit/virt-edit.pod:306
2984 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
2989 #: ../edit/virt-edit.pod:309
2991 "The command above uses libguestfs's guest inspection feature and so does not "
2992 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
2993 "disk images that don't contain guests. To edit a file on a disk image "
2998 #: ../edit/virt-edit.pod:314
3001 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
3006 #: ../edit/virt-edit.pod:316
3008 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
3009 "the disk image to edit, and C</file> is the full path to the file."
3013 #: ../edit/virt-edit.pod:320
3015 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
3016 "C<write> or C<upload> instead:"
3020 #: ../edit/virt-edit.pod:323
3023 " guestfish --rw -i -d domname touch /newfile\n"
3028 #: ../edit/virt-edit.pod:325
3031 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
3036 #: ../edit/virt-edit.pod:327
3039 " guestfish --rw -i -d domname upload localfile /newfile\n"
3044 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1086
3045 #: ../rescue/virt-rescue.pod:257 ../src/guestfs.pod:3074
3046 #: ../test-tool/libguestfs-test-tool.pod:95
3047 msgid "ENVIRONMENT VARIABLES"
3051 #: ../edit/virt-edit.pod:333
3056 #: ../edit/virt-edit.pod:335
3058 "If set, this string is used as the editor. It may contain arguments, eg. C<"
3063 #: ../edit/virt-edit.pod:338
3064 msgid "If not set, C<vi> is used."
3068 #: ../edit/virt-edit.pod:356
3070 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
3071 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
3072 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
3076 #: ../examples/guestfs-examples.pod:5
3077 msgid "guestfs-examples - Examples of using libguestfs from C"
3081 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
3084 " #include <guestfs.h>\n"
3089 #: ../examples/guestfs-examples.pod:11
3092 " guestfs_h *g = guestfs_create ();\n"
3093 " guestfs_add_drive_ro (g, \"disk.img\");\n"
3094 " guestfs_launch (g);\n"
3099 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
3102 " cc prog.c -o prog -lguestfs\n"
3104 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
3109 #: ../examples/guestfs-examples.pod:21
3111 "This manual page contains examples of calling libguestfs from the C "
3112 "programming language. If you are not familiar with using libguestfs, you "
3113 "also need to read L<guestfs(3)>."
3117 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
3118 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
3119 #: ../python/examples/guestfs-python.pod:34
3120 #: ../ruby/examples/guestfs-ruby.pod:28
3121 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
3125 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
3126 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
3127 #: ../python/examples/guestfs-python.pod:36
3128 #: ../ruby/examples/guestfs-ruby.pod:30
3133 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
3134 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
3135 #: ../python/examples/guestfs-python.pod:38
3136 #: ../ruby/examples/guestfs-ruby.pod:32
3137 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
3141 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
3142 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
3143 #: ../python/examples/guestfs-python.pod:40
3144 #: ../ruby/examples/guestfs-ruby.pod:34
3149 #: ../examples/guestfs-examples.pod:35
3151 "L<guestfs(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
3152 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
3157 #: ../examples/guestfs-examples.pod:44 ../examples/guestfs-recipes.pod:396
3158 #: ../fish/guestfish.pod:1260 ../fish/virt-copy-in.pod:60
3159 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
3160 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:319
3161 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:57
3162 #: ../ocaml/examples/guestfs-ocaml.pod:90 ../perl/examples/guestfs-perl.pod:51
3163 #: ../python/examples/guestfs-python.pod:53
3164 #: ../ruby/examples/guestfs-ruby.pod:47 ../src/guestfs.pod:3207
3165 #: ../test-tool/libguestfs-test-tool.pod:106
3170 #: ../examples/guestfs-examples.pod:46 ../examples/guestfs-recipes.pod:398
3171 #: ../fish/guestfish.pod:1262 ../fish/virt-copy-in.pod:62
3172 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
3173 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:321
3174 #: ../java/examples/guestfs-java.pod:59 ../ocaml/examples/guestfs-ocaml.pod:92
3175 #: ../perl/examples/guestfs-perl.pod:53
3176 #: ../python/examples/guestfs-python.pod:55
3177 #: ../ruby/examples/guestfs-ruby.pod:49 ../src/guestfs.pod:3209
3178 #: ../test-tool/libguestfs-test-tool.pod:108
3179 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3183 #: ../examples/guestfs-examples.pod:50 ../ocaml/examples/guestfs-ocaml.pod:96
3184 #: ../python/examples/guestfs-python.pod:59
3185 #: ../ruby/examples/guestfs-ruby.pod:53
3186 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
3190 #: ../examples/guestfs-examples.pod:52 ../examples/guestfs-recipes.pod:404
3191 #: ../java/examples/guestfs-java.pod:65 ../ocaml/examples/guestfs-ocaml.pod:98
3192 #: ../perl/examples/guestfs-perl.pod:59
3193 #: ../python/examples/guestfs-python.pod:61
3194 #: ../ruby/examples/guestfs-ruby.pod:55
3196 "The examples in this manual page may be freely copied, modified and "
3197 "distributed without any restrictions."
3201 #: ../examples/guestfs-examples.pod:55 ../examples/guestfs-recipes.pod:407
3202 #: ../java/examples/guestfs-java.pod:68
3203 #: ../ocaml/examples/guestfs-ocaml.pod:101
3204 #: ../perl/examples/guestfs-perl.pod:62
3205 #: ../python/examples/guestfs-python.pod:64
3206 #: ../ruby/examples/guestfs-ruby.pod:58 ../src/guestfs.pod:3216
3208 "This library is free software; you can redistribute it and/or modify it "
3209 "under the terms of the GNU Lesser General Public License as published by the "
3210 "Free Software Foundation; either version 2 of the License, or (at your "
3211 "option) any later version."
3215 #: ../examples/guestfs-examples.pod:60 ../examples/guestfs-recipes.pod:412
3216 #: ../java/examples/guestfs-java.pod:73
3217 #: ../ocaml/examples/guestfs-ocaml.pod:106
3218 #: ../perl/examples/guestfs-perl.pod:67
3219 #: ../python/examples/guestfs-python.pod:69
3220 #: ../ruby/examples/guestfs-ruby.pod:63 ../src/guestfs.pod:3221
3222 "This library is distributed in the hope that it will be useful, but WITHOUT "
3223 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3224 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3229 #: ../examples/guestfs-examples.pod:65 ../examples/guestfs-recipes.pod:417
3230 #: ../java/examples/guestfs-java.pod:78
3231 #: ../ocaml/examples/guestfs-ocaml.pod:111
3232 #: ../perl/examples/guestfs-perl.pod:72
3233 #: ../python/examples/guestfs-python.pod:74
3234 #: ../ruby/examples/guestfs-ruby.pod:68 ../src/guestfs.pod:3226
3236 "You should have received a copy of the GNU Lesser General Public License "
3237 "along with this library; if not, write to the Free Software Foundation, "
3238 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3242 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
3247 #: ../examples/guestfs-recipes.pod:5
3249 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
3250 "here. The only way which works for both sorts of output is to just write "
3251 "the URL directly. Do NOT use L<...> for URLs."
3255 #: ../examples/guestfs-recipes.pod:9
3257 "We break with tradition here and don't use ALL CAPS for the section "
3258 "headings, as this makes them much easier to read."
3262 #: ../examples/guestfs-recipes.pod:16
3263 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
3267 #: ../examples/guestfs-recipes.pod:20
3269 "This page contains recipes for and links to things you can do using "
3270 "libguestfs, L<guestfish(1)> and the virt tools."
3274 #: ../examples/guestfs-recipes.pod:23
3275 msgid "Audit a virtual machine for setuid files"
3279 #: ../examples/guestfs-recipes.pod:25
3281 "The link below contains a small program which can be used to audit a Linux "
3282 "virtual machine to see what setuid and setgid files it contains."
3286 #: ../examples/guestfs-recipes.pod:28
3288 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
3293 #: ../examples/guestfs-recipes.pod:30
3294 msgid "Change the background image in a Windows XP VM"
3298 #: ../examples/guestfs-recipes.pod:32
3300 "The links below explain how to use L<guestfish(1)> to change the background "
3301 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
3302 "be substantially different for each version of Windows."
3306 #: ../examples/guestfs-recipes.pod:37
3308 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
3309 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
3313 #: ../examples/guestfs-recipes.pod:40
3314 msgid "Cloning a virtual machine (Linux)"
3318 #: ../examples/guestfs-recipes.pod:42
3320 "The guestfish technique described in the link below works well for most "
3321 "Linux VMs. Depending on the Linux distro you may need to change the paths "
3326 #: ../examples/guestfs-recipes.pod:46
3328 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
3333 #: ../examples/guestfs-recipes.pod:48
3335 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
3340 #: ../examples/guestfs-recipes.pod:51
3341 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
3345 #: ../examples/guestfs-recipes.pod:53
3346 msgid "Cloning a virtual machine (Windows)"
3350 #: ../examples/guestfs-recipes.pod:55
3352 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
3353 "straightforward. Currently there is code in the Aeolus Oz project which "
3354 "does this (using libguestfs). As part of our review of the virt-clone tool, "
3355 "we may add sysprepping ability."
3359 #: ../examples/guestfs-recipes.pod:60
3361 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
3362 "list/2011-May/msg00019.html"
3366 #: ../examples/guestfs-recipes.pod:63
3367 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
3371 #: ../examples/guestfs-recipes.pod:65
3372 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
3376 #: ../examples/guestfs-recipes.pod:67
3379 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
3384 #: ../examples/guestfs-recipes.pod:69
3385 msgid "To export just a subdirectory, eg. C</files>, do:"
3389 #: ../examples/guestfs-recipes.pod:71
3392 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3397 #: ../examples/guestfs-recipes.pod:73
3398 msgid "Create empty disk images"
3402 #: ../examples/guestfs-recipes.pod:75
3404 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3405 "The useful guide below explains the options available."
3409 #: ../examples/guestfs-recipes.pod:78
3411 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
3416 #: ../examples/guestfs-recipes.pod:80
3417 msgid "Dump raw filesystem content from inside a disk image or VM"
3421 #: ../examples/guestfs-recipes.pod:82
3423 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3424 "filesystem content from any filesystem in a disk image or a VM (even one "
3425 "which is encrypted or buried inside an LV):"
3429 #: ../examples/guestfs-recipes.pod:86
3432 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3437 #: ../examples/guestfs-recipes.pod:88
3440 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3445 #: ../examples/guestfs-recipes.pod:90
3446 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
3450 #: ../examples/guestfs-recipes.pod:92
3451 msgid "Edit grub configuration in a VM"
3455 #: ../examples/guestfs-recipes.pod:94
3456 msgid "You can use this to:"
3460 #: ../examples/guestfs-recipes.pod:100
3461 msgid "Fix a virtual machine that does not boot."
3465 #: ../examples/guestfs-recipes.pod:104
3466 msgid "Change which kernel is used to boot the VM."
3470 #: ../examples/guestfs-recipes.pod:108
3471 msgid "Change kernel command line options."
3475 #: ../examples/guestfs-recipes.pod:112
3476 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
3480 #: ../examples/guestfs-recipes.pod:114
3483 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
3488 #: ../examples/guestfs-recipes.pod:116
3490 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
3495 #: ../examples/guestfs-recipes.pod:119
3498 " virt-rescue -d BrokenGuest\n"
3503 #: ../examples/guestfs-recipes.pod:121
3504 msgid "Export any directory from a VM"
3508 #: ../examples/guestfs-recipes.pod:123
3510 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
3514 #: ../examples/guestfs-recipes.pod:126
3517 " virt-copy-out -d Guest /home .\n"
3522 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
3523 #: ../fish/guestfish-actions.pod:1292 ../fish/guestfish-actions.pod:1934
3524 #: ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:1922
3525 #: ../src/guestfs-actions.pod:2860 ../src/guestfs.pod:1640
3526 #: ../tools/virt-win-reg.pl:706
3531 #: ../examples/guestfs-recipes.pod:134
3533 "The final dot of the command is not a printing error. It means we want to "
3534 "copy out to the current directory."
3538 #: ../examples/guestfs-recipes.pod:139
3539 msgid "This creates a directory called C<home> under the current directory."
3543 #: ../examples/guestfs-recipes.pod:143
3545 "If the guest is a Windows guest then you can use drive letters and "
3546 "backslashes, but you must prefix the path with C<win:> and quote it to "
3547 "protect it from the shell, like this:"
3551 #: ../examples/guestfs-recipes.pod:147
3554 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
3559 #: ../examples/guestfs-recipes.pod:149
3560 msgid "To get the output as a compressed tarball, do:"
3564 #: ../examples/guestfs-recipes.pod:151
3567 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
3572 #: ../examples/guestfs-recipes.pod:153
3574 "Although it sounds tempting, this is usually not a reliable way to get a "
3575 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
3576 "org/FAQ.html#backup"
3580 #: ../examples/guestfs-recipes.pod:157
3581 msgid "Find out which user is using the most space"
3585 #: ../examples/guestfs-recipes.pod:159
3587 "This simple script examines a Linux guest to find out which user is using "
3588 "the most space in their home directory:"
3592 #: ../examples/guestfs-recipes.pod:162
3600 #: ../examples/guestfs-recipes.pod:164
3608 #: ../examples/guestfs-recipes.pod:166
3617 #: ../examples/guestfs-recipes.pod:169
3620 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
3625 #: ../examples/guestfs-recipes.pod:171
3628 " for d in $(guestfish --remote ls \"$dir\"); do\n"
3629 " echo -n \"$dir/$d\"\n"
3631 " guestfish --remote du \"$dir/$d\";\n"
3632 " done | sort -nr -k 2\n"
3637 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
3640 " guestfish --remote exit\n"
3645 #: ../examples/guestfs-recipes.pod:179
3646 msgid "Get DHCP address from a VM"
3650 #: ../examples/guestfs-recipes.pod:181
3652 "The link below explains the many different possible techniques for getting "
3653 "the last assigned DHCP address of a virtual machine."
3657 #: ../examples/guestfs-recipes.pod:184
3659 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
3660 "a-virtual-machine-disk-image/#content"
3664 #: ../examples/guestfs-recipes.pod:186
3666 "In the libguestfs source examples directory you will find the latest version "
3667 "of the C<virt-dhcp-address.c> program."
3671 #: ../examples/guestfs-recipes.pod:189
3672 msgid "Get the operating system product name string"
3676 #: ../examples/guestfs-recipes.pod:191
3677 msgid "Save the following script into a file called C<product-name.sh>:"
3681 #: ../examples/guestfs-recipes.pod:193
3686 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3687 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3688 " guestfish --remote inspect-get-product-name \"$root\"\n"
3689 " guestfish --remote exit\n"
3694 #: ../examples/guestfs-recipes.pod:200
3695 msgid "Make the script executable and run it on a named guest:"
3699 #: ../examples/guestfs-recipes.pod:202
3702 " # product-name.sh RHEL60x64\n"
3703 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
3708 #: ../examples/guestfs-recipes.pod:205
3710 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
3711 "C<xpath> command line tool or from your favourite programming language:"
3715 #: ../examples/guestfs-recipes.pod:209
3718 " # virt-inspector RHEL60x64 > xml\n"
3719 " # xpath '//product_name' < xml\n"
3722 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
3727 #: ../examples/guestfs-recipes.pod:215
3728 msgid "Get the default boot kernel for a Linux VM"
3732 #: ../examples/guestfs-recipes.pod:217
3734 "The link below contains a program to print the default boot kernel for a "
3739 #: ../examples/guestfs-recipes.pod:220
3741 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
3742 "kernel-for-a-vm/#content"
3746 #: ../examples/guestfs-recipes.pod:222
3748 "It uses Augeas, and the technique is generally applicable for many different "
3753 #: ../examples/guestfs-recipes.pod:229
3754 msgid "listing the user accounts in the guest"
3758 #: ../examples/guestfs-recipes.pod:233
3759 msgid "what repositories is it configured to use"
3763 #: ../examples/guestfs-recipes.pod:237
3764 msgid "what NTP servers does it connect to"
3768 #: ../examples/guestfs-recipes.pod:241
3769 msgid "what were the boot messages last time it booted"
3773 #: ../examples/guestfs-recipes.pod:245
3774 msgid "listing who was logged in recently"
3778 #: ../examples/guestfs-recipes.pod:249
3779 msgid "http://augeas.net/"
3783 #: ../examples/guestfs-recipes.pod:251
3784 msgid "Install RPMs in a guest"
3788 #: ../examples/guestfs-recipes.pod:253
3790 "The link below contains a method to install RPMs in a guest. In fact the "
3791 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
3792 "installs them next time the guest is booted. You could use this technique "
3793 "to install vital security updates in an offline guest."
3797 #: ../examples/guestfs-recipes.pod:259
3799 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
3803 #: ../examples/guestfs-recipes.pod:261
3804 msgid "List applications installed in a VM"
3808 #: ../examples/guestfs-recipes.pod:263
3809 msgid "Save the following to a file C<list-apps.sh>:"
3813 #: ../examples/guestfs-recipes.pod:265
3818 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3819 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3820 " guestfish --remote inspect-list-applications \"$root\"\n"
3821 " guestfish --remote exit\n"
3826 #: ../examples/guestfs-recipes.pod:272
3828 "Make the file executable and then you can run it on any named virtual "
3833 #: ../examples/guestfs-recipes.pod:275
3836 " # list-apps.sh WinGuest\n"
3838 " app_name: Mozilla Firefox (3.6.12)\n"
3839 " app_display_name: Mozilla Firefox (3.6.12)\n"
3841 " app_version: 3.6.12 (en-GB)\n"
3843 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
3844 " app_trans_path:\n"
3845 " app_publisher: Mozilla\n"
3846 " app_url: http://www.mozilla.com/en-GB/\n"
3847 " app_source_package:\n"
3849 " app_description: Mozilla Firefox\n"
3852 " app_name: VLC media player\n"
3853 " app_display_name: VLC media player 1.1.5\n"
3855 " app_version: 1.1.5\n"
3857 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
3858 " app_trans_path:\n"
3859 " app_publisher: VideoLAN\n"
3860 " app_url: http://www.videolan.org/\n"
3861 " app_source_package:\n"
3863 " app_description:\n"
3869 #: ../examples/guestfs-recipes.pod:305
3871 "If you want to run the script on disk images (instead of libvirt virtual "
3872 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
3877 #: ../examples/guestfs-recipes.pod:309
3878 msgid "List files and directories in a VM"
3882 #: ../examples/guestfs-recipes.pod:311
3883 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
3887 #: ../examples/guestfs-recipes.pod:313
3890 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
3895 #: ../examples/guestfs-recipes.pod:315
3896 msgid "List services in a Windows VM"
3900 #: ../examples/guestfs-recipes.pod:317
3902 "The link below contains a script that can be used to list out the services "
3903 "from a Windows VM, and whether those services run at boot time or are loaded "
3908 #: ../examples/guestfs-recipes.pod:321
3910 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
3915 #: ../examples/guestfs-recipes.pod:323
3916 msgid "Make a disk image sparse"
3920 #: ../examples/guestfs-recipes.pod:325
3922 "The link below contains some guides for making a disk image sparse (or "
3923 "reintroducing sparseness)."
3927 #: ../examples/guestfs-recipes.pod:328
3929 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
3933 #: ../examples/guestfs-recipes.pod:330
3934 msgid "Monitor disk usage over time"
3938 #: ../examples/guestfs-recipes.pod:332
3940 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
3941 "The link below contains a guide."
3945 #: ../examples/guestfs-recipes.pod:335
3946 msgid "http://virt-tools.org/learning/advanced-virt-df/"
3950 #: ../examples/guestfs-recipes.pod:337
3951 msgid "Reading the Windows Event Log from Windows Vista (or later)"
3955 #: ../examples/guestfs-recipes.pod:339
3957 "L<guestfish(1)> plus the tools described in the link below can be used to "
3958 "read out the Windows Event Log from any virtual machine running Windows "
3959 "Vista or a later version."
3963 #: ../examples/guestfs-recipes.pod:343
3965 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
3966 "guestfish/#content"
3970 #: ../examples/guestfs-recipes.pod:345
3971 msgid "Remove root password (Linux)"
3975 #: ../examples/guestfs-recipes.pod:347
3977 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
3978 "files. One use is to remove the root password from a Linux guest:"
3982 #: ../examples/guestfs-recipes.pod:350
3985 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3990 #: ../examples/guestfs-recipes.pod:352
3991 msgid "Remove Administrator password (Windows)"
3995 #: ../examples/guestfs-recipes.pod:354
3997 "The link below contains one technique for removing the Administrator "
3998 "password from a Windows VM, or to be more precise, it gives you a command "
3999 "prompt the next time you log in which you can use to bypass any security:"
4003 #: ../examples/guestfs-recipes.pod:359
4005 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
4006 "administrator-password-with-guestfish/"
4010 #: ../examples/guestfs-recipes.pod:361
4011 msgid "Unpack a live CD"
4015 #: ../examples/guestfs-recipes.pod:363
4017 "Linux live CDs often contain multiple layers of disk images wrapped like a "
4018 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
4019 "layers, as outlined in the guide below."
4023 #: ../examples/guestfs-recipes.pod:367
4025 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
4030 #: ../examples/guestfs-recipes.pod:369
4031 msgid "Uploading and downloading files"
4035 #: ../examples/guestfs-recipes.pod:371
4037 "The link below contains general tips on uploading (copying in) and "
4038 "downloading (copying out) files from VMs."
4042 #: ../examples/guestfs-recipes.pod:374
4044 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
4048 #: ../examples/guestfs-recipes.pod:376
4049 msgid "Use libguestfs tools on VMware ESX guests"
4053 #: ../examples/guestfs-recipes.pod:378
4055 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
4056 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
4060 #: ../examples/guestfs-recipes.pod:382
4062 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
4067 #: ../examples/guestfs-recipes.pod:386
4069 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4070 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby"
4071 "(3)>, L<http://libguestfs.org/>."
4075 #: ../examples/guestfs-recipes.pod:402
4076 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
4080 #: ../fish/guestfish-actions.pod:1
4085 #: ../fish/guestfish-actions.pod:3
4088 " add-cdrom filename\n"
4093 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
4094 msgid "This function adds a virtual CD-ROM disk image to the guest."
4098 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
4099 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
4103 #: ../fish/guestfish-actions.pod:15
4105 "This call checks for the existence of C<filename>. This stops you from "
4106 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4107 "and C<http:> URLs. To specify those, use the general L</config> call "
4112 #: ../fish/guestfish-actions.pod:22
4114 "If you just want to add an ISO file (often you use this as an efficient way "
4115 "to transfer large files into the guest), then you should probably use L</add-"
4116 "drive-ro> instead."
4120 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163
4121 #: ../fish/guestfish-actions.pod:177
4123 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
4128 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166
4129 #: ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:991
4130 #: ../fish/guestfish-actions.pod:1351 ../fish/guestfish-actions.pod:1365
4131 #: ../fish/guestfish-actions.pod:3090 ../fish/guestfish-actions.pod:3297
4132 #: ../fish/guestfish-actions.pod:3411 ../fish/guestfish-actions.pod:3459
4133 #: ../fish/guestfish-actions.pod:4360 ../fish/guestfish-actions.pod:4383
4134 #: ../fish/guestfish-actions.pod:4405 ../fish/guestfish-actions.pod:4443
4135 #: ../fish/guestfish-actions.pod:5092 ../fish/guestfish-actions.pod:5198
4136 #: ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:252
4137 #: ../src/guestfs-actions.pod:273 ../src/guestfs-actions.pod:1508
4138 #: ../src/guestfs-actions.pod:2007 ../src/guestfs-actions.pod:2028
4139 #: ../src/guestfs-actions.pod:4623 ../src/guestfs-actions.pod:4926
4140 #: ../src/guestfs-actions.pod:5155 ../src/guestfs-actions.pod:5255
4141 #: ../src/guestfs-actions.pod:6521 ../src/guestfs-actions.pod:6565
4142 #: ../src/guestfs-actions.pod:6599 ../src/guestfs-actions.pod:6662
4143 #: ../src/guestfs-actions.pod:7594 ../src/guestfs-actions.pod:7703
4144 #: ../src/guestfs-actions.pod:7886
4146 "Deprecated functions will not be removed from the API, but the fact that "
4147 "they are deprecated indicates that there are problems with correct use of "
4152 #: ../fish/guestfish-actions.pod:35
4157 #: ../fish/guestfish-actions.pod:37
4162 #: ../fish/guestfish-actions.pod:39
4165 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
4170 #: ../fish/guestfish-actions.pod:41
4172 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4173 "It works by connecting to libvirt, requesting the domain and domain XML from "
4174 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
4178 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
4180 "The number of disks added is returned. This operation is atomic: if an "
4181 "error is returned, then no disks are added."
4185 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
4187 "This function does some minimal checks to make sure the libvirt domain is "
4188 "not running (unless C<readonly> is true). In a future version we will try "
4189 "to acquire the libvirt lock on each disk."
4193 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
4195 "Disks must be accessible locally. This often means that adding disks from a "
4196 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4197 "unless those disks are accessible via the same device path locally too."
4201 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
4203 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4204 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4205 "libvirt URI (or one set through an environment variable, see the libvirt "
4206 "documentation for full details)."
4210 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
4212 "The optional C<live> flag controls whether this call will try to connect to "
4213 "a running virtual machine C<guestfsd> process if it sees a suitable "
4214 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
4215 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
4216 "DAEMONS> for more information."
4220 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
4222 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
4223 "passed instead of the domain name. The C<dom> string is treated as a UUID "
4224 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
4229 #: ../fish/guestfish-actions.pod:76
4231 "The other optional parameters are passed directly through to L</add-drive-"
4236 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143
4237 #: ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:1973
4238 #: ../fish/guestfish-actions.pod:3139 ../fish/guestfish-actions.pod:3312
4239 #: ../fish/guestfish-actions.pod:3447
4241 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
4245 #: ../fish/guestfish-actions.pod:81
4250 #: ../fish/guestfish-actions.pod:83
4253 " add-drive filename\n"
4258 #: ../fish/guestfish-actions.pod:85
4260 "This function is the equivalent of calling L</add-drive-opts> with no "
4261 "optional parameters, so the disk is added writable, with the format being "
4262 "detected automatically."
4266 #: ../fish/guestfish-actions.pod:89
4268 "Automatic detection of the format opens you up to a potential security hole "
4269 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4270 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4271 "you should think about replacing calls to this function with calls to L</add-"
4272 "drive-opts>, and specifying the format."
4276 #: ../fish/guestfish-actions.pod:96
4277 msgid "add-drive-opts"
4281 #: ../fish/guestfish-actions.pod:98
4286 #: ../fish/guestfish-actions.pod:100
4289 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
4294 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
4296 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4297 "The first time you call this function, the disk appears as C</dev/sda>, the "
4298 "second time as C</dev/sdb>, and so on."
4302 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
4304 "You don't necessarily need to be root when using libguestfs. However you "
4305 "obviously do need sufficient permissions to access the filename for whatever "
4306 "operations you want to perform (ie. read access if you just want to read the "
4307 "image or write access if you want to modify the image)."
4311 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
4312 msgid "This call checks that C<filename> exists."
4316 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3101
4317 #: ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4660
4318 msgid "The optional arguments are:"
4322 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
4327 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
4329 "If true then the image is treated as read-only. Writes are still allowed, "
4330 "but they are stored in a temporary snapshot overlay which is discarded at "
4331 "the end. The disk that you add is not modified."
4335 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
4340 #: ../fish/guestfish-actions.pod:127
4342 "This forces the image format. If you omit this (or use L</add-drive> or L</"
4343 "add-drive-ro>) then the format is automatically detected. Possible formats "
4344 "include C<raw> and C<qcow2>."
4348 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
4350 "Automatic detection of the format opens you up to a potential security hole "
4351 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4352 "RHBZ#642934. Specifying the format closes this security hole."
4356 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
4361 #: ../fish/guestfish-actions.pod:138
4363 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
4364 "add-drive-with-if> call (q.v.)"
4368 #: ../fish/guestfish-actions.pod:145
4369 msgid "add-drive-ro"
4373 #: ../fish/guestfish-actions.pod:147
4378 #: ../fish/guestfish-actions.pod:149
4381 " add-drive-ro filename\n"
4386 #: ../fish/guestfish-actions.pod:151
4388 "This function is the equivalent of calling L</add-drive-opts> with the "
4389 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
4390 "is added read-only, with the format being detected automatically."
4394 #: ../fish/guestfish-actions.pod:156
4395 msgid "add-drive-ro-with-if"
4399 #: ../fish/guestfish-actions.pod:158
4402 " add-drive-ro-with-if filename iface\n"
4407 #: ../fish/guestfish-actions.pod:160
4409 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
4410 "interface emulation to use at run time."
4414 #: ../fish/guestfish-actions.pod:170
4415 msgid "add-drive-with-if"
4419 #: ../fish/guestfish-actions.pod:172
4422 " add-drive-with-if filename iface\n"
4427 #: ../fish/guestfish-actions.pod:174
4429 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4430 "interface emulation to use at run time."
4434 #: ../fish/guestfish-actions.pod:184
4439 #: ../fish/guestfish-actions.pod:186
4442 " aug-clear augpath\n"
4447 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
4449 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4450 "L<augtool(1)> C<clear> command."
4454 #: ../fish/guestfish-actions.pod:191
4459 #: ../fish/guestfish-actions.pod:193
4467 #: ../fish/guestfish-actions.pod:195
4469 "Close the current Augeas handle and free up any resources used by it. After "
4470 "calling this, you have to call L</aug-init> again before you can use any "
4471 "other Augeas functions."
4475 #: ../fish/guestfish-actions.pod:200
4480 #: ../fish/guestfish-actions.pod:202
4483 " aug-defnode name expr val\n"
4488 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
4490 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4494 #: ../fish/guestfish-actions.pod:207
4496 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4497 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
4498 "containing that single node."
4502 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
4504 "On success this returns a pair containing the number of nodes in the "
4505 "nodeset, and a boolean flag if a node was created."
4509 #: ../fish/guestfish-actions.pod:215
4514 #: ../fish/guestfish-actions.pod:217
4517 " aug-defvar name expr\n"
4522 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
4524 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4525 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4529 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
4531 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4532 "evaluates to something which is not a nodeset."
4536 #: ../fish/guestfish-actions.pod:226
4541 #: ../fish/guestfish-actions.pod:228
4544 " aug-get augpath\n"
4549 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
4551 "Look up the value associated with C<path>. If C<path> matches exactly one "
4552 "node, the C<value> is returned."
4556 #: ../fish/guestfish-actions.pod:233
4561 #: ../fish/guestfish-actions.pod:235
4564 " aug-init root flags\n"
4569 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
4571 "Create a new Augeas handle for editing configuration files. If there was "
4572 "any previous Augeas handle associated with this guestfs session, then it is "
4577 #: ../fish/guestfish-actions.pod:241
4578 msgid "You must call this before using any other L</aug-*> commands."
4582 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
4584 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4588 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
4590 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4591 "logical I<or> of the following integers:"
4595 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
4596 msgid "C<AUG_SAVE_BACKUP> = 1"
4600 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
4601 msgid "Keep the original file with a C<.augsave> extension."
4605 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
4606 msgid "C<AUG_SAVE_NEWFILE> = 2"
4610 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
4612 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4613 "original. Overrides C<AUG_SAVE_BACKUP>."
4617 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
4618 msgid "C<AUG_TYPE_CHECK> = 4"
4622 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
4623 msgid "Typecheck lenses."
4627 #: ../fish/guestfish-actions.pod:266
4629 "This option is only useful when debugging Augeas lenses. Use of this option "
4630 "may require additional memory for the libguestfs appliance. You may need to "
4631 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
4635 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
4636 msgid "C<AUG_NO_STDINC> = 8"
4640 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
4641 msgid "Do not use standard load path for modules."
4645 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
4646 msgid "C<AUG_SAVE_NOOP> = 16"
4650 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
4651 msgid "Make save a no-op, just record what would have been changed."
4655 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
4656 msgid "C<AUG_NO_LOAD> = 32"
4660 #: ../fish/guestfish-actions.pod:281
4661 msgid "Do not load the tree in L</aug-init>."
4665 #: ../fish/guestfish-actions.pod:285
4666 msgid "To close the handle, you can call L</aug-close>."
4670 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
4671 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4675 #: ../fish/guestfish-actions.pod:289
4680 #: ../fish/guestfish-actions.pod:291
4683 " aug-insert augpath label true|false\n"
4688 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
4690 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4691 "or after C<path> (depending on the boolean flag C<before>)."
4695 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
4697 "C<path> must match exactly one existing node in the tree, and C<label> must "
4698 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4702 #: ../fish/guestfish-actions.pod:301
4707 #: ../fish/guestfish-actions.pod:303
4715 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
4716 msgid "Load files into the tree."
4720 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
4721 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4725 #: ../fish/guestfish-actions.pod:310
4730 #: ../fish/guestfish-actions.pod:312
4738 #: ../fish/guestfish-actions.pod:314
4740 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4741 "resulting nodes into alphabetical order."
4745 #: ../fish/guestfish-actions.pod:317
4750 #: ../fish/guestfish-actions.pod:319
4753 " aug-match augpath\n"
4758 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
4760 "Returns a list of paths which match the path expression C<path>. The "
4761 "returned paths are sufficiently qualified so that they match exactly one "
4762 "node in the current tree."
4766 #: ../fish/guestfish-actions.pod:325
4771 #: ../fish/guestfish-actions.pod:327
4774 " aug-mv src dest\n"
4779 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
4781 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4782 "C<dest> is overwritten if it exists."
4786 #: ../fish/guestfish-actions.pod:332
4791 #: ../fish/guestfish-actions.pod:334
4799 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
4800 msgid "Remove C<path> and all of its children."
4804 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
4805 msgid "On success this returns the number of entries which were removed."
4809 #: ../fish/guestfish-actions.pod:340
4814 #: ../fish/guestfish-actions.pod:342
4822 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
4823 msgid "This writes all pending changes to disk."
4827 #: ../fish/guestfish-actions.pod:346
4829 "The flags which were passed to L</aug-init> affect exactly how files are "
4834 #: ../fish/guestfish-actions.pod:349
4839 #: ../fish/guestfish-actions.pod:351
4842 " aug-set augpath val\n"
4847 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
4848 msgid "Set the value associated with C<path> to C<val>."
4852 #: ../fish/guestfish-actions.pod:355
4854 "In the Augeas API, it is possible to clear a node by setting the value to "
4855 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4856 "this call. Instead you must use the L</aug-clear> call."
4860 #: ../fish/guestfish-actions.pod:360
4865 #: ../fish/guestfish-actions.pod:362
4868 " available 'groups ...'\n"
4873 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
4875 "This command is used to check the availability of some groups of "
4876 "functionality in the appliance, which not all builds of the libguestfs "
4877 "appliance will be able to provide."
4881 #: ../fish/guestfish-actions.pod:368
4883 "The libguestfs groups, and the functions that those groups correspond to, "
4884 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4885 "runtime by calling L</available-all-groups>."
4889 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
4891 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
4892 "\"]> would check for the availability of the Linux inotify functions and "
4893 "Augeas (configuration file editing) functions."
4897 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
4898 msgid "The command returns no error if I<all> requested groups are available."
4902 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
4904 "It fails with an error if one or more of the requested groups is unavailable "
4909 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
4911 "If an unknown group name is included in the list of groups then an error is "
4916 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
4921 #: ../fish/guestfish-actions.pod:392
4922 msgid "You must call L</launch> before calling this function."
4926 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
4928 "The reason is because we don't know what groups are supported by the "
4929 "appliance/daemon until it is running and can be queried."
4933 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
4935 "If a group of functions is available, this does not necessarily mean that "
4936 "they will work. You still have to check for errors when calling individual "
4937 "API functions even if they are available."
4941 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
4943 "It is usually the job of distro packagers to build complete functionality "
4944 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4945 "with all requirements satisfied, will support everything."
4949 #: ../fish/guestfish-actions.pod:414
4951 "This call was added in version C<1.0.80>. In previous versions of "
4952 "libguestfs all you could do would be to speculatively execute a command to "
4953 "find out if the daemon implemented it. See also L</version>."
4957 #: ../fish/guestfish-actions.pod:421
4958 msgid "available-all-groups"
4962 #: ../fish/guestfish-actions.pod:423
4965 " available-all-groups\n"
4970 #: ../fish/guestfish-actions.pod:425
4972 "This command returns a list of all optional groups that this daemon knows "
4973 "about. Note this returns both supported and unsupported groups. To find "
4974 "out which ones the daemon can actually support you have to call L</"
4975 "available> on each member of the returned list."
4979 #: ../fish/guestfish-actions.pod:431
4980 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
4984 #: ../fish/guestfish-actions.pod:433
4989 #: ../fish/guestfish-actions.pod:435
4992 " base64-in (base64file|-) filename\n"
4997 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
4999 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5003 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449
5004 #: ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:867
5005 #: ../fish/guestfish-actions.pod:886 ../fish/guestfish-actions.pod:1260
5006 #: ../fish/guestfish-actions.pod:4663 ../fish/guestfish-actions.pod:4675
5007 #: ../fish/guestfish-actions.pod:4686 ../fish/guestfish-actions.pod:4697
5008 #: ../fish/guestfish-actions.pod:4749 ../fish/guestfish-actions.pod:4758
5009 #: ../fish/guestfish-actions.pod:4812 ../fish/guestfish-actions.pod:4835
5010 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
5014 #: ../fish/guestfish-actions.pod:442
5019 #: ../fish/guestfish-actions.pod:444
5022 " base64-out filename (base64file|-)\n"
5027 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
5029 "This command downloads the contents of C<filename>, writing it out to local "
5030 "file C<base64file> encoded as base64."
5034 #: ../fish/guestfish-actions.pod:451
5035 msgid "blockdev-flushbufs"
5039 #: ../fish/guestfish-actions.pod:453
5042 " blockdev-flushbufs device\n"
5047 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
5049 "This tells the kernel to flush internal buffers associated with C<device>."
5053 #: ../fish/guestfish-actions.pod:458 ../fish/guestfish-actions.pod:469
5054 #: ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:488
5055 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:513
5056 #: ../fish/guestfish-actions.pod:521 ../fish/guestfish-actions.pod:532
5057 #: ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:548
5058 #: ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:696
5059 #: ../src/guestfs-actions.pod:711 ../src/guestfs-actions.pod:727
5060 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:764
5061 #: ../src/guestfs-actions.pod:778 ../src/guestfs-actions.pod:796
5062 #: ../src/guestfs-actions.pod:810 ../src/guestfs-actions.pod:824
5063 msgid "This uses the L<blockdev(8)> command."
5067 #: ../fish/guestfish-actions.pod:460
5068 msgid "blockdev-getbsz"
5072 #: ../fish/guestfish-actions.pod:462
5075 " blockdev-getbsz device\n"
5080 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
5081 msgid "This returns the block size of a device."
5085 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529
5086 #: ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
5088 "(Note this is different from both I<size in blocks> and I<filesystem block "
5093 #: ../fish/guestfish-actions.pod:471
5094 msgid "blockdev-getro"
5098 #: ../fish/guestfish-actions.pod:473
5101 " blockdev-getro device\n"
5106 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
5108 "Returns a boolean indicating if the block device is read-only (true if read-"
5109 "only, false if not)."
5113 #: ../fish/guestfish-actions.pod:480
5114 msgid "blockdev-getsize64"
5118 #: ../fish/guestfish-actions.pod:482
5121 " blockdev-getsize64 device\n"
5126 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
5127 msgid "This returns the size of the device in bytes."
5131 #: ../fish/guestfish-actions.pod:486
5132 msgid "See also L</blockdev-getsz>."
5136 #: ../fish/guestfish-actions.pod:490
5137 msgid "blockdev-getss"
5141 #: ../fish/guestfish-actions.pod:492
5144 " blockdev-getss device\n"
5149 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
5151 "This returns the size of sectors on a block device. Usually 512, but can be "
5152 "larger for modern devices."
5156 #: ../fish/guestfish-actions.pod:497
5158 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
5162 #: ../fish/guestfish-actions.pod:502
5163 msgid "blockdev-getsz"
5167 #: ../fish/guestfish-actions.pod:504
5170 " blockdev-getsz device\n"
5175 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
5177 "This returns the size of the device in units of 512-byte sectors (even if "
5178 "the sectorsize isn't 512 bytes ... weird)."
5182 #: ../fish/guestfish-actions.pod:509
5184 "See also L</blockdev-getss> for the real sector size of the device, and L</"
5185 "blockdev-getsize64> for the more useful I<size in bytes>."
5189 #: ../fish/guestfish-actions.pod:515
5190 msgid "blockdev-rereadpt"
5194 #: ../fish/guestfish-actions.pod:517
5197 " blockdev-rereadpt device\n"
5202 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
5203 msgid "Reread the partition table on C<device>."
5207 #: ../fish/guestfish-actions.pod:523
5208 msgid "blockdev-setbsz"
5212 #: ../fish/guestfish-actions.pod:525
5215 " blockdev-setbsz device blocksize\n"
5220 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
5221 msgid "This sets the block size of a device."
5225 #: ../fish/guestfish-actions.pod:534
5226 msgid "blockdev-setro"
5230 #: ../fish/guestfish-actions.pod:536
5233 " blockdev-setro device\n"
5238 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
5239 msgid "Sets the block device named C<device> to read-only."
5243 #: ../fish/guestfish-actions.pod:542
5244 msgid "blockdev-setrw"
5248 #: ../fish/guestfish-actions.pod:544
5251 " blockdev-setrw device\n"
5256 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
5257 msgid "Sets the block device named C<device> to read-write."
5261 #: ../fish/guestfish-actions.pod:550
5262 msgid "btrfs-filesystem-resize"
5266 #: ../fish/guestfish-actions.pod:552
5269 " btrfs-filesystem-resize mountpoint [size:..]\n"
5274 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
5275 msgid "This command resizes a btrfs filesystem."
5279 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
5281 "Note that unlike other resize calls, the filesystem has to be mounted and "
5282 "the parameter is the mountpoint not the device (this is a requirement of "
5287 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3422
5288 #: ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5194
5289 msgid "The optional parameters are:"
5293 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3426
5294 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5198
5299 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
5301 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
5302 "resized to the maximum size."
5306 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
5307 msgid "See also L<btrfs(8)>."
5311 #: ../fish/guestfish-actions.pod:575
5312 msgid "case-sensitive-path"
5316 #: ../fish/guestfish-actions.pod:577
5319 " case-sensitive-path path\n"
5324 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
5326 "This can be used to resolve case insensitive paths on a filesystem which is "
5327 "case sensitive. The use case is to resolve paths which you have read from "
5328 "Windows configuration files or the Windows Registry, to the true path."
5332 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
5334 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5335 "(and probably others), which is that although the underlying filesystem is "
5336 "case-insensitive, the driver exports the filesystem to Linux as case-"
5341 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
5343 "One consequence of this is that special directories such as C<c:\\windows> "
5344 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5345 "precise details of how they were created. In Windows itself this would not "
5350 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
5352 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5357 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
5359 "This function resolves the true case of each element in the path and returns "
5360 "the case-sensitive path."
5364 #: ../fish/guestfish-actions.pod:601
5366 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
5367 "WINDOWS/system32\"> (the exact return value would depend on details of how "
5368 "the directories were originally created under Windows)."
5372 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
5373 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5377 #: ../fish/guestfish-actions.pod:609
5378 msgid "See also L</realpath>."
5382 #: ../fish/guestfish-actions.pod:611
5387 #: ../fish/guestfish-actions.pod:613
5395 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3842
5396 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5837
5397 msgid "Return the contents of the file named C<path>."
5401 #: ../fish/guestfish-actions.pod:617
5403 "Note that this function cannot correctly handle binary files (specifically, "
5404 "files containing C<\\0> character which is treated as end of string). For "
5405 "those you need to use the L</read-file> or L</download> functions which have "
5406 "a more complex interface."
5410 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757
5411 #: ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:945
5412 #: ../fish/guestfish-actions.pod:955 ../fish/guestfish-actions.pod:1022
5413 #: ../fish/guestfish-actions.pod:1032 ../fish/guestfish-actions.pod:1224
5414 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:1541
5415 #: ../fish/guestfish-actions.pod:1569 ../fish/guestfish-actions.pod:1584
5416 #: ../fish/guestfish-actions.pod:1594 ../fish/guestfish-actions.pod:1613
5417 #: ../fish/guestfish-actions.pod:3712 ../fish/guestfish-actions.pod:3727
5418 #: ../fish/guestfish-actions.pod:3803 ../fish/guestfish-actions.pod:3820
5419 #: ../fish/guestfish-actions.pod:3835 ../fish/guestfish-actions.pod:4504
5420 #: ../fish/guestfish-actions.pod:4550 ../fish/guestfish-actions.pod:4635
5421 #: ../fish/guestfish-actions.pod:4650 ../fish/guestfish-actions.pod:5056
5422 #: ../fish/guestfish-actions.pod:5068 ../fish/guestfish-actions.pod:5086
5423 #: ../fish/guestfish-actions.pod:5103 ../fish/guestfish-actions.pod:5113
5424 #: ../fish/guestfish-actions.pod:5170 ../fish/guestfish-actions.pod:5180
5425 #: ../fish/guestfish-actions.pod:5209 ../fish/guestfish-actions.pod:5219
5426 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127
5427 #: ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1443
5428 #: ../src/guestfs-actions.pod:1462 ../src/guestfs-actions.pod:1565
5429 #: ../src/guestfs-actions.pod:1584 ../src/guestfs-actions.pod:1830
5430 #: ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2320
5431 #: ../src/guestfs-actions.pod:2363 ../src/guestfs-actions.pod:2387
5432 #: ../src/guestfs-actions.pod:2404 ../src/guestfs-actions.pod:2433
5433 #: ../src/guestfs-actions.pod:5619 ../src/guestfs-actions.pod:5645
5434 #: ../src/guestfs-actions.pod:5776 ../src/guestfs-actions.pod:5802
5435 #: ../src/guestfs-actions.pod:5826 ../src/guestfs-actions.pod:6777
5436 #: ../src/guestfs-actions.pod:6832 ../src/guestfs-actions.pod:6978
5437 #: ../src/guestfs-actions.pod:7002 ../src/guestfs-actions.pod:7667
5438 #: ../src/guestfs-actions.pod:7687 ../src/guestfs-actions.pod:7720
5439 #: ../src/guestfs-actions.pod:7739 ../src/guestfs-actions.pod:7758
5440 #: ../src/guestfs-actions.pod:7852 ../src/guestfs-actions.pod:7871
5441 #: ../src/guestfs-actions.pod:7917 ../src/guestfs-actions.pod:7936
5443 "Because of the message protocol, there is a transfer limit of somewhere "
5444 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5448 #: ../fish/guestfish-actions.pod:625
5453 #: ../fish/guestfish-actions.pod:627
5456 " checksum csumtype path\n"
5461 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
5463 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5467 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
5469 "The type of checksum to compute is given by the C<csumtype> parameter which "
5470 "must have one of the following values:"
5474 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
5479 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
5481 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5486 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
5491 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
5492 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5496 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
5501 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
5502 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5506 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
5511 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
5512 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5516 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
5521 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
5522 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5526 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
5531 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
5532 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5536 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
5541 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
5542 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5546 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
5547 msgid "The checksum is returned as a printable string."
5551 #: ../fish/guestfish-actions.pod:670
5552 msgid "To get the checksum for a device, use L</checksum-device>."
5556 #: ../fish/guestfish-actions.pod:672
5557 msgid "To get the checksums for many files, use L</checksums-out>."
5561 #: ../fish/guestfish-actions.pod:674
5562 msgid "checksum-device"
5566 #: ../fish/guestfish-actions.pod:676
5569 " checksum-device csumtype device\n"
5574 #: ../fish/guestfish-actions.pod:678
5576 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5577 "device named C<device>. For the types of checksums supported see the L</"
5578 "checksum> command."
5582 #: ../fish/guestfish-actions.pod:682
5583 msgid "checksums-out"
5587 #: ../fish/guestfish-actions.pod:684
5590 " checksums-out csumtype directory (sumsfile|-)\n"
5595 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
5597 "This command computes the checksums of all regular files in C<directory> and "
5598 "then emits a list of those checksums to the local output file C<sumsfile>."
5602 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
5604 "This can be used for verifying the integrity of a virtual machine. However "
5605 "to be properly secure you should pay attention to the output of the checksum "
5606 "command (it uses the ones from GNU coreutils). In particular when the "
5607 "filename is not printable, coreutils uses a special backslash syntax. For "
5608 "more information, see the GNU coreutils info file."
5612 #: ../fish/guestfish-actions.pod:700
5617 #: ../fish/guestfish-actions.pod:702
5620 " chmod mode path\n"
5625 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
5627 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5632 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
5634 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5635 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5640 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3065
5641 #: ../fish/guestfish-actions.pod:3204 ../fish/guestfish-actions.pod:3214
5642 #: ../fish/guestfish-actions.pod:3224 ../src/guestfs-actions.pod:1064
5643 #: ../src/guestfs-actions.pod:4591 ../src/guestfs-actions.pod:4800
5644 #: ../src/guestfs-actions.pod:4819 ../src/guestfs-actions.pod:4838
5645 msgid "The mode actually set is affected by the umask."
5649 #: ../fish/guestfish-actions.pod:713
5654 #: ../fish/guestfish-actions.pod:715
5657 " chown owner group path\n"
5662 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
5663 msgid "Change the file owner to C<owner> and group to C<group>."
5667 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2500
5668 #: ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3662
5670 "Only numeric uid and gid are supported. If you want to use names, you will "
5671 "need to locate and parse the password file yourself (Augeas support makes "
5672 "this relatively easy)."
5676 #: ../fish/guestfish-actions.pod:723
5681 #: ../fish/guestfish-actions.pod:725
5684 " command 'arguments ...'\n"
5689 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
5691 "This call runs a command from the guest filesystem. The filesystem must be "
5692 "mounted, and must contain a compatible operating system (ie. something "
5693 "Linux, with the same or compatible processor architecture)."
5697 #: ../fish/guestfish-actions.pod:732
5699 "The single parameter is an argv-style list of arguments. The first element "
5700 "is the name of the program to run. Subsequent elements are parameters. The "
5701 "list must be non-empty (ie. must contain a program name). Note that the "
5702 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5706 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
5707 msgid "The return value is anything printed to I<stdout> by the command."
5711 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
5713 "If the command returns a non-zero exit status, then this function returns an "
5714 "error message. The error message string is the content of I<stderr> from "
5719 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5721 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
5722 "bin>. If you require a program from another location, you should provide "
5723 "the full path in the first parameter."
5727 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
5729 "Shared libraries and data files required by the program must be available on "
5730 "filesystems which are mounted in the correct places. It is the caller's "
5731 "responsibility to ensure all filesystems that are needed are mounted at the "
5736 #: ../fish/guestfish-actions.pod:760
5737 msgid "command-lines"
5741 #: ../fish/guestfish-actions.pod:762
5744 " command-lines 'arguments ...'\n"
5749 #: ../fish/guestfish-actions.pod:764
5751 "This is the same as L</command>, but splits the result into a list of lines."
5755 #: ../fish/guestfish-actions.pod:767
5756 msgid "See also: L</sh-lines>"
5760 #: ../fish/guestfish-actions.pod:772
5765 #: ../fish/guestfish-actions.pod:774
5768 " config qemuparam qemuvalue\n"
5773 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1159
5775 "This can be used to add arbitrary qemu command line parameters of the form "
5776 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
5777 "setting some parameters which would interfere with parameters that we use."
5781 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1164
5782 msgid "The first character of C<param> string must be a C<-> (dash)."
5786 #: ../fish/guestfish-actions.pod:783 ../src/guestfs-actions.pod:1166
5787 msgid "C<value> can be NULL."
5791 #: ../fish/guestfish-actions.pod:785
5796 #: ../fish/guestfish-actions.pod:787
5799 " copy-size src dest size\n"
5804 #: ../fish/guestfish-actions.pod:789 ../src/guestfs-actions.pod:1180
5806 "This command copies exactly C<size> bytes from one source device or file "
5807 "C<src> to another destination device or file C<dest>."
5811 #: ../fish/guestfish-actions.pod:792 ../src/guestfs-actions.pod:1183
5813 "Note this will fail if the source is too short or if the destination is not "
5818 #: ../fish/guestfish-actions.pod:795
5823 #: ../fish/guestfish-actions.pod:797
5831 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1202
5833 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5834 "destination filename or destination directory."
5838 #: ../fish/guestfish-actions.pod:802
5843 #: ../fish/guestfish-actions.pod:804
5851 #: ../fish/guestfish-actions.pod:806 ../src/guestfs-actions.pod:1216
5853 "This copies a file or directory from C<src> to C<dest> recursively using the "
5858 #: ../fish/guestfish-actions.pod:809
5863 #: ../fish/guestfish-actions.pod:811
5871 #: ../fish/guestfish-actions.pod:813 ../src/guestfs-actions.pod:1230
5873 "This command copies from one source device or file C<src> to another "
5874 "destination device or file C<dest>. Normally you would use this to copy to "
5875 "or from a device or partition, for example to duplicate a filesystem."
5879 #: ../fish/guestfish-actions.pod:818
5881 "If the destination is a device, it must be as large or larger than the "
5882 "source file or device, otherwise the copy will fail. This command cannot do "
5883 "partial copies (see L</copy-size>)."
5887 #: ../fish/guestfish-actions.pod:822
5892 #: ../fish/guestfish-actions.pod:824
5900 #: ../fish/guestfish-actions.pod:826 ../src/guestfs-actions.pod:1248
5901 msgid "This command runs the C<df> command to report disk space used."
5905 #: ../fish/guestfish-actions.pod:828 ../fish/guestfish-actions.pod:839
5907 "This command is mostly useful for interactive sessions. It is I<not> "
5908 "intended that you try to parse the output string. Use L</statvfs> from "
5913 #: ../fish/guestfish-actions.pod:832
5918 #: ../fish/guestfish-actions.pod:834
5926 #: ../fish/guestfish-actions.pod:836 ../src/guestfs-actions.pod:1264
5928 "This command runs the C<df -h> command to report disk space used in human-"
5933 #: ../fish/guestfish-actions.pod:843
5938 #: ../fish/guestfish-actions.pod:845
5946 #: ../fish/guestfish-actions.pod:847 ../src/guestfs-actions.pod:1281
5948 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5949 "This is sometimes useful for extended debugging of problems."
5953 #: ../fish/guestfish-actions.pod:851
5955 "Another way to get the same information is to enable verbose messages with "
5956 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
5957 "before running the program."
5961 #: ../fish/guestfish-actions.pod:856
5966 #: ../fish/guestfish-actions.pod:858
5969 " download remotefilename (filename|-)\n"
5974 #: ../fish/guestfish-actions.pod:860 ../fish/guestfish-actions.pod:873
5975 #: ../src/guestfs-actions.pod:1302 ../src/guestfs-actions.pod:1327
5977 "Download file C<remotefilename> and save it as C<filename> on the local "
5982 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:4808
5983 #: ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:7237
5984 msgid "C<filename> can also be a named pipe."
5988 #: ../fish/guestfish-actions.pod:865
5989 msgid "See also L</upload>, L</cat>."
5993 #: ../fish/guestfish-actions.pod:869
5994 msgid "download-offset"
5998 #: ../fish/guestfish-actions.pod:871
6001 " download-offset remotefilename (filename|-) offset size\n"
6006 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1330
6008 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6009 "region must be within the file or device)."
6013 #: ../fish/guestfish-actions.pod:879
6015 "Note that there is no limit on the amount of data that can be downloaded "
6016 "with this call, unlike with L</pread>, and this call always reads the full "
6017 "amount unless an error occurs."
6021 #: ../fish/guestfish-actions.pod:884
6022 msgid "See also L</download>, L</pread>."
6026 #: ../fish/guestfish-actions.pod:888
6031 #: ../fish/guestfish-actions.pod:890
6034 " drop-caches whattodrop\n"
6039 #: ../fish/guestfish-actions.pod:892 ../src/guestfs-actions.pod:1355
6041 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6042 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6043 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6047 #: ../fish/guestfish-actions.pod:897 ../src/guestfs-actions.pod:1360
6048 msgid "Setting C<whattodrop> to 3 should drop everything."
6052 #: ../fish/guestfish-actions.pod:899 ../src/guestfs-actions.pod:1362
6054 "This automatically calls L<sync(2)> before the operation, so that the "
6055 "maximum guest memory is freed."
6059 #: ../fish/guestfish-actions.pod:902
6064 #: ../fish/guestfish-actions.pod:904
6072 #: ../fish/guestfish-actions.pod:906 ../src/guestfs-actions.pod:1375
6074 "This command runs the C<du -s> command to estimate file space usage for "
6079 #: ../fish/guestfish-actions.pod:909 ../src/guestfs-actions.pod:1378
6081 "C<path> can be a file or a directory. If C<path> is a directory then the "
6082 "estimate includes the contents of the directory and all subdirectories "
6087 #: ../fish/guestfish-actions.pod:913 ../src/guestfs-actions.pod:1382
6089 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6093 #: ../fish/guestfish-actions.pod:916
6098 #: ../fish/guestfish-actions.pod:918
6101 " e2fsck-f device\n"
6106 #: ../fish/guestfish-actions.pod:920 ../src/guestfs-actions.pod:1400
6108 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6109 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
6114 #: ../fish/guestfish-actions.pod:924
6116 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
6117 "should use L</fsck>."
6121 #: ../fish/guestfish-actions.pod:927
6126 #: ../fish/guestfish-actions.pod:929
6129 " echo-daemon 'words ...'\n"
6134 #: ../fish/guestfish-actions.pod:931 ../src/guestfs-actions.pod:1417
6136 "This command concatenates the list of C<words> passed with single spaces "
6137 "between them and returns the resulting string."
6141 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1420
6142 msgid "You can use this command to test the connection through to the daemon."
6146 #: ../fish/guestfish-actions.pod:936
6147 msgid "See also L</ping-daemon>."
6151 #: ../fish/guestfish-actions.pod:938
6156 #: ../fish/guestfish-actions.pod:940
6159 " egrep regex path\n"
6164 #: ../fish/guestfish-actions.pod:942 ../src/guestfs-actions.pod:1436
6166 "This calls the external C<egrep> program and returns the matching lines."
6170 #: ../fish/guestfish-actions.pod:948
6175 #: ../fish/guestfish-actions.pod:950
6178 " egrepi regex path\n"
6183 #: ../fish/guestfish-actions.pod:952 ../src/guestfs-actions.pod:1455
6185 "This calls the external C<egrep -i> program and returns the matching lines."
6189 #: ../fish/guestfish-actions.pod:958
6194 #: ../fish/guestfish-actions.pod:960
6197 " equal file1 file2\n"
6202 #: ../fish/guestfish-actions.pod:962 ../src/guestfs-actions.pod:1474
6204 "This compares the two files C<file1> and C<file2> and returns true if their "
6205 "content is exactly equal, or false otherwise."
6209 #: ../fish/guestfish-actions.pod:965 ../src/guestfs-actions.pod:1477
6210 msgid "The external L<cmp(1)> program is used for the comparison."
6214 #: ../fish/guestfish-actions.pod:967
6219 #: ../fish/guestfish-actions.pod:969
6227 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1489
6229 "This returns C<true> if and only if there is a file, directory (or anything) "
6230 "with the given C<path> name."
6234 #: ../fish/guestfish-actions.pod:974
6235 msgid "See also L</is-file>, L</is-dir>, L</stat>."
6239 #: ../fish/guestfish-actions.pod:976
6244 #: ../fish/guestfish-actions.pod:978
6247 " fallocate path len\n"
6252 #: ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:999
6253 #: ../src/guestfs-actions.pod:1512 ../src/guestfs-actions.pod:1531
6255 "This command preallocates a file (containing zero bytes) named C<path> of "
6256 "size C<len> bytes. If the file exists already, it is overwritten."
6260 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1516
6262 "Do not confuse this with the guestfish-specific C<alloc> command which "
6263 "allocates a file in the host and attaches it as a device."
6267 #: ../fish/guestfish-actions.pod:988
6269 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
6274 #: ../fish/guestfish-actions.pod:995
6279 #: ../fish/guestfish-actions.pod:997
6282 " fallocate64 path len\n"
6287 #: ../fish/guestfish-actions.pod:1003
6289 "Note that this call allocates disk blocks for the file. To create a sparse "
6290 "file use L</truncate-size> instead."
6294 #: ../fish/guestfish-actions.pod:1006
6296 "The deprecated call L</fallocate> does the same, but owing to an oversight "
6297 "it only allowed 30 bit lengths to be specified, effectively limiting the "
6298 "maximum size of files created through that call to 1GB."
6302 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1543
6304 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6305 "commands which create a file in the host and attach it as a device."
6309 #: ../fish/guestfish-actions.pod:1015
6314 #: ../fish/guestfish-actions.pod:1017
6317 " fgrep pattern path\n"
6322 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1558
6324 "This calls the external C<fgrep> program and returns the matching lines."
6328 #: ../fish/guestfish-actions.pod:1025
6333 #: ../fish/guestfish-actions.pod:1027
6336 " fgrepi pattern path\n"
6341 #: ../fish/guestfish-actions.pod:1029 ../src/guestfs-actions.pod:1577
6343 "This calls the external C<fgrep -i> program and returns the matching lines."
6347 #: ../fish/guestfish-actions.pod:1035
6352 #: ../fish/guestfish-actions.pod:1037
6360 #: ../fish/guestfish-actions.pod:1039 ../src/guestfs-actions.pod:1595
6362 "This call uses the standard L<file(1)> command to determine the type or "
6363 "contents of the file."
6367 #: ../fish/guestfish-actions.pod:1042 ../src/guestfs-actions.pod:1598
6369 "This call will also transparently look inside various types of compressed "
6374 #: ../fish/guestfish-actions.pod:1045 ../src/guestfs-actions.pod:1601
6376 "The exact command which runs is C<file -zb path>. Note in particular that "
6377 "the filename is not prepended to the output (the I<-b> option)."
6381 #: ../fish/guestfish-actions.pod:1049 ../src/guestfs-actions.pod:1605
6383 "The output depends on the output of the underlying L<file(1)> command and it "
6384 "can change in future in ways beyond our control. In other words, the output "
6385 "is not guaranteed by the ABI."
6389 #: ../fish/guestfish-actions.pod:1053
6391 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
6392 "(etc), L</is-zero>."
6396 #: ../fish/guestfish-actions.pod:1056
6397 msgid "file-architecture"
6401 #: ../fish/guestfish-actions.pod:1058
6404 " file-architecture filename\n"
6409 #: ../fish/guestfish-actions.pod:1060 ../src/guestfs-actions.pod:1623
6411 "This detects the architecture of the binary C<filename>, and returns it if "
6416 #: ../fish/guestfish-actions.pod:1063 ../src/guestfs-actions.pod:1626
6417 msgid "Currently defined architectures are:"
6421 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1630
6426 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1632
6428 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6429 "irrespective of the precise processor requirements of the binary."
6433 #: ../fish/guestfish-actions.pod:1072 ../src/guestfs-actions.pod:1635
6438 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1637
6439 msgid "64 bit x86-64."
6443 #: ../fish/guestfish-actions.pod:1076 ../src/guestfs-actions.pod:1639
6448 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1641
6449 msgid "32 bit SPARC."
6453 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1643
6458 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1645
6459 msgid "64 bit SPARC V9 and above."
6463 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1647
6468 #: ../fish/guestfish-actions.pod:1086 ../src/guestfs-actions.pod:1649
6469 msgid "Intel Itanium."
6473 #: ../fish/guestfish-actions.pod:1088 ../src/guestfs-actions.pod:1651
6478 #: ../fish/guestfish-actions.pod:1090 ../src/guestfs-actions.pod:1653
6479 msgid "32 bit Power PC."
6483 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1655
6488 #: ../fish/guestfish-actions.pod:1094 ../src/guestfs-actions.pod:1657
6489 msgid "64 bit Power PC."
6493 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1661
6494 msgid "Libguestfs may return other architecture strings in future."
6498 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1663
6499 msgid "The function works on at least the following types of files:"
6503 #: ../fish/guestfish-actions.pod:1106 ../src/guestfs-actions.pod:1669
6504 msgid "many types of Un*x and Linux binary"
6508 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1673
6509 msgid "many types of Un*x and Linux shared library"
6513 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1677
6514 msgid "Windows Win32 and Win64 binaries"
6518 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1681
6519 msgid "Windows Win32 and Win64 DLLs"
6523 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1683
6524 msgid "Win32 binaries and DLLs return C<i386>."
6528 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1685
6529 msgid "Win64 binaries and DLLs return C<x86_64>."
6533 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1689
6534 msgid "Linux kernel modules"
6538 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1693
6539 msgid "Linux new-style initrd images"
6543 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1697
6544 msgid "some non-x86 Linux vmlinuz kernels"
6548 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1701
6549 msgid "What it can't do currently:"
6553 #: ../fish/guestfish-actions.pod:1144 ../src/guestfs-actions.pod:1707
6554 msgid "static libraries (libfoo.a)"
6558 #: ../fish/guestfish-actions.pod:1148 ../src/guestfs-actions.pod:1711
6559 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6563 #: ../fish/guestfish-actions.pod:1152 ../src/guestfs-actions.pod:1715
6564 msgid "x86 Linux vmlinuz kernels"
6568 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1717
6570 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6571 "compressed code, and are horribly hard to unpack. If you want to find the "
6572 "architecture of a kernel, use the architecture of the associated initrd or "
6573 "kernel module(s) instead."
6577 #: ../fish/guestfish-actions.pod:1161
6582 #: ../fish/guestfish-actions.pod:1163
6590 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1735
6591 msgid "This command returns the size of C<file> in bytes."
6595 #: ../fish/guestfish-actions.pod:1167
6597 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
6598 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
6602 #: ../fish/guestfish-actions.pod:1171
6607 #: ../fish/guestfish-actions.pod:1173
6610 " fill c len path\n"
6615 #: ../fish/guestfish-actions.pod:1175 ../src/guestfs-actions.pod:1753
6617 "This command creates a new file called C<path>. The initial content of the "
6618 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
6623 #: ../fish/guestfish-actions.pod:1179
6625 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6626 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6631 #: ../fish/guestfish-actions.pod:1184
6632 msgid "fill-pattern"
6636 #: ../fish/guestfish-actions.pod:1186
6639 " fill-pattern pattern len path\n"
6644 #: ../fish/guestfish-actions.pod:1188
6646 "This function is like L</fill> except that it creates a new file of length "
6647 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6648 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6653 #: ../fish/guestfish-actions.pod:1193
6658 #: ../fish/guestfish-actions.pod:1195
6666 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:1799
6668 "This command lists out all files and directories, recursively, starting at "
6669 "C<directory>. It is essentially equivalent to running the shell command "
6670 "C<find directory -print> but some post-processing happens on the output, "
6675 #: ../fish/guestfish-actions.pod:1202 ../src/guestfs-actions.pod:1804
6677 "This returns a list of strings I<without any prefix>. Thus if the directory "
6682 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1807
6692 #: ../fish/guestfish-actions.pod:1209
6693 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6697 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:1814
6708 #: ../fish/guestfish-actions.pod:1217 ../src/guestfs-actions.pod:1819
6709 msgid "If C<directory> is not a directory, then this command returns an error."
6713 #: ../fish/guestfish-actions.pod:1220 ../src/guestfs-actions.pod:1822
6714 msgid "The returned list is sorted."
6718 #: ../fish/guestfish-actions.pod:1222
6719 msgid "See also L</find0>."
6723 #: ../fish/guestfish-actions.pod:1227
6728 #: ../fish/guestfish-actions.pod:1229
6731 " find0 directory (files|-)\n"
6736 #: ../fish/guestfish-actions.pod:1231 ../src/guestfs-actions.pod:1842
6738 "This command lists out all files and directories, recursively, starting at "
6739 "C<directory>, placing the resulting list in the external file called "
6744 #: ../fish/guestfish-actions.pod:1235
6746 "This command works the same way as L</find> with the following exceptions:"
6750 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1853
6751 msgid "The resulting list is written to an external file."
6755 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:1857
6757 "Items (filenames) in the result are separated by C<\\0> characters. See "
6758 "L<find(1)> option I<-print0>."
6762 #: ../fish/guestfish-actions.pod:1251 ../src/guestfs-actions.pod:1862
6763 msgid "This command is not limited in the number of names that it can return."
6767 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:1867
6768 msgid "The result list is not sorted."
6772 #: ../fish/guestfish-actions.pod:1262
6773 msgid "findfs-label"
6777 #: ../fish/guestfish-actions.pod:1264
6780 " findfs-label label\n"
6785 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1881
6787 "This command searches the filesystems and returns the one which has the "
6788 "given label. An error is returned if no such filesystem can be found."
6792 #: ../fish/guestfish-actions.pod:1270
6793 msgid "To find the label of a filesystem, use L</vfs-label>."
6797 #: ../fish/guestfish-actions.pod:1272
6802 #: ../fish/guestfish-actions.pod:1274
6805 " findfs-uuid uuid\n"
6810 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:1898
6812 "This command searches the filesystems and returns the one which has the "
6813 "given UUID. An error is returned if no such filesystem can be found."
6817 #: ../fish/guestfish-actions.pod:1280
6818 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
6822 #: ../fish/guestfish-actions.pod:1282
6827 #: ../fish/guestfish-actions.pod:1284
6830 " fsck fstype device\n"
6835 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1916
6837 "This runs the filesystem checker (fsck) on C<device> which should have "
6838 "filesystem type C<fstype>."
6842 #: ../fish/guestfish-actions.pod:1289 ../src/guestfs-actions.pod:1919
6844 "The returned integer is the status. See L<fsck(8)> for the list of status "
6845 "codes from C<fsck>."
6849 #: ../fish/guestfish-actions.pod:1298 ../src/guestfs-actions.pod:1928
6850 msgid "Multiple status codes can be summed together."
6854 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:1932
6856 "A non-zero return code can mean \"success\", for example if errors have been "
6857 "corrected on the filesystem."
6861 #: ../fish/guestfish-actions.pod:1307 ../src/guestfs-actions.pod:1937
6862 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6866 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:1942
6868 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6872 #: ../fish/guestfish-actions.pod:1314
6877 #: ../fish/guestfish-actions.pod:1316
6885 #: ../fish/guestfish-actions.pod:1318 ../src/guestfs-actions.pod:1953
6887 "Return the additional kernel options which are added to the guest kernel "
6892 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:1956
6893 msgid "If C<NULL> then no options are added."
6897 #: ../fish/guestfish-actions.pod:1323
6898 msgid "get-attach-method"
6902 #: ../fish/guestfish-actions.pod:1325
6905 " get-attach-method\n"
6910 #: ../fish/guestfish-actions.pod:1327
6911 msgid "Return the current attach method. See L</set-attach-method>."
6915 #: ../fish/guestfish-actions.pod:1329
6916 msgid "get-autosync"
6920 #: ../fish/guestfish-actions.pod:1331
6928 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:1981
6929 msgid "Get the autosync flag."
6933 #: ../fish/guestfish-actions.pod:1335
6938 #: ../fish/guestfish-actions.pod:1337
6946 #: ../fish/guestfish-actions.pod:1339 ../src/guestfs-actions.pod:1992
6947 msgid "Return the direct appliance mode flag."
6951 #: ../fish/guestfish-actions.pod:1341
6956 #: ../fish/guestfish-actions.pod:1343
6959 " get-e2label device\n"
6964 #: ../fish/guestfish-actions.pod:1345 ../src/guestfs-actions.pod:2011
6966 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6970 #: ../fish/guestfish-actions.pod:1348
6972 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
6977 #: ../fish/guestfish-actions.pod:1355
6982 #: ../fish/guestfish-actions.pod:1357
6985 " get-e2uuid device\n"
6990 #: ../fish/guestfish-actions.pod:1359 ../src/guestfs-actions.pod:2032
6992 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6996 #: ../fish/guestfish-actions.pod:1362
6998 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
7003 #: ../fish/guestfish-actions.pod:1369
7008 #: ../fish/guestfish-actions.pod:1371
7016 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2045
7018 "This gets the memory size in megabytes allocated to the qemu subprocess."
7022 #: ../fish/guestfish-actions.pod:1376
7024 "If L</set-memsize> was not called on this handle, and if "
7025 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7026 "value for memsize."
7030 #: ../fish/guestfish-actions.pod:1380 ../fish/guestfish-actions.pod:1437
7031 #: ../fish/guestfish-actions.pod:4168 ../fish/guestfish-actions.pod:4270
7032 #: ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2144
7033 #: ../src/guestfs-actions.pod:6298 ../src/guestfs-actions.pod:6424
7035 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7039 #: ../fish/guestfish-actions.pod:1383
7044 #: ../fish/guestfish-actions.pod:1385
7052 #: ../fish/guestfish-actions.pod:1387 ../src/guestfs-actions.pod:2064
7053 msgid "This returns the enable network flag."
7057 #: ../fish/guestfish-actions.pod:1389
7062 #: ../fish/guestfish-actions.pod:1391
7070 #: ../fish/guestfish-actions.pod:1393 ../src/guestfs-actions.pod:2075
7071 msgid "Return the current search path."
7075 #: ../fish/guestfish-actions.pod:1395 ../src/guestfs-actions.pod:2077
7077 "This is always non-NULL. If it wasn't set already, then this will return "
7082 #: ../fish/guestfish-actions.pod:1398
7087 #: ../fish/guestfish-actions.pod:1400
7095 #: ../fish/guestfish-actions.pod:1402 ../src/guestfs-actions.pod:2090
7096 msgid "This returns the process group flag."
7100 #: ../fish/guestfish-actions.pod:1404
7105 #: ../fish/guestfish-actions.pod:1406
7110 #: ../fish/guestfish-actions.pod:1408
7118 #: ../fish/guestfish-actions.pod:1410 ../src/guestfs-actions.pod:2101
7120 "Return the process ID of the qemu subprocess. If there is no qemu "
7121 "subprocess, then this will return an error."
7125 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2104
7126 msgid "This is an internal call used for debugging and testing."
7130 #: ../fish/guestfish-actions.pod:1415
7135 #: ../fish/guestfish-actions.pod:1417
7143 #: ../fish/guestfish-actions.pod:1419 ../src/guestfs-actions.pod:2115
7144 msgid "Return the current qemu binary."
7148 #: ../fish/guestfish-actions.pod:1421 ../src/guestfs-actions.pod:2117
7150 "This is always non-NULL. If it wasn't set already, then this will return "
7151 "the default qemu binary name."
7155 #: ../fish/guestfish-actions.pod:1424
7156 msgid "get-recovery-proc"
7160 #: ../fish/guestfish-actions.pod:1426
7163 " get-recovery-proc\n"
7168 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2130
7169 msgid "Return the recovery process enabled flag."
7173 #: ../fish/guestfish-actions.pod:1430
7178 #: ../fish/guestfish-actions.pod:1432
7186 #: ../fish/guestfish-actions.pod:1434
7188 "This returns the current setting of the selinux flag which is passed to the "
7189 "appliance at boot time. See L</set-selinux>."
7193 #: ../fish/guestfish-actions.pod:1440
7198 #: ../fish/guestfish-actions.pod:1442
7206 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2156
7208 "This returns the current state as an opaque integer. This is only useful "
7209 "for printing debug and internal error messages."
7213 #: ../fish/guestfish-actions.pod:1447 ../fish/guestfish-actions.pod:2367
7214 #: ../fish/guestfish-actions.pod:2385 ../fish/guestfish-actions.pod:2423
7215 #: ../fish/guestfish-actions.pod:2439 ../src/guestfs-actions.pod:2159
7216 #: ../src/guestfs-actions.pod:3439 ../src/guestfs-actions.pod:3468
7217 #: ../src/guestfs-actions.pod:3529 ../src/guestfs-actions.pod:3556
7218 msgid "For more information on states, see L<guestfs(3)>."
7222 #: ../fish/guestfish-actions.pod:1449
7227 #: ../fish/guestfish-actions.pod:1451
7235 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2170
7236 msgid "Return the command trace flag."
7240 #: ../fish/guestfish-actions.pod:1455
7245 #: ../fish/guestfish-actions.pod:1457
7253 #: ../fish/guestfish-actions.pod:1459
7255 "Return the current umask. By default the umask is C<022> unless it has been "
7256 "set by calling L</umask>."
7260 #: ../fish/guestfish-actions.pod:1462
7265 #: ../fish/guestfish-actions.pod:1464
7273 #: ../fish/guestfish-actions.pod:1466 ../src/guestfs-actions.pod:2193
7274 msgid "This returns the verbose messages flag."
7278 #: ../fish/guestfish-actions.pod:1468
7283 #: ../fish/guestfish-actions.pod:1470
7291 #: ../fish/guestfish-actions.pod:1472 ../src/guestfs-actions.pod:2204
7292 msgid "This gets the SELinux security context of the daemon."
7296 #: ../fish/guestfish-actions.pod:1474
7297 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
7301 #: ../fish/guestfish-actions.pod:1477
7306 #: ../fish/guestfish-actions.pod:1479
7309 " getxattr path name\n"
7314 #: ../fish/guestfish-actions.pod:1481
7316 "Get a single extended attribute from file C<path> named C<name>. This call "
7317 "follows symlinks. If you want to lookup an extended attribute for the "
7318 "symlink itself, use L</lgetxattr>."
7322 #: ../fish/guestfish-actions.pod:1485 ../fish/guestfish-actions.pod:2512
7324 "Normally it is better to get all extended attributes from a file in one go "
7325 "by calling L</getxattrs>. However some Linux filesystem implementations are "
7326 "buggy and do not provide a way to list out attributes. For these "
7327 "filesystems (notably ntfs-3g) you have to know the names of the extended "
7328 "attributes you want in advance and call this function."
7332 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:2519
7333 #: ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:3689
7335 "Extended attribute values are blobs of binary data. If there is no extended "
7336 "attribute named C<name>, this returns an error."
7340 #: ../fish/guestfish-actions.pod:1495
7341 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
7345 #: ../fish/guestfish-actions.pod:1497
7350 #: ../fish/guestfish-actions.pod:1499
7358 #: ../fish/guestfish-actions.pod:1501 ../src/guestfs-actions.pod:2250
7360 "This call lists the extended attributes of the file or directory C<path>."
7364 #: ../fish/guestfish-actions.pod:1504 ../src/guestfs-actions.pod:2253
7366 "At the system call level, this is a combination of the L<listxattr(2)> and "
7367 "L<getxattr(2)> calls."
7371 #: ../fish/guestfish-actions.pod:1507
7372 msgid "See also: L</lgetxattrs>, L<attr(5)>."
7376 #: ../fish/guestfish-actions.pod:1509
7381 #: ../fish/guestfish-actions.pod:1511
7384 " glob-expand pattern\n"
7389 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2270
7391 "This command searches for all the pathnames matching C<pattern> according to "
7392 "the wildcard expansion rules used by the shell."
7396 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2274
7398 "If no paths match, then this returns an empty list (note: not an error)."
7402 #: ../fish/guestfish-actions.pod:1520 ../src/guestfs-actions.pod:2277
7404 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
7405 "GLOB_BRACE>. See that manual page for more details."
7409 #: ../fish/guestfish-actions.pod:1524
7414 #: ../fish/guestfish-actions.pod:1526
7417 " grep regex path\n"
7422 #: ../fish/guestfish-actions.pod:1528 ../src/guestfs-actions.pod:2294
7423 msgid "This calls the external C<grep> program and returns the matching lines."
7427 #: ../fish/guestfish-actions.pod:1534
7432 #: ../fish/guestfish-actions.pod:1536
7435 " grepi regex path\n"
7440 #: ../fish/guestfish-actions.pod:1538 ../src/guestfs-actions.pod:2313
7442 "This calls the external C<grep -i> program and returns the matching lines."
7446 #: ../fish/guestfish-actions.pod:1544
7447 msgid "grub-install"
7451 #: ../fish/guestfish-actions.pod:1546
7454 " grub-install root device\n"
7459 #: ../fish/guestfish-actions.pod:1548 ../src/guestfs-actions.pod:2332
7461 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
7462 "the root directory being C<root>."
7466 #: ../fish/guestfish-actions.pod:1551 ../src/guestfs-actions.pod:2335
7468 "Note: If grub-install reports the error \"No suitable drive was found in the "
7469 "generated device map.\" it may be that you need to create a C</boot/grub/"
7470 "device.map> file first that contains the mapping between grub device names "
7471 "and Linux device names. It is usually sufficient to create a file "
7476 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2342
7484 #: ../fish/guestfish-actions.pod:1560 ../src/guestfs-actions.pod:2344
7485 msgid "replacing C</dev/vda> with the name of the installation device."
7489 #: ../fish/guestfish-actions.pod:1562
7494 #: ../fish/guestfish-actions.pod:1564
7502 #: ../fish/guestfish-actions.pod:1566 ../src/guestfs-actions.pod:2356
7504 "This command returns up to the first 10 lines of a file as a list of strings."
7508 #: ../fish/guestfish-actions.pod:1572
7513 #: ../fish/guestfish-actions.pod:1574
7516 " head-n nrlines path\n"
7521 #: ../fish/guestfish-actions.pod:1576 ../src/guestfs-actions.pod:2375
7523 "If the parameter C<nrlines> is a positive number, this returns the first "
7524 "C<nrlines> lines of the file C<path>."
7528 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2378
7530 "If the parameter C<nrlines> is a negative number, this returns lines from "
7531 "the file C<path>, excluding the last C<nrlines> lines."
7535 #: ../fish/guestfish-actions.pod:1582 ../fish/guestfish-actions.pod:4648
7536 #: ../src/guestfs-actions.pod:2381 ../src/guestfs-actions.pod:6996
7537 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7541 #: ../fish/guestfish-actions.pod:1587
7546 #: ../fish/guestfish-actions.pod:1589
7554 #: ../fish/guestfish-actions.pod:1591 ../src/guestfs-actions.pod:2398
7556 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
7557 "readable, canonical hex dump of the file."
7561 #: ../fish/guestfish-actions.pod:1597
7566 #: ../fish/guestfish-actions.pod:1599
7569 " initrd-cat initrdpath filename\n"
7574 #: ../fish/guestfish-actions.pod:1601 ../src/guestfs-actions.pod:2417
7576 "This command unpacks the file C<filename> from the initrd file called "
7577 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7582 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2421
7584 "For example, in guestfish you could use the following command to examine the "
7585 "boot script (usually called C</init>) contained in a Linux initrd or "
7590 #: ../fish/guestfish-actions.pod:1609 ../src/guestfs-actions.pod:2425
7593 " initrd-cat /boot/initrd-<version>.img init\n"
7598 #: ../fish/guestfish-actions.pod:1611
7599 msgid "See also L</initrd-list>."
7603 #: ../fish/guestfish-actions.pod:1616
7608 #: ../fish/guestfish-actions.pod:1618
7611 " initrd-list path\n"
7616 #: ../fish/guestfish-actions.pod:1620 ../src/guestfs-actions.pod:2444
7617 msgid "This command lists out files contained in an initrd."
7621 #: ../fish/guestfish-actions.pod:1622 ../src/guestfs-actions.pod:2446
7623 "The files are listed without any initial C</> character. The files are "
7624 "listed in the order they appear (not necessarily alphabetical). Directory "
7625 "names are listed as separate items."
7629 #: ../fish/guestfish-actions.pod:1626 ../src/guestfs-actions.pod:2450
7631 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7632 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7637 #: ../fish/guestfish-actions.pod:1630
7638 msgid "inotify-add-watch"
7642 #: ../fish/guestfish-actions.pod:1632
7645 " inotify-add-watch path mask\n"
7650 #: ../fish/guestfish-actions.pod:1634 ../src/guestfs-actions.pod:2467
7651 msgid "Watch C<path> for the events listed in C<mask>."
7655 #: ../fish/guestfish-actions.pod:1636 ../src/guestfs-actions.pod:2469
7657 "Note that if C<path> is a directory then events within that directory are "
7658 "watched, but this does I<not> happen recursively (in subdirectories)."
7662 #: ../fish/guestfish-actions.pod:1640 ../src/guestfs-actions.pod:2473
7664 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7665 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7669 #: ../fish/guestfish-actions.pod:1644
7670 msgid "inotify-close"
7674 #: ../fish/guestfish-actions.pod:1646
7682 #: ../fish/guestfish-actions.pod:1648 ../src/guestfs-actions.pod:2486
7684 "This closes the inotify handle which was previously opened by inotify_init. "
7685 "It removes all watches, throws away any pending events, and deallocates all "
7690 #: ../fish/guestfish-actions.pod:1652
7691 msgid "inotify-files"
7695 #: ../fish/guestfish-actions.pod:1654
7703 #: ../fish/guestfish-actions.pod:1656
7705 "This function is a helpful wrapper around L</inotify-read> which just "
7706 "returns a list of pathnames of objects that were touched. The returned "
7707 "pathnames are sorted and deduplicated."
7711 #: ../fish/guestfish-actions.pod:1660
7712 msgid "inotify-init"
7716 #: ../fish/guestfish-actions.pod:1662
7719 " inotify-init maxevents\n"
7724 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2515
7726 "This command creates a new inotify handle. The inotify subsystem can be "
7727 "used to notify events which happen to objects in the guest filesystem."
7731 #: ../fish/guestfish-actions.pod:1668
7733 "C<maxevents> is the maximum number of events which will be queued up between "
7734 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
7735 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
7736 "default was 16384 events. Beyond this limit, the kernel throws away events, "
7737 "but records the fact that it threw them away by setting a flag "
7738 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
7742 #: ../fish/guestfish-actions.pod:1678
7744 "Before any events are generated, you have to add some watches to the "
7745 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
7746 "L</inotify-watch-all>."
7750 #: ../fish/guestfish-actions.pod:1684
7752 "Queued up events should be read periodically by calling L</inotify-read> (or "
7753 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
7754 "If you don't read the events out often enough then you risk the internal "
7755 "queue overflowing."
7759 #: ../fish/guestfish-actions.pod:1691
7761 "The handle should be closed after use by calling L</inotify-close>. This "
7762 "also removes any watches automatically."
7766 #: ../fish/guestfish-actions.pod:1695 ../src/guestfs-actions.pod:2546
7768 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7769 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7770 "that there is one global inotify handle per libguestfs instance."
7774 #: ../fish/guestfish-actions.pod:1700
7775 msgid "inotify-read"
7779 #: ../fish/guestfish-actions.pod:1702
7787 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2560
7789 "Return the complete queue of events that have happened since the previous "
7794 #: ../fish/guestfish-actions.pod:1707 ../src/guestfs-actions.pod:2563
7795 msgid "If no events have happened, this returns an empty list."
7799 #: ../fish/guestfish-actions.pod:1709 ../src/guestfs-actions.pod:2565
7801 "I<Note>: In order to make sure that all events have been read, you must call "
7802 "this function repeatedly until it returns an empty list. The reason is that "
7803 "the call will read events up to the maximum appliance-to-host message size "
7804 "and leave remaining events in the queue."
7808 #: ../fish/guestfish-actions.pod:1715
7809 msgid "inotify-rm-watch"
7813 #: ../fish/guestfish-actions.pod:1717
7816 " inotify-rm-watch wd\n"
7821 #: ../fish/guestfish-actions.pod:1719
7822 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
7826 #: ../fish/guestfish-actions.pod:1722
7827 msgid "inspect-get-arch"
7831 #: ../fish/guestfish-actions.pod:1724
7834 " inspect-get-arch root\n"
7839 #: ../fish/guestfish-actions.pod:1726
7841 "This returns the architecture of the inspected operating system. The "
7842 "possible return values are listed under L</file-architecture>."
7846 #: ../fish/guestfish-actions.pod:1730 ../src/guestfs-actions.pod:2600
7848 "If the architecture could not be determined, then the string C<unknown> is "
7853 #: ../fish/guestfish-actions.pod:1733 ../fish/guestfish-actions.pod:1816
7854 #: ../fish/guestfish-actions.pod:1895 ../fish/guestfish-actions.pod:1907
7855 #: ../fish/guestfish-actions.pod:1991 ../fish/guestfish-actions.pod:2052
7856 #: ../fish/guestfish-actions.pod:2073 ../fish/guestfish-actions.pod:2087
7857 #: ../fish/guestfish-actions.pod:2127 ../fish/guestfish-actions.pod:2159
7858 #: ../fish/guestfish-actions.pod:2172 ../fish/guestfish-actions.pod:2185
7859 #: ../fish/guestfish-actions.pod:2195 ../fish/guestfish-actions.pod:2205
7860 #: ../fish/guestfish-actions.pod:2217 ../fish/guestfish-actions.pod:2313
7861 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:2603
7862 #: ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2797
7863 #: ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:2947
7864 #: ../src/guestfs-actions.pod:3030 ../src/guestfs-actions.pod:3058
7865 #: ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3132
7866 #: ../src/guestfs-actions.pod:3172 ../src/guestfs-actions.pod:3192
7867 #: ../src/guestfs-actions.pod:3212 ../src/guestfs-actions.pod:3229
7868 #: ../src/guestfs-actions.pod:3245 ../src/guestfs-actions.pod:3263
7869 #: ../src/guestfs-actions.pod:3365 ../src/guestfs-actions.pod:3406
7870 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7874 #: ../fish/guestfish-actions.pod:1735
7875 msgid "inspect-get-distro"
7879 #: ../fish/guestfish-actions.pod:1737
7882 " inspect-get-distro root\n"
7887 #: ../fish/guestfish-actions.pod:1739 ../src/guestfs-actions.pod:2616
7889 "This returns the distro (distribution) of the inspected operating system."
7893 #: ../fish/guestfish-actions.pod:1742 ../src/guestfs-actions.pod:2619
7894 msgid "Currently defined distros are:"
7898 #: ../fish/guestfish-actions.pod:1746 ../src/guestfs-actions.pod:2623
7899 msgid "\"archlinux\""
7903 #: ../fish/guestfish-actions.pod:1748 ../src/guestfs-actions.pod:2625
7908 #: ../fish/guestfish-actions.pod:1750 ../src/guestfs-actions.pod:2627
7913 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2629
7918 #: ../fish/guestfish-actions.pod:1754 ../src/guestfs-actions.pod:2631
7923 #: ../fish/guestfish-actions.pod:1756 ../src/guestfs-actions.pod:2633
7928 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2635
7933 #: ../fish/guestfish-actions.pod:1760 ../src/guestfs-actions.pod:2637
7938 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2639
7943 #: ../fish/guestfish-actions.pod:1764 ../src/guestfs-actions.pod:2641
7948 #: ../fish/guestfish-actions.pod:1766 ../src/guestfs-actions.pod:2643
7949 msgid "\"linuxmint\""
7953 #: ../fish/guestfish-actions.pod:1768 ../src/guestfs-actions.pod:2645
7958 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2647
7959 msgid "\"mandriva\""
7963 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2649
7968 #: ../fish/guestfish-actions.pod:1774 ../src/guestfs-actions.pod:2651
7973 #: ../fish/guestfish-actions.pod:1776 ../src/guestfs-actions.pod:2653
7978 #: ../fish/guestfish-actions.pod:1778 ../src/guestfs-actions.pod:2655
7983 #: ../fish/guestfish-actions.pod:1780 ../src/guestfs-actions.pod:2657
7988 #: ../fish/guestfish-actions.pod:1782 ../src/guestfs-actions.pod:2659
7989 msgid "\"redhat-based\""
7993 #: ../fish/guestfish-actions.pod:1784 ../src/guestfs-actions.pod:2661
7994 msgid "Some Red Hat-derived distro."
7998 #: ../fish/guestfish-actions.pod:1786 ../src/guestfs-actions.pod:2663
8003 #: ../fish/guestfish-actions.pod:1788 ../src/guestfs-actions.pod:2665
8004 msgid "Red Hat Enterprise Linux."
8008 #: ../fish/guestfish-actions.pod:1790 ../src/guestfs-actions.pod:2667
8009 msgid "\"scientificlinux\""
8013 #: ../fish/guestfish-actions.pod:1792 ../src/guestfs-actions.pod:2669
8014 msgid "Scientific Linux."
8018 #: ../fish/guestfish-actions.pod:1794 ../src/guestfs-actions.pod:2671
8019 msgid "\"slackware\""
8023 #: ../fish/guestfish-actions.pod:1796 ../src/guestfs-actions.pod:2673
8028 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2675
8033 #: ../fish/guestfish-actions.pod:1800 ../src/guestfs-actions.pod:2677
8038 #: ../fish/guestfish-actions.pod:1802 ../fish/guestfish-actions.pod:1886
8039 #: ../fish/guestfish-actions.pod:2150 ../src/guestfs-actions.pod:2679
8040 #: ../src/guestfs-actions.pod:2788 ../src/guestfs-actions.pod:3163
8045 #: ../fish/guestfish-actions.pod:1804 ../src/guestfs-actions.pod:2681
8046 msgid "The distro could not be determined."
8050 #: ../fish/guestfish-actions.pod:1806 ../fish/guestfish-actions.pod:2142
8051 #: ../src/guestfs-actions.pod:2683 ../src/guestfs-actions.pod:3155
8056 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2685
8058 "Windows does not have distributions. This string is returned if the OS type "
8063 #: ../fish/guestfish-actions.pod:1813 ../fish/guestfish-actions.pod:1892
8064 #: ../fish/guestfish-actions.pod:2156 ../src/guestfs-actions.pod:2690
8065 #: ../src/guestfs-actions.pod:2794 ../src/guestfs-actions.pod:3169
8067 "Future versions of libguestfs may return other strings here. The caller "
8068 "should be prepared to handle any string."
8072 #: ../fish/guestfish-actions.pod:1818
8073 msgid "inspect-get-drive-mappings"
8077 #: ../fish/guestfish-actions.pod:1820
8080 " inspect-get-drive-mappings root\n"
8085 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2706
8087 "This call is useful for Windows which uses a primitive system of assigning "
8088 "drive letters (like \"C:\") to partitions. This inspection API examines the "
8089 "Windows Registry to find out how disks/partitions are mapped to drive "
8090 "letters, and returns a hash table as in the example below:"
8094 #: ../fish/guestfish-actions.pod:1828 ../src/guestfs-actions.pod:2712
8104 #: ../fish/guestfish-actions.pod:1832 ../src/guestfs-actions.pod:2716
8106 "Note that keys are drive letters. For Windows, the key is case insensitive "
8107 "and just contains the drive letter, without the customary colon separator "
8112 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2720
8114 "In future we may support other operating systems that also used drive "
8115 "letters, but the keys for those might not be case insensitive and might be "
8116 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
8121 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2725
8123 "For Windows guests, currently only hard drive mappings are returned. "
8124 "Removable disks (eg. DVD-ROMs) are ignored."
8128 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2728
8130 "For guests that do not use drive mappings, or if the drive mappings could "
8131 "not be determined, this returns an empty hash table."
8135 #: ../fish/guestfish-actions.pod:1847
8137 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8138 "get-mountpoints>, L</inspect-get-filesystems>."
8142 #: ../fish/guestfish-actions.pod:1851
8143 msgid "inspect-get-filesystems"
8147 #: ../fish/guestfish-actions.pod:1853
8150 " inspect-get-filesystems root\n"
8155 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2749
8157 "This returns a list of all the filesystems that we think are associated with "
8158 "this operating system. This includes the root filesystem, other ordinary "
8159 "filesystems, and non-mounted devices like swap partitions."
8163 #: ../fish/guestfish-actions.pod:1860 ../src/guestfs-actions.pod:2754
8165 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8166 "to be shared between operating systems."
8170 #: ../fish/guestfish-actions.pod:1863
8172 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8177 #: ../fish/guestfish-actions.pod:1866
8178 msgid "inspect-get-format"
8182 #: ../fish/guestfish-actions.pod:1868
8185 " inspect-get-format root\n"
8190 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2772
8192 "This returns the format of the inspected operating system. You can use it "
8193 "to detect install images, live CDs and similar."
8197 #: ../fish/guestfish-actions.pod:1873 ../src/guestfs-actions.pod:2775
8198 msgid "Currently defined formats are:"
8202 #: ../fish/guestfish-actions.pod:1877 ../src/guestfs-actions.pod:2779
8203 msgid "\"installed\""
8207 #: ../fish/guestfish-actions.pod:1879 ../src/guestfs-actions.pod:2781
8208 msgid "This is an installed operating system."
8212 #: ../fish/guestfish-actions.pod:1881 ../src/guestfs-actions.pod:2783
8213 msgid "\"installer\""
8217 #: ../fish/guestfish-actions.pod:1883 ../src/guestfs-actions.pod:2785
8219 "The disk image being inspected is not an installed operating system, but a "
8220 "I<bootable> install disk, live CD, or similar."
8224 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:2790
8225 msgid "The format of this disk image is not known."
8229 #: ../fish/guestfish-actions.pod:1897
8230 msgid "inspect-get-hostname"
8234 #: ../fish/guestfish-actions.pod:1899
8237 " inspect-get-hostname root\n"
8242 #: ../fish/guestfish-actions.pod:1901 ../src/guestfs-actions.pod:2810
8244 "This function returns the hostname of the operating system as found by "
8245 "inspection of the guest's configuration files."
8249 #: ../fish/guestfish-actions.pod:1904 ../src/guestfs-actions.pod:2813
8251 "If the hostname could not be determined, then the string C<unknown> is "
8256 #: ../fish/guestfish-actions.pod:1909
8257 msgid "inspect-get-icon"
8261 #: ../fish/guestfish-actions.pod:1911
8264 " inspect-get-icon root [favicon:..] [highquality:..]\n"
8269 #: ../fish/guestfish-actions.pod:1913 ../src/guestfs-actions.pod:2839
8271 "This function returns an icon corresponding to the inspected operating "
8272 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
8273 "to PNG if necessary)."
8277 #: ../fish/guestfish-actions.pod:1917 ../src/guestfs-actions.pod:2843
8279 "If it was not possible to get an icon this function returns a zero-length "
8280 "(non-NULL) buffer. I<Callers must check for this case>."
8284 #: ../fish/guestfish-actions.pod:1920 ../src/guestfs-actions.pod:2846
8286 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
8287 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
8288 "this file will be returned. You can disable favicons by passing the "
8289 "optional C<favicon> boolean as false (default is true)."
8293 #: ../fish/guestfish-actions.pod:1926 ../src/guestfs-actions.pod:2852
8295 "If finding the favicon fails, then we look in other places in the guest for "
8300 #: ../fish/guestfish-actions.pod:1929 ../src/guestfs-actions.pod:2855
8302 "If the optional C<highquality> boolean is true then only high quality icons "
8303 "are returned, which means only icons of high resolution with an alpha "
8304 "channel. The default (false) is to return any icon we can, even if it is of "
8305 "substandard quality."
8309 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2866
8311 "Unlike most other inspection API calls, the guest's disks must be mounted up "
8312 "before you call this, since it needs to read information from the guest "
8313 "filesystem during the call."
8317 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:2872
8319 "B<Security:> The icon data comes from the untrusted guest, and should be "
8320 "treated with caution. PNG files have been known to contain exploits. "
8321 "Ensure that libpng (or other relevant libraries) are fully up to date before "
8322 "trying to process or display the icon."
8326 #: ../fish/guestfish-actions.pod:1954 ../src/guestfs-actions.pod:2880
8328 "The PNG image returned can be any size. It might not be square. Libguestfs "
8329 "tries to return the largest, highest quality icon available. The "
8330 "application must scale the icon to the required size."
8334 #: ../fish/guestfish-actions.pod:1961 ../src/guestfs-actions.pod:2887
8336 "Extracting icons from Windows guests requires the external C<wrestool> "
8337 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
8338 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
8339 "installed separately."
8343 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2894
8345 "Operating system icons are usually trademarks. Seek legal advice before "
8346 "using trademarks in applications."
8350 #: ../fish/guestfish-actions.pod:1975
8351 msgid "inspect-get-major-version"
8355 #: ../fish/guestfish-actions.pod:1977
8358 " inspect-get-major-version root\n"
8363 #: ../fish/guestfish-actions.pod:1979 ../src/guestfs-actions.pod:2935
8365 "This returns the major version number of the inspected operating system."
8369 #: ../fish/guestfish-actions.pod:1982 ../src/guestfs-actions.pod:2938
8371 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8372 "popular public names used by the operating system. Notably the operating "
8373 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8374 "1). You can find out the real versions corresponding to releases of Windows "
8375 "by consulting Wikipedia or MSDN."
8379 #: ../fish/guestfish-actions.pod:1989 ../fish/guestfish-actions.pod:2000
8380 #: ../src/guestfs-actions.pod:2945 ../src/guestfs-actions.pod:2962
8381 msgid "If the version could not be determined, then C<0> is returned."
8385 #: ../fish/guestfish-actions.pod:1993
8386 msgid "inspect-get-minor-version"
8390 #: ../fish/guestfish-actions.pod:1995
8393 " inspect-get-minor-version root\n"
8398 #: ../fish/guestfish-actions.pod:1997 ../src/guestfs-actions.pod:2959
8400 "This returns the minor version number of the inspected operating system."
8404 #: ../fish/guestfish-actions.pod:2002
8406 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8407 "get-major-version>."
8411 #: ../fish/guestfish-actions.pod:2005
8412 msgid "inspect-get-mountpoints"
8416 #: ../fish/guestfish-actions.pod:2007
8419 " inspect-get-mountpoints root\n"
8424 #: ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:2977
8426 "This returns a hash of where we think the filesystems associated with this "
8427 "operating system should be mounted. Callers should note that this is at "
8428 "best an educated guess made by reading configuration files such as C</etc/"
8429 "fstab>. I<In particular note> that this may return filesystems which are "
8430 "non-existent or not mountable and callers should be prepared to handle or "
8431 "ignore failures if they try to mount them."
8435 #: ../fish/guestfish-actions.pod:2018 ../src/guestfs-actions.pod:2986
8437 "Each element in the returned hashtable has a key which is the path of the "
8438 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8439 "mounted there (eg. C</dev/sda1>)."
8443 #: ../fish/guestfish-actions.pod:2023 ../src/guestfs-actions.pod:2991
8445 "Non-mounted devices such as swap devices are I<not> returned in this list."
8449 #: ../fish/guestfish-actions.pod:2026
8451 "For operating systems like Windows which still use drive letters, this call "
8452 "will only return an entry for the first drive \"mounted on\" C</>. For "
8453 "information about the mapping of drive letters to partitions, see L</inspect-"
8454 "get-drive-mappings>."
8458 #: ../fish/guestfish-actions.pod:2032
8460 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8465 #: ../fish/guestfish-actions.pod:2035
8466 msgid "inspect-get-package-format"
8470 #: ../fish/guestfish-actions.pod:2037
8473 " inspect-get-package-format root\n"
8478 #: ../fish/guestfish-actions.pod:2039
8480 "This function and L</inspect-get-package-management> return the package "
8481 "format and package management tool used by the inspected operating system. "
8482 "For example for Fedora these functions would return C<rpm> (package format) "
8483 "and C<yum> (package management)."
8487 #: ../fish/guestfish-actions.pod:2045 ../src/guestfs-actions.pod:3023
8489 "This returns the string C<unknown> if we could not determine the package "
8490 "format I<or> if the operating system does not have a real packaging system "
8495 #: ../fish/guestfish-actions.pod:2049 ../src/guestfs-actions.pod:3027
8497 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
8498 "Future versions of libguestfs may return other strings."
8502 #: ../fish/guestfish-actions.pod:2054
8503 msgid "inspect-get-package-management"
8507 #: ../fish/guestfish-actions.pod:2056
8510 " inspect-get-package-management root\n"
8515 #: ../fish/guestfish-actions.pod:2058
8517 "L</inspect-get-package-format> and this function return the package format "
8518 "and package management tool used by the inspected operating system. For "
8519 "example for Fedora these functions would return C<rpm> (package format) and "
8520 "C<yum> (package management)."
8524 #: ../fish/guestfish-actions.pod:2064 ../src/guestfs-actions.pod:3049
8526 "This returns the string C<unknown> if we could not determine the package "
8527 "management tool I<or> if the operating system does not have a real packaging "
8528 "system (eg. Windows)."
8532 #: ../fish/guestfish-actions.pod:2068 ../src/guestfs-actions.pod:3053
8534 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
8535 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
8536 "libguestfs may return other strings."
8540 #: ../fish/guestfish-actions.pod:2075
8541 msgid "inspect-get-product-name"
8545 #: ../fish/guestfish-actions.pod:2077
8548 " inspect-get-product-name root\n"
8553 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3071
8555 "This returns the product name of the inspected operating system. The "
8556 "product name is generally some freeform string which can be displayed to the "
8557 "user, but should not be parsed by programs."
8561 #: ../fish/guestfish-actions.pod:2084 ../src/guestfs-actions.pod:3076
8563 "If the product name could not be determined, then the string C<unknown> is "
8568 #: ../fish/guestfish-actions.pod:2089
8569 msgid "inspect-get-product-variant"
8573 #: ../fish/guestfish-actions.pod:2091
8576 " inspect-get-product-variant root\n"
8581 #: ../fish/guestfish-actions.pod:2093 ../src/guestfs-actions.pod:3092
8582 msgid "This returns the product variant of the inspected operating system."
8586 #: ../fish/guestfish-actions.pod:2096 ../src/guestfs-actions.pod:3095
8588 "For Windows guests, this returns the contents of the Registry key C<HKLM"
8589 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
8590 "is usually a string such as C<Client> or C<Server> (other values are "
8591 "possible). This can be used to distinguish consumer and enterprise versions "
8592 "of Windows that have the same version number (for example, Windows 7 and "
8593 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8594 "the latter is C<Server>)."
8598 #: ../fish/guestfish-actions.pod:2105 ../src/guestfs-actions.pod:3104
8600 "For enterprise Linux guests, in future we intend this to return the product "
8601 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8602 "implemented at present."
8606 #: ../fish/guestfish-actions.pod:2109 ../src/guestfs-actions.pod:3108
8608 "If the product variant could not be determined, then the string C<unknown> "
8613 #: ../fish/guestfish-actions.pod:2112
8615 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8616 "get-product-name>, L</inspect-get-major-version>."
8620 #: ../fish/guestfish-actions.pod:2116
8621 msgid "inspect-get-roots"
8625 #: ../fish/guestfish-actions.pod:2118
8628 " inspect-get-roots\n"
8633 #: ../fish/guestfish-actions.pod:2120
8635 "This function is a convenient way to get the list of root devices, as "
8636 "returned from a previous call to L</inspect-os>, but without redoing the "
8637 "whole inspection process."
8641 #: ../fish/guestfish-actions.pod:2124
8643 "This returns an empty list if either no root devices were found or the "
8644 "caller has not called L</inspect-os>."
8648 #: ../fish/guestfish-actions.pod:2129
8649 msgid "inspect-get-type"
8653 #: ../fish/guestfish-actions.pod:2131
8656 " inspect-get-type root\n"
8661 #: ../fish/guestfish-actions.pod:2133 ../src/guestfs-actions.pod:3146
8663 "This returns the type of the inspected operating system. Currently defined "
8668 #: ../fish/guestfish-actions.pod:2138 ../src/guestfs-actions.pod:3151
8673 #: ../fish/guestfish-actions.pod:2140 ../src/guestfs-actions.pod:3153
8674 msgid "Any Linux-based operating system."
8678 #: ../fish/guestfish-actions.pod:2144 ../src/guestfs-actions.pod:3157
8679 msgid "Any Microsoft Windows operating system."
8683 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3159
8688 #: ../fish/guestfish-actions.pod:2148 ../src/guestfs-actions.pod:3161
8693 #: ../fish/guestfish-actions.pod:2152 ../src/guestfs-actions.pod:3165
8694 msgid "The operating system type could not be determined."
8698 #: ../fish/guestfish-actions.pod:2161
8699 msgid "inspect-get-windows-current-control-set"
8703 #: ../fish/guestfish-actions.pod:2163
8706 " inspect-get-windows-current-control-set root\n"
8711 #: ../fish/guestfish-actions.pod:2165 ../src/guestfs-actions.pod:3185
8713 "This returns the Windows CurrentControlSet of the inspected guest. The "
8714 "CurrentControlSet is a registry key name such as C<ControlSet001>."
8718 #: ../fish/guestfish-actions.pod:2168 ../src/guestfs-actions.pod:3188
8720 "This call assumes that the guest is Windows and that the Registry could be "
8721 "examined by inspection. If this is not the case then an error is returned."
8725 #: ../fish/guestfish-actions.pod:2174
8726 msgid "inspect-get-windows-systemroot"
8730 #: ../fish/guestfish-actions.pod:2176
8733 " inspect-get-windows-systemroot root\n"
8738 #: ../fish/guestfish-actions.pod:2178 ../src/guestfs-actions.pod:3205
8740 "This returns the Windows systemroot of the inspected guest. The systemroot "
8741 "is a directory path such as C</WINDOWS>."
8745 #: ../fish/guestfish-actions.pod:2181 ../src/guestfs-actions.pod:3208
8747 "This call assumes that the guest is Windows and that the systemroot could be "
8748 "determined by inspection. If this is not the case then an error is returned."
8752 #: ../fish/guestfish-actions.pod:2187
8753 msgid "inspect-is-live"
8757 #: ../fish/guestfish-actions.pod:2189
8760 " inspect-is-live root\n"
8765 #: ../fish/guestfish-actions.pod:2191
8767 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8768 "then this returns true if a live image was detected on the disk."
8772 #: ../fish/guestfish-actions.pod:2197
8773 msgid "inspect-is-multipart"
8777 #: ../fish/guestfish-actions.pod:2199
8780 " inspect-is-multipart root\n"
8785 #: ../fish/guestfish-actions.pod:2201
8787 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8788 "then this returns true if the disk is part of a set."
8792 #: ../fish/guestfish-actions.pod:2207
8793 msgid "inspect-is-netinst"
8797 #: ../fish/guestfish-actions.pod:2209
8800 " inspect-is-netinst root\n"
8805 #: ../fish/guestfish-actions.pod:2211
8807 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8808 "then this returns true if the disk is a network installer, ie. not a self-"
8809 "contained install CD but one which is likely to require network access to "
8810 "complete the install."
8814 #: ../fish/guestfish-actions.pod:2219
8815 msgid "inspect-list-applications"
8819 #: ../fish/guestfish-actions.pod:2221
8822 " inspect-list-applications root\n"
8827 #: ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:3275
8828 msgid "Return the list of applications installed in the operating system."
8832 #: ../fish/guestfish-actions.pod:2225
8834 "I<Note:> This call works differently from other parts of the inspection "
8835 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
8836 "then mount up the disks, before calling this. Listing applications is a "
8837 "significantly more difficult operation which requires access to the full "
8838 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
8839 "are just returning data cached in the libguestfs handle, this call actually "
8840 "reads parts of the mounted filesystems during the call."
8844 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:3287
8846 "This returns an empty list if the inspection code was not able to determine "
8847 "the list of applications."
8851 #: ../fish/guestfish-actions.pod:2238 ../src/guestfs-actions.pod:3290
8852 msgid "The application structure contains the following fields:"
8856 #: ../fish/guestfish-actions.pod:2242 ../src/guestfs-actions.pod:3294
8861 #: ../fish/guestfish-actions.pod:2244 ../src/guestfs-actions.pod:3296
8863 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8864 "guests, this is the package name."
8868 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3299
8869 msgid "C<app_display_name>"
8873 #: ../fish/guestfish-actions.pod:2249 ../src/guestfs-actions.pod:3301
8875 "The display name of the application, sometimes localized to the install "
8876 "language of the guest operating system."
8880 #: ../fish/guestfish-actions.pod:2252 ../src/guestfs-actions.pod:3304
8882 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8883 "to display something can use C<app_name> instead."
8887 #: ../fish/guestfish-actions.pod:2255 ../src/guestfs-actions.pod:3307
8888 msgid "C<app_epoch>"
8892 #: ../fish/guestfish-actions.pod:2257 ../src/guestfs-actions.pod:3309
8894 "For package managers which use epochs, this contains the epoch of the "
8895 "package (an integer). If unavailable, this is returned as C<0>."
8899 #: ../fish/guestfish-actions.pod:2260 ../src/guestfs-actions.pod:3312
8900 msgid "C<app_version>"
8904 #: ../fish/guestfish-actions.pod:2262 ../src/guestfs-actions.pod:3314
8906 "The version string of the application or package. If unavailable this is "
8907 "returned as an empty string C<\"\">."
8911 #: ../fish/guestfish-actions.pod:2265 ../src/guestfs-actions.pod:3317
8912 msgid "C<app_release>"
8916 #: ../fish/guestfish-actions.pod:2267 ../src/guestfs-actions.pod:3319
8918 "The release string of the application or package, for package managers that "
8919 "use this. If unavailable this is returned as an empty string C<\"\">."
8923 #: ../fish/guestfish-actions.pod:2271 ../src/guestfs-actions.pod:3323
8924 msgid "C<app_install_path>"
8928 #: ../fish/guestfish-actions.pod:2273 ../src/guestfs-actions.pod:3325
8930 "The installation path of the application (on operating systems such as "
8931 "Windows which use installation paths). This path is in the format used by "
8932 "the guest operating system, it is not a libguestfs path."
8936 #: ../fish/guestfish-actions.pod:2278 ../src/guestfs-actions.pod:3330
8937 msgid "If unavailable this is returned as an empty string C<\"\">."
8941 #: ../fish/guestfish-actions.pod:2280 ../src/guestfs-actions.pod:3332
8942 msgid "C<app_trans_path>"
8946 #: ../fish/guestfish-actions.pod:2282 ../src/guestfs-actions.pod:3334
8948 "The install path translated into a libguestfs path. If unavailable this is "
8949 "returned as an empty string C<\"\">."
8953 #: ../fish/guestfish-actions.pod:2285 ../src/guestfs-actions.pod:3337
8954 msgid "C<app_publisher>"
8958 #: ../fish/guestfish-actions.pod:2287 ../src/guestfs-actions.pod:3339
8960 "The name of the publisher of the application, for package managers that use "
8961 "this. If unavailable this is returned as an empty string C<\"\">."
8965 #: ../fish/guestfish-actions.pod:2291 ../src/guestfs-actions.pod:3343
8970 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3345
8972 "The URL (eg. upstream URL) of the application. If unavailable this is "
8973 "returned as an empty string C<\"\">."
8977 #: ../fish/guestfish-actions.pod:2296 ../src/guestfs-actions.pod:3348
8978 msgid "C<app_source_package>"
8982 #: ../fish/guestfish-actions.pod:2298 ../src/guestfs-actions.pod:3350
8984 "For packaging systems which support this, the name of the source package. "
8985 "If unavailable this is returned as an empty string C<\"\">."
8989 #: ../fish/guestfish-actions.pod:2301 ../src/guestfs-actions.pod:3353
8990 msgid "C<app_summary>"
8994 #: ../fish/guestfish-actions.pod:2303 ../src/guestfs-actions.pod:3355
8996 "A short (usually one line) description of the application or package. If "
8997 "unavailable this is returned as an empty string C<\"\">."
9001 #: ../fish/guestfish-actions.pod:2306 ../src/guestfs-actions.pod:3358
9002 msgid "C<app_description>"
9006 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3360
9008 "A longer description of the application or package. If unavailable this is "
9009 "returned as an empty string C<\"\">."
9013 #: ../fish/guestfish-actions.pod:2315
9018 #: ../fish/guestfish-actions.pod:2317
9026 #: ../fish/guestfish-actions.pod:2319 ../src/guestfs-actions.pod:3378
9028 "This function uses other libguestfs functions and certain heuristics to "
9029 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9030 "for operating systems."
9034 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3382
9035 msgid "The list returned is empty if no operating systems were found."
9039 #: ../fish/guestfish-actions.pod:2325 ../src/guestfs-actions.pod:3384
9041 "If one operating system was found, then this returns a list with a single "
9042 "element, which is the name of the root filesystem of this operating system. "
9043 "It is also possible for this function to return a list containing more than "
9044 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9045 "element being the root filesystem of one of the operating systems."
9049 #: ../fish/guestfish-actions.pod:2332
9051 "You can pass the root string(s) returned to other L</inspect-get-*> "
9052 "functions in order to query further information about each operating system, "
9053 "such as the name and version."
9057 #: ../fish/guestfish-actions.pod:2337
9059 "This function uses other libguestfs features such as L</mount-ro> and L</"
9060 "umount-all> in order to mount and unmount filesystems and look at the "
9061 "contents. This should be called with no disks currently mounted. The "
9062 "function may also use Augeas, so any existing Augeas handle will be closed."
9066 #: ../fish/guestfish-actions.pod:2343 ../src/guestfs-actions.pod:3402
9068 "This function cannot decrypt encrypted disks. The caller must do that first "
9069 "(supplying the necessary keys) if the disk is encrypted."
9073 #: ../fish/guestfish-actions.pod:2349 ../fish/guestfish-actions.pod:2547
9074 #: ../fish/guestfish-actions.pod:2606
9075 msgid "See also L</list-filesystems>."
9079 #: ../fish/guestfish-actions.pod:2351
9084 #: ../fish/guestfish-actions.pod:2353
9087 " is-blockdev path\n"
9092 #: ../fish/guestfish-actions.pod:2355 ../src/guestfs-actions.pod:3422
9094 "This returns C<true> if and only if there is a block device with the given "
9099 #: ../fish/guestfish-actions.pod:2358 ../fish/guestfish-actions.pod:2376
9100 #: ../fish/guestfish-actions.pod:2395 ../fish/guestfish-actions.pod:2404
9101 #: ../fish/guestfish-actions.pod:2414 ../fish/guestfish-actions.pod:2448
9102 #: ../fish/guestfish-actions.pod:2457
9103 msgid "See also L</stat>."
9107 #: ../fish/guestfish-actions.pod:2360
9112 #: ../fish/guestfish-actions.pod:2362
9120 #: ../fish/guestfish-actions.pod:2364 ../src/guestfs-actions.pod:3436
9122 "This returns true iff this handle is busy processing a command (in the "
9127 #: ../fish/guestfish-actions.pod:2369
9132 #: ../fish/guestfish-actions.pod:2371
9135 " is-chardev path\n"
9140 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3451
9142 "This returns C<true> if and only if there is a character device with the "
9143 "given C<path> name."
9147 #: ../fish/guestfish-actions.pod:2378
9152 #: ../fish/guestfish-actions.pod:2380
9160 #: ../fish/guestfish-actions.pod:2382 ../src/guestfs-actions.pod:3465
9162 "This returns true iff this handle is being configured (in the C<CONFIG> "
9167 #: ../fish/guestfish-actions.pod:2387
9172 #: ../fish/guestfish-actions.pod:2389
9180 #: ../fish/guestfish-actions.pod:2391 ../src/guestfs-actions.pod:3480
9182 "This returns C<true> if and only if there is a directory with the given "
9183 "C<path> name. Note that it returns false for other objects like files."
9187 #: ../fish/guestfish-actions.pod:2397
9192 #: ../fish/guestfish-actions.pod:2399
9200 #: ../fish/guestfish-actions.pod:2401 ../src/guestfs-actions.pod:3496
9202 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9203 "given C<path> name."
9207 #: ../fish/guestfish-actions.pod:2406
9212 #: ../fish/guestfish-actions.pod:2408
9220 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3511
9222 "This returns C<true> if and only if there is a regular file with the given "
9223 "C<path> name. Note that it returns false for other objects like directories."
9227 #: ../fish/guestfish-actions.pod:2416
9228 msgid "is-launching"
9232 #: ../fish/guestfish-actions.pod:2418
9240 #: ../fish/guestfish-actions.pod:2420 ../src/guestfs-actions.pod:3526
9242 "This returns true iff this handle is launching the subprocess (in the "
9243 "C<LAUNCHING> state)."
9247 #: ../fish/guestfish-actions.pod:2425
9252 #: ../fish/guestfish-actions.pod:2427
9260 #: ../fish/guestfish-actions.pod:2429 ../src/guestfs-actions.pod:3541
9262 "This command tests whether C<device> is a logical volume, and returns true "
9263 "iff this is the case."
9267 #: ../fish/guestfish-actions.pod:2432
9272 #: ../fish/guestfish-actions.pod:2434
9280 #: ../fish/guestfish-actions.pod:2436 ../src/guestfs-actions.pod:3553
9282 "This returns true iff this handle is ready to accept commands (in the "
9287 #: ../fish/guestfish-actions.pod:2441
9292 #: ../fish/guestfish-actions.pod:2443
9300 #: ../fish/guestfish-actions.pod:2445 ../src/guestfs-actions.pod:3568
9302 "This returns C<true> if and only if there is a Unix domain socket with the "
9303 "given C<path> name."
9307 #: ../fish/guestfish-actions.pod:2450
9312 #: ../fish/guestfish-actions.pod:2452
9315 " is-symlink path\n"
9320 #: ../fish/guestfish-actions.pod:2454 ../src/guestfs-actions.pod:3583
9322 "This returns C<true> if and only if there is a symbolic link with the given "
9327 #: ../fish/guestfish-actions.pod:2459
9332 #: ../fish/guestfish-actions.pod:2461
9340 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3598
9342 "This returns true iff the file exists and the file is empty or it contains "
9347 #: ../fish/guestfish-actions.pod:2466
9348 msgid "is-zero-device"
9352 #: ../fish/guestfish-actions.pod:2468
9355 " is-zero-device device\n"
9360 #: ../fish/guestfish-actions.pod:2470 ../src/guestfs-actions.pod:3611
9361 msgid "This returns true iff the device exists and contains all zero bytes."
9365 #: ../fish/guestfish-actions.pod:2472 ../src/guestfs-actions.pod:3613
9366 msgid "Note that for large devices this can take a long time to run."
9370 #: ../fish/guestfish-actions.pod:2474
9371 msgid "kill-subprocess"
9375 #: ../fish/guestfish-actions.pod:2476
9378 " kill-subprocess\n"
9383 #: ../fish/guestfish-actions.pod:2478 ../src/guestfs-actions.pod:3624
9384 msgid "This kills the qemu subprocess. You should never need to call this."
9388 #: ../fish/guestfish-actions.pod:2480
9393 #: ../fish/guestfish-actions.pod:2482
9398 #: ../fish/guestfish-actions.pod:2484
9406 #: ../fish/guestfish-actions.pod:2486 ../src/guestfs-actions.pod:3635
9408 "Internally libguestfs is implemented by running a virtual machine using "
9413 #: ../fish/guestfish-actions.pod:2489 ../src/guestfs-actions.pod:3638
9415 "You should call this after configuring the handle (eg. adding drives) but "
9416 "before performing any actions."
9420 #: ../fish/guestfish-actions.pod:2492
9425 #: ../fish/guestfish-actions.pod:2494
9428 " lchown owner group path\n"
9433 #: ../fish/guestfish-actions.pod:2496
9435 "Change the file owner to C<owner> and group to C<group>. This is like L</"
9436 "chown> but if C<path> is a symlink then the link itself is changed, not the "
9441 #: ../fish/guestfish-actions.pod:2504
9446 #: ../fish/guestfish-actions.pod:2506
9449 " lgetxattr path name\n"
9454 #: ../fish/guestfish-actions.pod:2508 ../src/guestfs-actions.pod:3678
9456 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
9457 "is a symlink, then this call returns an extended attribute from the symlink."
9461 #: ../fish/guestfish-actions.pod:2522
9462 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
9466 #: ../fish/guestfish-actions.pod:2524
9471 #: ../fish/guestfish-actions.pod:2526
9474 " lgetxattrs path\n"
9479 #: ../fish/guestfish-actions.pod:2528
9481 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
9482 "it returns the extended attributes of the link itself."
9486 #: ../fish/guestfish-actions.pod:2532
9491 #: ../fish/guestfish-actions.pod:2534
9499 #: ../fish/guestfish-actions.pod:2536 ../src/guestfs-actions.pod:3721
9501 "List all 9p filesystems attached to the guest. A list of mount tags is "
9506 #: ../fish/guestfish-actions.pod:2539
9507 msgid "list-devices"
9511 #: ../fish/guestfish-actions.pod:2541
9519 #: ../fish/guestfish-actions.pod:2543 ../src/guestfs-actions.pod:3735
9520 msgid "List all the block devices."
9524 #: ../fish/guestfish-actions.pod:2545 ../src/guestfs-actions.pod:3737
9525 msgid "The full block device names are returned, eg. C</dev/sda>."
9529 #: ../fish/guestfish-actions.pod:2549
9530 msgid "list-dm-devices"
9534 #: ../fish/guestfish-actions.pod:2551
9537 " list-dm-devices\n"
9542 #: ../fish/guestfish-actions.pod:2553 ../src/guestfs-actions.pod:3752
9543 msgid "List all device mapper devices."
9547 #: ../fish/guestfish-actions.pod:2555
9549 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
9550 "previous call to L</luks-open>."
9554 #: ../fish/guestfish-actions.pod:2558
9556 "Device mapper devices which correspond to logical volumes are I<not> "
9557 "returned in this list. Call L</lvs> if you want to list logical volumes."
9561 #: ../fish/guestfish-actions.pod:2562
9562 msgid "list-filesystems"
9566 #: ../fish/guestfish-actions.pod:2564
9569 " list-filesystems\n"
9574 #: ../fish/guestfish-actions.pod:2566 ../src/guestfs-actions.pod:3772
9576 "This inspection command looks for filesystems on partitions, block devices "
9577 "and logical volumes, returning a list of devices containing filesystems and "
9582 #: ../fish/guestfish-actions.pod:2570 ../src/guestfs-actions.pod:3776
9584 "The return value is a hash, where the keys are the devices containing "
9585 "filesystems, and the values are the filesystem types. For example:"
9589 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3780
9592 " \"/dev/sda1\" => \"ntfs\"\n"
9593 " \"/dev/sda2\" => \"ext2\"\n"
9594 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9595 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9600 #: ../fish/guestfish-actions.pod:2579 ../src/guestfs-actions.pod:3785
9602 "The value can have the special value \"unknown\", meaning the content of the "
9603 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9607 #: ../fish/guestfish-actions.pod:2583
9609 "This command runs other libguestfs commands, which might include L</mount> "
9610 "and L</umount>, and therefore you should use this soon after launch and only "
9611 "when nothing is mounted."
9615 #: ../fish/guestfish-actions.pod:2587
9617 "Not all of the filesystems returned will be mountable. In particular, swap "
9618 "partitions are returned in the list. Also this command does not check that "
9619 "each filesystem found is valid and mountable, and some filesystems might be "
9620 "mountable but require special options. Filesystems may not all belong to a "
9621 "single logical operating system (use L</inspect-os> to look for OSes)."
9625 #: ../fish/guestfish-actions.pod:2595
9626 msgid "list-partitions"
9630 #: ../fish/guestfish-actions.pod:2597
9633 " list-partitions\n"
9638 #: ../fish/guestfish-actions.pod:2599 ../src/guestfs-actions.pod:3814
9639 msgid "List all the partitions detected on all block devices."
9643 #: ../fish/guestfish-actions.pod:2601 ../src/guestfs-actions.pod:3816
9644 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9648 #: ../fish/guestfish-actions.pod:2603
9650 "This does not return logical volumes. For that you will need to call L</"
9655 #: ../fish/guestfish-actions.pod:2608
9660 #: ../fish/guestfish-actions.pod:2610
9668 #: ../fish/guestfish-actions.pod:2612 ../src/guestfs-actions.pod:3835
9670 "List the files in C<directory> (relative to the root directory, there is no "
9671 "cwd) in the format of 'ls -la'."
9675 #: ../fish/guestfish-actions.pod:2615 ../src/guestfs-actions.pod:3838
9677 "This command is mostly useful for interactive sessions. It is I<not> "
9678 "intended that you try to parse the output string."
9682 #: ../fish/guestfish-actions.pod:2618
9687 #: ../fish/guestfish-actions.pod:2620
9690 " ln target linkname\n"
9695 #: ../fish/guestfish-actions.pod:2622 ../src/guestfs-actions.pod:3853
9696 msgid "This command creates a hard link using the C<ln> command."
9700 #: ../fish/guestfish-actions.pod:2624
9705 #: ../fish/guestfish-actions.pod:2626
9708 " ln-f target linkname\n"
9713 #: ../fish/guestfish-actions.pod:2628 ../src/guestfs-actions.pod:3866
9715 "This command creates a hard link using the C<ln -f> command. The I<-f> "
9716 "option removes the link (C<linkname>) if it exists already."
9720 #: ../fish/guestfish-actions.pod:2631
9725 #: ../fish/guestfish-actions.pod:2633
9728 " ln-s target linkname\n"
9733 #: ../fish/guestfish-actions.pod:2635 ../src/guestfs-actions.pod:3880
9734 msgid "This command creates a symbolic link using the C<ln -s> command."
9738 #: ../fish/guestfish-actions.pod:2637
9743 #: ../fish/guestfish-actions.pod:2639
9746 " ln-sf target linkname\n"
9751 #: ../fish/guestfish-actions.pod:2641 ../src/guestfs-actions.pod:3893
9753 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
9754 "option removes the link (C<linkname>) if it exists already."
9758 #: ../fish/guestfish-actions.pod:2644
9759 msgid "lremovexattr"
9763 #: ../fish/guestfish-actions.pod:2646
9766 " lremovexattr xattr path\n"
9771 #: ../fish/guestfish-actions.pod:2648
9773 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
9774 "it removes an extended attribute of the link itself."
9778 #: ../fish/guestfish-actions.pod:2652
9783 #: ../fish/guestfish-actions.pod:2654
9791 #: ../fish/guestfish-actions.pod:2656 ../src/guestfs-actions.pod:3921
9793 "List the files in C<directory> (relative to the root directory, there is no "
9794 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
9798 #: ../fish/guestfish-actions.pod:2660
9800 "This command is mostly useful for interactive sessions. Programs should "
9801 "probably use L</readdir> instead."
9805 #: ../fish/guestfish-actions.pod:2663
9810 #: ../fish/guestfish-actions.pod:2665
9813 " lsetxattr xattr val vallen path\n"
9818 #: ../fish/guestfish-actions.pod:2667
9820 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
9821 "sets an extended attribute of the link itself."
9825 #: ../fish/guestfish-actions.pod:2671
9830 #: ../fish/guestfish-actions.pod:2673
9838 #: ../fish/guestfish-actions.pod:2675 ../fish/guestfish-actions.pod:4483
9839 #: ../src/guestfs-actions.pod:3957 ../src/guestfs-actions.pod:6736
9840 msgid "Returns file information for the given C<path>."
9844 #: ../fish/guestfish-actions.pod:2677
9846 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
9847 "the link is stat-ed, not the file it refers to."
9851 #: ../fish/guestfish-actions.pod:2681 ../src/guestfs-actions.pod:3963
9852 msgid "This is the same as the C<lstat(2)> system call."
9856 #: ../fish/guestfish-actions.pod:2683
9861 #: ../fish/guestfish-actions.pod:2685
9864 " lstatlist path 'names ...'\n"
9869 #: ../fish/guestfish-actions.pod:2687
9871 "This call allows you to perform the L</lstat> operation on multiple files, "
9872 "where all files are in the directory C<path>. C<names> is the list of files "
9873 "from this directory."
9877 #: ../fish/guestfish-actions.pod:2691 ../src/guestfs-actions.pod:3982
9879 "On return you get a list of stat structs, with a one-to-one correspondence "
9880 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9881 "then the C<ino> field of that structure is set to C<-1>."
9885 #: ../fish/guestfish-actions.pod:2696
9887 "This call is intended for programs that want to efficiently list a directory "
9888 "contents without making many round-trips. See also L</lxattrlist> for a "
9889 "similarly efficient call for getting extended attributes. Very long "
9890 "directory listings might cause the protocol message size to be exceeded, "
9891 "causing this call to fail. The caller must split up such requests into "
9892 "smaller groups of names."
9896 #: ../fish/guestfish-actions.pod:2704
9897 msgid "luks-add-key"
9901 #: ../fish/guestfish-actions.pod:2706
9904 " luks-add-key device keyslot\n"
9909 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4010
9911 "This command adds a new key on LUKS device C<device>. C<key> is any "
9912 "existing key, and is used to access the device. C<newkey> is the new key to "
9913 "add. C<keyslot> is the key slot that will be replaced."
9917 #: ../fish/guestfish-actions.pod:2713
9919 "Note that if C<keyslot> already contains a key, then this command will "
9920 "fail. You have to use L</luks-kill-slot> first to remove that key."
9924 #: ../fish/guestfish-actions.pod:2717 ../fish/guestfish-actions.pod:2739
9925 #: ../fish/guestfish-actions.pod:2752 ../fish/guestfish-actions.pod:2766
9926 #: ../fish/guestfish-actions.pod:2792 ../fish/guestfish-actions.pod:2802
9928 "This command has one or more key or passphrase parameters. Guestfish will "
9929 "prompt for these separately."
9933 #: ../fish/guestfish-actions.pod:2720
9938 #: ../fish/guestfish-actions.pod:2722
9941 " luks-close device\n"
9946 #: ../fish/guestfish-actions.pod:2724
9948 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
9949 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
9950 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
9955 #: ../fish/guestfish-actions.pod:2730
9960 #: ../fish/guestfish-actions.pod:2732
9963 " luks-format device keyslot\n"
9968 #: ../fish/guestfish-actions.pod:2734 ../src/guestfs-actions.pod:4051
9970 "This command erases existing data on C<device> and formats the device as a "
9971 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9972 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9976 #: ../fish/guestfish-actions.pod:2742 ../fish/guestfish-actions.pod:2755
9977 #: ../fish/guestfish-actions.pod:2842 ../fish/guestfish-actions.pod:3503
9978 #: ../fish/guestfish-actions.pod:4029 ../fish/guestfish-actions.pod:4354
9979 #: ../fish/guestfish-actions.pod:4377 ../fish/guestfish-actions.pod:4399
9980 #: ../fish/guestfish-actions.pod:5145 ../src/guestfs-actions.pod:4058
9981 #: ../src/guestfs-actions.pod:4081 ../src/guestfs-actions.pod:4224
9982 #: ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:6115
9983 #: ../src/guestfs-actions.pod:6550 ../src/guestfs-actions.pod:6580
9984 #: ../src/guestfs-actions.pod:6613 ../src/guestfs-actions.pod:7812
9986 "B<This command is dangerous. Without careful use you can easily destroy all "
9991 #: ../fish/guestfish-actions.pod:2745
9992 msgid "luks-format-cipher"
9996 #: ../fish/guestfish-actions.pod:2747
9999 " luks-format-cipher device keyslot cipher\n"
10004 #: ../fish/guestfish-actions.pod:2749
10006 "This command is the same as L</luks-format> but it also allows you to set "
10007 "the C<cipher> used."
10011 #: ../fish/guestfish-actions.pod:2758
10012 msgid "luks-kill-slot"
10016 #: ../fish/guestfish-actions.pod:2760
10019 " luks-kill-slot device keyslot\n"
10024 #: ../fish/guestfish-actions.pod:2762 ../src/guestfs-actions.pod:4098
10026 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10027 "device C<device>. C<key> must be one of the I<other> keys."
10031 #: ../fish/guestfish-actions.pod:2769
10036 #: ../fish/guestfish-actions.pod:2771
10039 " luks-open device mapname\n"
10044 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4118
10046 "This command opens a block device which has been encrypted according to the "
10047 "Linux Unified Key Setup (LUKS) standard."
10051 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4121
10052 msgid "C<device> is the encrypted block device or partition."
10056 #: ../fish/guestfish-actions.pod:2778 ../src/guestfs-actions.pod:4123
10058 "The caller must supply one of the keys associated with the LUKS block "
10059 "device, in the C<key> parameter."
10063 #: ../fish/guestfish-actions.pod:2781 ../src/guestfs-actions.pod:4126
10065 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10066 "writes to this block device are decrypted from and encrypted to the "
10067 "underlying C<device> respectively."
10071 #: ../fish/guestfish-actions.pod:2785
10073 "If this block device contains LVM volume groups, then calling L</vgscan> "
10074 "followed by L</vg-activate-all> will make them visible."
10078 #: ../fish/guestfish-actions.pod:2789
10079 msgid "Use L</list-dm-devices> to list all device mapper devices."
10083 #: ../fish/guestfish-actions.pod:2795
10084 msgid "luks-open-ro"
10088 #: ../fish/guestfish-actions.pod:2797
10091 " luks-open-ro device mapname\n"
10096 #: ../fish/guestfish-actions.pod:2799
10098 "This is the same as L</luks-open> except that a read-only mapping is created."
10102 #: ../fish/guestfish-actions.pod:2805
10107 #: ../fish/guestfish-actions.pod:2807
10110 " lvcreate logvol volgroup mbytes\n"
10115 #: ../fish/guestfish-actions.pod:2809 ../src/guestfs-actions.pod:4172
10117 "This creates an LVM logical volume called C<logvol> on the volume group "
10118 "C<volgroup>, with C<size> megabytes."
10122 #: ../fish/guestfish-actions.pod:2812
10123 msgid "lvm-canonical-lv-name"
10127 #: ../fish/guestfish-actions.pod:2814
10130 " lvm-canonical-lv-name lvname\n"
10135 #: ../fish/guestfish-actions.pod:2816 ../src/guestfs-actions.pod:4185
10137 "This converts alternative naming schemes for LVs that you might find to the "
10138 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10143 #: ../fish/guestfish-actions.pod:2820 ../src/guestfs-actions.pod:4189
10145 "This command returns an error if the C<lvname> parameter does not refer to a "
10150 #: ../fish/guestfish-actions.pod:2823
10151 msgid "See also L</is-lv>."
10155 #: ../fish/guestfish-actions.pod:2825
10156 msgid "lvm-clear-filter"
10160 #: ../fish/guestfish-actions.pod:2827
10163 " lvm-clear-filter\n"
10168 #: ../fish/guestfish-actions.pod:2829
10170 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
10175 #: ../fish/guestfish-actions.pod:2832 ../fish/guestfish-actions.pod:2863
10176 #: ../src/guestfs-actions.pod:4207 ../src/guestfs-actions.pod:4249
10178 "This command also clears the LVM cache and performs a volume group scan."
10182 #: ../fish/guestfish-actions.pod:2835
10183 msgid "lvm-remove-all"
10187 #: ../fish/guestfish-actions.pod:2837
10190 " lvm-remove-all\n"
10195 #: ../fish/guestfish-actions.pod:2839 ../src/guestfs-actions.pod:4219
10197 "This command removes all LVM logical volumes, volume groups and physical "
10202 #: ../fish/guestfish-actions.pod:2845
10203 msgid "lvm-set-filter"
10207 #: ../fish/guestfish-actions.pod:2847
10210 " lvm-set-filter 'devices ...'\n"
10215 #: ../fish/guestfish-actions.pod:2849 ../src/guestfs-actions.pod:4235
10217 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10218 "block devices in the list C<devices>, and will ignore all other attached "
10223 #: ../fish/guestfish-actions.pod:2853 ../src/guestfs-actions.pod:4239
10225 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10226 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10227 "there are two types of duplication possible: either cloned PVs/VGs which "
10228 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10229 "same name. In normal operation you cannot create this situation, but you "
10230 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10231 "inside the LVM metadata."
10235 #: ../fish/guestfish-actions.pod:2866 ../src/guestfs-actions.pod:4252
10236 msgid "You can filter whole block devices or individual partitions."
10240 #: ../fish/guestfish-actions.pod:2868 ../src/guestfs-actions.pod:4254
10242 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10243 "filesystem), even if you are not filtering out that VG."
10247 #: ../fish/guestfish-actions.pod:2872
10252 #: ../fish/guestfish-actions.pod:2874
10255 " lvremove device\n"
10260 #: ../fish/guestfish-actions.pod:2876 ../src/guestfs-actions.pod:4268
10262 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10263 "LV, such as C</dev/VG/LV>."
10267 #: ../fish/guestfish-actions.pod:2879 ../src/guestfs-actions.pod:4271
10269 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10274 #: ../fish/guestfish-actions.pod:2882
10279 #: ../fish/guestfish-actions.pod:2884
10282 " lvrename logvol newlogvol\n"
10287 #: ../fish/guestfish-actions.pod:2886 ../src/guestfs-actions.pod:4285
10288 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10292 #: ../fish/guestfish-actions.pod:2888
10297 #: ../fish/guestfish-actions.pod:2890
10300 " lvresize device mbytes\n"
10305 #: ../fish/guestfish-actions.pod:2892 ../src/guestfs-actions.pod:4298
10307 "This resizes (expands or shrinks) an existing LVM logical volume to "
10308 "C<mbytes>. When reducing, data in the reduced part is lost."
10312 #: ../fish/guestfish-actions.pod:2896
10313 msgid "lvresize-free"
10317 #: ../fish/guestfish-actions.pod:2898
10320 " lvresize-free lv percent\n"
10325 #: ../fish/guestfish-actions.pod:2900 ../src/guestfs-actions.pod:4313
10327 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10328 "remaining free space in the volume group. Commonly you would call this with "
10329 "pc = 100 which expands the logical volume as much as possible, using all "
10330 "remaining free space in the volume group."
10334 #: ../fish/guestfish-actions.pod:2906
10339 #: ../fish/guestfish-actions.pod:2908
10347 #: ../fish/guestfish-actions.pod:2910 ../src/guestfs-actions.pod:4328
10349 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10354 #: ../fish/guestfish-actions.pod:2913 ../src/guestfs-actions.pod:4331
10356 "This returns a list of the logical volume device names (eg. C</dev/"
10357 "VolGroup00/LogVol00>)."
10361 #: ../fish/guestfish-actions.pod:2916
10362 msgid "See also L</lvs-full>, L</list-filesystems>."
10366 #: ../fish/guestfish-actions.pod:2918
10371 #: ../fish/guestfish-actions.pod:2920
10379 #: ../fish/guestfish-actions.pod:2922 ../src/guestfs-actions.pod:4347
10381 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10382 "(8)> command. The \"full\" version includes all fields."
10386 #: ../fish/guestfish-actions.pod:2925
10391 #: ../fish/guestfish-actions.pod:2927
10399 #: ../fish/guestfish-actions.pod:2929 ../src/guestfs-actions.pod:4362
10400 msgid "This command returns the UUID of the LVM LV C<device>."
10404 #: ../fish/guestfish-actions.pod:2931
10409 #: ../fish/guestfish-actions.pod:2933
10412 " lxattrlist path 'names ...'\n"
10417 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4376
10419 "This call allows you to get the extended attributes of multiple files, where "
10420 "all files are in the directory C<path>. C<names> is the list of files from "
10425 #: ../fish/guestfish-actions.pod:2939 ../src/guestfs-actions.pod:4380
10427 "On return you get a flat list of xattr structs which must be interpreted "
10428 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10429 "C<attrval> in this struct is zero-length to indicate there was an error "
10430 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10431 "number (the number of following attributes for this file, which could be C<"
10432 "\"0\">). Then after the first xattr struct are the zero or more attributes "
10433 "for the first named file. This repeats for the second and subsequent files."
10437 #: ../fish/guestfish-actions.pod:2949
10439 "This call is intended for programs that want to efficiently list a directory "
10440 "contents without making many round-trips. See also L</lstatlist> for a "
10441 "similarly efficient call for getting standard stats. Very long directory "
10442 "listings might cause the protocol message size to be exceeded, causing this "
10443 "call to fail. The caller must split up such requests into smaller groups of "
10448 #: ../fish/guestfish-actions.pod:2957
10453 #: ../fish/guestfish-actions.pod:2959
10461 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4410
10462 msgid "Create a directory named C<path>."
10466 #: ../fish/guestfish-actions.pod:2963
10471 #: ../fish/guestfish-actions.pod:2965
10474 " mkdir-mode path mode\n"
10479 #: ../fish/guestfish-actions.pod:2967 ../src/guestfs-actions.pod:4423
10481 "This command creates a directory, setting the initial permissions of the "
10482 "directory to C<mode>."
10486 #: ../fish/guestfish-actions.pod:2970 ../src/guestfs-actions.pod:4426
10488 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10489 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10494 #: ../fish/guestfish-actions.pod:2974
10495 msgid "See also L</mkdir>, L</umask>"
10499 #: ../fish/guestfish-actions.pod:2976
10504 #: ../fish/guestfish-actions.pod:2978
10512 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4442
10514 "Create a directory named C<path>, creating any parent directories as "
10515 "necessary. This is like the C<mkdir -p> shell command."
10519 #: ../fish/guestfish-actions.pod:2983
10524 #: ../fish/guestfish-actions.pod:2985
10527 " mkdtemp template\n"
10532 #: ../fish/guestfish-actions.pod:2987 ../src/guestfs-actions.pod:4455
10534 "This command creates a temporary directory. The C<template> parameter "
10535 "should be a full pathname for the temporary directory name with the final "
10536 "six characters being \"XXXXXX\"."
10540 #: ../fish/guestfish-actions.pod:2992 ../src/guestfs-actions.pod:4460
10542 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10543 "being suitable for Windows filesystems."
10547 #: ../fish/guestfish-actions.pod:2995 ../src/guestfs-actions.pod:4463
10548 msgid "The name of the temporary directory that was created is returned."
10552 #: ../fish/guestfish-actions.pod:2998 ../src/guestfs-actions.pod:4466
10553 msgid "The temporary directory is created with mode 0700 and is owned by root."
10557 #: ../fish/guestfish-actions.pod:3001 ../src/guestfs-actions.pod:4469
10559 "The caller is responsible for deleting the temporary directory and its "
10560 "contents after use."
10564 #: ../fish/guestfish-actions.pod:3004 ../src/guestfs-actions.pod:4472
10565 msgid "See also: L<mkdtemp(3)>"
10569 #: ../fish/guestfish-actions.pod:3006
10574 #: ../fish/guestfish-actions.pod:3008
10577 " mke2fs-J fstype blocksize device journal\n"
10582 #: ../fish/guestfish-actions.pod:3010 ../src/guestfs-actions.pod:4488
10584 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10585 "C<journal>. It is equivalent to the command:"
10589 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4492
10592 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10597 #: ../fish/guestfish-actions.pod:3016
10598 msgid "See also L</mke2journal>."
10602 #: ../fish/guestfish-actions.pod:3018
10607 #: ../fish/guestfish-actions.pod:3020
10610 " mke2fs-JL fstype blocksize device label\n"
10615 #: ../fish/guestfish-actions.pod:3022 ../src/guestfs-actions.pod:4509
10617 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10618 "the journal labeled C<label>."
10622 #: ../fish/guestfish-actions.pod:3025
10623 msgid "See also L</mke2journal-L>."
10627 #: ../fish/guestfish-actions.pod:3027
10632 #: ../fish/guestfish-actions.pod:3029
10635 " mke2fs-JU fstype blocksize device uuid\n"
10640 #: ../fish/guestfish-actions.pod:3031 ../src/guestfs-actions.pod:4527
10642 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10643 "the journal with UUID C<uuid>."
10647 #: ../fish/guestfish-actions.pod:3034
10648 msgid "See also L</mke2journal-U>."
10652 #: ../fish/guestfish-actions.pod:3036
10653 msgid "mke2journal"
10657 #: ../fish/guestfish-actions.pod:3038
10660 " mke2journal blocksize device\n"
10665 #: ../fish/guestfish-actions.pod:3040 ../src/guestfs-actions.pod:4543
10667 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10672 #: ../fish/guestfish-actions.pod:3043 ../src/guestfs-actions.pod:4546
10675 " mke2fs -O journal_dev -b blocksize device\n"
10680 #: ../fish/guestfish-actions.pod:3045
10681 msgid "mke2journal-L"
10685 #: ../fish/guestfish-actions.pod:3047
10688 " mke2journal-L blocksize label device\n"
10693 #: ../fish/guestfish-actions.pod:3049 ../src/guestfs-actions.pod:4560
10694 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10698 #: ../fish/guestfish-actions.pod:3051
10699 msgid "mke2journal-U"
10703 #: ../fish/guestfish-actions.pod:3053
10706 " mke2journal-U blocksize uuid device\n"
10711 #: ../fish/guestfish-actions.pod:3055 ../src/guestfs-actions.pod:4574
10712 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10716 #: ../fish/guestfish-actions.pod:3057
10721 #: ../fish/guestfish-actions.pod:3059
10724 " mkfifo mode path\n"
10729 #: ../fish/guestfish-actions.pod:3061
10731 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10732 "is just a convenient wrapper around L</mknod>."
10736 #: ../fish/guestfish-actions.pod:3067
10741 #: ../fish/guestfish-actions.pod:3069
10744 " mkfs fstype device\n"
10749 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4604
10751 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10752 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10756 #: ../fish/guestfish-actions.pod:3075
10761 #: ../fish/guestfish-actions.pod:3077
10764 " mkfs-b fstype blocksize device\n"
10769 #: ../fish/guestfish-actions.pod:3079
10771 "This call is similar to L</mkfs>, but it allows you to control the block "
10772 "size of the resulting filesystem. Supported block sizes depend on the "
10773 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10777 #: ../fish/guestfish-actions.pod:3084 ../fish/guestfish-actions.pod:3111
10778 #: ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:4670
10780 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10785 #: ../fish/guestfish-actions.pod:3087
10787 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
10792 #: ../fish/guestfish-actions.pod:3094
10797 #: ../fish/guestfish-actions.pod:3096
10800 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
10805 #: ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4657
10807 "This function creates a filesystem on C<device>. The filesystem type is "
10808 "C<fstype>, for example C<ext3>."
10812 #: ../fish/guestfish-actions.pod:3105 ../src/guestfs-actions.pod:4664
10813 msgid "C<blocksize>"
10817 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4666
10819 "The filesystem block size. Supported block sizes depend on the filesystem "
10820 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
10825 #: ../fish/guestfish-actions.pod:3114 ../src/guestfs-actions.pod:4673
10826 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
10830 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4675
10831 msgid "C<features>"
10835 #: ../fish/guestfish-actions.pod:3118 ../src/guestfs-actions.pod:4677
10836 msgid "This passes the I<-O> parameter to the external mkfs program."
10840 #: ../fish/guestfish-actions.pod:3120 ../src/guestfs-actions.pod:4679
10842 "For certain filesystem types, this allows extra filesystem features to be "
10843 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
10847 #: ../fish/guestfish-actions.pod:3124 ../src/guestfs-actions.pod:4683
10849 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
10854 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4686
10859 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4688
10861 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
10862 "sets the inode size (only for ext2/3/4 filesystems at present)."
10866 #: ../fish/guestfish-actions.pod:3132 ../src/guestfs-actions.pod:4691
10867 msgid "C<sectorsize>"
10871 #: ../fish/guestfish-actions.pod:3134 ../src/guestfs-actions.pod:4693
10873 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
10874 "sets sector size for ufs filesystem."
10878 #: ../fish/guestfish-actions.pod:3141
10879 msgid "mkmountpoint"
10883 #: ../fish/guestfish-actions.pod:3143
10886 " mkmountpoint exemptpath\n"
10891 #: ../fish/guestfish-actions.pod:3145
10893 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
10894 "to create extra mountpoints before mounting the first filesystem."
10898 #: ../fish/guestfish-actions.pod:3149 ../src/guestfs-actions.pod:4736
10900 "These calls are I<only> necessary in some very limited circumstances, mainly "
10901 "the case where you want to mount a mix of unrelated and/or read-only "
10902 "filesystems together."
10906 #: ../fish/guestfish-actions.pod:3153 ../src/guestfs-actions.pod:4740
10908 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10909 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10910 "inside that. You can unpack this as follows in guestfish:"
10914 #: ../fish/guestfish-actions.pod:3158 ../src/guestfs-actions.pod:4745
10917 " add-ro Fedora-11-i686-Live.iso\n"
10919 " mkmountpoint /cd\n"
10920 " mkmountpoint /sqsh\n"
10921 " mkmountpoint /ext3fs\n"
10922 " mount /dev/sda /cd\n"
10923 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10924 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10929 #: ../fish/guestfish-actions.pod:3167 ../src/guestfs-actions.pod:4754
10930 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10934 #: ../fish/guestfish-actions.pod:3169
10936 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
10937 "unexpected errors if you try to mix these calls. It is safest to manually "
10938 "unmount filesystems and remove mountpoints after use."
10942 #: ../fish/guestfish-actions.pod:3173
10944 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
10945 "for this to work for manual mountpoints, you must ensure that the innermost "
10946 "mountpoints have the longest pathnames, as in the example code above."
10950 #: ../fish/guestfish-actions.pod:3178 ../src/guestfs-actions.pod:4765
10952 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10956 #: ../fish/guestfish-actions.pod:3180
10958 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
10959 "L</umount-all> to be called when the handle is closed which can also trigger "
10964 #: ../fish/guestfish-actions.pod:3184
10969 #: ../fish/guestfish-actions.pod:3186
10972 " mknod mode devmajor devminor path\n"
10977 #: ../fish/guestfish-actions.pod:3188 ../src/guestfs-actions.pod:4784
10979 "This call creates block or character special devices, or named pipes (FIFOs)."
10983 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4787
10985 "The C<mode> parameter should be the mode, using the standard constants. "
10986 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10987 "used when creating block and character special devices."
10991 #: ../fish/guestfish-actions.pod:3196
10993 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10994 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10995 "regular file). These constants are available in the standard Linux header "
10996 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
10997 "wrappers around this command which bitwise OR in the appropriate constant "
11002 #: ../fish/guestfish-actions.pod:3206
11007 #: ../fish/guestfish-actions.pod:3208
11010 " mknod-b mode devmajor devminor path\n"
11015 #: ../fish/guestfish-actions.pod:3210
11017 "This call creates a block device node called C<path> with mode C<mode> and "
11018 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11019 "wrapper around L</mknod>."
11023 #: ../fish/guestfish-actions.pod:3216
11028 #: ../fish/guestfish-actions.pod:3218
11031 " mknod-c mode devmajor devminor path\n"
11036 #: ../fish/guestfish-actions.pod:3220
11038 "This call creates a char device node called C<path> with mode C<mode> and "
11039 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11040 "wrapper around L</mknod>."
11044 #: ../fish/guestfish-actions.pod:3226
11049 #: ../fish/guestfish-actions.pod:3228
11057 #: ../fish/guestfish-actions.pod:3230 ../src/guestfs-actions.pod:4850
11058 msgid "Create a swap partition on C<device>."
11062 #: ../fish/guestfish-actions.pod:3232
11067 #: ../fish/guestfish-actions.pod:3234
11070 " mkswap-L label device\n"
11075 #: ../fish/guestfish-actions.pod:3236 ../src/guestfs-actions.pod:4863
11076 msgid "Create a swap partition on C<device> with label C<label>."
11080 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4865
11082 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11083 "sda>), just to a partition. This appears to be a limitation of the kernel "
11088 #: ../fish/guestfish-actions.pod:3242
11093 #: ../fish/guestfish-actions.pod:3244
11096 " mkswap-U uuid device\n"
11101 #: ../fish/guestfish-actions.pod:3246 ../src/guestfs-actions.pod:4880
11102 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11106 #: ../fish/guestfish-actions.pod:3248
11107 msgid "mkswap-file"
11111 #: ../fish/guestfish-actions.pod:3250
11114 " mkswap-file path\n"
11119 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4892
11120 msgid "Create a swap file."
11124 #: ../fish/guestfish-actions.pod:3254
11126 "This command just writes a swap file signature to an existing file. To "
11127 "create the file itself, use something like L</fallocate>."
11131 #: ../fish/guestfish-actions.pod:3257
11136 #: ../fish/guestfish-actions.pod:3259
11139 " modprobe modulename\n"
11144 #: ../fish/guestfish-actions.pod:3261 ../src/guestfs-actions.pod:4907
11145 msgid "This loads a kernel module in the appliance."
11149 #: ../fish/guestfish-actions.pod:3263 ../src/guestfs-actions.pod:4909
11151 "The kernel module must have been whitelisted when libguestfs was built (see "
11152 "C<appliance/kmod.whitelist.in> in the source)."
11156 #: ../fish/guestfish-actions.pod:3266
11161 #: ../fish/guestfish-actions.pod:3268
11164 " mount device mountpoint\n"
11169 #: ../fish/guestfish-actions.pod:3270 ../src/guestfs-actions.pod:4930
11171 "Mount a guest disk at a position in the filesystem. Block devices are named "
11172 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11173 "those block devices contain partitions, they will have the usual names (eg. "
11174 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11178 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4936
11180 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11181 "mounted on C</> before others can be mounted. Other filesystems can only be "
11182 "mounted on directories which already exist."
11186 #: ../fish/guestfish-actions.pod:3281 ../src/guestfs-actions.pod:4941
11188 "The mounted filesystem is writable, if we have sufficient permissions on the "
11189 "underlying device."
11193 #: ../fish/guestfish-actions.pod:3284
11195 "B<Important note:> When you use this call, the filesystem options C<sync> "
11196 "and C<noatime> are set implicitly. This was originally done because we "
11197 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11198 "very large negative performance impact and negligible effect on "
11199 "reliability. Therefore we recommend that you avoid using L</mount> in any "
11200 "code that needs performance, and instead use L</mount-options> (use an empty "
11201 "string for the first parameter if you don't want any options)."
11205 #: ../fish/guestfish-actions.pod:3294
11207 "I<This function is deprecated.> In new code, use the L</mount_options> call "
11212 #: ../fish/guestfish-actions.pod:3301
11217 #: ../fish/guestfish-actions.pod:3303
11220 " mount-9p mounttag mountpoint [options:..]\n"
11225 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:4973
11227 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
11232 #: ../fish/guestfish-actions.pod:3308 ../src/guestfs-actions.pod:4976
11234 "If required, C<trans=virtio> will be automatically added to the options. "
11235 "Any other options required can be passed in the optional C<options> "
11240 #: ../fish/guestfish-actions.pod:3314
11245 #: ../fish/guestfish-actions.pod:3316
11248 " mount-loop file mountpoint\n"
11253 #: ../fish/guestfish-actions.pod:3318 ../src/guestfs-actions.pod:5015
11255 "This command lets you mount C<file> (a filesystem image in a file) on a "
11256 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11261 #: ../fish/guestfish-actions.pod:3322
11262 msgid "mount-options"
11266 #: ../fish/guestfish-actions.pod:3324
11269 " mount-options options device mountpoint\n"
11274 #: ../fish/guestfish-actions.pod:3326
11276 "This is the same as the L</mount> command, but it allows you to set the "
11277 "mount options as for the L<mount(8)> I<-o> flag."
11281 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5035
11283 "If the C<options> parameter is an empty string, then no options are passed "
11284 "(all options default to whatever the filesystem uses)."
11288 #: ../fish/guestfish-actions.pod:3334
11293 #: ../fish/guestfish-actions.pod:3336
11296 " mount-ro device mountpoint\n"
11301 #: ../fish/guestfish-actions.pod:3338
11303 "This is the same as the L</mount> command, but it mounts the filesystem with "
11304 "the read-only (I<-o ro>) flag."
11308 #: ../fish/guestfish-actions.pod:3341
11313 #: ../fish/guestfish-actions.pod:3343
11316 " mount-vfs options vfstype device mountpoint\n"
11321 #: ../fish/guestfish-actions.pod:3345
11323 "This is the same as the L</mount> command, but it allows you to set both the "
11324 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
11328 #: ../fish/guestfish-actions.pod:3349
11329 msgid "mountpoints"
11333 #: ../fish/guestfish-actions.pod:3351
11341 #: ../fish/guestfish-actions.pod:3353
11343 "This call is similar to L</mounts>. That call returns a list of devices. "
11344 "This one returns a hash table (map) of device name to directory where the "
11345 "device is mounted."
11349 #: ../fish/guestfish-actions.pod:3357
11354 #: ../fish/guestfish-actions.pod:3359
11362 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5096
11364 "This returns the list of currently mounted filesystems. It returns the list "
11365 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11369 #: ../fish/guestfish-actions.pod:3364 ../src/guestfs-actions.pod:5099
11370 msgid "Some internal mounts are not shown."
11374 #: ../fish/guestfish-actions.pod:3366
11375 msgid "See also: L</mountpoints>"
11379 #: ../fish/guestfish-actions.pod:3368
11384 #: ../fish/guestfish-actions.pod:3370
11392 #: ../fish/guestfish-actions.pod:3372 ../src/guestfs-actions.pod:5116
11394 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11395 "destination filename or destination directory."
11399 #: ../fish/guestfish-actions.pod:3375
11400 msgid "ntfs-3g-probe"
11404 #: ../fish/guestfish-actions.pod:3377
11407 " ntfs-3g-probe true|false device\n"
11412 #: ../fish/guestfish-actions.pod:3379 ../src/guestfs-actions.pod:5130
11414 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11415 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
11416 "write, and some cannot be mounted at all)."
11420 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5134
11422 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11423 "can be mounted read-write. Set it to false if you want to test if the "
11424 "volume can be mounted read-only."
11428 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5138
11430 "The return value is an integer which C<0> if the operation would succeed, or "
11431 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11435 #: ../fish/guestfish-actions.pod:3391
11440 #: ../fish/guestfish-actions.pod:3393
11443 " ntfsresize device\n"
11448 #: ../fish/guestfish-actions.pod:3395 ../fish/guestfish-actions.pod:3419
11449 #: ../src/guestfs-actions.pod:5159 ../src/guestfs-actions.pod:5191
11451 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11452 "size of the underlying device."
11456 #: ../fish/guestfish-actions.pod:3398 ../src/guestfs-actions.pod:5162
11458 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
11459 "consistency check (for safety). You have to boot into Windows to perform "
11460 "this check and clear this condition. Furthermore, ntfsresize refuses to "
11461 "resize filesystems which have been marked in this way. So in effect it is "
11462 "not possible to call ntfsresize multiple times on a single filesystem "
11463 "without booting into Windows between each resize."
11467 #: ../fish/guestfish-actions.pod:3406 ../fish/guestfish-actions.pod:3445
11468 #: ../src/guestfs-actions.pod:5170 ../src/guestfs-actions.pod:5217
11469 msgid "See also L<ntfsresize(8)>."
11473 #: ../fish/guestfish-actions.pod:3408 ../fish/guestfish-actions.pod:3456
11475 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
11480 #: ../fish/guestfish-actions.pod:3415
11481 msgid "ntfsresize-opts"
11485 #: ../fish/guestfish-actions.pod:3417
11488 " ntfsresize-opts device [size:..] [force:..]\n"
11493 #: ../fish/guestfish-actions.pod:3428 ../src/guestfs-actions.pod:5200
11495 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
11496 "resized to fit the container (eg. partition)."
11500 #: ../fish/guestfish-actions.pod:3431 ../src/guestfs-actions.pod:5203
11505 #: ../fish/guestfish-actions.pod:3433 ../src/guestfs-actions.pod:5205
11507 "If this option is true, then force the resize of the filesystem even if the "
11508 "filesystem is marked as requiring a consistency check."
11512 #: ../fish/guestfish-actions.pod:3436
11514 "After the resize operation, the filesystem is always marked as requiring a "
11515 "consistency check (for safety). You have to boot into Windows to perform "
11516 "this check and clear this condition. If you I<don't> set the C<force> "
11517 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
11518 "a single filesystem without booting into Windows between each resize."
11522 #: ../fish/guestfish-actions.pod:3449
11523 msgid "ntfsresize-size"
11527 #: ../fish/guestfish-actions.pod:3451
11530 " ntfsresize-size device size\n"
11535 #: ../fish/guestfish-actions.pod:3453
11537 "This command is the same as L</ntfsresize> except that it allows you to "
11538 "specify the new size (in bytes) explicitly."
11542 #: ../fish/guestfish-actions.pod:3463
11547 #: ../fish/guestfish-actions.pod:3465
11550 " part-add device prlogex startsect endsect\n"
11555 #: ../fish/guestfish-actions.pod:3467
11557 "This command adds a partition to C<device>. If there is no partition table "
11558 "on the device, call L</part-init> first."
11562 #: ../fish/guestfish-actions.pod:3470 ../src/guestfs-actions.pod:5278
11564 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11565 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11566 "C<logical>) and C<e> (or C<extended>) partition types."
11570 #: ../fish/guestfish-actions.pod:3475 ../src/guestfs-actions.pod:5283
11572 "C<startsect> and C<endsect> are the start and end of the partition in "
11573 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11574 "from the end of the disk (C<-1> is the last sector)."
11578 #: ../fish/guestfish-actions.pod:3479
11580 "Creating a partition which covers the whole disk is not so easy. Use L</"
11581 "part-disk> to do that."
11585 #: ../fish/guestfish-actions.pod:3482
11590 #: ../fish/guestfish-actions.pod:3484
11593 " part-del device partnum\n"
11598 #: ../fish/guestfish-actions.pod:3486 ../src/guestfs-actions.pod:5301
11599 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11603 #: ../fish/guestfish-actions.pod:3488 ../src/guestfs-actions.pod:5303
11605 "Note that in the case of MBR partitioning, deleting an extended partition "
11606 "also deletes any logical partitions it contains."
11610 #: ../fish/guestfish-actions.pod:3492
11615 #: ../fish/guestfish-actions.pod:3494
11618 " part-disk device parttype\n"
11623 #: ../fish/guestfish-actions.pod:3496
11625 "This command is simply a combination of L</part-init> followed by L</part-"
11626 "add> to create a single primary partition covering the whole disk."
11630 #: ../fish/guestfish-actions.pod:3500
11632 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11633 "possible values are described in L</part-init>."
11637 #: ../fish/guestfish-actions.pod:3506
11638 msgid "part-get-bootable"
11642 #: ../fish/guestfish-actions.pod:3508
11645 " part-get-bootable device partnum\n"
11650 #: ../fish/guestfish-actions.pod:3510 ../src/guestfs-actions.pod:5339
11652 "This command returns true if the partition C<partnum> on C<device> has the "
11653 "bootable flag set."
11657 #: ../fish/guestfish-actions.pod:3513
11658 msgid "See also L</part-set-bootable>."
11662 #: ../fish/guestfish-actions.pod:3515
11663 msgid "part-get-mbr-id"
11667 #: ../fish/guestfish-actions.pod:3517
11670 " part-get-mbr-id device partnum\n"
11675 #: ../fish/guestfish-actions.pod:3519 ../src/guestfs-actions.pod:5355
11677 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11678 "partition C<partnum>."
11682 #: ../fish/guestfish-actions.pod:3522 ../fish/guestfish-actions.pod:3666
11684 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11685 "undefined results for other partition table types (see L</part-get-"
11690 #: ../fish/guestfish-actions.pod:3526
11691 msgid "part-get-parttype"
11695 #: ../fish/guestfish-actions.pod:3528
11698 " part-get-parttype device\n"
11703 #: ../fish/guestfish-actions.pod:3530 ../src/guestfs-actions.pod:5372
11705 "This command examines the partition table on C<device> and returns the "
11706 "partition table type (format) being used."
11710 #: ../fish/guestfish-actions.pod:3533
11712 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11713 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11714 "possible, although unusual. See L</part-init> for a full list."
11718 #: ../fish/guestfish-actions.pod:3538
11723 #: ../fish/guestfish-actions.pod:3540
11726 " part-init device parttype\n"
11731 #: ../fish/guestfish-actions.pod:3542 ../src/guestfs-actions.pod:5392
11733 "This creates an empty partition table on C<device> of one of the partition "
11734 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11735 "(for large disks)."
11739 #: ../fish/guestfish-actions.pod:3546
11741 "Initially there are no partitions. Following this, you should call L</part-"
11742 "add> for each partition required."
11746 #: ../fish/guestfish-actions.pod:3549 ../src/guestfs-actions.pod:5399
11747 msgid "Possible values for C<parttype> are:"
11751 #: ../fish/guestfish-actions.pod:3553 ../src/guestfs-actions.pod:5403
11756 #: ../fish/guestfish-actions.pod:3555 ../src/guestfs-actions.pod:5405
11761 #: ../fish/guestfish-actions.pod:3557 ../src/guestfs-actions.pod:5407
11762 msgid "Intel EFI / GPT partition table."
11766 #: ../fish/guestfish-actions.pod:3559 ../src/guestfs-actions.pod:5409
11768 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11769 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11770 "the C<mbr> format."
11774 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5413
11779 #: ../fish/guestfish-actions.pod:3565 ../src/guestfs-actions.pod:5415
11784 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5417
11786 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11787 "Windows. This partition type will B<only> work for device sizes up to 2 "
11788 "TB. For large disks we recommend using C<gpt>."
11792 #: ../fish/guestfish-actions.pod:3574 ../src/guestfs-actions.pod:5424
11794 "Other partition table types that may work but are not supported include:"
11798 #: ../fish/guestfish-actions.pod:3579 ../src/guestfs-actions.pod:5429
11803 #: ../fish/guestfish-actions.pod:3581 ../src/guestfs-actions.pod:5431
11804 msgid "AIX disk labels."
11808 #: ../fish/guestfish-actions.pod:3583 ../src/guestfs-actions.pod:5433
11813 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5435
11818 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5437
11819 msgid "Amiga \"Rigid Disk Block\" format."
11823 #: ../fish/guestfish-actions.pod:3589 ../src/guestfs-actions.pod:5439
11828 #: ../fish/guestfish-actions.pod:3591 ../src/guestfs-actions.pod:5441
11829 msgid "BSD disk labels."
11833 #: ../fish/guestfish-actions.pod:3593 ../src/guestfs-actions.pod:5443
11838 #: ../fish/guestfish-actions.pod:3595 ../src/guestfs-actions.pod:5445
11839 msgid "DASD, used on IBM mainframes."
11843 #: ../fish/guestfish-actions.pod:3597 ../src/guestfs-actions.pod:5447
11848 #: ../fish/guestfish-actions.pod:3599 ../src/guestfs-actions.pod:5449
11849 msgid "MIPS/SGI volumes."
11853 #: ../fish/guestfish-actions.pod:3601 ../src/guestfs-actions.pod:5451
11858 #: ../fish/guestfish-actions.pod:3603 ../src/guestfs-actions.pod:5453
11859 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11863 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5455
11868 #: ../fish/guestfish-actions.pod:3607 ../src/guestfs-actions.pod:5457
11869 msgid "NEC PC-98 format, common in Japan apparently."
11873 #: ../fish/guestfish-actions.pod:3609 ../src/guestfs-actions.pod:5459
11878 #: ../fish/guestfish-actions.pod:3611 ../src/guestfs-actions.pod:5461
11879 msgid "Sun disk labels."
11883 #: ../fish/guestfish-actions.pod:3615
11888 #: ../fish/guestfish-actions.pod:3617
11891 " part-list device\n"
11896 #: ../fish/guestfish-actions.pod:3619 ../src/guestfs-actions.pod:5475
11898 "This command parses the partition table on C<device> and returns the list of "
11899 "partitions found."
11903 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5478
11904 msgid "The fields in the returned structure are:"
11908 #: ../fish/guestfish-actions.pod:3626 ../src/guestfs-actions.pod:5482
11909 msgid "B<part_num>"
11913 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5484
11914 msgid "Partition number, counting from 1."
11918 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5486
11919 msgid "B<part_start>"
11923 #: ../fish/guestfish-actions.pod:3632
11925 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11926 "the device's sector size, see L</blockdev-getss>."
11930 #: ../fish/guestfish-actions.pod:3635 ../src/guestfs-actions.pod:5491
11931 msgid "B<part_end>"
11935 #: ../fish/guestfish-actions.pod:3637 ../src/guestfs-actions.pod:5493
11936 msgid "End of the partition in bytes."
11940 #: ../fish/guestfish-actions.pod:3639 ../src/guestfs-actions.pod:5495
11941 msgid "B<part_size>"
11945 #: ../fish/guestfish-actions.pod:3641 ../src/guestfs-actions.pod:5497
11946 msgid "Size of the partition in bytes."
11950 #: ../fish/guestfish-actions.pod:3645
11951 msgid "part-set-bootable"
11955 #: ../fish/guestfish-actions.pod:3647
11958 " part-set-bootable device partnum true|false\n"
11963 #: ../fish/guestfish-actions.pod:3649 ../src/guestfs-actions.pod:5515
11965 "This sets the bootable flag on partition numbered C<partnum> on device "
11966 "C<device>. Note that partitions are numbered from 1."
11970 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5518
11972 "The bootable flag is used by some operating systems (notably Windows) to "
11973 "determine which partition to boot from. It is by no means universally "
11978 #: ../fish/guestfish-actions.pod:3656
11979 msgid "part-set-mbr-id"
11983 #: ../fish/guestfish-actions.pod:3658
11986 " part-set-mbr-id device partnum idbyte\n"
11991 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5534
11993 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11994 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11995 "documentation are in fact hexadecimal numbers, but usually documented "
11996 "without any leading \"0x\" which might be confusing."
12000 #: ../fish/guestfish-actions.pod:3670
12001 msgid "part-set-name"
12005 #: ../fish/guestfish-actions.pod:3672
12008 " part-set-name device partnum name\n"
12013 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5556
12015 "This sets the partition name on partition numbered C<partnum> on device "
12016 "C<device>. Note that partitions are numbered from 1."
12020 #: ../fish/guestfish-actions.pod:3677 ../src/guestfs-actions.pod:5559
12022 "The partition name can only be set on certain types of partition table. "
12023 "This works on C<gpt> but not on C<mbr> partitions."
12027 #: ../fish/guestfish-actions.pod:3680
12028 msgid "part-to-dev"
12032 #: ../fish/guestfish-actions.pod:3682
12035 " part-to-dev partition\n"
12040 #: ../fish/guestfish-actions.pod:3684 ../src/guestfs-actions.pod:5572
12042 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12043 "partition number, returning the device name (eg. \"/dev/sdb\")."
12047 #: ../fish/guestfish-actions.pod:3688
12049 "The named partition must exist, for example as a string returned from L</"
12050 "list-partitions>."
12054 #: ../fish/guestfish-actions.pod:3691
12055 msgid "ping-daemon"
12059 #: ../fish/guestfish-actions.pod:3693
12067 #: ../fish/guestfish-actions.pod:3695 ../src/guestfs-actions.pod:5589
12069 "This is a test probe into the guestfs daemon running inside the qemu "
12070 "subprocess. Calling this function checks that the daemon responds to the "
12071 "ping message, without affecting the daemon or attached block device(s) in "
12076 #: ../fish/guestfish-actions.pod:3700
12081 #: ../fish/guestfish-actions.pod:3702
12084 " pread path count offset\n"
12089 #: ../fish/guestfish-actions.pod:3704 ../src/guestfs-actions.pod:5607
12091 "This command lets you read part of a file. It reads C<count> bytes of the "
12092 "file, starting at C<offset>, from file C<path>."
12096 #: ../fish/guestfish-actions.pod:3707 ../fish/guestfish-actions.pod:3722
12097 #: ../src/guestfs-actions.pod:5610 ../src/guestfs-actions.pod:5636
12099 "This may read fewer bytes than requested. For further details see the "
12100 "L<pread(2)> system call."
12104 #: ../fish/guestfish-actions.pod:3710
12105 msgid "See also L</pwrite>, L</pread-device>."
12109 #: ../fish/guestfish-actions.pod:3715
12110 msgid "pread-device"
12114 #: ../fish/guestfish-actions.pod:3717
12117 " pread-device device count offset\n"
12122 #: ../fish/guestfish-actions.pod:3719 ../src/guestfs-actions.pod:5633
12124 "This command lets you read part of a file. It reads C<count> bytes of "
12125 "C<device>, starting at C<offset>."
12129 #: ../fish/guestfish-actions.pod:3725
12130 msgid "See also L</pread>."
12134 #: ../fish/guestfish-actions.pod:3730
12139 #: ../fish/guestfish-actions.pod:3732
12142 " pvcreate device\n"
12147 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5656
12149 "This creates an LVM physical volume on the named C<device>, where C<device> "
12150 "should usually be a partition name such as C</dev/sda1>."
12154 #: ../fish/guestfish-actions.pod:3738
12159 #: ../fish/guestfish-actions.pod:3740
12162 " pvremove device\n"
12167 #: ../fish/guestfish-actions.pod:3742 ../src/guestfs-actions.pod:5670
12169 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12174 #: ../fish/guestfish-actions.pod:3745 ../src/guestfs-actions.pod:5673
12176 "The implementation uses the C<pvremove> command which refuses to wipe "
12177 "physical volumes that contain any volume groups, so you have to remove those "
12182 #: ../fish/guestfish-actions.pod:3749
12187 #: ../fish/guestfish-actions.pod:3751
12190 " pvresize device\n"
12195 #: ../fish/guestfish-actions.pod:3753 ../src/guestfs-actions.pod:5687
12197 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12198 "the new size of the underlying device."
12202 #: ../fish/guestfish-actions.pod:3756
12203 msgid "pvresize-size"
12207 #: ../fish/guestfish-actions.pod:3758
12210 " pvresize-size device size\n"
12215 #: ../fish/guestfish-actions.pod:3760
12217 "This command is the same as L</pvresize> except that it allows you to "
12218 "specify the new size (in bytes) explicitly."
12222 #: ../fish/guestfish-actions.pod:3763
12227 #: ../fish/guestfish-actions.pod:3765
12235 #: ../fish/guestfish-actions.pod:3767 ../src/guestfs-actions.pod:5713
12237 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12242 #: ../fish/guestfish-actions.pod:3770 ../src/guestfs-actions.pod:5716
12244 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12249 #: ../fish/guestfish-actions.pod:3773
12250 msgid "See also L</pvs-full>."
12254 #: ../fish/guestfish-actions.pod:3775
12259 #: ../fish/guestfish-actions.pod:3777
12267 #: ../fish/guestfish-actions.pod:3779 ../src/guestfs-actions.pod:5732
12269 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12270 "(8)> command. The \"full\" version includes all fields."
12274 #: ../fish/guestfish-actions.pod:3782
12279 #: ../fish/guestfish-actions.pod:3784
12287 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5747
12288 msgid "This command returns the UUID of the LVM PV C<device>."
12292 #: ../fish/guestfish-actions.pod:3788
12297 #: ../fish/guestfish-actions.pod:3790
12300 " pwrite path content offset\n"
12305 #: ../fish/guestfish-actions.pod:3792 ../src/guestfs-actions.pod:5763
12307 "This command writes to part of a file. It writes the data buffer C<content> "
12308 "to the file C<path> starting at offset C<offset>."
12312 #: ../fish/guestfish-actions.pod:3795 ../src/guestfs-actions.pod:5766
12314 "This command implements the L<pwrite(2)> system call, and like that system "
12315 "call it may not write the full data requested. The return value is the "
12316 "number of bytes that were actually written to the file. This could even be "
12317 "0, although short writes are unlikely for regular files in ordinary "
12322 #: ../fish/guestfish-actions.pod:3801
12323 msgid "See also L</pread>, L</pwrite-device>."
12327 #: ../fish/guestfish-actions.pod:3806
12328 msgid "pwrite-device"
12332 #: ../fish/guestfish-actions.pod:3808
12335 " pwrite-device device content offset\n"
12340 #: ../fish/guestfish-actions.pod:3810 ../src/guestfs-actions.pod:5790
12342 "This command writes to part of a device. It writes the data buffer "
12343 "C<content> to C<device> starting at offset C<offset>."
12347 #: ../fish/guestfish-actions.pod:3813 ../src/guestfs-actions.pod:5793
12349 "This command implements the L<pwrite(2)> system call, and like that system "
12350 "call it may not write the full data requested (although short writes to disk "
12351 "devices and partitions are probably impossible with standard Linux kernels)."
12355 #: ../fish/guestfish-actions.pod:3818
12356 msgid "See also L</pwrite>."
12360 #: ../fish/guestfish-actions.pod:3823
12365 #: ../fish/guestfish-actions.pod:3825
12368 " read-file path\n"
12373 #: ../fish/guestfish-actions.pod:3827 ../src/guestfs-actions.pod:5814
12374 msgid "This calls returns the contents of the file C<path> as a buffer."
12378 #: ../fish/guestfish-actions.pod:3830
12380 "Unlike L</cat>, this function can correctly handle files that contain "
12381 "embedded ASCII NUL characters. However unlike L</download>, this function "
12382 "is limited in the total size of file that can be handled."
12386 #: ../fish/guestfish-actions.pod:3838
12391 #: ../fish/guestfish-actions.pod:3840
12394 " read-lines path\n"
12399 #: ../fish/guestfish-actions.pod:3844 ../src/guestfs-actions.pod:5839
12401 "The file contents are returned as a list of lines. Trailing C<LF> and "
12402 "C<CRLF> character sequences are I<not> returned."
12406 #: ../fish/guestfish-actions.pod:3847
12408 "Note that this function cannot correctly handle binary files (specifically, "
12409 "files containing C<\\0> character which is treated as end of line). For "
12410 "those you need to use the L</read-file> function which has a more complex "
12415 #: ../fish/guestfish-actions.pod:3852
12420 #: ../fish/guestfish-actions.pod:3854
12428 #: ../fish/guestfish-actions.pod:3856 ../src/guestfs-actions.pod:5859
12429 msgid "This returns the list of directory entries in directory C<dir>."
12433 #: ../fish/guestfish-actions.pod:3858 ../src/guestfs-actions.pod:5861
12435 "All entries in the directory are returned, including C<.> and C<..>. The "
12436 "entries are I<not> sorted, but returned in the same order as the underlying "
12441 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:5865
12443 "Also this call returns basic file type information about each file. The "
12444 "C<ftyp> field will contain one of the following characters:"
12448 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5870
12453 #: ../fish/guestfish-actions.pod:3869 ../src/guestfs-actions.pod:5872
12454 msgid "Block special"
12458 #: ../fish/guestfish-actions.pod:3871 ../src/guestfs-actions.pod:5874
12463 #: ../fish/guestfish-actions.pod:3873 ../src/guestfs-actions.pod:5876
12464 msgid "Char special"
12468 #: ../fish/guestfish-actions.pod:3875 ../src/guestfs-actions.pod:5878
12473 #: ../fish/guestfish-actions.pod:3877 ../src/guestfs-actions.pod:5880
12478 #: ../fish/guestfish-actions.pod:3879 ../src/guestfs-actions.pod:5882
12483 #: ../fish/guestfish-actions.pod:3881 ../src/guestfs-actions.pod:5884
12484 msgid "FIFO (named pipe)"
12488 #: ../fish/guestfish-actions.pod:3883 ../src/guestfs-actions.pod:5886
12493 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:5888
12494 msgid "Symbolic link"
12498 #: ../fish/guestfish-actions.pod:3887 ../src/guestfs-actions.pod:5890
12503 #: ../fish/guestfish-actions.pod:3889 ../src/guestfs-actions.pod:5892
12504 msgid "Regular file"
12508 #: ../fish/guestfish-actions.pod:3891 ../src/guestfs-actions.pod:5894
12513 #: ../fish/guestfish-actions.pod:3893 ../src/guestfs-actions.pod:5896
12518 #: ../fish/guestfish-actions.pod:3895 ../src/guestfs-actions.pod:5898
12523 #: ../fish/guestfish-actions.pod:3897 ../src/guestfs-actions.pod:5900
12524 msgid "Unknown file type"
12528 #: ../fish/guestfish-actions.pod:3899 ../src/guestfs-actions.pod:5902
12533 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5904
12535 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12539 #: ../fish/guestfish-actions.pod:3906
12541 "This function is primarily intended for use by programs. To get a simple "
12542 "list of names, use L</ls>. To get a printable directory for human "
12543 "consumption, use L</ll>."
12547 #: ../fish/guestfish-actions.pod:3910
12552 #: ../fish/guestfish-actions.pod:3912
12560 #: ../fish/guestfish-actions.pod:3914 ../src/guestfs-actions.pod:5925
12561 msgid "This command reads the target of a symbolic link."
12565 #: ../fish/guestfish-actions.pod:3916
12566 msgid "readlinklist"
12570 #: ../fish/guestfish-actions.pod:3918
12573 " readlinklist path 'names ...'\n"
12578 #: ../fish/guestfish-actions.pod:3920 ../src/guestfs-actions.pod:5939
12580 "This call allows you to do a C<readlink> operation on multiple files, where "
12581 "all files are in the directory C<path>. C<names> is the list of files from "
12586 #: ../fish/guestfish-actions.pod:3924 ../src/guestfs-actions.pod:5943
12588 "On return you get a list of strings, with a one-to-one correspondence to the "
12589 "C<names> list. Each string is the value of the symbolic link."
12593 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:5947
12595 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12596 "result string is the empty string C<\"\">. However the whole operation is "
12597 "completed even if there were C<readlink(2)> errors, and so you can call this "
12598 "function with names where you don't know if they are symbolic links already "
12599 "(albeit slightly less efficient)."
12603 #: ../fish/guestfish-actions.pod:3935 ../src/guestfs-actions.pod:5954
12605 "This call is intended for programs that want to efficiently list a directory "
12606 "contents without making many round-trips. Very long directory listings "
12607 "might cause the protocol message size to be exceeded, causing this call to "
12608 "fail. The caller must split up such requests into smaller groups of names."
12612 #: ../fish/guestfish-actions.pod:3942
12617 #: ../fish/guestfish-actions.pod:3944
12625 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:5973
12627 "Return the canonicalized absolute pathname of C<path>. The returned path "
12628 "has no C<.>, C<..> or symbolic link path elements."
12632 #: ../fish/guestfish-actions.pod:3949
12633 msgid "removexattr"
12637 #: ../fish/guestfish-actions.pod:3951
12640 " removexattr xattr path\n"
12645 #: ../fish/guestfish-actions.pod:3953 ../src/guestfs-actions.pod:5988
12647 "This call removes the extended attribute named C<xattr> of the file C<path>."
12651 #: ../fish/guestfish-actions.pod:3956
12652 msgid "See also: L</lremovexattr>, L<attr(5)>."
12656 #: ../fish/guestfish-actions.pod:3958
12661 #: ../fish/guestfish-actions.pod:3960
12664 " resize2fs device\n"
12669 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6003
12671 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12672 "underlying device."
12676 #: ../fish/guestfish-actions.pod:3965
12678 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
12679 "before calling this command. For unknown reasons C<resize2fs> sometimes "
12680 "gives an error about this and sometimes not. In any case, it is always safe "
12681 "to call L</e2fsck-f> before calling this function."
12685 #: ../fish/guestfish-actions.pod:3971
12686 msgid "resize2fs-M"
12690 #: ../fish/guestfish-actions.pod:3973
12693 " resize2fs-M device\n"
12698 #: ../fish/guestfish-actions.pod:3975
12700 "This command is the same as L</resize2fs>, but the filesystem is resized to "
12701 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
12706 #: ../fish/guestfish-actions.pod:3979
12708 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
12709 "and read the C<Block size> and C<Block count> values. These two numbers, "
12710 "multiplied together, give the resulting size of the minimal filesystem in "
12715 #: ../fish/guestfish-actions.pod:3984
12716 msgid "resize2fs-size"
12720 #: ../fish/guestfish-actions.pod:3986
12723 " resize2fs-size device size\n"
12728 #: ../fish/guestfish-actions.pod:3988
12730 "This command is the same as L</resize2fs> except that it allows you to "
12731 "specify the new size (in bytes) explicitly."
12735 #: ../fish/guestfish-actions.pod:3991
12740 #: ../fish/guestfish-actions.pod:3993
12748 #: ../fish/guestfish-actions.pod:3995 ../src/guestfs-actions.pod:6055
12749 msgid "Remove the single file C<path>."
12753 #: ../fish/guestfish-actions.pod:3997
12758 #: ../fish/guestfish-actions.pod:3999
12766 #: ../fish/guestfish-actions.pod:4001 ../src/guestfs-actions.pod:6067
12768 "Remove the file or directory C<path>, recursively removing the contents if "
12769 "its a directory. This is like the C<rm -rf> shell command."
12773 #: ../fish/guestfish-actions.pod:4005
12778 #: ../fish/guestfish-actions.pod:4007
12786 #: ../fish/guestfish-actions.pod:4009 ../src/guestfs-actions.pod:6081
12787 msgid "Remove the single directory C<path>."
12791 #: ../fish/guestfish-actions.pod:4011
12792 msgid "rmmountpoint"
12796 #: ../fish/guestfish-actions.pod:4013
12799 " rmmountpoint exemptpath\n"
12804 #: ../fish/guestfish-actions.pod:4015
12806 "This calls removes a mountpoint that was previously created with L</"
12807 "mkmountpoint>. See L</mkmountpoint> for full details."
12811 #: ../fish/guestfish-actions.pod:4019
12812 msgid "scrub-device"
12816 #: ../fish/guestfish-actions.pod:4021
12819 " scrub-device device\n"
12824 #: ../fish/guestfish-actions.pod:4023 ../src/guestfs-actions.pod:6107
12826 "This command writes patterns over C<device> to make data retrieval more "
12831 #: ../fish/guestfish-actions.pod:4026 ../fish/guestfish-actions.pod:4041
12832 #: ../fish/guestfish-actions.pod:4054 ../src/guestfs-actions.pod:6110
12833 #: ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150
12835 "It is an interface to the L<scrub(1)> program. See that manual page for "
12840 #: ../fish/guestfish-actions.pod:4032
12845 #: ../fish/guestfish-actions.pod:4034
12848 " scrub-file file\n"
12853 #: ../fish/guestfish-actions.pod:4036 ../src/guestfs-actions.pod:6126
12855 "This command writes patterns over a file to make data retrieval more "
12860 #: ../fish/guestfish-actions.pod:4039 ../src/guestfs-actions.pod:6129
12861 msgid "The file is I<removed> after scrubbing."
12865 #: ../fish/guestfish-actions.pod:4044
12866 msgid "scrub-freespace"
12870 #: ../fish/guestfish-actions.pod:4046
12873 " scrub-freespace dir\n"
12878 #: ../fish/guestfish-actions.pod:4048
12880 "This command creates the directory C<dir> and then fills it with files until "
12881 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
12882 "deletes them. The intention is to scrub any free space on the partition "
12883 "containing C<dir>."
12887 #: ../fish/guestfish-actions.pod:4057
12892 #: ../fish/guestfish-actions.pod:4059
12897 #: ../fish/guestfish-actions.pod:4061
12900 " set-append append\n"
12905 #: ../fish/guestfish-actions.pod:4063 ../src/guestfs-actions.pod:6163
12907 "This function is used to add additional options to the guest kernel command "
12912 #: ../fish/guestfish-actions.pod:4066 ../src/guestfs-actions.pod:6166
12914 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12915 "environment variable."
12919 #: ../fish/guestfish-actions.pod:4069 ../src/guestfs-actions.pod:6169
12921 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12922 "(libguestfs always adds a few of its own)."
12926 #: ../fish/guestfish-actions.pod:4072
12927 msgid "set-attach-method"
12931 #: ../fish/guestfish-actions.pod:4074
12932 msgid "attach-method"
12936 #: ../fish/guestfish-actions.pod:4076
12939 " set-attach-method attachmethod\n"
12944 #: ../fish/guestfish-actions.pod:4078 ../src/guestfs-actions.pod:6182
12946 "Set the method that libguestfs uses to connect to the back end guestfsd "
12947 "daemon. Possible methods are:"
12951 #: ../fish/guestfish-actions.pod:4083 ../src/guestfs-actions.pod:6187
12952 #: ../src/guestfs.pod:2796
12953 msgid "C<appliance>"
12957 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6189
12959 "Launch an appliance and connect to it. This is the ordinary method and the "
12964 #: ../fish/guestfish-actions.pod:4088 ../src/guestfs-actions.pod:6192
12965 msgid "C<unix:I<path>>"
12969 #: ../fish/guestfish-actions.pod:4090 ../src/guestfs-actions.pod:6194
12970 msgid "Connect to the Unix domain socket I<path>."
12974 #: ../fish/guestfish-actions.pod:4092 ../src/guestfs-actions.pod:6196
12976 "This method lets you connect to an existing daemon or (using virtio-serial) "
12977 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
12978 "RUNNING DAEMONS>."
12982 #: ../fish/guestfish-actions.pod:4098
12983 msgid "set-autosync"
12987 #: ../fish/guestfish-actions.pod:4100
12992 #: ../fish/guestfish-actions.pod:4102
12995 " set-autosync true|false\n"
13000 #: ../fish/guestfish-actions.pod:4104 ../src/guestfs-actions.pod:6212
13002 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13003 "effort attempt to make filesystems consistent and synchronized when the "
13004 "handle is closed (also if the program exits without closing handles)."
13008 #: ../fish/guestfish-actions.pod:4109 ../src/guestfs-actions.pod:6217
13010 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13011 "disabled by default)."
13015 #: ../fish/guestfish-actions.pod:4112
13020 #: ../fish/guestfish-actions.pod:4114
13025 #: ../fish/guestfish-actions.pod:4116
13028 " set-direct true|false\n"
13033 #: ../fish/guestfish-actions.pod:4118 ../src/guestfs-actions.pod:6230
13035 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13036 "passed directly through to the appliance once it is launched."
13040 #: ../fish/guestfish-actions.pod:4122
13042 "One consequence of this is that log messages aren't caught by the library "
13043 "and handled by L</set-log-message-callback>, but go straight to stdout."
13047 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6238
13048 msgid "You probably don't want to use this unless you know what you are doing."
13052 #: ../fish/guestfish-actions.pod:4129 ../src/guestfs-actions.pod:6241
13053 msgid "The default is disabled."
13057 #: ../fish/guestfish-actions.pod:4131
13058 msgid "set-e2label"
13062 #: ../fish/guestfish-actions.pod:4133
13065 " set-e2label device label\n"
13070 #: ../fish/guestfish-actions.pod:4135 ../src/guestfs-actions.pod:6254
13072 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13073 "C<label>. Filesystem labels are limited to 16 characters."
13077 #: ../fish/guestfish-actions.pod:4139
13079 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
13080 "label on a filesystem."
13084 #: ../fish/guestfish-actions.pod:4142
13089 #: ../fish/guestfish-actions.pod:4144
13092 " set-e2uuid device uuid\n"
13097 #: ../fish/guestfish-actions.pod:4146 ../src/guestfs-actions.pod:6272
13099 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13100 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13101 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13105 #: ../fish/guestfish-actions.pod:4151
13107 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
13108 "UUID of a filesystem."
13112 #: ../fish/guestfish-actions.pod:4154
13113 msgid "set-memsize"
13117 #: ../fish/guestfish-actions.pod:4156
13122 #: ../fish/guestfish-actions.pod:4158
13125 " set-memsize memsize\n"
13130 #: ../fish/guestfish-actions.pod:4160
13132 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13133 "This only has any effect if called before L</launch>."
13137 #: ../fish/guestfish-actions.pod:4164 ../src/guestfs-actions.pod:6294
13139 "You can also change this by setting the environment variable "
13140 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13144 #: ../fish/guestfish-actions.pod:4171
13145 msgid "set-network"
13149 #: ../fish/guestfish-actions.pod:4173
13154 #: ../fish/guestfish-actions.pod:4175
13157 " set-network true|false\n"
13162 #: ../fish/guestfish-actions.pod:4177 ../src/guestfs-actions.pod:6311
13164 "If C<network> is true, then the network is enabled in the libguestfs "
13165 "appliance. The default is false."
13169 #: ../fish/guestfish-actions.pod:4180 ../src/guestfs-actions.pod:6314
13171 "This affects whether commands are able to access the network (see L<guestfs"
13172 "(3)/RUNNING COMMANDS>)."
13176 #: ../fish/guestfish-actions.pod:4183
13178 "You must call this before calling L</launch>, otherwise it has no effect."
13182 #: ../fish/guestfish-actions.pod:4186
13187 #: ../fish/guestfish-actions.pod:4190
13190 " set-path searchpath\n"
13195 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6330
13196 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13200 #: ../fish/guestfish-actions.pod:4194 ../src/guestfs-actions.pod:6332
13202 "The default is C<$libdir/guestfs> unless overridden by setting "
13203 "C<LIBGUESTFS_PATH> environment variable."
13207 #: ../fish/guestfish-actions.pod:4197 ../src/guestfs-actions.pod:6335
13208 msgid "Setting C<path> to C<NULL> restores the default path."
13212 #: ../fish/guestfish-actions.pod:4199
13217 #: ../fish/guestfish-actions.pod:4201
13222 #: ../fish/guestfish-actions.pod:4203
13225 " set-pgroup true|false\n"
13230 #: ../fish/guestfish-actions.pod:4205 ../src/guestfs-actions.pod:6347
13232 "If C<pgroup> is true, child processes are placed into their own process "
13237 #: ../fish/guestfish-actions.pod:4208 ../src/guestfs-actions.pod:6350
13239 "The practical upshot of this is that signals like C<SIGINT> (from users "
13240 "pressing C<^C>) won't be received by the child process."
13244 #: ../fish/guestfish-actions.pod:4211 ../src/guestfs-actions.pod:6353
13246 "The default for this flag is false, because usually you want C<^C> to kill "
13251 #: ../fish/guestfish-actions.pod:4214
13256 #: ../fish/guestfish-actions.pod:4216
13261 #: ../fish/guestfish-actions.pod:4218
13269 #: ../fish/guestfish-actions.pod:4220 ../src/guestfs-actions.pod:6366
13270 msgid "Set the qemu binary that we will use."
13274 #: ../fish/guestfish-actions.pod:4222 ../src/guestfs-actions.pod:6368
13276 "The default is chosen when the library was compiled by the configure script."
13280 #: ../fish/guestfish-actions.pod:4225 ../src/guestfs-actions.pod:6371
13282 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13287 #: ../fish/guestfish-actions.pod:4228 ../src/guestfs-actions.pod:6374
13288 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13292 #: ../fish/guestfish-actions.pod:4230 ../src/guestfs-actions.pod:6376
13294 "Note that you should call this function as early as possible after creating "
13295 "the handle. This is because some pre-launch operations depend on testing "
13296 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13297 "don't retest features, and so you might see inconsistent results. Using the "
13298 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13299 "the qemu binary at the same time as the handle is created."
13303 #: ../fish/guestfish-actions.pod:4238
13304 msgid "set-recovery-proc"
13308 #: ../fish/guestfish-actions.pod:4240
13309 msgid "recovery-proc"
13313 #: ../fish/guestfish-actions.pod:4242
13316 " set-recovery-proc true|false\n"
13321 #: ../fish/guestfish-actions.pod:4244
13323 "If this is called with the parameter C<false> then L</launch> does not "
13324 "create a recovery process. The purpose of the recovery process is to stop "
13325 "runaway qemu processes in the case where the main program aborts abruptly."
13329 #: ../fish/guestfish-actions.pod:4249
13331 "This only has any effect if called before L</launch>, and the default is "
13336 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6402
13338 "About the only time when you would want to disable this is if the main "
13339 "process will fork itself into the background (\"daemonize\" itself). In "
13340 "this case the recovery process thinks that the main program has disappeared "
13341 "and so kills qemu, which is not very helpful."
13345 #: ../fish/guestfish-actions.pod:4258
13346 msgid "set-selinux"
13350 #: ../fish/guestfish-actions.pod:4260
13355 #: ../fish/guestfish-actions.pod:4262
13358 " set-selinux true|false\n"
13363 #: ../fish/guestfish-actions.pod:4264 ../src/guestfs-actions.pod:6418
13365 "This sets the selinux flag that is passed to the appliance at boot time. "
13366 "The default is C<selinux=0> (disabled)."
13370 #: ../fish/guestfish-actions.pod:4267 ../src/guestfs-actions.pod:6421
13372 "Note that if SELinux is enabled, it is always in Permissive mode "
13373 "(C<enforcing=0>)."
13377 #: ../fish/guestfish-actions.pod:4273
13382 #: ../fish/guestfish-actions.pod:4275
13387 #: ../fish/guestfish-actions.pod:4277
13390 " set-trace true|false\n"
13395 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6437
13397 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
13398 "return values are traced."
13402 #: ../fish/guestfish-actions.pod:4282 ../src/guestfs-actions.pod:6440
13404 "If you want to trace C API calls into libguestfs (and other libraries) then "
13405 "possibly a better way is to use the external ltrace(1) command."
13409 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6444
13411 "Command traces are disabled unless the environment variable "
13412 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13416 #: ../fish/guestfish-actions.pod:4289
13418 "Trace messages are normally sent to C<stderr>, unless you register a "
13419 "callback to send them somewhere else (see L</set-event-callback>)."
13423 #: ../fish/guestfish-actions.pod:4293
13424 msgid "set-verbose"
13428 #: ../fish/guestfish-actions.pod:4295
13433 #: ../fish/guestfish-actions.pod:4297
13436 " set-verbose true|false\n"
13441 #: ../fish/guestfish-actions.pod:4299 ../src/guestfs-actions.pod:6461
13442 msgid "If C<verbose> is true, this turns on verbose messages."
13446 #: ../fish/guestfish-actions.pod:4301 ../src/guestfs-actions.pod:6463
13448 "Verbose messages are disabled unless the environment variable "
13449 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13453 #: ../fish/guestfish-actions.pod:4304
13455 "Verbose messages are normally sent to C<stderr>, unless you register a "
13456 "callback to send them somewhere else (see L</set-event-callback>)."
13460 #: ../fish/guestfish-actions.pod:4308
13465 #: ../fish/guestfish-actions.pod:4310
13468 " setcon context\n"
13473 #: ../fish/guestfish-actions.pod:4312 ../src/guestfs-actions.pod:6480
13475 "This sets the SELinux security context of the daemon to the string "
13480 #: ../fish/guestfish-actions.pod:4315 ../src/guestfs-actions.pod:6483
13481 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13485 #: ../fish/guestfish-actions.pod:4317
13490 #: ../fish/guestfish-actions.pod:4319
13493 " setxattr xattr val vallen path\n"
13498 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6498
13500 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13501 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13505 #: ../fish/guestfish-actions.pod:4325
13506 msgid "See also: L</lsetxattr>, L<attr(5)>."
13510 #: ../fish/guestfish-actions.pod:4327
13515 #: ../fish/guestfish-actions.pod:4329
13518 " sfdisk device cyls heads sectors 'lines ...'\n"
13523 #: ../fish/guestfish-actions.pod:4331 ../src/guestfs-actions.pod:6525
13525 "This is a direct interface to the L<sfdisk(8)> program for creating "
13526 "partitions on block devices."
13530 #: ../fish/guestfish-actions.pod:4334 ../src/guestfs-actions.pod:6528
13531 msgid "C<device> should be a block device, for example C</dev/sda>."
13535 #: ../fish/guestfish-actions.pod:4336 ../src/guestfs-actions.pod:6530
13537 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13538 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
13539 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13540 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13541 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13542 "the kernel) cannot work out the right geometry and you will need to tell it."
13546 #: ../fish/guestfish-actions.pod:4344 ../src/guestfs-actions.pod:6538
13548 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13549 "refer to the L<sfdisk(8)> manpage."
13553 #: ../fish/guestfish-actions.pod:4347 ../src/guestfs-actions.pod:6541
13555 "To create a single partition occupying the whole disk, you would pass "
13556 "C<lines> as a single element list, when the single element being the string "
13561 #: ../fish/guestfish-actions.pod:4351
13562 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
13566 #: ../fish/guestfish-actions.pod:4357 ../fish/guestfish-actions.pod:4380
13567 #: ../fish/guestfish-actions.pod:4402
13569 "I<This function is deprecated.> In new code, use the L</part_add> call "
13574 #: ../fish/guestfish-actions.pod:4364
13579 #: ../fish/guestfish-actions.pod:4366
13582 " sfdiskM device 'lines ...'\n"
13587 #: ../fish/guestfish-actions.pod:4368
13589 "This is a simplified interface to the L</sfdisk> command, where partition "
13590 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13591 "you don't need to specify the cyls, heads and sectors parameters which were "
13592 "rarely if ever used anyway."
13596 #: ../fish/guestfish-actions.pod:4374
13597 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13601 #: ../fish/guestfish-actions.pod:4387
13606 #: ../fish/guestfish-actions.pod:4389
13609 " sfdisk-N device partnum cyls heads sectors line\n"
13614 #: ../fish/guestfish-actions.pod:4391 ../src/guestfs-actions.pod:6603
13616 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13617 "(note: C<n> counts from 1)."
13621 #: ../fish/guestfish-actions.pod:4394
13623 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13624 "cyls/heads/sectors parameters."
13628 #: ../fish/guestfish-actions.pod:4397
13629 msgid "See also: L</part-add>"
13633 #: ../fish/guestfish-actions.pod:4409
13634 msgid "sfdisk-disk-geometry"
13638 #: ../fish/guestfish-actions.pod:4411
13641 " sfdisk-disk-geometry device\n"
13646 #: ../fish/guestfish-actions.pod:4413
13648 "This displays the disk geometry of C<device> read from the partition table. "
13649 "Especially in the case where the underlying block device has been resized, "
13650 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
13651 "kernel-geometry>)."
13655 #: ../fish/guestfish-actions.pod:4418 ../fish/guestfish-actions.pod:4427
13656 #: ../src/guestfs-actions.pod:6629 ../src/guestfs-actions.pod:6645
13657 msgid "The result is in human-readable format, and not designed to be parsed."
13661 #: ../fish/guestfish-actions.pod:4421
13662 msgid "sfdisk-kernel-geometry"
13666 #: ../fish/guestfish-actions.pod:4423
13669 " sfdisk-kernel-geometry device\n"
13674 #: ../fish/guestfish-actions.pod:4425 ../src/guestfs-actions.pod:6643
13675 msgid "This displays the kernel's idea of the geometry of C<device>."
13679 #: ../fish/guestfish-actions.pod:4430
13684 #: ../fish/guestfish-actions.pod:4432
13687 " sfdisk-l device\n"
13692 #: ../fish/guestfish-actions.pod:4434 ../src/guestfs-actions.pod:6666
13694 "This displays the partition table on C<device>, in the human-readable output "
13695 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13699 #: ../fish/guestfish-actions.pod:4438
13700 msgid "See also: L</part-list>"
13704 #: ../fish/guestfish-actions.pod:4440
13706 "I<This function is deprecated.> In new code, use the L</part_list> call "
13711 #: ../fish/guestfish-actions.pod:4447
13716 #: ../fish/guestfish-actions.pod:4449
13724 #: ../fish/guestfish-actions.pod:4451 ../src/guestfs-actions.pod:6683
13726 "This call runs a command from the guest filesystem via the guest's C</bin/"
13731 #: ../fish/guestfish-actions.pod:4454
13732 msgid "This is like L</command>, but passes the command to:"
13736 #: ../fish/guestfish-actions.pod:4456 ../src/guestfs-actions.pod:6688
13739 " /bin/sh -c \"command\"\n"
13744 #: ../fish/guestfish-actions.pod:4458 ../src/guestfs-actions.pod:6690
13746 "Depending on the guest's shell, this usually results in wildcards being "
13747 "expanded, shell expressions being interpolated and so on."
13751 #: ../fish/guestfish-actions.pod:4462
13752 msgid "All the provisos about L</command> apply to this call."
13756 #: ../fish/guestfish-actions.pod:4464
13761 #: ../fish/guestfish-actions.pod:4466
13764 " sh-lines command\n"
13769 #: ../fish/guestfish-actions.pod:4468
13770 msgid "This is the same as L</sh>, but splits the result into a list of lines."
13774 #: ../fish/guestfish-actions.pod:4471
13775 msgid "See also: L</command-lines>"
13779 #: ../fish/guestfish-actions.pod:4473
13784 #: ../fish/guestfish-actions.pod:4475
13792 #: ../fish/guestfish-actions.pod:4477 ../src/guestfs-actions.pod:6724
13793 msgid "Sleep for C<secs> seconds."
13797 #: ../fish/guestfish-actions.pod:4479
13802 #: ../fish/guestfish-actions.pod:4481
13810 #: ../fish/guestfish-actions.pod:4485 ../src/guestfs-actions.pod:6738
13811 msgid "This is the same as the C<stat(2)> system call."
13815 #: ../fish/guestfish-actions.pod:4487
13820 #: ../fish/guestfish-actions.pod:4489
13828 #: ../fish/guestfish-actions.pod:4491 ../src/guestfs-actions.pod:6752
13830 "Returns file system statistics for any mounted file system. C<path> should "
13831 "be a file or directory in the mounted file system (typically it is the mount "
13832 "point itself, but it doesn't need to be)."
13836 #: ../fish/guestfish-actions.pod:4495 ../src/guestfs-actions.pod:6756
13837 msgid "This is the same as the C<statvfs(2)> system call."
13841 #: ../fish/guestfish-actions.pod:4497
13846 #: ../fish/guestfish-actions.pod:4499
13854 #: ../fish/guestfish-actions.pod:4501 ../src/guestfs-actions.pod:6770
13856 "This runs the L<strings(1)> command on a file and returns the list of "
13857 "printable strings found."
13861 #: ../fish/guestfish-actions.pod:4507
13866 #: ../fish/guestfish-actions.pod:4509
13869 " strings-e encoding path\n"
13874 #: ../fish/guestfish-actions.pod:4511
13876 "This is like the L</strings> command, but allows you to specify the encoding "
13877 "of strings that are looked for in the source file C<path>."
13881 #: ../fish/guestfish-actions.pod:4515 ../src/guestfs-actions.pod:6793
13882 msgid "Allowed encodings are:"
13886 #: ../fish/guestfish-actions.pod:4519 ../src/guestfs-actions.pod:6797
13891 #: ../fish/guestfish-actions.pod:4521
13893 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13894 "ISO-8859-X (this is what L</strings> uses)."
13898 #: ../fish/guestfish-actions.pod:4524 ../src/guestfs-actions.pod:6802
13903 #: ../fish/guestfish-actions.pod:4526 ../src/guestfs-actions.pod:6804
13904 msgid "Single 8-bit-byte characters."
13908 #: ../fish/guestfish-actions.pod:4528 ../src/guestfs-actions.pod:6806
13913 #: ../fish/guestfish-actions.pod:4530 ../src/guestfs-actions.pod:6808
13914 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13918 #: ../fish/guestfish-actions.pod:4533 ../src/guestfs-actions.pod:6811
13919 msgid "l (lower case letter L)"
13923 #: ../fish/guestfish-actions.pod:4535 ../src/guestfs-actions.pod:6813
13925 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13926 "examining binaries in Windows guests."
13930 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:6816
13935 #: ../fish/guestfish-actions.pod:4540 ../src/guestfs-actions.pod:6818
13936 msgid "32-bit big endian such as UCS-4BE."
13940 #: ../fish/guestfish-actions.pod:4542 ../src/guestfs-actions.pod:6820
13945 #: ../fish/guestfish-actions.pod:4544 ../src/guestfs-actions.pod:6822
13946 msgid "32-bit little endian such as UCS-4LE."
13950 #: ../fish/guestfish-actions.pod:4548 ../src/guestfs-actions.pod:6826
13951 msgid "The returned strings are transcoded to UTF-8."
13955 #: ../fish/guestfish-actions.pod:4553
13956 msgid "swapoff-device"
13960 #: ../fish/guestfish-actions.pod:4555
13963 " swapoff-device device\n"
13968 #: ../fish/guestfish-actions.pod:4557
13970 "This command disables the libguestfs appliance swap device or partition "
13971 "named C<device>. See L</swapon-device>."
13975 #: ../fish/guestfish-actions.pod:4561
13976 msgid "swapoff-file"
13980 #: ../fish/guestfish-actions.pod:4563
13983 " swapoff-file file\n"
13988 #: ../fish/guestfish-actions.pod:4565 ../src/guestfs-actions.pod:6857
13989 msgid "This command disables the libguestfs appliance swap on file."
13993 #: ../fish/guestfish-actions.pod:4567
13994 msgid "swapoff-label"
13998 #: ../fish/guestfish-actions.pod:4569
14001 " swapoff-label label\n"
14006 #: ../fish/guestfish-actions.pod:4571 ../src/guestfs-actions.pod:6869
14008 "This command disables the libguestfs appliance swap on labeled swap "
14013 #: ../fish/guestfish-actions.pod:4574
14014 msgid "swapoff-uuid"
14018 #: ../fish/guestfish-actions.pod:4576
14021 " swapoff-uuid uuid\n"
14026 #: ../fish/guestfish-actions.pod:4578 ../src/guestfs-actions.pod:6882
14028 "This command disables the libguestfs appliance swap partition with the given "
14033 #: ../fish/guestfish-actions.pod:4581
14034 msgid "swapon-device"
14038 #: ../fish/guestfish-actions.pod:4583
14041 " swapon-device device\n"
14046 #: ../fish/guestfish-actions.pod:4585
14048 "This command enables the libguestfs appliance to use the swap device or "
14049 "partition named C<device>. The increased memory is made available for all "
14050 "commands, for example those run using L</command> or L</sh>."
14054 #: ../fish/guestfish-actions.pod:4590 ../src/guestfs-actions.pod:6900
14056 "Note that you should not swap to existing guest swap partitions unless you "
14057 "know what you are doing. They may contain hibernation information, or other "
14058 "information that the guest doesn't want you to trash. You also risk leaking "
14059 "information about the host to the guest this way. Instead, attach a new "
14060 "host device to the guest and swap on that."
14064 #: ../fish/guestfish-actions.pod:4597
14065 msgid "swapon-file"
14069 #: ../fish/guestfish-actions.pod:4599
14072 " swapon-file file\n"
14077 #: ../fish/guestfish-actions.pod:4601
14079 "This command enables swap to a file. See L</swapon-device> for other notes."
14083 #: ../fish/guestfish-actions.pod:4604
14084 msgid "swapon-label"
14088 #: ../fish/guestfish-actions.pod:4606
14091 " swapon-label label\n"
14096 #: ../fish/guestfish-actions.pod:4608
14098 "This command enables swap to a labeled swap partition. See L</swapon-"
14099 "device> for other notes."
14103 #: ../fish/guestfish-actions.pod:4611
14104 msgid "swapon-uuid"
14108 #: ../fish/guestfish-actions.pod:4613
14111 " swapon-uuid uuid\n"
14116 #: ../fish/guestfish-actions.pod:4615
14118 "This command enables swap to a swap partition with the given UUID. See L</"
14119 "swapon-device> for other notes."
14123 #: ../fish/guestfish-actions.pod:4618
14128 #: ../fish/guestfish-actions.pod:4620
14136 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:6955
14138 "This syncs the disk, so that any writes are flushed through to the "
14139 "underlying disk image."
14143 #: ../fish/guestfish-actions.pod:4625 ../src/guestfs-actions.pod:6958
14145 "You should always call this if you have modified a disk image, before "
14146 "closing the handle."
14150 #: ../fish/guestfish-actions.pod:4628
14155 #: ../fish/guestfish-actions.pod:4630
14163 #: ../fish/guestfish-actions.pod:4632 ../src/guestfs-actions.pod:6971
14165 "This command returns up to the last 10 lines of a file as a list of strings."
14169 #: ../fish/guestfish-actions.pod:4638
14174 #: ../fish/guestfish-actions.pod:4640
14177 " tail-n nrlines path\n"
14182 #: ../fish/guestfish-actions.pod:4642 ../src/guestfs-actions.pod:6990
14184 "If the parameter C<nrlines> is a positive number, this returns the last "
14185 "C<nrlines> lines of the file C<path>."
14189 #: ../fish/guestfish-actions.pod:4645 ../src/guestfs-actions.pod:6993
14191 "If the parameter C<nrlines> is a negative number, this returns lines from "
14192 "the file C<path>, starting with the C<-nrlines>th line."
14196 #: ../fish/guestfish-actions.pod:4653
14201 #: ../fish/guestfish-actions.pod:4655
14204 " tar-in (tarfile|-) directory\n"
14209 #: ../fish/guestfish-actions.pod:4657 ../src/guestfs-actions.pod:7014
14211 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14212 "tar file) into C<directory>."
14216 #: ../fish/guestfish-actions.pod:4660
14217 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
14221 #: ../fish/guestfish-actions.pod:4665
14226 #: ../fish/guestfish-actions.pod:4667
14229 " tar-out directory (tarfile|-)\n"
14234 #: ../fish/guestfish-actions.pod:4669 ../src/guestfs-actions.pod:7031
14236 "This command packs the contents of C<directory> and downloads it to local "
14241 #: ../fish/guestfish-actions.pod:4672
14242 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
14246 #: ../fish/guestfish-actions.pod:4677
14251 #: ../fish/guestfish-actions.pod:4679
14254 " tgz-in (tarball|-) directory\n"
14259 #: ../fish/guestfish-actions.pod:4681 ../src/guestfs-actions.pod:7048
14261 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14262 "tar file) into C<directory>."
14266 #: ../fish/guestfish-actions.pod:4684
14267 msgid "To upload an uncompressed tarball, use L</tar-in>."
14271 #: ../fish/guestfish-actions.pod:4688
14276 #: ../fish/guestfish-actions.pod:4690
14279 " tgz-out directory (tarball|-)\n"
14284 #: ../fish/guestfish-actions.pod:4692 ../src/guestfs-actions.pod:7064
14286 "This command packs the contents of C<directory> and downloads it to local "
14291 #: ../fish/guestfish-actions.pod:4695
14292 msgid "To download an uncompressed tarball, use L</tar-out>."
14296 #: ../fish/guestfish-actions.pod:4699
14301 #: ../fish/guestfish-actions.pod:4701
14309 #: ../fish/guestfish-actions.pod:4703 ../src/guestfs-actions.pod:7079
14311 "Touch acts like the L<touch(1)> command. It can be used to update the "
14312 "timestamps on a file, or, if the file does not exist, to create a new zero-"
14317 #: ../fish/guestfish-actions.pod:4707 ../src/guestfs-actions.pod:7083
14319 "This command only works on regular files, and will fail on other file types "
14320 "such as directories, symbolic links, block special etc."
14324 #: ../fish/guestfish-actions.pod:4710
14329 #: ../fish/guestfish-actions.pod:4712
14337 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7096
14339 "This command truncates C<path> to a zero-length file. The file must exist "
14344 #: ../fish/guestfish-actions.pod:4717
14345 msgid "truncate-size"
14349 #: ../fish/guestfish-actions.pod:4719
14352 " truncate-size path size\n"
14357 #: ../fish/guestfish-actions.pod:4721 ../src/guestfs-actions.pod:7110
14359 "This command truncates C<path> to size C<size> bytes. The file must exist "
14364 #: ../fish/guestfish-actions.pod:4724
14366 "If the current file size is less than C<size> then the file is extended to "
14367 "the required size with zero bytes. This creates a sparse file (ie. disk "
14368 "blocks are not allocated for the file until you write to it). To create a "
14369 "non-sparse file of zeroes, use L</fallocate64> instead."
14373 #: ../fish/guestfish-actions.pod:4730
14378 #: ../fish/guestfish-actions.pod:4732
14381 " tune2fs-l device\n"
14386 #: ../fish/guestfish-actions.pod:4734 ../src/guestfs-actions.pod:7129
14388 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14393 #: ../fish/guestfish-actions.pod:4737 ../src/guestfs-actions.pod:7132
14395 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14396 "for more details. The list of fields returned isn't clearly defined, and "
14397 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14398 "and the filesystem itself."
14402 #: ../fish/guestfish-actions.pod:4742
14407 #: ../fish/guestfish-actions.pod:4744
14410 " txz-in (tarball|-) directory\n"
14415 #: ../fish/guestfish-actions.pod:4746 ../src/guestfs-actions.pod:7152
14417 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14418 "tar file) into C<directory>."
14422 #: ../fish/guestfish-actions.pod:4751
14427 #: ../fish/guestfish-actions.pod:4753
14430 " txz-out directory (tarball|-)\n"
14435 #: ../fish/guestfish-actions.pod:4755 ../src/guestfs-actions.pod:7166
14437 "This command packs the contents of C<directory> and downloads it to local "
14438 "file C<tarball> (as an xz compressed tar archive)."
14442 #: ../fish/guestfish-actions.pod:4760
14447 #: ../fish/guestfish-actions.pod:4762
14455 #: ../fish/guestfish-actions.pod:4764 ../src/guestfs-actions.pod:7179
14457 "This function sets the mask used for creating new files and device nodes to "
14462 #: ../fish/guestfish-actions.pod:4767 ../src/guestfs-actions.pod:7182
14464 "Typical umask values would be C<022> which creates new files with "
14465 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
14466 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
14470 #: ../fish/guestfish-actions.pod:4772 ../src/guestfs-actions.pod:7187
14472 "The default umask is C<022>. This is important because it means that "
14473 "directories and device nodes will be created with C<0644> or C<0755> mode "
14474 "even if you specify C<0777>."
14478 #: ../fish/guestfish-actions.pod:4776
14479 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
14483 #: ../fish/guestfish-actions.pod:4779 ../src/guestfs-actions.pod:7194
14484 msgid "This call returns the previous umask."
14488 #: ../fish/guestfish-actions.pod:4781
14493 #: ../fish/guestfish-actions.pod:4783
14498 #: ../fish/guestfish-actions.pod:4785
14501 " umount pathordevice\n"
14506 #: ../fish/guestfish-actions.pod:4787 ../src/guestfs-actions.pod:7206
14508 "This unmounts the given filesystem. The filesystem may be specified either "
14509 "by its mountpoint (path) or the device which contains the filesystem."
14513 #: ../fish/guestfish-actions.pod:4791
14518 #: ../fish/guestfish-actions.pod:4793
14519 msgid "unmount-all"
14523 #: ../fish/guestfish-actions.pod:4795
14531 #: ../fish/guestfish-actions.pod:4797 ../src/guestfs-actions.pod:7219
14532 msgid "This unmounts all mounted filesystems."
14536 #: ../fish/guestfish-actions.pod:4799 ../src/guestfs-actions.pod:7221
14537 msgid "Some internal mounts are not unmounted by this call."
14541 #: ../fish/guestfish-actions.pod:4801
14546 #: ../fish/guestfish-actions.pod:4803
14549 " upload (filename|-) remotefilename\n"
14554 #: ../fish/guestfish-actions.pod:4805 ../fish/guestfish-actions.pod:4818
14555 #: ../src/guestfs-actions.pod:7234 ../src/guestfs-actions.pod:7258
14556 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14560 #: ../fish/guestfish-actions.pod:4810
14561 msgid "See also L</download>."
14565 #: ../fish/guestfish-actions.pod:4814
14566 msgid "upload-offset"
14570 #: ../fish/guestfish-actions.pod:4816
14573 " upload-offset (filename|-) remotefilename offset\n"
14578 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7261
14580 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14581 "The intention is to overwrite parts of existing files or devices, although "
14582 "if a non-existant file is specified then it is created with a \"hole\" "
14583 "before C<offset>. The size of the data written is implicit in the size of "
14584 "the source C<filename>."
14588 #: ../fish/guestfish-actions.pod:4828
14590 "Note that there is no limit on the amount of data that can be uploaded with "
14591 "this call, unlike with L</pwrite>, and this call always writes the full "
14592 "amount unless an error occurs."
14596 #: ../fish/guestfish-actions.pod:4833
14597 msgid "See also L</upload>, L</pwrite>."
14601 #: ../fish/guestfish-actions.pod:4837
14606 #: ../fish/guestfish-actions.pod:4839
14609 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14614 #: ../fish/guestfish-actions.pod:4841 ../src/guestfs-actions.pod:7294
14615 msgid "This command sets the timestamps of a file with nanosecond precision."
14619 #: ../fish/guestfish-actions.pod:4844 ../src/guestfs-actions.pod:7297
14621 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14626 #: ../fish/guestfish-actions.pod:4847 ../src/guestfs-actions.pod:7300
14628 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14629 "nanoseconds from the epoch."
14633 #: ../fish/guestfish-actions.pod:4850 ../src/guestfs-actions.pod:7303
14635 "If the C<*nsecs> field contains the special value C<-1> then the "
14636 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14637 "ignored in this case)."
14641 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7307
14643 "If the C<*nsecs> field contains the special value C<-2> then the "
14644 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14649 #: ../fish/guestfish-actions.pod:4858
14654 #: ../fish/guestfish-actions.pod:4860
14662 #: ../fish/guestfish-actions.pod:4862 ../src/guestfs-actions.pod:7320
14664 "Return the libguestfs version number that the program is linked against."
14668 #: ../fish/guestfish-actions.pod:4865 ../src/guestfs-actions.pod:7323
14670 "Note that because of dynamic linking this is not necessarily the version of "
14671 "libguestfs that you compiled against. You can compile the program, and then "
14672 "at runtime dynamically link against a completely different C<libguestfs.so> "
14677 #: ../fish/guestfish-actions.pod:4870 ../src/guestfs-actions.pod:7328
14679 "This call was added in version C<1.0.58>. In previous versions of "
14680 "libguestfs there was no way to get the version number. From C code you can "
14681 "use dynamic linker functions to find out if this symbol exists (if it "
14682 "doesn't, then it's an earlier version)."
14686 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7334
14688 "The call returns a structure with four elements. The first three (C<major>, "
14689 "C<minor> and C<release>) are numbers and correspond to the usual version "
14690 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14691 "but may be used for distro-specific information."
14695 #: ../fish/guestfish-actions.pod:4882 ../src/guestfs-actions.pod:7340
14697 "To construct the original version string: C<$major.$minor.$release$extra>"
14701 #: ../fish/guestfish-actions.pod:4885 ../src/guestfs-actions.pod:7343
14702 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14706 #: ../fish/guestfish-actions.pod:4887
14708 "I<Note:> Don't use this call to test for availability of features. In "
14709 "enterprise distributions we backport features from later versions into "
14710 "earlier versions, making this an unreliable way to test for features. Use "
14711 "L</available> instead."
14715 #: ../fish/guestfish-actions.pod:4893
14720 #: ../fish/guestfish-actions.pod:4895
14723 " vfs-label device\n"
14728 #: ../fish/guestfish-actions.pod:4897 ../src/guestfs-actions.pod:7363
14729 msgid "This returns the filesystem label of the filesystem on C<device>."
14733 #: ../fish/guestfish-actions.pod:4900 ../src/guestfs-actions.pod:7366
14734 msgid "If the filesystem is unlabeled, this returns the empty string."
14738 #: ../fish/guestfish-actions.pod:4902
14739 msgid "To find a filesystem from the label, use L</findfs-label>."
14743 #: ../fish/guestfish-actions.pod:4904
14748 #: ../fish/guestfish-actions.pod:4906
14751 " vfs-type device\n"
14756 #: ../fish/guestfish-actions.pod:4908 ../src/guestfs-actions.pod:7381
14758 "This command gets the filesystem type corresponding to the filesystem on "
14763 #: ../fish/guestfish-actions.pod:4911 ../src/guestfs-actions.pod:7384
14765 "For most filesystems, the result is the name of the Linux VFS module which "
14766 "would be used to mount this filesystem if you mounted it without specifying "
14767 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14771 #: ../fish/guestfish-actions.pod:4916
14776 #: ../fish/guestfish-actions.pod:4918
14779 " vfs-uuid device\n"
14784 #: ../fish/guestfish-actions.pod:4920 ../src/guestfs-actions.pod:7400
14785 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14789 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7403
14790 msgid "If the filesystem does not have a UUID, this returns the empty string."
14794 #: ../fish/guestfish-actions.pod:4925
14795 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
14799 #: ../fish/guestfish-actions.pod:4927
14800 msgid "vg-activate"
14804 #: ../fish/guestfish-actions.pod:4929
14807 " vg-activate true|false 'volgroups ...'\n"
14812 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7419
14814 "This command activates or (if C<activate> is false) deactivates all logical "
14815 "volumes in the listed volume groups C<volgroups>."
14819 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7422
14820 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14824 #: ../fish/guestfish-actions.pod:4936 ../src/guestfs-actions.pod:7424
14826 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14827 "activated or deactivated."
14831 #: ../fish/guestfish-actions.pod:4939
14832 msgid "vg-activate-all"
14836 #: ../fish/guestfish-actions.pod:4941
14839 " vg-activate-all true|false\n"
14844 #: ../fish/guestfish-actions.pod:4943 ../src/guestfs-actions.pod:7437
14846 "This command activates or (if C<activate> is false) deactivates all logical "
14847 "volumes in all volume groups."
14851 #: ../fish/guestfish-actions.pod:4946 ../src/guestfs-actions.pod:7440
14852 msgid "This command is the same as running C<vgchange -a y|n>"
14856 #: ../fish/guestfish-actions.pod:4948
14861 #: ../fish/guestfish-actions.pod:4950
14864 " vgcreate volgroup 'physvols ...'\n"
14869 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7453
14871 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14872 "of physical volumes C<physvols>."
14876 #: ../fish/guestfish-actions.pod:4955
14881 #: ../fish/guestfish-actions.pod:4957
14884 " vglvuuids vgname\n"
14889 #: ../fish/guestfish-actions.pod:4959 ../src/guestfs-actions.pod:7466
14891 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14892 "volumes created in this volume group."
14896 #: ../fish/guestfish-actions.pod:4962
14898 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
14899 "logical volumes and volume groups."
14903 #: ../fish/guestfish-actions.pod:4965
14904 msgid "See also L</vgpvuuids>."
14908 #: ../fish/guestfish-actions.pod:4967
14913 #: ../fish/guestfish-actions.pod:4969
14916 " vgpvuuids vgname\n"
14921 #: ../fish/guestfish-actions.pod:4971 ../src/guestfs-actions.pod:7486
14923 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14924 "volumes that this volume group resides on."
14928 #: ../fish/guestfish-actions.pod:4974
14930 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
14931 "physical volumes and volume groups."
14935 #: ../fish/guestfish-actions.pod:4977
14936 msgid "See also L</vglvuuids>."
14940 #: ../fish/guestfish-actions.pod:4979
14945 #: ../fish/guestfish-actions.pod:4981
14948 " vgremove vgname\n"
14953 #: ../fish/guestfish-actions.pod:4983 ../src/guestfs-actions.pod:7506
14954 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14958 #: ../fish/guestfish-actions.pod:4985 ../src/guestfs-actions.pod:7508
14960 "This also forcibly removes all logical volumes in the volume group (if any)."
14964 #: ../fish/guestfish-actions.pod:4988
14969 #: ../fish/guestfish-actions.pod:4990
14972 " vgrename volgroup newvolgroup\n"
14977 #: ../fish/guestfish-actions.pod:4992 ../src/guestfs-actions.pod:7522
14978 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14982 #: ../fish/guestfish-actions.pod:4994
14987 #: ../fish/guestfish-actions.pod:4996
14995 #: ../fish/guestfish-actions.pod:4998 ../src/guestfs-actions.pod:7533
14997 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15002 #: ../fish/guestfish-actions.pod:5001 ../src/guestfs-actions.pod:7536
15004 "This returns a list of just the volume group names that were detected (eg. "
15009 #: ../fish/guestfish-actions.pod:5004
15010 msgid "See also L</vgs-full>."
15014 #: ../fish/guestfish-actions.pod:5006
15019 #: ../fish/guestfish-actions.pod:5008
15027 #: ../fish/guestfish-actions.pod:5010 ../src/guestfs-actions.pod:7552
15029 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15030 "> command. The \"full\" version includes all fields."
15034 #: ../fish/guestfish-actions.pod:5013
15039 #: ../fish/guestfish-actions.pod:5015
15047 #: ../fish/guestfish-actions.pod:5017 ../src/guestfs-actions.pod:7566
15049 "This rescans all block devices and rebuilds the list of LVM physical "
15050 "volumes, volume groups and logical volumes."
15054 #: ../fish/guestfish-actions.pod:5020
15059 #: ../fish/guestfish-actions.pod:5022
15067 #: ../fish/guestfish-actions.pod:5024 ../src/guestfs-actions.pod:7579
15068 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15072 #: ../fish/guestfish-actions.pod:5026
15077 #: ../fish/guestfish-actions.pod:5028
15085 #: ../fish/guestfish-actions.pod:5030 ../src/guestfs-actions.pod:7619
15087 "This command counts the characters in a file, using the C<wc -c> external "
15092 #: ../fish/guestfish-actions.pod:5033
15097 #: ../fish/guestfish-actions.pod:5035
15105 #: ../fish/guestfish-actions.pod:5037 ../src/guestfs-actions.pod:7632
15107 "This command counts the lines in a file, using the C<wc -l> external command."
15111 #: ../fish/guestfish-actions.pod:5040
15116 #: ../fish/guestfish-actions.pod:5042
15124 #: ../fish/guestfish-actions.pod:5044 ../src/guestfs-actions.pod:7645
15126 "This command counts the words in a file, using the C<wc -w> external command."
15130 #: ../fish/guestfish-actions.pod:5047
15135 #: ../fish/guestfish-actions.pod:5049
15138 " write path content\n"
15143 #: ../fish/guestfish-actions.pod:5051 ../src/guestfs-actions.pod:7660
15145 "This call creates a file called C<path>. The content of the file is the "
15146 "string C<content> (which can contain any 8 bit data)."
15150 #: ../fish/guestfish-actions.pod:5054
15151 msgid "See also L</write-append>."
15155 #: ../fish/guestfish-actions.pod:5059
15156 msgid "write-append"
15160 #: ../fish/guestfish-actions.pod:5061
15163 " write-append path content\n"
15168 #: ../fish/guestfish-actions.pod:5063 ../src/guestfs-actions.pod:7680
15170 "This call appends C<content> to the end of file C<path>. If C<path> does "
15171 "not exist, then a new file is created."
15175 #: ../fish/guestfish-actions.pod:5066
15176 msgid "See also L</write>."
15180 #: ../fish/guestfish-actions.pod:5071
15185 #: ../fish/guestfish-actions.pod:5073
15188 " write-file path content size\n"
15193 #: ../fish/guestfish-actions.pod:5075 ../src/guestfs-actions.pod:7707
15195 "This call creates a file called C<path>. The contents of the file is the "
15196 "string C<content> (which can contain any 8 bit data), with length C<size>."
15200 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7711
15202 "As a special case, if C<size> is C<0> then the length is calculated using "
15203 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15207 #: ../fish/guestfish-actions.pod:5083 ../src/guestfs-actions.pod:7715
15209 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15210 "I<not> work, even if the length is specified."
15214 #: ../fish/guestfish-actions.pod:5089
15216 "I<This function is deprecated.> In new code, use the L</write> call instead."
15220 #: ../fish/guestfish-actions.pod:5096
15225 #: ../fish/guestfish-actions.pod:5098
15228 " zegrep regex path\n"
15233 #: ../fish/guestfish-actions.pod:5100 ../src/guestfs-actions.pod:7732
15235 "This calls the external C<zegrep> program and returns the matching lines."
15239 #: ../fish/guestfish-actions.pod:5106
15244 #: ../fish/guestfish-actions.pod:5108
15247 " zegrepi regex path\n"
15252 #: ../fish/guestfish-actions.pod:5110 ../src/guestfs-actions.pod:7751
15254 "This calls the external C<zegrep -i> program and returns the matching lines."
15258 #: ../fish/guestfish-actions.pod:5116
15263 #: ../fish/guestfish-actions.pod:5118
15271 #: ../fish/guestfish-actions.pod:5120 ../src/guestfs-actions.pod:7769
15272 msgid "This command writes zeroes over the first few blocks of C<device>."
15276 #: ../fish/guestfish-actions.pod:5122 ../src/guestfs-actions.pod:7771
15278 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15279 "securely wipe the device). It should be sufficient to remove any partition "
15280 "tables, filesystem superblocks and so on."
15284 #: ../fish/guestfish-actions.pod:5126 ../fish/guestfish-actions.pod:5141
15285 #: ../src/guestfs-actions.pod:7775 ../src/guestfs-actions.pod:7801
15287 "If blocks are already zero, then this command avoids writing zeroes. This "
15288 "prevents the underlying device from becoming non-sparse or growing "
15293 #: ../fish/guestfish-actions.pod:5130
15294 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
15298 #: ../fish/guestfish-actions.pod:5133
15299 msgid "zero-device"
15303 #: ../fish/guestfish-actions.pod:5135
15306 " zero-device device\n"
15311 #: ../fish/guestfish-actions.pod:5137
15313 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
15314 "which just zeroes the first few blocks of a device."
15318 #: ../fish/guestfish-actions.pod:5148
15323 #: ../fish/guestfish-actions.pod:5150
15326 " zerofree device\n"
15331 #: ../fish/guestfish-actions.pod:5152 ../src/guestfs-actions.pod:7823
15333 "This runs the I<zerofree> program on C<device>. This program claims to zero "
15334 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
15335 "possible to compress the filesystem more effectively."
15339 #: ../fish/guestfish-actions.pod:5157 ../src/guestfs-actions.pod:7828
15340 msgid "You should B<not> run this program if the filesystem is mounted."
15344 #: ../fish/guestfish-actions.pod:5160 ../src/guestfs-actions.pod:7831
15346 "It is possible that using this program can damage the filesystem or data on "
15351 #: ../fish/guestfish-actions.pod:5163
15356 #: ../fish/guestfish-actions.pod:5165
15359 " zfgrep pattern path\n"
15364 #: ../fish/guestfish-actions.pod:5167 ../src/guestfs-actions.pod:7845
15366 "This calls the external C<zfgrep> program and returns the matching lines."
15370 #: ../fish/guestfish-actions.pod:5173
15375 #: ../fish/guestfish-actions.pod:5175
15378 " zfgrepi pattern path\n"
15383 #: ../fish/guestfish-actions.pod:5177 ../src/guestfs-actions.pod:7864
15385 "This calls the external C<zfgrep -i> program and returns the matching lines."
15389 #: ../fish/guestfish-actions.pod:5183
15394 #: ../fish/guestfish-actions.pod:5185
15397 " zfile meth path\n"
15402 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7890
15404 "This command runs C<file> after first decompressing C<path> using C<method>."
15408 #: ../fish/guestfish-actions.pod:5190 ../src/guestfs-actions.pod:7893
15409 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15413 #: ../fish/guestfish-actions.pod:5192
15415 "Since 1.0.63, use L</file> instead which can now process compressed files."
15419 #: ../fish/guestfish-actions.pod:5195
15421 "I<This function is deprecated.> In new code, use the L</file> call instead."
15425 #: ../fish/guestfish-actions.pod:5202
15430 #: ../fish/guestfish-actions.pod:5204
15433 " zgrep regex path\n"
15438 #: ../fish/guestfish-actions.pod:5206 ../src/guestfs-actions.pod:7910
15440 "This calls the external C<zgrep> program and returns the matching lines."
15444 #: ../fish/guestfish-actions.pod:5212
15449 #: ../fish/guestfish-actions.pod:5214
15452 " zgrepi regex path\n"
15457 #: ../fish/guestfish-actions.pod:5216 ../src/guestfs-actions.pod:7929
15459 "This calls the external C<zgrep -i> program and returns the matching lines."
15463 #: ../fish/guestfish-commands.pod:1
15468 #: ../fish/guestfish-commands.pod:3
15473 #: ../fish/guestfish-commands.pod:5
15476 " alloc filename size\n"
15481 #: ../fish/guestfish-commands.pod:7
15483 "This creates an empty (zeroed) file of the given size, and then adds so it "
15484 "can be further examined."
15488 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
15489 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
15493 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
15494 msgid "Size can be specified using standard suffixes, eg. C<1M>."
15498 #: ../fish/guestfish-commands.pod:14
15500 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
15501 "image, see L</PREPARED DISK IMAGES>."
15505 #: ../fish/guestfish-commands.pod:17
15510 #: ../fish/guestfish-commands.pod:19
15513 " copy-in local [local ...] /remotedir\n"
15518 #: ../fish/guestfish-commands.pod:21
15520 "C<copy-in> copies local files or directories recursively into the disk "
15521 "image, placing them in the directory called C</remotedir> (which must "
15522 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
15523 "other commands as necessary."
15527 #: ../fish/guestfish-commands.pod:26
15529 "Multiple local files and directories can be specified, but the last "
15530 "parameter must always be a remote directory. Wildcards cannot be used."
15534 #: ../fish/guestfish-commands.pod:30
15539 #: ../fish/guestfish-commands.pod:32
15542 " copy-out remote [remote ...] localdir\n"
15547 #: ../fish/guestfish-commands.pod:34
15549 "C<copy-out> copies remote files or directories recursively out of the disk "
15550 "image, placing them on the host disk in a local directory called C<localdir> "
15551 "(which must exist). This guestfish meta-command turns into a sequence of L</"
15552 "download>, L</tar-out> and other commands as necessary."
15556 #: ../fish/guestfish-commands.pod:40
15558 "Multiple remote files and directories can be specified, but the last "
15559 "parameter must always be a local directory. To download to the current "
15560 "directory, use C<.> as in:"
15564 #: ../fish/guestfish-commands.pod:44
15567 " copy-out /home .\n"
15572 #: ../fish/guestfish-commands.pod:46
15574 "Wildcards cannot be used in the ordinary command, but you can use them with "
15575 "the help of L</glob> like this:"
15579 #: ../fish/guestfish-commands.pod:49
15582 " glob copy-out /home/* .\n"
15587 #: ../fish/guestfish-commands.pod:51
15592 #: ../fish/guestfish-commands.pod:53
15595 " display filename\n"
15600 #: ../fish/guestfish-commands.pod:55
15602 "Use C<display> (a graphical display program) to display an image file. It "
15603 "downloads the file, and runs C<display> on it."
15607 #: ../fish/guestfish-commands.pod:58
15609 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15610 "environment variable. For example to use the GNOME display program:"
15614 #: ../fish/guestfish-commands.pod:61
15617 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15622 #: ../fish/guestfish-commands.pod:63
15623 msgid "See also L<display(1)>."
15627 #: ../fish/guestfish-commands.pod:65
15632 #: ../fish/guestfish-commands.pod:67
15635 " echo [params ...]\n"
15640 #: ../fish/guestfish-commands.pod:69
15641 msgid "This echos the parameters to the terminal."
15645 #: ../fish/guestfish-commands.pod:71
15650 #: ../fish/guestfish-commands.pod:73
15655 #: ../fish/guestfish-commands.pod:75
15660 #: ../fish/guestfish-commands.pod:77
15668 #: ../fish/guestfish-commands.pod:79
15670 "This is used to edit a file. It downloads the file, edits it locally using "
15671 "your editor, then uploads the result."
15675 #: ../fish/guestfish-commands.pod:82
15677 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
15678 "or C<emacs> you will get those corresponding editors."
15682 #: ../fish/guestfish-commands.pod:86
15687 #: ../fish/guestfish-commands.pod:88
15690 " glob command args...\n"
15695 #: ../fish/guestfish-commands.pod:90
15697 "Expand wildcards in any paths in the args list, and run C<command> "
15698 "repeatedly on each matching path."
15702 #: ../fish/guestfish-commands.pod:93
15703 msgid "See L</WILDCARDS AND GLOBBING>."
15707 #: ../fish/guestfish-commands.pod:95
15712 #: ../fish/guestfish-commands.pod:97
15715 " hexedit <filename|device>\n"
15716 " hexedit <filename|device> <max>\n"
15717 " hexedit <filename|device> <start> <max>\n"
15722 #: ../fish/guestfish-commands.pod:101
15724 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
15729 #: ../fish/guestfish-commands.pod:104
15731 "This command works by downloading potentially the whole file or device, "
15732 "editing it locally, then uploading it. If the file or device is large, you "
15733 "have to specify which part you wish to edit by using C<max> and/or C<start> "
15734 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
15735 "usual modifiers allowed such as C<1M> (1 megabyte)."
15739 #: ../fish/guestfish-commands.pod:111
15740 msgid "For example to edit the first few sectors of a disk you might do:"
15744 #: ../fish/guestfish-commands.pod:114
15747 " hexedit /dev/sda 1M\n"
15752 #: ../fish/guestfish-commands.pod:116
15754 "which would allow you to edit anywhere within the first megabyte of the disk."
15758 #: ../fish/guestfish-commands.pod:119
15759 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
15763 #: ../fish/guestfish-commands.pod:121
15766 " hexedit /dev/sda1 0x400 0x400\n"
15771 #: ../fish/guestfish-commands.pod:123
15772 msgid "(assuming the superblock is in the standard location)."
15776 #: ../fish/guestfish-commands.pod:125
15778 "This command requires the external L<hexedit(1)> program. You can specify "
15779 "another program to use by setting the C<HEXEDITOR> environment variable."
15783 #: ../fish/guestfish-commands.pod:129
15784 msgid "See also L</hexdump>."
15788 #: ../fish/guestfish-commands.pod:131
15793 #: ../fish/guestfish-commands.pod:133
15801 #: ../fish/guestfish-commands.pod:135
15803 "Change the local directory, ie. the current directory of guestfish itself."
15807 #: ../fish/guestfish-commands.pod:138
15808 msgid "Note that C<!cd> won't do what you might expect."
15812 #: ../fish/guestfish-commands.pod:140
15817 #: ../fish/guestfish-commands.pod:142
15822 #: ../fish/guestfish-commands.pod:144
15830 #: ../fish/guestfish-commands.pod:146
15831 msgid "Opens the manual page for guestfish."
15835 #: ../fish/guestfish-commands.pod:148
15840 #: ../fish/guestfish-commands.pod:150
15845 #: ../fish/guestfish-commands.pod:152
15853 #: ../fish/guestfish-commands.pod:154
15861 #: ../fish/guestfish-commands.pod:156
15862 msgid "This is used to view a file."
15866 #: ../fish/guestfish-commands.pod:158
15868 "The default viewer is C<$PAGER>. However if you use the alternate command "
15869 "C<less> you will get the C<less> command specifically."
15873 #: ../fish/guestfish-commands.pod:161
15878 #: ../fish/guestfish-commands.pod:163
15886 #: ../fish/guestfish-commands.pod:165
15888 "Close and reopen the libguestfs handle. It is not necessary to use this "
15889 "normally, because the handle is closed properly when guestfish exits. "
15890 "However this is occasionally useful for testing."
15894 #: ../fish/guestfish-commands.pod:169
15899 #: ../fish/guestfish-commands.pod:171
15902 " setenv VAR value\n"
15907 #: ../fish/guestfish-commands.pod:173
15908 msgid "Set the environment variable C<VAR> to the string C<value>."
15912 #: ../fish/guestfish-commands.pod:175
15914 "To print the value of an environment variable use a shell command such as:"
15918 #: ../fish/guestfish-commands.pod:178
15926 #: ../fish/guestfish-commands.pod:180
15931 #: ../fish/guestfish-commands.pod:182
15934 " sparse filename size\n"
15939 #: ../fish/guestfish-commands.pod:184
15941 "This creates an empty sparse file of the given size, and then adds so it can "
15942 "be further examined."
15946 #: ../fish/guestfish-commands.pod:187
15948 "In all respects it works the same as the L</alloc> command, except that the "
15949 "image file is allocated sparsely, which means that disk blocks are not "
15950 "assigned to the file until they are needed. Sparse disk files only use "
15951 "space when written to, but they are slower and there is a danger you could "
15952 "run out of real disk space during a write operation."
15956 #: ../fish/guestfish-commands.pod:197
15961 #: ../fish/guestfish-commands.pod:199
15969 #: ../fish/guestfish-commands.pod:201
15971 "This command returns a list of the optional groups known to the daemon, and "
15972 "indicates which ones are supported by this build of the libguestfs appliance."
15976 #: ../fish/guestfish-commands.pod:205
15977 msgid "See also L<guestfs(3)/AVAILABILITY>."
15981 #: ../fish/guestfish-commands.pod:207
15986 #: ../fish/guestfish-commands.pod:209
15989 " time command args...\n"
15994 #: ../fish/guestfish-commands.pod:211
15996 "Run the command as usual, but print the elapsed time afterwards. This can "
15997 "be useful for benchmarking operations."
16001 #: ../fish/guestfish-commands.pod:214
16006 #: ../fish/guestfish-commands.pod:216
16014 #: ../fish/guestfish-commands.pod:218
16015 msgid "Remove C<VAR> from the environment."
16019 #: ../fish/guestfish.pod:5
16020 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16024 #: ../fish/guestfish.pod:9
16027 " guestfish [--options] [commands]\n"
16032 #: ../fish/guestfish.pod:11
16040 #: ../fish/guestfish.pod:13
16043 " guestfish [--ro|--rw] -a disk.img\n"
16048 #: ../fish/guestfish.pod:15
16051 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16056 #: ../fish/guestfish.pod:17
16059 " guestfish -d libvirt-domain\n"
16064 #: ../fish/guestfish.pod:19
16067 " guestfish [--ro|--rw] -a disk.img -i\n"
16072 #: ../fish/guestfish.pod:21
16075 " guestfish -d libvirt-domain -i\n"
16080 #: ../fish/guestfish.pod:25
16082 "Using guestfish in read/write mode on live virtual machines can be "
16083 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16084 "option to use guestfish safely if the disk image or virtual machine might be "
16089 #: ../fish/guestfish.pod:32
16091 "Guestfish is a shell and command-line tool for examining and modifying "
16092 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16093 "functionality of the guestfs API, see L<guestfs(3)>."
16097 #: ../fish/guestfish.pod:36
16099 "Guestfish gives you structured access to the libguestfs API, from shell "
16100 "scripts or the command line or interactively. If you want to rescue a "
16101 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16106 #: ../fish/guestfish.pod:43
16107 msgid "As an interactive shell"
16111 #: ../fish/guestfish.pod:45
16119 #: ../fish/guestfish.pod:47
16122 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16123 " editing virtual machine filesystems.\n"
16128 #: ../fish/guestfish.pod:50
16131 " Type: 'help' for a list of commands\n"
16132 " 'man' to read the manual\n"
16133 " 'quit' to quit the shell\n"
16138 #: ../fish/guestfish.pod:54
16141 " ><fs> add-ro disk.img\n"
16143 " ><fs> list-filesystems\n"
16144 " /dev/sda1: ext4\n"
16145 " /dev/vg_guest/lv_root: ext4\n"
16146 " /dev/vg_guest/lv_swap: swap\n"
16147 " ><fs> mount /dev/vg_guest/lv_root /\n"
16148 " ><fs> cat /etc/fstab\n"
16150 " # Created by anaconda\n"
16157 #: ../fish/guestfish.pod:67
16158 msgid "From shell scripts"
16162 #: ../fish/guestfish.pod:69
16163 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16167 #: ../fish/guestfish.pod:71
16170 " guestfish <<_EOF_\n"
16173 " mount /dev/vg_guest/lv_root /\n"
16174 " write /etc/motd \"Welcome, new users\"\n"
16180 #: ../fish/guestfish.pod:78
16181 msgid "List the LVM logical volumes in a disk image:"
16185 #: ../fish/guestfish.pod:80
16188 " guestfish -a disk.img --ro <<_EOF_\n"
16196 #: ../fish/guestfish.pod:85
16197 msgid "List all the filesystems in a disk image:"
16201 #: ../fish/guestfish.pod:87
16204 " guestfish -a disk.img --ro <<_EOF_\n"
16206 " list-filesystems\n"
16212 #: ../fish/guestfish.pod:92
16213 msgid "On one command line"
16217 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
16218 msgid "Update C</etc/resolv.conf> in a guest:"
16222 #: ../fish/guestfish.pod:96
16226 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
16227 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16232 #: ../fish/guestfish.pod:100
16233 msgid "Edit C</boot/grub/grub.conf> interactively:"
16237 #: ../fish/guestfish.pod:102
16240 " guestfish --rw --add disk.img \\\n"
16241 " --mount /dev/vg_guest/lv_root \\\n"
16242 " --mount /dev/sda1:/boot \\\n"
16243 " edit /boot/grub/grub.conf\n"
16248 #: ../fish/guestfish.pod:107
16249 msgid "Mount disks automatically"
16253 #: ../fish/guestfish.pod:109
16255 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
16259 #: ../fish/guestfish.pod:112
16262 " guestfish --ro -a disk.img -i cat /etc/group\n"
16267 #: ../fish/guestfish.pod:114
16270 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16275 #: ../fish/guestfish.pod:116
16276 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16280 #: ../fish/guestfish.pod:118
16283 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16288 #: ../fish/guestfish.pod:120
16289 msgid "As a script interpreter"
16293 #: ../fish/guestfish.pod:122
16294 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16298 #: ../fish/guestfish.pod:124
16301 " #!/usr/bin/guestfish -f\n"
16302 " sparse test1.img 100M\n"
16304 " part-disk /dev/sda mbr\n"
16305 " mkfs ext2 /dev/sda1\n"
16310 #: ../fish/guestfish.pod:130
16311 msgid "Start with a prepared disk"
16315 #: ../fish/guestfish.pod:132
16317 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16318 "single ext2-formatted partition:"
16322 #: ../fish/guestfish.pod:135
16325 " guestfish -N fs\n"
16330 #: ../fish/guestfish.pod:137
16331 msgid "To list what is available do:"
16335 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1009
16338 " guestfish -N help | less\n"
16343 #: ../fish/guestfish.pod:141
16344 msgid "Remote control"
16348 #: ../fish/guestfish.pod:143
16351 " eval \"`guestfish --listen`\"\n"
16352 " guestfish --remote add-ro disk.img\n"
16353 " guestfish --remote run\n"
16354 " guestfish --remote lvs\n"
16359 #: ../fish/guestfish.pod:154
16360 msgid "Displays general help on options."
16364 #: ../fish/guestfish.pod:158
16365 msgid "B<--cmd-help>"
16369 #: ../fish/guestfish.pod:160
16370 msgid "Lists all available guestfish commands."
16374 #: ../fish/guestfish.pod:162
16379 #: ../fish/guestfish.pod:164
16380 msgid "B<--cmd-help cmd>"
16384 #: ../fish/guestfish.pod:166
16385 msgid "Displays detailed help on a single command C<cmd>."
16389 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
16390 msgid "B<-a image>"
16394 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
16395 msgid "B<--add image>"
16399 #: ../fish/guestfish.pod:172
16400 msgid "Add a block device or virtual machine image to the shell."
16404 #: ../fish/guestfish.pod:177
16406 "Using this flag is mostly equivalent to using the C<add> command, with "
16407 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
16408 "the I<--format=...> flag was given."
16412 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
16414 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16415 "URI to use. The default is to use the default libvirt connection."
16419 #: ../fish/guestfish.pod:189
16424 #: ../fish/guestfish.pod:191
16426 "If using the I<--listen> option and a csh-like shell, use this option. See "
16427 "section L</REMOTE CONTROL AND CSH> below."
16431 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
16432 msgid "B<-d libvirt-domain>"
16436 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
16437 msgid "B<--domain libvirt-domain>"
16441 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
16443 "Add disks from the named libvirt domain. If the I<--ro> option is also "
16444 "used, then any libvirt domain can be used. However in write mode, only "
16445 "libvirt domains which are shut down can be named here."
16449 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
16450 msgid "Domain UUIDs can be used instead of names."
16454 #: ../fish/guestfish.pod:204
16456 "Using this flag is mostly equivalent to using the C<add-domain> command, "
16457 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
16458 "if the I<--format:...> flag was given."
16462 #: ../fish/guestfish.pod:208
16467 #: ../fish/guestfish.pod:210
16468 msgid "B<--no-dest-paths>"
16472 #: ../fish/guestfish.pod:212
16474 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
16475 "to hit the tab key to complete paths on the guest filesystem, but this "
16476 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
16477 "allow this feature to be disabled."
16481 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
16483 "When prompting for keys and passphrases, guestfish normally turns echoing "
16484 "off so you cannot see what you are typing. If you are not worried about "
16485 "Tempest attacks and there is no one else in the room you can specify this "
16486 "flag to see what you are typing."
16490 #: ../fish/guestfish.pod:224
16495 #: ../fish/guestfish.pod:226
16496 msgid "B<--file file>"
16500 #: ../fish/guestfish.pod:228
16501 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
16505 #: ../fish/guestfish.pod:231
16508 " #!/usr/bin/guestfish -f\n"
16513 #: ../fish/guestfish.pod:244
16516 " guestfish --format=raw -a disk.img\n"
16521 #: ../fish/guestfish.pod:248
16524 " guestfish --format=raw -a disk.img --format -a another.img\n"
16529 #: ../fish/guestfish.pod:253
16531 "If you have untrusted raw-format guest disk images, you should use this "
16532 "option to specify the disk format. This avoids a possible security problem "
16533 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
16537 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
16538 msgid "B<--inspector>"
16542 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
16544 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
16545 "system and mount filesystems as they would be mounted on the real virtual "
16550 #: ../fish/guestfish.pod:266
16551 msgid "Typical usage is either:"
16555 #: ../fish/guestfish.pod:268
16558 " guestfish -d myguest -i\n"
16563 #: ../fish/guestfish.pod:270
16564 msgid "(for an inactive libvirt domain called I<myguest>), or:"
16568 #: ../fish/guestfish.pod:272
16571 " guestfish --ro -d myguest -i\n"
16576 #: ../fish/guestfish.pod:274
16577 msgid "(for active domains, readonly), or specify the block device directly:"
16581 #: ../fish/guestfish.pod:276
16584 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
16589 #: ../fish/guestfish.pod:278
16591 "Note that the command line syntax changed slightly over older versions of "
16592 "guestfish. You can still use the old syntax:"
16596 #: ../fish/guestfish.pod:281
16599 " guestfish [--ro] -i disk.img\n"
16604 #: ../fish/guestfish.pod:283
16607 " guestfish [--ro] -i libvirt-domain\n"
16612 #: ../fish/guestfish.pod:285
16614 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
16615 "then using other commands to mount the filesystems that were found."
16619 #: ../fish/guestfish.pod:294
16620 msgid "B<--listen>"
16624 #: ../fish/guestfish.pod:296
16626 "Fork into the background and listen for remote commands. See section L</"
16627 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16631 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
16636 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
16638 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
16639 "ATTACHING TO RUNNING DAEMONS>)."
16643 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
16644 msgid "B<-m dev[:mountpoint[:options]]>"
16648 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
16649 msgid "B<--mount dev[:mountpoint[:options]]>"
16653 #: ../fish/guestfish.pod:308
16654 msgid "Mount the named partition or logical volume on the given mountpoint."
16658 #: ../fish/guestfish.pod:310
16659 msgid "If the mountpoint is omitted, it defaults to C</>."
16663 #: ../fish/guestfish.pod:312
16664 msgid "You have to mount something on C</> before most commands will work."
16668 #: ../fish/guestfish.pod:314
16670 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16675 #: ../fish/guestfish.pod:317
16677 "If you don't know what filesystems a disk image contains, you can either run "
16678 "guestfish without this option, then list the partitions, filesystems and LVs "
16679 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
16680 "commands), or you can use the L<virt-filesystems(1)> program."
16684 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
16686 "The third (and rarely used) part of the mount parameter is the list of mount "
16687 "options used to mount the underlying filesystem. If this is not given, then "
16688 "the mount options are either the empty string or C<ro> (the latter if the "
16689 "I<--ro> flag is used). By specifying the mount options, you override this "
16690 "default choice. Probably the only time you would use this is to enable ACLs "
16691 "and/or extended attributes if the filesystem can support them:"
16695 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
16698 " -m /dev/sda1:/:acl,user_xattr\n"
16703 #: ../fish/guestfish.pod:333
16704 msgid "Using this flag is equivalent to using the C<mount-options> command."
16708 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193
16709 #: ../resize/virt-resize.pod:358
16714 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
16715 msgid "B<--no-sync>"
16719 #: ../fish/guestfish.pod:339
16721 "Disable autosync. This is enabled by default. See the discussion of "
16722 "autosync in the L<guestfs(3)> manpage."
16726 #: ../fish/guestfish.pod:342
16731 #: ../fish/guestfish.pod:344
16732 msgid "B<--new type>"
16736 #: ../fish/guestfish.pod:346
16741 #: ../fish/guestfish.pod:348
16743 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16744 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16745 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16750 #: ../fish/guestfish.pod:353
16751 msgid "B<--progress-bars>"
16755 #: ../fish/guestfish.pod:355
16756 msgid "Enable progress bars, even when guestfish is used non-interactively."
16760 #: ../fish/guestfish.pod:357
16762 "Progress bars are enabled by default when guestfish is used as an "
16763 "interactive shell."
16767 #: ../fish/guestfish.pod:360
16768 msgid "B<--no-progress-bars>"
16772 #: ../fish/guestfish.pod:362
16773 msgid "Disable progress bars."
16777 #: ../fish/guestfish.pod:364
16778 msgid "B<--remote[=pid]>"
16782 #: ../fish/guestfish.pod:366
16784 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16785 "CONTROL GUESTFISH OVER A SOCKET> below."
16789 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239
16790 #: ../rescue/virt-rescue.pod:161
16795 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241
16796 #: ../rescue/virt-rescue.pod:163
16801 #: ../fish/guestfish.pod:373
16803 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16804 "mounts are done read-only."
16808 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
16810 "The option must always be used if the disk image or virtual machine might be "
16811 "running, and is generally recommended in cases where you don't need write "
16812 "access to the disk."
16816 #: ../fish/guestfish.pod:380
16818 "Note that prepared disk images created with I<-N> are not affected by this "
16819 "option. Also commands like C<add> are not affected - you have to specify "
16820 "the C<readonly:true> option explicitly if you need it."
16824 #: ../fish/guestfish.pod:384
16825 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16829 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253
16830 #: ../rescue/virt-rescue.pod:173
16831 msgid "B<--selinux>"
16835 #: ../fish/guestfish.pod:388
16836 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16840 #: ../fish/guestfish.pod:394
16842 "Enable very verbose messages. This is particularly useful if you find a bug."
16846 #: ../fish/guestfish.pod:401
16847 msgid "Display the guestfish / libguestfs version number and exit."
16851 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269
16852 #: ../rescue/virt-rescue.pod:190
16857 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271
16858 #: ../rescue/virt-rescue.pod:192
16863 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
16865 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16866 "mounts are done read-write."
16870 #: ../fish/guestfish.pod:410
16871 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
16875 #: ../fish/guestfish.pod:414
16876 msgid "Echo each command before executing it."
16880 #: ../fish/guestfish.pod:418
16881 msgid "COMMANDS ON COMMAND LINE"
16885 #: ../fish/guestfish.pod:420
16887 "Any additional (non-option) arguments are treated as commands to execute."
16891 #: ../fish/guestfish.pod:423
16893 "Commands to execute should be separated by a colon (C<:>), where the colon "
16894 "is a separate parameter. Thus:"
16898 #: ../fish/guestfish.pod:426
16901 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16906 #: ../fish/guestfish.pod:428
16908 "If there are no additional arguments, then we enter a shell, either an "
16909 "interactive shell with a prompt (if the input is a terminal) or a non-"
16910 "interactive shell."
16914 #: ../fish/guestfish.pod:432
16916 "In either command line mode or non-interactive shell, the first command that "
16917 "gives an error causes the whole shell to exit. In interactive mode (with a "
16918 "prompt) if a command fails, you can continue to enter commands."
16922 #: ../fish/guestfish.pod:437
16923 msgid "USING launch (OR run)"
16927 #: ../fish/guestfish.pod:439
16929 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16930 "then launch it, then mount any disks you need, and finally issue actions/"
16931 "commands. So the general order of the day is:"
16935 #: ../fish/guestfish.pod:447
16936 msgid "add or -a/--add"
16940 #: ../fish/guestfish.pod:451
16941 msgid "launch (aka run)"
16945 #: ../fish/guestfish.pod:455
16946 msgid "mount or -m/--mount"
16950 #: ../fish/guestfish.pod:459
16951 msgid "any other commands"
16955 #: ../fish/guestfish.pod:463
16957 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16958 "guest before mounting or performing any other commands."
16962 #: ../fish/guestfish.pod:466
16964 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16965 "I<--new> options were given then C<run> is done automatically, simply "
16966 "because guestfish can't perform the action you asked for without doing this."
16970 #: ../fish/guestfish.pod:471
16971 msgid "OPENING DISKS FOR READ AND WRITE"
16975 #: ../fish/guestfish.pod:473
16977 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
16978 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
16979 "I<-i> and I<-m> open disk images read-only or for writing."
16983 #: ../fish/guestfish.pod:478
16985 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
16986 "opening disk images supplied on the command line for write. To open a disk "
16987 "image read-only you have to do I<-a image --ro>."
16991 #: ../fish/guestfish.pod:482
16993 "This matters: If you accidentally open a live VM disk image writable then "
16994 "you will cause irreversible disk corruption."
16998 #: ../fish/guestfish.pod:485
17000 "In a future libguestfs we intend to change the default the other way. Disk "
17001 "images will be opened read-only. You will have to either specify "
17002 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
17003 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
17004 "access for disk images specified by those other command line options."
17008 #: ../fish/guestfish.pod:492
17010 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
17011 "which does nothing (it is already the default). However it is highly "
17012 "recommended that you use this option to indicate that you need write access, "
17013 "and prepare your scripts for the day when this option will be required for "
17018 #: ../fish/guestfish.pod:498
17020 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17021 "other libguestfs program apart from guestfish and guestmount."
17025 #: ../fish/guestfish.pod:501
17030 #: ../fish/guestfish.pod:503
17032 "You can quote ordinary parameters using either single or double quotes. For "
17037 #: ../fish/guestfish.pod:506
17040 " add \"file with a space.img\"\n"
17045 #: ../fish/guestfish.pod:508
17048 " rm '/file name'\n"
17053 #: ../fish/guestfish.pod:510
17061 #: ../fish/guestfish.pod:512
17063 "A few commands require a list of strings to be passed. For these, use a "
17064 "whitespace-separated list, enclosed in quotes. Strings containing "
17065 "whitespace to be passed through must be enclosed in single quotes. A "
17066 "literal single quote must be escaped with a backslash."
17070 #: ../fish/guestfish.pod:517
17073 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17074 " command \"/bin/echo 'foo bar'\"\n"
17075 " command \"/bin/echo \\'foo\\'\"\n"
17080 #: ../fish/guestfish.pod:521
17081 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
17085 #: ../fish/guestfish.pod:523
17087 "In double-quoted arguments (only) use backslash to insert special characters:"
17091 #: ../fish/guestfish.pod:528
17096 #: ../fish/guestfish.pod:530
17097 msgid "Alert (bell) character."
17101 #: ../fish/guestfish.pod:532
17106 #: ../fish/guestfish.pod:534
17107 msgid "Backspace character."
17111 #: ../fish/guestfish.pod:536
17116 #: ../fish/guestfish.pod:538
17117 msgid "Form feed character."
17121 #: ../fish/guestfish.pod:540
17126 #: ../fish/guestfish.pod:542
17127 msgid "Newline character."
17131 #: ../fish/guestfish.pod:544
17136 #: ../fish/guestfish.pod:546
17137 msgid "Carriage return character."
17141 #: ../fish/guestfish.pod:548
17146 #: ../fish/guestfish.pod:550
17147 msgid "Horizontal tab character."
17151 #: ../fish/guestfish.pod:552
17156 #: ../fish/guestfish.pod:554
17157 msgid "Vertical tab character."
17161 #: ../fish/guestfish.pod:556
17166 #: ../fish/guestfish.pod:558
17167 msgid "A literal double quote character."
17171 #: ../fish/guestfish.pod:560
17176 #: ../fish/guestfish.pod:562
17178 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
17183 #: ../fish/guestfish.pod:565
17188 #: ../fish/guestfish.pod:567
17190 "A character with hex value I<hh>. There must be precisely 2 hex digits."
17194 #: ../fish/guestfish.pod:570
17196 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
17201 #: ../fish/guestfish.pod:573
17206 #: ../fish/guestfish.pod:575
17207 msgid "A literal backslash character."
17211 #: ../fish/guestfish.pod:579
17212 msgid "OPTIONAL ARGUMENTS"
17216 #: ../fish/guestfish.pod:581
17218 "Some commands take optional arguments. These arguments appear in this "
17219 "documentation as C<[argname:..]>. You can use them as in these examples:"
17223 #: ../fish/guestfish.pod:585
17226 " add-drive-opts filename\n"
17231 #: ../fish/guestfish.pod:587
17234 " add-drive-opts filename readonly:true\n"
17239 #: ../fish/guestfish.pod:589
17242 " add-drive-opts filename format:qcow2 readonly:false\n"
17247 #: ../fish/guestfish.pod:591
17249 "Each optional argument can appear at most once. All optional arguments must "
17250 "appear after the required ones."
17254 #: ../fish/guestfish.pod:594
17259 #: ../fish/guestfish.pod:596
17261 "This section applies to all commands which can take integers as parameters."
17265 #: ../fish/guestfish.pod:599
17266 msgid "SIZE SUFFIX"
17270 #: ../fish/guestfish.pod:601
17272 "When the command takes a parameter measured in bytes, you can use one of the "
17273 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17277 #: ../fish/guestfish.pod:607
17278 msgid "B<k> or B<K> or B<KiB>"
17282 #: ../fish/guestfish.pod:609
17283 msgid "The size in kilobytes (multiplied by 1024)."
17287 #: ../fish/guestfish.pod:611
17292 #: ../fish/guestfish.pod:613
17293 msgid "The size in SI 1000 byte units."
17297 #: ../fish/guestfish.pod:615
17298 msgid "B<M> or B<MiB>"
17302 #: ../fish/guestfish.pod:617
17303 msgid "The size in megabytes (multiplied by 1048576)."
17307 #: ../fish/guestfish.pod:619
17312 #: ../fish/guestfish.pod:621
17313 msgid "The size in SI 1000000 byte units."
17317 #: ../fish/guestfish.pod:623
17318 msgid "B<G> or B<GiB>"
17322 #: ../fish/guestfish.pod:625
17323 msgid "The size in gigabytes (multiplied by 2**30)."
17327 #: ../fish/guestfish.pod:627
17332 #: ../fish/guestfish.pod:629
17333 msgid "The size in SI 10**9 byte units."
17337 #: ../fish/guestfish.pod:631
17338 msgid "B<T> or B<TiB>"
17342 #: ../fish/guestfish.pod:633
17343 msgid "The size in terabytes (multiplied by 2**40)."
17347 #: ../fish/guestfish.pod:635
17352 #: ../fish/guestfish.pod:637
17353 msgid "The size in SI 10**12 byte units."
17357 #: ../fish/guestfish.pod:639
17358 msgid "B<P> or B<PiB>"
17362 #: ../fish/guestfish.pod:641
17363 msgid "The size in petabytes (multiplied by 2**50)."
17367 #: ../fish/guestfish.pod:643
17372 #: ../fish/guestfish.pod:645
17373 msgid "The size in SI 10**15 byte units."
17377 #: ../fish/guestfish.pod:647
17378 msgid "B<E> or B<EiB>"
17382 #: ../fish/guestfish.pod:649
17383 msgid "The size in exabytes (multiplied by 2**60)."
17387 #: ../fish/guestfish.pod:651
17392 #: ../fish/guestfish.pod:653
17393 msgid "The size in SI 10**18 byte units."
17397 #: ../fish/guestfish.pod:655
17398 msgid "B<Z> or B<ZiB>"
17402 #: ../fish/guestfish.pod:657
17403 msgid "The size in zettabytes (multiplied by 2**70)."
17407 #: ../fish/guestfish.pod:659
17412 #: ../fish/guestfish.pod:661
17413 msgid "The size in SI 10**21 byte units."
17417 #: ../fish/guestfish.pod:663
17418 msgid "B<Y> or B<YiB>"
17422 #: ../fish/guestfish.pod:665
17423 msgid "The size in yottabytes (multiplied by 2**80)."
17427 #: ../fish/guestfish.pod:667
17432 #: ../fish/guestfish.pod:669
17433 msgid "The size in SI 10**24 byte units."
17437 #: ../fish/guestfish.pod:675
17440 " truncate-size /file 1G\n"
17445 #: ../fish/guestfish.pod:677
17446 msgid "would truncate the file to 1 gigabyte."
17450 #: ../fish/guestfish.pod:679
17452 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
17453 "the parameter to L</memsize> is specified in megabytes already). Adding a "
17454 "suffix will probably not do what you expect."
17458 #: ../fish/guestfish.pod:683
17459 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17463 #: ../fish/guestfish.pod:685
17465 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17466 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17470 #: ../fish/guestfish.pod:688
17473 " 1234 decimal number 1234\n"
17474 " 02322 octal number, equivalent to decimal 1234\n"
17475 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17480 #: ../fish/guestfish.pod:692
17482 "When using the C<chmod> command, you almost always want to specify an octal "
17483 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17484 "L<chmod(1)> program):"
17488 #: ../fish/guestfish.pod:696
17491 " chmod 0777 /public # OK\n"
17492 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17497 #: ../fish/guestfish.pod:699
17499 "Commands that return numbers usually print them in decimal, but some "
17500 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17501 "octal, preceeded by C<0>)."
17505 #: ../fish/guestfish.pod:703
17506 msgid "WILDCARDS AND GLOBBING"
17510 #: ../fish/guestfish.pod:705
17512 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17513 "(globbing) by default. So for example the following will not do what you "
17518 #: ../fish/guestfish.pod:709
17526 #: ../fish/guestfish.pod:711
17528 "Assuming you don't have a directory called literally C</home/*> then the "
17529 "above command will return an error."
17533 #: ../fish/guestfish.pod:714
17534 msgid "To perform wildcard expansion, use the C<glob> command."
17538 #: ../fish/guestfish.pod:716
17541 " glob rm-rf /home/*\n"
17546 #: ../fish/guestfish.pod:718
17548 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17549 "many times), equivalent to:"
17553 #: ../fish/guestfish.pod:721
17556 " rm-rf /home/jim\n"
17557 " rm-rf /home/joe\n"
17558 " rm-rf /home/mary\n"
17563 #: ../fish/guestfish.pod:725
17564 msgid "C<glob> only works on simple guest paths and not on device names."
17568 #: ../fish/guestfish.pod:727
17570 "If you have several parameters, each containing a wildcard, then glob will "
17571 "perform a Cartesian product."
17575 #: ../fish/guestfish.pod:730
17580 #: ../fish/guestfish.pod:732
17582 "Any line which starts with a I<#> character is treated as a comment and "
17583 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17584 "a command. For example:"
17588 #: ../fish/guestfish.pod:736
17591 " # this is a comment\n"
17592 " # this is a comment\n"
17593 " foo # NOT a comment\n"
17598 #: ../fish/guestfish.pod:740
17599 msgid "Blank lines are also ignored."
17603 #: ../fish/guestfish.pod:742
17604 msgid "RUNNING COMMANDS LOCALLY"
17608 #: ../fish/guestfish.pod:744
17610 "Any line which starts with a I<!> character is treated as a command sent to "
17611 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17615 #: ../fish/guestfish.pod:748
17619 " tgz-out /remote local/remote-data.tar.gz\n"
17624 #: ../fish/guestfish.pod:751
17626 "will create a directory C<local> on the host, and then export the contents "
17627 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17628 "(See C<tgz-out>)."
17632 #: ../fish/guestfish.pod:755
17634 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17635 "effect, due to the way that subprocesses work in Unix."
17639 #: ../fish/guestfish.pod:758
17640 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
17644 #: ../fish/guestfish.pod:760
17646 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
17647 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
17648 "and executed as guestfish commands."
17652 #: ../fish/guestfish.pod:764
17654 "Thus you can use shell script to construct arbitrary guestfish commands "
17655 "which are then parsed by guestfish."
17659 #: ../fish/guestfish.pod:767
17661 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
17662 "through C</foo.100>) using guestfish commands alone. However this is simple "
17663 "if we use a shell script to create the guestfish commands for us:"
17667 #: ../fish/guestfish.pod:772
17670 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
17675 #: ../fish/guestfish.pod:774
17676 msgid "or with names like C</foo.001>:"
17680 #: ../fish/guestfish.pod:776
17683 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
17688 #: ../fish/guestfish.pod:778
17690 "When using guestfish interactively it can be helpful to just run the shell "
17691 "script first (ie. remove the initial C<E<lt>> character so it is just an "
17692 "ordinary I<!> local command), see what guestfish commands it would run, and "
17693 "when you are happy with those prepend the C<E<lt>> character to run the "
17694 "guestfish commands for real."
17698 #: ../fish/guestfish.pod:784
17703 #: ../fish/guestfish.pod:786
17705 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17706 "command (a guestfish command) to the second command (any host command). For "
17711 #: ../fish/guestfish.pod:790
17714 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17719 #: ../fish/guestfish.pod:792
17721 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17722 "program). The above command would list all accounts in the guest filesystem "
17723 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17727 #: ../fish/guestfish.pod:797
17730 " hexdump /bin/ls | head\n"
17731 " list-devices | tail -1\n"
17732 " tgz-out / - | tar ztf -\n"
17737 #: ../fish/guestfish.pod:801
17739 "The space before the pipe symbol is required, any space after the pipe "
17740 "symbol is optional. Everything after the pipe symbol is just passed "
17741 "straight to the host shell, so it can contain redirections, globs and "
17742 "anything else that makes sense on the host side."
17746 #: ../fish/guestfish.pod:806
17748 "To use a literal argument which begins with a pipe symbol, you have to quote "
17753 #: ../fish/guestfish.pod:809
17761 #: ../fish/guestfish.pod:811
17762 msgid "HOME DIRECTORIES"
17766 #: ../fish/guestfish.pod:813
17768 "If a parameter starts with the character C<~> then the tilde may be expanded "
17769 "as a home directory path (either C<~> for the current user's home directory, "
17770 "or C<~user> for another user)."
17774 #: ../fish/guestfish.pod:817
17776 "Note that home directory expansion happens for users known I<on the host>, "
17777 "not in the guest filesystem."
17781 #: ../fish/guestfish.pod:820
17783 "To use a literal argument which begins with a tilde, you have to quote it, "
17788 #: ../fish/guestfish.pod:823
17796 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
17797 msgid "ENCRYPTED DISKS"
17801 #: ../fish/guestfish.pod:827
17803 "Libguestfs has some support for Linux guests encrypted according to the "
17804 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17805 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
17806 "LUKS is supported."
17810 #: ../fish/guestfish.pod:832
17811 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17815 #: ../fish/guestfish.pod:834
17818 " ><fs> vfs-type /dev/sda2\n"
17824 #: ../fish/guestfish.pod:837
17826 "Then open those devices using L</luks-open>. This creates a device-mapper "
17827 "device called C</dev/mapper/luksdev>."
17831 #: ../fish/guestfish.pod:840
17834 " ><fs> luks-open /dev/sda2 luksdev\n"
17835 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17840 #: ../fish/guestfish.pod:843
17842 "Finally you have to tell LVM to scan for volume groups on the newly created "
17847 #: ../fish/guestfish.pod:846
17851 " vg-activate-all true\n"
17856 #: ../fish/guestfish.pod:849
17857 msgid "The logical volume(s) can now be mounted in the usual way."
17861 #: ../fish/guestfish.pod:851
17863 "Before closing a LUKS device you must unmount any logical volumes on it and "
17864 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17865 "one. Then you can close the mapper device:"
17869 #: ../fish/guestfish.pod:855
17872 " vg-activate false /dev/VG\n"
17873 " luks-close /dev/mapper/luksdev\n"
17878 #: ../fish/guestfish.pod:860
17880 "If a path is prefixed with C<win:> then you can use Windows-style drive "
17881 "letters and paths (with some limitations). The following commands are "
17886 #: ../fish/guestfish.pod:864
17889 " file /WINDOWS/system32/config/system.LOG\n"
17894 #: ../fish/guestfish.pod:866
17897 " file win:\\windows\\system32\\config\\system.log\n"
17902 #: ../fish/guestfish.pod:868
17905 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
17910 #: ../fish/guestfish.pod:870
17912 "The parameter is rewritten \"behind the scenes\" by looking up the position "
17913 "where the drive is mounted, prepending that to the path, changing all "
17914 "backslash characters to forward slash, then resolving the result using L</"
17915 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
17916 "the parameter might be rewritten like this:"
17920 #: ../fish/guestfish.pod:876
17923 " win:e:\\foo\\bar => /e/FOO/bar\n"
17928 #: ../fish/guestfish.pod:878
17929 msgid "This only works in argument positions that expect a path."
17933 #: ../fish/guestfish.pod:880
17934 msgid "UPLOADING AND DOWNLOADING FILES"
17938 #: ../fish/guestfish.pod:882
17940 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17941 "others which upload from or download to a local file, you can use the "
17942 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17946 #: ../fish/guestfish.pod:886
17954 #: ../fish/guestfish.pod:888
17956 "reads stdin and creates from that a file C</foo> in the disk image, and:"
17960 #: ../fish/guestfish.pod:891
17963 " tar-out /etc - | tar tf -\n"
17968 #: ../fish/guestfish.pod:893
17970 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17971 "command (see L</PIPES>)."
17975 #: ../fish/guestfish.pod:896
17977 "When using C<-> to read from stdin, the input is read up to the end of "
17978 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17979 "some arbitrary end marker:"
17983 #: ../fish/guestfish.pod:900
17986 " upload -<<END /foo\n"
17995 #: ../fish/guestfish.pod:906
17997 "Any string of characters can be used instead of C<END>. The end marker must "
17998 "appear on a line of its own, without any preceeding or following characters "
17999 "(not even spaces)."
18003 #: ../fish/guestfish.pod:910
18005 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18006 "upload local files (so-called \"FileIn\" parameters in the generator)."
18010 #: ../fish/guestfish.pod:913
18011 msgid "EXIT ON ERROR BEHAVIOUR"
18015 #: ../fish/guestfish.pod:915
18017 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18018 "taking commands from a human over a tty), and will exit on the first error "
18019 "in non-interactive mode (scripts, commands given on the command line)."
18023 #: ../fish/guestfish.pod:920
18025 "If you prefix a command with a I<-> character, then that command will not "
18026 "cause guestfish to exit, even if that (one) command returns an error."
18030 #: ../fish/guestfish.pod:924
18031 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18035 #: ../fish/guestfish.pod:926
18037 "Guestfish can be remote-controlled over a socket. This is useful "
18038 "particularly in shell scripts where you want to make several different "
18039 "changes to a filesystem, but you don't want the overhead of starting up a "
18040 "guestfish process each time."
18044 #: ../fish/guestfish.pod:931
18045 msgid "Start a guestfish server process using:"
18049 #: ../fish/guestfish.pod:933
18052 " eval \"`guestfish --listen`\"\n"
18057 #: ../fish/guestfish.pod:935
18058 msgid "and then send it commands by doing:"
18062 #: ../fish/guestfish.pod:937
18065 " guestfish --remote cmd [...]\n"
18070 #: ../fish/guestfish.pod:939
18071 msgid "To cause the server to exit, send it the exit command:"
18075 #: ../fish/guestfish.pod:943
18077 "Note that the server will normally exit if there is an error in a command. "
18078 "You can change this in the usual way. See section L</EXIT ON ERROR "
18083 #: ../fish/guestfish.pod:947
18084 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18088 #: ../fish/guestfish.pod:949
18090 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18091 "is how the I<--remote> option knows where to send the commands. You can "
18092 "have several guestfish listener processes running using:"
18096 #: ../fish/guestfish.pod:953
18099 " eval \"`guestfish --listen`\"\n"
18100 " pid1=$GUESTFISH_PID\n"
18101 " eval \"`guestfish --listen`\"\n"
18102 " pid2=$GUESTFISH_PID\n"
18104 " guestfish --remote=$pid1 cmd\n"
18105 " guestfish --remote=$pid2 cmd\n"
18110 #: ../fish/guestfish.pod:961
18111 msgid "REMOTE CONTROL AND CSH"
18115 #: ../fish/guestfish.pod:963
18117 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18122 #: ../fish/guestfish.pod:966
18125 " eval \"`guestfish --listen --csh`\"\n"
18130 #: ../fish/guestfish.pod:968
18131 msgid "REMOTE CONTROL DETAILS"
18135 #: ../fish/guestfish.pod:970
18137 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18138 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18139 "and C<$PID> is the process ID of the server."
18143 #: ../fish/guestfish.pod:974
18144 msgid "Guestfish client and server versions must match exactly."
18148 #: ../fish/guestfish.pod:976
18149 msgid "REMOTE CONTROL RUN COMMAND HANGING"
18153 #: ../fish/guestfish.pod:978
18155 "Using the C<run> (or C<launch>) command remotely in a command substitution "
18156 "context hangs, ie. don't do (note the backquotes):"
18160 #: ../fish/guestfish.pod:981
18163 " a=`guestfish --remote run`\n"
18168 #: ../fish/guestfish.pod:983
18170 "Since the C<run> command produces no output on stdout, this is not useful "
18171 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
18176 #: ../fish/guestfish.pod:987
18177 msgid "PREPARED DISK IMAGES"
18181 #: ../fish/guestfish.pod:989
18183 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18184 "preformatted disk images that guestfish can make for you to save typing. "
18185 "This is particularly useful for testing purposes. This option is used "
18186 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18187 "can be mixed with I<-a>)."
18191 #: ../fish/guestfish.pod:995
18193 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18194 "the second and so on. Existing files in the current directory are "
18199 #: ../fish/guestfish.pod:999
18201 "The type briefly describes how the disk should be sized, partitioned, how "
18202 "filesystem(s) should be created, and how content should be added. "
18203 "Optionally the type can be followed by extra parameters, separated by C<:> "
18204 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18205 "allocated disk, containing a single partition, with the partition formatted "
18206 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18211 #: ../fish/guestfish.pod:1007
18212 msgid "To list the available types and any extra parameters they take, run:"
18216 #: ../fish/guestfish.pod:1011
18218 "Note that the prepared filesystem is not mounted. You would usually have to "
18219 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18223 #: ../fish/guestfish.pod:1015
18225 "If any I<-N> or I<--new> options are given, the guest is automatically "
18230 #: ../fish/guestfish.pod:1020
18231 msgid "Create a 100MB disk with an ext4-formatted partition:"
18235 #: ../fish/guestfish.pod:1022
18238 " guestfish -N fs:ext4\n"
18243 #: ../fish/guestfish.pod:1024
18244 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18248 #: ../fish/guestfish.pod:1026
18251 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18256 #: ../fish/guestfish.pod:1028
18257 msgid "Create a blank 200MB disk:"
18261 #: ../fish/guestfish.pod:1030
18264 " guestfish -N disk:200M\n"
18269 #: ../fish/guestfish.pod:1032
18270 msgid "PROGRESS BARS"
18274 #: ../fish/guestfish.pod:1034
18276 "Some (not all) long-running commands send progress notification messages as "
18277 "they are running. Guestfish turns these messages into progress bars."
18281 #: ../fish/guestfish.pod:1038
18283 "When a command that supports progress bars takes longer than two seconds to "
18284 "run, and if progress bars are enabled, then you will see one appearing below "
18289 #: ../fish/guestfish.pod:1042
18292 " ><fs> copy-size /large-file /another-file 2048M\n"
18293 " / 10% [#####-----------------------------------------] 00:30\n"
18298 #: ../fish/guestfish.pod:1045
18300 "The spinner on the left hand side moves round once for every progress "
18301 "notification received from the backend. This is a (reasonably) golden "
18302 "assurance that the command is \"doing something\" even if the progress bar "
18303 "is not moving, because the command is able to send the progress "
18304 "notifications. When the bar reaches 100% and the command finishes, the "
18305 "spinner disappears."
18309 #: ../fish/guestfish.pod:1052
18311 "Progress bars are enabled by default when guestfish is used interactively. "
18312 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18313 "and you can disable them completely using I<--no-progress-bars>."
18317 #: ../fish/guestfish.pod:1057
18318 msgid "GUESTFISH COMMANDS"
18322 #: ../fish/guestfish.pod:1059
18324 "The commands in this section are guestfish convenience commands, in other "
18325 "words, they are not part of the L<guestfs(3)> API."
18329 #: ../fish/guestfish.pod:1062
18334 #: ../fish/guestfish.pod:1064
18343 #: ../fish/guestfish.pod:1067
18344 msgid "Without any parameter, this provides general help."
18348 #: ../fish/guestfish.pod:1069
18349 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18353 #: ../fish/guestfish.pod:1071
18354 msgid "quit | exit"
18358 #: ../fish/guestfish.pod:1073
18359 msgid "This exits guestfish. You can also use C<^D> key."
18363 #: ../fish/guestfish.pod:1075
18364 msgid "@FISH_COMMANDS@"
18368 #: ../fish/guestfish.pod:1077
18373 #: ../fish/guestfish.pod:1079 ../src/guestfs.pod:1475
18378 #: ../fish/guestfish.pod:1083
18380 "guestfish returns 0 if the commands completed without error, or 1 if there "
18385 #: ../fish/guestfish.pod:1090
18390 #: ../fish/guestfish.pod:1092
18392 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18397 #: ../fish/guestfish.pod:1095 ../src/guestfs.pod:3078
18398 msgid "FEBOOTSTRAP_KERNEL"
18402 #: ../fish/guestfish.pod:1097 ../src/guestfs.pod:3080
18403 msgid "FEBOOTSTRAP_MODULES"
18407 #: ../fish/guestfish.pod:1099 ../src/guestfs.pod:3082
18409 "These two environment variables allow the kernel that libguestfs uses in the "
18410 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
18411 "most recent host kernel is chosen. For more information about kernel "
18412 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
18413 "available in febootstrap E<ge> 3.8."
18417 #: ../fish/guestfish.pod:1105
18418 msgid "GUESTFISH_DISPLAY_IMAGE"
18422 #: ../fish/guestfish.pod:1107
18424 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
18425 "If not set, it uses L<display(1)>."
18429 #: ../fish/guestfish.pod:1110
18430 msgid "GUESTFISH_PID"
18434 #: ../fish/guestfish.pod:1112
18436 "Used with the I<--remote> option to specify the remote guestfish process to "
18437 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18441 #: ../fish/guestfish.pod:1116
18446 #: ../fish/guestfish.pod:1118
18448 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18449 "not specified, the external L<hexedit(1)> program is used."
18453 #: ../fish/guestfish.pod:1122
18458 #: ../fish/guestfish.pod:1124
18460 "If compiled with GNU readline support, various files in the home directory "
18461 "can be used. See L</FILES>."
18465 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3088
18466 msgid "LIBGUESTFS_APPEND"
18470 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3090
18471 msgid "Pass additional options to the guest kernel."
18475 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3092
18476 msgid "LIBGUESTFS_DEBUG"
18480 #: ../fish/guestfish.pod:1133
18482 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18483 "effect as using the B<-v> option."
18487 #: ../fish/guestfish.pod:1136 ../src/guestfs.pod:3097
18488 msgid "LIBGUESTFS_MEMSIZE"
18492 #: ../fish/guestfish.pod:1138 ../src/guestfs.pod:3099
18494 "Set the memory allocated to the qemu process, in megabytes. For example:"
18498 #: ../fish/guestfish.pod:1141 ../src/guestfs.pod:3102
18501 " LIBGUESTFS_MEMSIZE=700\n"
18506 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3104
18507 msgid "LIBGUESTFS_PATH"
18511 #: ../fish/guestfish.pod:1145
18513 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18514 "the discussion of paths in L<guestfs(3)>."
18518 #: ../fish/guestfish.pod:1148 ../src/guestfs.pod:3109
18519 msgid "LIBGUESTFS_QEMU"
18523 #: ../fish/guestfish.pod:1150 ../src/guestfs.pod:3111
18525 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
18526 "which was found at compile time by the configure script is used."
18530 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3117
18531 msgid "LIBGUESTFS_TRACE"
18535 #: ../fish/guestfish.pod:1156
18536 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18540 #: ../fish/guestfish.pod:1158
18545 #: ../fish/guestfish.pod:1160
18547 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18552 #: ../fish/guestfish.pod:1163 ../src/guestfs.pod:3122
18557 #: ../fish/guestfish.pod:1165 ../src/guestfs.pod:3124
18559 "Location of temporary directory, defaults to C</tmp> except for the cached "
18560 "supermin appliance which defaults to C</var/tmp>."
18564 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3127
18566 "If libguestfs was compiled to use the supermin appliance then the real "
18567 "appliance is cached in this directory, shared between all handles belonging "
18568 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
18569 "use in case C</var/tmp> is not large enough."
18573 #: ../fish/guestfish.pod:1176 ../fuse/guestmount.pod:288
18574 #: ../rescue/virt-rescue.pod:269
18579 #: ../fish/guestfish.pod:1180 ../fuse/guestmount.pod:292
18580 #: ../rescue/virt-rescue.pod:273
18581 msgid "$HOME/.libguestfs-tools.rc"
18585 #: ../fish/guestfish.pod:1182 ../fuse/guestmount.pod:294
18586 #: ../rescue/virt-rescue.pod:275
18587 msgid "/etc/libguestfs-tools.conf"
18591 #: ../fish/guestfish.pod:1184 ../fuse/guestmount.pod:296
18592 #: ../rescue/virt-rescue.pod:277
18594 "This configuration file controls the default read-only or read-write mode "
18595 "(I<--ro> or I<--rw>)."
18599 #: ../fish/guestfish.pod:1187
18600 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
18604 #: ../fish/guestfish.pod:1189
18605 msgid "$HOME/.guestfish"
18609 #: ../fish/guestfish.pod:1191
18611 "If compiled with GNU readline support, then the command history is saved in "
18616 #: ../fish/guestfish.pod:1194
18617 msgid "$HOME/.inputrc"
18621 #: ../fish/guestfish.pod:1196
18622 msgid "/etc/inputrc"
18626 #: ../fish/guestfish.pod:1198
18628 "If compiled with GNU readline support, then these files can be used to "
18629 "configure readline. For further information, please see L<readline(3)/"
18630 "INITIALIZATION FILE>."
18634 #: ../fish/guestfish.pod:1202
18635 msgid "To write rules which only apply to guestfish, use:"
18639 #: ../fish/guestfish.pod:1204
18649 #: ../fish/guestfish.pod:1208
18651 "Variables that you can set in inputrc that change the behaviour of guestfish "
18652 "in useful ways include:"
18656 #: ../fish/guestfish.pod:1213
18657 msgid "completion-ignore-case (default: on)"
18661 #: ../fish/guestfish.pod:1215
18663 "By default, guestfish will ignore case when tab-completing paths on the "
18668 #: ../fish/guestfish.pod:1218
18671 " set completion-ignore-case off\n"
18676 #: ../fish/guestfish.pod:1220
18677 msgid "to make guestfish case sensitive."
18681 #: ../fish/guestfish.pod:1224
18686 #: ../fish/guestfish.pod:1226
18687 msgid "test2.img (etc)"
18691 #: ../fish/guestfish.pod:1228
18693 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18694 "will be created in the file C<test1.img> in the current directory. The "
18695 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18696 "the same name will be overwritten."
18700 #: ../fish/guestfish.pod:1237
18702 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
18703 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
18704 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
18705 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
18706 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
18707 ">, L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
18711 #: ../fish/guestfish.pod:1266 ../src/guestfs.pod:3213
18712 #: ../test-tool/libguestfs-test-tool.pod:112
18713 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18717 #: ../fish/virt-copy-in.pod:5
18719 "virt-copy-in - Copy files and directories into a virtual machine disk image."
18723 #: ../fish/virt-copy-in.pod:9
18726 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18731 #: ../fish/virt-copy-in.pod:11
18734 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18739 #: ../fish/virt-copy-in.pod:15
18741 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18742 "causing disk corruption. The virtual machine must be shut down before you "
18743 "use this command."
18747 #: ../fish/virt-copy-in.pod:21
18749 "C<virt-copy-in> copies files and directories from the local disk into a "
18750 "virtual machine disk image or named libvirt domain."
18754 #: ../fish/virt-copy-in.pod:24
18756 "You can give one of more filenames and directories on the command line. "
18757 "Directories are copied in recursively. The final parameter must be the "
18758 "destination directory in the disk image which must be an absolute path "
18759 "starting with a C</> character."
18763 #: ../fish/virt-copy-in.pod:33
18766 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18771 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18772 msgid "Upload a home directory to a guest:"
18776 #: ../fish/virt-copy-in.pod:37
18779 " virt-copy-in -d MyGuest skel /home\n"
18784 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
18785 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18786 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18790 #: ../fish/virt-copy-in.pod:41
18792 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18793 "> C<copy-in> command. For anything more complex than a trivial copy, you "
18794 "are probably better off using guestfish directly."
18798 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
18799 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18801 "Since the shell script just passes options straight to guestfish, read "
18802 "L<guestfish(1)> to see the full list of options."
18806 #: ../fish/virt-copy-in.pod:52
18808 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18809 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18813 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
18814 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18815 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18819 #: ../fish/virt-copy-out.pod:5
18821 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18826 #: ../fish/virt-copy-out.pod:9
18829 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18834 #: ../fish/virt-copy-out.pod:11
18837 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18842 #: ../fish/virt-copy-out.pod:15
18844 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18845 "image or named libvirt domain."
18849 #: ../fish/virt-copy-out.pod:18
18851 "You can give one of more filenames and directories on the command line. "
18852 "Directories are copied out recursively."
18856 #: ../fish/virt-copy-out.pod:23
18857 msgid "Download the home directories from a virtual machine:"
18861 #: ../fish/virt-copy-out.pod:25
18865 " virt-copy-out -d MyGuest /home homes\n"
18870 #: ../fish/virt-copy-out.pod:30
18872 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18873 "> C<copy-out> command. For anything more complex than a trivial copy, you "
18874 "are probably better off using guestfish directly."
18878 #: ../fish/virt-copy-out.pod:41
18880 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
18881 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18885 #: ../fish/virt-tar-in.pod:5
18886 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18890 #: ../fish/virt-tar-in.pod:9
18893 " virt-tar-in -a disk.img data.tar /destination\n"
18898 #: ../fish/virt-tar-in.pod:11
18901 " virt-tar-in -d domain data.tar /destination\n"
18906 #: ../fish/virt-tar-in.pod:13
18909 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18914 #: ../fish/virt-tar-in.pod:17
18916 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18917 "causing disk corruption. The virtual machine must be shut down before you "
18918 "use this command."
18922 #: ../fish/virt-tar-in.pod:23
18924 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18925 "image or named libvirt domain."
18929 #: ../fish/virt-tar-in.pod:26
18931 "The first parameter is the tar file. Use C<-> to read the tar file from "
18932 "standard input. The second parameter is the absolute target directory to "
18937 #: ../fish/virt-tar-in.pod:34
18940 " virt-tar-in -d MyGuest homes.tar /home\n"
18945 #: ../fish/virt-tar-in.pod:38
18947 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18948 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
18949 "probably better off using guestfish directly."
18953 #: ../fish/virt-tar-in.pod:49
18955 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18956 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
18961 #: ../fish/virt-tar-out.pod:5
18963 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
18967 #: ../fish/virt-tar-out.pod:9
18970 " virt-tar-out -a disk.img /dir files.tar\n"
18975 #: ../fish/virt-tar-out.pod:11
18978 " virt-tar-out -d domain /dir files.tar\n"
18983 #: ../fish/virt-tar-out.pod:13
18986 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
18991 #: ../fish/virt-tar-out.pod:17
18993 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
18997 #: ../fish/virt-tar-out.pod:20
18999 "The first parameter is the absolute path of the virtual machine directory. "
19000 "The second parameter is the tar file to write. Use C<-> to write to "
19005 #: ../fish/virt-tar-out.pod:26
19006 msgid "Download the home directories from a guest:"
19010 #: ../fish/virt-tar-out.pod:28
19013 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
19018 #: ../fish/virt-tar-out.pod:32
19020 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19021 "> C<tar-out> command. For anything more complex than a trivial copy, you "
19022 "are probably better off using guestfish directly."
19026 #: ../fish/virt-tar-out.pod:43
19028 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19029 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
19033 #: ../fuse/guestmount.pod:5
19035 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
19039 #: ../fuse/guestmount.pod:9
19042 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
19047 #: ../fuse/guestmount.pod:11
19050 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
19055 #: ../fuse/guestmount.pod:13
19058 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
19063 #: ../fuse/guestmount.pod:17
19065 "You must I<not> use C<guestmount> in read-write mode on live virtual "
19066 "machines. If you do this, you risk disk corruption in the VM."
19070 #: ../fuse/guestmount.pod:22
19072 "The guestmount program can be used to mount virtual machine filesystems and "
19073 "other disk images on the host. It uses libguestfs for access to the guest "
19074 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
19075 "a mountable device."
19079 #: ../fuse/guestmount.pod:27
19081 "Along with other options, you have to give at least one device (I<-a> "
19082 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
19083 "option) or use the I<-i> inspection option. How this works is better "
19084 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
19089 #: ../fuse/guestmount.pod:33
19091 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
19092 "by you, and the filesystem will not be visible to any other users unless you "
19093 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
19094 "the filesystem, use the C<fusermount -u> command."
19098 #: ../fuse/guestmount.pod:41
19100 "For a typical Windows guest which has its main filesystem on the first "
19105 #: ../fuse/guestmount.pod:44
19108 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
19113 #: ../fuse/guestmount.pod:46
19115 "For a typical Linux guest which has a /boot filesystem on the first "
19116 "partition, and the root filesystem on a logical volume:"
19120 #: ../fuse/guestmount.pod:49
19123 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
19128 #: ../fuse/guestmount.pod:51
19129 msgid "To get libguestfs to detect guest mountpoints for you:"
19133 #: ../fuse/guestmount.pod:53
19136 " guestmount -a guest.img -i --ro /mnt\n"
19141 #: ../fuse/guestmount.pod:55
19142 msgid "For a libvirt guest called \"Guest\" you could do:"
19146 #: ../fuse/guestmount.pod:57
19149 " guestmount -d Guest -i --ro /mnt\n"
19154 #: ../fuse/guestmount.pod:59
19156 "If you don't know what filesystems are contained in a guest or disk image, "
19157 "use L<virt-filesystems(1)> first:"
19161 #: ../fuse/guestmount.pod:62
19164 " virt-filesystems MyGuest\n"
19169 #: ../fuse/guestmount.pod:64
19171 "If you want to trace the libguestfs calls but without excessive debugging "
19172 "information, we recommend:"
19176 #: ../fuse/guestmount.pod:67
19179 " guestmount [...] --trace /mnt\n"
19184 #: ../fuse/guestmount.pod:69
19185 msgid "If you want to debug the program, we recommend:"
19189 #: ../fuse/guestmount.pod:71
19192 " guestmount [...] --trace --verbose /mnt\n"
19197 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
19198 #: ../resize/virt-resize.pod:544
19203 #: ../fuse/guestmount.pod:75
19204 msgid "Other users cannot see the filesystem by default"
19208 #: ../fuse/guestmount.pod:77
19210 "If you mount a filesystem as one user (eg. root), then other users will not "
19211 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
19212 "option when mounting:"
19216 #: ../fuse/guestmount.pod:81
19219 " sudo guestmount [...] -o allow_other /mnt\n"
19224 #: ../fuse/guestmount.pod:91
19225 msgid "Add a block device or virtual machine image."
19229 #: ../fuse/guestmount.pod:114
19230 msgid "B<--dir-cache-timeout N>"
19234 #: ../fuse/guestmount.pod:116
19236 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
19237 "seconds. The readdir cache [actually, there are several semi-independent "
19238 "caches] is populated after a readdir(2) call with the stat and extended "
19239 "attributes of the files in the directory, in anticipation that they will be "
19240 "requested soon after."
19244 #: ../fuse/guestmount.pod:122
19246 "There is also a different attribute cache implemented by FUSE (see the FUSE "
19247 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
19248 "requests, only cache existing ones."
19252 #: ../fuse/guestmount.pod:142
19254 "If you have untrusted raw-format guest disk images, you should use this "
19255 "option to specify the disk format. This avoids a possible security problem "
19256 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
19257 "guestfs_add_drive_opts>."
19261 #: ../fuse/guestmount.pod:147
19262 msgid "B<--fuse-help>"
19266 #: ../fuse/guestmount.pod:149
19267 msgid "Display help on special FUSE options (see I<-o> below)."
19271 #: ../fuse/guestmount.pod:153
19272 msgid "Display brief help and exit."
19276 #: ../fuse/guestmount.pod:177
19278 "Mount the named partition or logical volume on the given mountpoint B<in the "
19279 "guest> (this has nothing to do with mountpoints in the host)."
19283 #: ../fuse/guestmount.pod:180
19285 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
19286 "something on C</>."
19290 #: ../fuse/guestmount.pod:197
19292 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
19293 "unmounted. If you specify this option, then we don't attempt to sync the "
19294 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
19298 #: ../fuse/guestmount.pod:202
19299 msgid "B<-o option>"
19303 #: ../fuse/guestmount.pod:204
19304 msgid "B<--option option>"
19308 #: ../fuse/guestmount.pod:206
19309 msgid "Pass extra options to FUSE."
19313 #: ../fuse/guestmount.pod:208
19315 "To get a list of all the extra options supported by FUSE, use the command "
19316 "below. Note that only the FUSE I<-o> options can be passed, and only some "
19317 "of them are a good idea."
19321 #: ../fuse/guestmount.pod:212
19324 " guestmount --fuse-help\n"
19329 #: ../fuse/guestmount.pod:214
19330 msgid "Some potentially useful FUSE options:"
19334 #: ../fuse/guestmount.pod:218
19335 msgid "B<-o allow_other>"
19339 #: ../fuse/guestmount.pod:220
19340 msgid "Allow other users to see the filesystem."
19344 #: ../fuse/guestmount.pod:222
19345 msgid "B<-o attr_timeout=N>"
19349 #: ../fuse/guestmount.pod:224
19350 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
19354 #: ../fuse/guestmount.pod:226
19355 msgid "B<-o kernel_cache>"
19359 #: ../fuse/guestmount.pod:228
19361 "Allow the kernel to cache files (reduces the number of reads that have to go "
19362 "through the L<guestfs(3)> API). This is generally a good idea if you can "
19363 "afford the extra memory usage."
19367 #: ../fuse/guestmount.pod:232
19368 msgid "B<-o uid=N> B<-o gid=N>"
19372 #: ../fuse/guestmount.pod:234
19374 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
19375 "the chosen values."
19379 #: ../fuse/guestmount.pod:243
19381 "Add devices and mount everything read-only. Also disallow writes and make "
19382 "the disk appear read-only to FUSE."
19386 #: ../fuse/guestmount.pod:246
19388 "This is highly recommended if you are not going to edit the guest disk. If "
19389 "the guest is running and this option is I<not> supplied, then there is a "
19390 "strong risk of disk corruption in the guest. We try to prevent this from "
19391 "happening, but it is not always possible."
19395 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
19396 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19400 #: ../fuse/guestmount.pod:255
19401 msgid "Enable SELinux support for the guest."
19405 #: ../fuse/guestmount.pod:261
19406 msgid "Enable verbose messages from underlying libguestfs."
19410 #: ../fuse/guestmount.pod:267
19411 msgid "Display the program version and exit."
19415 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299
19416 #: ../rescue/virt-rescue.pod:197 ../rescue/virt-rescue.pod:280
19417 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19421 #: ../fuse/guestmount.pod:280
19426 #: ../fuse/guestmount.pod:282
19427 msgid "Trace libguestfs calls and entry into each FUSE function."
19431 #: ../fuse/guestmount.pod:284
19432 msgid "This also stops the daemon from forking into the background."
19436 #: ../fuse/guestmount.pod:310
19438 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
19439 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
19444 #: ../fuse/guestmount.pod:325
19445 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
19449 #: ../inspector/virt-inspector.pod:5
19451 "virt-inspector - Display operating system version and other information "
19452 "about a virtual machine"
19456 #: ../inspector/virt-inspector.pod:9
19459 " virt-inspector [--options] -d domname\n"
19464 #: ../inspector/virt-inspector.pod:11
19467 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
19472 #: ../inspector/virt-inspector.pod:15
19475 " virt-inspector domname\n"
19480 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
19483 " virt-inspector disk.img [disk.img ...]\n"
19488 #: ../inspector/virt-inspector.pod:21
19490 "B<virt-inspector> examines a virtual machine or disk image and tries to "
19491 "determine the version of the operating system and other information about "
19492 "the virtual machine."
19496 #: ../inspector/virt-inspector.pod:25
19497 msgid "Virt-inspector produces XML output for feeding into other programs."
19501 #: ../inspector/virt-inspector.pod:27
19503 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
19504 "the libvirt domain (see: C<virsh list --all>)."
19508 #: ../inspector/virt-inspector.pod:30
19510 "You can also run virt-inspector directly on disk images from a single "
19511 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
19512 "has several block devices, in which case you should list several I<-a> "
19513 "options one after another, with the first corresponding to the guest's C</"
19514 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
19518 #: ../inspector/virt-inspector.pod:37
19520 "You can also run virt-inspector on install disks, live CDs, bootable USB "
19521 "keys and similar."
19525 #: ../inspector/virt-inspector.pod:40
19527 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
19528 "inspect several virtual machines, you have to run virt-inspector several "
19529 "times (for example, from a shell script for-loop)."
19533 #: ../inspector/virt-inspector.pod:45
19535 "Because virt-inspector needs direct access to guest images, it won't "
19536 "normally work over remote libvirt connections."
19540 #: ../inspector/virt-inspector.pod:48
19542 "All of the information available from virt-inspector is also available "
19543 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
19544 "The same information can also be fetched using guestfish or via libguestfs "
19545 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
19546 "WITH OTHER PROGRAMMING LANGUAGES>)."
19550 #: ../inspector/virt-inspector.pod:81
19552 "Libvirt is only used if you specify a C<domname> on the command line. If "
19553 "you specify guest block devices directly (I<-a>), then libvirt is not used "
19558 #: ../inspector/virt-inspector.pod:94
19560 "When prompting for keys and passphrases, virt-inspector normally turns "
19561 "echoing off so you cannot see what you are typing. If you are not worried "
19562 "about Tempest attacks and there is no one else in the room you can specify "
19563 "this flag to see what you are typing."
19567 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
19568 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
19569 #: ../tools/virt-win-reg.pl:144
19571 "Specify the format of disk images given on the command line. If this is "
19572 "omitted then the format is autodetected from the content of the disk image."
19576 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
19577 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
19578 #: ../tools/virt-win-reg.pl:148
19580 "If disk images are requested from libvirt, then this program asks libvirt "
19581 "for this information. In this case, the value of the format parameter is "
19586 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
19587 #: ../resize/virt-resize.pod:406 ../tools/virt-list-filesystems.pl:101
19588 #: ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151
19589 #: ../tools/virt-win-reg.pl:152
19591 "If working with untrusted raw-format guest disk images, you should ensure "
19592 "the format is always specified."
19596 #: ../inspector/virt-inspector.pod:139
19597 msgid "Previous versions of virt-inspector allowed you to write either:"
19601 #: ../inspector/virt-inspector.pod:145
19604 " virt-inspector guestname\n"
19609 #: ../inspector/virt-inspector.pod:153
19614 #: ../inspector/virt-inspector.pod:155
19616 "The virt-inspector XML is described precisely in a RELAX NG schema file "
19617 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
19618 "just an overview."
19622 #: ../inspector/virt-inspector.pod:159
19624 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
19625 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
19626 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
19627 "which is vanishingly rare in real world VMs."
19631 #: ../inspector/virt-inspector.pod:164
19632 msgid "E<lt>operatingsystemE<gt>"
19636 #: ../inspector/virt-inspector.pod:166
19638 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
19639 "describe the operating system, its architecture, the descriptive \"product "
19640 "name\" string, the type of OS and so on, as in this example:"
19644 #: ../inspector/virt-inspector.pod:170
19647 " <operatingsystems>\n"
19648 " <operatingsystem>\n"
19649 " <root>/dev/sda2</root>\n"
19650 " <name>windows</name>\n"
19651 " <arch>i386</arch>\n"
19652 " <distro>windows</distro>\n"
19653 " <product_name>Windows 7 Enterprise</product_name>\n"
19654 " <product_variant>Client</product_variant>\n"
19655 " <major_version>6</major_version>\n"
19656 " <minor_version>1</minor_version>\n"
19657 " <windows_systemroot>/Windows</windows_systemroot>\n"
19658 " <format>installed</format>\n"
19663 #: ../inspector/virt-inspector.pod:183
19665 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
19666 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
19667 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
19668 "architecture. The other fields are fairly self-explanatory, but because "
19669 "these fields are taken directly from the libguestfs inspection API you can "
19670 "find precise information from L<guestfs(3)/INSPECTION>."
19674 #: ../inspector/virt-inspector.pod:191
19676 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
19677 "of view of libguestfs (block devices may have completely different names "
19678 "inside the VM itself)."
19682 #: ../inspector/virt-inspector.pod:195
19683 msgid "E<lt>mountpointsE<gt>"
19687 #: ../inspector/virt-inspector.pod:197
19689 "Un*x-like guests typically have multiple filesystems which are mounted at "
19690 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
19691 "element which looks like this:"
19695 #: ../inspector/virt-inspector.pod:201
19698 " <operatingsystems>\n"
19699 " <operatingsystem>\n"
19702 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19703 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19704 " </mountpoints>\n"
19709 #: ../inspector/virt-inspector.pod:209
19711 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19712 "and may have completely different names inside the guest. Only mountable "
19713 "filesystems appear in this list, not things like swap devices."
19717 #: ../inspector/virt-inspector.pod:214
19718 msgid "E<lt>filesystemsE<gt>"
19722 #: ../inspector/virt-inspector.pod:216
19724 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19725 "filesystems belonging to the guest, including swap and empty partitions. "
19726 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19727 "this OS or shared with this OS and other OSes)."
19731 #: ../inspector/virt-inspector.pod:222
19732 msgid "You might see something like this:"
19736 #: ../inspector/virt-inspector.pod:224
19739 " <operatingsystems>\n"
19740 " <operatingsystem>\n"
19743 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19744 " <type>ext4</type>\n"
19745 " <label>Fedora-13-x86_64</label>\n"
19746 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19752 #: ../inspector/virt-inspector.pod:234
19754 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19755 "the label, and the UUID."
19759 #: ../inspector/virt-inspector.pod:237
19760 msgid "E<lt>applicationsE<gt>"
19764 #: ../inspector/virt-inspector.pod:239
19766 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19767 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19772 #: ../inspector/virt-inspector.pod:243
19774 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19775 "Typical values would be C<rpm> and C<deb>."
19779 #: ../inspector/virt-inspector.pod:246
19781 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19782 "Typical values include C<yum>, C<up2date> and C<apt>"
19786 #: ../inspector/virt-inspector.pod:249
19787 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19791 #: ../inspector/virt-inspector.pod:252
19794 " <operatingsystems>\n"
19795 " <operatingsystem>\n"
19797 " <applications>\n"
19799 " <name>coreutils</name>\n"
19800 " <version>8.5</version>\n"
19801 " <release>1</release>\n"
19802 " </application>\n"
19807 #: ../inspector/virt-inspector.pod:262
19809 "The version and release fields may not be available for some types guests. "
19810 "Other fields are possible, see L<guestfs(3)/"
19811 "guestfs_inspect_list_applications>."
19815 #: ../inspector/virt-inspector.pod:266
19816 msgid "E<lt>drive_mappingsE<gt>"
19820 #: ../inspector/virt-inspector.pod:268
19822 "For operating systems like Windows which use drive letters, virt-inspector "
19823 "is able to find out how drive letters map to filesystems."
19827 #: ../inspector/virt-inspector.pod:272
19830 " <operatingsystems>\n"
19831 " <operatingsystem>\n"
19833 " <drive_mappings>\n"
19834 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19835 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19836 " </drive_mappings>\n"
19841 #: ../inspector/virt-inspector.pod:280
19843 "In the example above, drive C maps to the filesystem on the second partition "
19844 "on the first disk, and drive E maps to the filesystem on the first partition "
19845 "on the second disk."
19849 #: ../inspector/virt-inspector.pod:284
19851 "Note that this only covers permanent local filesystem mappings, not things "
19852 "like network shares. Furthermore NTFS volume mount points may not be listed "
19857 #: ../inspector/virt-inspector.pod:288
19858 msgid "E<lt>iconE<gt>"
19862 #: ../inspector/virt-inspector.pod:290
19864 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19865 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19866 "very large and high quality."
19870 #: ../inspector/virt-inspector.pod:294
19873 " <operatingsystems>\n"
19874 " <operatingsystem>\n"
19877 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19878 " [... many lines of base64 data ...]\n"
19884 #: ../inspector/virt-inspector.pod:302
19886 "To display the icon, you have to extract it and convert the base64 data back "
19887 "to a binary file. Use an XPath query or simply an editor to extract the "
19888 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19893 #: ../inspector/virt-inspector.pod:307
19896 " base64 -i -d < icon.data > icon.png\n"
19901 #: ../inspector/virt-inspector.pod:309
19902 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19906 #: ../inspector/virt-inspector.pod:311
19908 "Virt-inspector can detect some operating system installers on install disks, "
19909 "live CDs, bootable USB keys and more."
19913 #: ../inspector/virt-inspector.pod:314
19915 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19916 "fields may be present to indicate a live CD, network installer, or one part "
19917 "of a multipart CD. For example:"
19921 #: ../inspector/virt-inspector.pod:318
19924 " <operatingsystems>\n"
19925 " <operatingsystem>\n"
19926 " <root>/dev/sda</root>\n"
19927 " <name>linux</name>\n"
19928 " <arch>i386</arch>\n"
19929 " <distro>ubuntu</distro>\n"
19930 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
19931 " <major_version>10</major_version>\n"
19932 " <minor_version>10</minor_version>\n"
19933 " <format>installer</format>\n"
19939 #: ../inspector/virt-inspector.pod:330
19940 msgid "USING XPATH"
19944 #: ../inspector/virt-inspector.pod:332
19946 "You can use the XPath query language to select parts of the XML. We "
19947 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
19951 #: ../inspector/virt-inspector.pod:338
19954 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
19956 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19957 " <type>ext4</type>\n"
19963 #: ../inspector/virt-inspector.pod:344
19966 " $ virt-inspector -d Guest | \\\n"
19967 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
19973 #: ../inspector/virt-inspector.pod:348
19976 " $ virt-inspector -d Guest | \\\n"
19977 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
19978 " [displays the guest icon, if there is one]\n"
19983 #: ../inspector/virt-inspector.pod:359
19984 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
19988 #: ../inspector/virt-inspector.pod:361
19990 "Early versions of libguestfs shipped with a different virt-inspector program "
19991 "written in Perl (the current version is written in C). The XML output of "
19992 "the Perl virt-inspector was different and it could also output in other "
19993 "formats like text."
19997 #: ../inspector/virt-inspector.pod:366
19999 "The old virt-inspector is no longer supported or shipped with libguestfs."
20003 #: ../inspector/virt-inspector.pod:369
20005 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
20006 "versions of virt-inspector with different names:"
20010 #: ../inspector/virt-inspector.pod:372
20013 " virt-inspector Old Perl version.\n"
20014 " virt-inspector2 New C version.\n"
20019 #: ../inspector/virt-inspector.pod:382
20021 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
20022 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
20026 #: ../inspector/virt-inspector.pod:399
20027 msgid "Matthew Booth L<mbooth@redhat.com>"
20031 #: ../java/examples/guestfs-java.pod:5
20032 msgid "guestfs-java - How to use libguestfs from Java"
20036 #: ../java/examples/guestfs-java.pod:9
20039 " import com.redhat.et.libguestfs.*;\n"
20044 #: ../java/examples/guestfs-java.pod:11
20047 " GuestFS g = new GuestFS ();\n"
20048 " g.add_drive_opts (\"disk.img\", null);\n"
20054 #: ../java/examples/guestfs-java.pod:17
20056 "This manual page documents how to call libguestfs from the Java programming "
20057 "language. This page just documents the differences from the C API and gives "
20058 "some examples. If you are not familiar with using libguestfs, you also need "
20059 "to read L<guestfs(3)>."
20063 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
20064 msgid "CLOSING THE HANDLE"
20068 #: ../java/examples/guestfs-java.pod:24
20070 "The handle is closed when it is reaped by the garbage collector. Because "
20071 "libguestfs handles include a lot of state, it is also possible to close (and "
20072 "hence free) them explicitly by calling the C<close> method."
20076 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
20077 #: ../python/examples/guestfs-python.pod:21
20078 #: ../ruby/examples/guestfs-ruby.pod:22
20083 #: ../java/examples/guestfs-java.pod:31
20085 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
20086 "exception. This has a single parameter which is the error message (a "
20091 #: ../java/examples/guestfs-java.pod:35
20092 msgid "Calling any method on a closed handle raises the same exception."
20096 #: ../java/examples/guestfs-java.pod:47
20098 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)"
20099 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20100 "libguestfs.org/>, L<http://caml.inria.fr/>."
20104 #: ../java/examples/guestfs-java.pod:63 ../perl/examples/guestfs-perl.pod:57
20105 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20109 #: ../ocaml/examples/guestfs-ocaml.pod:5
20110 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
20114 #: ../ocaml/examples/guestfs-ocaml.pod:9
20115 msgid "Module style:"
20119 #: ../ocaml/examples/guestfs-ocaml.pod:11
20122 " let g = Guestfs.create () in\n"
20123 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20124 " Guestfs.launch g;\n"
20129 #: ../ocaml/examples/guestfs-ocaml.pod:15
20130 msgid "Object-oriented style:"
20134 #: ../ocaml/examples/guestfs-ocaml.pod:17
20137 " let g = new Guestfs.guestfs () in\n"
20138 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20144 #: ../ocaml/examples/guestfs-ocaml.pod:21
20147 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
20149 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
20154 #: ../ocaml/examples/guestfs-ocaml.pod:27
20156 "This manual page documents how to call libguestfs from the OCaml programming "
20157 "language. This page just documents the differences from the C API and gives "
20158 "some examples. If you are not familiar with using libguestfs, you also need "
20159 "to read L<guestfs(3)>."
20163 #: ../ocaml/examples/guestfs-ocaml.pod:32
20164 msgid "PROGRAMMING STYLES"
20168 #: ../ocaml/examples/guestfs-ocaml.pod:34
20170 "There are two different programming styles supported by the OCaml bindings. "
20171 "You can use a module style, with each C function mapped to an OCaml function:"
20175 #: ../ocaml/examples/guestfs-ocaml.pod:38
20178 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
20183 #: ../ocaml/examples/guestfs-ocaml.pod:40
20188 #: ../ocaml/examples/guestfs-ocaml.pod:42
20191 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
20196 #: ../ocaml/examples/guestfs-ocaml.pod:44
20198 "Alternately you can use an object-oriented style, calling methods on the "
20199 "class C<Guestfs.guestfs>:"
20203 #: ../ocaml/examples/guestfs-ocaml.pod:47
20206 " method set_verbose : bool -> unit\n"
20211 #: ../ocaml/examples/guestfs-ocaml.pod:49
20213 "The object-oriented style is usually briefer, and the minor performance "
20214 "penalty isn't noticable in the general overhead of performing libguestfs "
20219 #: ../ocaml/examples/guestfs-ocaml.pod:55
20221 "The handle is closed when it is reaped by the garbage collector. Because "
20222 "libguestfs handles include a lot of state, it is also possible to close (and "
20223 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
20228 #: ../ocaml/examples/guestfs-ocaml.pod:62
20230 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
20231 "exception. This has a single parameter which is the error message (a "
20236 #: ../ocaml/examples/guestfs-ocaml.pod:66
20238 "Calling any function/method on a closed handle raises C<Guestfs."
20239 "Handle_closed>. The single parameter is the name of the function that you "
20244 #: ../ocaml/examples/guestfs-ocaml.pod:80
20246 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-perl(3)"
20247 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20248 "libguestfs.org/>, L<http://caml.inria.fr/>."
20252 #: ../perl/examples/guestfs-perl.pod:5
20253 msgid "guestfs-perl - How to use libguestfs from Perl"
20257 #: ../perl/examples/guestfs-perl.pod:9
20260 " use Sys::Guestfs;\n"
20265 #: ../perl/examples/guestfs-perl.pod:11
20268 " my $h = Sys::Guestfs->new ();\n"
20269 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
20270 " $h->launch ();\n"
20271 " $h->mount_options ('', '/dev/sda1', '/');\n"
20272 " $h->touch ('/hello');\n"
20278 #: ../perl/examples/guestfs-perl.pod:20
20280 "This manual page documents how to call libguestfs from the Perl programming "
20281 "language. This page just documents the differences from the C API and gives "
20282 "some examples. If you are not familiar with using libguestfs, you also need "
20283 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
20287 #: ../perl/examples/guestfs-perl.pod:26
20292 #: ../perl/examples/guestfs-perl.pod:28
20294 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
20299 #: ../perl/examples/guestfs-perl.pod:41
20301 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)"
20302 ">, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20303 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20307 #: ../python/examples/guestfs-python.pod:5
20308 msgid "guestfs-python - How to use libguestfs from Python"
20312 #: ../python/examples/guestfs-python.pod:9
20315 " import guestfs\n"
20316 " g = guestfs.GuestFS ()\n"
20317 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
20323 #: ../python/examples/guestfs-python.pod:16
20325 "This manual page documents how to call libguestfs from the Python "
20326 "programming language. This page just documents the differences from the C "
20327 "API and gives some examples. If you are not familiar with using libguestfs, "
20328 "you also need to read L<guestfs(3)>."
20332 #: ../python/examples/guestfs-python.pod:23
20334 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
20335 "single string argument which is the error message."
20339 #: ../python/examples/guestfs-python.pod:26
20340 msgid "MORE DOCUMENTATION"
20344 #: ../python/examples/guestfs-python.pod:28
20349 #: ../python/examples/guestfs-python.pod:30
20353 " >>> import guestfs\n"
20354 " >>> help (guestfs)\n"
20359 #: ../python/examples/guestfs-python.pod:44
20361 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
20362 ">, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20363 "libguestfs.org/>."
20367 #: ../rescue/virt-rescue.pod:5
20368 msgid "virt-rescue - Run a rescue shell on a virtual machine"
20372 #: ../rescue/virt-rescue.pod:9
20375 " virt-rescue [--options] -d domname\n"
20380 #: ../rescue/virt-rescue.pod:11
20383 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
20388 #: ../rescue/virt-rescue.pod:15
20391 " virt-rescue [--options] domname\n"
20396 #: ../rescue/virt-rescue.pod:17
20399 " virt-rescue [--options] disk.img [disk.img ...]\n"
20404 #: ../rescue/virt-rescue.pod:21
20406 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
20407 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
20408 "you from doing this, but doesn't catch all cases."
20412 #: ../rescue/virt-rescue.pod:25
20414 "However if you use the I<--ro> (read only) option, then you can attach a "
20415 "shell to a live virtual machine. The results might be strange or "
20416 "inconsistent at times but you won't get disk corruption."
20420 #: ../rescue/virt-rescue.pod:31
20422 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
20423 "need for a CD. virt-rescue gives you a rescue shell and some simple "
20424 "recovery tools which you can use to examine or rescue a virtual machine or "
20429 #: ../rescue/virt-rescue.pod:36
20431 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
20432 "on disk image(s):"
20436 #: ../rescue/virt-rescue.pod:39
20439 " virt-rescue -d GuestName\n"
20444 #: ../rescue/virt-rescue.pod:41
20447 " virt-rescue --ro -a /path/to/disk.img\n"
20452 #: ../rescue/virt-rescue.pod:43
20455 " virt-rescue -a /dev/sdc\n"
20460 #: ../rescue/virt-rescue.pod:45
20461 msgid "For live VMs you I<must> use the --ro option."
20465 #: ../rescue/virt-rescue.pod:47
20467 "When you run virt-rescue on a virtual machine or disk image, you are placed "
20468 "in an interactive bash shell where you can use many ordinary Linux "
20469 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
20470 "appliance. You must mount the virtual machine's filesystems by hand. There "
20471 "is an empty directory called C</sysroot> where you can mount filesystems."
20475 #: ../rescue/virt-rescue.pod:54
20477 "In the example below, we list logical volumes, then choose one to mount "
20478 "under C</sysroot>:"
20482 #: ../rescue/virt-rescue.pod:57
20486 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
20487 " lv_root vg_f11x64 -wi-a- 8.83G\n"
20488 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
20489 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
20490 " ><rescue> ls /sysroot\n"
20495 #: ../rescue/virt-rescue.pod:64
20497 "If you don't know what filesystems are available on the virtual machine then "
20498 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
20502 #: ../rescue/virt-rescue.pod:70
20504 "Virt-rescue can be used on I<any> disk image file or device, not just a "
20505 "virtual machine. For example you can use it on a blank file if you want to "
20506 "partition that file (although we would recommend using L<guestfish(1)> "
20507 "instead as it is more suitable for this purpose). You can even use virt-"
20508 "rescue on things like SD cards."
20512 #: ../rescue/virt-rescue.pod:76
20514 "Virt-rescue does not require root. You only need to run it as root if you "
20515 "need root to open the disk image."
20519 #: ../rescue/virt-rescue.pod:79
20521 "This tool is just designed for quick interactive hacking on a virtual "
20522 "machine. For more structured access to a virtual machine disk image, you "
20523 "should use L<guestfs(3)>. To get a structured shell that you can use to "
20524 "make scripted changes to guests, use L<guestfish(1)>."
20528 #: ../rescue/virt-rescue.pod:103
20529 msgid "B<--append kernelopts>"
20533 #: ../rescue/virt-rescue.pod:105
20534 msgid "Pass additional options to the rescue kernel."
20538 #: ../rescue/virt-rescue.pod:135
20541 " virt-rescue --format=raw -a disk.img\n"
20546 #: ../rescue/virt-rescue.pod:139
20549 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
20554 #: ../rescue/virt-rescue.pod:148
20559 #: ../rescue/virt-rescue.pod:150
20560 msgid "B<--memsize MB>"
20564 #: ../rescue/virt-rescue.pod:152
20566 "Change the amount of memory allocated to the rescue system. The default is "
20567 "set by libguestfs and is small but adequate for running system tools. The "
20568 "occasional program might need more memory. The parameter is specified in "
20573 #: ../rescue/virt-rescue.pod:157
20574 msgid "B<--network>"
20578 #: ../rescue/virt-rescue.pod:159
20579 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
20583 #: ../rescue/virt-rescue.pod:165
20584 msgid "Open the image read-only."
20588 #: ../rescue/virt-rescue.pod:175
20590 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
20591 "SELINUX> before using this option."
20595 #: ../rescue/virt-rescue.pod:194
20597 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
20598 "are done read-write."
20602 #: ../rescue/virt-rescue.pod:207
20603 msgid "Previous versions of virt-rescue allowed you to write either:"
20607 #: ../rescue/virt-rescue.pod:209
20610 " virt-rescue disk.img [disk.img ...]\n"
20615 #: ../rescue/virt-rescue.pod:213
20618 " virt-rescue guestname\n"
20623 #: ../rescue/virt-rescue.pod:221
20628 #: ../rescue/virt-rescue.pod:223
20630 "Adding the I<--network> option enables QEMU user networking in the rescue "
20631 "appliance. There are some differences between user networking and ordinary "
20636 #: ../rescue/virt-rescue.pod:229
20637 msgid "ping does not work"
20641 #: ../rescue/virt-rescue.pod:231
20643 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
20644 "send the ping packets, and because virt-rescue must be able to run as non-"
20645 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
20646 "The ping command will appear to resolve addresses but will not be able to "
20647 "send or receive any packets. This does not mean that the network is not "
20652 #: ../rescue/virt-rescue.pod:238
20653 msgid "cannot receive connections"
20657 #: ../rescue/virt-rescue.pod:240
20658 msgid "QEMU user networking cannot receive incoming connections."
20662 #: ../rescue/virt-rescue.pod:242
20663 msgid "making TCP connections"
20667 #: ../rescue/virt-rescue.pod:244
20669 "The virt-rescue appliance needs to be small and so does not include many "
20670 "network tools. In particular there is no L<telnet(1)> command. You can "
20671 "make TCP connections from the shell using the magical C</dev/tcp/"
20672 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
20676 #: ../rescue/virt-rescue.pod:249
20679 " exec 3<>/dev/tcp/redhat.com/80\n"
20680 " echo \"GET /\" >&3\n"
20686 #: ../rescue/virt-rescue.pod:253
20687 msgid "See L<bash(1)> for more details."
20691 #: ../rescue/virt-rescue.pod:259
20693 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
20694 "ENVIRONMENT VARIABLES> for the complete list."
20698 #: ../rescue/virt-rescue.pod:286
20700 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
20701 "libguestfs.org/>."
20705 #: ../resize/virt-resize.pod:5
20706 msgid "virt-resize - Resize a virtual machine disk"
20710 #: ../resize/virt-resize.pod:9
20713 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20714 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20715 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20720 #: ../resize/virt-resize.pod:15
20722 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20723 "larger or smaller overall, and resizing or deleting any partitions contained "
20728 #: ../resize/virt-resize.pod:19
20730 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20731 "not> be used on live virtual machines - for consistent results, shut the "
20732 "virtual machine down before resizing it."
20736 #: ../resize/virt-resize.pod:23
20738 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20739 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20743 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520
20744 #: ../src/guestfs.pod:469 ../src/guestfs.pod:1257 ../src/guestfs.pod:1396
20745 #: ../src/guestfs.pod:2574
20750 #: ../resize/virt-resize.pod:33
20752 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20753 "fill the extra 5GB of space."
20757 #: ../resize/virt-resize.pod:36
20760 " virt-filesystems --long -h --all -a olddisk\n"
20765 #: ../resize/virt-resize.pod:38
20768 " truncate -r olddisk newdisk\n"
20769 " truncate -s +5G newdisk\n"
20774 #: ../resize/virt-resize.pod:41
20777 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20778 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20783 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527
20784 #: ../src/guestfs.pod:475 ../src/guestfs.pod:1261 ../src/guestfs.pod:1400
20785 #: ../src/guestfs.pod:2599
20790 #: ../resize/virt-resize.pod:46
20792 "As above, but make the /boot partition 200MB bigger, while giving the "
20793 "remaining space to /dev/sda2:"
20797 #: ../resize/virt-resize.pod:49
20800 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20801 " olddisk newdisk\n"
20806 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533
20807 #: ../src/guestfs.pod:486 ../src/guestfs.pod:1406
20812 #: ../resize/virt-resize.pod:54
20814 "As in the first example, but expand a logical volume as the final step. "
20815 "This is what you would typically use for Linux guests that use LVM:"
20819 #: ../resize/virt-resize.pod:58
20822 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20823 " olddisk newdisk\n"
20828 #: ../resize/virt-resize.pod:61
20833 #: ../resize/virt-resize.pod:63
20835 "As in the first example, but the output format will be qcow2 instead of a "
20840 #: ../resize/virt-resize.pod:66
20843 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20844 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20849 #: ../resize/virt-resize.pod:71
20850 msgid "DETAILED USAGE"
20854 #: ../resize/virt-resize.pod:73
20855 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20859 #: ../resize/virt-resize.pod:77
20860 msgid "1. Shut down the virtual machine"
20864 #: ../resize/virt-resize.pod:79
20865 msgid "2. Locate input disk image"
20869 #: ../resize/virt-resize.pod:81
20871 "Locate the input disk image (ie. the file or device on the host containing "
20872 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20873 "dumpxml> like this to find the disk image name:"
20877 #: ../resize/virt-resize.pod:85
20880 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20881 " Found 1 nodes:\n"
20883 " <source dev=\"/dev/vg/lv_guest\" />\n"
20888 #: ../resize/virt-resize.pod:90
20889 msgid "3. Look at current sizing"
20893 #: ../resize/virt-resize.pod:92
20894 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20898 #: ../resize/virt-resize.pod:95
20901 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20902 " Name Type Size Parent\n"
20903 " /dev/sda1 partition 101M /dev/sda\n"
20904 " /dev/sda2 partition 7.9G /dev/sda\n"
20905 " /dev/sda device 8.0G -\n"
20910 #: ../resize/virt-resize.pod:101
20912 "(This example is a virtual machine with an 8 GB disk which we would like to "
20913 "expand up to 10 GB)."
20917 #: ../resize/virt-resize.pod:104
20918 msgid "4. Create output disk"
20922 #: ../resize/virt-resize.pod:106
20924 "Virt-resize cannot do in-place disk modifications. You have to have space "
20925 "to store the resized output disk."
20929 #: ../resize/virt-resize.pod:109
20931 "To store the resized disk image in a file, create a file of a suitable size:"
20935 #: ../resize/virt-resize.pod:112
20938 " # rm -f outdisk\n"
20939 " # truncate -s 10G outdisk\n"
20944 #: ../resize/virt-resize.pod:115
20945 msgid "Or use L<lvcreate(1)> to create a logical volume:"
20949 #: ../resize/virt-resize.pod:117
20952 " # lvcreate -L 10G -n lv_name vg_name\n"
20957 #: ../resize/virt-resize.pod:119
20958 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
20962 #: ../resize/virt-resize.pod:121
20965 " # virsh pool-list\n"
20966 " # virsh vol-create-as poolname newvol 10G\n"
20971 #: ../resize/virt-resize.pod:124
20976 #: ../resize/virt-resize.pod:126
20978 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
20979 "file) and the output disk. The output disk is the one created in the "
20984 #: ../resize/virt-resize.pod:130
20987 " # virt-resize indisk outdisk\n"
20992 #: ../resize/virt-resize.pod:132
20994 "This command just copies disk image C<indisk> to disk image C<outdisk> "
20995 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
20996 "larger, then an extra, empty partition is created at the end of the disk "
20997 "covering the extra space. If C<outdisk> is smaller, then it will give an "
21002 #: ../resize/virt-resize.pod:138
21004 "More realistically you'd want to expand existing partitions in the disk "
21005 "image by passing extra options (for the full list see the L</OPTIONS> "
21010 #: ../resize/virt-resize.pod:142
21012 "L</--expand> is the most useful option. It expands the named partition "
21013 "within the disk to fill any extra space:"
21017 #: ../resize/virt-resize.pod:145
21020 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
21025 #: ../resize/virt-resize.pod:147
21027 "(In this case, an extra partition is I<not> created at the end of the disk, "
21028 "because there will be no unused space)."
21032 #: ../resize/virt-resize.pod:150
21034 "L</--resize> is the other commonly used option. The following would "
21035 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
21036 "rest of the available space:"
21040 #: ../resize/virt-resize.pod:154
21043 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21044 " indisk outdisk\n"
21049 #: ../resize/virt-resize.pod:157
21051 "If the expanded partition in the image contains a filesystem or LVM PV, then "
21052 "if virt-resize knows how, it will resize the contents, the equivalent of "
21053 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
21054 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
21055 "filesystems, so you would have to online resize them after booting the guest."
21059 #: ../resize/virt-resize.pod:164
21060 msgid "Other options are covered below."
21064 #: ../resize/virt-resize.pod:166
21069 #: ../resize/virt-resize.pod:168
21070 msgid "Thoroughly test the new disk image I<before> discarding the old one."
21074 #: ../resize/virt-resize.pod:170
21075 msgid "If you are using libvirt, edit the XML to point at the new disk:"
21079 #: ../resize/virt-resize.pod:172
21082 " # virsh edit guestname\n"
21087 #: ../resize/virt-resize.pod:174
21089 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
21090 "html#elementsDisks>"
21094 #: ../resize/virt-resize.pod:177
21095 msgid "Then start up the domain with the new, resized disk:"
21099 #: ../resize/virt-resize.pod:179
21102 " # virsh start guestname\n"
21107 #: ../resize/virt-resize.pod:181
21109 "and check that it still works. See also the L</NOTES> section below for "
21110 "additional information."
21114 #: ../resize/virt-resize.pod:184
21115 msgid "7. Resize LVs etc inside the guest"
21119 #: ../resize/virt-resize.pod:186
21120 msgid "(This can also be done offline using L<guestfish(1)>)"
21124 #: ../resize/virt-resize.pod:188
21126 "Once the guest has booted you should see the new space available, at least "
21127 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
21128 "may need to resize LVs inside PVs, and also resize filesystem types that "
21129 "virt-resize does not know how to expand."
21133 #: ../resize/virt-resize.pod:195
21134 msgid "SHRINKING A VIRTUAL MACHINE DISK"
21138 #: ../resize/virt-resize.pod:197
21140 "Shrinking is somewhat more complex than expanding, and only an overview is "
21145 #: ../resize/virt-resize.pod:200
21147 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
21148 "filesystems). The user has to shrink content before passing the disk image "
21149 "to virt-resize, and virt-resize will check that the content has been shrunk "
21154 #: ../resize/virt-resize.pod:205
21155 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
21159 #: ../resize/virt-resize.pod:207
21161 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
21162 "steps 3 and 4 above to allocate a new disk image."
21166 #: ../resize/virt-resize.pod:210
21168 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
21172 #: ../resize/virt-resize.pod:213
21173 msgid "IGNORING OR DELETING PARTITIONS"
21177 #: ../resize/virt-resize.pod:215
21179 "virt-resize also gives a convenient way to ignore or delete partitions when "
21180 "copying from the input disk to the output disk. Ignoring a partition speeds "
21181 "up the copy where you don't care about the existing contents of a "
21182 "partition. Deleting a partition removes it completely, but note that it "
21183 "also renumbers any partitions after the one which is deleted, which can "
21184 "leave some guests unbootable."
21188 #: ../resize/virt-resize.pod:222
21189 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
21193 #: ../resize/virt-resize.pod:224
21195 "If the input disk is in qcow2 format, then you may prefer that the output is "
21196 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
21197 "the fly. The output format is simply determined by the format of the empty "
21198 "output container that you provide. Thus to create qcow2 output, use:"
21202 #: ../resize/virt-resize.pod:230
21205 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
21210 #: ../resize/virt-resize.pod:232
21211 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
21215 #: ../resize/virt-resize.pod:234
21216 msgid "Similarly, to get non-sparse raw output use:"
21220 #: ../resize/virt-resize.pod:236
21223 " fallocate -l size outdisk\n"
21228 #: ../resize/virt-resize.pod:238
21230 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
21231 "dev/zero of=outdisk bs=1M count=..>)"
21235 #: ../resize/virt-resize.pod:247
21236 msgid "Display help."
21240 #: ../resize/virt-resize.pod:249
21245 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
21246 #: ../tools/virt-win-reg.pl:120
21251 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
21252 msgid "Enable debugging messages."
21256 #: ../resize/virt-resize.pod:255
21257 msgid "B<--delete part>"
21261 #: ../resize/virt-resize.pod:257
21263 "Delete the named partition. It would be more accurate to describe this as "
21264 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
21265 "the original disk image is left intact."
21269 #: ../resize/virt-resize.pod:261
21271 "Note that when you delete a partition, then anything contained in the "
21272 "partition is also deleted. Furthermore, this causes any partitions that "
21273 "come after to be I<renumbered>, which can easily make your guest unbootable."
21277 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
21278 #: ../resize/virt-resize.pod:454
21279 msgid "You can give this option multiple times."
21283 #: ../resize/virt-resize.pod:268
21284 msgid "B<--expand part>"
21288 #: ../resize/virt-resize.pod:270
21290 "Expand the named partition so it uses up all extra space (space left over "
21291 "after any other resize changes that you request have been done)."
21295 #: ../resize/virt-resize.pod:273
21297 "If virt-resize knows how, it will expand the direct content of the "
21298 "partition. For example, if the partition is an LVM PV, it will expand the "
21299 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
21300 "content it doesn't know about alone."
21304 #: ../resize/virt-resize.pod:278
21305 msgid "Currently virt-resize can resize:"
21309 #: ../resize/virt-resize.pod:284
21310 msgid "ext2, ext3 and ext4 filesystems."
21314 #: ../resize/virt-resize.pod:288
21315 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
21319 #: ../resize/virt-resize.pod:290
21321 "The filesystem must have been shut down consistently last time it was used. "
21322 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
21323 "consistency check, so at the first boot after resizing Windows will check "
21328 #: ../resize/virt-resize.pod:297
21330 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
21331 "inside the PV, but see the I<--LV-expand> option. The user could also "
21332 "resize LVs as desired after boot."
21336 #: ../resize/virt-resize.pod:303
21337 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
21341 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
21342 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
21346 #: ../resize/virt-resize.pod:309 ../tools/virt-list-filesystems.pl:91
21347 #: ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141
21348 #: ../tools/virt-win-reg.pl:142
21349 msgid "B<--format> raw"
21353 #: ../resize/virt-resize.pod:311
21355 "Specify the format of the input disk image. If this flag is not given then "
21356 "it is auto-detected from the image itself."
21360 #: ../resize/virt-resize.pod:317
21362 "Note that this option I<does not> affect the output format. See L</QCOW2 "
21363 "AND NON-SPARSE RAW FORMATS>."
21367 #: ../resize/virt-resize.pod:320
21368 msgid "B<--ignore part>"
21372 #: ../resize/virt-resize.pod:322
21374 "Ignore the named partition. Effectively this means the partition is "
21375 "allocated on the destination disk, but the content is not copied across from "
21376 "the source disk. The content of the partition will be blank (all zero "
21381 #: ../resize/virt-resize.pod:329
21382 msgid "B<--LV-expand logvol>"
21386 #: ../resize/virt-resize.pod:331
21388 "This takes the logical volume and, as a final step, expands it to fill all "
21389 "the space available in its volume group. A typical usage, assuming a Linux "
21390 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
21391 "lv_root> would be:"
21395 #: ../resize/virt-resize.pod:336
21398 " virt-resize indisk outdisk \\\n"
21399 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
21404 #: ../resize/virt-resize.pod:339
21406 "This would first expand the partition (and PV), and then expand the root "
21407 "device to fill the extra space in the PV."
21411 #: ../resize/virt-resize.pod:342
21413 "The contents of the LV are also resized if virt-resize knows how to do "
21414 "that. You can stop virt-resize from trying to expand the content by using "
21415 "the option I<--no-expand-content>."
21419 #: ../resize/virt-resize.pod:346
21420 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
21424 #: ../resize/virt-resize.pod:348
21426 "You can give this option multiple times, I<but> it doesn't make sense to do "
21427 "this unless the logical volumes you specify are all in different volume "
21432 #: ../resize/virt-resize.pod:352
21433 msgid "B<--machine-readable>"
21437 #: ../resize/virt-resize.pod:354
21439 "This option is used to make the output more machine friendly when being "
21440 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
21444 #: ../resize/virt-resize.pod:360
21445 msgid "B<--dryrun>"
21449 #: ../resize/virt-resize.pod:362
21450 msgid "Print a summary of what would be done, but don't do anything."
21454 #: ../resize/virt-resize.pod:364
21455 msgid "B<--no-copy-boot-loader>"
21459 #: ../resize/virt-resize.pod:366
21461 "By default, virt-resize copies over some sectors at the start of the disk "
21462 "(up to the beginning of the first partition). Commonly these sectors "
21463 "contain the Master Boot Record (MBR) and the boot loader, and are required "
21464 "in order for the guest to boot correctly."
21468 #: ../resize/virt-resize.pod:371
21470 "If you specify this flag, then this initial copy is not done. You may need "
21471 "to reinstall the boot loader in this case."
21475 #: ../resize/virt-resize.pod:374
21476 msgid "B<--no-extra-partition>"
21480 #: ../resize/virt-resize.pod:376
21482 "By default, virt-resize creates an extra partition if there is any extra, "
21483 "unused space after all resizing has happened. Use this option to prevent "
21484 "the extra partition from being created. If you do this then the extra space "
21485 "will be inaccessible until you run fdisk, parted, or some other partitioning "
21486 "tool in the guest."
21490 #: ../resize/virt-resize.pod:382
21492 "Note that if the surplus space is smaller than 10 MB, no extra partition "
21497 #: ../resize/virt-resize.pod:385
21498 msgid "B<--no-expand-content>"
21502 #: ../resize/virt-resize.pod:387
21504 "By default, virt-resize will try to expand the direct contents of "
21505 "partitions, if it knows how (see I<--expand> option above)."
21509 #: ../resize/virt-resize.pod:390
21511 "If you give the I<--no-expand-content> option then virt-resize will not "
21516 #: ../resize/virt-resize.pod:393
21517 msgid "B<--ntfsresize-force>"
21521 #: ../resize/virt-resize.pod:395
21523 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
21524 "the NTFS disk is marked as needing a consistency check. You have to use "
21525 "this option if you want to resize a Windows guest multiple times without "
21526 "booting into Windows between each resize."
21530 #: ../resize/virt-resize.pod:401
21531 msgid "B<--output-format> raw"
21535 #: ../resize/virt-resize.pod:403
21537 "Specify the format of the output disk image. If this flag is not given then "
21538 "it is auto-detected from the image itself."
21542 #: ../resize/virt-resize.pod:409
21544 "Note that this option I<does not create> the output format. This option "
21545 "just tells libguestfs what it is so it doesn't try to guess it. You still "
21546 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
21547 "SPARSE RAW FORMATS>."
21551 #: ../resize/virt-resize.pod:414
21556 #: ../resize/virt-resize.pod:416
21561 #: ../resize/virt-resize.pod:418
21562 msgid "Don't print the summary."
21566 #: ../resize/virt-resize.pod:420
21567 msgid "B<--resize part=size>"
21571 #: ../resize/virt-resize.pod:422
21573 "Resize the named partition (expanding or shrinking it) so that it has the "
21578 #: ../resize/virt-resize.pod:425
21580 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
21581 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
21582 "size; or as a relative number or percentage. For example:"
21586 #: ../resize/virt-resize.pod:431
21589 " --resize /dev/sda2=10G\n"
21594 #: ../resize/virt-resize.pod:433
21597 " --resize /dev/sda4=90%\n"
21602 #: ../resize/virt-resize.pod:435
21605 " --resize /dev/sda2=+1G\n"
21610 #: ../resize/virt-resize.pod:437
21613 " --resize /dev/sda2=-200M\n"
21618 #: ../resize/virt-resize.pod:439
21621 " --resize /dev/sda1=+128K\n"
21626 #: ../resize/virt-resize.pod:441
21629 " --resize /dev/sda1=+10%\n"
21634 #: ../resize/virt-resize.pod:443
21637 " --resize /dev/sda1=-10%\n"
21642 #: ../resize/virt-resize.pod:445
21644 "You can increase the size of any partition. Virt-resize will expand the "
21645 "direct content of the partition if it knows how (see I<--expand> below)."
21649 #: ../resize/virt-resize.pod:449
21651 "You can only I<decrease> the size of partitions that contain filesystems or "
21652 "PVs which have already been shrunk. Virt-resize will check this has been "
21653 "done before proceeding, or else will print an error (see also I<--resize-"
21658 #: ../resize/virt-resize.pod:456
21659 msgid "B<--resize-force part=size>"
21663 #: ../resize/virt-resize.pod:458
21665 "This is the same as I<--resize> except that it will let you decrease the "
21666 "size of any partition. Generally this means you will lose any data which "
21667 "was at the end of the partition you shrink, but you may not care about that "
21668 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
21669 "as a swap partition)."
21673 #: ../resize/virt-resize.pod:464
21674 msgid "See also the I<--ignore> option."
21678 #: ../resize/virt-resize.pod:466
21679 msgid "B<--shrink part>"
21683 #: ../resize/virt-resize.pod:468
21685 "Shrink the named partition until the overall disk image fits in the "
21686 "destination. The named partition B<must> contain a filesystem or PV which "
21687 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
21688 "online tools). Virt-resize will check this and give an error if it has not "
21693 #: ../resize/virt-resize.pod:474
21695 "The amount by which the overall disk must be shrunk (after carrying out all "
21696 "other operations requested by the user) is called the \"deficit\". For "
21697 "example, a straight copy (assume no other operations) from a 5GB disk image "
21698 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
21699 "would give an error unless the user specified a partition to shrink and that "
21700 "partition had more than a gigabyte of free space."
21704 #: ../resize/virt-resize.pod:492
21705 msgid "MACHINE READABLE OUTPUT"
21709 #: ../resize/virt-resize.pod:494
21711 "The I<--machine-readable> option can be used to make the output more machine "
21712 "friendly, which is useful when calling virt-resize from other programs, GUIs "
21717 #: ../resize/virt-resize.pod:498
21718 msgid "There are two ways to use this option."
21722 #: ../resize/virt-resize.pod:500
21724 "Firstly use the option on its own to query the capabilities of the virt-"
21725 "resize binary. Typical output looks like this:"
21729 #: ../resize/virt-resize.pod:503
21732 " $ virt-resize --machine-readable\n"
21734 " ntfsresize-force\n"
21742 #: ../resize/virt-resize.pod:510
21744 "A list of features is printed, one per line, and the program exits with "
21749 #: ../resize/virt-resize.pod:513
21751 "Secondly use the option in conjunction with other options to make the "
21752 "regular program output more machine friendly."
21756 #: ../resize/virt-resize.pod:516
21757 msgid "At the moment this means:"
21761 #: ../resize/virt-resize.pod:522
21763 "Progress bar messages can be parsed from stdout by looking for this regular "
21768 #: ../resize/virt-resize.pod:525
21771 " ^[0-9]+/[0-9]+$\n"
21776 #: ../resize/virt-resize.pod:529
21778 "The calling program should treat messages sent to stdout (except for "
21779 "progress bar messages) as status messages. They can be logged and/or "
21780 "displayed to the user."
21784 #: ../resize/virt-resize.pod:535
21786 "The calling program should treat messages sent to stderr as error messages. "
21787 "In addition, virt-resize exits with a non-zero status code if there was a "
21792 #: ../resize/virt-resize.pod:541
21794 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
21795 "readable> option and will return an error."
21799 #: ../resize/virt-resize.pod:546
21800 msgid "\"Partition 1 does not end on cylinder boundary.\""
21804 #: ../resize/virt-resize.pod:548
21806 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
21807 "means the partitions will not be aligned to the ancient CHS geometry. "
21808 "However CHS geometry is meaningless for disks manufactured since the early "
21809 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
21810 "cylinders is not required by any modern operating system."
21814 #: ../resize/virt-resize.pod:555
21815 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
21819 #: ../resize/virt-resize.pod:557
21821 "In Windows Vista and later versions, Microsoft switched to using a separate "
21822 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
21823 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
21824 "the boot partition. Doing so seems to break the guest completely. However "
21825 "expanding the second partition (ie. C: drive) should work."
21829 #: ../resize/virt-resize.pod:564
21831 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21832 "NTFS partitions have been expanded. This is just a safety check and (unless "
21833 "it find errors) is nothing to worry about."
21837 #: ../resize/virt-resize.pod:568
21838 msgid "GUEST BOOT STUCK AT \"GRUB\""
21842 #: ../resize/virt-resize.pod:570
21844 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21845 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21846 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21847 "although we think is to do with partition alignment."
21851 #: ../resize/virt-resize.pod:575
21854 " guestfish -i -a newdisk\n"
21855 " ><fs> cat /boot/grub/device.map\n"
21856 " # check the contents of this file are sensible or\n"
21857 " # edit the file if necessary\n"
21858 " ><fs> grub-install / /dev/vda\n"
21864 #: ../resize/virt-resize.pod:582
21866 "For more flexible guest reconfiguration, including if you need to specify "
21867 "other parameters to grub-install, use L<virt-rescue(1)>."
21871 #: ../resize/virt-resize.pod:585
21872 msgid "ALTERNATIVE TOOLS"
21876 #: ../resize/virt-resize.pod:587
21878 "There are several proprietary tools for resizing partitions. We won't "
21879 "mention any here."
21883 #: ../resize/virt-resize.pod:590
21885 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21886 "operations on disk images. They can resize and move partitions, but I don't "
21887 "think they can do anything with the contents, and they certainly don't "
21892 #: ../resize/virt-resize.pod:595
21894 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21895 "but at a much lower level. You will probably end up hand-calculating sector "
21896 "offsets, which is something that virt-resize was designed to avoid. If you "
21897 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21902 #: ../resize/virt-resize.pod:615
21904 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
21905 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
21906 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
21907 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<http://libguestfs.org/>."
21911 #: ../ruby/examples/guestfs-ruby.pod:5
21912 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21916 #: ../ruby/examples/guestfs-ruby.pod:9
21919 " require 'guestfs'\n"
21920 " g = Guestfs::Guestfs.new()\n"
21921 " g.add_drive_opts(\"disk.img\",\n"
21922 " :readonly => 1, :format => \"raw\")\n"
21928 #: ../ruby/examples/guestfs-ruby.pod:17
21930 "This manual page documents how to call libguestfs from the Ruby programming "
21931 "language. This page just documents the differences from the C API and gives "
21932 "some examples. If you are not familiar with using libguestfs, you also need "
21933 "to read L<guestfs(3)>."
21937 #: ../ruby/examples/guestfs-ruby.pod:24
21939 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21940 "This has a single parameter which is the error message (a string)."
21944 #: ../ruby/examples/guestfs-ruby.pod:38
21946 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
21947 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://"
21948 "libguestfs.org/>."
21952 #: ../src/guestfs-actions.pod:1
21953 msgid "guestfs_add_cdrom"
21957 #: ../src/guestfs-actions.pod:3
21961 " guestfs_add_cdrom (guestfs_h *g,\n"
21962 " const char *filename);\n"
21967 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249
21968 #: ../src/guestfs-actions.pod:270
21970 "I<This function is deprecated.> In new code, use the L</"
21971 "guestfs_add_drive_opts> call instead."
21975 #: ../src/guestfs-actions.pod:24
21977 "This call checks for the existence of C<filename>. This stops you from "
21978 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21979 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21984 #: ../src/guestfs-actions.pod:31
21986 "If you just want to add an ISO file (often you use this as an efficient way "
21987 "to transfer large files into the guest), then you should probably use "
21988 "C<guestfs_add_drive_ro> instead."
21992 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
21993 #: ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238
21994 #: ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280
21995 #: ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307
21996 #: ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447
21997 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506
21998 #: ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552
21999 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652
22000 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681
22001 #: ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798
22002 #: ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826
22003 #: ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046
22004 #: ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084
22005 #: ../src/guestfs-actions.pod:1168 ../src/guestfs-actions.pod:1186
22006 #: ../src/guestfs-actions.pod:1205 ../src/guestfs-actions.pod:1219
22007 #: ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1309
22008 #: ../src/guestfs-actions.pod:1340 ../src/guestfs-actions.pod:1365
22009 #: ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1520
22010 #: ../src/guestfs-actions.pod:1547 ../src/guestfs-actions.pod:1762
22011 #: ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1871
22012 #: ../src/guestfs-actions.pod:2346 ../src/guestfs-actions.pod:2490
22013 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2586
22014 #: ../src/guestfs-actions.pod:3626 ../src/guestfs-actions.pod:3641
22015 #: ../src/guestfs-actions.pod:3666 ../src/guestfs-actions.pod:3855
22016 #: ../src/guestfs-actions.pod:3869 ../src/guestfs-actions.pod:3882
22017 #: ../src/guestfs-actions.pod:3896 ../src/guestfs-actions.pod:3911
22018 #: ../src/guestfs-actions.pod:3947 ../src/guestfs-actions.pod:4019
22019 #: ../src/guestfs-actions.pod:4039 ../src/guestfs-actions.pod:4056
22020 #: ../src/guestfs-actions.pod:4079 ../src/guestfs-actions.pod:4102
22021 #: ../src/guestfs-actions.pod:4137 ../src/guestfs-actions.pod:4156
22022 #: ../src/guestfs-actions.pod:4175 ../src/guestfs-actions.pod:4210
22023 #: ../src/guestfs-actions.pod:4222 ../src/guestfs-actions.pod:4258
22024 #: ../src/guestfs-actions.pod:4274 ../src/guestfs-actions.pod:4287
22025 #: ../src/guestfs-actions.pod:4302 ../src/guestfs-actions.pod:4319
22026 #: ../src/guestfs-actions.pod:4412 ../src/guestfs-actions.pod:4432
22027 #: ../src/guestfs-actions.pod:4445 ../src/guestfs-actions.pod:4496
22028 #: ../src/guestfs-actions.pod:4514 ../src/guestfs-actions.pod:4532
22029 #: ../src/guestfs-actions.pod:4548 ../src/guestfs-actions.pod:4562
22030 #: ../src/guestfs-actions.pod:4576 ../src/guestfs-actions.pod:4593
22031 #: ../src/guestfs-actions.pod:4608 ../src/guestfs-actions.pod:4635
22032 #: ../src/guestfs-actions.pod:4698 ../src/guestfs-actions.pod:4771
22033 #: ../src/guestfs-actions.pod:4802 ../src/guestfs-actions.pod:4821
22034 #: ../src/guestfs-actions.pod:4840 ../src/guestfs-actions.pod:4852
22035 #: ../src/guestfs-actions.pod:4869 ../src/guestfs-actions.pod:4882
22036 #: ../src/guestfs-actions.pod:4897 ../src/guestfs-actions.pod:4912
22037 #: ../src/guestfs-actions.pod:4954 ../src/guestfs-actions.pod:4980
22038 #: ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5039
22039 #: ../src/guestfs-actions.pod:5053 ../src/guestfs-actions.pod:5070
22040 #: ../src/guestfs-actions.pod:5119 ../src/guestfs-actions.pod:5172
22041 #: ../src/guestfs-actions.pod:5219 ../src/guestfs-actions.pod:5262
22042 #: ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5307
22043 #: ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5465
22044 #: ../src/guestfs-actions.pod:5522 ../src/guestfs-actions.pod:5544
22045 #: ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:5594
22046 #: ../src/guestfs-actions.pod:5660 ../src/guestfs-actions.pod:5677
22047 #: ../src/guestfs-actions.pod:5690 ../src/guestfs-actions.pod:5704
22048 #: ../src/guestfs-actions.pod:5993 ../src/guestfs-actions.pod:6012
22049 #: ../src/guestfs-actions.pod:6031 ../src/guestfs-actions.pod:6045
22050 #: ../src/guestfs-actions.pod:6057 ../src/guestfs-actions.pod:6071
22051 #: ../src/guestfs-actions.pod:6083 ../src/guestfs-actions.pod:6097
22052 #: ../src/guestfs-actions.pod:6113 ../src/guestfs-actions.pod:6134
22053 #: ../src/guestfs-actions.pod:6153 ../src/guestfs-actions.pod:6172
22054 #: ../src/guestfs-actions.pod:6202 ../src/guestfs-actions.pod:6220
22055 #: ../src/guestfs-actions.pod:6243 ../src/guestfs-actions.pod:6261
22056 #: ../src/guestfs-actions.pod:6280 ../src/guestfs-actions.pod:6301
22057 #: ../src/guestfs-actions.pod:6320 ../src/guestfs-actions.pod:6337
22058 #: ../src/guestfs-actions.pod:6356 ../src/guestfs-actions.pod:6384
22059 #: ../src/guestfs-actions.pod:6408 ../src/guestfs-actions.pod:6427
22060 #: ../src/guestfs-actions.pod:6451 ../src/guestfs-actions.pod:6470
22061 #: ../src/guestfs-actions.pod:6485 ../src/guestfs-actions.pod:6504
22062 #: ../src/guestfs-actions.pod:6548 ../src/guestfs-actions.pod:6578
22063 #: ../src/guestfs-actions.pod:6611 ../src/guestfs-actions.pod:6726
22064 #: ../src/guestfs-actions.pod:6847 ../src/guestfs-actions.pod:6859
22065 #: ../src/guestfs-actions.pod:6872 ../src/guestfs-actions.pod:6885
22066 #: ../src/guestfs-actions.pod:6907 ../src/guestfs-actions.pod:6920
22067 #: ../src/guestfs-actions.pod:6933 ../src/guestfs-actions.pod:6946
22068 #: ../src/guestfs-actions.pod:6961 ../src/guestfs-actions.pod:7020
22069 #: ../src/guestfs-actions.pod:7037 ../src/guestfs-actions.pod:7053
22070 #: ../src/guestfs-actions.pod:7069 ../src/guestfs-actions.pod:7086
22071 #: ../src/guestfs-actions.pod:7099 ../src/guestfs-actions.pod:7119
22072 #: ../src/guestfs-actions.pod:7155 ../src/guestfs-actions.pod:7169
22073 #: ../src/guestfs-actions.pod:7210 ../src/guestfs-actions.pod:7223
22074 #: ../src/guestfs-actions.pod:7241 ../src/guestfs-actions.pod:7275
22075 #: ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7427
22076 #: ../src/guestfs-actions.pod:7442 ../src/guestfs-actions.pod:7456
22077 #: ../src/guestfs-actions.pod:7511 ../src/guestfs-actions.pod:7524
22078 #: ../src/guestfs-actions.pod:7569 ../src/guestfs-actions.pod:7609
22079 #: ../src/guestfs-actions.pod:7665 ../src/guestfs-actions.pod:7685
22080 #: ../src/guestfs-actions.pod:7718 ../src/guestfs-actions.pod:7782
22081 #: ../src/guestfs-actions.pod:7805 ../src/guestfs-actions.pod:7834
22082 msgid "This function returns 0 on success or -1 on error."
22086 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
22087 #: ../src/guestfs-actions.pod:1170 ../src/guestfs-actions.pod:1985
22088 #: ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2197
22089 #: ../src/guestfs-actions.pod:3628 ../src/guestfs-actions.pod:3648
22090 #: ../src/guestfs-actions.pod:4956 ../src/guestfs-actions.pod:6222
22091 #: ../src/guestfs-actions.pod:6339 ../src/guestfs-actions.pod:6472
22092 #: ../src/guestfs-actions.pod:6963 ../src/guestfs-actions.pod:7088
22093 #: ../src/guestfs-actions.pod:7611
22094 msgid "(Added in 0.3)"
22098 #: ../src/guestfs-actions.pod:41
22099 msgid "guestfs_add_domain"
22103 #: ../src/guestfs-actions.pod:43
22107 " guestfs_add_domain (guestfs_h *g,\n"
22108 " const char *dom,\n"
22114 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
22115 #: ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:2831
22116 #: ../src/guestfs-actions.pod:4647 ../src/guestfs-actions.pod:4966
22117 #: ../src/guestfs-actions.pod:5183
22119 "You may supply a list of optional arguments to this call. Use zero or more "
22120 "of the following pairs of parameters, and terminate the list with C<-1> on "
22121 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
22125 #: ../src/guestfs-actions.pod:53
22128 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
22129 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
22130 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
22131 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
22132 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
22137 #: ../src/guestfs-actions.pod:59
22139 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
22140 "It works by connecting to libvirt, requesting the domain and domain XML from "
22141 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
22146 #: ../src/guestfs-actions.pod:94
22148 "The other optional parameters are passed directly through to "
22149 "C<guestfs_add_drive_opts>."
22153 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350
22154 #: ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698
22155 #: ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747
22156 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1385
22157 #: ../src/guestfs-actions.pod:1741 ../src/guestfs-actions.pod:1944
22158 #: ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2106
22159 #: ../src/guestfs-actions.pod:2161 ../src/guestfs-actions.pod:2184
22160 #: ../src/guestfs-actions.pod:2477 ../src/guestfs-actions.pod:2949
22161 #: ../src/guestfs-actions.pod:2967 ../src/guestfs-actions.pod:5142
22162 #: ../src/guestfs-actions.pod:5362 ../src/guestfs-actions.pod:5774
22163 #: ../src/guestfs-actions.pod:5800 ../src/guestfs-actions.pod:7196
22164 #: ../src/guestfs-actions.pod:7622 ../src/guestfs-actions.pod:7635
22165 #: ../src/guestfs-actions.pod:7648
22166 msgid "On error this function returns -1."
22170 #: ../src/guestfs-actions.pod:99
22171 msgid "(Added in 1.7.4)"
22175 #: ../src/guestfs-actions.pod:101
22176 msgid "guestfs_add_domain_va"
22180 #: ../src/guestfs-actions.pod:103
22184 " guestfs_add_domain_va (guestfs_h *g,\n"
22185 " const char *dom,\n"
22186 " va_list args);\n"
22191 #: ../src/guestfs-actions.pod:108
22192 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
22196 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
22197 #: ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225
22198 #: ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887
22199 #: ../src/guestfs-actions.pod:2915 ../src/guestfs-actions.pod:2927
22200 #: ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4724
22201 #: ../src/guestfs-actions.pod:4994 ../src/guestfs-actions.pod:5006
22202 #: ../src/guestfs-actions.pod:5232 ../src/guestfs-actions.pod:5243
22203 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
22207 #: ../src/guestfs-actions.pod:112
22208 msgid "guestfs_add_domain_argv"
22212 #: ../src/guestfs-actions.pod:114
22216 " guestfs_add_domain_argv (guestfs_h *g,\n"
22217 " const char *dom,\n"
22218 " const struct guestfs_add_domain_argv *optargs);\n"
22223 #: ../src/guestfs-actions.pod:119
22224 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
22228 #: ../src/guestfs-actions.pod:123
22229 msgid "guestfs_add_drive"
22233 #: ../src/guestfs-actions.pod:125
22237 " guestfs_add_drive (guestfs_h *g,\n"
22238 " const char *filename);\n"
22243 #: ../src/guestfs-actions.pod:129
22245 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
22246 "optional parameters, so the disk is added writable, with the format being "
22247 "detected automatically."
22251 #: ../src/guestfs-actions.pod:133
22253 "Automatic detection of the format opens you up to a potential security hole "
22254 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
22255 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
22256 "you should think about replacing calls to this function with calls to "
22257 "C<guestfs_add_drive_opts>, and specifying the format."
22261 #: ../src/guestfs-actions.pod:144
22262 msgid "guestfs_add_drive_opts"
22266 #: ../src/guestfs-actions.pod:146
22270 " guestfs_add_drive_opts (guestfs_h *g,\n"
22271 " const char *filename,\n"
22277 #: ../src/guestfs-actions.pod:156
22280 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
22281 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
22282 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
22287 #: ../src/guestfs-actions.pod:185
22289 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
22290 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
22291 "Possible formats include C<raw> and C<qcow2>."
22295 #: ../src/guestfs-actions.pod:196
22297 "This rarely-used option lets you emulate the behaviour of the deprecated "
22298 "C<guestfs_add_drive_with_if> call (q.v.)"
22302 #: ../src/guestfs-actions.pod:203
22303 msgid "(Added in 1.5.23)"
22307 #: ../src/guestfs-actions.pod:205
22308 msgid "guestfs_add_drive_opts_va"
22312 #: ../src/guestfs-actions.pod:207
22316 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
22317 " const char *filename,\n"
22318 " va_list args);\n"
22323 #: ../src/guestfs-actions.pod:212
22324 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
22328 #: ../src/guestfs-actions.pod:216
22329 msgid "guestfs_add_drive_opts_argv"
22333 #: ../src/guestfs-actions.pod:218
22337 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
22338 " const char *filename,\n"
22339 " const struct guestfs_add_drive_opts_argv *optargs);\n"
22344 #: ../src/guestfs-actions.pod:223
22345 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
22349 #: ../src/guestfs-actions.pod:227
22350 msgid "guestfs_add_drive_ro"
22354 #: ../src/guestfs-actions.pod:229
22358 " guestfs_add_drive_ro (guestfs_h *g,\n"
22359 " const char *filename);\n"
22364 #: ../src/guestfs-actions.pod:233
22366 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
22367 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
22368 "disk is added read-only, with the format being detected automatically."
22372 #: ../src/guestfs-actions.pod:240
22373 msgid "(Added in 1.0.38)"
22377 #: ../src/guestfs-actions.pod:242
22378 msgid "guestfs_add_drive_ro_with_if"
22382 #: ../src/guestfs-actions.pod:244
22386 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
22387 " const char *filename,\n"
22388 " const char *iface);\n"
22393 #: ../src/guestfs-actions.pod:256
22395 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
22396 "QEMU interface emulation to use at run time."
22400 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282
22401 #: ../src/guestfs-actions.pod:2436
22402 msgid "(Added in 1.0.84)"
22406 #: ../src/guestfs-actions.pod:263
22407 msgid "guestfs_add_drive_with_if"
22411 #: ../src/guestfs-actions.pod:265
22415 " guestfs_add_drive_with_if (guestfs_h *g,\n"
22416 " const char *filename,\n"
22417 " const char *iface);\n"
22422 #: ../src/guestfs-actions.pod:277
22424 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
22425 "QEMU interface emulation to use at run time."
22429 #: ../src/guestfs-actions.pod:284
22430 msgid "guestfs_aug_clear"
22434 #: ../src/guestfs-actions.pod:286
22438 " guestfs_aug_clear (guestfs_h *g,\n"
22439 " const char *augpath);\n"
22444 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2186
22445 msgid "(Added in 1.3.4)"
22449 #: ../src/guestfs-actions.pod:297
22450 msgid "guestfs_aug_close"
22454 #: ../src/guestfs-actions.pod:299
22458 " guestfs_aug_close (guestfs_h *g);\n"
22463 #: ../src/guestfs-actions.pod:302
22465 "Close the current Augeas handle and free up any resources used by it. After "
22466 "calling this, you have to call C<guestfs_aug_init> again before you can use "
22467 "any other Augeas functions."
22471 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334
22472 #: ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366
22473 #: ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449
22474 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494
22475 #: ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522
22476 #: ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554
22477 #: ../src/guestfs-actions.pod:5851
22478 msgid "(Added in 0.7)"
22482 #: ../src/guestfs-actions.pod:311
22483 msgid "guestfs_aug_defnode"
22487 #: ../src/guestfs-actions.pod:313
22490 " struct guestfs_int_bool *\n"
22491 " guestfs_aug_defnode (guestfs_h *g,\n"
22492 " const char *name,\n"
22493 " const char *expr,\n"
22494 " const char *val);\n"
22499 #: ../src/guestfs-actions.pod:322
22501 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
22502 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
22503 "containing that single node."
22507 #: ../src/guestfs-actions.pod:330
22509 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
22510 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
22514 #: ../src/guestfs-actions.pod:336
22515 msgid "guestfs_aug_defvar"
22519 #: ../src/guestfs-actions.pod:338
22523 " guestfs_aug_defvar (guestfs_h *g,\n"
22524 " const char *name,\n"
22525 " const char *expr);\n"
22530 #: ../src/guestfs-actions.pod:354
22531 msgid "guestfs_aug_get"
22535 #: ../src/guestfs-actions.pod:356
22539 " guestfs_aug_get (guestfs_h *g,\n"
22540 " const char *augpath);\n"
22545 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927
22546 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005
22547 #: ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124
22548 #: ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1271
22549 #: ../src/guestfs-actions.pod:1290 ../src/guestfs-actions.pod:1424
22550 #: ../src/guestfs-actions.pod:1612 ../src/guestfs-actions.pod:1724
22551 #: ../src/guestfs-actions.pod:1887 ../src/guestfs-actions.pod:1904
22552 #: ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:2014
22553 #: ../src/guestfs-actions.pod:2035 ../src/guestfs-actions.pod:2209
22554 #: ../src/guestfs-actions.pod:2401 ../src/guestfs-actions.pod:2605
22555 #: ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:2799
22556 #: ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:3032
22557 #: ../src/guestfs-actions.pod:3060 ../src/guestfs-actions.pod:3081
22558 #: ../src/guestfs-actions.pod:3115 ../src/guestfs-actions.pod:3174
22559 #: ../src/guestfs-actions.pod:3194 ../src/guestfs-actions.pod:3214
22560 #: ../src/guestfs-actions.pod:3841 ../src/guestfs-actions.pod:4194
22561 #: ../src/guestfs-actions.pod:4364 ../src/guestfs-actions.pod:4474
22562 #: ../src/guestfs-actions.pod:5380 ../src/guestfs-actions.pod:5579
22563 #: ../src/guestfs-actions.pod:5749 ../src/guestfs-actions.pod:5927
22564 #: ../src/guestfs-actions.pod:5976 ../src/guestfs-actions.pod:6632
22565 #: ../src/guestfs-actions.pod:6648 ../src/guestfs-actions.pod:6672
22566 #: ../src/guestfs-actions.pod:6696 ../src/guestfs-actions.pod:7370
22567 #: ../src/guestfs-actions.pod:7389 ../src/guestfs-actions.pod:7407
22568 #: ../src/guestfs-actions.pod:7581 ../src/guestfs-actions.pod:7898
22570 "This function returns a string, or NULL on error. I<The caller must free "
22571 "the returned string after use>."
22575 #: ../src/guestfs-actions.pod:368
22576 msgid "guestfs_aug_init"
22580 #: ../src/guestfs-actions.pod:370
22584 " guestfs_aug_init (guestfs_h *g,\n"
22585 " const char *root,\n"
22591 #: ../src/guestfs-actions.pod:379
22592 msgid "You must call this before using any other C<guestfs_aug_*> commands."
22596 #: ../src/guestfs-actions.pod:404
22598 "This option is only useful when debugging Augeas lenses. Use of this option "
22599 "may require additional memory for the libguestfs appliance. You may need to "
22600 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
22601 "C<guestfs_set_memsize>."
22605 #: ../src/guestfs-actions.pod:419
22606 msgid "Do not load the tree in C<guestfs_aug_init>."
22610 #: ../src/guestfs-actions.pod:423
22611 msgid "To close the handle, you can call C<guestfs_aug_close>."
22615 #: ../src/guestfs-actions.pod:431
22616 msgid "guestfs_aug_insert"
22620 #: ../src/guestfs-actions.pod:433
22624 " guestfs_aug_insert (guestfs_h *g,\n"
22625 " const char *augpath,\n"
22626 " const char *label,\n"
22632 #: ../src/guestfs-actions.pod:451
22633 msgid "guestfs_aug_load"
22637 #: ../src/guestfs-actions.pod:453
22641 " guestfs_aug_load (guestfs_h *g);\n"
22646 #: ../src/guestfs-actions.pod:465
22647 msgid "guestfs_aug_ls"
22651 #: ../src/guestfs-actions.pod:467
22655 " guestfs_aug_ls (guestfs_h *g,\n"
22656 " const char *augpath);\n"
22661 #: ../src/guestfs-actions.pod:471
22663 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
22664 "sorting the resulting nodes into alphabetical order."
22668 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490
22669 #: ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143
22670 #: ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1458
22671 #: ../src/guestfs-actions.pod:1561 ../src/guestfs-actions.pod:1580
22672 #: ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:2281
22673 #: ../src/guestfs-actions.pod:2297 ../src/guestfs-actions.pod:2316
22674 #: ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2383
22675 #: ../src/guestfs-actions.pod:2454 ../src/guestfs-actions.pod:2503
22676 #: ../src/guestfs-actions.pod:2760 ../src/guestfs-actions.pod:3134
22677 #: ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3724
22678 #: ../src/guestfs-actions.pod:3741 ../src/guestfs-actions.pod:3761
22679 #: ../src/guestfs-actions.pod:3823 ../src/guestfs-actions.pod:3928
22680 #: ../src/guestfs-actions.pod:4336 ../src/guestfs-actions.pod:5103
22681 #: ../src/guestfs-actions.pod:5721 ../src/guestfs-actions.pod:5847
22682 #: ../src/guestfs-actions.pod:5961 ../src/guestfs-actions.pod:6712
22683 #: ../src/guestfs-actions.pod:6773 ../src/guestfs-actions.pod:6828
22684 #: ../src/guestfs-actions.pod:6974 ../src/guestfs-actions.pod:6998
22685 #: ../src/guestfs-actions.pod:7474 ../src/guestfs-actions.pod:7494
22686 #: ../src/guestfs-actions.pod:7541 ../src/guestfs-actions.pod:7735
22687 #: ../src/guestfs-actions.pod:7754 ../src/guestfs-actions.pod:7848
22688 #: ../src/guestfs-actions.pod:7867 ../src/guestfs-actions.pod:7913
22689 #: ../src/guestfs-actions.pod:7932
22691 "This function returns a NULL-terminated array of strings (like L<environ(3)"
22692 ">), or NULL if there was an error. I<The caller must free the strings and "
22693 "the array after use>."
22697 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068
22698 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1496
22699 #: ../src/guestfs-actions.pod:3488 ../src/guestfs-actions.pod:3519
22700 #: ../src/guestfs-actions.pod:4177 ../src/guestfs-actions.pod:4227
22701 #: ../src/guestfs-actions.pod:4414 ../src/guestfs-actions.pod:4447
22702 #: ../src/guestfs-actions.pod:4610 ../src/guestfs-actions.pod:5107
22703 #: ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:6059
22704 #: ../src/guestfs-actions.pod:6073 ../src/guestfs-actions.pod:6085
22705 #: ../src/guestfs-actions.pod:6553 ../src/guestfs-actions.pod:7212
22706 #: ../src/guestfs-actions.pod:7225 ../src/guestfs-actions.pod:7458
22707 #: ../src/guestfs-actions.pod:7723
22708 msgid "(Added in 0.8)"
22712 #: ../src/guestfs-actions.pod:480
22713 msgid "guestfs_aug_match"
22717 #: ../src/guestfs-actions.pod:482
22721 " guestfs_aug_match (guestfs_h *g,\n"
22722 " const char *augpath);\n"
22727 #: ../src/guestfs-actions.pod:496
22728 msgid "guestfs_aug_mv"
22732 #: ../src/guestfs-actions.pod:498
22736 " guestfs_aug_mv (guestfs_h *g,\n"
22737 " const char *src,\n"
22738 " const char *dest);\n"
22743 #: ../src/guestfs-actions.pod:510
22744 msgid "guestfs_aug_rm"
22748 #: ../src/guestfs-actions.pod:512
22752 " guestfs_aug_rm (guestfs_h *g,\n"
22753 " const char *augpath);\n"
22758 #: ../src/guestfs-actions.pod:524
22759 msgid "guestfs_aug_save"
22763 #: ../src/guestfs-actions.pod:526
22767 " guestfs_aug_save (guestfs_h *g);\n"
22772 #: ../src/guestfs-actions.pod:531
22774 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
22779 #: ../src/guestfs-actions.pod:538
22780 msgid "guestfs_aug_set"
22784 #: ../src/guestfs-actions.pod:540
22788 " guestfs_aug_set (guestfs_h *g,\n"
22789 " const char *augpath,\n"
22790 " const char *val);\n"
22795 #: ../src/guestfs-actions.pod:547
22797 "In the Augeas API, it is possible to clear a node by setting the value to "
22798 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
22799 "this call. Instead you must use the C<guestfs_aug_clear> call."
22803 #: ../src/guestfs-actions.pod:556
22804 msgid "guestfs_available"
22808 #: ../src/guestfs-actions.pod:558
22812 " guestfs_available (guestfs_h *g,\n"
22813 " char *const *groups);\n"
22818 #: ../src/guestfs-actions.pod:566
22820 "The libguestfs groups, and the functions that those groups correspond to, "
22821 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
22822 "runtime by calling C<guestfs_available_all_groups>."
22826 #: ../src/guestfs-actions.pod:590
22827 msgid "You must call C<guestfs_launch> before calling this function."
22831 #: ../src/guestfs-actions.pod:612
22833 "This call was added in version C<1.0.80>. In previous versions of "
22834 "libguestfs all you could do would be to speculatively execute a command to "
22835 "find out if the daemon implemented it. See also C<guestfs_version>."
22839 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1241
22840 msgid "(Added in 1.0.80)"
22844 #: ../src/guestfs-actions.pod:623
22845 msgid "guestfs_available_all_groups"
22849 #: ../src/guestfs-actions.pod:625
22853 " guestfs_available_all_groups (guestfs_h *g);\n"
22858 #: ../src/guestfs-actions.pod:628
22860 "This command returns a list of all optional groups that this daemon knows "
22861 "about. Note this returns both supported and unsupported groups. To find "
22862 "out which ones the daemon can actually support you have to call "
22863 "C<guestfs_available> on each member of the returned list."
22867 #: ../src/guestfs-actions.pod:634
22868 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
22872 #: ../src/guestfs-actions.pod:640
22873 msgid "(Added in 1.3.15)"
22877 #: ../src/guestfs-actions.pod:642
22878 msgid "guestfs_base64_in"
22882 #: ../src/guestfs-actions.pod:644
22886 " guestfs_base64_in (guestfs_h *g,\n"
22887 " const char *base64file,\n"
22888 " const char *filename);\n"
22893 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
22894 msgid "(Added in 1.3.5)"
22898 #: ../src/guestfs-actions.pod:656
22899 msgid "guestfs_base64_out"
22903 #: ../src/guestfs-actions.pod:658
22907 " guestfs_base64_out (guestfs_h *g,\n"
22908 " const char *filename,\n"
22909 " const char *base64file);\n"
22914 #: ../src/guestfs-actions.pod:670
22915 msgid "guestfs_blockdev_flushbufs"
22919 #: ../src/guestfs-actions.pod:672
22923 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
22924 " const char *device);\n"
22929 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700
22930 #: ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731
22931 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768
22932 #: ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800
22933 #: ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
22934 msgid "(Added in 0.9.3)"
22938 #: ../src/guestfs-actions.pod:685
22939 msgid "guestfs_blockdev_getbsz"
22943 #: ../src/guestfs-actions.pod:687
22947 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
22948 " const char *device);\n"
22953 #: ../src/guestfs-actions.pod:702
22954 msgid "guestfs_blockdev_getro"
22958 #: ../src/guestfs-actions.pod:704
22962 " guestfs_blockdev_getro (guestfs_h *g,\n"
22963 " const char *device);\n"
22968 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1479
22969 #: ../src/guestfs-actions.pod:1494 ../src/guestfs-actions.pod:1983
22970 #: ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:2066
22971 #: ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:2132
22972 #: ../src/guestfs-actions.pod:2147 ../src/guestfs-actions.pod:2172
22973 #: ../src/guestfs-actions.pod:2195 ../src/guestfs-actions.pod:3231
22974 #: ../src/guestfs-actions.pod:3247 ../src/guestfs-actions.pod:3265
22975 #: ../src/guestfs-actions.pod:3427 ../src/guestfs-actions.pod:3441
22976 #: ../src/guestfs-actions.pod:3456 ../src/guestfs-actions.pod:3470
22977 #: ../src/guestfs-actions.pod:3486 ../src/guestfs-actions.pod:3501
22978 #: ../src/guestfs-actions.pod:3517 ../src/guestfs-actions.pod:3531
22979 #: ../src/guestfs-actions.pod:3544 ../src/guestfs-actions.pod:3558
22980 #: ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3588
22981 #: ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3615
22982 #: ../src/guestfs-actions.pod:5344
22983 msgid "This function returns a C truth value on success or -1 on error."
22987 #: ../src/guestfs-actions.pod:717
22988 msgid "guestfs_blockdev_getsize64"
22992 #: ../src/guestfs-actions.pod:719
22996 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
22997 " const char *device);\n"
23002 #: ../src/guestfs-actions.pod:725
23003 msgid "See also C<guestfs_blockdev_getsz>."
23007 #: ../src/guestfs-actions.pod:733
23008 msgid "guestfs_blockdev_getss"
23012 #: ../src/guestfs-actions.pod:735
23016 " guestfs_blockdev_getss (guestfs_h *g,\n"
23017 " const char *device);\n"
23022 #: ../src/guestfs-actions.pod:742
23024 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
23029 #: ../src/guestfs-actions.pod:751
23030 msgid "guestfs_blockdev_getsz"
23034 #: ../src/guestfs-actions.pod:753
23038 " guestfs_blockdev_getsz (guestfs_h *g,\n"
23039 " const char *device);\n"
23044 #: ../src/guestfs-actions.pod:760
23046 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
23047 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
23051 #: ../src/guestfs-actions.pod:770
23052 msgid "guestfs_blockdev_rereadpt"
23056 #: ../src/guestfs-actions.pod:772
23060 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
23061 " const char *device);\n"
23066 #: ../src/guestfs-actions.pod:784
23067 msgid "guestfs_blockdev_setbsz"
23071 #: ../src/guestfs-actions.pod:786
23075 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
23076 " const char *device,\n"
23077 " int blocksize);\n"
23082 #: ../src/guestfs-actions.pod:802
23083 msgid "guestfs_blockdev_setro"
23087 #: ../src/guestfs-actions.pod:804
23091 " guestfs_blockdev_setro (guestfs_h *g,\n"
23092 " const char *device);\n"
23097 #: ../src/guestfs-actions.pod:816
23098 msgid "guestfs_blockdev_setrw"
23102 #: ../src/guestfs-actions.pod:818
23106 " guestfs_blockdev_setrw (guestfs_h *g,\n"
23107 " const char *device);\n"
23112 #: ../src/guestfs-actions.pod:830
23113 msgid "guestfs_btrfs_filesystem_resize"
23117 #: ../src/guestfs-actions.pod:832
23121 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
23122 " const char *mountpoint,\n"
23128 #: ../src/guestfs-actions.pod:842
23131 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
23136 #: ../src/guestfs-actions.pod:865
23137 msgid "(Added in 1.11.17)"
23141 #: ../src/guestfs-actions.pod:867
23142 msgid "guestfs_btrfs_filesystem_resize_va"
23146 #: ../src/guestfs-actions.pod:869
23150 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
23151 " const char *mountpoint,\n"
23152 " va_list args);\n"
23157 #: ../src/guestfs-actions.pod:874
23158 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
23162 #: ../src/guestfs-actions.pod:878
23163 msgid "guestfs_btrfs_filesystem_resize_argv"
23167 #: ../src/guestfs-actions.pod:880
23171 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
23172 " const char *mountpoint,\n"
23173 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
23178 #: ../src/guestfs-actions.pod:885
23179 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
23183 #: ../src/guestfs-actions.pod:889
23184 msgid "guestfs_case_sensitive_path"
23188 #: ../src/guestfs-actions.pod:891
23192 " guestfs_case_sensitive_path (guestfs_h *g,\n"
23193 " const char *path);\n"
23198 #: ../src/guestfs-actions.pod:917
23200 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
23201 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
23202 "how the directories were originally created under Windows)."
23206 #: ../src/guestfs-actions.pod:925
23207 msgid "See also C<guestfs_realpath>."
23211 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7392
23212 msgid "(Added in 1.0.75)"
23216 #: ../src/guestfs-actions.pod:932
23217 msgid "guestfs_cat"
23221 #: ../src/guestfs-actions.pod:934
23225 " guestfs_cat (guestfs_h *g,\n"
23226 " const char *path);\n"
23231 #: ../src/guestfs-actions.pod:940
23233 "Note that this function cannot correctly handle binary files (specifically, "
23234 "files containing C<\\0> character which is treated as end of string). For "
23235 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
23236 "functions which have a more complex interface."
23240 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3745
23241 #: ../src/guestfs-actions.pod:3827 ../src/guestfs-actions.pod:3844
23242 #: ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:4340
23243 #: ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:5725
23244 #: ../src/guestfs-actions.pod:5739 ../src/guestfs-actions.pod:7545
23245 #: ../src/guestfs-actions.pod:7559
23246 msgid "(Added in 0.4)"
23250 #: ../src/guestfs-actions.pod:953
23251 msgid "guestfs_checksum"
23255 #: ../src/guestfs-actions.pod:955
23259 " guestfs_checksum (guestfs_h *g,\n"
23260 " const char *csumtype,\n"
23261 " const char *path);\n"
23266 #: ../src/guestfs-actions.pod:1001
23267 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
23271 #: ../src/guestfs-actions.pod:1003
23272 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
23276 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1316
23277 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:3443
23278 #: ../src/guestfs-actions.pod:3472 ../src/guestfs-actions.pod:3533
23279 #: ../src/guestfs-actions.pod:3560 ../src/guestfs-actions.pod:7248
23280 msgid "(Added in 1.0.2)"
23284 #: ../src/guestfs-actions.pod:1010
23285 msgid "guestfs_checksum_device"
23289 #: ../src/guestfs-actions.pod:1012
23293 " guestfs_checksum_device (guestfs_h *g,\n"
23294 " const char *csumtype,\n"
23295 " const char *device);\n"
23300 #: ../src/guestfs-actions.pod:1017
23302 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
23303 "device named C<device>. For the types of checksums supported see the "
23304 "C<guestfs_checksum> command."
23308 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5174
23309 #: ../src/guestfs-actions.pod:5309 ../src/guestfs-actions.pod:5346
23310 #: ../src/guestfs-actions.pod:5364 ../src/guestfs-actions.pod:5546
23311 #: ../src/guestfs-actions.pod:7157 ../src/guestfs-actions.pod:7171
23312 #: ../src/guestfs-actions.pod:7571
23313 msgid "(Added in 1.3.2)"
23317 #: ../src/guestfs-actions.pod:1026
23318 msgid "guestfs_checksums_out"
23322 #: ../src/guestfs-actions.pod:1028
23326 " guestfs_checksums_out (guestfs_h *g,\n"
23327 " const char *csumtype,\n"
23328 " const char *directory,\n"
23329 " const char *sumsfile);\n"
23334 #: ../src/guestfs-actions.pod:1048
23335 msgid "(Added in 1.3.7)"
23339 #: ../src/guestfs-actions.pod:1050
23340 msgid "guestfs_chmod"
23344 #: ../src/guestfs-actions.pod:1052
23348 " guestfs_chmod (guestfs_h *g,\n"
23350 " const char *path);\n"
23355 #: ../src/guestfs-actions.pod:1070
23356 msgid "guestfs_chown"
23360 #: ../src/guestfs-actions.pod:1072
23364 " guestfs_chown (guestfs_h *g,\n"
23367 " const char *path);\n"
23372 #: ../src/guestfs-actions.pod:1088
23373 msgid "guestfs_command"
23377 #: ../src/guestfs-actions.pod:1090
23381 " guestfs_command (guestfs_h *g,\n"
23382 " char *const *arguments);\n"
23387 #: ../src/guestfs-actions.pod:1099
23389 "The single parameter is an argv-style list of arguments. The first element "
23390 "is the name of the program to run. Subsequent elements are parameters. The "
23391 "list must be non-empty (ie. must contain a program name). Note that the "
23392 "command runs directly, and is I<not> invoked via the shell (see "
23397 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150
23398 #: ../src/guestfs-actions.pod:1615
23399 msgid "(Added in 0.9.1)"
23403 #: ../src/guestfs-actions.pod:1132
23404 msgid "guestfs_command_lines"
23408 #: ../src/guestfs-actions.pod:1134
23412 " guestfs_command_lines (guestfs_h *g,\n"
23413 " char *const *arguments);\n"
23418 #: ../src/guestfs-actions.pod:1138
23420 "This is the same as C<guestfs_command>, but splits the result into a list of "
23425 #: ../src/guestfs-actions.pod:1141
23426 msgid "See also: C<guestfs_sh_lines>"
23430 #: ../src/guestfs-actions.pod:1152
23431 msgid "guestfs_config"
23435 #: ../src/guestfs-actions.pod:1154
23439 " guestfs_config (guestfs_h *g,\n"
23440 " const char *qemuparam,\n"
23441 " const char *qemuvalue);\n"
23446 #: ../src/guestfs-actions.pod:1172
23447 msgid "guestfs_copy_size"
23451 #: ../src/guestfs-actions.pod:1174
23455 " guestfs_copy_size (guestfs_h *g,\n"
23456 " const char *src,\n"
23457 " const char *dest,\n"
23458 " int64_t size);\n"
23463 #: ../src/guestfs-actions.pod:1188 ../src/guestfs-actions.pod:1311
23464 #: ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:1387
23465 #: ../src/guestfs-actions.pod:1764 ../src/guestfs-actions.pod:1786
23466 #: ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:7243
23467 #: ../src/guestfs-actions.pod:7277 ../src/guestfs-actions.pod:7784
23468 #: ../src/guestfs-actions.pod:7807
23470 "This long-running command can generate progress notification messages so "
23471 "that the caller can display a progress bar or indicator. To receive these "
23472 "messages, the caller must register a progress event callback. See L<guestfs"
23473 "(3)/GUESTFS_EVENT_PROGRESS>."
23477 #: ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:4367
23478 #: ../src/guestfs-actions.pod:5752 ../src/guestfs-actions.pod:7478
23479 #: ../src/guestfs-actions.pod:7498 ../src/guestfs-actions.pod:7584
23480 msgid "(Added in 1.0.87)"
23484 #: ../src/guestfs-actions.pod:1195
23489 #: ../src/guestfs-actions.pod:1197
23493 " guestfs_cp (guestfs_h *g,\n"
23494 " const char *src,\n"
23495 " const char *dest);\n"
23500 #: ../src/guestfs-actions.pod:1207 ../src/guestfs-actions.pod:1221
23501 #: ../src/guestfs-actions.pod:1293 ../src/guestfs-actions.pod:1367
23502 #: ../src/guestfs-actions.pod:1481 ../src/guestfs-actions.pod:5121
23503 #: ../src/guestfs-actions.pod:5596
23504 msgid "(Added in 1.0.18)"
23508 #: ../src/guestfs-actions.pod:1209
23509 msgid "guestfs_cp_a"
23513 #: ../src/guestfs-actions.pod:1211
23517 " guestfs_cp_a (guestfs_h *g,\n"
23518 " const char *src,\n"
23519 " const char *dest);\n"
23524 #: ../src/guestfs-actions.pod:1223
23529 #: ../src/guestfs-actions.pod:1225
23533 " guestfs_dd (guestfs_h *g,\n"
23534 " const char *src,\n"
23535 " const char *dest);\n"
23540 #: ../src/guestfs-actions.pod:1235
23542 "If the destination is a device, it must be as large or larger than the "
23543 "source file or device, otherwise the copy will fail. This command cannot do "
23544 "partial copies (see C<guestfs_copy_size>)."
23548 #: ../src/guestfs-actions.pod:1243
23553 #: ../src/guestfs-actions.pod:1245
23557 " guestfs_df (guestfs_h *g);\n"
23562 #: ../src/guestfs-actions.pod:1250 ../src/guestfs-actions.pod:1267
23564 "This command is mostly useful for interactive sessions. It is I<not> "
23565 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
23570 #: ../src/guestfs-actions.pod:1257 ../src/guestfs-actions.pod:1274
23571 #: ../src/guestfs-actions.pod:1392 ../src/guestfs-actions.pod:2366
23572 #: ../src/guestfs-actions.pod:2390 ../src/guestfs-actions.pod:2458
23573 #: ../src/guestfs-actions.pod:4477 ../src/guestfs-actions.pod:5021
23574 #: ../src/guestfs-actions.pod:6981 ../src/guestfs-actions.pod:7005
23575 #: ../src/guestfs-actions.pod:7624 ../src/guestfs-actions.pod:7637
23576 #: ../src/guestfs-actions.pod:7650
23577 msgid "(Added in 1.0.54)"
23581 #: ../src/guestfs-actions.pod:1259
23582 msgid "guestfs_df_h"
23586 #: ../src/guestfs-actions.pod:1261
23590 " guestfs_df_h (guestfs_h *g);\n"
23595 #: ../src/guestfs-actions.pod:1276
23596 msgid "guestfs_dmesg"
23600 #: ../src/guestfs-actions.pod:1278
23604 " guestfs_dmesg (guestfs_h *g);\n"
23609 #: ../src/guestfs-actions.pod:1285
23611 "Another way to get the same information is to enable verbose messages with "
23612 "C<guestfs_set_verbose> or by setting the environment variable "
23613 "C<LIBGUESTFS_DEBUG=1> before running the program."
23617 #: ../src/guestfs-actions.pod:1295
23618 msgid "guestfs_download"
23622 #: ../src/guestfs-actions.pod:1297
23626 " guestfs_download (guestfs_h *g,\n"
23627 " const char *remotefilename,\n"
23628 " const char *filename);\n"
23633 #: ../src/guestfs-actions.pod:1307
23634 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
23638 #: ../src/guestfs-actions.pod:1318
23639 msgid "guestfs_download_offset"
23643 #: ../src/guestfs-actions.pod:1320
23647 " guestfs_download_offset (guestfs_h *g,\n"
23648 " const char *remotefilename,\n"
23649 " const char *filename,\n"
23650 " int64_t offset,\n"
23651 " int64_t size);\n"
23656 #: ../src/guestfs-actions.pod:1333
23658 "Note that there is no limit on the amount of data that can be downloaded "
23659 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
23660 "full amount unless an error occurs."
23664 #: ../src/guestfs-actions.pod:1338
23665 msgid "See also C<guestfs_download>, C<guestfs_pread>."
23669 #: ../src/guestfs-actions.pod:1347 ../src/guestfs-actions.pod:7282
23670 msgid "(Added in 1.5.17)"
23674 #: ../src/guestfs-actions.pod:1349
23675 msgid "guestfs_drop_caches"
23679 #: ../src/guestfs-actions.pod:1351
23683 " guestfs_drop_caches (guestfs_h *g,\n"
23684 " int whattodrop);\n"
23689 #: ../src/guestfs-actions.pod:1369
23694 #: ../src/guestfs-actions.pod:1371
23698 " guestfs_du (guestfs_h *g,\n"
23699 " const char *path);\n"
23704 #: ../src/guestfs-actions.pod:1394
23705 msgid "guestfs_e2fsck_f"
23709 #: ../src/guestfs-actions.pod:1396
23713 " guestfs_e2fsck_f (guestfs_h *g,\n"
23714 " const char *device);\n"
23719 #: ../src/guestfs-actions.pod:1404
23721 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
23722 "Normally you should use C<guestfs_fsck>."
23726 #: ../src/guestfs-actions.pod:1409
23727 msgid "(Added in 1.0.29)"
23731 #: ../src/guestfs-actions.pod:1411
23732 msgid "guestfs_echo_daemon"
23736 #: ../src/guestfs-actions.pod:1413
23740 " guestfs_echo_daemon (guestfs_h *g,\n"
23741 " char *const *words);\n"
23746 #: ../src/guestfs-actions.pod:1422
23747 msgid "See also C<guestfs_ping_daemon>."
23751 #: ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:2174
23752 #: ../src/guestfs-actions.pod:6453
23753 msgid "(Added in 1.0.69)"
23757 #: ../src/guestfs-actions.pod:1429
23758 msgid "guestfs_egrep"
23762 #: ../src/guestfs-actions.pod:1431
23766 " guestfs_egrep (guestfs_h *g,\n"
23767 " const char *regex,\n"
23768 " const char *path);\n"
23773 #: ../src/guestfs-actions.pod:1446 ../src/guestfs-actions.pod:1465
23774 #: ../src/guestfs-actions.pod:1522 ../src/guestfs-actions.pod:1568
23775 #: ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:2304
23776 #: ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:2479
23777 #: ../src/guestfs-actions.pod:2492 ../src/guestfs-actions.pod:2507
23778 #: ../src/guestfs-actions.pod:2553 ../src/guestfs-actions.pod:2575
23779 #: ../src/guestfs-actions.pod:2588 ../src/guestfs-actions.pod:3857
23780 #: ../src/guestfs-actions.pod:3871 ../src/guestfs-actions.pod:3884
23781 #: ../src/guestfs-actions.pod:3898 ../src/guestfs-actions.pod:4899
23782 #: ../src/guestfs-actions.pod:5930 ../src/guestfs-actions.pod:5979
23783 #: ../src/guestfs-actions.pod:6849 ../src/guestfs-actions.pod:6861
23784 #: ../src/guestfs-actions.pod:6874 ../src/guestfs-actions.pod:6887
23785 #: ../src/guestfs-actions.pod:6909 ../src/guestfs-actions.pod:6922
23786 #: ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:6948
23787 #: ../src/guestfs-actions.pod:7742 ../src/guestfs-actions.pod:7761
23788 #: ../src/guestfs-actions.pod:7855 ../src/guestfs-actions.pod:7874
23789 #: ../src/guestfs-actions.pod:7920 ../src/guestfs-actions.pod:7939
23790 msgid "(Added in 1.0.66)"
23794 #: ../src/guestfs-actions.pod:1448
23795 msgid "guestfs_egrepi"
23799 #: ../src/guestfs-actions.pod:1450
23803 " guestfs_egrepi (guestfs_h *g,\n"
23804 " const char *regex,\n"
23805 " const char *path);\n"
23810 #: ../src/guestfs-actions.pod:1467
23811 msgid "guestfs_equal"
23815 #: ../src/guestfs-actions.pod:1469
23819 " guestfs_equal (guestfs_h *g,\n"
23820 " const char *file1,\n"
23821 " const char *file2);\n"
23826 #: ../src/guestfs-actions.pod:1483
23827 msgid "guestfs_exists"
23831 #: ../src/guestfs-actions.pod:1485
23835 " guestfs_exists (guestfs_h *g,\n"
23836 " const char *path);\n"
23841 #: ../src/guestfs-actions.pod:1492
23842 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
23846 #: ../src/guestfs-actions.pod:1498
23847 msgid "guestfs_fallocate"
23851 #: ../src/guestfs-actions.pod:1500
23855 " guestfs_fallocate (guestfs_h *g,\n"
23856 " const char *path,\n"
23862 #: ../src/guestfs-actions.pod:1505
23864 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
23869 #: ../src/guestfs-actions.pod:1524
23870 msgid "guestfs_fallocate64"
23874 #: ../src/guestfs-actions.pod:1526
23878 " guestfs_fallocate64 (guestfs_h *g,\n"
23879 " const char *path,\n"
23885 #: ../src/guestfs-actions.pod:1535
23887 "Note that this call allocates disk blocks for the file. To create a sparse "
23888 "file use C<guestfs_truncate_size> instead."
23892 #: ../src/guestfs-actions.pod:1538
23894 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
23895 "oversight it only allowed 30 bit lengths to be specified, effectively "
23896 "limiting the maximum size of files created through that call to 1GB."
23900 #: ../src/guestfs-actions.pod:1549
23901 msgid "(Added in 1.3.17)"
23905 #: ../src/guestfs-actions.pod:1551
23906 msgid "guestfs_fgrep"
23910 #: ../src/guestfs-actions.pod:1553
23914 " guestfs_fgrep (guestfs_h *g,\n"
23915 " const char *pattern,\n"
23916 " const char *path);\n"
23921 #: ../src/guestfs-actions.pod:1570
23922 msgid "guestfs_fgrepi"
23926 #: ../src/guestfs-actions.pod:1572
23930 " guestfs_fgrepi (guestfs_h *g,\n"
23931 " const char *pattern,\n"
23932 " const char *path);\n"
23937 #: ../src/guestfs-actions.pod:1589
23938 msgid "guestfs_file"
23942 #: ../src/guestfs-actions.pod:1591
23946 " guestfs_file (guestfs_h *g,\n"
23947 " const char *path);\n"
23952 #: ../src/guestfs-actions.pod:1609
23954 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
23955 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
23959 #: ../src/guestfs-actions.pod:1617
23960 msgid "guestfs_file_architecture"
23964 #: ../src/guestfs-actions.pod:1619
23968 " guestfs_file_architecture (guestfs_h *g,\n"
23969 " const char *filename);\n"
23974 #: ../src/guestfs-actions.pod:1727 ../src/guestfs-actions.pod:1890
23975 #: ../src/guestfs-actions.pod:1907 ../src/guestfs-actions.pod:2608
23976 #: ../src/guestfs-actions.pod:2698 ../src/guestfs-actions.pod:2764
23977 #: ../src/guestfs-actions.pod:2951 ../src/guestfs-actions.pod:2969
23978 #: ../src/guestfs-actions.pod:3009 ../src/guestfs-actions.pod:3084
23979 #: ../src/guestfs-actions.pod:3177 ../src/guestfs-actions.pod:3414
23980 #: ../src/guestfs-actions.pod:3546
23981 msgid "(Added in 1.5.3)"
23985 #: ../src/guestfs-actions.pod:1729
23986 msgid "guestfs_filesize"
23990 #: ../src/guestfs-actions.pod:1731
23994 " guestfs_filesize (guestfs_h *g,\n"
23995 " const char *file);\n"
24000 #: ../src/guestfs-actions.pod:1737
24002 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
24003 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
24004 "devices, use C<guestfs_blockdev_getsize64>."
24008 #: ../src/guestfs-actions.pod:1743
24009 msgid "(Added in 1.0.82)"
24013 #: ../src/guestfs-actions.pod:1745
24014 msgid "guestfs_fill"
24018 #: ../src/guestfs-actions.pod:1747
24022 " guestfs_fill (guestfs_h *g,\n"
24025 " const char *path);\n"
24030 #: ../src/guestfs-actions.pod:1757
24032 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
24033 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
24034 "bytes use C<guestfs_fill_pattern>."
24038 #: ../src/guestfs-actions.pod:1769
24039 msgid "(Added in 1.0.79)"
24043 #: ../src/guestfs-actions.pod:1771
24044 msgid "guestfs_fill_pattern"
24048 #: ../src/guestfs-actions.pod:1773
24052 " guestfs_fill_pattern (guestfs_h *g,\n"
24053 " const char *pattern,\n"
24055 " const char *path);\n"
24060 #: ../src/guestfs-actions.pod:1779
24062 "This function is like C<guestfs_fill> except that it creates a new file of "
24063 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
24064 "pattern is truncated if necessary to ensure the length of the file is "
24065 "exactly C<len> bytes."
24069 #: ../src/guestfs-actions.pod:1791
24070 msgid "(Added in 1.3.12)"
24074 #: ../src/guestfs-actions.pod:1793
24075 msgid "guestfs_find"
24079 #: ../src/guestfs-actions.pod:1795
24083 " guestfs_find (guestfs_h *g,\n"
24084 " const char *directory);\n"
24089 #: ../src/guestfs-actions.pod:1811
24091 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
24095 #: ../src/guestfs-actions.pod:1824
24096 msgid "See also C<guestfs_find0>."
24100 #: ../src/guestfs-actions.pod:1833 ../src/guestfs-actions.pod:4304
24101 #: ../src/guestfs-actions.pod:6014
24102 msgid "(Added in 1.0.27)"
24106 #: ../src/guestfs-actions.pod:1835
24107 msgid "guestfs_find0"
24111 #: ../src/guestfs-actions.pod:1837
24115 " guestfs_find0 (guestfs_h *g,\n"
24116 " const char *directory,\n"
24117 " const char *files);\n"
24122 #: ../src/guestfs-actions.pod:1846
24124 "This command works the same way as C<guestfs_find> with the following "
24129 #: ../src/guestfs-actions.pod:1873
24130 msgid "(Added in 1.0.74)"
24134 #: ../src/guestfs-actions.pod:1875
24135 msgid "guestfs_findfs_label"
24139 #: ../src/guestfs-actions.pod:1877
24143 " guestfs_findfs_label (guestfs_h *g,\n"
24144 " const char *label);\n"
24149 #: ../src/guestfs-actions.pod:1885
24150 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
24154 #: ../src/guestfs-actions.pod:1892
24155 msgid "guestfs_findfs_uuid"
24159 #: ../src/guestfs-actions.pod:1894
24163 " guestfs_findfs_uuid (guestfs_h *g,\n"
24164 " const char *uuid);\n"
24169 #: ../src/guestfs-actions.pod:1902
24170 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
24174 #: ../src/guestfs-actions.pod:1909
24175 msgid "guestfs_fsck"
24179 #: ../src/guestfs-actions.pod:1911
24183 " guestfs_fsck (guestfs_h *g,\n"
24184 " const char *fstype,\n"
24185 " const char *device);\n"
24190 #: ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:7789
24191 msgid "(Added in 1.0.16)"
24195 #: ../src/guestfs-actions.pod:1948
24196 msgid "guestfs_get_append"
24200 #: ../src/guestfs-actions.pod:1950
24204 " guestfs_get_append (guestfs_h *g);\n"
24209 #: ../src/guestfs-actions.pod:1958
24211 "This function returns a string which may be NULL. There is no way to return "
24212 "an error from this function. The string is owned by the guest handle and "
24213 "must I<not> be freed."
24217 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:5692
24218 #: ../src/guestfs-actions.pod:6174 ../src/guestfs-actions.pod:6616
24219 #: ../src/guestfs-actions.pod:6635 ../src/guestfs-actions.pod:6651
24220 #: ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:7429
24221 #: ../src/guestfs-actions.pod:7444 ../src/guestfs-actions.pod:7836
24222 msgid "(Added in 1.0.26)"
24226 #: ../src/guestfs-actions.pod:1964
24227 msgid "guestfs_get_attach_method"
24231 #: ../src/guestfs-actions.pod:1966
24235 " guestfs_get_attach_method (guestfs_h *g);\n"
24240 #: ../src/guestfs-actions.pod:1969
24241 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
24245 #: ../src/guestfs-actions.pod:1974 ../src/guestfs-actions.pod:6204
24246 msgid "(Added in 1.9.8)"
24250 #: ../src/guestfs-actions.pod:1976
24251 msgid "guestfs_get_autosync"
24255 #: ../src/guestfs-actions.pod:1978
24259 " guestfs_get_autosync (guestfs_h *g);\n"
24264 #: ../src/guestfs-actions.pod:1987
24265 msgid "guestfs_get_direct"
24269 #: ../src/guestfs-actions.pod:1989
24273 " guestfs_get_direct (guestfs_h *g);\n"
24278 #: ../src/guestfs-actions.pod:1996 ../src/guestfs-actions.pod:6245
24279 msgid "(Added in 1.0.72)"
24283 #: ../src/guestfs-actions.pod:1998
24284 msgid "guestfs_get_e2label"
24288 #: ../src/guestfs-actions.pod:2000
24292 " guestfs_get_e2label (guestfs_h *g,\n"
24293 " const char *device);\n"
24298 #: ../src/guestfs-actions.pod:2004
24300 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
24305 #: ../src/guestfs-actions.pod:2017 ../src/guestfs-actions.pod:2038
24306 #: ../src/guestfs-actions.pod:6263 ../src/guestfs-actions.pod:6282
24307 msgid "(Added in 1.0.15)"
24311 #: ../src/guestfs-actions.pod:2019
24312 msgid "guestfs_get_e2uuid"
24316 #: ../src/guestfs-actions.pod:2021
24320 " guestfs_get_e2uuid (guestfs_h *g,\n"
24321 " const char *device);\n"
24326 #: ../src/guestfs-actions.pod:2025
24328 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
24333 #: ../src/guestfs-actions.pod:2040
24334 msgid "guestfs_get_memsize"
24338 #: ../src/guestfs-actions.pod:2042
24342 " guestfs_get_memsize (guestfs_h *g);\n"
24347 #: ../src/guestfs-actions.pod:2048
24349 "If C<guestfs_set_memsize> was not called on this handle, and if "
24350 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
24351 "value for memsize."
24355 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:4595
24356 #: ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:4823
24357 #: ../src/guestfs-actions.pod:4842 ../src/guestfs-actions.pod:4854
24358 #: ../src/guestfs-actions.pod:4871 ../src/guestfs-actions.pod:4884
24359 #: ../src/guestfs-actions.pod:5917 ../src/guestfs-actions.pod:6303
24360 #: ../src/guestfs-actions.pod:6583 ../src/guestfs-actions.pod:7198
24361 msgid "(Added in 1.0.55)"
24365 #: ../src/guestfs-actions.pod:2059
24366 msgid "guestfs_get_network"
24370 #: ../src/guestfs-actions.pod:2061
24374 " guestfs_get_network (guestfs_h *g);\n"
24379 #: ../src/guestfs-actions.pod:2068 ../src/guestfs-actions.pod:6322
24380 msgid "(Added in 1.5.4)"
24384 #: ../src/guestfs-actions.pod:2070
24385 msgid "guestfs_get_path"
24389 #: ../src/guestfs-actions.pod:2072
24393 " guestfs_get_path (guestfs_h *g);\n"
24398 #: ../src/guestfs-actions.pod:2080 ../src/guestfs-actions.pod:2120
24400 "This function returns a string, or NULL on error. The string is owned by "
24401 "the guest handle and must I<not> be freed."
24405 #: ../src/guestfs-actions.pod:2085
24406 msgid "guestfs_get_pgroup"
24410 #: ../src/guestfs-actions.pod:2087
24414 " guestfs_get_pgroup (guestfs_h *g);\n"
24419 #: ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:6358
24420 #: ../src/guestfs-actions.pod:7690
24421 msgid "(Added in 1.11.18)"
24425 #: ../src/guestfs-actions.pod:2096
24426 msgid "guestfs_get_pid"
24430 #: ../src/guestfs-actions.pod:2098
24434 " guestfs_get_pid (guestfs_h *g);\n"
24439 #: ../src/guestfs-actions.pod:2108
24440 msgid "(Added in 1.0.56)"
24444 #: ../src/guestfs-actions.pod:2110
24445 msgid "guestfs_get_qemu"
24449 #: ../src/guestfs-actions.pod:2112
24453 " guestfs_get_qemu (guestfs_h *g);\n"
24458 #: ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:6386
24459 msgid "(Added in 1.0.6)"
24463 #: ../src/guestfs-actions.pod:2125
24464 msgid "guestfs_get_recovery_proc"
24468 #: ../src/guestfs-actions.pod:2127
24472 " guestfs_get_recovery_proc (guestfs_h *g);\n"
24477 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:3668
24478 #: ../src/guestfs-actions.pod:3999 ../src/guestfs-actions.pod:4402
24479 #: ../src/guestfs-actions.pod:4434 ../src/guestfs-actions.pod:5622
24480 #: ../src/guestfs-actions.pod:5965 ../src/guestfs-actions.pod:6410
24481 #: ../src/guestfs-actions.pod:7101 ../src/guestfs-actions.pod:7121
24482 #: ../src/guestfs-actions.pod:7313
24483 msgid "(Added in 1.0.77)"
24487 #: ../src/guestfs-actions.pod:2136
24488 msgid "guestfs_get_selinux"
24492 #: ../src/guestfs-actions.pod:2138
24496 " guestfs_get_selinux (guestfs_h *g);\n"
24501 #: ../src/guestfs-actions.pod:2141
24503 "This returns the current setting of the selinux flag which is passed to the "
24504 "appliance at boot time. See C<guestfs_set_selinux>."
24508 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2212
24509 #: ../src/guestfs-actions.pod:6429 ../src/guestfs-actions.pod:6487
24510 msgid "(Added in 1.0.67)"
24514 #: ../src/guestfs-actions.pod:2151
24515 msgid "guestfs_get_state"
24519 #: ../src/guestfs-actions.pod:2153
24523 " guestfs_get_state (guestfs_h *g);\n"
24528 #: ../src/guestfs-actions.pod:2165
24529 msgid "guestfs_get_trace"
24533 #: ../src/guestfs-actions.pod:2167
24537 " guestfs_get_trace (guestfs_h *g);\n"
24542 #: ../src/guestfs-actions.pod:2176
24543 msgid "guestfs_get_umask"
24547 #: ../src/guestfs-actions.pod:2178
24551 " guestfs_get_umask (guestfs_h *g);\n"
24556 #: ../src/guestfs-actions.pod:2181
24558 "Return the current umask. By default the umask is C<022> unless it has been "
24559 "set by calling C<guestfs_umask>."
24563 #: ../src/guestfs-actions.pod:2188
24564 msgid "guestfs_get_verbose"
24568 #: ../src/guestfs-actions.pod:2190
24572 " guestfs_get_verbose (guestfs_h *g);\n"
24577 #: ../src/guestfs-actions.pod:2199
24578 msgid "guestfs_getcon"
24582 #: ../src/guestfs-actions.pod:2201
24586 " guestfs_getcon (guestfs_h *g);\n"
24591 #: ../src/guestfs-actions.pod:2206
24593 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
24597 #: ../src/guestfs-actions.pod:2214
24598 msgid "guestfs_getxattr"
24602 #: ../src/guestfs-actions.pod:2216
24606 " guestfs_getxattr (guestfs_h *g,\n"
24607 " const char *path,\n"
24608 " const char *name,\n"
24609 " size_t *size_r);\n"
24614 #: ../src/guestfs-actions.pod:2222
24616 "Get a single extended attribute from file C<path> named C<name>. This call "
24617 "follows symlinks. If you want to lookup an extended attribute for the "
24618 "symlink itself, use C<guestfs_lgetxattr>."
24622 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:3682
24624 "Normally it is better to get all extended attributes from a file in one go "
24625 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
24626 "implementations are buggy and do not provide a way to list out attributes. "
24627 "For these filesystems (notably ntfs-3g) you have to know the names of the "
24628 "extended attributes you want in advance and call this function."
24632 #: ../src/guestfs-actions.pod:2236
24633 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
24637 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2429
24638 #: ../src/guestfs-actions.pod:2899 ../src/guestfs-actions.pod:3694
24639 #: ../src/guestfs-actions.pod:5615 ../src/guestfs-actions.pod:5641
24640 #: ../src/guestfs-actions.pod:5822
24642 "This function returns a buffer, or NULL on error. The size of the returned "
24643 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
24648 #: ../src/guestfs-actions.pod:2242 ../src/guestfs-actions.pod:3698
24649 msgid "(Added in 1.7.24)"
24653 #: ../src/guestfs-actions.pod:2244
24654 msgid "guestfs_getxattrs"
24658 #: ../src/guestfs-actions.pod:2246
24661 " struct guestfs_xattr_list *\n"
24662 " guestfs_getxattrs (guestfs_h *g,\n"
24663 " const char *path);\n"
24668 #: ../src/guestfs-actions.pod:2256
24669 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
24673 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:3710
24674 #: ../src/guestfs-actions.pod:4398
24676 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
24677 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
24681 #: ../src/guestfs-actions.pod:2262 ../src/guestfs-actions.pod:3714
24682 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:3949
24683 #: ../src/guestfs-actions.pod:5995 ../src/guestfs-actions.pod:6506
24684 #: ../src/guestfs-actions.pod:7901
24685 msgid "(Added in 1.0.59)"
24689 #: ../src/guestfs-actions.pod:2264
24690 msgid "guestfs_glob_expand"
24694 #: ../src/guestfs-actions.pod:2266
24698 " guestfs_glob_expand (guestfs_h *g,\n"
24699 " const char *pattern);\n"
24704 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:6699
24705 #: ../src/guestfs-actions.pod:6716
24706 msgid "(Added in 1.0.50)"
24710 #: ../src/guestfs-actions.pod:2287
24711 msgid "guestfs_grep"
24715 #: ../src/guestfs-actions.pod:2289
24719 " guestfs_grep (guestfs_h *g,\n"
24720 " const char *regex,\n"
24721 " const char *path);\n"
24726 #: ../src/guestfs-actions.pod:2306
24727 msgid "guestfs_grepi"
24731 #: ../src/guestfs-actions.pod:2308
24735 " guestfs_grepi (guestfs_h *g,\n"
24736 " const char *regex,\n"
24737 " const char *path);\n"
24742 #: ../src/guestfs-actions.pod:2325
24743 msgid "guestfs_grub_install"
24747 #: ../src/guestfs-actions.pod:2327
24751 " guestfs_grub_install (guestfs_h *g,\n"
24752 " const char *root,\n"
24753 " const char *device);\n"
24758 #: ../src/guestfs-actions.pod:2348
24759 msgid "(Added in 1.0.17)"
24763 #: ../src/guestfs-actions.pod:2350
24764 msgid "guestfs_head"
24768 #: ../src/guestfs-actions.pod:2352
24772 " guestfs_head (guestfs_h *g,\n"
24773 " const char *path);\n"
24778 #: ../src/guestfs-actions.pod:2368
24779 msgid "guestfs_head_n"
24783 #: ../src/guestfs-actions.pod:2370
24787 " guestfs_head_n (guestfs_h *g,\n"
24789 " const char *path);\n"
24794 #: ../src/guestfs-actions.pod:2392
24795 msgid "guestfs_hexdump"
24799 #: ../src/guestfs-actions.pod:2394
24803 " guestfs_hexdump (guestfs_h *g,\n"
24804 " const char *path);\n"
24809 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:6780
24810 #: ../src/guestfs-actions.pod:6835
24811 msgid "(Added in 1.0.22)"
24815 #: ../src/guestfs-actions.pod:2409
24816 msgid "guestfs_initrd_cat"
24820 #: ../src/guestfs-actions.pod:2411
24824 " guestfs_initrd_cat (guestfs_h *g,\n"
24825 " const char *initrdpath,\n"
24826 " const char *filename,\n"
24827 " size_t *size_r);\n"
24832 #: ../src/guestfs-actions.pod:2427
24833 msgid "See also C<guestfs_initrd_list>."
24837 #: ../src/guestfs-actions.pod:2438
24838 msgid "guestfs_initrd_list"
24842 #: ../src/guestfs-actions.pod:2440
24846 " guestfs_initrd_list (guestfs_h *g,\n"
24847 " const char *path);\n"
24852 #: ../src/guestfs-actions.pod:2460
24853 msgid "guestfs_inotify_add_watch"
24857 #: ../src/guestfs-actions.pod:2462
24861 " guestfs_inotify_add_watch (guestfs_h *g,\n"
24862 " const char *path,\n"
24868 #: ../src/guestfs-actions.pod:2481
24869 msgid "guestfs_inotify_close"
24873 #: ../src/guestfs-actions.pod:2483
24877 " guestfs_inotify_close (guestfs_h *g);\n"
24882 #: ../src/guestfs-actions.pod:2494
24883 msgid "guestfs_inotify_files"
24887 #: ../src/guestfs-actions.pod:2496
24891 " guestfs_inotify_files (guestfs_h *g);\n"
24896 #: ../src/guestfs-actions.pod:2499
24898 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
24899 "returns a list of pathnames of objects that were touched. The returned "
24900 "pathnames are sorted and deduplicated."
24904 #: ../src/guestfs-actions.pod:2509
24905 msgid "guestfs_inotify_init"
24909 #: ../src/guestfs-actions.pod:2511
24913 " guestfs_inotify_init (guestfs_h *g,\n"
24914 " int maxevents);\n"
24919 #: ../src/guestfs-actions.pod:2519
24921 "C<maxevents> is the maximum number of events which will be queued up between "
24922 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
24923 "passed as C<0>, then the kernel (or previously set) default is used. For "
24924 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
24925 "throws away events, but records the fact that it threw them away by setting "
24926 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
24927 "C<guestfs_inotify_read>)."
24931 #: ../src/guestfs-actions.pod:2529
24933 "Before any events are generated, you have to add some watches to the "
24934 "internal watch list. See: C<guestfs_inotify_add_watch>, "
24935 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
24939 #: ../src/guestfs-actions.pod:2535
24941 "Queued up events should be read periodically by calling "
24942 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
24943 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
24944 "often enough then you risk the internal queue overflowing."
24948 #: ../src/guestfs-actions.pod:2542
24950 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
24951 "This also removes any watches automatically."
24955 #: ../src/guestfs-actions.pod:2555
24956 msgid "guestfs_inotify_read"
24960 #: ../src/guestfs-actions.pod:2557
24963 " struct guestfs_inotify_event_list *\n"
24964 " guestfs_inotify_read (guestfs_h *g);\n"
24969 #: ../src/guestfs-actions.pod:2571
24971 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
24972 "there was an error. I<The caller must call "
24973 "C<guestfs_free_inotify_event_list> after use>."
24977 #: ../src/guestfs-actions.pod:2577
24978 msgid "guestfs_inotify_rm_watch"
24982 #: ../src/guestfs-actions.pod:2579
24986 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
24992 #: ../src/guestfs-actions.pod:2583
24994 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
24998 #: ../src/guestfs-actions.pod:2590
24999 msgid "guestfs_inspect_get_arch"
25003 #: ../src/guestfs-actions.pod:2592
25007 " guestfs_inspect_get_arch (guestfs_h *g,\n"
25008 " const char *root);\n"
25013 #: ../src/guestfs-actions.pod:2596
25015 "This returns the architecture of the inspected operating system. The "
25016 "possible return values are listed under C<guestfs_file_architecture>."
25020 #: ../src/guestfs-actions.pod:2610
25021 msgid "guestfs_inspect_get_distro"
25025 #: ../src/guestfs-actions.pod:2612
25029 " guestfs_inspect_get_distro (guestfs_h *g,\n"
25030 " const char *root);\n"
25035 #: ../src/guestfs-actions.pod:2700
25036 msgid "guestfs_inspect_get_drive_mappings"
25040 #: ../src/guestfs-actions.pod:2702
25044 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
25045 " const char *root);\n"
25050 #: ../src/guestfs-actions.pod:2731
25052 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25053 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
25057 #: ../src/guestfs-actions.pod:2735 ../src/guestfs-actions.pod:3003
25058 #: ../src/guestfs-actions.pod:3801 ../src/guestfs-actions.pod:5083
25059 #: ../src/guestfs-actions.pod:7137
25061 "This function returns a NULL-terminated array of strings, or NULL if there "
25062 "was an error. The array of strings will always have length C<2n+1>, where "
25063 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
25064 "caller must free the strings and the array after use>."
25068 #: ../src/guestfs-actions.pod:2741 ../src/guestfs-actions.pod:3197
25069 msgid "(Added in 1.9.17)"
25073 #: ../src/guestfs-actions.pod:2743
25074 msgid "guestfs_inspect_get_filesystems"
25078 #: ../src/guestfs-actions.pod:2745
25082 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
25083 " const char *root);\n"
25088 #: ../src/guestfs-actions.pod:2757
25090 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25091 "C<guestfs_inspect_get_mountpoints>."
25095 #: ../src/guestfs-actions.pod:2766
25096 msgid "guestfs_inspect_get_format"
25100 #: ../src/guestfs-actions.pod:2768
25104 " guestfs_inspect_get_format (guestfs_h *g,\n"
25105 " const char *root);\n"
25110 #: ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:3233
25111 #: ../src/guestfs-actions.pod:3249 ../src/guestfs-actions.pod:3267
25112 #: ../src/guestfs-actions.pod:6033
25113 msgid "(Added in 1.9.4)"
25117 #: ../src/guestfs-actions.pod:2804
25118 msgid "guestfs_inspect_get_hostname"
25122 #: ../src/guestfs-actions.pod:2806
25126 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
25127 " const char *root);\n"
25132 #: ../src/guestfs-actions.pod:2821
25133 msgid "(Added in 1.7.9)"
25137 #: ../src/guestfs-actions.pod:2823
25138 msgid "guestfs_inspect_get_icon"
25142 #: ../src/guestfs-actions.pod:2825
25146 " guestfs_inspect_get_icon (guestfs_h *g,\n"
25147 " const char *root,\n"
25148 " size_t *size_r,\n"
25154 #: ../src/guestfs-actions.pod:2836
25157 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
25158 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
25163 #: ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:3728
25164 #: ../src/guestfs-actions.pod:4982
25165 msgid "(Added in 1.11.12)"
25169 #: ../src/guestfs-actions.pod:2905
25170 msgid "guestfs_inspect_get_icon_va"
25174 #: ../src/guestfs-actions.pod:2907
25178 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
25179 " const char *root,\n"
25180 " size_t *size_r,\n"
25181 " va_list args);\n"
25186 #: ../src/guestfs-actions.pod:2913
25187 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
25191 #: ../src/guestfs-actions.pod:2917
25192 msgid "guestfs_inspect_get_icon_argv"
25196 #: ../src/guestfs-actions.pod:2919
25200 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
25201 " const char *root,\n"
25202 " size_t *size_r,\n"
25203 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
25208 #: ../src/guestfs-actions.pod:2925
25209 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
25213 #: ../src/guestfs-actions.pod:2929
25214 msgid "guestfs_inspect_get_major_version"
25218 #: ../src/guestfs-actions.pod:2931
25222 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
25223 " const char *root);\n"
25228 #: ../src/guestfs-actions.pod:2953
25229 msgid "guestfs_inspect_get_minor_version"
25233 #: ../src/guestfs-actions.pod:2955
25237 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
25238 " const char *root);\n"
25243 #: ../src/guestfs-actions.pod:2964
25245 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25246 "C<guestfs_inspect_get_major_version>."
25250 #: ../src/guestfs-actions.pod:2971
25251 msgid "guestfs_inspect_get_mountpoints"
25255 #: ../src/guestfs-actions.pod:2973
25259 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
25260 " const char *root);\n"
25265 #: ../src/guestfs-actions.pod:2994
25267 "For operating systems like Windows which still use drive letters, this call "
25268 "will only return an entry for the first drive \"mounted on\" C</>. For "
25269 "information about the mapping of drive letters to partitions, see "
25270 "C<guestfs_inspect_get_drive_mappings>."
25274 #: ../src/guestfs-actions.pod:3000
25276 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25277 "C<guestfs_inspect_get_filesystems>."
25281 #: ../src/guestfs-actions.pod:3011
25282 msgid "guestfs_inspect_get_package_format"
25286 #: ../src/guestfs-actions.pod:3013
25290 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
25291 " const char *root);\n"
25296 #: ../src/guestfs-actions.pod:3017
25298 "This function and C<guestfs_inspect_get_package_management> return the "
25299 "package format and package management tool used by the inspected operating "
25300 "system. For example for Fedora these functions would return C<rpm> (package "
25301 "format) and C<yum> (package management)."
25305 #: ../src/guestfs-actions.pod:3035 ../src/guestfs-actions.pod:3063
25306 msgid "(Added in 1.7.5)"
25310 #: ../src/guestfs-actions.pod:3037
25311 msgid "guestfs_inspect_get_package_management"
25315 #: ../src/guestfs-actions.pod:3039
25319 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
25320 " const char *root);\n"
25325 #: ../src/guestfs-actions.pod:3043
25327 "C<guestfs_inspect_get_package_format> and this function return the package "
25328 "format and package management tool used by the inspected operating system. "
25329 "For example for Fedora these functions would return C<rpm> (package format) "
25330 "and C<yum> (package management)."
25334 #: ../src/guestfs-actions.pod:3065
25335 msgid "guestfs_inspect_get_product_name"
25339 #: ../src/guestfs-actions.pod:3067
25343 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
25344 " const char *root);\n"
25349 #: ../src/guestfs-actions.pod:3086
25350 msgid "guestfs_inspect_get_product_variant"
25354 #: ../src/guestfs-actions.pod:3088
25358 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
25359 " const char *root);\n"
25364 #: ../src/guestfs-actions.pod:3111
25366 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25367 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
25371 #: ../src/guestfs-actions.pod:3118
25372 msgid "(Added in 1.9.13)"
25376 #: ../src/guestfs-actions.pod:3120
25377 msgid "guestfs_inspect_get_roots"
25381 #: ../src/guestfs-actions.pod:3122
25385 " guestfs_inspect_get_roots (guestfs_h *g);\n"
25390 #: ../src/guestfs-actions.pod:3125
25392 "This function is a convenient way to get the list of root devices, as "
25393 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
25394 "the whole inspection process."
25398 #: ../src/guestfs-actions.pod:3129
25400 "This returns an empty list if either no root devices were found or the "
25401 "caller has not called C<guestfs_inspect_os>."
25405 #: ../src/guestfs-actions.pod:3138
25406 msgid "(Added in 1.7.3)"
25410 #: ../src/guestfs-actions.pod:3140
25411 msgid "guestfs_inspect_get_type"
25415 #: ../src/guestfs-actions.pod:3142
25419 " guestfs_inspect_get_type (guestfs_h *g,\n"
25420 " const char *root);\n"
25425 #: ../src/guestfs-actions.pod:3179
25426 msgid "guestfs_inspect_get_windows_current_control_set"
25430 #: ../src/guestfs-actions.pod:3181
25434 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
25435 " const char *root);\n"
25440 #: ../src/guestfs-actions.pod:3199
25441 msgid "guestfs_inspect_get_windows_systemroot"
25445 #: ../src/guestfs-actions.pod:3201
25449 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
25450 " const char *root);\n"
25455 #: ../src/guestfs-actions.pod:3217
25456 msgid "(Added in 1.5.25)"
25460 #: ../src/guestfs-actions.pod:3219
25461 msgid "guestfs_inspect_is_live"
25465 #: ../src/guestfs-actions.pod:3221
25469 " guestfs_inspect_is_live (guestfs_h *g,\n"
25470 " const char *root);\n"
25475 #: ../src/guestfs-actions.pod:3225
25477 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25478 "disk), then this returns true if a live image was detected on the disk."
25482 #: ../src/guestfs-actions.pod:3235
25483 msgid "guestfs_inspect_is_multipart"
25487 #: ../src/guestfs-actions.pod:3237
25491 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
25492 " const char *root);\n"
25497 #: ../src/guestfs-actions.pod:3241
25499 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25500 "disk), then this returns true if the disk is part of a set."
25504 #: ../src/guestfs-actions.pod:3251
25505 msgid "guestfs_inspect_is_netinst"
25509 #: ../src/guestfs-actions.pod:3253
25513 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
25514 " const char *root);\n"
25519 #: ../src/guestfs-actions.pod:3257
25521 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25522 "disk), then this returns true if the disk is a network installer, ie. not a "
25523 "self-contained install CD but one which is likely to require network access "
25524 "to complete the install."
25528 #: ../src/guestfs-actions.pod:3269
25529 msgid "guestfs_inspect_list_applications"
25533 #: ../src/guestfs-actions.pod:3271
25536 " struct guestfs_application_list *\n"
25537 " guestfs_inspect_list_applications (guestfs_h *g,\n"
25538 " const char *root);\n"
25543 #: ../src/guestfs-actions.pod:3277
25545 "I<Note:> This call works differently from other parts of the inspection "
25546 "API. You have to call C<guestfs_inspect_os>, then "
25547 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
25548 "this. Listing applications is a significantly more difficult operation "
25549 "which requires access to the full filesystem. Also note that unlike the "
25550 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
25551 "the libguestfs handle, this call actually reads parts of the mounted "
25552 "filesystems during the call."
25556 #: ../src/guestfs-actions.pod:3367
25558 "This function returns a C<struct guestfs_application_list *>, or NULL if "
25559 "there was an error. I<The caller must call C<guestfs_free_application_list> "
25564 #: ../src/guestfs-actions.pod:3371
25565 msgid "(Added in 1.7.8)"
25569 #: ../src/guestfs-actions.pod:3373
25570 msgid "guestfs_inspect_os"
25574 #: ../src/guestfs-actions.pod:3375
25578 " guestfs_inspect_os (guestfs_h *g);\n"
25583 #: ../src/guestfs-actions.pod:3391
25585 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
25586 "functions in order to query further information about each operating system, "
25587 "such as the name and version."
25591 #: ../src/guestfs-actions.pod:3396
25593 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
25594 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
25595 "the contents. This should be called with no disks currently mounted. The "
25596 "function may also use Augeas, so any existing Augeas handle will be closed."
25600 #: ../src/guestfs-actions.pod:3408 ../src/guestfs-actions.pod:3739
25601 #: ../src/guestfs-actions.pod:3821
25602 msgid "See also C<guestfs_list_filesystems>."
25606 #: ../src/guestfs-actions.pod:3416
25607 msgid "guestfs_is_blockdev"
25611 #: ../src/guestfs-actions.pod:3418
25615 " guestfs_is_blockdev (guestfs_h *g,\n"
25616 " const char *path);\n"
25621 #: ../src/guestfs-actions.pod:3425 ../src/guestfs-actions.pod:3454
25622 #: ../src/guestfs-actions.pod:3484 ../src/guestfs-actions.pod:3499
25623 #: ../src/guestfs-actions.pod:3515 ../src/guestfs-actions.pod:3571
25624 #: ../src/guestfs-actions.pod:3586
25625 msgid "See also C<guestfs_stat>."
25629 #: ../src/guestfs-actions.pod:3429 ../src/guestfs-actions.pod:3458
25630 #: ../src/guestfs-actions.pod:3503 ../src/guestfs-actions.pod:3575
25631 #: ../src/guestfs-actions.pod:3590
25632 msgid "(Added in 1.5.10)"
25636 #: ../src/guestfs-actions.pod:3431
25637 msgid "guestfs_is_busy"
25641 #: ../src/guestfs-actions.pod:3433
25645 " guestfs_is_busy (guestfs_h *g);\n"
25650 #: ../src/guestfs-actions.pod:3445
25651 msgid "guestfs_is_chardev"
25655 #: ../src/guestfs-actions.pod:3447
25659 " guestfs_is_chardev (guestfs_h *g,\n"
25660 " const char *path);\n"
25665 #: ../src/guestfs-actions.pod:3460
25666 msgid "guestfs_is_config"
25670 #: ../src/guestfs-actions.pod:3462
25674 " guestfs_is_config (guestfs_h *g);\n"
25679 #: ../src/guestfs-actions.pod:3474
25680 msgid "guestfs_is_dir"
25684 #: ../src/guestfs-actions.pod:3476
25688 " guestfs_is_dir (guestfs_h *g,\n"
25689 " const char *path);\n"
25694 #: ../src/guestfs-actions.pod:3490
25695 msgid "guestfs_is_fifo"
25699 #: ../src/guestfs-actions.pod:3492
25703 " guestfs_is_fifo (guestfs_h *g,\n"
25704 " const char *path);\n"
25709 #: ../src/guestfs-actions.pod:3505
25710 msgid "guestfs_is_file"
25714 #: ../src/guestfs-actions.pod:3507
25718 " guestfs_is_file (guestfs_h *g,\n"
25719 " const char *path);\n"
25724 #: ../src/guestfs-actions.pod:3521
25725 msgid "guestfs_is_launching"
25729 #: ../src/guestfs-actions.pod:3523
25733 " guestfs_is_launching (guestfs_h *g);\n"
25738 #: ../src/guestfs-actions.pod:3535
25739 msgid "guestfs_is_lv"
25743 #: ../src/guestfs-actions.pod:3537
25747 " guestfs_is_lv (guestfs_h *g,\n"
25748 " const char *device);\n"
25753 #: ../src/guestfs-actions.pod:3548
25754 msgid "guestfs_is_ready"
25758 #: ../src/guestfs-actions.pod:3550
25762 " guestfs_is_ready (guestfs_h *g);\n"
25767 #: ../src/guestfs-actions.pod:3562
25768 msgid "guestfs_is_socket"
25772 #: ../src/guestfs-actions.pod:3564
25776 " guestfs_is_socket (guestfs_h *g,\n"
25777 " const char *path);\n"
25782 #: ../src/guestfs-actions.pod:3577
25783 msgid "guestfs_is_symlink"
25787 #: ../src/guestfs-actions.pod:3579
25791 " guestfs_is_symlink (guestfs_h *g,\n"
25792 " const char *path);\n"
25797 #: ../src/guestfs-actions.pod:3592
25798 msgid "guestfs_is_zero"
25802 #: ../src/guestfs-actions.pod:3594
25806 " guestfs_is_zero (guestfs_h *g,\n"
25807 " const char *path);\n"
25812 #: ../src/guestfs-actions.pod:3603 ../src/guestfs-actions.pod:3617
25813 msgid "(Added in 1.11.8)"
25817 #: ../src/guestfs-actions.pod:3605
25818 msgid "guestfs_is_zero_device"
25822 #: ../src/guestfs-actions.pod:3607
25826 " guestfs_is_zero_device (guestfs_h *g,\n"
25827 " const char *device);\n"
25832 #: ../src/guestfs-actions.pod:3619
25833 msgid "guestfs_kill_subprocess"
25837 #: ../src/guestfs-actions.pod:3621
25841 " guestfs_kill_subprocess (guestfs_h *g);\n"
25846 #: ../src/guestfs-actions.pod:3630
25847 msgid "guestfs_launch"
25851 #: ../src/guestfs-actions.pod:3632
25855 " guestfs_launch (guestfs_h *g);\n"
25860 #: ../src/guestfs-actions.pod:3650
25861 msgid "guestfs_lchown"
25865 #: ../src/guestfs-actions.pod:3652
25869 " guestfs_lchown (guestfs_h *g,\n"
25872 " const char *path);\n"
25877 #: ../src/guestfs-actions.pod:3658
25879 "Change the file owner to C<owner> and group to C<group>. This is like "
25880 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
25881 "changed, not the target."
25885 #: ../src/guestfs-actions.pod:3670
25886 msgid "guestfs_lgetxattr"
25890 #: ../src/guestfs-actions.pod:3672
25894 " guestfs_lgetxattr (guestfs_h *g,\n"
25895 " const char *path,\n"
25896 " const char *name,\n"
25897 " size_t *size_r);\n"
25902 #: ../src/guestfs-actions.pod:3692
25903 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
25907 #: ../src/guestfs-actions.pod:3700
25908 msgid "guestfs_lgetxattrs"
25912 #: ../src/guestfs-actions.pod:3702
25915 " struct guestfs_xattr_list *\n"
25916 " guestfs_lgetxattrs (guestfs_h *g,\n"
25917 " const char *path);\n"
25922 #: ../src/guestfs-actions.pod:3706
25924 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
25925 "then it returns the extended attributes of the link itself."
25929 #: ../src/guestfs-actions.pod:3716
25930 msgid "guestfs_list_9p"
25934 #: ../src/guestfs-actions.pod:3718
25938 " guestfs_list_9p (guestfs_h *g);\n"
25943 #: ../src/guestfs-actions.pod:3730
25944 msgid "guestfs_list_devices"
25948 #: ../src/guestfs-actions.pod:3732
25952 " guestfs_list_devices (guestfs_h *g);\n"
25957 #: ../src/guestfs-actions.pod:3747
25958 msgid "guestfs_list_dm_devices"
25962 #: ../src/guestfs-actions.pod:3749
25966 " guestfs_list_dm_devices (guestfs_h *g);\n"
25971 #: ../src/guestfs-actions.pod:3754
25973 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
25974 "previous call to C<guestfs_luks_open>."
25978 #: ../src/guestfs-actions.pod:3757
25980 "Device mapper devices which correspond to logical volumes are I<not> "
25981 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
25986 #: ../src/guestfs-actions.pod:3765 ../src/guestfs-actions.pod:5221
25987 msgid "(Added in 1.11.15)"
25991 #: ../src/guestfs-actions.pod:3767
25992 msgid "guestfs_list_filesystems"
25996 #: ../src/guestfs-actions.pod:3769
26000 " guestfs_list_filesystems (guestfs_h *g);\n"
26005 #: ../src/guestfs-actions.pod:3789
26007 "This command runs other libguestfs commands, which might include "
26008 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
26009 "soon after launch and only when nothing is mounted."
26013 #: ../src/guestfs-actions.pod:3793
26015 "Not all of the filesystems returned will be mountable. In particular, swap "
26016 "partitions are returned in the list. Also this command does not check that "
26017 "each filesystem found is valid and mountable, and some filesystems might be "
26018 "mountable but require special options. Filesystems may not all belong to a "
26019 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
26023 #: ../src/guestfs-actions.pod:3807 ../src/guestfs-actions.pod:5582
26024 msgid "(Added in 1.5.15)"
26028 #: ../src/guestfs-actions.pod:3809
26029 msgid "guestfs_list_partitions"
26033 #: ../src/guestfs-actions.pod:3811
26037 " guestfs_list_partitions (guestfs_h *g);\n"
26042 #: ../src/guestfs-actions.pod:3818
26044 "This does not return logical volumes. For that you will need to call "
26049 #: ../src/guestfs-actions.pod:3829
26054 #: ../src/guestfs-actions.pod:3831
26058 " guestfs_ll (guestfs_h *g,\n"
26059 " const char *directory);\n"
26064 #: ../src/guestfs-actions.pod:3846
26069 #: ../src/guestfs-actions.pod:3848
26073 " guestfs_ln (guestfs_h *g,\n"
26074 " const char *target,\n"
26075 " const char *linkname);\n"
26080 #: ../src/guestfs-actions.pod:3859
26081 msgid "guestfs_ln_f"
26085 #: ../src/guestfs-actions.pod:3861
26089 " guestfs_ln_f (guestfs_h *g,\n"
26090 " const char *target,\n"
26091 " const char *linkname);\n"
26096 #: ../src/guestfs-actions.pod:3873
26097 msgid "guestfs_ln_s"
26101 #: ../src/guestfs-actions.pod:3875
26105 " guestfs_ln_s (guestfs_h *g,\n"
26106 " const char *target,\n"
26107 " const char *linkname);\n"
26112 #: ../src/guestfs-actions.pod:3886
26113 msgid "guestfs_ln_sf"
26117 #: ../src/guestfs-actions.pod:3888
26121 " guestfs_ln_sf (guestfs_h *g,\n"
26122 " const char *target,\n"
26123 " const char *linkname);\n"
26128 #: ../src/guestfs-actions.pod:3900
26129 msgid "guestfs_lremovexattr"
26133 #: ../src/guestfs-actions.pod:3902
26137 " guestfs_lremovexattr (guestfs_h *g,\n"
26138 " const char *xattr,\n"
26139 " const char *path);\n"
26144 #: ../src/guestfs-actions.pod:3907
26146 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
26147 "link, then it removes an extended attribute of the link itself."
26151 #: ../src/guestfs-actions.pod:3915
26156 #: ../src/guestfs-actions.pod:3917
26160 " guestfs_ls (guestfs_h *g,\n"
26161 " const char *directory);\n"
26166 #: ../src/guestfs-actions.pod:3925
26168 "This command is mostly useful for interactive sessions. Programs should "
26169 "probably use C<guestfs_readdir> instead."
26173 #: ../src/guestfs-actions.pod:3934
26174 msgid "guestfs_lsetxattr"
26178 #: ../src/guestfs-actions.pod:3936
26182 " guestfs_lsetxattr (guestfs_h *g,\n"
26183 " const char *xattr,\n"
26184 " const char *val,\n"
26186 " const char *path);\n"
26191 #: ../src/guestfs-actions.pod:3943
26193 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
26194 "then it sets an extended attribute of the link itself."
26198 #: ../src/guestfs-actions.pod:3951
26199 msgid "guestfs_lstat"
26203 #: ../src/guestfs-actions.pod:3953
26206 " struct guestfs_stat *\n"
26207 " guestfs_lstat (guestfs_h *g,\n"
26208 " const char *path);\n"
26213 #: ../src/guestfs-actions.pod:3959
26215 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
26216 "link, then the link is stat-ed, not the file it refers to."
26220 #: ../src/guestfs-actions.pod:3965 ../src/guestfs-actions.pod:6740
26222 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
26223 "error. I<The caller must call C<guestfs_free_stat> after use>."
26227 #: ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:6744
26228 #: ../src/guestfs-actions.pod:6762 ../src/guestfs-actions.pod:7143
26229 msgid "(Added in 0.9.2)"
26233 #: ../src/guestfs-actions.pod:3971
26234 msgid "guestfs_lstatlist"
26238 #: ../src/guestfs-actions.pod:3973
26241 " struct guestfs_stat_list *\n"
26242 " guestfs_lstatlist (guestfs_h *g,\n"
26243 " const char *path,\n"
26244 " char *const *names);\n"
26249 #: ../src/guestfs-actions.pod:3978
26251 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
26252 "files, where all files are in the directory C<path>. C<names> is the list "
26253 "of files from this directory."
26257 #: ../src/guestfs-actions.pod:3987
26259 "This call is intended for programs that want to efficiently list a directory "
26260 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
26261 "for a similarly efficient call for getting extended attributes. Very long "
26262 "directory listings might cause the protocol message size to be exceeded, "
26263 "causing this call to fail. The caller must split up such requests into "
26264 "smaller groups of names."
26268 #: ../src/guestfs-actions.pod:3995
26270 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
26271 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
26275 #: ../src/guestfs-actions.pod:4001
26276 msgid "guestfs_luks_add_key"
26280 #: ../src/guestfs-actions.pod:4003
26284 " guestfs_luks_add_key (guestfs_h *g,\n"
26285 " const char *device,\n"
26286 " const char *key,\n"
26287 " const char *newkey,\n"
26293 #: ../src/guestfs-actions.pod:4015
26295 "Note that if C<keyslot> already contains a key, then this command will "
26296 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
26300 #: ../src/guestfs-actions.pod:4021 ../src/guestfs-actions.pod:4061
26301 #: ../src/guestfs-actions.pod:4084 ../src/guestfs-actions.pod:4104
26302 #: ../src/guestfs-actions.pod:4139 ../src/guestfs-actions.pod:4158
26304 "This function takes a key or passphrase parameter which could contain "
26305 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
26310 #: ../src/guestfs-actions.pod:4025 ../src/guestfs-actions.pod:4065
26311 #: ../src/guestfs-actions.pod:4088 ../src/guestfs-actions.pod:4108
26312 msgid "(Added in 1.5.2)"
26316 #: ../src/guestfs-actions.pod:4027
26317 msgid "guestfs_luks_close"
26321 #: ../src/guestfs-actions.pod:4029
26325 " guestfs_luks_close (guestfs_h *g,\n"
26326 " const char *device);\n"
26331 #: ../src/guestfs-actions.pod:4033
26333 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
26334 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
26335 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
26336 "underlying block device."
26340 #: ../src/guestfs-actions.pod:4041 ../src/guestfs-actions.pod:4143
26341 #: ../src/guestfs-actions.pod:4162 ../src/guestfs-actions.pod:4212
26342 #: ../src/guestfs-actions.pod:4260
26343 msgid "(Added in 1.5.1)"
26347 #: ../src/guestfs-actions.pod:4043
26348 msgid "guestfs_luks_format"
26352 #: ../src/guestfs-actions.pod:4045
26356 " guestfs_luks_format (guestfs_h *g,\n"
26357 " const char *device,\n"
26358 " const char *key,\n"
26364 #: ../src/guestfs-actions.pod:4067
26365 msgid "guestfs_luks_format_cipher"
26369 #: ../src/guestfs-actions.pod:4069
26373 " guestfs_luks_format_cipher (guestfs_h *g,\n"
26374 " const char *device,\n"
26375 " const char *key,\n"
26377 " const char *cipher);\n"
26382 #: ../src/guestfs-actions.pod:4076
26384 "This command is the same as C<guestfs_luks_format> but it also allows you to "
26385 "set the C<cipher> used."
26389 #: ../src/guestfs-actions.pod:4090
26390 msgid "guestfs_luks_kill_slot"
26394 #: ../src/guestfs-actions.pod:4092
26398 " guestfs_luks_kill_slot (guestfs_h *g,\n"
26399 " const char *device,\n"
26400 " const char *key,\n"
26406 #: ../src/guestfs-actions.pod:4110
26407 msgid "guestfs_luks_open"
26411 #: ../src/guestfs-actions.pod:4112
26415 " guestfs_luks_open (guestfs_h *g,\n"
26416 " const char *device,\n"
26417 " const char *key,\n"
26418 " const char *mapname);\n"
26423 #: ../src/guestfs-actions.pod:4130
26425 "If this block device contains LVM volume groups, then calling "
26426 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
26431 #: ../src/guestfs-actions.pod:4134
26432 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
26436 #: ../src/guestfs-actions.pod:4145
26437 msgid "guestfs_luks_open_ro"
26441 #: ../src/guestfs-actions.pod:4147
26445 " guestfs_luks_open_ro (guestfs_h *g,\n"
26446 " const char *device,\n"
26447 " const char *key,\n"
26448 " const char *mapname);\n"
26453 #: ../src/guestfs-actions.pod:4153
26455 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
26460 #: ../src/guestfs-actions.pod:4164
26461 msgid "guestfs_lvcreate"
26465 #: ../src/guestfs-actions.pod:4166
26469 " guestfs_lvcreate (guestfs_h *g,\n"
26470 " const char *logvol,\n"
26471 " const char *volgroup,\n"
26477 #: ../src/guestfs-actions.pod:4179
26478 msgid "guestfs_lvm_canonical_lv_name"
26482 #: ../src/guestfs-actions.pod:4181
26486 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
26487 " const char *lvname);\n"
26492 #: ../src/guestfs-actions.pod:4192
26493 msgid "See also C<guestfs_is_lv>."
26497 #: ../src/guestfs-actions.pod:4197
26498 msgid "(Added in 1.5.24)"
26502 #: ../src/guestfs-actions.pod:4199
26503 msgid "guestfs_lvm_clear_filter"
26507 #: ../src/guestfs-actions.pod:4201
26511 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
26516 #: ../src/guestfs-actions.pod:4204
26518 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
26519 "see every block device."
26523 #: ../src/guestfs-actions.pod:4214
26524 msgid "guestfs_lvm_remove_all"
26528 #: ../src/guestfs-actions.pod:4216
26532 " guestfs_lvm_remove_all (guestfs_h *g);\n"
26537 #: ../src/guestfs-actions.pod:4229
26538 msgid "guestfs_lvm_set_filter"
26542 #: ../src/guestfs-actions.pod:4231
26546 " guestfs_lvm_set_filter (guestfs_h *g,\n"
26547 " char *const *devices);\n"
26552 #: ../src/guestfs-actions.pod:4262
26553 msgid "guestfs_lvremove"
26557 #: ../src/guestfs-actions.pod:4264
26561 " guestfs_lvremove (guestfs_h *g,\n"
26562 " const char *device);\n"
26567 #: ../src/guestfs-actions.pod:4276 ../src/guestfs-actions.pod:5679
26568 #: ../src/guestfs-actions.pod:7513
26569 msgid "(Added in 1.0.13)"
26573 #: ../src/guestfs-actions.pod:4278
26574 msgid "guestfs_lvrename"
26578 #: ../src/guestfs-actions.pod:4280
26582 " guestfs_lvrename (guestfs_h *g,\n"
26583 " const char *logvol,\n"
26584 " const char *newlogvol);\n"
26589 #: ../src/guestfs-actions.pod:4289 ../src/guestfs-actions.pod:7526
26590 msgid "(Added in 1.0.83)"
26594 #: ../src/guestfs-actions.pod:4291
26595 msgid "guestfs_lvresize"
26599 #: ../src/guestfs-actions.pod:4293
26603 " guestfs_lvresize (guestfs_h *g,\n"
26604 " const char *device,\n"
26610 #: ../src/guestfs-actions.pod:4306
26611 msgid "guestfs_lvresize_free"
26615 #: ../src/guestfs-actions.pod:4308
26619 " guestfs_lvresize_free (guestfs_h *g,\n"
26620 " const char *lv,\n"
26626 #: ../src/guestfs-actions.pod:4321
26627 msgid "(Added in 1.3.3)"
26631 #: ../src/guestfs-actions.pod:4323
26632 msgid "guestfs_lvs"
26636 #: ../src/guestfs-actions.pod:4325
26640 " guestfs_lvs (guestfs_h *g);\n"
26645 #: ../src/guestfs-actions.pod:4334
26646 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
26650 #: ../src/guestfs-actions.pod:4342
26651 msgid "guestfs_lvs_full"
26655 #: ../src/guestfs-actions.pod:4344
26658 " struct guestfs_lvm_lv_list *\n"
26659 " guestfs_lvs_full (guestfs_h *g);\n"
26664 #: ../src/guestfs-actions.pod:4350
26666 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
26667 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
26671 #: ../src/guestfs-actions.pod:4356
26672 msgid "guestfs_lvuuid"
26676 #: ../src/guestfs-actions.pod:4358
26680 " guestfs_lvuuid (guestfs_h *g,\n"
26681 " const char *device);\n"
26686 #: ../src/guestfs-actions.pod:4369
26687 msgid "guestfs_lxattrlist"
26691 #: ../src/guestfs-actions.pod:4371
26694 " struct guestfs_xattr_list *\n"
26695 " guestfs_lxattrlist (guestfs_h *g,\n"
26696 " const char *path,\n"
26697 " char *const *names);\n"
26702 #: ../src/guestfs-actions.pod:4390
26704 "This call is intended for programs that want to efficiently list a directory "
26705 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
26706 "a similarly efficient call for getting standard stats. Very long directory "
26707 "listings might cause the protocol message size to be exceeded, causing this "
26708 "call to fail. The caller must split up such requests into smaller groups of "
26713 #: ../src/guestfs-actions.pod:4404
26714 msgid "guestfs_mkdir"
26718 #: ../src/guestfs-actions.pod:4406
26722 " guestfs_mkdir (guestfs_h *g,\n"
26723 " const char *path);\n"
26728 #: ../src/guestfs-actions.pod:4416
26729 msgid "guestfs_mkdir_mode"
26733 #: ../src/guestfs-actions.pod:4418
26737 " guestfs_mkdir_mode (guestfs_h *g,\n"
26738 " const char *path,\n"
26744 #: ../src/guestfs-actions.pod:4430
26745 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
26749 #: ../src/guestfs-actions.pod:4436
26750 msgid "guestfs_mkdir_p"
26754 #: ../src/guestfs-actions.pod:4438
26758 " guestfs_mkdir_p (guestfs_h *g,\n"
26759 " const char *path);\n"
26764 #: ../src/guestfs-actions.pod:4449
26765 msgid "guestfs_mkdtemp"
26769 #: ../src/guestfs-actions.pod:4451
26773 " guestfs_mkdtemp (guestfs_h *g,\n"
26774 " const char *template);\n"
26779 #: ../src/guestfs-actions.pod:4479
26780 msgid "guestfs_mke2fs_J"
26784 #: ../src/guestfs-actions.pod:4481
26788 " guestfs_mke2fs_J (guestfs_h *g,\n"
26789 " const char *fstype,\n"
26790 " int blocksize,\n"
26791 " const char *device,\n"
26792 " const char *journal);\n"
26797 #: ../src/guestfs-actions.pod:4494
26798 msgid "See also C<guestfs_mke2journal>."
26802 #: ../src/guestfs-actions.pod:4498 ../src/guestfs-actions.pod:4516
26803 #: ../src/guestfs-actions.pod:4534 ../src/guestfs-actions.pod:4550
26804 #: ../src/guestfs-actions.pod:4564 ../src/guestfs-actions.pod:4578
26805 #: ../src/guestfs-actions.pod:4637 ../src/guestfs-actions.pod:4914
26806 msgid "(Added in 1.0.68)"
26810 #: ../src/guestfs-actions.pod:4500
26811 msgid "guestfs_mke2fs_JL"
26815 #: ../src/guestfs-actions.pod:4502
26819 " guestfs_mke2fs_JL (guestfs_h *g,\n"
26820 " const char *fstype,\n"
26821 " int blocksize,\n"
26822 " const char *device,\n"
26823 " const char *label);\n"
26828 #: ../src/guestfs-actions.pod:4512
26829 msgid "See also C<guestfs_mke2journal_L>."
26833 #: ../src/guestfs-actions.pod:4518
26834 msgid "guestfs_mke2fs_JU"
26838 #: ../src/guestfs-actions.pod:4520
26842 " guestfs_mke2fs_JU (guestfs_h *g,\n"
26843 " const char *fstype,\n"
26844 " int blocksize,\n"
26845 " const char *device,\n"
26846 " const char *uuid);\n"
26851 #: ../src/guestfs-actions.pod:4530
26852 msgid "See also C<guestfs_mke2journal_U>."
26856 #: ../src/guestfs-actions.pod:4536
26857 msgid "guestfs_mke2journal"
26861 #: ../src/guestfs-actions.pod:4538
26865 " guestfs_mke2journal (guestfs_h *g,\n"
26866 " int blocksize,\n"
26867 " const char *device);\n"
26872 #: ../src/guestfs-actions.pod:4552
26873 msgid "guestfs_mke2journal_L"
26877 #: ../src/guestfs-actions.pod:4554
26881 " guestfs_mke2journal_L (guestfs_h *g,\n"
26882 " int blocksize,\n"
26883 " const char *label,\n"
26884 " const char *device);\n"
26889 #: ../src/guestfs-actions.pod:4566
26890 msgid "guestfs_mke2journal_U"
26894 #: ../src/guestfs-actions.pod:4568
26898 " guestfs_mke2journal_U (guestfs_h *g,\n"
26899 " int blocksize,\n"
26900 " const char *uuid,\n"
26901 " const char *device);\n"
26906 #: ../src/guestfs-actions.pod:4580
26907 msgid "guestfs_mkfifo"
26911 #: ../src/guestfs-actions.pod:4582
26915 " guestfs_mkfifo (guestfs_h *g,\n"
26917 " const char *path);\n"
26922 #: ../src/guestfs-actions.pod:4587
26924 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
26925 "is just a convenient wrapper around C<guestfs_mknod>."
26929 #: ../src/guestfs-actions.pod:4597
26930 msgid "guestfs_mkfs"
26934 #: ../src/guestfs-actions.pod:4599
26938 " guestfs_mkfs (guestfs_h *g,\n"
26939 " const char *fstype,\n"
26940 " const char *device);\n"
26945 #: ../src/guestfs-actions.pod:4612
26946 msgid "guestfs_mkfs_b"
26950 #: ../src/guestfs-actions.pod:4614
26954 " guestfs_mkfs_b (guestfs_h *g,\n"
26955 " const char *fstype,\n"
26956 " int blocksize,\n"
26957 " const char *device);\n"
26962 #: ../src/guestfs-actions.pod:4620
26964 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
26969 #: ../src/guestfs-actions.pod:4627
26971 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
26972 "block size of the resulting filesystem. Supported block sizes depend on the "
26973 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
26977 #: ../src/guestfs-actions.pod:4639
26978 msgid "guestfs_mkfs_opts"
26982 #: ../src/guestfs-actions.pod:4641
26986 " guestfs_mkfs_opts (guestfs_h *g,\n"
26987 " const char *fstype,\n"
26988 " const char *device,\n"
26994 #: ../src/guestfs-actions.pod:4652
26997 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
26998 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
26999 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
27000 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
27005 #: ../src/guestfs-actions.pod:4700
27006 msgid "(Added in 1.7.19)"
27010 #: ../src/guestfs-actions.pod:4702
27011 msgid "guestfs_mkfs_opts_va"
27015 #: ../src/guestfs-actions.pod:4704
27019 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
27020 " const char *fstype,\n"
27021 " const char *device,\n"
27022 " va_list args);\n"
27027 #: ../src/guestfs-actions.pod:4710
27028 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
27032 #: ../src/guestfs-actions.pod:4714
27033 msgid "guestfs_mkfs_opts_argv"
27037 #: ../src/guestfs-actions.pod:4716
27041 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
27042 " const char *fstype,\n"
27043 " const char *device,\n"
27044 " const struct guestfs_mkfs_opts_argv *optargs);\n"
27049 #: ../src/guestfs-actions.pod:4722
27050 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
27054 #: ../src/guestfs-actions.pod:4726
27055 msgid "guestfs_mkmountpoint"
27059 #: ../src/guestfs-actions.pod:4728
27063 " guestfs_mkmountpoint (guestfs_h *g,\n"
27064 " const char *exemptpath);\n"
27069 #: ../src/guestfs-actions.pod:4732
27071 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
27072 "that can be used to create extra mountpoints before mounting the first "
27077 #: ../src/guestfs-actions.pod:4756
27079 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
27080 "may get unexpected errors if you try to mix these calls. It is safest to "
27081 "manually unmount filesystems and remove mountpoints after use."
27085 #: ../src/guestfs-actions.pod:4760
27087 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
27088 "first, so for this to work for manual mountpoints, you must ensure that the "
27089 "innermost mountpoints have the longest pathnames, as in the example code "
27094 #: ../src/guestfs-actions.pod:4767
27096 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
27097 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
27098 "can also trigger these issues."
27102 #: ../src/guestfs-actions.pod:4773 ../src/guestfs-actions.pod:5089
27103 #: ../src/guestfs-actions.pod:6099
27104 msgid "(Added in 1.0.62)"
27108 #: ../src/guestfs-actions.pod:4775
27109 msgid "guestfs_mknod"
27113 #: ../src/guestfs-actions.pod:4777
27117 " guestfs_mknod (guestfs_h *g,\n"
27121 " const char *path);\n"
27126 #: ../src/guestfs-actions.pod:4792
27128 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
27129 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
27130 "regular file). These constants are available in the standard Linux header "
27131 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
27132 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
27133 "the appropriate constant for you."
27137 #: ../src/guestfs-actions.pod:4806
27138 msgid "guestfs_mknod_b"
27142 #: ../src/guestfs-actions.pod:4808
27146 " guestfs_mknod_b (guestfs_h *g,\n"
27150 " const char *path);\n"
27155 #: ../src/guestfs-actions.pod:4815
27157 "This call creates a block device node called C<path> with mode C<mode> and "
27158 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27159 "wrapper around C<guestfs_mknod>."
27163 #: ../src/guestfs-actions.pod:4825
27164 msgid "guestfs_mknod_c"
27168 #: ../src/guestfs-actions.pod:4827
27172 " guestfs_mknod_c (guestfs_h *g,\n"
27176 " const char *path);\n"
27181 #: ../src/guestfs-actions.pod:4834
27183 "This call creates a char device node called C<path> with mode C<mode> and "
27184 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27185 "wrapper around C<guestfs_mknod>."
27189 #: ../src/guestfs-actions.pod:4844
27190 msgid "guestfs_mkswap"
27194 #: ../src/guestfs-actions.pod:4846
27198 " guestfs_mkswap (guestfs_h *g,\n"
27199 " const char *device);\n"
27204 #: ../src/guestfs-actions.pod:4856
27205 msgid "guestfs_mkswap_L"
27209 #: ../src/guestfs-actions.pod:4858
27213 " guestfs_mkswap_L (guestfs_h *g,\n"
27214 " const char *label,\n"
27215 " const char *device);\n"
27220 #: ../src/guestfs-actions.pod:4873
27221 msgid "guestfs_mkswap_U"
27225 #: ../src/guestfs-actions.pod:4875
27229 " guestfs_mkswap_U (guestfs_h *g,\n"
27230 " const char *uuid,\n"
27231 " const char *device);\n"
27236 #: ../src/guestfs-actions.pod:4886
27237 msgid "guestfs_mkswap_file"
27241 #: ../src/guestfs-actions.pod:4888
27245 " guestfs_mkswap_file (guestfs_h *g,\n"
27246 " const char *path);\n"
27251 #: ../src/guestfs-actions.pod:4894
27253 "This command just writes a swap file signature to an existing file. To "
27254 "create the file itself, use something like C<guestfs_fallocate>."
27258 #: ../src/guestfs-actions.pod:4901
27259 msgid "guestfs_modprobe"
27263 #: ../src/guestfs-actions.pod:4903
27267 " guestfs_modprobe (guestfs_h *g,\n"
27268 " const char *modulename);\n"
27273 #: ../src/guestfs-actions.pod:4916
27274 msgid "guestfs_mount"
27278 #: ../src/guestfs-actions.pod:4918
27282 " guestfs_mount (guestfs_h *g,\n"
27283 " const char *device,\n"
27284 " const char *mountpoint);\n"
27289 #: ../src/guestfs-actions.pod:4923
27291 "I<This function is deprecated.> In new code, use the L</"
27292 "guestfs_mount_options> call instead."
27296 #: ../src/guestfs-actions.pod:4944
27298 "B<Important note:> When you use this call, the filesystem options C<sync> "
27299 "and C<noatime> are set implicitly. This was originally done because we "
27300 "thought it would improve reliability, but it turns out that I<-o sync> has a "
27301 "very large negative performance impact and negligible effect on "
27302 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
27303 "in any code that needs performance, and instead use C<guestfs_mount_options> "
27304 "(use an empty string for the first parameter if you don't want any options)."
27308 #: ../src/guestfs-actions.pod:4958
27309 msgid "guestfs_mount_9p"
27313 #: ../src/guestfs-actions.pod:4960
27317 " guestfs_mount_9p (guestfs_h *g,\n"
27318 " const char *mounttag,\n"
27319 " const char *mountpoint,\n"
27325 #: ../src/guestfs-actions.pod:4971
27328 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
27333 #: ../src/guestfs-actions.pod:4984
27334 msgid "guestfs_mount_9p_va"
27338 #: ../src/guestfs-actions.pod:4986
27342 " guestfs_mount_9p_va (guestfs_h *g,\n"
27343 " const char *mounttag,\n"
27344 " const char *mountpoint,\n"
27345 " va_list args);\n"
27350 #: ../src/guestfs-actions.pod:4992
27351 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
27355 #: ../src/guestfs-actions.pod:4996
27356 msgid "guestfs_mount_9p_argv"
27360 #: ../src/guestfs-actions.pod:4998
27364 " guestfs_mount_9p_argv (guestfs_h *g,\n"
27365 " const char *mounttag,\n"
27366 " const char *mountpoint,\n"
27367 " const struct guestfs_mount_9p_argv *optargs);\n"
27372 #: ../src/guestfs-actions.pod:5004
27373 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
27377 #: ../src/guestfs-actions.pod:5008
27378 msgid "guestfs_mount_loop"
27382 #: ../src/guestfs-actions.pod:5010
27386 " guestfs_mount_loop (guestfs_h *g,\n"
27387 " const char *file,\n"
27388 " const char *mountpoint);\n"
27393 #: ../src/guestfs-actions.pod:5023
27394 msgid "guestfs_mount_options"
27398 #: ../src/guestfs-actions.pod:5025
27402 " guestfs_mount_options (guestfs_h *g,\n"
27403 " const char *options,\n"
27404 " const char *device,\n"
27405 " const char *mountpoint);\n"
27410 #: ../src/guestfs-actions.pod:5031
27412 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27413 "the mount options as for the L<mount(8)> I<-o> flag."
27417 #: ../src/guestfs-actions.pod:5041 ../src/guestfs-actions.pod:5055
27418 #: ../src/guestfs-actions.pod:5072
27419 msgid "(Added in 1.0.10)"
27423 #: ../src/guestfs-actions.pod:5043
27424 msgid "guestfs_mount_ro"
27428 #: ../src/guestfs-actions.pod:5045
27432 " guestfs_mount_ro (guestfs_h *g,\n"
27433 " const char *device,\n"
27434 " const char *mountpoint);\n"
27439 #: ../src/guestfs-actions.pod:5050
27441 "This is the same as the C<guestfs_mount> command, but it mounts the "
27442 "filesystem with the read-only (I<-o ro>) flag."
27446 #: ../src/guestfs-actions.pod:5057
27447 msgid "guestfs_mount_vfs"
27451 #: ../src/guestfs-actions.pod:5059
27455 " guestfs_mount_vfs (guestfs_h *g,\n"
27456 " const char *options,\n"
27457 " const char *vfstype,\n"
27458 " const char *device,\n"
27459 " const char *mountpoint);\n"
27464 #: ../src/guestfs-actions.pod:5066
27466 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27467 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
27472 #: ../src/guestfs-actions.pod:5074
27473 msgid "guestfs_mountpoints"
27477 #: ../src/guestfs-actions.pod:5076
27481 " guestfs_mountpoints (guestfs_h *g);\n"
27486 #: ../src/guestfs-actions.pod:5079
27488 "This call is similar to C<guestfs_mounts>. That call returns a list of "
27489 "devices. This one returns a hash table (map) of device name to directory "
27490 "where the device is mounted."
27494 #: ../src/guestfs-actions.pod:5091
27495 msgid "guestfs_mounts"
27499 #: ../src/guestfs-actions.pod:5093
27503 " guestfs_mounts (guestfs_h *g);\n"
27508 #: ../src/guestfs-actions.pod:5101
27509 msgid "See also: C<guestfs_mountpoints>"
27513 #: ../src/guestfs-actions.pod:5109
27518 #: ../src/guestfs-actions.pod:5111
27522 " guestfs_mv (guestfs_h *g,\n"
27523 " const char *src,\n"
27524 " const char *dest);\n"
27529 #: ../src/guestfs-actions.pod:5123
27530 msgid "guestfs_ntfs_3g_probe"
27534 #: ../src/guestfs-actions.pod:5125
27538 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
27540 " const char *device);\n"
27545 #: ../src/guestfs-actions.pod:5144
27546 msgid "(Added in 1.0.43)"
27550 #: ../src/guestfs-actions.pod:5146
27551 msgid "guestfs_ntfsresize"
27555 #: ../src/guestfs-actions.pod:5148
27559 " guestfs_ntfsresize (guestfs_h *g,\n"
27560 " const char *device);\n"
27565 #: ../src/guestfs-actions.pod:5152 ../src/guestfs-actions.pod:5252
27567 "I<This function is deprecated.> In new code, use the L</"
27568 "guestfs_ntfsresize_opts> call instead."
27572 #: ../src/guestfs-actions.pod:5176
27573 msgid "guestfs_ntfsresize_opts"
27577 #: ../src/guestfs-actions.pod:5178
27581 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
27582 " const char *device,\n"
27588 #: ../src/guestfs-actions.pod:5188
27591 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
27592 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
27597 #: ../src/guestfs-actions.pod:5208
27599 "After the resize operation, the filesystem is always marked as requiring a "
27600 "consistency check (for safety). You have to boot into Windows to perform "
27601 "this check and clear this condition. If you I<don't> set the C<force> "
27602 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
27603 "times on a single filesystem without booting into Windows between each "
27608 #: ../src/guestfs-actions.pod:5223
27609 msgid "guestfs_ntfsresize_opts_va"
27613 #: ../src/guestfs-actions.pod:5225
27617 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
27618 " const char *device,\n"
27619 " va_list args);\n"
27624 #: ../src/guestfs-actions.pod:5230
27625 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
27629 #: ../src/guestfs-actions.pod:5234
27630 msgid "guestfs_ntfsresize_opts_argv"
27634 #: ../src/guestfs-actions.pod:5236
27638 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
27639 " const char *device,\n"
27640 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
27645 #: ../src/guestfs-actions.pod:5241
27646 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
27650 #: ../src/guestfs-actions.pod:5245
27651 msgid "guestfs_ntfsresize_size"
27655 #: ../src/guestfs-actions.pod:5247
27659 " guestfs_ntfsresize_size (guestfs_h *g,\n"
27660 " const char *device,\n"
27661 " int64_t size);\n"
27666 #: ../src/guestfs-actions.pod:5259
27668 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
27669 "to specify the new size (in bytes) explicitly."
27673 #: ../src/guestfs-actions.pod:5264 ../src/guestfs-actions.pod:5706
27674 #: ../src/guestfs-actions.pod:5779 ../src/guestfs-actions.pod:6047
27675 #: ../src/guestfs-actions.pod:7670
27676 msgid "(Added in 1.3.14)"
27680 #: ../src/guestfs-actions.pod:5266
27681 msgid "guestfs_part_add"
27685 #: ../src/guestfs-actions.pod:5268
27689 " guestfs_part_add (guestfs_h *g,\n"
27690 " const char *device,\n"
27691 " const char *prlogex,\n"
27692 " int64_t startsect,\n"
27693 " int64_t endsect);\n"
27698 #: ../src/guestfs-actions.pod:5275
27700 "This command adds a partition to C<device>. If there is no partition table "
27701 "on the device, call C<guestfs_part_init> first."
27705 #: ../src/guestfs-actions.pod:5287
27707 "Creating a partition which covers the whole disk is not so easy. Use "
27708 "C<guestfs_part_disk> to do that."
27712 #: ../src/guestfs-actions.pod:5292 ../src/guestfs-actions.pod:5330
27713 #: ../src/guestfs-actions.pod:5383 ../src/guestfs-actions.pod:5467
27714 #: ../src/guestfs-actions.pod:5505 ../src/guestfs-actions.pod:5524
27715 #: ../src/guestfs-actions.pod:5564
27716 msgid "(Added in 1.0.78)"
27720 #: ../src/guestfs-actions.pod:5294
27721 msgid "guestfs_part_del"
27725 #: ../src/guestfs-actions.pod:5296
27729 " guestfs_part_del (guestfs_h *g,\n"
27730 " const char *device,\n"
27736 #: ../src/guestfs-actions.pod:5311
27737 msgid "guestfs_part_disk"
27741 #: ../src/guestfs-actions.pod:5313
27745 " guestfs_part_disk (guestfs_h *g,\n"
27746 " const char *device,\n"
27747 " const char *parttype);\n"
27752 #: ../src/guestfs-actions.pod:5318
27754 "This command is simply a combination of C<guestfs_part_init> followed by "
27755 "C<guestfs_part_add> to create a single primary partition covering the whole "
27760 #: ../src/guestfs-actions.pod:5322
27762 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27763 "possible values are described in C<guestfs_part_init>."
27767 #: ../src/guestfs-actions.pod:5332
27768 msgid "guestfs_part_get_bootable"
27772 #: ../src/guestfs-actions.pod:5334
27776 " guestfs_part_get_bootable (guestfs_h *g,\n"
27777 " const char *device,\n"
27783 #: ../src/guestfs-actions.pod:5342
27784 msgid "See also C<guestfs_part_set_bootable>."
27788 #: ../src/guestfs-actions.pod:5348
27789 msgid "guestfs_part_get_mbr_id"
27793 #: ../src/guestfs-actions.pod:5350
27797 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
27798 " const char *device,\n"
27804 #: ../src/guestfs-actions.pod:5358 ../src/guestfs-actions.pod:5540
27806 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
27807 "undefined results for other partition table types (see "
27808 "C<guestfs_part_get_parttype>)."
27812 #: ../src/guestfs-actions.pod:5366
27813 msgid "guestfs_part_get_parttype"
27817 #: ../src/guestfs-actions.pod:5368
27821 " guestfs_part_get_parttype (guestfs_h *g,\n"
27822 " const char *device);\n"
27827 #: ../src/guestfs-actions.pod:5375
27829 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
27830 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
27831 "possible, although unusual. See C<guestfs_part_init> for a full list."
27835 #: ../src/guestfs-actions.pod:5385
27836 msgid "guestfs_part_init"
27840 #: ../src/guestfs-actions.pod:5387
27844 " guestfs_part_init (guestfs_h *g,\n"
27845 " const char *device,\n"
27846 " const char *parttype);\n"
27851 #: ../src/guestfs-actions.pod:5396
27853 "Initially there are no partitions. Following this, you should call "
27854 "C<guestfs_part_add> for each partition required."
27858 #: ../src/guestfs-actions.pod:5469
27859 msgid "guestfs_part_list"
27863 #: ../src/guestfs-actions.pod:5471
27866 " struct guestfs_partition_list *\n"
27867 " guestfs_part_list (guestfs_h *g,\n"
27868 " const char *device);\n"
27873 #: ../src/guestfs-actions.pod:5488
27875 "Start of the partition I<in bytes>. To get sectors you have to divide by "
27876 "the device's sector size, see C<guestfs_blockdev_getss>."
27880 #: ../src/guestfs-actions.pod:5501
27882 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
27883 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
27888 #: ../src/guestfs-actions.pod:5507
27889 msgid "guestfs_part_set_bootable"
27893 #: ../src/guestfs-actions.pod:5509
27897 " guestfs_part_set_bootable (guestfs_h *g,\n"
27898 " const char *device,\n"
27900 " int bootable);\n"
27905 #: ../src/guestfs-actions.pod:5526
27906 msgid "guestfs_part_set_mbr_id"
27910 #: ../src/guestfs-actions.pod:5528
27914 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
27915 " const char *device,\n"
27922 #: ../src/guestfs-actions.pod:5548
27923 msgid "guestfs_part_set_name"
27927 #: ../src/guestfs-actions.pod:5550
27931 " guestfs_part_set_name (guestfs_h *g,\n"
27932 " const char *device,\n"
27934 " const char *name);\n"
27939 #: ../src/guestfs-actions.pod:5566
27940 msgid "guestfs_part_to_dev"
27944 #: ../src/guestfs-actions.pod:5568
27948 " guestfs_part_to_dev (guestfs_h *g,\n"
27949 " const char *partition);\n"
27954 #: ../src/guestfs-actions.pod:5576
27956 "The named partition must exist, for example as a string returned from "
27957 "C<guestfs_list_partitions>."
27961 #: ../src/guestfs-actions.pod:5584
27962 msgid "guestfs_ping_daemon"
27966 #: ../src/guestfs-actions.pod:5586
27970 " guestfs_ping_daemon (guestfs_h *g);\n"
27975 #: ../src/guestfs-actions.pod:5598
27976 msgid "guestfs_pread"
27980 #: ../src/guestfs-actions.pod:5600
27984 " guestfs_pread (guestfs_h *g,\n"
27985 " const char *path,\n"
27987 " int64_t offset,\n"
27988 " size_t *size_r);\n"
27993 #: ../src/guestfs-actions.pod:5613
27994 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
27998 #: ../src/guestfs-actions.pod:5624
27999 msgid "guestfs_pread_device"
28003 #: ../src/guestfs-actions.pod:5626
28007 " guestfs_pread_device (guestfs_h *g,\n"
28008 " const char *device,\n"
28010 " int64_t offset,\n"
28011 " size_t *size_r);\n"
28016 #: ../src/guestfs-actions.pod:5639
28017 msgid "See also C<guestfs_pread>."
28021 #: ../src/guestfs-actions.pod:5648
28022 msgid "(Added in 1.5.21)"
28026 #: ../src/guestfs-actions.pod:5650
28027 msgid "guestfs_pvcreate"
28031 #: ../src/guestfs-actions.pod:5652
28035 " guestfs_pvcreate (guestfs_h *g,\n"
28036 " const char *device);\n"
28041 #: ../src/guestfs-actions.pod:5664
28042 msgid "guestfs_pvremove"
28046 #: ../src/guestfs-actions.pod:5666
28050 " guestfs_pvremove (guestfs_h *g,\n"
28051 " const char *device);\n"
28056 #: ../src/guestfs-actions.pod:5681
28057 msgid "guestfs_pvresize"
28061 #: ../src/guestfs-actions.pod:5683
28065 " guestfs_pvresize (guestfs_h *g,\n"
28066 " const char *device);\n"
28071 #: ../src/guestfs-actions.pod:5694
28072 msgid "guestfs_pvresize_size"
28076 #: ../src/guestfs-actions.pod:5696
28080 " guestfs_pvresize_size (guestfs_h *g,\n"
28081 " const char *device,\n"
28082 " int64_t size);\n"
28087 #: ../src/guestfs-actions.pod:5701
28089 "This command is the same as C<guestfs_pvresize> except that it allows you to "
28090 "specify the new size (in bytes) explicitly."
28094 #: ../src/guestfs-actions.pod:5708
28095 msgid "guestfs_pvs"
28099 #: ../src/guestfs-actions.pod:5710
28103 " guestfs_pvs (guestfs_h *g);\n"
28108 #: ../src/guestfs-actions.pod:5719
28109 msgid "See also C<guestfs_pvs_full>."
28113 #: ../src/guestfs-actions.pod:5727
28114 msgid "guestfs_pvs_full"
28118 #: ../src/guestfs-actions.pod:5729
28121 " struct guestfs_lvm_pv_list *\n"
28122 " guestfs_pvs_full (guestfs_h *g);\n"
28127 #: ../src/guestfs-actions.pod:5735
28129 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
28130 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
28134 #: ../src/guestfs-actions.pod:5741
28135 msgid "guestfs_pvuuid"
28139 #: ../src/guestfs-actions.pod:5743
28143 " guestfs_pvuuid (guestfs_h *g,\n"
28144 " const char *device);\n"
28149 #: ../src/guestfs-actions.pod:5754
28150 msgid "guestfs_pwrite"
28154 #: ../src/guestfs-actions.pod:5756
28158 " guestfs_pwrite (guestfs_h *g,\n"
28159 " const char *path,\n"
28160 " const char *content,\n"
28161 " size_t content_size,\n"
28162 " int64_t offset);\n"
28167 #: ../src/guestfs-actions.pod:5772
28168 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
28172 #: ../src/guestfs-actions.pod:5781
28173 msgid "guestfs_pwrite_device"
28177 #: ../src/guestfs-actions.pod:5783
28181 " guestfs_pwrite_device (guestfs_h *g,\n"
28182 " const char *device,\n"
28183 " const char *content,\n"
28184 " size_t content_size,\n"
28185 " int64_t offset);\n"
28190 #: ../src/guestfs-actions.pod:5798
28191 msgid "See also C<guestfs_pwrite>."
28195 #: ../src/guestfs-actions.pod:5805
28196 msgid "(Added in 1.5.20)"
28200 #: ../src/guestfs-actions.pod:5807
28201 msgid "guestfs_read_file"
28205 #: ../src/guestfs-actions.pod:5809
28209 " guestfs_read_file (guestfs_h *g,\n"
28210 " const char *path,\n"
28211 " size_t *size_r);\n"
28216 #: ../src/guestfs-actions.pod:5817
28218 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
28219 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
28220 "function is limited in the total size of file that can be handled."
28224 #: ../src/guestfs-actions.pod:5829
28225 msgid "(Added in 1.0.63)"
28229 #: ../src/guestfs-actions.pod:5831
28230 msgid "guestfs_read_lines"
28234 #: ../src/guestfs-actions.pod:5833
28238 " guestfs_read_lines (guestfs_h *g,\n"
28239 " const char *path);\n"
28244 #: ../src/guestfs-actions.pod:5842
28246 "Note that this function cannot correctly handle binary files (specifically, "
28247 "files containing C<\\0> character which is treated as end of line). For "
28248 "those you need to use the C<guestfs_read_file> function which has a more "
28249 "complex interface."
28253 #: ../src/guestfs-actions.pod:5853
28254 msgid "guestfs_readdir"
28258 #: ../src/guestfs-actions.pod:5855
28261 " struct guestfs_dirent_list *\n"
28262 " guestfs_readdir (guestfs_h *g,\n"
28263 " const char *dir);\n"
28268 #: ../src/guestfs-actions.pod:5909
28270 "This function is primarily intended for use by programs. To get a simple "
28271 "list of names, use C<guestfs_ls>. To get a printable directory for human "
28272 "consumption, use C<guestfs_ll>."
28276 #: ../src/guestfs-actions.pod:5913
28278 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
28279 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
28283 #: ../src/guestfs-actions.pod:5919
28284 msgid "guestfs_readlink"
28288 #: ../src/guestfs-actions.pod:5921
28292 " guestfs_readlink (guestfs_h *g,\n"
28293 " const char *path);\n"
28298 #: ../src/guestfs-actions.pod:5932
28299 msgid "guestfs_readlinklist"
28303 #: ../src/guestfs-actions.pod:5934
28307 " guestfs_readlinklist (guestfs_h *g,\n"
28308 " const char *path,\n"
28309 " char *const *names);\n"
28314 #: ../src/guestfs-actions.pod:5967
28315 msgid "guestfs_realpath"
28319 #: ../src/guestfs-actions.pod:5969
28323 " guestfs_realpath (guestfs_h *g,\n"
28324 " const char *path);\n"
28329 #: ../src/guestfs-actions.pod:5981
28330 msgid "guestfs_removexattr"
28334 #: ../src/guestfs-actions.pod:5983
28338 " guestfs_removexattr (guestfs_h *g,\n"
28339 " const char *xattr,\n"
28340 " const char *path);\n"
28345 #: ../src/guestfs-actions.pod:5991
28346 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
28350 #: ../src/guestfs-actions.pod:5997
28351 msgid "guestfs_resize2fs"
28355 #: ../src/guestfs-actions.pod:5999
28359 " guestfs_resize2fs (guestfs_h *g,\n"
28360 " const char *device);\n"
28365 #: ../src/guestfs-actions.pod:6006
28367 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
28368 "C<device> before calling this command. For unknown reasons C<resize2fs> "
28369 "sometimes gives an error about this and sometimes not. In any case, it is "
28370 "always safe to call C<guestfs_e2fsck_f> before calling this function."
28374 #: ../src/guestfs-actions.pod:6016
28375 msgid "guestfs_resize2fs_M"
28379 #: ../src/guestfs-actions.pod:6018
28383 " guestfs_resize2fs_M (guestfs_h *g,\n"
28384 " const char *device);\n"
28389 #: ../src/guestfs-actions.pod:6022
28391 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
28392 "resized to its minimum size. This works like the I<-M> option to the "
28393 "C<resize2fs> command."
28397 #: ../src/guestfs-actions.pod:6026
28399 "To get the resulting size of the filesystem you should call "
28400 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
28401 "These two numbers, multiplied together, give the resulting size of the "
28402 "minimal filesystem in bytes."
28406 #: ../src/guestfs-actions.pod:6035
28407 msgid "guestfs_resize2fs_size"
28411 #: ../src/guestfs-actions.pod:6037
28415 " guestfs_resize2fs_size (guestfs_h *g,\n"
28416 " const char *device,\n"
28417 " int64_t size);\n"
28422 #: ../src/guestfs-actions.pod:6042
28424 "This command is the same as C<guestfs_resize2fs> except that it allows you "
28425 "to specify the new size (in bytes) explicitly."
28429 #: ../src/guestfs-actions.pod:6049
28434 #: ../src/guestfs-actions.pod:6051
28438 " guestfs_rm (guestfs_h *g,\n"
28439 " const char *path);\n"
28444 #: ../src/guestfs-actions.pod:6061
28445 msgid "guestfs_rm_rf"
28449 #: ../src/guestfs-actions.pod:6063
28453 " guestfs_rm_rf (guestfs_h *g,\n"
28454 " const char *path);\n"
28459 #: ../src/guestfs-actions.pod:6075
28460 msgid "guestfs_rmdir"
28464 #: ../src/guestfs-actions.pod:6077
28468 " guestfs_rmdir (guestfs_h *g,\n"
28469 " const char *path);\n"
28474 #: ../src/guestfs-actions.pod:6087
28475 msgid "guestfs_rmmountpoint"
28479 #: ../src/guestfs-actions.pod:6089
28483 " guestfs_rmmountpoint (guestfs_h *g,\n"
28484 " const char *exemptpath);\n"
28489 #: ../src/guestfs-actions.pod:6093
28491 "This calls removes a mountpoint that was previously created with "
28492 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
28496 #: ../src/guestfs-actions.pod:6101
28497 msgid "guestfs_scrub_device"
28501 #: ../src/guestfs-actions.pod:6103
28505 " guestfs_scrub_device (guestfs_h *g,\n"
28506 " const char *device);\n"
28511 #: ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6136
28512 #: ../src/guestfs-actions.pod:6155
28513 msgid "(Added in 1.0.52)"
28517 #: ../src/guestfs-actions.pod:6120
28518 msgid "guestfs_scrub_file"
28522 #: ../src/guestfs-actions.pod:6122
28526 " guestfs_scrub_file (guestfs_h *g,\n"
28527 " const char *file);\n"
28532 #: ../src/guestfs-actions.pod:6138
28533 msgid "guestfs_scrub_freespace"
28537 #: ../src/guestfs-actions.pod:6140
28541 " guestfs_scrub_freespace (guestfs_h *g,\n"
28542 " const char *dir);\n"
28547 #: ../src/guestfs-actions.pod:6144
28549 "This command creates the directory C<dir> and then fills it with files until "
28550 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
28551 "and deletes them. The intention is to scrub any free space on the partition "
28552 "containing C<dir>."
28556 #: ../src/guestfs-actions.pod:6157
28557 msgid "guestfs_set_append"
28561 #: ../src/guestfs-actions.pod:6159
28565 " guestfs_set_append (guestfs_h *g,\n"
28566 " const char *append);\n"
28571 #: ../src/guestfs-actions.pod:6176
28572 msgid "guestfs_set_attach_method"
28576 #: ../src/guestfs-actions.pod:6178
28580 " guestfs_set_attach_method (guestfs_h *g,\n"
28581 " const char *attachmethod);\n"
28586 #: ../src/guestfs-actions.pod:6206
28587 msgid "guestfs_set_autosync"
28591 #: ../src/guestfs-actions.pod:6208
28595 " guestfs_set_autosync (guestfs_h *g,\n"
28596 " int autosync);\n"
28601 #: ../src/guestfs-actions.pod:6224
28602 msgid "guestfs_set_direct"
28606 #: ../src/guestfs-actions.pod:6226
28610 " guestfs_set_direct (guestfs_h *g,\n"
28616 #: ../src/guestfs-actions.pod:6234
28618 "One consequence of this is that log messages aren't caught by the library "
28619 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
28624 #: ../src/guestfs-actions.pod:6247
28625 msgid "guestfs_set_e2label"
28629 #: ../src/guestfs-actions.pod:6249
28633 " guestfs_set_e2label (guestfs_h *g,\n"
28634 " const char *device,\n"
28635 " const char *label);\n"
28640 #: ../src/guestfs-actions.pod:6258
28642 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
28643 "the existing label on a filesystem."
28647 #: ../src/guestfs-actions.pod:6265
28648 msgid "guestfs_set_e2uuid"
28652 #: ../src/guestfs-actions.pod:6267
28656 " guestfs_set_e2uuid (guestfs_h *g,\n"
28657 " const char *device,\n"
28658 " const char *uuid);\n"
28663 #: ../src/guestfs-actions.pod:6277
28665 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
28666 "the existing UUID of a filesystem."
28670 #: ../src/guestfs-actions.pod:6284
28671 msgid "guestfs_set_memsize"
28675 #: ../src/guestfs-actions.pod:6286
28679 " guestfs_set_memsize (guestfs_h *g,\n"
28685 #: ../src/guestfs-actions.pod:6290
28687 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28688 "This only has any effect if called before C<guestfs_launch>."
28692 #: ../src/guestfs-actions.pod:6305
28693 msgid "guestfs_set_network"
28697 #: ../src/guestfs-actions.pod:6307
28701 " guestfs_set_network (guestfs_h *g,\n"
28707 #: ../src/guestfs-actions.pod:6317
28709 "You must call this before calling C<guestfs_launch>, otherwise it has no "
28714 #: ../src/guestfs-actions.pod:6324
28715 msgid "guestfs_set_path"
28719 #: ../src/guestfs-actions.pod:6326
28723 " guestfs_set_path (guestfs_h *g,\n"
28724 " const char *searchpath);\n"
28729 #: ../src/guestfs-actions.pod:6341
28730 msgid "guestfs_set_pgroup"
28734 #: ../src/guestfs-actions.pod:6343
28738 " guestfs_set_pgroup (guestfs_h *g,\n"
28744 #: ../src/guestfs-actions.pod:6360
28745 msgid "guestfs_set_qemu"
28749 #: ../src/guestfs-actions.pod:6362
28753 " guestfs_set_qemu (guestfs_h *g,\n"
28754 " const char *qemu);\n"
28759 #: ../src/guestfs-actions.pod:6388
28760 msgid "guestfs_set_recovery_proc"
28764 #: ../src/guestfs-actions.pod:6390
28768 " guestfs_set_recovery_proc (guestfs_h *g,\n"
28769 " int recoveryproc);\n"
28774 #: ../src/guestfs-actions.pod:6394
28776 "If this is called with the parameter C<false> then C<guestfs_launch> does "
28777 "not create a recovery process. The purpose of the recovery process is to "
28778 "stop runaway qemu processes in the case where the main program aborts "
28783 #: ../src/guestfs-actions.pod:6399
28785 "This only has any effect if called before C<guestfs_launch>, and the default "
28790 #: ../src/guestfs-actions.pod:6412
28791 msgid "guestfs_set_selinux"
28795 #: ../src/guestfs-actions.pod:6414
28799 " guestfs_set_selinux (guestfs_h *g,\n"
28805 #: ../src/guestfs-actions.pod:6431
28806 msgid "guestfs_set_trace"
28810 #: ../src/guestfs-actions.pod:6433
28814 " guestfs_set_trace (guestfs_h *g,\n"
28820 #: ../src/guestfs-actions.pod:6447
28822 "Trace messages are normally sent to C<stderr>, unless you register a "
28823 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28827 #: ../src/guestfs-actions.pod:6455
28828 msgid "guestfs_set_verbose"
28832 #: ../src/guestfs-actions.pod:6457
28836 " guestfs_set_verbose (guestfs_h *g,\n"
28842 #: ../src/guestfs-actions.pod:6466
28844 "Verbose messages are normally sent to C<stderr>, unless you register a "
28845 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28849 #: ../src/guestfs-actions.pod:6474
28850 msgid "guestfs_setcon"
28854 #: ../src/guestfs-actions.pod:6476
28858 " guestfs_setcon (guestfs_h *g,\n"
28859 " const char *context);\n"
28864 #: ../src/guestfs-actions.pod:6489
28865 msgid "guestfs_setxattr"
28869 #: ../src/guestfs-actions.pod:6491
28873 " guestfs_setxattr (guestfs_h *g,\n"
28874 " const char *xattr,\n"
28875 " const char *val,\n"
28877 " const char *path);\n"
28882 #: ../src/guestfs-actions.pod:6502
28883 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
28887 #: ../src/guestfs-actions.pod:6508
28888 msgid "guestfs_sfdisk"
28892 #: ../src/guestfs-actions.pod:6510
28896 " guestfs_sfdisk (guestfs_h *g,\n"
28897 " const char *device,\n"
28901 " char *const *lines);\n"
28906 #: ../src/guestfs-actions.pod:6518 ../src/guestfs-actions.pod:6562
28907 #: ../src/guestfs-actions.pod:6596
28909 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
28914 #: ../src/guestfs-actions.pod:6545
28916 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
28920 #: ../src/guestfs-actions.pod:6555
28921 msgid "guestfs_sfdiskM"
28925 #: ../src/guestfs-actions.pod:6557
28929 " guestfs_sfdiskM (guestfs_h *g,\n"
28930 " const char *device,\n"
28931 " char *const *lines);\n"
28936 #: ../src/guestfs-actions.pod:6569
28938 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
28939 "partition sizes are specified in megabytes only (rounded to the nearest "
28940 "cylinder) and you don't need to specify the cyls, heads and sectors "
28941 "parameters which were rarely if ever used anyway."
28945 #: ../src/guestfs-actions.pod:6575
28947 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
28948 "C<guestfs_part_disk>"
28952 #: ../src/guestfs-actions.pod:6585
28953 msgid "guestfs_sfdisk_N"
28957 #: ../src/guestfs-actions.pod:6587
28961 " guestfs_sfdisk_N (guestfs_h *g,\n"
28962 " const char *device,\n"
28967 " const char *line);\n"
28972 #: ../src/guestfs-actions.pod:6606
28974 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
28975 "for the cyls/heads/sectors parameters."
28979 #: ../src/guestfs-actions.pod:6609
28980 msgid "See also: C<guestfs_part_add>"
28984 #: ../src/guestfs-actions.pod:6618
28985 msgid "guestfs_sfdisk_disk_geometry"
28989 #: ../src/guestfs-actions.pod:6620
28993 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
28994 " const char *device);\n"
28999 #: ../src/guestfs-actions.pod:6624
29001 "This displays the disk geometry of C<device> read from the partition table. "
29002 "Especially in the case where the underlying block device has been resized, "
29003 "this can be different from the kernel's idea of the geometry (see "
29004 "C<guestfs_sfdisk_kernel_geometry>)."
29008 #: ../src/guestfs-actions.pod:6637
29009 msgid "guestfs_sfdisk_kernel_geometry"
29013 #: ../src/guestfs-actions.pod:6639
29017 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
29018 " const char *device);\n"
29023 #: ../src/guestfs-actions.pod:6653
29024 msgid "guestfs_sfdisk_l"
29028 #: ../src/guestfs-actions.pod:6655
29032 " guestfs_sfdisk_l (guestfs_h *g,\n"
29033 " const char *device);\n"
29038 #: ../src/guestfs-actions.pod:6659
29040 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
29045 #: ../src/guestfs-actions.pod:6670
29046 msgid "See also: C<guestfs_part_list>"
29050 #: ../src/guestfs-actions.pod:6677
29055 #: ../src/guestfs-actions.pod:6679
29059 " guestfs_sh (guestfs_h *g,\n"
29060 " const char *command);\n"
29065 #: ../src/guestfs-actions.pod:6686
29066 msgid "This is like C<guestfs_command>, but passes the command to:"
29070 #: ../src/guestfs-actions.pod:6694
29071 msgid "All the provisos about C<guestfs_command> apply to this call."
29075 #: ../src/guestfs-actions.pod:6701
29076 msgid "guestfs_sh_lines"
29080 #: ../src/guestfs-actions.pod:6703
29084 " guestfs_sh_lines (guestfs_h *g,\n"
29085 " const char *command);\n"
29090 #: ../src/guestfs-actions.pod:6707
29092 "This is the same as C<guestfs_sh>, but splits the result into a list of "
29097 #: ../src/guestfs-actions.pod:6710
29098 msgid "See also: C<guestfs_command_lines>"
29102 #: ../src/guestfs-actions.pod:6718
29103 msgid "guestfs_sleep"
29107 #: ../src/guestfs-actions.pod:6720
29111 " guestfs_sleep (guestfs_h *g,\n"
29117 #: ../src/guestfs-actions.pod:6728
29118 msgid "(Added in 1.0.41)"
29122 #: ../src/guestfs-actions.pod:6730 ../src/guestfs-structs.pod:109
29123 msgid "guestfs_stat"
29127 #: ../src/guestfs-actions.pod:6732
29130 " struct guestfs_stat *\n"
29131 " guestfs_stat (guestfs_h *g,\n"
29132 " const char *path);\n"
29137 #: ../src/guestfs-actions.pod:6746 ../src/guestfs-structs.pod:135
29138 msgid "guestfs_statvfs"
29142 #: ../src/guestfs-actions.pod:6748
29145 " struct guestfs_statvfs *\n"
29146 " guestfs_statvfs (guestfs_h *g,\n"
29147 " const char *path);\n"
29152 #: ../src/guestfs-actions.pod:6758
29154 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
29155 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
29159 #: ../src/guestfs-actions.pod:6764
29160 msgid "guestfs_strings"
29164 #: ../src/guestfs-actions.pod:6766
29168 " guestfs_strings (guestfs_h *g,\n"
29169 " const char *path);\n"
29174 #: ../src/guestfs-actions.pod:6782
29175 msgid "guestfs_strings_e"
29179 #: ../src/guestfs-actions.pod:6784
29183 " guestfs_strings_e (guestfs_h *g,\n"
29184 " const char *encoding,\n"
29185 " const char *path);\n"
29190 #: ../src/guestfs-actions.pod:6789
29192 "This is like the C<guestfs_strings> command, but allows you to specify the "
29193 "encoding of strings that are looked for in the source file C<path>."
29197 #: ../src/guestfs-actions.pod:6799
29199 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29200 "ISO-8859-X (this is what C<guestfs_strings> uses)."
29204 #: ../src/guestfs-actions.pod:6837
29205 msgid "guestfs_swapoff_device"
29209 #: ../src/guestfs-actions.pod:6839
29213 " guestfs_swapoff_device (guestfs_h *g,\n"
29214 " const char *device);\n"
29219 #: ../src/guestfs-actions.pod:6843
29221 "This command disables the libguestfs appliance swap device or partition "
29222 "named C<device>. See C<guestfs_swapon_device>."
29226 #: ../src/guestfs-actions.pod:6851
29227 msgid "guestfs_swapoff_file"
29231 #: ../src/guestfs-actions.pod:6853
29235 " guestfs_swapoff_file (guestfs_h *g,\n"
29236 " const char *file);\n"
29241 #: ../src/guestfs-actions.pod:6863
29242 msgid "guestfs_swapoff_label"
29246 #: ../src/guestfs-actions.pod:6865
29250 " guestfs_swapoff_label (guestfs_h *g,\n"
29251 " const char *label);\n"
29256 #: ../src/guestfs-actions.pod:6876
29257 msgid "guestfs_swapoff_uuid"
29261 #: ../src/guestfs-actions.pod:6878
29265 " guestfs_swapoff_uuid (guestfs_h *g,\n"
29266 " const char *uuid);\n"
29271 #: ../src/guestfs-actions.pod:6889
29272 msgid "guestfs_swapon_device"
29276 #: ../src/guestfs-actions.pod:6891
29280 " guestfs_swapon_device (guestfs_h *g,\n"
29281 " const char *device);\n"
29286 #: ../src/guestfs-actions.pod:6895
29288 "This command enables the libguestfs appliance to use the swap device or "
29289 "partition named C<device>. The increased memory is made available for all "
29290 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
29294 #: ../src/guestfs-actions.pod:6911
29295 msgid "guestfs_swapon_file"
29299 #: ../src/guestfs-actions.pod:6913
29303 " guestfs_swapon_file (guestfs_h *g,\n"
29304 " const char *file);\n"
29309 #: ../src/guestfs-actions.pod:6917
29311 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
29316 #: ../src/guestfs-actions.pod:6924
29317 msgid "guestfs_swapon_label"
29321 #: ../src/guestfs-actions.pod:6926
29325 " guestfs_swapon_label (guestfs_h *g,\n"
29326 " const char *label);\n"
29331 #: ../src/guestfs-actions.pod:6930
29333 "This command enables swap to a labeled swap partition. See "
29334 "C<guestfs_swapon_device> for other notes."
29338 #: ../src/guestfs-actions.pod:6937
29339 msgid "guestfs_swapon_uuid"
29343 #: ../src/guestfs-actions.pod:6939
29347 " guestfs_swapon_uuid (guestfs_h *g,\n"
29348 " const char *uuid);\n"
29353 #: ../src/guestfs-actions.pod:6943
29355 "This command enables swap to a swap partition with the given UUID. See "
29356 "C<guestfs_swapon_device> for other notes."
29360 #: ../src/guestfs-actions.pod:6950
29361 msgid "guestfs_sync"
29365 #: ../src/guestfs-actions.pod:6952
29369 " guestfs_sync (guestfs_h *g);\n"
29374 #: ../src/guestfs-actions.pod:6965
29375 msgid "guestfs_tail"
29379 #: ../src/guestfs-actions.pod:6967
29383 " guestfs_tail (guestfs_h *g,\n"
29384 " const char *path);\n"
29389 #: ../src/guestfs-actions.pod:6983
29390 msgid "guestfs_tail_n"
29394 #: ../src/guestfs-actions.pod:6985
29398 " guestfs_tail_n (guestfs_h *g,\n"
29400 " const char *path);\n"
29405 #: ../src/guestfs-actions.pod:7007
29406 msgid "guestfs_tar_in"
29410 #: ../src/guestfs-actions.pod:7009
29414 " guestfs_tar_in (guestfs_h *g,\n"
29415 " const char *tarfile,\n"
29416 " const char *directory);\n"
29421 #: ../src/guestfs-actions.pod:7017
29423 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
29427 #: ../src/guestfs-actions.pod:7022 ../src/guestfs-actions.pod:7039
29428 #: ../src/guestfs-actions.pod:7055 ../src/guestfs-actions.pod:7071
29429 msgid "(Added in 1.0.3)"
29433 #: ../src/guestfs-actions.pod:7024
29434 msgid "guestfs_tar_out"
29438 #: ../src/guestfs-actions.pod:7026
29442 " guestfs_tar_out (guestfs_h *g,\n"
29443 " const char *directory,\n"
29444 " const char *tarfile);\n"
29449 #: ../src/guestfs-actions.pod:7034
29451 "To download a compressed tarball, use C<guestfs_tgz_out> or "
29452 "C<guestfs_txz_out>."
29456 #: ../src/guestfs-actions.pod:7041
29457 msgid "guestfs_tgz_in"
29461 #: ../src/guestfs-actions.pod:7043
29465 " guestfs_tgz_in (guestfs_h *g,\n"
29466 " const char *tarball,\n"
29467 " const char *directory);\n"
29472 #: ../src/guestfs-actions.pod:7051
29473 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
29477 #: ../src/guestfs-actions.pod:7057
29478 msgid "guestfs_tgz_out"
29482 #: ../src/guestfs-actions.pod:7059
29486 " guestfs_tgz_out (guestfs_h *g,\n"
29487 " const char *directory,\n"
29488 " const char *tarball);\n"
29493 #: ../src/guestfs-actions.pod:7067
29494 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
29498 #: ../src/guestfs-actions.pod:7073
29499 msgid "guestfs_touch"
29503 #: ../src/guestfs-actions.pod:7075
29507 " guestfs_touch (guestfs_h *g,\n"
29508 " const char *path);\n"
29513 #: ../src/guestfs-actions.pod:7090
29514 msgid "guestfs_truncate"
29518 #: ../src/guestfs-actions.pod:7092
29522 " guestfs_truncate (guestfs_h *g,\n"
29523 " const char *path);\n"
29528 #: ../src/guestfs-actions.pod:7103
29529 msgid "guestfs_truncate_size"
29533 #: ../src/guestfs-actions.pod:7105
29537 " guestfs_truncate_size (guestfs_h *g,\n"
29538 " const char *path,\n"
29539 " int64_t size);\n"
29544 #: ../src/guestfs-actions.pod:7113
29546 "If the current file size is less than C<size> then the file is extended to "
29547 "the required size with zero bytes. This creates a sparse file (ie. disk "
29548 "blocks are not allocated for the file until you write to it). To create a "
29549 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
29553 #: ../src/guestfs-actions.pod:7123
29554 msgid "guestfs_tune2fs_l"
29558 #: ../src/guestfs-actions.pod:7125
29562 " guestfs_tune2fs_l (guestfs_h *g,\n"
29563 " const char *device);\n"
29568 #: ../src/guestfs-actions.pod:7145
29569 msgid "guestfs_txz_in"
29573 #: ../src/guestfs-actions.pod:7147
29577 " guestfs_txz_in (guestfs_h *g,\n"
29578 " const char *tarball,\n"
29579 " const char *directory);\n"
29584 #: ../src/guestfs-actions.pod:7159
29585 msgid "guestfs_txz_out"
29589 #: ../src/guestfs-actions.pod:7161
29593 " guestfs_txz_out (guestfs_h *g,\n"
29594 " const char *directory,\n"
29595 " const char *tarball);\n"
29600 #: ../src/guestfs-actions.pod:7173
29601 msgid "guestfs_umask"
29605 #: ../src/guestfs-actions.pod:7175
29609 " guestfs_umask (guestfs_h *g,\n"
29615 #: ../src/guestfs-actions.pod:7191
29617 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
29618 "C<guestfs_mkdir>."
29622 #: ../src/guestfs-actions.pod:7200
29623 msgid "guestfs_umount"
29627 #: ../src/guestfs-actions.pod:7202
29631 " guestfs_umount (guestfs_h *g,\n"
29632 " const char *pathordevice);\n"
29637 #: ../src/guestfs-actions.pod:7214
29638 msgid "guestfs_umount_all"
29642 #: ../src/guestfs-actions.pod:7216
29646 " guestfs_umount_all (guestfs_h *g);\n"
29651 #: ../src/guestfs-actions.pod:7227
29652 msgid "guestfs_upload"
29656 #: ../src/guestfs-actions.pod:7229
29660 " guestfs_upload (guestfs_h *g,\n"
29661 " const char *filename,\n"
29662 " const char *remotefilename);\n"
29667 #: ../src/guestfs-actions.pod:7239
29668 msgid "See also C<guestfs_download>."
29672 #: ../src/guestfs-actions.pod:7250
29673 msgid "guestfs_upload_offset"
29677 #: ../src/guestfs-actions.pod:7252
29681 " guestfs_upload_offset (guestfs_h *g,\n"
29682 " const char *filename,\n"
29683 " const char *remotefilename,\n"
29684 " int64_t offset);\n"
29689 #: ../src/guestfs-actions.pod:7268
29691 "Note that there is no limit on the amount of data that can be uploaded with "
29692 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
29693 "full amount unless an error occurs."
29697 #: ../src/guestfs-actions.pod:7273
29698 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
29702 #: ../src/guestfs-actions.pod:7284
29703 msgid "guestfs_utimens"
29707 #: ../src/guestfs-actions.pod:7286
29711 " guestfs_utimens (guestfs_h *g,\n"
29712 " const char *path,\n"
29713 " int64_t atsecs,\n"
29714 " int64_t atnsecs,\n"
29715 " int64_t mtsecs,\n"
29716 " int64_t mtnsecs);\n"
29721 #: ../src/guestfs-actions.pod:7315 ../src/guestfs-structs.pod:175
29722 msgid "guestfs_version"
29726 #: ../src/guestfs-actions.pod:7317
29729 " struct guestfs_version *\n"
29730 " guestfs_version (guestfs_h *g);\n"
29735 #: ../src/guestfs-actions.pod:7345
29737 "I<Note:> Don't use this call to test for availability of features. In "
29738 "enterprise distributions we backport features from later versions into "
29739 "earlier versions, making this an unreliable way to test for features. Use "
29740 "C<guestfs_available> instead."
29744 #: ../src/guestfs-actions.pod:7351
29746 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
29747 "error. I<The caller must call C<guestfs_free_version> after use>."
29751 #: ../src/guestfs-actions.pod:7355
29752 msgid "(Added in 1.0.58)"
29756 #: ../src/guestfs-actions.pod:7357
29757 msgid "guestfs_vfs_label"
29761 #: ../src/guestfs-actions.pod:7359
29765 " guestfs_vfs_label (guestfs_h *g,\n"
29766 " const char *device);\n"
29771 #: ../src/guestfs-actions.pod:7368
29772 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
29776 #: ../src/guestfs-actions.pod:7373 ../src/guestfs-actions.pod:7410
29777 msgid "(Added in 1.3.18)"
29781 #: ../src/guestfs-actions.pod:7375
29782 msgid "guestfs_vfs_type"
29786 #: ../src/guestfs-actions.pod:7377
29790 " guestfs_vfs_type (guestfs_h *g,\n"
29791 " const char *device);\n"
29796 #: ../src/guestfs-actions.pod:7394
29797 msgid "guestfs_vfs_uuid"
29801 #: ../src/guestfs-actions.pod:7396
29805 " guestfs_vfs_uuid (guestfs_h *g,\n"
29806 " const char *device);\n"
29811 #: ../src/guestfs-actions.pod:7405
29812 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
29816 #: ../src/guestfs-actions.pod:7412
29817 msgid "guestfs_vg_activate"
29821 #: ../src/guestfs-actions.pod:7414
29825 " guestfs_vg_activate (guestfs_h *g,\n"
29827 " char *const *volgroups);\n"
29832 #: ../src/guestfs-actions.pod:7431
29833 msgid "guestfs_vg_activate_all"
29837 #: ../src/guestfs-actions.pod:7433
29841 " guestfs_vg_activate_all (guestfs_h *g,\n"
29842 " int activate);\n"
29847 #: ../src/guestfs-actions.pod:7446
29848 msgid "guestfs_vgcreate"
29852 #: ../src/guestfs-actions.pod:7448
29856 " guestfs_vgcreate (guestfs_h *g,\n"
29857 " const char *volgroup,\n"
29858 " char *const *physvols);\n"
29863 #: ../src/guestfs-actions.pod:7460
29864 msgid "guestfs_vglvuuids"
29868 #: ../src/guestfs-actions.pod:7462
29872 " guestfs_vglvuuids (guestfs_h *g,\n"
29873 " const char *vgname);\n"
29878 #: ../src/guestfs-actions.pod:7469
29880 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
29881 "associate logical volumes and volume groups."
29885 #: ../src/guestfs-actions.pod:7472
29886 msgid "See also C<guestfs_vgpvuuids>."
29890 #: ../src/guestfs-actions.pod:7480
29891 msgid "guestfs_vgpvuuids"
29895 #: ../src/guestfs-actions.pod:7482
29899 " guestfs_vgpvuuids (guestfs_h *g,\n"
29900 " const char *vgname);\n"
29905 #: ../src/guestfs-actions.pod:7489
29907 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
29908 "associate physical volumes and volume groups."
29912 #: ../src/guestfs-actions.pod:7492
29913 msgid "See also C<guestfs_vglvuuids>."
29917 #: ../src/guestfs-actions.pod:7500
29918 msgid "guestfs_vgremove"
29922 #: ../src/guestfs-actions.pod:7502
29926 " guestfs_vgremove (guestfs_h *g,\n"
29927 " const char *vgname);\n"
29932 #: ../src/guestfs-actions.pod:7515
29933 msgid "guestfs_vgrename"
29937 #: ../src/guestfs-actions.pod:7517
29941 " guestfs_vgrename (guestfs_h *g,\n"
29942 " const char *volgroup,\n"
29943 " const char *newvolgroup);\n"
29948 #: ../src/guestfs-actions.pod:7528
29949 msgid "guestfs_vgs"
29953 #: ../src/guestfs-actions.pod:7530
29957 " guestfs_vgs (guestfs_h *g);\n"
29962 #: ../src/guestfs-actions.pod:7539
29963 msgid "See also C<guestfs_vgs_full>."
29967 #: ../src/guestfs-actions.pod:7547
29968 msgid "guestfs_vgs_full"
29972 #: ../src/guestfs-actions.pod:7549
29975 " struct guestfs_lvm_vg_list *\n"
29976 " guestfs_vgs_full (guestfs_h *g);\n"
29981 #: ../src/guestfs-actions.pod:7555
29983 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
29984 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
29988 #: ../src/guestfs-actions.pod:7561
29989 msgid "guestfs_vgscan"
29993 #: ../src/guestfs-actions.pod:7563
29997 " guestfs_vgscan (guestfs_h *g);\n"
30002 #: ../src/guestfs-actions.pod:7573
30003 msgid "guestfs_vguuid"
30007 #: ../src/guestfs-actions.pod:7575
30011 " guestfs_vguuid (guestfs_h *g,\n"
30012 " const char *vgname);\n"
30017 #: ../src/guestfs-actions.pod:7586
30018 msgid "guestfs_wait_ready"
30022 #: ../src/guestfs-actions.pod:7588
30026 " guestfs_wait_ready (guestfs_h *g);\n"
30031 #: ../src/guestfs-actions.pod:7591
30033 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
30038 #: ../src/guestfs-actions.pod:7598
30039 msgid "This function is a no op."
30043 #: ../src/guestfs-actions.pod:7600
30045 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
30046 "calling C<guestfs_launch> to wait for the launch to complete. However this "
30047 "is no longer necessary because C<guestfs_launch> now does the waiting."
30051 #: ../src/guestfs-actions.pod:7605
30053 "If you see any calls to this function in code then you can just remove them, "
30054 "unless you want to retain compatibility with older versions of the API."
30058 #: ../src/guestfs-actions.pod:7613
30059 msgid "guestfs_wc_c"
30063 #: ../src/guestfs-actions.pod:7615
30067 " guestfs_wc_c (guestfs_h *g,\n"
30068 " const char *path);\n"
30073 #: ../src/guestfs-actions.pod:7626
30074 msgid "guestfs_wc_l"
30078 #: ../src/guestfs-actions.pod:7628
30082 " guestfs_wc_l (guestfs_h *g,\n"
30083 " const char *path);\n"
30088 #: ../src/guestfs-actions.pod:7639
30089 msgid "guestfs_wc_w"
30093 #: ../src/guestfs-actions.pod:7641
30097 " guestfs_wc_w (guestfs_h *g,\n"
30098 " const char *path);\n"
30103 #: ../src/guestfs-actions.pod:7652
30104 msgid "guestfs_write"
30108 #: ../src/guestfs-actions.pod:7654
30112 " guestfs_write (guestfs_h *g,\n"
30113 " const char *path,\n"
30114 " const char *content,\n"
30115 " size_t content_size);\n"
30120 #: ../src/guestfs-actions.pod:7663
30121 msgid "See also C<guestfs_write_append>."
30125 #: ../src/guestfs-actions.pod:7672
30126 msgid "guestfs_write_append"
30130 #: ../src/guestfs-actions.pod:7674
30134 " guestfs_write_append (guestfs_h *g,\n"
30135 " const char *path,\n"
30136 " const char *content,\n"
30137 " size_t content_size);\n"
30142 #: ../src/guestfs-actions.pod:7683
30143 msgid "See also C<guestfs_write>."
30147 #: ../src/guestfs-actions.pod:7692
30148 msgid "guestfs_write_file"
30152 #: ../src/guestfs-actions.pod:7694
30156 " guestfs_write_file (guestfs_h *g,\n"
30157 " const char *path,\n"
30158 " const char *content,\n"
30164 #: ../src/guestfs-actions.pod:7700
30166 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
30171 #: ../src/guestfs-actions.pod:7725
30172 msgid "guestfs_zegrep"
30176 #: ../src/guestfs-actions.pod:7727
30180 " guestfs_zegrep (guestfs_h *g,\n"
30181 " const char *regex,\n"
30182 " const char *path);\n"
30187 #: ../src/guestfs-actions.pod:7744
30188 msgid "guestfs_zegrepi"
30192 #: ../src/guestfs-actions.pod:7746
30196 " guestfs_zegrepi (guestfs_h *g,\n"
30197 " const char *regex,\n"
30198 " const char *path);\n"
30203 #: ../src/guestfs-actions.pod:7763
30204 msgid "guestfs_zero"
30208 #: ../src/guestfs-actions.pod:7765
30212 " guestfs_zero (guestfs_h *g,\n"
30213 " const char *device);\n"
30218 #: ../src/guestfs-actions.pod:7779
30220 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
30221 "C<guestfs_is_zero_device>"
30225 #: ../src/guestfs-actions.pod:7791
30226 msgid "guestfs_zero_device"
30230 #: ../src/guestfs-actions.pod:7793
30234 " guestfs_zero_device (guestfs_h *g,\n"
30235 " const char *device);\n"
30240 #: ../src/guestfs-actions.pod:7797
30242 "This command writes zeroes over the entire C<device>. Compare with "
30243 "C<guestfs_zero> which just zeroes the first few blocks of a device."
30247 #: ../src/guestfs-actions.pod:7815
30248 msgid "(Added in 1.3.1)"
30252 #: ../src/guestfs-actions.pod:7817
30253 msgid "guestfs_zerofree"
30257 #: ../src/guestfs-actions.pod:7819
30261 " guestfs_zerofree (guestfs_h *g,\n"
30262 " const char *device);\n"
30267 #: ../src/guestfs-actions.pod:7838
30268 msgid "guestfs_zfgrep"
30272 #: ../src/guestfs-actions.pod:7840
30276 " guestfs_zfgrep (guestfs_h *g,\n"
30277 " const char *pattern,\n"
30278 " const char *path);\n"
30283 #: ../src/guestfs-actions.pod:7857
30284 msgid "guestfs_zfgrepi"
30288 #: ../src/guestfs-actions.pod:7859
30292 " guestfs_zfgrepi (guestfs_h *g,\n"
30293 " const char *pattern,\n"
30294 " const char *path);\n"
30299 #: ../src/guestfs-actions.pod:7876
30300 msgid "guestfs_zfile"
30304 #: ../src/guestfs-actions.pod:7878
30308 " guestfs_zfile (guestfs_h *g,\n"
30309 " const char *meth,\n"
30310 " const char *path);\n"
30315 #: ../src/guestfs-actions.pod:7883
30317 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
30322 #: ../src/guestfs-actions.pod:7895
30324 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
30329 #: ../src/guestfs-actions.pod:7903
30330 msgid "guestfs_zgrep"
30334 #: ../src/guestfs-actions.pod:7905
30338 " guestfs_zgrep (guestfs_h *g,\n"
30339 " const char *regex,\n"
30340 " const char *path);\n"
30345 #: ../src/guestfs-actions.pod:7922
30346 msgid "guestfs_zgrepi"
30350 #: ../src/guestfs-actions.pod:7924
30354 " guestfs_zgrepi (guestfs_h *g,\n"
30355 " const char *regex,\n"
30356 " const char *path);\n"
30361 #: ../src/guestfs-availability.pod:3
30366 #: ../src/guestfs-availability.pod:5
30368 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
30369 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
30370 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
30371 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
30372 "L</guestfs_aug_save> L</guestfs_aug_set>"
30376 #: ../src/guestfs-availability.pod:21
30381 #: ../src/guestfs-availability.pod:23
30382 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
30386 #: ../src/guestfs-availability.pod:26
30391 #: ../src/guestfs-availability.pod:28
30393 "The following functions: L</guestfs_inotify_add_watch> L</"
30394 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
30395 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
30399 #: ../src/guestfs-availability.pod:36
30400 msgid "B<linuxfsuuid>"
30404 #: ../src/guestfs-availability.pod:38
30406 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
30407 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
30411 #: ../src/guestfs-availability.pod:45
30412 msgid "B<linuxmodules>"
30416 #: ../src/guestfs-availability.pod:47
30417 msgid "The following functions: L</guestfs_modprobe>"
30421 #: ../src/guestfs-availability.pod:50
30422 msgid "B<linuxxattrs>"
30426 #: ../src/guestfs-availability.pod:52
30428 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
30429 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
30430 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
30431 "guestfs_setxattr>"
30435 #: ../src/guestfs-availability.pod:63
30440 #: ../src/guestfs-availability.pod:65
30442 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
30443 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
30444 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
30448 #: ../src/guestfs-availability.pod:74
30453 #: ../src/guestfs-availability.pod:76
30455 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
30456 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
30457 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
30458 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
30459 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
30460 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
30461 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
30465 #: ../src/guestfs-availability.pod:99
30470 #: ../src/guestfs-availability.pod:101
30472 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
30473 "guestfs_mknod_b> L</guestfs_mknod_c>"
30477 #: ../src/guestfs-availability.pod:107
30482 #: ../src/guestfs-availability.pod:109
30483 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
30487 #: ../src/guestfs-availability.pod:112
30488 msgid "B<ntfsprogs>"
30492 #: ../src/guestfs-availability.pod:114
30494 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
30495 "L</guestfs_ntfsresize_size>"
30499 #: ../src/guestfs-availability.pod:119
30500 msgid "B<realpath>"
30504 #: ../src/guestfs-availability.pod:121
30505 msgid "The following functions: L</guestfs_realpath>"
30509 #: ../src/guestfs-availability.pod:124
30514 #: ../src/guestfs-availability.pod:126
30516 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
30517 "guestfs_scrub_freespace>"
30521 #: ../src/guestfs-availability.pod:131
30526 #: ../src/guestfs-availability.pod:133
30527 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
30531 #: ../src/guestfs-availability.pod:137
30536 #: ../src/guestfs-availability.pod:139
30537 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
30541 #: ../src/guestfs-availability.pod:143
30542 msgid "B<zerofree>"
30546 #: ../src/guestfs-availability.pod:145
30547 msgid "The following functions: L</guestfs_zerofree>"
30551 #: ../src/guestfs-structs.pod:1
30552 msgid "guestfs_int_bool"
30556 #: ../src/guestfs-structs.pod:3
30559 " struct guestfs_int_bool {\n"
30567 #: ../src/guestfs-structs.pod:8
30570 " struct guestfs_int_bool_list {\n"
30571 " uint32_t len; /* Number of elements in list. */\n"
30572 " struct guestfs_int_bool *val; /* Elements. */\n"
30578 #: ../src/guestfs-structs.pod:13
30581 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
30582 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
30587 #: ../src/guestfs-structs.pod:16
30588 msgid "guestfs_lvm_pv"
30592 #: ../src/guestfs-structs.pod:18
30595 " struct guestfs_lvm_pv {\n"
30596 " char *pv_name;\n"
30597 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30598 " char pv_uuid[32];\n"
30600 " uint64_t pv_size;\n"
30601 " uint64_t dev_size;\n"
30602 " uint64_t pv_free;\n"
30603 " uint64_t pv_used;\n"
30604 " char *pv_attr;\n"
30605 " int64_t pv_pe_count;\n"
30606 " int64_t pv_pe_alloc_count;\n"
30607 " char *pv_tags;\n"
30608 " uint64_t pe_start;\n"
30609 " int64_t pv_mda_count;\n"
30610 " uint64_t pv_mda_free;\n"
30616 #: ../src/guestfs-structs.pod:36
30619 " struct guestfs_lvm_pv_list {\n"
30620 " uint32_t len; /* Number of elements in list. */\n"
30621 " struct guestfs_lvm_pv *val; /* Elements. */\n"
30627 #: ../src/guestfs-structs.pod:41
30630 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
30631 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
30636 #: ../src/guestfs-structs.pod:44
30637 msgid "guestfs_lvm_vg"
30641 #: ../src/guestfs-structs.pod:46
30644 " struct guestfs_lvm_vg {\n"
30645 " char *vg_name;\n"
30646 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30647 " char vg_uuid[32];\n"
30649 " char *vg_attr;\n"
30650 " uint64_t vg_size;\n"
30651 " uint64_t vg_free;\n"
30652 " char *vg_sysid;\n"
30653 " uint64_t vg_extent_size;\n"
30654 " int64_t vg_extent_count;\n"
30655 " int64_t vg_free_count;\n"
30656 " int64_t max_lv;\n"
30657 " int64_t max_pv;\n"
30658 " int64_t pv_count;\n"
30659 " int64_t lv_count;\n"
30660 " int64_t snap_count;\n"
30661 " int64_t vg_seqno;\n"
30662 " char *vg_tags;\n"
30663 " int64_t vg_mda_count;\n"
30664 " uint64_t vg_mda_free;\n"
30670 #: ../src/guestfs-structs.pod:69
30673 " struct guestfs_lvm_vg_list {\n"
30674 " uint32_t len; /* Number of elements in list. */\n"
30675 " struct guestfs_lvm_vg *val; /* Elements. */\n"
30681 #: ../src/guestfs-structs.pod:74
30684 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
30685 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
30690 #: ../src/guestfs-structs.pod:77
30691 msgid "guestfs_lvm_lv"
30695 #: ../src/guestfs-structs.pod:79
30698 " struct guestfs_lvm_lv {\n"
30699 " char *lv_name;\n"
30700 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30701 " char lv_uuid[32];\n"
30702 " char *lv_attr;\n"
30703 " int64_t lv_major;\n"
30704 " int64_t lv_minor;\n"
30705 " int64_t lv_kernel_major;\n"
30706 " int64_t lv_kernel_minor;\n"
30707 " uint64_t lv_size;\n"
30708 " int64_t seg_count;\n"
30710 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30711 " float snap_percent;\n"
30712 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30713 " float copy_percent;\n"
30714 " char *move_pv;\n"
30715 " char *lv_tags;\n"
30716 " char *mirror_log;\n"
30717 " char *modules;\n"
30723 #: ../src/guestfs-structs.pod:101
30726 " struct guestfs_lvm_lv_list {\n"
30727 " uint32_t len; /* Number of elements in list. */\n"
30728 " struct guestfs_lvm_lv *val; /* Elements. */\n"
30734 #: ../src/guestfs-structs.pod:106
30737 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
30738 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
30743 #: ../src/guestfs-structs.pod:111
30746 " struct guestfs_stat {\n"
30750 " int64_t nlink;\n"
30755 " int64_t blksize;\n"
30756 " int64_t blocks;\n"
30757 " int64_t atime;\n"
30758 " int64_t mtime;\n"
30759 " int64_t ctime;\n"
30765 #: ../src/guestfs-structs.pod:127
30768 " struct guestfs_stat_list {\n"
30769 " uint32_t len; /* Number of elements in list. */\n"
30770 " struct guestfs_stat *val; /* Elements. */\n"
30776 #: ../src/guestfs-structs.pod:132
30779 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
30780 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
30785 #: ../src/guestfs-structs.pod:137
30788 " struct guestfs_statvfs {\n"
30789 " int64_t bsize;\n"
30790 " int64_t frsize;\n"
30791 " int64_t blocks;\n"
30792 " int64_t bfree;\n"
30793 " int64_t bavail;\n"
30794 " int64_t files;\n"
30795 " int64_t ffree;\n"
30796 " int64_t favail;\n"
30799 " int64_t namemax;\n"
30805 #: ../src/guestfs-structs.pod:151
30808 " struct guestfs_statvfs_list {\n"
30809 " uint32_t len; /* Number of elements in list. */\n"
30810 " struct guestfs_statvfs *val; /* Elements. */\n"
30816 #: ../src/guestfs-structs.pod:156
30819 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
30820 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
30825 #: ../src/guestfs-structs.pod:159
30826 msgid "guestfs_dirent"
30830 #: ../src/guestfs-structs.pod:161
30833 " struct guestfs_dirent {\n"
30842 #: ../src/guestfs-structs.pod:167
30845 " struct guestfs_dirent_list {\n"
30846 " uint32_t len; /* Number of elements in list. */\n"
30847 " struct guestfs_dirent *val; /* Elements. */\n"
30853 #: ../src/guestfs-structs.pod:172
30856 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
30857 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
30862 #: ../src/guestfs-structs.pod:177
30865 " struct guestfs_version {\n"
30866 " int64_t major;\n"
30867 " int64_t minor;\n"
30868 " int64_t release;\n"
30875 #: ../src/guestfs-structs.pod:184
30878 " struct guestfs_version_list {\n"
30879 " uint32_t len; /* Number of elements in list. */\n"
30880 " struct guestfs_version *val; /* Elements. */\n"
30886 #: ../src/guestfs-structs.pod:189
30889 " void guestfs_free_version (struct guestfs_free_version *);\n"
30890 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
30895 #: ../src/guestfs-structs.pod:192
30896 msgid "guestfs_xattr"
30900 #: ../src/guestfs-structs.pod:194
30903 " struct guestfs_xattr {\n"
30904 " char *attrname;\n"
30905 " /* The next two fields describe a byte array. */\n"
30906 " uint32_t attrval_len;\n"
30907 " char *attrval;\n"
30913 #: ../src/guestfs-structs.pod:201
30916 " struct guestfs_xattr_list {\n"
30917 " uint32_t len; /* Number of elements in list. */\n"
30918 " struct guestfs_xattr *val; /* Elements. */\n"
30924 #: ../src/guestfs-structs.pod:206
30927 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
30928 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
30933 #: ../src/guestfs-structs.pod:209
30934 msgid "guestfs_inotify_event"
30938 #: ../src/guestfs-structs.pod:211
30941 " struct guestfs_inotify_event {\n"
30942 " int64_t in_wd;\n"
30943 " uint32_t in_mask;\n"
30944 " uint32_t in_cookie;\n"
30945 " char *in_name;\n"
30951 #: ../src/guestfs-structs.pod:218
30954 " struct guestfs_inotify_event_list {\n"
30955 " uint32_t len; /* Number of elements in list. */\n"
30956 " struct guestfs_inotify_event *val; /* Elements. */\n"
30962 #: ../src/guestfs-structs.pod:223
30965 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
30966 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
30971 #: ../src/guestfs-structs.pod:226
30972 msgid "guestfs_partition"
30976 #: ../src/guestfs-structs.pod:228
30979 " struct guestfs_partition {\n"
30980 " int32_t part_num;\n"
30981 " uint64_t part_start;\n"
30982 " uint64_t part_end;\n"
30983 " uint64_t part_size;\n"
30989 #: ../src/guestfs-structs.pod:235
30992 " struct guestfs_partition_list {\n"
30993 " uint32_t len; /* Number of elements in list. */\n"
30994 " struct guestfs_partition *val; /* Elements. */\n"
31000 #: ../src/guestfs-structs.pod:240
31003 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
31004 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
31009 #: ../src/guestfs-structs.pod:243
31010 msgid "guestfs_application"
31014 #: ../src/guestfs-structs.pod:245
31017 " struct guestfs_application {\n"
31018 " char *app_name;\n"
31019 " char *app_display_name;\n"
31020 " int32_t app_epoch;\n"
31021 " char *app_version;\n"
31022 " char *app_release;\n"
31023 " char *app_install_path;\n"
31024 " char *app_trans_path;\n"
31025 " char *app_publisher;\n"
31026 " char *app_url;\n"
31027 " char *app_source_package;\n"
31028 " char *app_summary;\n"
31029 " char *app_description;\n"
31035 #: ../src/guestfs-structs.pod:260
31038 " struct guestfs_application_list {\n"
31039 " uint32_t len; /* Number of elements in list. */\n"
31040 " struct guestfs_application *val; /* Elements. */\n"
31046 #: ../src/guestfs-structs.pod:265
31049 " void guestfs_free_application (struct guestfs_free_application *);\n"
31050 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
31055 #: ../src/guestfs.pod:5
31056 msgid "guestfs - Library for accessing and modifying virtual machine images"
31060 #: ../src/guestfs.pod:11
31063 " guestfs_h *g = guestfs_create ();\n"
31064 " guestfs_add_drive (g, \"guest.img\");\n"
31065 " guestfs_launch (g);\n"
31066 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
31067 " guestfs_touch (g, \"/hello\");\n"
31068 " guestfs_umount (g, \"/\");\n"
31069 " guestfs_close (g);\n"
31074 #: ../src/guestfs.pod:25
31076 "Libguestfs is a library for accessing and modifying guest disk images. "
31077 "Amongst the things this is good for: making batch configuration changes to "
31078 "guests, getting disk used/free statistics (see also: virt-df), migrating "
31079 "between virtualization systems (see also: virt-p2v), performing partial "
31080 "backups, performing partial guest clones, cloning guests and changing "
31081 "registry/UUID/hostname info, and much else besides."
31085 #: ../src/guestfs.pod:33
31087 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
31088 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
31089 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
31094 #: ../src/guestfs.pod:38
31096 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
31097 "what filesystem is in each LV, etc.). It can also run commands in the "
31098 "context of the guest. Also you can access filesystems over FUSE."
31102 #: ../src/guestfs.pod:43
31104 "Libguestfs is a library that can be linked with C and C++ management "
31105 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
31106 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
31111 #: ../src/guestfs.pod:48
31113 "You don't need to be root to use libguestfs, although obviously you do need "
31114 "enough permissions to access the disk images."
31118 #: ../src/guestfs.pod:51
31120 "Libguestfs is a large API because it can do many things. For a gentle "
31121 "introduction, please read the L</API OVERVIEW> section next."
31125 #: ../src/guestfs.pod:54
31127 "There are also some example programs in the L<guestfs-examples(3)> manual "
31132 #: ../src/guestfs.pod:57
31133 msgid "API OVERVIEW"
31137 #: ../src/guestfs.pod:59
31139 "This section provides a gentler overview of the libguestfs API. We also try "
31140 "to group API calls together, where that may not be obvious from reading "
31141 "about the individual calls in the main section of this manual."
31145 #: ../src/guestfs.pod:64
31150 #: ../src/guestfs.pod:66
31152 "Before you can use libguestfs calls, you have to create a handle. Then you "
31153 "must add at least one disk image to the handle, followed by launching the "
31154 "handle, then performing whatever operations you want, and finally closing "
31155 "the handle. By convention we use the single letter C<g> for the name of the "
31156 "handle variable, although of course you can use any name you want."
31160 #: ../src/guestfs.pod:73
31161 msgid "The general structure of all libguestfs-using programs looks like this:"
31165 #: ../src/guestfs.pod:76
31168 " guestfs_h *g = guestfs_create ();\n"
31173 #: ../src/guestfs.pod:78
31176 " /* Call guestfs_add_drive additional times if there are\n"
31177 " * multiple disk images.\n"
31179 " guestfs_add_drive (g, \"guest.img\");\n"
31184 #: ../src/guestfs.pod:83
31187 " /* Most manipulation calls won't work until you've launched\n"
31188 " * the handle 'g'. You have to do this _after_ adding drives\n"
31189 " * and _before_ other commands.\n"
31191 " guestfs_launch (g);\n"
31196 #: ../src/guestfs.pod:89
31199 " /* Now you can examine what partitions, LVs etc are available.\n"
31201 " char **partitions = guestfs_list_partitions (g);\n"
31202 " char **logvols = guestfs_lvs (g);\n"
31207 #: ../src/guestfs.pod:94
31210 " /* To access a filesystem in the image, you must mount it.\n"
31212 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
31217 #: ../src/guestfs.pod:98
31220 " /* Now you can perform filesystem actions on the guest\n"
31223 " guestfs_touch (g, \"/hello\");\n"
31228 #: ../src/guestfs.pod:103
31231 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
31232 " * it is done automatically when you close the handle. See\n"
31233 " * discussion of autosync in this page.\n"
31235 " guestfs_sync (g);\n"
31240 #: ../src/guestfs.pod:109
31243 " /* Close the handle 'g'. */\n"
31244 " guestfs_close (g);\n"
31249 #: ../src/guestfs.pod:112
31251 "The code above doesn't include any error checking. In real code you should "
31252 "check return values carefully for errors. In general all functions that "
31253 "return integers return C<-1> on error, and all functions that return "
31254 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
31255 "how to handle errors, and consult the documentation for each function call "
31256 "below to see precisely how they return error indications. See L<guestfs-"
31257 "examples(3)> for fully worked examples."
31261 #: ../src/guestfs.pod:121
31262 msgid "DISK IMAGES"
31266 #: ../src/guestfs.pod:123
31268 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
31269 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
31270 "actual block device, or simply an empty file of zeroes that you have created "
31271 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
31276 #: ../src/guestfs.pod:129
31278 "The call you should use in modern code for adding drives is L</"
31279 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
31280 "specifying that the format is raw, do:"
31284 #: ../src/guestfs.pod:133
31287 " guestfs_add_drive_opts (g, filename,\n"
31288 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31294 #: ../src/guestfs.pod:137
31295 msgid "You can add a disk read-only using:"
31299 #: ../src/guestfs.pod:139
31302 " guestfs_add_drive_opts (g, filename,\n"
31303 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31304 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
31310 #: ../src/guestfs.pod:144
31312 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
31313 "libguestfs won't modify the file."
31317 #: ../src/guestfs.pod:147
31319 "Be extremely cautious if the disk image is in use, eg. if it is being used "
31320 "by a virtual machine. Adding it read-write will almost certainly cause disk "
31321 "corruption, but adding it read-only is safe."
31325 #: ../src/guestfs.pod:151
31327 "You must add at least one disk image, and you may add multiple disk images. "
31328 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
31329 "first one you added), C</dev/sdb> (for the second one you added), etc."
31333 #: ../src/guestfs.pod:156
31335 "Once L</guestfs_launch> has been called you cannot add any more images. You "
31336 "can call L</guestfs_list_devices> to get a list of the device names, in the "
31337 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
31341 #: ../src/guestfs.pod:161
31346 #: ../src/guestfs.pod:163
31348 "Before you can read or write files, create directories and so on in a disk "
31349 "image that contains filesystems, you have to mount those filesystems using "
31350 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
31351 "a disk image contains (for example) one partition with a filesystem on that "
31352 "partition, then you can mount it directly:"
31356 #: ../src/guestfs.pod:170
31359 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
31364 #: ../src/guestfs.pod:172
31366 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
31367 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
31368 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
31369 "that these are libguestfs virtual devices, and are nothing to do with host "
31374 #: ../src/guestfs.pod:178
31376 "If you are given a disk image and you don't know what it contains then you "
31377 "have to find out. Libguestfs can do that too: use L</"
31378 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
31379 "LVs, and either try mounting each to see what is mountable, or else examine "
31380 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
31381 "filesystems, use L</guestfs_list_filesystems>."
31385 #: ../src/guestfs.pod:186
31387 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
31388 "L</INSPECTION> below). But you might find it easier to look at higher level "
31389 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
31393 #: ../src/guestfs.pod:191
31395 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
31396 "several other variations of the C<guestfs_mount_*> call."
31400 #: ../src/guestfs.pod:194
31401 msgid "FILESYSTEM ACCESS AND MODIFICATION"
31405 #: ../src/guestfs.pod:196
31407 "The majority of the libguestfs API consists of fairly low-level calls for "
31408 "accessing and modifying the files, directories, symlinks etc on mounted "
31409 "filesystems. There are over a hundred such calls which you can find listed "
31410 "in detail below in this man page, and we don't even pretend to cover them "
31411 "all in this overview."
31415 #: ../src/guestfs.pod:202
31417 "Specify filenames as full paths, starting with C<\"/\"> and including the "
31422 #: ../src/guestfs.pod:205
31424 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
31425 "the file called C<\"etc/passwd\"> then you could do:"
31429 #: ../src/guestfs.pod:208
31432 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
31437 #: ../src/guestfs.pod:210
31439 "This would return C<data> as a newly allocated buffer containing the full "
31440 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
31441 "or C<NULL> if there was an error."
31445 #: ../src/guestfs.pod:214
31447 "As another example, to create a top-level directory on that filesystem "
31448 "called C<\"var\"> you would do:"
31452 #: ../src/guestfs.pod:217
31455 " guestfs_mkdir (g, \"/var\");\n"
31460 #: ../src/guestfs.pod:219
31461 msgid "To create a symlink you could do:"
31465 #: ../src/guestfs.pod:221
31468 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
31469 " \"/etc/rc3.d/S30portmap\");\n"
31474 #: ../src/guestfs.pod:224
31476 "Libguestfs will reject attempts to use relative paths and there is no "
31477 "concept of a current working directory."
31481 #: ../src/guestfs.pod:227
31483 "Libguestfs can return errors in many situations: for example if the "
31484 "filesystem isn't writable, or if a file or directory that you requested "
31485 "doesn't exist. If you are using the C API (documented here) you have to "
31486 "check for those error conditions after each call. (Other language bindings "
31487 "turn these errors into exceptions)."
31491 #: ../src/guestfs.pod:233
31493 "File writes are affected by the per-handle umask, set by calling L</"
31494 "guestfs_umask> and defaulting to 022. See L</UMASK>."
31498 #: ../src/guestfs.pod:236
31499 msgid "PARTITIONING"
31503 #: ../src/guestfs.pod:238
31505 "Libguestfs contains API calls to read, create and modify partition tables on "
31510 #: ../src/guestfs.pod:241
31512 "In the common case where you want to create a single partition covering the "
31513 "whole disk, you should use the L</guestfs_part_disk> call:"
31517 #: ../src/guestfs.pod:245
31520 " const char *parttype = \"mbr\";\n"
31521 " if (disk_is_larger_than_2TB)\n"
31522 " parttype = \"gpt\";\n"
31523 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
31528 #: ../src/guestfs.pod:250
31530 "Obviously this effectively wipes anything that was on that disk image before."
31534 #: ../src/guestfs.pod:253
31539 #: ../src/guestfs.pod:255
31541 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
31542 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
31543 "you familiarize yourself with the concepts of physical volumes, volume "
31544 "groups and logical volumes."
31548 #: ../src/guestfs.pod:260
31550 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
31551 "tldp.org/HOWTO/LVM-HOWTO/>."
31555 #: ../src/guestfs.pod:263
31556 msgid "DOWNLOADING"
31560 #: ../src/guestfs.pod:265
31562 "Use L</guestfs_cat> to download small, text only files. This call is "
31563 "limited to files which are less than 2 MB and which cannot contain any ASCII "
31564 "NUL (C<\\0>) characters. However the API is very simple to use."
31568 #: ../src/guestfs.pod:269
31570 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
31571 "bit data, since it returns a (pointer, size) pair. However it is still "
31572 "limited to \"small\" files, less than 2 MB."
31576 #: ../src/guestfs.pod:273
31578 "L</guestfs_download> can be used to download any file, with no limits on "
31579 "content or size (even files larger than 4 GB)."
31583 #: ../src/guestfs.pod:276
31585 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
31589 #: ../src/guestfs.pod:279
31594 #: ../src/guestfs.pod:281
31596 "It's often the case that you want to write a file or files to the disk image."
31600 #: ../src/guestfs.pod:284
31602 "To write a small file with fixed content, use L</guestfs_write>. To create "
31603 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
31604 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
31605 "of other functions for creating test files, for example L</guestfs_fill> and "
31606 "L</guestfs_fill_pattern>."
31610 #: ../src/guestfs.pod:290
31612 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
31613 "file content or size (even files larger than 4 GB)."
31617 #: ../src/guestfs.pod:293
31619 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
31623 #: ../src/guestfs.pod:295
31625 "However the fastest way to upload I<large numbers of arbitrary files> is to "
31626 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
31627 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
31628 "in a predictable way (eg. adding it last after all other drives) then you "
31629 "can get the device name from L</guestfs_list_devices> and mount it directly "
31630 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
31631 "portable between kernel versions, and they don't support labels or UUIDs. "
31632 "If you want to pre-build an image or you need to mount it using a label or "
31633 "UUID, use an ISO image instead."
31637 #: ../src/guestfs.pod:306
31642 #: ../src/guestfs.pod:308
31644 "There are various different commands for copying between files and devices "
31645 "and in and out of the guest filesystem. These are summarised in the table "
31650 #: ../src/guestfs.pod:314
31651 msgid "B<file> to B<file>"
31655 #: ../src/guestfs.pod:316
31657 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
31658 "directories recursively."
31662 #: ../src/guestfs.pod:319
31663 msgid "B<file or device> to B<file or device>"
31667 #: ../src/guestfs.pod:321
31669 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
31670 "devices in the guest."
31674 #: ../src/guestfs.pod:324
31675 msgid "Example: duplicate the contents of an LV:"
31679 #: ../src/guestfs.pod:326
31682 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
31687 #: ../src/guestfs.pod:328
31689 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
31690 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
31691 "guestfs_copy_size>."
31695 #: ../src/guestfs.pod:332
31696 msgid "B<file on the host> to B<file or device>"
31700 #: ../src/guestfs.pod:334
31701 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
31705 #: ../src/guestfs.pod:336
31706 msgid "B<file or device> to B<file on the host>"
31710 #: ../src/guestfs.pod:338
31711 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
31715 #: ../src/guestfs.pod:342
31716 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
31720 #: ../src/guestfs.pod:344
31722 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
31723 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
31724 "appears you can only upload and download to files. However many Un*x-like "
31725 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
31726 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
31727 "and arbitrary file descriptor N."
31731 #: ../src/guestfs.pod:352
31732 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
31736 #: ../src/guestfs.pod:355
31739 " guestfs_download (g, filename, \"/dev/stdout\");\n"
31744 #: ../src/guestfs.pod:357
31745 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
31749 #: ../src/guestfs.pod:359
31752 " char devfd[64];\n"
31753 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
31754 " guestfs_tar_out (g, \"/\", devfd);\n"
31759 #: ../src/guestfs.pod:363
31760 msgid "LISTING FILES"
31764 #: ../src/guestfs.pod:365
31766 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
31767 "L<guestfish(1)>-equivalent command C<ll>)."
31771 #: ../src/guestfs.pod:368
31773 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
31774 "programs, as a flat list of strings."
31778 #: ../src/guestfs.pod:371
31780 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
31781 "directory, plus additional information about each one. It is more "
31782 "equivalent to using the L<readdir(3)> call on a local filesystem."
31786 #: ../src/guestfs.pod:375
31788 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
31792 #: ../src/guestfs.pod:378
31793 msgid "RUNNING COMMANDS"
31797 #: ../src/guestfs.pod:380
31799 "Although libguestfs is primarily an API for manipulating files inside guest "
31800 "images, we also provide some limited facilities for running commands inside "
31805 #: ../src/guestfs.pod:384
31806 msgid "There are many limitations to this:"
31810 #: ../src/guestfs.pod:390
31812 "The kernel version that the command runs under will be different from what "
31817 #: ../src/guestfs.pod:395
31819 "If the command needs to communicate with daemons, then most likely they "
31820 "won't be running."
31824 #: ../src/guestfs.pod:400
31825 msgid "The command will be running in limited memory."
31829 #: ../src/guestfs.pod:404
31831 "The network may not be available unless you enable it (see L</"
31832 "guestfs_set_network>)."
31836 #: ../src/guestfs.pod:409
31837 msgid "Only supports Linux guests (not Windows, BSD, etc)."
31841 #: ../src/guestfs.pod:413
31843 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
31847 #: ../src/guestfs.pod:418
31849 "For SELinux guests, you may need to enable SELinux and load policy first. "
31850 "See L</SELINUX> in this manpage."
31854 #: ../src/guestfs.pod:423
31856 "I<Security:> It is not safe to run commands from untrusted, possibly "
31857 "malicious guests. These commands may attempt to exploit your program by "
31858 "sending unexpected output. They could also try to exploit the Linux kernel "
31859 "or qemu provided by the libguestfs appliance. They could use the network "
31860 "provided by the libguestfs appliance to bypass ordinary network partitions "
31861 "and firewalls. They could use the elevated privileges or different SELinux "
31862 "context of your program to their advantage."
31866 #: ../src/guestfs.pod:432
31868 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
31869 "(a script which runs when the guest next boots normally), and to have this "
31870 "script run the commands you want in the normal context of the running guest, "
31871 "network security and so on. For information about other security issues, "
31872 "see L</SECURITY>."
31876 #: ../src/guestfs.pod:440
31878 "The two main API calls to run commands are L</guestfs_command> and L</"
31879 "guestfs_sh> (there are also variations)."
31883 #: ../src/guestfs.pod:443
31885 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
31886 "shell globs, redirections, etc will work."
31890 #: ../src/guestfs.pod:446
31891 msgid "CONFIGURATION FILES"
31895 #: ../src/guestfs.pod:448
31897 "To read and write configuration files in Linux guest filesystems, we "
31898 "strongly recommend using Augeas. For example, Augeas understands how to "
31899 "read and write, say, a Linux shadow password file or X.org configuration "
31900 "file, and so avoids you having to write that code."
31904 #: ../src/guestfs.pod:453
31906 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
31907 "document Augeas itself here because there is excellent documentation on the "
31908 "L<http://augeas.net/> website."
31912 #: ../src/guestfs.pod:457
31914 "If you don't want to use Augeas (you fool!) then try calling L</"
31915 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
31920 #: ../src/guestfs.pod:461
31925 #: ../src/guestfs.pod:463
31927 "We support SELinux guests. To ensure that labeling happens correctly in "
31928 "SELinux guests, you need to enable SELinux and load the guest's policy:"
31932 #: ../src/guestfs.pod:471
31933 msgid "Before launching, do:"
31937 #: ../src/guestfs.pod:473
31940 " guestfs_set_selinux (g, 1);\n"
31945 #: ../src/guestfs.pod:477
31947 "After mounting the guest's filesystem(s), load the policy. This is best "
31948 "done by running the L<load_policy(8)> command in the guest itself:"
31952 #: ../src/guestfs.pod:481
31955 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
31960 #: ../src/guestfs.pod:483
31962 "(Older versions of C<load_policy> require you to specify the name of the "
31967 #: ../src/guestfs.pod:488
31969 "Optionally, set the security context for the API. The correct security "
31970 "context to use can only be known by inspecting the guest. As an example:"
31974 #: ../src/guestfs.pod:492
31977 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
31982 #: ../src/guestfs.pod:496
31983 msgid "This will work for running commands and editing existing files."
31987 #: ../src/guestfs.pod:498
31989 "When new files are created, you may need to label them explicitly, for "
31990 "example by running the external command C<restorecon pathname>."
31994 #: ../src/guestfs.pod:502
31999 #: ../src/guestfs.pod:504
32001 "Certain calls are affected by the current file mode creation mask (the "
32002 "\"umask\"). In particular ones which create files or directories, such as "
32003 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
32004 "either the default mode that the file is created with or modifies the mode "
32009 #: ../src/guestfs.pod:510
32011 "The default umask is C<022>, so files are created with modes such as C<0644> "
32012 "and directories with C<0755>."
32016 #: ../src/guestfs.pod:513
32018 "There are two ways to avoid being affected by umask. Either set umask to 0 "
32019 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
32020 "guestfs_chmod> after creating each file or directory."
32024 #: ../src/guestfs.pod:517
32025 msgid "For more information about umask, see L<umask(2)>."
32029 #: ../src/guestfs.pod:521
32031 "Libguestfs allows you to access Linux guests which have been encrypted using "
32032 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
32033 "standard. This includes nearly all whole disk encryption systems used by "
32034 "modern Linux guests."
32038 #: ../src/guestfs.pod:527
32040 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
32041 "returns the string C<crypto_LUKS>)."
32045 #: ../src/guestfs.pod:530
32047 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
32048 "will require the passphrase!"
32052 #: ../src/guestfs.pod:533
32054 "Opening a LUKS device creates a new device mapper device called C</dev/"
32055 "mapper/mapname> (where C<mapname> is the string you supply to L</"
32056 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
32057 "from and encrypted to the underlying block device respectively."
32061 #: ../src/guestfs.pod:539
32063 "LVM volume groups on the device can be made visible by calling L</"
32064 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
32065 "(s) can now be mounted in the usual way."
32069 #: ../src/guestfs.pod:543
32071 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
32072 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
32073 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
32074 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
32075 "underlying encrypted block device)."
32079 #: ../src/guestfs.pod:550
32084 #: ../src/guestfs.pod:552
32086 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
32087 "contains operating systems, an install CD or a live CD. (These APIs used to "
32088 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
32089 "version 1.5.3 the most frequently used part of this library has been "
32090 "rewritten in C and moved into the core code)."
32094 #: ../src/guestfs.pod:559
32096 "Add all disks belonging to the unknown virtual machine and call L</"
32097 "guestfs_launch> in the usual way."
32101 #: ../src/guestfs.pod:562
32103 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
32104 "and certain heuristics, and returns a list of operating systems that were "
32105 "found. An empty list means none were found. A single element is the root "
32106 "filesystem of the operating system. For dual- or multi-boot guests, "
32107 "multiple roots can be returned, each one corresponding to a separate "
32108 "operating system. (Multi-boot virtual machines are extremely rare in the "
32109 "world of virtualization, but since this scenario can happen, we have built "
32110 "libguestfs to deal with it.)"
32114 #: ../src/guestfs.pod:571
32116 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
32117 "to get additional details about that operating system. For example, call L</"
32118 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
32119 "Windows and Linux-based operating systems respectively."
32123 #: ../src/guestfs.pod:577
32125 "Un*x-like and Linux-based operating systems usually consist of several "
32126 "filesystems which are mounted at boot time (for example, a separate boot "
32127 "partition mounted on C</boot>). The inspection rules are able to detect how "
32128 "filesystems correspond to mount points. Call "
32129 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
32130 "hash table like this example:"
32134 #: ../src/guestfs.pod:584
32137 " /boot => /dev/sda1\n"
32138 " / => /dev/vg_guest/lv_root\n"
32139 " /usr => /dev/vg_guest/lv_usr\n"
32144 #: ../src/guestfs.pod:588
32146 "The caller can then make calls to L</guestfs_mount_options> to mount the "
32147 "filesystems as suggested."
32151 #: ../src/guestfs.pod:591
32153 "Be careful to mount filesystems in the right order (eg. C</> before C</"
32154 "usr>). Sorting the keys of the hash by length, shortest first, should work."
32158 #: ../src/guestfs.pod:595
32160 "Inspection currently only works for some common operating systems. "
32161 "Contributors are welcome to send patches for other operating systems that we "
32162 "currently cannot detect."
32166 #: ../src/guestfs.pod:599
32168 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
32169 "for more details. The L</guestfs_inspect_os> function just ignores any "
32170 "encrypted devices."
32174 #: ../src/guestfs.pod:603
32176 "A note on the implementation: The call L</guestfs_inspect_os> performs "
32177 "inspection and caches the results in the guest handle. Subsequent calls to "
32178 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
32179 "read the disks. If you change the content of the guest disks, you can redo "
32180 "inspection by calling L</guestfs_inspect_os> again. (L</"
32181 "guestfs_inspect_list_applications> works a little differently from the other "
32182 "calls and does read the disks. See documentation for that function for "
32187 #: ../src/guestfs.pod:612
32188 msgid "INSPECTING INSTALL DISKS"
32192 #: ../src/guestfs.pod:614
32194 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
32199 #: ../src/guestfs.pod:617
32201 "Call L</guestfs_inspect_get_format> to return the format of the operating "
32202 "system, which currently can be C<installed> (a regular operating system) or "
32203 "C<installer> (some sort of install disk)."
32207 #: ../src/guestfs.pod:621
32209 "Further information is available about the operating system that can be "
32210 "installed using the regular inspection APIs like L</"
32211 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
32215 #: ../src/guestfs.pod:626
32217 "Some additional information specific to installer disks is also available "
32218 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
32219 "guestfs_inspect_is_multipart> calls."
32223 #: ../src/guestfs.pod:631
32224 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
32228 #: ../src/guestfs.pod:633
32230 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
32231 "ntfs-3g.org/> driver."
32235 #: ../src/guestfs.pod:636
32236 msgid "DRIVE LETTERS AND PATHS"
32240 #: ../src/guestfs.pod:638
32242 "DOS and Windows still use drive letters, and the filesystems are always "
32243 "treated as case insensitive by Windows itself, and therefore you might find "
32244 "a Windows configuration file referring to a path like C<c:\\windows"
32245 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
32246 "might be referred to as C</WINDOWS/System32>."
32250 #: ../src/guestfs.pod:644
32252 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
32253 "L</guestfs_inspect_get_drive_mappings>)"
32257 #: ../src/guestfs.pod:647
32259 "Dealing with separator characters (backslash vs forward slash) is outside "
32260 "the scope of libguestfs, but usually a simple character replacement will "
32265 #: ../src/guestfs.pod:651
32267 "To resolve the case insensitivity of paths, call L</"
32268 "guestfs_case_sensitive_path>."
32272 #: ../src/guestfs.pod:654
32273 msgid "ACCESSING THE WINDOWS REGISTRY"
32277 #: ../src/guestfs.pod:656
32279 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
32280 "files, through the library C<hivex> which is part of the libguestfs project "
32281 "although ships as a separate tarball. You have to locate and download the "
32282 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
32283 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
32284 "reg(1)> for more help on this issue."
32288 #: ../src/guestfs.pod:664
32289 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
32293 #: ../src/guestfs.pod:666
32295 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
32296 "provide something which looks like a Linux symlink. The way it tries to do "
32297 "the rewriting is described here:"
32301 #: ../src/guestfs.pod:670
32303 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
32308 #: ../src/guestfs.pod:672
32310 "The essential problem is that ntfs-3g simply does not have enough "
32311 "information to do a correct job. NTFS links can contain drive letters and "
32312 "references to external device GUIDs that ntfs-3g has no way of resolving. "
32313 "It is almost certainly the case that libguestfs callers should ignore what "
32314 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
32318 #: ../src/guestfs.pod:679
32320 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
32321 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
32322 "attribute, and read the raw reparse data from that (you can find the format "
32323 "documented in various places around the web)."
32327 #: ../src/guestfs.pod:684
32328 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
32332 #: ../src/guestfs.pod:686
32334 "There are other useful extended attributes that can be read from ntfs-3g "
32335 "filesystems (using L</guestfs_getxattr>). See:"
32339 #: ../src/guestfs.pod:689
32341 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
32345 #: ../src/guestfs.pod:691
32346 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
32350 #: ../src/guestfs.pod:693
32352 "Although we don't want to discourage you from using the C API, we will "
32353 "mention here that the same API is also available in other languages."
32357 #: ../src/guestfs.pod:696
32359 "The API is broadly identical in all supported languages. This means that "
32360 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
32361 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
32362 "OCaml. In other words, a straightforward, predictable isomorphism between "
32367 #: ../src/guestfs.pod:702
32369 "Error messages are automatically transformed into exceptions if the language "
32374 #: ../src/guestfs.pod:705
32376 "We don't try to \"object orientify\" parts of the API in OO languages, "
32377 "although contributors are welcome to write higher level APIs above what we "
32378 "provide in their favourite languages if they wish."
32382 #: ../src/guestfs.pod:711
32387 #: ../src/guestfs.pod:713
32389 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
32390 "identical to the C API. C++ classes and exceptions are not used."
32394 #: ../src/guestfs.pod:717
32399 #: ../src/guestfs.pod:719
32401 "The C# bindings are highly experimental. Please read the warnings at the "
32402 "top of C<csharp/Libguestfs.cs>."
32406 #: ../src/guestfs.pod:722
32411 #: ../src/guestfs.pod:724
32413 "This is the only language binding that is working but incomplete. Only "
32414 "calls which return simple integers have been bound in Haskell, and we are "
32415 "looking for help to complete this binding."
32419 #: ../src/guestfs.pod:728
32424 #: ../src/guestfs.pod:730
32426 "Full documentation is contained in the Javadoc which is distributed with "
32427 "libguestfs. For examples, see L<guestfs-java(3)>."
32431 #: ../src/guestfs.pod:733
32436 #: ../src/guestfs.pod:735
32437 msgid "See L<guestfs-ocaml(3)>."
32441 #: ../src/guestfs.pod:737
32446 #: ../src/guestfs.pod:739
32447 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
32451 #: ../src/guestfs.pod:741
32456 #: ../src/guestfs.pod:743
32458 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
32459 "the php-libguestfs package for your distribution."
32463 #: ../src/guestfs.pod:746
32464 msgid "The PHP binding only works correctly on 64 bit machines."
32468 #: ../src/guestfs.pod:748
32473 #: ../src/guestfs.pod:750
32474 msgid "See L<guestfs-python(3)>."
32478 #: ../src/guestfs.pod:752
32483 #: ../src/guestfs.pod:754
32484 msgid "See L<guestfs-ruby(3)>."
32488 #: ../src/guestfs.pod:756
32489 msgid "B<shell scripts>"
32493 #: ../src/guestfs.pod:758
32494 msgid "See L<guestfish(1)>."
32498 #: ../src/guestfs.pod:762
32499 msgid "LIBGUESTFS GOTCHAS"
32503 #: ../src/guestfs.pod:764
32505 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
32506 "system [...] that works in the way it is documented but is counterintuitive "
32507 "and almost invites mistakes.\""
32511 #: ../src/guestfs.pod:768
32513 "Since we developed libguestfs and the associated tools, there are several "
32514 "things we would have designed differently, but are now stuck with for "
32515 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
32516 "release, you can expect these to change. Beware of them."
32520 #: ../src/guestfs.pod:776
32521 msgid "Autosync / forgetting to sync."
32525 #: ../src/guestfs.pod:778
32527 "I<Update:> Autosync is enabled by default for all API users starting from "
32528 "libguestfs 1.5.24. This section only applies to older versions."
32532 #: ../src/guestfs.pod:781
32534 "When modifying a filesystem from C or another language, you B<must> unmount "
32535 "all filesystems and call L</guestfs_sync> explicitly before you close the "
32536 "libguestfs handle. You can also call:"
32540 #: ../src/guestfs.pod:785
32543 " guestfs_set_autosync (g, 1);\n"
32548 #: ../src/guestfs.pod:787
32550 "to have the unmount/sync done automatically for you when the handle 'g' is "
32551 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
32555 #: ../src/guestfs.pod:791
32557 "If you forget to do this, then it is entirely possible that your changes "
32558 "won't be written out, or will be partially written, or (very rarely) that "
32559 "you'll get disk corruption."
32563 #: ../src/guestfs.pod:795
32565 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
32566 "guestfish scripts that forget to sync will work just fine, which can make "
32567 "this very puzzling if you are trying to debug a problem."
32571 #: ../src/guestfs.pod:799
32572 msgid "Mount option C<-o sync> should not be the default."
32576 #: ../src/guestfs.pod:801
32578 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
32579 "However C<-o sync> does not add any reliability benefit, but does have a "
32580 "very large performance impact."
32584 #: ../src/guestfs.pod:805
32586 "The work around is to use L</guestfs_mount_options> and set the mount "
32587 "options that you actually want to use."
32591 #: ../src/guestfs.pod:808
32592 msgid "Read-only should be the default."
32596 #: ../src/guestfs.pod:810
32598 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
32599 "specify I<--rw> if you want to make changes to the image."
32603 #: ../src/guestfs.pod:813
32604 msgid "This would reduce the potential to corrupt live VM images."
32608 #: ../src/guestfs.pod:815
32610 "Note that many filesystems change the disk when you just mount and unmount, "
32611 "even if you didn't perform any writes. You need to use L</"
32612 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
32616 #: ../src/guestfs.pod:819
32617 msgid "guestfish command line is hard to use."
32621 #: ../src/guestfs.pod:821
32623 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
32624 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
32625 "exist, so it fails. In earlier versions of guestfish the error message was "
32626 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
32627 "we should have used C<guestfish -c command> to run commands."
32631 #: ../src/guestfs.pod:828
32632 msgid "guestfish megabyte modifiers don't work right on all commands"
32636 #: ../src/guestfs.pod:830
32638 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
32639 "other modifiers). What guestfish actually does is to multiply the number "
32640 "part by the modifier part and pass the result to the C API. However this "
32641 "doesn't work for a few APIs which aren't expecting bytes, but are already "
32642 "expecting some other unit (eg. megabytes)."
32646 #: ../src/guestfs.pod:837
32647 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
32651 #: ../src/guestfs.pod:839
32654 " lvcreate LV VG 100M\n"
32659 #: ../src/guestfs.pod:841
32661 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
32662 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
32663 "megabytes * megabytes) logical volume. The error message you get from this "
32664 "is also a little obscure."
32668 #: ../src/guestfs.pod:846
32670 "This could be fixed in the generator by specially marking parameters and "
32671 "return values which take bytes or other units."
32675 #: ../src/guestfs.pod:849
32676 msgid "Ambiguity between devices and paths"
32680 #: ../src/guestfs.pod:851
32682 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
32683 "sdb2>) and a similar pathname. A file might just happen to be called "
32684 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
32688 #: ../src/guestfs.pod:856
32690 "In the current API we usually resolve this ambiguity by having two separate "
32691 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
32692 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
32693 "detecting if the path supplied begins with C</dev/>."
32697 #: ../src/guestfs.pod:862
32699 "To avoid both the ambiguity and the need to duplicate some calls, we could "
32700 "make paths/devices into structured names. One way to do this would be to "
32701 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
32702 "aspect of grub. Another way would be to use a structured type, equivalent "
32703 "to this OCaml type:"
32707 #: ../src/guestfs.pod:868
32710 " type path = Path of string | Device of int | Partition of int * int\n"
32715 #: ../src/guestfs.pod:870
32716 msgid "which would allow you to pass arguments like:"
32720 #: ../src/guestfs.pod:872
32723 " Path \"/foo/bar\"\n"
32724 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
32725 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
32726 " Path \"/dev/sdb2\" (* not a device *)\n"
32731 #: ../src/guestfs.pod:877
32733 "As you can see there are still problems to resolve even with this "
32734 "representation. Also consider how it might work in guestfish."
32738 #: ../src/guestfs.pod:882
32739 msgid "KEYS AND PASSPHRASES"
32743 #: ../src/guestfs.pod:884
32745 "Certain libguestfs calls take a parameter that contains sensitive key "
32746 "material, passed in as a C string."
32750 #: ../src/guestfs.pod:887
32752 "In the future we would hope to change the libguestfs implementation so that "
32753 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
32754 "swap. However this is I<not> done at the moment, because of the complexity "
32755 "of such an implementation."
32759 #: ../src/guestfs.pod:892
32761 "Therefore you should be aware that any key parameter you pass to libguestfs "
32762 "might end up being written out to the swap partition. If this is a concern, "
32763 "scrub the swap partition or don't use libguestfs on encrypted devices."
32767 #: ../src/guestfs.pod:897
32768 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
32772 #: ../src/guestfs.pod:899
32774 "All high-level libguestfs actions are synchronous. If you want to use "
32775 "libguestfs asynchronously then you must create a thread."
32779 #: ../src/guestfs.pod:902
32781 "Only use the handle from a single thread. Either use the handle exclusively "
32782 "from one thread, or provide your own mutex so that two threads cannot issue "
32783 "calls on the same handle at the same time."
32787 #: ../src/guestfs.pod:906
32789 "See the graphical program guestfs-browser for one possible architecture for "
32790 "multithreaded programs using libvirt and libguestfs."
32794 #: ../src/guestfs.pod:909
32799 #: ../src/guestfs.pod:911
32801 "Libguestfs needs a supermin appliance, which it finds by looking along an "
32806 #: ../src/guestfs.pod:914
32808 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
32809 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
32813 #: ../src/guestfs.pod:917
32815 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
32816 "to change the directories that libguestfs will search in. The value is a "
32817 "colon-separated list of paths. The current directory is I<not> searched "
32818 "unless the path contains an empty element or C<.>. For example "
32819 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
32820 "then C</usr/lib/guestfs>."
32824 #: ../src/guestfs.pod:924
32825 msgid "QEMU WRAPPERS"
32829 #: ../src/guestfs.pod:926
32831 "If you want to compile your own qemu, run qemu from a non-standard location, "
32832 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
32837 #: ../src/guestfs.pod:930
32839 "There is one important rule to remember: you I<must C<exec qemu>> as the "
32840 "last command in the shell script (so that qemu replaces the shell and "
32841 "becomes the direct child of the libguestfs-using program). If you don't do "
32842 "this, then the qemu process won't be cleaned up correctly."
32846 #: ../src/guestfs.pod:935
32848 "Here is an example of a wrapper, where I have built my own copy of qemu from "
32853 #: ../src/guestfs.pod:938
32857 " qemudir=/home/rjones/d/qemu\n"
32858 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
32863 #: ../src/guestfs.pod:942
32865 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
32866 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
32871 #: ../src/guestfs.pod:946
32874 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
32879 #: ../src/guestfs.pod:948
32881 "Note that libguestfs also calls qemu with the -help and -version options in "
32882 "order to determine features."
32886 #: ../src/guestfs.pod:951
32887 msgid "ATTACHING TO RUNNING DAEMONS"
32891 #: ../src/guestfs.pod:953
32893 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
32894 "babies. Use with caution."
32898 #: ../src/guestfs.pod:956
32900 "I<Note (2):> This section explains how to attach to a running daemon from a "
32901 "low level perspective. For most users, simply using virt tools such as "
32902 "L<guestfish(1)> with the I<--live> option will \"just work\"."
32906 #: ../src/guestfs.pod:960
32907 msgid "Using guestfs_set_attach_method"
32911 #: ../src/guestfs.pod:962
32913 "By calling L</guestfs_set_attach_method> you can change how the library "
32914 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
32915 "ARCHITECTURE> for some background)."
32919 #: ../src/guestfs.pod:966
32921 "The normal attach method is C<appliance>, where a small appliance is created "
32922 "containing the daemon, and then the library connects to this."
32926 #: ../src/guestfs.pod:969
32928 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
32929 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
32930 "daemon over the Unix domain socket."
32934 #: ../src/guestfs.pod:973
32936 "The normal use for this is to connect to a running virtual machine that "
32937 "contains a C<guestfsd> daemon, and send commands so you can read and write "
32938 "files inside the live virtual machine."
32942 #: ../src/guestfs.pod:977
32943 msgid "Using guestfs_add_domain with live flag"
32947 #: ../src/guestfs.pod:979
32949 "L</guestfs_add_domain> provides some help for getting the correct attach "
32950 "method. If you pass the C<live> option to this function, then (if the "
32951 "virtual machine is running) it will examine the libvirt XML looking for a "
32952 "virtio-serial channel to connect to:"
32956 #: ../src/guestfs.pod:985
32963 " <channel type='unix'>\n"
32964 " <source mode='bind' path='/path/to/socket'/>\n"
32965 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
32974 #: ../src/guestfs.pod:997
32976 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
32977 "method to C<unix:/path/to/socket>."
32981 #: ../src/guestfs.pod:1000
32983 "Some of the libguestfs tools (including guestfish) support a I<--live> "
32984 "option which is passed through to L</guestfs_add_domain> thus allowing you "
32985 "to attach to and modify live virtual machines."
32989 #: ../src/guestfs.pod:1004
32991 "The virtual machine needs to have been set up beforehand so that it has the "
32992 "virtio-serial channel and so that guestfsd is running inside it."
32996 #: ../src/guestfs.pod:1008
32997 msgid "ABI GUARANTEE"
33001 #: ../src/guestfs.pod:1010
33003 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
33004 "actions as outlined in this section. Although we will deprecate some "
33005 "actions, for example if they get replaced by newer calls, we will keep the "
33006 "old actions forever. This allows you the developer to program in confidence "
33007 "against the libguestfs API."
33011 #: ../src/guestfs.pod:1016
33012 msgid "BLOCK DEVICE NAMING"
33016 #: ../src/guestfs.pod:1018
33018 "In the kernel there is now quite a profusion of schemata for naming block "
33019 "devices (in this context, by I<block device> I mean a physical or virtual "
33020 "hard drive). The original Linux IDE driver used names starting with C</dev/"
33021 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
33022 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
33023 "for the old IDE driver (particularly for SATA devices) those devices also "
33024 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
33025 "paravirtualized drivers. This has created several different naming systems, "
33026 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
33030 #: ../src/guestfs.pod:1030
33032 "As discussed above, libguestfs uses a qemu appliance running an embedded "
33033 "Linux kernel to access block devices. We can run a variety of appliances "
33034 "based on a variety of Linux kernels."
33038 #: ../src/guestfs.pod:1034
33040 "This causes a problem for libguestfs because many API calls use device or "
33041 "partition names. Working scripts and the recipe (example) scripts that we "
33042 "make available over the internet could fail if the naming scheme changes."
33046 #: ../src/guestfs.pod:1039
33048 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
33049 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
33050 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
33051 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
33055 #: ../src/guestfs.pod:1045
33057 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
33058 "L</guestfs_list_partitions> and similar calls return the true names of the "
33059 "devices and partitions as known to the appliance."
33063 #: ../src/guestfs.pod:1050
33064 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
33068 #: ../src/guestfs.pod:1052
33070 "Usually this translation is transparent. However in some (very rare) cases "
33071 "you may need to know the exact algorithm. Such cases include where you use "
33072 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
33073 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
33077 #: ../src/guestfs.pod:1058
33079 "The algorithm is applied only to I<parameters> which are known to be either "
33080 "device or partition names. Return values from functions such as L</"
33081 "guestfs_list_devices> are never changed."
33085 #: ../src/guestfs.pod:1066
33086 msgid "Is the string a parameter which is a device or partition name?"
33090 #: ../src/guestfs.pod:1070
33091 msgid "Does the string begin with C</dev/sd>?"
33095 #: ../src/guestfs.pod:1074
33097 "Does the named device exist? If so, we use that device. However if I<not> "
33098 "then we continue with this algorithm."
33102 #: ../src/guestfs.pod:1079
33103 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
33107 #: ../src/guestfs.pod:1081
33108 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
33112 #: ../src/guestfs.pod:1083
33113 msgid "If that named device exists, use it. If not, continue."
33117 #: ../src/guestfs.pod:1087
33118 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
33122 #: ../src/guestfs.pod:1089
33123 msgid "If that named device exists, use it. If not, return an error."
33127 #: ../src/guestfs.pod:1093
33128 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
33132 #: ../src/guestfs.pod:1095
33134 "Although the standard naming scheme and automatic translation is useful for "
33135 "simple programs and guestfish scripts, for larger programs it is best not to "
33136 "rely on this mechanism."
33140 #: ../src/guestfs.pod:1099
33142 "Where possible for maximum future portability programs using libguestfs "
33143 "should use these future-proof techniques:"
33147 #: ../src/guestfs.pod:1106
33149 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
33150 "device names, and then use those names directly."
33154 #: ../src/guestfs.pod:1109
33156 "Since those device names exist by definition, they will never be translated."
33160 #: ../src/guestfs.pod:1114
33162 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
33163 "filesystem labels."
33167 #: ../src/guestfs.pod:1119
33172 #: ../src/guestfs.pod:1121
33174 "This section discusses security implications of using libguestfs, "
33175 "particularly with untrusted or malicious guests or disk images."
33179 #: ../src/guestfs.pod:1124
33180 msgid "GENERAL SECURITY CONSIDERATIONS"
33184 #: ../src/guestfs.pod:1126
33186 "Be careful with any files or data that you download from a guest (by "
33187 "\"download\" we mean not just the L</guestfs_download> command but any "
33188 "command that reads files, filenames, directories or anything else from a "
33189 "disk image). An attacker could manipulate the data to fool your program "
33190 "into doing the wrong thing. Consider cases such as:"
33194 #: ../src/guestfs.pod:1136
33195 msgid "the data (file etc) not being present"
33199 #: ../src/guestfs.pod:1140
33200 msgid "being present but empty"
33204 #: ../src/guestfs.pod:1144
33205 msgid "being much larger than normal"
33209 #: ../src/guestfs.pod:1148
33210 msgid "containing arbitrary 8 bit data"
33214 #: ../src/guestfs.pod:1152
33215 msgid "being in an unexpected character encoding"
33219 #: ../src/guestfs.pod:1156
33220 msgid "containing homoglyphs."
33224 #: ../src/guestfs.pod:1160
33225 msgid "SECURITY OF MOUNTING FILESYSTEMS"
33229 #: ../src/guestfs.pod:1162
33231 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
33232 "(VFS) module can sometimes be escalated into exploits by deliberately "
33233 "creating a malicious, malformed filesystem. These exploits are very severe "
33234 "for two reasons. Firstly there are very many filesystem drivers in the "
33235 "kernel, and many of them are infrequently used and not much developer "
33236 "attention has been paid to the code. Linux userspace helps potential "
33237 "crackers by detecting the filesystem type and automatically choosing the "
33238 "right VFS driver, even if that filesystem type is obscure or unexpected for "
33239 "the administrator. Secondly, a kernel-level exploit is like a local root "
33240 "exploit (worse in some ways), giving immediate and total access to the "
33241 "system right down to the hardware level."
33245 #: ../src/guestfs.pod:1175
33247 "That explains why you should never mount a filesystem from an untrusted "
33248 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
33249 "inside a qemu virtual machine, usually running as a non-root user. The "
33250 "attacker would need to write a filesystem which first exploited the kernel, "
33251 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
33252 "the libguestfs protocol, and finally to be as serious as the host kernel "
33253 "exploit it would need to escalate its privileges to root. This multi-step "
33254 "escalation, performed by a static piece of data, is thought to be extremely "
33255 "hard to do, although we never say 'never' about security issues."
33259 #: ../src/guestfs.pod:1186
33261 "In any case callers can reduce the attack surface by forcing the filesystem "
33262 "type when mounting (use L</guestfs_mount_vfs>)."
33266 #: ../src/guestfs.pod:1189
33267 msgid "PROTOCOL SECURITY"
33271 #: ../src/guestfs.pod:1191
33273 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
33274 "defined upper message size. However a program that uses libguestfs must "
33275 "also take care - for example you can write a program that downloads a binary "
33276 "from a disk image and executes it locally, and no amount of protocol "
33277 "security will save you from the consequences."
33281 #: ../src/guestfs.pod:1197
33282 msgid "INSPECTION SECURITY"
33286 #: ../src/guestfs.pod:1199
33288 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
33289 "directly from the guest, and these could contain any 8 bit data. Callers "
33290 "should be careful to escape these before printing them to a structured file "
33291 "(for example, use HTML escaping if creating a web page)."
33295 #: ../src/guestfs.pod:1205
33297 "Guest configuration may be altered in unusual ways by the administrator of "
33298 "the virtual machine, and may not reflect reality (particularly for untrusted "
33299 "or actively malicious guests). For example we parse the hostname from "
33300 "configuration files like C</etc/sysconfig/network> that we find in the "
33301 "guest, but the guest administrator can easily manipulate these files to "
33302 "provide the wrong hostname."
33306 #: ../src/guestfs.pod:1213
33308 "The inspection API parses guest configuration using two external libraries: "
33309 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
33310 "designed to be robust in the face of malicious data, although denial of "
33311 "service attacks are still possible, for example with oversized configuration "
33316 #: ../src/guestfs.pod:1219
33317 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
33321 #: ../src/guestfs.pod:1221
33323 "Be very cautious about running commands from the guest. By running a "
33324 "command in the guest, you are giving CPU time to a binary that you do not "
33325 "control, under the same user account as the library, albeit wrapped in qemu "
33326 "virtualization. More information and alternatives can be found in the "
33327 "section L</RUNNING COMMANDS>."
33331 #: ../src/guestfs.pod:1227
33332 msgid "CVE-2010-3851"
33336 #: ../src/guestfs.pod:1229
33337 msgid "https://bugzilla.redhat.com/642934"
33341 #: ../src/guestfs.pod:1231
33343 "This security bug concerns the automatic disk format detection that qemu "
33344 "does on disk images."
33348 #: ../src/guestfs.pod:1234
33350 "A raw disk image is just the raw bytes, there is no header. Other disk "
33351 "images like qcow2 contain a special header. Qemu deals with this by looking "
33352 "for one of the known headers, and if none is found then assuming the disk "
33353 "image must be raw."
33357 #: ../src/guestfs.pod:1239
33359 "This allows a guest which has been given a raw disk image to write some "
33360 "other header. At next boot (or when the disk image is accessed by "
33361 "libguestfs) qemu would do autodetection and think the disk image format was, "
33362 "say, qcow2 based on the header written by the guest."
33366 #: ../src/guestfs.pod:1244
33368 "This in itself would not be a problem, but qcow2 offers many features, one "
33369 "of which is to allow a disk image to refer to another image (called the "
33370 "\"backing disk\"). It does this by placing the path to the backing disk "
33371 "into the qcow2 header. This path is not validated and could point to any "
33372 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
33373 "\"holes\" in the qcow2 disk image, which of course is completely under the "
33374 "control of the attacker."
33378 #: ../src/guestfs.pod:1252
33380 "In libguestfs this is rather hard to exploit except under two circumstances:"
33384 #: ../src/guestfs.pod:1259
33385 msgid "You have enabled the network or have opened the disk in write mode."
33389 #: ../src/guestfs.pod:1263
33391 "You are also running untrusted code from the guest (see L</RUNNING "
33396 #: ../src/guestfs.pod:1268
33398 "The way to avoid this is to specify the expected disk format when adding "
33399 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
33400 "should always do this if the disk is raw format, and it's a good idea for "
33405 #: ../src/guestfs.pod:1273
33407 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
33408 "format is fetched from libvirt and passed through."
33412 #: ../src/guestfs.pod:1276
33414 "For libguestfs tools, use the I<--format> command line parameter as "
33419 #: ../src/guestfs.pod:1279
33420 msgid "CONNECTION MANAGEMENT"
33424 #: ../src/guestfs.pod:1281
33425 msgid "guestfs_h *"
33429 #: ../src/guestfs.pod:1283
33431 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
33432 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
33433 "handle and release all resources used."
33437 #: ../src/guestfs.pod:1287
33439 "For information on using multiple handles and threads, see the section L</"
33440 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
33444 #: ../src/guestfs.pod:1290
33445 msgid "guestfs_create"
33449 #: ../src/guestfs.pod:1292
33452 " guestfs_h *guestfs_create (void);\n"
33457 #: ../src/guestfs.pod:1294
33458 msgid "Create a connection handle."
33462 #: ../src/guestfs.pod:1296
33464 "On success this returns a non-NULL pointer to a handle. On error it returns "
33469 #: ../src/guestfs.pod:1299
33471 "You have to \"configure\" the handle after creating it. This includes "
33472 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
33473 "handle at least once."
33477 #: ../src/guestfs.pod:1303
33478 msgid "After configuring the handle, you have to call L</guestfs_launch>."
33482 #: ../src/guestfs.pod:1305
33484 "You may also want to configure error handling for the handle. See the L</"
33485 "ERROR HANDLING> section below."
33489 #: ../src/guestfs.pod:1308
33490 msgid "guestfs_close"
33494 #: ../src/guestfs.pod:1310
33497 " void guestfs_close (guestfs_h *g);\n"
33502 #: ../src/guestfs.pod:1312
33503 msgid "This closes the connection handle and frees up all resources used."
33507 #: ../src/guestfs.pod:1314
33509 "If autosync was set on the handle and the handle was launched, then this "
33510 "implicitly calls various functions to unmount filesystems and sync the "
33511 "disk. See L</guestfs_set_autosync> for more details."
33515 #: ../src/guestfs.pod:1318
33516 msgid "If a close callback was set on the handle, then it is called."
33520 #: ../src/guestfs.pod:1320
33521 msgid "ERROR HANDLING"
33525 #: ../src/guestfs.pod:1322
33527 "API functions can return errors. For example, almost all functions that "
33528 "return C<int> will return C<-1> to indicate an error."
33532 #: ../src/guestfs.pod:1325
33534 "Additional information is available for errors: an error message string and "
33535 "optionally an error number (errno) if the thing that failed was a system "
33540 #: ../src/guestfs.pod:1329
33542 "You can get at the additional information about the last error on the handle "
33543 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
33544 "up an error handler with L</guestfs_set_error_handler>."
33548 #: ../src/guestfs.pod:1334
33550 "When the handle is created, a default error handler is installed which "
33551 "prints the error message string to C<stderr>. For small short-running "
33552 "command line programs it is sufficient to do:"
33556 #: ../src/guestfs.pod:1338
33559 " if (guestfs_launch (g) == -1)\n"
33560 " exit (EXIT_FAILURE);\n"
33565 #: ../src/guestfs.pod:1341
33567 "since the default error handler will ensure that an error message has been "
33568 "printed to C<stderr> before the program exits."
33572 #: ../src/guestfs.pod:1344
33574 "For other programs the caller will almost certainly want to install an "
33575 "alternate error handler or do error handling in-line like this:"
33579 #: ../src/guestfs.pod:1347
33582 " /* This disables the default behaviour of printing errors\n"
33584 " guestfs_set_error_handler (g, NULL, NULL);\n"
33589 #: ../src/guestfs.pod:1351
33592 " if (guestfs_launch (g) == -1) {\n"
33593 " /* Examine the error message and print it etc. */\n"
33594 " char *msg = guestfs_last_error (g);\n"
33595 " int errnum = guestfs_last_errno (g);\n"
33596 " fprintf (stderr, \"%s\", msg);\n"
33597 " if (errnum != 0)\n"
33598 " fprintf (stderr, \": %s\", strerror (errnum));\n"
33599 " fprintf (stderr, \"\\n\");\n"
33606 #: ../src/guestfs.pod:1362
33608 "Out of memory errors are handled differently. The default action is to call "
33609 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
33610 "guestfs_set_out_of_memory_handler>."
33614 #: ../src/guestfs.pod:1366
33616 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
33617 "because there is no handle if this happens there is no way to get additional "
33618 "error information. However L</guestfs_create> is supposed to be a "
33619 "lightweight operation which can only fail because of insufficient memory (it "
33620 "returns NULL in this case)."
33624 #: ../src/guestfs.pod:1372
33625 msgid "guestfs_last_error"
33629 #: ../src/guestfs.pod:1374
33632 " const char *guestfs_last_error (guestfs_h *g);\n"
33637 #: ../src/guestfs.pod:1376
33639 "This returns the last error message that happened on C<g>. If there has not "
33640 "been an error since the handle was created, then this returns C<NULL>."
33644 #: ../src/guestfs.pod:1380
33646 "The lifetime of the returned string is until the next error occurs, or L</"
33647 "guestfs_close> is called."
33651 #: ../src/guestfs.pod:1383
33652 msgid "guestfs_last_errno"
33656 #: ../src/guestfs.pod:1385
33659 " int guestfs_last_errno (guestfs_h *g);\n"
33664 #: ../src/guestfs.pod:1387
33665 msgid "This returns the last error number (errno) that happened on C<g>."
33669 #: ../src/guestfs.pod:1389
33670 msgid "If successful, an errno integer not equal to zero is returned."
33674 #: ../src/guestfs.pod:1391
33676 "If no error, this returns 0. This call can return 0 in three situations:"
33680 #: ../src/guestfs.pod:1398
33681 msgid "There has not been any error on the handle."
33685 #: ../src/guestfs.pod:1402
33687 "There has been an error but the errno was meaningless. This corresponds to "
33688 "the case where the error did not come from a failed system call, but for "
33689 "some other reason."
33693 #: ../src/guestfs.pod:1408
33695 "There was an error from a failed system call, but for some reason the errno "
33696 "was not captured and returned. This usually indicates a bug in libguestfs."
33700 #: ../src/guestfs.pod:1414
33702 "Libguestfs tries to convert the errno from inside the applicance into a "
33703 "corresponding errno for the caller (not entirely trivial: the appliance "
33704 "might be running a completely different operating system from the library "
33705 "and error numbers are not standardized across Un*xen). If this could not be "
33706 "done, then the error is translated to C<EINVAL>. In practice this should "
33707 "only happen in very rare circumstances."
33711 #: ../src/guestfs.pod:1422
33712 msgid "guestfs_set_error_handler"
33716 #: ../src/guestfs.pod:1424
33719 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
33721 " const char *msg);\n"
33722 " void guestfs_set_error_handler (guestfs_h *g,\n"
33723 " guestfs_error_handler_cb cb,\n"
33724 " void *opaque);\n"
33729 #: ../src/guestfs.pod:1431
33731 "The callback C<cb> will be called if there is an error. The parameters "
33732 "passed to the callback are an opaque data pointer and the error message "
33737 #: ../src/guestfs.pod:1435
33739 "C<errno> is not passed to the callback. To get that the callback must call "
33740 "L</guestfs_last_errno>."
33744 #: ../src/guestfs.pod:1438
33746 "Note that the message string C<msg> is freed as soon as the callback "
33747 "function returns, so if you want to stash it somewhere you must make your "
33752 #: ../src/guestfs.pod:1442
33753 msgid "The default handler prints messages on C<stderr>."
33757 #: ../src/guestfs.pod:1444
33758 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
33762 #: ../src/guestfs.pod:1446
33763 msgid "guestfs_get_error_handler"
33767 #: ../src/guestfs.pod:1448
33770 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
33771 " void **opaque_rtn);\n"
33776 #: ../src/guestfs.pod:1451
33777 msgid "Returns the current error handler callback."
33781 #: ../src/guestfs.pod:1453
33782 msgid "guestfs_set_out_of_memory_handler"
33786 #: ../src/guestfs.pod:1455
33789 " typedef void (*guestfs_abort_cb) (void);\n"
33790 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
33791 " guestfs_abort_cb);\n"
33796 #: ../src/guestfs.pod:1459
33798 "The callback C<cb> will be called if there is an out of memory situation. "
33799 "I<Note this callback must not return>."
33803 #: ../src/guestfs.pod:1462
33804 msgid "The default is to call L<abort(3)>."
33808 #: ../src/guestfs.pod:1464
33810 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
33814 #: ../src/guestfs.pod:1467
33815 msgid "guestfs_get_out_of_memory_handler"
33819 #: ../src/guestfs.pod:1469
33822 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
33827 #: ../src/guestfs.pod:1471
33828 msgid "This returns the current out of memory handler."
33832 #: ../src/guestfs.pod:1473
33837 #: ../src/guestfs.pod:1477
33842 #: ../src/guestfs.pod:1479
33847 #: ../src/guestfs.pod:1481
33848 msgid "AVAILABILITY"
33852 #: ../src/guestfs.pod:1483
33853 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
33857 #: ../src/guestfs.pod:1485
33859 "Using L</guestfs_available> you can test availability of the following "
33860 "groups of functions. This test queries the appliance to see if the "
33861 "appliance you are currently using supports the functionality."
33865 #: ../src/guestfs.pod:1490
33866 msgid "@AVAILABILITY@"
33870 #: ../src/guestfs.pod:1492
33871 msgid "GUESTFISH supported COMMAND"
33875 #: ../src/guestfs.pod:1494
33877 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
33878 "prints out the available groups and whether they are supported by this build "
33879 "of libguestfs. Note however that you have to do C<run> first."
33883 #: ../src/guestfs.pod:1499
33884 msgid "SINGLE CALLS AT COMPILE TIME"
33888 #: ../src/guestfs.pod:1501
33890 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
33891 "function, such as:"
33895 #: ../src/guestfs.pod:1504
33898 " #define LIBGUESTFS_HAVE_DD 1\n"
33903 #: ../src/guestfs.pod:1506
33904 msgid "if L</guestfs_dd> is available."
33908 #: ../src/guestfs.pod:1508
33910 "Before version 1.5.8, if you needed to test whether a single libguestfs "
33911 "function is available at compile time, we recommended using build tools such "
33912 "as autoconf or cmake. For example in autotools you could use:"
33916 #: ../src/guestfs.pod:1513
33919 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
33920 " AC_CHECK_FUNCS([guestfs_dd])\n"
33925 #: ../src/guestfs.pod:1516
33927 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
33932 #: ../src/guestfs.pod:1519
33933 msgid "SINGLE CALLS AT RUN TIME"
33937 #: ../src/guestfs.pod:1521
33939 "Testing at compile time doesn't guarantee that a function really exists in "
33940 "the library. The reason is that you might be dynamically linked against a "
33941 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
33942 "This situation unfortunately results in a segmentation fault, which is a "
33943 "shortcoming of the C dynamic linking system itself."
33947 #: ../src/guestfs.pod:1528
33949 "You can use L<dlopen(3)> to test if a function is available at run time, as "
33950 "in this example program (note that you still need the compile time check as "
33955 #: ../src/guestfs.pod:1532
33958 " #include <stdio.h>\n"
33959 " #include <stdlib.h>\n"
33960 " #include <unistd.h>\n"
33961 " #include <dlfcn.h>\n"
33962 " #include <guestfs.h>\n"
33967 #: ../src/guestfs.pod:1538
33972 " #ifdef LIBGUESTFS_HAVE_DD\n"
33974 " int has_function;\n"
33979 #: ../src/guestfs.pod:1544
33982 " /* Test if the function guestfs_dd is really available. */\n"
33983 " dl = dlopen (NULL, RTLD_LAZY);\n"
33985 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
33986 " exit (EXIT_FAILURE);\n"
33988 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
33994 #: ../src/guestfs.pod:1553
33997 " if (!has_function)\n"
33998 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
34000 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
34001 " /* Now it's safe to call\n"
34002 " guestfs_dd (g, \"foo\", \"bar\");\n"
34006 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
34013 #: ../src/guestfs.pod:1566
34015 "You may think the above is an awful lot of hassle, and it is. There are "
34016 "other ways outside of the C linking system to ensure that this kind of "
34017 "incompatibility never arises, such as using package versioning:"
34021 #: ../src/guestfs.pod:1571
34024 " Requires: libguestfs >= 1.0.80\n"
34029 #: ../src/guestfs.pod:1573
34030 msgid "CALLS WITH OPTIONAL ARGUMENTS"
34034 #: ../src/guestfs.pod:1575
34036 "A recent feature of the API is the introduction of calls which take optional "
34037 "arguments. In C these are declared 3 ways. The main way is as a call which "
34038 "takes variable arguments (ie. C<...>), as in this example:"
34042 #: ../src/guestfs.pod:1580
34045 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
34050 #: ../src/guestfs.pod:1582
34052 "Call this with a list of optional arguments, terminated by C<-1>. So to "
34053 "call with no optional arguments specified:"
34057 #: ../src/guestfs.pod:1585
34060 " guestfs_add_drive_opts (g, filename, -1);\n"
34065 #: ../src/guestfs.pod:1587
34066 msgid "With a single optional argument:"
34070 #: ../src/guestfs.pod:1589
34073 " guestfs_add_drive_opts (g, filename,\n"
34074 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
34080 #: ../src/guestfs.pod:1593
34085 #: ../src/guestfs.pod:1595
34088 " guestfs_add_drive_opts (g, filename,\n"
34089 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
34090 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
34096 #: ../src/guestfs.pod:1600
34098 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
34103 #: ../src/guestfs.pod:1603
34104 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
34108 #: ../src/guestfs.pod:1605
34110 "The second variant has the same name with the suffix C<_va>, which works the "
34111 "same way but takes a C<va_list>. See the C manual for details. For the "
34112 "example function, this is declared:"
34116 #: ../src/guestfs.pod:1609
34119 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
34120 " va_list args);\n"
34125 #: ../src/guestfs.pod:1612
34126 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
34130 #: ../src/guestfs.pod:1614
34132 "The third variant is useful where you need to construct these calls. You "
34133 "pass in a structure where you fill in the optional fields. The structure "
34134 "has a bitmask as the first element which you must set to indicate which "
34135 "fields you have filled in. For our example function the structure and call "
34140 #: ../src/guestfs.pod:1620
34143 " struct guestfs_add_drive_opts_argv {\n"
34144 " uint64_t bitmask;\n"
34146 " const char *format;\n"
34149 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
34150 " const struct guestfs_add_drive_opts_argv *optargs);\n"
34155 #: ../src/guestfs.pod:1629
34156 msgid "You could call it like this:"
34160 #: ../src/guestfs.pod:1631
34163 " struct guestfs_add_drive_opts_argv optargs = {\n"
34164 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
34165 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
34166 " .readonly = 1,\n"
34167 " .format = \"qcow2\"\n"
34173 #: ../src/guestfs.pod:1638
34176 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
34181 #: ../src/guestfs.pod:1646
34182 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
34186 #: ../src/guestfs.pod:1651
34187 msgid "You do not need to fill in all fields of the structure."
34191 #: ../src/guestfs.pod:1655
34193 "There must be a one-to-one correspondence between fields of the structure "
34194 "that are filled in, and bits set in the bitmask."
34198 #: ../src/guestfs.pod:1660
34199 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
34203 #: ../src/guestfs.pod:1662
34205 "In other languages, optional arguments are expressed in the way that is "
34206 "natural for that language. We refer you to the language-specific "
34207 "documentation for more details on that."
34211 #: ../src/guestfs.pod:1666
34212 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
34216 #: ../src/guestfs.pod:1668
34217 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
34221 #: ../src/guestfs.pod:1670
34223 "B<Note:> This section documents the generic event mechanism introduced in "
34224 "libguestfs 1.10, which you should use in new code if possible. The old "
34225 "functions C<guestfs_set_log_message_callback>, "
34226 "C<guestfs_set_subprocess_quit_callback>, "
34227 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
34228 "C<guestfs_set_progress_callback> are no longer documented in this manual "
34229 "page. Because of the ABI guarantee, the old functions continue to work."
34233 #: ../src/guestfs.pod:1679
34235 "Handles generate events when certain things happen, such as log messages "
34236 "being generated, progress messages during long-running operations, or the "
34237 "handle being closed. The API calls described below let you register a "
34238 "callback to be called when events happen. You can register multiple "
34239 "callbacks (for the same, different or overlapping sets of events), and "
34240 "individually remove callbacks. If callbacks are not removed, then they "
34241 "remain in force until the handle is closed."
34245 #: ../src/guestfs.pod:1687
34247 "In the current implementation, events are only generated synchronously: that "
34248 "means that events (and hence callbacks) can only happen while you are in the "
34249 "middle of making another libguestfs call. The callback is called in the "
34254 #: ../src/guestfs.pod:1692
34256 "Events may contain a payload, usually nothing (void), an array of 64 bit "
34257 "unsigned integers, or a message buffer. Payloads are discussed later on."
34261 #: ../src/guestfs.pod:1696
34262 msgid "CLASSES OF EVENTS"
34266 #: ../src/guestfs.pod:1700
34267 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
34271 #: ../src/guestfs.pod:1703
34273 "The callback function will be called while the handle is being closed "
34274 "(synchronously from L</guestfs_close>)."
34278 #: ../src/guestfs.pod:1706
34280 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
34281 "handles that are open when the program exits. This means that this callback "
34282 "might be called indirectly from L<exit(3)>, which can cause unexpected "
34283 "problems in higher-level languages (eg. if your HLL interpreter has already "
34284 "been cleaned up by the time this is called, and if your callback then jumps "
34285 "into some HLL function)."
34289 #: ../src/guestfs.pod:1713
34291 "If no callback is registered: the handle is closed without any callback "
34296 #: ../src/guestfs.pod:1716
34297 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
34301 #: ../src/guestfs.pod:1719
34303 "The callback function will be called when the child process quits, either "
34304 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
34305 "corresponds to a transition from any state to the CONFIG state)."
34309 #: ../src/guestfs.pod:1723 ../src/guestfs.pod:1732 ../src/guestfs.pod:1849
34310 msgid "If no callback is registered: the event is ignored."
34314 #: ../src/guestfs.pod:1725
34315 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
34319 #: ../src/guestfs.pod:1728
34321 "The callback function will be called when the child process becomes ready "
34322 "first time after it has been launched. (This corresponds to a transition "
34323 "from LAUNCHING to the READY state)."
34327 #: ../src/guestfs.pod:1734
34328 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
34332 #: ../src/guestfs.pod:1737
34334 "Some long-running operations can generate progress messages. If this "
34335 "callback is registered, then it will be called each time a progress message "
34336 "is generated (usually two seconds after the operation started, and three "
34337 "times per second thereafter until it completes, although the frequency may "
34338 "change in future versions)."
34342 #: ../src/guestfs.pod:1743
34344 "The callback receives in the payload four unsigned 64 bit numbers which are "
34345 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
34349 #: ../src/guestfs.pod:1746
34351 "The units of C<total> are not defined, although for some operations C<total> "
34352 "may relate in some way to the amount of data to be transferred (eg. in bytes "
34353 "or megabytes), and C<position> may be the portion which has been transferred."
34357 #: ../src/guestfs.pod:1751
34358 msgid "The only defined and stable parts of the API are:"
34362 #: ../src/guestfs.pod:1757
34364 "The callback can display to the user some type of progress bar or indicator "
34365 "which shows the ratio of C<position>:C<total>."
34369 #: ../src/guestfs.pod:1762
34370 msgid "0 E<lt>= C<position> E<lt>= C<total>"
34374 #: ../src/guestfs.pod:1766
34376 "If any progress notification is sent during a call, then a final progress "
34377 "notification is always sent when C<position> = C<total> (I<unless> the call "
34378 "fails with an error)."
34382 #: ../src/guestfs.pod:1770
34384 "This is to simplify caller code, so callers can easily set the progress "
34385 "indicator to \"100%\" at the end of the operation, without requiring special "
34386 "code to detect this case."
34390 #: ../src/guestfs.pod:1776
34392 "For some calls we are unable to estimate the progress of the call, but we "
34393 "can still generate progress messages to indicate activity. This is known as "
34394 "\"pulse mode\", and is directly supported by certain progress bar "
34395 "implementations (eg. GtkProgressBar)."
34399 #: ../src/guestfs.pod:1781
34401 "For these calls, zero or more progress messages are generated with "
34402 "C<position = 0> and C<total = 1>, followed by a final message with "
34403 "C<position = total = 1>."
34407 #: ../src/guestfs.pod:1785
34409 "As noted above, if the call fails with an error then the final message may "
34410 "not be generated."
34414 #: ../src/guestfs.pod:1790
34416 "The callback also receives the procedure number (C<proc_nr>) and serial "
34417 "number (C<serial>) of the call. These are only useful for debugging "
34418 "protocol issues, and the callback can normally ignore them. The callback "
34419 "may want to print these numbers in error messages or debugging messages."
34423 #: ../src/guestfs.pod:1796
34424 msgid "If no callback is registered: progress messages are discarded."
34428 #: ../src/guestfs.pod:1798
34429 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
34433 #: ../src/guestfs.pod:1801
34435 "The callback function is called whenever a log message is generated by qemu, "
34436 "the appliance kernel, guestfsd (daemon), or utility programs."
34440 #: ../src/guestfs.pod:1804
34442 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
34443 "guestfs_launch>) then additional debug messages are generated."
34447 #: ../src/guestfs.pod:1807 ../src/guestfs.pod:1821
34449 "If no callback is registered: the messages are discarded unless the verbose "
34450 "flag is set in which case they are sent to stderr. You can override the "
34451 "printing of verbose messages to stderr by setting up a callback."
34455 #: ../src/guestfs.pod:1812
34456 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
34460 #: ../src/guestfs.pod:1815
34462 "The callback function is called whenever a log message is generated by the "
34463 "library part of libguestfs."
34467 #: ../src/guestfs.pod:1818
34469 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
34470 "messages are generated."
34474 #: ../src/guestfs.pod:1826
34475 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
34479 #: ../src/guestfs.pod:1829
34481 "The callback function is called whenever a trace message is generated. This "
34482 "only applies if the trace flag (L</guestfs_set_trace>) is set."
34486 #: ../src/guestfs.pod:1832
34488 "If no callback is registered: the messages are sent to stderr. You can "
34489 "override the printing of trace messages to stderr by setting up a callback."
34493 #: ../src/guestfs.pod:1836
34494 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
34498 #: ../src/guestfs.pod:1839
34500 "The callback function is called whenever a libguestfs function is entered."
34504 #: ../src/guestfs.pod:1842
34506 "The payload is a string which contains the name of the function that we are "
34507 "entering (not including C<guestfs_> prefix)."
34511 #: ../src/guestfs.pod:1845
34513 "Note that libguestfs functions can call themselves, so you may see many "
34514 "events from a single call. A few libguestfs functions do not generate this "
34519 #: ../src/guestfs.pod:1853
34520 msgid "guestfs_set_event_callback"
34524 #: ../src/guestfs.pod:1855
34527 " int guestfs_set_event_callback (guestfs_h *g,\n"
34528 " guestfs_event_callback cb,\n"
34529 " uint64_t event_bitmask,\n"
34531 " void *opaque);\n"
34536 #: ../src/guestfs.pod:1861
34538 "This function registers a callback (C<cb>) for all event classes in the "
34539 "C<event_bitmask>."
34543 #: ../src/guestfs.pod:1864
34545 "For example, to register for all log message events, you could call this "
34546 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
34547 "To register a single callback for all possible classes of events, use "
34548 "C<GUESTFS_EVENT_ALL>."
34552 #: ../src/guestfs.pod:1870
34553 msgid "C<flags> should always be passed as 0."
34557 #: ../src/guestfs.pod:1872
34559 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
34560 "it for any purpose."
34564 #: ../src/guestfs.pod:1875
34566 "The return value is the event handle (an integer) which you can use to "
34567 "delete the callback (see below)."
34571 #: ../src/guestfs.pod:1878
34573 "If there is an error, this function returns C<-1>, and sets the error in the "
34574 "handle in the usual way (see L</guestfs_last_error> etc.)"
34578 #: ../src/guestfs.pod:1881
34580 "Callbacks remain in effect until they are deleted, or until the handle is "
34585 #: ../src/guestfs.pod:1884
34587 "In the case where multiple callbacks are registered for a particular event "
34588 "class, all of the callbacks are called. The order in which multiple "
34589 "callbacks are called is not defined."
34593 #: ../src/guestfs.pod:1888
34594 msgid "guestfs_delete_event_callback"
34598 #: ../src/guestfs.pod:1890
34601 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
34606 #: ../src/guestfs.pod:1892
34608 "Delete a callback that was previously registered. C<event_handle> should be "
34609 "the integer that was returned by a previous call to "
34610 "C<guestfs_set_event_callback> on the same handle."
34614 #: ../src/guestfs.pod:1896
34615 msgid "guestfs_event_callback"
34619 #: ../src/guestfs.pod:1898
34622 " typedef void (*guestfs_event_callback) (\n"
34625 " uint64_t event,\n"
34626 " int event_handle,\n"
34628 " const char *buf, size_t buf_len,\n"
34629 " const uint64_t *array, size_t array_len);\n"
34634 #: ../src/guestfs.pod:1907
34636 "This is the type of the event callback function that you have to provide."
34640 #: ../src/guestfs.pod:1910
34642 "The basic parameters are: the handle (C<g>), the opaque user pointer "
34643 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
34644 "handle, and C<flags> which in the current API you should ignore."
34648 #: ../src/guestfs.pod:1914
34650 "The remaining parameters contain the event payload (if any). Each event may "
34651 "contain a payload, which usually relates to the event class, but for future "
34652 "proofing your code should be written to handle any payload for any event "
34657 #: ../src/guestfs.pod:1919
34659 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
34660 "there is no message buffer). Note that this message buffer can contain "
34661 "arbitrary 8 bit data, including NUL bytes."
34665 #: ../src/guestfs.pod:1923
34667 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
34668 "moment this is only used for progress messages."
34672 #: ../src/guestfs.pod:1926
34673 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
34677 #: ../src/guestfs.pod:1928
34679 "One motivation for the generic event API was to allow GUI programs to "
34680 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
34681 "unconditionally to C<stderr>."
34685 #: ../src/guestfs.pod:1932
34687 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
34688 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
34689 "messages are not events; you must capture error messages separately)."
34693 #: ../src/guestfs.pod:1937
34695 "Programs have to set up a callback to capture the classes of events of "
34700 #: ../src/guestfs.pod:1940
34704 " guestfs_set_event_callback\n"
34705 " (g, message_callback,\n"
34706 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
34707 " GUESTFS_EVENT_TRACE,\n"
34708 " 0, NULL) == -1)\n"
34709 " if (eh == -1) {\n"
34710 " // handle error in the usual way\n"
34716 #: ../src/guestfs.pod:1950
34718 "The callback can then direct messages to the appropriate place. In this "
34719 "example, messages are directed to syslog:"
34723 #: ../src/guestfs.pod:1953
34727 " message_callback (\n"
34730 " uint64_t event,\n"
34731 " int event_handle,\n"
34733 " const char *buf, size_t buf_len,\n"
34734 " const uint64_t *array, size_t array_len)\n"
34736 " const int priority = LOG_USER|LOG_INFO;\n"
34737 " if (buf_len > 0)\n"
34738 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
34744 #: ../src/guestfs.pod:1968
34745 msgid "CANCELLING LONG TRANSFERS"
34749 #: ../src/guestfs.pod:1970
34751 "Some operations can be cancelled by the caller while they are in progress. "
34752 "Currently only operations that involve uploading or downloading data can be "
34753 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
34754 "parameters in the generator)."
34758 #: ../src/guestfs.pod:1975
34759 msgid "guestfs_user_cancel"
34763 #: ../src/guestfs.pod:1977
34766 " void guestfs_user_cancel (guestfs_h *g);\n"
34771 #: ../src/guestfs.pod:1979
34773 "C<guestfs_user_cancel> cancels the current upload or download operation."
34777 #: ../src/guestfs.pod:1982
34779 "Unlike most other libguestfs calls, this function is signal safe and thread "
34780 "safe. You can call it from a signal handler or from another thread, without "
34781 "needing to do any locking."
34785 #: ../src/guestfs.pod:1986
34787 "The transfer that was in progress (if there is one) will stop shortly "
34788 "afterwards, and will return an error. The errno (see L</"
34789 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
34790 "out if the operation was cancelled or failed because of another error."
34794 #: ../src/guestfs.pod:1992
34796 "No cleanup is performed: for example, if a file was being uploaded then "
34797 "after cancellation there may be a partially uploaded file. It is the "
34798 "caller's responsibility to clean up if necessary."
34802 #: ../src/guestfs.pod:1996
34803 msgid "There are two common places that you might call C<guestfs_user_cancel>."
34807 #: ../src/guestfs.pod:1998
34809 "In an interactive text-based program, you might call it from a C<SIGINT> "
34810 "signal handler so that pressing C<^C> cancels the current operation. (You "
34811 "also need to call L</guestfs_set_pgroup> so that child processes don't "
34812 "receive the C<^C> signal)."
34816 #: ../src/guestfs.pod:2003
34818 "In a graphical program, when the main thread is displaying a progress bar "
34819 "with a cancel button, wire up the cancel button to call this function."
34823 #: ../src/guestfs.pod:2007
34824 msgid "PRIVATE DATA AREA"
34828 #: ../src/guestfs.pod:2009
34830 "You can attach named pieces of private data to the libguestfs handle, fetch "
34831 "them by name, and walk over them, for the lifetime of the handle. This is "
34832 "called the private data area and is only available from the C API."
34836 #: ../src/guestfs.pod:2014
34837 msgid "To attach a named piece of data, use the following call:"
34841 #: ../src/guestfs.pod:2016
34844 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
34849 #: ../src/guestfs.pod:2018
34851 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
34852 "pointer (which can be C<NULL>). Any previous item with the same key is "
34857 #: ../src/guestfs.pod:2022
34859 "You can use any C<key> you want, but your key should I<not> start with an "
34860 "underscore character. Keys beginning with an underscore character are "
34861 "reserved for internal libguestfs purposes (eg. for implementing language "
34862 "bindings). It is recommended that you prefix the key with some unique "
34863 "string to avoid collisions with other users."
34867 #: ../src/guestfs.pod:2028
34868 msgid "To retrieve the pointer, use:"
34872 #: ../src/guestfs.pod:2030
34875 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
34880 #: ../src/guestfs.pod:2032
34882 "This function returns C<NULL> if either no data is found associated with "
34883 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
34888 #: ../src/guestfs.pod:2036
34890 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
34891 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
34892 "all. In particular, libguestfs does I<not> try to free the data when the "
34893 "handle is closed. If the data must be freed, then the caller must either "
34894 "free it before calling L</guestfs_close> or must set up a close callback to "
34895 "do it (see L</GUESTFS_EVENT_CLOSE>)."
34899 #: ../src/guestfs.pod:2043
34900 msgid "To walk over all entries, use these two functions:"
34904 #: ../src/guestfs.pod:2045
34907 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
34912 #: ../src/guestfs.pod:2047
34915 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
34920 #: ../src/guestfs.pod:2049
34922 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
34923 "not have any particular meaning -- keys are not returned in any defined "
34924 "order). A pointer to the key is returned in C<*key_rtn> and the "
34925 "corresponding data pointer is returned from the function. C<NULL> is "
34926 "returned if there are no keys stored in the handle."
34930 #: ../src/guestfs.pod:2055
34932 "C<guestfs_next_private> returns the next key, pointer pair. The return "
34933 "value of this function is also C<NULL> is there are no further entries to "
34938 #: ../src/guestfs.pod:2059
34939 msgid "Notes about walking over entries:"
34943 #: ../src/guestfs.pod:2065
34945 "You must not call C<guestfs_set_private> while walking over the entries."
34949 #: ../src/guestfs.pod:2070
34951 "The handle maintains an internal iterator which is reset when you call "
34952 "C<guestfs_first_private>. This internal iterator is invalidated when you "
34953 "call C<guestfs_set_private>."
34957 #: ../src/guestfs.pod:2076
34958 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
34962 #: ../src/guestfs.pod:2078
34965 " guestfs_set_private (g, key, NULL);\n"
34970 #: ../src/guestfs.pod:2080
34971 msgid "then that C<key> is not returned when walking."
34975 #: ../src/guestfs.pod:2084
34977 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
34978 "C<guestfs_next_private> or C<guestfs_set_private>."
34982 #: ../src/guestfs.pod:2090
34984 "The following example code shows how to print all keys and data pointers "
34985 "that are associated with the handle C<g>:"
34989 #: ../src/guestfs.pod:2093
34992 " const char *key;\n"
34993 " void *data = guestfs_first_private (g, &key);\n"
34994 " while (data != NULL)\n"
34996 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34997 " data = guestfs_next_private (g, &key);\n"
35003 #: ../src/guestfs.pod:2101
35005 "More commonly you are only interested in keys that begin with an application-"
35006 "specific prefix C<foo_>. Modify the loop like so:"
35010 #: ../src/guestfs.pod:2104
35013 " const char *key;\n"
35014 " void *data = guestfs_first_private (g, &key);\n"
35015 " while (data != NULL)\n"
35017 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
35018 " printf (\"key = %s, data = %p\\n\", key, data);\n"
35019 " data = guestfs_next_private (g, &key);\n"
35025 #: ../src/guestfs.pod:2113
35027 "If you need to modify keys while walking, then you have to jump back to the "
35028 "beginning of the loop. For example, to delete all keys prefixed with "
35033 #: ../src/guestfs.pod:2117
35036 " const char *key;\n"
35039 " data = guestfs_first_private (g, &key);\n"
35040 " while (data != NULL)\n"
35042 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
35044 " guestfs_set_private (g, key, NULL);\n"
35045 " /* note that 'key' pointer is now invalid, and so is\n"
35046 " the internal iterator */\n"
35049 " data = guestfs_next_private (g, &key);\n"
35055 #: ../src/guestfs.pod:2133
35057 "Note that the above loop is guaranteed to terminate because the keys are "
35058 "being deleted, but other manipulations of keys within the loop might not "
35059 "terminate unless you also maintain an indication of which keys have been "
35064 #: ../src/guestfs.pod:2138 ../src/guestfs.pod:2143
35069 #: ../src/guestfs.pod:2140
35071 "<!-- old anchor for the next section --> <a name="
35072 "\"state_machine_and_low_level_event_api\"/>"
35076 #: ../src/guestfs.pod:2145
35077 msgid "ARCHITECTURE"
35081 #: ../src/guestfs.pod:2147
35083 "Internally, libguestfs is implemented by running an appliance (a special "
35084 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
35085 "process of the main program."
35089 #: ../src/guestfs.pod:2151
35092 " ___________________\n"
35094 " | main program |\n"
35096 " | | child process / appliance\n"
35097 " | | __________________________\n"
35099 " +-------------------+ RPC | +-----------------+ |\n"
35100 " | libguestfs <--------------------> guestfsd | |\n"
35101 " | | | +-----------------+ |\n"
35102 " \\___________________/ | | Linux kernel | |\n"
35103 " | +--^--------------+ |\n"
35104 " \\_________|________________/\n"
35106 " _______v______\n"
35109 " | disk image |\n"
35110 " \\______________/\n"
35115 #: ../src/guestfs.pod:2171
35117 "The library, linked to the main program, creates the child process and hence "
35118 "the appliance in the L</guestfs_launch> function."
35122 #: ../src/guestfs.pod:2174
35124 "Inside the appliance is a Linux kernel and a complete stack of userspace "
35125 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
35126 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
35127 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
35128 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
35129 "attached to the qemu process which translates device access by the "
35130 "appliance's Linux kernel into accesses to the image."
35134 #: ../src/guestfs.pod:2183
35136 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
35137 "Although the disk image you are attached to might also be used by some "
35138 "virtual machine, libguestfs doesn't know or care about this. (But you will "
35139 "care if both libguestfs's qemu process and your virtual machine are trying "
35140 "to update the disk image at the same time, since these usually results in "
35141 "massive disk corruption)."
35145 #: ../src/guestfs.pod:2190
35146 msgid "STATE MACHINE"
35150 #: ../src/guestfs.pod:2192
35151 msgid "libguestfs uses a state machine to model the child process:"
35155 #: ../src/guestfs.pod:2194
35159 " guestfs_create\n"
35167 " / | \\ \\ guestfs_launch\n"
35168 " / | _\\__V______\n"
35170 " / | | LAUNCHING |\n"
35171 " / | \\___________/\n"
35173 " / | guestfs_launch\n"
35175 " ______ / __|____V\n"
35176 " / \\ ------> / \\\n"
35177 " | BUSY | | READY |\n"
35178 " \\______/ <------ \\________/\n"
35183 #: ../src/guestfs.pod:2216
35185 "The normal transitions are (1) CONFIG (when the handle is created, but there "
35186 "is no child process), (2) LAUNCHING (when the child process is booting up), "
35187 "(3) alternating between READY and BUSY as commands are issued to, and "
35188 "carried out by, the child process."
35192 #: ../src/guestfs.pod:2221
35194 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
35195 "asynchronously at any time (eg. due to some internal error), and that causes "
35196 "the state to transition back to CONFIG."
35200 #: ../src/guestfs.pod:2225
35202 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
35203 "issued when in the CONFIG state."
35207 #: ../src/guestfs.pod:2228
35209 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
35210 "L</guestfs_launch> blocks until the child process is READY to accept "
35211 "commands (or until some failure or timeout). L</guestfs_launch> internally "
35212 "moves the state from CONFIG to LAUNCHING while it is running."
35216 #: ../src/guestfs.pod:2234
35218 "API actions such as L</guestfs_mount> can only be issued when in the READY "
35219 "state. These API calls block waiting for the command to be carried out (ie. "
35220 "the state to transition to BUSY and then back to READY). There are no non-"
35221 "blocking versions, and no way to issue more than one command per handle at "
35226 #: ../src/guestfs.pod:2240
35228 "Finally, the child process sends asynchronous messages back to the main "
35229 "program, such as kernel log messages. You can register a callback to "
35230 "receive these messages."
35234 #: ../src/guestfs.pod:2244
35239 #: ../src/guestfs.pod:2246
35240 msgid "APPLIANCE BOOT PROCESS"
35244 #: ../src/guestfs.pod:2248
35246 "This process has evolved and continues to evolve. The description here "
35247 "corresponds only to the current version of libguestfs and is provided for "
35248 "information only."
35252 #: ../src/guestfs.pod:2252
35254 "In order to follow the stages involved below, enable libguestfs debugging "
35255 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
35259 #: ../src/guestfs.pod:2257
35260 msgid "Create the appliance"
35264 #: ../src/guestfs.pod:2259
35266 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
35267 "initrd and the appliance."
35271 #: ../src/guestfs.pod:2262
35273 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
35274 "directory if C<TMPDIR> is set)."
35278 #: ../src/guestfs.pod:2265
35280 "For a complete description of how the appliance is created and cached, read "
35281 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
35285 #: ../src/guestfs.pod:2269
35286 msgid "Start qemu and boot the kernel"
35290 #: ../src/guestfs.pod:2271
35291 msgid "qemu is invoked to boot the kernel."
35295 #: ../src/guestfs.pod:2273
35296 msgid "Run the initrd"
35300 #: ../src/guestfs.pod:2275
35302 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
35303 "appliance. The purpose of the initrd is to load enough kernel modules in "
35304 "order that the appliance itself can be mounted and started."
35308 #: ../src/guestfs.pod:2279
35310 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
35315 #: ../src/guestfs.pod:2282
35317 "When the initrd has started you will see messages showing that kernel "
35318 "modules are being loaded, similar to this:"
35322 #: ../src/guestfs.pod:2285
35325 " febootstrap: ext2 mini initrd starting up\n"
35326 " febootstrap: mounting /sys\n"
35327 " febootstrap: internal insmod libcrc32c.ko\n"
35328 " febootstrap: internal insmod crc32c-intel.ko\n"
35333 #: ../src/guestfs.pod:2290
35334 msgid "Find and mount the appliance device"
35338 #: ../src/guestfs.pod:2292
35340 "The appliance is a sparse file containing an ext2 filesystem which contains "
35341 "a familiar (although reduced in size) Linux operating system. It would "
35342 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
35346 #: ../src/guestfs.pod:2296
35348 "The regular disks being inspected by libguestfs are the first devices "
35349 "exposed by qemu (eg. as C</dev/vda>)."
35353 #: ../src/guestfs.pod:2299
35355 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
35356 "there was only one regular disk)."
35360 #: ../src/guestfs.pod:2302
35362 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
35363 "and switch root into the appliance, and run C</init> from the appliance."
35367 #: ../src/guestfs.pod:2306
35368 msgid "If this works successfully you will see messages such as:"
35372 #: ../src/guestfs.pod:2308
35375 " febootstrap: picked /sys/block/vdb/dev as root device\n"
35376 " febootstrap: creating /dev/root as block special 252:16\n"
35377 " febootstrap: mounting new root on /root\n"
35378 " febootstrap: chroot\n"
35379 " Starting /init script ...\n"
35384 #: ../src/guestfs.pod:2314
35386 "Note that C<Starting /init script ...> indicates that the appliance's init "
35387 "script is now running."
35391 #: ../src/guestfs.pod:2317
35392 msgid "Initialize the appliance"
35396 #: ../src/guestfs.pod:2319
35398 "The appliance itself now initializes itself. This involves starting certain "
35399 "processes like C<udev>, possibly printing some debug information, and "
35400 "finally running the daemon (C<guestfsd>)."
35404 #: ../src/guestfs.pod:2323
35409 #: ../src/guestfs.pod:2325
35411 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
35416 #: ../src/guestfs.pod:2328
35419 " verbose daemon enabled\n"
35424 #: ../src/guestfs.pod:2330
35426 "The daemon expects to see a named virtio-serial port exposed by qemu and "
35427 "connected on the other end to the library."
35431 #: ../src/guestfs.pod:2333
35433 "The daemon connects to this port (and hence to the library) and sends a four "
35434 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
35435 "protocol (see below)."
35439 #: ../src/guestfs.pod:2339
35440 msgid "COMMUNICATION PROTOCOL"
35444 #: ../src/guestfs.pod:2341
35446 "Don't rely on using this protocol directly. This section documents how it "
35447 "currently works, but it may change at any time."
35451 #: ../src/guestfs.pod:2344
35453 "The protocol used to talk between the library and the daemon running inside "
35454 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
35455 "1014, RFC 1832, RFC 4506)."
35459 #: ../src/guestfs.pod:2348
35461 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
35462 "this file is automatically generated)."
35466 #: ../src/guestfs.pod:2351
35468 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
35469 "and C<FileOut> parameters, which are handled with very simple request/reply "
35470 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
35471 "parameters, which use the same request and reply messages, but they may also "
35472 "be followed by files sent using a chunked encoding."
35476 #: ../src/guestfs.pod:2358
35477 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
35481 #: ../src/guestfs.pod:2360
35482 msgid "For ordinary functions, the request message is:"
35486 #: ../src/guestfs.pod:2362
35489 " total length (header + arguments,\n"
35490 " but not including the length word itself)\n"
35491 " struct guestfs_message_header (encoded as XDR)\n"
35492 " struct guestfs_<foo>_args (encoded as XDR)\n"
35497 #: ../src/guestfs.pod:2367
35499 "The total length field allows the daemon to allocate a fixed size buffer "
35500 "into which it slurps the rest of the message. As a result, the total length "
35501 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
35502 "effective size of any request is limited to somewhere under this size."
35506 #: ../src/guestfs.pod:2373
35508 "Note also that many functions don't take any arguments, in which case the "
35509 "C<guestfs_I<foo>_args> is completely omitted."
35513 #: ../src/guestfs.pod:2376
35515 "The header contains the procedure number (C<guestfs_proc>) which is how the "
35516 "receiver knows what type of args structure to expect, or none at all."
35520 #: ../src/guestfs.pod:2380
35522 "For functions that take optional arguments, the optional arguments are "
35523 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
35524 "arguments. A bitmask in the header indicates which optional arguments are "
35525 "meaningful. The bitmask is also checked to see if it contains bits set "
35526 "which the daemon does not know about (eg. if more optional arguments were "
35527 "added in a later version of the library), and this causes the call to be "
35532 #: ../src/guestfs.pod:2388
35533 msgid "The reply message for ordinary functions is:"
35537 #: ../src/guestfs.pod:2390
35540 " total length (header + ret,\n"
35541 " but not including the length word itself)\n"
35542 " struct guestfs_message_header (encoded as XDR)\n"
35543 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35548 #: ../src/guestfs.pod:2395
35550 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
35551 "functions that return no formal return values."
35555 #: ../src/guestfs.pod:2398
35557 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
35561 #: ../src/guestfs.pod:2401
35563 "In the case of an error, a flag is set in the header, and the reply message "
35564 "is slightly changed:"
35568 #: ../src/guestfs.pod:2404
35571 " total length (header + error,\n"
35572 " but not including the length word itself)\n"
35573 " struct guestfs_message_header (encoded as XDR)\n"
35574 " struct guestfs_message_error (encoded as XDR)\n"
35579 #: ../src/guestfs.pod:2409
35581 "The C<guestfs_message_error> structure contains the error message as a "
35586 #: ../src/guestfs.pod:2412
35587 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
35591 #: ../src/guestfs.pod:2414
35593 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
35594 "The normal request message is sent (see above). However this is followed by "
35595 "a sequence of file chunks."
35599 #: ../src/guestfs.pod:2418
35602 " total length (header + arguments,\n"
35603 " but not including the length word itself,\n"
35604 " and not including the chunks)\n"
35605 " struct guestfs_message_header (encoded as XDR)\n"
35606 " struct guestfs_<foo>_args (encoded as XDR)\n"
35607 " sequence of chunks for FileIn param #0\n"
35608 " sequence of chunks for FileIn param #1 etc.\n"
35613 #: ../src/guestfs.pod:2426
35614 msgid "The \"sequence of chunks\" is:"
35618 #: ../src/guestfs.pod:2428
35621 " length of chunk (not including length word itself)\n"
35622 " struct guestfs_chunk (encoded as XDR)\n"
35623 " length of chunk\n"
35624 " struct guestfs_chunk (encoded as XDR)\n"
35626 " length of chunk\n"
35627 " struct guestfs_chunk (with data.data_len == 0)\n"
35632 #: ../src/guestfs.pod:2436
35634 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
35635 "is set in the final chunk to indicate either successful completion or early "
35640 #: ../src/guestfs.pod:2440
35642 "At time of writing there are no functions that have more than one FileIn "
35643 "parameter. However this is (theoretically) supported, by sending the "
35644 "sequence of chunks for each FileIn parameter one after another (from left to "
35649 #: ../src/guestfs.pod:2445
35651 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
35652 "transfer. The library does this by sending a chunk with a special flag set "
35653 "to indicate cancellation. When the daemon sees this, it cancels the whole "
35654 "RPC, does I<not> send any reply, and goes back to reading the next request."
35658 #: ../src/guestfs.pod:2451
35660 "The daemon may also cancel. It does this by writing a special word "
35661 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
35662 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
35663 "cancel chunk). The special word is chosen so that even if cancellation "
35664 "happens right at the end of the transfer (after the library has finished "
35665 "writing and has started listening for the reply), the \"spurious\" cancel "
35666 "flag will not be confused with the reply message."
35670 #: ../src/guestfs.pod:2460
35672 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
35673 "limit), and also files where the size is not known in advance (eg. from "
35674 "pipes or sockets). However the chunks are rather small "
35675 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
35676 "to keep much in memory."
35680 #: ../src/guestfs.pod:2466
35681 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
35685 #: ../src/guestfs.pod:2468
35687 "The protocol for FileOut parameters is exactly the same as for FileIn "
35688 "parameters, but with the roles of daemon and library reversed."
35692 #: ../src/guestfs.pod:2471
35695 " total length (header + ret,\n"
35696 " but not including the length word itself,\n"
35697 " and not including the chunks)\n"
35698 " struct guestfs_message_header (encoded as XDR)\n"
35699 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35700 " sequence of chunks for FileOut param #0\n"
35701 " sequence of chunks for FileOut param #1 etc.\n"
35706 #: ../src/guestfs.pod:2479
35707 msgid "INITIAL MESSAGE"
35711 #: ../src/guestfs.pod:2481
35713 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
35714 "which indicates that the guest and daemon is alive. This is what L</"
35715 "guestfs_launch> waits for."
35719 #: ../src/guestfs.pod:2485
35720 msgid "PROGRESS NOTIFICATION MESSAGES"
35724 #: ../src/guestfs.pod:2487
35726 "The daemon may send progress notification messages at any time. These are "
35727 "distinguished by the normal length word being replaced by "
35728 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
35732 #: ../src/guestfs.pod:2491
35734 "The library turns them into progress callbacks (see L</"
35735 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
35740 #: ../src/guestfs.pod:2495
35742 "The daemon self-limits the frequency of progress messages it sends (see "
35743 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
35748 #: ../src/guestfs.pod:2499
35749 msgid "LIBGUESTFS VERSION NUMBERS"
35753 #: ../src/guestfs.pod:2501
35755 "Since April 2010, libguestfs has started to make separate development and "
35756 "stable releases, along with corresponding branches in our git repository. "
35757 "These separate releases can be identified by version number:"
35761 #: ../src/guestfs.pod:2506
35764 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
35765 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
35771 " | `-------- sub-version\n"
35773 " `------ always '1' because we don't change the ABI\n"
35778 #: ../src/guestfs.pod:2517
35779 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
35783 #: ../src/guestfs.pod:2519
35785 "As time passes we cherry pick fixes from the development branch and backport "
35786 "those into the stable branch, the effect being that the stable branch should "
35787 "get more stable and less buggy over time. So the stable releases are ideal "
35788 "for people who don't need new features but would just like the software to "
35793 #: ../src/guestfs.pod:2525
35794 msgid "Our criteria for backporting changes are:"
35798 #: ../src/guestfs.pod:2531
35800 "Documentation changes which don't affect any code are backported unless the "
35801 "documentation refers to a future feature which is not in stable."
35805 #: ../src/guestfs.pod:2537
35807 "Bug fixes which are not controversial, fix obvious problems, and have been "
35808 "well tested are backported."
35812 #: ../src/guestfs.pod:2542
35814 "Simple rearrangements of code which shouldn't affect how it works get "
35815 "backported. This is so that the code in the two branches doesn't get too "
35816 "far out of step, allowing us to backport future fixes more easily."
35820 #: ../src/guestfs.pod:2548
35822 "We I<don't> backport new features, new APIs, new tools etc, except in one "
35823 "exceptional case: the new feature is required in order to implement an "
35824 "important bug fix."
35828 #: ../src/guestfs.pod:2554
35830 "A new stable branch starts when we think the new features in development are "
35831 "substantial and compelling enough over the current stable branch to warrant "
35832 "it. When that happens we create new stable and development versions 1.N.0 "
35833 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
35834 "stable at this point, but by backporting fixes from development, that branch "
35835 "will stabilize over time."
35839 #: ../src/guestfs.pod:2562
35840 msgid "EXTENDING LIBGUESTFS"
35844 #: ../src/guestfs.pod:2564
35845 msgid "ADDING A NEW API ACTION"
35849 #: ../src/guestfs.pod:2566
35851 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
35852 "documentation) are generated, and this makes it easy to extend the "
35857 #: ../src/guestfs.pod:2570
35858 msgid "To add a new API action there are two changes:"
35862 #: ../src/guestfs.pod:2576
35864 "You need to add a description of the call (name, parameters, return type, "
35865 "tests, documentation) to C<generator/generator_actions.ml>."
35869 #: ../src/guestfs.pod:2579
35871 "There are two sorts of API action, depending on whether the call goes "
35872 "through to the daemon in the appliance, or is serviced entirely by the "
35873 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
35874 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
35875 "an example of the latter, since a trace flag is maintained in the handle and "
35876 "all tracing is done on the library side."
35880 #: ../src/guestfs.pod:2587
35882 "Most new actions are of the first type, and get added to the "
35883 "C<daemon_functions> list. Each function has a unique procedure number used "
35884 "in the RPC protocol which is assigned to that action when we publish "
35885 "libguestfs and cannot be reused. Take the latest procedure number and "
35890 #: ../src/guestfs.pod:2593
35892 "For library-only actions of the second type, add to the "
35893 "C<non_daemon_functions> list. Since these functions are serviced by the "
35894 "library and do not travel over the RPC mechanism to the daemon, these "
35895 "functions do not need a procedure number, and so the procedure number is set "
35900 #: ../src/guestfs.pod:2601
35901 msgid "Implement the action (in C):"
35905 #: ../src/guestfs.pod:2603
35907 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
35908 "C<daemon/> directory."
35912 #: ../src/guestfs.pod:2606
35914 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
35915 "(note: double underscore) in the C<src/> directory."
35919 #: ../src/guestfs.pod:2609
35920 msgid "In either case, use another function as an example of what to do."
35924 #: ../src/guestfs.pod:2613
35925 msgid "After making these changes, use C<make> to compile."
35929 #: ../src/guestfs.pod:2615
35931 "Note that you don't need to implement the RPC, language bindings, manual "
35932 "pages or anything else. It's all automatically generated from the OCaml "
35937 #: ../src/guestfs.pod:2619
35938 msgid "ADDING TESTS FOR AN API ACTION"
35942 #: ../src/guestfs.pod:2621
35944 "You can supply zero or as many tests as you want per API call. The tests "
35945 "can either be added as part of the API description (C<generator/"
35946 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
35947 "into C<regressions/>. Note that adding a script to C<regressions/> is "
35948 "slower, so if possible use the first method."
35952 #: ../src/guestfs.pod:2627
35954 "The following describes the test environment used when you add an API test "
35955 "in C<generator_actions.ml>."
35959 #: ../src/guestfs.pod:2630
35960 msgid "The test environment has 4 block devices:"
35964 #: ../src/guestfs.pod:2634
35965 msgid "C</dev/sda> 500MB"
35969 #: ../src/guestfs.pod:2636
35970 msgid "General block device for testing."
35974 #: ../src/guestfs.pod:2638
35975 msgid "C</dev/sdb> 50MB"
35979 #: ../src/guestfs.pod:2640
35981 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
35986 #: ../src/guestfs.pod:2643
35987 msgid "C</dev/sdc> 10MB"
35991 #: ../src/guestfs.pod:2645
35992 msgid "Used in a few tests where two block devices are needed."
35996 #: ../src/guestfs.pod:2647
35997 msgid "C</dev/sdd>"
36001 #: ../src/guestfs.pod:2649
36002 msgid "ISO with fixed content (see C<images/test.iso>)."
36006 #: ../src/guestfs.pod:2653
36008 "To be able to run the tests in a reasonable amount of time, the libguestfs "
36009 "appliance and block devices are reused between tests. So don't try testing "
36010 "L</guestfs_kill_subprocess> :-x"
36014 #: ../src/guestfs.pod:2657
36016 "Each test starts with an initial scenario, selected using one of the "
36017 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
36018 "initialize the disks mentioned above in a particular way as documented in "
36019 "C<generator_types.ml>. You should not assume anything about the previous "
36020 "contents of other disks that are not initialized."
36024 #: ../src/guestfs.pod:2663
36026 "You can add a prerequisite clause to any individual test. This is a run-"
36027 "time check, which, if it fails, causes the test to be skipped. Useful if "
36028 "testing a command which might not work on all variations of libguestfs "
36029 "builds. A test that has prerequisite of C<Always> means to run "
36034 #: ../src/guestfs.pod:2669
36036 "In addition, packagers can skip individual tests by setting environment "
36037 "variables before running C<make check>."
36041 #: ../src/guestfs.pod:2672
36044 " SKIP_TEST_<CMD>_<NUM>=1\n"
36049 #: ../src/guestfs.pod:2674
36050 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
36054 #: ../src/guestfs.pod:2676
36059 #: ../src/guestfs.pod:2678
36062 " SKIP_TEST_<CMD>=1\n"
36067 #: ../src/guestfs.pod:2680
36068 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
36072 #: ../src/guestfs.pod:2682
36073 msgid "Packagers can run only certain tests by setting for example:"
36077 #: ../src/guestfs.pod:2684
36080 " TEST_ONLY=\"vfs_type zerofree\"\n"
36085 #: ../src/guestfs.pod:2686
36087 "See C<capitests/tests.c> for more details of how these environment variables "
36092 #: ../src/guestfs.pod:2689
36093 msgid "DEBUGGING NEW API ACTIONS"
36097 #: ../src/guestfs.pod:2691
36098 msgid "Test new actions work before submitting them."
36102 #: ../src/guestfs.pod:2693
36103 msgid "You can use guestfish to try out new commands."
36107 #: ../src/guestfs.pod:2695
36109 "Debugging the daemon is a problem because it runs inside a minimal "
36110 "environment. However you can fprintf messages in the daemon to stderr, and "
36111 "they will show up if you use C<guestfish -v>."
36115 #: ../src/guestfs.pod:2699
36116 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
36120 #: ../src/guestfs.pod:2701
36122 "Our C source code generally adheres to some basic code-formatting "
36123 "conventions. The existing code base is not totally consistent on this "
36124 "front, but we do prefer that contributed code be formatted similarly. In "
36125 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
36126 "indentation level, and other than that, follow the K&R style."
36130 #: ../src/guestfs.pod:2707
36132 "If you use Emacs, add the following to one of one of your start-up files (e."
36133 "g., ~/.emacs), to help ensure that you get indentation right:"
36137 #: ../src/guestfs.pod:2710
36140 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
36141 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
36142 " (add-hook 'find-file-hook\n"
36143 " '(lambda () (if (and buffer-file-name\n"
36144 " (string-match \"/libguestfs\\\\>\"\n"
36145 " (buffer-file-name))\n"
36146 " (not (string-equal mode-name \"Change Log\"))\n"
36147 " (not (string-equal mode-name \"Makefile\")))\n"
36148 " (setq indent-tabs-mode nil))))\n"
36153 #: ../src/guestfs.pod:2720
36156 " ;;; When editing C sources in libguestfs, use this style.\n"
36157 " (defun libguestfs-c-mode ()\n"
36158 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
36160 " (c-set-style \"K&R\")\n"
36161 " (setq c-indent-level 2)\n"
36162 " (setq c-basic-offset 2))\n"
36163 " (add-hook 'c-mode-hook\n"
36164 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
36165 " (buffer-file-name))\n"
36166 " (libguestfs-c-mode))))\n"
36171 #: ../src/guestfs.pod:2732
36172 msgid "Enable warnings when compiling (and fix any problems this finds):"
36176 #: ../src/guestfs.pod:2735
36179 " ./configure --enable-gcc-warnings\n"
36184 #: ../src/guestfs.pod:2737
36185 msgid "Useful targets are:"
36189 #: ../src/guestfs.pod:2739
36192 " make syntax-check # checks the syntax of the C code\n"
36193 " make check # runs the test suite\n"
36198 #: ../src/guestfs.pod:2742
36199 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
36203 #: ../src/guestfs.pod:2744
36205 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
36206 "which are used to do shell quoting."
36210 #: ../src/guestfs.pod:2749
36215 #: ../src/guestfs.pod:2751
36217 "Simple shell quoted string. Any spaces or other shell characters are "
36222 #: ../src/guestfs.pod:2754
36227 #: ../src/guestfs.pod:2756
36229 "Same as C<%Q> except the string is treated as a path which is prefixed by "
36234 #: ../src/guestfs.pod:2763
36237 " asprintf (&cmd, \"cat %R\", path);\n"
36242 #: ../src/guestfs.pod:2765
36243 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
36247 #: ../src/guestfs.pod:2767
36249 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
36250 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
36251 "they are not passed via the shell (instead, straight to exec). You probably "
36252 "want to use the C<sysroot_path()> function however."
36256 #: ../src/guestfs.pod:2773
36257 msgid "SUBMITTING YOUR NEW API ACTIONS"
36261 #: ../src/guestfs.pod:2775
36263 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
36264 "libguestfs> and CC to L<rjones@redhat.com>."
36268 #: ../src/guestfs.pod:2779
36269 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
36273 #: ../src/guestfs.pod:2781
36274 msgid "We support i18n (gettext anyhow) in the library."
36278 #: ../src/guestfs.pod:2783
36280 "However many messages come from the daemon, and we don't translate those at "
36281 "the moment. One reason is that the appliance generally has all locale files "
36282 "removed from it, because they take up a lot of space. So we'd have to readd "
36283 "some of those, as well as copying our PO files into the appliance."
36287 #: ../src/guestfs.pod:2789
36289 "Debugging messages are never translated, since they are intended for the "
36294 #: ../src/guestfs.pod:2792
36295 msgid "SOURCE CODE SUBDIRECTORIES"
36299 #: ../src/guestfs.pod:2798
36300 msgid "The libguestfs appliance, build scripts and so on."
36304 #: ../src/guestfs.pod:2800
36305 msgid "C<capitests>"
36309 #: ../src/guestfs.pod:2802
36310 msgid "Automated tests of the C API."
36314 #: ../src/guestfs.pod:2804
36319 #: ../src/guestfs.pod:2806
36321 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
36326 #: ../src/guestfs.pod:2809
36331 #: ../src/guestfs.pod:2811
36333 "Safety and liveness tests of components that libguestfs depends upon (not of "
36334 "libguestfs itself). Mainly this is for qemu and the kernel."
36338 #: ../src/guestfs.pod:2814
36343 #: ../src/guestfs.pod:2816
36344 msgid "Outside contributions, experimental parts."
36348 #: ../src/guestfs.pod:2818
36353 #: ../src/guestfs.pod:2820
36355 "The daemon that runs inside the libguestfs appliance and carries out actions."
36359 #: ../src/guestfs.pod:2823
36364 #: ../src/guestfs.pod:2825
36365 msgid "L<virt-df(1)> command and documentation."
36369 #: ../src/guestfs.pod:2827
36374 #: ../src/guestfs.pod:2829
36375 msgid "L<virt-edit(1)> command and documentation."
36379 #: ../src/guestfs.pod:2831
36380 msgid "C<examples>"
36384 #: ../src/guestfs.pod:2833
36385 msgid "C API example code."
36389 #: ../src/guestfs.pod:2835
36394 #: ../src/guestfs.pod:2837
36396 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
36397 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
36398 "L<virt-tar-out(1)>."
36402 #: ../src/guestfs.pod:2841
36407 #: ../src/guestfs.pod:2843
36409 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
36413 #: ../src/guestfs.pod:2845
36414 msgid "C<generator>"
36418 #: ../src/guestfs.pod:2847
36420 "The crucially important generator, used to automatically generate large "
36421 "amounts of boilerplate C code for things like RPC and bindings."
36425 #: ../src/guestfs.pod:2850
36430 #: ../src/guestfs.pod:2852
36431 msgid "Files used by the test suite."
36435 #: ../src/guestfs.pod:2854
36436 msgid "Some \"phony\" guest images which we test against."
36440 #: ../src/guestfs.pod:2856
36441 msgid "C<inspector>"
36445 #: ../src/guestfs.pod:2858
36446 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
36450 #: ../src/guestfs.pod:2860
36455 #: ../src/guestfs.pod:2862
36456 msgid "Logo used on the website. The fish is called Arthur by the way."
36460 #: ../src/guestfs.pod:2864
36465 #: ../src/guestfs.pod:2866
36466 msgid "M4 macros used by autoconf."
36470 #: ../src/guestfs.pod:2868
36475 #: ../src/guestfs.pod:2870
36476 msgid "Translations of simple gettext strings."
36480 #: ../src/guestfs.pod:2872
36485 #: ../src/guestfs.pod:2874
36487 "The build infrastructure and PO files for translations of manpages and POD "
36488 "files. Eventually this will be combined with the C<po> directory, but that "
36489 "is rather complicated."
36493 #: ../src/guestfs.pod:2878
36494 msgid "C<regressions>"
36498 #: ../src/guestfs.pod:2880
36499 msgid "Regression tests."
36503 #: ../src/guestfs.pod:2882
36508 #: ../src/guestfs.pod:2884
36509 msgid "L<virt-rescue(1)> command and documentation."
36513 #: ../src/guestfs.pod:2886
36518 #: ../src/guestfs.pod:2888
36519 msgid "Source code to the C library."
36523 #: ../src/guestfs.pod:2890
36528 #: ../src/guestfs.pod:2892
36529 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
36533 #: ../src/guestfs.pod:2894
36534 msgid "C<test-tool>"
36538 #: ../src/guestfs.pod:2896
36540 "Test tool for end users to test if their qemu/kernel combination will work "
36545 #: ../src/guestfs.pod:2899
36550 #: ../src/guestfs.pod:2901
36555 #: ../src/guestfs.pod:2903
36560 #: ../src/guestfs.pod:2905
36565 #: ../src/guestfs.pod:2907
36570 #: ../src/guestfs.pod:2909
36575 #: ../src/guestfs.pod:2911
36580 #: ../src/guestfs.pod:2913
36585 #: ../src/guestfs.pod:2915
36586 msgid "Language bindings."
36590 #: ../src/guestfs.pod:2919
36591 msgid "MAKING A STABLE RELEASE"
36595 #: ../src/guestfs.pod:2921
36597 "When we make a stable release, there are several steps documented here. See "
36598 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
36603 #: ../src/guestfs.pod:2929
36605 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
36609 #: ../src/guestfs.pod:2934
36610 msgid "Finalize RELEASE-NOTES."
36614 #: ../src/guestfs.pod:2938
36615 msgid "Update ROADMAP."
36619 #: ../src/guestfs.pod:2942
36620 msgid "Run C<src/api-support/update-from-tarballs.sh>."
36624 #: ../src/guestfs.pod:2946
36625 msgid "Push and pull from Transifex."
36629 #: ../src/guestfs.pod:2948
36634 #: ../src/guestfs.pod:2950
36642 #: ../src/guestfs.pod:2952
36643 msgid "to push the latest POT files to Transifex. Then run:"
36647 #: ../src/guestfs.pod:2954
36655 #: ../src/guestfs.pod:2956
36656 msgid "which is a wrapper to pull the latest translated C<*.po> files."
36660 #: ../src/guestfs.pod:2960
36662 "Create new stable and development directories under L<http://libguestfs.org/"
36667 #: ../src/guestfs.pod:2965
36668 msgid "Create the branch in git:"
36672 #: ../src/guestfs.pod:2967
36675 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
36676 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
36677 " git branch stable-1.XX\n"
36678 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
36683 #: ../src/guestfs.pod:2974
36688 #: ../src/guestfs.pod:2976
36689 msgid "PROTOCOL LIMITS"
36693 #: ../src/guestfs.pod:2978
36695 "Internally libguestfs uses a message-based protocol to pass API calls and "
36696 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
36697 "plenty more detail about this). The maximum message size used by the "
36698 "protocol is slightly less than 4 MB. For some API calls you may need to be "
36699 "aware of this limit. The API calls which may be affected are individually "
36700 "documented, with a link back to this section of the documentation."
36704 #: ../src/guestfs.pod:2986
36706 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
36707 "a simple string. Because this string is at some point internally encoded as "
36708 "a message, the maximum size that it can return is slightly under 4 MB. If "
36709 "the requested file is larger than this then you will get an error."
36713 #: ../src/guestfs.pod:2992
36715 "In order to transfer large files into and out of the guest filesystem, you "
36716 "need to use particular calls that support this. The sections L</UPLOADING> "
36717 "and L</DOWNLOADING> document how to do this."
36721 #: ../src/guestfs.pod:2996
36723 "You might also consider mounting the disk image using our FUSE filesystem "
36724 "support (L<guestmount(1)>)."
36728 #: ../src/guestfs.pod:2999
36729 msgid "MAXIMUM NUMBER OF DISKS"
36733 #: ../src/guestfs.pod:3001
36734 msgid "When using virtio disks (the default) the current limit is B<25> disks."
36738 #: ../src/guestfs.pod:3004
36740 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
36741 "slots. However febootstrap only understands disks with names C</dev/vda> "
36742 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
36747 #: ../src/guestfs.pod:3009
36749 "We are working to substantially raise this limit in future versions but it "
36750 "requires complex changes to qemu."
36754 #: ../src/guestfs.pod:3012
36756 "In future versions of libguestfs it should also be possible to \"hot plug\" "
36757 "disks (add and remove disks after calling L</guestfs_launch>). This also "
36758 "requires changes to qemu."
36762 #: ../src/guestfs.pod:3016
36763 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
36767 #: ../src/guestfs.pod:3018
36768 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
36772 #: ../src/guestfs.pod:3020
36774 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
36775 "vda>, and C</dev/vda1> through C</dev/vda15>)."
36779 #: ../src/guestfs.pod:3023
36781 "If you attach a disk with more than 15 partitions, the extra partitions are "
36782 "ignored by libguestfs."
36786 #: ../src/guestfs.pod:3026
36787 msgid "MAXIMUM SIZE OF A DISK"
36791 #: ../src/guestfs.pod:3028
36792 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
36796 #: ../src/guestfs.pod:3030
36798 "We have tested block devices up to 1 exabyte (2**60 or "
36799 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
36804 #: ../src/guestfs.pod:3034
36806 "Although libguestfs probably does not impose any limit, the underlying host "
36807 "storage will. If you store disk images on a host ext4 filesystem, then the "
36808 "maximum size will be limited by the maximum ext4 file size (currently 16 "
36809 "TB). If you store disk images as host logical volumes then you are limited "
36810 "by the maximum size of an LV."
36814 #: ../src/guestfs.pod:3040
36816 "For the hugest disk image files, we recommend using XFS on the host for "
36821 #: ../src/guestfs.pod:3043
36822 msgid "MAXIMUM SIZE OF A PARTITION"
36826 #: ../src/guestfs.pod:3045
36828 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
36829 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
36830 "address a partition located beyond 2 TB on the disk."
36834 #: ../src/guestfs.pod:3049
36836 "It is recommended that you use GPT partitions on disks which are larger than "
36837 "this size. GPT uses 64 bit sector numbers and so can address partitions "
36838 "which are theoretically larger than the largest disk we could support."
36842 #: ../src/guestfs.pod:3054
36843 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
36847 #: ../src/guestfs.pod:3056
36849 "This depends on the filesystem type. libguestfs itself does not impose any "
36850 "known limit. Consult Wikipedia or the filesystem documentation to find out "
36851 "what these limits are."
36855 #: ../src/guestfs.pod:3060
36856 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
36860 #: ../src/guestfs.pod:3062
36862 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
36863 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
36864 "uploads and downloads."
36868 #: ../src/guestfs.pod:3066
36869 msgid "INSPECTION LIMITS"
36873 #: ../src/guestfs.pod:3068
36875 "The inspection code has several arbitrary limits on things like the size of "
36876 "Windows Registry hive it will read, and the length of product name. These "
36877 "are intended to stop a malicious guest from consuming arbitrary amounts of "
36878 "memory and disk space on the host, and should not be reached in practice. "
36879 "See the source code for more information."
36883 #: ../src/guestfs.pod:3094
36885 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
36886 "effect as calling C<guestfs_set_verbose (g, 1)>."
36890 #: ../src/guestfs.pod:3106
36892 "Set the path that libguestfs uses to search for a supermin appliance. See "
36893 "the discussion of paths in section L</PATH> above."
36897 #: ../src/guestfs.pod:3115
36898 msgid "See also L</QEMU WRAPPERS> above."
36902 #: ../src/guestfs.pod:3119
36904 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
36905 "effect as calling C<guestfs_set_trace (g, 1)>."
36909 #: ../src/guestfs.pod:3137
36911 "L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-"
36912 "perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, L<guestfish(1)>, "
36913 "L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
36914 "L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)"
36915 ">, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
36916 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
36917 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
36918 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
36922 #: ../src/guestfs.pod:3167
36924 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
36925 "(8)>, L<disktype(1)>."
36929 #: ../src/guestfs.pod:3174 ../tools/virt-make-fs.pl:553
36930 #: ../tools/virt-win-reg.pl:761
36935 #: ../src/guestfs.pod:3176
36936 msgid "To get a list of bugs against libguestfs use this link:"
36940 #: ../src/guestfs.pod:3178
36942 "L<https://bugzilla.redhat.com/buglist.cgi?"
36943 "component=libguestfs&product=Virtualization+Tools>"
36947 #: ../src/guestfs.pod:3180
36948 msgid "To report a new bug against libguestfs use this link:"
36952 #: ../src/guestfs.pod:3182
36954 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
36955 "component=libguestfs&product=Virtualization+Tools>"
36959 #: ../src/guestfs.pod:3184
36960 msgid "When reporting a bug, please check:"
36964 #: ../src/guestfs.pod:3190
36965 msgid "That the bug hasn't been reported already."
36969 #: ../src/guestfs.pod:3194
36970 msgid "That you are testing a recent version."
36974 #: ../src/guestfs.pod:3198
36975 msgid "Describe the bug accurately, and give a way to reproduce it."
36979 #: ../src/guestfs.pod:3202
36981 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
36986 #: ../test-tool/libguestfs-test-tool.pod:5
36987 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
36991 #: ../test-tool/libguestfs-test-tool.pod:9
36994 " libguestfs-test-tool [--options]\n"
36999 #: ../test-tool/libguestfs-test-tool.pod:13
37001 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
37002 "to check basic libguestfs functionality is working. This is needed because "
37003 "libguestfs occasionally breaks for reasons beyond our control: usually "
37004 "because of changes in the underlying qemu or kernel packages, or the host "
37009 #: ../test-tool/libguestfs-test-tool.pod:19
37010 msgid "If you suspect a problem in libguestfs, then just run:"
37014 #: ../test-tool/libguestfs-test-tool.pod:21
37017 " libguestfs-test-tool\n"
37022 #: ../test-tool/libguestfs-test-tool.pod:23
37023 msgid "It will print lots of diagnostic messages."
37027 #: ../test-tool/libguestfs-test-tool.pod:25
37028 msgid "If it runs to completion successfully, you will see this near the end:"
37032 #: ../test-tool/libguestfs-test-tool.pod:27
37035 " ===== TEST FINISHED OK =====\n"
37040 #: ../test-tool/libguestfs-test-tool.pod:29
37041 msgid "and the test tool will exit with code 0."
37045 #: ../test-tool/libguestfs-test-tool.pod:31
37047 "If it fails (and/or exits with non-zero error code), please paste the "
37048 "I<complete, unedited> output of the test tool into a bug report. More "
37049 "information about reporting bugs can be found on the L<http://libguestfs.org/"
37054 #: ../test-tool/libguestfs-test-tool.pod:42
37055 msgid "Display short usage information and exit."
37059 #: ../test-tool/libguestfs-test-tool.pod:44
37060 msgid "B<--qemu qemu_binary>"
37064 #: ../test-tool/libguestfs-test-tool.pod:46
37066 "If you have downloaded another qemu binary, point this option at the full "
37067 "path of the binary to try it."
37071 #: ../test-tool/libguestfs-test-tool.pod:49
37072 msgid "B<--qemudir qemu_source_dir>"
37076 #: ../test-tool/libguestfs-test-tool.pod:51
37078 "If you have compiled qemu from source, point this option at the source "
37079 "directory to try it."
37083 #: ../test-tool/libguestfs-test-tool.pod:54
37088 #: ../test-tool/libguestfs-test-tool.pod:56
37089 msgid "B<--timeout N>"
37093 #: ../test-tool/libguestfs-test-tool.pod:58
37095 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
37096 "minutes) which does not usually need to be adjusted."
37100 #: ../test-tool/libguestfs-test-tool.pod:63
37101 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
37105 #: ../test-tool/libguestfs-test-tool.pod:65
37107 "If you have compiled another version of qemu from source and would like to "
37108 "try that, then you can use the I<--qemudir> option to point to the qemu "
37109 "source directory."
37113 #: ../test-tool/libguestfs-test-tool.pod:69
37115 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
37116 "option to point to the binary."
37120 #: ../test-tool/libguestfs-test-tool.pod:72
37122 "Note when using these options, you can ignore the business of qemu wrapper "
37123 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
37124 "wrapper script for you if one is needed."
37128 #: ../test-tool/libguestfs-test-tool.pod:76
37129 msgid "TRYING OUT A DIFFERENT KERNEL"
37133 #: ../test-tool/libguestfs-test-tool.pod:78
37135 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
37136 "libguestfs tries. You do this by setting the environment variables "
37137 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
37141 #: ../test-tool/libguestfs-test-tool.pod:82
37143 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
37148 #: ../test-tool/libguestfs-test-tool.pod:85
37149 msgid "SELF-DIAGNOSIS"
37153 #: ../test-tool/libguestfs-test-tool.pod:87
37155 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
37156 "produced by libguestfs-test-tool and/or possible errors."
37160 #: ../test-tool/libguestfs-test-tool.pod:92
37162 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
37163 "I<1> if there was an error."
37167 #: ../test-tool/libguestfs-test-tool.pod:97
37169 "For the full list of environment variables which may affect libguestfs, "
37170 "please see the L<guestfs(3)> manual page."
37174 #: ../test-tool/libguestfs-test-tool.pod:102
37175 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
37179 #: ../tools/virt-list-filesystems.pl:32
37181 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
37185 #: ../tools/virt-list-filesystems.pl:36
37188 " virt-list-filesystems [--options] domname\n"
37193 #: ../tools/virt-list-filesystems.pl:38
37196 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
37201 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
37203 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
37208 #: ../tools/virt-list-filesystems.pl:45
37210 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
37211 "are contained in a virtual machine or disk image."
37215 #: ../tools/virt-list-filesystems.pl:49
37217 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
37218 "functionality. For more complex cases you should look at the L<guestfish(1)"
37223 #: ../tools/virt-list-filesystems.pl:112
37225 "With this option, C<virt-list-filesystems> displays the type of each "
37226 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
37230 #: ../tools/virt-list-filesystems.pl:119
37235 #: ../tools/virt-list-filesystems.pl:123
37237 "Normally we only show mountable filesystems. If this option is given then "
37238 "swap devices are shown too."
37242 #: ../tools/virt-list-filesystems.pl:197
37244 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
37245 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
37246 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37250 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
37251 msgid "Copyright (C) 2009 Red Hat Inc."
37255 #: ../tools/virt-list-partitions.pl:32
37257 "virt-list-partitions - List partitions in a virtual machine or disk image"
37261 #: ../tools/virt-list-partitions.pl:36
37264 " virt-list-partitions [--options] domname\n"
37269 #: ../tools/virt-list-partitions.pl:38
37272 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
37277 #: ../tools/virt-list-partitions.pl:45
37279 "C<virt-list-partitions> is a command line tool to list the partitions that "
37280 "are contained in a virtual machine or disk image. It is mainly useful as a "
37281 "first step to using L<virt-resize(1)>."
37285 #: ../tools/virt-list-partitions.pl:50
37287 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
37288 "functionality. For more complex cases you should look at the L<guestfish(1)"
37293 #: ../tools/virt-list-partitions.pl:113
37294 msgid "Show sizes in human-readable form (eg. \"1G\")."
37298 #: ../tools/virt-list-partitions.pl:123
37300 "With this option, C<virt-list-partitions> displays the type and size of each "
37301 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
37305 #: ../tools/virt-list-partitions.pl:130
37310 #: ../tools/virt-list-partitions.pl:132
37315 #: ../tools/virt-list-partitions.pl:134
37317 "Display the total size of each block device (as a separate row or rows)."
37321 #: ../tools/virt-list-partitions.pl:267
37323 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
37324 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
37325 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37329 #: ../tools/virt-list-partitions.pl:283
37330 msgid "Copyright (C) 2009-2010 Red Hat Inc."
37334 #: ../tools/virt-make-fs.pl:37
37335 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
37339 #: ../tools/virt-make-fs.pl:41
37342 " virt-make-fs [--options] input.tar output.img\n"
37347 #: ../tools/virt-make-fs.pl:43
37350 " virt-make-fs [--options] input.tar.gz output.img\n"
37355 #: ../tools/virt-make-fs.pl:45
37358 " virt-make-fs [--options] directory output.img\n"
37363 #: ../tools/virt-make-fs.pl:49
37365 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
37366 "archive or some files in a directory. It is similar to tools like L<mkisofs"
37367 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
37368 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
37369 "you want to attach these filesystems to existing virtual machines (eg. to "
37370 "import large amounts of read-only data to a VM)."
37374 #: ../tools/virt-make-fs.pl:57
37375 msgid "Basic usage is:"
37379 #: ../tools/virt-make-fs.pl:59
37382 " virt-make-fs input output\n"
37387 #: ../tools/virt-make-fs.pl:61
37389 "where C<input> is either a directory containing files that you want to add, "
37390 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
37391 "C<output> is a disk image. The input type is detected automatically. The "
37392 "output disk image defaults to a raw ext2 image unless you specify extra "
37393 "flags (see L</OPTIONS> below)."
37397 #: ../tools/virt-make-fs.pl:67
37398 msgid "EXTRA SPACE"
37402 #: ../tools/virt-make-fs.pl:69
37404 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
37405 "the files that it contains, but might have extra space. Depending on how "
37406 "you are going to use the output, you might think this extra space is wasted "
37407 "and want to minimize it, or you might want to leave space so that more files "
37408 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
37409 "but you can use the I<--size> flag to leave space in the filesystem if you "
37414 #: ../tools/virt-make-fs.pl:77
37416 "An alternative way to leave extra space but not make the output image any "
37417 "bigger is to use an alternative disk image format (instead of the default "
37418 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
37419 "image format (check your hypervisor supports this before using it). This "
37420 "allows you to choose a large I<--size> but the extra space won't actually be "
37421 "allocated in the image until you try to store something in it."
37425 #: ../tools/virt-make-fs.pl:85
37427 "Don't forget that you can also use local commands including L<resize2fs(8)> "
37428 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
37429 "to build another image from scratch."
37433 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
37434 #: ../tools/virt-make-fs.pl:142
37439 #: ../tools/virt-make-fs.pl:91
37442 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
37447 #: ../tools/virt-make-fs.pl:93
37448 msgid "FILESYSTEM TYPE"
37452 #: ../tools/virt-make-fs.pl:95
37454 "The default filesystem type is C<ext2>. Just about any filesystem type that "
37455 "libguestfs supports can be used (but I<not> read-only formats like "
37456 "ISO9660). Here are some of the more common choices:"
37460 #: ../tools/virt-make-fs.pl:101
37465 #: ../tools/virt-make-fs.pl:103
37467 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
37468 "you are not going to use the filesystem in a way that requires the journal, "
37469 "then this is just wasted overhead."
37473 #: ../tools/virt-make-fs.pl:107
37474 msgid "I<ntfs> or I<vfat>"
37478 #: ../tools/virt-make-fs.pl:109
37479 msgid "Useful if exporting data to a Windows guest."
37483 #: ../tools/virt-make-fs.pl:111
37485 "I<Note for vfat>: The tar archive or local directory must only contain files "
37486 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
37487 "program running within libguestfs is unable to change the ownership of non-"
37488 "root files, since vfat itself does not support this."
37492 #: ../tools/virt-make-fs.pl:116
37497 #: ../tools/virt-make-fs.pl:118
37499 "Lower overhead than C<ext2>, but certain limitations on filename length and "
37500 "total filesystem size."
37504 #: ../tools/virt-make-fs.pl:125
37507 " virt-make-fs --type=minix input minixfs.img\n"
37512 #: ../tools/virt-make-fs.pl:127
37513 msgid "TO PARTITION OR NOT TO PARTITION"
37517 #: ../tools/virt-make-fs.pl:129
37518 msgid "Optionally virt-make-fs can add a partition table to the output disk."
37522 #: ../tools/virt-make-fs.pl:131
37524 "Adding a partition can make the disk image more compatible with certain "
37525 "virtualized operating systems which don't expect to see a filesystem "
37526 "directly located on a block device (Linux doesn't care and will happily "
37527 "handle both types)."
37531 #: ../tools/virt-make-fs.pl:136
37533 "On the other hand, if you have a partition table then the output image is no "
37534 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
37535 "directly on a partitioned disk image. (However libguestfs tools such as "
37536 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
37540 #: ../tools/virt-make-fs.pl:144
37541 msgid "Add an MBR partition:"
37545 #: ../tools/virt-make-fs.pl:146
37548 " virt-make-fs --partition -- input disk.img\n"
37553 #: ../tools/virt-make-fs.pl:148
37555 "If the output disk image could be terabyte-sized or larger, it's better to "
37556 "use an EFI/GPT-compatible partition table:"
37560 #: ../tools/virt-make-fs.pl:151
37563 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
37568 #: ../tools/virt-make-fs.pl:179
37569 msgid "Enable debugging information."
37573 #: ../tools/virt-make-fs.pl:185
37574 msgid "B<--size=E<lt>NE<gt>>"
37578 #: ../tools/virt-make-fs.pl:187
37579 msgid "B<--size=+E<lt>NE<gt>>"
37583 #: ../tools/virt-make-fs.pl:189
37584 msgid "B<-s E<lt>NE<gt>>"
37588 #: ../tools/virt-make-fs.pl:191
37589 msgid "B<-s +E<lt>NE<gt>>"
37593 #: ../tools/virt-make-fs.pl:193
37595 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
37599 #: ../tools/virt-make-fs.pl:196
37601 "If this option is I<not> given, then the output image will be just large "
37602 "enough to contain all the files, with not much wasted space."
37606 #: ../tools/virt-make-fs.pl:199
37608 "To choose a fixed size output disk, specify an absolute number followed by b/"
37609 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37610 "Petabytes or Exabytes. This must be large enough to contain all the input "
37611 "files, else you will get an error."
37615 #: ../tools/virt-make-fs.pl:204
37617 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
37618 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37619 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
37620 "the input files, and (approximately) an extra 200 MB free space."
37624 #: ../tools/virt-make-fs.pl:210
37626 "Note that virt-make-fs estimates free space, and therefore will not produce "
37627 "filesystems containing precisely the free space requested. (It is much more "
37628 "expensive and time-consuming to produce a filesystem which has precisely the "
37629 "desired free space)."
37633 #: ../tools/virt-make-fs.pl:219
37634 msgid "B<--format=E<lt>fmtE<gt>>"
37638 #: ../tools/virt-make-fs.pl:221
37639 msgid "B<-F E<lt>fmtE<gt>>"
37643 #: ../tools/virt-make-fs.pl:223
37644 msgid "Choose the output disk image format."
37648 #: ../tools/virt-make-fs.pl:225
37649 msgid "The default is C<raw> (raw disk image)."
37653 #: ../tools/virt-make-fs.pl:227
37655 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
37656 "that would really make sense here is C<qcow2>."
37660 #: ../tools/virt-make-fs.pl:234
37661 msgid "B<--type=E<lt>fsE<gt>>"
37665 #: ../tools/virt-make-fs.pl:236
37666 msgid "B<-t E<lt>fsE<gt>>"
37670 #: ../tools/virt-make-fs.pl:238
37671 msgid "Choose the output filesystem type."
37675 #: ../tools/virt-make-fs.pl:240
37676 msgid "The default is C<ext2>."
37680 #: ../tools/virt-make-fs.pl:242
37682 "Any filesystem which is supported read-write by libguestfs can be used here."
37686 #: ../tools/virt-make-fs.pl:249
37687 msgid "B<--partition>"
37691 #: ../tools/virt-make-fs.pl:251
37692 msgid "B<--partition=E<lt>parttypeE<gt>>"
37696 #: ../tools/virt-make-fs.pl:253
37698 "If specified, this flag adds an MBR partition table to the output disk image."
37702 #: ../tools/virt-make-fs.pl:256
37704 "You can change the partition table type, eg. I<--partition=gpt> for large "
37709 #: ../tools/virt-make-fs.pl:259
37711 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
37712 "might consider the next parameter to be the partition type. For example:"
37716 #: ../tools/virt-make-fs.pl:263
37719 " virt-make-fs --partition input.tar ...\n"
37724 #: ../tools/virt-make-fs.pl:265
37726 "would cause virt-make-fs to think you wanted to use a partition type of "
37727 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
37728 "dash) between options and the input file argument:"
37732 #: ../tools/virt-make-fs.pl:269
37735 " virt-make-fs --partition -- input.tar ...\n"
37740 #: ../tools/virt-make-fs.pl:541
37742 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
37743 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
37744 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
37748 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
37750 "When reporting bugs, please enable debugging and capture the I<complete> "
37755 #: ../tools/virt-make-fs.pl:558
37758 " export LIBGUESTFS_DEBUG=1\n"
37759 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
37764 #: ../tools/virt-make-fs.pl:561
37766 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
37771 #: ../tools/virt-tar.pl:33
37772 msgid "virt-tar - Extract or upload files to a virtual machine"
37776 #: ../tools/virt-tar.pl:37
37779 " virt-tar [--options] -x domname directory tarball\n"
37784 #: ../tools/virt-tar.pl:39
37787 " virt-tar [--options] -u domname tarball directory\n"
37792 #: ../tools/virt-tar.pl:41
37795 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
37800 #: ../tools/virt-tar.pl:43
37803 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
37808 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
37813 #: ../tools/virt-tar.pl:47
37815 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
37816 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
37820 #: ../tools/virt-tar.pl:52
37821 msgid "Download C</home> from the VM into a local tarball:"
37825 #: ../tools/virt-tar.pl:54
37828 " virt-tar -x domname /home home.tar\n"
37833 #: ../tools/virt-tar.pl:56
37836 " virt-tar -zx domname /home home.tar.gz\n"
37841 #: ../tools/virt-tar.pl:58
37842 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
37846 #: ../tools/virt-tar.pl:60
37849 " virt-tar -u domname uploadstuff.tar /tmp\n"
37854 #: ../tools/virt-tar.pl:62
37857 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
37862 #: ../tools/virt-tar.pl:66
37864 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
37865 "virtual machines. If you do this, you risk disk corruption in the VM. "
37866 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
37870 #: ../tools/virt-tar.pl:71
37872 "You can use I<-x> (extract) on live virtual machines, but you might get "
37873 "inconsistent results or errors if there is filesystem activity inside the "
37874 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
37875 "work, but the only way to guarantee consistent results is if the virtual "
37876 "machine is shut down."
37880 #: ../tools/virt-tar.pl:79
37882 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
37883 "parts of a guest filesystem. There are many possibilities: making backups, "
37884 "uploading data files, snooping on guest activity, fixing or customizing "
37889 #: ../tools/virt-tar.pl:84
37891 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
37892 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
37893 "should look at the L<guestfish(1)> tool."
37897 #: ../tools/virt-tar.pl:88
37899 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
37900 "its contents (recursively) from the virtual machine into a local tarball. "
37901 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
37902 "virtual machine. You cannot use these two options together."
37906 #: ../tools/virt-tar.pl:94
37908 "In addition, you may need to use the I<-z> (gZip) option to enable "
37909 "compression. When uploading, you have to specify I<-z> if the upload file "
37910 "is compressed because virt-tar won't detect this on its own."
37914 #: ../tools/virt-tar.pl:98
37916 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
37917 "example it cannot do PKZip files or bzip2 compression. If you want that "
37918 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
37919 "the L<libguestfs(3)> API)."
37923 #: ../tools/virt-tar.pl:160
37924 msgid "B<--extract>"
37928 #: ../tools/virt-tar.pl:162
37929 msgid "B<--download>"
37933 #: ../tools/virt-tar.pl:164
37938 #: ../tools/virt-tar.pl:166
37939 msgid "B<--upload>"
37943 #: ../tools/virt-tar.pl:168
37945 "Use I<-x> to extract (download) a directory from a virtual machine to a "
37950 #: ../tools/virt-tar.pl:171
37952 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
37953 "Please read the L</WARNING> section above before using this option."
37957 #: ../tools/virt-tar.pl:175
37958 msgid "You must specify exactly one of these options."
37962 #: ../tools/virt-tar.pl:181
37967 #: ../tools/virt-tar.pl:183
37972 #: ../tools/virt-tar.pl:185
37973 msgid "Specify that the input or output tarball is gzip-compressed."
37977 #: ../tools/virt-tar.pl:298
37979 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
37980 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
37981 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
37986 #: ../tools/virt-win-reg.pl:37
37988 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
37992 #: ../tools/virt-win-reg.pl:41
37995 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
38000 #: ../tools/virt-win-reg.pl:43
38003 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
38008 #: ../tools/virt-win-reg.pl:45
38011 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
38016 #: ../tools/virt-win-reg.pl:47
38019 " virt-win-reg --merge domname [input.reg ...]\n"
38024 #: ../tools/virt-win-reg.pl:49
38027 " virt-win-reg [--options] disk.img ... # instead of domname\n"
38032 #: ../tools/virt-win-reg.pl:53
38034 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
38035 "virtual machines. If you do this, you I<will> get irreversible disk "
38036 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
38037 "but doesn't catch all cases."
38041 #: ../tools/virt-win-reg.pl:58
38043 "Modifying the Windows Registry is an inherently risky operation. The format "
38044 "is deliberately obscure and undocumented, and Registry changes can leave the "
38045 "system unbootable. Therefore when using the I<--merge> option, make sure "
38046 "you have a reliable backup first."
38050 #: ../tools/virt-win-reg.pl:65
38052 "This program can export and merge Windows Registry entries from a Windows "
38057 #: ../tools/virt-win-reg.pl:68
38059 "The first parameter is the libvirt guest name or the raw disk image of a "
38064 #: ../tools/virt-win-reg.pl:71
38066 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
38067 "exported (recursively). For example:"
38071 #: ../tools/virt-win-reg.pl:74
38074 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
38079 #: ../tools/virt-win-reg.pl:76
38081 "You can also display single values from within registry keys, for example:"
38085 #: ../tools/virt-win-reg.pl:79
38088 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
38089 " $ virt-win-reg Windows7 $cvkey ProductName\n"
38090 " Windows 7 Enterprise\n"
38095 #: ../tools/virt-win-reg.pl:83
38097 "With I<--merge>, you can merge a textual regedit file into the Windows "
38102 #: ../tools/virt-win-reg.pl:86
38105 " $ virt-win-reg --merge Windows7 changes.reg\n"
38110 #: ../tools/virt-win-reg.pl:90
38112 "This program is only meant for simple access to the registry. If you want "
38113 "to do complicated things with the registry, we suggest you download the "
38114 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
38115 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
38116 "L<hivexregedit(1)>."
38120 #: ../tools/virt-win-reg.pl:159
38125 #: ../tools/virt-win-reg.pl:161
38127 "In merge mode, this merges a textual regedit file into the Windows Registry "
38128 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
38129 "displays or exports Registry entries instead."
38133 #: ../tools/virt-win-reg.pl:165
38135 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
38136 "result in disk corruption. However exporting (without this flag) is always "
38141 #: ../tools/virt-win-reg.pl:173
38142 msgid "B<--encoding> UTF-16LE|ASCII"
38146 #: ../tools/virt-win-reg.pl:175
38148 "When merging (only), you may need to specify the encoding for strings to be "
38149 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
38150 "(3)/ENCODING STRINGS>."
38154 #: ../tools/virt-win-reg.pl:179
38156 "The default is to use UTF-16LE, which should work with recent versions of "
38161 #: ../tools/virt-win-reg.pl:186
38162 msgid "B<--unsafe-printable-strings>"
38166 #: ../tools/virt-win-reg.pl:188
38168 "When exporting (only), assume strings are UTF-16LE and print them as strings "
38169 "instead of hex sequences. Remove the final zero codepoint from strings if "
38174 #: ../tools/virt-win-reg.pl:192
38176 "This is unsafe and does not preserve the fidelity of strings in the original "
38177 "Registry for various reasons:"
38181 #: ../tools/virt-win-reg.pl:199
38183 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
38184 "other encodings will be corrupted by this transformation."
38188 #: ../tools/virt-win-reg.pl:204
38190 "Assumes that everything which has type 1 or 2 is really a string and that "
38191 "everything else is not a string, but the type field in real Registries is "
38196 #: ../tools/virt-win-reg.pl:210
38198 "Loses information about whether a zero codepoint followed the string in the "
38203 #: ../tools/virt-win-reg.pl:215
38205 "This all happens because the Registry itself contains no information about "
38206 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
38210 #: ../tools/virt-win-reg.pl:219
38212 "You should only use this option for quick hacking and debugging of the "
38213 "Registry contents, and I<never> use it if the output is going to be passed "
38214 "into another program or stored in another Registry."
38218 #: ../tools/virt-win-reg.pl:556
38219 msgid "SUPPORTED SYSTEMS"
38223 #: ../tools/virt-win-reg.pl:558
38225 "The program currently supports Windows NT-derived guests starting with "
38226 "Windows XP through to at least Windows 7."
38230 #: ../tools/virt-win-reg.pl:561
38231 msgid "The following Registry keys are supported:"
38235 #: ../tools/virt-win-reg.pl:565
38236 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
38240 #: ../tools/virt-win-reg.pl:567
38241 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
38245 #: ../tools/virt-win-reg.pl:569
38246 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
38250 #: ../tools/virt-win-reg.pl:571
38251 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
38255 #: ../tools/virt-win-reg.pl:573
38256 msgid "C<HKEY_USERS\\.DEFAULT>"
38260 #: ../tools/virt-win-reg.pl:575
38261 msgid "C<HKEY_USERS\\I<SID>>"
38265 #: ../tools/virt-win-reg.pl:577
38266 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
38270 #: ../tools/virt-win-reg.pl:579
38271 msgid "C<HKEY_USERS\\I<username>>"
38275 #: ../tools/virt-win-reg.pl:581
38277 "where I<username> is a local user name (this is a libguestfs extension)."
38281 #: ../tools/virt-win-reg.pl:585
38283 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
38288 #: ../tools/virt-win-reg.pl:588
38290 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
38291 "supported (there is no \"current user\")."
38295 #: ../tools/virt-win-reg.pl:591
38300 #: ../tools/virt-win-reg.pl:593
38302 "C<virt-win-reg> expects that regedit files have already been reencoded in "
38303 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
38304 "style line endings. Since Windows regedit files are often in UTF-16LE with "
38305 "Windows-style line endings, you may need to reencode the whole file before "
38306 "or after processing."
38310 #: ../tools/virt-win-reg.pl:599
38312 "To reencode a file from Windows format to Linux (before processing it with "
38313 "the I<--merge> option), you would do something like this:"
38317 #: ../tools/virt-win-reg.pl:602
38320 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
38325 #: ../tools/virt-win-reg.pl:604
38327 "To go in the opposite direction, after exporting and before sending the file "
38328 "to a Windows user, do something like this:"
38332 #: ../tools/virt-win-reg.pl:607
38335 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
38340 #: ../tools/virt-win-reg.pl:609
38341 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
38345 #: ../tools/virt-win-reg.pl:611
38347 "If you are unsure about the current encoding, use the L<file(1)> command. "
38348 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
38349 "style (CRLF) line endings, like this:"
38353 #: ../tools/virt-win-reg.pl:615
38356 " $ file software.reg\n"
38357 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
38358 " with CRLF line terminators\n"
38363 #: ../tools/virt-win-reg.pl:619
38364 msgid "This file would need conversion before you could I<--merge> it."
38368 #: ../tools/virt-win-reg.pl:621
38369 msgid "CurrentControlSet etc."
38373 #: ../tools/virt-win-reg.pl:623
38375 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
38376 "Registry at the level of the hive file, and therefore you cannot modify "
38381 #: ../tools/virt-win-reg.pl:627
38383 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
38384 "circumstances it might refer to another control set. The way to find out is "
38385 "to look at the C<HKLM\\SYSTEM\\Select> key:"
38389 #: ../tools/virt-win-reg.pl:631
38392 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
38393 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
38394 " \"Current\"=dword:00000001\n"
38395 " \"Default\"=dword:00000001\n"
38396 " \"Failed\"=dword:00000000\n"
38397 " \"LastKnownGood\"=dword:00000002\n"
38402 #: ../tools/virt-win-reg.pl:638
38403 msgid "\"Current\" is the one which Windows will choose when it boots."
38407 #: ../tools/virt-win-reg.pl:640
38409 "Similarly, other C<Current...> keys in the path may need to be replaced."
38413 #: ../tools/virt-win-reg.pl:643
38414 msgid "WINDOWS TIPS"
38418 #: ../tools/virt-win-reg.pl:645
38420 "Note that some of these tips modify the guest disk image. The guest I<must> "
38421 "be shut off, else you will get disk corruption."
38425 #: ../tools/virt-win-reg.pl:648
38426 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
38430 #: ../tools/virt-win-reg.pl:650
38432 "Prepare a DOS batch script, VBScript or executable. Upload this using "
38433 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
38434 "is uploaded into C<C:\\>:"
38438 #: ../tools/virt-win-reg.pl:654
38441 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
38446 #: ../tools/virt-win-reg.pl:656
38447 msgid "Prepare a regedit file containing the registry change:"
38451 #: ../tools/virt-win-reg.pl:658
38454 " cat > test.reg <<'EOF'\n"
38455 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
38456 " \"Test\"=\"c:\\\\test.bat\"\n"
38462 #: ../tools/virt-win-reg.pl:663
38464 "In this example we use the key C<RunOnce> which means that the script will "
38465 "run precisely once when the first user logs in. If you want it to run every "
38466 "time a user logs in, replace C<RunOnce> with C<Run>."
38470 #: ../tools/virt-win-reg.pl:667
38471 msgid "Now update the registry:"
38475 #: ../tools/virt-win-reg.pl:669
38478 " virt-win-reg --merge WindowsGuest test.reg\n"
38483 #: ../tools/virt-win-reg.pl:671
38484 msgid "INSTALLING A SERVICE"
38488 #: ../tools/virt-win-reg.pl:673
38490 "This section assumes you are familiar with Windows services, and you either "
38491 "have a program which handles the Windows Service Control Protocol directly "
38492 "or you want to run any program using a service wrapper like SrvAny or the "
38497 #: ../tools/virt-win-reg.pl:678
38499 "First upload the program and optionally the service wrapper. In this case "
38500 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
38504 #: ../tools/virt-win-reg.pl:682
38507 " guestfish -i -d WindowsGuest <<EOF\n"
38508 " upload rhsrvany.exe /rhsrvany.exe\n"
38509 " upload test.exe /test.exe\n"
38515 #: ../tools/virt-win-reg.pl:687
38517 "Prepare a regedit file containing the registry changes. In this example, "
38518 "the first registry change is needed for the service itself or the service "
38519 "wrapper (if used). The second registry change is only needed because I am "
38520 "using the RHSrvAny service wrapper."
38524 #: ../tools/virt-win-reg.pl:692
38527 " cat > service.reg <<'EOF'\n"
38528 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
38529 " \"Type\"=dword:00000010\n"
38530 " \"Start\"=dword:00000002\n"
38531 " \"ErrorControl\"=dword:00000001\n"
38532 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
38533 " \"DisplayName\"=\"RHSrvAny\"\n"
38534 " \"ObjectName\"=\"NetworkService\"\n"
38539 #: ../tools/virt-win-reg.pl:701
38542 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
38543 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
38544 " \"PWD\"=\"c:\\\\Temp\"\n"
38550 #: ../tools/virt-win-reg.pl:712
38552 "For use of C<ControlSet001> see the section above in this manual page. You "
38553 "may need to adjust this according to the control set that is in use by the "
38558 #: ../tools/virt-win-reg.pl:718
38560 "C<\"ObjectName\"> controls the privileges that the service will have. An "
38561 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
38562 "privileged account."
38566 #: ../tools/virt-win-reg.pl:724
38568 "For the meaning of the magic numbers, see this Microsoft KB article: "
38569 "L<http://support.microsoft.com/kb/103000>."
38573 #: ../tools/virt-win-reg.pl:729
38574 msgid "Update the registry:"
38578 #: ../tools/virt-win-reg.pl:731
38581 " virt-win-reg --merge WindowsGuest service.reg\n"
38586 #: ../tools/virt-win-reg.pl:735
38588 "Be careful when passing parameters containing C<\\> (backslash) in the "
38589 "shell. Usually you will have to use 'single quotes' or double backslashes "
38590 "(but not both) to protect them from the shell."
38594 #: ../tools/virt-win-reg.pl:739
38595 msgid "Paths and value names are case-insensitive."
38599 #: ../tools/virt-win-reg.pl:748
38601 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
38602 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
38603 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38607 #: ../tools/virt-win-reg.pl:766
38610 " export LIBGUESTFS_DEBUG=1\n"
38611 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
38616 #: ../tools/virt-win-reg.pl:769
38618 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."