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-10-19 19:11+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:1051 ../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:92
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:160
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:102
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:135 ../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:142 ../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:144
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:146
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:2768
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:172 ../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:174 ../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:266
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:268
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:272
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:274
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:287
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:568 ../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:570 ../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:1114 ../fuse/guestmount.pod:312
668 #: ../inspector/virt-inspector.pod:375 ../resize/virt-resize.pod:575
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:314 ../inspector/virt-inspector.pod:377
677 #: ../resize/virt-resize.pod:577
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:1268 ../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:317
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:580 ../ruby/examples/guestfs-ruby.pod:36
693 #: ../src/guestfs.pod:3146 ../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:601
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:603 ../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:1297 ../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:332
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:605 ../ruby/examples/guestfs-ruby.pod:51
738 #: ../src/guestfs.pod:3223 ../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:607
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:1302 ../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:337
757 #: ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:300
758 #: ../resize/virt-resize.pod:609 ../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:1307 ../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:342
775 #: ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:305
776 #: ../resize/virt-resize.pod:614 ../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:1312 ../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:347
793 #: ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:310
794 #: ../resize/virt-resize.pod:619 ../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:4210
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:164
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:1555
2408 #: ../fish/guestfish-actions.pod:1562 ../fish/guestfish-actions.pod:1569
2409 #: ../fish/guestfish-actions.pod:1960 ../fish/guestfish-actions.pod:1966
2410 #: ../fish/guestfish-actions.pod:1974 ../fish/guestfish-actions.pod:1981
2411 #: ../fish/guestfish-actions.pod:1988 ../fish/guestfish.pod:445
2412 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
2413 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393
2414 #: ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:282
2415 #: ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295
2416 #: ../resize/virt-resize.pod:301 ../src/guestfs-actions.pod:15
2417 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:588
2418 #: ../src/guestfs-actions.pod:596 ../src/guestfs-actions.pod:603
2419 #: ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:1667
2420 #: ../src/guestfs-actions.pod:1671 ../src/guestfs-actions.pod:1675
2421 #: ../src/guestfs-actions.pod:1679 ../src/guestfs-actions.pod:1687
2422 #: ../src/guestfs-actions.pod:1691 ../src/guestfs-actions.pod:1695
2423 #: ../src/guestfs-actions.pod:1705 ../src/guestfs-actions.pod:1709
2424 #: ../src/guestfs-actions.pod:1713 ../src/guestfs-actions.pod:1851
2425 #: ../src/guestfs-actions.pod:1855 ../src/guestfs-actions.pod:1860
2426 #: ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:1926
2427 #: ../src/guestfs-actions.pod:1930 ../src/guestfs-actions.pod:1935
2428 #: ../src/guestfs-actions.pod:2339 ../src/guestfs-actions.pod:2346
2429 #: ../src/guestfs-actions.pod:2353 ../src/guestfs-actions.pod:2886
2430 #: ../src/guestfs-actions.pod:2892 ../src/guestfs-actions.pod:2900
2431 #: ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2914
2432 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398
2433 #: ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411
2434 #: ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1087
2435 #: ../src/guestfs.pod:1091 ../src/guestfs.pod:1095 ../src/guestfs.pod:1100
2436 #: ../src/guestfs.pod:1108 ../src/guestfs.pod:1127 ../src/guestfs.pod:1135
2437 #: ../src/guestfs.pod:1157 ../src/guestfs.pod:1161 ../src/guestfs.pod:1165
2438 #: ../src/guestfs.pod:1169 ../src/guestfs.pod:1173 ../src/guestfs.pod:1177
2439 #: ../src/guestfs.pod:1666 ../src/guestfs.pod:1671 ../src/guestfs.pod:1675
2440 #: ../src/guestfs.pod:1777 ../src/guestfs.pod:1782 ../src/guestfs.pod:1786
2441 #: ../src/guestfs.pod:1796 ../src/guestfs.pod:2070 ../src/guestfs.pod:2075
2442 #: ../src/guestfs.pod:2081 ../src/guestfs.pod:2089 ../src/guestfs.pod:2536
2443 #: ../src/guestfs.pod:2542 ../src/guestfs.pod:2547 ../src/guestfs.pod:2553
2444 #: ../src/guestfs.pod:2938 ../src/guestfs.pod:2943 ../src/guestfs.pod:2947
2445 #: ../src/guestfs.pod:2951 ../src/guestfs.pod:2955 ../src/guestfs.pod:2969
2446 #: ../src/guestfs.pod:2974 ../src/guestfs.pod:3200 ../src/guestfs.pod:3204
2447 #: ../src/guestfs.pod:3208 ../src/guestfs.pod:3212
2448 #: ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202
2449 #: ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:710
2450 #: ../tools/virt-win-reg.pl:716 ../tools/virt-win-reg.pl:722
2455 #: ../df/virt-df.pod:150
2457 "If you think an untrusted guest might actively try to exploit the libguestfs "
2458 "appliance kernel, then this prevents one guest from interfering with the "
2459 "stats printed for another guest."
2463 #: ../df/virt-df.pod:156
2465 "If the kernel has a bug which stops it from accessing a filesystem in one "
2466 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
2467 "and report stats for further guests."
2471 #: ../df/virt-df.pod:165
2473 "Print UUIDs instead of names. This is useful for following a guest even "
2474 "when the guest is migrated or renamed, or when two guests happen to have the "
2479 #: ../df/virt-df.pod:169
2481 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
2482 "images, we still print the disk image name even when this option is "
2487 #: ../df/virt-df.pod:229
2489 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
2494 #: ../edit/virt-edit.pod:5
2495 msgid "virt-edit - Edit a file in a virtual machine"
2499 #: ../edit/virt-edit.pod:9
2502 " virt-edit [--options] -d domname file [file ...]\n"
2507 #: ../edit/virt-edit.pod:11
2510 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
2515 #: ../edit/virt-edit.pod:13
2518 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
2523 #: ../edit/virt-edit.pod:17
2526 " virt-edit domname file\n"
2531 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
2534 " virt-edit disk.img [disk.img ...] file\n"
2539 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
2540 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
2541 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
2542 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
2547 #: ../edit/virt-edit.pod:23
2549 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
2550 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
2551 "doing this, but doesn't catch all cases."
2555 #: ../edit/virt-edit.pod:29
2557 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
2558 "exists in the named virtual machine (or disk image)."
2562 #: ../edit/virt-edit.pod:32
2564 "Multiple filenames can be given, in which case they are each edited in "
2565 "turn. Each filename must be a full path, starting at the root directory "
2566 "(starting with '/')."
2570 #: ../edit/virt-edit.pod:36
2571 msgid "If you want to just view a file, use L<virt-cat(1)>."
2575 #: ../edit/virt-edit.pod:38
2577 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
2578 "USING GUESTFISH> below)."
2582 #: ../edit/virt-edit.pod:41
2584 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
2585 "that and much more."
2589 #: ../edit/virt-edit.pod:46
2590 msgid "Edit the named files interactively:"
2594 #: ../edit/virt-edit.pod:48
2597 " virt-edit -d mydomain /boot/grub/grub.conf\n"
2602 #: ../edit/virt-edit.pod:50
2605 " virt-edit -d mydomain /etc/passwd\n"
2610 #: ../edit/virt-edit.pod:52
2611 msgid "For Windows guests, some Windows paths are understood:"
2615 #: ../edit/virt-edit.pod:54
2618 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
2623 #: ../edit/virt-edit.pod:56
2625 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
2626 "INTERACTIVE EDITING> below). To change the init default level to 5:"
2630 #: ../edit/virt-edit.pod:60
2633 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
2638 #: ../edit/virt-edit.pod:81
2639 msgid "B<-b> extension"
2643 #: ../edit/virt-edit.pod:83
2644 msgid "B<--backup> extension"
2648 #: ../edit/virt-edit.pod:85
2650 "Create a backup of the original file I<in the guest disk image>. The backup "
2651 "has the original filename with C<extension> added."
2655 #: ../edit/virt-edit.pod:88
2657 "Usually the first character of C<extension> would be a dot C<.> so you would "
2662 #: ../edit/virt-edit.pod:91
2665 " virt-edit -b .orig [etc]\n"
2670 #: ../edit/virt-edit.pod:93
2671 msgid "By default, no backup file is made."
2675 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
2676 #: ../fuse/guestmount.pod:105 ../inspector/virt-inspector.pod:74
2677 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
2678 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
2683 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
2684 #: ../fuse/guestmount.pod:107 ../inspector/virt-inspector.pod:76
2685 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
2686 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
2687 msgid "B<--connect URI>"
2691 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
2692 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
2693 #: ../tools/virt-win-reg.pl:135
2695 "If you specify guest block devices directly, then libvirt is not used at all."
2699 #: ../edit/virt-edit.pod:114
2701 "When prompting for keys and passphrases, virt-edit normally turns echoing "
2702 "off so you cannot see what you are typing. If you are not worried about "
2703 "Tempest attacks and there is no one else in the room you can specify this "
2704 "flag to see what you are typing."
2708 #: ../edit/virt-edit.pod:119
2713 #: ../edit/virt-edit.pod:121
2714 msgid "B<--expr> EXPR"
2718 #: ../edit/virt-edit.pod:123
2720 "Instead of launching the external editor, non-interactively apply the Perl "
2721 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
2726 #: ../edit/virt-edit.pod:127
2728 "Be careful to properly quote the expression to prevent it from being altered "
2733 #: ../edit/virt-edit.pod:130
2734 msgid "Note that this option is only available when Perl 5 is installed."
2738 #: ../edit/virt-edit.pod:132
2739 msgid "B<--format> raw|qcow2|..."
2743 #: ../edit/virt-edit.pod:143
2746 " virt-edit --format=raw -a disk.img file\n"
2751 #: ../edit/virt-edit.pod:147
2754 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
2759 #: ../edit/virt-edit.pod:181
2760 msgid "Previous versions of virt-edit allowed you to write either:"
2764 #: ../edit/virt-edit.pod:187
2767 " virt-edit guestname file\n"
2772 #: ../edit/virt-edit.pod:195
2773 msgid "NON-INTERACTIVE EDITING"
2777 #: ../edit/virt-edit.pod:197
2779 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
2780 "administrator can interactively edit the file."
2784 #: ../edit/virt-edit.pod:200
2786 "There are two ways also to use C<virt-edit> from scripts in order to make "
2787 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
2788 "like this, it's less error-prone to write scripts directly using the "
2789 "libguestfs API and Augeas for configuration file editing.)"
2793 #: ../edit/virt-edit.pod:206
2795 "The first method is to temporarily set C<$EDITOR> to any script or program "
2796 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
2797 "update C<tmpfile> in place however it likes."
2801 #: ../edit/virt-edit.pod:210
2803 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
2804 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
2805 "instances of C<foo> with C<bar> in a file:"
2809 #: ../edit/virt-edit.pod:214
2812 " virt-edit -d domname filename -e 's/foo/bar/'\n"
2817 #: ../edit/virt-edit.pod:216
2819 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
2820 "For example to delete root's password you could do:"
2824 #: ../edit/virt-edit.pod:219
2827 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
2832 #: ../edit/virt-edit.pod:221
2834 "What really happens is that the snippet is evaluated as a Perl expression "
2835 "for each line of the file. The line, including the final C<\\n>, is passed "
2836 "in C<$_> and the expression should update C<$_> or leave it unchanged."
2840 #: ../edit/virt-edit.pod:226
2842 "To delete a line, set C<$_> to the empty string. For example, to delete the "
2843 "C<apache> user account from the password file you can do:"
2847 #: ../edit/virt-edit.pod:229
2850 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
2855 #: ../edit/virt-edit.pod:231
2857 "To insert a line, prepend or append it to C<$_>. However appending lines to "
2858 "the end of the file is rather difficult this way since there is no concept "
2859 "of \"last line of the file\" - your expression just doesn't get called "
2860 "again. You might want to use the first method (setting C<$EDITOR>) if you "
2865 #: ../edit/virt-edit.pod:237
2867 "The variable C<$lineno> contains the current line number. As is "
2868 "traditional, the first line in the file is number C<1>."
2872 #: ../edit/virt-edit.pod:240
2874 "The return value from the expression is ignored, but the expression may call "
2875 "C<die> in order to abort the whole program, leaving the original file "
2880 #: ../edit/virt-edit.pod:244
2882 "Remember when matching the end of a line that C<$_> may contain the final C<"
2883 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
2884 "newline then neither of these. Thus to match or substitute some text at the "
2885 "end of a line, use this regular expression:"
2889 #: ../edit/virt-edit.pod:249
2892 " /some text(\\r?\\n)?$/\n"
2897 #: ../edit/virt-edit.pod:251
2899 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
2900 "$_> itself (since that would remove all newlines from the file):"
2904 #: ../edit/virt-edit.pod:255
2907 " my $m = $_; chomp $m; $m =~ /some text$/\n"
2912 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
2913 msgid "WINDOWS PATHS"
2917 #: ../edit/virt-edit.pod:259
2919 "C<virt-edit> has a limited ability to understand Windows drive letters and "
2920 "paths (eg. C<E:\\foo\\bar.txt>)."
2924 #: ../edit/virt-edit.pod:262
2925 msgid "If and only if the guest is running Windows then:"
2929 #: ../edit/virt-edit.pod:268
2931 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
2932 "to the correct filesystem."
2936 #: ../edit/virt-edit.pod:273
2938 "Any backslash (C<\\>) characters in the path are replaced with forward "
2939 "slashes so that libguestfs can process it."
2943 #: ../edit/virt-edit.pod:278
2945 "The path is resolved case insensitively to locate the file that should be "
2950 #: ../edit/virt-edit.pod:283
2951 msgid "There are some known shortcomings:"
2955 #: ../edit/virt-edit.pod:289
2956 msgid "Some NTFS symbolic links may not be followed correctly."
2960 #: ../edit/virt-edit.pod:293
2961 msgid "NTFS junction points that cross filesystems are not followed."
2965 #: ../edit/virt-edit.pod:299
2967 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
2968 "C<virt-edit> doesn't work."
2972 #: ../edit/virt-edit.pod:302
2973 msgid "Using C<virt-edit> is approximately equivalent to doing:"
2977 #: ../edit/virt-edit.pod:304
2980 " guestfish --rw -i -d domname edit /file\n"
2985 #: ../edit/virt-edit.pod:306
2987 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
2992 #: ../edit/virt-edit.pod:309
2994 "The command above uses libguestfs's guest inspection feature and so does not "
2995 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
2996 "disk images that don't contain guests. To edit a file on a disk image "
3001 #: ../edit/virt-edit.pod:314
3004 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
3009 #: ../edit/virt-edit.pod:316
3011 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
3012 "the disk image to edit, and C</file> is the full path to the file."
3016 #: ../edit/virt-edit.pod:320
3018 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
3019 "C<write> or C<upload> instead:"
3023 #: ../edit/virt-edit.pod:323
3026 " guestfish --rw -i -d domname touch /newfile\n"
3031 #: ../edit/virt-edit.pod:325
3034 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
3039 #: ../edit/virt-edit.pod:327
3042 " guestfish --rw -i -d domname upload localfile /newfile\n"
3047 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119
3048 #: ../rescue/virt-rescue.pod:257 ../src/guestfs.pod:3085
3049 #: ../test-tool/libguestfs-test-tool.pod:95
3050 msgid "ENVIRONMENT VARIABLES"
3054 #: ../edit/virt-edit.pod:333
3059 #: ../edit/virt-edit.pod:335
3061 "If set, this string is used as the editor. It may contain arguments, eg. C<"
3066 #: ../edit/virt-edit.pod:338
3067 msgid "If not set, C<vi> is used."
3071 #: ../edit/virt-edit.pod:356
3073 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
3074 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
3075 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
3079 #: ../examples/guestfs-examples.pod:5
3080 msgid "guestfs-examples - Examples of using libguestfs from C"
3084 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
3087 " #include <guestfs.h>\n"
3092 #: ../examples/guestfs-examples.pod:11
3095 " guestfs_h *g = guestfs_create ();\n"
3096 " guestfs_add_drive_ro (g, \"disk.img\");\n"
3097 " guestfs_launch (g);\n"
3102 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
3105 " cc prog.c -o prog -lguestfs\n"
3107 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
3112 #: ../examples/guestfs-examples.pod:21
3114 "This manual page contains examples of calling libguestfs from the C "
3115 "programming language. If you are not familiar with using libguestfs, you "
3116 "also need to read L<guestfs(3)>."
3120 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
3121 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
3122 #: ../python/examples/guestfs-python.pod:34
3123 #: ../ruby/examples/guestfs-ruby.pod:28
3124 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
3128 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
3129 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
3130 #: ../python/examples/guestfs-python.pod:36
3131 #: ../ruby/examples/guestfs-ruby.pod:30
3136 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
3137 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
3138 #: ../python/examples/guestfs-python.pod:38
3139 #: ../ruby/examples/guestfs-ruby.pod:32
3140 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
3144 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
3145 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
3146 #: ../python/examples/guestfs-python.pod:40
3147 #: ../ruby/examples/guestfs-ruby.pod:34
3152 #: ../examples/guestfs-examples.pod:35
3154 "L<guestfs(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
3155 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
3160 #: ../examples/guestfs-examples.pod:44 ../examples/guestfs-recipes.pod:396
3161 #: ../fish/guestfish.pod:1293 ../fish/virt-copy-in.pod:60
3162 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
3163 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:328
3164 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:57
3165 #: ../ocaml/examples/guestfs-ocaml.pod:90 ../perl/examples/guestfs-perl.pod:51
3166 #: ../python/examples/guestfs-python.pod:53
3167 #: ../ruby/examples/guestfs-ruby.pod:47 ../src/guestfs.pod:3219
3168 #: ../test-tool/libguestfs-test-tool.pod:106
3173 #: ../examples/guestfs-examples.pod:46 ../examples/guestfs-recipes.pod:398
3174 #: ../fish/guestfish.pod:1295 ../fish/virt-copy-in.pod:62
3175 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
3176 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:330
3177 #: ../java/examples/guestfs-java.pod:59 ../ocaml/examples/guestfs-ocaml.pod:92
3178 #: ../perl/examples/guestfs-perl.pod:53
3179 #: ../python/examples/guestfs-python.pod:55
3180 #: ../ruby/examples/guestfs-ruby.pod:49 ../src/guestfs.pod:3221
3181 #: ../test-tool/libguestfs-test-tool.pod:108
3182 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3186 #: ../examples/guestfs-examples.pod:50 ../ocaml/examples/guestfs-ocaml.pod:96
3187 #: ../python/examples/guestfs-python.pod:59
3188 #: ../ruby/examples/guestfs-ruby.pod:53
3189 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
3193 #: ../examples/guestfs-examples.pod:52 ../examples/guestfs-recipes.pod:404
3194 #: ../java/examples/guestfs-java.pod:65 ../ocaml/examples/guestfs-ocaml.pod:98
3195 #: ../perl/examples/guestfs-perl.pod:59
3196 #: ../python/examples/guestfs-python.pod:61
3197 #: ../ruby/examples/guestfs-ruby.pod:55
3199 "The examples in this manual page may be freely copied, modified and "
3200 "distributed without any restrictions."
3204 #: ../examples/guestfs-examples.pod:55 ../examples/guestfs-recipes.pod:407
3205 #: ../java/examples/guestfs-java.pod:68
3206 #: ../ocaml/examples/guestfs-ocaml.pod:101
3207 #: ../perl/examples/guestfs-perl.pod:62
3208 #: ../python/examples/guestfs-python.pod:64
3209 #: ../ruby/examples/guestfs-ruby.pod:58 ../src/guestfs.pod:3228
3211 "This library is free software; you can redistribute it and/or modify it "
3212 "under the terms of the GNU Lesser General Public License as published by the "
3213 "Free Software Foundation; either version 2 of the License, or (at your "
3214 "option) any later version."
3218 #: ../examples/guestfs-examples.pod:60 ../examples/guestfs-recipes.pod:412
3219 #: ../java/examples/guestfs-java.pod:73
3220 #: ../ocaml/examples/guestfs-ocaml.pod:106
3221 #: ../perl/examples/guestfs-perl.pod:67
3222 #: ../python/examples/guestfs-python.pod:69
3223 #: ../ruby/examples/guestfs-ruby.pod:63 ../src/guestfs.pod:3233
3225 "This library is distributed in the hope that it will be useful, but WITHOUT "
3226 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3227 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3232 #: ../examples/guestfs-examples.pod:65 ../examples/guestfs-recipes.pod:417
3233 #: ../java/examples/guestfs-java.pod:78
3234 #: ../ocaml/examples/guestfs-ocaml.pod:111
3235 #: ../perl/examples/guestfs-perl.pod:72
3236 #: ../python/examples/guestfs-python.pod:74
3237 #: ../ruby/examples/guestfs-ruby.pod:68 ../src/guestfs.pod:3238
3239 "You should have received a copy of the GNU Lesser General Public License "
3240 "along with this library; if not, write to the Free Software Foundation, "
3241 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3245 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
3250 #: ../examples/guestfs-recipes.pod:5
3252 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
3253 "here. The only way which works for both sorts of output is to just write "
3254 "the URL directly. Do NOT use L<...> for URLs."
3258 #: ../examples/guestfs-recipes.pod:9
3260 "We break with tradition here and don't use ALL CAPS for the section "
3261 "headings, as this makes them much easier to read."
3265 #: ../examples/guestfs-recipes.pod:16
3266 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
3270 #: ../examples/guestfs-recipes.pod:20
3272 "This page contains recipes for and links to things you can do using "
3273 "libguestfs, L<guestfish(1)> and the virt tools."
3277 #: ../examples/guestfs-recipes.pod:23
3278 msgid "Audit a virtual machine for setuid files"
3282 #: ../examples/guestfs-recipes.pod:25
3284 "The link below contains a small program which can be used to audit a Linux "
3285 "virtual machine to see what setuid and setgid files it contains."
3289 #: ../examples/guestfs-recipes.pod:28
3291 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
3296 #: ../examples/guestfs-recipes.pod:30
3297 msgid "Change the background image in a Windows XP VM"
3301 #: ../examples/guestfs-recipes.pod:32
3303 "The links below explain how to use L<guestfish(1)> to change the background "
3304 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
3305 "be substantially different for each version of Windows."
3309 #: ../examples/guestfs-recipes.pod:37
3311 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
3312 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
3316 #: ../examples/guestfs-recipes.pod:40
3317 msgid "Cloning a virtual machine (Linux)"
3321 #: ../examples/guestfs-recipes.pod:42
3323 "The guestfish technique described in the link below works well for most "
3324 "Linux VMs. Depending on the Linux distro you may need to change the paths "
3329 #: ../examples/guestfs-recipes.pod:46
3331 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
3336 #: ../examples/guestfs-recipes.pod:48
3338 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
3343 #: ../examples/guestfs-recipes.pod:51
3344 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
3348 #: ../examples/guestfs-recipes.pod:53
3349 msgid "Cloning a virtual machine (Windows)"
3353 #: ../examples/guestfs-recipes.pod:55
3355 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
3356 "straightforward. Currently there is code in the Aeolus Oz project which "
3357 "does this (using libguestfs). As part of our review of the virt-clone tool, "
3358 "we may add sysprepping ability."
3362 #: ../examples/guestfs-recipes.pod:60
3364 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
3365 "list/2011-May/msg00019.html"
3369 #: ../examples/guestfs-recipes.pod:63
3370 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
3374 #: ../examples/guestfs-recipes.pod:65
3375 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
3379 #: ../examples/guestfs-recipes.pod:67
3382 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
3387 #: ../examples/guestfs-recipes.pod:69
3388 msgid "To export just a subdirectory, eg. C</files>, do:"
3392 #: ../examples/guestfs-recipes.pod:71
3395 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3400 #: ../examples/guestfs-recipes.pod:73
3401 msgid "Create empty disk images"
3405 #: ../examples/guestfs-recipes.pod:75
3407 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3408 "The useful guide below explains the options available."
3412 #: ../examples/guestfs-recipes.pod:78
3414 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
3419 #: ../examples/guestfs-recipes.pod:80
3420 msgid "Dump raw filesystem content from inside a disk image or VM"
3424 #: ../examples/guestfs-recipes.pod:82
3426 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3427 "filesystem content from any filesystem in a disk image or a VM (even one "
3428 "which is encrypted or buried inside an LV):"
3432 #: ../examples/guestfs-recipes.pod:86
3435 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3440 #: ../examples/guestfs-recipes.pod:88
3443 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3448 #: ../examples/guestfs-recipes.pod:90
3449 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
3453 #: ../examples/guestfs-recipes.pod:92
3454 msgid "Edit grub configuration in a VM"
3458 #: ../examples/guestfs-recipes.pod:94
3459 msgid "You can use this to:"
3463 #: ../examples/guestfs-recipes.pod:100
3464 msgid "Fix a virtual machine that does not boot."
3468 #: ../examples/guestfs-recipes.pod:104
3469 msgid "Change which kernel is used to boot the VM."
3473 #: ../examples/guestfs-recipes.pod:108
3474 msgid "Change kernel command line options."
3478 #: ../examples/guestfs-recipes.pod:112
3479 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
3483 #: ../examples/guestfs-recipes.pod:114
3486 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
3491 #: ../examples/guestfs-recipes.pod:116
3493 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
3498 #: ../examples/guestfs-recipes.pod:119
3501 " virt-rescue -d BrokenGuest\n"
3506 #: ../examples/guestfs-recipes.pod:121
3507 msgid "Export any directory from a VM"
3511 #: ../examples/guestfs-recipes.pod:123
3513 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
3517 #: ../examples/guestfs-recipes.pod:126
3520 " virt-copy-out -d Guest /home .\n"
3525 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
3526 #: ../fish/guestfish-actions.pod:1292 ../fish/guestfish-actions.pod:1551
3527 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:11
3528 #: ../src/guestfs-actions.pod:1922 ../src/guestfs-actions.pod:2335
3529 #: ../src/guestfs-actions.pod:2882 ../src/guestfs.pod:1662
3530 #: ../tools/virt-win-reg.pl:706
3535 #: ../examples/guestfs-recipes.pod:134
3537 "The final dot of the command is not a printing error. It means we want to "
3538 "copy out to the current directory."
3542 #: ../examples/guestfs-recipes.pod:139
3543 msgid "This creates a directory called C<home> under the current directory."
3547 #: ../examples/guestfs-recipes.pod:143
3549 "If the guest is a Windows guest then you can use drive letters and "
3550 "backslashes, but you must prefix the path with C<win:> and quote it to "
3551 "protect it from the shell, like this:"
3555 #: ../examples/guestfs-recipes.pod:147
3558 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
3563 #: ../examples/guestfs-recipes.pod:149
3564 msgid "To get the output as a compressed tarball, do:"
3568 #: ../examples/guestfs-recipes.pod:151
3571 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
3576 #: ../examples/guestfs-recipes.pod:153
3578 "Although it sounds tempting, this is usually not a reliable way to get a "
3579 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
3580 "org/FAQ.html#backup"
3584 #: ../examples/guestfs-recipes.pod:157
3585 msgid "Find out which user is using the most space"
3589 #: ../examples/guestfs-recipes.pod:159
3591 "This simple script examines a Linux guest to find out which user is using "
3592 "the most space in their home directory:"
3596 #: ../examples/guestfs-recipes.pod:162
3604 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
3612 #: ../examples/guestfs-recipes.pod:166
3621 #: ../examples/guestfs-recipes.pod:169
3624 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
3629 #: ../examples/guestfs-recipes.pod:171
3632 " for d in $(guestfish --remote ls \"$dir\"); do\n"
3633 " echo -n \"$dir/$d\"\n"
3635 " guestfish --remote du \"$dir/$d\";\n"
3636 " done | sort -nr -k 2\n"
3641 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
3644 " guestfish --remote exit\n"
3649 #: ../examples/guestfs-recipes.pod:179
3650 msgid "Get DHCP address from a VM"
3654 #: ../examples/guestfs-recipes.pod:181
3656 "The link below explains the many different possible techniques for getting "
3657 "the last assigned DHCP address of a virtual machine."
3661 #: ../examples/guestfs-recipes.pod:184
3663 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
3664 "a-virtual-machine-disk-image/#content"
3668 #: ../examples/guestfs-recipes.pod:186
3670 "In the libguestfs source examples directory you will find the latest version "
3671 "of the C<virt-dhcp-address.c> program."
3675 #: ../examples/guestfs-recipes.pod:189
3676 msgid "Get the operating system product name string"
3680 #: ../examples/guestfs-recipes.pod:191
3681 msgid "Save the following script into a file called C<product-name.sh>:"
3685 #: ../examples/guestfs-recipes.pod:193
3690 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3691 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3692 " guestfish --remote inspect-get-product-name \"$root\"\n"
3693 " guestfish --remote exit\n"
3698 #: ../examples/guestfs-recipes.pod:200
3699 msgid "Make the script executable and run it on a named guest:"
3703 #: ../examples/guestfs-recipes.pod:202
3706 " # product-name.sh RHEL60x64\n"
3707 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
3712 #: ../examples/guestfs-recipes.pod:205
3714 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
3715 "C<xpath> command line tool or from your favourite programming language:"
3719 #: ../examples/guestfs-recipes.pod:209
3722 " # virt-inspector RHEL60x64 > xml\n"
3723 " # xpath '//product_name' < xml\n"
3726 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
3731 #: ../examples/guestfs-recipes.pod:215
3732 msgid "Get the default boot kernel for a Linux VM"
3736 #: ../examples/guestfs-recipes.pod:217
3738 "The link below contains a program to print the default boot kernel for a "
3743 #: ../examples/guestfs-recipes.pod:220
3745 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
3746 "kernel-for-a-vm/#content"
3750 #: ../examples/guestfs-recipes.pod:222
3752 "It uses Augeas, and the technique is generally applicable for many different "
3757 #: ../examples/guestfs-recipes.pod:229
3758 msgid "listing the user accounts in the guest"
3762 #: ../examples/guestfs-recipes.pod:233
3763 msgid "what repositories is it configured to use"
3767 #: ../examples/guestfs-recipes.pod:237
3768 msgid "what NTP servers does it connect to"
3772 #: ../examples/guestfs-recipes.pod:241
3773 msgid "what were the boot messages last time it booted"
3777 #: ../examples/guestfs-recipes.pod:245
3778 msgid "listing who was logged in recently"
3782 #: ../examples/guestfs-recipes.pod:249
3783 msgid "http://augeas.net/"
3787 #: ../examples/guestfs-recipes.pod:251
3788 msgid "Install RPMs in a guest"
3792 #: ../examples/guestfs-recipes.pod:253
3794 "The link below contains a method to install RPMs in a guest. In fact the "
3795 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
3796 "installs them next time the guest is booted. You could use this technique "
3797 "to install vital security updates in an offline guest."
3801 #: ../examples/guestfs-recipes.pod:259
3803 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
3807 #: ../examples/guestfs-recipes.pod:261
3808 msgid "List applications installed in a VM"
3812 #: ../examples/guestfs-recipes.pod:263
3813 msgid "Save the following to a file C<list-apps.sh>:"
3817 #: ../examples/guestfs-recipes.pod:265
3822 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3823 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3824 " guestfish --remote inspect-list-applications \"$root\"\n"
3825 " guestfish --remote exit\n"
3830 #: ../examples/guestfs-recipes.pod:272
3832 "Make the file executable and then you can run it on any named virtual "
3837 #: ../examples/guestfs-recipes.pod:275
3840 " # list-apps.sh WinGuest\n"
3842 " app_name: Mozilla Firefox (3.6.12)\n"
3843 " app_display_name: Mozilla Firefox (3.6.12)\n"
3845 " app_version: 3.6.12 (en-GB)\n"
3847 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
3848 " app_trans_path:\n"
3849 " app_publisher: Mozilla\n"
3850 " app_url: http://www.mozilla.com/en-GB/\n"
3851 " app_source_package:\n"
3853 " app_description: Mozilla Firefox\n"
3856 " app_name: VLC media player\n"
3857 " app_display_name: VLC media player 1.1.5\n"
3859 " app_version: 1.1.5\n"
3861 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
3862 " app_trans_path:\n"
3863 " app_publisher: VideoLAN\n"
3864 " app_url: http://www.videolan.org/\n"
3865 " app_source_package:\n"
3867 " app_description:\n"
3873 #: ../examples/guestfs-recipes.pod:305
3875 "If you want to run the script on disk images (instead of libvirt virtual "
3876 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
3881 #: ../examples/guestfs-recipes.pod:309
3882 msgid "List files and directories in a VM"
3886 #: ../examples/guestfs-recipes.pod:311
3887 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
3891 #: ../examples/guestfs-recipes.pod:313
3894 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
3899 #: ../examples/guestfs-recipes.pod:315
3900 msgid "List services in a Windows VM"
3904 #: ../examples/guestfs-recipes.pod:317
3906 "The link below contains a script that can be used to list out the services "
3907 "from a Windows VM, and whether those services run at boot time or are loaded "
3912 #: ../examples/guestfs-recipes.pod:321
3914 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
3919 #: ../examples/guestfs-recipes.pod:323
3920 msgid "Make a disk image sparse"
3924 #: ../examples/guestfs-recipes.pod:325
3926 "The link below contains some guides for making a disk image sparse (or "
3927 "reintroducing sparseness)."
3931 #: ../examples/guestfs-recipes.pod:328
3933 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
3937 #: ../examples/guestfs-recipes.pod:330
3938 msgid "Monitor disk usage over time"
3942 #: ../examples/guestfs-recipes.pod:332
3944 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
3945 "The link below contains a guide."
3949 #: ../examples/guestfs-recipes.pod:335
3950 msgid "http://virt-tools.org/learning/advanced-virt-df/"
3954 #: ../examples/guestfs-recipes.pod:337
3955 msgid "Reading the Windows Event Log from Windows Vista (or later)"
3959 #: ../examples/guestfs-recipes.pod:339
3961 "L<guestfish(1)> plus the tools described in the link below can be used to "
3962 "read out the Windows Event Log from any virtual machine running Windows "
3963 "Vista or a later version."
3967 #: ../examples/guestfs-recipes.pod:343
3969 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
3970 "guestfish/#content"
3974 #: ../examples/guestfs-recipes.pod:345
3975 msgid "Remove root password (Linux)"
3979 #: ../examples/guestfs-recipes.pod:347
3981 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
3982 "files. One use is to remove the root password from a Linux guest:"
3986 #: ../examples/guestfs-recipes.pod:350
3989 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3994 #: ../examples/guestfs-recipes.pod:352
3995 msgid "Remove Administrator password (Windows)"
3999 #: ../examples/guestfs-recipes.pod:354
4001 "The link below contains one technique for removing the Administrator "
4002 "password from a Windows VM, or to be more precise, it gives you a command "
4003 "prompt the next time you log in which you can use to bypass any security:"
4007 #: ../examples/guestfs-recipes.pod:359
4009 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
4010 "administrator-password-with-guestfish/"
4014 #: ../examples/guestfs-recipes.pod:361
4015 msgid "Unpack a live CD"
4019 #: ../examples/guestfs-recipes.pod:363
4021 "Linux live CDs often contain multiple layers of disk images wrapped like a "
4022 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
4023 "layers, as outlined in the guide below."
4027 #: ../examples/guestfs-recipes.pod:367
4029 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
4034 #: ../examples/guestfs-recipes.pod:369
4035 msgid "Uploading and downloading files"
4039 #: ../examples/guestfs-recipes.pod:371
4041 "The link below contains general tips on uploading (copying in) and "
4042 "downloading (copying out) files from VMs."
4046 #: ../examples/guestfs-recipes.pod:374
4048 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
4052 #: ../examples/guestfs-recipes.pod:376
4053 msgid "Use libguestfs tools on VMware ESX guests"
4057 #: ../examples/guestfs-recipes.pod:378
4059 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
4060 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
4064 #: ../examples/guestfs-recipes.pod:382
4066 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
4071 #: ../examples/guestfs-recipes.pod:386
4073 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4074 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby"
4075 "(3)>, L<http://libguestfs.org/>."
4079 #: ../examples/guestfs-recipes.pod:402
4080 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
4084 #: ../fish/guestfish-actions.pod:1
4089 #: ../fish/guestfish-actions.pod:3
4092 " add-cdrom filename\n"
4097 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:7
4098 msgid "This function adds a virtual CD-ROM disk image to the guest."
4102 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:9
4103 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
4107 #: ../fish/guestfish-actions.pod:15
4109 "This call checks for the existence of C<filename>. This stops you from "
4110 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4111 "and C<http:> URLs. To specify those, use the general L</config> call "
4116 #: ../fish/guestfish-actions.pod:22
4118 "If you just want to add an ISO file (often you use this as an efficient way "
4119 "to transfer large files into the guest), then you should probably use L</add-"
4120 "drive-ro> instead."
4124 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163
4125 #: ../fish/guestfish-actions.pod:177
4127 "This function is deprecated. In new code, use the L</add_drive_opts> call "
4132 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166
4133 #: ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:991
4134 #: ../fish/guestfish-actions.pod:1351 ../fish/guestfish-actions.pod:1365
4135 #: ../fish/guestfish-actions.pod:3112 ../fish/guestfish-actions.pod:3319
4136 #: ../fish/guestfish-actions.pod:3433 ../fish/guestfish-actions.pod:3481
4137 #: ../fish/guestfish-actions.pod:4382 ../fish/guestfish-actions.pod:4405
4138 #: ../fish/guestfish-actions.pod:4427 ../fish/guestfish-actions.pod:4465
4139 #: ../fish/guestfish-actions.pod:5114 ../fish/guestfish-actions.pod:5220
4140 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:257
4141 #: ../src/guestfs-actions.pod:278 ../src/guestfs-actions.pod:1518
4142 #: ../src/guestfs-actions.pod:2013 ../src/guestfs-actions.pod:2034
4143 #: ../src/guestfs-actions.pod:4655 ../src/guestfs-actions.pod:4974
4144 #: ../src/guestfs-actions.pod:5192 ../src/guestfs-actions.pod:5282
4145 #: ../src/guestfs-actions.pod:6571 ../src/guestfs-actions.pod:6601
4146 #: ../src/guestfs-actions.pod:6634 ../src/guestfs-actions.pod:6693
4147 #: ../src/guestfs-actions.pod:7629 ../src/guestfs-actions.pod:7741
4148 #: ../src/guestfs-actions.pod:7919
4150 "Deprecated functions will not be removed from the API, but the fact that "
4151 "they are deprecated indicates that there are problems with correct use of "
4156 #: ../fish/guestfish-actions.pod:35
4161 #: ../fish/guestfish-actions.pod:37
4166 #: ../fish/guestfish-actions.pod:39
4169 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
4174 #: ../fish/guestfish-actions.pod:41
4176 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4177 "It works by connecting to libvirt, requesting the domain and domain XML from "
4178 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
4182 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
4184 "The number of disks added is returned. This operation is atomic: if an "
4185 "error is returned, then no disks are added."
4189 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
4191 "This function does some minimal checks to make sure the libvirt domain is "
4192 "not running (unless C<readonly> is true). In a future version we will try "
4193 "to acquire the libvirt lock on each disk."
4197 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
4199 "Disks must be accessible locally. This often means that adding disks from a "
4200 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4201 "unless those disks are accessible via the same device path locally too."
4205 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
4207 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4208 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4209 "libvirt URI (or one set through an environment variable, see the libvirt "
4210 "documentation for full details)."
4214 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
4216 "The optional C<live> flag controls whether this call will try to connect to "
4217 "a running virtual machine C<guestfsd> process if it sees a suitable "
4218 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
4219 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
4220 "DAEMONS> for more information."
4224 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
4226 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
4227 "passed instead of the domain name. The C<dom> string is treated as a UUID "
4228 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
4233 #: ../fish/guestfish-actions.pod:76
4235 "The other optional parameters are passed directly through to L</add-drive-"
4240 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143
4241 #: ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:1995
4242 #: ../fish/guestfish-actions.pod:3161 ../fish/guestfish-actions.pod:3334
4243 #: ../fish/guestfish-actions.pod:3469
4245 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
4249 #: ../fish/guestfish-actions.pod:81
4254 #: ../fish/guestfish-actions.pod:83
4257 " add-drive filename\n"
4262 #: ../fish/guestfish-actions.pod:85
4264 "This function is the equivalent of calling L</add-drive-opts> with no "
4265 "optional parameters, so the disk is added writable, with the format being "
4266 "detected automatically."
4270 #: ../fish/guestfish-actions.pod:89
4272 "Automatic detection of the format opens you up to a potential security hole "
4273 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4274 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4275 "you should think about replacing calls to this function with calls to L</add-"
4276 "drive-opts>, and specifying the format."
4280 #: ../fish/guestfish-actions.pod:96
4281 msgid "add-drive-opts"
4285 #: ../fish/guestfish-actions.pod:98
4290 #: ../fish/guestfish-actions.pod:100
4293 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
4298 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
4300 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4301 "The first time you call this function, the disk appears as C</dev/sda>, the "
4302 "second time as C</dev/sdb>, and so on."
4306 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
4308 "You don't necessarily need to be root when using libguestfs. However you "
4309 "obviously do need sufficient permissions to access the filename for whatever "
4310 "operations you want to perform (ie. read access if you just want to read the "
4311 "image or write access if you want to modify the image)."
4315 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
4316 msgid "This call checks that C<filename> exists."
4320 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3123
4321 #: ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4682
4322 msgid "The optional arguments are:"
4326 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
4331 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
4333 "If true then the image is treated as read-only. Writes are still allowed, "
4334 "but they are stored in a temporary snapshot overlay which is discarded at "
4335 "the end. The disk that you add is not modified."
4339 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
4344 #: ../fish/guestfish-actions.pod:127
4346 "This forces the image format. If you omit this (or use L</add-drive> or L</"
4347 "add-drive-ro>) then the format is automatically detected. Possible formats "
4348 "include C<raw> and C<qcow2>."
4352 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
4354 "Automatic detection of the format opens you up to a potential security hole "
4355 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4356 "RHBZ#642934. Specifying the format closes this security hole."
4360 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
4365 #: ../fish/guestfish-actions.pod:138
4367 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
4368 "add-drive-with-if> call (q.v.)"
4372 #: ../fish/guestfish-actions.pod:145
4373 msgid "add-drive-ro"
4377 #: ../fish/guestfish-actions.pod:147
4382 #: ../fish/guestfish-actions.pod:149
4385 " add-drive-ro filename\n"
4390 #: ../fish/guestfish-actions.pod:151
4392 "This function is the equivalent of calling L</add-drive-opts> with the "
4393 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
4394 "is added read-only, with the format being detected automatically."
4398 #: ../fish/guestfish-actions.pod:156
4399 msgid "add-drive-ro-with-if"
4403 #: ../fish/guestfish-actions.pod:158
4406 " add-drive-ro-with-if filename iface\n"
4411 #: ../fish/guestfish-actions.pod:160
4413 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
4414 "interface emulation to use at run time."
4418 #: ../fish/guestfish-actions.pod:170
4419 msgid "add-drive-with-if"
4423 #: ../fish/guestfish-actions.pod:172
4426 " add-drive-with-if filename iface\n"
4431 #: ../fish/guestfish-actions.pod:174
4433 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4434 "interface emulation to use at run time."
4438 #: ../fish/guestfish-actions.pod:184
4443 #: ../fish/guestfish-actions.pod:186
4446 " aug-clear augpath\n"
4451 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
4453 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4454 "L<augtool(1)> C<clear> command."
4458 #: ../fish/guestfish-actions.pod:191
4463 #: ../fish/guestfish-actions.pod:193
4471 #: ../fish/guestfish-actions.pod:195
4473 "Close the current Augeas handle and free up any resources used by it. After "
4474 "calling this, you have to call L</aug-init> again before you can use any "
4475 "other Augeas functions."
4479 #: ../fish/guestfish-actions.pod:200
4484 #: ../fish/guestfish-actions.pod:202
4487 " aug-defnode name expr val\n"
4492 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
4494 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4498 #: ../fish/guestfish-actions.pod:207
4500 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4501 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
4502 "containing that single node."
4506 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
4508 "On success this returns a pair containing the number of nodes in the "
4509 "nodeset, and a boolean flag if a node was created."
4513 #: ../fish/guestfish-actions.pod:215
4518 #: ../fish/guestfish-actions.pod:217
4521 " aug-defvar name expr\n"
4526 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
4528 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4529 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4533 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
4535 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4536 "evaluates to something which is not a nodeset."
4540 #: ../fish/guestfish-actions.pod:226
4545 #: ../fish/guestfish-actions.pod:228
4548 " aug-get augpath\n"
4553 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
4555 "Look up the value associated with C<path>. If C<path> matches exactly one "
4556 "node, the C<value> is returned."
4560 #: ../fish/guestfish-actions.pod:233
4565 #: ../fish/guestfish-actions.pod:235
4568 " aug-init root flags\n"
4573 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
4575 "Create a new Augeas handle for editing configuration files. If there was "
4576 "any previous Augeas handle associated with this guestfs session, then it is "
4581 #: ../fish/guestfish-actions.pod:241
4582 msgid "You must call this before using any other L</aug-*> commands."
4586 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
4588 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4592 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
4594 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4595 "logical I<or> of the following integers:"
4599 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
4600 msgid "C<AUG_SAVE_BACKUP> = 1"
4604 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
4605 msgid "Keep the original file with a C<.augsave> extension."
4609 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
4610 msgid "C<AUG_SAVE_NEWFILE> = 2"
4614 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
4616 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4617 "original. Overrides C<AUG_SAVE_BACKUP>."
4621 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
4622 msgid "C<AUG_TYPE_CHECK> = 4"
4626 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
4627 msgid "Typecheck lenses."
4631 #: ../fish/guestfish-actions.pod:266
4633 "This option is only useful when debugging Augeas lenses. Use of this option "
4634 "may require additional memory for the libguestfs appliance. You may need to "
4635 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
4639 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
4640 msgid "C<AUG_NO_STDINC> = 8"
4644 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
4645 msgid "Do not use standard load path for modules."
4649 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
4650 msgid "C<AUG_SAVE_NOOP> = 16"
4654 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
4655 msgid "Make save a no-op, just record what would have been changed."
4659 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
4660 msgid "C<AUG_NO_LOAD> = 32"
4664 #: ../fish/guestfish-actions.pod:281
4665 msgid "Do not load the tree in L</aug-init>."
4669 #: ../fish/guestfish-actions.pod:285
4670 msgid "To close the handle, you can call L</aug-close>."
4674 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
4675 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4679 #: ../fish/guestfish-actions.pod:289
4684 #: ../fish/guestfish-actions.pod:291
4687 " aug-insert augpath label true|false\n"
4692 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
4694 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4695 "or after C<path> (depending on the boolean flag C<before>)."
4699 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
4701 "C<path> must match exactly one existing node in the tree, and C<label> must "
4702 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4706 #: ../fish/guestfish-actions.pod:301
4711 #: ../fish/guestfish-actions.pod:303
4719 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
4720 msgid "Load files into the tree."
4724 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
4725 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4729 #: ../fish/guestfish-actions.pod:310
4734 #: ../fish/guestfish-actions.pod:312
4742 #: ../fish/guestfish-actions.pod:314
4744 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4745 "resulting nodes into alphabetical order."
4749 #: ../fish/guestfish-actions.pod:317
4754 #: ../fish/guestfish-actions.pod:319
4757 " aug-match augpath\n"
4762 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
4764 "Returns a list of paths which match the path expression C<path>. The "
4765 "returned paths are sufficiently qualified so that they match exactly one "
4766 "node in the current tree."
4770 #: ../fish/guestfish-actions.pod:325
4775 #: ../fish/guestfish-actions.pod:327
4778 " aug-mv src dest\n"
4783 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
4785 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4786 "C<dest> is overwritten if it exists."
4790 #: ../fish/guestfish-actions.pod:332
4795 #: ../fish/guestfish-actions.pod:334
4803 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
4804 msgid "Remove C<path> and all of its children."
4808 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
4809 msgid "On success this returns the number of entries which were removed."
4813 #: ../fish/guestfish-actions.pod:340
4818 #: ../fish/guestfish-actions.pod:342
4826 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
4827 msgid "This writes all pending changes to disk."
4831 #: ../fish/guestfish-actions.pod:346
4833 "The flags which were passed to L</aug-init> affect exactly how files are "
4838 #: ../fish/guestfish-actions.pod:349
4843 #: ../fish/guestfish-actions.pod:351
4846 " aug-set augpath val\n"
4851 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
4852 msgid "Set the value associated with C<path> to C<val>."
4856 #: ../fish/guestfish-actions.pod:355
4858 "In the Augeas API, it is possible to clear a node by setting the value to "
4859 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4860 "this call. Instead you must use the L</aug-clear> call."
4864 #: ../fish/guestfish-actions.pod:360
4869 #: ../fish/guestfish-actions.pod:362
4872 " available 'groups ...'\n"
4877 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
4879 "This command is used to check the availability of some groups of "
4880 "functionality in the appliance, which not all builds of the libguestfs "
4881 "appliance will be able to provide."
4885 #: ../fish/guestfish-actions.pod:368
4887 "The libguestfs groups, and the functions that those groups correspond to, "
4888 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4889 "runtime by calling L</available-all-groups>."
4893 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
4895 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
4896 "\"]> would check for the availability of the Linux inotify functions and "
4897 "Augeas (configuration file editing) functions."
4901 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
4902 msgid "The command returns no error if I<all> requested groups are available."
4906 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
4908 "It fails with an error if one or more of the requested groups is unavailable "
4913 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
4915 "If an unknown group name is included in the list of groups then an error is "
4920 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
4925 #: ../fish/guestfish-actions.pod:392
4926 msgid "You must call L</launch> before calling this function."
4930 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
4932 "The reason is because we don't know what groups are supported by the "
4933 "appliance/daemon until it is running and can be queried."
4937 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
4939 "If a group of functions is available, this does not necessarily mean that "
4940 "they will work. You still have to check for errors when calling individual "
4941 "API functions even if they are available."
4945 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
4947 "It is usually the job of distro packagers to build complete functionality "
4948 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4949 "with all requirements satisfied, will support everything."
4953 #: ../fish/guestfish-actions.pod:414
4955 "This call was added in version C<1.0.80>. In previous versions of "
4956 "libguestfs all you could do would be to speculatively execute a command to "
4957 "find out if the daemon implemented it. See also L</version>."
4961 #: ../fish/guestfish-actions.pod:421
4962 msgid "available-all-groups"
4966 #: ../fish/guestfish-actions.pod:423
4969 " available-all-groups\n"
4974 #: ../fish/guestfish-actions.pod:425
4976 "This command returns a list of all optional groups that this daemon knows "
4977 "about. Note this returns both supported and unsupported groups. To find "
4978 "out which ones the daemon can actually support you have to call L</"
4979 "available> on each member of the returned list."
4983 #: ../fish/guestfish-actions.pod:431
4984 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
4988 #: ../fish/guestfish-actions.pod:433
4993 #: ../fish/guestfish-actions.pod:435
4996 " base64-in (base64file|-) filename\n"
5001 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
5003 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5007 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449
5008 #: ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:867
5009 #: ../fish/guestfish-actions.pod:886 ../fish/guestfish-actions.pod:1260
5010 #: ../fish/guestfish-actions.pod:4685 ../fish/guestfish-actions.pod:4697
5011 #: ../fish/guestfish-actions.pod:4708 ../fish/guestfish-actions.pod:4719
5012 #: ../fish/guestfish-actions.pod:4771 ../fish/guestfish-actions.pod:4780
5013 #: ../fish/guestfish-actions.pod:4834 ../fish/guestfish-actions.pod:4857
5014 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
5018 #: ../fish/guestfish-actions.pod:442
5023 #: ../fish/guestfish-actions.pod:444
5026 " base64-out filename (base64file|-)\n"
5031 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
5033 "This command downloads the contents of C<filename>, writing it out to local "
5034 "file C<base64file> encoded as base64."
5038 #: ../fish/guestfish-actions.pod:451
5039 msgid "blockdev-flushbufs"
5043 #: ../fish/guestfish-actions.pod:453
5046 " blockdev-flushbufs device\n"
5051 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
5053 "This tells the kernel to flush internal buffers associated with C<device>."
5057 #: ../fish/guestfish-actions.pod:458 ../fish/guestfish-actions.pod:469
5058 #: ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:488
5059 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:513
5060 #: ../fish/guestfish-actions.pod:521 ../fish/guestfish-actions.pod:532
5061 #: ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:548
5062 #: ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:696
5063 #: ../src/guestfs-actions.pod:711 ../src/guestfs-actions.pod:727
5064 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:764
5065 #: ../src/guestfs-actions.pod:778 ../src/guestfs-actions.pod:796
5066 #: ../src/guestfs-actions.pod:810 ../src/guestfs-actions.pod:824
5067 msgid "This uses the L<blockdev(8)> command."
5071 #: ../fish/guestfish-actions.pod:460
5072 msgid "blockdev-getbsz"
5076 #: ../fish/guestfish-actions.pod:462
5079 " blockdev-getbsz device\n"
5084 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
5085 msgid "This returns the block size of a device."
5089 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529
5090 #: ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
5092 "(Note this is different from both I<size in blocks> and I<filesystem block "
5097 #: ../fish/guestfish-actions.pod:471
5098 msgid "blockdev-getro"
5102 #: ../fish/guestfish-actions.pod:473
5105 " blockdev-getro device\n"
5110 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
5112 "Returns a boolean indicating if the block device is read-only (true if read-"
5113 "only, false if not)."
5117 #: ../fish/guestfish-actions.pod:480
5118 msgid "blockdev-getsize64"
5122 #: ../fish/guestfish-actions.pod:482
5125 " blockdev-getsize64 device\n"
5130 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
5131 msgid "This returns the size of the device in bytes."
5135 #: ../fish/guestfish-actions.pod:486
5136 msgid "See also L</blockdev-getsz>."
5140 #: ../fish/guestfish-actions.pod:490
5141 msgid "blockdev-getss"
5145 #: ../fish/guestfish-actions.pod:492
5148 " blockdev-getss device\n"
5153 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
5155 "This returns the size of sectors on a block device. Usually 512, but can be "
5156 "larger for modern devices."
5160 #: ../fish/guestfish-actions.pod:497
5162 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
5166 #: ../fish/guestfish-actions.pod:502
5167 msgid "blockdev-getsz"
5171 #: ../fish/guestfish-actions.pod:504
5174 " blockdev-getsz device\n"
5179 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
5181 "This returns the size of the device in units of 512-byte sectors (even if "
5182 "the sectorsize isn't 512 bytes ... weird)."
5186 #: ../fish/guestfish-actions.pod:509
5188 "See also L</blockdev-getss> for the real sector size of the device, and L</"
5189 "blockdev-getsize64> for the more useful I<size in bytes>."
5193 #: ../fish/guestfish-actions.pod:515
5194 msgid "blockdev-rereadpt"
5198 #: ../fish/guestfish-actions.pod:517
5201 " blockdev-rereadpt device\n"
5206 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
5207 msgid "Reread the partition table on C<device>."
5211 #: ../fish/guestfish-actions.pod:523
5212 msgid "blockdev-setbsz"
5216 #: ../fish/guestfish-actions.pod:525
5219 " blockdev-setbsz device blocksize\n"
5224 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
5225 msgid "This sets the block size of a device."
5229 #: ../fish/guestfish-actions.pod:534
5230 msgid "blockdev-setro"
5234 #: ../fish/guestfish-actions.pod:536
5237 " blockdev-setro device\n"
5242 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
5243 msgid "Sets the block device named C<device> to read-only."
5247 #: ../fish/guestfish-actions.pod:542
5248 msgid "blockdev-setrw"
5252 #: ../fish/guestfish-actions.pod:544
5255 " blockdev-setrw device\n"
5260 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
5261 msgid "Sets the block device named C<device> to read-write."
5265 #: ../fish/guestfish-actions.pod:550
5266 msgid "btrfs-filesystem-resize"
5270 #: ../fish/guestfish-actions.pod:552
5273 " btrfs-filesystem-resize mountpoint [size:..]\n"
5278 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
5279 msgid "This command resizes a btrfs filesystem."
5283 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
5285 "Note that unlike other resize calls, the filesystem has to be mounted and "
5286 "the parameter is the mountpoint not the device (this is a requirement of "
5291 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3444
5292 #: ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5216
5293 msgid "The optional parameters are:"
5297 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3448
5298 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5220
5303 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
5305 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
5306 "resized to the maximum size."
5310 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
5311 msgid "See also L<btrfs(8)>."
5315 #: ../fish/guestfish-actions.pod:575
5316 msgid "case-sensitive-path"
5320 #: ../fish/guestfish-actions.pod:577
5323 " case-sensitive-path path\n"
5328 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
5330 "This can be used to resolve case insensitive paths on a filesystem which is "
5331 "case sensitive. The use case is to resolve paths which you have read from "
5332 "Windows configuration files or the Windows Registry, to the true path."
5336 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
5338 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5339 "(and probably others), which is that although the underlying filesystem is "
5340 "case-insensitive, the driver exports the filesystem to Linux as case-"
5345 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
5347 "One consequence of this is that special directories such as C<c:\\windows> "
5348 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5349 "precise details of how they were created. In Windows itself this would not "
5354 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
5356 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5361 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
5363 "This function resolves the true case of each element in the path and returns "
5364 "the case-sensitive path."
5368 #: ../fish/guestfish-actions.pod:601
5370 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
5371 "WINDOWS/system32\"> (the exact return value would depend on details of how "
5372 "the directories were originally created under Windows)."
5376 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
5377 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5381 #: ../fish/guestfish-actions.pod:609
5382 msgid "See also L</realpath>."
5386 #: ../fish/guestfish-actions.pod:611
5391 #: ../fish/guestfish-actions.pod:613
5399 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3864
5400 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5859
5401 msgid "Return the contents of the file named C<path>."
5405 #: ../fish/guestfish-actions.pod:617
5407 "Note that this function cannot correctly handle binary files (specifically, "
5408 "files containing C<\\0> character which is treated as end of string). For "
5409 "those you need to use the L</read-file> or L</download> functions which have "
5410 "a more complex interface."
5414 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757
5415 #: ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:945
5416 #: ../fish/guestfish-actions.pod:955 ../fish/guestfish-actions.pod:1022
5417 #: ../fish/guestfish-actions.pod:1032 ../fish/guestfish-actions.pod:1224
5418 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:1541
5419 #: ../fish/guestfish-actions.pod:1591 ../fish/guestfish-actions.pod:1606
5420 #: ../fish/guestfish-actions.pod:1616 ../fish/guestfish-actions.pod:1635
5421 #: ../fish/guestfish-actions.pod:3734 ../fish/guestfish-actions.pod:3749
5422 #: ../fish/guestfish-actions.pod:3825 ../fish/guestfish-actions.pod:3842
5423 #: ../fish/guestfish-actions.pod:3857 ../fish/guestfish-actions.pod:4526
5424 #: ../fish/guestfish-actions.pod:4572 ../fish/guestfish-actions.pod:4657
5425 #: ../fish/guestfish-actions.pod:4672 ../fish/guestfish-actions.pod:5078
5426 #: ../fish/guestfish-actions.pod:5090 ../fish/guestfish-actions.pod:5108
5427 #: ../fish/guestfish-actions.pod:5125 ../fish/guestfish-actions.pod:5135
5428 #: ../fish/guestfish-actions.pod:5192 ../fish/guestfish-actions.pod:5202
5429 #: ../fish/guestfish-actions.pod:5231 ../fish/guestfish-actions.pod:5241
5430 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127
5431 #: ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1443
5432 #: ../src/guestfs-actions.pod:1462 ../src/guestfs-actions.pod:1565
5433 #: ../src/guestfs-actions.pod:1584 ../src/guestfs-actions.pod:1830
5434 #: ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2320
5435 #: ../src/guestfs-actions.pod:2385 ../src/guestfs-actions.pod:2409
5436 #: ../src/guestfs-actions.pod:2426 ../src/guestfs-actions.pod:2455
5437 #: ../src/guestfs-actions.pod:5641 ../src/guestfs-actions.pod:5667
5438 #: ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5824
5439 #: ../src/guestfs-actions.pod:5848 ../src/guestfs-actions.pod:6799
5440 #: ../src/guestfs-actions.pod:6854 ../src/guestfs-actions.pod:7000
5441 #: ../src/guestfs-actions.pod:7024 ../src/guestfs-actions.pod:7689
5442 #: ../src/guestfs-actions.pod:7709 ../src/guestfs-actions.pod:7735
5443 #: ../src/guestfs-actions.pod:7761 ../src/guestfs-actions.pod:7780
5444 #: ../src/guestfs-actions.pod:7874 ../src/guestfs-actions.pod:7893
5445 #: ../src/guestfs-actions.pod:7939 ../src/guestfs-actions.pod:7958
5447 "Because of the message protocol, there is a transfer limit of somewhere "
5448 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5452 #: ../fish/guestfish-actions.pod:625
5457 #: ../fish/guestfish-actions.pod:627
5460 " checksum csumtype path\n"
5465 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
5467 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5471 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
5473 "The type of checksum to compute is given by the C<csumtype> parameter which "
5474 "must have one of the following values:"
5478 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
5483 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
5485 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5490 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
5495 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
5496 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5500 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
5505 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
5506 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5510 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
5515 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
5516 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5520 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
5525 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
5526 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5530 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
5535 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
5536 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5540 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
5545 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
5546 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5550 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
5551 msgid "The checksum is returned as a printable string."
5555 #: ../fish/guestfish-actions.pod:670
5556 msgid "To get the checksum for a device, use L</checksum-device>."
5560 #: ../fish/guestfish-actions.pod:672
5561 msgid "To get the checksums for many files, use L</checksums-out>."
5565 #: ../fish/guestfish-actions.pod:674
5566 msgid "checksum-device"
5570 #: ../fish/guestfish-actions.pod:676
5573 " checksum-device csumtype device\n"
5578 #: ../fish/guestfish-actions.pod:678
5580 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5581 "device named C<device>. For the types of checksums supported see the L</"
5582 "checksum> command."
5586 #: ../fish/guestfish-actions.pod:682
5587 msgid "checksums-out"
5591 #: ../fish/guestfish-actions.pod:684
5594 " checksums-out csumtype directory (sumsfile|-)\n"
5599 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
5601 "This command computes the checksums of all regular files in C<directory> and "
5602 "then emits a list of those checksums to the local output file C<sumsfile>."
5606 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
5608 "This can be used for verifying the integrity of a virtual machine. However "
5609 "to be properly secure you should pay attention to the output of the checksum "
5610 "command (it uses the ones from GNU coreutils). In particular when the "
5611 "filename is not printable, coreutils uses a special backslash syntax. For "
5612 "more information, see the GNU coreutils info file."
5616 #: ../fish/guestfish-actions.pod:700
5621 #: ../fish/guestfish-actions.pod:702
5624 " chmod mode path\n"
5629 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
5631 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5636 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
5638 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5639 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5644 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3087
5645 #: ../fish/guestfish-actions.pod:3226 ../fish/guestfish-actions.pod:3236
5646 #: ../fish/guestfish-actions.pod:3246 ../src/guestfs-actions.pod:1064
5647 #: ../src/guestfs-actions.pod:4613 ../src/guestfs-actions.pod:4822
5648 #: ../src/guestfs-actions.pod:4841 ../src/guestfs-actions.pod:4860
5649 msgid "The mode actually set is affected by the umask."
5653 #: ../fish/guestfish-actions.pod:713
5658 #: ../fish/guestfish-actions.pod:715
5661 " chown owner group path\n"
5666 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
5667 msgid "Change the file owner to C<owner> and group to C<group>."
5671 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2522
5672 #: ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3684
5674 "Only numeric uid and gid are supported. If you want to use names, you will "
5675 "need to locate and parse the password file yourself (Augeas support makes "
5676 "this relatively easy)."
5680 #: ../fish/guestfish-actions.pod:723
5685 #: ../fish/guestfish-actions.pod:725
5688 " command 'arguments ...'\n"
5693 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
5695 "This call runs a command from the guest filesystem. The filesystem must be "
5696 "mounted, and must contain a compatible operating system (ie. something "
5697 "Linux, with the same or compatible processor architecture)."
5701 #: ../fish/guestfish-actions.pod:732
5703 "The single parameter is an argv-style list of arguments. The first element "
5704 "is the name of the program to run. Subsequent elements are parameters. The "
5705 "list must be non-empty (ie. must contain a program name). Note that the "
5706 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5710 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
5711 msgid "The return value is anything printed to I<stdout> by the command."
5715 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
5717 "If the command returns a non-zero exit status, then this function returns an "
5718 "error message. The error message string is the content of I<stderr> from "
5723 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5725 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
5726 "bin>. If you require a program from another location, you should provide "
5727 "the full path in the first parameter."
5731 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
5733 "Shared libraries and data files required by the program must be available on "
5734 "filesystems which are mounted in the correct places. It is the caller's "
5735 "responsibility to ensure all filesystems that are needed are mounted at the "
5740 #: ../fish/guestfish-actions.pod:760
5741 msgid "command-lines"
5745 #: ../fish/guestfish-actions.pod:762
5748 " command-lines 'arguments ...'\n"
5753 #: ../fish/guestfish-actions.pod:764
5755 "This is the same as L</command>, but splits the result into a list of lines."
5759 #: ../fish/guestfish-actions.pod:767
5760 msgid "See also: L</sh-lines>"
5764 #: ../fish/guestfish-actions.pod:772
5769 #: ../fish/guestfish-actions.pod:774
5772 " config qemuparam qemuvalue\n"
5777 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1159
5779 "This can be used to add arbitrary qemu command line parameters of the form "
5780 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
5781 "setting some parameters which would interfere with parameters that we use."
5785 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1164
5786 msgid "The first character of C<param> string must be a C<-> (dash)."
5790 #: ../fish/guestfish-actions.pod:783 ../src/guestfs-actions.pod:1166
5791 msgid "C<value> can be NULL."
5795 #: ../fish/guestfish-actions.pod:785
5800 #: ../fish/guestfish-actions.pod:787
5803 " copy-size src dest size\n"
5808 #: ../fish/guestfish-actions.pod:789 ../src/guestfs-actions.pod:1180
5810 "This command copies exactly C<size> bytes from one source device or file "
5811 "C<src> to another destination device or file C<dest>."
5815 #: ../fish/guestfish-actions.pod:792 ../src/guestfs-actions.pod:1183
5817 "Note this will fail if the source is too short or if the destination is not "
5822 #: ../fish/guestfish-actions.pod:795
5827 #: ../fish/guestfish-actions.pod:797
5835 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1202
5837 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5838 "destination filename or destination directory."
5842 #: ../fish/guestfish-actions.pod:802
5847 #: ../fish/guestfish-actions.pod:804
5855 #: ../fish/guestfish-actions.pod:806 ../src/guestfs-actions.pod:1216
5857 "This copies a file or directory from C<src> to C<dest> recursively using the "
5862 #: ../fish/guestfish-actions.pod:809
5867 #: ../fish/guestfish-actions.pod:811
5875 #: ../fish/guestfish-actions.pod:813 ../src/guestfs-actions.pod:1230
5877 "This command copies from one source device or file C<src> to another "
5878 "destination device or file C<dest>. Normally you would use this to copy to "
5879 "or from a device or partition, for example to duplicate a filesystem."
5883 #: ../fish/guestfish-actions.pod:818
5885 "If the destination is a device, it must be as large or larger than the "
5886 "source file or device, otherwise the copy will fail. This command cannot do "
5887 "partial copies (see L</copy-size>)."
5891 #: ../fish/guestfish-actions.pod:822
5896 #: ../fish/guestfish-actions.pod:824
5904 #: ../fish/guestfish-actions.pod:826 ../src/guestfs-actions.pod:1248
5905 msgid "This command runs the C<df> command to report disk space used."
5909 #: ../fish/guestfish-actions.pod:828 ../fish/guestfish-actions.pod:839
5911 "This command is mostly useful for interactive sessions. It is I<not> "
5912 "intended that you try to parse the output string. Use L</statvfs> from "
5917 #: ../fish/guestfish-actions.pod:832
5922 #: ../fish/guestfish-actions.pod:834
5930 #: ../fish/guestfish-actions.pod:836 ../src/guestfs-actions.pod:1264
5932 "This command runs the C<df -h> command to report disk space used in human-"
5937 #: ../fish/guestfish-actions.pod:843
5942 #: ../fish/guestfish-actions.pod:845
5950 #: ../fish/guestfish-actions.pod:847 ../src/guestfs-actions.pod:1281
5952 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5953 "This is sometimes useful for extended debugging of problems."
5957 #: ../fish/guestfish-actions.pod:851
5959 "Another way to get the same information is to enable verbose messages with "
5960 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
5961 "before running the program."
5965 #: ../fish/guestfish-actions.pod:856
5970 #: ../fish/guestfish-actions.pod:858
5973 " download remotefilename (filename|-)\n"
5978 #: ../fish/guestfish-actions.pod:860 ../fish/guestfish-actions.pod:873
5979 #: ../src/guestfs-actions.pod:1302 ../src/guestfs-actions.pod:1327
5981 "Download file C<remotefilename> and save it as C<filename> on the local "
5986 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:4830
5987 #: ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:7259
5988 msgid "C<filename> can also be a named pipe."
5992 #: ../fish/guestfish-actions.pod:865
5993 msgid "See also L</upload>, L</cat>."
5997 #: ../fish/guestfish-actions.pod:869
5998 msgid "download-offset"
6002 #: ../fish/guestfish-actions.pod:871
6005 " download-offset remotefilename (filename|-) offset size\n"
6010 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1330
6012 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6013 "region must be within the file or device)."
6017 #: ../fish/guestfish-actions.pod:879
6019 "Note that there is no limit on the amount of data that can be downloaded "
6020 "with this call, unlike with L</pread>, and this call always reads the full "
6021 "amount unless an error occurs."
6025 #: ../fish/guestfish-actions.pod:884
6026 msgid "See also L</download>, L</pread>."
6030 #: ../fish/guestfish-actions.pod:888
6035 #: ../fish/guestfish-actions.pod:890
6038 " drop-caches whattodrop\n"
6043 #: ../fish/guestfish-actions.pod:892 ../src/guestfs-actions.pod:1355
6045 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6046 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6047 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6051 #: ../fish/guestfish-actions.pod:897 ../src/guestfs-actions.pod:1360
6052 msgid "Setting C<whattodrop> to 3 should drop everything."
6056 #: ../fish/guestfish-actions.pod:899 ../src/guestfs-actions.pod:1362
6058 "This automatically calls L<sync(2)> before the operation, so that the "
6059 "maximum guest memory is freed."
6063 #: ../fish/guestfish-actions.pod:902
6068 #: ../fish/guestfish-actions.pod:904
6076 #: ../fish/guestfish-actions.pod:906 ../src/guestfs-actions.pod:1375
6078 "This command runs the C<du -s> command to estimate file space usage for "
6083 #: ../fish/guestfish-actions.pod:909 ../src/guestfs-actions.pod:1378
6085 "C<path> can be a file or a directory. If C<path> is a directory then the "
6086 "estimate includes the contents of the directory and all subdirectories "
6091 #: ../fish/guestfish-actions.pod:913 ../src/guestfs-actions.pod:1382
6093 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6097 #: ../fish/guestfish-actions.pod:916
6102 #: ../fish/guestfish-actions.pod:918
6105 " e2fsck-f device\n"
6110 #: ../fish/guestfish-actions.pod:920 ../src/guestfs-actions.pod:1400
6112 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6113 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
6118 #: ../fish/guestfish-actions.pod:924
6120 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
6121 "should use L</fsck>."
6125 #: ../fish/guestfish-actions.pod:927
6130 #: ../fish/guestfish-actions.pod:929
6133 " echo-daemon 'words ...'\n"
6138 #: ../fish/guestfish-actions.pod:931 ../src/guestfs-actions.pod:1417
6140 "This command concatenates the list of C<words> passed with single spaces "
6141 "between them and returns the resulting string."
6145 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1420
6146 msgid "You can use this command to test the connection through to the daemon."
6150 #: ../fish/guestfish-actions.pod:936
6151 msgid "See also L</ping-daemon>."
6155 #: ../fish/guestfish-actions.pod:938
6160 #: ../fish/guestfish-actions.pod:940
6163 " egrep regex path\n"
6168 #: ../fish/guestfish-actions.pod:942 ../src/guestfs-actions.pod:1436
6170 "This calls the external C<egrep> program and returns the matching lines."
6174 #: ../fish/guestfish-actions.pod:948
6179 #: ../fish/guestfish-actions.pod:950
6182 " egrepi regex path\n"
6187 #: ../fish/guestfish-actions.pod:952 ../src/guestfs-actions.pod:1455
6189 "This calls the external C<egrep -i> program and returns the matching lines."
6193 #: ../fish/guestfish-actions.pod:958
6198 #: ../fish/guestfish-actions.pod:960
6201 " equal file1 file2\n"
6206 #: ../fish/guestfish-actions.pod:962 ../src/guestfs-actions.pod:1474
6208 "This compares the two files C<file1> and C<file2> and returns true if their "
6209 "content is exactly equal, or false otherwise."
6213 #: ../fish/guestfish-actions.pod:965 ../src/guestfs-actions.pod:1477
6214 msgid "The external L<cmp(1)> program is used for the comparison."
6218 #: ../fish/guestfish-actions.pod:967
6223 #: ../fish/guestfish-actions.pod:969
6231 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1489
6233 "This returns C<true> if and only if there is a file, directory (or anything) "
6234 "with the given C<path> name."
6238 #: ../fish/guestfish-actions.pod:974
6239 msgid "See also L</is-file>, L</is-dir>, L</stat>."
6243 #: ../fish/guestfish-actions.pod:976
6248 #: ../fish/guestfish-actions.pod:978
6251 " fallocate path len\n"
6256 #: ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:999
6257 #: ../src/guestfs-actions.pod:1505 ../src/guestfs-actions.pod:1531
6259 "This command preallocates a file (containing zero bytes) named C<path> of "
6260 "size C<len> bytes. If the file exists already, it is overwritten."
6264 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1509
6266 "Do not confuse this with the guestfish-specific C<alloc> command which "
6267 "allocates a file in the host and attaches it as a device."
6271 #: ../fish/guestfish-actions.pod:988
6273 "This function is deprecated. In new code, use the L</fallocate64> call "
6278 #: ../fish/guestfish-actions.pod:995
6283 #: ../fish/guestfish-actions.pod:997
6286 " fallocate64 path len\n"
6291 #: ../fish/guestfish-actions.pod:1003
6293 "Note that this call allocates disk blocks for the file. To create a sparse "
6294 "file use L</truncate-size> instead."
6298 #: ../fish/guestfish-actions.pod:1006
6300 "The deprecated call L</fallocate> does the same, but owing to an oversight "
6301 "it only allowed 30 bit lengths to be specified, effectively limiting the "
6302 "maximum size of files created through that call to 1GB."
6306 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1543
6308 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6309 "commands which create a file in the host and attach it as a device."
6313 #: ../fish/guestfish-actions.pod:1015
6318 #: ../fish/guestfish-actions.pod:1017
6321 " fgrep pattern path\n"
6326 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1558
6328 "This calls the external C<fgrep> program and returns the matching lines."
6332 #: ../fish/guestfish-actions.pod:1025
6337 #: ../fish/guestfish-actions.pod:1027
6340 " fgrepi pattern path\n"
6345 #: ../fish/guestfish-actions.pod:1029 ../src/guestfs-actions.pod:1577
6347 "This calls the external C<fgrep -i> program and returns the matching lines."
6351 #: ../fish/guestfish-actions.pod:1035
6356 #: ../fish/guestfish-actions.pod:1037
6364 #: ../fish/guestfish-actions.pod:1039 ../src/guestfs-actions.pod:1595
6366 "This call uses the standard L<file(1)> command to determine the type or "
6367 "contents of the file."
6371 #: ../fish/guestfish-actions.pod:1042 ../src/guestfs-actions.pod:1598
6373 "This call will also transparently look inside various types of compressed "
6378 #: ../fish/guestfish-actions.pod:1045 ../src/guestfs-actions.pod:1601
6380 "The exact command which runs is C<file -zb path>. Note in particular that "
6381 "the filename is not prepended to the output (the I<-b> option)."
6385 #: ../fish/guestfish-actions.pod:1049 ../src/guestfs-actions.pod:1605
6387 "The output depends on the output of the underlying L<file(1)> command and it "
6388 "can change in future in ways beyond our control. In other words, the output "
6389 "is not guaranteed by the ABI."
6393 #: ../fish/guestfish-actions.pod:1053
6395 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
6396 "(etc), L</is-zero>."
6400 #: ../fish/guestfish-actions.pod:1056
6401 msgid "file-architecture"
6405 #: ../fish/guestfish-actions.pod:1058
6408 " file-architecture filename\n"
6413 #: ../fish/guestfish-actions.pod:1060 ../src/guestfs-actions.pod:1623
6415 "This detects the architecture of the binary C<filename>, and returns it if "
6420 #: ../fish/guestfish-actions.pod:1063 ../src/guestfs-actions.pod:1626
6421 msgid "Currently defined architectures are:"
6425 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1630
6430 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1632
6432 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6433 "irrespective of the precise processor requirements of the binary."
6437 #: ../fish/guestfish-actions.pod:1072 ../src/guestfs-actions.pod:1635
6442 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1637
6443 msgid "64 bit x86-64."
6447 #: ../fish/guestfish-actions.pod:1076 ../src/guestfs-actions.pod:1639
6452 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1641
6453 msgid "32 bit SPARC."
6457 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1643
6462 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1645
6463 msgid "64 bit SPARC V9 and above."
6467 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1647
6472 #: ../fish/guestfish-actions.pod:1086 ../src/guestfs-actions.pod:1649
6473 msgid "Intel Itanium."
6477 #: ../fish/guestfish-actions.pod:1088 ../src/guestfs-actions.pod:1651
6482 #: ../fish/guestfish-actions.pod:1090 ../src/guestfs-actions.pod:1653
6483 msgid "32 bit Power PC."
6487 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1655
6492 #: ../fish/guestfish-actions.pod:1094 ../src/guestfs-actions.pod:1657
6493 msgid "64 bit Power PC."
6497 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1661
6498 msgid "Libguestfs may return other architecture strings in future."
6502 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1663
6503 msgid "The function works on at least the following types of files:"
6507 #: ../fish/guestfish-actions.pod:1106 ../src/guestfs-actions.pod:1669
6508 msgid "many types of Un*x and Linux binary"
6512 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1673
6513 msgid "many types of Un*x and Linux shared library"
6517 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1677
6518 msgid "Windows Win32 and Win64 binaries"
6522 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1681
6523 msgid "Windows Win32 and Win64 DLLs"
6527 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1683
6528 msgid "Win32 binaries and DLLs return C<i386>."
6532 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1685
6533 msgid "Win64 binaries and DLLs return C<x86_64>."
6537 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1689
6538 msgid "Linux kernel modules"
6542 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1693
6543 msgid "Linux new-style initrd images"
6547 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1697
6548 msgid "some non-x86 Linux vmlinuz kernels"
6552 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1701
6553 msgid "What it can't do currently:"
6557 #: ../fish/guestfish-actions.pod:1144 ../src/guestfs-actions.pod:1707
6558 msgid "static libraries (libfoo.a)"
6562 #: ../fish/guestfish-actions.pod:1148 ../src/guestfs-actions.pod:1711
6563 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6567 #: ../fish/guestfish-actions.pod:1152 ../src/guestfs-actions.pod:1715
6568 msgid "x86 Linux vmlinuz kernels"
6572 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1717
6574 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6575 "compressed code, and are horribly hard to unpack. If you want to find the "
6576 "architecture of a kernel, use the architecture of the associated initrd or "
6577 "kernel module(s) instead."
6581 #: ../fish/guestfish-actions.pod:1161
6586 #: ../fish/guestfish-actions.pod:1163
6594 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1735
6595 msgid "This command returns the size of C<file> in bytes."
6599 #: ../fish/guestfish-actions.pod:1167
6601 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
6602 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
6606 #: ../fish/guestfish-actions.pod:1171
6611 #: ../fish/guestfish-actions.pod:1173
6614 " fill c len path\n"
6619 #: ../fish/guestfish-actions.pod:1175 ../src/guestfs-actions.pod:1753
6621 "This command creates a new file called C<path>. The initial content of the "
6622 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
6627 #: ../fish/guestfish-actions.pod:1179
6629 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6630 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6635 #: ../fish/guestfish-actions.pod:1184
6636 msgid "fill-pattern"
6640 #: ../fish/guestfish-actions.pod:1186
6643 " fill-pattern pattern len path\n"
6648 #: ../fish/guestfish-actions.pod:1188
6650 "This function is like L</fill> except that it creates a new file of length "
6651 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6652 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6657 #: ../fish/guestfish-actions.pod:1193
6662 #: ../fish/guestfish-actions.pod:1195
6670 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:1799
6672 "This command lists out all files and directories, recursively, starting at "
6673 "C<directory>. It is essentially equivalent to running the shell command "
6674 "C<find directory -print> but some post-processing happens on the output, "
6679 #: ../fish/guestfish-actions.pod:1202 ../src/guestfs-actions.pod:1804
6681 "This returns a list of strings I<without any prefix>. Thus if the directory "
6686 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1807
6696 #: ../fish/guestfish-actions.pod:1209
6697 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6701 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:1814
6712 #: ../fish/guestfish-actions.pod:1217 ../src/guestfs-actions.pod:1819
6713 msgid "If C<directory> is not a directory, then this command returns an error."
6717 #: ../fish/guestfish-actions.pod:1220 ../src/guestfs-actions.pod:1822
6718 msgid "The returned list is sorted."
6722 #: ../fish/guestfish-actions.pod:1222
6723 msgid "See also L</find0>."
6727 #: ../fish/guestfish-actions.pod:1227
6732 #: ../fish/guestfish-actions.pod:1229
6735 " find0 directory (files|-)\n"
6740 #: ../fish/guestfish-actions.pod:1231 ../src/guestfs-actions.pod:1842
6742 "This command lists out all files and directories, recursively, starting at "
6743 "C<directory>, placing the resulting list in the external file called "
6748 #: ../fish/guestfish-actions.pod:1235
6750 "This command works the same way as L</find> with the following exceptions:"
6754 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1853
6755 msgid "The resulting list is written to an external file."
6759 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:1857
6761 "Items (filenames) in the result are separated by C<\\0> characters. See "
6762 "L<find(1)> option I<-print0>."
6766 #: ../fish/guestfish-actions.pod:1251 ../src/guestfs-actions.pod:1862
6767 msgid "This command is not limited in the number of names that it can return."
6771 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:1867
6772 msgid "The result list is not sorted."
6776 #: ../fish/guestfish-actions.pod:1262
6777 msgid "findfs-label"
6781 #: ../fish/guestfish-actions.pod:1264
6784 " findfs-label label\n"
6789 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1881
6791 "This command searches the filesystems and returns the one which has the "
6792 "given label. An error is returned if no such filesystem can be found."
6796 #: ../fish/guestfish-actions.pod:1270
6797 msgid "To find the label of a filesystem, use L</vfs-label>."
6801 #: ../fish/guestfish-actions.pod:1272
6806 #: ../fish/guestfish-actions.pod:1274
6809 " findfs-uuid uuid\n"
6814 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:1898
6816 "This command searches the filesystems and returns the one which has the "
6817 "given UUID. An error is returned if no such filesystem can be found."
6821 #: ../fish/guestfish-actions.pod:1280
6822 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
6826 #: ../fish/guestfish-actions.pod:1282
6831 #: ../fish/guestfish-actions.pod:1284
6834 " fsck fstype device\n"
6839 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1916
6841 "This runs the filesystem checker (fsck) on C<device> which should have "
6842 "filesystem type C<fstype>."
6846 #: ../fish/guestfish-actions.pod:1289 ../src/guestfs-actions.pod:1919
6848 "The returned integer is the status. See L<fsck(8)> for the list of status "
6849 "codes from C<fsck>."
6853 #: ../fish/guestfish-actions.pod:1298 ../src/guestfs-actions.pod:1928
6854 msgid "Multiple status codes can be summed together."
6858 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:1932
6860 "A non-zero return code can mean \"success\", for example if errors have been "
6861 "corrected on the filesystem."
6865 #: ../fish/guestfish-actions.pod:1307 ../src/guestfs-actions.pod:1937
6866 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6870 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:1942
6872 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6876 #: ../fish/guestfish-actions.pod:1314
6881 #: ../fish/guestfish-actions.pod:1316
6889 #: ../fish/guestfish-actions.pod:1318 ../src/guestfs-actions.pod:1953
6891 "Return the additional kernel options which are added to the guest kernel "
6896 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:1956
6897 msgid "If C<NULL> then no options are added."
6901 #: ../fish/guestfish-actions.pod:1323
6902 msgid "get-attach-method"
6906 #: ../fish/guestfish-actions.pod:1325
6909 " get-attach-method\n"
6914 #: ../fish/guestfish-actions.pod:1327
6915 msgid "Return the current attach method. See L</set-attach-method>."
6919 #: ../fish/guestfish-actions.pod:1329
6920 msgid "get-autosync"
6924 #: ../fish/guestfish-actions.pod:1331
6932 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:1981
6933 msgid "Get the autosync flag."
6937 #: ../fish/guestfish-actions.pod:1335
6942 #: ../fish/guestfish-actions.pod:1337
6950 #: ../fish/guestfish-actions.pod:1339 ../src/guestfs-actions.pod:1992
6951 msgid "Return the direct appliance mode flag."
6955 #: ../fish/guestfish-actions.pod:1341
6960 #: ../fish/guestfish-actions.pod:1343
6963 " get-e2label device\n"
6968 #: ../fish/guestfish-actions.pod:1345 ../src/guestfs-actions.pod:2004
6970 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6974 #: ../fish/guestfish-actions.pod:1348
6976 "This function is deprecated. In new code, use the L</vfs_label> call "
6981 #: ../fish/guestfish-actions.pod:1355
6986 #: ../fish/guestfish-actions.pod:1357
6989 " get-e2uuid device\n"
6994 #: ../fish/guestfish-actions.pod:1359 ../src/guestfs-actions.pod:2025
6996 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7000 #: ../fish/guestfish-actions.pod:1362
7002 "This function is deprecated. In new code, use the L</vfs_uuid> call instead."
7006 #: ../fish/guestfish-actions.pod:1369
7011 #: ../fish/guestfish-actions.pod:1371
7019 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2045
7021 "This gets the memory size in megabytes allocated to the qemu subprocess."
7025 #: ../fish/guestfish-actions.pod:1376
7027 "If L</set-memsize> was not called on this handle, and if "
7028 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7029 "value for memsize."
7033 #: ../fish/guestfish-actions.pod:1380 ../fish/guestfish-actions.pod:1437
7034 #: ../fish/guestfish-actions.pod:4190 ../fish/guestfish-actions.pod:4292
7035 #: ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2144
7036 #: ../src/guestfs-actions.pod:6320 ../src/guestfs-actions.pod:6446
7038 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7042 #: ../fish/guestfish-actions.pod:1383
7047 #: ../fish/guestfish-actions.pod:1385
7055 #: ../fish/guestfish-actions.pod:1387 ../src/guestfs-actions.pod:2064
7056 msgid "This returns the enable network flag."
7060 #: ../fish/guestfish-actions.pod:1389
7065 #: ../fish/guestfish-actions.pod:1391
7073 #: ../fish/guestfish-actions.pod:1393 ../src/guestfs-actions.pod:2075
7074 msgid "Return the current search path."
7078 #: ../fish/guestfish-actions.pod:1395 ../src/guestfs-actions.pod:2077
7080 "This is always non-NULL. If it wasn't set already, then this will return "
7085 #: ../fish/guestfish-actions.pod:1398
7090 #: ../fish/guestfish-actions.pod:1400
7098 #: ../fish/guestfish-actions.pod:1402 ../src/guestfs-actions.pod:2090
7099 msgid "This returns the process group flag."
7103 #: ../fish/guestfish-actions.pod:1404
7108 #: ../fish/guestfish-actions.pod:1406
7113 #: ../fish/guestfish-actions.pod:1408
7121 #: ../fish/guestfish-actions.pod:1410 ../src/guestfs-actions.pod:2101
7123 "Return the process ID of the qemu subprocess. If there is no qemu "
7124 "subprocess, then this will return an error."
7128 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2104
7129 msgid "This is an internal call used for debugging and testing."
7133 #: ../fish/guestfish-actions.pod:1415
7138 #: ../fish/guestfish-actions.pod:1417
7146 #: ../fish/guestfish-actions.pod:1419 ../src/guestfs-actions.pod:2115
7147 msgid "Return the current qemu binary."
7151 #: ../fish/guestfish-actions.pod:1421 ../src/guestfs-actions.pod:2117
7153 "This is always non-NULL. If it wasn't set already, then this will return "
7154 "the default qemu binary name."
7158 #: ../fish/guestfish-actions.pod:1424
7159 msgid "get-recovery-proc"
7163 #: ../fish/guestfish-actions.pod:1426
7166 " get-recovery-proc\n"
7171 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2130
7172 msgid "Return the recovery process enabled flag."
7176 #: ../fish/guestfish-actions.pod:1430
7181 #: ../fish/guestfish-actions.pod:1432
7189 #: ../fish/guestfish-actions.pod:1434
7191 "This returns the current setting of the selinux flag which is passed to the "
7192 "appliance at boot time. See L</set-selinux>."
7196 #: ../fish/guestfish-actions.pod:1440
7201 #: ../fish/guestfish-actions.pod:1442
7209 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2156
7211 "This returns the current state as an opaque integer. This is only useful "
7212 "for printing debug and internal error messages."
7216 #: ../fish/guestfish-actions.pod:1447 ../fish/guestfish-actions.pod:2389
7217 #: ../fish/guestfish-actions.pod:2407 ../fish/guestfish-actions.pod:2445
7218 #: ../fish/guestfish-actions.pod:2461 ../src/guestfs-actions.pod:2159
7219 #: ../src/guestfs-actions.pod:3461 ../src/guestfs-actions.pod:3490
7220 #: ../src/guestfs-actions.pod:3551 ../src/guestfs-actions.pod:3578
7221 msgid "For more information on states, see L<guestfs(3)>."
7225 #: ../fish/guestfish-actions.pod:1449
7230 #: ../fish/guestfish-actions.pod:1451
7238 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2170
7239 msgid "Return the command trace flag."
7243 #: ../fish/guestfish-actions.pod:1455
7248 #: ../fish/guestfish-actions.pod:1457
7256 #: ../fish/guestfish-actions.pod:1459
7258 "Return the current umask. By default the umask is C<022> unless it has been "
7259 "set by calling L</umask>."
7263 #: ../fish/guestfish-actions.pod:1462
7268 #: ../fish/guestfish-actions.pod:1464
7276 #: ../fish/guestfish-actions.pod:1466 ../src/guestfs-actions.pod:2193
7277 msgid "This returns the verbose messages flag."
7281 #: ../fish/guestfish-actions.pod:1468
7286 #: ../fish/guestfish-actions.pod:1470
7294 #: ../fish/guestfish-actions.pod:1472 ../src/guestfs-actions.pod:2204
7295 msgid "This gets the SELinux security context of the daemon."
7299 #: ../fish/guestfish-actions.pod:1474
7300 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
7304 #: ../fish/guestfish-actions.pod:1477
7309 #: ../fish/guestfish-actions.pod:1479
7312 " getxattr path name\n"
7317 #: ../fish/guestfish-actions.pod:1481
7319 "Get a single extended attribute from file C<path> named C<name>. This call "
7320 "follows symlinks. If you want to lookup an extended attribute for the "
7321 "symlink itself, use L</lgetxattr>."
7325 #: ../fish/guestfish-actions.pod:1485 ../fish/guestfish-actions.pod:2534
7327 "Normally it is better to get all extended attributes from a file in one go "
7328 "by calling L</getxattrs>. However some Linux filesystem implementations are "
7329 "buggy and do not provide a way to list out attributes. For these "
7330 "filesystems (notably ntfs-3g) you have to know the names of the extended "
7331 "attributes you want in advance and call this function."
7335 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:2541
7336 #: ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:3711
7338 "Extended attribute values are blobs of binary data. If there is no extended "
7339 "attribute named C<name>, this returns an error."
7343 #: ../fish/guestfish-actions.pod:1495
7344 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
7348 #: ../fish/guestfish-actions.pod:1497
7353 #: ../fish/guestfish-actions.pod:1499
7361 #: ../fish/guestfish-actions.pod:1501 ../src/guestfs-actions.pod:2250
7363 "This call lists the extended attributes of the file or directory C<path>."
7367 #: ../fish/guestfish-actions.pod:1504 ../src/guestfs-actions.pod:2253
7369 "At the system call level, this is a combination of the L<listxattr(2)> and "
7370 "L<getxattr(2)> calls."
7374 #: ../fish/guestfish-actions.pod:1507
7375 msgid "See also: L</lgetxattrs>, L<attr(5)>."
7379 #: ../fish/guestfish-actions.pod:1509
7384 #: ../fish/guestfish-actions.pod:1511
7387 " glob-expand pattern\n"
7392 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2270
7394 "This command searches for all the pathnames matching C<pattern> according to "
7395 "the wildcard expansion rules used by the shell."
7399 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2274
7401 "If no paths match, then this returns an empty list (note: not an error)."
7405 #: ../fish/guestfish-actions.pod:1520 ../src/guestfs-actions.pod:2277
7407 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
7408 "GLOB_BRACE>. See that manual page for more details."
7412 #: ../fish/guestfish-actions.pod:1524
7417 #: ../fish/guestfish-actions.pod:1526
7420 " grep regex path\n"
7425 #: ../fish/guestfish-actions.pod:1528 ../src/guestfs-actions.pod:2294
7426 msgid "This calls the external C<grep> program and returns the matching lines."
7430 #: ../fish/guestfish-actions.pod:1534
7435 #: ../fish/guestfish-actions.pod:1536
7438 " grepi regex path\n"
7443 #: ../fish/guestfish-actions.pod:1538 ../src/guestfs-actions.pod:2313
7445 "This calls the external C<grep -i> program and returns the matching lines."
7449 #: ../fish/guestfish-actions.pod:1544
7450 msgid "grub-install"
7454 #: ../fish/guestfish-actions.pod:1546
7457 " grub-install root device\n"
7462 #: ../fish/guestfish-actions.pod:1548 ../src/guestfs-actions.pod:2332
7464 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
7465 "with the root directory being C<root>."
7469 #: ../fish/guestfish-actions.pod:1557 ../src/guestfs-actions.pod:2341
7471 "There is currently no way in the API to install grub2, which is used by most "
7472 "modern Linux guests. It is possible to run the grub2 command from the "
7473 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
7477 #: ../fish/guestfish-actions.pod:1564 ../src/guestfs-actions.pod:2348
7479 "This uses C<grub-install> from the host. Unfortunately grub is not always "
7480 "compatible with itself, so this only works in rather narrow circumstances. "
7481 "Careful testing with each guest version is advisable."
7485 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2355
7487 "If grub-install reports the error \"No suitable drive was found in the "
7488 "generated device map.\" it may be that you need to create a C</boot/grub/"
7489 "device.map> file first that contains the mapping between grub device names "
7490 "and Linux device names. It is usually sufficient to create a file "
7495 #: ../fish/guestfish-actions.pod:1578 ../src/guestfs-actions.pod:2362
7503 #: ../fish/guestfish-actions.pod:1580 ../src/guestfs-actions.pod:2364
7504 msgid "replacing C</dev/vda> with the name of the installation device."
7508 #: ../fish/guestfish-actions.pod:1584
7513 #: ../fish/guestfish-actions.pod:1586
7521 #: ../fish/guestfish-actions.pod:1588 ../src/guestfs-actions.pod:2378
7523 "This command returns up to the first 10 lines of a file as a list of strings."
7527 #: ../fish/guestfish-actions.pod:1594
7532 #: ../fish/guestfish-actions.pod:1596
7535 " head-n nrlines path\n"
7540 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2397
7542 "If the parameter C<nrlines> is a positive number, this returns the first "
7543 "C<nrlines> lines of the file C<path>."
7547 #: ../fish/guestfish-actions.pod:1601 ../src/guestfs-actions.pod:2400
7549 "If the parameter C<nrlines> is a negative number, this returns lines from "
7550 "the file C<path>, excluding the last C<nrlines> lines."
7554 #: ../fish/guestfish-actions.pod:1604 ../fish/guestfish-actions.pod:4670
7555 #: ../src/guestfs-actions.pod:2403 ../src/guestfs-actions.pod:7018
7556 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7560 #: ../fish/guestfish-actions.pod:1609
7565 #: ../fish/guestfish-actions.pod:1611
7573 #: ../fish/guestfish-actions.pod:1613 ../src/guestfs-actions.pod:2420
7575 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
7576 "readable, canonical hex dump of the file."
7580 #: ../fish/guestfish-actions.pod:1619
7585 #: ../fish/guestfish-actions.pod:1621
7588 " initrd-cat initrdpath filename\n"
7593 #: ../fish/guestfish-actions.pod:1623 ../src/guestfs-actions.pod:2439
7595 "This command unpacks the file C<filename> from the initrd file called "
7596 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7601 #: ../fish/guestfish-actions.pod:1627 ../src/guestfs-actions.pod:2443
7603 "For example, in guestfish you could use the following command to examine the "
7604 "boot script (usually called C</init>) contained in a Linux initrd or "
7609 #: ../fish/guestfish-actions.pod:1631 ../src/guestfs-actions.pod:2447
7612 " initrd-cat /boot/initrd-<version>.img init\n"
7617 #: ../fish/guestfish-actions.pod:1633
7618 msgid "See also L</initrd-list>."
7622 #: ../fish/guestfish-actions.pod:1638
7627 #: ../fish/guestfish-actions.pod:1640
7630 " initrd-list path\n"
7635 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2466
7636 msgid "This command lists out files contained in an initrd."
7640 #: ../fish/guestfish-actions.pod:1644 ../src/guestfs-actions.pod:2468
7642 "The files are listed without any initial C</> character. The files are "
7643 "listed in the order they appear (not necessarily alphabetical). Directory "
7644 "names are listed as separate items."
7648 #: ../fish/guestfish-actions.pod:1648 ../src/guestfs-actions.pod:2472
7650 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7651 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7656 #: ../fish/guestfish-actions.pod:1652
7657 msgid "inotify-add-watch"
7661 #: ../fish/guestfish-actions.pod:1654
7664 " inotify-add-watch path mask\n"
7669 #: ../fish/guestfish-actions.pod:1656 ../src/guestfs-actions.pod:2489
7670 msgid "Watch C<path> for the events listed in C<mask>."
7674 #: ../fish/guestfish-actions.pod:1658 ../src/guestfs-actions.pod:2491
7676 "Note that if C<path> is a directory then events within that directory are "
7677 "watched, but this does I<not> happen recursively (in subdirectories)."
7681 #: ../fish/guestfish-actions.pod:1662 ../src/guestfs-actions.pod:2495
7683 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7684 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7688 #: ../fish/guestfish-actions.pod:1666
7689 msgid "inotify-close"
7693 #: ../fish/guestfish-actions.pod:1668
7701 #: ../fish/guestfish-actions.pod:1670 ../src/guestfs-actions.pod:2508
7703 "This closes the inotify handle which was previously opened by inotify_init. "
7704 "It removes all watches, throws away any pending events, and deallocates all "
7709 #: ../fish/guestfish-actions.pod:1674
7710 msgid "inotify-files"
7714 #: ../fish/guestfish-actions.pod:1676
7722 #: ../fish/guestfish-actions.pod:1678
7724 "This function is a helpful wrapper around L</inotify-read> which just "
7725 "returns a list of pathnames of objects that were touched. The returned "
7726 "pathnames are sorted and deduplicated."
7730 #: ../fish/guestfish-actions.pod:1682
7731 msgid "inotify-init"
7735 #: ../fish/guestfish-actions.pod:1684
7738 " inotify-init maxevents\n"
7743 #: ../fish/guestfish-actions.pod:1686 ../src/guestfs-actions.pod:2537
7745 "This command creates a new inotify handle. The inotify subsystem can be "
7746 "used to notify events which happen to objects in the guest filesystem."
7750 #: ../fish/guestfish-actions.pod:1690
7752 "C<maxevents> is the maximum number of events which will be queued up between "
7753 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
7754 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
7755 "default was 16384 events. Beyond this limit, the kernel throws away events, "
7756 "but records the fact that it threw them away by setting a flag "
7757 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
7761 #: ../fish/guestfish-actions.pod:1700
7763 "Before any events are generated, you have to add some watches to the "
7764 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
7765 "L</inotify-watch-all>."
7769 #: ../fish/guestfish-actions.pod:1706
7771 "Queued up events should be read periodically by calling L</inotify-read> (or "
7772 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
7773 "If you don't read the events out often enough then you risk the internal "
7774 "queue overflowing."
7778 #: ../fish/guestfish-actions.pod:1713
7780 "The handle should be closed after use by calling L</inotify-close>. This "
7781 "also removes any watches automatically."
7785 #: ../fish/guestfish-actions.pod:1717 ../src/guestfs-actions.pod:2568
7787 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7788 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7789 "that there is one global inotify handle per libguestfs instance."
7793 #: ../fish/guestfish-actions.pod:1722
7794 msgid "inotify-read"
7798 #: ../fish/guestfish-actions.pod:1724
7806 #: ../fish/guestfish-actions.pod:1726 ../src/guestfs-actions.pod:2582
7808 "Return the complete queue of events that have happened since the previous "
7813 #: ../fish/guestfish-actions.pod:1729 ../src/guestfs-actions.pod:2585
7814 msgid "If no events have happened, this returns an empty list."
7818 #: ../fish/guestfish-actions.pod:1731 ../src/guestfs-actions.pod:2587
7820 "I<Note>: In order to make sure that all events have been read, you must call "
7821 "this function repeatedly until it returns an empty list. The reason is that "
7822 "the call will read events up to the maximum appliance-to-host message size "
7823 "and leave remaining events in the queue."
7827 #: ../fish/guestfish-actions.pod:1737
7828 msgid "inotify-rm-watch"
7832 #: ../fish/guestfish-actions.pod:1739
7835 " inotify-rm-watch wd\n"
7840 #: ../fish/guestfish-actions.pod:1741
7841 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
7845 #: ../fish/guestfish-actions.pod:1744
7846 msgid "inspect-get-arch"
7850 #: ../fish/guestfish-actions.pod:1746
7853 " inspect-get-arch root\n"
7858 #: ../fish/guestfish-actions.pod:1748
7860 "This returns the architecture of the inspected operating system. The "
7861 "possible return values are listed under L</file-architecture>."
7865 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2622
7867 "If the architecture could not be determined, then the string C<unknown> is "
7872 #: ../fish/guestfish-actions.pod:1755 ../fish/guestfish-actions.pod:1838
7873 #: ../fish/guestfish-actions.pod:1917 ../fish/guestfish-actions.pod:1929
7874 #: ../fish/guestfish-actions.pod:2013 ../fish/guestfish-actions.pod:2074
7875 #: ../fish/guestfish-actions.pod:2095 ../fish/guestfish-actions.pod:2109
7876 #: ../fish/guestfish-actions.pod:2149 ../fish/guestfish-actions.pod:2181
7877 #: ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2207
7878 #: ../fish/guestfish-actions.pod:2217 ../fish/guestfish-actions.pod:2227
7879 #: ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2335
7880 #: ../fish/guestfish-actions.pod:2369 ../src/guestfs-actions.pod:2625
7881 #: ../src/guestfs-actions.pod:2715 ../src/guestfs-actions.pod:2819
7882 #: ../src/guestfs-actions.pod:2838 ../src/guestfs-actions.pod:2969
7883 #: ../src/guestfs-actions.pod:3052 ../src/guestfs-actions.pod:3080
7884 #: ../src/guestfs-actions.pod:3101 ../src/guestfs-actions.pod:3154
7885 #: ../src/guestfs-actions.pod:3194 ../src/guestfs-actions.pod:3214
7886 #: ../src/guestfs-actions.pod:3234 ../src/guestfs-actions.pod:3251
7887 #: ../src/guestfs-actions.pod:3267 ../src/guestfs-actions.pod:3285
7888 #: ../src/guestfs-actions.pod:3387 ../src/guestfs-actions.pod:3428
7889 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7893 #: ../fish/guestfish-actions.pod:1757
7894 msgid "inspect-get-distro"
7898 #: ../fish/guestfish-actions.pod:1759
7901 " inspect-get-distro root\n"
7906 #: ../fish/guestfish-actions.pod:1761 ../src/guestfs-actions.pod:2638
7908 "This returns the distro (distribution) of the inspected operating system."
7912 #: ../fish/guestfish-actions.pod:1764 ../src/guestfs-actions.pod:2641
7913 msgid "Currently defined distros are:"
7917 #: ../fish/guestfish-actions.pod:1768 ../src/guestfs-actions.pod:2645
7918 msgid "\"archlinux\""
7922 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2647
7927 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2649
7932 #: ../fish/guestfish-actions.pod:1774 ../src/guestfs-actions.pod:2651
7937 #: ../fish/guestfish-actions.pod:1776 ../src/guestfs-actions.pod:2653
7942 #: ../fish/guestfish-actions.pod:1778 ../src/guestfs-actions.pod:2655
7947 #: ../fish/guestfish-actions.pod:1780 ../src/guestfs-actions.pod:2657
7952 #: ../fish/guestfish-actions.pod:1782 ../src/guestfs-actions.pod:2659
7957 #: ../fish/guestfish-actions.pod:1784 ../src/guestfs-actions.pod:2661
7962 #: ../fish/guestfish-actions.pod:1786 ../src/guestfs-actions.pod:2663
7967 #: ../fish/guestfish-actions.pod:1788 ../src/guestfs-actions.pod:2665
7968 msgid "\"linuxmint\""
7972 #: ../fish/guestfish-actions.pod:1790 ../src/guestfs-actions.pod:2667
7977 #: ../fish/guestfish-actions.pod:1792 ../src/guestfs-actions.pod:2669
7978 msgid "\"mandriva\""
7982 #: ../fish/guestfish-actions.pod:1794 ../src/guestfs-actions.pod:2671
7987 #: ../fish/guestfish-actions.pod:1796 ../src/guestfs-actions.pod:2673
7992 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2675
7997 #: ../fish/guestfish-actions.pod:1800 ../src/guestfs-actions.pod:2677
8002 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2679
8007 #: ../fish/guestfish-actions.pod:1804 ../src/guestfs-actions.pod:2681
8008 msgid "\"redhat-based\""
8012 #: ../fish/guestfish-actions.pod:1806 ../src/guestfs-actions.pod:2683
8013 msgid "Some Red Hat-derived distro."
8017 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2685
8022 #: ../fish/guestfish-actions.pod:1810 ../src/guestfs-actions.pod:2687
8023 msgid "Red Hat Enterprise Linux."
8027 #: ../fish/guestfish-actions.pod:1812 ../src/guestfs-actions.pod:2689
8028 msgid "\"scientificlinux\""
8032 #: ../fish/guestfish-actions.pod:1814 ../src/guestfs-actions.pod:2691
8033 msgid "Scientific Linux."
8037 #: ../fish/guestfish-actions.pod:1816 ../src/guestfs-actions.pod:2693
8038 msgid "\"slackware\""
8042 #: ../fish/guestfish-actions.pod:1818 ../src/guestfs-actions.pod:2695
8047 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2697
8052 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2699
8057 #: ../fish/guestfish-actions.pod:1824 ../fish/guestfish-actions.pod:1908
8058 #: ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:2701
8059 #: ../src/guestfs-actions.pod:2810 ../src/guestfs-actions.pod:3185
8064 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2703
8065 msgid "The distro could not be determined."
8069 #: ../fish/guestfish-actions.pod:1828 ../fish/guestfish-actions.pod:2164
8070 #: ../src/guestfs-actions.pod:2705 ../src/guestfs-actions.pod:3177
8075 #: ../fish/guestfish-actions.pod:1830 ../src/guestfs-actions.pod:2707
8077 "Windows does not have distributions. This string is returned if the OS type "
8082 #: ../fish/guestfish-actions.pod:1835 ../fish/guestfish-actions.pod:1914
8083 #: ../fish/guestfish-actions.pod:2178 ../src/guestfs-actions.pod:2712
8084 #: ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:3191
8086 "Future versions of libguestfs may return other strings here. The caller "
8087 "should be prepared to handle any string."
8091 #: ../fish/guestfish-actions.pod:1840
8092 msgid "inspect-get-drive-mappings"
8096 #: ../fish/guestfish-actions.pod:1842
8099 " inspect-get-drive-mappings root\n"
8104 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2728
8106 "This call is useful for Windows which uses a primitive system of assigning "
8107 "drive letters (like \"C:\") to partitions. This inspection API examines the "
8108 "Windows Registry to find out how disks/partitions are mapped to drive "
8109 "letters, and returns a hash table as in the example below:"
8113 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2734
8123 #: ../fish/guestfish-actions.pod:1854 ../src/guestfs-actions.pod:2738
8125 "Note that keys are drive letters. For Windows, the key is case insensitive "
8126 "and just contains the drive letter, without the customary colon separator "
8131 #: ../fish/guestfish-actions.pod:1858 ../src/guestfs-actions.pod:2742
8133 "In future we may support other operating systems that also used drive "
8134 "letters, but the keys for those might not be case insensitive and might be "
8135 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
8140 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2747
8142 "For Windows guests, currently only hard drive mappings are returned. "
8143 "Removable disks (eg. DVD-ROMs) are ignored."
8147 #: ../fish/guestfish-actions.pod:1866 ../src/guestfs-actions.pod:2750
8149 "For guests that do not use drive mappings, or if the drive mappings could "
8150 "not be determined, this returns an empty hash table."
8154 #: ../fish/guestfish-actions.pod:1869
8156 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8157 "get-mountpoints>, L</inspect-get-filesystems>."
8161 #: ../fish/guestfish-actions.pod:1873
8162 msgid "inspect-get-filesystems"
8166 #: ../fish/guestfish-actions.pod:1875
8169 " inspect-get-filesystems root\n"
8174 #: ../fish/guestfish-actions.pod:1877 ../src/guestfs-actions.pod:2771
8176 "This returns a list of all the filesystems that we think are associated with "
8177 "this operating system. This includes the root filesystem, other ordinary "
8178 "filesystems, and non-mounted devices like swap partitions."
8182 #: ../fish/guestfish-actions.pod:1882 ../src/guestfs-actions.pod:2776
8184 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8185 "to be shared between operating systems."
8189 #: ../fish/guestfish-actions.pod:1885
8191 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8196 #: ../fish/guestfish-actions.pod:1888
8197 msgid "inspect-get-format"
8201 #: ../fish/guestfish-actions.pod:1890
8204 " inspect-get-format root\n"
8209 #: ../fish/guestfish-actions.pod:1892 ../src/guestfs-actions.pod:2794
8211 "This returns the format of the inspected operating system. You can use it "
8212 "to detect install images, live CDs and similar."
8216 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:2797
8217 msgid "Currently defined formats are:"
8221 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2801
8222 msgid "\"installed\""
8226 #: ../fish/guestfish-actions.pod:1901 ../src/guestfs-actions.pod:2803
8227 msgid "This is an installed operating system."
8231 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2805
8232 msgid "\"installer\""
8236 #: ../fish/guestfish-actions.pod:1905 ../src/guestfs-actions.pod:2807
8238 "The disk image being inspected is not an installed operating system, but a "
8239 "I<bootable> install disk, live CD, or similar."
8243 #: ../fish/guestfish-actions.pod:1910 ../src/guestfs-actions.pod:2812
8244 msgid "The format of this disk image is not known."
8248 #: ../fish/guestfish-actions.pod:1919
8249 msgid "inspect-get-hostname"
8253 #: ../fish/guestfish-actions.pod:1921
8256 " inspect-get-hostname root\n"
8261 #: ../fish/guestfish-actions.pod:1923 ../src/guestfs-actions.pod:2832
8263 "This function returns the hostname of the operating system as found by "
8264 "inspection of the guest's configuration files."
8268 #: ../fish/guestfish-actions.pod:1926 ../src/guestfs-actions.pod:2835
8270 "If the hostname could not be determined, then the string C<unknown> is "
8275 #: ../fish/guestfish-actions.pod:1931
8276 msgid "inspect-get-icon"
8280 #: ../fish/guestfish-actions.pod:1933
8283 " inspect-get-icon root [favicon:..] [highquality:..]\n"
8288 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2861
8290 "This function returns an icon corresponding to the inspected operating "
8291 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
8292 "to PNG if necessary)."
8296 #: ../fish/guestfish-actions.pod:1939 ../src/guestfs-actions.pod:2865
8298 "If it was not possible to get an icon this function returns a zero-length "
8299 "(non-NULL) buffer. I<Callers must check for this case>."
8303 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:2868
8305 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
8306 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
8307 "this file will be returned. You can disable favicons by passing the "
8308 "optional C<favicon> boolean as false (default is true)."
8312 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2874
8314 "If finding the favicon fails, then we look in other places in the guest for "
8319 #: ../fish/guestfish-actions.pod:1951 ../src/guestfs-actions.pod:2877
8321 "If the optional C<highquality> boolean is true then only high quality icons "
8322 "are returned, which means only icons of high resolution with an alpha "
8323 "channel. The default (false) is to return any icon we can, even if it is of "
8324 "substandard quality."
8328 #: ../fish/guestfish-actions.pod:1962 ../src/guestfs-actions.pod:2888
8330 "Unlike most other inspection API calls, the guest's disks must be mounted up "
8331 "before you call this, since it needs to read information from the guest "
8332 "filesystem during the call."
8336 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2894
8338 "B<Security:> The icon data comes from the untrusted guest, and should be "
8339 "treated with caution. PNG files have been known to contain exploits. "
8340 "Ensure that libpng (or other relevant libraries) are fully up to date before "
8341 "trying to process or display the icon."
8345 #: ../fish/guestfish-actions.pod:1976 ../src/guestfs-actions.pod:2902
8347 "The PNG image returned can be any size. It might not be square. Libguestfs "
8348 "tries to return the largest, highest quality icon available. The "
8349 "application must scale the icon to the required size."
8353 #: ../fish/guestfish-actions.pod:1983 ../src/guestfs-actions.pod:2909
8355 "Extracting icons from Windows guests requires the external C<wrestool> "
8356 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
8357 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
8358 "installed separately."
8362 #: ../fish/guestfish-actions.pod:1990 ../src/guestfs-actions.pod:2916
8364 "Operating system icons are usually trademarks. Seek legal advice before "
8365 "using trademarks in applications."
8369 #: ../fish/guestfish-actions.pod:1997
8370 msgid "inspect-get-major-version"
8374 #: ../fish/guestfish-actions.pod:1999
8377 " inspect-get-major-version root\n"
8382 #: ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:2957
8384 "This returns the major version number of the inspected operating system."
8388 #: ../fish/guestfish-actions.pod:2004 ../src/guestfs-actions.pod:2960
8390 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8391 "popular public names used by the operating system. Notably the operating "
8392 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8393 "1). You can find out the real versions corresponding to releases of Windows "
8394 "by consulting Wikipedia or MSDN."
8398 #: ../fish/guestfish-actions.pod:2011 ../fish/guestfish-actions.pod:2022
8399 #: ../src/guestfs-actions.pod:2967 ../src/guestfs-actions.pod:2984
8400 msgid "If the version could not be determined, then C<0> is returned."
8404 #: ../fish/guestfish-actions.pod:2015
8405 msgid "inspect-get-minor-version"
8409 #: ../fish/guestfish-actions.pod:2017
8412 " inspect-get-minor-version root\n"
8417 #: ../fish/guestfish-actions.pod:2019 ../src/guestfs-actions.pod:2981
8419 "This returns the minor version number of the inspected operating system."
8423 #: ../fish/guestfish-actions.pod:2024
8425 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8426 "get-major-version>."
8430 #: ../fish/guestfish-actions.pod:2027
8431 msgid "inspect-get-mountpoints"
8435 #: ../fish/guestfish-actions.pod:2029
8438 " inspect-get-mountpoints root\n"
8443 #: ../fish/guestfish-actions.pod:2031 ../src/guestfs-actions.pod:2999
8445 "This returns a hash of where we think the filesystems associated with this "
8446 "operating system should be mounted. Callers should note that this is at "
8447 "best an educated guess made by reading configuration files such as C</etc/"
8448 "fstab>. I<In particular note> that this may return filesystems which are "
8449 "non-existent or not mountable and callers should be prepared to handle or "
8450 "ignore failures if they try to mount them."
8454 #: ../fish/guestfish-actions.pod:2040 ../src/guestfs-actions.pod:3008
8456 "Each element in the returned hashtable has a key which is the path of the "
8457 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8458 "mounted there (eg. C</dev/sda1>)."
8462 #: ../fish/guestfish-actions.pod:2045 ../src/guestfs-actions.pod:3013
8464 "Non-mounted devices such as swap devices are I<not> returned in this list."
8468 #: ../fish/guestfish-actions.pod:2048
8470 "For operating systems like Windows which still use drive letters, this call "
8471 "will only return an entry for the first drive \"mounted on\" C</>. For "
8472 "information about the mapping of drive letters to partitions, see L</inspect-"
8473 "get-drive-mappings>."
8477 #: ../fish/guestfish-actions.pod:2054
8479 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8484 #: ../fish/guestfish-actions.pod:2057
8485 msgid "inspect-get-package-format"
8489 #: ../fish/guestfish-actions.pod:2059
8492 " inspect-get-package-format root\n"
8497 #: ../fish/guestfish-actions.pod:2061
8499 "This function and L</inspect-get-package-management> return the package "
8500 "format and package management tool used by the inspected operating system. "
8501 "For example for Fedora these functions would return C<rpm> (package format) "
8502 "and C<yum> (package management)."
8506 #: ../fish/guestfish-actions.pod:2067 ../src/guestfs-actions.pod:3045
8508 "This returns the string C<unknown> if we could not determine the package "
8509 "format I<or> if the operating system does not have a real packaging system "
8514 #: ../fish/guestfish-actions.pod:2071 ../src/guestfs-actions.pod:3049
8516 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
8517 "Future versions of libguestfs may return other strings."
8521 #: ../fish/guestfish-actions.pod:2076
8522 msgid "inspect-get-package-management"
8526 #: ../fish/guestfish-actions.pod:2078
8529 " inspect-get-package-management root\n"
8534 #: ../fish/guestfish-actions.pod:2080
8536 "L</inspect-get-package-format> and this function return the package format "
8537 "and package management tool used by the inspected operating system. For "
8538 "example for Fedora these functions would return C<rpm> (package format) and "
8539 "C<yum> (package management)."
8543 #: ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:3071
8545 "This returns the string C<unknown> if we could not determine the package "
8546 "management tool I<or> if the operating system does not have a real packaging "
8547 "system (eg. Windows)."
8551 #: ../fish/guestfish-actions.pod:2090 ../src/guestfs-actions.pod:3075
8553 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
8554 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
8555 "libguestfs may return other strings."
8559 #: ../fish/guestfish-actions.pod:2097
8560 msgid "inspect-get-product-name"
8564 #: ../fish/guestfish-actions.pod:2099
8567 " inspect-get-product-name root\n"
8572 #: ../fish/guestfish-actions.pod:2101 ../src/guestfs-actions.pod:3093
8574 "This returns the product name of the inspected operating system. The "
8575 "product name is generally some freeform string which can be displayed to the "
8576 "user, but should not be parsed by programs."
8580 #: ../fish/guestfish-actions.pod:2106 ../src/guestfs-actions.pod:3098
8582 "If the product name could not be determined, then the string C<unknown> is "
8587 #: ../fish/guestfish-actions.pod:2111
8588 msgid "inspect-get-product-variant"
8592 #: ../fish/guestfish-actions.pod:2113
8595 " inspect-get-product-variant root\n"
8600 #: ../fish/guestfish-actions.pod:2115 ../src/guestfs-actions.pod:3114
8601 msgid "This returns the product variant of the inspected operating system."
8605 #: ../fish/guestfish-actions.pod:2118 ../src/guestfs-actions.pod:3117
8607 "For Windows guests, this returns the contents of the Registry key C<HKLM"
8608 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
8609 "is usually a string such as C<Client> or C<Server> (other values are "
8610 "possible). This can be used to distinguish consumer and enterprise versions "
8611 "of Windows that have the same version number (for example, Windows 7 and "
8612 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8613 "the latter is C<Server>)."
8617 #: ../fish/guestfish-actions.pod:2127 ../src/guestfs-actions.pod:3126
8619 "For enterprise Linux guests, in future we intend this to return the product "
8620 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8621 "implemented at present."
8625 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3130
8627 "If the product variant could not be determined, then the string C<unknown> "
8632 #: ../fish/guestfish-actions.pod:2134
8634 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8635 "get-product-name>, L</inspect-get-major-version>."
8639 #: ../fish/guestfish-actions.pod:2138
8640 msgid "inspect-get-roots"
8644 #: ../fish/guestfish-actions.pod:2140
8647 " inspect-get-roots\n"
8652 #: ../fish/guestfish-actions.pod:2142
8654 "This function is a convenient way to get the list of root devices, as "
8655 "returned from a previous call to L</inspect-os>, but without redoing the "
8656 "whole inspection process."
8660 #: ../fish/guestfish-actions.pod:2146
8662 "This returns an empty list if either no root devices were found or the "
8663 "caller has not called L</inspect-os>."
8667 #: ../fish/guestfish-actions.pod:2151
8668 msgid "inspect-get-type"
8672 #: ../fish/guestfish-actions.pod:2153
8675 " inspect-get-type root\n"
8680 #: ../fish/guestfish-actions.pod:2155 ../src/guestfs-actions.pod:3168
8682 "This returns the type of the inspected operating system. Currently defined "
8687 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3173
8692 #: ../fish/guestfish-actions.pod:2162 ../src/guestfs-actions.pod:3175
8693 msgid "Any Linux-based operating system."
8697 #: ../fish/guestfish-actions.pod:2166 ../src/guestfs-actions.pod:3179
8698 msgid "Any Microsoft Windows operating system."
8702 #: ../fish/guestfish-actions.pod:2168 ../src/guestfs-actions.pod:3181
8707 #: ../fish/guestfish-actions.pod:2170 ../src/guestfs-actions.pod:3183
8712 #: ../fish/guestfish-actions.pod:2174 ../src/guestfs-actions.pod:3187
8713 msgid "The operating system type could not be determined."
8717 #: ../fish/guestfish-actions.pod:2183
8718 msgid "inspect-get-windows-current-control-set"
8722 #: ../fish/guestfish-actions.pod:2185
8725 " inspect-get-windows-current-control-set root\n"
8730 #: ../fish/guestfish-actions.pod:2187 ../src/guestfs-actions.pod:3207
8732 "This returns the Windows CurrentControlSet of the inspected guest. The "
8733 "CurrentControlSet is a registry key name such as C<ControlSet001>."
8737 #: ../fish/guestfish-actions.pod:2190 ../src/guestfs-actions.pod:3210
8739 "This call assumes that the guest is Windows and that the Registry could be "
8740 "examined by inspection. If this is not the case then an error is returned."
8744 #: ../fish/guestfish-actions.pod:2196
8745 msgid "inspect-get-windows-systemroot"
8749 #: ../fish/guestfish-actions.pod:2198
8752 " inspect-get-windows-systemroot root\n"
8757 #: ../fish/guestfish-actions.pod:2200 ../src/guestfs-actions.pod:3227
8759 "This returns the Windows systemroot of the inspected guest. The systemroot "
8760 "is a directory path such as C</WINDOWS>."
8764 #: ../fish/guestfish-actions.pod:2203 ../src/guestfs-actions.pod:3230
8766 "This call assumes that the guest is Windows and that the systemroot could be "
8767 "determined by inspection. If this is not the case then an error is returned."
8771 #: ../fish/guestfish-actions.pod:2209
8772 msgid "inspect-is-live"
8776 #: ../fish/guestfish-actions.pod:2211
8779 " inspect-is-live root\n"
8784 #: ../fish/guestfish-actions.pod:2213
8786 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8787 "then this returns true if a live image was detected on the disk."
8791 #: ../fish/guestfish-actions.pod:2219
8792 msgid "inspect-is-multipart"
8796 #: ../fish/guestfish-actions.pod:2221
8799 " inspect-is-multipart root\n"
8804 #: ../fish/guestfish-actions.pod:2223
8806 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8807 "then this returns true if the disk is part of a set."
8811 #: ../fish/guestfish-actions.pod:2229
8812 msgid "inspect-is-netinst"
8816 #: ../fish/guestfish-actions.pod:2231
8819 " inspect-is-netinst root\n"
8824 #: ../fish/guestfish-actions.pod:2233
8826 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8827 "then this returns true if the disk is a network installer, ie. not a self-"
8828 "contained install CD but one which is likely to require network access to "
8829 "complete the install."
8833 #: ../fish/guestfish-actions.pod:2241
8834 msgid "inspect-list-applications"
8838 #: ../fish/guestfish-actions.pod:2243
8841 " inspect-list-applications root\n"
8846 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3297
8847 msgid "Return the list of applications installed in the operating system."
8851 #: ../fish/guestfish-actions.pod:2247
8853 "I<Note:> This call works differently from other parts of the inspection "
8854 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
8855 "then mount up the disks, before calling this. Listing applications is a "
8856 "significantly more difficult operation which requires access to the full "
8857 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
8858 "are just returning data cached in the libguestfs handle, this call actually "
8859 "reads parts of the mounted filesystems during the call."
8863 #: ../fish/guestfish-actions.pod:2257 ../src/guestfs-actions.pod:3309
8865 "This returns an empty list if the inspection code was not able to determine "
8866 "the list of applications."
8870 #: ../fish/guestfish-actions.pod:2260 ../src/guestfs-actions.pod:3312
8871 msgid "The application structure contains the following fields:"
8875 #: ../fish/guestfish-actions.pod:2264 ../src/guestfs-actions.pod:3316
8880 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3318
8882 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8883 "guests, this is the package name."
8887 #: ../fish/guestfish-actions.pod:2269 ../src/guestfs-actions.pod:3321
8888 msgid "C<app_display_name>"
8892 #: ../fish/guestfish-actions.pod:2271 ../src/guestfs-actions.pod:3323
8894 "The display name of the application, sometimes localized to the install "
8895 "language of the guest operating system."
8899 #: ../fish/guestfish-actions.pod:2274 ../src/guestfs-actions.pod:3326
8901 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8902 "to display something can use C<app_name> instead."
8906 #: ../fish/guestfish-actions.pod:2277 ../src/guestfs-actions.pod:3329
8907 msgid "C<app_epoch>"
8911 #: ../fish/guestfish-actions.pod:2279 ../src/guestfs-actions.pod:3331
8913 "For package managers which use epochs, this contains the epoch of the "
8914 "package (an integer). If unavailable, this is returned as C<0>."
8918 #: ../fish/guestfish-actions.pod:2282 ../src/guestfs-actions.pod:3334
8919 msgid "C<app_version>"
8923 #: ../fish/guestfish-actions.pod:2284 ../src/guestfs-actions.pod:3336
8925 "The version string of the application or package. If unavailable this is "
8926 "returned as an empty string C<\"\">."
8930 #: ../fish/guestfish-actions.pod:2287 ../src/guestfs-actions.pod:3339
8931 msgid "C<app_release>"
8935 #: ../fish/guestfish-actions.pod:2289 ../src/guestfs-actions.pod:3341
8937 "The release string of the application or package, for package managers that "
8938 "use this. If unavailable this is returned as an empty string C<\"\">."
8942 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3345
8943 msgid "C<app_install_path>"
8947 #: ../fish/guestfish-actions.pod:2295 ../src/guestfs-actions.pod:3347
8949 "The installation path of the application (on operating systems such as "
8950 "Windows which use installation paths). This path is in the format used by "
8951 "the guest operating system, it is not a libguestfs path."
8955 #: ../fish/guestfish-actions.pod:2300 ../src/guestfs-actions.pod:3352
8956 msgid "If unavailable this is returned as an empty string C<\"\">."
8960 #: ../fish/guestfish-actions.pod:2302 ../src/guestfs-actions.pod:3354
8961 msgid "C<app_trans_path>"
8965 #: ../fish/guestfish-actions.pod:2304 ../src/guestfs-actions.pod:3356
8967 "The install path translated into a libguestfs path. If unavailable this is "
8968 "returned as an empty string C<\"\">."
8972 #: ../fish/guestfish-actions.pod:2307 ../src/guestfs-actions.pod:3359
8973 msgid "C<app_publisher>"
8977 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3361
8979 "The name of the publisher of the application, for package managers that use "
8980 "this. If unavailable this is returned as an empty string C<\"\">."
8984 #: ../fish/guestfish-actions.pod:2313 ../src/guestfs-actions.pod:3365
8989 #: ../fish/guestfish-actions.pod:2315 ../src/guestfs-actions.pod:3367
8991 "The URL (eg. upstream URL) of the application. If unavailable this is "
8992 "returned as an empty string C<\"\">."
8996 #: ../fish/guestfish-actions.pod:2318 ../src/guestfs-actions.pod:3370
8997 msgid "C<app_source_package>"
9001 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3372
9003 "For packaging systems which support this, the name of the source package. "
9004 "If unavailable this is returned as an empty string C<\"\">."
9008 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3375
9009 msgid "C<app_summary>"
9013 #: ../fish/guestfish-actions.pod:2325 ../src/guestfs-actions.pod:3377
9015 "A short (usually one line) description of the application or package. If "
9016 "unavailable this is returned as an empty string C<\"\">."
9020 #: ../fish/guestfish-actions.pod:2328 ../src/guestfs-actions.pod:3380
9021 msgid "C<app_description>"
9025 #: ../fish/guestfish-actions.pod:2330 ../src/guestfs-actions.pod:3382
9027 "A longer description of the application or package. If unavailable this is "
9028 "returned as an empty string C<\"\">."
9032 #: ../fish/guestfish-actions.pod:2337
9037 #: ../fish/guestfish-actions.pod:2339
9045 #: ../fish/guestfish-actions.pod:2341 ../src/guestfs-actions.pod:3400
9047 "This function uses other libguestfs functions and certain heuristics to "
9048 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9049 "for operating systems."
9053 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3404
9054 msgid "The list returned is empty if no operating systems were found."
9058 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3406
9060 "If one operating system was found, then this returns a list with a single "
9061 "element, which is the name of the root filesystem of this operating system. "
9062 "It is also possible for this function to return a list containing more than "
9063 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9064 "element being the root filesystem of one of the operating systems."
9068 #: ../fish/guestfish-actions.pod:2354
9070 "You can pass the root string(s) returned to other L</inspect-get-*> "
9071 "functions in order to query further information about each operating system, "
9072 "such as the name and version."
9076 #: ../fish/guestfish-actions.pod:2359
9078 "This function uses other libguestfs features such as L</mount-ro> and L</"
9079 "umount-all> in order to mount and unmount filesystems and look at the "
9080 "contents. This should be called with no disks currently mounted. The "
9081 "function may also use Augeas, so any existing Augeas handle will be closed."
9085 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3424
9087 "This function cannot decrypt encrypted disks. The caller must do that first "
9088 "(supplying the necessary keys) if the disk is encrypted."
9092 #: ../fish/guestfish-actions.pod:2371 ../fish/guestfish-actions.pod:2569
9093 #: ../fish/guestfish-actions.pod:2628
9094 msgid "See also L</list-filesystems>."
9098 #: ../fish/guestfish-actions.pod:2373
9103 #: ../fish/guestfish-actions.pod:2375
9106 " is-blockdev path\n"
9111 #: ../fish/guestfish-actions.pod:2377 ../src/guestfs-actions.pod:3444
9113 "This returns C<true> if and only if there is a block device with the given "
9118 #: ../fish/guestfish-actions.pod:2380 ../fish/guestfish-actions.pod:2398
9119 #: ../fish/guestfish-actions.pod:2417 ../fish/guestfish-actions.pod:2426
9120 #: ../fish/guestfish-actions.pod:2436 ../fish/guestfish-actions.pod:2470
9121 #: ../fish/guestfish-actions.pod:2479
9122 msgid "See also L</stat>."
9126 #: ../fish/guestfish-actions.pod:2382
9131 #: ../fish/guestfish-actions.pod:2384
9139 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3458
9141 "This returns true iff this handle is busy processing a command (in the "
9146 #: ../fish/guestfish-actions.pod:2391
9151 #: ../fish/guestfish-actions.pod:2393
9154 " is-chardev path\n"
9159 #: ../fish/guestfish-actions.pod:2395 ../src/guestfs-actions.pod:3473
9161 "This returns C<true> if and only if there is a character device with the "
9162 "given C<path> name."
9166 #: ../fish/guestfish-actions.pod:2400
9171 #: ../fish/guestfish-actions.pod:2402
9179 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3487
9181 "This returns true iff this handle is being configured (in the C<CONFIG> "
9186 #: ../fish/guestfish-actions.pod:2409
9191 #: ../fish/guestfish-actions.pod:2411
9199 #: ../fish/guestfish-actions.pod:2413 ../src/guestfs-actions.pod:3502
9201 "This returns C<true> if and only if there is a directory with the given "
9202 "C<path> name. Note that it returns false for other objects like files."
9206 #: ../fish/guestfish-actions.pod:2419
9211 #: ../fish/guestfish-actions.pod:2421
9219 #: ../fish/guestfish-actions.pod:2423 ../src/guestfs-actions.pod:3518
9221 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9222 "given C<path> name."
9226 #: ../fish/guestfish-actions.pod:2428
9231 #: ../fish/guestfish-actions.pod:2430
9239 #: ../fish/guestfish-actions.pod:2432 ../src/guestfs-actions.pod:3533
9241 "This returns C<true> if and only if there is a regular file with the given "
9242 "C<path> name. Note that it returns false for other objects like directories."
9246 #: ../fish/guestfish-actions.pod:2438
9247 msgid "is-launching"
9251 #: ../fish/guestfish-actions.pod:2440
9259 #: ../fish/guestfish-actions.pod:2442 ../src/guestfs-actions.pod:3548
9261 "This returns true iff this handle is launching the subprocess (in the "
9262 "C<LAUNCHING> state)."
9266 #: ../fish/guestfish-actions.pod:2447
9271 #: ../fish/guestfish-actions.pod:2449
9279 #: ../fish/guestfish-actions.pod:2451 ../src/guestfs-actions.pod:3563
9281 "This command tests whether C<device> is a logical volume, and returns true "
9282 "iff this is the case."
9286 #: ../fish/guestfish-actions.pod:2454
9291 #: ../fish/guestfish-actions.pod:2456
9299 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3575
9301 "This returns true iff this handle is ready to accept commands (in the "
9306 #: ../fish/guestfish-actions.pod:2463
9311 #: ../fish/guestfish-actions.pod:2465
9319 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3590
9321 "This returns C<true> if and only if there is a Unix domain socket with the "
9322 "given C<path> name."
9326 #: ../fish/guestfish-actions.pod:2472
9331 #: ../fish/guestfish-actions.pod:2474
9334 " is-symlink path\n"
9339 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3605
9341 "This returns C<true> if and only if there is a symbolic link with the given "
9346 #: ../fish/guestfish-actions.pod:2481
9351 #: ../fish/guestfish-actions.pod:2483
9359 #: ../fish/guestfish-actions.pod:2485 ../src/guestfs-actions.pod:3620
9361 "This returns true iff the file exists and the file is empty or it contains "
9366 #: ../fish/guestfish-actions.pod:2488
9367 msgid "is-zero-device"
9371 #: ../fish/guestfish-actions.pod:2490
9374 " is-zero-device device\n"
9379 #: ../fish/guestfish-actions.pod:2492 ../src/guestfs-actions.pod:3633
9380 msgid "This returns true iff the device exists and contains all zero bytes."
9384 #: ../fish/guestfish-actions.pod:2494 ../src/guestfs-actions.pod:3635
9385 msgid "Note that for large devices this can take a long time to run."
9389 #: ../fish/guestfish-actions.pod:2496
9390 msgid "kill-subprocess"
9394 #: ../fish/guestfish-actions.pod:2498
9397 " kill-subprocess\n"
9402 #: ../fish/guestfish-actions.pod:2500 ../src/guestfs-actions.pod:3646
9403 msgid "This kills the qemu subprocess. You should never need to call this."
9407 #: ../fish/guestfish-actions.pod:2502
9412 #: ../fish/guestfish-actions.pod:2504
9417 #: ../fish/guestfish-actions.pod:2506
9425 #: ../fish/guestfish-actions.pod:2508 ../src/guestfs-actions.pod:3657
9427 "Internally libguestfs is implemented by running a virtual machine using "
9432 #: ../fish/guestfish-actions.pod:2511 ../src/guestfs-actions.pod:3660
9434 "You should call this after configuring the handle (eg. adding drives) but "
9435 "before performing any actions."
9439 #: ../fish/guestfish-actions.pod:2514
9444 #: ../fish/guestfish-actions.pod:2516
9447 " lchown owner group path\n"
9452 #: ../fish/guestfish-actions.pod:2518
9454 "Change the file owner to C<owner> and group to C<group>. This is like L</"
9455 "chown> but if C<path> is a symlink then the link itself is changed, not the "
9460 #: ../fish/guestfish-actions.pod:2526
9465 #: ../fish/guestfish-actions.pod:2528
9468 " lgetxattr path name\n"
9473 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3700
9475 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
9476 "is a symlink, then this call returns an extended attribute from the symlink."
9480 #: ../fish/guestfish-actions.pod:2544
9481 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
9485 #: ../fish/guestfish-actions.pod:2546
9490 #: ../fish/guestfish-actions.pod:2548
9493 " lgetxattrs path\n"
9498 #: ../fish/guestfish-actions.pod:2550
9500 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
9501 "it returns the extended attributes of the link itself."
9505 #: ../fish/guestfish-actions.pod:2554
9510 #: ../fish/guestfish-actions.pod:2556
9518 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3743
9520 "List all 9p filesystems attached to the guest. A list of mount tags is "
9525 #: ../fish/guestfish-actions.pod:2561
9526 msgid "list-devices"
9530 #: ../fish/guestfish-actions.pod:2563
9538 #: ../fish/guestfish-actions.pod:2565 ../src/guestfs-actions.pod:3757
9539 msgid "List all the block devices."
9543 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3759
9544 msgid "The full block device names are returned, eg. C</dev/sda>."
9548 #: ../fish/guestfish-actions.pod:2571
9549 msgid "list-dm-devices"
9553 #: ../fish/guestfish-actions.pod:2573
9556 " list-dm-devices\n"
9561 #: ../fish/guestfish-actions.pod:2575 ../src/guestfs-actions.pod:3774
9562 msgid "List all device mapper devices."
9566 #: ../fish/guestfish-actions.pod:2577
9568 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
9569 "previous call to L</luks-open>."
9573 #: ../fish/guestfish-actions.pod:2580
9575 "Device mapper devices which correspond to logical volumes are I<not> "
9576 "returned in this list. Call L</lvs> if you want to list logical volumes."
9580 #: ../fish/guestfish-actions.pod:2584
9581 msgid "list-filesystems"
9585 #: ../fish/guestfish-actions.pod:2586
9588 " list-filesystems\n"
9593 #: ../fish/guestfish-actions.pod:2588 ../src/guestfs-actions.pod:3794
9595 "This inspection command looks for filesystems on partitions, block devices "
9596 "and logical volumes, returning a list of devices containing filesystems and "
9601 #: ../fish/guestfish-actions.pod:2592 ../src/guestfs-actions.pod:3798
9603 "The return value is a hash, where the keys are the devices containing "
9604 "filesystems, and the values are the filesystem types. For example:"
9608 #: ../fish/guestfish-actions.pod:2596 ../src/guestfs-actions.pod:3802
9611 " \"/dev/sda1\" => \"ntfs\"\n"
9612 " \"/dev/sda2\" => \"ext2\"\n"
9613 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9614 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9619 #: ../fish/guestfish-actions.pod:2601 ../src/guestfs-actions.pod:3807
9621 "The value can have the special value \"unknown\", meaning the content of the "
9622 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9626 #: ../fish/guestfish-actions.pod:2605
9628 "This command runs other libguestfs commands, which might include L</mount> "
9629 "and L</umount>, and therefore you should use this soon after launch and only "
9630 "when nothing is mounted."
9634 #: ../fish/guestfish-actions.pod:2609
9636 "Not all of the filesystems returned will be mountable. In particular, swap "
9637 "partitions are returned in the list. Also this command does not check that "
9638 "each filesystem found is valid and mountable, and some filesystems might be "
9639 "mountable but require special options. Filesystems may not all belong to a "
9640 "single logical operating system (use L</inspect-os> to look for OSes)."
9644 #: ../fish/guestfish-actions.pod:2617
9645 msgid "list-partitions"
9649 #: ../fish/guestfish-actions.pod:2619
9652 " list-partitions\n"
9657 #: ../fish/guestfish-actions.pod:2621 ../src/guestfs-actions.pod:3836
9658 msgid "List all the partitions detected on all block devices."
9662 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3838
9663 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9667 #: ../fish/guestfish-actions.pod:2625
9669 "This does not return logical volumes. For that you will need to call L</"
9674 #: ../fish/guestfish-actions.pod:2630
9679 #: ../fish/guestfish-actions.pod:2632
9687 #: ../fish/guestfish-actions.pod:2634 ../src/guestfs-actions.pod:3857
9689 "List the files in C<directory> (relative to the root directory, there is no "
9690 "cwd) in the format of 'ls -la'."
9694 #: ../fish/guestfish-actions.pod:2637 ../src/guestfs-actions.pod:3860
9696 "This command is mostly useful for interactive sessions. It is I<not> "
9697 "intended that you try to parse the output string."
9701 #: ../fish/guestfish-actions.pod:2640
9706 #: ../fish/guestfish-actions.pod:2642
9709 " ln target linkname\n"
9714 #: ../fish/guestfish-actions.pod:2644 ../src/guestfs-actions.pod:3875
9715 msgid "This command creates a hard link using the C<ln> command."
9719 #: ../fish/guestfish-actions.pod:2646
9724 #: ../fish/guestfish-actions.pod:2648
9727 " ln-f target linkname\n"
9732 #: ../fish/guestfish-actions.pod:2650 ../src/guestfs-actions.pod:3888
9734 "This command creates a hard link using the C<ln -f> command. The I<-f> "
9735 "option removes the link (C<linkname>) if it exists already."
9739 #: ../fish/guestfish-actions.pod:2653
9744 #: ../fish/guestfish-actions.pod:2655
9747 " ln-s target linkname\n"
9752 #: ../fish/guestfish-actions.pod:2657 ../src/guestfs-actions.pod:3902
9753 msgid "This command creates a symbolic link using the C<ln -s> command."
9757 #: ../fish/guestfish-actions.pod:2659
9762 #: ../fish/guestfish-actions.pod:2661
9765 " ln-sf target linkname\n"
9770 #: ../fish/guestfish-actions.pod:2663 ../src/guestfs-actions.pod:3915
9772 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
9773 "option removes the link (C<linkname>) if it exists already."
9777 #: ../fish/guestfish-actions.pod:2666
9778 msgid "lremovexattr"
9782 #: ../fish/guestfish-actions.pod:2668
9785 " lremovexattr xattr path\n"
9790 #: ../fish/guestfish-actions.pod:2670
9792 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
9793 "it removes an extended attribute of the link itself."
9797 #: ../fish/guestfish-actions.pod:2674
9802 #: ../fish/guestfish-actions.pod:2676
9810 #: ../fish/guestfish-actions.pod:2678 ../src/guestfs-actions.pod:3943
9812 "List the files in C<directory> (relative to the root directory, there is no "
9813 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
9817 #: ../fish/guestfish-actions.pod:2682
9819 "This command is mostly useful for interactive sessions. Programs should "
9820 "probably use L</readdir> instead."
9824 #: ../fish/guestfish-actions.pod:2685
9829 #: ../fish/guestfish-actions.pod:2687
9832 " lsetxattr xattr val vallen path\n"
9837 #: ../fish/guestfish-actions.pod:2689
9839 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
9840 "sets an extended attribute of the link itself."
9844 #: ../fish/guestfish-actions.pod:2693
9849 #: ../fish/guestfish-actions.pod:2695
9857 #: ../fish/guestfish-actions.pod:2697 ../fish/guestfish-actions.pod:4505
9858 #: ../src/guestfs-actions.pod:3979 ../src/guestfs-actions.pod:6758
9859 msgid "Returns file information for the given C<path>."
9863 #: ../fish/guestfish-actions.pod:2699
9865 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
9866 "the link is stat-ed, not the file it refers to."
9870 #: ../fish/guestfish-actions.pod:2703 ../src/guestfs-actions.pod:3985
9871 msgid "This is the same as the C<lstat(2)> system call."
9875 #: ../fish/guestfish-actions.pod:2705
9880 #: ../fish/guestfish-actions.pod:2707
9883 " lstatlist path 'names ...'\n"
9888 #: ../fish/guestfish-actions.pod:2709
9890 "This call allows you to perform the L</lstat> operation on multiple files, "
9891 "where all files are in the directory C<path>. C<names> is the list of files "
9892 "from this directory."
9896 #: ../fish/guestfish-actions.pod:2713 ../src/guestfs-actions.pod:4004
9898 "On return you get a list of stat structs, with a one-to-one correspondence "
9899 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9900 "then the C<ino> field of that structure is set to C<-1>."
9904 #: ../fish/guestfish-actions.pod:2718
9906 "This call is intended for programs that want to efficiently list a directory "
9907 "contents without making many round-trips. See also L</lxattrlist> for a "
9908 "similarly efficient call for getting extended attributes. Very long "
9909 "directory listings might cause the protocol message size to be exceeded, "
9910 "causing this call to fail. The caller must split up such requests into "
9911 "smaller groups of names."
9915 #: ../fish/guestfish-actions.pod:2726
9916 msgid "luks-add-key"
9920 #: ../fish/guestfish-actions.pod:2728
9923 " luks-add-key device keyslot\n"
9928 #: ../fish/guestfish-actions.pod:2730 ../src/guestfs-actions.pod:4032
9930 "This command adds a new key on LUKS device C<device>. C<key> is any "
9931 "existing key, and is used to access the device. C<newkey> is the new key to "
9932 "add. C<keyslot> is the key slot that will be replaced."
9936 #: ../fish/guestfish-actions.pod:2735
9938 "Note that if C<keyslot> already contains a key, then this command will "
9939 "fail. You have to use L</luks-kill-slot> first to remove that key."
9943 #: ../fish/guestfish-actions.pod:2739 ../fish/guestfish-actions.pod:2761
9944 #: ../fish/guestfish-actions.pod:2774 ../fish/guestfish-actions.pod:2788
9945 #: ../fish/guestfish-actions.pod:2814 ../fish/guestfish-actions.pod:2824
9947 "This command has one or more key or passphrase parameters. Guestfish will "
9948 "prompt for these separately."
9952 #: ../fish/guestfish-actions.pod:2742
9957 #: ../fish/guestfish-actions.pod:2744
9960 " luks-close device\n"
9965 #: ../fish/guestfish-actions.pod:2746
9967 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
9968 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
9969 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
9974 #: ../fish/guestfish-actions.pod:2752
9979 #: ../fish/guestfish-actions.pod:2754
9982 " luks-format device keyslot\n"
9987 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4073
9989 "This command erases existing data on C<device> and formats the device as a "
9990 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9991 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9995 #: ../fish/guestfish-actions.pod:2764 ../fish/guestfish-actions.pod:2777
9996 #: ../fish/guestfish-actions.pod:2864 ../fish/guestfish-actions.pod:3525
9997 #: ../fish/guestfish-actions.pod:4051 ../fish/guestfish-actions.pod:4376
9998 #: ../fish/guestfish-actions.pod:4399 ../fish/guestfish-actions.pod:4421
9999 #: ../fish/guestfish-actions.pod:5167 ../src/guestfs-actions.pod:4080
10000 #: ../src/guestfs-actions.pod:4103 ../src/guestfs-actions.pod:4246
10001 #: ../src/guestfs-actions.pod:5349 ../src/guestfs-actions.pod:6137
10002 #: ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6595
10003 #: ../src/guestfs-actions.pod:6628 ../src/guestfs-actions.pod:7834
10005 "B<This command is dangerous. Without careful use you can easily destroy all "
10010 #: ../fish/guestfish-actions.pod:2767
10011 msgid "luks-format-cipher"
10015 #: ../fish/guestfish-actions.pod:2769
10018 " luks-format-cipher device keyslot cipher\n"
10023 #: ../fish/guestfish-actions.pod:2771
10025 "This command is the same as L</luks-format> but it also allows you to set "
10026 "the C<cipher> used."
10030 #: ../fish/guestfish-actions.pod:2780
10031 msgid "luks-kill-slot"
10035 #: ../fish/guestfish-actions.pod:2782
10038 " luks-kill-slot device keyslot\n"
10043 #: ../fish/guestfish-actions.pod:2784 ../src/guestfs-actions.pod:4120
10045 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10046 "device C<device>. C<key> must be one of the I<other> keys."
10050 #: ../fish/guestfish-actions.pod:2791
10055 #: ../fish/guestfish-actions.pod:2793
10058 " luks-open device mapname\n"
10063 #: ../fish/guestfish-actions.pod:2795 ../src/guestfs-actions.pod:4140
10065 "This command opens a block device which has been encrypted according to the "
10066 "Linux Unified Key Setup (LUKS) standard."
10070 #: ../fish/guestfish-actions.pod:2798 ../src/guestfs-actions.pod:4143
10071 msgid "C<device> is the encrypted block device or partition."
10075 #: ../fish/guestfish-actions.pod:2800 ../src/guestfs-actions.pod:4145
10077 "The caller must supply one of the keys associated with the LUKS block "
10078 "device, in the C<key> parameter."
10082 #: ../fish/guestfish-actions.pod:2803 ../src/guestfs-actions.pod:4148
10084 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10085 "writes to this block device are decrypted from and encrypted to the "
10086 "underlying C<device> respectively."
10090 #: ../fish/guestfish-actions.pod:2807
10092 "If this block device contains LVM volume groups, then calling L</vgscan> "
10093 "followed by L</vg-activate-all> will make them visible."
10097 #: ../fish/guestfish-actions.pod:2811
10098 msgid "Use L</list-dm-devices> to list all device mapper devices."
10102 #: ../fish/guestfish-actions.pod:2817
10103 msgid "luks-open-ro"
10107 #: ../fish/guestfish-actions.pod:2819
10110 " luks-open-ro device mapname\n"
10115 #: ../fish/guestfish-actions.pod:2821
10117 "This is the same as L</luks-open> except that a read-only mapping is created."
10121 #: ../fish/guestfish-actions.pod:2827
10126 #: ../fish/guestfish-actions.pod:2829
10129 " lvcreate logvol volgroup mbytes\n"
10134 #: ../fish/guestfish-actions.pod:2831 ../src/guestfs-actions.pod:4194
10136 "This creates an LVM logical volume called C<logvol> on the volume group "
10137 "C<volgroup>, with C<size> megabytes."
10141 #: ../fish/guestfish-actions.pod:2834
10142 msgid "lvm-canonical-lv-name"
10146 #: ../fish/guestfish-actions.pod:2836
10149 " lvm-canonical-lv-name lvname\n"
10154 #: ../fish/guestfish-actions.pod:2838 ../src/guestfs-actions.pod:4207
10156 "This converts alternative naming schemes for LVs that you might find to the "
10157 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10162 #: ../fish/guestfish-actions.pod:2842 ../src/guestfs-actions.pod:4211
10164 "This command returns an error if the C<lvname> parameter does not refer to a "
10169 #: ../fish/guestfish-actions.pod:2845
10170 msgid "See also L</is-lv>."
10174 #: ../fish/guestfish-actions.pod:2847
10175 msgid "lvm-clear-filter"
10179 #: ../fish/guestfish-actions.pod:2849
10182 " lvm-clear-filter\n"
10187 #: ../fish/guestfish-actions.pod:2851
10189 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
10194 #: ../fish/guestfish-actions.pod:2854 ../fish/guestfish-actions.pod:2885
10195 #: ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:4271
10197 "This command also clears the LVM cache and performs a volume group scan."
10201 #: ../fish/guestfish-actions.pod:2857
10202 msgid "lvm-remove-all"
10206 #: ../fish/guestfish-actions.pod:2859
10209 " lvm-remove-all\n"
10214 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4241
10216 "This command removes all LVM logical volumes, volume groups and physical "
10221 #: ../fish/guestfish-actions.pod:2867
10222 msgid "lvm-set-filter"
10226 #: ../fish/guestfish-actions.pod:2869
10229 " lvm-set-filter 'devices ...'\n"
10234 #: ../fish/guestfish-actions.pod:2871 ../src/guestfs-actions.pod:4257
10236 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10237 "block devices in the list C<devices>, and will ignore all other attached "
10242 #: ../fish/guestfish-actions.pod:2875 ../src/guestfs-actions.pod:4261
10244 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10245 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10246 "there are two types of duplication possible: either cloned PVs/VGs which "
10247 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10248 "same name. In normal operation you cannot create this situation, but you "
10249 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10250 "inside the LVM metadata."
10254 #: ../fish/guestfish-actions.pod:2888 ../src/guestfs-actions.pod:4274
10255 msgid "You can filter whole block devices or individual partitions."
10259 #: ../fish/guestfish-actions.pod:2890 ../src/guestfs-actions.pod:4276
10261 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10262 "filesystem), even if you are not filtering out that VG."
10266 #: ../fish/guestfish-actions.pod:2894
10271 #: ../fish/guestfish-actions.pod:2896
10274 " lvremove device\n"
10279 #: ../fish/guestfish-actions.pod:2898 ../src/guestfs-actions.pod:4290
10281 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10282 "LV, such as C</dev/VG/LV>."
10286 #: ../fish/guestfish-actions.pod:2901 ../src/guestfs-actions.pod:4293
10288 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10293 #: ../fish/guestfish-actions.pod:2904
10298 #: ../fish/guestfish-actions.pod:2906
10301 " lvrename logvol newlogvol\n"
10306 #: ../fish/guestfish-actions.pod:2908 ../src/guestfs-actions.pod:4307
10307 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10311 #: ../fish/guestfish-actions.pod:2910
10316 #: ../fish/guestfish-actions.pod:2912
10319 " lvresize device mbytes\n"
10324 #: ../fish/guestfish-actions.pod:2914 ../src/guestfs-actions.pod:4320
10326 "This resizes (expands or shrinks) an existing LVM logical volume to "
10327 "C<mbytes>. When reducing, data in the reduced part is lost."
10331 #: ../fish/guestfish-actions.pod:2918
10332 msgid "lvresize-free"
10336 #: ../fish/guestfish-actions.pod:2920
10339 " lvresize-free lv percent\n"
10344 #: ../fish/guestfish-actions.pod:2922 ../src/guestfs-actions.pod:4335
10346 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10347 "remaining free space in the volume group. Commonly you would call this with "
10348 "pc = 100 which expands the logical volume as much as possible, using all "
10349 "remaining free space in the volume group."
10353 #: ../fish/guestfish-actions.pod:2928
10358 #: ../fish/guestfish-actions.pod:2930
10366 #: ../fish/guestfish-actions.pod:2932 ../src/guestfs-actions.pod:4350
10368 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10373 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4353
10375 "This returns a list of the logical volume device names (eg. C</dev/"
10376 "VolGroup00/LogVol00>)."
10380 #: ../fish/guestfish-actions.pod:2938
10381 msgid "See also L</lvs-full>, L</list-filesystems>."
10385 #: ../fish/guestfish-actions.pod:2940
10390 #: ../fish/guestfish-actions.pod:2942
10398 #: ../fish/guestfish-actions.pod:2944 ../src/guestfs-actions.pod:4369
10400 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10401 "(8)> command. The \"full\" version includes all fields."
10405 #: ../fish/guestfish-actions.pod:2947
10410 #: ../fish/guestfish-actions.pod:2949
10418 #: ../fish/guestfish-actions.pod:2951 ../src/guestfs-actions.pod:4384
10419 msgid "This command returns the UUID of the LVM LV C<device>."
10423 #: ../fish/guestfish-actions.pod:2953
10428 #: ../fish/guestfish-actions.pod:2955
10431 " lxattrlist path 'names ...'\n"
10436 #: ../fish/guestfish-actions.pod:2957 ../src/guestfs-actions.pod:4398
10438 "This call allows you to get the extended attributes of multiple files, where "
10439 "all files are in the directory C<path>. C<names> is the list of files from "
10444 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4402
10446 "On return you get a flat list of xattr structs which must be interpreted "
10447 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10448 "C<attrval> in this struct is zero-length to indicate there was an error "
10449 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10450 "number (the number of following attributes for this file, which could be C<"
10451 "\"0\">). Then after the first xattr struct are the zero or more attributes "
10452 "for the first named file. This repeats for the second and subsequent files."
10456 #: ../fish/guestfish-actions.pod:2971
10458 "This call is intended for programs that want to efficiently list a directory "
10459 "contents without making many round-trips. See also L</lstatlist> for a "
10460 "similarly efficient call for getting standard stats. Very long directory "
10461 "listings might cause the protocol message size to be exceeded, causing this "
10462 "call to fail. The caller must split up such requests into smaller groups of "
10467 #: ../fish/guestfish-actions.pod:2979
10472 #: ../fish/guestfish-actions.pod:2981
10480 #: ../fish/guestfish-actions.pod:2983 ../src/guestfs-actions.pod:4432
10481 msgid "Create a directory named C<path>."
10485 #: ../fish/guestfish-actions.pod:2985
10490 #: ../fish/guestfish-actions.pod:2987
10493 " mkdir-mode path mode\n"
10498 #: ../fish/guestfish-actions.pod:2989 ../src/guestfs-actions.pod:4445
10500 "This command creates a directory, setting the initial permissions of the "
10501 "directory to C<mode>."
10505 #: ../fish/guestfish-actions.pod:2992 ../src/guestfs-actions.pod:4448
10507 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10508 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10513 #: ../fish/guestfish-actions.pod:2996
10514 msgid "See also L</mkdir>, L</umask>"
10518 #: ../fish/guestfish-actions.pod:2998
10523 #: ../fish/guestfish-actions.pod:3000
10531 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4464
10533 "Create a directory named C<path>, creating any parent directories as "
10534 "necessary. This is like the C<mkdir -p> shell command."
10538 #: ../fish/guestfish-actions.pod:3005
10543 #: ../fish/guestfish-actions.pod:3007
10546 " mkdtemp template\n"
10551 #: ../fish/guestfish-actions.pod:3009 ../src/guestfs-actions.pod:4477
10553 "This command creates a temporary directory. The C<template> parameter "
10554 "should be a full pathname for the temporary directory name with the final "
10555 "six characters being \"XXXXXX\"."
10559 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4482
10561 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10562 "being suitable for Windows filesystems."
10566 #: ../fish/guestfish-actions.pod:3017 ../src/guestfs-actions.pod:4485
10567 msgid "The name of the temporary directory that was created is returned."
10571 #: ../fish/guestfish-actions.pod:3020 ../src/guestfs-actions.pod:4488
10572 msgid "The temporary directory is created with mode 0700 and is owned by root."
10576 #: ../fish/guestfish-actions.pod:3023 ../src/guestfs-actions.pod:4491
10578 "The caller is responsible for deleting the temporary directory and its "
10579 "contents after use."
10583 #: ../fish/guestfish-actions.pod:3026 ../src/guestfs-actions.pod:4494
10584 msgid "See also: L<mkdtemp(3)>"
10588 #: ../fish/guestfish-actions.pod:3028
10593 #: ../fish/guestfish-actions.pod:3030
10596 " mke2fs-J fstype blocksize device journal\n"
10601 #: ../fish/guestfish-actions.pod:3032 ../src/guestfs-actions.pod:4510
10603 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10604 "C<journal>. It is equivalent to the command:"
10608 #: ../fish/guestfish-actions.pod:3036 ../src/guestfs-actions.pod:4514
10611 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10616 #: ../fish/guestfish-actions.pod:3038
10617 msgid "See also L</mke2journal>."
10621 #: ../fish/guestfish-actions.pod:3040
10626 #: ../fish/guestfish-actions.pod:3042
10629 " mke2fs-JL fstype blocksize device label\n"
10634 #: ../fish/guestfish-actions.pod:3044 ../src/guestfs-actions.pod:4531
10636 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10637 "the journal labeled C<label>."
10641 #: ../fish/guestfish-actions.pod:3047
10642 msgid "See also L</mke2journal-L>."
10646 #: ../fish/guestfish-actions.pod:3049
10651 #: ../fish/guestfish-actions.pod:3051
10654 " mke2fs-JU fstype blocksize device uuid\n"
10659 #: ../fish/guestfish-actions.pod:3053 ../src/guestfs-actions.pod:4549
10661 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10662 "the journal with UUID C<uuid>."
10666 #: ../fish/guestfish-actions.pod:3056
10667 msgid "See also L</mke2journal-U>."
10671 #: ../fish/guestfish-actions.pod:3058
10672 msgid "mke2journal"
10676 #: ../fish/guestfish-actions.pod:3060
10679 " mke2journal blocksize device\n"
10684 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4565
10686 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10691 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4568
10694 " mke2fs -O journal_dev -b blocksize device\n"
10699 #: ../fish/guestfish-actions.pod:3067
10700 msgid "mke2journal-L"
10704 #: ../fish/guestfish-actions.pod:3069
10707 " mke2journal-L blocksize label device\n"
10712 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4582
10713 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10717 #: ../fish/guestfish-actions.pod:3073
10718 msgid "mke2journal-U"
10722 #: ../fish/guestfish-actions.pod:3075
10725 " mke2journal-U blocksize uuid device\n"
10730 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4596
10731 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10735 #: ../fish/guestfish-actions.pod:3079
10740 #: ../fish/guestfish-actions.pod:3081
10743 " mkfifo mode path\n"
10748 #: ../fish/guestfish-actions.pod:3083
10750 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10751 "is just a convenient wrapper around L</mknod>."
10755 #: ../fish/guestfish-actions.pod:3089
10760 #: ../fish/guestfish-actions.pod:3091
10763 " mkfs fstype device\n"
10768 #: ../fish/guestfish-actions.pod:3093 ../src/guestfs-actions.pod:4626
10770 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10771 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10775 #: ../fish/guestfish-actions.pod:3097
10780 #: ../fish/guestfish-actions.pod:3099
10783 " mkfs-b fstype blocksize device\n"
10788 #: ../fish/guestfish-actions.pod:3101
10790 "This call is similar to L</mkfs>, but it allows you to control the block "
10791 "size of the resulting filesystem. Supported block sizes depend on the "
10792 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10796 #: ../fish/guestfish-actions.pod:3106 ../fish/guestfish-actions.pod:3133
10797 #: ../src/guestfs-actions.pod:4647 ../src/guestfs-actions.pod:4692
10799 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10804 #: ../fish/guestfish-actions.pod:3109
10806 "This function is deprecated. In new code, use the L</mkfs_opts> call "
10811 #: ../fish/guestfish-actions.pod:3116
10816 #: ../fish/guestfish-actions.pod:3118
10819 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
10824 #: ../fish/guestfish-actions.pod:3120 ../src/guestfs-actions.pod:4679
10826 "This function creates a filesystem on C<device>. The filesystem type is "
10827 "C<fstype>, for example C<ext3>."
10831 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4686
10832 msgid "C<blocksize>"
10836 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4688
10838 "The filesystem block size. Supported block sizes depend on the filesystem "
10839 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
10844 #: ../fish/guestfish-actions.pod:3136 ../src/guestfs-actions.pod:4695
10845 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
10849 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4697
10850 msgid "C<features>"
10854 #: ../fish/guestfish-actions.pod:3140 ../src/guestfs-actions.pod:4699
10855 msgid "This passes the I<-O> parameter to the external mkfs program."
10859 #: ../fish/guestfish-actions.pod:3142 ../src/guestfs-actions.pod:4701
10861 "For certain filesystem types, this allows extra filesystem features to be "
10862 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
10866 #: ../fish/guestfish-actions.pod:3146 ../src/guestfs-actions.pod:4705
10868 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
10873 #: ../fish/guestfish-actions.pod:3149 ../src/guestfs-actions.pod:4708
10878 #: ../fish/guestfish-actions.pod:3151 ../src/guestfs-actions.pod:4710
10880 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
10881 "sets the inode size (only for ext2/3/4 filesystems at present)."
10885 #: ../fish/guestfish-actions.pod:3154 ../src/guestfs-actions.pod:4713
10886 msgid "C<sectorsize>"
10890 #: ../fish/guestfish-actions.pod:3156 ../src/guestfs-actions.pod:4715
10892 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
10893 "sets sector size for ufs filesystem."
10897 #: ../fish/guestfish-actions.pod:3163
10898 msgid "mkmountpoint"
10902 #: ../fish/guestfish-actions.pod:3165
10905 " mkmountpoint exemptpath\n"
10910 #: ../fish/guestfish-actions.pod:3167
10912 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
10913 "to create extra mountpoints before mounting the first filesystem."
10917 #: ../fish/guestfish-actions.pod:3171 ../src/guestfs-actions.pod:4758
10919 "These calls are I<only> necessary in some very limited circumstances, mainly "
10920 "the case where you want to mount a mix of unrelated and/or read-only "
10921 "filesystems together."
10925 #: ../fish/guestfish-actions.pod:3175 ../src/guestfs-actions.pod:4762
10927 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10928 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10929 "inside that. You can unpack this as follows in guestfish:"
10933 #: ../fish/guestfish-actions.pod:3180 ../src/guestfs-actions.pod:4767
10936 " add-ro Fedora-11-i686-Live.iso\n"
10938 " mkmountpoint /cd\n"
10939 " mkmountpoint /sqsh\n"
10940 " mkmountpoint /ext3fs\n"
10941 " mount /dev/sda /cd\n"
10942 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10943 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10948 #: ../fish/guestfish-actions.pod:3189 ../src/guestfs-actions.pod:4776
10949 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10953 #: ../fish/guestfish-actions.pod:3191
10955 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
10956 "unexpected errors if you try to mix these calls. It is safest to manually "
10957 "unmount filesystems and remove mountpoints after use."
10961 #: ../fish/guestfish-actions.pod:3195
10963 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
10964 "for this to work for manual mountpoints, you must ensure that the innermost "
10965 "mountpoints have the longest pathnames, as in the example code above."
10969 #: ../fish/guestfish-actions.pod:3200 ../src/guestfs-actions.pod:4787
10971 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10975 #: ../fish/guestfish-actions.pod:3202
10977 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
10978 "L</umount-all> to be called when the handle is closed which can also trigger "
10983 #: ../fish/guestfish-actions.pod:3206
10988 #: ../fish/guestfish-actions.pod:3208
10991 " mknod mode devmajor devminor path\n"
10996 #: ../fish/guestfish-actions.pod:3210 ../src/guestfs-actions.pod:4806
10998 "This call creates block or character special devices, or named pipes (FIFOs)."
11002 #: ../fish/guestfish-actions.pod:3213 ../src/guestfs-actions.pod:4809
11004 "The C<mode> parameter should be the mode, using the standard constants. "
11005 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11006 "used when creating block and character special devices."
11010 #: ../fish/guestfish-actions.pod:3218
11012 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11013 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11014 "regular file). These constants are available in the standard Linux header "
11015 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
11016 "wrappers around this command which bitwise OR in the appropriate constant "
11021 #: ../fish/guestfish-actions.pod:3228
11026 #: ../fish/guestfish-actions.pod:3230
11029 " mknod-b mode devmajor devminor path\n"
11034 #: ../fish/guestfish-actions.pod:3232
11036 "This call creates a block device node called C<path> with mode C<mode> and "
11037 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11038 "wrapper around L</mknod>."
11042 #: ../fish/guestfish-actions.pod:3238
11047 #: ../fish/guestfish-actions.pod:3240
11050 " mknod-c mode devmajor devminor path\n"
11055 #: ../fish/guestfish-actions.pod:3242
11057 "This call creates a char device node called C<path> with mode C<mode> and "
11058 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11059 "wrapper around L</mknod>."
11063 #: ../fish/guestfish-actions.pod:3248
11068 #: ../fish/guestfish-actions.pod:3250
11076 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4872
11077 msgid "Create a swap partition on C<device>."
11081 #: ../fish/guestfish-actions.pod:3254
11086 #: ../fish/guestfish-actions.pod:3256
11089 " mkswap-L label device\n"
11094 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4885
11095 msgid "Create a swap partition on C<device> with label C<label>."
11099 #: ../fish/guestfish-actions.pod:3260 ../src/guestfs-actions.pod:4887
11101 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11102 "sda>), just to a partition. This appears to be a limitation of the kernel "
11107 #: ../fish/guestfish-actions.pod:3264
11112 #: ../fish/guestfish-actions.pod:3266
11115 " mkswap-U uuid device\n"
11120 #: ../fish/guestfish-actions.pod:3268 ../src/guestfs-actions.pod:4902
11121 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11125 #: ../fish/guestfish-actions.pod:3270
11126 msgid "mkswap-file"
11130 #: ../fish/guestfish-actions.pod:3272
11133 " mkswap-file path\n"
11138 #: ../fish/guestfish-actions.pod:3274 ../src/guestfs-actions.pod:4914
11139 msgid "Create a swap file."
11143 #: ../fish/guestfish-actions.pod:3276
11145 "This command just writes a swap file signature to an existing file. To "
11146 "create the file itself, use something like L</fallocate>."
11150 #: ../fish/guestfish-actions.pod:3279
11155 #: ../fish/guestfish-actions.pod:3281
11158 " modprobe modulename\n"
11163 #: ../fish/guestfish-actions.pod:3283 ../src/guestfs-actions.pod:4929
11164 msgid "This loads a kernel module in the appliance."
11168 #: ../fish/guestfish-actions.pod:3285 ../src/guestfs-actions.pod:4931
11170 "The kernel module must have been whitelisted when libguestfs was built (see "
11171 "C<appliance/kmod.whitelist.in> in the source)."
11175 #: ../fish/guestfish-actions.pod:3288
11180 #: ../fish/guestfish-actions.pod:3290
11183 " mount device mountpoint\n"
11188 #: ../fish/guestfish-actions.pod:3292 ../src/guestfs-actions.pod:4945
11190 "Mount a guest disk at a position in the filesystem. Block devices are named "
11191 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11192 "those block devices contain partitions, they will have the usual names (eg. "
11193 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11197 #: ../fish/guestfish-actions.pod:3298 ../src/guestfs-actions.pod:4951
11199 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11200 "mounted on C</> before others can be mounted. Other filesystems can only be "
11201 "mounted on directories which already exist."
11205 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:4956
11207 "The mounted filesystem is writable, if we have sufficient permissions on the "
11208 "underlying device."
11212 #: ../fish/guestfish-actions.pod:3306
11214 "B<Important note:> When you use this call, the filesystem options C<sync> "
11215 "and C<noatime> are set implicitly. This was originally done because we "
11216 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11217 "very large negative performance impact and negligible effect on "
11218 "reliability. Therefore we recommend that you avoid using L</mount> in any "
11219 "code that needs performance, and instead use L</mount-options> (use an empty "
11220 "string for the first parameter if you don't want any options)."
11224 #: ../fish/guestfish-actions.pod:3316
11226 "This function is deprecated. In new code, use the L</mount_options> call "
11231 #: ../fish/guestfish-actions.pod:3323
11236 #: ../fish/guestfish-actions.pod:3325
11239 " mount-9p mounttag mountpoint [options:..]\n"
11244 #: ../fish/guestfish-actions.pod:3327 ../src/guestfs-actions.pod:4995
11246 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
11251 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:4998
11253 "If required, C<trans=virtio> will be automatically added to the options. "
11254 "Any other options required can be passed in the optional C<options> "
11259 #: ../fish/guestfish-actions.pod:3336
11264 #: ../fish/guestfish-actions.pod:3338
11267 " mount-loop file mountpoint\n"
11272 #: ../fish/guestfish-actions.pod:3340 ../src/guestfs-actions.pod:5037
11274 "This command lets you mount C<file> (a filesystem image in a file) on a "
11275 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11280 #: ../fish/guestfish-actions.pod:3344
11281 msgid "mount-options"
11285 #: ../fish/guestfish-actions.pod:3346
11288 " mount-options options device mountpoint\n"
11293 #: ../fish/guestfish-actions.pod:3348
11295 "This is the same as the L</mount> command, but it allows you to set the "
11296 "mount options as for the L<mount(8)> I<-o> flag."
11300 #: ../fish/guestfish-actions.pod:3352 ../src/guestfs-actions.pod:5057
11302 "If the C<options> parameter is an empty string, then no options are passed "
11303 "(all options default to whatever the filesystem uses)."
11307 #: ../fish/guestfish-actions.pod:3356
11312 #: ../fish/guestfish-actions.pod:3358
11315 " mount-ro device mountpoint\n"
11320 #: ../fish/guestfish-actions.pod:3360
11322 "This is the same as the L</mount> command, but it mounts the filesystem with "
11323 "the read-only (I<-o ro>) flag."
11327 #: ../fish/guestfish-actions.pod:3363
11332 #: ../fish/guestfish-actions.pod:3365
11335 " mount-vfs options vfstype device mountpoint\n"
11340 #: ../fish/guestfish-actions.pod:3367
11342 "This is the same as the L</mount> command, but it allows you to set both the "
11343 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
11347 #: ../fish/guestfish-actions.pod:3371
11348 msgid "mountpoints"
11352 #: ../fish/guestfish-actions.pod:3373
11360 #: ../fish/guestfish-actions.pod:3375
11362 "This call is similar to L</mounts>. That call returns a list of devices. "
11363 "This one returns a hash table (map) of device name to directory where the "
11364 "device is mounted."
11368 #: ../fish/guestfish-actions.pod:3379
11373 #: ../fish/guestfish-actions.pod:3381
11381 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5118
11383 "This returns the list of currently mounted filesystems. It returns the list "
11384 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11388 #: ../fish/guestfish-actions.pod:3386 ../src/guestfs-actions.pod:5121
11389 msgid "Some internal mounts are not shown."
11393 #: ../fish/guestfish-actions.pod:3388
11394 msgid "See also: L</mountpoints>"
11398 #: ../fish/guestfish-actions.pod:3390
11403 #: ../fish/guestfish-actions.pod:3392
11411 #: ../fish/guestfish-actions.pod:3394 ../src/guestfs-actions.pod:5138
11413 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11414 "destination filename or destination directory."
11418 #: ../fish/guestfish-actions.pod:3397
11419 msgid "ntfs-3g-probe"
11423 #: ../fish/guestfish-actions.pod:3399
11426 " ntfs-3g-probe true|false device\n"
11431 #: ../fish/guestfish-actions.pod:3401 ../src/guestfs-actions.pod:5152
11433 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11434 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
11435 "write, and some cannot be mounted at all)."
11439 #: ../fish/guestfish-actions.pod:3405 ../src/guestfs-actions.pod:5156
11441 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11442 "can be mounted read-write. Set it to false if you want to test if the "
11443 "volume can be mounted read-only."
11447 #: ../fish/guestfish-actions.pod:3409 ../src/guestfs-actions.pod:5160
11449 "The return value is an integer which C<0> if the operation would succeed, or "
11450 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11454 #: ../fish/guestfish-actions.pod:3413
11459 #: ../fish/guestfish-actions.pod:3415
11462 " ntfsresize device\n"
11467 #: ../fish/guestfish-actions.pod:3417 ../fish/guestfish-actions.pod:3441
11468 #: ../src/guestfs-actions.pod:5174 ../src/guestfs-actions.pod:5213
11470 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11471 "size of the underlying device."
11475 #: ../fish/guestfish-actions.pod:3420 ../src/guestfs-actions.pod:5177
11477 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
11478 "consistency check (for safety). You have to boot into Windows to perform "
11479 "this check and clear this condition. Furthermore, ntfsresize refuses to "
11480 "resize filesystems which have been marked in this way. So in effect it is "
11481 "not possible to call ntfsresize multiple times on a single filesystem "
11482 "without booting into Windows between each resize."
11486 #: ../fish/guestfish-actions.pod:3428 ../fish/guestfish-actions.pod:3467
11487 #: ../src/guestfs-actions.pod:5185 ../src/guestfs-actions.pod:5239
11488 msgid "See also L<ntfsresize(8)>."
11492 #: ../fish/guestfish-actions.pod:3430 ../fish/guestfish-actions.pod:3478
11494 "This function is deprecated. In new code, use the L</ntfsresize_opts> call "
11499 #: ../fish/guestfish-actions.pod:3437
11500 msgid "ntfsresize-opts"
11504 #: ../fish/guestfish-actions.pod:3439
11507 " ntfsresize-opts device [size:..] [force:..]\n"
11512 #: ../fish/guestfish-actions.pod:3450 ../src/guestfs-actions.pod:5222
11514 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
11515 "resized to fit the container (eg. partition)."
11519 #: ../fish/guestfish-actions.pod:3453 ../src/guestfs-actions.pod:5225
11524 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5227
11526 "If this option is true, then force the resize of the filesystem even if the "
11527 "filesystem is marked as requiring a consistency check."
11531 #: ../fish/guestfish-actions.pod:3458
11533 "After the resize operation, the filesystem is always marked as requiring a "
11534 "consistency check (for safety). You have to boot into Windows to perform "
11535 "this check and clear this condition. If you I<don't> set the C<force> "
11536 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
11537 "a single filesystem without booting into Windows between each resize."
11541 #: ../fish/guestfish-actions.pod:3471
11542 msgid "ntfsresize-size"
11546 #: ../fish/guestfish-actions.pod:3473
11549 " ntfsresize-size device size\n"
11554 #: ../fish/guestfish-actions.pod:3475
11556 "This command is the same as L</ntfsresize> except that it allows you to "
11557 "specify the new size (in bytes) explicitly."
11561 #: ../fish/guestfish-actions.pod:3485
11566 #: ../fish/guestfish-actions.pod:3487
11569 " part-add device prlogex startsect endsect\n"
11574 #: ../fish/guestfish-actions.pod:3489
11576 "This command adds a partition to C<device>. If there is no partition table "
11577 "on the device, call L</part-init> first."
11581 #: ../fish/guestfish-actions.pod:3492 ../src/guestfs-actions.pod:5300
11583 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11584 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11585 "C<logical>) and C<e> (or C<extended>) partition types."
11589 #: ../fish/guestfish-actions.pod:3497 ../src/guestfs-actions.pod:5305
11591 "C<startsect> and C<endsect> are the start and end of the partition in "
11592 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11593 "from the end of the disk (C<-1> is the last sector)."
11597 #: ../fish/guestfish-actions.pod:3501
11599 "Creating a partition which covers the whole disk is not so easy. Use L</"
11600 "part-disk> to do that."
11604 #: ../fish/guestfish-actions.pod:3504
11609 #: ../fish/guestfish-actions.pod:3506
11612 " part-del device partnum\n"
11617 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5323
11618 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11622 #: ../fish/guestfish-actions.pod:3510 ../src/guestfs-actions.pod:5325
11624 "Note that in the case of MBR partitioning, deleting an extended partition "
11625 "also deletes any logical partitions it contains."
11629 #: ../fish/guestfish-actions.pod:3514
11634 #: ../fish/guestfish-actions.pod:3516
11637 " part-disk device parttype\n"
11642 #: ../fish/guestfish-actions.pod:3518
11644 "This command is simply a combination of L</part-init> followed by L</part-"
11645 "add> to create a single primary partition covering the whole disk."
11649 #: ../fish/guestfish-actions.pod:3522
11651 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11652 "possible values are described in L</part-init>."
11656 #: ../fish/guestfish-actions.pod:3528
11657 msgid "part-get-bootable"
11661 #: ../fish/guestfish-actions.pod:3530
11664 " part-get-bootable device partnum\n"
11669 #: ../fish/guestfish-actions.pod:3532 ../src/guestfs-actions.pod:5361
11671 "This command returns true if the partition C<partnum> on C<device> has the "
11672 "bootable flag set."
11676 #: ../fish/guestfish-actions.pod:3535
11677 msgid "See also L</part-set-bootable>."
11681 #: ../fish/guestfish-actions.pod:3537
11682 msgid "part-get-mbr-id"
11686 #: ../fish/guestfish-actions.pod:3539
11689 " part-get-mbr-id device partnum\n"
11694 #: ../fish/guestfish-actions.pod:3541 ../src/guestfs-actions.pod:5377
11696 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11697 "partition C<partnum>."
11701 #: ../fish/guestfish-actions.pod:3544 ../fish/guestfish-actions.pod:3688
11703 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11704 "undefined results for other partition table types (see L</part-get-"
11709 #: ../fish/guestfish-actions.pod:3548
11710 msgid "part-get-parttype"
11714 #: ../fish/guestfish-actions.pod:3550
11717 " part-get-parttype device\n"
11722 #: ../fish/guestfish-actions.pod:3552 ../src/guestfs-actions.pod:5394
11724 "This command examines the partition table on C<device> and returns the "
11725 "partition table type (format) being used."
11729 #: ../fish/guestfish-actions.pod:3555
11731 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11732 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11733 "possible, although unusual. See L</part-init> for a full list."
11737 #: ../fish/guestfish-actions.pod:3560
11742 #: ../fish/guestfish-actions.pod:3562
11745 " part-init device parttype\n"
11750 #: ../fish/guestfish-actions.pod:3564 ../src/guestfs-actions.pod:5414
11752 "This creates an empty partition table on C<device> of one of the partition "
11753 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11754 "(for large disks)."
11758 #: ../fish/guestfish-actions.pod:3568
11760 "Initially there are no partitions. Following this, you should call L</part-"
11761 "add> for each partition required."
11765 #: ../fish/guestfish-actions.pod:3571 ../src/guestfs-actions.pod:5421
11766 msgid "Possible values for C<parttype> are:"
11770 #: ../fish/guestfish-actions.pod:3575 ../src/guestfs-actions.pod:5425
11775 #: ../fish/guestfish-actions.pod:3577 ../src/guestfs-actions.pod:5427
11780 #: ../fish/guestfish-actions.pod:3579 ../src/guestfs-actions.pod:5429
11781 msgid "Intel EFI / GPT partition table."
11785 #: ../fish/guestfish-actions.pod:3581 ../src/guestfs-actions.pod:5431
11787 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11788 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11789 "the C<mbr> format."
11793 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5435
11798 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5437
11803 #: ../fish/guestfish-actions.pod:3589 ../src/guestfs-actions.pod:5439
11805 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11806 "Windows. This partition type will B<only> work for device sizes up to 2 "
11807 "TB. For large disks we recommend using C<gpt>."
11811 #: ../fish/guestfish-actions.pod:3596 ../src/guestfs-actions.pod:5446
11813 "Other partition table types that may work but are not supported include:"
11817 #: ../fish/guestfish-actions.pod:3601 ../src/guestfs-actions.pod:5451
11822 #: ../fish/guestfish-actions.pod:3603 ../src/guestfs-actions.pod:5453
11823 msgid "AIX disk labels."
11827 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5455
11832 #: ../fish/guestfish-actions.pod:3607 ../src/guestfs-actions.pod:5457
11837 #: ../fish/guestfish-actions.pod:3609 ../src/guestfs-actions.pod:5459
11838 msgid "Amiga \"Rigid Disk Block\" format."
11842 #: ../fish/guestfish-actions.pod:3611 ../src/guestfs-actions.pod:5461
11847 #: ../fish/guestfish-actions.pod:3613 ../src/guestfs-actions.pod:5463
11848 msgid "BSD disk labels."
11852 #: ../fish/guestfish-actions.pod:3615 ../src/guestfs-actions.pod:5465
11857 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5467
11858 msgid "DASD, used on IBM mainframes."
11862 #: ../fish/guestfish-actions.pod:3619 ../src/guestfs-actions.pod:5469
11867 #: ../fish/guestfish-actions.pod:3621 ../src/guestfs-actions.pod:5471
11868 msgid "MIPS/SGI volumes."
11872 #: ../fish/guestfish-actions.pod:3623 ../src/guestfs-actions.pod:5473
11877 #: ../fish/guestfish-actions.pod:3625 ../src/guestfs-actions.pod:5475
11878 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11882 #: ../fish/guestfish-actions.pod:3627 ../src/guestfs-actions.pod:5477
11887 #: ../fish/guestfish-actions.pod:3629 ../src/guestfs-actions.pod:5479
11888 msgid "NEC PC-98 format, common in Japan apparently."
11892 #: ../fish/guestfish-actions.pod:3631 ../src/guestfs-actions.pod:5481
11897 #: ../fish/guestfish-actions.pod:3633 ../src/guestfs-actions.pod:5483
11898 msgid "Sun disk labels."
11902 #: ../fish/guestfish-actions.pod:3637
11907 #: ../fish/guestfish-actions.pod:3639
11910 " part-list device\n"
11915 #: ../fish/guestfish-actions.pod:3641 ../src/guestfs-actions.pod:5497
11917 "This command parses the partition table on C<device> and returns the list of "
11918 "partitions found."
11922 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5500
11923 msgid "The fields in the returned structure are:"
11927 #: ../fish/guestfish-actions.pod:3648 ../src/guestfs-actions.pod:5504
11928 msgid "B<part_num>"
11932 #: ../fish/guestfish-actions.pod:3650 ../src/guestfs-actions.pod:5506
11933 msgid "Partition number, counting from 1."
11937 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5508
11938 msgid "B<part_start>"
11942 #: ../fish/guestfish-actions.pod:3654
11944 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11945 "the device's sector size, see L</blockdev-getss>."
11949 #: ../fish/guestfish-actions.pod:3657 ../src/guestfs-actions.pod:5513
11950 msgid "B<part_end>"
11954 #: ../fish/guestfish-actions.pod:3659 ../src/guestfs-actions.pod:5515
11955 msgid "End of the partition in bytes."
11959 #: ../fish/guestfish-actions.pod:3661 ../src/guestfs-actions.pod:5517
11960 msgid "B<part_size>"
11964 #: ../fish/guestfish-actions.pod:3663 ../src/guestfs-actions.pod:5519
11965 msgid "Size of the partition in bytes."
11969 #: ../fish/guestfish-actions.pod:3667
11970 msgid "part-set-bootable"
11974 #: ../fish/guestfish-actions.pod:3669
11977 " part-set-bootable device partnum true|false\n"
11982 #: ../fish/guestfish-actions.pod:3671 ../src/guestfs-actions.pod:5537
11984 "This sets the bootable flag on partition numbered C<partnum> on device "
11985 "C<device>. Note that partitions are numbered from 1."
11989 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5540
11991 "The bootable flag is used by some operating systems (notably Windows) to "
11992 "determine which partition to boot from. It is by no means universally "
11997 #: ../fish/guestfish-actions.pod:3678
11998 msgid "part-set-mbr-id"
12002 #: ../fish/guestfish-actions.pod:3680
12005 " part-set-mbr-id device partnum idbyte\n"
12010 #: ../fish/guestfish-actions.pod:3682 ../src/guestfs-actions.pod:5556
12012 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12013 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12014 "documentation are in fact hexadecimal numbers, but usually documented "
12015 "without any leading \"0x\" which might be confusing."
12019 #: ../fish/guestfish-actions.pod:3692
12020 msgid "part-set-name"
12024 #: ../fish/guestfish-actions.pod:3694
12027 " part-set-name device partnum name\n"
12032 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5578
12034 "This sets the partition name on partition numbered C<partnum> on device "
12035 "C<device>. Note that partitions are numbered from 1."
12039 #: ../fish/guestfish-actions.pod:3699 ../src/guestfs-actions.pod:5581
12041 "The partition name can only be set on certain types of partition table. "
12042 "This works on C<gpt> but not on C<mbr> partitions."
12046 #: ../fish/guestfish-actions.pod:3702
12047 msgid "part-to-dev"
12051 #: ../fish/guestfish-actions.pod:3704
12054 " part-to-dev partition\n"
12059 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5594
12061 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12062 "partition number, returning the device name (eg. \"/dev/sdb\")."
12066 #: ../fish/guestfish-actions.pod:3710
12068 "The named partition must exist, for example as a string returned from L</"
12069 "list-partitions>."
12073 #: ../fish/guestfish-actions.pod:3713
12074 msgid "ping-daemon"
12078 #: ../fish/guestfish-actions.pod:3715
12086 #: ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5611
12088 "This is a test probe into the guestfs daemon running inside the qemu "
12089 "subprocess. Calling this function checks that the daemon responds to the "
12090 "ping message, without affecting the daemon or attached block device(s) in "
12095 #: ../fish/guestfish-actions.pod:3722
12100 #: ../fish/guestfish-actions.pod:3724
12103 " pread path count offset\n"
12108 #: ../fish/guestfish-actions.pod:3726 ../src/guestfs-actions.pod:5629
12110 "This command lets you read part of a file. It reads C<count> bytes of the "
12111 "file, starting at C<offset>, from file C<path>."
12115 #: ../fish/guestfish-actions.pod:3729 ../fish/guestfish-actions.pod:3744
12116 #: ../src/guestfs-actions.pod:5632 ../src/guestfs-actions.pod:5658
12118 "This may read fewer bytes than requested. For further details see the "
12119 "L<pread(2)> system call."
12123 #: ../fish/guestfish-actions.pod:3732
12124 msgid "See also L</pwrite>, L</pread-device>."
12128 #: ../fish/guestfish-actions.pod:3737
12129 msgid "pread-device"
12133 #: ../fish/guestfish-actions.pod:3739
12136 " pread-device device count offset\n"
12141 #: ../fish/guestfish-actions.pod:3741 ../src/guestfs-actions.pod:5655
12143 "This command lets you read part of a file. It reads C<count> bytes of "
12144 "C<device>, starting at C<offset>."
12148 #: ../fish/guestfish-actions.pod:3747
12149 msgid "See also L</pread>."
12153 #: ../fish/guestfish-actions.pod:3752
12158 #: ../fish/guestfish-actions.pod:3754
12161 " pvcreate device\n"
12166 #: ../fish/guestfish-actions.pod:3756 ../src/guestfs-actions.pod:5678
12168 "This creates an LVM physical volume on the named C<device>, where C<device> "
12169 "should usually be a partition name such as C</dev/sda1>."
12173 #: ../fish/guestfish-actions.pod:3760
12178 #: ../fish/guestfish-actions.pod:3762
12181 " pvremove device\n"
12186 #: ../fish/guestfish-actions.pod:3764 ../src/guestfs-actions.pod:5692
12188 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12193 #: ../fish/guestfish-actions.pod:3767 ../src/guestfs-actions.pod:5695
12195 "The implementation uses the C<pvremove> command which refuses to wipe "
12196 "physical volumes that contain any volume groups, so you have to remove those "
12201 #: ../fish/guestfish-actions.pod:3771
12206 #: ../fish/guestfish-actions.pod:3773
12209 " pvresize device\n"
12214 #: ../fish/guestfish-actions.pod:3775 ../src/guestfs-actions.pod:5709
12216 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12217 "the new size of the underlying device."
12221 #: ../fish/guestfish-actions.pod:3778
12222 msgid "pvresize-size"
12226 #: ../fish/guestfish-actions.pod:3780
12229 " pvresize-size device size\n"
12234 #: ../fish/guestfish-actions.pod:3782
12236 "This command is the same as L</pvresize> except that it allows you to "
12237 "specify the new size (in bytes) explicitly."
12241 #: ../fish/guestfish-actions.pod:3785
12246 #: ../fish/guestfish-actions.pod:3787
12254 #: ../fish/guestfish-actions.pod:3789 ../src/guestfs-actions.pod:5735
12256 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12261 #: ../fish/guestfish-actions.pod:3792 ../src/guestfs-actions.pod:5738
12263 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12268 #: ../fish/guestfish-actions.pod:3795
12269 msgid "See also L</pvs-full>."
12273 #: ../fish/guestfish-actions.pod:3797
12278 #: ../fish/guestfish-actions.pod:3799
12286 #: ../fish/guestfish-actions.pod:3801 ../src/guestfs-actions.pod:5754
12288 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12289 "(8)> command. The \"full\" version includes all fields."
12293 #: ../fish/guestfish-actions.pod:3804
12298 #: ../fish/guestfish-actions.pod:3806
12306 #: ../fish/guestfish-actions.pod:3808 ../src/guestfs-actions.pod:5769
12307 msgid "This command returns the UUID of the LVM PV C<device>."
12311 #: ../fish/guestfish-actions.pod:3810
12316 #: ../fish/guestfish-actions.pod:3812
12319 " pwrite path content offset\n"
12324 #: ../fish/guestfish-actions.pod:3814 ../src/guestfs-actions.pod:5785
12326 "This command writes to part of a file. It writes the data buffer C<content> "
12327 "to the file C<path> starting at offset C<offset>."
12331 #: ../fish/guestfish-actions.pod:3817 ../src/guestfs-actions.pod:5788
12333 "This command implements the L<pwrite(2)> system call, and like that system "
12334 "call it may not write the full data requested. The return value is the "
12335 "number of bytes that were actually written to the file. This could even be "
12336 "0, although short writes are unlikely for regular files in ordinary "
12341 #: ../fish/guestfish-actions.pod:3823
12342 msgid "See also L</pread>, L</pwrite-device>."
12346 #: ../fish/guestfish-actions.pod:3828
12347 msgid "pwrite-device"
12351 #: ../fish/guestfish-actions.pod:3830
12354 " pwrite-device device content offset\n"
12359 #: ../fish/guestfish-actions.pod:3832 ../src/guestfs-actions.pod:5812
12361 "This command writes to part of a device. It writes the data buffer "
12362 "C<content> to C<device> starting at offset C<offset>."
12366 #: ../fish/guestfish-actions.pod:3835 ../src/guestfs-actions.pod:5815
12368 "This command implements the L<pwrite(2)> system call, and like that system "
12369 "call it may not write the full data requested (although short writes to disk "
12370 "devices and partitions are probably impossible with standard Linux kernels)."
12374 #: ../fish/guestfish-actions.pod:3840
12375 msgid "See also L</pwrite>."
12379 #: ../fish/guestfish-actions.pod:3845
12384 #: ../fish/guestfish-actions.pod:3847
12387 " read-file path\n"
12392 #: ../fish/guestfish-actions.pod:3849 ../src/guestfs-actions.pod:5836
12393 msgid "This calls returns the contents of the file C<path> as a buffer."
12397 #: ../fish/guestfish-actions.pod:3852
12399 "Unlike L</cat>, this function can correctly handle files that contain "
12400 "embedded ASCII NUL characters. However unlike L</download>, this function "
12401 "is limited in the total size of file that can be handled."
12405 #: ../fish/guestfish-actions.pod:3860
12410 #: ../fish/guestfish-actions.pod:3862
12413 " read-lines path\n"
12418 #: ../fish/guestfish-actions.pod:3866 ../src/guestfs-actions.pod:5861
12420 "The file contents are returned as a list of lines. Trailing C<LF> and "
12421 "C<CRLF> character sequences are I<not> returned."
12425 #: ../fish/guestfish-actions.pod:3869
12427 "Note that this function cannot correctly handle binary files (specifically, "
12428 "files containing C<\\0> character which is treated as end of line). For "
12429 "those you need to use the L</read-file> function which has a more complex "
12434 #: ../fish/guestfish-actions.pod:3874
12439 #: ../fish/guestfish-actions.pod:3876
12447 #: ../fish/guestfish-actions.pod:3878 ../src/guestfs-actions.pod:5881
12448 msgid "This returns the list of directory entries in directory C<dir>."
12452 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:5883
12454 "All entries in the directory are returned, including C<.> and C<..>. The "
12455 "entries are I<not> sorted, but returned in the same order as the underlying "
12460 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5887
12462 "Also this call returns basic file type information about each file. The "
12463 "C<ftyp> field will contain one of the following characters:"
12467 #: ../fish/guestfish-actions.pod:3889 ../src/guestfs-actions.pod:5892
12472 #: ../fish/guestfish-actions.pod:3891 ../src/guestfs-actions.pod:5894
12473 msgid "Block special"
12477 #: ../fish/guestfish-actions.pod:3893 ../src/guestfs-actions.pod:5896
12482 #: ../fish/guestfish-actions.pod:3895 ../src/guestfs-actions.pod:5898
12483 msgid "Char special"
12487 #: ../fish/guestfish-actions.pod:3897 ../src/guestfs-actions.pod:5900
12492 #: ../fish/guestfish-actions.pod:3899 ../src/guestfs-actions.pod:5902
12497 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5904
12502 #: ../fish/guestfish-actions.pod:3903 ../src/guestfs-actions.pod:5906
12503 msgid "FIFO (named pipe)"
12507 #: ../fish/guestfish-actions.pod:3905 ../src/guestfs-actions.pod:5908
12512 #: ../fish/guestfish-actions.pod:3907 ../src/guestfs-actions.pod:5910
12513 msgid "Symbolic link"
12517 #: ../fish/guestfish-actions.pod:3909 ../src/guestfs-actions.pod:5912
12522 #: ../fish/guestfish-actions.pod:3911 ../src/guestfs-actions.pod:5914
12523 msgid "Regular file"
12527 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:5916
12532 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5918
12537 #: ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:5920
12542 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5922
12543 msgid "Unknown file type"
12547 #: ../fish/guestfish-actions.pod:3921 ../src/guestfs-actions.pod:5924
12552 #: ../fish/guestfish-actions.pod:3923 ../src/guestfs-actions.pod:5926
12554 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12558 #: ../fish/guestfish-actions.pod:3928
12560 "This function is primarily intended for use by programs. To get a simple "
12561 "list of names, use L</ls>. To get a printable directory for human "
12562 "consumption, use L</ll>."
12566 #: ../fish/guestfish-actions.pod:3932
12571 #: ../fish/guestfish-actions.pod:3934
12579 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:5947
12580 msgid "This command reads the target of a symbolic link."
12584 #: ../fish/guestfish-actions.pod:3938
12585 msgid "readlinklist"
12589 #: ../fish/guestfish-actions.pod:3940
12592 " readlinklist path 'names ...'\n"
12597 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:5961
12599 "This call allows you to do a C<readlink> operation on multiple files, where "
12600 "all files are in the directory C<path>. C<names> is the list of files from "
12605 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:5965
12607 "On return you get a list of strings, with a one-to-one correspondence to the "
12608 "C<names> list. Each string is the value of the symbolic link."
12612 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:5969
12614 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12615 "result string is the empty string C<\"\">. However the whole operation is "
12616 "completed even if there were C<readlink(2)> errors, and so you can call this "
12617 "function with names where you don't know if they are symbolic links already "
12618 "(albeit slightly less efficient)."
12622 #: ../fish/guestfish-actions.pod:3957 ../src/guestfs-actions.pod:5976
12624 "This call is intended for programs that want to efficiently list a directory "
12625 "contents without making many round-trips. Very long directory listings "
12626 "might cause the protocol message size to be exceeded, causing this call to "
12627 "fail. The caller must split up such requests into smaller groups of names."
12631 #: ../fish/guestfish-actions.pod:3964
12636 #: ../fish/guestfish-actions.pod:3966
12644 #: ../fish/guestfish-actions.pod:3968 ../src/guestfs-actions.pod:5995
12646 "Return the canonicalized absolute pathname of C<path>. The returned path "
12647 "has no C<.>, C<..> or symbolic link path elements."
12651 #: ../fish/guestfish-actions.pod:3971
12652 msgid "removexattr"
12656 #: ../fish/guestfish-actions.pod:3973
12659 " removexattr xattr path\n"
12664 #: ../fish/guestfish-actions.pod:3975 ../src/guestfs-actions.pod:6010
12666 "This call removes the extended attribute named C<xattr> of the file C<path>."
12670 #: ../fish/guestfish-actions.pod:3978
12671 msgid "See also: L</lremovexattr>, L<attr(5)>."
12675 #: ../fish/guestfish-actions.pod:3980
12680 #: ../fish/guestfish-actions.pod:3982
12683 " resize2fs device\n"
12688 #: ../fish/guestfish-actions.pod:3984 ../src/guestfs-actions.pod:6025
12690 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12691 "underlying device."
12695 #: ../fish/guestfish-actions.pod:3987
12697 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
12698 "before calling this command. For unknown reasons C<resize2fs> sometimes "
12699 "gives an error about this and sometimes not. In any case, it is always safe "
12700 "to call L</e2fsck-f> before calling this function."
12704 #: ../fish/guestfish-actions.pod:3993
12705 msgid "resize2fs-M"
12709 #: ../fish/guestfish-actions.pod:3995
12712 " resize2fs-M device\n"
12717 #: ../fish/guestfish-actions.pod:3997
12719 "This command is the same as L</resize2fs>, but the filesystem is resized to "
12720 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
12725 #: ../fish/guestfish-actions.pod:4001
12727 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
12728 "and read the C<Block size> and C<Block count> values. These two numbers, "
12729 "multiplied together, give the resulting size of the minimal filesystem in "
12734 #: ../fish/guestfish-actions.pod:4006
12735 msgid "resize2fs-size"
12739 #: ../fish/guestfish-actions.pod:4008
12742 " resize2fs-size device size\n"
12747 #: ../fish/guestfish-actions.pod:4010
12749 "This command is the same as L</resize2fs> except that it allows you to "
12750 "specify the new size (in bytes) explicitly."
12754 #: ../fish/guestfish-actions.pod:4013
12759 #: ../fish/guestfish-actions.pod:4015
12767 #: ../fish/guestfish-actions.pod:4017 ../src/guestfs-actions.pod:6077
12768 msgid "Remove the single file C<path>."
12772 #: ../fish/guestfish-actions.pod:4019
12777 #: ../fish/guestfish-actions.pod:4021
12785 #: ../fish/guestfish-actions.pod:4023 ../src/guestfs-actions.pod:6089
12787 "Remove the file or directory C<path>, recursively removing the contents if "
12788 "its a directory. This is like the C<rm -rf> shell command."
12792 #: ../fish/guestfish-actions.pod:4027
12797 #: ../fish/guestfish-actions.pod:4029
12805 #: ../fish/guestfish-actions.pod:4031 ../src/guestfs-actions.pod:6103
12806 msgid "Remove the single directory C<path>."
12810 #: ../fish/guestfish-actions.pod:4033
12811 msgid "rmmountpoint"
12815 #: ../fish/guestfish-actions.pod:4035
12818 " rmmountpoint exemptpath\n"
12823 #: ../fish/guestfish-actions.pod:4037
12825 "This calls removes a mountpoint that was previously created with L</"
12826 "mkmountpoint>. See L</mkmountpoint> for full details."
12830 #: ../fish/guestfish-actions.pod:4041
12831 msgid "scrub-device"
12835 #: ../fish/guestfish-actions.pod:4043
12838 " scrub-device device\n"
12843 #: ../fish/guestfish-actions.pod:4045 ../src/guestfs-actions.pod:6129
12845 "This command writes patterns over C<device> to make data retrieval more "
12850 #: ../fish/guestfish-actions.pod:4048 ../fish/guestfish-actions.pod:4063
12851 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6132
12852 #: ../src/guestfs-actions.pod:6153 ../src/guestfs-actions.pod:6172
12854 "It is an interface to the L<scrub(1)> program. See that manual page for "
12859 #: ../fish/guestfish-actions.pod:4054
12864 #: ../fish/guestfish-actions.pod:4056
12867 " scrub-file file\n"
12872 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6148
12874 "This command writes patterns over a file to make data retrieval more "
12879 #: ../fish/guestfish-actions.pod:4061 ../src/guestfs-actions.pod:6151
12880 msgid "The file is I<removed> after scrubbing."
12884 #: ../fish/guestfish-actions.pod:4066
12885 msgid "scrub-freespace"
12889 #: ../fish/guestfish-actions.pod:4068
12892 " scrub-freespace dir\n"
12897 #: ../fish/guestfish-actions.pod:4070
12899 "This command creates the directory C<dir> and then fills it with files until "
12900 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
12901 "deletes them. The intention is to scrub any free space on the partition "
12902 "containing C<dir>."
12906 #: ../fish/guestfish-actions.pod:4079
12911 #: ../fish/guestfish-actions.pod:4081
12916 #: ../fish/guestfish-actions.pod:4083
12919 " set-append append\n"
12924 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6185
12926 "This function is used to add additional options to the guest kernel command "
12931 #: ../fish/guestfish-actions.pod:4088 ../src/guestfs-actions.pod:6188
12933 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12934 "environment variable."
12938 #: ../fish/guestfish-actions.pod:4091 ../src/guestfs-actions.pod:6191
12940 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12941 "(libguestfs always adds a few of its own)."
12945 #: ../fish/guestfish-actions.pod:4094
12946 msgid "set-attach-method"
12950 #: ../fish/guestfish-actions.pod:4096
12951 msgid "attach-method"
12955 #: ../fish/guestfish-actions.pod:4098
12958 " set-attach-method attachmethod\n"
12963 #: ../fish/guestfish-actions.pod:4100 ../src/guestfs-actions.pod:6204
12965 "Set the method that libguestfs uses to connect to the back end guestfsd "
12966 "daemon. Possible methods are:"
12970 #: ../fish/guestfish-actions.pod:4105 ../src/guestfs-actions.pod:6209
12971 #: ../src/guestfs.pod:2803
12972 msgid "C<appliance>"
12976 #: ../fish/guestfish-actions.pod:4107 ../src/guestfs-actions.pod:6211
12978 "Launch an appliance and connect to it. This is the ordinary method and the "
12983 #: ../fish/guestfish-actions.pod:4110 ../src/guestfs-actions.pod:6214
12984 msgid "C<unix:I<path>>"
12988 #: ../fish/guestfish-actions.pod:4112 ../src/guestfs-actions.pod:6216
12989 msgid "Connect to the Unix domain socket I<path>."
12993 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6218
12995 "This method lets you connect to an existing daemon or (using virtio-serial) "
12996 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
12997 "RUNNING DAEMONS>."
13001 #: ../fish/guestfish-actions.pod:4120
13002 msgid "set-autosync"
13006 #: ../fish/guestfish-actions.pod:4122
13011 #: ../fish/guestfish-actions.pod:4124
13014 " set-autosync true|false\n"
13019 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6234
13021 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13022 "effort attempt to make filesystems consistent and synchronized when the "
13023 "handle is closed (also if the program exits without closing handles)."
13027 #: ../fish/guestfish-actions.pod:4131 ../src/guestfs-actions.pod:6239
13029 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13030 "disabled by default)."
13034 #: ../fish/guestfish-actions.pod:4134
13039 #: ../fish/guestfish-actions.pod:4136
13044 #: ../fish/guestfish-actions.pod:4138
13047 " set-direct true|false\n"
13052 #: ../fish/guestfish-actions.pod:4140 ../src/guestfs-actions.pod:6252
13054 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13055 "passed directly through to the appliance once it is launched."
13059 #: ../fish/guestfish-actions.pod:4144
13061 "One consequence of this is that log messages aren't caught by the library "
13062 "and handled by L</set-log-message-callback>, but go straight to stdout."
13066 #: ../fish/guestfish-actions.pod:4148 ../src/guestfs-actions.pod:6260
13067 msgid "You probably don't want to use this unless you know what you are doing."
13071 #: ../fish/guestfish-actions.pod:4151 ../src/guestfs-actions.pod:6263
13072 msgid "The default is disabled."
13076 #: ../fish/guestfish-actions.pod:4153
13077 msgid "set-e2label"
13081 #: ../fish/guestfish-actions.pod:4155
13084 " set-e2label device label\n"
13089 #: ../fish/guestfish-actions.pod:4157 ../src/guestfs-actions.pod:6276
13091 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13092 "C<label>. Filesystem labels are limited to 16 characters."
13096 #: ../fish/guestfish-actions.pod:4161
13098 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
13099 "label on a filesystem."
13103 #: ../fish/guestfish-actions.pod:4164
13108 #: ../fish/guestfish-actions.pod:4166
13111 " set-e2uuid device uuid\n"
13116 #: ../fish/guestfish-actions.pod:4168 ../src/guestfs-actions.pod:6294
13118 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13119 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13120 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13124 #: ../fish/guestfish-actions.pod:4173
13126 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
13127 "UUID of a filesystem."
13131 #: ../fish/guestfish-actions.pod:4176
13132 msgid "set-memsize"
13136 #: ../fish/guestfish-actions.pod:4178
13141 #: ../fish/guestfish-actions.pod:4180
13144 " set-memsize memsize\n"
13149 #: ../fish/guestfish-actions.pod:4182
13151 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13152 "This only has any effect if called before L</launch>."
13156 #: ../fish/guestfish-actions.pod:4186 ../src/guestfs-actions.pod:6316
13158 "You can also change this by setting the environment variable "
13159 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13163 #: ../fish/guestfish-actions.pod:4193
13164 msgid "set-network"
13168 #: ../fish/guestfish-actions.pod:4195
13173 #: ../fish/guestfish-actions.pod:4197
13176 " set-network true|false\n"
13181 #: ../fish/guestfish-actions.pod:4199 ../src/guestfs-actions.pod:6333
13183 "If C<network> is true, then the network is enabled in the libguestfs "
13184 "appliance. The default is false."
13188 #: ../fish/guestfish-actions.pod:4202 ../src/guestfs-actions.pod:6336
13190 "This affects whether commands are able to access the network (see L<guestfs"
13191 "(3)/RUNNING COMMANDS>)."
13195 #: ../fish/guestfish-actions.pod:4205
13197 "You must call this before calling L</launch>, otherwise it has no effect."
13201 #: ../fish/guestfish-actions.pod:4208
13206 #: ../fish/guestfish-actions.pod:4212
13209 " set-path searchpath\n"
13214 #: ../fish/guestfish-actions.pod:4214 ../src/guestfs-actions.pod:6352
13215 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13219 #: ../fish/guestfish-actions.pod:4216 ../src/guestfs-actions.pod:6354
13221 "The default is C<$libdir/guestfs> unless overridden by setting "
13222 "C<LIBGUESTFS_PATH> environment variable."
13226 #: ../fish/guestfish-actions.pod:4219 ../src/guestfs-actions.pod:6357
13227 msgid "Setting C<path> to C<NULL> restores the default path."
13231 #: ../fish/guestfish-actions.pod:4221
13236 #: ../fish/guestfish-actions.pod:4223
13241 #: ../fish/guestfish-actions.pod:4225
13244 " set-pgroup true|false\n"
13249 #: ../fish/guestfish-actions.pod:4227 ../src/guestfs-actions.pod:6369
13251 "If C<pgroup> is true, child processes are placed into their own process "
13256 #: ../fish/guestfish-actions.pod:4230 ../src/guestfs-actions.pod:6372
13258 "The practical upshot of this is that signals like C<SIGINT> (from users "
13259 "pressing C<^C>) won't be received by the child process."
13263 #: ../fish/guestfish-actions.pod:4233 ../src/guestfs-actions.pod:6375
13265 "The default for this flag is false, because usually you want C<^C> to kill "
13270 #: ../fish/guestfish-actions.pod:4236
13275 #: ../fish/guestfish-actions.pod:4238
13280 #: ../fish/guestfish-actions.pod:4240
13288 #: ../fish/guestfish-actions.pod:4242 ../src/guestfs-actions.pod:6388
13289 msgid "Set the qemu binary that we will use."
13293 #: ../fish/guestfish-actions.pod:4244 ../src/guestfs-actions.pod:6390
13295 "The default is chosen when the library was compiled by the configure script."
13299 #: ../fish/guestfish-actions.pod:4247 ../src/guestfs-actions.pod:6393
13301 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13306 #: ../fish/guestfish-actions.pod:4250 ../src/guestfs-actions.pod:6396
13307 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13311 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6398
13313 "Note that you should call this function as early as possible after creating "
13314 "the handle. This is because some pre-launch operations depend on testing "
13315 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13316 "don't retest features, and so you might see inconsistent results. Using the "
13317 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13318 "the qemu binary at the same time as the handle is created."
13322 #: ../fish/guestfish-actions.pod:4260
13323 msgid "set-recovery-proc"
13327 #: ../fish/guestfish-actions.pod:4262
13328 msgid "recovery-proc"
13332 #: ../fish/guestfish-actions.pod:4264
13335 " set-recovery-proc true|false\n"
13340 #: ../fish/guestfish-actions.pod:4266
13342 "If this is called with the parameter C<false> then L</launch> does not "
13343 "create a recovery process. The purpose of the recovery process is to stop "
13344 "runaway qemu processes in the case where the main program aborts abruptly."
13348 #: ../fish/guestfish-actions.pod:4271
13350 "This only has any effect if called before L</launch>, and the default is "
13355 #: ../fish/guestfish-actions.pod:4274 ../src/guestfs-actions.pod:6424
13357 "About the only time when you would want to disable this is if the main "
13358 "process will fork itself into the background (\"daemonize\" itself). In "
13359 "this case the recovery process thinks that the main program has disappeared "
13360 "and so kills qemu, which is not very helpful."
13364 #: ../fish/guestfish-actions.pod:4280
13365 msgid "set-selinux"
13369 #: ../fish/guestfish-actions.pod:4282
13374 #: ../fish/guestfish-actions.pod:4284
13377 " set-selinux true|false\n"
13382 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6440
13384 "This sets the selinux flag that is passed to the appliance at boot time. "
13385 "The default is C<selinux=0> (disabled)."
13389 #: ../fish/guestfish-actions.pod:4289 ../src/guestfs-actions.pod:6443
13391 "Note that if SELinux is enabled, it is always in Permissive mode "
13392 "(C<enforcing=0>)."
13396 #: ../fish/guestfish-actions.pod:4295
13401 #: ../fish/guestfish-actions.pod:4297
13406 #: ../fish/guestfish-actions.pod:4299
13409 " set-trace true|false\n"
13414 #: ../fish/guestfish-actions.pod:4301 ../src/guestfs-actions.pod:6459
13416 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
13417 "return values are traced."
13421 #: ../fish/guestfish-actions.pod:4304 ../src/guestfs-actions.pod:6462
13423 "If you want to trace C API calls into libguestfs (and other libraries) then "
13424 "possibly a better way is to use the external ltrace(1) command."
13428 #: ../fish/guestfish-actions.pod:4308 ../src/guestfs-actions.pod:6466
13430 "Command traces are disabled unless the environment variable "
13431 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13435 #: ../fish/guestfish-actions.pod:4311
13437 "Trace messages are normally sent to C<stderr>, unless you register a "
13438 "callback to send them somewhere else (see L</set-event-callback>)."
13442 #: ../fish/guestfish-actions.pod:4315
13443 msgid "set-verbose"
13447 #: ../fish/guestfish-actions.pod:4317
13452 #: ../fish/guestfish-actions.pod:4319
13455 " set-verbose true|false\n"
13460 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6483
13461 msgid "If C<verbose> is true, this turns on verbose messages."
13465 #: ../fish/guestfish-actions.pod:4323 ../src/guestfs-actions.pod:6485
13467 "Verbose messages are disabled unless the environment variable "
13468 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13472 #: ../fish/guestfish-actions.pod:4326
13474 "Verbose messages are normally sent to C<stderr>, unless you register a "
13475 "callback to send them somewhere else (see L</set-event-callback>)."
13479 #: ../fish/guestfish-actions.pod:4330
13484 #: ../fish/guestfish-actions.pod:4332
13487 " setcon context\n"
13492 #: ../fish/guestfish-actions.pod:4334 ../src/guestfs-actions.pod:6502
13494 "This sets the SELinux security context of the daemon to the string "
13499 #: ../fish/guestfish-actions.pod:4337 ../src/guestfs-actions.pod:6505
13500 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13504 #: ../fish/guestfish-actions.pod:4339
13509 #: ../fish/guestfish-actions.pod:4341
13512 " setxattr xattr val vallen path\n"
13517 #: ../fish/guestfish-actions.pod:4343 ../src/guestfs-actions.pod:6520
13519 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13520 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13524 #: ../fish/guestfish-actions.pod:4347
13525 msgid "See also: L</lsetxattr>, L<attr(5)>."
13529 #: ../fish/guestfish-actions.pod:4349
13534 #: ../fish/guestfish-actions.pod:4351
13537 " sfdisk device cyls heads sectors 'lines ...'\n"
13542 #: ../fish/guestfish-actions.pod:4353 ../src/guestfs-actions.pod:6540
13544 "This is a direct interface to the L<sfdisk(8)> program for creating "
13545 "partitions on block devices."
13549 #: ../fish/guestfish-actions.pod:4356 ../src/guestfs-actions.pod:6543
13550 msgid "C<device> should be a block device, for example C</dev/sda>."
13554 #: ../fish/guestfish-actions.pod:4358 ../src/guestfs-actions.pod:6545
13556 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13557 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
13558 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13559 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13560 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13561 "the kernel) cannot work out the right geometry and you will need to tell it."
13565 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6553
13567 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13568 "refer to the L<sfdisk(8)> manpage."
13572 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6556
13574 "To create a single partition occupying the whole disk, you would pass "
13575 "C<lines> as a single element list, when the single element being the string "
13580 #: ../fish/guestfish-actions.pod:4373
13581 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
13585 #: ../fish/guestfish-actions.pod:4379 ../fish/guestfish-actions.pod:4402
13586 #: ../fish/guestfish-actions.pod:4424
13588 "This function is deprecated. In new code, use the L</part_add> call instead."
13592 #: ../fish/guestfish-actions.pod:4386
13597 #: ../fish/guestfish-actions.pod:4388
13600 " sfdiskM device 'lines ...'\n"
13605 #: ../fish/guestfish-actions.pod:4390
13607 "This is a simplified interface to the L</sfdisk> command, where partition "
13608 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13609 "you don't need to specify the cyls, heads and sectors parameters which were "
13610 "rarely if ever used anyway."
13614 #: ../fish/guestfish-actions.pod:4396
13615 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13619 #: ../fish/guestfish-actions.pod:4409
13624 #: ../fish/guestfish-actions.pod:4411
13627 " sfdisk-N device partnum cyls heads sectors line\n"
13632 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6618
13634 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13635 "(note: C<n> counts from 1)."
13639 #: ../fish/guestfish-actions.pod:4416
13641 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13642 "cyls/heads/sectors parameters."
13646 #: ../fish/guestfish-actions.pod:4419
13647 msgid "See also: L</part-add>"
13651 #: ../fish/guestfish-actions.pod:4431
13652 msgid "sfdisk-disk-geometry"
13656 #: ../fish/guestfish-actions.pod:4433
13659 " sfdisk-disk-geometry device\n"
13664 #: ../fish/guestfish-actions.pod:4435
13666 "This displays the disk geometry of C<device> read from the partition table. "
13667 "Especially in the case where the underlying block device has been resized, "
13668 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
13669 "kernel-geometry>)."
13673 #: ../fish/guestfish-actions.pod:4440 ../fish/guestfish-actions.pod:4449
13674 #: ../src/guestfs-actions.pod:6651 ../src/guestfs-actions.pod:6667
13675 msgid "The result is in human-readable format, and not designed to be parsed."
13679 #: ../fish/guestfish-actions.pod:4443
13680 msgid "sfdisk-kernel-geometry"
13684 #: ../fish/guestfish-actions.pod:4445
13687 " sfdisk-kernel-geometry device\n"
13692 #: ../fish/guestfish-actions.pod:4447 ../src/guestfs-actions.pod:6665
13693 msgid "This displays the kernel's idea of the geometry of C<device>."
13697 #: ../fish/guestfish-actions.pod:4452
13702 #: ../fish/guestfish-actions.pod:4454
13705 " sfdisk-l device\n"
13710 #: ../fish/guestfish-actions.pod:4456 ../src/guestfs-actions.pod:6681
13712 "This displays the partition table on C<device>, in the human-readable output "
13713 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13717 #: ../fish/guestfish-actions.pod:4460
13718 msgid "See also: L</part-list>"
13722 #: ../fish/guestfish-actions.pod:4462
13724 "This function is deprecated. In new code, use the L</part_list> call "
13729 #: ../fish/guestfish-actions.pod:4469
13734 #: ../fish/guestfish-actions.pod:4471
13742 #: ../fish/guestfish-actions.pod:4473 ../src/guestfs-actions.pod:6705
13744 "This call runs a command from the guest filesystem via the guest's C</bin/"
13749 #: ../fish/guestfish-actions.pod:4476
13750 msgid "This is like L</command>, but passes the command to:"
13754 #: ../fish/guestfish-actions.pod:4478 ../src/guestfs-actions.pod:6710
13757 " /bin/sh -c \"command\"\n"
13762 #: ../fish/guestfish-actions.pod:4480 ../src/guestfs-actions.pod:6712
13764 "Depending on the guest's shell, this usually results in wildcards being "
13765 "expanded, shell expressions being interpolated and so on."
13769 #: ../fish/guestfish-actions.pod:4484
13770 msgid "All the provisos about L</command> apply to this call."
13774 #: ../fish/guestfish-actions.pod:4486
13779 #: ../fish/guestfish-actions.pod:4488
13782 " sh-lines command\n"
13787 #: ../fish/guestfish-actions.pod:4490
13788 msgid "This is the same as L</sh>, but splits the result into a list of lines."
13792 #: ../fish/guestfish-actions.pod:4493
13793 msgid "See also: L</command-lines>"
13797 #: ../fish/guestfish-actions.pod:4495
13802 #: ../fish/guestfish-actions.pod:4497
13810 #: ../fish/guestfish-actions.pod:4499 ../src/guestfs-actions.pod:6746
13811 msgid "Sleep for C<secs> seconds."
13815 #: ../fish/guestfish-actions.pod:4501
13820 #: ../fish/guestfish-actions.pod:4503
13828 #: ../fish/guestfish-actions.pod:4507 ../src/guestfs-actions.pod:6760
13829 msgid "This is the same as the C<stat(2)> system call."
13833 #: ../fish/guestfish-actions.pod:4509
13838 #: ../fish/guestfish-actions.pod:4511
13846 #: ../fish/guestfish-actions.pod:4513 ../src/guestfs-actions.pod:6774
13848 "Returns file system statistics for any mounted file system. C<path> should "
13849 "be a file or directory in the mounted file system (typically it is the mount "
13850 "point itself, but it doesn't need to be)."
13854 #: ../fish/guestfish-actions.pod:4517 ../src/guestfs-actions.pod:6778
13855 msgid "This is the same as the C<statvfs(2)> system call."
13859 #: ../fish/guestfish-actions.pod:4519
13864 #: ../fish/guestfish-actions.pod:4521
13872 #: ../fish/guestfish-actions.pod:4523 ../src/guestfs-actions.pod:6792
13874 "This runs the L<strings(1)> command on a file and returns the list of "
13875 "printable strings found."
13879 #: ../fish/guestfish-actions.pod:4529
13884 #: ../fish/guestfish-actions.pod:4531
13887 " strings-e encoding path\n"
13892 #: ../fish/guestfish-actions.pod:4533
13894 "This is like the L</strings> command, but allows you to specify the encoding "
13895 "of strings that are looked for in the source file C<path>."
13899 #: ../fish/guestfish-actions.pod:4537 ../src/guestfs-actions.pod:6815
13900 msgid "Allowed encodings are:"
13904 #: ../fish/guestfish-actions.pod:4541 ../src/guestfs-actions.pod:6819
13909 #: ../fish/guestfish-actions.pod:4543
13911 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13912 "ISO-8859-X (this is what L</strings> uses)."
13916 #: ../fish/guestfish-actions.pod:4546 ../src/guestfs-actions.pod:6824
13921 #: ../fish/guestfish-actions.pod:4548 ../src/guestfs-actions.pod:6826
13922 msgid "Single 8-bit-byte characters."
13926 #: ../fish/guestfish-actions.pod:4550 ../src/guestfs-actions.pod:6828
13931 #: ../fish/guestfish-actions.pod:4552 ../src/guestfs-actions.pod:6830
13932 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13936 #: ../fish/guestfish-actions.pod:4555 ../src/guestfs-actions.pod:6833
13937 msgid "l (lower case letter L)"
13941 #: ../fish/guestfish-actions.pod:4557 ../src/guestfs-actions.pod:6835
13943 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13944 "examining binaries in Windows guests."
13948 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6838
13953 #: ../fish/guestfish-actions.pod:4562 ../src/guestfs-actions.pod:6840
13954 msgid "32-bit big endian such as UCS-4BE."
13958 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6842
13963 #: ../fish/guestfish-actions.pod:4566 ../src/guestfs-actions.pod:6844
13964 msgid "32-bit little endian such as UCS-4LE."
13968 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:6848
13969 msgid "The returned strings are transcoded to UTF-8."
13973 #: ../fish/guestfish-actions.pod:4575
13974 msgid "swapoff-device"
13978 #: ../fish/guestfish-actions.pod:4577
13981 " swapoff-device device\n"
13986 #: ../fish/guestfish-actions.pod:4579
13988 "This command disables the libguestfs appliance swap device or partition "
13989 "named C<device>. See L</swapon-device>."
13993 #: ../fish/guestfish-actions.pod:4583
13994 msgid "swapoff-file"
13998 #: ../fish/guestfish-actions.pod:4585
14001 " swapoff-file file\n"
14006 #: ../fish/guestfish-actions.pod:4587 ../src/guestfs-actions.pod:6879
14007 msgid "This command disables the libguestfs appliance swap on file."
14011 #: ../fish/guestfish-actions.pod:4589
14012 msgid "swapoff-label"
14016 #: ../fish/guestfish-actions.pod:4591
14019 " swapoff-label label\n"
14024 #: ../fish/guestfish-actions.pod:4593 ../src/guestfs-actions.pod:6891
14026 "This command disables the libguestfs appliance swap on labeled swap "
14031 #: ../fish/guestfish-actions.pod:4596
14032 msgid "swapoff-uuid"
14036 #: ../fish/guestfish-actions.pod:4598
14039 " swapoff-uuid uuid\n"
14044 #: ../fish/guestfish-actions.pod:4600 ../src/guestfs-actions.pod:6904
14046 "This command disables the libguestfs appliance swap partition with the given "
14051 #: ../fish/guestfish-actions.pod:4603
14052 msgid "swapon-device"
14056 #: ../fish/guestfish-actions.pod:4605
14059 " swapon-device device\n"
14064 #: ../fish/guestfish-actions.pod:4607
14066 "This command enables the libguestfs appliance to use the swap device or "
14067 "partition named C<device>. The increased memory is made available for all "
14068 "commands, for example those run using L</command> or L</sh>."
14072 #: ../fish/guestfish-actions.pod:4612 ../src/guestfs-actions.pod:6922
14074 "Note that you should not swap to existing guest swap partitions unless you "
14075 "know what you are doing. They may contain hibernation information, or other "
14076 "information that the guest doesn't want you to trash. You also risk leaking "
14077 "information about the host to the guest this way. Instead, attach a new "
14078 "host device to the guest and swap on that."
14082 #: ../fish/guestfish-actions.pod:4619
14083 msgid "swapon-file"
14087 #: ../fish/guestfish-actions.pod:4621
14090 " swapon-file file\n"
14095 #: ../fish/guestfish-actions.pod:4623
14097 "This command enables swap to a file. See L</swapon-device> for other notes."
14101 #: ../fish/guestfish-actions.pod:4626
14102 msgid "swapon-label"
14106 #: ../fish/guestfish-actions.pod:4628
14109 " swapon-label label\n"
14114 #: ../fish/guestfish-actions.pod:4630
14116 "This command enables swap to a labeled swap partition. See L</swapon-"
14117 "device> for other notes."
14121 #: ../fish/guestfish-actions.pod:4633
14122 msgid "swapon-uuid"
14126 #: ../fish/guestfish-actions.pod:4635
14129 " swapon-uuid uuid\n"
14134 #: ../fish/guestfish-actions.pod:4637
14136 "This command enables swap to a swap partition with the given UUID. See L</"
14137 "swapon-device> for other notes."
14141 #: ../fish/guestfish-actions.pod:4640
14146 #: ../fish/guestfish-actions.pod:4642
14154 #: ../fish/guestfish-actions.pod:4644 ../src/guestfs-actions.pod:6977
14156 "This syncs the disk, so that any writes are flushed through to the "
14157 "underlying disk image."
14161 #: ../fish/guestfish-actions.pod:4647 ../src/guestfs-actions.pod:6980
14163 "You should always call this if you have modified a disk image, before "
14164 "closing the handle."
14168 #: ../fish/guestfish-actions.pod:4650
14173 #: ../fish/guestfish-actions.pod:4652
14181 #: ../fish/guestfish-actions.pod:4654 ../src/guestfs-actions.pod:6993
14183 "This command returns up to the last 10 lines of a file as a list of strings."
14187 #: ../fish/guestfish-actions.pod:4660
14192 #: ../fish/guestfish-actions.pod:4662
14195 " tail-n nrlines path\n"
14200 #: ../fish/guestfish-actions.pod:4664 ../src/guestfs-actions.pod:7012
14202 "If the parameter C<nrlines> is a positive number, this returns the last "
14203 "C<nrlines> lines of the file C<path>."
14207 #: ../fish/guestfish-actions.pod:4667 ../src/guestfs-actions.pod:7015
14209 "If the parameter C<nrlines> is a negative number, this returns lines from "
14210 "the file C<path>, starting with the C<-nrlines>th line."
14214 #: ../fish/guestfish-actions.pod:4675
14219 #: ../fish/guestfish-actions.pod:4677
14222 " tar-in (tarfile|-) directory\n"
14227 #: ../fish/guestfish-actions.pod:4679 ../src/guestfs-actions.pod:7036
14229 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14230 "tar file) into C<directory>."
14234 #: ../fish/guestfish-actions.pod:4682
14235 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
14239 #: ../fish/guestfish-actions.pod:4687
14244 #: ../fish/guestfish-actions.pod:4689
14247 " tar-out directory (tarfile|-)\n"
14252 #: ../fish/guestfish-actions.pod:4691 ../src/guestfs-actions.pod:7053
14254 "This command packs the contents of C<directory> and downloads it to local "
14259 #: ../fish/guestfish-actions.pod:4694
14260 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
14264 #: ../fish/guestfish-actions.pod:4699
14269 #: ../fish/guestfish-actions.pod:4701
14272 " tgz-in (tarball|-) directory\n"
14277 #: ../fish/guestfish-actions.pod:4703 ../src/guestfs-actions.pod:7070
14279 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14280 "tar file) into C<directory>."
14284 #: ../fish/guestfish-actions.pod:4706
14285 msgid "To upload an uncompressed tarball, use L</tar-in>."
14289 #: ../fish/guestfish-actions.pod:4710
14294 #: ../fish/guestfish-actions.pod:4712
14297 " tgz-out directory (tarball|-)\n"
14302 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7086
14304 "This command packs the contents of C<directory> and downloads it to local "
14309 #: ../fish/guestfish-actions.pod:4717
14310 msgid "To download an uncompressed tarball, use L</tar-out>."
14314 #: ../fish/guestfish-actions.pod:4721
14319 #: ../fish/guestfish-actions.pod:4723
14327 #: ../fish/guestfish-actions.pod:4725 ../src/guestfs-actions.pod:7101
14329 "Touch acts like the L<touch(1)> command. It can be used to update the "
14330 "timestamps on a file, or, if the file does not exist, to create a new zero-"
14335 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7105
14337 "This command only works on regular files, and will fail on other file types "
14338 "such as directories, symbolic links, block special etc."
14342 #: ../fish/guestfish-actions.pod:4732
14347 #: ../fish/guestfish-actions.pod:4734
14355 #: ../fish/guestfish-actions.pod:4736 ../src/guestfs-actions.pod:7118
14357 "This command truncates C<path> to a zero-length file. The file must exist "
14362 #: ../fish/guestfish-actions.pod:4739
14363 msgid "truncate-size"
14367 #: ../fish/guestfish-actions.pod:4741
14370 " truncate-size path size\n"
14375 #: ../fish/guestfish-actions.pod:4743 ../src/guestfs-actions.pod:7132
14377 "This command truncates C<path> to size C<size> bytes. The file must exist "
14382 #: ../fish/guestfish-actions.pod:4746
14384 "If the current file size is less than C<size> then the file is extended to "
14385 "the required size with zero bytes. This creates a sparse file (ie. disk "
14386 "blocks are not allocated for the file until you write to it). To create a "
14387 "non-sparse file of zeroes, use L</fallocate64> instead."
14391 #: ../fish/guestfish-actions.pod:4752
14396 #: ../fish/guestfish-actions.pod:4754
14399 " tune2fs-l device\n"
14404 #: ../fish/guestfish-actions.pod:4756 ../src/guestfs-actions.pod:7151
14406 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14411 #: ../fish/guestfish-actions.pod:4759 ../src/guestfs-actions.pod:7154
14413 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14414 "for more details. The list of fields returned isn't clearly defined, and "
14415 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14416 "and the filesystem itself."
14420 #: ../fish/guestfish-actions.pod:4764
14425 #: ../fish/guestfish-actions.pod:4766
14428 " txz-in (tarball|-) directory\n"
14433 #: ../fish/guestfish-actions.pod:4768 ../src/guestfs-actions.pod:7174
14435 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14436 "tar file) into C<directory>."
14440 #: ../fish/guestfish-actions.pod:4773
14445 #: ../fish/guestfish-actions.pod:4775
14448 " txz-out directory (tarball|-)\n"
14453 #: ../fish/guestfish-actions.pod:4777 ../src/guestfs-actions.pod:7188
14455 "This command packs the contents of C<directory> and downloads it to local "
14456 "file C<tarball> (as an xz compressed tar archive)."
14460 #: ../fish/guestfish-actions.pod:4782
14465 #: ../fish/guestfish-actions.pod:4784
14473 #: ../fish/guestfish-actions.pod:4786 ../src/guestfs-actions.pod:7201
14475 "This function sets the mask used for creating new files and device nodes to "
14480 #: ../fish/guestfish-actions.pod:4789 ../src/guestfs-actions.pod:7204
14482 "Typical umask values would be C<022> which creates new files with "
14483 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
14484 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
14488 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7209
14490 "The default umask is C<022>. This is important because it means that "
14491 "directories and device nodes will be created with C<0644> or C<0755> mode "
14492 "even if you specify C<0777>."
14496 #: ../fish/guestfish-actions.pod:4798
14497 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
14501 #: ../fish/guestfish-actions.pod:4801 ../src/guestfs-actions.pod:7216
14502 msgid "This call returns the previous umask."
14506 #: ../fish/guestfish-actions.pod:4803
14511 #: ../fish/guestfish-actions.pod:4805
14516 #: ../fish/guestfish-actions.pod:4807
14519 " umount pathordevice\n"
14524 #: ../fish/guestfish-actions.pod:4809 ../src/guestfs-actions.pod:7228
14526 "This unmounts the given filesystem. The filesystem may be specified either "
14527 "by its mountpoint (path) or the device which contains the filesystem."
14531 #: ../fish/guestfish-actions.pod:4813
14536 #: ../fish/guestfish-actions.pod:4815
14537 msgid "unmount-all"
14541 #: ../fish/guestfish-actions.pod:4817
14549 #: ../fish/guestfish-actions.pod:4819 ../src/guestfs-actions.pod:7241
14550 msgid "This unmounts all mounted filesystems."
14554 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7243
14555 msgid "Some internal mounts are not unmounted by this call."
14559 #: ../fish/guestfish-actions.pod:4823
14564 #: ../fish/guestfish-actions.pod:4825
14567 " upload (filename|-) remotefilename\n"
14572 #: ../fish/guestfish-actions.pod:4827 ../fish/guestfish-actions.pod:4840
14573 #: ../src/guestfs-actions.pod:7256 ../src/guestfs-actions.pod:7280
14574 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14578 #: ../fish/guestfish-actions.pod:4832
14579 msgid "See also L</download>."
14583 #: ../fish/guestfish-actions.pod:4836
14584 msgid "upload-offset"
14588 #: ../fish/guestfish-actions.pod:4838
14591 " upload-offset (filename|-) remotefilename offset\n"
14596 #: ../fish/guestfish-actions.pod:4843 ../src/guestfs-actions.pod:7283
14598 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14599 "The intention is to overwrite parts of existing files or devices, although "
14600 "if a non-existant file is specified then it is created with a \"hole\" "
14601 "before C<offset>. The size of the data written is implicit in the size of "
14602 "the source C<filename>."
14606 #: ../fish/guestfish-actions.pod:4850
14608 "Note that there is no limit on the amount of data that can be uploaded with "
14609 "this call, unlike with L</pwrite>, and this call always writes the full "
14610 "amount unless an error occurs."
14614 #: ../fish/guestfish-actions.pod:4855
14615 msgid "See also L</upload>, L</pwrite>."
14619 #: ../fish/guestfish-actions.pod:4859
14624 #: ../fish/guestfish-actions.pod:4861
14627 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14632 #: ../fish/guestfish-actions.pod:4863 ../src/guestfs-actions.pod:7316
14633 msgid "This command sets the timestamps of a file with nanosecond precision."
14637 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7319
14639 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14644 #: ../fish/guestfish-actions.pod:4869 ../src/guestfs-actions.pod:7322
14646 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14647 "nanoseconds from the epoch."
14651 #: ../fish/guestfish-actions.pod:4872 ../src/guestfs-actions.pod:7325
14653 "If the C<*nsecs> field contains the special value C<-1> then the "
14654 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14655 "ignored in this case)."
14659 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7329
14661 "If the C<*nsecs> field contains the special value C<-2> then the "
14662 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14667 #: ../fish/guestfish-actions.pod:4880
14672 #: ../fish/guestfish-actions.pod:4882
14680 #: ../fish/guestfish-actions.pod:4884 ../src/guestfs-actions.pod:7342
14682 "Return the libguestfs version number that the program is linked against."
14686 #: ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:7345
14688 "Note that because of dynamic linking this is not necessarily the version of "
14689 "libguestfs that you compiled against. You can compile the program, and then "
14690 "at runtime dynamically link against a completely different C<libguestfs.so> "
14695 #: ../fish/guestfish-actions.pod:4892 ../src/guestfs-actions.pod:7350
14697 "This call was added in version C<1.0.58>. In previous versions of "
14698 "libguestfs there was no way to get the version number. From C code you can "
14699 "use dynamic linker functions to find out if this symbol exists (if it "
14700 "doesn't, then it's an earlier version)."
14704 #: ../fish/guestfish-actions.pod:4898 ../src/guestfs-actions.pod:7356
14706 "The call returns a structure with four elements. The first three (C<major>, "
14707 "C<minor> and C<release>) are numbers and correspond to the usual version "
14708 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14709 "but may be used for distro-specific information."
14713 #: ../fish/guestfish-actions.pod:4904 ../src/guestfs-actions.pod:7362
14715 "To construct the original version string: C<$major.$minor.$release$extra>"
14719 #: ../fish/guestfish-actions.pod:4907 ../src/guestfs-actions.pod:7365
14720 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14724 #: ../fish/guestfish-actions.pod:4909
14726 "I<Note:> Don't use this call to test for availability of features. In "
14727 "enterprise distributions we backport features from later versions into "
14728 "earlier versions, making this an unreliable way to test for features. Use "
14729 "L</available> instead."
14733 #: ../fish/guestfish-actions.pod:4915
14738 #: ../fish/guestfish-actions.pod:4917
14741 " vfs-label device\n"
14746 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7385
14747 msgid "This returns the filesystem label of the filesystem on C<device>."
14751 #: ../fish/guestfish-actions.pod:4922 ../src/guestfs-actions.pod:7388
14752 msgid "If the filesystem is unlabeled, this returns the empty string."
14756 #: ../fish/guestfish-actions.pod:4924
14757 msgid "To find a filesystem from the label, use L</findfs-label>."
14761 #: ../fish/guestfish-actions.pod:4926
14766 #: ../fish/guestfish-actions.pod:4928
14769 " vfs-type device\n"
14774 #: ../fish/guestfish-actions.pod:4930 ../src/guestfs-actions.pod:7403
14776 "This command gets the filesystem type corresponding to the filesystem on "
14781 #: ../fish/guestfish-actions.pod:4933 ../src/guestfs-actions.pod:7406
14783 "For most filesystems, the result is the name of the Linux VFS module which "
14784 "would be used to mount this filesystem if you mounted it without specifying "
14785 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14789 #: ../fish/guestfish-actions.pod:4938
14794 #: ../fish/guestfish-actions.pod:4940
14797 " vfs-uuid device\n"
14802 #: ../fish/guestfish-actions.pod:4942 ../src/guestfs-actions.pod:7422
14803 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14807 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7425
14808 msgid "If the filesystem does not have a UUID, this returns the empty string."
14812 #: ../fish/guestfish-actions.pod:4947
14813 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
14817 #: ../fish/guestfish-actions.pod:4949
14818 msgid "vg-activate"
14822 #: ../fish/guestfish-actions.pod:4951
14825 " vg-activate true|false 'volgroups ...'\n"
14830 #: ../fish/guestfish-actions.pod:4953 ../src/guestfs-actions.pod:7441
14832 "This command activates or (if C<activate> is false) deactivates all logical "
14833 "volumes in the listed volume groups C<volgroups>."
14837 #: ../fish/guestfish-actions.pod:4956 ../src/guestfs-actions.pod:7444
14838 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14842 #: ../fish/guestfish-actions.pod:4958 ../src/guestfs-actions.pod:7446
14844 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14845 "activated or deactivated."
14849 #: ../fish/guestfish-actions.pod:4961
14850 msgid "vg-activate-all"
14854 #: ../fish/guestfish-actions.pod:4963
14857 " vg-activate-all true|false\n"
14862 #: ../fish/guestfish-actions.pod:4965 ../src/guestfs-actions.pod:7459
14864 "This command activates or (if C<activate> is false) deactivates all logical "
14865 "volumes in all volume groups."
14869 #: ../fish/guestfish-actions.pod:4968 ../src/guestfs-actions.pod:7462
14870 msgid "This command is the same as running C<vgchange -a y|n>"
14874 #: ../fish/guestfish-actions.pod:4970
14879 #: ../fish/guestfish-actions.pod:4972
14882 " vgcreate volgroup 'physvols ...'\n"
14887 #: ../fish/guestfish-actions.pod:4974 ../src/guestfs-actions.pod:7475
14889 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14890 "of physical volumes C<physvols>."
14894 #: ../fish/guestfish-actions.pod:4977
14899 #: ../fish/guestfish-actions.pod:4979
14902 " vglvuuids vgname\n"
14907 #: ../fish/guestfish-actions.pod:4981 ../src/guestfs-actions.pod:7488
14909 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14910 "volumes created in this volume group."
14914 #: ../fish/guestfish-actions.pod:4984
14916 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
14917 "logical volumes and volume groups."
14921 #: ../fish/guestfish-actions.pod:4987
14922 msgid "See also L</vgpvuuids>."
14926 #: ../fish/guestfish-actions.pod:4989
14931 #: ../fish/guestfish-actions.pod:4991
14934 " vgpvuuids vgname\n"
14939 #: ../fish/guestfish-actions.pod:4993 ../src/guestfs-actions.pod:7508
14941 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14942 "volumes that this volume group resides on."
14946 #: ../fish/guestfish-actions.pod:4996
14948 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
14949 "physical volumes and volume groups."
14953 #: ../fish/guestfish-actions.pod:4999
14954 msgid "See also L</vglvuuids>."
14958 #: ../fish/guestfish-actions.pod:5001
14963 #: ../fish/guestfish-actions.pod:5003
14966 " vgremove vgname\n"
14971 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7528
14972 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14976 #: ../fish/guestfish-actions.pod:5007 ../src/guestfs-actions.pod:7530
14978 "This also forcibly removes all logical volumes in the volume group (if any)."
14982 #: ../fish/guestfish-actions.pod:5010
14987 #: ../fish/guestfish-actions.pod:5012
14990 " vgrename volgroup newvolgroup\n"
14995 #: ../fish/guestfish-actions.pod:5014 ../src/guestfs-actions.pod:7544
14996 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15000 #: ../fish/guestfish-actions.pod:5016
15005 #: ../fish/guestfish-actions.pod:5018
15013 #: ../fish/guestfish-actions.pod:5020 ../src/guestfs-actions.pod:7555
15015 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15020 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7558
15022 "This returns a list of just the volume group names that were detected (eg. "
15027 #: ../fish/guestfish-actions.pod:5026
15028 msgid "See also L</vgs-full>."
15032 #: ../fish/guestfish-actions.pod:5028
15037 #: ../fish/guestfish-actions.pod:5030
15045 #: ../fish/guestfish-actions.pod:5032 ../src/guestfs-actions.pod:7574
15047 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15048 "> command. The \"full\" version includes all fields."
15052 #: ../fish/guestfish-actions.pod:5035
15057 #: ../fish/guestfish-actions.pod:5037
15065 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7588
15067 "This rescans all block devices and rebuilds the list of LVM physical "
15068 "volumes, volume groups and logical volumes."
15072 #: ../fish/guestfish-actions.pod:5042
15077 #: ../fish/guestfish-actions.pod:5044
15085 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7601
15086 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15090 #: ../fish/guestfish-actions.pod:5048
15095 #: ../fish/guestfish-actions.pod:5050
15103 #: ../fish/guestfish-actions.pod:5052 ../src/guestfs-actions.pod:7641
15105 "This command counts the characters in a file, using the C<wc -c> external "
15110 #: ../fish/guestfish-actions.pod:5055
15115 #: ../fish/guestfish-actions.pod:5057
15123 #: ../fish/guestfish-actions.pod:5059 ../src/guestfs-actions.pod:7654
15125 "This command counts the lines in a file, using the C<wc -l> external command."
15129 #: ../fish/guestfish-actions.pod:5062
15134 #: ../fish/guestfish-actions.pod:5064
15142 #: ../fish/guestfish-actions.pod:5066 ../src/guestfs-actions.pod:7667
15144 "This command counts the words in a file, using the C<wc -w> external command."
15148 #: ../fish/guestfish-actions.pod:5069
15153 #: ../fish/guestfish-actions.pod:5071
15156 " write path content\n"
15161 #: ../fish/guestfish-actions.pod:5073 ../src/guestfs-actions.pod:7682
15163 "This call creates a file called C<path>. The content of the file is the "
15164 "string C<content> (which can contain any 8 bit data)."
15168 #: ../fish/guestfish-actions.pod:5076
15169 msgid "See also L</write-append>."
15173 #: ../fish/guestfish-actions.pod:5081
15174 msgid "write-append"
15178 #: ../fish/guestfish-actions.pod:5083
15181 " write-append path content\n"
15186 #: ../fish/guestfish-actions.pod:5085 ../src/guestfs-actions.pod:7702
15188 "This call appends C<content> to the end of file C<path>. If C<path> does "
15189 "not exist, then a new file is created."
15193 #: ../fish/guestfish-actions.pod:5088
15194 msgid "See also L</write>."
15198 #: ../fish/guestfish-actions.pod:5093
15203 #: ../fish/guestfish-actions.pod:5095
15206 " write-file path content size\n"
15211 #: ../fish/guestfish-actions.pod:5097 ../src/guestfs-actions.pod:7722
15213 "This call creates a file called C<path>. The contents of the file is the "
15214 "string C<content> (which can contain any 8 bit data), with length C<size>."
15218 #: ../fish/guestfish-actions.pod:5101 ../src/guestfs-actions.pod:7726
15220 "As a special case, if C<size> is C<0> then the length is calculated using "
15221 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15225 #: ../fish/guestfish-actions.pod:5105 ../src/guestfs-actions.pod:7730
15227 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15228 "I<not> work, even if the length is specified."
15232 #: ../fish/guestfish-actions.pod:5111
15234 "This function is deprecated. In new code, use the L</write> call instead."
15238 #: ../fish/guestfish-actions.pod:5118
15243 #: ../fish/guestfish-actions.pod:5120
15246 " zegrep regex path\n"
15251 #: ../fish/guestfish-actions.pod:5122 ../src/guestfs-actions.pod:7754
15253 "This calls the external C<zegrep> program and returns the matching lines."
15257 #: ../fish/guestfish-actions.pod:5128
15262 #: ../fish/guestfish-actions.pod:5130
15265 " zegrepi regex path\n"
15270 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7773
15272 "This calls the external C<zegrep -i> program and returns the matching lines."
15276 #: ../fish/guestfish-actions.pod:5138
15281 #: ../fish/guestfish-actions.pod:5140
15289 #: ../fish/guestfish-actions.pod:5142 ../src/guestfs-actions.pod:7791
15290 msgid "This command writes zeroes over the first few blocks of C<device>."
15294 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7793
15296 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15297 "securely wipe the device). It should be sufficient to remove any partition "
15298 "tables, filesystem superblocks and so on."
15302 #: ../fish/guestfish-actions.pod:5148 ../fish/guestfish-actions.pod:5163
15303 #: ../src/guestfs-actions.pod:7797 ../src/guestfs-actions.pod:7823
15305 "If blocks are already zero, then this command avoids writing zeroes. This "
15306 "prevents the underlying device from becoming non-sparse or growing "
15311 #: ../fish/guestfish-actions.pod:5152
15312 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
15316 #: ../fish/guestfish-actions.pod:5155
15317 msgid "zero-device"
15321 #: ../fish/guestfish-actions.pod:5157
15324 " zero-device device\n"
15329 #: ../fish/guestfish-actions.pod:5159
15331 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
15332 "which just zeroes the first few blocks of a device."
15336 #: ../fish/guestfish-actions.pod:5170
15341 #: ../fish/guestfish-actions.pod:5172
15344 " zerofree device\n"
15349 #: ../fish/guestfish-actions.pod:5174 ../src/guestfs-actions.pod:7845
15351 "This runs the I<zerofree> program on C<device>. This program claims to zero "
15352 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
15353 "possible to compress the filesystem more effectively."
15357 #: ../fish/guestfish-actions.pod:5179 ../src/guestfs-actions.pod:7850
15358 msgid "You should B<not> run this program if the filesystem is mounted."
15362 #: ../fish/guestfish-actions.pod:5182 ../src/guestfs-actions.pod:7853
15364 "It is possible that using this program can damage the filesystem or data on "
15369 #: ../fish/guestfish-actions.pod:5185
15374 #: ../fish/guestfish-actions.pod:5187
15377 " zfgrep pattern path\n"
15382 #: ../fish/guestfish-actions.pod:5189 ../src/guestfs-actions.pod:7867
15384 "This calls the external C<zfgrep> program and returns the matching lines."
15388 #: ../fish/guestfish-actions.pod:5195
15393 #: ../fish/guestfish-actions.pod:5197
15396 " zfgrepi pattern path\n"
15401 #: ../fish/guestfish-actions.pod:5199 ../src/guestfs-actions.pod:7886
15403 "This calls the external C<zfgrep -i> program and returns the matching lines."
15407 #: ../fish/guestfish-actions.pod:5205
15412 #: ../fish/guestfish-actions.pod:5207
15415 " zfile meth path\n"
15420 #: ../fish/guestfish-actions.pod:5209 ../src/guestfs-actions.pod:7905
15422 "This command runs C<file> after first decompressing C<path> using C<method>."
15426 #: ../fish/guestfish-actions.pod:5212 ../src/guestfs-actions.pod:7908
15427 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15431 #: ../fish/guestfish-actions.pod:5214
15433 "Since 1.0.63, use L</file> instead which can now process compressed files."
15437 #: ../fish/guestfish-actions.pod:5217
15439 "This function is deprecated. In new code, use the L</file> call instead."
15443 #: ../fish/guestfish-actions.pod:5224
15448 #: ../fish/guestfish-actions.pod:5226
15451 " zgrep regex path\n"
15456 #: ../fish/guestfish-actions.pod:5228 ../src/guestfs-actions.pod:7932
15458 "This calls the external C<zgrep> program and returns the matching lines."
15462 #: ../fish/guestfish-actions.pod:5234
15467 #: ../fish/guestfish-actions.pod:5236
15470 " zgrepi regex path\n"
15475 #: ../fish/guestfish-actions.pod:5238 ../src/guestfs-actions.pod:7951
15477 "This calls the external C<zgrep -i> program and returns the matching lines."
15481 #: ../fish/guestfish-commands.pod:1
15486 #: ../fish/guestfish-commands.pod:3
15491 #: ../fish/guestfish-commands.pod:5
15494 " alloc filename size\n"
15499 #: ../fish/guestfish-commands.pod:7
15501 "This creates an empty (zeroed) file of the given size, and then adds so it "
15502 "can be further examined."
15506 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:182
15507 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
15511 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:184
15512 msgid "Size can be specified using standard suffixes, eg. C<1M>."
15516 #: ../fish/guestfish-commands.pod:14
15518 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
15519 "image, see L</PREPARED DISK IMAGES>."
15523 #: ../fish/guestfish-commands.pod:17
15528 #: ../fish/guestfish-commands.pod:19
15531 " copy-in local [local ...] /remotedir\n"
15536 #: ../fish/guestfish-commands.pod:21
15538 "C<copy-in> copies local files or directories recursively into the disk "
15539 "image, placing them in the directory called C</remotedir> (which must "
15540 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
15541 "other commands as necessary."
15545 #: ../fish/guestfish-commands.pod:26
15547 "Multiple local files and directories can be specified, but the last "
15548 "parameter must always be a remote directory. Wildcards cannot be used."
15552 #: ../fish/guestfish-commands.pod:30
15557 #: ../fish/guestfish-commands.pod:32
15560 " copy-out remote [remote ...] localdir\n"
15565 #: ../fish/guestfish-commands.pod:34
15567 "C<copy-out> copies remote files or directories recursively out of the disk "
15568 "image, placing them on the host disk in a local directory called C<localdir> "
15569 "(which must exist). This guestfish meta-command turns into a sequence of L</"
15570 "download>, L</tar-out> and other commands as necessary."
15574 #: ../fish/guestfish-commands.pod:40
15576 "Multiple remote files and directories can be specified, but the last "
15577 "parameter must always be a local directory. To download to the current "
15578 "directory, use C<.> as in:"
15582 #: ../fish/guestfish-commands.pod:44
15585 " copy-out /home .\n"
15590 #: ../fish/guestfish-commands.pod:46
15592 "Wildcards cannot be used in the ordinary command, but you can use them with "
15593 "the help of L</glob> like this:"
15597 #: ../fish/guestfish-commands.pod:49
15600 " glob copy-out /home/* .\n"
15605 #: ../fish/guestfish-commands.pod:51
15610 #: ../fish/guestfish-commands.pod:53
15613 " display filename\n"
15618 #: ../fish/guestfish-commands.pod:55
15620 "Use C<display> (a graphical display program) to display an image file. It "
15621 "downloads the file, and runs C<display> on it."
15625 #: ../fish/guestfish-commands.pod:58
15627 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15628 "environment variable. For example to use the GNOME display program:"
15632 #: ../fish/guestfish-commands.pod:61
15635 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15640 #: ../fish/guestfish-commands.pod:63
15641 msgid "See also L<display(1)>."
15645 #: ../fish/guestfish-commands.pod:65
15650 #: ../fish/guestfish-commands.pod:67
15653 " echo [params ...]\n"
15658 #: ../fish/guestfish-commands.pod:69
15659 msgid "This echos the parameters to the terminal."
15663 #: ../fish/guestfish-commands.pod:71
15668 #: ../fish/guestfish-commands.pod:73
15673 #: ../fish/guestfish-commands.pod:75
15678 #: ../fish/guestfish-commands.pod:77
15686 #: ../fish/guestfish-commands.pod:79
15688 "This is used to edit a file. It downloads the file, edits it locally using "
15689 "your editor, then uploads the result."
15693 #: ../fish/guestfish-commands.pod:82
15695 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
15696 "or C<emacs> you will get those corresponding editors."
15700 #: ../fish/guestfish-commands.pod:86
15705 #: ../fish/guestfish-commands.pod:88
15708 " glob command args...\n"
15713 #: ../fish/guestfish-commands.pod:90
15715 "Expand wildcards in any paths in the args list, and run C<command> "
15716 "repeatedly on each matching path."
15720 #: ../fish/guestfish-commands.pod:93
15721 msgid "See L</WILDCARDS AND GLOBBING>."
15725 #: ../fish/guestfish-commands.pod:95
15730 #: ../fish/guestfish-commands.pod:97
15733 " hexedit <filename|device>\n"
15734 " hexedit <filename|device> <max>\n"
15735 " hexedit <filename|device> <start> <max>\n"
15740 #: ../fish/guestfish-commands.pod:101
15742 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
15747 #: ../fish/guestfish-commands.pod:104
15749 "This command works by downloading potentially the whole file or device, "
15750 "editing it locally, then uploading it. If the file or device is large, you "
15751 "have to specify which part you wish to edit by using C<max> and/or C<start> "
15752 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
15753 "usual modifiers allowed such as C<1M> (1 megabyte)."
15757 #: ../fish/guestfish-commands.pod:111
15758 msgid "For example to edit the first few sectors of a disk you might do:"
15762 #: ../fish/guestfish-commands.pod:114
15765 " hexedit /dev/sda 1M\n"
15770 #: ../fish/guestfish-commands.pod:116
15772 "which would allow you to edit anywhere within the first megabyte of the disk."
15776 #: ../fish/guestfish-commands.pod:119
15777 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
15781 #: ../fish/guestfish-commands.pod:121
15784 " hexedit /dev/sda1 0x400 0x400\n"
15789 #: ../fish/guestfish-commands.pod:123
15790 msgid "(assuming the superblock is in the standard location)."
15794 #: ../fish/guestfish-commands.pod:125
15796 "This command requires the external L<hexedit(1)> program. You can specify "
15797 "another program to use by setting the C<HEXEDITOR> environment variable."
15801 #: ../fish/guestfish-commands.pod:129
15802 msgid "See also L</hexdump>."
15806 #: ../fish/guestfish-commands.pod:131
15811 #: ../fish/guestfish-commands.pod:133
15819 #: ../fish/guestfish-commands.pod:135
15821 "Change the local directory, ie. the current directory of guestfish itself."
15825 #: ../fish/guestfish-commands.pod:138
15826 msgid "Note that C<!cd> won't do what you might expect."
15830 #: ../fish/guestfish-commands.pod:140
15835 #: ../fish/guestfish-commands.pod:142
15840 #: ../fish/guestfish-commands.pod:144
15848 #: ../fish/guestfish-commands.pod:146
15849 msgid "Opens the manual page for guestfish."
15853 #: ../fish/guestfish-commands.pod:148
15858 #: ../fish/guestfish-commands.pod:150
15863 #: ../fish/guestfish-commands.pod:152
15871 #: ../fish/guestfish-commands.pod:154
15879 #: ../fish/guestfish-commands.pod:156
15880 msgid "This is used to view a file."
15884 #: ../fish/guestfish-commands.pod:158
15886 "The default viewer is C<$PAGER>. However if you use the alternate command "
15887 "C<less> you will get the C<less> command specifically."
15891 #: ../fish/guestfish-commands.pod:161
15896 #: ../fish/guestfish-commands.pod:163
15904 #: ../fish/guestfish-commands.pod:165
15906 "Close and reopen the libguestfs handle. It is not necessary to use this "
15907 "normally, because the handle is closed properly when guestfish exits. "
15908 "However this is occasionally useful for testing."
15912 #: ../fish/guestfish-commands.pod:169
15917 #: ../fish/guestfish-commands.pod:171
15920 " sparse filename size\n"
15925 #: ../fish/guestfish-commands.pod:173
15927 "This creates an empty sparse file of the given size, and then adds so it can "
15928 "be further examined."
15932 #: ../fish/guestfish-commands.pod:176
15934 "In all respects it works the same as the L</alloc> command, except that the "
15935 "image file is allocated sparsely, which means that disk blocks are not "
15936 "assigned to the file until they are needed. Sparse disk files only use "
15937 "space when written to, but they are slower and there is a danger you could "
15938 "run out of real disk space during a write operation."
15942 #: ../fish/guestfish-commands.pod:186
15947 #: ../fish/guestfish-commands.pod:188
15955 #: ../fish/guestfish-commands.pod:190
15957 "This command returns a list of the optional groups known to the daemon, and "
15958 "indicates which ones are supported by this build of the libguestfs appliance."
15962 #: ../fish/guestfish-commands.pod:194
15963 msgid "See also L<guestfs(3)/AVAILABILITY>."
15967 #: ../fish/guestfish-commands.pod:196
15972 #: ../fish/guestfish-commands.pod:198
15975 " time command args...\n"
15980 #: ../fish/guestfish-commands.pod:200
15982 "Run the command as usual, but print the elapsed time afterwards. This can "
15983 "be useful for benchmarking operations."
15987 #: ../fish/guestfish.pod:5
15988 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15992 #: ../fish/guestfish.pod:9
15995 " guestfish [--options] [commands]\n"
16000 #: ../fish/guestfish.pod:11
16008 #: ../fish/guestfish.pod:13
16011 " guestfish [--ro|--rw] -a disk.img\n"
16016 #: ../fish/guestfish.pod:15
16019 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16024 #: ../fish/guestfish.pod:17
16027 " guestfish -d libvirt-domain\n"
16032 #: ../fish/guestfish.pod:19
16035 " guestfish [--ro|--rw] -a disk.img -i\n"
16040 #: ../fish/guestfish.pod:21
16043 " guestfish -d libvirt-domain -i\n"
16048 #: ../fish/guestfish.pod:25
16050 "Using guestfish in read/write mode on live virtual machines can be "
16051 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16052 "option to use guestfish safely if the disk image or virtual machine might be "
16057 #: ../fish/guestfish.pod:32
16059 "Guestfish is a shell and command-line tool for examining and modifying "
16060 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16061 "functionality of the guestfs API, see L<guestfs(3)>."
16065 #: ../fish/guestfish.pod:36
16067 "Guestfish gives you structured access to the libguestfs API, from shell "
16068 "scripts or the command line or interactively. If you want to rescue a "
16069 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16074 #: ../fish/guestfish.pod:43
16075 msgid "As an interactive shell"
16079 #: ../fish/guestfish.pod:45
16087 #: ../fish/guestfish.pod:47
16090 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16091 " editing virtual machine filesystems.\n"
16096 #: ../fish/guestfish.pod:50
16099 " Type: 'help' for a list of commands\n"
16100 " 'man' to read the manual\n"
16101 " 'quit' to quit the shell\n"
16106 #: ../fish/guestfish.pod:54
16109 " ><fs> add-ro disk.img\n"
16111 " ><fs> list-filesystems\n"
16112 " /dev/sda1: ext4\n"
16113 " /dev/vg_guest/lv_root: ext4\n"
16114 " /dev/vg_guest/lv_swap: swap\n"
16115 " ><fs> mount /dev/vg_guest/lv_root /\n"
16116 " ><fs> cat /etc/fstab\n"
16118 " # Created by anaconda\n"
16125 #: ../fish/guestfish.pod:67
16126 msgid "From shell scripts"
16130 #: ../fish/guestfish.pod:69
16131 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16135 #: ../fish/guestfish.pod:71
16138 " guestfish <<_EOF_\n"
16141 " mount /dev/vg_guest/lv_root /\n"
16142 " write /etc/motd \"Welcome, new users\"\n"
16148 #: ../fish/guestfish.pod:78
16149 msgid "List the LVM logical volumes in a disk image:"
16153 #: ../fish/guestfish.pod:80
16156 " guestfish -a disk.img --ro <<_EOF_\n"
16164 #: ../fish/guestfish.pod:85
16165 msgid "List all the filesystems in a disk image:"
16169 #: ../fish/guestfish.pod:87
16172 " guestfish -a disk.img --ro <<_EOF_\n"
16174 " list-filesystems\n"
16180 #: ../fish/guestfish.pod:92
16181 msgid "On one command line"
16185 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
16186 msgid "Update C</etc/resolv.conf> in a guest:"
16190 #: ../fish/guestfish.pod:96
16194 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
16195 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16200 #: ../fish/guestfish.pod:100
16201 msgid "Edit C</boot/grub/grub.conf> interactively:"
16205 #: ../fish/guestfish.pod:102
16208 " guestfish --rw --add disk.img \\\n"
16209 " --mount /dev/vg_guest/lv_root \\\n"
16210 " --mount /dev/sda1:/boot \\\n"
16211 " edit /boot/grub/grub.conf\n"
16216 #: ../fish/guestfish.pod:107
16217 msgid "Mount disks automatically"
16221 #: ../fish/guestfish.pod:109
16223 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
16227 #: ../fish/guestfish.pod:112
16230 " guestfish --ro -a disk.img -i cat /etc/group\n"
16235 #: ../fish/guestfish.pod:114
16238 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16243 #: ../fish/guestfish.pod:116
16244 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16248 #: ../fish/guestfish.pod:118
16251 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16256 #: ../fish/guestfish.pod:120
16257 msgid "As a script interpreter"
16261 #: ../fish/guestfish.pod:122
16262 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16266 #: ../fish/guestfish.pod:124
16269 " #!/usr/bin/guestfish -f\n"
16270 " sparse test1.img 100M\n"
16272 " part-disk /dev/sda mbr\n"
16273 " mkfs ext2 /dev/sda1\n"
16278 #: ../fish/guestfish.pod:130
16279 msgid "Start with a prepared disk"
16283 #: ../fish/guestfish.pod:132
16285 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16286 "single ext2-formatted partition:"
16290 #: ../fish/guestfish.pod:135
16293 " guestfish -N fs\n"
16298 #: ../fish/guestfish.pod:137
16299 msgid "To list what is available do:"
16303 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
16306 " guestfish -N help | less\n"
16311 #: ../fish/guestfish.pod:141
16312 msgid "Remote control"
16316 #: ../fish/guestfish.pod:143
16319 " eval \"`guestfish --listen`\"\n"
16320 " guestfish --remote add-ro disk.img\n"
16321 " guestfish --remote run\n"
16322 " guestfish --remote lvs\n"
16327 #: ../fish/guestfish.pod:154
16328 msgid "Displays general help on options."
16332 #: ../fish/guestfish.pod:158
16333 msgid "B<--cmd-help>"
16337 #: ../fish/guestfish.pod:160
16338 msgid "Lists all available guestfish commands."
16342 #: ../fish/guestfish.pod:162
16347 #: ../fish/guestfish.pod:164
16348 msgid "B<--cmd-help cmd>"
16352 #: ../fish/guestfish.pod:166
16353 msgid "Displays detailed help on a single command C<cmd>."
16357 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
16358 msgid "B<-a image>"
16362 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
16363 msgid "B<--add image>"
16367 #: ../fish/guestfish.pod:172
16368 msgid "Add a block device or virtual machine image to the shell."
16372 #: ../fish/guestfish.pod:177
16374 "Using this flag is mostly equivalent to using the C<add> command, with "
16375 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
16376 "the I<--format=...> flag was given."
16380 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
16382 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16383 "URI to use. The default is to use the default libvirt connection."
16387 #: ../fish/guestfish.pod:189
16392 #: ../fish/guestfish.pod:191
16394 "If using the I<--listen> option and a csh-like shell, use this option. See "
16395 "section L</REMOTE CONTROL AND CSH> below."
16399 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
16400 msgid "B<-d libvirt-domain>"
16404 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
16405 msgid "B<--domain libvirt-domain>"
16409 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
16411 "Add disks from the named libvirt domain. If the I<--ro> option is also "
16412 "used, then any libvirt domain can be used. However in write mode, only "
16413 "libvirt domains which are shut down can be named here."
16417 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
16418 msgid "Domain UUIDs can be used instead of names."
16422 #: ../fish/guestfish.pod:204
16424 "Using this flag is mostly equivalent to using the C<add-domain> command, "
16425 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
16426 "if the I<--format:...> flag was given."
16430 #: ../fish/guestfish.pod:208
16435 #: ../fish/guestfish.pod:210
16436 msgid "B<--no-dest-paths>"
16440 #: ../fish/guestfish.pod:212
16442 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
16443 "to hit the tab key to complete paths on the guest filesystem, but this "
16444 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
16445 "allow this feature to be disabled."
16449 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
16451 "When prompting for keys and passphrases, guestfish normally turns echoing "
16452 "off so you cannot see what you are typing. If you are not worried about "
16453 "Tempest attacks and there is no one else in the room you can specify this "
16454 "flag to see what you are typing."
16458 #: ../fish/guestfish.pod:224
16463 #: ../fish/guestfish.pod:226
16464 msgid "B<--file file>"
16468 #: ../fish/guestfish.pod:228
16469 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
16473 #: ../fish/guestfish.pod:231
16476 " #!/usr/bin/guestfish -f\n"
16481 #: ../fish/guestfish.pod:244
16484 " guestfish --format=raw -a disk.img\n"
16489 #: ../fish/guestfish.pod:248
16492 " guestfish --format=raw -a disk.img --format -a another.img\n"
16497 #: ../fish/guestfish.pod:253
16499 "If you have untrusted raw-format guest disk images, you should use this "
16500 "option to specify the disk format. This avoids a possible security problem "
16501 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
16505 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
16506 msgid "B<--inspector>"
16510 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
16512 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
16513 "system and mount filesystems as they would be mounted on the real virtual "
16518 #: ../fish/guestfish.pod:266
16519 msgid "Typical usage is either:"
16523 #: ../fish/guestfish.pod:268
16526 " guestfish -d myguest -i\n"
16531 #: ../fish/guestfish.pod:270
16532 msgid "(for an inactive libvirt domain called I<myguest>), or:"
16536 #: ../fish/guestfish.pod:272
16539 " guestfish --ro -d myguest -i\n"
16544 #: ../fish/guestfish.pod:274
16545 msgid "(for active domains, readonly), or specify the block device directly:"
16549 #: ../fish/guestfish.pod:276
16552 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
16557 #: ../fish/guestfish.pod:278
16559 "Note that the command line syntax changed slightly over older versions of "
16560 "guestfish. You can still use the old syntax:"
16564 #: ../fish/guestfish.pod:281
16567 " guestfish [--ro] -i disk.img\n"
16572 #: ../fish/guestfish.pod:283
16575 " guestfish [--ro] -i libvirt-domain\n"
16580 #: ../fish/guestfish.pod:285
16582 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
16583 "then using other commands to mount the filesystems that were found."
16587 #: ../fish/guestfish.pod:294
16588 msgid "B<--listen>"
16592 #: ../fish/guestfish.pod:296
16594 "Fork into the background and listen for remote commands. See section L</"
16595 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16599 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
16604 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
16606 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
16607 "ATTACHING TO RUNNING DAEMONS>)."
16611 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
16612 msgid "B<-m dev[:mountpoint[:options]]>"
16616 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
16617 msgid "B<--mount dev[:mountpoint[:options]]>"
16621 #: ../fish/guestfish.pod:308
16622 msgid "Mount the named partition or logical volume on the given mountpoint."
16626 #: ../fish/guestfish.pod:310
16627 msgid "If the mountpoint is omitted, it defaults to C</>."
16631 #: ../fish/guestfish.pod:312
16632 msgid "You have to mount something on C</> before most commands will work."
16636 #: ../fish/guestfish.pod:314
16638 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16643 #: ../fish/guestfish.pod:317
16645 "If you don't know what filesystems a disk image contains, you can either run "
16646 "guestfish without this option, then list the partitions, filesystems and LVs "
16647 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
16648 "commands), or you can use the L<virt-filesystems(1)> program."
16652 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
16654 "The third (and rarely used) part of the mount parameter is the list of mount "
16655 "options used to mount the underlying filesystem. If this is not given, then "
16656 "the mount options are either the empty string or C<ro> (the latter if the "
16657 "I<--ro> flag is used). By specifying the mount options, you override this "
16658 "default choice. Probably the only time you would use this is to enable ACLs "
16659 "and/or extended attributes if the filesystem can support them:"
16663 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
16666 " -m /dev/sda1:/:acl,user_xattr\n"
16671 #: ../fish/guestfish.pod:333
16672 msgid "Using this flag is equivalent to using the C<mount-options> command."
16676 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202
16677 #: ../resize/virt-resize.pod:358
16682 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
16683 msgid "B<--no-sync>"
16687 #: ../fish/guestfish.pod:339
16689 "Disable autosync. This is enabled by default. See the discussion of "
16690 "autosync in the L<guestfs(3)> manpage."
16694 #: ../fish/guestfish.pod:342
16699 #: ../fish/guestfish.pod:344
16700 msgid "B<--new type>"
16704 #: ../fish/guestfish.pod:346
16709 #: ../fish/guestfish.pod:348
16711 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16712 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16713 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16718 #: ../fish/guestfish.pod:353
16719 msgid "B<--progress-bars>"
16723 #: ../fish/guestfish.pod:355
16724 msgid "Enable progress bars, even when guestfish is used non-interactively."
16728 #: ../fish/guestfish.pod:357
16730 "Progress bars are enabled by default when guestfish is used as an "
16731 "interactive shell."
16735 #: ../fish/guestfish.pod:360
16736 msgid "B<--no-progress-bars>"
16740 #: ../fish/guestfish.pod:362
16741 msgid "Disable progress bars."
16745 #: ../fish/guestfish.pod:364
16746 msgid "B<--remote[=pid]>"
16750 #: ../fish/guestfish.pod:366
16752 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16753 "CONTROL GUESTFISH OVER A SOCKET> below."
16757 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248
16758 #: ../rescue/virt-rescue.pod:161
16763 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250
16764 #: ../rescue/virt-rescue.pod:163
16769 #: ../fish/guestfish.pod:373
16771 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16772 "mounts are done read-only."
16776 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
16778 "The option must always be used if the disk image or virtual machine might be "
16779 "running, and is generally recommended in cases where you don't need write "
16780 "access to the disk."
16784 #: ../fish/guestfish.pod:380
16786 "Note that prepared disk images created with I<-N> are not affected by this "
16787 "option. Also commands like C<add> are not affected - you have to specify "
16788 "the C<readonly:true> option explicitly if you need it."
16792 #: ../fish/guestfish.pod:384
16793 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16797 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262
16798 #: ../rescue/virt-rescue.pod:173
16799 msgid "B<--selinux>"
16803 #: ../fish/guestfish.pod:388
16804 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16808 #: ../fish/guestfish.pod:394
16810 "Enable very verbose messages. This is particularly useful if you find a bug."
16814 #: ../fish/guestfish.pod:401
16815 msgid "Display the guestfish / libguestfs version number and exit."
16819 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278
16820 #: ../rescue/virt-rescue.pod:190
16825 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280
16826 #: ../rescue/virt-rescue.pod:192
16831 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
16833 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16834 "mounts are done read-write."
16838 #: ../fish/guestfish.pod:410
16839 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
16843 #: ../fish/guestfish.pod:414
16844 msgid "Echo each command before executing it."
16848 #: ../fish/guestfish.pod:418
16849 msgid "COMMANDS ON COMMAND LINE"
16853 #: ../fish/guestfish.pod:420
16855 "Any additional (non-option) arguments are treated as commands to execute."
16859 #: ../fish/guestfish.pod:423
16861 "Commands to execute should be separated by a colon (C<:>), where the colon "
16862 "is a separate parameter. Thus:"
16866 #: ../fish/guestfish.pod:426
16869 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16874 #: ../fish/guestfish.pod:428
16876 "If there are no additional arguments, then we enter a shell, either an "
16877 "interactive shell with a prompt (if the input is a terminal) or a non-"
16878 "interactive shell."
16882 #: ../fish/guestfish.pod:432
16884 "In either command line mode or non-interactive shell, the first command that "
16885 "gives an error causes the whole shell to exit. In interactive mode (with a "
16886 "prompt) if a command fails, you can continue to enter commands."
16890 #: ../fish/guestfish.pod:437
16891 msgid "USING launch (OR run)"
16895 #: ../fish/guestfish.pod:439
16897 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16898 "then launch it, then mount any disks you need, and finally issue actions/"
16899 "commands. So the general order of the day is:"
16903 #: ../fish/guestfish.pod:447
16904 msgid "add or -a/--add"
16908 #: ../fish/guestfish.pod:451
16909 msgid "launch (aka run)"
16913 #: ../fish/guestfish.pod:455
16914 msgid "mount or -m/--mount"
16918 #: ../fish/guestfish.pod:459
16919 msgid "any other commands"
16923 #: ../fish/guestfish.pod:463
16925 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16926 "guest before mounting or performing any other commands."
16930 #: ../fish/guestfish.pod:466
16932 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16933 "I<--new> options were given then C<run> is done automatically, simply "
16934 "because guestfish can't perform the action you asked for without doing this."
16938 #: ../fish/guestfish.pod:471
16939 msgid "OPENING DISKS FOR READ AND WRITE"
16943 #: ../fish/guestfish.pod:473
16945 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
16946 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
16947 "I<-i> and I<-m> open disk images read-only or for writing."
16951 #: ../fish/guestfish.pod:478
16953 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
16954 "opening disk images supplied on the command line for write. To open a disk "
16955 "image read-only you have to do I<-a image --ro>."
16959 #: ../fish/guestfish.pod:482
16961 "This matters: If you accidentally open a live VM disk image writable then "
16962 "you will cause irreversible disk corruption."
16966 #: ../fish/guestfish.pod:485
16968 "In a future libguestfs we intend to change the default the other way. Disk "
16969 "images will be opened read-only. You will have to either specify "
16970 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
16971 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
16972 "access for disk images specified by those other command line options."
16976 #: ../fish/guestfish.pod:492
16978 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
16979 "which does nothing (it is already the default). However it is highly "
16980 "recommended that you use this option to indicate that you need write access, "
16981 "and prepare your scripts for the day when this option will be required for "
16986 #: ../fish/guestfish.pod:498
16988 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
16989 "other libguestfs program apart from guestfish and guestmount."
16993 #: ../fish/guestfish.pod:501
16998 #: ../fish/guestfish.pod:503
17000 "You can quote ordinary parameters using either single or double quotes. For "
17005 #: ../fish/guestfish.pod:506
17008 " add \"file with a space.img\"\n"
17013 #: ../fish/guestfish.pod:508
17016 " rm '/file name'\n"
17021 #: ../fish/guestfish.pod:510
17029 #: ../fish/guestfish.pod:512
17031 "A few commands require a list of strings to be passed. For these, use a "
17032 "whitespace-separated list, enclosed in quotes. Strings containing "
17033 "whitespace to be passed through must be enclosed in single quotes. A "
17034 "literal single quote must be escaped with a backslash."
17038 #: ../fish/guestfish.pod:517
17041 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17042 " command \"/bin/echo 'foo bar'\"\n"
17043 " command \"/bin/echo \\'foo\\'\"\n"
17048 #: ../fish/guestfish.pod:521
17049 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
17053 #: ../fish/guestfish.pod:523
17055 "In double-quoted arguments (only) use backslash to insert special characters:"
17059 #: ../fish/guestfish.pod:528
17064 #: ../fish/guestfish.pod:530
17065 msgid "Alert (bell) character."
17069 #: ../fish/guestfish.pod:532
17074 #: ../fish/guestfish.pod:534
17075 msgid "Backspace character."
17079 #: ../fish/guestfish.pod:536
17084 #: ../fish/guestfish.pod:538
17085 msgid "Form feed character."
17089 #: ../fish/guestfish.pod:540
17094 #: ../fish/guestfish.pod:542
17095 msgid "Newline character."
17099 #: ../fish/guestfish.pod:544
17104 #: ../fish/guestfish.pod:546
17105 msgid "Carriage return character."
17109 #: ../fish/guestfish.pod:548
17114 #: ../fish/guestfish.pod:550
17115 msgid "Horizontal tab character."
17119 #: ../fish/guestfish.pod:552
17124 #: ../fish/guestfish.pod:554
17125 msgid "Vertical tab character."
17129 #: ../fish/guestfish.pod:556
17134 #: ../fish/guestfish.pod:558
17135 msgid "A literal double quote character."
17139 #: ../fish/guestfish.pod:560
17144 #: ../fish/guestfish.pod:562
17146 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
17151 #: ../fish/guestfish.pod:565
17156 #: ../fish/guestfish.pod:567
17158 "A character with hex value I<hh>. There must be precisely 2 hex digits."
17162 #: ../fish/guestfish.pod:570
17164 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
17169 #: ../fish/guestfish.pod:573
17174 #: ../fish/guestfish.pod:575
17175 msgid "A literal backslash character."
17179 #: ../fish/guestfish.pod:579
17180 msgid "OPTIONAL ARGUMENTS"
17184 #: ../fish/guestfish.pod:581
17186 "Some commands take optional arguments. These arguments appear in this "
17187 "documentation as C<[argname:..]>. You can use them as in these examples:"
17191 #: ../fish/guestfish.pod:585
17194 " add-drive-opts filename\n"
17199 #: ../fish/guestfish.pod:587
17202 " add-drive-opts filename readonly:true\n"
17207 #: ../fish/guestfish.pod:589
17210 " add-drive-opts filename format:qcow2 readonly:false\n"
17215 #: ../fish/guestfish.pod:591
17217 "Each optional argument can appear at most once. All optional arguments must "
17218 "appear after the required ones."
17222 #: ../fish/guestfish.pod:594
17227 #: ../fish/guestfish.pod:596
17229 "This section applies to all commands which can take integers as parameters."
17233 #: ../fish/guestfish.pod:599
17234 msgid "SIZE SUFFIX"
17238 #: ../fish/guestfish.pod:601
17240 "When the command takes a parameter measured in bytes, you can use one of the "
17241 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17245 #: ../fish/guestfish.pod:607
17246 msgid "B<k> or B<K> or B<KiB>"
17250 #: ../fish/guestfish.pod:609
17251 msgid "The size in kilobytes (multiplied by 1024)."
17255 #: ../fish/guestfish.pod:611
17260 #: ../fish/guestfish.pod:613
17261 msgid "The size in SI 1000 byte units."
17265 #: ../fish/guestfish.pod:615
17266 msgid "B<M> or B<MiB>"
17270 #: ../fish/guestfish.pod:617
17271 msgid "The size in megabytes (multiplied by 1048576)."
17275 #: ../fish/guestfish.pod:619
17280 #: ../fish/guestfish.pod:621
17281 msgid "The size in SI 1000000 byte units."
17285 #: ../fish/guestfish.pod:623
17286 msgid "B<G> or B<GiB>"
17290 #: ../fish/guestfish.pod:625
17291 msgid "The size in gigabytes (multiplied by 2**30)."
17295 #: ../fish/guestfish.pod:627
17300 #: ../fish/guestfish.pod:629
17301 msgid "The size in SI 10**9 byte units."
17305 #: ../fish/guestfish.pod:631
17306 msgid "B<T> or B<TiB>"
17310 #: ../fish/guestfish.pod:633
17311 msgid "The size in terabytes (multiplied by 2**40)."
17315 #: ../fish/guestfish.pod:635
17320 #: ../fish/guestfish.pod:637
17321 msgid "The size in SI 10**12 byte units."
17325 #: ../fish/guestfish.pod:639
17326 msgid "B<P> or B<PiB>"
17330 #: ../fish/guestfish.pod:641
17331 msgid "The size in petabytes (multiplied by 2**50)."
17335 #: ../fish/guestfish.pod:643
17340 #: ../fish/guestfish.pod:645
17341 msgid "The size in SI 10**15 byte units."
17345 #: ../fish/guestfish.pod:647
17346 msgid "B<E> or B<EiB>"
17350 #: ../fish/guestfish.pod:649
17351 msgid "The size in exabytes (multiplied by 2**60)."
17355 #: ../fish/guestfish.pod:651
17360 #: ../fish/guestfish.pod:653
17361 msgid "The size in SI 10**18 byte units."
17365 #: ../fish/guestfish.pod:655
17366 msgid "B<Z> or B<ZiB>"
17370 #: ../fish/guestfish.pod:657
17371 msgid "The size in zettabytes (multiplied by 2**70)."
17375 #: ../fish/guestfish.pod:659
17380 #: ../fish/guestfish.pod:661
17381 msgid "The size in SI 10**21 byte units."
17385 #: ../fish/guestfish.pod:663
17386 msgid "B<Y> or B<YiB>"
17390 #: ../fish/guestfish.pod:665
17391 msgid "The size in yottabytes (multiplied by 2**80)."
17395 #: ../fish/guestfish.pod:667
17400 #: ../fish/guestfish.pod:669
17401 msgid "The size in SI 10**24 byte units."
17405 #: ../fish/guestfish.pod:675
17408 " truncate-size /file 1G\n"
17413 #: ../fish/guestfish.pod:677
17414 msgid "would truncate the file to 1 gigabyte."
17418 #: ../fish/guestfish.pod:679
17420 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
17421 "the parameter to L</memsize> is specified in megabytes already). Adding a "
17422 "suffix will probably not do what you expect."
17426 #: ../fish/guestfish.pod:683
17427 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17431 #: ../fish/guestfish.pod:685
17433 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17434 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17438 #: ../fish/guestfish.pod:688
17441 " 1234 decimal number 1234\n"
17442 " 02322 octal number, equivalent to decimal 1234\n"
17443 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17448 #: ../fish/guestfish.pod:692
17450 "When using the C<chmod> command, you almost always want to specify an octal "
17451 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17452 "L<chmod(1)> program):"
17456 #: ../fish/guestfish.pod:696
17459 " chmod 0777 /public # OK\n"
17460 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17465 #: ../fish/guestfish.pod:699
17467 "Commands that return numbers usually print them in decimal, but some "
17468 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17469 "octal, preceeded by C<0>)."
17473 #: ../fish/guestfish.pod:703
17474 msgid "WILDCARDS AND GLOBBING"
17478 #: ../fish/guestfish.pod:705
17480 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17481 "(globbing) by default. So for example the following will not do what you "
17486 #: ../fish/guestfish.pod:709
17494 #: ../fish/guestfish.pod:711
17496 "Assuming you don't have a directory called literally C</home/*> then the "
17497 "above command will return an error."
17501 #: ../fish/guestfish.pod:714
17502 msgid "To perform wildcard expansion, use the C<glob> command."
17506 #: ../fish/guestfish.pod:716
17509 " glob rm-rf /home/*\n"
17514 #: ../fish/guestfish.pod:718
17516 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17517 "many times), equivalent to:"
17521 #: ../fish/guestfish.pod:721
17524 " rm-rf /home/jim\n"
17525 " rm-rf /home/joe\n"
17526 " rm-rf /home/mary\n"
17531 #: ../fish/guestfish.pod:725
17532 msgid "C<glob> only works on simple guest paths and not on device names."
17536 #: ../fish/guestfish.pod:727
17538 "If you have several parameters, each containing a wildcard, then glob will "
17539 "perform a Cartesian product."
17543 #: ../fish/guestfish.pod:730
17548 #: ../fish/guestfish.pod:732
17550 "Any line which starts with a I<#> character is treated as a comment and "
17551 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17552 "a command. For example:"
17556 #: ../fish/guestfish.pod:736
17559 " # this is a comment\n"
17560 " # this is a comment\n"
17561 " foo # NOT a comment\n"
17566 #: ../fish/guestfish.pod:740
17567 msgid "Blank lines are also ignored."
17571 #: ../fish/guestfish.pod:742
17572 msgid "RUNNING COMMANDS LOCALLY"
17576 #: ../fish/guestfish.pod:744
17578 "Any line which starts with a I<!> character is treated as a command sent to "
17579 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17583 #: ../fish/guestfish.pod:748
17587 " tgz-out /remote local/remote-data.tar.gz\n"
17592 #: ../fish/guestfish.pod:751
17594 "will create a directory C<local> on the host, and then export the contents "
17595 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17596 "(See C<tgz-out>)."
17600 #: ../fish/guestfish.pod:755
17602 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17603 "effect, due to the way that subprocesses work in Unix."
17607 #: ../fish/guestfish.pod:758
17608 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
17612 #: ../fish/guestfish.pod:760
17614 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
17615 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
17616 "and executed as guestfish commands."
17620 #: ../fish/guestfish.pod:764
17622 "Thus you can use shell script to construct arbitrary guestfish commands "
17623 "which are then parsed by guestfish."
17627 #: ../fish/guestfish.pod:767
17629 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
17630 "through C</foo.100>) using guestfish commands alone. However this is simple "
17631 "if we use a shell script to create the guestfish commands for us:"
17635 #: ../fish/guestfish.pod:772
17638 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
17643 #: ../fish/guestfish.pod:774
17644 msgid "or with names like C</foo.001>:"
17648 #: ../fish/guestfish.pod:776
17651 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
17656 #: ../fish/guestfish.pod:778
17658 "When using guestfish interactively it can be helpful to just run the shell "
17659 "script first (ie. remove the initial C<E<lt>> character so it is just an "
17660 "ordinary I<!> local command), see what guestfish commands it would run, and "
17661 "when you are happy with those prepend the C<E<lt>> character to run the "
17662 "guestfish commands for real."
17666 #: ../fish/guestfish.pod:784
17671 #: ../fish/guestfish.pod:786
17673 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17674 "command (a guestfish command) to the second command (any host command). For "
17679 #: ../fish/guestfish.pod:790
17682 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17687 #: ../fish/guestfish.pod:792
17689 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17690 "program). The above command would list all accounts in the guest filesystem "
17691 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17695 #: ../fish/guestfish.pod:797
17698 " hexdump /bin/ls | head\n"
17699 " list-devices | tail -1\n"
17700 " tgz-out / - | tar ztf -\n"
17705 #: ../fish/guestfish.pod:801
17707 "The space before the pipe symbol is required, any space after the pipe "
17708 "symbol is optional. Everything after the pipe symbol is just passed "
17709 "straight to the host shell, so it can contain redirections, globs and "
17710 "anything else that makes sense on the host side."
17714 #: ../fish/guestfish.pod:806
17716 "To use a literal argument which begins with a pipe symbol, you have to quote "
17721 #: ../fish/guestfish.pod:809
17729 #: ../fish/guestfish.pod:811
17730 msgid "HOME DIRECTORIES"
17734 #: ../fish/guestfish.pod:813
17736 "If a parameter starts with the character C<~> then the tilde may be expanded "
17737 "as a home directory path (either C<~> for the current user's home directory, "
17738 "or C<~user> for another user)."
17742 #: ../fish/guestfish.pod:817
17744 "Note that home directory expansion happens for users known I<on the host>, "
17745 "not in the guest filesystem."
17749 #: ../fish/guestfish.pod:820
17751 "To use a literal argument which begins with a tilde, you have to quote it, "
17756 #: ../fish/guestfish.pod:823
17764 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
17765 msgid "ENCRYPTED DISKS"
17769 #: ../fish/guestfish.pod:827
17771 "Libguestfs has some support for Linux guests encrypted according to the "
17772 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17773 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
17774 "LUKS is supported."
17778 #: ../fish/guestfish.pod:832
17779 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17783 #: ../fish/guestfish.pod:834
17786 " ><fs> vfs-type /dev/sda2\n"
17792 #: ../fish/guestfish.pod:837
17794 "Then open those devices using L</luks-open>. This creates a device-mapper "
17795 "device called C</dev/mapper/luksdev>."
17799 #: ../fish/guestfish.pod:840
17802 " ><fs> luks-open /dev/sda2 luksdev\n"
17803 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17808 #: ../fish/guestfish.pod:843
17810 "Finally you have to tell LVM to scan for volume groups on the newly created "
17815 #: ../fish/guestfish.pod:846
17819 " vg-activate-all true\n"
17824 #: ../fish/guestfish.pod:849
17825 msgid "The logical volume(s) can now be mounted in the usual way."
17829 #: ../fish/guestfish.pod:851
17831 "Before closing a LUKS device you must unmount any logical volumes on it and "
17832 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17833 "one. Then you can close the mapper device:"
17837 #: ../fish/guestfish.pod:855
17840 " vg-activate false /dev/VG\n"
17841 " luks-close /dev/mapper/luksdev\n"
17846 #: ../fish/guestfish.pod:860
17848 "If a path is prefixed with C<win:> then you can use Windows-style drive "
17849 "letters and paths (with some limitations). The following commands are "
17854 #: ../fish/guestfish.pod:864
17857 " file /WINDOWS/system32/config/system.LOG\n"
17862 #: ../fish/guestfish.pod:866
17865 " file win:\\windows\\system32\\config\\system.log\n"
17870 #: ../fish/guestfish.pod:868
17873 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
17878 #: ../fish/guestfish.pod:870
17880 "The parameter is rewritten \"behind the scenes\" by looking up the position "
17881 "where the drive is mounted, prepending that to the path, changing all "
17882 "backslash characters to forward slash, then resolving the result using L</"
17883 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
17884 "the parameter might be rewritten like this:"
17888 #: ../fish/guestfish.pod:876
17891 " win:e:\\foo\\bar => /e/FOO/bar\n"
17896 #: ../fish/guestfish.pod:878
17897 msgid "This only works in argument positions that expect a path."
17901 #: ../fish/guestfish.pod:880
17902 msgid "UPLOADING AND DOWNLOADING FILES"
17906 #: ../fish/guestfish.pod:882
17908 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17909 "others which upload from or download to a local file, you can use the "
17910 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17914 #: ../fish/guestfish.pod:886
17922 #: ../fish/guestfish.pod:888
17924 "reads stdin and creates from that a file C</foo> in the disk image, and:"
17928 #: ../fish/guestfish.pod:891
17931 " tar-out /etc - | tar tf -\n"
17936 #: ../fish/guestfish.pod:893
17938 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17939 "command (see L</PIPES>)."
17943 #: ../fish/guestfish.pod:896
17945 "When using C<-> to read from stdin, the input is read up to the end of "
17946 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17947 "some arbitrary end marker:"
17951 #: ../fish/guestfish.pod:900
17954 " upload -<<END /foo\n"
17963 #: ../fish/guestfish.pod:906
17965 "Any string of characters can be used instead of C<END>. The end marker must "
17966 "appear on a line of its own, without any preceeding or following characters "
17967 "(not even spaces)."
17971 #: ../fish/guestfish.pod:910
17973 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
17974 "upload local files (so-called \"FileIn\" parameters in the generator)."
17978 #: ../fish/guestfish.pod:913
17979 msgid "EXIT ON ERROR BEHAVIOUR"
17983 #: ../fish/guestfish.pod:915
17985 "By default, guestfish will ignore any errors when in interactive mode (ie. "
17986 "taking commands from a human over a tty), and will exit on the first error "
17987 "in non-interactive mode (scripts, commands given on the command line)."
17991 #: ../fish/guestfish.pod:920
17993 "If you prefix a command with a I<-> character, then that command will not "
17994 "cause guestfish to exit, even if that (one) command returns an error."
17998 #: ../fish/guestfish.pod:924
17999 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18003 #: ../fish/guestfish.pod:926
18005 "Guestfish can be remote-controlled over a socket. This is useful "
18006 "particularly in shell scripts where you want to make several different "
18007 "changes to a filesystem, but you don't want the overhead of starting up a "
18008 "guestfish process each time."
18012 #: ../fish/guestfish.pod:931
18013 msgid "Start a guestfish server process using:"
18017 #: ../fish/guestfish.pod:933
18020 " eval \"`guestfish --listen`\"\n"
18025 #: ../fish/guestfish.pod:935
18026 msgid "and then send it commands by doing:"
18030 #: ../fish/guestfish.pod:937
18033 " guestfish --remote cmd [...]\n"
18038 #: ../fish/guestfish.pod:939
18039 msgid "To cause the server to exit, send it the exit command:"
18043 #: ../fish/guestfish.pod:943
18045 "Note that the server will normally exit if there is an error in a command. "
18046 "You can change this in the usual way. See section L</EXIT ON ERROR "
18051 #: ../fish/guestfish.pod:947
18052 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18056 #: ../fish/guestfish.pod:949
18058 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18059 "is how the I<--remote> option knows where to send the commands. You can "
18060 "have several guestfish listener processes running using:"
18064 #: ../fish/guestfish.pod:953
18067 " eval \"`guestfish --listen`\"\n"
18068 " pid1=$GUESTFISH_PID\n"
18069 " eval \"`guestfish --listen`\"\n"
18070 " pid2=$GUESTFISH_PID\n"
18072 " guestfish --remote=$pid1 cmd\n"
18073 " guestfish --remote=$pid2 cmd\n"
18078 #: ../fish/guestfish.pod:961
18079 msgid "REMOTE CONTROL AND CSH"
18083 #: ../fish/guestfish.pod:963
18085 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18090 #: ../fish/guestfish.pod:966
18093 " eval \"`guestfish --listen --csh`\"\n"
18098 #: ../fish/guestfish.pod:968
18099 msgid "REMOTE CONTROL DETAILS"
18103 #: ../fish/guestfish.pod:970
18105 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18106 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18107 "and C<$PID> is the process ID of the server."
18111 #: ../fish/guestfish.pod:974
18112 msgid "Guestfish client and server versions must match exactly."
18116 #: ../fish/guestfish.pod:976
18117 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
18121 #: ../fish/guestfish.pod:978
18123 "From Bash, you can use the following code which creates a guestfish "
18124 "instance, correctly quotes the command line, handles failure to start, and "
18125 "cleans up guestfish when the script exits:"
18129 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:958
18137 #: ../fish/guestfish.pod:986
18140 " guestfish[0]=\"guestfish\"\n"
18141 " guestfish[1]=\"--listen\"\n"
18142 " guestfish[2]=\"--ro\"\n"
18143 " guestfish[3]=\"-a\"\n"
18144 " guestfish[4]=\"disk.img\"\n"
18149 #: ../fish/guestfish.pod:992
18152 " GUESTFISH_PID=\n"
18153 " eval $(\"${guestfish[@]}\")\n"
18154 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
18155 " echo \"error: guestfish didn't start up, see error messages above\"\n"
18162 #: ../fish/guestfish.pod:999
18165 " cleanup_guestfish ()\n"
18167 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
18169 " trap cleanup_guestfish EXIT ERR\n"
18174 #: ../fish/guestfish.pod:1005
18177 " guestfish --remote -- run\n"
18182 #: ../fish/guestfish.pod:1007
18190 #: ../fish/guestfish.pod:1009
18191 msgid "REMOTE CONTROL RUN COMMAND HANGING"
18195 #: ../fish/guestfish.pod:1011
18197 "Using the C<run> (or C<launch>) command remotely in a command substitution "
18198 "context hangs, ie. don't do (note the backquotes):"
18202 #: ../fish/guestfish.pod:1014
18205 " a=`guestfish --remote run`\n"
18210 #: ../fish/guestfish.pod:1016
18212 "Since the C<run> command produces no output on stdout, this is not useful "
18213 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
18218 #: ../fish/guestfish.pod:1020
18219 msgid "PREPARED DISK IMAGES"
18223 #: ../fish/guestfish.pod:1022
18225 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18226 "preformatted disk images that guestfish can make for you to save typing. "
18227 "This is particularly useful for testing purposes. This option is used "
18228 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18229 "can be mixed with I<-a>)."
18233 #: ../fish/guestfish.pod:1028
18235 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18236 "the second and so on. Existing files in the current directory are "
18241 #: ../fish/guestfish.pod:1032
18243 "The type briefly describes how the disk should be sized, partitioned, how "
18244 "filesystem(s) should be created, and how content should be added. "
18245 "Optionally the type can be followed by extra parameters, separated by C<:> "
18246 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18247 "allocated disk, containing a single partition, with the partition formatted "
18248 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18253 #: ../fish/guestfish.pod:1040
18254 msgid "To list the available types and any extra parameters they take, run:"
18258 #: ../fish/guestfish.pod:1044
18260 "Note that the prepared filesystem is not mounted. You would usually have to "
18261 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18265 #: ../fish/guestfish.pod:1048
18267 "If any I<-N> or I<--new> options are given, the guest is automatically "
18272 #: ../fish/guestfish.pod:1053
18273 msgid "Create a 100MB disk with an ext4-formatted partition:"
18277 #: ../fish/guestfish.pod:1055
18280 " guestfish -N fs:ext4\n"
18285 #: ../fish/guestfish.pod:1057
18286 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18290 #: ../fish/guestfish.pod:1059
18293 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18298 #: ../fish/guestfish.pod:1061
18299 msgid "Create a blank 200MB disk:"
18303 #: ../fish/guestfish.pod:1063
18306 " guestfish -N disk:200M\n"
18311 #: ../fish/guestfish.pod:1065
18312 msgid "PROGRESS BARS"
18316 #: ../fish/guestfish.pod:1067
18318 "Some (not all) long-running commands send progress notification messages as "
18319 "they are running. Guestfish turns these messages into progress bars."
18323 #: ../fish/guestfish.pod:1071
18325 "When a command that supports progress bars takes longer than two seconds to "
18326 "run, and if progress bars are enabled, then you will see one appearing below "
18331 #: ../fish/guestfish.pod:1075
18334 " ><fs> copy-size /large-file /another-file 2048M\n"
18335 " / 10% [#####-----------------------------------------] 00:30\n"
18340 #: ../fish/guestfish.pod:1078
18342 "The spinner on the left hand side moves round once for every progress "
18343 "notification received from the backend. This is a (reasonably) golden "
18344 "assurance that the command is \"doing something\" even if the progress bar "
18345 "is not moving, because the command is able to send the progress "
18346 "notifications. When the bar reaches 100% and the command finishes, the "
18347 "spinner disappears."
18351 #: ../fish/guestfish.pod:1085
18353 "Progress bars are enabled by default when guestfish is used interactively. "
18354 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18355 "and you can disable them completely using I<--no-progress-bars>."
18359 #: ../fish/guestfish.pod:1090
18360 msgid "GUESTFISH COMMANDS"
18364 #: ../fish/guestfish.pod:1092
18366 "The commands in this section are guestfish convenience commands, in other "
18367 "words, they are not part of the L<guestfs(3)> API."
18371 #: ../fish/guestfish.pod:1095
18376 #: ../fish/guestfish.pod:1097
18385 #: ../fish/guestfish.pod:1100
18386 msgid "Without any parameter, this provides general help."
18390 #: ../fish/guestfish.pod:1102
18391 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18395 #: ../fish/guestfish.pod:1104
18396 msgid "quit | exit"
18400 #: ../fish/guestfish.pod:1106
18401 msgid "This exits guestfish. You can also use C<^D> key."
18405 #: ../fish/guestfish.pod:1108
18406 msgid "@FISH_COMMANDS@"
18410 #: ../fish/guestfish.pod:1110
18415 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1497
18420 #: ../fish/guestfish.pod:1116
18422 "guestfish returns 0 if the commands completed without error, or 1 if there "
18427 #: ../fish/guestfish.pod:1123
18432 #: ../fish/guestfish.pod:1125
18434 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18439 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3089
18440 msgid "FEBOOTSTRAP_KERNEL"
18444 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3091
18445 msgid "FEBOOTSTRAP_MODULES"
18449 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3093
18451 "These two environment variables allow the kernel that libguestfs uses in the "
18452 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
18453 "most recent host kernel is chosen. For more information about kernel "
18454 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
18455 "available in febootstrap E<ge> 3.8."
18459 #: ../fish/guestfish.pod:1138
18460 msgid "GUESTFISH_DISPLAY_IMAGE"
18464 #: ../fish/guestfish.pod:1140
18466 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
18467 "If not set, it uses L<display(1)>."
18471 #: ../fish/guestfish.pod:1143
18472 msgid "GUESTFISH_PID"
18476 #: ../fish/guestfish.pod:1145
18478 "Used with the I<--remote> option to specify the remote guestfish process to "
18479 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18483 #: ../fish/guestfish.pod:1149
18488 #: ../fish/guestfish.pod:1151
18490 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18491 "not specified, the external L<hexedit(1)> program is used."
18495 #: ../fish/guestfish.pod:1155
18500 #: ../fish/guestfish.pod:1157
18502 "If compiled with GNU readline support, various files in the home directory "
18503 "can be used. See L</FILES>."
18507 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3099
18508 msgid "LIBGUESTFS_APPEND"
18512 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3101
18513 msgid "Pass additional options to the guest kernel."
18517 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3103
18518 msgid "LIBGUESTFS_DEBUG"
18522 #: ../fish/guestfish.pod:1166
18524 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18525 "effect as using the B<-v> option."
18529 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3108
18530 msgid "LIBGUESTFS_MEMSIZE"
18534 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3110
18536 "Set the memory allocated to the qemu process, in megabytes. For example:"
18540 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3113
18543 " LIBGUESTFS_MEMSIZE=700\n"
18548 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3115
18549 msgid "LIBGUESTFS_PATH"
18553 #: ../fish/guestfish.pod:1178
18555 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18556 "the discussion of paths in L<guestfs(3)>."
18560 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3120
18561 msgid "LIBGUESTFS_QEMU"
18565 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3122
18567 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
18568 "which was found at compile time by the configure script is used."
18572 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3128
18573 msgid "LIBGUESTFS_TRACE"
18577 #: ../fish/guestfish.pod:1189
18578 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18582 #: ../fish/guestfish.pod:1191
18587 #: ../fish/guestfish.pod:1193
18589 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18594 #: ../fish/guestfish.pod:1196 ../src/guestfs.pod:3133
18599 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3135
18601 "Location of temporary directory, defaults to C</tmp> except for the cached "
18602 "supermin appliance which defaults to C</var/tmp>."
18606 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3138
18608 "If libguestfs was compiled to use the supermin appliance then the real "
18609 "appliance is cached in this directory, shared between all handles belonging "
18610 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
18611 "use in case C</var/tmp> is not large enough."
18615 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297
18616 #: ../rescue/virt-rescue.pod:269
18621 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301
18622 #: ../rescue/virt-rescue.pod:273
18623 msgid "$HOME/.libguestfs-tools.rc"
18627 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303
18628 #: ../rescue/virt-rescue.pod:275
18629 msgid "/etc/libguestfs-tools.conf"
18633 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305
18634 #: ../rescue/virt-rescue.pod:277
18636 "This configuration file controls the default read-only or read-write mode "
18637 "(I<--ro> or I<--rw>)."
18641 #: ../fish/guestfish.pod:1220
18642 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
18646 #: ../fish/guestfish.pod:1222
18647 msgid "$HOME/.guestfish"
18651 #: ../fish/guestfish.pod:1224
18653 "If compiled with GNU readline support, then the command history is saved in "
18658 #: ../fish/guestfish.pod:1227
18659 msgid "$HOME/.inputrc"
18663 #: ../fish/guestfish.pod:1229
18664 msgid "/etc/inputrc"
18668 #: ../fish/guestfish.pod:1231
18670 "If compiled with GNU readline support, then these files can be used to "
18671 "configure readline. For further information, please see L<readline(3)/"
18672 "INITIALIZATION FILE>."
18676 #: ../fish/guestfish.pod:1235
18677 msgid "To write rules which only apply to guestfish, use:"
18681 #: ../fish/guestfish.pod:1237
18691 #: ../fish/guestfish.pod:1241
18693 "Variables that you can set in inputrc that change the behaviour of guestfish "
18694 "in useful ways include:"
18698 #: ../fish/guestfish.pod:1246
18699 msgid "completion-ignore-case (default: on)"
18703 #: ../fish/guestfish.pod:1248
18705 "By default, guestfish will ignore case when tab-completing paths on the "
18710 #: ../fish/guestfish.pod:1251
18713 " set completion-ignore-case off\n"
18718 #: ../fish/guestfish.pod:1253
18719 msgid "to make guestfish case sensitive."
18723 #: ../fish/guestfish.pod:1257
18728 #: ../fish/guestfish.pod:1259
18729 msgid "test2.img (etc)"
18733 #: ../fish/guestfish.pod:1261
18735 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18736 "will be created in the file C<test1.img> in the current directory. The "
18737 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18738 "the same name will be overwritten."
18742 #: ../fish/guestfish.pod:1270
18744 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
18745 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
18746 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
18747 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
18748 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
18749 ">, L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
18753 #: ../fish/guestfish.pod:1299 ../src/guestfs.pod:3225
18754 #: ../test-tool/libguestfs-test-tool.pod:112
18755 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18759 #: ../fish/virt-copy-in.pod:5
18761 "virt-copy-in - Copy files and directories into a virtual machine disk image."
18765 #: ../fish/virt-copy-in.pod:9
18768 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18773 #: ../fish/virt-copy-in.pod:11
18776 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18781 #: ../fish/virt-copy-in.pod:15
18783 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18784 "causing disk corruption. The virtual machine must be shut down before you "
18785 "use this command."
18789 #: ../fish/virt-copy-in.pod:21
18791 "C<virt-copy-in> copies files and directories from the local disk into a "
18792 "virtual machine disk image or named libvirt domain."
18796 #: ../fish/virt-copy-in.pod:24
18798 "You can give one of more filenames and directories on the command line. "
18799 "Directories are copied in recursively. The final parameter must be the "
18800 "destination directory in the disk image which must be an absolute path "
18801 "starting with a C</> character."
18805 #: ../fish/virt-copy-in.pod:33
18808 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18813 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18814 msgid "Upload a home directory to a guest:"
18818 #: ../fish/virt-copy-in.pod:37
18821 " virt-copy-in -d MyGuest skel /home\n"
18826 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
18827 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18828 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18832 #: ../fish/virt-copy-in.pod:41
18834 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18835 "> C<copy-in> command. For anything more complex than a trivial copy, you "
18836 "are probably better off using guestfish directly."
18840 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
18841 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18843 "Since the shell script just passes options straight to guestfish, read "
18844 "L<guestfish(1)> to see the full list of options."
18848 #: ../fish/virt-copy-in.pod:52
18850 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18851 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18855 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
18856 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18857 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18861 #: ../fish/virt-copy-out.pod:5
18863 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18868 #: ../fish/virt-copy-out.pod:9
18871 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18876 #: ../fish/virt-copy-out.pod:11
18879 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18884 #: ../fish/virt-copy-out.pod:15
18886 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18887 "image or named libvirt domain."
18891 #: ../fish/virt-copy-out.pod:18
18893 "You can give one of more filenames and directories on the command line. "
18894 "Directories are copied out recursively."
18898 #: ../fish/virt-copy-out.pod:23
18899 msgid "Download the home directories from a virtual machine:"
18903 #: ../fish/virt-copy-out.pod:25
18907 " virt-copy-out -d MyGuest /home homes\n"
18912 #: ../fish/virt-copy-out.pod:30
18914 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18915 "> C<copy-out> command. For anything more complex than a trivial copy, you "
18916 "are probably better off using guestfish directly."
18920 #: ../fish/virt-copy-out.pod:41
18922 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
18923 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18927 #: ../fish/virt-tar-in.pod:5
18928 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18932 #: ../fish/virt-tar-in.pod:9
18935 " virt-tar-in -a disk.img data.tar /destination\n"
18940 #: ../fish/virt-tar-in.pod:11
18943 " virt-tar-in -d domain data.tar /destination\n"
18948 #: ../fish/virt-tar-in.pod:13
18951 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18956 #: ../fish/virt-tar-in.pod:17
18958 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18959 "causing disk corruption. The virtual machine must be shut down before you "
18960 "use this command."
18964 #: ../fish/virt-tar-in.pod:23
18966 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18967 "image or named libvirt domain."
18971 #: ../fish/virt-tar-in.pod:26
18973 "The first parameter is the tar file. Use C<-> to read the tar file from "
18974 "standard input. The second parameter is the absolute target directory to "
18979 #: ../fish/virt-tar-in.pod:34
18982 " virt-tar-in -d MyGuest homes.tar /home\n"
18987 #: ../fish/virt-tar-in.pod:38
18989 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18990 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
18991 "probably better off using guestfish directly."
18995 #: ../fish/virt-tar-in.pod:49
18997 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18998 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
19003 #: ../fish/virt-tar-out.pod:5
19005 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
19009 #: ../fish/virt-tar-out.pod:9
19012 " virt-tar-out -a disk.img /dir files.tar\n"
19017 #: ../fish/virt-tar-out.pod:11
19020 " virt-tar-out -d domain /dir files.tar\n"
19025 #: ../fish/virt-tar-out.pod:13
19028 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
19033 #: ../fish/virt-tar-out.pod:17
19035 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
19039 #: ../fish/virt-tar-out.pod:20
19041 "The first parameter is the absolute path of the virtual machine directory. "
19042 "The second parameter is the tar file to write. Use C<-> to write to "
19047 #: ../fish/virt-tar-out.pod:26
19048 msgid "Download the home directories from a guest:"
19052 #: ../fish/virt-tar-out.pod:28
19055 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
19060 #: ../fish/virt-tar-out.pod:32
19062 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19063 "> C<tar-out> command. For anything more complex than a trivial copy, you "
19064 "are probably better off using guestfish directly."
19068 #: ../fish/virt-tar-out.pod:43
19070 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19071 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
19075 #: ../fuse/guestmount.pod:5
19077 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
19081 #: ../fuse/guestmount.pod:9
19084 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
19089 #: ../fuse/guestmount.pod:11
19092 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
19097 #: ../fuse/guestmount.pod:13
19100 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
19105 #: ../fuse/guestmount.pod:17
19107 "You must I<not> use C<guestmount> in read-write mode on live virtual "
19108 "machines. If you do this, you risk disk corruption in the VM."
19112 #: ../fuse/guestmount.pod:22
19114 "The guestmount program can be used to mount virtual machine filesystems and "
19115 "other disk images on the host. It uses libguestfs for access to the guest "
19116 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
19117 "a mountable device."
19121 #: ../fuse/guestmount.pod:27
19123 "Along with other options, you have to give at least one device (I<-a> "
19124 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
19125 "option) or use the I<-i> inspection option. How this works is better "
19126 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
19131 #: ../fuse/guestmount.pod:33
19133 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
19134 "by you, and the filesystem will not be visible to any other users unless you "
19135 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
19136 "the filesystem, use the C<fusermount -u> command."
19140 #: ../fuse/guestmount.pod:41
19142 "For a typical Windows guest which has its main filesystem on the first "
19147 #: ../fuse/guestmount.pod:44
19150 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
19155 #: ../fuse/guestmount.pod:46
19157 "For a typical Linux guest which has a /boot filesystem on the first "
19158 "partition, and the root filesystem on a logical volume:"
19162 #: ../fuse/guestmount.pod:49
19165 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
19170 #: ../fuse/guestmount.pod:51
19171 msgid "To get libguestfs to detect guest mountpoints for you:"
19175 #: ../fuse/guestmount.pod:53
19178 " guestmount -a guest.img -i --ro /mnt\n"
19183 #: ../fuse/guestmount.pod:55
19184 msgid "For a libvirt guest called \"Guest\" you could do:"
19188 #: ../fuse/guestmount.pod:57
19191 " guestmount -d Guest -i --ro /mnt\n"
19196 #: ../fuse/guestmount.pod:59
19198 "If you don't know what filesystems are contained in a guest or disk image, "
19199 "use L<virt-filesystems(1)> first:"
19203 #: ../fuse/guestmount.pod:62
19206 " virt-filesystems MyGuest\n"
19211 #: ../fuse/guestmount.pod:64
19213 "If you want to trace the libguestfs calls but without excessive debugging "
19214 "information, we recommend:"
19218 #: ../fuse/guestmount.pod:67
19221 " guestmount [...] --trace /mnt\n"
19226 #: ../fuse/guestmount.pod:69
19227 msgid "If you want to debug the program, we recommend:"
19231 #: ../fuse/guestmount.pod:71
19234 " guestmount [...] --trace --verbose /mnt\n"
19239 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
19240 #: ../resize/virt-resize.pod:511
19245 #: ../fuse/guestmount.pod:75
19246 msgid "Other users cannot see the filesystem by default"
19250 #: ../fuse/guestmount.pod:77
19252 "If you mount a filesystem as one user (eg. root), then other users will not "
19253 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
19254 "option when mounting:"
19258 #: ../fuse/guestmount.pod:81
19261 " sudo guestmount [...] -o allow_other /mnt\n"
19266 #: ../fuse/guestmount.pod:83
19267 msgid "Enabling FUSE"
19271 #: ../fuse/guestmount.pod:85
19273 "On some distros, you may need to add yourself to a special group (eg. "
19274 "C<fuse>) before you can use any FUSE filesystem. This is necessary on "
19275 "Debian and derivatives."
19279 #: ../fuse/guestmount.pod:89
19281 "On other distros, no special group is required. It is not necessary on "
19282 "Fedora or Red Hat Enterprise Linux."
19286 #: ../fuse/guestmount.pod:100
19287 msgid "Add a block device or virtual machine image."
19291 #: ../fuse/guestmount.pod:123
19292 msgid "B<--dir-cache-timeout N>"
19296 #: ../fuse/guestmount.pod:125
19298 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
19299 "seconds. The readdir cache [actually, there are several semi-independent "
19300 "caches] is populated after a readdir(2) call with the stat and extended "
19301 "attributes of the files in the directory, in anticipation that they will be "
19302 "requested soon after."
19306 #: ../fuse/guestmount.pod:131
19308 "There is also a different attribute cache implemented by FUSE (see the FUSE "
19309 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
19310 "requests, only cache existing ones."
19314 #: ../fuse/guestmount.pod:151
19316 "If you have untrusted raw-format guest disk images, you should use this "
19317 "option to specify the disk format. This avoids a possible security problem "
19318 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
19319 "guestfs_add_drive_opts>."
19323 #: ../fuse/guestmount.pod:156
19324 msgid "B<--fuse-help>"
19328 #: ../fuse/guestmount.pod:158
19329 msgid "Display help on special FUSE options (see I<-o> below)."
19333 #: ../fuse/guestmount.pod:162
19334 msgid "Display brief help and exit."
19338 #: ../fuse/guestmount.pod:186
19340 "Mount the named partition or logical volume on the given mountpoint B<in the "
19341 "guest> (this has nothing to do with mountpoints in the host)."
19345 #: ../fuse/guestmount.pod:189
19347 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
19348 "something on C</>."
19352 #: ../fuse/guestmount.pod:206
19354 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
19355 "unmounted. If you specify this option, then we don't attempt to sync the "
19356 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
19360 #: ../fuse/guestmount.pod:211
19361 msgid "B<-o option>"
19365 #: ../fuse/guestmount.pod:213
19366 msgid "B<--option option>"
19370 #: ../fuse/guestmount.pod:215
19371 msgid "Pass extra options to FUSE."
19375 #: ../fuse/guestmount.pod:217
19377 "To get a list of all the extra options supported by FUSE, use the command "
19378 "below. Note that only the FUSE I<-o> options can be passed, and only some "
19379 "of them are a good idea."
19383 #: ../fuse/guestmount.pod:221
19386 " guestmount --fuse-help\n"
19391 #: ../fuse/guestmount.pod:223
19392 msgid "Some potentially useful FUSE options:"
19396 #: ../fuse/guestmount.pod:227
19397 msgid "B<-o allow_other>"
19401 #: ../fuse/guestmount.pod:229
19402 msgid "Allow other users to see the filesystem."
19406 #: ../fuse/guestmount.pod:231
19407 msgid "B<-o attr_timeout=N>"
19411 #: ../fuse/guestmount.pod:233
19412 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
19416 #: ../fuse/guestmount.pod:235
19417 msgid "B<-o kernel_cache>"
19421 #: ../fuse/guestmount.pod:237
19423 "Allow the kernel to cache files (reduces the number of reads that have to go "
19424 "through the L<guestfs(3)> API). This is generally a good idea if you can "
19425 "afford the extra memory usage."
19429 #: ../fuse/guestmount.pod:241
19430 msgid "B<-o uid=N> B<-o gid=N>"
19434 #: ../fuse/guestmount.pod:243
19436 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
19437 "the chosen values."
19441 #: ../fuse/guestmount.pod:252
19443 "Add devices and mount everything read-only. Also disallow writes and make "
19444 "the disk appear read-only to FUSE."
19448 #: ../fuse/guestmount.pod:255
19450 "This is highly recommended if you are not going to edit the guest disk. If "
19451 "the guest is running and this option is I<not> supplied, then there is a "
19452 "strong risk of disk corruption in the guest. We try to prevent this from "
19453 "happening, but it is not always possible."
19457 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
19458 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19462 #: ../fuse/guestmount.pod:264
19463 msgid "Enable SELinux support for the guest."
19467 #: ../fuse/guestmount.pod:270
19468 msgid "Enable verbose messages from underlying libguestfs."
19472 #: ../fuse/guestmount.pod:276
19473 msgid "Display the program version and exit."
19477 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308
19478 #: ../rescue/virt-rescue.pod:197 ../rescue/virt-rescue.pod:280
19479 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19483 #: ../fuse/guestmount.pod:289
19488 #: ../fuse/guestmount.pod:291
19489 msgid "Trace libguestfs calls and entry into each FUSE function."
19493 #: ../fuse/guestmount.pod:293
19494 msgid "This also stops the daemon from forking into the background."
19498 #: ../fuse/guestmount.pod:319
19500 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
19501 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
19506 #: ../fuse/guestmount.pod:334
19507 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
19511 #: ../inspector/virt-inspector.pod:5
19513 "virt-inspector - Display operating system version and other information "
19514 "about a virtual machine"
19518 #: ../inspector/virt-inspector.pod:9
19521 " virt-inspector [--options] -d domname\n"
19526 #: ../inspector/virt-inspector.pod:11
19529 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
19534 #: ../inspector/virt-inspector.pod:15
19537 " virt-inspector domname\n"
19542 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
19545 " virt-inspector disk.img [disk.img ...]\n"
19550 #: ../inspector/virt-inspector.pod:21
19552 "B<virt-inspector> examines a virtual machine or disk image and tries to "
19553 "determine the version of the operating system and other information about "
19554 "the virtual machine."
19558 #: ../inspector/virt-inspector.pod:25
19559 msgid "Virt-inspector produces XML output for feeding into other programs."
19563 #: ../inspector/virt-inspector.pod:27
19565 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
19566 "the libvirt domain (see: C<virsh list --all>)."
19570 #: ../inspector/virt-inspector.pod:30
19572 "You can also run virt-inspector directly on disk images from a single "
19573 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
19574 "has several block devices, in which case you should list several I<-a> "
19575 "options one after another, with the first corresponding to the guest's C</"
19576 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
19580 #: ../inspector/virt-inspector.pod:37
19582 "You can also run virt-inspector on install disks, live CDs, bootable USB "
19583 "keys and similar."
19587 #: ../inspector/virt-inspector.pod:40
19589 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
19590 "inspect several virtual machines, you have to run virt-inspector several "
19591 "times (for example, from a shell script for-loop)."
19595 #: ../inspector/virt-inspector.pod:45
19597 "Because virt-inspector needs direct access to guest images, it won't "
19598 "normally work over remote libvirt connections."
19602 #: ../inspector/virt-inspector.pod:48
19604 "All of the information available from virt-inspector is also available "
19605 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
19606 "The same information can also be fetched using guestfish or via libguestfs "
19607 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
19608 "WITH OTHER PROGRAMMING LANGUAGES>)."
19612 #: ../inspector/virt-inspector.pod:81
19614 "Libvirt is only used if you specify a C<domname> on the command line. If "
19615 "you specify guest block devices directly (I<-a>), then libvirt is not used "
19620 #: ../inspector/virt-inspector.pod:94
19622 "When prompting for keys and passphrases, virt-inspector normally turns "
19623 "echoing off so you cannot see what you are typing. If you are not worried "
19624 "about Tempest attacks and there is no one else in the room you can specify "
19625 "this flag to see what you are typing."
19629 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
19630 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
19631 #: ../tools/virt-win-reg.pl:144
19633 "Specify the format of disk images given on the command line. If this is "
19634 "omitted then the format is autodetected from the content of the disk image."
19638 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
19639 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
19640 #: ../tools/virt-win-reg.pl:148
19642 "If disk images are requested from libvirt, then this program asks libvirt "
19643 "for this information. In this case, the value of the format parameter is "
19648 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
19649 #: ../resize/virt-resize.pod:406 ../tools/virt-list-filesystems.pl:101
19650 #: ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151
19651 #: ../tools/virt-win-reg.pl:152
19653 "If working with untrusted raw-format guest disk images, you should ensure "
19654 "the format is always specified."
19658 #: ../inspector/virt-inspector.pod:139
19659 msgid "Previous versions of virt-inspector allowed you to write either:"
19663 #: ../inspector/virt-inspector.pod:145
19666 " virt-inspector guestname\n"
19671 #: ../inspector/virt-inspector.pod:153
19676 #: ../inspector/virt-inspector.pod:155
19678 "The virt-inspector XML is described precisely in a RELAX NG schema file "
19679 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
19680 "just an overview."
19684 #: ../inspector/virt-inspector.pod:159
19686 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
19687 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
19688 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
19689 "which is vanishingly rare in real world VMs."
19693 #: ../inspector/virt-inspector.pod:164
19694 msgid "E<lt>operatingsystemE<gt>"
19698 #: ../inspector/virt-inspector.pod:166
19700 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
19701 "describe the operating system, its architecture, the descriptive \"product "
19702 "name\" string, the type of OS and so on, as in this example:"
19706 #: ../inspector/virt-inspector.pod:170
19709 " <operatingsystems>\n"
19710 " <operatingsystem>\n"
19711 " <root>/dev/sda2</root>\n"
19712 " <name>windows</name>\n"
19713 " <arch>i386</arch>\n"
19714 " <distro>windows</distro>\n"
19715 " <product_name>Windows 7 Enterprise</product_name>\n"
19716 " <product_variant>Client</product_variant>\n"
19717 " <major_version>6</major_version>\n"
19718 " <minor_version>1</minor_version>\n"
19719 " <windows_systemroot>/Windows</windows_systemroot>\n"
19720 " <format>installed</format>\n"
19725 #: ../inspector/virt-inspector.pod:183
19727 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
19728 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
19729 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
19730 "architecture. The other fields are fairly self-explanatory, but because "
19731 "these fields are taken directly from the libguestfs inspection API you can "
19732 "find precise information from L<guestfs(3)/INSPECTION>."
19736 #: ../inspector/virt-inspector.pod:191
19738 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
19739 "of view of libguestfs (block devices may have completely different names "
19740 "inside the VM itself)."
19744 #: ../inspector/virt-inspector.pod:195
19745 msgid "E<lt>mountpointsE<gt>"
19749 #: ../inspector/virt-inspector.pod:197
19751 "Un*x-like guests typically have multiple filesystems which are mounted at "
19752 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
19753 "element which looks like this:"
19757 #: ../inspector/virt-inspector.pod:201
19760 " <operatingsystems>\n"
19761 " <operatingsystem>\n"
19764 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19765 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19766 " </mountpoints>\n"
19771 #: ../inspector/virt-inspector.pod:209
19773 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19774 "and may have completely different names inside the guest. Only mountable "
19775 "filesystems appear in this list, not things like swap devices."
19779 #: ../inspector/virt-inspector.pod:214
19780 msgid "E<lt>filesystemsE<gt>"
19784 #: ../inspector/virt-inspector.pod:216
19786 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19787 "filesystems belonging to the guest, including swap and empty partitions. "
19788 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19789 "this OS or shared with this OS and other OSes)."
19793 #: ../inspector/virt-inspector.pod:222
19794 msgid "You might see something like this:"
19798 #: ../inspector/virt-inspector.pod:224
19801 " <operatingsystems>\n"
19802 " <operatingsystem>\n"
19805 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19806 " <type>ext4</type>\n"
19807 " <label>Fedora-13-x86_64</label>\n"
19808 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19814 #: ../inspector/virt-inspector.pod:234
19816 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19817 "the label, and the UUID."
19821 #: ../inspector/virt-inspector.pod:237
19822 msgid "E<lt>applicationsE<gt>"
19826 #: ../inspector/virt-inspector.pod:239
19828 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19829 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19834 #: ../inspector/virt-inspector.pod:243
19836 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19837 "Typical values would be C<rpm> and C<deb>."
19841 #: ../inspector/virt-inspector.pod:246
19843 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19844 "Typical values include C<yum>, C<up2date> and C<apt>"
19848 #: ../inspector/virt-inspector.pod:249
19849 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19853 #: ../inspector/virt-inspector.pod:252
19856 " <operatingsystems>\n"
19857 " <operatingsystem>\n"
19859 " <applications>\n"
19861 " <name>coreutils</name>\n"
19862 " <version>8.5</version>\n"
19863 " <release>1</release>\n"
19864 " </application>\n"
19869 #: ../inspector/virt-inspector.pod:262
19871 "The version and release fields may not be available for some types guests. "
19872 "Other fields are possible, see L<guestfs(3)/"
19873 "guestfs_inspect_list_applications>."
19877 #: ../inspector/virt-inspector.pod:266
19878 msgid "E<lt>drive_mappingsE<gt>"
19882 #: ../inspector/virt-inspector.pod:268
19884 "For operating systems like Windows which use drive letters, virt-inspector "
19885 "is able to find out how drive letters map to filesystems."
19889 #: ../inspector/virt-inspector.pod:272
19892 " <operatingsystems>\n"
19893 " <operatingsystem>\n"
19895 " <drive_mappings>\n"
19896 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19897 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19898 " </drive_mappings>\n"
19903 #: ../inspector/virt-inspector.pod:280
19905 "In the example above, drive C maps to the filesystem on the second partition "
19906 "on the first disk, and drive E maps to the filesystem on the first partition "
19907 "on the second disk."
19911 #: ../inspector/virt-inspector.pod:284
19913 "Note that this only covers permanent local filesystem mappings, not things "
19914 "like network shares. Furthermore NTFS volume mount points may not be listed "
19919 #: ../inspector/virt-inspector.pod:288
19920 msgid "E<lt>iconE<gt>"
19924 #: ../inspector/virt-inspector.pod:290
19926 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19927 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19928 "very large and high quality."
19932 #: ../inspector/virt-inspector.pod:294
19935 " <operatingsystems>\n"
19936 " <operatingsystem>\n"
19939 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19940 " [... many lines of base64 data ...]\n"
19946 #: ../inspector/virt-inspector.pod:302
19948 "To display the icon, you have to extract it and convert the base64 data back "
19949 "to a binary file. Use an XPath query or simply an editor to extract the "
19950 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19955 #: ../inspector/virt-inspector.pod:307
19958 " base64 -i -d < icon.data > icon.png\n"
19963 #: ../inspector/virt-inspector.pod:309
19964 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19968 #: ../inspector/virt-inspector.pod:311
19970 "Virt-inspector can detect some operating system installers on install disks, "
19971 "live CDs, bootable USB keys and more."
19975 #: ../inspector/virt-inspector.pod:314
19977 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19978 "fields may be present to indicate a live CD, network installer, or one part "
19979 "of a multipart CD. For example:"
19983 #: ../inspector/virt-inspector.pod:318
19986 " <operatingsystems>\n"
19987 " <operatingsystem>\n"
19988 " <root>/dev/sda</root>\n"
19989 " <name>linux</name>\n"
19990 " <arch>i386</arch>\n"
19991 " <distro>ubuntu</distro>\n"
19992 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
19993 " <major_version>10</major_version>\n"
19994 " <minor_version>10</minor_version>\n"
19995 " <format>installer</format>\n"
20001 #: ../inspector/virt-inspector.pod:330
20002 msgid "USING XPATH"
20006 #: ../inspector/virt-inspector.pod:332
20008 "You can use the XPath query language to select parts of the XML. We "
20009 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
20013 #: ../inspector/virt-inspector.pod:338
20016 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
20018 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20019 " <type>ext4</type>\n"
20025 #: ../inspector/virt-inspector.pod:344
20028 " $ virt-inspector -d Guest | \\\n"
20029 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
20035 #: ../inspector/virt-inspector.pod:348
20038 " $ virt-inspector -d Guest | \\\n"
20039 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
20040 " [displays the guest icon, if there is one]\n"
20045 #: ../inspector/virt-inspector.pod:359
20046 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
20050 #: ../inspector/virt-inspector.pod:361
20052 "Early versions of libguestfs shipped with a different virt-inspector program "
20053 "written in Perl (the current version is written in C). The XML output of "
20054 "the Perl virt-inspector was different and it could also output in other "
20055 "formats like text."
20059 #: ../inspector/virt-inspector.pod:366
20061 "The old virt-inspector is no longer supported or shipped with libguestfs."
20065 #: ../inspector/virt-inspector.pod:369
20067 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
20068 "versions of virt-inspector with different names:"
20072 #: ../inspector/virt-inspector.pod:372
20075 " virt-inspector Old Perl version.\n"
20076 " virt-inspector2 New C version.\n"
20081 #: ../inspector/virt-inspector.pod:382
20083 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
20084 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
20088 #: ../inspector/virt-inspector.pod:399
20089 msgid "Matthew Booth L<mbooth@redhat.com>"
20093 #: ../java/examples/guestfs-java.pod:5
20094 msgid "guestfs-java - How to use libguestfs from Java"
20098 #: ../java/examples/guestfs-java.pod:9
20101 " import com.redhat.et.libguestfs.*;\n"
20106 #: ../java/examples/guestfs-java.pod:11
20109 " GuestFS g = new GuestFS ();\n"
20110 " g.add_drive_opts (\"disk.img\", null);\n"
20116 #: ../java/examples/guestfs-java.pod:17
20118 "This manual page documents how to call libguestfs from the Java programming "
20119 "language. This page just documents the differences from the C API and gives "
20120 "some examples. If you are not familiar with using libguestfs, you also need "
20121 "to read L<guestfs(3)>."
20125 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
20126 msgid "CLOSING THE HANDLE"
20130 #: ../java/examples/guestfs-java.pod:24
20132 "The handle is closed when it is reaped by the garbage collector. Because "
20133 "libguestfs handles include a lot of state, it is also possible to close (and "
20134 "hence free) them explicitly by calling the C<close> method."
20138 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
20139 #: ../python/examples/guestfs-python.pod:21
20140 #: ../ruby/examples/guestfs-ruby.pod:22
20145 #: ../java/examples/guestfs-java.pod:31
20147 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
20148 "exception. This has a single parameter which is the error message (a "
20153 #: ../java/examples/guestfs-java.pod:35
20154 msgid "Calling any method on a closed handle raises the same exception."
20158 #: ../java/examples/guestfs-java.pod:47
20160 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)"
20161 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20162 "libguestfs.org/>, L<http://caml.inria.fr/>."
20166 #: ../java/examples/guestfs-java.pod:63 ../perl/examples/guestfs-perl.pod:57
20167 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20171 #: ../ocaml/examples/guestfs-ocaml.pod:5
20172 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
20176 #: ../ocaml/examples/guestfs-ocaml.pod:9
20177 msgid "Module style:"
20181 #: ../ocaml/examples/guestfs-ocaml.pod:11
20184 " let g = Guestfs.create () in\n"
20185 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20186 " Guestfs.launch g;\n"
20191 #: ../ocaml/examples/guestfs-ocaml.pod:15
20192 msgid "Object-oriented style:"
20196 #: ../ocaml/examples/guestfs-ocaml.pod:17
20199 " let g = new Guestfs.guestfs () in\n"
20200 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20206 #: ../ocaml/examples/guestfs-ocaml.pod:21
20209 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
20211 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
20216 #: ../ocaml/examples/guestfs-ocaml.pod:27
20218 "This manual page documents how to call libguestfs from the OCaml programming "
20219 "language. This page just documents the differences from the C API and gives "
20220 "some examples. If you are not familiar with using libguestfs, you also need "
20221 "to read L<guestfs(3)>."
20225 #: ../ocaml/examples/guestfs-ocaml.pod:32
20226 msgid "PROGRAMMING STYLES"
20230 #: ../ocaml/examples/guestfs-ocaml.pod:34
20232 "There are two different programming styles supported by the OCaml bindings. "
20233 "You can use a module style, with each C function mapped to an OCaml function:"
20237 #: ../ocaml/examples/guestfs-ocaml.pod:38
20240 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
20245 #: ../ocaml/examples/guestfs-ocaml.pod:40
20250 #: ../ocaml/examples/guestfs-ocaml.pod:42
20253 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
20258 #: ../ocaml/examples/guestfs-ocaml.pod:44
20260 "Alternately you can use an object-oriented style, calling methods on the "
20261 "class C<Guestfs.guestfs>:"
20265 #: ../ocaml/examples/guestfs-ocaml.pod:47
20268 " method set_verbose : bool -> unit\n"
20273 #: ../ocaml/examples/guestfs-ocaml.pod:49
20275 "The object-oriented style is usually briefer, and the minor performance "
20276 "penalty isn't noticable in the general overhead of performing libguestfs "
20281 #: ../ocaml/examples/guestfs-ocaml.pod:55
20283 "The handle is closed when it is reaped by the garbage collector. Because "
20284 "libguestfs handles include a lot of state, it is also possible to close (and "
20285 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
20290 #: ../ocaml/examples/guestfs-ocaml.pod:62
20292 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
20293 "exception. This has a single parameter which is the error message (a "
20298 #: ../ocaml/examples/guestfs-ocaml.pod:66
20300 "Calling any function/method on a closed handle raises C<Guestfs."
20301 "Handle_closed>. The single parameter is the name of the function that you "
20306 #: ../ocaml/examples/guestfs-ocaml.pod:80
20308 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-perl(3)"
20309 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20310 "libguestfs.org/>, L<http://caml.inria.fr/>."
20314 #: ../perl/examples/guestfs-perl.pod:5
20315 msgid "guestfs-perl - How to use libguestfs from Perl"
20319 #: ../perl/examples/guestfs-perl.pod:9
20322 " use Sys::Guestfs;\n"
20327 #: ../perl/examples/guestfs-perl.pod:11
20330 " my $h = Sys::Guestfs->new ();\n"
20331 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
20332 " $h->launch ();\n"
20333 " $h->mount_options ('', '/dev/sda1', '/');\n"
20334 " $h->touch ('/hello');\n"
20340 #: ../perl/examples/guestfs-perl.pod:20
20342 "This manual page documents how to call libguestfs from the Perl programming "
20343 "language. This page just documents the differences from the C API and gives "
20344 "some examples. If you are not familiar with using libguestfs, you also need "
20345 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
20349 #: ../perl/examples/guestfs-perl.pod:26
20354 #: ../perl/examples/guestfs-perl.pod:28
20356 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
20361 #: ../perl/examples/guestfs-perl.pod:41
20363 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)"
20364 ">, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20365 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20369 #: ../python/examples/guestfs-python.pod:5
20370 msgid "guestfs-python - How to use libguestfs from Python"
20374 #: ../python/examples/guestfs-python.pod:9
20377 " import guestfs\n"
20378 " g = guestfs.GuestFS ()\n"
20379 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
20385 #: ../python/examples/guestfs-python.pod:16
20387 "This manual page documents how to call libguestfs from the Python "
20388 "programming language. This page just documents the differences from the C "
20389 "API and gives some examples. If you are not familiar with using libguestfs, "
20390 "you also need to read L<guestfs(3)>."
20394 #: ../python/examples/guestfs-python.pod:23
20396 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
20397 "single string argument which is the error message."
20401 #: ../python/examples/guestfs-python.pod:26
20402 msgid "MORE DOCUMENTATION"
20406 #: ../python/examples/guestfs-python.pod:28
20411 #: ../python/examples/guestfs-python.pod:30
20415 " >>> import guestfs\n"
20416 " >>> help (guestfs)\n"
20421 #: ../python/examples/guestfs-python.pod:44
20423 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
20424 ">, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20425 "libguestfs.org/>."
20429 #: ../rescue/virt-rescue.pod:5
20430 msgid "virt-rescue - Run a rescue shell on a virtual machine"
20434 #: ../rescue/virt-rescue.pod:9
20437 " virt-rescue [--options] -d domname\n"
20442 #: ../rescue/virt-rescue.pod:11
20445 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
20450 #: ../rescue/virt-rescue.pod:15
20453 " virt-rescue [--options] domname\n"
20458 #: ../rescue/virt-rescue.pod:17
20461 " virt-rescue [--options] disk.img [disk.img ...]\n"
20466 #: ../rescue/virt-rescue.pod:21
20468 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
20469 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
20470 "you from doing this, but doesn't catch all cases."
20474 #: ../rescue/virt-rescue.pod:25
20476 "However if you use the I<--ro> (read only) option, then you can attach a "
20477 "shell to a live virtual machine. The results might be strange or "
20478 "inconsistent at times but you won't get disk corruption."
20482 #: ../rescue/virt-rescue.pod:31
20484 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
20485 "need for a CD. virt-rescue gives you a rescue shell and some simple "
20486 "recovery tools which you can use to examine or rescue a virtual machine or "
20491 #: ../rescue/virt-rescue.pod:36
20493 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
20494 "on disk image(s):"
20498 #: ../rescue/virt-rescue.pod:39
20501 " virt-rescue -d GuestName\n"
20506 #: ../rescue/virt-rescue.pod:41
20509 " virt-rescue --ro -a /path/to/disk.img\n"
20514 #: ../rescue/virt-rescue.pod:43
20517 " virt-rescue -a /dev/sdc\n"
20522 #: ../rescue/virt-rescue.pod:45
20523 msgid "For live VMs you I<must> use the --ro option."
20527 #: ../rescue/virt-rescue.pod:47
20529 "When you run virt-rescue on a virtual machine or disk image, you are placed "
20530 "in an interactive bash shell where you can use many ordinary Linux "
20531 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
20532 "appliance. You must mount the virtual machine's filesystems by hand. There "
20533 "is an empty directory called C</sysroot> where you can mount filesystems."
20537 #: ../rescue/virt-rescue.pod:54
20539 "In the example below, we list logical volumes, then choose one to mount "
20540 "under C</sysroot>:"
20544 #: ../rescue/virt-rescue.pod:57
20548 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
20549 " lv_root vg_f11x64 -wi-a- 8.83G\n"
20550 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
20551 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
20552 " ><rescue> ls /sysroot\n"
20557 #: ../rescue/virt-rescue.pod:64
20559 "If you don't know what filesystems are available on the virtual machine then "
20560 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
20564 #: ../rescue/virt-rescue.pod:70
20566 "Virt-rescue can be used on I<any> disk image file or device, not just a "
20567 "virtual machine. For example you can use it on a blank file if you want to "
20568 "partition that file (although we would recommend using L<guestfish(1)> "
20569 "instead as it is more suitable for this purpose). You can even use virt-"
20570 "rescue on things like SD cards."
20574 #: ../rescue/virt-rescue.pod:76
20576 "Virt-rescue does not require root. You only need to run it as root if you "
20577 "need root to open the disk image."
20581 #: ../rescue/virt-rescue.pod:79
20583 "This tool is just designed for quick interactive hacking on a virtual "
20584 "machine. For more structured access to a virtual machine disk image, you "
20585 "should use L<guestfs(3)>. To get a structured shell that you can use to "
20586 "make scripted changes to guests, use L<guestfish(1)>."
20590 #: ../rescue/virt-rescue.pod:103
20591 msgid "B<--append kernelopts>"
20595 #: ../rescue/virt-rescue.pod:105
20596 msgid "Pass additional options to the rescue kernel."
20600 #: ../rescue/virt-rescue.pod:135
20603 " virt-rescue --format=raw -a disk.img\n"
20608 #: ../rescue/virt-rescue.pod:139
20611 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
20616 #: ../rescue/virt-rescue.pod:148
20621 #: ../rescue/virt-rescue.pod:150
20622 msgid "B<--memsize MB>"
20626 #: ../rescue/virt-rescue.pod:152
20628 "Change the amount of memory allocated to the rescue system. The default is "
20629 "set by libguestfs and is small but adequate for running system tools. The "
20630 "occasional program might need more memory. The parameter is specified in "
20635 #: ../rescue/virt-rescue.pod:157
20636 msgid "B<--network>"
20640 #: ../rescue/virt-rescue.pod:159
20641 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
20645 #: ../rescue/virt-rescue.pod:165
20646 msgid "Open the image read-only."
20650 #: ../rescue/virt-rescue.pod:175
20652 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
20653 "SELINUX> before using this option."
20657 #: ../rescue/virt-rescue.pod:194
20659 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
20660 "are done read-write."
20664 #: ../rescue/virt-rescue.pod:207
20665 msgid "Previous versions of virt-rescue allowed you to write either:"
20669 #: ../rescue/virt-rescue.pod:209
20672 " virt-rescue disk.img [disk.img ...]\n"
20677 #: ../rescue/virt-rescue.pod:213
20680 " virt-rescue guestname\n"
20685 #: ../rescue/virt-rescue.pod:221
20690 #: ../rescue/virt-rescue.pod:223
20692 "Adding the I<--network> option enables QEMU user networking in the rescue "
20693 "appliance. There are some differences between user networking and ordinary "
20698 #: ../rescue/virt-rescue.pod:229
20699 msgid "ping does not work"
20703 #: ../rescue/virt-rescue.pod:231
20705 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
20706 "send the ping packets, and because virt-rescue must be able to run as non-"
20707 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
20708 "The ping command will appear to resolve addresses but will not be able to "
20709 "send or receive any packets. This does not mean that the network is not "
20714 #: ../rescue/virt-rescue.pod:238
20715 msgid "cannot receive connections"
20719 #: ../rescue/virt-rescue.pod:240
20720 msgid "QEMU user networking cannot receive incoming connections."
20724 #: ../rescue/virt-rescue.pod:242
20725 msgid "making TCP connections"
20729 #: ../rescue/virt-rescue.pod:244
20731 "The virt-rescue appliance needs to be small and so does not include many "
20732 "network tools. In particular there is no L<telnet(1)> command. You can "
20733 "make TCP connections from the shell using the magical C</dev/tcp/"
20734 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
20738 #: ../rescue/virt-rescue.pod:249
20741 " exec 3<>/dev/tcp/redhat.com/80\n"
20742 " echo \"GET /\" >&3\n"
20748 #: ../rescue/virt-rescue.pod:253
20749 msgid "See L<bash(1)> for more details."
20753 #: ../rescue/virt-rescue.pod:259
20755 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
20756 "ENVIRONMENT VARIABLES> for the complete list."
20760 #: ../rescue/virt-rescue.pod:286
20762 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
20763 "libguestfs.org/>."
20767 #: ../resize/virt-resize.pod:5
20768 msgid "virt-resize - Resize a virtual machine disk"
20772 #: ../resize/virt-resize.pod:9
20775 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20776 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20777 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20782 #: ../resize/virt-resize.pod:15
20784 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20785 "larger or smaller overall, and resizing or deleting any partitions contained "
20790 #: ../resize/virt-resize.pod:19
20792 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20793 "not> be used on live virtual machines - for consistent results, shut the "
20794 "virtual machine down before resizing it."
20798 #: ../resize/virt-resize.pod:23
20800 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20801 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20805 #: ../resize/virt-resize.pod:31 ../src/guestfs.pod:469 ../src/guestfs.pod:1280
20806 #: ../src/guestfs.pod:1418 ../src/guestfs.pod:2581
20811 #: ../resize/virt-resize.pod:33
20813 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20814 "fill the extra 5GB of space."
20818 #: ../resize/virt-resize.pod:36
20821 " virt-filesystems --long -h --all -a olddisk\n"
20826 #: ../resize/virt-resize.pod:38
20829 " truncate -r olddisk newdisk\n"
20830 " truncate -s +5G newdisk\n"
20835 #: ../resize/virt-resize.pod:41
20838 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20839 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20844 #: ../resize/virt-resize.pod:44 ../src/guestfs.pod:475 ../src/guestfs.pod:1284
20845 #: ../src/guestfs.pod:1422 ../src/guestfs.pod:2606
20850 #: ../resize/virt-resize.pod:46
20852 "As above, but make the /boot partition 200MB bigger, while giving the "
20853 "remaining space to /dev/sda2:"
20857 #: ../resize/virt-resize.pod:49
20860 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20861 " olddisk newdisk\n"
20866 #: ../resize/virt-resize.pod:52 ../src/guestfs.pod:486 ../src/guestfs.pod:1428
20871 #: ../resize/virt-resize.pod:54
20873 "As in the first example, but expand a logical volume as the final step. "
20874 "This is what you would typically use for Linux guests that use LVM:"
20878 #: ../resize/virt-resize.pod:58
20881 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20882 " olddisk newdisk\n"
20887 #: ../resize/virt-resize.pod:61
20892 #: ../resize/virt-resize.pod:63
20894 "As in the first example, but the output format will be qcow2 instead of a "
20899 #: ../resize/virt-resize.pod:66
20902 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20903 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20908 #: ../resize/virt-resize.pod:71
20909 msgid "DETAILED USAGE"
20913 #: ../resize/virt-resize.pod:73
20914 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20918 #: ../resize/virt-resize.pod:77
20919 msgid "1. Shut down the virtual machine"
20923 #: ../resize/virt-resize.pod:79
20924 msgid "2. Locate input disk image"
20928 #: ../resize/virt-resize.pod:81
20930 "Locate the input disk image (ie. the file or device on the host containing "
20931 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20932 "dumpxml> like this to find the disk image name:"
20936 #: ../resize/virt-resize.pod:85
20939 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20940 " Found 1 nodes:\n"
20942 " <source dev=\"/dev/vg/lv_guest\" />\n"
20947 #: ../resize/virt-resize.pod:90
20948 msgid "3. Look at current sizing"
20952 #: ../resize/virt-resize.pod:92
20953 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20957 #: ../resize/virt-resize.pod:95
20960 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20961 " Name Type Size Parent\n"
20962 " /dev/sda1 partition 101M /dev/sda\n"
20963 " /dev/sda2 partition 7.9G /dev/sda\n"
20964 " /dev/sda device 8.0G -\n"
20969 #: ../resize/virt-resize.pod:101
20971 "(This example is a virtual machine with an 8 GB disk which we would like to "
20972 "expand up to 10 GB)."
20976 #: ../resize/virt-resize.pod:104
20977 msgid "4. Create output disk"
20981 #: ../resize/virt-resize.pod:106
20983 "Virt-resize cannot do in-place disk modifications. You have to have space "
20984 "to store the resized output disk."
20988 #: ../resize/virt-resize.pod:109
20990 "To store the resized disk image in a file, create a file of a suitable size:"
20994 #: ../resize/virt-resize.pod:112
20997 " # rm -f outdisk\n"
20998 " # truncate -s 10G outdisk\n"
21003 #: ../resize/virt-resize.pod:115
21004 msgid "Or use L<lvcreate(1)> to create a logical volume:"
21008 #: ../resize/virt-resize.pod:117
21011 " # lvcreate -L 10G -n lv_name vg_name\n"
21016 #: ../resize/virt-resize.pod:119
21017 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
21021 #: ../resize/virt-resize.pod:121
21024 " # virsh pool-list\n"
21025 " # virsh vol-create-as poolname newvol 10G\n"
21030 #: ../resize/virt-resize.pod:124
21035 #: ../resize/virt-resize.pod:126
21037 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
21038 "file) and the output disk. The output disk is the one created in the "
21043 #: ../resize/virt-resize.pod:130
21046 " # virt-resize indisk outdisk\n"
21051 #: ../resize/virt-resize.pod:132
21053 "This command just copies disk image C<indisk> to disk image C<outdisk> "
21054 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
21055 "larger, then an extra, empty partition is created at the end of the disk "
21056 "covering the extra space. If C<outdisk> is smaller, then it will give an "
21061 #: ../resize/virt-resize.pod:138
21063 "More realistically you'd want to expand existing partitions in the disk "
21064 "image by passing extra options (for the full list see the L</OPTIONS> "
21069 #: ../resize/virt-resize.pod:142
21071 "L</--expand> is the most useful option. It expands the named partition "
21072 "within the disk to fill any extra space:"
21076 #: ../resize/virt-resize.pod:145
21079 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
21084 #: ../resize/virt-resize.pod:147
21086 "(In this case, an extra partition is I<not> created at the end of the disk, "
21087 "because there will be no unused space)."
21091 #: ../resize/virt-resize.pod:150
21093 "L</--resize> is the other commonly used option. The following would "
21094 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
21095 "rest of the available space:"
21099 #: ../resize/virt-resize.pod:154
21102 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21103 " indisk outdisk\n"
21108 #: ../resize/virt-resize.pod:157
21110 "If the expanded partition in the image contains a filesystem or LVM PV, then "
21111 "if virt-resize knows how, it will resize the contents, the equivalent of "
21112 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
21113 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
21114 "filesystems, so you would have to online resize them after booting the guest."
21118 #: ../resize/virt-resize.pod:164
21119 msgid "Other options are covered below."
21123 #: ../resize/virt-resize.pod:166
21128 #: ../resize/virt-resize.pod:168
21129 msgid "Thoroughly test the new disk image I<before> discarding the old one."
21133 #: ../resize/virt-resize.pod:170
21134 msgid "If you are using libvirt, edit the XML to point at the new disk:"
21138 #: ../resize/virt-resize.pod:172
21141 " # virsh edit guestname\n"
21146 #: ../resize/virt-resize.pod:174
21148 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
21149 "html#elementsDisks>"
21153 #: ../resize/virt-resize.pod:177
21154 msgid "Then start up the domain with the new, resized disk:"
21158 #: ../resize/virt-resize.pod:179
21161 " # virsh start guestname\n"
21166 #: ../resize/virt-resize.pod:181
21168 "and check that it still works. See also the L</NOTES> section below for "
21169 "additional information."
21173 #: ../resize/virt-resize.pod:184
21174 msgid "7. Resize LVs etc inside the guest"
21178 #: ../resize/virt-resize.pod:186
21179 msgid "(This can also be done offline using L<guestfish(1)>)"
21183 #: ../resize/virt-resize.pod:188
21185 "Once the guest has booted you should see the new space available, at least "
21186 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
21187 "may need to resize LVs inside PVs, and also resize filesystem types that "
21188 "virt-resize does not know how to expand."
21192 #: ../resize/virt-resize.pod:195
21193 msgid "SHRINKING A VIRTUAL MACHINE DISK"
21197 #: ../resize/virt-resize.pod:197
21199 "Shrinking is somewhat more complex than expanding, and only an overview is "
21204 #: ../resize/virt-resize.pod:200
21206 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
21207 "filesystems). The user has to shrink content before passing the disk image "
21208 "to virt-resize, and virt-resize will check that the content has been shrunk "
21213 #: ../resize/virt-resize.pod:205
21214 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
21218 #: ../resize/virt-resize.pod:207
21220 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
21221 "steps 3 and 4 above to allocate a new disk image."
21225 #: ../resize/virt-resize.pod:210
21227 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
21231 #: ../resize/virt-resize.pod:213
21232 msgid "IGNORING OR DELETING PARTITIONS"
21236 #: ../resize/virt-resize.pod:215
21238 "virt-resize also gives a convenient way to ignore or delete partitions when "
21239 "copying from the input disk to the output disk. Ignoring a partition speeds "
21240 "up the copy where you don't care about the existing contents of a "
21241 "partition. Deleting a partition removes it completely, but note that it "
21242 "also renumbers any partitions after the one which is deleted, which can "
21243 "leave some guests unbootable."
21247 #: ../resize/virt-resize.pod:222
21248 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
21252 #: ../resize/virt-resize.pod:224
21254 "If the input disk is in qcow2 format, then you may prefer that the output is "
21255 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
21256 "the fly. The output format is simply determined by the format of the empty "
21257 "output container that you provide. Thus to create qcow2 output, use:"
21261 #: ../resize/virt-resize.pod:230
21264 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
21269 #: ../resize/virt-resize.pod:232
21270 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
21274 #: ../resize/virt-resize.pod:234
21275 msgid "Similarly, to get non-sparse raw output use:"
21279 #: ../resize/virt-resize.pod:236
21282 " fallocate -l size outdisk\n"
21287 #: ../resize/virt-resize.pod:238
21289 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
21290 "dev/zero of=outdisk bs=1M count=..>)"
21294 #: ../resize/virt-resize.pod:247
21295 msgid "Display help."
21299 #: ../resize/virt-resize.pod:249
21304 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
21305 #: ../tools/virt-win-reg.pl:120
21310 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
21311 msgid "Enable debugging messages."
21315 #: ../resize/virt-resize.pod:255
21316 msgid "B<--delete part>"
21320 #: ../resize/virt-resize.pod:257
21322 "Delete the named partition. It would be more accurate to describe this as "
21323 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
21324 "the original disk image is left intact."
21328 #: ../resize/virt-resize.pod:261
21330 "Note that when you delete a partition, then anything contained in the "
21331 "partition is also deleted. Furthermore, this causes any partitions that "
21332 "come after to be I<renumbered>, which can easily make your guest unbootable."
21336 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
21337 #: ../resize/virt-resize.pod:454
21338 msgid "You can give this option multiple times."
21342 #: ../resize/virt-resize.pod:268
21343 msgid "B<--expand part>"
21347 #: ../resize/virt-resize.pod:270
21349 "Expand the named partition so it uses up all extra space (space left over "
21350 "after any other resize changes that you request have been done)."
21354 #: ../resize/virt-resize.pod:273
21356 "If virt-resize knows how, it will expand the direct content of the "
21357 "partition. For example, if the partition is an LVM PV, it will expand the "
21358 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
21359 "content it doesn't know about alone."
21363 #: ../resize/virt-resize.pod:278
21364 msgid "Currently virt-resize can resize:"
21368 #: ../resize/virt-resize.pod:284
21369 msgid "ext2, ext3 and ext4 filesystems."
21373 #: ../resize/virt-resize.pod:288
21374 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
21378 #: ../resize/virt-resize.pod:290
21380 "The filesystem must have been shut down consistently last time it was used. "
21381 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
21382 "consistency check, so at the first boot after resizing Windows will check "
21387 #: ../resize/virt-resize.pod:297
21389 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
21390 "inside the PV, but see the I<--LV-expand> option. The user could also "
21391 "resize LVs as desired after boot."
21395 #: ../resize/virt-resize.pod:303
21396 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
21400 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
21401 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
21405 #: ../resize/virt-resize.pod:309 ../tools/virt-list-filesystems.pl:91
21406 #: ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141
21407 #: ../tools/virt-win-reg.pl:142
21408 msgid "B<--format> raw"
21412 #: ../resize/virt-resize.pod:311
21414 "Specify the format of the input disk image. If this flag is not given then "
21415 "it is auto-detected from the image itself."
21419 #: ../resize/virt-resize.pod:317
21421 "Note that this option I<does not> affect the output format. See L</QCOW2 "
21422 "AND NON-SPARSE RAW FORMATS>."
21426 #: ../resize/virt-resize.pod:320
21427 msgid "B<--ignore part>"
21431 #: ../resize/virt-resize.pod:322
21433 "Ignore the named partition. Effectively this means the partition is "
21434 "allocated on the destination disk, but the content is not copied across from "
21435 "the source disk. The content of the partition will be blank (all zero "
21440 #: ../resize/virt-resize.pod:329
21441 msgid "B<--LV-expand logvol>"
21445 #: ../resize/virt-resize.pod:331
21447 "This takes the logical volume and, as a final step, expands it to fill all "
21448 "the space available in its volume group. A typical usage, assuming a Linux "
21449 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
21450 "lv_root> would be:"
21454 #: ../resize/virt-resize.pod:336
21457 " virt-resize indisk outdisk \\\n"
21458 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
21463 #: ../resize/virt-resize.pod:339
21465 "This would first expand the partition (and PV), and then expand the root "
21466 "device to fill the extra space in the PV."
21470 #: ../resize/virt-resize.pod:342
21472 "The contents of the LV are also resized if virt-resize knows how to do "
21473 "that. You can stop virt-resize from trying to expand the content by using "
21474 "the option I<--no-expand-content>."
21478 #: ../resize/virt-resize.pod:346
21479 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
21483 #: ../resize/virt-resize.pod:348
21485 "You can give this option multiple times, I<but> it doesn't make sense to do "
21486 "this unless the logical volumes you specify are all in different volume "
21491 #: ../resize/virt-resize.pod:352
21492 msgid "B<--machine-readable>"
21496 #: ../resize/virt-resize.pod:354
21498 "This option is used to make the output more machine friendly when being "
21499 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
21503 #: ../resize/virt-resize.pod:360
21504 msgid "B<--dryrun>"
21508 #: ../resize/virt-resize.pod:362
21509 msgid "Print a summary of what would be done, but don't do anything."
21513 #: ../resize/virt-resize.pod:364
21514 msgid "B<--no-copy-boot-loader>"
21518 #: ../resize/virt-resize.pod:366
21520 "By default, virt-resize copies over some sectors at the start of the disk "
21521 "(up to the beginning of the first partition). Commonly these sectors "
21522 "contain the Master Boot Record (MBR) and the boot loader, and are required "
21523 "in order for the guest to boot correctly."
21527 #: ../resize/virt-resize.pod:371
21529 "If you specify this flag, then this initial copy is not done. You may need "
21530 "to reinstall the boot loader in this case."
21534 #: ../resize/virt-resize.pod:374
21535 msgid "B<--no-extra-partition>"
21539 #: ../resize/virt-resize.pod:376
21541 "By default, virt-resize creates an extra partition if there is any extra, "
21542 "unused space after all resizing has happened. Use this option to prevent "
21543 "the extra partition from being created. If you do this then the extra space "
21544 "will be inaccessible until you run fdisk, parted, or some other partitioning "
21545 "tool in the guest."
21549 #: ../resize/virt-resize.pod:382
21551 "Note that if the surplus space is smaller than 10 MB, no extra partition "
21556 #: ../resize/virt-resize.pod:385
21557 msgid "B<--no-expand-content>"
21561 #: ../resize/virt-resize.pod:387
21563 "By default, virt-resize will try to expand the direct contents of "
21564 "partitions, if it knows how (see I<--expand> option above)."
21568 #: ../resize/virt-resize.pod:390
21570 "If you give the I<--no-expand-content> option then virt-resize will not "
21575 #: ../resize/virt-resize.pod:393
21576 msgid "B<--ntfsresize-force>"
21580 #: ../resize/virt-resize.pod:395
21582 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
21583 "the NTFS disk is marked as needing a consistency check. You have to use "
21584 "this option if you want to resize a Windows guest multiple times without "
21585 "booting into Windows between each resize."
21589 #: ../resize/virt-resize.pod:401
21590 msgid "B<--output-format> raw"
21594 #: ../resize/virt-resize.pod:403
21596 "Specify the format of the output disk image. If this flag is not given then "
21597 "it is auto-detected from the image itself."
21601 #: ../resize/virt-resize.pod:409
21603 "Note that this option I<does not create> the output format. This option "
21604 "just tells libguestfs what it is so it doesn't try to guess it. You still "
21605 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
21606 "SPARSE RAW FORMATS>."
21610 #: ../resize/virt-resize.pod:414
21615 #: ../resize/virt-resize.pod:416
21620 #: ../resize/virt-resize.pod:418
21621 msgid "Don't print the summary."
21625 #: ../resize/virt-resize.pod:420
21626 msgid "B<--resize part=size>"
21630 #: ../resize/virt-resize.pod:422
21632 "Resize the named partition (expanding or shrinking it) so that it has the "
21637 #: ../resize/virt-resize.pod:425
21639 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
21640 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
21641 "size; or as a relative number or percentage. For example:"
21645 #: ../resize/virt-resize.pod:431
21648 " --resize /dev/sda2=10G\n"
21653 #: ../resize/virt-resize.pod:433
21656 " --resize /dev/sda4=90%\n"
21661 #: ../resize/virt-resize.pod:435
21664 " --resize /dev/sda2=+1G\n"
21669 #: ../resize/virt-resize.pod:437
21672 " --resize /dev/sda2=-200M\n"
21677 #: ../resize/virt-resize.pod:439
21680 " --resize /dev/sda1=+128K\n"
21685 #: ../resize/virt-resize.pod:441
21688 " --resize /dev/sda1=+10%\n"
21693 #: ../resize/virt-resize.pod:443
21696 " --resize /dev/sda1=-10%\n"
21701 #: ../resize/virt-resize.pod:445
21703 "You can increase the size of any partition. Virt-resize will expand the "
21704 "direct content of the partition if it knows how (see I<--expand> below)."
21708 #: ../resize/virt-resize.pod:449
21710 "You can only I<decrease> the size of partitions that contain filesystems or "
21711 "PVs which have already been shrunk. Virt-resize will check this has been "
21712 "done before proceeding, or else will print an error (see also I<--resize-"
21717 #: ../resize/virt-resize.pod:456
21718 msgid "B<--resize-force part=size>"
21722 #: ../resize/virt-resize.pod:458
21724 "This is the same as I<--resize> except that it will let you decrease the "
21725 "size of any partition. Generally this means you will lose any data which "
21726 "was at the end of the partition you shrink, but you may not care about that "
21727 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
21728 "as a swap partition)."
21732 #: ../resize/virt-resize.pod:464
21733 msgid "See also the I<--ignore> option."
21737 #: ../resize/virt-resize.pod:466
21738 msgid "B<--shrink part>"
21742 #: ../resize/virt-resize.pod:468
21744 "Shrink the named partition until the overall disk image fits in the "
21745 "destination. The named partition B<must> contain a filesystem or PV which "
21746 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
21747 "online tools). Virt-resize will check this and give an error if it has not "
21752 #: ../resize/virt-resize.pod:474
21754 "The amount by which the overall disk must be shrunk (after carrying out all "
21755 "other operations requested by the user) is called the \"deficit\". For "
21756 "example, a straight copy (assume no other operations) from a 5GB disk image "
21757 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
21758 "would give an error unless the user specified a partition to shrink and that "
21759 "partition had more than a gigabyte of free space."
21763 #: ../resize/virt-resize.pod:492
21764 msgid "MACHINE READABLE OUTPUT"
21768 #: ../resize/virt-resize.pod:494
21770 "The I<--machine-readable> option can be used to make the output more machine "
21771 "friendly, which is useful when calling virt-resize from other programs, GUIs "
21776 #: ../resize/virt-resize.pod:498
21778 "Use the option on its own to query the capabilities of the virt-resize "
21779 "binary. Typical output looks like this:"
21783 #: ../resize/virt-resize.pod:501
21786 " $ virt-resize --machine-readable\n"
21788 " ntfsresize-force\n"
21796 #: ../resize/virt-resize.pod:508
21798 "A list of features is printed, one per line, and the program exits with "
21803 #: ../resize/virt-resize.pod:513
21804 msgid "\"Partition 1 does not end on cylinder boundary.\""
21808 #: ../resize/virt-resize.pod:515
21810 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
21811 "means the partitions will not be aligned to the ancient CHS geometry. "
21812 "However CHS geometry is meaningless for disks manufactured since the early "
21813 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
21814 "cylinders is not required by any modern operating system."
21818 #: ../resize/virt-resize.pod:522
21819 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
21823 #: ../resize/virt-resize.pod:524
21825 "In Windows Vista and later versions, Microsoft switched to using a separate "
21826 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
21827 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
21828 "the boot partition. Doing so seems to break the guest completely. However "
21829 "expanding the second partition (ie. C: drive) should work."
21833 #: ../resize/virt-resize.pod:531
21835 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21836 "NTFS partitions have been expanded. This is just a safety check and (unless "
21837 "it find errors) is nothing to worry about."
21841 #: ../resize/virt-resize.pod:535
21842 msgid "GUEST BOOT STUCK AT \"GRUB\""
21846 #: ../resize/virt-resize.pod:537
21848 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21849 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21850 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21851 "although we think is to do with partition alignment."
21855 #: ../resize/virt-resize.pod:542
21858 " guestfish -i -a newdisk\n"
21859 " ><fs> cat /boot/grub/device.map\n"
21860 " # check the contents of this file are sensible or\n"
21861 " # edit the file if necessary\n"
21862 " ><fs> grub-install / /dev/vda\n"
21868 #: ../resize/virt-resize.pod:549
21870 "For more flexible guest reconfiguration, including if you need to specify "
21871 "other parameters to grub-install, use L<virt-rescue(1)>."
21875 #: ../resize/virt-resize.pod:552
21876 msgid "ALTERNATIVE TOOLS"
21880 #: ../resize/virt-resize.pod:554
21882 "There are several proprietary tools for resizing partitions. We won't "
21883 "mention any here."
21887 #: ../resize/virt-resize.pod:557
21889 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21890 "operations on disk images. They can resize and move partitions, but I don't "
21891 "think they can do anything with the contents, and they certainly don't "
21896 #: ../resize/virt-resize.pod:562
21898 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21899 "but at a much lower level. You will probably end up hand-calculating sector "
21900 "offsets, which is something that virt-resize was designed to avoid. If you "
21901 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21906 #: ../resize/virt-resize.pod:582
21908 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
21909 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
21910 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
21911 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<http://libguestfs.org/>."
21915 #: ../ruby/examples/guestfs-ruby.pod:5
21916 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21920 #: ../ruby/examples/guestfs-ruby.pod:9
21923 " require 'guestfs'\n"
21924 " g = Guestfs::Guestfs.new()\n"
21925 " g.add_drive_opts(\"disk.img\",\n"
21926 " :readonly => 1, :format => \"raw\")\n"
21932 #: ../ruby/examples/guestfs-ruby.pod:17
21934 "This manual page documents how to call libguestfs from the Ruby programming "
21935 "language. This page just documents the differences from the C API and gives "
21936 "some examples. If you are not familiar with using libguestfs, you also need "
21937 "to read L<guestfs(3)>."
21941 #: ../ruby/examples/guestfs-ruby.pod:24
21943 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21944 "This has a single parameter which is the error message (a string)."
21948 #: ../ruby/examples/guestfs-ruby.pod:38
21950 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
21951 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://"
21952 "libguestfs.org/>."
21956 #: ../src/guestfs-actions.pod:1
21957 msgid "guestfs_add_cdrom"
21961 #: ../src/guestfs-actions.pod:3
21965 " guestfs_add_cdrom (guestfs_h *g,\n"
21966 " const char *filename);\n"
21971 #: ../src/guestfs-actions.pod:17
21973 "This call checks for the existence of C<filename>. This stops you from "
21974 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21975 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21980 #: ../src/guestfs-actions.pod:24
21982 "If you just want to add an ISO file (often you use this as an efficient way "
21983 "to transfer large files into the guest), then you should probably use "
21984 "C<guestfs_add_drive_ro> instead."
21988 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:140
21989 #: ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238
21990 #: ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273
21991 #: ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307
21992 #: ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447
21993 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506
21994 #: ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552
21995 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652
21996 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681
21997 #: ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798
21998 #: ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826
21999 #: ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046
22000 #: ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084
22001 #: ../src/guestfs-actions.pod:1168 ../src/guestfs-actions.pod:1186
22002 #: ../src/guestfs-actions.pod:1205 ../src/guestfs-actions.pod:1219
22003 #: ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1309
22004 #: ../src/guestfs-actions.pod:1340 ../src/guestfs-actions.pod:1365
22005 #: ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1513
22006 #: ../src/guestfs-actions.pod:1547 ../src/guestfs-actions.pod:1762
22007 #: ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1871
22008 #: ../src/guestfs-actions.pod:2368 ../src/guestfs-actions.pod:2512
22009 #: ../src/guestfs-actions.pod:2573 ../src/guestfs-actions.pod:2608
22010 #: ../src/guestfs-actions.pod:3648 ../src/guestfs-actions.pod:3663
22011 #: ../src/guestfs-actions.pod:3688 ../src/guestfs-actions.pod:3877
22012 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3904
22013 #: ../src/guestfs-actions.pod:3918 ../src/guestfs-actions.pod:3933
22014 #: ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:4041
22015 #: ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4078
22016 #: ../src/guestfs-actions.pod:4101 ../src/guestfs-actions.pod:4124
22017 #: ../src/guestfs-actions.pod:4159 ../src/guestfs-actions.pod:4178
22018 #: ../src/guestfs-actions.pod:4197 ../src/guestfs-actions.pod:4232
22019 #: ../src/guestfs-actions.pod:4244 ../src/guestfs-actions.pod:4280
22020 #: ../src/guestfs-actions.pod:4296 ../src/guestfs-actions.pod:4309
22021 #: ../src/guestfs-actions.pod:4324 ../src/guestfs-actions.pod:4341
22022 #: ../src/guestfs-actions.pod:4434 ../src/guestfs-actions.pod:4454
22023 #: ../src/guestfs-actions.pod:4467 ../src/guestfs-actions.pod:4518
22024 #: ../src/guestfs-actions.pod:4536 ../src/guestfs-actions.pod:4554
22025 #: ../src/guestfs-actions.pod:4570 ../src/guestfs-actions.pod:4584
22026 #: ../src/guestfs-actions.pod:4598 ../src/guestfs-actions.pod:4615
22027 #: ../src/guestfs-actions.pod:4630 ../src/guestfs-actions.pod:4650
22028 #: ../src/guestfs-actions.pod:4720 ../src/guestfs-actions.pod:4793
22029 #: ../src/guestfs-actions.pod:4824 ../src/guestfs-actions.pod:4843
22030 #: ../src/guestfs-actions.pod:4862 ../src/guestfs-actions.pod:4874
22031 #: ../src/guestfs-actions.pod:4891 ../src/guestfs-actions.pod:4904
22032 #: ../src/guestfs-actions.pod:4919 ../src/guestfs-actions.pod:4934
22033 #: ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:5002
22034 #: ../src/guestfs-actions.pod:5041 ../src/guestfs-actions.pod:5061
22035 #: ../src/guestfs-actions.pod:5075 ../src/guestfs-actions.pod:5092
22036 #: ../src/guestfs-actions.pod:5141 ../src/guestfs-actions.pod:5187
22037 #: ../src/guestfs-actions.pod:5241 ../src/guestfs-actions.pod:5277
22038 #: ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5329
22039 #: ../src/guestfs-actions.pod:5347 ../src/guestfs-actions.pod:5487
22040 #: ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5566
22041 #: ../src/guestfs-actions.pod:5584 ../src/guestfs-actions.pod:5616
22042 #: ../src/guestfs-actions.pod:5682 ../src/guestfs-actions.pod:5699
22043 #: ../src/guestfs-actions.pod:5712 ../src/guestfs-actions.pod:5726
22044 #: ../src/guestfs-actions.pod:6015 ../src/guestfs-actions.pod:6034
22045 #: ../src/guestfs-actions.pod:6053 ../src/guestfs-actions.pod:6067
22046 #: ../src/guestfs-actions.pod:6079 ../src/guestfs-actions.pod:6093
22047 #: ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6119
22048 #: ../src/guestfs-actions.pod:6135 ../src/guestfs-actions.pod:6156
22049 #: ../src/guestfs-actions.pod:6175 ../src/guestfs-actions.pod:6194
22050 #: ../src/guestfs-actions.pod:6224 ../src/guestfs-actions.pod:6242
22051 #: ../src/guestfs-actions.pod:6265 ../src/guestfs-actions.pod:6283
22052 #: ../src/guestfs-actions.pod:6302 ../src/guestfs-actions.pod:6323
22053 #: ../src/guestfs-actions.pod:6342 ../src/guestfs-actions.pod:6359
22054 #: ../src/guestfs-actions.pod:6378 ../src/guestfs-actions.pod:6406
22055 #: ../src/guestfs-actions.pod:6430 ../src/guestfs-actions.pod:6449
22056 #: ../src/guestfs-actions.pod:6473 ../src/guestfs-actions.pod:6492
22057 #: ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:6526
22058 #: ../src/guestfs-actions.pod:6563 ../src/guestfs-actions.pod:6593
22059 #: ../src/guestfs-actions.pod:6626 ../src/guestfs-actions.pod:6748
22060 #: ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:6881
22061 #: ../src/guestfs-actions.pod:6894 ../src/guestfs-actions.pod:6907
22062 #: ../src/guestfs-actions.pod:6929 ../src/guestfs-actions.pod:6942
22063 #: ../src/guestfs-actions.pod:6955 ../src/guestfs-actions.pod:6968
22064 #: ../src/guestfs-actions.pod:6983 ../src/guestfs-actions.pod:7042
22065 #: ../src/guestfs-actions.pod:7059 ../src/guestfs-actions.pod:7075
22066 #: ../src/guestfs-actions.pod:7091 ../src/guestfs-actions.pod:7108
22067 #: ../src/guestfs-actions.pod:7121 ../src/guestfs-actions.pod:7141
22068 #: ../src/guestfs-actions.pod:7177 ../src/guestfs-actions.pod:7191
22069 #: ../src/guestfs-actions.pod:7232 ../src/guestfs-actions.pod:7245
22070 #: ../src/guestfs-actions.pod:7263 ../src/guestfs-actions.pod:7297
22071 #: ../src/guestfs-actions.pod:7333 ../src/guestfs-actions.pod:7449
22072 #: ../src/guestfs-actions.pod:7464 ../src/guestfs-actions.pod:7478
22073 #: ../src/guestfs-actions.pod:7533 ../src/guestfs-actions.pod:7546
22074 #: ../src/guestfs-actions.pod:7591 ../src/guestfs-actions.pod:7624
22075 #: ../src/guestfs-actions.pod:7687 ../src/guestfs-actions.pod:7707
22076 #: ../src/guestfs-actions.pod:7733 ../src/guestfs-actions.pod:7804
22077 #: ../src/guestfs-actions.pod:7827 ../src/guestfs-actions.pod:7856
22078 msgid "This function returns 0 on success or -1 on error."
22082 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:254
22083 #: ../src/guestfs-actions.pod:275
22085 "This function is deprecated. In new code, use the L</"
22086 "guestfs_add_drive_opts> call instead."
22090 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
22091 #: ../src/guestfs-actions.pod:1170 ../src/guestfs-actions.pod:1985
22092 #: ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2197
22093 #: ../src/guestfs-actions.pod:3650 ../src/guestfs-actions.pod:3670
22094 #: ../src/guestfs-actions.pod:4978 ../src/guestfs-actions.pod:6244
22095 #: ../src/guestfs-actions.pod:6361 ../src/guestfs-actions.pod:6494
22096 #: ../src/guestfs-actions.pod:6985 ../src/guestfs-actions.pod:7110
22097 #: ../src/guestfs-actions.pod:7633
22098 msgid "(Added in 0.3)"
22102 #: ../src/guestfs-actions.pod:41
22103 msgid "guestfs_add_domain"
22107 #: ../src/guestfs-actions.pod:43
22111 " guestfs_add_domain (guestfs_h *g,\n"
22112 " const char *dom,\n"
22118 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
22119 #: ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:2853
22120 #: ../src/guestfs-actions.pod:4669 ../src/guestfs-actions.pod:4988
22121 #: ../src/guestfs-actions.pod:5205
22123 "You may supply a list of optional arguments to this call. Use zero or more "
22124 "of the following pairs of parameters, and terminate the list with C<-1> on "
22125 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
22129 #: ../src/guestfs-actions.pod:53
22132 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
22133 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
22134 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
22135 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
22136 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
22141 #: ../src/guestfs-actions.pod:59
22143 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
22144 "It works by connecting to libvirt, requesting the domain and domain XML from "
22145 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
22150 #: ../src/guestfs-actions.pod:94
22152 "The other optional parameters are passed directly through to "
22153 "C<guestfs_add_drive_opts>."
22157 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350
22158 #: ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698
22159 #: ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747
22160 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1385
22161 #: ../src/guestfs-actions.pod:1741 ../src/guestfs-actions.pod:1944
22162 #: ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2106
22163 #: ../src/guestfs-actions.pod:2161 ../src/guestfs-actions.pod:2184
22164 #: ../src/guestfs-actions.pod:2499 ../src/guestfs-actions.pod:2971
22165 #: ../src/guestfs-actions.pod:2989 ../src/guestfs-actions.pod:5164
22166 #: ../src/guestfs-actions.pod:5384 ../src/guestfs-actions.pod:5796
22167 #: ../src/guestfs-actions.pod:5822 ../src/guestfs-actions.pod:7218
22168 #: ../src/guestfs-actions.pod:7644 ../src/guestfs-actions.pod:7657
22169 #: ../src/guestfs-actions.pod:7670
22170 msgid "On error this function returns -1."
22174 #: ../src/guestfs-actions.pod:99
22175 msgid "(Added in 1.7.4)"
22179 #: ../src/guestfs-actions.pod:101
22180 msgid "guestfs_add_domain_va"
22184 #: ../src/guestfs-actions.pod:103
22188 " guestfs_add_domain_va (guestfs_h *g,\n"
22189 " const char *dom,\n"
22190 " va_list args);\n"
22195 #: ../src/guestfs-actions.pod:108
22196 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
22200 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
22201 #: ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225
22202 #: ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887
22203 #: ../src/guestfs-actions.pod:2937 ../src/guestfs-actions.pod:2949
22204 #: ../src/guestfs-actions.pod:4734 ../src/guestfs-actions.pod:4746
22205 #: ../src/guestfs-actions.pod:5016 ../src/guestfs-actions.pod:5028
22206 #: ../src/guestfs-actions.pod:5254 ../src/guestfs-actions.pod:5265
22207 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
22211 #: ../src/guestfs-actions.pod:112
22212 msgid "guestfs_add_domain_argv"
22216 #: ../src/guestfs-actions.pod:114
22220 " guestfs_add_domain_argv (guestfs_h *g,\n"
22221 " const char *dom,\n"
22222 " const struct guestfs_add_domain_argv *optargs);\n"
22227 #: ../src/guestfs-actions.pod:119
22228 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
22232 #: ../src/guestfs-actions.pod:123
22233 msgid "guestfs_add_drive"
22237 #: ../src/guestfs-actions.pod:125
22241 " guestfs_add_drive (guestfs_h *g,\n"
22242 " const char *filename);\n"
22247 #: ../src/guestfs-actions.pod:129
22249 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
22250 "optional parameters, so the disk is added writable, with the format being "
22251 "detected automatically."
22255 #: ../src/guestfs-actions.pod:133
22257 "Automatic detection of the format opens you up to a potential security hole "
22258 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
22259 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
22260 "you should think about replacing calls to this function with calls to "
22261 "C<guestfs_add_drive_opts>, and specifying the format."
22265 #: ../src/guestfs-actions.pod:144
22266 msgid "guestfs_add_drive_opts"
22270 #: ../src/guestfs-actions.pod:146
22274 " guestfs_add_drive_opts (guestfs_h *g,\n"
22275 " const char *filename,\n"
22281 #: ../src/guestfs-actions.pod:156
22284 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
22285 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
22286 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
22291 #: ../src/guestfs-actions.pod:185
22293 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
22294 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
22295 "Possible formats include C<raw> and C<qcow2>."
22299 #: ../src/guestfs-actions.pod:196
22301 "This rarely-used option lets you emulate the behaviour of the deprecated "
22302 "C<guestfs_add_drive_with_if> call (q.v.)"
22306 #: ../src/guestfs-actions.pod:203
22307 msgid "(Added in 1.5.23)"
22311 #: ../src/guestfs-actions.pod:205
22312 msgid "guestfs_add_drive_opts_va"
22316 #: ../src/guestfs-actions.pod:207
22320 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
22321 " const char *filename,\n"
22322 " va_list args);\n"
22327 #: ../src/guestfs-actions.pod:212
22328 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
22332 #: ../src/guestfs-actions.pod:216
22333 msgid "guestfs_add_drive_opts_argv"
22337 #: ../src/guestfs-actions.pod:218
22341 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
22342 " const char *filename,\n"
22343 " const struct guestfs_add_drive_opts_argv *optargs);\n"
22348 #: ../src/guestfs-actions.pod:223
22349 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
22353 #: ../src/guestfs-actions.pod:227
22354 msgid "guestfs_add_drive_ro"
22358 #: ../src/guestfs-actions.pod:229
22362 " guestfs_add_drive_ro (guestfs_h *g,\n"
22363 " const char *filename);\n"
22368 #: ../src/guestfs-actions.pod:233
22370 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
22371 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
22372 "disk is added read-only, with the format being detected automatically."
22376 #: ../src/guestfs-actions.pod:240
22377 msgid "(Added in 1.0.38)"
22381 #: ../src/guestfs-actions.pod:242
22382 msgid "guestfs_add_drive_ro_with_if"
22386 #: ../src/guestfs-actions.pod:244
22390 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
22391 " const char *filename,\n"
22392 " const char *iface);\n"
22397 #: ../src/guestfs-actions.pod:249
22399 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
22400 "QEMU interface emulation to use at run time."
22404 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282
22405 #: ../src/guestfs-actions.pod:2458
22406 msgid "(Added in 1.0.84)"
22410 #: ../src/guestfs-actions.pod:263
22411 msgid "guestfs_add_drive_with_if"
22415 #: ../src/guestfs-actions.pod:265
22419 " guestfs_add_drive_with_if (guestfs_h *g,\n"
22420 " const char *filename,\n"
22421 " const char *iface);\n"
22426 #: ../src/guestfs-actions.pod:270
22428 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
22429 "QEMU interface emulation to use at run time."
22433 #: ../src/guestfs-actions.pod:284
22434 msgid "guestfs_aug_clear"
22438 #: ../src/guestfs-actions.pod:286
22442 " guestfs_aug_clear (guestfs_h *g,\n"
22443 " const char *augpath);\n"
22448 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2186
22449 msgid "(Added in 1.3.4)"
22453 #: ../src/guestfs-actions.pod:297
22454 msgid "guestfs_aug_close"
22458 #: ../src/guestfs-actions.pod:299
22462 " guestfs_aug_close (guestfs_h *g);\n"
22467 #: ../src/guestfs-actions.pod:302
22469 "Close the current Augeas handle and free up any resources used by it. After "
22470 "calling this, you have to call C<guestfs_aug_init> again before you can use "
22471 "any other Augeas functions."
22475 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334
22476 #: ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366
22477 #: ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449
22478 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494
22479 #: ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522
22480 #: ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554
22481 #: ../src/guestfs-actions.pod:5873
22482 msgid "(Added in 0.7)"
22486 #: ../src/guestfs-actions.pod:311
22487 msgid "guestfs_aug_defnode"
22491 #: ../src/guestfs-actions.pod:313
22494 " struct guestfs_int_bool *\n"
22495 " guestfs_aug_defnode (guestfs_h *g,\n"
22496 " const char *name,\n"
22497 " const char *expr,\n"
22498 " const char *val);\n"
22503 #: ../src/guestfs-actions.pod:322
22505 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
22506 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
22507 "containing that single node."
22511 #: ../src/guestfs-actions.pod:330
22513 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
22514 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
22518 #: ../src/guestfs-actions.pod:336
22519 msgid "guestfs_aug_defvar"
22523 #: ../src/guestfs-actions.pod:338
22527 " guestfs_aug_defvar (guestfs_h *g,\n"
22528 " const char *name,\n"
22529 " const char *expr);\n"
22534 #: ../src/guestfs-actions.pod:354
22535 msgid "guestfs_aug_get"
22539 #: ../src/guestfs-actions.pod:356
22543 " guestfs_aug_get (guestfs_h *g,\n"
22544 " const char *augpath);\n"
22549 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927
22550 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005
22551 #: ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124
22552 #: ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1271
22553 #: ../src/guestfs-actions.pod:1290 ../src/guestfs-actions.pod:1424
22554 #: ../src/guestfs-actions.pod:1612 ../src/guestfs-actions.pod:1724
22555 #: ../src/guestfs-actions.pod:1887 ../src/guestfs-actions.pod:1904
22556 #: ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:2007
22557 #: ../src/guestfs-actions.pod:2028 ../src/guestfs-actions.pod:2209
22558 #: ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2627
22559 #: ../src/guestfs-actions.pod:2717 ../src/guestfs-actions.pod:2821
22560 #: ../src/guestfs-actions.pod:2840 ../src/guestfs-actions.pod:3054
22561 #: ../src/guestfs-actions.pod:3082 ../src/guestfs-actions.pod:3103
22562 #: ../src/guestfs-actions.pod:3137 ../src/guestfs-actions.pod:3196
22563 #: ../src/guestfs-actions.pod:3216 ../src/guestfs-actions.pod:3236
22564 #: ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:4216
22565 #: ../src/guestfs-actions.pod:4386 ../src/guestfs-actions.pod:4496
22566 #: ../src/guestfs-actions.pod:5402 ../src/guestfs-actions.pod:5601
22567 #: ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5949
22568 #: ../src/guestfs-actions.pod:5998 ../src/guestfs-actions.pod:6654
22569 #: ../src/guestfs-actions.pod:6670 ../src/guestfs-actions.pod:6687
22570 #: ../src/guestfs-actions.pod:6718 ../src/guestfs-actions.pod:7392
22571 #: ../src/guestfs-actions.pod:7411 ../src/guestfs-actions.pod:7429
22572 #: ../src/guestfs-actions.pod:7603 ../src/guestfs-actions.pod:7913
22574 "This function returns a string, or NULL on error. I<The caller must free "
22575 "the returned string after use>."
22579 #: ../src/guestfs-actions.pod:368
22580 msgid "guestfs_aug_init"
22584 #: ../src/guestfs-actions.pod:370
22588 " guestfs_aug_init (guestfs_h *g,\n"
22589 " const char *root,\n"
22595 #: ../src/guestfs-actions.pod:379
22596 msgid "You must call this before using any other C<guestfs_aug_*> commands."
22600 #: ../src/guestfs-actions.pod:404
22602 "This option is only useful when debugging Augeas lenses. Use of this option "
22603 "may require additional memory for the libguestfs appliance. You may need to "
22604 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
22605 "C<guestfs_set_memsize>."
22609 #: ../src/guestfs-actions.pod:419
22610 msgid "Do not load the tree in C<guestfs_aug_init>."
22614 #: ../src/guestfs-actions.pod:423
22615 msgid "To close the handle, you can call C<guestfs_aug_close>."
22619 #: ../src/guestfs-actions.pod:431
22620 msgid "guestfs_aug_insert"
22624 #: ../src/guestfs-actions.pod:433
22628 " guestfs_aug_insert (guestfs_h *g,\n"
22629 " const char *augpath,\n"
22630 " const char *label,\n"
22636 #: ../src/guestfs-actions.pod:451
22637 msgid "guestfs_aug_load"
22641 #: ../src/guestfs-actions.pod:453
22645 " guestfs_aug_load (guestfs_h *g);\n"
22650 #: ../src/guestfs-actions.pod:465
22651 msgid "guestfs_aug_ls"
22655 #: ../src/guestfs-actions.pod:467
22659 " guestfs_aug_ls (guestfs_h *g,\n"
22660 " const char *augpath);\n"
22665 #: ../src/guestfs-actions.pod:471
22667 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
22668 "sorting the resulting nodes into alphabetical order."
22672 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490
22673 #: ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143
22674 #: ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1458
22675 #: ../src/guestfs-actions.pod:1561 ../src/guestfs-actions.pod:1580
22676 #: ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:2281
22677 #: ../src/guestfs-actions.pod:2297 ../src/guestfs-actions.pod:2316
22678 #: ../src/guestfs-actions.pod:2381 ../src/guestfs-actions.pod:2405
22679 #: ../src/guestfs-actions.pod:2476 ../src/guestfs-actions.pod:2525
22680 #: ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:3156
22681 #: ../src/guestfs-actions.pod:3432 ../src/guestfs-actions.pod:3746
22682 #: ../src/guestfs-actions.pod:3763 ../src/guestfs-actions.pod:3783
22683 #: ../src/guestfs-actions.pod:3845 ../src/guestfs-actions.pod:3950
22684 #: ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:5125
22685 #: ../src/guestfs-actions.pod:5743 ../src/guestfs-actions.pod:5869
22686 #: ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6734
22687 #: ../src/guestfs-actions.pod:6795 ../src/guestfs-actions.pod:6850
22688 #: ../src/guestfs-actions.pod:6996 ../src/guestfs-actions.pod:7020
22689 #: ../src/guestfs-actions.pod:7496 ../src/guestfs-actions.pod:7516
22690 #: ../src/guestfs-actions.pod:7563 ../src/guestfs-actions.pod:7757
22691 #: ../src/guestfs-actions.pod:7776 ../src/guestfs-actions.pod:7870
22692 #: ../src/guestfs-actions.pod:7889 ../src/guestfs-actions.pod:7935
22693 #: ../src/guestfs-actions.pod:7954
22695 "This function returns a NULL-terminated array of strings (like L<environ(3)"
22696 ">), or NULL if there was an error. I<The caller must free the strings and "
22697 "the array after use>."
22701 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068
22702 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1496
22703 #: ../src/guestfs-actions.pod:3510 ../src/guestfs-actions.pod:3541
22704 #: ../src/guestfs-actions.pod:4199 ../src/guestfs-actions.pod:4249
22705 #: ../src/guestfs-actions.pod:4436 ../src/guestfs-actions.pod:4469
22706 #: ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:5129
22707 #: ../src/guestfs-actions.pod:5684 ../src/guestfs-actions.pod:6081
22708 #: ../src/guestfs-actions.pod:6095 ../src/guestfs-actions.pod:6107
22709 #: ../src/guestfs-actions.pod:6575 ../src/guestfs-actions.pod:7234
22710 #: ../src/guestfs-actions.pod:7247 ../src/guestfs-actions.pod:7480
22711 #: ../src/guestfs-actions.pod:7745
22712 msgid "(Added in 0.8)"
22716 #: ../src/guestfs-actions.pod:480
22717 msgid "guestfs_aug_match"
22721 #: ../src/guestfs-actions.pod:482
22725 " guestfs_aug_match (guestfs_h *g,\n"
22726 " const char *augpath);\n"
22731 #: ../src/guestfs-actions.pod:496
22732 msgid "guestfs_aug_mv"
22736 #: ../src/guestfs-actions.pod:498
22740 " guestfs_aug_mv (guestfs_h *g,\n"
22741 " const char *src,\n"
22742 " const char *dest);\n"
22747 #: ../src/guestfs-actions.pod:510
22748 msgid "guestfs_aug_rm"
22752 #: ../src/guestfs-actions.pod:512
22756 " guestfs_aug_rm (guestfs_h *g,\n"
22757 " const char *augpath);\n"
22762 #: ../src/guestfs-actions.pod:524
22763 msgid "guestfs_aug_save"
22767 #: ../src/guestfs-actions.pod:526
22771 " guestfs_aug_save (guestfs_h *g);\n"
22776 #: ../src/guestfs-actions.pod:531
22778 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
22783 #: ../src/guestfs-actions.pod:538
22784 msgid "guestfs_aug_set"
22788 #: ../src/guestfs-actions.pod:540
22792 " guestfs_aug_set (guestfs_h *g,\n"
22793 " const char *augpath,\n"
22794 " const char *val);\n"
22799 #: ../src/guestfs-actions.pod:547
22801 "In the Augeas API, it is possible to clear a node by setting the value to "
22802 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
22803 "this call. Instead you must use the C<guestfs_aug_clear> call."
22807 #: ../src/guestfs-actions.pod:556
22808 msgid "guestfs_available"
22812 #: ../src/guestfs-actions.pod:558
22816 " guestfs_available (guestfs_h *g,\n"
22817 " char *const *groups);\n"
22822 #: ../src/guestfs-actions.pod:566
22824 "The libguestfs groups, and the functions that those groups correspond to, "
22825 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
22826 "runtime by calling C<guestfs_available_all_groups>."
22830 #: ../src/guestfs-actions.pod:590
22831 msgid "You must call C<guestfs_launch> before calling this function."
22835 #: ../src/guestfs-actions.pod:612
22837 "This call was added in version C<1.0.80>. In previous versions of "
22838 "libguestfs all you could do would be to speculatively execute a command to "
22839 "find out if the daemon implemented it. See also C<guestfs_version>."
22843 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1241
22844 msgid "(Added in 1.0.80)"
22848 #: ../src/guestfs-actions.pod:623
22849 msgid "guestfs_available_all_groups"
22853 #: ../src/guestfs-actions.pod:625
22857 " guestfs_available_all_groups (guestfs_h *g);\n"
22862 #: ../src/guestfs-actions.pod:628
22864 "This command returns a list of all optional groups that this daemon knows "
22865 "about. Note this returns both supported and unsupported groups. To find "
22866 "out which ones the daemon can actually support you have to call "
22867 "C<guestfs_available> on each member of the returned list."
22871 #: ../src/guestfs-actions.pod:634
22872 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
22876 #: ../src/guestfs-actions.pod:640
22877 msgid "(Added in 1.3.15)"
22881 #: ../src/guestfs-actions.pod:642
22882 msgid "guestfs_base64_in"
22886 #: ../src/guestfs-actions.pod:644
22890 " guestfs_base64_in (guestfs_h *g,\n"
22891 " const char *base64file,\n"
22892 " const char *filename);\n"
22897 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
22898 msgid "(Added in 1.3.5)"
22902 #: ../src/guestfs-actions.pod:656
22903 msgid "guestfs_base64_out"
22907 #: ../src/guestfs-actions.pod:658
22911 " guestfs_base64_out (guestfs_h *g,\n"
22912 " const char *filename,\n"
22913 " const char *base64file);\n"
22918 #: ../src/guestfs-actions.pod:670
22919 msgid "guestfs_blockdev_flushbufs"
22923 #: ../src/guestfs-actions.pod:672
22927 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
22928 " const char *device);\n"
22933 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700
22934 #: ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731
22935 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768
22936 #: ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800
22937 #: ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
22938 msgid "(Added in 0.9.3)"
22942 #: ../src/guestfs-actions.pod:685
22943 msgid "guestfs_blockdev_getbsz"
22947 #: ../src/guestfs-actions.pod:687
22951 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
22952 " const char *device);\n"
22957 #: ../src/guestfs-actions.pod:702
22958 msgid "guestfs_blockdev_getro"
22962 #: ../src/guestfs-actions.pod:704
22966 " guestfs_blockdev_getro (guestfs_h *g,\n"
22967 " const char *device);\n"
22972 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1479
22973 #: ../src/guestfs-actions.pod:1494 ../src/guestfs-actions.pod:1983
22974 #: ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:2066
22975 #: ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:2132
22976 #: ../src/guestfs-actions.pod:2147 ../src/guestfs-actions.pod:2172
22977 #: ../src/guestfs-actions.pod:2195 ../src/guestfs-actions.pod:3253
22978 #: ../src/guestfs-actions.pod:3269 ../src/guestfs-actions.pod:3287
22979 #: ../src/guestfs-actions.pod:3449 ../src/guestfs-actions.pod:3463
22980 #: ../src/guestfs-actions.pod:3478 ../src/guestfs-actions.pod:3492
22981 #: ../src/guestfs-actions.pod:3508 ../src/guestfs-actions.pod:3523
22982 #: ../src/guestfs-actions.pod:3539 ../src/guestfs-actions.pod:3553
22983 #: ../src/guestfs-actions.pod:3566 ../src/guestfs-actions.pod:3580
22984 #: ../src/guestfs-actions.pod:3595 ../src/guestfs-actions.pod:3610
22985 #: ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3637
22986 #: ../src/guestfs-actions.pod:5366
22987 msgid "This function returns a C truth value on success or -1 on error."
22991 #: ../src/guestfs-actions.pod:717
22992 msgid "guestfs_blockdev_getsize64"
22996 #: ../src/guestfs-actions.pod:719
23000 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
23001 " const char *device);\n"
23006 #: ../src/guestfs-actions.pod:725
23007 msgid "See also C<guestfs_blockdev_getsz>."
23011 #: ../src/guestfs-actions.pod:733
23012 msgid "guestfs_blockdev_getss"
23016 #: ../src/guestfs-actions.pod:735
23020 " guestfs_blockdev_getss (guestfs_h *g,\n"
23021 " const char *device);\n"
23026 #: ../src/guestfs-actions.pod:742
23028 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
23033 #: ../src/guestfs-actions.pod:751
23034 msgid "guestfs_blockdev_getsz"
23038 #: ../src/guestfs-actions.pod:753
23042 " guestfs_blockdev_getsz (guestfs_h *g,\n"
23043 " const char *device);\n"
23048 #: ../src/guestfs-actions.pod:760
23050 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
23051 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
23055 #: ../src/guestfs-actions.pod:770
23056 msgid "guestfs_blockdev_rereadpt"
23060 #: ../src/guestfs-actions.pod:772
23064 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
23065 " const char *device);\n"
23070 #: ../src/guestfs-actions.pod:784
23071 msgid "guestfs_blockdev_setbsz"
23075 #: ../src/guestfs-actions.pod:786
23079 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
23080 " const char *device,\n"
23081 " int blocksize);\n"
23086 #: ../src/guestfs-actions.pod:802
23087 msgid "guestfs_blockdev_setro"
23091 #: ../src/guestfs-actions.pod:804
23095 " guestfs_blockdev_setro (guestfs_h *g,\n"
23096 " const char *device);\n"
23101 #: ../src/guestfs-actions.pod:816
23102 msgid "guestfs_blockdev_setrw"
23106 #: ../src/guestfs-actions.pod:818
23110 " guestfs_blockdev_setrw (guestfs_h *g,\n"
23111 " const char *device);\n"
23116 #: ../src/guestfs-actions.pod:830
23117 msgid "guestfs_btrfs_filesystem_resize"
23121 #: ../src/guestfs-actions.pod:832
23125 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
23126 " const char *mountpoint,\n"
23132 #: ../src/guestfs-actions.pod:842
23135 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
23140 #: ../src/guestfs-actions.pod:865
23141 msgid "(Added in 1.11.17)"
23145 #: ../src/guestfs-actions.pod:867
23146 msgid "guestfs_btrfs_filesystem_resize_va"
23150 #: ../src/guestfs-actions.pod:869
23154 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
23155 " const char *mountpoint,\n"
23156 " va_list args);\n"
23161 #: ../src/guestfs-actions.pod:874
23162 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
23166 #: ../src/guestfs-actions.pod:878
23167 msgid "guestfs_btrfs_filesystem_resize_argv"
23171 #: ../src/guestfs-actions.pod:880
23175 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
23176 " const char *mountpoint,\n"
23177 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
23182 #: ../src/guestfs-actions.pod:885
23183 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
23187 #: ../src/guestfs-actions.pod:889
23188 msgid "guestfs_case_sensitive_path"
23192 #: ../src/guestfs-actions.pod:891
23196 " guestfs_case_sensitive_path (guestfs_h *g,\n"
23197 " const char *path);\n"
23202 #: ../src/guestfs-actions.pod:917
23204 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
23205 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
23206 "how the directories were originally created under Windows)."
23210 #: ../src/guestfs-actions.pod:925
23211 msgid "See also C<guestfs_realpath>."
23215 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7414
23216 msgid "(Added in 1.0.75)"
23220 #: ../src/guestfs-actions.pod:932
23221 msgid "guestfs_cat"
23225 #: ../src/guestfs-actions.pod:934
23229 " guestfs_cat (guestfs_h *g,\n"
23230 " const char *path);\n"
23235 #: ../src/guestfs-actions.pod:940
23237 "Note that this function cannot correctly handle binary files (specifically, "
23238 "files containing C<\\0> character which is treated as end of string). For "
23239 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
23240 "functions which have a more complex interface."
23244 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3767
23245 #: ../src/guestfs-actions.pod:3849 ../src/guestfs-actions.pod:3866
23246 #: ../src/guestfs-actions.pod:3954 ../src/guestfs-actions.pod:4362
23247 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:5747
23248 #: ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:7567
23249 #: ../src/guestfs-actions.pod:7581
23250 msgid "(Added in 0.4)"
23254 #: ../src/guestfs-actions.pod:953
23255 msgid "guestfs_checksum"
23259 #: ../src/guestfs-actions.pod:955
23263 " guestfs_checksum (guestfs_h *g,\n"
23264 " const char *csumtype,\n"
23265 " const char *path);\n"
23270 #: ../src/guestfs-actions.pod:1001
23271 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
23275 #: ../src/guestfs-actions.pod:1003
23276 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
23280 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1316
23281 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:3465
23282 #: ../src/guestfs-actions.pod:3494 ../src/guestfs-actions.pod:3555
23283 #: ../src/guestfs-actions.pod:3582 ../src/guestfs-actions.pod:7270
23284 msgid "(Added in 1.0.2)"
23288 #: ../src/guestfs-actions.pod:1010
23289 msgid "guestfs_checksum_device"
23293 #: ../src/guestfs-actions.pod:1012
23297 " guestfs_checksum_device (guestfs_h *g,\n"
23298 " const char *csumtype,\n"
23299 " const char *device);\n"
23304 #: ../src/guestfs-actions.pod:1017
23306 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
23307 "device named C<device>. For the types of checksums supported see the "
23308 "C<guestfs_checksum> command."
23312 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5196
23313 #: ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5368
23314 #: ../src/guestfs-actions.pod:5386 ../src/guestfs-actions.pod:5568
23315 #: ../src/guestfs-actions.pod:7179 ../src/guestfs-actions.pod:7193
23316 #: ../src/guestfs-actions.pod:7593
23317 msgid "(Added in 1.3.2)"
23321 #: ../src/guestfs-actions.pod:1026
23322 msgid "guestfs_checksums_out"
23326 #: ../src/guestfs-actions.pod:1028
23330 " guestfs_checksums_out (guestfs_h *g,\n"
23331 " const char *csumtype,\n"
23332 " const char *directory,\n"
23333 " const char *sumsfile);\n"
23338 #: ../src/guestfs-actions.pod:1048
23339 msgid "(Added in 1.3.7)"
23343 #: ../src/guestfs-actions.pod:1050
23344 msgid "guestfs_chmod"
23348 #: ../src/guestfs-actions.pod:1052
23352 " guestfs_chmod (guestfs_h *g,\n"
23354 " const char *path);\n"
23359 #: ../src/guestfs-actions.pod:1070
23360 msgid "guestfs_chown"
23364 #: ../src/guestfs-actions.pod:1072
23368 " guestfs_chown (guestfs_h *g,\n"
23371 " const char *path);\n"
23376 #: ../src/guestfs-actions.pod:1088
23377 msgid "guestfs_command"
23381 #: ../src/guestfs-actions.pod:1090
23385 " guestfs_command (guestfs_h *g,\n"
23386 " char *const *arguments);\n"
23391 #: ../src/guestfs-actions.pod:1099
23393 "The single parameter is an argv-style list of arguments. The first element "
23394 "is the name of the program to run. Subsequent elements are parameters. The "
23395 "list must be non-empty (ie. must contain a program name). Note that the "
23396 "command runs directly, and is I<not> invoked via the shell (see "
23401 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150
23402 #: ../src/guestfs-actions.pod:1615
23403 msgid "(Added in 0.9.1)"
23407 #: ../src/guestfs-actions.pod:1132
23408 msgid "guestfs_command_lines"
23412 #: ../src/guestfs-actions.pod:1134
23416 " guestfs_command_lines (guestfs_h *g,\n"
23417 " char *const *arguments);\n"
23422 #: ../src/guestfs-actions.pod:1138
23424 "This is the same as C<guestfs_command>, but splits the result into a list of "
23429 #: ../src/guestfs-actions.pod:1141
23430 msgid "See also: C<guestfs_sh_lines>"
23434 #: ../src/guestfs-actions.pod:1152
23435 msgid "guestfs_config"
23439 #: ../src/guestfs-actions.pod:1154
23443 " guestfs_config (guestfs_h *g,\n"
23444 " const char *qemuparam,\n"
23445 " const char *qemuvalue);\n"
23450 #: ../src/guestfs-actions.pod:1172
23451 msgid "guestfs_copy_size"
23455 #: ../src/guestfs-actions.pod:1174
23459 " guestfs_copy_size (guestfs_h *g,\n"
23460 " const char *src,\n"
23461 " const char *dest,\n"
23462 " int64_t size);\n"
23467 #: ../src/guestfs-actions.pod:1188 ../src/guestfs-actions.pod:1311
23468 #: ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:1387
23469 #: ../src/guestfs-actions.pod:1764 ../src/guestfs-actions.pod:1786
23470 #: ../src/guestfs-actions.pod:3665 ../src/guestfs-actions.pod:7265
23471 #: ../src/guestfs-actions.pod:7299 ../src/guestfs-actions.pod:7806
23472 #: ../src/guestfs-actions.pod:7829
23474 "This long-running command can generate progress notification messages so "
23475 "that the caller can display a progress bar or indicator. To receive these "
23476 "messages, the caller must register a progress event callback. See L<guestfs"
23477 "(3)/GUESTFS_EVENT_PROGRESS>."
23481 #: ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:4389
23482 #: ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:7500
23483 #: ../src/guestfs-actions.pod:7520 ../src/guestfs-actions.pod:7606
23484 msgid "(Added in 1.0.87)"
23488 #: ../src/guestfs-actions.pod:1195
23493 #: ../src/guestfs-actions.pod:1197
23497 " guestfs_cp (guestfs_h *g,\n"
23498 " const char *src,\n"
23499 " const char *dest);\n"
23504 #: ../src/guestfs-actions.pod:1207 ../src/guestfs-actions.pod:1221
23505 #: ../src/guestfs-actions.pod:1293 ../src/guestfs-actions.pod:1367
23506 #: ../src/guestfs-actions.pod:1481 ../src/guestfs-actions.pod:5143
23507 #: ../src/guestfs-actions.pod:5618
23508 msgid "(Added in 1.0.18)"
23512 #: ../src/guestfs-actions.pod:1209
23513 msgid "guestfs_cp_a"
23517 #: ../src/guestfs-actions.pod:1211
23521 " guestfs_cp_a (guestfs_h *g,\n"
23522 " const char *src,\n"
23523 " const char *dest);\n"
23528 #: ../src/guestfs-actions.pod:1223
23533 #: ../src/guestfs-actions.pod:1225
23537 " guestfs_dd (guestfs_h *g,\n"
23538 " const char *src,\n"
23539 " const char *dest);\n"
23544 #: ../src/guestfs-actions.pod:1235
23546 "If the destination is a device, it must be as large or larger than the "
23547 "source file or device, otherwise the copy will fail. This command cannot do "
23548 "partial copies (see C<guestfs_copy_size>)."
23552 #: ../src/guestfs-actions.pod:1243
23557 #: ../src/guestfs-actions.pod:1245
23561 " guestfs_df (guestfs_h *g);\n"
23566 #: ../src/guestfs-actions.pod:1250 ../src/guestfs-actions.pod:1267
23568 "This command is mostly useful for interactive sessions. It is I<not> "
23569 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
23574 #: ../src/guestfs-actions.pod:1257 ../src/guestfs-actions.pod:1274
23575 #: ../src/guestfs-actions.pod:1392 ../src/guestfs-actions.pod:2388
23576 #: ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2480
23577 #: ../src/guestfs-actions.pod:4499 ../src/guestfs-actions.pod:5043
23578 #: ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7027
23579 #: ../src/guestfs-actions.pod:7646 ../src/guestfs-actions.pod:7659
23580 #: ../src/guestfs-actions.pod:7672
23581 msgid "(Added in 1.0.54)"
23585 #: ../src/guestfs-actions.pod:1259
23586 msgid "guestfs_df_h"
23590 #: ../src/guestfs-actions.pod:1261
23594 " guestfs_df_h (guestfs_h *g);\n"
23599 #: ../src/guestfs-actions.pod:1276
23600 msgid "guestfs_dmesg"
23604 #: ../src/guestfs-actions.pod:1278
23608 " guestfs_dmesg (guestfs_h *g);\n"
23613 #: ../src/guestfs-actions.pod:1285
23615 "Another way to get the same information is to enable verbose messages with "
23616 "C<guestfs_set_verbose> or by setting the environment variable "
23617 "C<LIBGUESTFS_DEBUG=1> before running the program."
23621 #: ../src/guestfs-actions.pod:1295
23622 msgid "guestfs_download"
23626 #: ../src/guestfs-actions.pod:1297
23630 " guestfs_download (guestfs_h *g,\n"
23631 " const char *remotefilename,\n"
23632 " const char *filename);\n"
23637 #: ../src/guestfs-actions.pod:1307
23638 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
23642 #: ../src/guestfs-actions.pod:1318
23643 msgid "guestfs_download_offset"
23647 #: ../src/guestfs-actions.pod:1320
23651 " guestfs_download_offset (guestfs_h *g,\n"
23652 " const char *remotefilename,\n"
23653 " const char *filename,\n"
23654 " int64_t offset,\n"
23655 " int64_t size);\n"
23660 #: ../src/guestfs-actions.pod:1333
23662 "Note that there is no limit on the amount of data that can be downloaded "
23663 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
23664 "full amount unless an error occurs."
23668 #: ../src/guestfs-actions.pod:1338
23669 msgid "See also C<guestfs_download>, C<guestfs_pread>."
23673 #: ../src/guestfs-actions.pod:1347 ../src/guestfs-actions.pod:7304
23674 msgid "(Added in 1.5.17)"
23678 #: ../src/guestfs-actions.pod:1349
23679 msgid "guestfs_drop_caches"
23683 #: ../src/guestfs-actions.pod:1351
23687 " guestfs_drop_caches (guestfs_h *g,\n"
23688 " int whattodrop);\n"
23693 #: ../src/guestfs-actions.pod:1369
23698 #: ../src/guestfs-actions.pod:1371
23702 " guestfs_du (guestfs_h *g,\n"
23703 " const char *path);\n"
23708 #: ../src/guestfs-actions.pod:1394
23709 msgid "guestfs_e2fsck_f"
23713 #: ../src/guestfs-actions.pod:1396
23717 " guestfs_e2fsck_f (guestfs_h *g,\n"
23718 " const char *device);\n"
23723 #: ../src/guestfs-actions.pod:1404
23725 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
23726 "Normally you should use C<guestfs_fsck>."
23730 #: ../src/guestfs-actions.pod:1409
23731 msgid "(Added in 1.0.29)"
23735 #: ../src/guestfs-actions.pod:1411
23736 msgid "guestfs_echo_daemon"
23740 #: ../src/guestfs-actions.pod:1413
23744 " guestfs_echo_daemon (guestfs_h *g,\n"
23745 " char *const *words);\n"
23750 #: ../src/guestfs-actions.pod:1422
23751 msgid "See also C<guestfs_ping_daemon>."
23755 #: ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:2174
23756 #: ../src/guestfs-actions.pod:6475
23757 msgid "(Added in 1.0.69)"
23761 #: ../src/guestfs-actions.pod:1429
23762 msgid "guestfs_egrep"
23766 #: ../src/guestfs-actions.pod:1431
23770 " guestfs_egrep (guestfs_h *g,\n"
23771 " const char *regex,\n"
23772 " const char *path);\n"
23777 #: ../src/guestfs-actions.pod:1446 ../src/guestfs-actions.pod:1465
23778 #: ../src/guestfs-actions.pod:1522 ../src/guestfs-actions.pod:1568
23779 #: ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:2304
23780 #: ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:2501
23781 #: ../src/guestfs-actions.pod:2514 ../src/guestfs-actions.pod:2529
23782 #: ../src/guestfs-actions.pod:2575 ../src/guestfs-actions.pod:2597
23783 #: ../src/guestfs-actions.pod:2610 ../src/guestfs-actions.pod:3879
23784 #: ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3906
23785 #: ../src/guestfs-actions.pod:3920 ../src/guestfs-actions.pod:4921
23786 #: ../src/guestfs-actions.pod:5952 ../src/guestfs-actions.pod:6001
23787 #: ../src/guestfs-actions.pod:6871 ../src/guestfs-actions.pod:6883
23788 #: ../src/guestfs-actions.pod:6896 ../src/guestfs-actions.pod:6909
23789 #: ../src/guestfs-actions.pod:6931 ../src/guestfs-actions.pod:6944
23790 #: ../src/guestfs-actions.pod:6957 ../src/guestfs-actions.pod:6970
23791 #: ../src/guestfs-actions.pod:7764 ../src/guestfs-actions.pod:7783
23792 #: ../src/guestfs-actions.pod:7877 ../src/guestfs-actions.pod:7896
23793 #: ../src/guestfs-actions.pod:7942 ../src/guestfs-actions.pod:7961
23794 msgid "(Added in 1.0.66)"
23798 #: ../src/guestfs-actions.pod:1448
23799 msgid "guestfs_egrepi"
23803 #: ../src/guestfs-actions.pod:1450
23807 " guestfs_egrepi (guestfs_h *g,\n"
23808 " const char *regex,\n"
23809 " const char *path);\n"
23814 #: ../src/guestfs-actions.pod:1467
23815 msgid "guestfs_equal"
23819 #: ../src/guestfs-actions.pod:1469
23823 " guestfs_equal (guestfs_h *g,\n"
23824 " const char *file1,\n"
23825 " const char *file2);\n"
23830 #: ../src/guestfs-actions.pod:1483
23831 msgid "guestfs_exists"
23835 #: ../src/guestfs-actions.pod:1485
23839 " guestfs_exists (guestfs_h *g,\n"
23840 " const char *path);\n"
23845 #: ../src/guestfs-actions.pod:1492
23846 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
23850 #: ../src/guestfs-actions.pod:1498
23851 msgid "guestfs_fallocate"
23855 #: ../src/guestfs-actions.pod:1500
23859 " guestfs_fallocate (guestfs_h *g,\n"
23860 " const char *path,\n"
23866 #: ../src/guestfs-actions.pod:1515
23868 "This function is deprecated. In new code, use the L</guestfs_fallocate64> "
23873 #: ../src/guestfs-actions.pod:1524
23874 msgid "guestfs_fallocate64"
23878 #: ../src/guestfs-actions.pod:1526
23882 " guestfs_fallocate64 (guestfs_h *g,\n"
23883 " const char *path,\n"
23889 #: ../src/guestfs-actions.pod:1535
23891 "Note that this call allocates disk blocks for the file. To create a sparse "
23892 "file use C<guestfs_truncate_size> instead."
23896 #: ../src/guestfs-actions.pod:1538
23898 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
23899 "oversight it only allowed 30 bit lengths to be specified, effectively "
23900 "limiting the maximum size of files created through that call to 1GB."
23904 #: ../src/guestfs-actions.pod:1549
23905 msgid "(Added in 1.3.17)"
23909 #: ../src/guestfs-actions.pod:1551
23910 msgid "guestfs_fgrep"
23914 #: ../src/guestfs-actions.pod:1553
23918 " guestfs_fgrep (guestfs_h *g,\n"
23919 " const char *pattern,\n"
23920 " const char *path);\n"
23925 #: ../src/guestfs-actions.pod:1570
23926 msgid "guestfs_fgrepi"
23930 #: ../src/guestfs-actions.pod:1572
23934 " guestfs_fgrepi (guestfs_h *g,\n"
23935 " const char *pattern,\n"
23936 " const char *path);\n"
23941 #: ../src/guestfs-actions.pod:1589
23942 msgid "guestfs_file"
23946 #: ../src/guestfs-actions.pod:1591
23950 " guestfs_file (guestfs_h *g,\n"
23951 " const char *path);\n"
23956 #: ../src/guestfs-actions.pod:1609
23958 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
23959 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
23963 #: ../src/guestfs-actions.pod:1617
23964 msgid "guestfs_file_architecture"
23968 #: ../src/guestfs-actions.pod:1619
23972 " guestfs_file_architecture (guestfs_h *g,\n"
23973 " const char *filename);\n"
23978 #: ../src/guestfs-actions.pod:1727 ../src/guestfs-actions.pod:1890
23979 #: ../src/guestfs-actions.pod:1907 ../src/guestfs-actions.pod:2630
23980 #: ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:2786
23981 #: ../src/guestfs-actions.pod:2973 ../src/guestfs-actions.pod:2991
23982 #: ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:3106
23983 #: ../src/guestfs-actions.pod:3199 ../src/guestfs-actions.pod:3436
23984 #: ../src/guestfs-actions.pod:3568
23985 msgid "(Added in 1.5.3)"
23989 #: ../src/guestfs-actions.pod:1729
23990 msgid "guestfs_filesize"
23994 #: ../src/guestfs-actions.pod:1731
23998 " guestfs_filesize (guestfs_h *g,\n"
23999 " const char *file);\n"
24004 #: ../src/guestfs-actions.pod:1737
24006 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
24007 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
24008 "devices, use C<guestfs_blockdev_getsize64>."
24012 #: ../src/guestfs-actions.pod:1743
24013 msgid "(Added in 1.0.82)"
24017 #: ../src/guestfs-actions.pod:1745
24018 msgid "guestfs_fill"
24022 #: ../src/guestfs-actions.pod:1747
24026 " guestfs_fill (guestfs_h *g,\n"
24029 " const char *path);\n"
24034 #: ../src/guestfs-actions.pod:1757
24036 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
24037 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
24038 "bytes use C<guestfs_fill_pattern>."
24042 #: ../src/guestfs-actions.pod:1769
24043 msgid "(Added in 1.0.79)"
24047 #: ../src/guestfs-actions.pod:1771
24048 msgid "guestfs_fill_pattern"
24052 #: ../src/guestfs-actions.pod:1773
24056 " guestfs_fill_pattern (guestfs_h *g,\n"
24057 " const char *pattern,\n"
24059 " const char *path);\n"
24064 #: ../src/guestfs-actions.pod:1779
24066 "This function is like C<guestfs_fill> except that it creates a new file of "
24067 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
24068 "pattern is truncated if necessary to ensure the length of the file is "
24069 "exactly C<len> bytes."
24073 #: ../src/guestfs-actions.pod:1791
24074 msgid "(Added in 1.3.12)"
24078 #: ../src/guestfs-actions.pod:1793
24079 msgid "guestfs_find"
24083 #: ../src/guestfs-actions.pod:1795
24087 " guestfs_find (guestfs_h *g,\n"
24088 " const char *directory);\n"
24093 #: ../src/guestfs-actions.pod:1811
24095 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
24099 #: ../src/guestfs-actions.pod:1824
24100 msgid "See also C<guestfs_find0>."
24104 #: ../src/guestfs-actions.pod:1833 ../src/guestfs-actions.pod:4326
24105 #: ../src/guestfs-actions.pod:6036
24106 msgid "(Added in 1.0.27)"
24110 #: ../src/guestfs-actions.pod:1835
24111 msgid "guestfs_find0"
24115 #: ../src/guestfs-actions.pod:1837
24119 " guestfs_find0 (guestfs_h *g,\n"
24120 " const char *directory,\n"
24121 " const char *files);\n"
24126 #: ../src/guestfs-actions.pod:1846
24128 "This command works the same way as C<guestfs_find> with the following "
24133 #: ../src/guestfs-actions.pod:1873
24134 msgid "(Added in 1.0.74)"
24138 #: ../src/guestfs-actions.pod:1875
24139 msgid "guestfs_findfs_label"
24143 #: ../src/guestfs-actions.pod:1877
24147 " guestfs_findfs_label (guestfs_h *g,\n"
24148 " const char *label);\n"
24153 #: ../src/guestfs-actions.pod:1885
24154 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
24158 #: ../src/guestfs-actions.pod:1892
24159 msgid "guestfs_findfs_uuid"
24163 #: ../src/guestfs-actions.pod:1894
24167 " guestfs_findfs_uuid (guestfs_h *g,\n"
24168 " const char *uuid);\n"
24173 #: ../src/guestfs-actions.pod:1902
24174 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
24178 #: ../src/guestfs-actions.pod:1909
24179 msgid "guestfs_fsck"
24183 #: ../src/guestfs-actions.pod:1911
24187 " guestfs_fsck (guestfs_h *g,\n"
24188 " const char *fstype,\n"
24189 " const char *device);\n"
24194 #: ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:7811
24195 msgid "(Added in 1.0.16)"
24199 #: ../src/guestfs-actions.pod:1948
24200 msgid "guestfs_get_append"
24204 #: ../src/guestfs-actions.pod:1950
24208 " guestfs_get_append (guestfs_h *g);\n"
24213 #: ../src/guestfs-actions.pod:1958
24215 "This function returns a string which may be NULL. There is no way to return "
24216 "an error from this function. The string is owned by the guest handle and "
24217 "must I<not> be freed."
24221 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:5714
24222 #: ../src/guestfs-actions.pod:6196 ../src/guestfs-actions.pod:6638
24223 #: ../src/guestfs-actions.pod:6657 ../src/guestfs-actions.pod:6673
24224 #: ../src/guestfs-actions.pod:6697 ../src/guestfs-actions.pod:7451
24225 #: ../src/guestfs-actions.pod:7466 ../src/guestfs-actions.pod:7858
24226 msgid "(Added in 1.0.26)"
24230 #: ../src/guestfs-actions.pod:1964
24231 msgid "guestfs_get_attach_method"
24235 #: ../src/guestfs-actions.pod:1966
24239 " guestfs_get_attach_method (guestfs_h *g);\n"
24244 #: ../src/guestfs-actions.pod:1969
24245 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
24249 #: ../src/guestfs-actions.pod:1974 ../src/guestfs-actions.pod:6226
24250 msgid "(Added in 1.9.8)"
24254 #: ../src/guestfs-actions.pod:1976
24255 msgid "guestfs_get_autosync"
24259 #: ../src/guestfs-actions.pod:1978
24263 " guestfs_get_autosync (guestfs_h *g);\n"
24268 #: ../src/guestfs-actions.pod:1987
24269 msgid "guestfs_get_direct"
24273 #: ../src/guestfs-actions.pod:1989
24277 " guestfs_get_direct (guestfs_h *g);\n"
24282 #: ../src/guestfs-actions.pod:1996 ../src/guestfs-actions.pod:6267
24283 msgid "(Added in 1.0.72)"
24287 #: ../src/guestfs-actions.pod:1998
24288 msgid "guestfs_get_e2label"
24292 #: ../src/guestfs-actions.pod:2000
24296 " guestfs_get_e2label (guestfs_h *g,\n"
24297 " const char *device);\n"
24302 #: ../src/guestfs-actions.pod:2010
24304 "This function is deprecated. In new code, use the L</guestfs_vfs_label> "
24309 #: ../src/guestfs-actions.pod:2017 ../src/guestfs-actions.pod:2038
24310 #: ../src/guestfs-actions.pod:6285 ../src/guestfs-actions.pod:6304
24311 msgid "(Added in 1.0.15)"
24315 #: ../src/guestfs-actions.pod:2019
24316 msgid "guestfs_get_e2uuid"
24320 #: ../src/guestfs-actions.pod:2021
24324 " guestfs_get_e2uuid (guestfs_h *g,\n"
24325 " const char *device);\n"
24330 #: ../src/guestfs-actions.pod:2031
24332 "This function is deprecated. In new code, use the L</guestfs_vfs_uuid> call "
24337 #: ../src/guestfs-actions.pod:2040
24338 msgid "guestfs_get_memsize"
24342 #: ../src/guestfs-actions.pod:2042
24346 " guestfs_get_memsize (guestfs_h *g);\n"
24351 #: ../src/guestfs-actions.pod:2048
24353 "If C<guestfs_set_memsize> was not called on this handle, and if "
24354 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
24355 "value for memsize."
24359 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:4617
24360 #: ../src/guestfs-actions.pod:4826 ../src/guestfs-actions.pod:4845
24361 #: ../src/guestfs-actions.pod:4864 ../src/guestfs-actions.pod:4876
24362 #: ../src/guestfs-actions.pod:4893 ../src/guestfs-actions.pod:4906
24363 #: ../src/guestfs-actions.pod:5939 ../src/guestfs-actions.pod:6325
24364 #: ../src/guestfs-actions.pod:6605 ../src/guestfs-actions.pod:7220
24365 msgid "(Added in 1.0.55)"
24369 #: ../src/guestfs-actions.pod:2059
24370 msgid "guestfs_get_network"
24374 #: ../src/guestfs-actions.pod:2061
24378 " guestfs_get_network (guestfs_h *g);\n"
24383 #: ../src/guestfs-actions.pod:2068 ../src/guestfs-actions.pod:6344
24384 msgid "(Added in 1.5.4)"
24388 #: ../src/guestfs-actions.pod:2070
24389 msgid "guestfs_get_path"
24393 #: ../src/guestfs-actions.pod:2072
24397 " guestfs_get_path (guestfs_h *g);\n"
24402 #: ../src/guestfs-actions.pod:2080 ../src/guestfs-actions.pod:2120
24404 "This function returns a string, or NULL on error. The string is owned by "
24405 "the guest handle and must I<not> be freed."
24409 #: ../src/guestfs-actions.pod:2085
24410 msgid "guestfs_get_pgroup"
24414 #: ../src/guestfs-actions.pod:2087
24418 " guestfs_get_pgroup (guestfs_h *g);\n"
24423 #: ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:6380
24424 #: ../src/guestfs-actions.pod:7712
24425 msgid "(Added in 1.11.18)"
24429 #: ../src/guestfs-actions.pod:2096
24430 msgid "guestfs_get_pid"
24434 #: ../src/guestfs-actions.pod:2098
24438 " guestfs_get_pid (guestfs_h *g);\n"
24443 #: ../src/guestfs-actions.pod:2108
24444 msgid "(Added in 1.0.56)"
24448 #: ../src/guestfs-actions.pod:2110
24449 msgid "guestfs_get_qemu"
24453 #: ../src/guestfs-actions.pod:2112
24457 " guestfs_get_qemu (guestfs_h *g);\n"
24462 #: ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:6408
24463 msgid "(Added in 1.0.6)"
24467 #: ../src/guestfs-actions.pod:2125
24468 msgid "guestfs_get_recovery_proc"
24472 #: ../src/guestfs-actions.pod:2127
24476 " guestfs_get_recovery_proc (guestfs_h *g);\n"
24481 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:3690
24482 #: ../src/guestfs-actions.pod:4021 ../src/guestfs-actions.pod:4424
24483 #: ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:5644
24484 #: ../src/guestfs-actions.pod:5987 ../src/guestfs-actions.pod:6432
24485 #: ../src/guestfs-actions.pod:7123 ../src/guestfs-actions.pod:7143
24486 #: ../src/guestfs-actions.pod:7335
24487 msgid "(Added in 1.0.77)"
24491 #: ../src/guestfs-actions.pod:2136
24492 msgid "guestfs_get_selinux"
24496 #: ../src/guestfs-actions.pod:2138
24500 " guestfs_get_selinux (guestfs_h *g);\n"
24505 #: ../src/guestfs-actions.pod:2141
24507 "This returns the current setting of the selinux flag which is passed to the "
24508 "appliance at boot time. See C<guestfs_set_selinux>."
24512 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2212
24513 #: ../src/guestfs-actions.pod:6451 ../src/guestfs-actions.pod:6509
24514 msgid "(Added in 1.0.67)"
24518 #: ../src/guestfs-actions.pod:2151
24519 msgid "guestfs_get_state"
24523 #: ../src/guestfs-actions.pod:2153
24527 " guestfs_get_state (guestfs_h *g);\n"
24532 #: ../src/guestfs-actions.pod:2165
24533 msgid "guestfs_get_trace"
24537 #: ../src/guestfs-actions.pod:2167
24541 " guestfs_get_trace (guestfs_h *g);\n"
24546 #: ../src/guestfs-actions.pod:2176
24547 msgid "guestfs_get_umask"
24551 #: ../src/guestfs-actions.pod:2178
24555 " guestfs_get_umask (guestfs_h *g);\n"
24560 #: ../src/guestfs-actions.pod:2181
24562 "Return the current umask. By default the umask is C<022> unless it has been "
24563 "set by calling C<guestfs_umask>."
24567 #: ../src/guestfs-actions.pod:2188
24568 msgid "guestfs_get_verbose"
24572 #: ../src/guestfs-actions.pod:2190
24576 " guestfs_get_verbose (guestfs_h *g);\n"
24581 #: ../src/guestfs-actions.pod:2199
24582 msgid "guestfs_getcon"
24586 #: ../src/guestfs-actions.pod:2201
24590 " guestfs_getcon (guestfs_h *g);\n"
24595 #: ../src/guestfs-actions.pod:2206
24597 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
24601 #: ../src/guestfs-actions.pod:2214
24602 msgid "guestfs_getxattr"
24606 #: ../src/guestfs-actions.pod:2216
24610 " guestfs_getxattr (guestfs_h *g,\n"
24611 " const char *path,\n"
24612 " const char *name,\n"
24613 " size_t *size_r);\n"
24618 #: ../src/guestfs-actions.pod:2222
24620 "Get a single extended attribute from file C<path> named C<name>. This call "
24621 "follows symlinks. If you want to lookup an extended attribute for the "
24622 "symlink itself, use C<guestfs_lgetxattr>."
24626 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:3704
24628 "Normally it is better to get all extended attributes from a file in one go "
24629 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
24630 "implementations are buggy and do not provide a way to list out attributes. "
24631 "For these filesystems (notably ntfs-3g) you have to know the names of the "
24632 "extended attributes you want in advance and call this function."
24636 #: ../src/guestfs-actions.pod:2236
24637 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
24641 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2451
24642 #: ../src/guestfs-actions.pod:2921 ../src/guestfs-actions.pod:3716
24643 #: ../src/guestfs-actions.pod:5637 ../src/guestfs-actions.pod:5663
24644 #: ../src/guestfs-actions.pod:5844
24646 "This function returns a buffer, or NULL on error. The size of the returned "
24647 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
24652 #: ../src/guestfs-actions.pod:2242 ../src/guestfs-actions.pod:3720
24653 msgid "(Added in 1.7.24)"
24657 #: ../src/guestfs-actions.pod:2244
24658 msgid "guestfs_getxattrs"
24662 #: ../src/guestfs-actions.pod:2246
24665 " struct guestfs_xattr_list *\n"
24666 " guestfs_getxattrs (guestfs_h *g,\n"
24667 " const char *path);\n"
24672 #: ../src/guestfs-actions.pod:2256
24673 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
24677 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:3732
24678 #: ../src/guestfs-actions.pod:4420
24680 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
24681 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
24685 #: ../src/guestfs-actions.pod:2262 ../src/guestfs-actions.pod:3736
24686 #: ../src/guestfs-actions.pod:3935 ../src/guestfs-actions.pod:3971
24687 #: ../src/guestfs-actions.pod:6017 ../src/guestfs-actions.pod:6528
24688 #: ../src/guestfs-actions.pod:7923
24689 msgid "(Added in 1.0.59)"
24693 #: ../src/guestfs-actions.pod:2264
24694 msgid "guestfs_glob_expand"
24698 #: ../src/guestfs-actions.pod:2266
24702 " guestfs_glob_expand (guestfs_h *g,\n"
24703 " const char *pattern);\n"
24708 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:6721
24709 #: ../src/guestfs-actions.pod:6738
24710 msgid "(Added in 1.0.50)"
24714 #: ../src/guestfs-actions.pod:2287
24715 msgid "guestfs_grep"
24719 #: ../src/guestfs-actions.pod:2289
24723 " guestfs_grep (guestfs_h *g,\n"
24724 " const char *regex,\n"
24725 " const char *path);\n"
24730 #: ../src/guestfs-actions.pod:2306
24731 msgid "guestfs_grepi"
24735 #: ../src/guestfs-actions.pod:2308
24739 " guestfs_grepi (guestfs_h *g,\n"
24740 " const char *regex,\n"
24741 " const char *path);\n"
24746 #: ../src/guestfs-actions.pod:2325
24747 msgid "guestfs_grub_install"
24751 #: ../src/guestfs-actions.pod:2327
24755 " guestfs_grub_install (guestfs_h *g,\n"
24756 " const char *root,\n"
24757 " const char *device);\n"
24762 #: ../src/guestfs-actions.pod:2370
24763 msgid "(Added in 1.0.17)"
24767 #: ../src/guestfs-actions.pod:2372
24768 msgid "guestfs_head"
24772 #: ../src/guestfs-actions.pod:2374
24776 " guestfs_head (guestfs_h *g,\n"
24777 " const char *path);\n"
24782 #: ../src/guestfs-actions.pod:2390
24783 msgid "guestfs_head_n"
24787 #: ../src/guestfs-actions.pod:2392
24791 " guestfs_head_n (guestfs_h *g,\n"
24793 " const char *path);\n"
24798 #: ../src/guestfs-actions.pod:2414
24799 msgid "guestfs_hexdump"
24803 #: ../src/guestfs-actions.pod:2416
24807 " guestfs_hexdump (guestfs_h *g,\n"
24808 " const char *path);\n"
24813 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:6802
24814 #: ../src/guestfs-actions.pod:6857
24815 msgid "(Added in 1.0.22)"
24819 #: ../src/guestfs-actions.pod:2431
24820 msgid "guestfs_initrd_cat"
24824 #: ../src/guestfs-actions.pod:2433
24828 " guestfs_initrd_cat (guestfs_h *g,\n"
24829 " const char *initrdpath,\n"
24830 " const char *filename,\n"
24831 " size_t *size_r);\n"
24836 #: ../src/guestfs-actions.pod:2449
24837 msgid "See also C<guestfs_initrd_list>."
24841 #: ../src/guestfs-actions.pod:2460
24842 msgid "guestfs_initrd_list"
24846 #: ../src/guestfs-actions.pod:2462
24850 " guestfs_initrd_list (guestfs_h *g,\n"
24851 " const char *path);\n"
24856 #: ../src/guestfs-actions.pod:2482
24857 msgid "guestfs_inotify_add_watch"
24861 #: ../src/guestfs-actions.pod:2484
24865 " guestfs_inotify_add_watch (guestfs_h *g,\n"
24866 " const char *path,\n"
24872 #: ../src/guestfs-actions.pod:2503
24873 msgid "guestfs_inotify_close"
24877 #: ../src/guestfs-actions.pod:2505
24881 " guestfs_inotify_close (guestfs_h *g);\n"
24886 #: ../src/guestfs-actions.pod:2516
24887 msgid "guestfs_inotify_files"
24891 #: ../src/guestfs-actions.pod:2518
24895 " guestfs_inotify_files (guestfs_h *g);\n"
24900 #: ../src/guestfs-actions.pod:2521
24902 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
24903 "returns a list of pathnames of objects that were touched. The returned "
24904 "pathnames are sorted and deduplicated."
24908 #: ../src/guestfs-actions.pod:2531
24909 msgid "guestfs_inotify_init"
24913 #: ../src/guestfs-actions.pod:2533
24917 " guestfs_inotify_init (guestfs_h *g,\n"
24918 " int maxevents);\n"
24923 #: ../src/guestfs-actions.pod:2541
24925 "C<maxevents> is the maximum number of events which will be queued up between "
24926 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
24927 "passed as C<0>, then the kernel (or previously set) default is used. For "
24928 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
24929 "throws away events, but records the fact that it threw them away by setting "
24930 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
24931 "C<guestfs_inotify_read>)."
24935 #: ../src/guestfs-actions.pod:2551
24937 "Before any events are generated, you have to add some watches to the "
24938 "internal watch list. See: C<guestfs_inotify_add_watch>, "
24939 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
24943 #: ../src/guestfs-actions.pod:2557
24945 "Queued up events should be read periodically by calling "
24946 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
24947 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
24948 "often enough then you risk the internal queue overflowing."
24952 #: ../src/guestfs-actions.pod:2564
24954 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
24955 "This also removes any watches automatically."
24959 #: ../src/guestfs-actions.pod:2577
24960 msgid "guestfs_inotify_read"
24964 #: ../src/guestfs-actions.pod:2579
24967 " struct guestfs_inotify_event_list *\n"
24968 " guestfs_inotify_read (guestfs_h *g);\n"
24973 #: ../src/guestfs-actions.pod:2593
24975 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
24976 "there was an error. I<The caller must call "
24977 "C<guestfs_free_inotify_event_list> after use>."
24981 #: ../src/guestfs-actions.pod:2599
24982 msgid "guestfs_inotify_rm_watch"
24986 #: ../src/guestfs-actions.pod:2601
24990 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
24996 #: ../src/guestfs-actions.pod:2605
24998 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
25002 #: ../src/guestfs-actions.pod:2612
25003 msgid "guestfs_inspect_get_arch"
25007 #: ../src/guestfs-actions.pod:2614
25011 " guestfs_inspect_get_arch (guestfs_h *g,\n"
25012 " const char *root);\n"
25017 #: ../src/guestfs-actions.pod:2618
25019 "This returns the architecture of the inspected operating system. The "
25020 "possible return values are listed under C<guestfs_file_architecture>."
25024 #: ../src/guestfs-actions.pod:2632
25025 msgid "guestfs_inspect_get_distro"
25029 #: ../src/guestfs-actions.pod:2634
25033 " guestfs_inspect_get_distro (guestfs_h *g,\n"
25034 " const char *root);\n"
25039 #: ../src/guestfs-actions.pod:2722
25040 msgid "guestfs_inspect_get_drive_mappings"
25044 #: ../src/guestfs-actions.pod:2724
25048 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
25049 " const char *root);\n"
25054 #: ../src/guestfs-actions.pod:2753
25056 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25057 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
25061 #: ../src/guestfs-actions.pod:2757 ../src/guestfs-actions.pod:3025
25062 #: ../src/guestfs-actions.pod:3823 ../src/guestfs-actions.pod:5105
25063 #: ../src/guestfs-actions.pod:7159
25065 "This function returns a NULL-terminated array of strings, or NULL if there "
25066 "was an error. The array of strings will always have length C<2n+1>, where "
25067 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
25068 "caller must free the strings and the array after use>."
25072 #: ../src/guestfs-actions.pod:2763 ../src/guestfs-actions.pod:3219
25073 msgid "(Added in 1.9.17)"
25077 #: ../src/guestfs-actions.pod:2765
25078 msgid "guestfs_inspect_get_filesystems"
25082 #: ../src/guestfs-actions.pod:2767
25086 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
25087 " const char *root);\n"
25092 #: ../src/guestfs-actions.pod:2779
25094 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25095 "C<guestfs_inspect_get_mountpoints>."
25099 #: ../src/guestfs-actions.pod:2788
25100 msgid "guestfs_inspect_get_format"
25104 #: ../src/guestfs-actions.pod:2790
25108 " guestfs_inspect_get_format (guestfs_h *g,\n"
25109 " const char *root);\n"
25114 #: ../src/guestfs-actions.pod:2824 ../src/guestfs-actions.pod:3255
25115 #: ../src/guestfs-actions.pod:3271 ../src/guestfs-actions.pod:3289
25116 #: ../src/guestfs-actions.pod:6055
25117 msgid "(Added in 1.9.4)"
25121 #: ../src/guestfs-actions.pod:2826
25122 msgid "guestfs_inspect_get_hostname"
25126 #: ../src/guestfs-actions.pod:2828
25130 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
25131 " const char *root);\n"
25136 #: ../src/guestfs-actions.pod:2843
25137 msgid "(Added in 1.7.9)"
25141 #: ../src/guestfs-actions.pod:2845
25142 msgid "guestfs_inspect_get_icon"
25146 #: ../src/guestfs-actions.pod:2847
25150 " guestfs_inspect_get_icon (guestfs_h *g,\n"
25151 " const char *root,\n"
25152 " size_t *size_r,\n"
25158 #: ../src/guestfs-actions.pod:2858
25161 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
25162 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
25167 #: ../src/guestfs-actions.pod:2925 ../src/guestfs-actions.pod:3750
25168 #: ../src/guestfs-actions.pod:5004
25169 msgid "(Added in 1.11.12)"
25173 #: ../src/guestfs-actions.pod:2927
25174 msgid "guestfs_inspect_get_icon_va"
25178 #: ../src/guestfs-actions.pod:2929
25182 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
25183 " const char *root,\n"
25184 " size_t *size_r,\n"
25185 " va_list args);\n"
25190 #: ../src/guestfs-actions.pod:2935
25191 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
25195 #: ../src/guestfs-actions.pod:2939
25196 msgid "guestfs_inspect_get_icon_argv"
25200 #: ../src/guestfs-actions.pod:2941
25204 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
25205 " const char *root,\n"
25206 " size_t *size_r,\n"
25207 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
25212 #: ../src/guestfs-actions.pod:2947
25213 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
25217 #: ../src/guestfs-actions.pod:2951
25218 msgid "guestfs_inspect_get_major_version"
25222 #: ../src/guestfs-actions.pod:2953
25226 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
25227 " const char *root);\n"
25232 #: ../src/guestfs-actions.pod:2975
25233 msgid "guestfs_inspect_get_minor_version"
25237 #: ../src/guestfs-actions.pod:2977
25241 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
25242 " const char *root);\n"
25247 #: ../src/guestfs-actions.pod:2986
25249 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25250 "C<guestfs_inspect_get_major_version>."
25254 #: ../src/guestfs-actions.pod:2993
25255 msgid "guestfs_inspect_get_mountpoints"
25259 #: ../src/guestfs-actions.pod:2995
25263 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
25264 " const char *root);\n"
25269 #: ../src/guestfs-actions.pod:3016
25271 "For operating systems like Windows which still use drive letters, this call "
25272 "will only return an entry for the first drive \"mounted on\" C</>. For "
25273 "information about the mapping of drive letters to partitions, see "
25274 "C<guestfs_inspect_get_drive_mappings>."
25278 #: ../src/guestfs-actions.pod:3022
25280 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25281 "C<guestfs_inspect_get_filesystems>."
25285 #: ../src/guestfs-actions.pod:3033
25286 msgid "guestfs_inspect_get_package_format"
25290 #: ../src/guestfs-actions.pod:3035
25294 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
25295 " const char *root);\n"
25300 #: ../src/guestfs-actions.pod:3039
25302 "This function and C<guestfs_inspect_get_package_management> return the "
25303 "package format and package management tool used by the inspected operating "
25304 "system. For example for Fedora these functions would return C<rpm> (package "
25305 "format) and C<yum> (package management)."
25309 #: ../src/guestfs-actions.pod:3057 ../src/guestfs-actions.pod:3085
25310 msgid "(Added in 1.7.5)"
25314 #: ../src/guestfs-actions.pod:3059
25315 msgid "guestfs_inspect_get_package_management"
25319 #: ../src/guestfs-actions.pod:3061
25323 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
25324 " const char *root);\n"
25329 #: ../src/guestfs-actions.pod:3065
25331 "C<guestfs_inspect_get_package_format> and this function return the package "
25332 "format and package management tool used by the inspected operating system. "
25333 "For example for Fedora these functions would return C<rpm> (package format) "
25334 "and C<yum> (package management)."
25338 #: ../src/guestfs-actions.pod:3087
25339 msgid "guestfs_inspect_get_product_name"
25343 #: ../src/guestfs-actions.pod:3089
25347 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
25348 " const char *root);\n"
25353 #: ../src/guestfs-actions.pod:3108
25354 msgid "guestfs_inspect_get_product_variant"
25358 #: ../src/guestfs-actions.pod:3110
25362 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
25363 " const char *root);\n"
25368 #: ../src/guestfs-actions.pod:3133
25370 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25371 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
25375 #: ../src/guestfs-actions.pod:3140
25376 msgid "(Added in 1.9.13)"
25380 #: ../src/guestfs-actions.pod:3142
25381 msgid "guestfs_inspect_get_roots"
25385 #: ../src/guestfs-actions.pod:3144
25389 " guestfs_inspect_get_roots (guestfs_h *g);\n"
25394 #: ../src/guestfs-actions.pod:3147
25396 "This function is a convenient way to get the list of root devices, as "
25397 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
25398 "the whole inspection process."
25402 #: ../src/guestfs-actions.pod:3151
25404 "This returns an empty list if either no root devices were found or the "
25405 "caller has not called C<guestfs_inspect_os>."
25409 #: ../src/guestfs-actions.pod:3160
25410 msgid "(Added in 1.7.3)"
25414 #: ../src/guestfs-actions.pod:3162
25415 msgid "guestfs_inspect_get_type"
25419 #: ../src/guestfs-actions.pod:3164
25423 " guestfs_inspect_get_type (guestfs_h *g,\n"
25424 " const char *root);\n"
25429 #: ../src/guestfs-actions.pod:3201
25430 msgid "guestfs_inspect_get_windows_current_control_set"
25434 #: ../src/guestfs-actions.pod:3203
25438 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
25439 " const char *root);\n"
25444 #: ../src/guestfs-actions.pod:3221
25445 msgid "guestfs_inspect_get_windows_systemroot"
25449 #: ../src/guestfs-actions.pod:3223
25453 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
25454 " const char *root);\n"
25459 #: ../src/guestfs-actions.pod:3239
25460 msgid "(Added in 1.5.25)"
25464 #: ../src/guestfs-actions.pod:3241
25465 msgid "guestfs_inspect_is_live"
25469 #: ../src/guestfs-actions.pod:3243
25473 " guestfs_inspect_is_live (guestfs_h *g,\n"
25474 " const char *root);\n"
25479 #: ../src/guestfs-actions.pod:3247
25481 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25482 "disk), then this returns true if a live image was detected on the disk."
25486 #: ../src/guestfs-actions.pod:3257
25487 msgid "guestfs_inspect_is_multipart"
25491 #: ../src/guestfs-actions.pod:3259
25495 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
25496 " const char *root);\n"
25501 #: ../src/guestfs-actions.pod:3263
25503 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25504 "disk), then this returns true if the disk is part of a set."
25508 #: ../src/guestfs-actions.pod:3273
25509 msgid "guestfs_inspect_is_netinst"
25513 #: ../src/guestfs-actions.pod:3275
25517 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
25518 " const char *root);\n"
25523 #: ../src/guestfs-actions.pod:3279
25525 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25526 "disk), then this returns true if the disk is a network installer, ie. not a "
25527 "self-contained install CD but one which is likely to require network access "
25528 "to complete the install."
25532 #: ../src/guestfs-actions.pod:3291
25533 msgid "guestfs_inspect_list_applications"
25537 #: ../src/guestfs-actions.pod:3293
25540 " struct guestfs_application_list *\n"
25541 " guestfs_inspect_list_applications (guestfs_h *g,\n"
25542 " const char *root);\n"
25547 #: ../src/guestfs-actions.pod:3299
25549 "I<Note:> This call works differently from other parts of the inspection "
25550 "API. You have to call C<guestfs_inspect_os>, then "
25551 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
25552 "this. Listing applications is a significantly more difficult operation "
25553 "which requires access to the full filesystem. Also note that unlike the "
25554 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
25555 "the libguestfs handle, this call actually reads parts of the mounted "
25556 "filesystems during the call."
25560 #: ../src/guestfs-actions.pod:3389
25562 "This function returns a C<struct guestfs_application_list *>, or NULL if "
25563 "there was an error. I<The caller must call C<guestfs_free_application_list> "
25568 #: ../src/guestfs-actions.pod:3393
25569 msgid "(Added in 1.7.8)"
25573 #: ../src/guestfs-actions.pod:3395
25574 msgid "guestfs_inspect_os"
25578 #: ../src/guestfs-actions.pod:3397
25582 " guestfs_inspect_os (guestfs_h *g);\n"
25587 #: ../src/guestfs-actions.pod:3413
25589 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
25590 "functions in order to query further information about each operating system, "
25591 "such as the name and version."
25595 #: ../src/guestfs-actions.pod:3418
25597 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
25598 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
25599 "the contents. This should be called with no disks currently mounted. The "
25600 "function may also use Augeas, so any existing Augeas handle will be closed."
25604 #: ../src/guestfs-actions.pod:3430 ../src/guestfs-actions.pod:3761
25605 #: ../src/guestfs-actions.pod:3843
25606 msgid "See also C<guestfs_list_filesystems>."
25610 #: ../src/guestfs-actions.pod:3438
25611 msgid "guestfs_is_blockdev"
25615 #: ../src/guestfs-actions.pod:3440
25619 " guestfs_is_blockdev (guestfs_h *g,\n"
25620 " const char *path);\n"
25625 #: ../src/guestfs-actions.pod:3447 ../src/guestfs-actions.pod:3476
25626 #: ../src/guestfs-actions.pod:3506 ../src/guestfs-actions.pod:3521
25627 #: ../src/guestfs-actions.pod:3537 ../src/guestfs-actions.pod:3593
25628 #: ../src/guestfs-actions.pod:3608
25629 msgid "See also C<guestfs_stat>."
25633 #: ../src/guestfs-actions.pod:3451 ../src/guestfs-actions.pod:3480
25634 #: ../src/guestfs-actions.pod:3525 ../src/guestfs-actions.pod:3597
25635 #: ../src/guestfs-actions.pod:3612
25636 msgid "(Added in 1.5.10)"
25640 #: ../src/guestfs-actions.pod:3453
25641 msgid "guestfs_is_busy"
25645 #: ../src/guestfs-actions.pod:3455
25649 " guestfs_is_busy (guestfs_h *g);\n"
25654 #: ../src/guestfs-actions.pod:3467
25655 msgid "guestfs_is_chardev"
25659 #: ../src/guestfs-actions.pod:3469
25663 " guestfs_is_chardev (guestfs_h *g,\n"
25664 " const char *path);\n"
25669 #: ../src/guestfs-actions.pod:3482
25670 msgid "guestfs_is_config"
25674 #: ../src/guestfs-actions.pod:3484
25678 " guestfs_is_config (guestfs_h *g);\n"
25683 #: ../src/guestfs-actions.pod:3496
25684 msgid "guestfs_is_dir"
25688 #: ../src/guestfs-actions.pod:3498
25692 " guestfs_is_dir (guestfs_h *g,\n"
25693 " const char *path);\n"
25698 #: ../src/guestfs-actions.pod:3512
25699 msgid "guestfs_is_fifo"
25703 #: ../src/guestfs-actions.pod:3514
25707 " guestfs_is_fifo (guestfs_h *g,\n"
25708 " const char *path);\n"
25713 #: ../src/guestfs-actions.pod:3527
25714 msgid "guestfs_is_file"
25718 #: ../src/guestfs-actions.pod:3529
25722 " guestfs_is_file (guestfs_h *g,\n"
25723 " const char *path);\n"
25728 #: ../src/guestfs-actions.pod:3543
25729 msgid "guestfs_is_launching"
25733 #: ../src/guestfs-actions.pod:3545
25737 " guestfs_is_launching (guestfs_h *g);\n"
25742 #: ../src/guestfs-actions.pod:3557
25743 msgid "guestfs_is_lv"
25747 #: ../src/guestfs-actions.pod:3559
25751 " guestfs_is_lv (guestfs_h *g,\n"
25752 " const char *device);\n"
25757 #: ../src/guestfs-actions.pod:3570
25758 msgid "guestfs_is_ready"
25762 #: ../src/guestfs-actions.pod:3572
25766 " guestfs_is_ready (guestfs_h *g);\n"
25771 #: ../src/guestfs-actions.pod:3584
25772 msgid "guestfs_is_socket"
25776 #: ../src/guestfs-actions.pod:3586
25780 " guestfs_is_socket (guestfs_h *g,\n"
25781 " const char *path);\n"
25786 #: ../src/guestfs-actions.pod:3599
25787 msgid "guestfs_is_symlink"
25791 #: ../src/guestfs-actions.pod:3601
25795 " guestfs_is_symlink (guestfs_h *g,\n"
25796 " const char *path);\n"
25801 #: ../src/guestfs-actions.pod:3614
25802 msgid "guestfs_is_zero"
25806 #: ../src/guestfs-actions.pod:3616
25810 " guestfs_is_zero (guestfs_h *g,\n"
25811 " const char *path);\n"
25816 #: ../src/guestfs-actions.pod:3625 ../src/guestfs-actions.pod:3639
25817 msgid "(Added in 1.11.8)"
25821 #: ../src/guestfs-actions.pod:3627
25822 msgid "guestfs_is_zero_device"
25826 #: ../src/guestfs-actions.pod:3629
25830 " guestfs_is_zero_device (guestfs_h *g,\n"
25831 " const char *device);\n"
25836 #: ../src/guestfs-actions.pod:3641
25837 msgid "guestfs_kill_subprocess"
25841 #: ../src/guestfs-actions.pod:3643
25845 " guestfs_kill_subprocess (guestfs_h *g);\n"
25850 #: ../src/guestfs-actions.pod:3652
25851 msgid "guestfs_launch"
25855 #: ../src/guestfs-actions.pod:3654
25859 " guestfs_launch (guestfs_h *g);\n"
25864 #: ../src/guestfs-actions.pod:3672
25865 msgid "guestfs_lchown"
25869 #: ../src/guestfs-actions.pod:3674
25873 " guestfs_lchown (guestfs_h *g,\n"
25876 " const char *path);\n"
25881 #: ../src/guestfs-actions.pod:3680
25883 "Change the file owner to C<owner> and group to C<group>. This is like "
25884 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
25885 "changed, not the target."
25889 #: ../src/guestfs-actions.pod:3692
25890 msgid "guestfs_lgetxattr"
25894 #: ../src/guestfs-actions.pod:3694
25898 " guestfs_lgetxattr (guestfs_h *g,\n"
25899 " const char *path,\n"
25900 " const char *name,\n"
25901 " size_t *size_r);\n"
25906 #: ../src/guestfs-actions.pod:3714
25907 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
25911 #: ../src/guestfs-actions.pod:3722
25912 msgid "guestfs_lgetxattrs"
25916 #: ../src/guestfs-actions.pod:3724
25919 " struct guestfs_xattr_list *\n"
25920 " guestfs_lgetxattrs (guestfs_h *g,\n"
25921 " const char *path);\n"
25926 #: ../src/guestfs-actions.pod:3728
25928 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
25929 "then it returns the extended attributes of the link itself."
25933 #: ../src/guestfs-actions.pod:3738
25934 msgid "guestfs_list_9p"
25938 #: ../src/guestfs-actions.pod:3740
25942 " guestfs_list_9p (guestfs_h *g);\n"
25947 #: ../src/guestfs-actions.pod:3752
25948 msgid "guestfs_list_devices"
25952 #: ../src/guestfs-actions.pod:3754
25956 " guestfs_list_devices (guestfs_h *g);\n"
25961 #: ../src/guestfs-actions.pod:3769
25962 msgid "guestfs_list_dm_devices"
25966 #: ../src/guestfs-actions.pod:3771
25970 " guestfs_list_dm_devices (guestfs_h *g);\n"
25975 #: ../src/guestfs-actions.pod:3776
25977 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
25978 "previous call to C<guestfs_luks_open>."
25982 #: ../src/guestfs-actions.pod:3779
25984 "Device mapper devices which correspond to logical volumes are I<not> "
25985 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
25990 #: ../src/guestfs-actions.pod:3787 ../src/guestfs-actions.pod:5243
25991 msgid "(Added in 1.11.15)"
25995 #: ../src/guestfs-actions.pod:3789
25996 msgid "guestfs_list_filesystems"
26000 #: ../src/guestfs-actions.pod:3791
26004 " guestfs_list_filesystems (guestfs_h *g);\n"
26009 #: ../src/guestfs-actions.pod:3811
26011 "This command runs other libguestfs commands, which might include "
26012 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
26013 "soon after launch and only when nothing is mounted."
26017 #: ../src/guestfs-actions.pod:3815
26019 "Not all of the filesystems returned will be mountable. In particular, swap "
26020 "partitions are returned in the list. Also this command does not check that "
26021 "each filesystem found is valid and mountable, and some filesystems might be "
26022 "mountable but require special options. Filesystems may not all belong to a "
26023 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
26027 #: ../src/guestfs-actions.pod:3829 ../src/guestfs-actions.pod:5604
26028 msgid "(Added in 1.5.15)"
26032 #: ../src/guestfs-actions.pod:3831
26033 msgid "guestfs_list_partitions"
26037 #: ../src/guestfs-actions.pod:3833
26041 " guestfs_list_partitions (guestfs_h *g);\n"
26046 #: ../src/guestfs-actions.pod:3840
26048 "This does not return logical volumes. For that you will need to call "
26053 #: ../src/guestfs-actions.pod:3851
26058 #: ../src/guestfs-actions.pod:3853
26062 " guestfs_ll (guestfs_h *g,\n"
26063 " const char *directory);\n"
26068 #: ../src/guestfs-actions.pod:3868
26073 #: ../src/guestfs-actions.pod:3870
26077 " guestfs_ln (guestfs_h *g,\n"
26078 " const char *target,\n"
26079 " const char *linkname);\n"
26084 #: ../src/guestfs-actions.pod:3881
26085 msgid "guestfs_ln_f"
26089 #: ../src/guestfs-actions.pod:3883
26093 " guestfs_ln_f (guestfs_h *g,\n"
26094 " const char *target,\n"
26095 " const char *linkname);\n"
26100 #: ../src/guestfs-actions.pod:3895
26101 msgid "guestfs_ln_s"
26105 #: ../src/guestfs-actions.pod:3897
26109 " guestfs_ln_s (guestfs_h *g,\n"
26110 " const char *target,\n"
26111 " const char *linkname);\n"
26116 #: ../src/guestfs-actions.pod:3908
26117 msgid "guestfs_ln_sf"
26121 #: ../src/guestfs-actions.pod:3910
26125 " guestfs_ln_sf (guestfs_h *g,\n"
26126 " const char *target,\n"
26127 " const char *linkname);\n"
26132 #: ../src/guestfs-actions.pod:3922
26133 msgid "guestfs_lremovexattr"
26137 #: ../src/guestfs-actions.pod:3924
26141 " guestfs_lremovexattr (guestfs_h *g,\n"
26142 " const char *xattr,\n"
26143 " const char *path);\n"
26148 #: ../src/guestfs-actions.pod:3929
26150 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
26151 "link, then it removes an extended attribute of the link itself."
26155 #: ../src/guestfs-actions.pod:3937
26160 #: ../src/guestfs-actions.pod:3939
26164 " guestfs_ls (guestfs_h *g,\n"
26165 " const char *directory);\n"
26170 #: ../src/guestfs-actions.pod:3947
26172 "This command is mostly useful for interactive sessions. Programs should "
26173 "probably use C<guestfs_readdir> instead."
26177 #: ../src/guestfs-actions.pod:3956
26178 msgid "guestfs_lsetxattr"
26182 #: ../src/guestfs-actions.pod:3958
26186 " guestfs_lsetxattr (guestfs_h *g,\n"
26187 " const char *xattr,\n"
26188 " const char *val,\n"
26190 " const char *path);\n"
26195 #: ../src/guestfs-actions.pod:3965
26197 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
26198 "then it sets an extended attribute of the link itself."
26202 #: ../src/guestfs-actions.pod:3973
26203 msgid "guestfs_lstat"
26207 #: ../src/guestfs-actions.pod:3975
26210 " struct guestfs_stat *\n"
26211 " guestfs_lstat (guestfs_h *g,\n"
26212 " const char *path);\n"
26217 #: ../src/guestfs-actions.pod:3981
26219 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
26220 "link, then the link is stat-ed, not the file it refers to."
26224 #: ../src/guestfs-actions.pod:3987 ../src/guestfs-actions.pod:6762
26226 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
26227 "error. I<The caller must call C<guestfs_free_stat> after use>."
26231 #: ../src/guestfs-actions.pod:3991 ../src/guestfs-actions.pod:6766
26232 #: ../src/guestfs-actions.pod:6784 ../src/guestfs-actions.pod:7165
26233 msgid "(Added in 0.9.2)"
26237 #: ../src/guestfs-actions.pod:3993
26238 msgid "guestfs_lstatlist"
26242 #: ../src/guestfs-actions.pod:3995
26245 " struct guestfs_stat_list *\n"
26246 " guestfs_lstatlist (guestfs_h *g,\n"
26247 " const char *path,\n"
26248 " char *const *names);\n"
26253 #: ../src/guestfs-actions.pod:4000
26255 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
26256 "files, where all files are in the directory C<path>. C<names> is the list "
26257 "of files from this directory."
26261 #: ../src/guestfs-actions.pod:4009
26263 "This call is intended for programs that want to efficiently list a directory "
26264 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
26265 "for a similarly efficient call for getting extended attributes. Very long "
26266 "directory listings might cause the protocol message size to be exceeded, "
26267 "causing this call to fail. The caller must split up such requests into "
26268 "smaller groups of names."
26272 #: ../src/guestfs-actions.pod:4017
26274 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
26275 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
26279 #: ../src/guestfs-actions.pod:4023
26280 msgid "guestfs_luks_add_key"
26284 #: ../src/guestfs-actions.pod:4025
26288 " guestfs_luks_add_key (guestfs_h *g,\n"
26289 " const char *device,\n"
26290 " const char *key,\n"
26291 " const char *newkey,\n"
26297 #: ../src/guestfs-actions.pod:4037
26299 "Note that if C<keyslot> already contains a key, then this command will "
26300 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
26304 #: ../src/guestfs-actions.pod:4043 ../src/guestfs-actions.pod:4083
26305 #: ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4126
26306 #: ../src/guestfs-actions.pod:4161 ../src/guestfs-actions.pod:4180
26308 "This function takes a key or passphrase parameter which could contain "
26309 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
26314 #: ../src/guestfs-actions.pod:4047 ../src/guestfs-actions.pod:4087
26315 #: ../src/guestfs-actions.pod:4110 ../src/guestfs-actions.pod:4130
26316 msgid "(Added in 1.5.2)"
26320 #: ../src/guestfs-actions.pod:4049
26321 msgid "guestfs_luks_close"
26325 #: ../src/guestfs-actions.pod:4051
26329 " guestfs_luks_close (guestfs_h *g,\n"
26330 " const char *device);\n"
26335 #: ../src/guestfs-actions.pod:4055
26337 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
26338 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
26339 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
26340 "underlying block device."
26344 #: ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4165
26345 #: ../src/guestfs-actions.pod:4184 ../src/guestfs-actions.pod:4234
26346 #: ../src/guestfs-actions.pod:4282
26347 msgid "(Added in 1.5.1)"
26351 #: ../src/guestfs-actions.pod:4065
26352 msgid "guestfs_luks_format"
26356 #: ../src/guestfs-actions.pod:4067
26360 " guestfs_luks_format (guestfs_h *g,\n"
26361 " const char *device,\n"
26362 " const char *key,\n"
26368 #: ../src/guestfs-actions.pod:4089
26369 msgid "guestfs_luks_format_cipher"
26373 #: ../src/guestfs-actions.pod:4091
26377 " guestfs_luks_format_cipher (guestfs_h *g,\n"
26378 " const char *device,\n"
26379 " const char *key,\n"
26381 " const char *cipher);\n"
26386 #: ../src/guestfs-actions.pod:4098
26388 "This command is the same as C<guestfs_luks_format> but it also allows you to "
26389 "set the C<cipher> used."
26393 #: ../src/guestfs-actions.pod:4112
26394 msgid "guestfs_luks_kill_slot"
26398 #: ../src/guestfs-actions.pod:4114
26402 " guestfs_luks_kill_slot (guestfs_h *g,\n"
26403 " const char *device,\n"
26404 " const char *key,\n"
26410 #: ../src/guestfs-actions.pod:4132
26411 msgid "guestfs_luks_open"
26415 #: ../src/guestfs-actions.pod:4134
26419 " guestfs_luks_open (guestfs_h *g,\n"
26420 " const char *device,\n"
26421 " const char *key,\n"
26422 " const char *mapname);\n"
26427 #: ../src/guestfs-actions.pod:4152
26429 "If this block device contains LVM volume groups, then calling "
26430 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
26435 #: ../src/guestfs-actions.pod:4156
26436 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
26440 #: ../src/guestfs-actions.pod:4167
26441 msgid "guestfs_luks_open_ro"
26445 #: ../src/guestfs-actions.pod:4169
26449 " guestfs_luks_open_ro (guestfs_h *g,\n"
26450 " const char *device,\n"
26451 " const char *key,\n"
26452 " const char *mapname);\n"
26457 #: ../src/guestfs-actions.pod:4175
26459 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
26464 #: ../src/guestfs-actions.pod:4186
26465 msgid "guestfs_lvcreate"
26469 #: ../src/guestfs-actions.pod:4188
26473 " guestfs_lvcreate (guestfs_h *g,\n"
26474 " const char *logvol,\n"
26475 " const char *volgroup,\n"
26481 #: ../src/guestfs-actions.pod:4201
26482 msgid "guestfs_lvm_canonical_lv_name"
26486 #: ../src/guestfs-actions.pod:4203
26490 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
26491 " const char *lvname);\n"
26496 #: ../src/guestfs-actions.pod:4214
26497 msgid "See also C<guestfs_is_lv>."
26501 #: ../src/guestfs-actions.pod:4219
26502 msgid "(Added in 1.5.24)"
26506 #: ../src/guestfs-actions.pod:4221
26507 msgid "guestfs_lvm_clear_filter"
26511 #: ../src/guestfs-actions.pod:4223
26515 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
26520 #: ../src/guestfs-actions.pod:4226
26522 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
26523 "see every block device."
26527 #: ../src/guestfs-actions.pod:4236
26528 msgid "guestfs_lvm_remove_all"
26532 #: ../src/guestfs-actions.pod:4238
26536 " guestfs_lvm_remove_all (guestfs_h *g);\n"
26541 #: ../src/guestfs-actions.pod:4251
26542 msgid "guestfs_lvm_set_filter"
26546 #: ../src/guestfs-actions.pod:4253
26550 " guestfs_lvm_set_filter (guestfs_h *g,\n"
26551 " char *const *devices);\n"
26556 #: ../src/guestfs-actions.pod:4284
26557 msgid "guestfs_lvremove"
26561 #: ../src/guestfs-actions.pod:4286
26565 " guestfs_lvremove (guestfs_h *g,\n"
26566 " const char *device);\n"
26571 #: ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:5701
26572 #: ../src/guestfs-actions.pod:7535
26573 msgid "(Added in 1.0.13)"
26577 #: ../src/guestfs-actions.pod:4300
26578 msgid "guestfs_lvrename"
26582 #: ../src/guestfs-actions.pod:4302
26586 " guestfs_lvrename (guestfs_h *g,\n"
26587 " const char *logvol,\n"
26588 " const char *newlogvol);\n"
26593 #: ../src/guestfs-actions.pod:4311 ../src/guestfs-actions.pod:7548
26594 msgid "(Added in 1.0.83)"
26598 #: ../src/guestfs-actions.pod:4313
26599 msgid "guestfs_lvresize"
26603 #: ../src/guestfs-actions.pod:4315
26607 " guestfs_lvresize (guestfs_h *g,\n"
26608 " const char *device,\n"
26614 #: ../src/guestfs-actions.pod:4328
26615 msgid "guestfs_lvresize_free"
26619 #: ../src/guestfs-actions.pod:4330
26623 " guestfs_lvresize_free (guestfs_h *g,\n"
26624 " const char *lv,\n"
26630 #: ../src/guestfs-actions.pod:4343
26631 msgid "(Added in 1.3.3)"
26635 #: ../src/guestfs-actions.pod:4345
26636 msgid "guestfs_lvs"
26640 #: ../src/guestfs-actions.pod:4347
26644 " guestfs_lvs (guestfs_h *g);\n"
26649 #: ../src/guestfs-actions.pod:4356
26650 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
26654 #: ../src/guestfs-actions.pod:4364
26655 msgid "guestfs_lvs_full"
26659 #: ../src/guestfs-actions.pod:4366
26662 " struct guestfs_lvm_lv_list *\n"
26663 " guestfs_lvs_full (guestfs_h *g);\n"
26668 #: ../src/guestfs-actions.pod:4372
26670 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
26671 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
26675 #: ../src/guestfs-actions.pod:4378
26676 msgid "guestfs_lvuuid"
26680 #: ../src/guestfs-actions.pod:4380
26684 " guestfs_lvuuid (guestfs_h *g,\n"
26685 " const char *device);\n"
26690 #: ../src/guestfs-actions.pod:4391
26691 msgid "guestfs_lxattrlist"
26695 #: ../src/guestfs-actions.pod:4393
26698 " struct guestfs_xattr_list *\n"
26699 " guestfs_lxattrlist (guestfs_h *g,\n"
26700 " const char *path,\n"
26701 " char *const *names);\n"
26706 #: ../src/guestfs-actions.pod:4412
26708 "This call is intended for programs that want to efficiently list a directory "
26709 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
26710 "a similarly efficient call for getting standard stats. Very long directory "
26711 "listings might cause the protocol message size to be exceeded, causing this "
26712 "call to fail. The caller must split up such requests into smaller groups of "
26717 #: ../src/guestfs-actions.pod:4426
26718 msgid "guestfs_mkdir"
26722 #: ../src/guestfs-actions.pod:4428
26726 " guestfs_mkdir (guestfs_h *g,\n"
26727 " const char *path);\n"
26732 #: ../src/guestfs-actions.pod:4438
26733 msgid "guestfs_mkdir_mode"
26737 #: ../src/guestfs-actions.pod:4440
26741 " guestfs_mkdir_mode (guestfs_h *g,\n"
26742 " const char *path,\n"
26748 #: ../src/guestfs-actions.pod:4452
26749 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
26753 #: ../src/guestfs-actions.pod:4458
26754 msgid "guestfs_mkdir_p"
26758 #: ../src/guestfs-actions.pod:4460
26762 " guestfs_mkdir_p (guestfs_h *g,\n"
26763 " const char *path);\n"
26768 #: ../src/guestfs-actions.pod:4471
26769 msgid "guestfs_mkdtemp"
26773 #: ../src/guestfs-actions.pod:4473
26777 " guestfs_mkdtemp (guestfs_h *g,\n"
26778 " const char *template);\n"
26783 #: ../src/guestfs-actions.pod:4501
26784 msgid "guestfs_mke2fs_J"
26788 #: ../src/guestfs-actions.pod:4503
26792 " guestfs_mke2fs_J (guestfs_h *g,\n"
26793 " const char *fstype,\n"
26794 " int blocksize,\n"
26795 " const char *device,\n"
26796 " const char *journal);\n"
26801 #: ../src/guestfs-actions.pod:4516
26802 msgid "See also C<guestfs_mke2journal>."
26806 #: ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4538
26807 #: ../src/guestfs-actions.pod:4556 ../src/guestfs-actions.pod:4572
26808 #: ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4600
26809 #: ../src/guestfs-actions.pod:4659 ../src/guestfs-actions.pod:4936
26810 msgid "(Added in 1.0.68)"
26814 #: ../src/guestfs-actions.pod:4522
26815 msgid "guestfs_mke2fs_JL"
26819 #: ../src/guestfs-actions.pod:4524
26823 " guestfs_mke2fs_JL (guestfs_h *g,\n"
26824 " const char *fstype,\n"
26825 " int blocksize,\n"
26826 " const char *device,\n"
26827 " const char *label);\n"
26832 #: ../src/guestfs-actions.pod:4534
26833 msgid "See also C<guestfs_mke2journal_L>."
26837 #: ../src/guestfs-actions.pod:4540
26838 msgid "guestfs_mke2fs_JU"
26842 #: ../src/guestfs-actions.pod:4542
26846 " guestfs_mke2fs_JU (guestfs_h *g,\n"
26847 " const char *fstype,\n"
26848 " int blocksize,\n"
26849 " const char *device,\n"
26850 " const char *uuid);\n"
26855 #: ../src/guestfs-actions.pod:4552
26856 msgid "See also C<guestfs_mke2journal_U>."
26860 #: ../src/guestfs-actions.pod:4558
26861 msgid "guestfs_mke2journal"
26865 #: ../src/guestfs-actions.pod:4560
26869 " guestfs_mke2journal (guestfs_h *g,\n"
26870 " int blocksize,\n"
26871 " const char *device);\n"
26876 #: ../src/guestfs-actions.pod:4574
26877 msgid "guestfs_mke2journal_L"
26881 #: ../src/guestfs-actions.pod:4576
26885 " guestfs_mke2journal_L (guestfs_h *g,\n"
26886 " int blocksize,\n"
26887 " const char *label,\n"
26888 " const char *device);\n"
26893 #: ../src/guestfs-actions.pod:4588
26894 msgid "guestfs_mke2journal_U"
26898 #: ../src/guestfs-actions.pod:4590
26902 " guestfs_mke2journal_U (guestfs_h *g,\n"
26903 " int blocksize,\n"
26904 " const char *uuid,\n"
26905 " const char *device);\n"
26910 #: ../src/guestfs-actions.pod:4602
26911 msgid "guestfs_mkfifo"
26915 #: ../src/guestfs-actions.pod:4604
26919 " guestfs_mkfifo (guestfs_h *g,\n"
26921 " const char *path);\n"
26926 #: ../src/guestfs-actions.pod:4609
26928 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
26929 "is just a convenient wrapper around C<guestfs_mknod>."
26933 #: ../src/guestfs-actions.pod:4619
26934 msgid "guestfs_mkfs"
26938 #: ../src/guestfs-actions.pod:4621
26942 " guestfs_mkfs (guestfs_h *g,\n"
26943 " const char *fstype,\n"
26944 " const char *device);\n"
26949 #: ../src/guestfs-actions.pod:4634
26950 msgid "guestfs_mkfs_b"
26954 #: ../src/guestfs-actions.pod:4636
26958 " guestfs_mkfs_b (guestfs_h *g,\n"
26959 " const char *fstype,\n"
26960 " int blocksize,\n"
26961 " const char *device);\n"
26966 #: ../src/guestfs-actions.pod:4642
26968 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
26969 "block size of the resulting filesystem. Supported block sizes depend on the "
26970 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
26974 #: ../src/guestfs-actions.pod:4652
26976 "This function is deprecated. In new code, use the L</guestfs_mkfs_opts> "
26981 #: ../src/guestfs-actions.pod:4661
26982 msgid "guestfs_mkfs_opts"
26986 #: ../src/guestfs-actions.pod:4663
26990 " guestfs_mkfs_opts (guestfs_h *g,\n"
26991 " const char *fstype,\n"
26992 " const char *device,\n"
26998 #: ../src/guestfs-actions.pod:4674
27001 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
27002 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
27003 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
27004 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
27009 #: ../src/guestfs-actions.pod:4722
27010 msgid "(Added in 1.7.19)"
27014 #: ../src/guestfs-actions.pod:4724
27015 msgid "guestfs_mkfs_opts_va"
27019 #: ../src/guestfs-actions.pod:4726
27023 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
27024 " const char *fstype,\n"
27025 " const char *device,\n"
27026 " va_list args);\n"
27031 #: ../src/guestfs-actions.pod:4732
27032 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
27036 #: ../src/guestfs-actions.pod:4736
27037 msgid "guestfs_mkfs_opts_argv"
27041 #: ../src/guestfs-actions.pod:4738
27045 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
27046 " const char *fstype,\n"
27047 " const char *device,\n"
27048 " const struct guestfs_mkfs_opts_argv *optargs);\n"
27053 #: ../src/guestfs-actions.pod:4744
27054 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
27058 #: ../src/guestfs-actions.pod:4748
27059 msgid "guestfs_mkmountpoint"
27063 #: ../src/guestfs-actions.pod:4750
27067 " guestfs_mkmountpoint (guestfs_h *g,\n"
27068 " const char *exemptpath);\n"
27073 #: ../src/guestfs-actions.pod:4754
27075 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
27076 "that can be used to create extra mountpoints before mounting the first "
27081 #: ../src/guestfs-actions.pod:4778
27083 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
27084 "may get unexpected errors if you try to mix these calls. It is safest to "
27085 "manually unmount filesystems and remove mountpoints after use."
27089 #: ../src/guestfs-actions.pod:4782
27091 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
27092 "first, so for this to work for manual mountpoints, you must ensure that the "
27093 "innermost mountpoints have the longest pathnames, as in the example code "
27098 #: ../src/guestfs-actions.pod:4789
27100 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
27101 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
27102 "can also trigger these issues."
27106 #: ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:5111
27107 #: ../src/guestfs-actions.pod:6121
27108 msgid "(Added in 1.0.62)"
27112 #: ../src/guestfs-actions.pod:4797
27113 msgid "guestfs_mknod"
27117 #: ../src/guestfs-actions.pod:4799
27121 " guestfs_mknod (guestfs_h *g,\n"
27125 " const char *path);\n"
27130 #: ../src/guestfs-actions.pod:4814
27132 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
27133 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
27134 "regular file). These constants are available in the standard Linux header "
27135 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
27136 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
27137 "the appropriate constant for you."
27141 #: ../src/guestfs-actions.pod:4828
27142 msgid "guestfs_mknod_b"
27146 #: ../src/guestfs-actions.pod:4830
27150 " guestfs_mknod_b (guestfs_h *g,\n"
27154 " const char *path);\n"
27159 #: ../src/guestfs-actions.pod:4837
27161 "This call creates a block device node called C<path> with mode C<mode> and "
27162 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27163 "wrapper around C<guestfs_mknod>."
27167 #: ../src/guestfs-actions.pod:4847
27168 msgid "guestfs_mknod_c"
27172 #: ../src/guestfs-actions.pod:4849
27176 " guestfs_mknod_c (guestfs_h *g,\n"
27180 " const char *path);\n"
27185 #: ../src/guestfs-actions.pod:4856
27187 "This call creates a char device node called C<path> with mode C<mode> and "
27188 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27189 "wrapper around C<guestfs_mknod>."
27193 #: ../src/guestfs-actions.pod:4866
27194 msgid "guestfs_mkswap"
27198 #: ../src/guestfs-actions.pod:4868
27202 " guestfs_mkswap (guestfs_h *g,\n"
27203 " const char *device);\n"
27208 #: ../src/guestfs-actions.pod:4878
27209 msgid "guestfs_mkswap_L"
27213 #: ../src/guestfs-actions.pod:4880
27217 " guestfs_mkswap_L (guestfs_h *g,\n"
27218 " const char *label,\n"
27219 " const char *device);\n"
27224 #: ../src/guestfs-actions.pod:4895
27225 msgid "guestfs_mkswap_U"
27229 #: ../src/guestfs-actions.pod:4897
27233 " guestfs_mkswap_U (guestfs_h *g,\n"
27234 " const char *uuid,\n"
27235 " const char *device);\n"
27240 #: ../src/guestfs-actions.pod:4908
27241 msgid "guestfs_mkswap_file"
27245 #: ../src/guestfs-actions.pod:4910
27249 " guestfs_mkswap_file (guestfs_h *g,\n"
27250 " const char *path);\n"
27255 #: ../src/guestfs-actions.pod:4916
27257 "This command just writes a swap file signature to an existing file. To "
27258 "create the file itself, use something like C<guestfs_fallocate>."
27262 #: ../src/guestfs-actions.pod:4923
27263 msgid "guestfs_modprobe"
27267 #: ../src/guestfs-actions.pod:4925
27271 " guestfs_modprobe (guestfs_h *g,\n"
27272 " const char *modulename);\n"
27277 #: ../src/guestfs-actions.pod:4938
27278 msgid "guestfs_mount"
27282 #: ../src/guestfs-actions.pod:4940
27286 " guestfs_mount (guestfs_h *g,\n"
27287 " const char *device,\n"
27288 " const char *mountpoint);\n"
27293 #: ../src/guestfs-actions.pod:4959
27295 "B<Important note:> When you use this call, the filesystem options C<sync> "
27296 "and C<noatime> are set implicitly. This was originally done because we "
27297 "thought it would improve reliability, but it turns out that I<-o sync> has a "
27298 "very large negative performance impact and negligible effect on "
27299 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
27300 "in any code that needs performance, and instead use C<guestfs_mount_options> "
27301 "(use an empty string for the first parameter if you don't want any options)."
27305 #: ../src/guestfs-actions.pod:4971
27307 "This function is deprecated. In new code, use the L</guestfs_mount_options> "
27312 #: ../src/guestfs-actions.pod:4980
27313 msgid "guestfs_mount_9p"
27317 #: ../src/guestfs-actions.pod:4982
27321 " guestfs_mount_9p (guestfs_h *g,\n"
27322 " const char *mounttag,\n"
27323 " const char *mountpoint,\n"
27329 #: ../src/guestfs-actions.pod:4993
27332 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
27337 #: ../src/guestfs-actions.pod:5006
27338 msgid "guestfs_mount_9p_va"
27342 #: ../src/guestfs-actions.pod:5008
27346 " guestfs_mount_9p_va (guestfs_h *g,\n"
27347 " const char *mounttag,\n"
27348 " const char *mountpoint,\n"
27349 " va_list args);\n"
27354 #: ../src/guestfs-actions.pod:5014
27355 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
27359 #: ../src/guestfs-actions.pod:5018
27360 msgid "guestfs_mount_9p_argv"
27364 #: ../src/guestfs-actions.pod:5020
27368 " guestfs_mount_9p_argv (guestfs_h *g,\n"
27369 " const char *mounttag,\n"
27370 " const char *mountpoint,\n"
27371 " const struct guestfs_mount_9p_argv *optargs);\n"
27376 #: ../src/guestfs-actions.pod:5026
27377 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
27381 #: ../src/guestfs-actions.pod:5030
27382 msgid "guestfs_mount_loop"
27386 #: ../src/guestfs-actions.pod:5032
27390 " guestfs_mount_loop (guestfs_h *g,\n"
27391 " const char *file,\n"
27392 " const char *mountpoint);\n"
27397 #: ../src/guestfs-actions.pod:5045
27398 msgid "guestfs_mount_options"
27402 #: ../src/guestfs-actions.pod:5047
27406 " guestfs_mount_options (guestfs_h *g,\n"
27407 " const char *options,\n"
27408 " const char *device,\n"
27409 " const char *mountpoint);\n"
27414 #: ../src/guestfs-actions.pod:5053
27416 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27417 "the mount options as for the L<mount(8)> I<-o> flag."
27421 #: ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5077
27422 #: ../src/guestfs-actions.pod:5094
27423 msgid "(Added in 1.0.10)"
27427 #: ../src/guestfs-actions.pod:5065
27428 msgid "guestfs_mount_ro"
27432 #: ../src/guestfs-actions.pod:5067
27436 " guestfs_mount_ro (guestfs_h *g,\n"
27437 " const char *device,\n"
27438 " const char *mountpoint);\n"
27443 #: ../src/guestfs-actions.pod:5072
27445 "This is the same as the C<guestfs_mount> command, but it mounts the "
27446 "filesystem with the read-only (I<-o ro>) flag."
27450 #: ../src/guestfs-actions.pod:5079
27451 msgid "guestfs_mount_vfs"
27455 #: ../src/guestfs-actions.pod:5081
27459 " guestfs_mount_vfs (guestfs_h *g,\n"
27460 " const char *options,\n"
27461 " const char *vfstype,\n"
27462 " const char *device,\n"
27463 " const char *mountpoint);\n"
27468 #: ../src/guestfs-actions.pod:5088
27470 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27471 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
27476 #: ../src/guestfs-actions.pod:5096
27477 msgid "guestfs_mountpoints"
27481 #: ../src/guestfs-actions.pod:5098
27485 " guestfs_mountpoints (guestfs_h *g);\n"
27490 #: ../src/guestfs-actions.pod:5101
27492 "This call is similar to C<guestfs_mounts>. That call returns a list of "
27493 "devices. This one returns a hash table (map) of device name to directory "
27494 "where the device is mounted."
27498 #: ../src/guestfs-actions.pod:5113
27499 msgid "guestfs_mounts"
27503 #: ../src/guestfs-actions.pod:5115
27507 " guestfs_mounts (guestfs_h *g);\n"
27512 #: ../src/guestfs-actions.pod:5123
27513 msgid "See also: C<guestfs_mountpoints>"
27517 #: ../src/guestfs-actions.pod:5131
27522 #: ../src/guestfs-actions.pod:5133
27526 " guestfs_mv (guestfs_h *g,\n"
27527 " const char *src,\n"
27528 " const char *dest);\n"
27533 #: ../src/guestfs-actions.pod:5145
27534 msgid "guestfs_ntfs_3g_probe"
27538 #: ../src/guestfs-actions.pod:5147
27542 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
27544 " const char *device);\n"
27549 #: ../src/guestfs-actions.pod:5166
27550 msgid "(Added in 1.0.43)"
27554 #: ../src/guestfs-actions.pod:5168
27555 msgid "guestfs_ntfsresize"
27559 #: ../src/guestfs-actions.pod:5170
27563 " guestfs_ntfsresize (guestfs_h *g,\n"
27564 " const char *device);\n"
27569 #: ../src/guestfs-actions.pod:5189 ../src/guestfs-actions.pod:5279
27571 "This function is deprecated. In new code, use the L</"
27572 "guestfs_ntfsresize_opts> call instead."
27576 #: ../src/guestfs-actions.pod:5198
27577 msgid "guestfs_ntfsresize_opts"
27581 #: ../src/guestfs-actions.pod:5200
27585 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
27586 " const char *device,\n"
27592 #: ../src/guestfs-actions.pod:5210
27595 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
27596 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
27601 #: ../src/guestfs-actions.pod:5230
27603 "After the resize operation, the filesystem is always marked as requiring a "
27604 "consistency check (for safety). You have to boot into Windows to perform "
27605 "this check and clear this condition. If you I<don't> set the C<force> "
27606 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
27607 "times on a single filesystem without booting into Windows between each "
27612 #: ../src/guestfs-actions.pod:5245
27613 msgid "guestfs_ntfsresize_opts_va"
27617 #: ../src/guestfs-actions.pod:5247
27621 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
27622 " const char *device,\n"
27623 " va_list args);\n"
27628 #: ../src/guestfs-actions.pod:5252
27629 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
27633 #: ../src/guestfs-actions.pod:5256
27634 msgid "guestfs_ntfsresize_opts_argv"
27638 #: ../src/guestfs-actions.pod:5258
27642 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
27643 " const char *device,\n"
27644 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
27649 #: ../src/guestfs-actions.pod:5263
27650 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
27654 #: ../src/guestfs-actions.pod:5267
27655 msgid "guestfs_ntfsresize_size"
27659 #: ../src/guestfs-actions.pod:5269
27663 " guestfs_ntfsresize_size (guestfs_h *g,\n"
27664 " const char *device,\n"
27665 " int64_t size);\n"
27670 #: ../src/guestfs-actions.pod:5274
27672 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
27673 "to specify the new size (in bytes) explicitly."
27677 #: ../src/guestfs-actions.pod:5286 ../src/guestfs-actions.pod:5728
27678 #: ../src/guestfs-actions.pod:5801 ../src/guestfs-actions.pod:6069
27679 #: ../src/guestfs-actions.pod:7692
27680 msgid "(Added in 1.3.14)"
27684 #: ../src/guestfs-actions.pod:5288
27685 msgid "guestfs_part_add"
27689 #: ../src/guestfs-actions.pod:5290
27693 " guestfs_part_add (guestfs_h *g,\n"
27694 " const char *device,\n"
27695 " const char *prlogex,\n"
27696 " int64_t startsect,\n"
27697 " int64_t endsect);\n"
27702 #: ../src/guestfs-actions.pod:5297
27704 "This command adds a partition to C<device>. If there is no partition table "
27705 "on the device, call C<guestfs_part_init> first."
27709 #: ../src/guestfs-actions.pod:5309
27711 "Creating a partition which covers the whole disk is not so easy. Use "
27712 "C<guestfs_part_disk> to do that."
27716 #: ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:5352
27717 #: ../src/guestfs-actions.pod:5405 ../src/guestfs-actions.pod:5489
27718 #: ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:5546
27719 #: ../src/guestfs-actions.pod:5586
27720 msgid "(Added in 1.0.78)"
27724 #: ../src/guestfs-actions.pod:5316
27725 msgid "guestfs_part_del"
27729 #: ../src/guestfs-actions.pod:5318
27733 " guestfs_part_del (guestfs_h *g,\n"
27734 " const char *device,\n"
27740 #: ../src/guestfs-actions.pod:5333
27741 msgid "guestfs_part_disk"
27745 #: ../src/guestfs-actions.pod:5335
27749 " guestfs_part_disk (guestfs_h *g,\n"
27750 " const char *device,\n"
27751 " const char *parttype);\n"
27756 #: ../src/guestfs-actions.pod:5340
27758 "This command is simply a combination of C<guestfs_part_init> followed by "
27759 "C<guestfs_part_add> to create a single primary partition covering the whole "
27764 #: ../src/guestfs-actions.pod:5344
27766 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27767 "possible values are described in C<guestfs_part_init>."
27771 #: ../src/guestfs-actions.pod:5354
27772 msgid "guestfs_part_get_bootable"
27776 #: ../src/guestfs-actions.pod:5356
27780 " guestfs_part_get_bootable (guestfs_h *g,\n"
27781 " const char *device,\n"
27787 #: ../src/guestfs-actions.pod:5364
27788 msgid "See also C<guestfs_part_set_bootable>."
27792 #: ../src/guestfs-actions.pod:5370
27793 msgid "guestfs_part_get_mbr_id"
27797 #: ../src/guestfs-actions.pod:5372
27801 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
27802 " const char *device,\n"
27808 #: ../src/guestfs-actions.pod:5380 ../src/guestfs-actions.pod:5562
27810 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
27811 "undefined results for other partition table types (see "
27812 "C<guestfs_part_get_parttype>)."
27816 #: ../src/guestfs-actions.pod:5388
27817 msgid "guestfs_part_get_parttype"
27821 #: ../src/guestfs-actions.pod:5390
27825 " guestfs_part_get_parttype (guestfs_h *g,\n"
27826 " const char *device);\n"
27831 #: ../src/guestfs-actions.pod:5397
27833 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
27834 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
27835 "possible, although unusual. See C<guestfs_part_init> for a full list."
27839 #: ../src/guestfs-actions.pod:5407
27840 msgid "guestfs_part_init"
27844 #: ../src/guestfs-actions.pod:5409
27848 " guestfs_part_init (guestfs_h *g,\n"
27849 " const char *device,\n"
27850 " const char *parttype);\n"
27855 #: ../src/guestfs-actions.pod:5418
27857 "Initially there are no partitions. Following this, you should call "
27858 "C<guestfs_part_add> for each partition required."
27862 #: ../src/guestfs-actions.pod:5491
27863 msgid "guestfs_part_list"
27867 #: ../src/guestfs-actions.pod:5493
27870 " struct guestfs_partition_list *\n"
27871 " guestfs_part_list (guestfs_h *g,\n"
27872 " const char *device);\n"
27877 #: ../src/guestfs-actions.pod:5510
27879 "Start of the partition I<in bytes>. To get sectors you have to divide by "
27880 "the device's sector size, see C<guestfs_blockdev_getss>."
27884 #: ../src/guestfs-actions.pod:5523
27886 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
27887 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
27892 #: ../src/guestfs-actions.pod:5529
27893 msgid "guestfs_part_set_bootable"
27897 #: ../src/guestfs-actions.pod:5531
27901 " guestfs_part_set_bootable (guestfs_h *g,\n"
27902 " const char *device,\n"
27904 " int bootable);\n"
27909 #: ../src/guestfs-actions.pod:5548
27910 msgid "guestfs_part_set_mbr_id"
27914 #: ../src/guestfs-actions.pod:5550
27918 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
27919 " const char *device,\n"
27926 #: ../src/guestfs-actions.pod:5570
27927 msgid "guestfs_part_set_name"
27931 #: ../src/guestfs-actions.pod:5572
27935 " guestfs_part_set_name (guestfs_h *g,\n"
27936 " const char *device,\n"
27938 " const char *name);\n"
27943 #: ../src/guestfs-actions.pod:5588
27944 msgid "guestfs_part_to_dev"
27948 #: ../src/guestfs-actions.pod:5590
27952 " guestfs_part_to_dev (guestfs_h *g,\n"
27953 " const char *partition);\n"
27958 #: ../src/guestfs-actions.pod:5598
27960 "The named partition must exist, for example as a string returned from "
27961 "C<guestfs_list_partitions>."
27965 #: ../src/guestfs-actions.pod:5606
27966 msgid "guestfs_ping_daemon"
27970 #: ../src/guestfs-actions.pod:5608
27974 " guestfs_ping_daemon (guestfs_h *g);\n"
27979 #: ../src/guestfs-actions.pod:5620
27980 msgid "guestfs_pread"
27984 #: ../src/guestfs-actions.pod:5622
27988 " guestfs_pread (guestfs_h *g,\n"
27989 " const char *path,\n"
27991 " int64_t offset,\n"
27992 " size_t *size_r);\n"
27997 #: ../src/guestfs-actions.pod:5635
27998 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
28002 #: ../src/guestfs-actions.pod:5646
28003 msgid "guestfs_pread_device"
28007 #: ../src/guestfs-actions.pod:5648
28011 " guestfs_pread_device (guestfs_h *g,\n"
28012 " const char *device,\n"
28014 " int64_t offset,\n"
28015 " size_t *size_r);\n"
28020 #: ../src/guestfs-actions.pod:5661
28021 msgid "See also C<guestfs_pread>."
28025 #: ../src/guestfs-actions.pod:5670
28026 msgid "(Added in 1.5.21)"
28030 #: ../src/guestfs-actions.pod:5672
28031 msgid "guestfs_pvcreate"
28035 #: ../src/guestfs-actions.pod:5674
28039 " guestfs_pvcreate (guestfs_h *g,\n"
28040 " const char *device);\n"
28045 #: ../src/guestfs-actions.pod:5686
28046 msgid "guestfs_pvremove"
28050 #: ../src/guestfs-actions.pod:5688
28054 " guestfs_pvremove (guestfs_h *g,\n"
28055 " const char *device);\n"
28060 #: ../src/guestfs-actions.pod:5703
28061 msgid "guestfs_pvresize"
28065 #: ../src/guestfs-actions.pod:5705
28069 " guestfs_pvresize (guestfs_h *g,\n"
28070 " const char *device);\n"
28075 #: ../src/guestfs-actions.pod:5716
28076 msgid "guestfs_pvresize_size"
28080 #: ../src/guestfs-actions.pod:5718
28084 " guestfs_pvresize_size (guestfs_h *g,\n"
28085 " const char *device,\n"
28086 " int64_t size);\n"
28091 #: ../src/guestfs-actions.pod:5723
28093 "This command is the same as C<guestfs_pvresize> except that it allows you to "
28094 "specify the new size (in bytes) explicitly."
28098 #: ../src/guestfs-actions.pod:5730
28099 msgid "guestfs_pvs"
28103 #: ../src/guestfs-actions.pod:5732
28107 " guestfs_pvs (guestfs_h *g);\n"
28112 #: ../src/guestfs-actions.pod:5741
28113 msgid "See also C<guestfs_pvs_full>."
28117 #: ../src/guestfs-actions.pod:5749
28118 msgid "guestfs_pvs_full"
28122 #: ../src/guestfs-actions.pod:5751
28125 " struct guestfs_lvm_pv_list *\n"
28126 " guestfs_pvs_full (guestfs_h *g);\n"
28131 #: ../src/guestfs-actions.pod:5757
28133 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
28134 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
28138 #: ../src/guestfs-actions.pod:5763
28139 msgid "guestfs_pvuuid"
28143 #: ../src/guestfs-actions.pod:5765
28147 " guestfs_pvuuid (guestfs_h *g,\n"
28148 " const char *device);\n"
28153 #: ../src/guestfs-actions.pod:5776
28154 msgid "guestfs_pwrite"
28158 #: ../src/guestfs-actions.pod:5778
28162 " guestfs_pwrite (guestfs_h *g,\n"
28163 " const char *path,\n"
28164 " const char *content,\n"
28165 " size_t content_size,\n"
28166 " int64_t offset);\n"
28171 #: ../src/guestfs-actions.pod:5794
28172 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
28176 #: ../src/guestfs-actions.pod:5803
28177 msgid "guestfs_pwrite_device"
28181 #: ../src/guestfs-actions.pod:5805
28185 " guestfs_pwrite_device (guestfs_h *g,\n"
28186 " const char *device,\n"
28187 " const char *content,\n"
28188 " size_t content_size,\n"
28189 " int64_t offset);\n"
28194 #: ../src/guestfs-actions.pod:5820
28195 msgid "See also C<guestfs_pwrite>."
28199 #: ../src/guestfs-actions.pod:5827
28200 msgid "(Added in 1.5.20)"
28204 #: ../src/guestfs-actions.pod:5829
28205 msgid "guestfs_read_file"
28209 #: ../src/guestfs-actions.pod:5831
28213 " guestfs_read_file (guestfs_h *g,\n"
28214 " const char *path,\n"
28215 " size_t *size_r);\n"
28220 #: ../src/guestfs-actions.pod:5839
28222 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
28223 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
28224 "function is limited in the total size of file that can be handled."
28228 #: ../src/guestfs-actions.pod:5851
28229 msgid "(Added in 1.0.63)"
28233 #: ../src/guestfs-actions.pod:5853
28234 msgid "guestfs_read_lines"
28238 #: ../src/guestfs-actions.pod:5855
28242 " guestfs_read_lines (guestfs_h *g,\n"
28243 " const char *path);\n"
28248 #: ../src/guestfs-actions.pod:5864
28250 "Note that this function cannot correctly handle binary files (specifically, "
28251 "files containing C<\\0> character which is treated as end of line). For "
28252 "those you need to use the C<guestfs_read_file> function which has a more "
28253 "complex interface."
28257 #: ../src/guestfs-actions.pod:5875
28258 msgid "guestfs_readdir"
28262 #: ../src/guestfs-actions.pod:5877
28265 " struct guestfs_dirent_list *\n"
28266 " guestfs_readdir (guestfs_h *g,\n"
28267 " const char *dir);\n"
28272 #: ../src/guestfs-actions.pod:5931
28274 "This function is primarily intended for use by programs. To get a simple "
28275 "list of names, use C<guestfs_ls>. To get a printable directory for human "
28276 "consumption, use C<guestfs_ll>."
28280 #: ../src/guestfs-actions.pod:5935
28282 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
28283 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
28287 #: ../src/guestfs-actions.pod:5941
28288 msgid "guestfs_readlink"
28292 #: ../src/guestfs-actions.pod:5943
28296 " guestfs_readlink (guestfs_h *g,\n"
28297 " const char *path);\n"
28302 #: ../src/guestfs-actions.pod:5954
28303 msgid "guestfs_readlinklist"
28307 #: ../src/guestfs-actions.pod:5956
28311 " guestfs_readlinklist (guestfs_h *g,\n"
28312 " const char *path,\n"
28313 " char *const *names);\n"
28318 #: ../src/guestfs-actions.pod:5989
28319 msgid "guestfs_realpath"
28323 #: ../src/guestfs-actions.pod:5991
28327 " guestfs_realpath (guestfs_h *g,\n"
28328 " const char *path);\n"
28333 #: ../src/guestfs-actions.pod:6003
28334 msgid "guestfs_removexattr"
28338 #: ../src/guestfs-actions.pod:6005
28342 " guestfs_removexattr (guestfs_h *g,\n"
28343 " const char *xattr,\n"
28344 " const char *path);\n"
28349 #: ../src/guestfs-actions.pod:6013
28350 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
28354 #: ../src/guestfs-actions.pod:6019
28355 msgid "guestfs_resize2fs"
28359 #: ../src/guestfs-actions.pod:6021
28363 " guestfs_resize2fs (guestfs_h *g,\n"
28364 " const char *device);\n"
28369 #: ../src/guestfs-actions.pod:6028
28371 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
28372 "C<device> before calling this command. For unknown reasons C<resize2fs> "
28373 "sometimes gives an error about this and sometimes not. In any case, it is "
28374 "always safe to call C<guestfs_e2fsck_f> before calling this function."
28378 #: ../src/guestfs-actions.pod:6038
28379 msgid "guestfs_resize2fs_M"
28383 #: ../src/guestfs-actions.pod:6040
28387 " guestfs_resize2fs_M (guestfs_h *g,\n"
28388 " const char *device);\n"
28393 #: ../src/guestfs-actions.pod:6044
28395 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
28396 "resized to its minimum size. This works like the I<-M> option to the "
28397 "C<resize2fs> command."
28401 #: ../src/guestfs-actions.pod:6048
28403 "To get the resulting size of the filesystem you should call "
28404 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
28405 "These two numbers, multiplied together, give the resulting size of the "
28406 "minimal filesystem in bytes."
28410 #: ../src/guestfs-actions.pod:6057
28411 msgid "guestfs_resize2fs_size"
28415 #: ../src/guestfs-actions.pod:6059
28419 " guestfs_resize2fs_size (guestfs_h *g,\n"
28420 " const char *device,\n"
28421 " int64_t size);\n"
28426 #: ../src/guestfs-actions.pod:6064
28428 "This command is the same as C<guestfs_resize2fs> except that it allows you "
28429 "to specify the new size (in bytes) explicitly."
28433 #: ../src/guestfs-actions.pod:6071
28438 #: ../src/guestfs-actions.pod:6073
28442 " guestfs_rm (guestfs_h *g,\n"
28443 " const char *path);\n"
28448 #: ../src/guestfs-actions.pod:6083
28449 msgid "guestfs_rm_rf"
28453 #: ../src/guestfs-actions.pod:6085
28457 " guestfs_rm_rf (guestfs_h *g,\n"
28458 " const char *path);\n"
28463 #: ../src/guestfs-actions.pod:6097
28464 msgid "guestfs_rmdir"
28468 #: ../src/guestfs-actions.pod:6099
28472 " guestfs_rmdir (guestfs_h *g,\n"
28473 " const char *path);\n"
28478 #: ../src/guestfs-actions.pod:6109
28479 msgid "guestfs_rmmountpoint"
28483 #: ../src/guestfs-actions.pod:6111
28487 " guestfs_rmmountpoint (guestfs_h *g,\n"
28488 " const char *exemptpath);\n"
28493 #: ../src/guestfs-actions.pod:6115
28495 "This calls removes a mountpoint that was previously created with "
28496 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
28500 #: ../src/guestfs-actions.pod:6123
28501 msgid "guestfs_scrub_device"
28505 #: ../src/guestfs-actions.pod:6125
28509 " guestfs_scrub_device (guestfs_h *g,\n"
28510 " const char *device);\n"
28515 #: ../src/guestfs-actions.pod:6140 ../src/guestfs-actions.pod:6158
28516 #: ../src/guestfs-actions.pod:6177
28517 msgid "(Added in 1.0.52)"
28521 #: ../src/guestfs-actions.pod:6142
28522 msgid "guestfs_scrub_file"
28526 #: ../src/guestfs-actions.pod:6144
28530 " guestfs_scrub_file (guestfs_h *g,\n"
28531 " const char *file);\n"
28536 #: ../src/guestfs-actions.pod:6160
28537 msgid "guestfs_scrub_freespace"
28541 #: ../src/guestfs-actions.pod:6162
28545 " guestfs_scrub_freespace (guestfs_h *g,\n"
28546 " const char *dir);\n"
28551 #: ../src/guestfs-actions.pod:6166
28553 "This command creates the directory C<dir> and then fills it with files until "
28554 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
28555 "and deletes them. The intention is to scrub any free space on the partition "
28556 "containing C<dir>."
28560 #: ../src/guestfs-actions.pod:6179
28561 msgid "guestfs_set_append"
28565 #: ../src/guestfs-actions.pod:6181
28569 " guestfs_set_append (guestfs_h *g,\n"
28570 " const char *append);\n"
28575 #: ../src/guestfs-actions.pod:6198
28576 msgid "guestfs_set_attach_method"
28580 #: ../src/guestfs-actions.pod:6200
28584 " guestfs_set_attach_method (guestfs_h *g,\n"
28585 " const char *attachmethod);\n"
28590 #: ../src/guestfs-actions.pod:6228
28591 msgid "guestfs_set_autosync"
28595 #: ../src/guestfs-actions.pod:6230
28599 " guestfs_set_autosync (guestfs_h *g,\n"
28600 " int autosync);\n"
28605 #: ../src/guestfs-actions.pod:6246
28606 msgid "guestfs_set_direct"
28610 #: ../src/guestfs-actions.pod:6248
28614 " guestfs_set_direct (guestfs_h *g,\n"
28620 #: ../src/guestfs-actions.pod:6256
28622 "One consequence of this is that log messages aren't caught by the library "
28623 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
28628 #: ../src/guestfs-actions.pod:6269
28629 msgid "guestfs_set_e2label"
28633 #: ../src/guestfs-actions.pod:6271
28637 " guestfs_set_e2label (guestfs_h *g,\n"
28638 " const char *device,\n"
28639 " const char *label);\n"
28644 #: ../src/guestfs-actions.pod:6280
28646 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
28647 "the existing label on a filesystem."
28651 #: ../src/guestfs-actions.pod:6287
28652 msgid "guestfs_set_e2uuid"
28656 #: ../src/guestfs-actions.pod:6289
28660 " guestfs_set_e2uuid (guestfs_h *g,\n"
28661 " const char *device,\n"
28662 " const char *uuid);\n"
28667 #: ../src/guestfs-actions.pod:6299
28669 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
28670 "the existing UUID of a filesystem."
28674 #: ../src/guestfs-actions.pod:6306
28675 msgid "guestfs_set_memsize"
28679 #: ../src/guestfs-actions.pod:6308
28683 " guestfs_set_memsize (guestfs_h *g,\n"
28689 #: ../src/guestfs-actions.pod:6312
28691 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28692 "This only has any effect if called before C<guestfs_launch>."
28696 #: ../src/guestfs-actions.pod:6327
28697 msgid "guestfs_set_network"
28701 #: ../src/guestfs-actions.pod:6329
28705 " guestfs_set_network (guestfs_h *g,\n"
28711 #: ../src/guestfs-actions.pod:6339
28713 "You must call this before calling C<guestfs_launch>, otherwise it has no "
28718 #: ../src/guestfs-actions.pod:6346
28719 msgid "guestfs_set_path"
28723 #: ../src/guestfs-actions.pod:6348
28727 " guestfs_set_path (guestfs_h *g,\n"
28728 " const char *searchpath);\n"
28733 #: ../src/guestfs-actions.pod:6363
28734 msgid "guestfs_set_pgroup"
28738 #: ../src/guestfs-actions.pod:6365
28742 " guestfs_set_pgroup (guestfs_h *g,\n"
28748 #: ../src/guestfs-actions.pod:6382
28749 msgid "guestfs_set_qemu"
28753 #: ../src/guestfs-actions.pod:6384
28757 " guestfs_set_qemu (guestfs_h *g,\n"
28758 " const char *qemu);\n"
28763 #: ../src/guestfs-actions.pod:6410
28764 msgid "guestfs_set_recovery_proc"
28768 #: ../src/guestfs-actions.pod:6412
28772 " guestfs_set_recovery_proc (guestfs_h *g,\n"
28773 " int recoveryproc);\n"
28778 #: ../src/guestfs-actions.pod:6416
28780 "If this is called with the parameter C<false> then C<guestfs_launch> does "
28781 "not create a recovery process. The purpose of the recovery process is to "
28782 "stop runaway qemu processes in the case where the main program aborts "
28787 #: ../src/guestfs-actions.pod:6421
28789 "This only has any effect if called before C<guestfs_launch>, and the default "
28794 #: ../src/guestfs-actions.pod:6434
28795 msgid "guestfs_set_selinux"
28799 #: ../src/guestfs-actions.pod:6436
28803 " guestfs_set_selinux (guestfs_h *g,\n"
28809 #: ../src/guestfs-actions.pod:6453
28810 msgid "guestfs_set_trace"
28814 #: ../src/guestfs-actions.pod:6455
28818 " guestfs_set_trace (guestfs_h *g,\n"
28824 #: ../src/guestfs-actions.pod:6469
28826 "Trace messages are normally sent to C<stderr>, unless you register a "
28827 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28831 #: ../src/guestfs-actions.pod:6477
28832 msgid "guestfs_set_verbose"
28836 #: ../src/guestfs-actions.pod:6479
28840 " guestfs_set_verbose (guestfs_h *g,\n"
28846 #: ../src/guestfs-actions.pod:6488
28848 "Verbose messages are normally sent to C<stderr>, unless you register a "
28849 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28853 #: ../src/guestfs-actions.pod:6496
28854 msgid "guestfs_setcon"
28858 #: ../src/guestfs-actions.pod:6498
28862 " guestfs_setcon (guestfs_h *g,\n"
28863 " const char *context);\n"
28868 #: ../src/guestfs-actions.pod:6511
28869 msgid "guestfs_setxattr"
28873 #: ../src/guestfs-actions.pod:6513
28877 " guestfs_setxattr (guestfs_h *g,\n"
28878 " const char *xattr,\n"
28879 " const char *val,\n"
28881 " const char *path);\n"
28886 #: ../src/guestfs-actions.pod:6524
28887 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
28891 #: ../src/guestfs-actions.pod:6530
28892 msgid "guestfs_sfdisk"
28896 #: ../src/guestfs-actions.pod:6532
28900 " guestfs_sfdisk (guestfs_h *g,\n"
28901 " const char *device,\n"
28905 " char *const *lines);\n"
28910 #: ../src/guestfs-actions.pod:6560
28912 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
28916 #: ../src/guestfs-actions.pod:6568 ../src/guestfs-actions.pod:6598
28917 #: ../src/guestfs-actions.pod:6631
28919 "This function is deprecated. In new code, use the L</guestfs_part_add> call "
28924 #: ../src/guestfs-actions.pod:6577
28925 msgid "guestfs_sfdiskM"
28929 #: ../src/guestfs-actions.pod:6579
28933 " guestfs_sfdiskM (guestfs_h *g,\n"
28934 " const char *device,\n"
28935 " char *const *lines);\n"
28940 #: ../src/guestfs-actions.pod:6584
28942 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
28943 "partition sizes are specified in megabytes only (rounded to the nearest "
28944 "cylinder) and you don't need to specify the cyls, heads and sectors "
28945 "parameters which were rarely if ever used anyway."
28949 #: ../src/guestfs-actions.pod:6590
28951 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
28952 "C<guestfs_part_disk>"
28956 #: ../src/guestfs-actions.pod:6607
28957 msgid "guestfs_sfdisk_N"
28961 #: ../src/guestfs-actions.pod:6609
28965 " guestfs_sfdisk_N (guestfs_h *g,\n"
28966 " const char *device,\n"
28971 " const char *line);\n"
28976 #: ../src/guestfs-actions.pod:6621
28978 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
28979 "for the cyls/heads/sectors parameters."
28983 #: ../src/guestfs-actions.pod:6624
28984 msgid "See also: C<guestfs_part_add>"
28988 #: ../src/guestfs-actions.pod:6640
28989 msgid "guestfs_sfdisk_disk_geometry"
28993 #: ../src/guestfs-actions.pod:6642
28997 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
28998 " const char *device);\n"
29003 #: ../src/guestfs-actions.pod:6646
29005 "This displays the disk geometry of C<device> read from the partition table. "
29006 "Especially in the case where the underlying block device has been resized, "
29007 "this can be different from the kernel's idea of the geometry (see "
29008 "C<guestfs_sfdisk_kernel_geometry>)."
29012 #: ../src/guestfs-actions.pod:6659
29013 msgid "guestfs_sfdisk_kernel_geometry"
29017 #: ../src/guestfs-actions.pod:6661
29021 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
29022 " const char *device);\n"
29027 #: ../src/guestfs-actions.pod:6675
29028 msgid "guestfs_sfdisk_l"
29032 #: ../src/guestfs-actions.pod:6677
29036 " guestfs_sfdisk_l (guestfs_h *g,\n"
29037 " const char *device);\n"
29042 #: ../src/guestfs-actions.pod:6685
29043 msgid "See also: C<guestfs_part_list>"
29047 #: ../src/guestfs-actions.pod:6690
29049 "This function is deprecated. In new code, use the L</guestfs_part_list> "
29054 #: ../src/guestfs-actions.pod:6699
29059 #: ../src/guestfs-actions.pod:6701
29063 " guestfs_sh (guestfs_h *g,\n"
29064 " const char *command);\n"
29069 #: ../src/guestfs-actions.pod:6708
29070 msgid "This is like C<guestfs_command>, but passes the command to:"
29074 #: ../src/guestfs-actions.pod:6716
29075 msgid "All the provisos about C<guestfs_command> apply to this call."
29079 #: ../src/guestfs-actions.pod:6723
29080 msgid "guestfs_sh_lines"
29084 #: ../src/guestfs-actions.pod:6725
29088 " guestfs_sh_lines (guestfs_h *g,\n"
29089 " const char *command);\n"
29094 #: ../src/guestfs-actions.pod:6729
29096 "This is the same as C<guestfs_sh>, but splits the result into a list of "
29101 #: ../src/guestfs-actions.pod:6732
29102 msgid "See also: C<guestfs_command_lines>"
29106 #: ../src/guestfs-actions.pod:6740
29107 msgid "guestfs_sleep"
29111 #: ../src/guestfs-actions.pod:6742
29115 " guestfs_sleep (guestfs_h *g,\n"
29121 #: ../src/guestfs-actions.pod:6750
29122 msgid "(Added in 1.0.41)"
29126 #: ../src/guestfs-actions.pod:6752 ../src/guestfs-structs.pod:109
29127 msgid "guestfs_stat"
29131 #: ../src/guestfs-actions.pod:6754
29134 " struct guestfs_stat *\n"
29135 " guestfs_stat (guestfs_h *g,\n"
29136 " const char *path);\n"
29141 #: ../src/guestfs-actions.pod:6768 ../src/guestfs-structs.pod:135
29142 msgid "guestfs_statvfs"
29146 #: ../src/guestfs-actions.pod:6770
29149 " struct guestfs_statvfs *\n"
29150 " guestfs_statvfs (guestfs_h *g,\n"
29151 " const char *path);\n"
29156 #: ../src/guestfs-actions.pod:6780
29158 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
29159 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
29163 #: ../src/guestfs-actions.pod:6786
29164 msgid "guestfs_strings"
29168 #: ../src/guestfs-actions.pod:6788
29172 " guestfs_strings (guestfs_h *g,\n"
29173 " const char *path);\n"
29178 #: ../src/guestfs-actions.pod:6804
29179 msgid "guestfs_strings_e"
29183 #: ../src/guestfs-actions.pod:6806
29187 " guestfs_strings_e (guestfs_h *g,\n"
29188 " const char *encoding,\n"
29189 " const char *path);\n"
29194 #: ../src/guestfs-actions.pod:6811
29196 "This is like the C<guestfs_strings> command, but allows you to specify the "
29197 "encoding of strings that are looked for in the source file C<path>."
29201 #: ../src/guestfs-actions.pod:6821
29203 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29204 "ISO-8859-X (this is what C<guestfs_strings> uses)."
29208 #: ../src/guestfs-actions.pod:6859
29209 msgid "guestfs_swapoff_device"
29213 #: ../src/guestfs-actions.pod:6861
29217 " guestfs_swapoff_device (guestfs_h *g,\n"
29218 " const char *device);\n"
29223 #: ../src/guestfs-actions.pod:6865
29225 "This command disables the libguestfs appliance swap device or partition "
29226 "named C<device>. See C<guestfs_swapon_device>."
29230 #: ../src/guestfs-actions.pod:6873
29231 msgid "guestfs_swapoff_file"
29235 #: ../src/guestfs-actions.pod:6875
29239 " guestfs_swapoff_file (guestfs_h *g,\n"
29240 " const char *file);\n"
29245 #: ../src/guestfs-actions.pod:6885
29246 msgid "guestfs_swapoff_label"
29250 #: ../src/guestfs-actions.pod:6887
29254 " guestfs_swapoff_label (guestfs_h *g,\n"
29255 " const char *label);\n"
29260 #: ../src/guestfs-actions.pod:6898
29261 msgid "guestfs_swapoff_uuid"
29265 #: ../src/guestfs-actions.pod:6900
29269 " guestfs_swapoff_uuid (guestfs_h *g,\n"
29270 " const char *uuid);\n"
29275 #: ../src/guestfs-actions.pod:6911
29276 msgid "guestfs_swapon_device"
29280 #: ../src/guestfs-actions.pod:6913
29284 " guestfs_swapon_device (guestfs_h *g,\n"
29285 " const char *device);\n"
29290 #: ../src/guestfs-actions.pod:6917
29292 "This command enables the libguestfs appliance to use the swap device or "
29293 "partition named C<device>. The increased memory is made available for all "
29294 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
29298 #: ../src/guestfs-actions.pod:6933
29299 msgid "guestfs_swapon_file"
29303 #: ../src/guestfs-actions.pod:6935
29307 " guestfs_swapon_file (guestfs_h *g,\n"
29308 " const char *file);\n"
29313 #: ../src/guestfs-actions.pod:6939
29315 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
29320 #: ../src/guestfs-actions.pod:6946
29321 msgid "guestfs_swapon_label"
29325 #: ../src/guestfs-actions.pod:6948
29329 " guestfs_swapon_label (guestfs_h *g,\n"
29330 " const char *label);\n"
29335 #: ../src/guestfs-actions.pod:6952
29337 "This command enables swap to a labeled swap partition. See "
29338 "C<guestfs_swapon_device> for other notes."
29342 #: ../src/guestfs-actions.pod:6959
29343 msgid "guestfs_swapon_uuid"
29347 #: ../src/guestfs-actions.pod:6961
29351 " guestfs_swapon_uuid (guestfs_h *g,\n"
29352 " const char *uuid);\n"
29357 #: ../src/guestfs-actions.pod:6965
29359 "This command enables swap to a swap partition with the given UUID. See "
29360 "C<guestfs_swapon_device> for other notes."
29364 #: ../src/guestfs-actions.pod:6972
29365 msgid "guestfs_sync"
29369 #: ../src/guestfs-actions.pod:6974
29373 " guestfs_sync (guestfs_h *g);\n"
29378 #: ../src/guestfs-actions.pod:6987
29379 msgid "guestfs_tail"
29383 #: ../src/guestfs-actions.pod:6989
29387 " guestfs_tail (guestfs_h *g,\n"
29388 " const char *path);\n"
29393 #: ../src/guestfs-actions.pod:7005
29394 msgid "guestfs_tail_n"
29398 #: ../src/guestfs-actions.pod:7007
29402 " guestfs_tail_n (guestfs_h *g,\n"
29404 " const char *path);\n"
29409 #: ../src/guestfs-actions.pod:7029
29410 msgid "guestfs_tar_in"
29414 #: ../src/guestfs-actions.pod:7031
29418 " guestfs_tar_in (guestfs_h *g,\n"
29419 " const char *tarfile,\n"
29420 " const char *directory);\n"
29425 #: ../src/guestfs-actions.pod:7039
29427 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
29431 #: ../src/guestfs-actions.pod:7044 ../src/guestfs-actions.pod:7061
29432 #: ../src/guestfs-actions.pod:7077 ../src/guestfs-actions.pod:7093
29433 msgid "(Added in 1.0.3)"
29437 #: ../src/guestfs-actions.pod:7046
29438 msgid "guestfs_tar_out"
29442 #: ../src/guestfs-actions.pod:7048
29446 " guestfs_tar_out (guestfs_h *g,\n"
29447 " const char *directory,\n"
29448 " const char *tarfile);\n"
29453 #: ../src/guestfs-actions.pod:7056
29455 "To download a compressed tarball, use C<guestfs_tgz_out> or "
29456 "C<guestfs_txz_out>."
29460 #: ../src/guestfs-actions.pod:7063
29461 msgid "guestfs_tgz_in"
29465 #: ../src/guestfs-actions.pod:7065
29469 " guestfs_tgz_in (guestfs_h *g,\n"
29470 " const char *tarball,\n"
29471 " const char *directory);\n"
29476 #: ../src/guestfs-actions.pod:7073
29477 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
29481 #: ../src/guestfs-actions.pod:7079
29482 msgid "guestfs_tgz_out"
29486 #: ../src/guestfs-actions.pod:7081
29490 " guestfs_tgz_out (guestfs_h *g,\n"
29491 " const char *directory,\n"
29492 " const char *tarball);\n"
29497 #: ../src/guestfs-actions.pod:7089
29498 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
29502 #: ../src/guestfs-actions.pod:7095
29503 msgid "guestfs_touch"
29507 #: ../src/guestfs-actions.pod:7097
29511 " guestfs_touch (guestfs_h *g,\n"
29512 " const char *path);\n"
29517 #: ../src/guestfs-actions.pod:7112
29518 msgid "guestfs_truncate"
29522 #: ../src/guestfs-actions.pod:7114
29526 " guestfs_truncate (guestfs_h *g,\n"
29527 " const char *path);\n"
29532 #: ../src/guestfs-actions.pod:7125
29533 msgid "guestfs_truncate_size"
29537 #: ../src/guestfs-actions.pod:7127
29541 " guestfs_truncate_size (guestfs_h *g,\n"
29542 " const char *path,\n"
29543 " int64_t size);\n"
29548 #: ../src/guestfs-actions.pod:7135
29550 "If the current file size is less than C<size> then the file is extended to "
29551 "the required size with zero bytes. This creates a sparse file (ie. disk "
29552 "blocks are not allocated for the file until you write to it). To create a "
29553 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
29557 #: ../src/guestfs-actions.pod:7145
29558 msgid "guestfs_tune2fs_l"
29562 #: ../src/guestfs-actions.pod:7147
29566 " guestfs_tune2fs_l (guestfs_h *g,\n"
29567 " const char *device);\n"
29572 #: ../src/guestfs-actions.pod:7167
29573 msgid "guestfs_txz_in"
29577 #: ../src/guestfs-actions.pod:7169
29581 " guestfs_txz_in (guestfs_h *g,\n"
29582 " const char *tarball,\n"
29583 " const char *directory);\n"
29588 #: ../src/guestfs-actions.pod:7181
29589 msgid "guestfs_txz_out"
29593 #: ../src/guestfs-actions.pod:7183
29597 " guestfs_txz_out (guestfs_h *g,\n"
29598 " const char *directory,\n"
29599 " const char *tarball);\n"
29604 #: ../src/guestfs-actions.pod:7195
29605 msgid "guestfs_umask"
29609 #: ../src/guestfs-actions.pod:7197
29613 " guestfs_umask (guestfs_h *g,\n"
29619 #: ../src/guestfs-actions.pod:7213
29621 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
29622 "C<guestfs_mkdir>."
29626 #: ../src/guestfs-actions.pod:7222
29627 msgid "guestfs_umount"
29631 #: ../src/guestfs-actions.pod:7224
29635 " guestfs_umount (guestfs_h *g,\n"
29636 " const char *pathordevice);\n"
29641 #: ../src/guestfs-actions.pod:7236
29642 msgid "guestfs_umount_all"
29646 #: ../src/guestfs-actions.pod:7238
29650 " guestfs_umount_all (guestfs_h *g);\n"
29655 #: ../src/guestfs-actions.pod:7249
29656 msgid "guestfs_upload"
29660 #: ../src/guestfs-actions.pod:7251
29664 " guestfs_upload (guestfs_h *g,\n"
29665 " const char *filename,\n"
29666 " const char *remotefilename);\n"
29671 #: ../src/guestfs-actions.pod:7261
29672 msgid "See also C<guestfs_download>."
29676 #: ../src/guestfs-actions.pod:7272
29677 msgid "guestfs_upload_offset"
29681 #: ../src/guestfs-actions.pod:7274
29685 " guestfs_upload_offset (guestfs_h *g,\n"
29686 " const char *filename,\n"
29687 " const char *remotefilename,\n"
29688 " int64_t offset);\n"
29693 #: ../src/guestfs-actions.pod:7290
29695 "Note that there is no limit on the amount of data that can be uploaded with "
29696 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
29697 "full amount unless an error occurs."
29701 #: ../src/guestfs-actions.pod:7295
29702 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
29706 #: ../src/guestfs-actions.pod:7306
29707 msgid "guestfs_utimens"
29711 #: ../src/guestfs-actions.pod:7308
29715 " guestfs_utimens (guestfs_h *g,\n"
29716 " const char *path,\n"
29717 " int64_t atsecs,\n"
29718 " int64_t atnsecs,\n"
29719 " int64_t mtsecs,\n"
29720 " int64_t mtnsecs);\n"
29725 #: ../src/guestfs-actions.pod:7337 ../src/guestfs-structs.pod:175
29726 msgid "guestfs_version"
29730 #: ../src/guestfs-actions.pod:7339
29733 " struct guestfs_version *\n"
29734 " guestfs_version (guestfs_h *g);\n"
29739 #: ../src/guestfs-actions.pod:7367
29741 "I<Note:> Don't use this call to test for availability of features. In "
29742 "enterprise distributions we backport features from later versions into "
29743 "earlier versions, making this an unreliable way to test for features. Use "
29744 "C<guestfs_available> instead."
29748 #: ../src/guestfs-actions.pod:7373
29750 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
29751 "error. I<The caller must call C<guestfs_free_version> after use>."
29755 #: ../src/guestfs-actions.pod:7377
29756 msgid "(Added in 1.0.58)"
29760 #: ../src/guestfs-actions.pod:7379
29761 msgid "guestfs_vfs_label"
29765 #: ../src/guestfs-actions.pod:7381
29769 " guestfs_vfs_label (guestfs_h *g,\n"
29770 " const char *device);\n"
29775 #: ../src/guestfs-actions.pod:7390
29776 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
29780 #: ../src/guestfs-actions.pod:7395 ../src/guestfs-actions.pod:7432
29781 msgid "(Added in 1.3.18)"
29785 #: ../src/guestfs-actions.pod:7397
29786 msgid "guestfs_vfs_type"
29790 #: ../src/guestfs-actions.pod:7399
29794 " guestfs_vfs_type (guestfs_h *g,\n"
29795 " const char *device);\n"
29800 #: ../src/guestfs-actions.pod:7416
29801 msgid "guestfs_vfs_uuid"
29805 #: ../src/guestfs-actions.pod:7418
29809 " guestfs_vfs_uuid (guestfs_h *g,\n"
29810 " const char *device);\n"
29815 #: ../src/guestfs-actions.pod:7427
29816 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
29820 #: ../src/guestfs-actions.pod:7434
29821 msgid "guestfs_vg_activate"
29825 #: ../src/guestfs-actions.pod:7436
29829 " guestfs_vg_activate (guestfs_h *g,\n"
29831 " char *const *volgroups);\n"
29836 #: ../src/guestfs-actions.pod:7453
29837 msgid "guestfs_vg_activate_all"
29841 #: ../src/guestfs-actions.pod:7455
29845 " guestfs_vg_activate_all (guestfs_h *g,\n"
29846 " int activate);\n"
29851 #: ../src/guestfs-actions.pod:7468
29852 msgid "guestfs_vgcreate"
29856 #: ../src/guestfs-actions.pod:7470
29860 " guestfs_vgcreate (guestfs_h *g,\n"
29861 " const char *volgroup,\n"
29862 " char *const *physvols);\n"
29867 #: ../src/guestfs-actions.pod:7482
29868 msgid "guestfs_vglvuuids"
29872 #: ../src/guestfs-actions.pod:7484
29876 " guestfs_vglvuuids (guestfs_h *g,\n"
29877 " const char *vgname);\n"
29882 #: ../src/guestfs-actions.pod:7491
29884 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
29885 "associate logical volumes and volume groups."
29889 #: ../src/guestfs-actions.pod:7494
29890 msgid "See also C<guestfs_vgpvuuids>."
29894 #: ../src/guestfs-actions.pod:7502
29895 msgid "guestfs_vgpvuuids"
29899 #: ../src/guestfs-actions.pod:7504
29903 " guestfs_vgpvuuids (guestfs_h *g,\n"
29904 " const char *vgname);\n"
29909 #: ../src/guestfs-actions.pod:7511
29911 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
29912 "associate physical volumes and volume groups."
29916 #: ../src/guestfs-actions.pod:7514
29917 msgid "See also C<guestfs_vglvuuids>."
29921 #: ../src/guestfs-actions.pod:7522
29922 msgid "guestfs_vgremove"
29926 #: ../src/guestfs-actions.pod:7524
29930 " guestfs_vgremove (guestfs_h *g,\n"
29931 " const char *vgname);\n"
29936 #: ../src/guestfs-actions.pod:7537
29937 msgid "guestfs_vgrename"
29941 #: ../src/guestfs-actions.pod:7539
29945 " guestfs_vgrename (guestfs_h *g,\n"
29946 " const char *volgroup,\n"
29947 " const char *newvolgroup);\n"
29952 #: ../src/guestfs-actions.pod:7550
29953 msgid "guestfs_vgs"
29957 #: ../src/guestfs-actions.pod:7552
29961 " guestfs_vgs (guestfs_h *g);\n"
29966 #: ../src/guestfs-actions.pod:7561
29967 msgid "See also C<guestfs_vgs_full>."
29971 #: ../src/guestfs-actions.pod:7569
29972 msgid "guestfs_vgs_full"
29976 #: ../src/guestfs-actions.pod:7571
29979 " struct guestfs_lvm_vg_list *\n"
29980 " guestfs_vgs_full (guestfs_h *g);\n"
29985 #: ../src/guestfs-actions.pod:7577
29987 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
29988 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
29992 #: ../src/guestfs-actions.pod:7583
29993 msgid "guestfs_vgscan"
29997 #: ../src/guestfs-actions.pod:7585
30001 " guestfs_vgscan (guestfs_h *g);\n"
30006 #: ../src/guestfs-actions.pod:7595
30007 msgid "guestfs_vguuid"
30011 #: ../src/guestfs-actions.pod:7597
30015 " guestfs_vguuid (guestfs_h *g,\n"
30016 " const char *vgname);\n"
30021 #: ../src/guestfs-actions.pod:7608
30022 msgid "guestfs_wait_ready"
30026 #: ../src/guestfs-actions.pod:7610
30030 " guestfs_wait_ready (guestfs_h *g);\n"
30035 #: ../src/guestfs-actions.pod:7613
30036 msgid "This function is a no op."
30040 #: ../src/guestfs-actions.pod:7615
30042 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
30043 "calling C<guestfs_launch> to wait for the launch to complete. However this "
30044 "is no longer necessary because C<guestfs_launch> now does the waiting."
30048 #: ../src/guestfs-actions.pod:7620
30050 "If you see any calls to this function in code then you can just remove them, "
30051 "unless you want to retain compatibility with older versions of the API."
30055 #: ../src/guestfs-actions.pod:7626
30057 "This function is deprecated. In new code, use the L</guestfs_launch> call "
30062 #: ../src/guestfs-actions.pod:7635
30063 msgid "guestfs_wc_c"
30067 #: ../src/guestfs-actions.pod:7637
30071 " guestfs_wc_c (guestfs_h *g,\n"
30072 " const char *path);\n"
30077 #: ../src/guestfs-actions.pod:7648
30078 msgid "guestfs_wc_l"
30082 #: ../src/guestfs-actions.pod:7650
30086 " guestfs_wc_l (guestfs_h *g,\n"
30087 " const char *path);\n"
30092 #: ../src/guestfs-actions.pod:7661
30093 msgid "guestfs_wc_w"
30097 #: ../src/guestfs-actions.pod:7663
30101 " guestfs_wc_w (guestfs_h *g,\n"
30102 " const char *path);\n"
30107 #: ../src/guestfs-actions.pod:7674
30108 msgid "guestfs_write"
30112 #: ../src/guestfs-actions.pod:7676
30116 " guestfs_write (guestfs_h *g,\n"
30117 " const char *path,\n"
30118 " const char *content,\n"
30119 " size_t content_size);\n"
30124 #: ../src/guestfs-actions.pod:7685
30125 msgid "See also C<guestfs_write_append>."
30129 #: ../src/guestfs-actions.pod:7694
30130 msgid "guestfs_write_append"
30134 #: ../src/guestfs-actions.pod:7696
30138 " guestfs_write_append (guestfs_h *g,\n"
30139 " const char *path,\n"
30140 " const char *content,\n"
30141 " size_t content_size);\n"
30146 #: ../src/guestfs-actions.pod:7705
30147 msgid "See also C<guestfs_write>."
30151 #: ../src/guestfs-actions.pod:7714
30152 msgid "guestfs_write_file"
30156 #: ../src/guestfs-actions.pod:7716
30160 " guestfs_write_file (guestfs_h *g,\n"
30161 " const char *path,\n"
30162 " const char *content,\n"
30168 #: ../src/guestfs-actions.pod:7738
30170 "This function is deprecated. In new code, use the L</guestfs_write> call "
30175 #: ../src/guestfs-actions.pod:7747
30176 msgid "guestfs_zegrep"
30180 #: ../src/guestfs-actions.pod:7749
30184 " guestfs_zegrep (guestfs_h *g,\n"
30185 " const char *regex,\n"
30186 " const char *path);\n"
30191 #: ../src/guestfs-actions.pod:7766
30192 msgid "guestfs_zegrepi"
30196 #: ../src/guestfs-actions.pod:7768
30200 " guestfs_zegrepi (guestfs_h *g,\n"
30201 " const char *regex,\n"
30202 " const char *path);\n"
30207 #: ../src/guestfs-actions.pod:7785
30208 msgid "guestfs_zero"
30212 #: ../src/guestfs-actions.pod:7787
30216 " guestfs_zero (guestfs_h *g,\n"
30217 " const char *device);\n"
30222 #: ../src/guestfs-actions.pod:7801
30224 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
30225 "C<guestfs_is_zero_device>"
30229 #: ../src/guestfs-actions.pod:7813
30230 msgid "guestfs_zero_device"
30234 #: ../src/guestfs-actions.pod:7815
30238 " guestfs_zero_device (guestfs_h *g,\n"
30239 " const char *device);\n"
30244 #: ../src/guestfs-actions.pod:7819
30246 "This command writes zeroes over the entire C<device>. Compare with "
30247 "C<guestfs_zero> which just zeroes the first few blocks of a device."
30251 #: ../src/guestfs-actions.pod:7837
30252 msgid "(Added in 1.3.1)"
30256 #: ../src/guestfs-actions.pod:7839
30257 msgid "guestfs_zerofree"
30261 #: ../src/guestfs-actions.pod:7841
30265 " guestfs_zerofree (guestfs_h *g,\n"
30266 " const char *device);\n"
30271 #: ../src/guestfs-actions.pod:7860
30272 msgid "guestfs_zfgrep"
30276 #: ../src/guestfs-actions.pod:7862
30280 " guestfs_zfgrep (guestfs_h *g,\n"
30281 " const char *pattern,\n"
30282 " const char *path);\n"
30287 #: ../src/guestfs-actions.pod:7879
30288 msgid "guestfs_zfgrepi"
30292 #: ../src/guestfs-actions.pod:7881
30296 " guestfs_zfgrepi (guestfs_h *g,\n"
30297 " const char *pattern,\n"
30298 " const char *path);\n"
30303 #: ../src/guestfs-actions.pod:7898
30304 msgid "guestfs_zfile"
30308 #: ../src/guestfs-actions.pod:7900
30312 " guestfs_zfile (guestfs_h *g,\n"
30313 " const char *meth,\n"
30314 " const char *path);\n"
30319 #: ../src/guestfs-actions.pod:7910
30321 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
30326 #: ../src/guestfs-actions.pod:7916
30328 "This function is deprecated. In new code, use the L</guestfs_file> call "
30333 #: ../src/guestfs-actions.pod:7925
30334 msgid "guestfs_zgrep"
30338 #: ../src/guestfs-actions.pod:7927
30342 " guestfs_zgrep (guestfs_h *g,\n"
30343 " const char *regex,\n"
30344 " const char *path);\n"
30349 #: ../src/guestfs-actions.pod:7944
30350 msgid "guestfs_zgrepi"
30354 #: ../src/guestfs-actions.pod:7946
30358 " guestfs_zgrepi (guestfs_h *g,\n"
30359 " const char *regex,\n"
30360 " const char *path);\n"
30365 #: ../src/guestfs-availability.pod:3
30370 #: ../src/guestfs-availability.pod:5
30372 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
30373 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
30374 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
30375 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
30376 "L</guestfs_aug_save> L</guestfs_aug_set>"
30380 #: ../src/guestfs-availability.pod:21
30385 #: ../src/guestfs-availability.pod:23
30386 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
30390 #: ../src/guestfs-availability.pod:26
30395 #: ../src/guestfs-availability.pod:28
30396 msgid "The following functions: L</guestfs_grub_install>"
30400 #: ../src/guestfs-availability.pod:31
30405 #: ../src/guestfs-availability.pod:33
30407 "The following functions: L</guestfs_inotify_add_watch> L</"
30408 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
30409 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
30413 #: ../src/guestfs-availability.pod:41
30414 msgid "B<linuxfsuuid>"
30418 #: ../src/guestfs-availability.pod:43
30420 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
30421 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
30425 #: ../src/guestfs-availability.pod:50
30426 msgid "B<linuxmodules>"
30430 #: ../src/guestfs-availability.pod:52
30431 msgid "The following functions: L</guestfs_modprobe>"
30435 #: ../src/guestfs-availability.pod:55
30436 msgid "B<linuxxattrs>"
30440 #: ../src/guestfs-availability.pod:57
30442 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
30443 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
30444 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
30445 "guestfs_setxattr>"
30449 #: ../src/guestfs-availability.pod:68
30454 #: ../src/guestfs-availability.pod:70
30456 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
30457 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
30458 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
30462 #: ../src/guestfs-availability.pod:79
30467 #: ../src/guestfs-availability.pod:81
30469 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
30470 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
30471 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
30472 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
30473 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
30474 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
30475 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
30479 #: ../src/guestfs-availability.pod:104
30484 #: ../src/guestfs-availability.pod:106
30486 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
30487 "guestfs_mknod_b> L</guestfs_mknod_c>"
30491 #: ../src/guestfs-availability.pod:112
30496 #: ../src/guestfs-availability.pod:114
30497 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
30501 #: ../src/guestfs-availability.pod:117
30502 msgid "B<ntfsprogs>"
30506 #: ../src/guestfs-availability.pod:119
30508 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
30509 "L</guestfs_ntfsresize_size>"
30513 #: ../src/guestfs-availability.pod:124
30514 msgid "B<realpath>"
30518 #: ../src/guestfs-availability.pod:126
30519 msgid "The following functions: L</guestfs_realpath>"
30523 #: ../src/guestfs-availability.pod:129
30528 #: ../src/guestfs-availability.pod:131
30530 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
30531 "guestfs_scrub_freespace>"
30535 #: ../src/guestfs-availability.pod:136
30540 #: ../src/guestfs-availability.pod:138
30541 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
30545 #: ../src/guestfs-availability.pod:142
30550 #: ../src/guestfs-availability.pod:144
30551 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
30555 #: ../src/guestfs-availability.pod:148
30556 msgid "B<zerofree>"
30560 #: ../src/guestfs-availability.pod:150
30561 msgid "The following functions: L</guestfs_zerofree>"
30565 #: ../src/guestfs-structs.pod:1
30566 msgid "guestfs_int_bool"
30570 #: ../src/guestfs-structs.pod:3
30573 " struct guestfs_int_bool {\n"
30581 #: ../src/guestfs-structs.pod:8
30584 " struct guestfs_int_bool_list {\n"
30585 " uint32_t len; /* Number of elements in list. */\n"
30586 " struct guestfs_int_bool *val; /* Elements. */\n"
30592 #: ../src/guestfs-structs.pod:13
30595 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
30596 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
30601 #: ../src/guestfs-structs.pod:16
30602 msgid "guestfs_lvm_pv"
30606 #: ../src/guestfs-structs.pod:18
30609 " struct guestfs_lvm_pv {\n"
30610 " char *pv_name;\n"
30611 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30612 " char pv_uuid[32];\n"
30614 " uint64_t pv_size;\n"
30615 " uint64_t dev_size;\n"
30616 " uint64_t pv_free;\n"
30617 " uint64_t pv_used;\n"
30618 " char *pv_attr;\n"
30619 " int64_t pv_pe_count;\n"
30620 " int64_t pv_pe_alloc_count;\n"
30621 " char *pv_tags;\n"
30622 " uint64_t pe_start;\n"
30623 " int64_t pv_mda_count;\n"
30624 " uint64_t pv_mda_free;\n"
30630 #: ../src/guestfs-structs.pod:36
30633 " struct guestfs_lvm_pv_list {\n"
30634 " uint32_t len; /* Number of elements in list. */\n"
30635 " struct guestfs_lvm_pv *val; /* Elements. */\n"
30641 #: ../src/guestfs-structs.pod:41
30644 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
30645 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
30650 #: ../src/guestfs-structs.pod:44
30651 msgid "guestfs_lvm_vg"
30655 #: ../src/guestfs-structs.pod:46
30658 " struct guestfs_lvm_vg {\n"
30659 " char *vg_name;\n"
30660 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30661 " char vg_uuid[32];\n"
30663 " char *vg_attr;\n"
30664 " uint64_t vg_size;\n"
30665 " uint64_t vg_free;\n"
30666 " char *vg_sysid;\n"
30667 " uint64_t vg_extent_size;\n"
30668 " int64_t vg_extent_count;\n"
30669 " int64_t vg_free_count;\n"
30670 " int64_t max_lv;\n"
30671 " int64_t max_pv;\n"
30672 " int64_t pv_count;\n"
30673 " int64_t lv_count;\n"
30674 " int64_t snap_count;\n"
30675 " int64_t vg_seqno;\n"
30676 " char *vg_tags;\n"
30677 " int64_t vg_mda_count;\n"
30678 " uint64_t vg_mda_free;\n"
30684 #: ../src/guestfs-structs.pod:69
30687 " struct guestfs_lvm_vg_list {\n"
30688 " uint32_t len; /* Number of elements in list. */\n"
30689 " struct guestfs_lvm_vg *val; /* Elements. */\n"
30695 #: ../src/guestfs-structs.pod:74
30698 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
30699 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
30704 #: ../src/guestfs-structs.pod:77
30705 msgid "guestfs_lvm_lv"
30709 #: ../src/guestfs-structs.pod:79
30712 " struct guestfs_lvm_lv {\n"
30713 " char *lv_name;\n"
30714 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30715 " char lv_uuid[32];\n"
30716 " char *lv_attr;\n"
30717 " int64_t lv_major;\n"
30718 " int64_t lv_minor;\n"
30719 " int64_t lv_kernel_major;\n"
30720 " int64_t lv_kernel_minor;\n"
30721 " uint64_t lv_size;\n"
30722 " int64_t seg_count;\n"
30724 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30725 " float snap_percent;\n"
30726 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30727 " float copy_percent;\n"
30728 " char *move_pv;\n"
30729 " char *lv_tags;\n"
30730 " char *mirror_log;\n"
30731 " char *modules;\n"
30737 #: ../src/guestfs-structs.pod:101
30740 " struct guestfs_lvm_lv_list {\n"
30741 " uint32_t len; /* Number of elements in list. */\n"
30742 " struct guestfs_lvm_lv *val; /* Elements. */\n"
30748 #: ../src/guestfs-structs.pod:106
30751 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
30752 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
30757 #: ../src/guestfs-structs.pod:111
30760 " struct guestfs_stat {\n"
30764 " int64_t nlink;\n"
30769 " int64_t blksize;\n"
30770 " int64_t blocks;\n"
30771 " int64_t atime;\n"
30772 " int64_t mtime;\n"
30773 " int64_t ctime;\n"
30779 #: ../src/guestfs-structs.pod:127
30782 " struct guestfs_stat_list {\n"
30783 " uint32_t len; /* Number of elements in list. */\n"
30784 " struct guestfs_stat *val; /* Elements. */\n"
30790 #: ../src/guestfs-structs.pod:132
30793 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
30794 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
30799 #: ../src/guestfs-structs.pod:137
30802 " struct guestfs_statvfs {\n"
30803 " int64_t bsize;\n"
30804 " int64_t frsize;\n"
30805 " int64_t blocks;\n"
30806 " int64_t bfree;\n"
30807 " int64_t bavail;\n"
30808 " int64_t files;\n"
30809 " int64_t ffree;\n"
30810 " int64_t favail;\n"
30813 " int64_t namemax;\n"
30819 #: ../src/guestfs-structs.pod:151
30822 " struct guestfs_statvfs_list {\n"
30823 " uint32_t len; /* Number of elements in list. */\n"
30824 " struct guestfs_statvfs *val; /* Elements. */\n"
30830 #: ../src/guestfs-structs.pod:156
30833 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
30834 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
30839 #: ../src/guestfs-structs.pod:159
30840 msgid "guestfs_dirent"
30844 #: ../src/guestfs-structs.pod:161
30847 " struct guestfs_dirent {\n"
30856 #: ../src/guestfs-structs.pod:167
30859 " struct guestfs_dirent_list {\n"
30860 " uint32_t len; /* Number of elements in list. */\n"
30861 " struct guestfs_dirent *val; /* Elements. */\n"
30867 #: ../src/guestfs-structs.pod:172
30870 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
30871 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
30876 #: ../src/guestfs-structs.pod:177
30879 " struct guestfs_version {\n"
30880 " int64_t major;\n"
30881 " int64_t minor;\n"
30882 " int64_t release;\n"
30889 #: ../src/guestfs-structs.pod:184
30892 " struct guestfs_version_list {\n"
30893 " uint32_t len; /* Number of elements in list. */\n"
30894 " struct guestfs_version *val; /* Elements. */\n"
30900 #: ../src/guestfs-structs.pod:189
30903 " void guestfs_free_version (struct guestfs_free_version *);\n"
30904 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
30909 #: ../src/guestfs-structs.pod:192
30910 msgid "guestfs_xattr"
30914 #: ../src/guestfs-structs.pod:194
30917 " struct guestfs_xattr {\n"
30918 " char *attrname;\n"
30919 " /* The next two fields describe a byte array. */\n"
30920 " uint32_t attrval_len;\n"
30921 " char *attrval;\n"
30927 #: ../src/guestfs-structs.pod:201
30930 " struct guestfs_xattr_list {\n"
30931 " uint32_t len; /* Number of elements in list. */\n"
30932 " struct guestfs_xattr *val; /* Elements. */\n"
30938 #: ../src/guestfs-structs.pod:206
30941 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
30942 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
30947 #: ../src/guestfs-structs.pod:209
30948 msgid "guestfs_inotify_event"
30952 #: ../src/guestfs-structs.pod:211
30955 " struct guestfs_inotify_event {\n"
30956 " int64_t in_wd;\n"
30957 " uint32_t in_mask;\n"
30958 " uint32_t in_cookie;\n"
30959 " char *in_name;\n"
30965 #: ../src/guestfs-structs.pod:218
30968 " struct guestfs_inotify_event_list {\n"
30969 " uint32_t len; /* Number of elements in list. */\n"
30970 " struct guestfs_inotify_event *val; /* Elements. */\n"
30976 #: ../src/guestfs-structs.pod:223
30979 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
30980 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
30985 #: ../src/guestfs-structs.pod:226
30986 msgid "guestfs_partition"
30990 #: ../src/guestfs-structs.pod:228
30993 " struct guestfs_partition {\n"
30994 " int32_t part_num;\n"
30995 " uint64_t part_start;\n"
30996 " uint64_t part_end;\n"
30997 " uint64_t part_size;\n"
31003 #: ../src/guestfs-structs.pod:235
31006 " struct guestfs_partition_list {\n"
31007 " uint32_t len; /* Number of elements in list. */\n"
31008 " struct guestfs_partition *val; /* Elements. */\n"
31014 #: ../src/guestfs-structs.pod:240
31017 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
31018 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
31023 #: ../src/guestfs-structs.pod:243
31024 msgid "guestfs_application"
31028 #: ../src/guestfs-structs.pod:245
31031 " struct guestfs_application {\n"
31032 " char *app_name;\n"
31033 " char *app_display_name;\n"
31034 " int32_t app_epoch;\n"
31035 " char *app_version;\n"
31036 " char *app_release;\n"
31037 " char *app_install_path;\n"
31038 " char *app_trans_path;\n"
31039 " char *app_publisher;\n"
31040 " char *app_url;\n"
31041 " char *app_source_package;\n"
31042 " char *app_summary;\n"
31043 " char *app_description;\n"
31049 #: ../src/guestfs-structs.pod:260
31052 " struct guestfs_application_list {\n"
31053 " uint32_t len; /* Number of elements in list. */\n"
31054 " struct guestfs_application *val; /* Elements. */\n"
31060 #: ../src/guestfs-structs.pod:265
31063 " void guestfs_free_application (struct guestfs_free_application *);\n"
31064 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
31069 #: ../src/guestfs.pod:5
31070 msgid "guestfs - Library for accessing and modifying virtual machine images"
31074 #: ../src/guestfs.pod:11
31077 " guestfs_h *g = guestfs_create ();\n"
31078 " guestfs_add_drive (g, \"guest.img\");\n"
31079 " guestfs_launch (g);\n"
31080 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
31081 " guestfs_touch (g, \"/hello\");\n"
31082 " guestfs_umount (g, \"/\");\n"
31083 " guestfs_close (g);\n"
31088 #: ../src/guestfs.pod:25
31090 "Libguestfs is a library for accessing and modifying guest disk images. "
31091 "Amongst the things this is good for: making batch configuration changes to "
31092 "guests, getting disk used/free statistics (see also: virt-df), migrating "
31093 "between virtualization systems (see also: virt-p2v), performing partial "
31094 "backups, performing partial guest clones, cloning guests and changing "
31095 "registry/UUID/hostname info, and much else besides."
31099 #: ../src/guestfs.pod:33
31101 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
31102 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
31103 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
31108 #: ../src/guestfs.pod:38
31110 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
31111 "what filesystem is in each LV, etc.). It can also run commands in the "
31112 "context of the guest. Also you can access filesystems over FUSE."
31116 #: ../src/guestfs.pod:43
31118 "Libguestfs is a library that can be linked with C and C++ management "
31119 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
31120 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
31125 #: ../src/guestfs.pod:48
31127 "You don't need to be root to use libguestfs, although obviously you do need "
31128 "enough permissions to access the disk images."
31132 #: ../src/guestfs.pod:51
31134 "Libguestfs is a large API because it can do many things. For a gentle "
31135 "introduction, please read the L</API OVERVIEW> section next."
31139 #: ../src/guestfs.pod:54
31141 "There are also some example programs in the L<guestfs-examples(3)> manual "
31146 #: ../src/guestfs.pod:57
31147 msgid "API OVERVIEW"
31151 #: ../src/guestfs.pod:59
31153 "This section provides a gentler overview of the libguestfs API. We also try "
31154 "to group API calls together, where that may not be obvious from reading "
31155 "about the individual calls in the main section of this manual."
31159 #: ../src/guestfs.pod:64
31164 #: ../src/guestfs.pod:66
31166 "Before you can use libguestfs calls, you have to create a handle. Then you "
31167 "must add at least one disk image to the handle, followed by launching the "
31168 "handle, then performing whatever operations you want, and finally closing "
31169 "the handle. By convention we use the single letter C<g> for the name of the "
31170 "handle variable, although of course you can use any name you want."
31174 #: ../src/guestfs.pod:73
31175 msgid "The general structure of all libguestfs-using programs looks like this:"
31179 #: ../src/guestfs.pod:76
31182 " guestfs_h *g = guestfs_create ();\n"
31187 #: ../src/guestfs.pod:78
31190 " /* Call guestfs_add_drive additional times if there are\n"
31191 " * multiple disk images.\n"
31193 " guestfs_add_drive (g, \"guest.img\");\n"
31198 #: ../src/guestfs.pod:83
31201 " /* Most manipulation calls won't work until you've launched\n"
31202 " * the handle 'g'. You have to do this _after_ adding drives\n"
31203 " * and _before_ other commands.\n"
31205 " guestfs_launch (g);\n"
31210 #: ../src/guestfs.pod:89
31213 " /* Now you can examine what partitions, LVs etc are available.\n"
31215 " char **partitions = guestfs_list_partitions (g);\n"
31216 " char **logvols = guestfs_lvs (g);\n"
31221 #: ../src/guestfs.pod:94
31224 " /* To access a filesystem in the image, you must mount it.\n"
31226 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
31231 #: ../src/guestfs.pod:98
31234 " /* Now you can perform filesystem actions on the guest\n"
31237 " guestfs_touch (g, \"/hello\");\n"
31242 #: ../src/guestfs.pod:103
31245 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
31246 " * it is done automatically when you close the handle. See\n"
31247 " * discussion of autosync in this page.\n"
31249 " guestfs_sync (g);\n"
31254 #: ../src/guestfs.pod:109
31257 " /* Close the handle 'g'. */\n"
31258 " guestfs_close (g);\n"
31263 #: ../src/guestfs.pod:112
31265 "The code above doesn't include any error checking. In real code you should "
31266 "check return values carefully for errors. In general all functions that "
31267 "return integers return C<-1> on error, and all functions that return "
31268 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
31269 "how to handle errors, and consult the documentation for each function call "
31270 "below to see precisely how they return error indications. See L<guestfs-"
31271 "examples(3)> for fully worked examples."
31275 #: ../src/guestfs.pod:121
31276 msgid "DISK IMAGES"
31280 #: ../src/guestfs.pod:123
31282 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
31283 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
31284 "actual block device, or simply an empty file of zeroes that you have created "
31285 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
31290 #: ../src/guestfs.pod:129
31292 "The call you should use in modern code for adding drives is L</"
31293 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
31294 "specifying that the format is raw, do:"
31298 #: ../src/guestfs.pod:133
31301 " guestfs_add_drive_opts (g, filename,\n"
31302 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31308 #: ../src/guestfs.pod:137
31309 msgid "You can add a disk read-only using:"
31313 #: ../src/guestfs.pod:139
31316 " guestfs_add_drive_opts (g, filename,\n"
31317 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31318 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
31324 #: ../src/guestfs.pod:144
31326 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
31327 "libguestfs won't modify the file."
31331 #: ../src/guestfs.pod:147
31333 "Be extremely cautious if the disk image is in use, eg. if it is being used "
31334 "by a virtual machine. Adding it read-write will almost certainly cause disk "
31335 "corruption, but adding it read-only is safe."
31339 #: ../src/guestfs.pod:151
31341 "You must add at least one disk image, and you may add multiple disk images. "
31342 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
31343 "first one you added), C</dev/sdb> (for the second one you added), etc."
31347 #: ../src/guestfs.pod:156
31349 "Once L</guestfs_launch> has been called you cannot add any more images. You "
31350 "can call L</guestfs_list_devices> to get a list of the device names, in the "
31351 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
31355 #: ../src/guestfs.pod:161
31360 #: ../src/guestfs.pod:163
31362 "Before you can read or write files, create directories and so on in a disk "
31363 "image that contains filesystems, you have to mount those filesystems using "
31364 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
31365 "a disk image contains (for example) one partition with a filesystem on that "
31366 "partition, then you can mount it directly:"
31370 #: ../src/guestfs.pod:170
31373 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
31378 #: ../src/guestfs.pod:172
31380 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
31381 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
31382 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
31383 "that these are libguestfs virtual devices, and are nothing to do with host "
31388 #: ../src/guestfs.pod:178
31390 "If you are given a disk image and you don't know what it contains then you "
31391 "have to find out. Libguestfs can do that too: use L</"
31392 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
31393 "LVs, and either try mounting each to see what is mountable, or else examine "
31394 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
31395 "filesystems, use L</guestfs_list_filesystems>."
31399 #: ../src/guestfs.pod:186
31401 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
31402 "L</INSPECTION> below). But you might find it easier to look at higher level "
31403 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
31407 #: ../src/guestfs.pod:191
31409 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
31410 "several other variations of the C<guestfs_mount_*> call."
31414 #: ../src/guestfs.pod:194
31415 msgid "FILESYSTEM ACCESS AND MODIFICATION"
31419 #: ../src/guestfs.pod:196
31421 "The majority of the libguestfs API consists of fairly low-level calls for "
31422 "accessing and modifying the files, directories, symlinks etc on mounted "
31423 "filesystems. There are over a hundred such calls which you can find listed "
31424 "in detail below in this man page, and we don't even pretend to cover them "
31425 "all in this overview."
31429 #: ../src/guestfs.pod:202
31431 "Specify filenames as full paths, starting with C<\"/\"> and including the "
31436 #: ../src/guestfs.pod:205
31438 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
31439 "the file called C<\"etc/passwd\"> then you could do:"
31443 #: ../src/guestfs.pod:208
31446 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
31451 #: ../src/guestfs.pod:210
31453 "This would return C<data> as a newly allocated buffer containing the full "
31454 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
31455 "or C<NULL> if there was an error."
31459 #: ../src/guestfs.pod:214
31461 "As another example, to create a top-level directory on that filesystem "
31462 "called C<\"var\"> you would do:"
31466 #: ../src/guestfs.pod:217
31469 " guestfs_mkdir (g, \"/var\");\n"
31474 #: ../src/guestfs.pod:219
31475 msgid "To create a symlink you could do:"
31479 #: ../src/guestfs.pod:221
31482 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
31483 " \"/etc/rc3.d/S30portmap\");\n"
31488 #: ../src/guestfs.pod:224
31490 "Libguestfs will reject attempts to use relative paths and there is no "
31491 "concept of a current working directory."
31495 #: ../src/guestfs.pod:227
31497 "Libguestfs can return errors in many situations: for example if the "
31498 "filesystem isn't writable, or if a file or directory that you requested "
31499 "doesn't exist. If you are using the C API (documented here) you have to "
31500 "check for those error conditions after each call. (Other language bindings "
31501 "turn these errors into exceptions)."
31505 #: ../src/guestfs.pod:233
31507 "File writes are affected by the per-handle umask, set by calling L</"
31508 "guestfs_umask> and defaulting to 022. See L</UMASK>."
31512 #: ../src/guestfs.pod:236
31513 msgid "PARTITIONING"
31517 #: ../src/guestfs.pod:238
31519 "Libguestfs contains API calls to read, create and modify partition tables on "
31524 #: ../src/guestfs.pod:241
31526 "In the common case where you want to create a single partition covering the "
31527 "whole disk, you should use the L</guestfs_part_disk> call:"
31531 #: ../src/guestfs.pod:245
31534 " const char *parttype = \"mbr\";\n"
31535 " if (disk_is_larger_than_2TB)\n"
31536 " parttype = \"gpt\";\n"
31537 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
31542 #: ../src/guestfs.pod:250
31544 "Obviously this effectively wipes anything that was on that disk image before."
31548 #: ../src/guestfs.pod:253
31553 #: ../src/guestfs.pod:255
31555 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
31556 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
31557 "you familiarize yourself with the concepts of physical volumes, volume "
31558 "groups and logical volumes."
31562 #: ../src/guestfs.pod:260
31564 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
31565 "tldp.org/HOWTO/LVM-HOWTO/>."
31569 #: ../src/guestfs.pod:263
31570 msgid "DOWNLOADING"
31574 #: ../src/guestfs.pod:265
31576 "Use L</guestfs_cat> to download small, text only files. This call is "
31577 "limited to files which are less than 2 MB and which cannot contain any ASCII "
31578 "NUL (C<\\0>) characters. However the API is very simple to use."
31582 #: ../src/guestfs.pod:269
31584 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
31585 "bit data, since it returns a (pointer, size) pair. However it is still "
31586 "limited to \"small\" files, less than 2 MB."
31590 #: ../src/guestfs.pod:273
31592 "L</guestfs_download> can be used to download any file, with no limits on "
31593 "content or size (even files larger than 4 GB)."
31597 #: ../src/guestfs.pod:276
31599 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
31603 #: ../src/guestfs.pod:279
31608 #: ../src/guestfs.pod:281
31610 "It's often the case that you want to write a file or files to the disk image."
31614 #: ../src/guestfs.pod:284
31616 "To write a small file with fixed content, use L</guestfs_write>. To create "
31617 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
31618 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
31619 "of other functions for creating test files, for example L</guestfs_fill> and "
31620 "L</guestfs_fill_pattern>."
31624 #: ../src/guestfs.pod:290
31626 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
31627 "file content or size (even files larger than 4 GB)."
31631 #: ../src/guestfs.pod:293
31633 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
31637 #: ../src/guestfs.pod:295
31639 "However the fastest way to upload I<large numbers of arbitrary files> is to "
31640 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
31641 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
31642 "in a predictable way (eg. adding it last after all other drives) then you "
31643 "can get the device name from L</guestfs_list_devices> and mount it directly "
31644 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
31645 "portable between kernel versions, and they don't support labels or UUIDs. "
31646 "If you want to pre-build an image or you need to mount it using a label or "
31647 "UUID, use an ISO image instead."
31651 #: ../src/guestfs.pod:306
31656 #: ../src/guestfs.pod:308
31658 "There are various different commands for copying between files and devices "
31659 "and in and out of the guest filesystem. These are summarised in the table "
31664 #: ../src/guestfs.pod:314
31665 msgid "B<file> to B<file>"
31669 #: ../src/guestfs.pod:316
31671 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
31672 "directories recursively."
31676 #: ../src/guestfs.pod:319
31677 msgid "B<file or device> to B<file or device>"
31681 #: ../src/guestfs.pod:321
31683 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
31684 "devices in the guest."
31688 #: ../src/guestfs.pod:324
31689 msgid "Example: duplicate the contents of an LV:"
31693 #: ../src/guestfs.pod:326
31696 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
31701 #: ../src/guestfs.pod:328
31703 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
31704 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
31705 "guestfs_copy_size>."
31709 #: ../src/guestfs.pod:332
31710 msgid "B<file on the host> to B<file or device>"
31714 #: ../src/guestfs.pod:334
31715 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
31719 #: ../src/guestfs.pod:336
31720 msgid "B<file or device> to B<file on the host>"
31724 #: ../src/guestfs.pod:338
31725 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
31729 #: ../src/guestfs.pod:342
31730 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
31734 #: ../src/guestfs.pod:344
31736 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
31737 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
31738 "appears you can only upload and download to files. However many Un*x-like "
31739 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
31740 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
31741 "and arbitrary file descriptor N."
31745 #: ../src/guestfs.pod:352
31746 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
31750 #: ../src/guestfs.pod:355
31753 " guestfs_download (g, filename, \"/dev/stdout\");\n"
31758 #: ../src/guestfs.pod:357
31759 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
31763 #: ../src/guestfs.pod:359
31766 " char devfd[64];\n"
31767 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
31768 " guestfs_tar_out (g, \"/\", devfd);\n"
31773 #: ../src/guestfs.pod:363
31774 msgid "LISTING FILES"
31778 #: ../src/guestfs.pod:365
31780 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
31781 "L<guestfish(1)>-equivalent command C<ll>)."
31785 #: ../src/guestfs.pod:368
31787 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
31788 "programs, as a flat list of strings."
31792 #: ../src/guestfs.pod:371
31794 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
31795 "directory, plus additional information about each one. It is more "
31796 "equivalent to using the L<readdir(3)> call on a local filesystem."
31800 #: ../src/guestfs.pod:375
31802 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
31806 #: ../src/guestfs.pod:378
31807 msgid "RUNNING COMMANDS"
31811 #: ../src/guestfs.pod:380
31813 "Although libguestfs is primarily an API for manipulating files inside guest "
31814 "images, we also provide some limited facilities for running commands inside "
31819 #: ../src/guestfs.pod:384
31820 msgid "There are many limitations to this:"
31824 #: ../src/guestfs.pod:390
31826 "The kernel version that the command runs under will be different from what "
31831 #: ../src/guestfs.pod:395
31833 "If the command needs to communicate with daemons, then most likely they "
31834 "won't be running."
31838 #: ../src/guestfs.pod:400
31839 msgid "The command will be running in limited memory."
31843 #: ../src/guestfs.pod:404
31845 "The network may not be available unless you enable it (see L</"
31846 "guestfs_set_network>)."
31850 #: ../src/guestfs.pod:409
31851 msgid "Only supports Linux guests (not Windows, BSD, etc)."
31855 #: ../src/guestfs.pod:413
31857 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
31861 #: ../src/guestfs.pod:418
31863 "For SELinux guests, you may need to enable SELinux and load policy first. "
31864 "See L</SELINUX> in this manpage."
31868 #: ../src/guestfs.pod:423
31870 "I<Security:> It is not safe to run commands from untrusted, possibly "
31871 "malicious guests. These commands may attempt to exploit your program by "
31872 "sending unexpected output. They could also try to exploit the Linux kernel "
31873 "or qemu provided by the libguestfs appliance. They could use the network "
31874 "provided by the libguestfs appliance to bypass ordinary network partitions "
31875 "and firewalls. They could use the elevated privileges or different SELinux "
31876 "context of your program to their advantage."
31880 #: ../src/guestfs.pod:432
31882 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
31883 "(a script which runs when the guest next boots normally), and to have this "
31884 "script run the commands you want in the normal context of the running guest, "
31885 "network security and so on. For information about other security issues, "
31886 "see L</SECURITY>."
31890 #: ../src/guestfs.pod:440
31892 "The two main API calls to run commands are L</guestfs_command> and L</"
31893 "guestfs_sh> (there are also variations)."
31897 #: ../src/guestfs.pod:443
31899 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
31900 "shell globs, redirections, etc will work."
31904 #: ../src/guestfs.pod:446
31905 msgid "CONFIGURATION FILES"
31909 #: ../src/guestfs.pod:448
31911 "To read and write configuration files in Linux guest filesystems, we "
31912 "strongly recommend using Augeas. For example, Augeas understands how to "
31913 "read and write, say, a Linux shadow password file or X.org configuration "
31914 "file, and so avoids you having to write that code."
31918 #: ../src/guestfs.pod:453
31920 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
31921 "document Augeas itself here because there is excellent documentation on the "
31922 "L<http://augeas.net/> website."
31926 #: ../src/guestfs.pod:457
31928 "If you don't want to use Augeas (you fool!) then try calling L</"
31929 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
31934 #: ../src/guestfs.pod:461
31939 #: ../src/guestfs.pod:463
31941 "We support SELinux guests. To ensure that labeling happens correctly in "
31942 "SELinux guests, you need to enable SELinux and load the guest's policy:"
31946 #: ../src/guestfs.pod:471
31947 msgid "Before launching, do:"
31951 #: ../src/guestfs.pod:473
31954 " guestfs_set_selinux (g, 1);\n"
31959 #: ../src/guestfs.pod:477
31961 "After mounting the guest's filesystem(s), load the policy. This is best "
31962 "done by running the L<load_policy(8)> command in the guest itself:"
31966 #: ../src/guestfs.pod:481
31969 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
31974 #: ../src/guestfs.pod:483
31976 "(Older versions of C<load_policy> require you to specify the name of the "
31981 #: ../src/guestfs.pod:488
31983 "Optionally, set the security context for the API. The correct security "
31984 "context to use can only be known by inspecting the guest. As an example:"
31988 #: ../src/guestfs.pod:492
31991 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
31996 #: ../src/guestfs.pod:496
31997 msgid "This will work for running commands and editing existing files."
32001 #: ../src/guestfs.pod:498
32003 "When new files are created, you may need to label them explicitly, for "
32004 "example by running the external command C<restorecon pathname>."
32008 #: ../src/guestfs.pod:502
32013 #: ../src/guestfs.pod:504
32015 "Certain calls are affected by the current file mode creation mask (the "
32016 "\"umask\"). In particular ones which create files or directories, such as "
32017 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
32018 "either the default mode that the file is created with or modifies the mode "
32023 #: ../src/guestfs.pod:510
32025 "The default umask is C<022>, so files are created with modes such as C<0644> "
32026 "and directories with C<0755>."
32030 #: ../src/guestfs.pod:513
32032 "There are two ways to avoid being affected by umask. Either set umask to 0 "
32033 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
32034 "guestfs_chmod> after creating each file or directory."
32038 #: ../src/guestfs.pod:517
32039 msgid "For more information about umask, see L<umask(2)>."
32043 #: ../src/guestfs.pod:521
32045 "Libguestfs allows you to access Linux guests which have been encrypted using "
32046 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
32047 "standard. This includes nearly all whole disk encryption systems used by "
32048 "modern Linux guests."
32052 #: ../src/guestfs.pod:527
32054 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
32055 "returns the string C<crypto_LUKS>)."
32059 #: ../src/guestfs.pod:530
32061 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
32062 "will require the passphrase!"
32066 #: ../src/guestfs.pod:533
32068 "Opening a LUKS device creates a new device mapper device called C</dev/"
32069 "mapper/mapname> (where C<mapname> is the string you supply to L</"
32070 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
32071 "from and encrypted to the underlying block device respectively."
32075 #: ../src/guestfs.pod:539
32077 "LVM volume groups on the device can be made visible by calling L</"
32078 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
32079 "(s) can now be mounted in the usual way."
32083 #: ../src/guestfs.pod:543
32085 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
32086 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
32087 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
32088 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
32089 "underlying encrypted block device)."
32093 #: ../src/guestfs.pod:550
32098 #: ../src/guestfs.pod:552
32100 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
32101 "contains operating systems, an install CD or a live CD. (These APIs used to "
32102 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
32103 "version 1.5.3 the most frequently used part of this library has been "
32104 "rewritten in C and moved into the core code)."
32108 #: ../src/guestfs.pod:559
32110 "Add all disks belonging to the unknown virtual machine and call L</"
32111 "guestfs_launch> in the usual way."
32115 #: ../src/guestfs.pod:562
32117 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
32118 "and certain heuristics, and returns a list of operating systems that were "
32119 "found. An empty list means none were found. A single element is the root "
32120 "filesystem of the operating system. For dual- or multi-boot guests, "
32121 "multiple roots can be returned, each one corresponding to a separate "
32122 "operating system. (Multi-boot virtual machines are extremely rare in the "
32123 "world of virtualization, but since this scenario can happen, we have built "
32124 "libguestfs to deal with it.)"
32128 #: ../src/guestfs.pod:571
32130 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
32131 "to get additional details about that operating system. For example, call L</"
32132 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
32133 "Windows and Linux-based operating systems respectively."
32137 #: ../src/guestfs.pod:577
32139 "Un*x-like and Linux-based operating systems usually consist of several "
32140 "filesystems which are mounted at boot time (for example, a separate boot "
32141 "partition mounted on C</boot>). The inspection rules are able to detect how "
32142 "filesystems correspond to mount points. Call "
32143 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
32144 "hash table like this example:"
32148 #: ../src/guestfs.pod:584
32151 " /boot => /dev/sda1\n"
32152 " / => /dev/vg_guest/lv_root\n"
32153 " /usr => /dev/vg_guest/lv_usr\n"
32158 #: ../src/guestfs.pod:588
32160 "The caller can then make calls to L</guestfs_mount_options> to mount the "
32161 "filesystems as suggested."
32165 #: ../src/guestfs.pod:591
32167 "Be careful to mount filesystems in the right order (eg. C</> before C</"
32168 "usr>). Sorting the keys of the hash by length, shortest first, should work."
32172 #: ../src/guestfs.pod:595
32174 "Inspection currently only works for some common operating systems. "
32175 "Contributors are welcome to send patches for other operating systems that we "
32176 "currently cannot detect."
32180 #: ../src/guestfs.pod:599
32182 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
32183 "for more details. The L</guestfs_inspect_os> function just ignores any "
32184 "encrypted devices."
32188 #: ../src/guestfs.pod:603
32190 "A note on the implementation: The call L</guestfs_inspect_os> performs "
32191 "inspection and caches the results in the guest handle. Subsequent calls to "
32192 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
32193 "read the disks. If you change the content of the guest disks, you can redo "
32194 "inspection by calling L</guestfs_inspect_os> again. (L</"
32195 "guestfs_inspect_list_applications> works a little differently from the other "
32196 "calls and does read the disks. See documentation for that function for "
32201 #: ../src/guestfs.pod:612
32202 msgid "INSPECTING INSTALL DISKS"
32206 #: ../src/guestfs.pod:614
32208 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
32213 #: ../src/guestfs.pod:617
32215 "Call L</guestfs_inspect_get_format> to return the format of the operating "
32216 "system, which currently can be C<installed> (a regular operating system) or "
32217 "C<installer> (some sort of install disk)."
32221 #: ../src/guestfs.pod:621
32223 "Further information is available about the operating system that can be "
32224 "installed using the regular inspection APIs like L</"
32225 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
32229 #: ../src/guestfs.pod:626
32231 "Some additional information specific to installer disks is also available "
32232 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
32233 "guestfs_inspect_is_multipart> calls."
32237 #: ../src/guestfs.pod:631
32238 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
32242 #: ../src/guestfs.pod:633
32244 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
32245 "ntfs-3g.org/> driver."
32249 #: ../src/guestfs.pod:636
32250 msgid "DRIVE LETTERS AND PATHS"
32254 #: ../src/guestfs.pod:638
32256 "DOS and Windows still use drive letters, and the filesystems are always "
32257 "treated as case insensitive by Windows itself, and therefore you might find "
32258 "a Windows configuration file referring to a path like C<c:\\windows"
32259 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
32260 "might be referred to as C</WINDOWS/System32>."
32264 #: ../src/guestfs.pod:644
32266 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
32267 "L</guestfs_inspect_get_drive_mappings>)"
32271 #: ../src/guestfs.pod:647
32273 "Dealing with separator characters (backslash vs forward slash) is outside "
32274 "the scope of libguestfs, but usually a simple character replacement will "
32279 #: ../src/guestfs.pod:651
32281 "To resolve the case insensitivity of paths, call L</"
32282 "guestfs_case_sensitive_path>."
32286 #: ../src/guestfs.pod:654
32287 msgid "ACCESSING THE WINDOWS REGISTRY"
32291 #: ../src/guestfs.pod:656
32293 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
32294 "files, through the library C<hivex> which is part of the libguestfs project "
32295 "although ships as a separate tarball. You have to locate and download the "
32296 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
32297 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
32298 "reg(1)> for more help on this issue."
32302 #: ../src/guestfs.pod:664
32303 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
32307 #: ../src/guestfs.pod:666
32309 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
32310 "provide something which looks like a Linux symlink. The way it tries to do "
32311 "the rewriting is described here:"
32315 #: ../src/guestfs.pod:670
32317 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
32322 #: ../src/guestfs.pod:672
32324 "The essential problem is that ntfs-3g simply does not have enough "
32325 "information to do a correct job. NTFS links can contain drive letters and "
32326 "references to external device GUIDs that ntfs-3g has no way of resolving. "
32327 "It is almost certainly the case that libguestfs callers should ignore what "
32328 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
32332 #: ../src/guestfs.pod:679
32334 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
32335 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
32336 "attribute, and read the raw reparse data from that (you can find the format "
32337 "documented in various places around the web)."
32341 #: ../src/guestfs.pod:684
32342 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
32346 #: ../src/guestfs.pod:686
32348 "There are other useful extended attributes that can be read from ntfs-3g "
32349 "filesystems (using L</guestfs_getxattr>). See:"
32353 #: ../src/guestfs.pod:689
32355 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
32359 #: ../src/guestfs.pod:691
32360 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
32364 #: ../src/guestfs.pod:693
32366 "Although we don't want to discourage you from using the C API, we will "
32367 "mention here that the same API is also available in other languages."
32371 #: ../src/guestfs.pod:696
32373 "The API is broadly identical in all supported languages. This means that "
32374 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
32375 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
32376 "OCaml. In other words, a straightforward, predictable isomorphism between "
32381 #: ../src/guestfs.pod:702
32383 "Error messages are automatically transformed into exceptions if the language "
32388 #: ../src/guestfs.pod:705
32390 "We don't try to \"object orientify\" parts of the API in OO languages, "
32391 "although contributors are welcome to write higher level APIs above what we "
32392 "provide in their favourite languages if they wish."
32396 #: ../src/guestfs.pod:711
32401 #: ../src/guestfs.pod:713
32403 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
32404 "identical to the C API. C++ classes and exceptions are not used."
32408 #: ../src/guestfs.pod:717
32413 #: ../src/guestfs.pod:719
32415 "The C# bindings are highly experimental. Please read the warnings at the "
32416 "top of C<csharp/Libguestfs.cs>."
32420 #: ../src/guestfs.pod:722
32425 #: ../src/guestfs.pod:724
32427 "This is the only language binding that is working but incomplete. Only "
32428 "calls which return simple integers have been bound in Haskell, and we are "
32429 "looking for help to complete this binding."
32433 #: ../src/guestfs.pod:728
32438 #: ../src/guestfs.pod:730
32440 "Full documentation is contained in the Javadoc which is distributed with "
32441 "libguestfs. For examples, see L<guestfs-java(3)>."
32445 #: ../src/guestfs.pod:733
32450 #: ../src/guestfs.pod:735
32451 msgid "See L<guestfs-ocaml(3)>."
32455 #: ../src/guestfs.pod:737
32460 #: ../src/guestfs.pod:739
32461 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
32465 #: ../src/guestfs.pod:741
32470 #: ../src/guestfs.pod:743
32472 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
32473 "the php-libguestfs package for your distribution."
32477 #: ../src/guestfs.pod:746
32478 msgid "The PHP binding only works correctly on 64 bit machines."
32482 #: ../src/guestfs.pod:748
32487 #: ../src/guestfs.pod:750
32488 msgid "See L<guestfs-python(3)>."
32492 #: ../src/guestfs.pod:752
32497 #: ../src/guestfs.pod:754
32498 msgid "See L<guestfs-ruby(3)>."
32502 #: ../src/guestfs.pod:756
32503 msgid "B<shell scripts>"
32507 #: ../src/guestfs.pod:758
32508 msgid "See L<guestfish(1)>."
32512 #: ../src/guestfs.pod:762
32513 msgid "LIBGUESTFS GOTCHAS"
32517 #: ../src/guestfs.pod:764
32519 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
32520 "system [...] that works in the way it is documented but is counterintuitive "
32521 "and almost invites mistakes.\""
32525 #: ../src/guestfs.pod:768
32527 "Since we developed libguestfs and the associated tools, there are several "
32528 "things we would have designed differently, but are now stuck with for "
32529 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
32530 "release, you can expect these to change. Beware of them."
32534 #: ../src/guestfs.pod:776
32535 msgid "Autosync / forgetting to sync."
32539 #: ../src/guestfs.pod:778
32541 "I<Update:> Autosync is enabled by default for all API users starting from "
32542 "libguestfs 1.5.24. This section only applies to older versions."
32546 #: ../src/guestfs.pod:781
32548 "When modifying a filesystem from C or another language, you B<must> unmount "
32549 "all filesystems and call L</guestfs_sync> explicitly before you close the "
32550 "libguestfs handle. You can also call:"
32554 #: ../src/guestfs.pod:785
32557 " guestfs_set_autosync (g, 1);\n"
32562 #: ../src/guestfs.pod:787
32564 "to have the unmount/sync done automatically for you when the handle 'g' is "
32565 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
32569 #: ../src/guestfs.pod:791
32571 "If you forget to do this, then it is entirely possible that your changes "
32572 "won't be written out, or will be partially written, or (very rarely) that "
32573 "you'll get disk corruption."
32577 #: ../src/guestfs.pod:795
32579 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
32580 "guestfish scripts that forget to sync will work just fine, which can make "
32581 "this very puzzling if you are trying to debug a problem."
32585 #: ../src/guestfs.pod:799
32586 msgid "Mount option C<-o sync> should not be the default."
32590 #: ../src/guestfs.pod:801
32592 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
32593 "However C<-o sync> does not add any reliability benefit, but does have a "
32594 "very large performance impact."
32598 #: ../src/guestfs.pod:805
32600 "The work around is to use L</guestfs_mount_options> and set the mount "
32601 "options that you actually want to use."
32605 #: ../src/guestfs.pod:808
32606 msgid "Read-only should be the default."
32610 #: ../src/guestfs.pod:810
32612 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
32613 "specify I<--rw> if you want to make changes to the image."
32617 #: ../src/guestfs.pod:813
32618 msgid "This would reduce the potential to corrupt live VM images."
32622 #: ../src/guestfs.pod:815
32624 "Note that many filesystems change the disk when you just mount and unmount, "
32625 "even if you didn't perform any writes. You need to use L</"
32626 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
32630 #: ../src/guestfs.pod:819
32631 msgid "guestfish command line is hard to use."
32635 #: ../src/guestfs.pod:821
32637 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
32638 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
32639 "exist, so it fails. In earlier versions of guestfish the error message was "
32640 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
32641 "we should have used C<guestfish -c command> to run commands."
32645 #: ../src/guestfs.pod:828
32646 msgid "guestfish megabyte modifiers don't work right on all commands"
32650 #: ../src/guestfs.pod:830
32652 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
32653 "other modifiers). What guestfish actually does is to multiply the number "
32654 "part by the modifier part and pass the result to the C API. However this "
32655 "doesn't work for a few APIs which aren't expecting bytes, but are already "
32656 "expecting some other unit (eg. megabytes)."
32660 #: ../src/guestfs.pod:837
32661 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
32665 #: ../src/guestfs.pod:839
32668 " lvcreate LV VG 100M\n"
32673 #: ../src/guestfs.pod:841
32675 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
32676 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
32677 "megabytes * megabytes) logical volume. The error message you get from this "
32678 "is also a little obscure."
32682 #: ../src/guestfs.pod:846
32684 "This could be fixed in the generator by specially marking parameters and "
32685 "return values which take bytes or other units."
32689 #: ../src/guestfs.pod:849
32690 msgid "Ambiguity between devices and paths"
32694 #: ../src/guestfs.pod:851
32696 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
32697 "sdb2>) and a similar pathname. A file might just happen to be called "
32698 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
32702 #: ../src/guestfs.pod:856
32704 "In the current API we usually resolve this ambiguity by having two separate "
32705 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
32706 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
32707 "detecting if the path supplied begins with C</dev/>."
32711 #: ../src/guestfs.pod:862
32713 "To avoid both the ambiguity and the need to duplicate some calls, we could "
32714 "make paths/devices into structured names. One way to do this would be to "
32715 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
32716 "aspect of grub. Another way would be to use a structured type, equivalent "
32717 "to this OCaml type:"
32721 #: ../src/guestfs.pod:868
32724 " type path = Path of string | Device of int | Partition of int * int\n"
32729 #: ../src/guestfs.pod:870
32730 msgid "which would allow you to pass arguments like:"
32734 #: ../src/guestfs.pod:872
32737 " Path \"/foo/bar\"\n"
32738 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
32739 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
32740 " Path \"/dev/sdb2\" (* not a device *)\n"
32745 #: ../src/guestfs.pod:877
32747 "As you can see there are still problems to resolve even with this "
32748 "representation. Also consider how it might work in guestfish."
32752 #: ../src/guestfs.pod:882
32753 msgid "KEYS AND PASSPHRASES"
32757 #: ../src/guestfs.pod:884
32759 "Certain libguestfs calls take a parameter that contains sensitive key "
32760 "material, passed in as a C string."
32764 #: ../src/guestfs.pod:887
32766 "In the future we would hope to change the libguestfs implementation so that "
32767 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
32768 "swap. However this is I<not> done at the moment, because of the complexity "
32769 "of such an implementation."
32773 #: ../src/guestfs.pod:892
32775 "Therefore you should be aware that any key parameter you pass to libguestfs "
32776 "might end up being written out to the swap partition. If this is a concern, "
32777 "scrub the swap partition or don't use libguestfs on encrypted devices."
32781 #: ../src/guestfs.pod:897
32782 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
32786 #: ../src/guestfs.pod:899
32788 "All high-level libguestfs actions are synchronous. If you want to use "
32789 "libguestfs asynchronously then you must create a thread."
32793 #: ../src/guestfs.pod:902
32795 "Only use the handle from a single thread. Either use the handle exclusively "
32796 "from one thread, or provide your own mutex so that two threads cannot issue "
32797 "calls on the same handle at the same time."
32801 #: ../src/guestfs.pod:906
32803 "See the graphical program guestfs-browser for one possible architecture for "
32804 "multithreaded programs using libvirt and libguestfs."
32808 #: ../src/guestfs.pod:909
32813 #: ../src/guestfs.pod:911
32815 "Libguestfs needs a supermin appliance, which it finds by looking along an "
32820 #: ../src/guestfs.pod:914
32822 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
32823 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
32827 #: ../src/guestfs.pod:917
32829 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
32830 "to change the directories that libguestfs will search in. The value is a "
32831 "colon-separated list of paths. The current directory is I<not> searched "
32832 "unless the path contains an empty element or C<.>. For example "
32833 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
32834 "then C</usr/lib/guestfs>."
32838 #: ../src/guestfs.pod:924
32839 msgid "QEMU WRAPPERS"
32843 #: ../src/guestfs.pod:926
32845 "If you want to compile your own qemu, run qemu from a non-standard location, "
32846 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
32851 #: ../src/guestfs.pod:930
32853 "There is one important rule to remember: you I<must C<exec qemu>> as the "
32854 "last command in the shell script (so that qemu replaces the shell and "
32855 "becomes the direct child of the libguestfs-using program). If you don't do "
32856 "this, then the qemu process won't be cleaned up correctly."
32860 #: ../src/guestfs.pod:935
32862 "Here is an example of a wrapper, where I have built my own copy of qemu from "
32867 #: ../src/guestfs.pod:938
32871 " qemudir=/home/rjones/d/qemu\n"
32872 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
32877 #: ../src/guestfs.pod:942
32879 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
32880 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
32885 #: ../src/guestfs.pod:946
32888 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
32893 #: ../src/guestfs.pod:948
32895 "Note that libguestfs also calls qemu with the -help and -version options in "
32896 "order to determine features."
32900 #: ../src/guestfs.pod:951
32902 "Wrappers can also be used to edit the options passed to qemu. In the "
32903 "following example, the C<-machine ...> option (C<-machine> and the following "
32904 "argument) are removed from the command line and replaced with C<-machine pc,"
32905 "accel=tcg>. The while loop iterates over the options until it finds the "
32906 "right one to remove, putting the remaining options into the C<args> array."
32910 #: ../src/guestfs.pod:960
32914 " while [ $# -gt 0 ]; do\n"
32915 " case \"$1\" in\n"
32919 " args[i]=\"$1\"\n"
32928 #: ../src/guestfs.pod:972
32931 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
32936 #: ../src/guestfs.pod:974
32937 msgid "ATTACHING TO RUNNING DAEMONS"
32941 #: ../src/guestfs.pod:976
32943 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
32944 "babies. Use with caution."
32948 #: ../src/guestfs.pod:979
32950 "I<Note (2):> This section explains how to attach to a running daemon from a "
32951 "low level perspective. For most users, simply using virt tools such as "
32952 "L<guestfish(1)> with the I<--live> option will \"just work\"."
32956 #: ../src/guestfs.pod:983
32957 msgid "Using guestfs_set_attach_method"
32961 #: ../src/guestfs.pod:985
32963 "By calling L</guestfs_set_attach_method> you can change how the library "
32964 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
32965 "ARCHITECTURE> for some background)."
32969 #: ../src/guestfs.pod:989
32971 "The normal attach method is C<appliance>, where a small appliance is created "
32972 "containing the daemon, and then the library connects to this."
32976 #: ../src/guestfs.pod:992
32978 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
32979 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
32980 "daemon over the Unix domain socket."
32984 #: ../src/guestfs.pod:996
32986 "The normal use for this is to connect to a running virtual machine that "
32987 "contains a C<guestfsd> daemon, and send commands so you can read and write "
32988 "files inside the live virtual machine."
32992 #: ../src/guestfs.pod:1000
32993 msgid "Using guestfs_add_domain with live flag"
32997 #: ../src/guestfs.pod:1002
32999 "L</guestfs_add_domain> provides some help for getting the correct attach "
33000 "method. If you pass the C<live> option to this function, then (if the "
33001 "virtual machine is running) it will examine the libvirt XML looking for a "
33002 "virtio-serial channel to connect to:"
33006 #: ../src/guestfs.pod:1008
33013 " <channel type='unix'>\n"
33014 " <source mode='bind' path='/path/to/socket'/>\n"
33015 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
33024 #: ../src/guestfs.pod:1020
33026 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
33027 "method to C<unix:/path/to/socket>."
33031 #: ../src/guestfs.pod:1023
33033 "Some of the libguestfs tools (including guestfish) support a I<--live> "
33034 "option which is passed through to L</guestfs_add_domain> thus allowing you "
33035 "to attach to and modify live virtual machines."
33039 #: ../src/guestfs.pod:1027
33041 "The virtual machine needs to have been set up beforehand so that it has the "
33042 "virtio-serial channel and so that guestfsd is running inside it."
33046 #: ../src/guestfs.pod:1031
33047 msgid "ABI GUARANTEE"
33051 #: ../src/guestfs.pod:1033
33053 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
33054 "actions as outlined in this section. Although we will deprecate some "
33055 "actions, for example if they get replaced by newer calls, we will keep the "
33056 "old actions forever. This allows you the developer to program in confidence "
33057 "against the libguestfs API."
33061 #: ../src/guestfs.pod:1039
33062 msgid "BLOCK DEVICE NAMING"
33066 #: ../src/guestfs.pod:1041
33068 "In the kernel there is now quite a profusion of schemata for naming block "
33069 "devices (in this context, by I<block device> I mean a physical or virtual "
33070 "hard drive). The original Linux IDE driver used names starting with C</dev/"
33071 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
33072 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
33073 "for the old IDE driver (particularly for SATA devices) those devices also "
33074 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
33075 "paravirtualized drivers. This has created several different naming systems, "
33076 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
33080 #: ../src/guestfs.pod:1053
33082 "As discussed above, libguestfs uses a qemu appliance running an embedded "
33083 "Linux kernel to access block devices. We can run a variety of appliances "
33084 "based on a variety of Linux kernels."
33088 #: ../src/guestfs.pod:1057
33090 "This causes a problem for libguestfs because many API calls use device or "
33091 "partition names. Working scripts and the recipe (example) scripts that we "
33092 "make available over the internet could fail if the naming scheme changes."
33096 #: ../src/guestfs.pod:1062
33098 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
33099 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
33100 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
33101 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
33105 #: ../src/guestfs.pod:1068
33107 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
33108 "L</guestfs_list_partitions> and similar calls return the true names of the "
33109 "devices and partitions as known to the appliance."
33113 #: ../src/guestfs.pod:1073
33114 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
33118 #: ../src/guestfs.pod:1075
33120 "Usually this translation is transparent. However in some (very rare) cases "
33121 "you may need to know the exact algorithm. Such cases include where you use "
33122 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
33123 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
33127 #: ../src/guestfs.pod:1081
33129 "The algorithm is applied only to I<parameters> which are known to be either "
33130 "device or partition names. Return values from functions such as L</"
33131 "guestfs_list_devices> are never changed."
33135 #: ../src/guestfs.pod:1089
33136 msgid "Is the string a parameter which is a device or partition name?"
33140 #: ../src/guestfs.pod:1093
33141 msgid "Does the string begin with C</dev/sd>?"
33145 #: ../src/guestfs.pod:1097
33147 "Does the named device exist? If so, we use that device. However if I<not> "
33148 "then we continue with this algorithm."
33152 #: ../src/guestfs.pod:1102
33153 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
33157 #: ../src/guestfs.pod:1104
33158 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
33162 #: ../src/guestfs.pod:1106
33163 msgid "If that named device exists, use it. If not, continue."
33167 #: ../src/guestfs.pod:1110
33168 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
33172 #: ../src/guestfs.pod:1112
33173 msgid "If that named device exists, use it. If not, return an error."
33177 #: ../src/guestfs.pod:1116
33178 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
33182 #: ../src/guestfs.pod:1118
33184 "Although the standard naming scheme and automatic translation is useful for "
33185 "simple programs and guestfish scripts, for larger programs it is best not to "
33186 "rely on this mechanism."
33190 #: ../src/guestfs.pod:1122
33192 "Where possible for maximum future portability programs using libguestfs "
33193 "should use these future-proof techniques:"
33197 #: ../src/guestfs.pod:1129
33199 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
33200 "device names, and then use those names directly."
33204 #: ../src/guestfs.pod:1132
33206 "Since those device names exist by definition, they will never be translated."
33210 #: ../src/guestfs.pod:1137
33212 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
33213 "filesystem labels."
33217 #: ../src/guestfs.pod:1142
33222 #: ../src/guestfs.pod:1144
33224 "This section discusses security implications of using libguestfs, "
33225 "particularly with untrusted or malicious guests or disk images."
33229 #: ../src/guestfs.pod:1147
33230 msgid "GENERAL SECURITY CONSIDERATIONS"
33234 #: ../src/guestfs.pod:1149
33236 "Be careful with any files or data that you download from a guest (by "
33237 "\"download\" we mean not just the L</guestfs_download> command but any "
33238 "command that reads files, filenames, directories or anything else from a "
33239 "disk image). An attacker could manipulate the data to fool your program "
33240 "into doing the wrong thing. Consider cases such as:"
33244 #: ../src/guestfs.pod:1159
33245 msgid "the data (file etc) not being present"
33249 #: ../src/guestfs.pod:1163
33250 msgid "being present but empty"
33254 #: ../src/guestfs.pod:1167
33255 msgid "being much larger than normal"
33259 #: ../src/guestfs.pod:1171
33260 msgid "containing arbitrary 8 bit data"
33264 #: ../src/guestfs.pod:1175
33265 msgid "being in an unexpected character encoding"
33269 #: ../src/guestfs.pod:1179
33270 msgid "containing homoglyphs."
33274 #: ../src/guestfs.pod:1183
33275 msgid "SECURITY OF MOUNTING FILESYSTEMS"
33279 #: ../src/guestfs.pod:1185
33281 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
33282 "(VFS) module can sometimes be escalated into exploits by deliberately "
33283 "creating a malicious, malformed filesystem. These exploits are very severe "
33284 "for two reasons. Firstly there are very many filesystem drivers in the "
33285 "kernel, and many of them are infrequently used and not much developer "
33286 "attention has been paid to the code. Linux userspace helps potential "
33287 "crackers by detecting the filesystem type and automatically choosing the "
33288 "right VFS driver, even if that filesystem type is obscure or unexpected for "
33289 "the administrator. Secondly, a kernel-level exploit is like a local root "
33290 "exploit (worse in some ways), giving immediate and total access to the "
33291 "system right down to the hardware level."
33295 #: ../src/guestfs.pod:1198
33297 "That explains why you should never mount a filesystem from an untrusted "
33298 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
33299 "inside a qemu virtual machine, usually running as a non-root user. The "
33300 "attacker would need to write a filesystem which first exploited the kernel, "
33301 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
33302 "the libguestfs protocol, and finally to be as serious as the host kernel "
33303 "exploit it would need to escalate its privileges to root. This multi-step "
33304 "escalation, performed by a static piece of data, is thought to be extremely "
33305 "hard to do, although we never say 'never' about security issues."
33309 #: ../src/guestfs.pod:1209
33311 "In any case callers can reduce the attack surface by forcing the filesystem "
33312 "type when mounting (use L</guestfs_mount_vfs>)."
33316 #: ../src/guestfs.pod:1212
33317 msgid "PROTOCOL SECURITY"
33321 #: ../src/guestfs.pod:1214
33323 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
33324 "defined upper message size. However a program that uses libguestfs must "
33325 "also take care - for example you can write a program that downloads a binary "
33326 "from a disk image and executes it locally, and no amount of protocol "
33327 "security will save you from the consequences."
33331 #: ../src/guestfs.pod:1220
33332 msgid "INSPECTION SECURITY"
33336 #: ../src/guestfs.pod:1222
33338 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
33339 "directly from the guest, and these could contain any 8 bit data. Callers "
33340 "should be careful to escape these before printing them to a structured file "
33341 "(for example, use HTML escaping if creating a web page)."
33345 #: ../src/guestfs.pod:1228
33347 "Guest configuration may be altered in unusual ways by the administrator of "
33348 "the virtual machine, and may not reflect reality (particularly for untrusted "
33349 "or actively malicious guests). For example we parse the hostname from "
33350 "configuration files like C</etc/sysconfig/network> that we find in the "
33351 "guest, but the guest administrator can easily manipulate these files to "
33352 "provide the wrong hostname."
33356 #: ../src/guestfs.pod:1236
33358 "The inspection API parses guest configuration using two external libraries: "
33359 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
33360 "designed to be robust in the face of malicious data, although denial of "
33361 "service attacks are still possible, for example with oversized configuration "
33366 #: ../src/guestfs.pod:1242
33367 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
33371 #: ../src/guestfs.pod:1244
33373 "Be very cautious about running commands from the guest. By running a "
33374 "command in the guest, you are giving CPU time to a binary that you do not "
33375 "control, under the same user account as the library, albeit wrapped in qemu "
33376 "virtualization. More information and alternatives can be found in the "
33377 "section L</RUNNING COMMANDS>."
33381 #: ../src/guestfs.pod:1250
33382 msgid "CVE-2010-3851"
33386 #: ../src/guestfs.pod:1252
33387 msgid "https://bugzilla.redhat.com/642934"
33391 #: ../src/guestfs.pod:1254
33393 "This security bug concerns the automatic disk format detection that qemu "
33394 "does on disk images."
33398 #: ../src/guestfs.pod:1257
33400 "A raw disk image is just the raw bytes, there is no header. Other disk "
33401 "images like qcow2 contain a special header. Qemu deals with this by looking "
33402 "for one of the known headers, and if none is found then assuming the disk "
33403 "image must be raw."
33407 #: ../src/guestfs.pod:1262
33409 "This allows a guest which has been given a raw disk image to write some "
33410 "other header. At next boot (or when the disk image is accessed by "
33411 "libguestfs) qemu would do autodetection and think the disk image format was, "
33412 "say, qcow2 based on the header written by the guest."
33416 #: ../src/guestfs.pod:1267
33418 "This in itself would not be a problem, but qcow2 offers many features, one "
33419 "of which is to allow a disk image to refer to another image (called the "
33420 "\"backing disk\"). It does this by placing the path to the backing disk "
33421 "into the qcow2 header. This path is not validated and could point to any "
33422 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
33423 "\"holes\" in the qcow2 disk image, which of course is completely under the "
33424 "control of the attacker."
33428 #: ../src/guestfs.pod:1275
33430 "In libguestfs this is rather hard to exploit except under two circumstances:"
33434 #: ../src/guestfs.pod:1282
33435 msgid "You have enabled the network or have opened the disk in write mode."
33439 #: ../src/guestfs.pod:1286
33441 "You are also running untrusted code from the guest (see L</RUNNING "
33446 #: ../src/guestfs.pod:1291
33448 "The way to avoid this is to specify the expected disk format when adding "
33449 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
33450 "should always do this if the disk is raw format, and it's a good idea for "
33455 #: ../src/guestfs.pod:1296
33457 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
33458 "format is fetched from libvirt and passed through."
33462 #: ../src/guestfs.pod:1299
33464 "For libguestfs tools, use the I<--format> command line parameter as "
33469 #: ../src/guestfs.pod:1302
33470 msgid "CONNECTION MANAGEMENT"
33474 #: ../src/guestfs.pod:1304
33475 msgid "guestfs_h *"
33479 #: ../src/guestfs.pod:1306
33481 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
33482 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
33483 "handle and release all resources used."
33487 #: ../src/guestfs.pod:1310
33489 "For information on using multiple handles and threads, see the section L</"
33490 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
33494 #: ../src/guestfs.pod:1313
33495 msgid "guestfs_create"
33499 #: ../src/guestfs.pod:1315
33502 " guestfs_h *guestfs_create (void);\n"
33507 #: ../src/guestfs.pod:1317
33508 msgid "Create a connection handle."
33512 #: ../src/guestfs.pod:1319
33514 "On success this returns a non-NULL pointer to a handle. On error it returns "
33519 #: ../src/guestfs.pod:1322
33521 "You have to \"configure\" the handle after creating it. This includes "
33522 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
33523 "handle at least once."
33527 #: ../src/guestfs.pod:1326
33528 msgid "After configuring the handle, you have to call L</guestfs_launch>."
33532 #: ../src/guestfs.pod:1328
33534 "You may also want to configure error handling for the handle. See the L</"
33535 "ERROR HANDLING> section below."
33539 #: ../src/guestfs.pod:1331
33540 msgid "guestfs_close"
33544 #: ../src/guestfs.pod:1333
33547 " void guestfs_close (guestfs_h *g);\n"
33552 #: ../src/guestfs.pod:1335
33553 msgid "This closes the connection handle and frees up all resources used."
33557 #: ../src/guestfs.pod:1337
33559 "If autosync was set on the handle and the handle was launched, then this "
33560 "implicitly calls various functions to unmount filesystems and sync the "
33561 "disk. See L</guestfs_set_autosync> for more details."
33565 #: ../src/guestfs.pod:1341
33566 msgid "If a close callback was set on the handle, then it is called."
33570 #: ../src/guestfs.pod:1343
33571 msgid "ERROR HANDLING"
33575 #: ../src/guestfs.pod:1345
33577 "API functions can return errors. For example, almost all functions that "
33578 "return C<int> will return C<-1> to indicate an error."
33582 #: ../src/guestfs.pod:1348
33584 "Additional information is available for errors: an error message string and "
33585 "optionally an error number (errno) if the thing that failed was a system "
33590 #: ../src/guestfs.pod:1352
33592 "You can get at the additional information about the last error on the handle "
33593 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
33594 "up an error handler with L</guestfs_set_error_handler>."
33598 #: ../src/guestfs.pod:1357
33600 "When the handle is created, a default error handler is installed which "
33601 "prints the error message string to C<stderr>. For small short-running "
33602 "command line programs it is sufficient to do:"
33606 #: ../src/guestfs.pod:1361
33609 " if (guestfs_launch (g) == -1)\n"
33610 " exit (EXIT_FAILURE);\n"
33615 #: ../src/guestfs.pod:1364
33617 "since the default error handler will ensure that an error message has been "
33618 "printed to C<stderr> before the program exits."
33622 #: ../src/guestfs.pod:1367
33624 "For other programs the caller will almost certainly want to install an "
33625 "alternate error handler or do error handling in-line like this:"
33629 #: ../src/guestfs.pod:1370
33632 " g = guestfs_create ();\n"
33637 #: ../src/guestfs.pod:1372
33640 " /* This disables the default behaviour of printing errors\n"
33642 " guestfs_set_error_handler (g, NULL, NULL);\n"
33647 #: ../src/guestfs.pod:1376
33650 " if (guestfs_launch (g) == -1) {\n"
33651 " /* Examine the error message and print it etc. */\n"
33652 " char *msg = guestfs_last_error (g);\n"
33653 " int errnum = guestfs_last_errno (g);\n"
33654 " fprintf (stderr, \"%s\\n\", msg);\n"
33661 #: ../src/guestfs.pod:1384
33663 "Out of memory errors are handled differently. The default action is to call "
33664 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
33665 "guestfs_set_out_of_memory_handler>."
33669 #: ../src/guestfs.pod:1388
33671 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
33672 "because there is no handle if this happens there is no way to get additional "
33673 "error information. However L</guestfs_create> is supposed to be a "
33674 "lightweight operation which can only fail because of insufficient memory (it "
33675 "returns NULL in this case)."
33679 #: ../src/guestfs.pod:1394
33680 msgid "guestfs_last_error"
33684 #: ../src/guestfs.pod:1396
33687 " const char *guestfs_last_error (guestfs_h *g);\n"
33692 #: ../src/guestfs.pod:1398
33694 "This returns the last error message that happened on C<g>. If there has not "
33695 "been an error since the handle was created, then this returns C<NULL>."
33699 #: ../src/guestfs.pod:1402
33701 "The lifetime of the returned string is until the next error occurs, or L</"
33702 "guestfs_close> is called."
33706 #: ../src/guestfs.pod:1405
33707 msgid "guestfs_last_errno"
33711 #: ../src/guestfs.pod:1407
33714 " int guestfs_last_errno (guestfs_h *g);\n"
33719 #: ../src/guestfs.pod:1409
33720 msgid "This returns the last error number (errno) that happened on C<g>."
33724 #: ../src/guestfs.pod:1411
33725 msgid "If successful, an errno integer not equal to zero is returned."
33729 #: ../src/guestfs.pod:1413
33731 "If no error, this returns 0. This call can return 0 in three situations:"
33735 #: ../src/guestfs.pod:1420
33736 msgid "There has not been any error on the handle."
33740 #: ../src/guestfs.pod:1424
33742 "There has been an error but the errno was meaningless. This corresponds to "
33743 "the case where the error did not come from a failed system call, but for "
33744 "some other reason."
33748 #: ../src/guestfs.pod:1430
33750 "There was an error from a failed system call, but for some reason the errno "
33751 "was not captured and returned. This usually indicates a bug in libguestfs."
33755 #: ../src/guestfs.pod:1436
33757 "Libguestfs tries to convert the errno from inside the applicance into a "
33758 "corresponding errno for the caller (not entirely trivial: the appliance "
33759 "might be running a completely different operating system from the library "
33760 "and error numbers are not standardized across Un*xen). If this could not be "
33761 "done, then the error is translated to C<EINVAL>. In practice this should "
33762 "only happen in very rare circumstances."
33766 #: ../src/guestfs.pod:1444
33767 msgid "guestfs_set_error_handler"
33771 #: ../src/guestfs.pod:1446
33774 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
33776 " const char *msg);\n"
33777 " void guestfs_set_error_handler (guestfs_h *g,\n"
33778 " guestfs_error_handler_cb cb,\n"
33779 " void *opaque);\n"
33784 #: ../src/guestfs.pod:1453
33786 "The callback C<cb> will be called if there is an error. The parameters "
33787 "passed to the callback are an opaque data pointer and the error message "
33792 #: ../src/guestfs.pod:1457
33794 "C<errno> is not passed to the callback. To get that the callback must call "
33795 "L</guestfs_last_errno>."
33799 #: ../src/guestfs.pod:1460
33801 "Note that the message string C<msg> is freed as soon as the callback "
33802 "function returns, so if you want to stash it somewhere you must make your "
33807 #: ../src/guestfs.pod:1464
33808 msgid "The default handler prints messages on C<stderr>."
33812 #: ../src/guestfs.pod:1466
33813 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
33817 #: ../src/guestfs.pod:1468
33818 msgid "guestfs_get_error_handler"
33822 #: ../src/guestfs.pod:1470
33825 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
33826 " void **opaque_rtn);\n"
33831 #: ../src/guestfs.pod:1473
33832 msgid "Returns the current error handler callback."
33836 #: ../src/guestfs.pod:1475
33837 msgid "guestfs_set_out_of_memory_handler"
33841 #: ../src/guestfs.pod:1477
33844 " typedef void (*guestfs_abort_cb) (void);\n"
33845 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
33846 " guestfs_abort_cb);\n"
33851 #: ../src/guestfs.pod:1481
33853 "The callback C<cb> will be called if there is an out of memory situation. "
33854 "I<Note this callback must not return>."
33858 #: ../src/guestfs.pod:1484
33859 msgid "The default is to call L<abort(3)>."
33863 #: ../src/guestfs.pod:1486
33865 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
33869 #: ../src/guestfs.pod:1489
33870 msgid "guestfs_get_out_of_memory_handler"
33874 #: ../src/guestfs.pod:1491
33877 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
33882 #: ../src/guestfs.pod:1493
33883 msgid "This returns the current out of memory handler."
33887 #: ../src/guestfs.pod:1495
33892 #: ../src/guestfs.pod:1499
33897 #: ../src/guestfs.pod:1501
33902 #: ../src/guestfs.pod:1503
33903 msgid "AVAILABILITY"
33907 #: ../src/guestfs.pod:1505
33908 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
33912 #: ../src/guestfs.pod:1507
33914 "Using L</guestfs_available> you can test availability of the following "
33915 "groups of functions. This test queries the appliance to see if the "
33916 "appliance you are currently using supports the functionality."
33920 #: ../src/guestfs.pod:1512
33921 msgid "@AVAILABILITY@"
33925 #: ../src/guestfs.pod:1514
33926 msgid "GUESTFISH supported COMMAND"
33930 #: ../src/guestfs.pod:1516
33932 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
33933 "prints out the available groups and whether they are supported by this build "
33934 "of libguestfs. Note however that you have to do C<run> first."
33938 #: ../src/guestfs.pod:1521
33939 msgid "SINGLE CALLS AT COMPILE TIME"
33943 #: ../src/guestfs.pod:1523
33945 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
33946 "function, such as:"
33950 #: ../src/guestfs.pod:1526
33953 " #define LIBGUESTFS_HAVE_DD 1\n"
33958 #: ../src/guestfs.pod:1528
33959 msgid "if L</guestfs_dd> is available."
33963 #: ../src/guestfs.pod:1530
33965 "Before version 1.5.8, if you needed to test whether a single libguestfs "
33966 "function is available at compile time, we recommended using build tools such "
33967 "as autoconf or cmake. For example in autotools you could use:"
33971 #: ../src/guestfs.pod:1535
33974 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
33975 " AC_CHECK_FUNCS([guestfs_dd])\n"
33980 #: ../src/guestfs.pod:1538
33982 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
33987 #: ../src/guestfs.pod:1541
33988 msgid "SINGLE CALLS AT RUN TIME"
33992 #: ../src/guestfs.pod:1543
33994 "Testing at compile time doesn't guarantee that a function really exists in "
33995 "the library. The reason is that you might be dynamically linked against a "
33996 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
33997 "This situation unfortunately results in a segmentation fault, which is a "
33998 "shortcoming of the C dynamic linking system itself."
34002 #: ../src/guestfs.pod:1550
34004 "You can use L<dlopen(3)> to test if a function is available at run time, as "
34005 "in this example program (note that you still need the compile time check as "
34010 #: ../src/guestfs.pod:1554
34013 " #include <stdio.h>\n"
34014 " #include <stdlib.h>\n"
34015 " #include <unistd.h>\n"
34016 " #include <dlfcn.h>\n"
34017 " #include <guestfs.h>\n"
34022 #: ../src/guestfs.pod:1560
34027 " #ifdef LIBGUESTFS_HAVE_DD\n"
34029 " int has_function;\n"
34034 #: ../src/guestfs.pod:1566
34037 " /* Test if the function guestfs_dd is really available. */\n"
34038 " dl = dlopen (NULL, RTLD_LAZY);\n"
34040 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
34041 " exit (EXIT_FAILURE);\n"
34043 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
34049 #: ../src/guestfs.pod:1575
34052 " if (!has_function)\n"
34053 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
34055 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
34056 " /* Now it's safe to call\n"
34057 " guestfs_dd (g, \"foo\", \"bar\");\n"
34061 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
34068 #: ../src/guestfs.pod:1588
34070 "You may think the above is an awful lot of hassle, and it is. There are "
34071 "other ways outside of the C linking system to ensure that this kind of "
34072 "incompatibility never arises, such as using package versioning:"
34076 #: ../src/guestfs.pod:1593
34079 " Requires: libguestfs >= 1.0.80\n"
34084 #: ../src/guestfs.pod:1595
34085 msgid "CALLS WITH OPTIONAL ARGUMENTS"
34089 #: ../src/guestfs.pod:1597
34091 "A recent feature of the API is the introduction of calls which take optional "
34092 "arguments. In C these are declared 3 ways. The main way is as a call which "
34093 "takes variable arguments (ie. C<...>), as in this example:"
34097 #: ../src/guestfs.pod:1602
34100 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
34105 #: ../src/guestfs.pod:1604
34107 "Call this with a list of optional arguments, terminated by C<-1>. So to "
34108 "call with no optional arguments specified:"
34112 #: ../src/guestfs.pod:1607
34115 " guestfs_add_drive_opts (g, filename, -1);\n"
34120 #: ../src/guestfs.pod:1609
34121 msgid "With a single optional argument:"
34125 #: ../src/guestfs.pod:1611
34128 " guestfs_add_drive_opts (g, filename,\n"
34129 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
34135 #: ../src/guestfs.pod:1615
34140 #: ../src/guestfs.pod:1617
34143 " guestfs_add_drive_opts (g, filename,\n"
34144 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
34145 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
34151 #: ../src/guestfs.pod:1622
34153 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
34158 #: ../src/guestfs.pod:1625
34159 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
34163 #: ../src/guestfs.pod:1627
34165 "The second variant has the same name with the suffix C<_va>, which works the "
34166 "same way but takes a C<va_list>. See the C manual for details. For the "
34167 "example function, this is declared:"
34171 #: ../src/guestfs.pod:1631
34174 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
34175 " va_list args);\n"
34180 #: ../src/guestfs.pod:1634
34181 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
34185 #: ../src/guestfs.pod:1636
34187 "The third variant is useful where you need to construct these calls. You "
34188 "pass in a structure where you fill in the optional fields. The structure "
34189 "has a bitmask as the first element which you must set to indicate which "
34190 "fields you have filled in. For our example function the structure and call "
34195 #: ../src/guestfs.pod:1642
34198 " struct guestfs_add_drive_opts_argv {\n"
34199 " uint64_t bitmask;\n"
34201 " const char *format;\n"
34204 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
34205 " const struct guestfs_add_drive_opts_argv *optargs);\n"
34210 #: ../src/guestfs.pod:1651
34211 msgid "You could call it like this:"
34215 #: ../src/guestfs.pod:1653
34218 " struct guestfs_add_drive_opts_argv optargs = {\n"
34219 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
34220 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
34221 " .readonly = 1,\n"
34222 " .format = \"qcow2\"\n"
34228 #: ../src/guestfs.pod:1660
34231 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
34236 #: ../src/guestfs.pod:1668
34237 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
34241 #: ../src/guestfs.pod:1673
34242 msgid "You do not need to fill in all fields of the structure."
34246 #: ../src/guestfs.pod:1677
34248 "There must be a one-to-one correspondence between fields of the structure "
34249 "that are filled in, and bits set in the bitmask."
34253 #: ../src/guestfs.pod:1682
34254 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
34258 #: ../src/guestfs.pod:1684
34260 "In other languages, optional arguments are expressed in the way that is "
34261 "natural for that language. We refer you to the language-specific "
34262 "documentation for more details on that."
34266 #: ../src/guestfs.pod:1688
34267 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
34271 #: ../src/guestfs.pod:1690
34272 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
34276 #: ../src/guestfs.pod:1692
34278 "B<Note:> This section documents the generic event mechanism introduced in "
34279 "libguestfs 1.10, which you should use in new code if possible. The old "
34280 "functions C<guestfs_set_log_message_callback>, "
34281 "C<guestfs_set_subprocess_quit_callback>, "
34282 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
34283 "C<guestfs_set_progress_callback> are no longer documented in this manual "
34284 "page. Because of the ABI guarantee, the old functions continue to work."
34288 #: ../src/guestfs.pod:1701
34290 "Handles generate events when certain things happen, such as log messages "
34291 "being generated, progress messages during long-running operations, or the "
34292 "handle being closed. The API calls described below let you register a "
34293 "callback to be called when events happen. You can register multiple "
34294 "callbacks (for the same, different or overlapping sets of events), and "
34295 "individually remove callbacks. If callbacks are not removed, then they "
34296 "remain in force until the handle is closed."
34300 #: ../src/guestfs.pod:1709
34302 "In the current implementation, events are only generated synchronously: that "
34303 "means that events (and hence callbacks) can only happen while you are in the "
34304 "middle of making another libguestfs call. The callback is called in the "
34309 #: ../src/guestfs.pod:1714
34311 "Events may contain a payload, usually nothing (void), an array of 64 bit "
34312 "unsigned integers, or a message buffer. Payloads are discussed later on."
34316 #: ../src/guestfs.pod:1718
34317 msgid "CLASSES OF EVENTS"
34321 #: ../src/guestfs.pod:1722
34322 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
34326 #: ../src/guestfs.pod:1725
34328 "The callback function will be called while the handle is being closed "
34329 "(synchronously from L</guestfs_close>)."
34333 #: ../src/guestfs.pod:1728
34335 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
34336 "handles that are open when the program exits. This means that this callback "
34337 "might be called indirectly from L<exit(3)>, which can cause unexpected "
34338 "problems in higher-level languages (eg. if your HLL interpreter has already "
34339 "been cleaned up by the time this is called, and if your callback then jumps "
34340 "into some HLL function)."
34344 #: ../src/guestfs.pod:1735
34346 "If no callback is registered: the handle is closed without any callback "
34351 #: ../src/guestfs.pod:1738
34352 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
34356 #: ../src/guestfs.pod:1741
34358 "The callback function will be called when the child process quits, either "
34359 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
34360 "corresponds to a transition from any state to the CONFIG state)."
34364 #: ../src/guestfs.pod:1745 ../src/guestfs.pod:1754
34365 msgid "If no callback is registered: the event is ignored."
34369 #: ../src/guestfs.pod:1747
34370 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
34374 #: ../src/guestfs.pod:1750
34376 "The callback function will be called when the child process becomes ready "
34377 "first time after it has been launched. (This corresponds to a transition "
34378 "from LAUNCHING to the READY state)."
34382 #: ../src/guestfs.pod:1756
34383 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
34387 #: ../src/guestfs.pod:1759
34389 "Some long-running operations can generate progress messages. If this "
34390 "callback is registered, then it will be called each time a progress message "
34391 "is generated (usually two seconds after the operation started, and three "
34392 "times per second thereafter until it completes, although the frequency may "
34393 "change in future versions)."
34397 #: ../src/guestfs.pod:1765
34399 "The callback receives in the payload four unsigned 64 bit numbers which are "
34400 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
34404 #: ../src/guestfs.pod:1768
34406 "The units of C<total> are not defined, although for some operations C<total> "
34407 "may relate in some way to the amount of data to be transferred (eg. in bytes "
34408 "or megabytes), and C<position> may be the portion which has been transferred."
34412 #: ../src/guestfs.pod:1773
34413 msgid "The only defined and stable parts of the API are:"
34417 #: ../src/guestfs.pod:1779
34419 "The callback can display to the user some type of progress bar or indicator "
34420 "which shows the ratio of C<position>:C<total>."
34424 #: ../src/guestfs.pod:1784
34425 msgid "0 E<lt>= C<position> E<lt>= C<total>"
34429 #: ../src/guestfs.pod:1788
34431 "If any progress notification is sent during a call, then a final progress "
34432 "notification is always sent when C<position> = C<total> (I<unless> the call "
34433 "fails with an error)."
34437 #: ../src/guestfs.pod:1792
34439 "This is to simplify caller code, so callers can easily set the progress "
34440 "indicator to \"100%\" at the end of the operation, without requiring special "
34441 "code to detect this case."
34445 #: ../src/guestfs.pod:1798
34447 "For some calls we are unable to estimate the progress of the call, but we "
34448 "can still generate progress messages to indicate activity. This is known as "
34449 "\"pulse mode\", and is directly supported by certain progress bar "
34450 "implementations (eg. GtkProgressBar)."
34454 #: ../src/guestfs.pod:1803
34456 "For these calls, zero or more progress messages are generated with "
34457 "C<position = 0> and C<total = 1>, followed by a final message with "
34458 "C<position = total = 1>."
34462 #: ../src/guestfs.pod:1807
34464 "As noted above, if the call fails with an error then the final message may "
34465 "not be generated."
34469 #: ../src/guestfs.pod:1812
34471 "The callback also receives the procedure number (C<proc_nr>) and serial "
34472 "number (C<serial>) of the call. These are only useful for debugging "
34473 "protocol issues, and the callback can normally ignore them. The callback "
34474 "may want to print these numbers in error messages or debugging messages."
34478 #: ../src/guestfs.pod:1818
34479 msgid "If no callback is registered: progress messages are discarded."
34483 #: ../src/guestfs.pod:1820
34484 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
34488 #: ../src/guestfs.pod:1823
34490 "The callback function is called whenever a log message is generated by qemu, "
34491 "the appliance kernel, guestfsd (daemon), or utility programs."
34495 #: ../src/guestfs.pod:1826
34497 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
34498 "guestfs_launch>) then additional debug messages are generated."
34502 #: ../src/guestfs.pod:1829 ../src/guestfs.pod:1843
34504 "If no callback is registered: the messages are discarded unless the verbose "
34505 "flag is set in which case they are sent to stderr. You can override the "
34506 "printing of verbose messages to stderr by setting up a callback."
34510 #: ../src/guestfs.pod:1834
34511 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
34515 #: ../src/guestfs.pod:1837
34517 "The callback function is called whenever a log message is generated by the "
34518 "library part of libguestfs."
34522 #: ../src/guestfs.pod:1840
34524 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
34525 "messages are generated."
34529 #: ../src/guestfs.pod:1848
34530 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
34534 #: ../src/guestfs.pod:1851
34536 "The callback function is called whenever a trace message is generated. This "
34537 "only applies if the trace flag (L</guestfs_set_trace>) is set."
34541 #: ../src/guestfs.pod:1854
34543 "If no callback is registered: the messages are sent to stderr. You can "
34544 "override the printing of trace messages to stderr by setting up a callback."
34548 #: ../src/guestfs.pod:1860
34549 msgid "guestfs_set_event_callback"
34553 #: ../src/guestfs.pod:1862
34556 " int guestfs_set_event_callback (guestfs_h *g,\n"
34557 " guestfs_event_callback cb,\n"
34558 " uint64_t event_bitmask,\n"
34560 " void *opaque);\n"
34565 #: ../src/guestfs.pod:1868
34567 "This function registers a callback (C<cb>) for all event classes in the "
34568 "C<event_bitmask>."
34572 #: ../src/guestfs.pod:1871
34574 "For example, to register for all log message events, you could call this "
34575 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
34576 "To register a single callback for all possible classes of events, use "
34577 "C<GUESTFS_EVENT_ALL>."
34581 #: ../src/guestfs.pod:1877
34582 msgid "C<flags> should always be passed as 0."
34586 #: ../src/guestfs.pod:1879
34588 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
34589 "it for any purpose."
34593 #: ../src/guestfs.pod:1882
34595 "The return value is the event handle (an integer) which you can use to "
34596 "delete the callback (see below)."
34600 #: ../src/guestfs.pod:1885
34602 "If there is an error, this function returns C<-1>, and sets the error in the "
34603 "handle in the usual way (see L</guestfs_last_error> etc.)"
34607 #: ../src/guestfs.pod:1888
34609 "Callbacks remain in effect until they are deleted, or until the handle is "
34614 #: ../src/guestfs.pod:1891
34616 "In the case where multiple callbacks are registered for a particular event "
34617 "class, all of the callbacks are called. The order in which multiple "
34618 "callbacks are called is not defined."
34622 #: ../src/guestfs.pod:1895
34623 msgid "guestfs_delete_event_callback"
34627 #: ../src/guestfs.pod:1897
34630 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
34635 #: ../src/guestfs.pod:1899
34637 "Delete a callback that was previously registered. C<event_handle> should be "
34638 "the integer that was returned by a previous call to "
34639 "C<guestfs_set_event_callback> on the same handle."
34643 #: ../src/guestfs.pod:1903
34644 msgid "guestfs_event_callback"
34648 #: ../src/guestfs.pod:1905
34651 " typedef void (*guestfs_event_callback) (\n"
34654 " uint64_t event,\n"
34655 " int event_handle,\n"
34657 " const char *buf, size_t buf_len,\n"
34658 " const uint64_t *array, size_t array_len);\n"
34663 #: ../src/guestfs.pod:1914
34665 "This is the type of the event callback function that you have to provide."
34669 #: ../src/guestfs.pod:1917
34671 "The basic parameters are: the handle (C<g>), the opaque user pointer "
34672 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
34673 "handle, and C<flags> which in the current API you should ignore."
34677 #: ../src/guestfs.pod:1921
34679 "The remaining parameters contain the event payload (if any). Each event may "
34680 "contain a payload, which usually relates to the event class, but for future "
34681 "proofing your code should be written to handle any payload for any event "
34686 #: ../src/guestfs.pod:1926
34688 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
34689 "there is no message buffer). Note that this message buffer can contain "
34690 "arbitrary 8 bit data, including NUL bytes."
34694 #: ../src/guestfs.pod:1930
34696 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
34697 "moment this is only used for progress messages."
34701 #: ../src/guestfs.pod:1933
34702 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
34706 #: ../src/guestfs.pod:1935
34708 "One motivation for the generic event API was to allow GUI programs to "
34709 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
34710 "unconditionally to C<stderr>."
34714 #: ../src/guestfs.pod:1939
34716 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
34717 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
34718 "messages are not events; you must capture error messages separately)."
34722 #: ../src/guestfs.pod:1944
34724 "Programs have to set up a callback to capture the classes of events of "
34729 #: ../src/guestfs.pod:1947
34733 " guestfs_set_event_callback\n"
34734 " (g, message_callback,\n"
34735 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
34736 " GUESTFS_EVENT_TRACE,\n"
34737 " 0, NULL) == -1)\n"
34738 " if (eh == -1) {\n"
34739 " // handle error in the usual way\n"
34745 #: ../src/guestfs.pod:1957
34747 "The callback can then direct messages to the appropriate place. In this "
34748 "example, messages are directed to syslog:"
34752 #: ../src/guestfs.pod:1960
34756 " message_callback (\n"
34759 " uint64_t event,\n"
34760 " int event_handle,\n"
34762 " const char *buf, size_t buf_len,\n"
34763 " const uint64_t *array, size_t array_len)\n"
34765 " const int priority = LOG_USER|LOG_INFO;\n"
34766 " if (buf_len > 0)\n"
34767 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
34773 #: ../src/guestfs.pod:1975
34774 msgid "CANCELLING LONG TRANSFERS"
34778 #: ../src/guestfs.pod:1977
34780 "Some operations can be cancelled by the caller while they are in progress. "
34781 "Currently only operations that involve uploading or downloading data can be "
34782 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
34783 "parameters in the generator)."
34787 #: ../src/guestfs.pod:1982
34788 msgid "guestfs_user_cancel"
34792 #: ../src/guestfs.pod:1984
34795 " void guestfs_user_cancel (guestfs_h *g);\n"
34800 #: ../src/guestfs.pod:1986
34802 "C<guestfs_user_cancel> cancels the current upload or download operation."
34806 #: ../src/guestfs.pod:1989
34808 "Unlike most other libguestfs calls, this function is signal safe and thread "
34809 "safe. You can call it from a signal handler or from another thread, without "
34810 "needing to do any locking."
34814 #: ../src/guestfs.pod:1993
34816 "The transfer that was in progress (if there is one) will stop shortly "
34817 "afterwards, and will return an error. The errno (see L</"
34818 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
34819 "out if the operation was cancelled or failed because of another error."
34823 #: ../src/guestfs.pod:1999
34825 "No cleanup is performed: for example, if a file was being uploaded then "
34826 "after cancellation there may be a partially uploaded file. It is the "
34827 "caller's responsibility to clean up if necessary."
34831 #: ../src/guestfs.pod:2003
34832 msgid "There are two common places that you might call C<guestfs_user_cancel>."
34836 #: ../src/guestfs.pod:2005
34838 "In an interactive text-based program, you might call it from a C<SIGINT> "
34839 "signal handler so that pressing C<^C> cancels the current operation. (You "
34840 "also need to call L</guestfs_set_pgroup> so that child processes don't "
34841 "receive the C<^C> signal)."
34845 #: ../src/guestfs.pod:2010
34847 "In a graphical program, when the main thread is displaying a progress bar "
34848 "with a cancel button, wire up the cancel button to call this function."
34852 #: ../src/guestfs.pod:2014
34853 msgid "PRIVATE DATA AREA"
34857 #: ../src/guestfs.pod:2016
34859 "You can attach named pieces of private data to the libguestfs handle, fetch "
34860 "them by name, and walk over them, for the lifetime of the handle. This is "
34861 "called the private data area and is only available from the C API."
34865 #: ../src/guestfs.pod:2021
34866 msgid "To attach a named piece of data, use the following call:"
34870 #: ../src/guestfs.pod:2023
34873 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
34878 #: ../src/guestfs.pod:2025
34880 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
34881 "pointer (which can be C<NULL>). Any previous item with the same key is "
34886 #: ../src/guestfs.pod:2029
34888 "You can use any C<key> you want, but your key should I<not> start with an "
34889 "underscore character. Keys beginning with an underscore character are "
34890 "reserved for internal libguestfs purposes (eg. for implementing language "
34891 "bindings). It is recommended that you prefix the key with some unique "
34892 "string to avoid collisions with other users."
34896 #: ../src/guestfs.pod:2035
34897 msgid "To retrieve the pointer, use:"
34901 #: ../src/guestfs.pod:2037
34904 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
34909 #: ../src/guestfs.pod:2039
34911 "This function returns C<NULL> if either no data is found associated with "
34912 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
34917 #: ../src/guestfs.pod:2043
34919 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
34920 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
34921 "all. In particular, libguestfs does I<not> try to free the data when the "
34922 "handle is closed. If the data must be freed, then the caller must either "
34923 "free it before calling L</guestfs_close> or must set up a close callback to "
34924 "do it (see L</GUESTFS_EVENT_CLOSE>)."
34928 #: ../src/guestfs.pod:2050
34929 msgid "To walk over all entries, use these two functions:"
34933 #: ../src/guestfs.pod:2052
34936 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
34941 #: ../src/guestfs.pod:2054
34944 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
34949 #: ../src/guestfs.pod:2056
34951 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
34952 "not have any particular meaning -- keys are not returned in any defined "
34953 "order). A pointer to the key is returned in C<*key_rtn> and the "
34954 "corresponding data pointer is returned from the function. C<NULL> is "
34955 "returned if there are no keys stored in the handle."
34959 #: ../src/guestfs.pod:2062
34961 "C<guestfs_next_private> returns the next key, pointer pair. The return "
34962 "value of this function is also C<NULL> is there are no further entries to "
34967 #: ../src/guestfs.pod:2066
34968 msgid "Notes about walking over entries:"
34972 #: ../src/guestfs.pod:2072
34974 "You must not call C<guestfs_set_private> while walking over the entries."
34978 #: ../src/guestfs.pod:2077
34980 "The handle maintains an internal iterator which is reset when you call "
34981 "C<guestfs_first_private>. This internal iterator is invalidated when you "
34982 "call C<guestfs_set_private>."
34986 #: ../src/guestfs.pod:2083
34987 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
34991 #: ../src/guestfs.pod:2085
34994 " guestfs_set_private (g, key, NULL);\n"
34999 #: ../src/guestfs.pod:2087
35000 msgid "then that C<key> is not returned when walking."
35004 #: ../src/guestfs.pod:2091
35006 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
35007 "C<guestfs_next_private> or C<guestfs_set_private>."
35011 #: ../src/guestfs.pod:2097
35013 "The following example code shows how to print all keys and data pointers "
35014 "that are associated with the handle C<g>:"
35018 #: ../src/guestfs.pod:2100
35021 " const char *key;\n"
35022 " void *data = guestfs_first_private (g, &key);\n"
35023 " while (data != NULL)\n"
35025 " printf (\"key = %s, data = %p\\n\", key, data);\n"
35026 " data = guestfs_next_private (g, &key);\n"
35032 #: ../src/guestfs.pod:2108
35034 "More commonly you are only interested in keys that begin with an application-"
35035 "specific prefix C<foo_>. Modify the loop like so:"
35039 #: ../src/guestfs.pod:2111
35042 " const char *key;\n"
35043 " void *data = guestfs_first_private (g, &key);\n"
35044 " while (data != NULL)\n"
35046 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
35047 " printf (\"key = %s, data = %p\\n\", key, data);\n"
35048 " data = guestfs_next_private (g, &key);\n"
35054 #: ../src/guestfs.pod:2120
35056 "If you need to modify keys while walking, then you have to jump back to the "
35057 "beginning of the loop. For example, to delete all keys prefixed with "
35062 #: ../src/guestfs.pod:2124
35065 " const char *key;\n"
35068 " data = guestfs_first_private (g, &key);\n"
35069 " while (data != NULL)\n"
35071 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
35073 " guestfs_set_private (g, key, NULL);\n"
35074 " /* note that 'key' pointer is now invalid, and so is\n"
35075 " the internal iterator */\n"
35078 " data = guestfs_next_private (g, &key);\n"
35084 #: ../src/guestfs.pod:2140
35086 "Note that the above loop is guaranteed to terminate because the keys are "
35087 "being deleted, but other manipulations of keys within the loop might not "
35088 "terminate unless you also maintain an indication of which keys have been "
35093 #: ../src/guestfs.pod:2145 ../src/guestfs.pod:2150
35098 #: ../src/guestfs.pod:2147
35100 "<!-- old anchor for the next section --> <a name="
35101 "\"state_machine_and_low_level_event_api\"/>"
35105 #: ../src/guestfs.pod:2152
35106 msgid "ARCHITECTURE"
35110 #: ../src/guestfs.pod:2154
35112 "Internally, libguestfs is implemented by running an appliance (a special "
35113 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
35114 "process of the main program."
35118 #: ../src/guestfs.pod:2158
35121 " ___________________\n"
35123 " | main program |\n"
35125 " | | child process / appliance\n"
35126 " | | __________________________\n"
35128 " +-------------------+ RPC | +-----------------+ |\n"
35129 " | libguestfs <--------------------> guestfsd | |\n"
35130 " | | | +-----------------+ |\n"
35131 " \\___________________/ | | Linux kernel | |\n"
35132 " | +--^--------------+ |\n"
35133 " \\_________|________________/\n"
35135 " _______v______\n"
35138 " | disk image |\n"
35139 " \\______________/\n"
35144 #: ../src/guestfs.pod:2178
35146 "The library, linked to the main program, creates the child process and hence "
35147 "the appliance in the L</guestfs_launch> function."
35151 #: ../src/guestfs.pod:2181
35153 "Inside the appliance is a Linux kernel and a complete stack of userspace "
35154 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
35155 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
35156 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
35157 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
35158 "attached to the qemu process which translates device access by the "
35159 "appliance's Linux kernel into accesses to the image."
35163 #: ../src/guestfs.pod:2190
35165 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
35166 "Although the disk image you are attached to might also be used by some "
35167 "virtual machine, libguestfs doesn't know or care about this. (But you will "
35168 "care if both libguestfs's qemu process and your virtual machine are trying "
35169 "to update the disk image at the same time, since these usually results in "
35170 "massive disk corruption)."
35174 #: ../src/guestfs.pod:2197
35175 msgid "STATE MACHINE"
35179 #: ../src/guestfs.pod:2199
35180 msgid "libguestfs uses a state machine to model the child process:"
35184 #: ../src/guestfs.pod:2201
35188 " guestfs_create\n"
35196 " / | \\ \\ guestfs_launch\n"
35197 " / | _\\__V______\n"
35199 " / | | LAUNCHING |\n"
35200 " / | \\___________/\n"
35202 " / | guestfs_launch\n"
35204 " ______ / __|____V\n"
35205 " / \\ ------> / \\\n"
35206 " | BUSY | | READY |\n"
35207 " \\______/ <------ \\________/\n"
35212 #: ../src/guestfs.pod:2223
35214 "The normal transitions are (1) CONFIG (when the handle is created, but there "
35215 "is no child process), (2) LAUNCHING (when the child process is booting up), "
35216 "(3) alternating between READY and BUSY as commands are issued to, and "
35217 "carried out by, the child process."
35221 #: ../src/guestfs.pod:2228
35223 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
35224 "asynchronously at any time (eg. due to some internal error), and that causes "
35225 "the state to transition back to CONFIG."
35229 #: ../src/guestfs.pod:2232
35231 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
35232 "issued when in the CONFIG state."
35236 #: ../src/guestfs.pod:2235
35238 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
35239 "L</guestfs_launch> blocks until the child process is READY to accept "
35240 "commands (or until some failure or timeout). L</guestfs_launch> internally "
35241 "moves the state from CONFIG to LAUNCHING while it is running."
35245 #: ../src/guestfs.pod:2241
35247 "API actions such as L</guestfs_mount> can only be issued when in the READY "
35248 "state. These API calls block waiting for the command to be carried out (ie. "
35249 "the state to transition to BUSY and then back to READY). There are no non-"
35250 "blocking versions, and no way to issue more than one command per handle at "
35255 #: ../src/guestfs.pod:2247
35257 "Finally, the child process sends asynchronous messages back to the main "
35258 "program, such as kernel log messages. You can register a callback to "
35259 "receive these messages."
35263 #: ../src/guestfs.pod:2251
35268 #: ../src/guestfs.pod:2253
35269 msgid "APPLIANCE BOOT PROCESS"
35273 #: ../src/guestfs.pod:2255
35275 "This process has evolved and continues to evolve. The description here "
35276 "corresponds only to the current version of libguestfs and is provided for "
35277 "information only."
35281 #: ../src/guestfs.pod:2259
35283 "In order to follow the stages involved below, enable libguestfs debugging "
35284 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
35288 #: ../src/guestfs.pod:2264
35289 msgid "Create the appliance"
35293 #: ../src/guestfs.pod:2266
35295 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
35296 "initrd and the appliance."
35300 #: ../src/guestfs.pod:2269
35302 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
35303 "directory if C<TMPDIR> is set)."
35307 #: ../src/guestfs.pod:2272
35309 "For a complete description of how the appliance is created and cached, read "
35310 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
35314 #: ../src/guestfs.pod:2276
35315 msgid "Start qemu and boot the kernel"
35319 #: ../src/guestfs.pod:2278
35320 msgid "qemu is invoked to boot the kernel."
35324 #: ../src/guestfs.pod:2280
35325 msgid "Run the initrd"
35329 #: ../src/guestfs.pod:2282
35331 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
35332 "appliance. The purpose of the initrd is to load enough kernel modules in "
35333 "order that the appliance itself can be mounted and started."
35337 #: ../src/guestfs.pod:2286
35339 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
35344 #: ../src/guestfs.pod:2289
35346 "When the initrd has started you will see messages showing that kernel "
35347 "modules are being loaded, similar to this:"
35351 #: ../src/guestfs.pod:2292
35354 " febootstrap: ext2 mini initrd starting up\n"
35355 " febootstrap: mounting /sys\n"
35356 " febootstrap: internal insmod libcrc32c.ko\n"
35357 " febootstrap: internal insmod crc32c-intel.ko\n"
35362 #: ../src/guestfs.pod:2297
35363 msgid "Find and mount the appliance device"
35367 #: ../src/guestfs.pod:2299
35369 "The appliance is a sparse file containing an ext2 filesystem which contains "
35370 "a familiar (although reduced in size) Linux operating system. It would "
35371 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
35375 #: ../src/guestfs.pod:2303
35377 "The regular disks being inspected by libguestfs are the first devices "
35378 "exposed by qemu (eg. as C</dev/vda>)."
35382 #: ../src/guestfs.pod:2306
35384 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
35385 "there was only one regular disk)."
35389 #: ../src/guestfs.pod:2309
35391 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
35392 "and switch root into the appliance, and run C</init> from the appliance."
35396 #: ../src/guestfs.pod:2313
35397 msgid "If this works successfully you will see messages such as:"
35401 #: ../src/guestfs.pod:2315
35404 " febootstrap: picked /sys/block/vdb/dev as root device\n"
35405 " febootstrap: creating /dev/root as block special 252:16\n"
35406 " febootstrap: mounting new root on /root\n"
35407 " febootstrap: chroot\n"
35408 " Starting /init script ...\n"
35413 #: ../src/guestfs.pod:2321
35415 "Note that C<Starting /init script ...> indicates that the appliance's init "
35416 "script is now running."
35420 #: ../src/guestfs.pod:2324
35421 msgid "Initialize the appliance"
35425 #: ../src/guestfs.pod:2326
35427 "The appliance itself now initializes itself. This involves starting certain "
35428 "processes like C<udev>, possibly printing some debug information, and "
35429 "finally running the daemon (C<guestfsd>)."
35433 #: ../src/guestfs.pod:2330
35438 #: ../src/guestfs.pod:2332
35440 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
35445 #: ../src/guestfs.pod:2335
35448 " verbose daemon enabled\n"
35453 #: ../src/guestfs.pod:2337
35455 "The daemon expects to see a named virtio-serial port exposed by qemu and "
35456 "connected on the other end to the library."
35460 #: ../src/guestfs.pod:2340
35462 "The daemon connects to this port (and hence to the library) and sends a four "
35463 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
35464 "protocol (see below)."
35468 #: ../src/guestfs.pod:2346
35469 msgid "COMMUNICATION PROTOCOL"
35473 #: ../src/guestfs.pod:2348
35475 "Don't rely on using this protocol directly. This section documents how it "
35476 "currently works, but it may change at any time."
35480 #: ../src/guestfs.pod:2351
35482 "The protocol used to talk between the library and the daemon running inside "
35483 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
35484 "1014, RFC 1832, RFC 4506)."
35488 #: ../src/guestfs.pod:2355
35490 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
35491 "this file is automatically generated)."
35495 #: ../src/guestfs.pod:2358
35497 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
35498 "and C<FileOut> parameters, which are handled with very simple request/reply "
35499 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
35500 "parameters, which use the same request and reply messages, but they may also "
35501 "be followed by files sent using a chunked encoding."
35505 #: ../src/guestfs.pod:2365
35506 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
35510 #: ../src/guestfs.pod:2367
35511 msgid "For ordinary functions, the request message is:"
35515 #: ../src/guestfs.pod:2369
35518 " total length (header + arguments,\n"
35519 " but not including the length word itself)\n"
35520 " struct guestfs_message_header (encoded as XDR)\n"
35521 " struct guestfs_<foo>_args (encoded as XDR)\n"
35526 #: ../src/guestfs.pod:2374
35528 "The total length field allows the daemon to allocate a fixed size buffer "
35529 "into which it slurps the rest of the message. As a result, the total length "
35530 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
35531 "effective size of any request is limited to somewhere under this size."
35535 #: ../src/guestfs.pod:2380
35537 "Note also that many functions don't take any arguments, in which case the "
35538 "C<guestfs_I<foo>_args> is completely omitted."
35542 #: ../src/guestfs.pod:2383
35544 "The header contains the procedure number (C<guestfs_proc>) which is how the "
35545 "receiver knows what type of args structure to expect, or none at all."
35549 #: ../src/guestfs.pod:2387
35551 "For functions that take optional arguments, the optional arguments are "
35552 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
35553 "arguments. A bitmask in the header indicates which optional arguments are "
35554 "meaningful. The bitmask is also checked to see if it contains bits set "
35555 "which the daemon does not know about (eg. if more optional arguments were "
35556 "added in a later version of the library), and this causes the call to be "
35561 #: ../src/guestfs.pod:2395
35562 msgid "The reply message for ordinary functions is:"
35566 #: ../src/guestfs.pod:2397
35569 " total length (header + ret,\n"
35570 " but not including the length word itself)\n"
35571 " struct guestfs_message_header (encoded as XDR)\n"
35572 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35577 #: ../src/guestfs.pod:2402
35579 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
35580 "functions that return no formal return values."
35584 #: ../src/guestfs.pod:2405
35586 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
35590 #: ../src/guestfs.pod:2408
35592 "In the case of an error, a flag is set in the header, and the reply message "
35593 "is slightly changed:"
35597 #: ../src/guestfs.pod:2411
35600 " total length (header + error,\n"
35601 " but not including the length word itself)\n"
35602 " struct guestfs_message_header (encoded as XDR)\n"
35603 " struct guestfs_message_error (encoded as XDR)\n"
35608 #: ../src/guestfs.pod:2416
35610 "The C<guestfs_message_error> structure contains the error message as a "
35615 #: ../src/guestfs.pod:2419
35616 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
35620 #: ../src/guestfs.pod:2421
35622 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
35623 "The normal request message is sent (see above). However this is followed by "
35624 "a sequence of file chunks."
35628 #: ../src/guestfs.pod:2425
35631 " total length (header + arguments,\n"
35632 " but not including the length word itself,\n"
35633 " and not including the chunks)\n"
35634 " struct guestfs_message_header (encoded as XDR)\n"
35635 " struct guestfs_<foo>_args (encoded as XDR)\n"
35636 " sequence of chunks for FileIn param #0\n"
35637 " sequence of chunks for FileIn param #1 etc.\n"
35642 #: ../src/guestfs.pod:2433
35643 msgid "The \"sequence of chunks\" is:"
35647 #: ../src/guestfs.pod:2435
35650 " length of chunk (not including length word itself)\n"
35651 " struct guestfs_chunk (encoded as XDR)\n"
35652 " length of chunk\n"
35653 " struct guestfs_chunk (encoded as XDR)\n"
35655 " length of chunk\n"
35656 " struct guestfs_chunk (with data.data_len == 0)\n"
35661 #: ../src/guestfs.pod:2443
35663 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
35664 "is set in the final chunk to indicate either successful completion or early "
35669 #: ../src/guestfs.pod:2447
35671 "At time of writing there are no functions that have more than one FileIn "
35672 "parameter. However this is (theoretically) supported, by sending the "
35673 "sequence of chunks for each FileIn parameter one after another (from left to "
35678 #: ../src/guestfs.pod:2452
35680 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
35681 "transfer. The library does this by sending a chunk with a special flag set "
35682 "to indicate cancellation. When the daemon sees this, it cancels the whole "
35683 "RPC, does I<not> send any reply, and goes back to reading the next request."
35687 #: ../src/guestfs.pod:2458
35689 "The daemon may also cancel. It does this by writing a special word "
35690 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
35691 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
35692 "cancel chunk). The special word is chosen so that even if cancellation "
35693 "happens right at the end of the transfer (after the library has finished "
35694 "writing and has started listening for the reply), the \"spurious\" cancel "
35695 "flag will not be confused with the reply message."
35699 #: ../src/guestfs.pod:2467
35701 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
35702 "limit), and also files where the size is not known in advance (eg. from "
35703 "pipes or sockets). However the chunks are rather small "
35704 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
35705 "to keep much in memory."
35709 #: ../src/guestfs.pod:2473
35710 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
35714 #: ../src/guestfs.pod:2475
35716 "The protocol for FileOut parameters is exactly the same as for FileIn "
35717 "parameters, but with the roles of daemon and library reversed."
35721 #: ../src/guestfs.pod:2478
35724 " total length (header + ret,\n"
35725 " but not including the length word itself,\n"
35726 " and not including the chunks)\n"
35727 " struct guestfs_message_header (encoded as XDR)\n"
35728 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35729 " sequence of chunks for FileOut param #0\n"
35730 " sequence of chunks for FileOut param #1 etc.\n"
35735 #: ../src/guestfs.pod:2486
35736 msgid "INITIAL MESSAGE"
35740 #: ../src/guestfs.pod:2488
35742 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
35743 "which indicates that the guest and daemon is alive. This is what L</"
35744 "guestfs_launch> waits for."
35748 #: ../src/guestfs.pod:2492
35749 msgid "PROGRESS NOTIFICATION MESSAGES"
35753 #: ../src/guestfs.pod:2494
35755 "The daemon may send progress notification messages at any time. These are "
35756 "distinguished by the normal length word being replaced by "
35757 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
35761 #: ../src/guestfs.pod:2498
35763 "The library turns them into progress callbacks (see L</"
35764 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
35769 #: ../src/guestfs.pod:2502
35771 "The daemon self-limits the frequency of progress messages it sends (see "
35772 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
35777 #: ../src/guestfs.pod:2506
35778 msgid "LIBGUESTFS VERSION NUMBERS"
35782 #: ../src/guestfs.pod:2508
35784 "Since April 2010, libguestfs has started to make separate development and "
35785 "stable releases, along with corresponding branches in our git repository. "
35786 "These separate releases can be identified by version number:"
35790 #: ../src/guestfs.pod:2513
35793 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
35794 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
35800 " | `-------- sub-version\n"
35802 " `------ always '1' because we don't change the ABI\n"
35807 #: ../src/guestfs.pod:2524
35808 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
35812 #: ../src/guestfs.pod:2526
35814 "As time passes we cherry pick fixes from the development branch and backport "
35815 "those into the stable branch, the effect being that the stable branch should "
35816 "get more stable and less buggy over time. So the stable releases are ideal "
35817 "for people who don't need new features but would just like the software to "
35822 #: ../src/guestfs.pod:2532
35823 msgid "Our criteria for backporting changes are:"
35827 #: ../src/guestfs.pod:2538
35829 "Documentation changes which don't affect any code are backported unless the "
35830 "documentation refers to a future feature which is not in stable."
35834 #: ../src/guestfs.pod:2544
35836 "Bug fixes which are not controversial, fix obvious problems, and have been "
35837 "well tested are backported."
35841 #: ../src/guestfs.pod:2549
35843 "Simple rearrangements of code which shouldn't affect how it works get "
35844 "backported. This is so that the code in the two branches doesn't get too "
35845 "far out of step, allowing us to backport future fixes more easily."
35849 #: ../src/guestfs.pod:2555
35851 "We I<don't> backport new features, new APIs, new tools etc, except in one "
35852 "exceptional case: the new feature is required in order to implement an "
35853 "important bug fix."
35857 #: ../src/guestfs.pod:2561
35859 "A new stable branch starts when we think the new features in development are "
35860 "substantial and compelling enough over the current stable branch to warrant "
35861 "it. When that happens we create new stable and development versions 1.N.0 "
35862 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
35863 "stable at this point, but by backporting fixes from development, that branch "
35864 "will stabilize over time."
35868 #: ../src/guestfs.pod:2569
35869 msgid "EXTENDING LIBGUESTFS"
35873 #: ../src/guestfs.pod:2571
35874 msgid "ADDING A NEW API ACTION"
35878 #: ../src/guestfs.pod:2573
35880 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
35881 "documentation) are generated, and this makes it easy to extend the "
35886 #: ../src/guestfs.pod:2577
35887 msgid "To add a new API action there are two changes:"
35891 #: ../src/guestfs.pod:2583
35893 "You need to add a description of the call (name, parameters, return type, "
35894 "tests, documentation) to C<generator/generator_actions.ml>."
35898 #: ../src/guestfs.pod:2586
35900 "There are two sorts of API action, depending on whether the call goes "
35901 "through to the daemon in the appliance, or is serviced entirely by the "
35902 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
35903 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
35904 "an example of the latter, since a trace flag is maintained in the handle and "
35905 "all tracing is done on the library side."
35909 #: ../src/guestfs.pod:2594
35911 "Most new actions are of the first type, and get added to the "
35912 "C<daemon_functions> list. Each function has a unique procedure number used "
35913 "in the RPC protocol which is assigned to that action when we publish "
35914 "libguestfs and cannot be reused. Take the latest procedure number and "
35919 #: ../src/guestfs.pod:2600
35921 "For library-only actions of the second type, add to the "
35922 "C<non_daemon_functions> list. Since these functions are serviced by the "
35923 "library and do not travel over the RPC mechanism to the daemon, these "
35924 "functions do not need a procedure number, and so the procedure number is set "
35929 #: ../src/guestfs.pod:2608
35930 msgid "Implement the action (in C):"
35934 #: ../src/guestfs.pod:2610
35936 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
35937 "C<daemon/> directory."
35941 #: ../src/guestfs.pod:2613
35943 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
35944 "(note: double underscore) in the C<src/> directory."
35948 #: ../src/guestfs.pod:2616
35949 msgid "In either case, use another function as an example of what to do."
35953 #: ../src/guestfs.pod:2620
35954 msgid "After making these changes, use C<make> to compile."
35958 #: ../src/guestfs.pod:2622
35960 "Note that you don't need to implement the RPC, language bindings, manual "
35961 "pages or anything else. It's all automatically generated from the OCaml "
35966 #: ../src/guestfs.pod:2626
35967 msgid "ADDING TESTS FOR AN API ACTION"
35971 #: ../src/guestfs.pod:2628
35973 "You can supply zero or as many tests as you want per API call. The tests "
35974 "can either be added as part of the API description (C<generator/"
35975 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
35976 "into C<regressions/>. Note that adding a script to C<regressions/> is "
35977 "slower, so if possible use the first method."
35981 #: ../src/guestfs.pod:2634
35983 "The following describes the test environment used when you add an API test "
35984 "in C<generator_actions.ml>."
35988 #: ../src/guestfs.pod:2637
35989 msgid "The test environment has 4 block devices:"
35993 #: ../src/guestfs.pod:2641
35994 msgid "C</dev/sda> 500MB"
35998 #: ../src/guestfs.pod:2643
35999 msgid "General block device for testing."
36003 #: ../src/guestfs.pod:2645
36004 msgid "C</dev/sdb> 50MB"
36008 #: ../src/guestfs.pod:2647
36010 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
36015 #: ../src/guestfs.pod:2650
36016 msgid "C</dev/sdc> 10MB"
36020 #: ../src/guestfs.pod:2652
36021 msgid "Used in a few tests where two block devices are needed."
36025 #: ../src/guestfs.pod:2654
36026 msgid "C</dev/sdd>"
36030 #: ../src/guestfs.pod:2656
36031 msgid "ISO with fixed content (see C<images/test.iso>)."
36035 #: ../src/guestfs.pod:2660
36037 "To be able to run the tests in a reasonable amount of time, the libguestfs "
36038 "appliance and block devices are reused between tests. So don't try testing "
36039 "L</guestfs_kill_subprocess> :-x"
36043 #: ../src/guestfs.pod:2664
36045 "Each test starts with an initial scenario, selected using one of the "
36046 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
36047 "initialize the disks mentioned above in a particular way as documented in "
36048 "C<generator_types.ml>. You should not assume anything about the previous "
36049 "contents of other disks that are not initialized."
36053 #: ../src/guestfs.pod:2670
36055 "You can add a prerequisite clause to any individual test. This is a run-"
36056 "time check, which, if it fails, causes the test to be skipped. Useful if "
36057 "testing a command which might not work on all variations of libguestfs "
36058 "builds. A test that has prerequisite of C<Always> means to run "
36063 #: ../src/guestfs.pod:2676
36065 "In addition, packagers can skip individual tests by setting environment "
36066 "variables before running C<make check>."
36070 #: ../src/guestfs.pod:2679
36073 " SKIP_TEST_<CMD>_<NUM>=1\n"
36078 #: ../src/guestfs.pod:2681
36079 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
36083 #: ../src/guestfs.pod:2683
36088 #: ../src/guestfs.pod:2685
36091 " SKIP_TEST_<CMD>=1\n"
36096 #: ../src/guestfs.pod:2687
36097 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
36101 #: ../src/guestfs.pod:2689
36102 msgid "Packagers can run only certain tests by setting for example:"
36106 #: ../src/guestfs.pod:2691
36109 " TEST_ONLY=\"vfs_type zerofree\"\n"
36114 #: ../src/guestfs.pod:2693
36116 "See C<capitests/tests.c> for more details of how these environment variables "
36121 #: ../src/guestfs.pod:2696
36122 msgid "DEBUGGING NEW API ACTIONS"
36126 #: ../src/guestfs.pod:2698
36127 msgid "Test new actions work before submitting them."
36131 #: ../src/guestfs.pod:2700
36132 msgid "You can use guestfish to try out new commands."
36136 #: ../src/guestfs.pod:2702
36138 "Debugging the daemon is a problem because it runs inside a minimal "
36139 "environment. However you can fprintf messages in the daemon to stderr, and "
36140 "they will show up if you use C<guestfish -v>."
36144 #: ../src/guestfs.pod:2706
36145 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
36149 #: ../src/guestfs.pod:2708
36151 "Our C source code generally adheres to some basic code-formatting "
36152 "conventions. The existing code base is not totally consistent on this "
36153 "front, but we do prefer that contributed code be formatted similarly. In "
36154 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
36155 "indentation level, and other than that, follow the K&R style."
36159 #: ../src/guestfs.pod:2714
36161 "If you use Emacs, add the following to one of one of your start-up files (e."
36162 "g., ~/.emacs), to help ensure that you get indentation right:"
36166 #: ../src/guestfs.pod:2717
36169 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
36170 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
36171 " (add-hook 'find-file-hook\n"
36172 " '(lambda () (if (and buffer-file-name\n"
36173 " (string-match \"/libguestfs\\\\>\"\n"
36174 " (buffer-file-name))\n"
36175 " (not (string-equal mode-name \"Change Log\"))\n"
36176 " (not (string-equal mode-name \"Makefile\")))\n"
36177 " (setq indent-tabs-mode nil))))\n"
36182 #: ../src/guestfs.pod:2727
36185 " ;;; When editing C sources in libguestfs, use this style.\n"
36186 " (defun libguestfs-c-mode ()\n"
36187 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
36189 " (c-set-style \"K&R\")\n"
36190 " (setq c-indent-level 2)\n"
36191 " (setq c-basic-offset 2))\n"
36192 " (add-hook 'c-mode-hook\n"
36193 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
36194 " (buffer-file-name))\n"
36195 " (libguestfs-c-mode))))\n"
36200 #: ../src/guestfs.pod:2739
36201 msgid "Enable warnings when compiling (and fix any problems this finds):"
36205 #: ../src/guestfs.pod:2742
36208 " ./configure --enable-gcc-warnings\n"
36213 #: ../src/guestfs.pod:2744
36214 msgid "Useful targets are:"
36218 #: ../src/guestfs.pod:2746
36221 " make syntax-check # checks the syntax of the C code\n"
36222 " make check # runs the test suite\n"
36227 #: ../src/guestfs.pod:2749
36228 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
36232 #: ../src/guestfs.pod:2751
36234 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
36235 "which are used to do shell quoting."
36239 #: ../src/guestfs.pod:2756
36244 #: ../src/guestfs.pod:2758
36246 "Simple shell quoted string. Any spaces or other shell characters are "
36251 #: ../src/guestfs.pod:2761
36256 #: ../src/guestfs.pod:2763
36258 "Same as C<%Q> except the string is treated as a path which is prefixed by "
36263 #: ../src/guestfs.pod:2770
36266 " asprintf (&cmd, \"cat %R\", path);\n"
36271 #: ../src/guestfs.pod:2772
36272 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
36276 #: ../src/guestfs.pod:2774
36278 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
36279 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
36280 "they are not passed via the shell (instead, straight to exec). You probably "
36281 "want to use the C<sysroot_path()> function however."
36285 #: ../src/guestfs.pod:2780
36286 msgid "SUBMITTING YOUR NEW API ACTIONS"
36290 #: ../src/guestfs.pod:2782
36292 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
36293 "libguestfs> and CC to L<rjones@redhat.com>."
36297 #: ../src/guestfs.pod:2786
36298 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
36302 #: ../src/guestfs.pod:2788
36303 msgid "We support i18n (gettext anyhow) in the library."
36307 #: ../src/guestfs.pod:2790
36309 "However many messages come from the daemon, and we don't translate those at "
36310 "the moment. One reason is that the appliance generally has all locale files "
36311 "removed from it, because they take up a lot of space. So we'd have to readd "
36312 "some of those, as well as copying our PO files into the appliance."
36316 #: ../src/guestfs.pod:2796
36318 "Debugging messages are never translated, since they are intended for the "
36323 #: ../src/guestfs.pod:2799
36324 msgid "SOURCE CODE SUBDIRECTORIES"
36328 #: ../src/guestfs.pod:2805
36329 msgid "The libguestfs appliance, build scripts and so on."
36333 #: ../src/guestfs.pod:2807
36334 msgid "C<capitests>"
36338 #: ../src/guestfs.pod:2809
36339 msgid "Automated tests of the C API."
36343 #: ../src/guestfs.pod:2811
36348 #: ../src/guestfs.pod:2813
36350 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
36355 #: ../src/guestfs.pod:2816
36360 #: ../src/guestfs.pod:2818
36362 "Safety and liveness tests of components that libguestfs depends upon (not of "
36363 "libguestfs itself). Mainly this is for qemu and the kernel."
36367 #: ../src/guestfs.pod:2821
36372 #: ../src/guestfs.pod:2823
36373 msgid "Outside contributions, experimental parts."
36377 #: ../src/guestfs.pod:2825
36382 #: ../src/guestfs.pod:2827
36384 "The daemon that runs inside the libguestfs appliance and carries out actions."
36388 #: ../src/guestfs.pod:2830
36393 #: ../src/guestfs.pod:2832
36394 msgid "L<virt-df(1)> command and documentation."
36398 #: ../src/guestfs.pod:2834
36403 #: ../src/guestfs.pod:2836
36404 msgid "L<virt-edit(1)> command and documentation."
36408 #: ../src/guestfs.pod:2838
36409 msgid "C<examples>"
36413 #: ../src/guestfs.pod:2840
36414 msgid "C API example code."
36418 #: ../src/guestfs.pod:2842
36423 #: ../src/guestfs.pod:2844
36425 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
36426 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
36427 "L<virt-tar-out(1)>."
36431 #: ../src/guestfs.pod:2848
36436 #: ../src/guestfs.pod:2850
36438 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
36442 #: ../src/guestfs.pod:2852
36443 msgid "C<generator>"
36447 #: ../src/guestfs.pod:2854
36449 "The crucially important generator, used to automatically generate large "
36450 "amounts of boilerplate C code for things like RPC and bindings."
36454 #: ../src/guestfs.pod:2857
36459 #: ../src/guestfs.pod:2859
36460 msgid "Files used by the test suite."
36464 #: ../src/guestfs.pod:2861
36465 msgid "Some \"phony\" guest images which we test against."
36469 #: ../src/guestfs.pod:2863
36470 msgid "C<inspector>"
36474 #: ../src/guestfs.pod:2865
36475 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
36479 #: ../src/guestfs.pod:2867
36484 #: ../src/guestfs.pod:2869
36485 msgid "Logo used on the website. The fish is called Arthur by the way."
36489 #: ../src/guestfs.pod:2871
36494 #: ../src/guestfs.pod:2873
36495 msgid "M4 macros used by autoconf."
36499 #: ../src/guestfs.pod:2875
36504 #: ../src/guestfs.pod:2877
36505 msgid "Translations of simple gettext strings."
36509 #: ../src/guestfs.pod:2879
36514 #: ../src/guestfs.pod:2881
36516 "The build infrastructure and PO files for translations of manpages and POD "
36517 "files. Eventually this will be combined with the C<po> directory, but that "
36518 "is rather complicated."
36522 #: ../src/guestfs.pod:2885
36523 msgid "C<regressions>"
36527 #: ../src/guestfs.pod:2887
36528 msgid "Regression tests."
36532 #: ../src/guestfs.pod:2889
36537 #: ../src/guestfs.pod:2891
36538 msgid "L<virt-rescue(1)> command and documentation."
36542 #: ../src/guestfs.pod:2893
36547 #: ../src/guestfs.pod:2895
36548 msgid "L<virt-resize(1)> command and documentation."
36552 #: ../src/guestfs.pod:2897
36557 #: ../src/guestfs.pod:2899
36558 msgid "Source code to the C library."
36562 #: ../src/guestfs.pod:2901
36567 #: ../src/guestfs.pod:2903
36569 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
36573 #: ../src/guestfs.pod:2905
36574 msgid "C<test-tool>"
36578 #: ../src/guestfs.pod:2907
36580 "Test tool for end users to test if their qemu/kernel combination will work "
36585 #: ../src/guestfs.pod:2910
36590 #: ../src/guestfs.pod:2912
36595 #: ../src/guestfs.pod:2914
36600 #: ../src/guestfs.pod:2916
36605 #: ../src/guestfs.pod:2918
36610 #: ../src/guestfs.pod:2920
36615 #: ../src/guestfs.pod:2922
36620 #: ../src/guestfs.pod:2924
36625 #: ../src/guestfs.pod:2926
36626 msgid "Language bindings."
36630 #: ../src/guestfs.pod:2930
36631 msgid "MAKING A STABLE RELEASE"
36635 #: ../src/guestfs.pod:2932
36637 "When we make a stable release, there are several steps documented here. See "
36638 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
36643 #: ../src/guestfs.pod:2940
36645 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
36649 #: ../src/guestfs.pod:2945
36650 msgid "Finalize RELEASE-NOTES."
36654 #: ../src/guestfs.pod:2949
36655 msgid "Update ROADMAP."
36659 #: ../src/guestfs.pod:2953
36660 msgid "Run C<src/api-support/update-from-tarballs.sh>."
36664 #: ../src/guestfs.pod:2957
36665 msgid "Push and pull from Transifex."
36669 #: ../src/guestfs.pod:2959
36674 #: ../src/guestfs.pod:2961
36682 #: ../src/guestfs.pod:2963
36683 msgid "to push the latest POT files to Transifex. Then run:"
36687 #: ../src/guestfs.pod:2965
36695 #: ../src/guestfs.pod:2967
36696 msgid "which is a wrapper to pull the latest translated C<*.po> files."
36700 #: ../src/guestfs.pod:2971
36702 "Create new stable and development directories under L<http://libguestfs.org/"
36707 #: ../src/guestfs.pod:2976
36708 msgid "Create the branch in git:"
36712 #: ../src/guestfs.pod:2978
36715 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
36716 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
36717 " git branch stable-1.XX\n"
36718 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
36723 #: ../src/guestfs.pod:2985
36728 #: ../src/guestfs.pod:2987
36729 msgid "PROTOCOL LIMITS"
36733 #: ../src/guestfs.pod:2989
36735 "Internally libguestfs uses a message-based protocol to pass API calls and "
36736 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
36737 "plenty more detail about this). The maximum message size used by the "
36738 "protocol is slightly less than 4 MB. For some API calls you may need to be "
36739 "aware of this limit. The API calls which may be affected are individually "
36740 "documented, with a link back to this section of the documentation."
36744 #: ../src/guestfs.pod:2997
36746 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
36747 "a simple string. Because this string is at some point internally encoded as "
36748 "a message, the maximum size that it can return is slightly under 4 MB. If "
36749 "the requested file is larger than this then you will get an error."
36753 #: ../src/guestfs.pod:3003
36755 "In order to transfer large files into and out of the guest filesystem, you "
36756 "need to use particular calls that support this. The sections L</UPLOADING> "
36757 "and L</DOWNLOADING> document how to do this."
36761 #: ../src/guestfs.pod:3007
36763 "You might also consider mounting the disk image using our FUSE filesystem "
36764 "support (L<guestmount(1)>)."
36768 #: ../src/guestfs.pod:3010
36769 msgid "MAXIMUM NUMBER OF DISKS"
36773 #: ../src/guestfs.pod:3012
36774 msgid "When using virtio disks (the default) the current limit is B<25> disks."
36778 #: ../src/guestfs.pod:3015
36780 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
36781 "slots. However febootstrap only understands disks with names C</dev/vda> "
36782 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
36787 #: ../src/guestfs.pod:3020
36789 "We are working to substantially raise this limit in future versions but it "
36790 "requires complex changes to qemu."
36794 #: ../src/guestfs.pod:3023
36796 "In future versions of libguestfs it should also be possible to \"hot plug\" "
36797 "disks (add and remove disks after calling L</guestfs_launch>). This also "
36798 "requires changes to qemu."
36802 #: ../src/guestfs.pod:3027
36803 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
36807 #: ../src/guestfs.pod:3029
36808 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
36812 #: ../src/guestfs.pod:3031
36814 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
36815 "vda>, and C</dev/vda1> through C</dev/vda15>)."
36819 #: ../src/guestfs.pod:3034
36821 "If you attach a disk with more than 15 partitions, the extra partitions are "
36822 "ignored by libguestfs."
36826 #: ../src/guestfs.pod:3037
36827 msgid "MAXIMUM SIZE OF A DISK"
36831 #: ../src/guestfs.pod:3039
36832 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
36836 #: ../src/guestfs.pod:3041
36838 "We have tested block devices up to 1 exabyte (2**60 or "
36839 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
36844 #: ../src/guestfs.pod:3045
36846 "Although libguestfs probably does not impose any limit, the underlying host "
36847 "storage will. If you store disk images on a host ext4 filesystem, then the "
36848 "maximum size will be limited by the maximum ext4 file size (currently 16 "
36849 "TB). If you store disk images as host logical volumes then you are limited "
36850 "by the maximum size of an LV."
36854 #: ../src/guestfs.pod:3051
36856 "For the hugest disk image files, we recommend using XFS on the host for "
36861 #: ../src/guestfs.pod:3054
36862 msgid "MAXIMUM SIZE OF A PARTITION"
36866 #: ../src/guestfs.pod:3056
36868 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
36869 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
36870 "address a partition located beyond 2 TB on the disk."
36874 #: ../src/guestfs.pod:3060
36876 "It is recommended that you use GPT partitions on disks which are larger than "
36877 "this size. GPT uses 64 bit sector numbers and so can address partitions "
36878 "which are theoretically larger than the largest disk we could support."
36882 #: ../src/guestfs.pod:3065
36883 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
36887 #: ../src/guestfs.pod:3067
36889 "This depends on the filesystem type. libguestfs itself does not impose any "
36890 "known limit. Consult Wikipedia or the filesystem documentation to find out "
36891 "what these limits are."
36895 #: ../src/guestfs.pod:3071
36896 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
36900 #: ../src/guestfs.pod:3073
36902 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
36903 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
36904 "uploads and downloads."
36908 #: ../src/guestfs.pod:3077
36909 msgid "INSPECTION LIMITS"
36913 #: ../src/guestfs.pod:3079
36915 "The inspection code has several arbitrary limits on things like the size of "
36916 "Windows Registry hive it will read, and the length of product name. These "
36917 "are intended to stop a malicious guest from consuming arbitrary amounts of "
36918 "memory and disk space on the host, and should not be reached in practice. "
36919 "See the source code for more information."
36923 #: ../src/guestfs.pod:3105
36925 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
36926 "effect as calling C<guestfs_set_verbose (g, 1)>."
36930 #: ../src/guestfs.pod:3117
36932 "Set the path that libguestfs uses to search for a supermin appliance. See "
36933 "the discussion of paths in section L</PATH> above."
36937 #: ../src/guestfs.pod:3126
36938 msgid "See also L</QEMU WRAPPERS> above."
36942 #: ../src/guestfs.pod:3130
36944 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
36945 "effect as calling C<guestfs_set_trace (g, 1)>."
36949 #: ../src/guestfs.pod:3148
36951 "L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-"
36952 "perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, L<guestfish(1)>, "
36953 "L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
36954 "L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)"
36955 ">, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
36956 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, "
36957 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
36958 "L<febootstrap(1)>, L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://"
36959 "libguestfs.org/>."
36963 #: ../src/guestfs.pod:3179
36965 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
36966 "(8)>, L<disktype(1)>."
36970 #: ../src/guestfs.pod:3186 ../tools/virt-make-fs.pl:553
36971 #: ../tools/virt-win-reg.pl:761
36976 #: ../src/guestfs.pod:3188
36977 msgid "To get a list of bugs against libguestfs use this link:"
36981 #: ../src/guestfs.pod:3190
36983 "L<https://bugzilla.redhat.com/buglist.cgi?"
36984 "component=libguestfs&product=Virtualization+Tools>"
36988 #: ../src/guestfs.pod:3192
36989 msgid "To report a new bug against libguestfs use this link:"
36993 #: ../src/guestfs.pod:3194
36995 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
36996 "component=libguestfs&product=Virtualization+Tools>"
37000 #: ../src/guestfs.pod:3196
37001 msgid "When reporting a bug, please check:"
37005 #: ../src/guestfs.pod:3202
37006 msgid "That the bug hasn't been reported already."
37010 #: ../src/guestfs.pod:3206
37011 msgid "That you are testing a recent version."
37015 #: ../src/guestfs.pod:3210
37016 msgid "Describe the bug accurately, and give a way to reproduce it."
37020 #: ../src/guestfs.pod:3214
37022 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
37027 #: ../test-tool/libguestfs-test-tool.pod:5
37028 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
37032 #: ../test-tool/libguestfs-test-tool.pod:9
37035 " libguestfs-test-tool [--options]\n"
37040 #: ../test-tool/libguestfs-test-tool.pod:13
37042 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
37043 "to check basic libguestfs functionality is working. This is needed because "
37044 "libguestfs occasionally breaks for reasons beyond our control: usually "
37045 "because of changes in the underlying qemu or kernel packages, or the host "
37050 #: ../test-tool/libguestfs-test-tool.pod:19
37051 msgid "If you suspect a problem in libguestfs, then just run:"
37055 #: ../test-tool/libguestfs-test-tool.pod:21
37058 " libguestfs-test-tool\n"
37063 #: ../test-tool/libguestfs-test-tool.pod:23
37064 msgid "It will print lots of diagnostic messages."
37068 #: ../test-tool/libguestfs-test-tool.pod:25
37069 msgid "If it runs to completion successfully, you will see this near the end:"
37073 #: ../test-tool/libguestfs-test-tool.pod:27
37076 " ===== TEST FINISHED OK =====\n"
37081 #: ../test-tool/libguestfs-test-tool.pod:29
37082 msgid "and the test tool will exit with code 0."
37086 #: ../test-tool/libguestfs-test-tool.pod:31
37088 "If it fails (and/or exits with non-zero error code), please paste the "
37089 "I<complete, unedited> output of the test tool into a bug report. More "
37090 "information about reporting bugs can be found on the L<http://libguestfs.org/"
37095 #: ../test-tool/libguestfs-test-tool.pod:42
37096 msgid "Display short usage information and exit."
37100 #: ../test-tool/libguestfs-test-tool.pod:44
37101 msgid "B<--qemu qemu_binary>"
37105 #: ../test-tool/libguestfs-test-tool.pod:46
37107 "If you have downloaded another qemu binary, point this option at the full "
37108 "path of the binary to try it."
37112 #: ../test-tool/libguestfs-test-tool.pod:49
37113 msgid "B<--qemudir qemu_source_dir>"
37117 #: ../test-tool/libguestfs-test-tool.pod:51
37119 "If you have compiled qemu from source, point this option at the source "
37120 "directory to try it."
37124 #: ../test-tool/libguestfs-test-tool.pod:54
37129 #: ../test-tool/libguestfs-test-tool.pod:56
37130 msgid "B<--timeout N>"
37134 #: ../test-tool/libguestfs-test-tool.pod:58
37136 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
37137 "minutes) which does not usually need to be adjusted."
37141 #: ../test-tool/libguestfs-test-tool.pod:63
37142 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
37146 #: ../test-tool/libguestfs-test-tool.pod:65
37148 "If you have compiled another version of qemu from source and would like to "
37149 "try that, then you can use the I<--qemudir> option to point to the qemu "
37150 "source directory."
37154 #: ../test-tool/libguestfs-test-tool.pod:69
37156 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
37157 "option to point to the binary."
37161 #: ../test-tool/libguestfs-test-tool.pod:72
37163 "Note when using these options, you can ignore the business of qemu wrapper "
37164 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
37165 "wrapper script for you if one is needed."
37169 #: ../test-tool/libguestfs-test-tool.pod:76
37170 msgid "TRYING OUT A DIFFERENT KERNEL"
37174 #: ../test-tool/libguestfs-test-tool.pod:78
37176 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
37177 "libguestfs tries. You do this by setting the environment variables "
37178 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
37182 #: ../test-tool/libguestfs-test-tool.pod:82
37184 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
37189 #: ../test-tool/libguestfs-test-tool.pod:85
37190 msgid "SELF-DIAGNOSIS"
37194 #: ../test-tool/libguestfs-test-tool.pod:87
37196 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
37197 "produced by libguestfs-test-tool and/or possible errors."
37201 #: ../test-tool/libguestfs-test-tool.pod:92
37203 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
37204 "I<1> if there was an error."
37208 #: ../test-tool/libguestfs-test-tool.pod:97
37210 "For the full list of environment variables which may affect libguestfs, "
37211 "please see the L<guestfs(3)> manual page."
37215 #: ../test-tool/libguestfs-test-tool.pod:102
37216 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
37220 #: ../tools/virt-list-filesystems.pl:32
37222 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
37226 #: ../tools/virt-list-filesystems.pl:36
37229 " virt-list-filesystems [--options] domname\n"
37234 #: ../tools/virt-list-filesystems.pl:38
37237 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
37242 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
37244 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
37249 #: ../tools/virt-list-filesystems.pl:45
37251 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
37252 "are contained in a virtual machine or disk image."
37256 #: ../tools/virt-list-filesystems.pl:49
37258 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
37259 "functionality. For more complex cases you should look at the L<guestfish(1)"
37264 #: ../tools/virt-list-filesystems.pl:112
37266 "With this option, C<virt-list-filesystems> displays the type of each "
37267 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
37271 #: ../tools/virt-list-filesystems.pl:119
37276 #: ../tools/virt-list-filesystems.pl:123
37278 "Normally we only show mountable filesystems. If this option is given then "
37279 "swap devices are shown too."
37283 #: ../tools/virt-list-filesystems.pl:197
37285 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
37286 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
37287 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37291 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
37292 msgid "Copyright (C) 2009 Red Hat Inc."
37296 #: ../tools/virt-list-partitions.pl:32
37298 "virt-list-partitions - List partitions in a virtual machine or disk image"
37302 #: ../tools/virt-list-partitions.pl:36
37305 " virt-list-partitions [--options] domname\n"
37310 #: ../tools/virt-list-partitions.pl:38
37313 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
37318 #: ../tools/virt-list-partitions.pl:45
37320 "C<virt-list-partitions> is a command line tool to list the partitions that "
37321 "are contained in a virtual machine or disk image. It is mainly useful as a "
37322 "first step to using L<virt-resize(1)>."
37326 #: ../tools/virt-list-partitions.pl:50
37328 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
37329 "functionality. For more complex cases you should look at the L<guestfish(1)"
37334 #: ../tools/virt-list-partitions.pl:113
37335 msgid "Show sizes in human-readable form (eg. \"1G\")."
37339 #: ../tools/virt-list-partitions.pl:123
37341 "With this option, C<virt-list-partitions> displays the type and size of each "
37342 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
37346 #: ../tools/virt-list-partitions.pl:130
37351 #: ../tools/virt-list-partitions.pl:132
37356 #: ../tools/virt-list-partitions.pl:134
37358 "Display the total size of each block device (as a separate row or rows)."
37362 #: ../tools/virt-list-partitions.pl:267
37364 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
37365 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
37366 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37370 #: ../tools/virt-list-partitions.pl:283
37371 msgid "Copyright (C) 2009-2010 Red Hat Inc."
37375 #: ../tools/virt-make-fs.pl:37
37376 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
37380 #: ../tools/virt-make-fs.pl:41
37383 " virt-make-fs [--options] input.tar output.img\n"
37388 #: ../tools/virt-make-fs.pl:43
37391 " virt-make-fs [--options] input.tar.gz output.img\n"
37396 #: ../tools/virt-make-fs.pl:45
37399 " virt-make-fs [--options] directory output.img\n"
37404 #: ../tools/virt-make-fs.pl:49
37406 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
37407 "archive or some files in a directory. It is similar to tools like L<mkisofs"
37408 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
37409 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
37410 "you want to attach these filesystems to existing virtual machines (eg. to "
37411 "import large amounts of read-only data to a VM)."
37415 #: ../tools/virt-make-fs.pl:57
37416 msgid "Basic usage is:"
37420 #: ../tools/virt-make-fs.pl:59
37423 " virt-make-fs input output\n"
37428 #: ../tools/virt-make-fs.pl:61
37430 "where C<input> is either a directory containing files that you want to add, "
37431 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
37432 "C<output> is a disk image. The input type is detected automatically. The "
37433 "output disk image defaults to a raw ext2 image unless you specify extra "
37434 "flags (see L</OPTIONS> below)."
37438 #: ../tools/virt-make-fs.pl:67
37439 msgid "EXTRA SPACE"
37443 #: ../tools/virt-make-fs.pl:69
37445 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
37446 "the files that it contains, but might have extra space. Depending on how "
37447 "you are going to use the output, you might think this extra space is wasted "
37448 "and want to minimize it, or you might want to leave space so that more files "
37449 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
37450 "but you can use the I<--size> flag to leave space in the filesystem if you "
37455 #: ../tools/virt-make-fs.pl:77
37457 "An alternative way to leave extra space but not make the output image any "
37458 "bigger is to use an alternative disk image format (instead of the default "
37459 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
37460 "image format (check your hypervisor supports this before using it). This "
37461 "allows you to choose a large I<--size> but the extra space won't actually be "
37462 "allocated in the image until you try to store something in it."
37466 #: ../tools/virt-make-fs.pl:85
37468 "Don't forget that you can also use local commands including L<resize2fs(8)> "
37469 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
37470 "to build another image from scratch."
37474 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
37475 #: ../tools/virt-make-fs.pl:142
37480 #: ../tools/virt-make-fs.pl:91
37483 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
37488 #: ../tools/virt-make-fs.pl:93
37489 msgid "FILESYSTEM TYPE"
37493 #: ../tools/virt-make-fs.pl:95
37495 "The default filesystem type is C<ext2>. Just about any filesystem type that "
37496 "libguestfs supports can be used (but I<not> read-only formats like "
37497 "ISO9660). Here are some of the more common choices:"
37501 #: ../tools/virt-make-fs.pl:101
37506 #: ../tools/virt-make-fs.pl:103
37508 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
37509 "you are not going to use the filesystem in a way that requires the journal, "
37510 "then this is just wasted overhead."
37514 #: ../tools/virt-make-fs.pl:107
37515 msgid "I<ntfs> or I<vfat>"
37519 #: ../tools/virt-make-fs.pl:109
37520 msgid "Useful if exporting data to a Windows guest."
37524 #: ../tools/virt-make-fs.pl:111
37526 "I<Note for vfat>: The tar archive or local directory must only contain files "
37527 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
37528 "program running within libguestfs is unable to change the ownership of non-"
37529 "root files, since vfat itself does not support this."
37533 #: ../tools/virt-make-fs.pl:116
37538 #: ../tools/virt-make-fs.pl:118
37540 "Lower overhead than C<ext2>, but certain limitations on filename length and "
37541 "total filesystem size."
37545 #: ../tools/virt-make-fs.pl:125
37548 " virt-make-fs --type=minix input minixfs.img\n"
37553 #: ../tools/virt-make-fs.pl:127
37554 msgid "TO PARTITION OR NOT TO PARTITION"
37558 #: ../tools/virt-make-fs.pl:129
37559 msgid "Optionally virt-make-fs can add a partition table to the output disk."
37563 #: ../tools/virt-make-fs.pl:131
37565 "Adding a partition can make the disk image more compatible with certain "
37566 "virtualized operating systems which don't expect to see a filesystem "
37567 "directly located on a block device (Linux doesn't care and will happily "
37568 "handle both types)."
37572 #: ../tools/virt-make-fs.pl:136
37574 "On the other hand, if you have a partition table then the output image is no "
37575 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
37576 "directly on a partitioned disk image. (However libguestfs tools such as "
37577 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
37581 #: ../tools/virt-make-fs.pl:144
37582 msgid "Add an MBR partition:"
37586 #: ../tools/virt-make-fs.pl:146
37589 " virt-make-fs --partition -- input disk.img\n"
37594 #: ../tools/virt-make-fs.pl:148
37596 "If the output disk image could be terabyte-sized or larger, it's better to "
37597 "use an EFI/GPT-compatible partition table:"
37601 #: ../tools/virt-make-fs.pl:151
37604 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
37609 #: ../tools/virt-make-fs.pl:179
37610 msgid "Enable debugging information."
37614 #: ../tools/virt-make-fs.pl:185
37615 msgid "B<--size=E<lt>NE<gt>>"
37619 #: ../tools/virt-make-fs.pl:187
37620 msgid "B<--size=+E<lt>NE<gt>>"
37624 #: ../tools/virt-make-fs.pl:189
37625 msgid "B<-s E<lt>NE<gt>>"
37629 #: ../tools/virt-make-fs.pl:191
37630 msgid "B<-s +E<lt>NE<gt>>"
37634 #: ../tools/virt-make-fs.pl:193
37636 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
37640 #: ../tools/virt-make-fs.pl:196
37642 "If this option is I<not> given, then the output image will be just large "
37643 "enough to contain all the files, with not much wasted space."
37647 #: ../tools/virt-make-fs.pl:199
37649 "To choose a fixed size output disk, specify an absolute number followed by b/"
37650 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37651 "Petabytes or Exabytes. This must be large enough to contain all the input "
37652 "files, else you will get an error."
37656 #: ../tools/virt-make-fs.pl:204
37658 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
37659 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37660 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
37661 "the input files, and (approximately) an extra 200 MB free space."
37665 #: ../tools/virt-make-fs.pl:210
37667 "Note that virt-make-fs estimates free space, and therefore will not produce "
37668 "filesystems containing precisely the free space requested. (It is much more "
37669 "expensive and time-consuming to produce a filesystem which has precisely the "
37670 "desired free space)."
37674 #: ../tools/virt-make-fs.pl:219
37675 msgid "B<--format=E<lt>fmtE<gt>>"
37679 #: ../tools/virt-make-fs.pl:221
37680 msgid "B<-F E<lt>fmtE<gt>>"
37684 #: ../tools/virt-make-fs.pl:223
37685 msgid "Choose the output disk image format."
37689 #: ../tools/virt-make-fs.pl:225
37690 msgid "The default is C<raw> (raw disk image)."
37694 #: ../tools/virt-make-fs.pl:227
37696 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
37697 "that would really make sense here is C<qcow2>."
37701 #: ../tools/virt-make-fs.pl:234
37702 msgid "B<--type=E<lt>fsE<gt>>"
37706 #: ../tools/virt-make-fs.pl:236
37707 msgid "B<-t E<lt>fsE<gt>>"
37711 #: ../tools/virt-make-fs.pl:238
37712 msgid "Choose the output filesystem type."
37716 #: ../tools/virt-make-fs.pl:240
37717 msgid "The default is C<ext2>."
37721 #: ../tools/virt-make-fs.pl:242
37723 "Any filesystem which is supported read-write by libguestfs can be used here."
37727 #: ../tools/virt-make-fs.pl:249
37728 msgid "B<--partition>"
37732 #: ../tools/virt-make-fs.pl:251
37733 msgid "B<--partition=E<lt>parttypeE<gt>>"
37737 #: ../tools/virt-make-fs.pl:253
37739 "If specified, this flag adds an MBR partition table to the output disk image."
37743 #: ../tools/virt-make-fs.pl:256
37745 "You can change the partition table type, eg. I<--partition=gpt> for large "
37750 #: ../tools/virt-make-fs.pl:259
37752 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
37753 "might consider the next parameter to be the partition type. For example:"
37757 #: ../tools/virt-make-fs.pl:263
37760 " virt-make-fs --partition input.tar ...\n"
37765 #: ../tools/virt-make-fs.pl:265
37767 "would cause virt-make-fs to think you wanted to use a partition type of "
37768 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
37769 "dash) between options and the input file argument:"
37773 #: ../tools/virt-make-fs.pl:269
37776 " virt-make-fs --partition -- input.tar ...\n"
37781 #: ../tools/virt-make-fs.pl:541
37783 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
37784 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
37785 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
37789 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
37791 "When reporting bugs, please enable debugging and capture the I<complete> "
37796 #: ../tools/virt-make-fs.pl:558
37799 " export LIBGUESTFS_DEBUG=1\n"
37800 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
37805 #: ../tools/virt-make-fs.pl:561
37807 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
37812 #: ../tools/virt-tar.pl:33
37813 msgid "virt-tar - Extract or upload files to a virtual machine"
37817 #: ../tools/virt-tar.pl:37
37820 " virt-tar [--options] -x domname directory tarball\n"
37825 #: ../tools/virt-tar.pl:39
37828 " virt-tar [--options] -u domname tarball directory\n"
37833 #: ../tools/virt-tar.pl:41
37836 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
37841 #: ../tools/virt-tar.pl:43
37844 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
37849 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
37854 #: ../tools/virt-tar.pl:47
37856 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
37857 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
37861 #: ../tools/virt-tar.pl:52
37862 msgid "Download C</home> from the VM into a local tarball:"
37866 #: ../tools/virt-tar.pl:54
37869 " virt-tar -x domname /home home.tar\n"
37874 #: ../tools/virt-tar.pl:56
37877 " virt-tar -zx domname /home home.tar.gz\n"
37882 #: ../tools/virt-tar.pl:58
37883 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
37887 #: ../tools/virt-tar.pl:60
37890 " virt-tar -u domname uploadstuff.tar /tmp\n"
37895 #: ../tools/virt-tar.pl:62
37898 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
37903 #: ../tools/virt-tar.pl:66
37905 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
37906 "virtual machines. If you do this, you risk disk corruption in the VM. "
37907 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
37911 #: ../tools/virt-tar.pl:71
37913 "You can use I<-x> (extract) on live virtual machines, but you might get "
37914 "inconsistent results or errors if there is filesystem activity inside the "
37915 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
37916 "work, but the only way to guarantee consistent results is if the virtual "
37917 "machine is shut down."
37921 #: ../tools/virt-tar.pl:79
37923 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
37924 "parts of a guest filesystem. There are many possibilities: making backups, "
37925 "uploading data files, snooping on guest activity, fixing or customizing "
37930 #: ../tools/virt-tar.pl:84
37932 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
37933 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
37934 "should look at the L<guestfish(1)> tool."
37938 #: ../tools/virt-tar.pl:88
37940 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
37941 "its contents (recursively) from the virtual machine into a local tarball. "
37942 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
37943 "virtual machine. You cannot use these two options together."
37947 #: ../tools/virt-tar.pl:94
37949 "In addition, you may need to use the I<-z> (gZip) option to enable "
37950 "compression. When uploading, you have to specify I<-z> if the upload file "
37951 "is compressed because virt-tar won't detect this on its own."
37955 #: ../tools/virt-tar.pl:98
37957 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
37958 "example it cannot do PKZip files or bzip2 compression. If you want that "
37959 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
37960 "the L<libguestfs(3)> API)."
37964 #: ../tools/virt-tar.pl:160
37965 msgid "B<--extract>"
37969 #: ../tools/virt-tar.pl:162
37970 msgid "B<--download>"
37974 #: ../tools/virt-tar.pl:164
37979 #: ../tools/virt-tar.pl:166
37980 msgid "B<--upload>"
37984 #: ../tools/virt-tar.pl:168
37986 "Use I<-x> to extract (download) a directory from a virtual machine to a "
37991 #: ../tools/virt-tar.pl:171
37993 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
37994 "Please read the L</WARNING> section above before using this option."
37998 #: ../tools/virt-tar.pl:175
37999 msgid "You must specify exactly one of these options."
38003 #: ../tools/virt-tar.pl:181
38008 #: ../tools/virt-tar.pl:183
38013 #: ../tools/virt-tar.pl:185
38014 msgid "Specify that the input or output tarball is gzip-compressed."
38018 #: ../tools/virt-tar.pl:298
38020 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
38021 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
38022 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
38027 #: ../tools/virt-win-reg.pl:37
38029 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
38033 #: ../tools/virt-win-reg.pl:41
38036 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
38041 #: ../tools/virt-win-reg.pl:43
38044 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
38049 #: ../tools/virt-win-reg.pl:45
38052 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
38057 #: ../tools/virt-win-reg.pl:47
38060 " virt-win-reg --merge domname [input.reg ...]\n"
38065 #: ../tools/virt-win-reg.pl:49
38068 " virt-win-reg [--options] disk.img ... # instead of domname\n"
38073 #: ../tools/virt-win-reg.pl:53
38075 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
38076 "virtual machines. If you do this, you I<will> get irreversible disk "
38077 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
38078 "but doesn't catch all cases."
38082 #: ../tools/virt-win-reg.pl:58
38084 "Modifying the Windows Registry is an inherently risky operation. The format "
38085 "is deliberately obscure and undocumented, and Registry changes can leave the "
38086 "system unbootable. Therefore when using the I<--merge> option, make sure "
38087 "you have a reliable backup first."
38091 #: ../tools/virt-win-reg.pl:65
38093 "This program can export and merge Windows Registry entries from a Windows "
38098 #: ../tools/virt-win-reg.pl:68
38100 "The first parameter is the libvirt guest name or the raw disk image of a "
38105 #: ../tools/virt-win-reg.pl:71
38107 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
38108 "exported (recursively). For example:"
38112 #: ../tools/virt-win-reg.pl:74
38115 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
38120 #: ../tools/virt-win-reg.pl:76
38122 "You can also display single values from within registry keys, for example:"
38126 #: ../tools/virt-win-reg.pl:79
38129 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
38130 " $ virt-win-reg Windows7 $cvkey ProductName\n"
38131 " Windows 7 Enterprise\n"
38136 #: ../tools/virt-win-reg.pl:83
38138 "With I<--merge>, you can merge a textual regedit file into the Windows "
38143 #: ../tools/virt-win-reg.pl:86
38146 " $ virt-win-reg --merge Windows7 changes.reg\n"
38151 #: ../tools/virt-win-reg.pl:90
38153 "This program is only meant for simple access to the registry. If you want "
38154 "to do complicated things with the registry, we suggest you download the "
38155 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
38156 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
38157 "L<hivexregedit(1)>."
38161 #: ../tools/virt-win-reg.pl:159
38166 #: ../tools/virt-win-reg.pl:161
38168 "In merge mode, this merges a textual regedit file into the Windows Registry "
38169 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
38170 "displays or exports Registry entries instead."
38174 #: ../tools/virt-win-reg.pl:165
38176 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
38177 "result in disk corruption. However exporting (without this flag) is always "
38182 #: ../tools/virt-win-reg.pl:173
38183 msgid "B<--encoding> UTF-16LE|ASCII"
38187 #: ../tools/virt-win-reg.pl:175
38189 "When merging (only), you may need to specify the encoding for strings to be "
38190 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
38191 "(3)/ENCODING STRINGS>."
38195 #: ../tools/virt-win-reg.pl:179
38197 "The default is to use UTF-16LE, which should work with recent versions of "
38202 #: ../tools/virt-win-reg.pl:186
38203 msgid "B<--unsafe-printable-strings>"
38207 #: ../tools/virt-win-reg.pl:188
38209 "When exporting (only), assume strings are UTF-16LE and print them as strings "
38210 "instead of hex sequences. Remove the final zero codepoint from strings if "
38215 #: ../tools/virt-win-reg.pl:192
38217 "This is unsafe and does not preserve the fidelity of strings in the original "
38218 "Registry for various reasons:"
38222 #: ../tools/virt-win-reg.pl:199
38224 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
38225 "other encodings will be corrupted by this transformation."
38229 #: ../tools/virt-win-reg.pl:204
38231 "Assumes that everything which has type 1 or 2 is really a string and that "
38232 "everything else is not a string, but the type field in real Registries is "
38237 #: ../tools/virt-win-reg.pl:210
38239 "Loses information about whether a zero codepoint followed the string in the "
38244 #: ../tools/virt-win-reg.pl:215
38246 "This all happens because the Registry itself contains no information about "
38247 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
38251 #: ../tools/virt-win-reg.pl:219
38253 "You should only use this option for quick hacking and debugging of the "
38254 "Registry contents, and I<never> use it if the output is going to be passed "
38255 "into another program or stored in another Registry."
38259 #: ../tools/virt-win-reg.pl:556
38260 msgid "SUPPORTED SYSTEMS"
38264 #: ../tools/virt-win-reg.pl:558
38266 "The program currently supports Windows NT-derived guests starting with "
38267 "Windows XP through to at least Windows 7."
38271 #: ../tools/virt-win-reg.pl:561
38272 msgid "The following Registry keys are supported:"
38276 #: ../tools/virt-win-reg.pl:565
38277 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
38281 #: ../tools/virt-win-reg.pl:567
38282 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
38286 #: ../tools/virt-win-reg.pl:569
38287 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
38291 #: ../tools/virt-win-reg.pl:571
38292 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
38296 #: ../tools/virt-win-reg.pl:573
38297 msgid "C<HKEY_USERS\\.DEFAULT>"
38301 #: ../tools/virt-win-reg.pl:575
38302 msgid "C<HKEY_USERS\\I<SID>>"
38306 #: ../tools/virt-win-reg.pl:577
38307 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
38311 #: ../tools/virt-win-reg.pl:579
38312 msgid "C<HKEY_USERS\\I<username>>"
38316 #: ../tools/virt-win-reg.pl:581
38318 "where I<username> is a local user name (this is a libguestfs extension)."
38322 #: ../tools/virt-win-reg.pl:585
38324 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
38329 #: ../tools/virt-win-reg.pl:588
38331 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
38332 "supported (there is no \"current user\")."
38336 #: ../tools/virt-win-reg.pl:591
38341 #: ../tools/virt-win-reg.pl:593
38343 "C<virt-win-reg> expects that regedit files have already been reencoded in "
38344 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
38345 "style line endings. Since Windows regedit files are often in UTF-16LE with "
38346 "Windows-style line endings, you may need to reencode the whole file before "
38347 "or after processing."
38351 #: ../tools/virt-win-reg.pl:599
38353 "To reencode a file from Windows format to Linux (before processing it with "
38354 "the I<--merge> option), you would do something like this:"
38358 #: ../tools/virt-win-reg.pl:602
38361 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
38366 #: ../tools/virt-win-reg.pl:604
38368 "To go in the opposite direction, after exporting and before sending the file "
38369 "to a Windows user, do something like this:"
38373 #: ../tools/virt-win-reg.pl:607
38376 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
38381 #: ../tools/virt-win-reg.pl:609
38382 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
38386 #: ../tools/virt-win-reg.pl:611
38388 "If you are unsure about the current encoding, use the L<file(1)> command. "
38389 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
38390 "style (CRLF) line endings, like this:"
38394 #: ../tools/virt-win-reg.pl:615
38397 " $ file software.reg\n"
38398 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
38399 " with CRLF line terminators\n"
38404 #: ../tools/virt-win-reg.pl:619
38405 msgid "This file would need conversion before you could I<--merge> it."
38409 #: ../tools/virt-win-reg.pl:621
38410 msgid "CurrentControlSet etc."
38414 #: ../tools/virt-win-reg.pl:623
38416 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
38417 "Registry at the level of the hive file, and therefore you cannot modify "
38422 #: ../tools/virt-win-reg.pl:627
38424 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
38425 "circumstances it might refer to another control set. The way to find out is "
38426 "to look at the C<HKLM\\SYSTEM\\Select> key:"
38430 #: ../tools/virt-win-reg.pl:631
38433 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
38434 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
38435 " \"Current\"=dword:00000001\n"
38436 " \"Default\"=dword:00000001\n"
38437 " \"Failed\"=dword:00000000\n"
38438 " \"LastKnownGood\"=dword:00000002\n"
38443 #: ../tools/virt-win-reg.pl:638
38444 msgid "\"Current\" is the one which Windows will choose when it boots."
38448 #: ../tools/virt-win-reg.pl:640
38450 "Similarly, other C<Current...> keys in the path may need to be replaced."
38454 #: ../tools/virt-win-reg.pl:643
38455 msgid "WINDOWS TIPS"
38459 #: ../tools/virt-win-reg.pl:645
38461 "Note that some of these tips modify the guest disk image. The guest I<must> "
38462 "be shut off, else you will get disk corruption."
38466 #: ../tools/virt-win-reg.pl:648
38467 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
38471 #: ../tools/virt-win-reg.pl:650
38473 "Prepare a DOS batch script, VBScript or executable. Upload this using "
38474 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
38475 "is uploaded into C<C:\\>:"
38479 #: ../tools/virt-win-reg.pl:654
38482 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
38487 #: ../tools/virt-win-reg.pl:656
38488 msgid "Prepare a regedit file containing the registry change:"
38492 #: ../tools/virt-win-reg.pl:658
38495 " cat > test.reg <<'EOF'\n"
38496 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
38497 " \"Test\"=\"c:\\\\test.bat\"\n"
38503 #: ../tools/virt-win-reg.pl:663
38505 "In this example we use the key C<RunOnce> which means that the script will "
38506 "run precisely once when the first user logs in. If you want it to run every "
38507 "time a user logs in, replace C<RunOnce> with C<Run>."
38511 #: ../tools/virt-win-reg.pl:667
38512 msgid "Now update the registry:"
38516 #: ../tools/virt-win-reg.pl:669
38519 " virt-win-reg --merge WindowsGuest test.reg\n"
38524 #: ../tools/virt-win-reg.pl:671
38525 msgid "INSTALLING A SERVICE"
38529 #: ../tools/virt-win-reg.pl:673
38531 "This section assumes you are familiar with Windows services, and you either "
38532 "have a program which handles the Windows Service Control Protocol directly "
38533 "or you want to run any program using a service wrapper like SrvAny or the "
38538 #: ../tools/virt-win-reg.pl:678
38540 "First upload the program and optionally the service wrapper. In this case "
38541 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
38545 #: ../tools/virt-win-reg.pl:682
38548 " guestfish -i -d WindowsGuest <<EOF\n"
38549 " upload rhsrvany.exe /rhsrvany.exe\n"
38550 " upload test.exe /test.exe\n"
38556 #: ../tools/virt-win-reg.pl:687
38558 "Prepare a regedit file containing the registry changes. In this example, "
38559 "the first registry change is needed for the service itself or the service "
38560 "wrapper (if used). The second registry change is only needed because I am "
38561 "using the RHSrvAny service wrapper."
38565 #: ../tools/virt-win-reg.pl:692
38568 " cat > service.reg <<'EOF'\n"
38569 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
38570 " \"Type\"=dword:00000010\n"
38571 " \"Start\"=dword:00000002\n"
38572 " \"ErrorControl\"=dword:00000001\n"
38573 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
38574 " \"DisplayName\"=\"RHSrvAny\"\n"
38575 " \"ObjectName\"=\"NetworkService\"\n"
38580 #: ../tools/virt-win-reg.pl:701
38583 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
38584 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
38585 " \"PWD\"=\"c:\\\\Temp\"\n"
38591 #: ../tools/virt-win-reg.pl:712
38593 "For use of C<ControlSet001> see the section above in this manual page. You "
38594 "may need to adjust this according to the control set that is in use by the "
38599 #: ../tools/virt-win-reg.pl:718
38601 "C<\"ObjectName\"> controls the privileges that the service will have. An "
38602 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
38603 "privileged account."
38607 #: ../tools/virt-win-reg.pl:724
38609 "For the meaning of the magic numbers, see this Microsoft KB article: "
38610 "L<http://support.microsoft.com/kb/103000>."
38614 #: ../tools/virt-win-reg.pl:729
38615 msgid "Update the registry:"
38619 #: ../tools/virt-win-reg.pl:731
38622 " virt-win-reg --merge WindowsGuest service.reg\n"
38627 #: ../tools/virt-win-reg.pl:735
38629 "Be careful when passing parameters containing C<\\> (backslash) in the "
38630 "shell. Usually you will have to use 'single quotes' or double backslashes "
38631 "(but not both) to protect them from the shell."
38635 #: ../tools/virt-win-reg.pl:739
38636 msgid "Paths and value names are case-insensitive."
38640 #: ../tools/virt-win-reg.pl:748
38642 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
38643 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
38644 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38648 #: ../tools/virt-win-reg.pl:766
38651 " export LIBGUESTFS_DEBUG=1\n"
38652 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
38657 #: ../tools/virt-win-reg.pl:769
38659 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."