1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
5 # rjones <rjones@redhat.com>, 2011.
8 "Project-Id-Version: libguestfs\n"
9 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
10 "POT-Creation-Date: 2011-09-16 16:31+0200\n"
11 "PO-Revision-Date: 2011-07-17 20:50+0000\n"
12 "Last-Translator: rjones <rjones@redhat.com>\n"
13 "Language-Team: Japanese (http://www.transifex.net/projects/p/fedora/team/"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=1; plural=0\n"
22 #: ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3
23 #: ../df/virt-df.pod:3 ../edit/virt-edit.pod:3
24 #: ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14
25 #: ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3
26 #: ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3
27 #: ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3
28 #: ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3
29 #: ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3
30 #: ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3
31 #: ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3
32 #: ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3
33 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
34 #: ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31
35 #: ../tools/virt-win-reg.pl:35
40 #: ../cat/virt-cat.pod:5
41 msgid "virt-cat - Display files in a virtual machine"
45 #: ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7
46 #: ../df/virt-df.pod:7 ../edit/virt-edit.pod:7
47 #: ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7
48 #: ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7
49 #: ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7
50 #: ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7
51 #: ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7
52 #: ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7
53 #: ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7
54 #: ../ruby/examples/guestfs-ruby.pod:7 ../src/guestfs.pod:7
55 #: ../test-tool/libguestfs-test-tool.pod:7
56 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
57 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
58 #: ../tools/virt-win-reg.pl:39
63 #: ../cat/virt-cat.pod:9
66 " virt-cat [--options] -d domname file [file ...]\n"
71 #: ../cat/virt-cat.pod:11
74 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
79 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
80 #: ../inspector/virt-inspector.pod:13
85 #: ../cat/virt-cat.pod:15
88 " virt-cat domname file\n"
93 #: ../cat/virt-cat.pod:17
96 " virt-cat disk.img file\n"
101 #: ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19
102 #: ../df/virt-df.pod:21 ../edit/virt-edit.pod:27
103 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
104 #: ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19
105 #: ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21
106 #: ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20
107 #: ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15
108 #: ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18
109 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29
110 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
111 #: ../src/guestfs.pod:23 ../test-tool/libguestfs-test-tool.pod:11
112 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
113 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
114 #: ../tools/virt-win-reg.pl:63
119 #: ../cat/virt-cat.pod:21
121 "C<virt-cat> is a command line tool to display the contents of C<file> where "
122 "C<file> exists in the named virtual machine (or disk image)."
126 #: ../cat/virt-cat.pod:24
128 "Multiple filenames can be given, in which case they are concatenated "
129 "together. Each filename must be a full path, starting at the root directory "
130 "(starting with '/')."
134 #: ../cat/virt-cat.pod:28
136 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
137 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
138 "(see L</USING GUESTFISH> below)."
142 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
143 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
144 #: ../fish/guestfish.pod:1018 ../fish/virt-copy-in.pod:29
145 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
146 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
147 #: ../resize/virt-resize.pod:27 ../tools/virt-tar.pl:50
152 #: ../cat/virt-cat.pod:34
154 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
158 #: ../cat/virt-cat.pod:37
161 " virt-cat -d mydomain /etc/fstab\n"
166 #: ../cat/virt-cat.pod:39
167 msgid "List syslog messages from a VM disk image file:"
171 #: ../cat/virt-cat.pod:41
174 " virt-cat -a disk.img /var/log/messages | tail\n"
179 #: ../cat/virt-cat.pod:43
180 msgid "Find out what DHCP IP address a VM acquired:"
184 #: ../cat/virt-cat.pod:45
187 " virt-cat -d mydomain /var/log/messages | \\\n"
188 " grep 'dhclient: bound to' | tail\n"
193 #: ../cat/virt-cat.pod:48
194 msgid "Find out what packages were recently installed:"
198 #: ../cat/virt-cat.pod:50
201 " virt-cat -d mydomain /var/log/yum.log | tail\n"
206 #: ../cat/virt-cat.pod:52
207 msgid "Find out who is logged on inside a virtual machine:"
211 #: ../cat/virt-cat.pod:54
214 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
220 #: ../cat/virt-cat.pod:57
221 msgid "or who was logged on:"
225 #: ../cat/virt-cat.pod:59
228 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
229 " last -f /tmp/wtmp\n"
234 #: ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91
235 #: ../cat/virt-ls.pod:261 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62
236 #: ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45
237 #: ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42
238 #: ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:83
239 #: ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84
240 #: ../resize/virt-resize.pod:241 ../test-tool/libguestfs-test-tool.pod:36
241 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
242 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
243 #: ../tools/virt-win-reg.pl:96
248 #: ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95
249 #: ../cat/virt-ls.pod:265 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66
250 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:151
251 #: ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88
252 #: ../resize/virt-resize.pod:245 ../test-tool/libguestfs-test-tool.pod:40
253 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62
254 #: ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111
255 #: ../tools/virt-win-reg.pl:104
260 #: ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97
261 #: ../cat/virt-ls.pod:267 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68
262 #: ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90
263 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64
264 #: ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113
265 #: ../tools/virt-win-reg.pl:106
266 msgid "Display brief help."
270 #: ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99
271 #: ../cat/virt-ls.pod:269 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70
272 #: ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
277 #: ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101
278 #: ../cat/virt-ls.pod:271 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72
279 #: ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
280 msgid "B<--add> file"
284 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
285 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
286 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
288 "Add I<file> which should be a disk image from a virtual machine. If the "
289 "virtual machine has multiple block devices, you must supply all of them with "
290 "separate I<-a> options."
294 #: ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107
295 #: ../cat/virt-ls.pod:277 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78
296 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:93
297 #: ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
299 "The format of the disk image is auto-detected. To override this and force a "
300 "particular format use the I<--format=..> option."
304 #: ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125
305 #: ../cat/virt-ls.pod:291 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
310 #: ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127
311 #: ../cat/virt-ls.pod:293 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
312 msgid "B<--connect> URI"
316 #: ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129
317 #: ../cat/virt-ls.pod:295 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99
318 #: ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111
319 #: ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82
320 #: ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
322 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
323 "to the default libvirt hypervisor."
327 #: ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132
328 #: ../cat/virt-ls.pod:298 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
330 "If you specify guest block devices directly (I<-a>), then libvirt is not "
335 #: ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141
336 #: ../cat/virt-ls.pod:307 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105
337 #: ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
342 #: ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143
343 #: ../cat/virt-ls.pod:309 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107
344 #: ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
345 msgid "B<--domain> guest"
349 #: ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145
350 #: ../cat/virt-ls.pod:311 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109
351 #: ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
353 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
358 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
359 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
360 #: ../fuse/guestmount.pod:126 ../inspector/virt-inspector.pod:92
361 msgid "B<--echo-keys>"
365 #: ../cat/virt-cat.pod:100
367 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
368 "so you cannot see what you are typing. If you are not worried about Tempest "
369 "attacks and there is no one else in the room you can specify this flag to "
370 "see what you are typing."
374 #: ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170
375 #: ../cat/virt-ls.pod:328 ../df/virt-df.pod:101 ../fish/guestfish.pod:233
376 #: ../fuse/guestmount.pod:133 ../inspector/virt-inspector.pod:99
377 #: ../rescue/virt-rescue.pod:124
378 msgid "B<--format=raw|qcow2|..>"
382 #: ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172
383 #: ../cat/virt-ls.pod:330 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134
384 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:135
385 #: ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
390 #: ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174
391 #: ../cat/virt-ls.pod:332 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136
392 #: ../fish/guestfish.pod:237 ../fuse/guestmount.pod:137
393 #: ../rescue/virt-rescue.pod:128
395 "The default for the I<-a> option is to auto-detect the format of the disk "
396 "image. Using this forces the disk format for I<-a> options which follow on "
397 "the command line. Using I<--format> with no argument switches back to auto-"
398 "detection for subsequent I<-a> options."
402 #: ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179
403 #: ../cat/virt-ls.pod:337 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141
404 #: ../fish/guestfish.pod:242 ../fish/guestfish.pod:673
405 #: ../inspector/virt-inspector.pod:336 ../rescue/virt-rescue.pod:133
406 #: ../src/guestfs.pod:2745
411 #: ../cat/virt-cat.pod:116
414 " virt-cat --format=raw -a disk.img file\n"
419 #: ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183
420 #: ../cat/virt-ls.pod:341 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145
421 #: ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
422 msgid "forces raw format (no auto-detection) for C<disk.img>."
426 #: ../cat/virt-cat.pod:120
429 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
434 #: ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187
435 #: ../cat/virt-ls.pod:345 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149
436 #: ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
438 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
439 "detection for C<another.img>."
443 #: ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190
444 #: ../cat/virt-ls.pod:348 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152
445 #: ../rescue/virt-rescue.pod:144
447 "If you have untrusted raw-format guest disk images, you should use this "
448 "option to specify the disk format. This avoids a possible security problem "
449 "with malicious guests (CVE-2010-3851)."
453 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
454 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
455 #: ../fuse/guestmount.pod:163 ../inspector/virt-inspector.pod:114
456 msgid "B<--keys-from-stdin>"
460 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
461 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
462 #: ../fuse/guestmount.pod:165 ../inspector/virt-inspector.pod:116
464 "Read key or passphrase parameters from stdin. The default is to try to read "
465 "passphrases from the user by opening C</dev/tty>."
469 #: ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261
470 #: ../cat/virt-ls.pod:425 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161
471 #: ../fish/guestfish.pod:390 ../fuse/guestmount.pod:257
472 #: ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:178
477 #: ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263
478 #: ../cat/virt-ls.pod:427 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163
479 #: ../fish/guestfish.pod:392 ../fuse/guestmount.pod:259
480 #: ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:180
485 #: ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265
486 #: ../cat/virt-ls.pod:429 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165
487 #: ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:182
488 msgid "Enable verbose messages for debugging."
492 #: ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267
493 #: ../cat/virt-ls.pod:431 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167
494 #: ../fish/guestfish.pod:397 ../fuse/guestmount.pod:263
495 #: ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:184
496 #: ../resize/virt-resize.pod:484
501 #: ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269
502 #: ../cat/virt-ls.pod:433 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169
503 #: ../fish/guestfish.pod:399 ../fuse/guestmount.pod:265
504 #: ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:186
505 #: ../resize/virt-resize.pod:486 ../tools/virt-list-filesystems.pl:69
506 #: ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169
507 #: ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
512 #: ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271
513 #: ../cat/virt-ls.pod:435 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171
514 #: ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:188
515 #: ../resize/virt-resize.pod:488 ../tools/virt-list-filesystems.pl:71
516 #: ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171
517 #: ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
518 msgid "Display version number and exit."
522 #: ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281
523 #: ../cat/virt-ls.pod:437 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173
524 #: ../fish/guestfish.pod:412 ../fuse/guestmount.pod:278
525 #: ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:199
526 #: ../tools/virt-tar.pl:158
531 #: ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283
532 #: ../cat/virt-ls.pod:439 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175
533 #: ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:201
534 msgid "Enable tracing of libguestfs API calls."
538 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
539 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:205
540 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
544 #: ../cat/virt-cat.pod:154
545 msgid "Previous versions of virt-cat allowed you to write either:"
549 #: ../cat/virt-cat.pod:156
552 " virt-cat disk.img [disk.img ...] file\n"
557 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
558 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:211
563 #: ../cat/virt-cat.pod:160
566 " virt-cat guestname file\n"
571 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
572 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:215
574 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
575 "the confusing case where a disk image might have the same name as a guest."
579 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
580 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:219
581 msgid "For compatibility the old style is still supported."
585 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
586 msgid "USING GUESTFISH"
590 #: ../cat/virt-cat.pod:170
592 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
593 "C<virt-cat> doesn't work."
597 #: ../cat/virt-cat.pod:173
598 msgid "Using C<virt-cat> is approximately equivalent to doing:"
602 #: ../cat/virt-cat.pod:175
605 " guestfish --ro -i -d domname download file -\n"
610 #: ../cat/virt-cat.pod:177
612 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
613 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
617 #: ../cat/virt-cat.pod:181
619 "The command above uses libguestfs's guest inspection feature and so does not "
620 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
621 "disk images that don't contain guests. To display a file from a disk image "
626 #: ../cat/virt-cat.pod:186
629 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
634 #: ../cat/virt-cat.pod:188
636 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
637 "the disk image, and C<file> is the full path to the file."
641 #: ../cat/virt-cat.pod:191 ../cat/virt-filesystems.pod:365
642 #: ../cat/virt-ls.pod:483 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342
643 #: ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:262
644 #: ../resize/virt-resize.pod: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:1081 ../fuse/guestmount.pod:303
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:305 ../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:1235 ../fish/virt-copy-in.pod:50
687 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
688 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:308
689 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
690 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
691 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:284
692 #: ../resize/virt-resize.pod:580 ../ruby/examples/guestfs-ruby.pod:36
693 #: ../src/guestfs.pod:3119 ../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:1264 ../fish/virt-copy-in.pod:64
732 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
733 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:323
734 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:61
735 #: ../ocaml/examples/guestfs-ocaml.pod:94 ../perl/examples/guestfs-perl.pod:55
736 #: ../python/examples/guestfs-python.pod:57 ../rescue/virt-rescue.pod:296
737 #: ../resize/virt-resize.pod:605 ../ruby/examples/guestfs-ruby.pod:51
738 #: ../src/guestfs.pod:3195 ../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:1269 ../fish/virt-copy-in.pod:69
755 #: ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67
756 #: ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:328
757 #: ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:300
758 #: ../resize/virt-resize.pod: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:1274 ../fish/virt-copy-in.pod:74
773 #: ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72
774 #: ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:333
775 #: ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:305
776 #: ../resize/virt-resize.pod: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:1279 ../fish/virt-copy-in.pod:79
791 #: ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77
792 #: ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:338
793 #: ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:310
794 #: ../resize/virt-resize.pod: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:155
2361 #: ../df/virt-df.pod:135
2366 #: ../df/virt-df.pod:137
2367 msgid "Print inodes instead of blocks."
2371 #: ../df/virt-df.pod:139
2372 msgid "B<--one-per-guest>"
2376 #: ../df/virt-df.pod:141
2378 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
2379 "disks from several guests to a single libguestfs appliance."
2383 #: ../df/virt-df.pod:144
2384 msgid "You might use this option in the following circumstances:"
2388 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
2389 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
2390 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
2391 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
2392 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
2393 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
2394 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
2395 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
2396 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
2397 #: ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:398
2398 #: ../fish/guestfish-actions.pod:405 ../fish/guestfish-actions.pod:412
2399 #: ../fish/guestfish-actions.pod:1104 ../fish/guestfish-actions.pod:1108
2400 #: ../fish/guestfish-actions.pod:1112 ../fish/guestfish-actions.pod:1116
2401 #: ../fish/guestfish-actions.pod:1124 ../fish/guestfish-actions.pod:1128
2402 #: ../fish/guestfish-actions.pod:1132 ../fish/guestfish-actions.pod:1142
2403 #: ../fish/guestfish-actions.pod:1146 ../fish/guestfish-actions.pod:1150
2404 #: ../fish/guestfish-actions.pod:1240 ../fish/guestfish-actions.pod:1244
2405 #: ../fish/guestfish-actions.pod:1249 ../fish/guestfish-actions.pod:1254
2406 #: ../fish/guestfish-actions.pod:1296 ../fish/guestfish-actions.pod:1300
2407 #: ../fish/guestfish-actions.pod:1305 ../fish/guestfish-actions.pod: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:1064
2435 #: ../src/guestfs.pod:1068 ../src/guestfs.pod:1072 ../src/guestfs.pod:1077
2436 #: ../src/guestfs.pod:1085 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112
2437 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1138 ../src/guestfs.pod:1142
2438 #: ../src/guestfs.pod:1146 ../src/guestfs.pod:1150 ../src/guestfs.pod:1154
2439 #: ../src/guestfs.pod:1643 ../src/guestfs.pod:1648 ../src/guestfs.pod:1652
2440 #: ../src/guestfs.pod:1754 ../src/guestfs.pod:1759 ../src/guestfs.pod:1763
2441 #: ../src/guestfs.pod:1773 ../src/guestfs.pod:2047 ../src/guestfs.pod:2052
2442 #: ../src/guestfs.pod:2058 ../src/guestfs.pod:2066 ../src/guestfs.pod:2513
2443 #: ../src/guestfs.pod:2519 ../src/guestfs.pod:2524 ../src/guestfs.pod:2530
2444 #: ../src/guestfs.pod:2911 ../src/guestfs.pod:2916 ../src/guestfs.pod:2920
2445 #: ../src/guestfs.pod:2924 ../src/guestfs.pod:2928 ../src/guestfs.pod:2942
2446 #: ../src/guestfs.pod:2947 ../src/guestfs.pod:3172 ../src/guestfs.pod:3176
2447 #: ../src/guestfs.pod:3180 ../src/guestfs.pod:3184
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:96 ../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:98 ../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:1086
3048 #: ../rescue/virt-rescue.pod:257 ../src/guestfs.pod:3058
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:1260 ../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:319
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:3191
3168 #: ../test-tool/libguestfs-test-tool.pod:106
3173 #: ../examples/guestfs-examples.pod:46 ../examples/guestfs-recipes.pod:398
3174 #: ../fish/guestfish.pod:1262 ../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:321
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:3193
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:3200
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:3205
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:3210
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:1639
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
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:2780
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:1009
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:87
16358 msgid "B<-a image>"
16362 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
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:100
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:104
16400 msgid "B<-d libvirt-domain>"
16404 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
16405 msgid "B<--domain libvirt-domain>"
16409 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
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:112
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:128
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:157
16506 msgid "B<--inspector>"
16510 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
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:168
16604 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
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:173
16612 msgid "B<-m dev[:mountpoint[:options]]>"
16616 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
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:183
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:191
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:193
16677 #: ../resize/virt-resize.pod:358
16682 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
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:239
16758 #: ../rescue/virt-rescue.pod:161
16763 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241
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:253
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:269
16820 #: ../rescue/virt-rescue.pod:190
16825 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271
16826 #: ../rescue/virt-rescue.pod:192
16831 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
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 "REMOTE CONTROL RUN COMMAND HANGING"
18121 #: ../fish/guestfish.pod:978
18123 "Using the C<run> (or C<launch>) command remotely in a command substitution "
18124 "context hangs, ie. don't do (note the backquotes):"
18128 #: ../fish/guestfish.pod:981
18131 " a=`guestfish --remote run`\n"
18136 #: ../fish/guestfish.pod:983
18138 "Since the C<run> command produces no output on stdout, this is not useful "
18139 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
18144 #: ../fish/guestfish.pod:987
18145 msgid "PREPARED DISK IMAGES"
18149 #: ../fish/guestfish.pod:989
18151 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18152 "preformatted disk images that guestfish can make for you to save typing. "
18153 "This is particularly useful for testing purposes. This option is used "
18154 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18155 "can be mixed with I<-a>)."
18159 #: ../fish/guestfish.pod:995
18161 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18162 "the second and so on. Existing files in the current directory are "
18167 #: ../fish/guestfish.pod:999
18169 "The type briefly describes how the disk should be sized, partitioned, how "
18170 "filesystem(s) should be created, and how content should be added. "
18171 "Optionally the type can be followed by extra parameters, separated by C<:> "
18172 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18173 "allocated disk, containing a single partition, with the partition formatted "
18174 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18179 #: ../fish/guestfish.pod:1007
18180 msgid "To list the available types and any extra parameters they take, run:"
18184 #: ../fish/guestfish.pod:1011
18186 "Note that the prepared filesystem is not mounted. You would usually have to "
18187 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18191 #: ../fish/guestfish.pod:1015
18193 "If any I<-N> or I<--new> options are given, the guest is automatically "
18198 #: ../fish/guestfish.pod:1020
18199 msgid "Create a 100MB disk with an ext4-formatted partition:"
18203 #: ../fish/guestfish.pod:1022
18206 " guestfish -N fs:ext4\n"
18211 #: ../fish/guestfish.pod:1024
18212 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18216 #: ../fish/guestfish.pod:1026
18219 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18224 #: ../fish/guestfish.pod:1028
18225 msgid "Create a blank 200MB disk:"
18229 #: ../fish/guestfish.pod:1030
18232 " guestfish -N disk:200M\n"
18237 #: ../fish/guestfish.pod:1032
18238 msgid "PROGRESS BARS"
18242 #: ../fish/guestfish.pod:1034
18244 "Some (not all) long-running commands send progress notification messages as "
18245 "they are running. Guestfish turns these messages into progress bars."
18249 #: ../fish/guestfish.pod:1038
18251 "When a command that supports progress bars takes longer than two seconds to "
18252 "run, and if progress bars are enabled, then you will see one appearing below "
18257 #: ../fish/guestfish.pod:1042
18260 " ><fs> copy-size /large-file /another-file 2048M\n"
18261 " / 10% [#####-----------------------------------------] 00:30\n"
18266 #: ../fish/guestfish.pod:1045
18268 "The spinner on the left hand side moves round once for every progress "
18269 "notification received from the backend. This is a (reasonably) golden "
18270 "assurance that the command is \"doing something\" even if the progress bar "
18271 "is not moving, because the command is able to send the progress "
18272 "notifications. When the bar reaches 100% and the command finishes, the "
18273 "spinner disappears."
18277 #: ../fish/guestfish.pod:1052
18279 "Progress bars are enabled by default when guestfish is used interactively. "
18280 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18281 "and you can disable them completely using I<--no-progress-bars>."
18285 #: ../fish/guestfish.pod:1057
18286 msgid "GUESTFISH COMMANDS"
18290 #: ../fish/guestfish.pod:1059
18292 "The commands in this section are guestfish convenience commands, in other "
18293 "words, they are not part of the L<guestfs(3)> API."
18297 #: ../fish/guestfish.pod:1062
18302 #: ../fish/guestfish.pod:1064
18311 #: ../fish/guestfish.pod:1067
18312 msgid "Without any parameter, this provides general help."
18316 #: ../fish/guestfish.pod:1069
18317 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18321 #: ../fish/guestfish.pod:1071
18322 msgid "quit | exit"
18326 #: ../fish/guestfish.pod:1073
18327 msgid "This exits guestfish. You can also use C<^D> key."
18331 #: ../fish/guestfish.pod:1075
18332 msgid "@FISH_COMMANDS@"
18336 #: ../fish/guestfish.pod:1077
18341 #: ../fish/guestfish.pod:1079 ../src/guestfs.pod:1474
18346 #: ../fish/guestfish.pod:1083
18348 "guestfish returns 0 if the commands completed without error, or 1 if there "
18353 #: ../fish/guestfish.pod:1090
18358 #: ../fish/guestfish.pod:1092
18360 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18365 #: ../fish/guestfish.pod:1095 ../src/guestfs.pod:3062
18366 msgid "FEBOOTSTRAP_KERNEL"
18370 #: ../fish/guestfish.pod:1097 ../src/guestfs.pod:3064
18371 msgid "FEBOOTSTRAP_MODULES"
18375 #: ../fish/guestfish.pod:1099 ../src/guestfs.pod:3066
18377 "These two environment variables allow the kernel that libguestfs uses in the "
18378 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
18379 "most recent host kernel is chosen. For more information about kernel "
18380 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
18381 "available in febootstrap E<ge> 3.8."
18385 #: ../fish/guestfish.pod:1105
18386 msgid "GUESTFISH_DISPLAY_IMAGE"
18390 #: ../fish/guestfish.pod:1107
18392 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
18393 "If not set, it uses L<display(1)>."
18397 #: ../fish/guestfish.pod:1110
18398 msgid "GUESTFISH_PID"
18402 #: ../fish/guestfish.pod:1112
18404 "Used with the I<--remote> option to specify the remote guestfish process to "
18405 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18409 #: ../fish/guestfish.pod:1116
18414 #: ../fish/guestfish.pod:1118
18416 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18417 "not specified, the external L<hexedit(1)> program is used."
18421 #: ../fish/guestfish.pod:1122
18426 #: ../fish/guestfish.pod:1124
18428 "If compiled with GNU readline support, various files in the home directory "
18429 "can be used. See L</FILES>."
18433 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3072
18434 msgid "LIBGUESTFS_APPEND"
18438 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3074
18439 msgid "Pass additional options to the guest kernel."
18443 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3076
18444 msgid "LIBGUESTFS_DEBUG"
18448 #: ../fish/guestfish.pod:1133
18450 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18451 "effect as using the B<-v> option."
18455 #: ../fish/guestfish.pod:1136 ../src/guestfs.pod:3081
18456 msgid "LIBGUESTFS_MEMSIZE"
18460 #: ../fish/guestfish.pod:1138 ../src/guestfs.pod:3083
18462 "Set the memory allocated to the qemu process, in megabytes. For example:"
18466 #: ../fish/guestfish.pod:1141 ../src/guestfs.pod:3086
18469 " LIBGUESTFS_MEMSIZE=700\n"
18474 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3088
18475 msgid "LIBGUESTFS_PATH"
18479 #: ../fish/guestfish.pod:1145
18481 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18482 "the discussion of paths in L<guestfs(3)>."
18486 #: ../fish/guestfish.pod:1148 ../src/guestfs.pod:3093
18487 msgid "LIBGUESTFS_QEMU"
18491 #: ../fish/guestfish.pod:1150 ../src/guestfs.pod:3095
18493 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
18494 "which was found at compile time by the configure script is used."
18498 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3101
18499 msgid "LIBGUESTFS_TRACE"
18503 #: ../fish/guestfish.pod:1156
18504 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18508 #: ../fish/guestfish.pod:1158
18513 #: ../fish/guestfish.pod:1160
18515 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18520 #: ../fish/guestfish.pod:1163 ../src/guestfs.pod:3106
18525 #: ../fish/guestfish.pod:1165 ../src/guestfs.pod:3108
18527 "Location of temporary directory, defaults to C</tmp> except for the cached "
18528 "supermin appliance which defaults to C</var/tmp>."
18532 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3111
18534 "If libguestfs was compiled to use the supermin appliance then the real "
18535 "appliance is cached in this directory, shared between all handles belonging "
18536 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
18537 "use in case C</var/tmp> is not large enough."
18541 #: ../fish/guestfish.pod:1176 ../fuse/guestmount.pod:288
18542 #: ../rescue/virt-rescue.pod:269
18547 #: ../fish/guestfish.pod:1180 ../fuse/guestmount.pod:292
18548 #: ../rescue/virt-rescue.pod:273
18549 msgid "$HOME/.libguestfs-tools.rc"
18553 #: ../fish/guestfish.pod:1182 ../fuse/guestmount.pod:294
18554 #: ../rescue/virt-rescue.pod:275
18555 msgid "/etc/libguestfs-tools.conf"
18559 #: ../fish/guestfish.pod:1184 ../fuse/guestmount.pod:296
18560 #: ../rescue/virt-rescue.pod:277
18562 "This configuration file controls the default read-only or read-write mode "
18563 "(I<--ro> or I<--rw>)."
18567 #: ../fish/guestfish.pod:1187
18568 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
18572 #: ../fish/guestfish.pod:1189
18573 msgid "$HOME/.guestfish"
18577 #: ../fish/guestfish.pod:1191
18579 "If compiled with GNU readline support, then the command history is saved in "
18584 #: ../fish/guestfish.pod:1194
18585 msgid "$HOME/.inputrc"
18589 #: ../fish/guestfish.pod:1196
18590 msgid "/etc/inputrc"
18594 #: ../fish/guestfish.pod:1198
18596 "If compiled with GNU readline support, then these files can be used to "
18597 "configure readline. For further information, please see L<readline(3)/"
18598 "INITIALIZATION FILE>."
18602 #: ../fish/guestfish.pod:1202
18603 msgid "To write rules which only apply to guestfish, use:"
18607 #: ../fish/guestfish.pod:1204
18617 #: ../fish/guestfish.pod:1208
18619 "Variables that you can set in inputrc that change the behaviour of guestfish "
18620 "in useful ways include:"
18624 #: ../fish/guestfish.pod:1213
18625 msgid "completion-ignore-case (default: on)"
18629 #: ../fish/guestfish.pod:1215
18631 "By default, guestfish will ignore case when tab-completing paths on the "
18636 #: ../fish/guestfish.pod:1218
18639 " set completion-ignore-case off\n"
18644 #: ../fish/guestfish.pod:1220
18645 msgid "to make guestfish case sensitive."
18649 #: ../fish/guestfish.pod:1224
18654 #: ../fish/guestfish.pod:1226
18655 msgid "test2.img (etc)"
18659 #: ../fish/guestfish.pod:1228
18661 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18662 "will be created in the file C<test1.img> in the current directory. The "
18663 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18664 "the same name will be overwritten."
18668 #: ../fish/guestfish.pod:1237
18670 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
18671 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
18672 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
18673 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
18674 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
18675 ">, L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
18679 #: ../fish/guestfish.pod:1266 ../src/guestfs.pod:3197
18680 #: ../test-tool/libguestfs-test-tool.pod:112
18681 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18685 #: ../fish/virt-copy-in.pod:5
18687 "virt-copy-in - Copy files and directories into a virtual machine disk image."
18691 #: ../fish/virt-copy-in.pod:9
18694 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18699 #: ../fish/virt-copy-in.pod:11
18702 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18707 #: ../fish/virt-copy-in.pod:15
18709 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18710 "causing disk corruption. The virtual machine must be shut down before you "
18711 "use this command."
18715 #: ../fish/virt-copy-in.pod:21
18717 "C<virt-copy-in> copies files and directories from the local disk into a "
18718 "virtual machine disk image or named libvirt domain."
18722 #: ../fish/virt-copy-in.pod:24
18724 "You can give one of more filenames and directories on the command line. "
18725 "Directories are copied in recursively. The final parameter must be the "
18726 "destination directory in the disk image which must be an absolute path "
18727 "starting with a C</> character."
18731 #: ../fish/virt-copy-in.pod:33
18734 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18739 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18740 msgid "Upload a home directory to a guest:"
18744 #: ../fish/virt-copy-in.pod:37
18747 " virt-copy-in -d MyGuest skel /home\n"
18752 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
18753 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18754 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18758 #: ../fish/virt-copy-in.pod:41
18760 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18761 "> C<copy-in> command. For anything more complex than a trivial copy, you "
18762 "are probably better off using guestfish directly."
18766 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
18767 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18769 "Since the shell script just passes options straight to guestfish, read "
18770 "L<guestfish(1)> to see the full list of options."
18774 #: ../fish/virt-copy-in.pod:52
18776 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18777 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18781 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
18782 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18783 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18787 #: ../fish/virt-copy-out.pod:5
18789 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18794 #: ../fish/virt-copy-out.pod:9
18797 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18802 #: ../fish/virt-copy-out.pod:11
18805 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18810 #: ../fish/virt-copy-out.pod:15
18812 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18813 "image or named libvirt domain."
18817 #: ../fish/virt-copy-out.pod:18
18819 "You can give one of more filenames and directories on the command line. "
18820 "Directories are copied out recursively."
18824 #: ../fish/virt-copy-out.pod:23
18825 msgid "Download the home directories from a virtual machine:"
18829 #: ../fish/virt-copy-out.pod:25
18833 " virt-copy-out -d MyGuest /home homes\n"
18838 #: ../fish/virt-copy-out.pod:30
18840 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18841 "> C<copy-out> command. For anything more complex than a trivial copy, you "
18842 "are probably better off using guestfish directly."
18846 #: ../fish/virt-copy-out.pod:41
18848 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
18849 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18853 #: ../fish/virt-tar-in.pod:5
18854 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18858 #: ../fish/virt-tar-in.pod:9
18861 " virt-tar-in -a disk.img data.tar /destination\n"
18866 #: ../fish/virt-tar-in.pod:11
18869 " virt-tar-in -d domain data.tar /destination\n"
18874 #: ../fish/virt-tar-in.pod:13
18877 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18882 #: ../fish/virt-tar-in.pod:17
18884 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18885 "causing disk corruption. The virtual machine must be shut down before you "
18886 "use this command."
18890 #: ../fish/virt-tar-in.pod:23
18892 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18893 "image or named libvirt domain."
18897 #: ../fish/virt-tar-in.pod:26
18899 "The first parameter is the tar file. Use C<-> to read the tar file from "
18900 "standard input. The second parameter is the absolute target directory to "
18905 #: ../fish/virt-tar-in.pod:34
18908 " virt-tar-in -d MyGuest homes.tar /home\n"
18913 #: ../fish/virt-tar-in.pod:38
18915 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18916 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
18917 "probably better off using guestfish directly."
18921 #: ../fish/virt-tar-in.pod:49
18923 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18924 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
18929 #: ../fish/virt-tar-out.pod:5
18931 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
18935 #: ../fish/virt-tar-out.pod:9
18938 " virt-tar-out -a disk.img /dir files.tar\n"
18943 #: ../fish/virt-tar-out.pod:11
18946 " virt-tar-out -d domain /dir files.tar\n"
18951 #: ../fish/virt-tar-out.pod:13
18954 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
18959 #: ../fish/virt-tar-out.pod:17
18961 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
18965 #: ../fish/virt-tar-out.pod:20
18967 "The first parameter is the absolute path of the virtual machine directory. "
18968 "The second parameter is the tar file to write. Use C<-> to write to "
18973 #: ../fish/virt-tar-out.pod:26
18974 msgid "Download the home directories from a guest:"
18978 #: ../fish/virt-tar-out.pod:28
18981 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
18986 #: ../fish/virt-tar-out.pod:32
18988 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18989 "> C<tar-out> command. For anything more complex than a trivial copy, you "
18990 "are probably better off using guestfish directly."
18994 #: ../fish/virt-tar-out.pod:43
18996 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18997 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
19001 #: ../fuse/guestmount.pod:5
19003 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
19007 #: ../fuse/guestmount.pod:9
19010 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
19015 #: ../fuse/guestmount.pod:11
19018 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
19023 #: ../fuse/guestmount.pod:13
19026 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
19031 #: ../fuse/guestmount.pod:17
19033 "You must I<not> use C<guestmount> in read-write mode on live virtual "
19034 "machines. If you do this, you risk disk corruption in the VM."
19038 #: ../fuse/guestmount.pod:22
19040 "The guestmount program can be used to mount virtual machine filesystems and "
19041 "other disk images on the host. It uses libguestfs for access to the guest "
19042 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
19043 "a mountable device."
19047 #: ../fuse/guestmount.pod:27
19049 "Along with other options, you have to give at least one device (I<-a> "
19050 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
19051 "option) or use the I<-i> inspection option. How this works is better "
19052 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
19057 #: ../fuse/guestmount.pod:33
19059 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
19060 "by you, and the filesystem will not be visible to any other users unless you "
19061 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
19062 "the filesystem, use the C<fusermount -u> command."
19066 #: ../fuse/guestmount.pod:41
19068 "For a typical Windows guest which has its main filesystem on the first "
19073 #: ../fuse/guestmount.pod:44
19076 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
19081 #: ../fuse/guestmount.pod:46
19083 "For a typical Linux guest which has a /boot filesystem on the first "
19084 "partition, and the root filesystem on a logical volume:"
19088 #: ../fuse/guestmount.pod:49
19091 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
19096 #: ../fuse/guestmount.pod:51
19097 msgid "To get libguestfs to detect guest mountpoints for you:"
19101 #: ../fuse/guestmount.pod:53
19104 " guestmount -a guest.img -i --ro /mnt\n"
19109 #: ../fuse/guestmount.pod:55
19110 msgid "For a libvirt guest called \"Guest\" you could do:"
19114 #: ../fuse/guestmount.pod:57
19117 " guestmount -d Guest -i --ro /mnt\n"
19122 #: ../fuse/guestmount.pod:59
19124 "If you don't know what filesystems are contained in a guest or disk image, "
19125 "use L<virt-filesystems(1)> first:"
19129 #: ../fuse/guestmount.pod:62
19132 " virt-filesystems MyGuest\n"
19137 #: ../fuse/guestmount.pod:64
19139 "If you want to trace the libguestfs calls but without excessive debugging "
19140 "information, we recommend:"
19144 #: ../fuse/guestmount.pod:67
19147 " guestmount [...] --trace /mnt\n"
19152 #: ../fuse/guestmount.pod:69
19153 msgid "If you want to debug the program, we recommend:"
19157 #: ../fuse/guestmount.pod:71
19160 " guestmount [...] --trace --verbose /mnt\n"
19165 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
19166 #: ../resize/virt-resize.pod:511
19171 #: ../fuse/guestmount.pod:75
19172 msgid "Other users cannot see the filesystem by default"
19176 #: ../fuse/guestmount.pod:77
19178 "If you mount a filesystem as one user (eg. root), then other users will not "
19179 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
19180 "option when mounting:"
19184 #: ../fuse/guestmount.pod:81
19187 " sudo guestmount [...] -o allow_other /mnt\n"
19192 #: ../fuse/guestmount.pod:91
19193 msgid "Add a block device or virtual machine image."
19197 #: ../fuse/guestmount.pod:114
19198 msgid "B<--dir-cache-timeout N>"
19202 #: ../fuse/guestmount.pod:116
19204 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
19205 "seconds. The readdir cache [actually, there are several semi-independent "
19206 "caches] is populated after a readdir(2) call with the stat and extended "
19207 "attributes of the files in the directory, in anticipation that they will be "
19208 "requested soon after."
19212 #: ../fuse/guestmount.pod:122
19214 "There is also a different attribute cache implemented by FUSE (see the FUSE "
19215 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
19216 "requests, only cache existing ones."
19220 #: ../fuse/guestmount.pod:142
19222 "If you have untrusted raw-format guest disk images, you should use this "
19223 "option to specify the disk format. This avoids a possible security problem "
19224 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
19225 "guestfs_add_drive_opts>."
19229 #: ../fuse/guestmount.pod:147
19230 msgid "B<--fuse-help>"
19234 #: ../fuse/guestmount.pod:149
19235 msgid "Display help on special FUSE options (see I<-o> below)."
19239 #: ../fuse/guestmount.pod:153
19240 msgid "Display brief help and exit."
19244 #: ../fuse/guestmount.pod:177
19246 "Mount the named partition or logical volume on the given mountpoint B<in the "
19247 "guest> (this has nothing to do with mountpoints in the host)."
19251 #: ../fuse/guestmount.pod:180
19253 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
19254 "something on C</>."
19258 #: ../fuse/guestmount.pod:197
19260 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
19261 "unmounted. If you specify this option, then we don't attempt to sync the "
19262 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
19266 #: ../fuse/guestmount.pod:202
19267 msgid "B<-o option>"
19271 #: ../fuse/guestmount.pod:204
19272 msgid "B<--option option>"
19276 #: ../fuse/guestmount.pod:206
19277 msgid "Pass extra options to FUSE."
19281 #: ../fuse/guestmount.pod:208
19283 "To get a list of all the extra options supported by FUSE, use the command "
19284 "below. Note that only the FUSE I<-o> options can be passed, and only some "
19285 "of them are a good idea."
19289 #: ../fuse/guestmount.pod:212
19292 " guestmount --fuse-help\n"
19297 #: ../fuse/guestmount.pod:214
19298 msgid "Some potentially useful FUSE options:"
19302 #: ../fuse/guestmount.pod:218
19303 msgid "B<-o allow_other>"
19307 #: ../fuse/guestmount.pod:220
19308 msgid "Allow other users to see the filesystem."
19312 #: ../fuse/guestmount.pod:222
19313 msgid "B<-o attr_timeout=N>"
19317 #: ../fuse/guestmount.pod:224
19318 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
19322 #: ../fuse/guestmount.pod:226
19323 msgid "B<-o kernel_cache>"
19327 #: ../fuse/guestmount.pod:228
19329 "Allow the kernel to cache files (reduces the number of reads that have to go "
19330 "through the L<guestfs(3)> API). This is generally a good idea if you can "
19331 "afford the extra memory usage."
19335 #: ../fuse/guestmount.pod:232
19336 msgid "B<-o uid=N> B<-o gid=N>"
19340 #: ../fuse/guestmount.pod:234
19342 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
19343 "the chosen values."
19347 #: ../fuse/guestmount.pod:243
19349 "Add devices and mount everything read-only. Also disallow writes and make "
19350 "the disk appear read-only to FUSE."
19354 #: ../fuse/guestmount.pod:246
19356 "This is highly recommended if you are not going to edit the guest disk. If "
19357 "the guest is running and this option is I<not> supplied, then there is a "
19358 "strong risk of disk corruption in the guest. We try to prevent this from "
19359 "happening, but it is not always possible."
19363 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
19364 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19368 #: ../fuse/guestmount.pod:255
19369 msgid "Enable SELinux support for the guest."
19373 #: ../fuse/guestmount.pod:261
19374 msgid "Enable verbose messages from underlying libguestfs."
19378 #: ../fuse/guestmount.pod:267
19379 msgid "Display the program version and exit."
19383 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299
19384 #: ../rescue/virt-rescue.pod:197 ../rescue/virt-rescue.pod:280
19385 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19389 #: ../fuse/guestmount.pod:280
19394 #: ../fuse/guestmount.pod:282
19395 msgid "Trace libguestfs calls and entry into each FUSE function."
19399 #: ../fuse/guestmount.pod:284
19400 msgid "This also stops the daemon from forking into the background."
19404 #: ../fuse/guestmount.pod:310
19406 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
19407 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
19412 #: ../fuse/guestmount.pod:325
19413 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
19417 #: ../inspector/virt-inspector.pod:5
19419 "virt-inspector - Display operating system version and other information "
19420 "about a virtual machine"
19424 #: ../inspector/virt-inspector.pod:9
19427 " virt-inspector [--options] -d domname\n"
19432 #: ../inspector/virt-inspector.pod:11
19435 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
19440 #: ../inspector/virt-inspector.pod:15
19443 " virt-inspector domname\n"
19448 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
19451 " virt-inspector disk.img [disk.img ...]\n"
19456 #: ../inspector/virt-inspector.pod:21
19458 "B<virt-inspector> examines a virtual machine or disk image and tries to "
19459 "determine the version of the operating system and other information about "
19460 "the virtual machine."
19464 #: ../inspector/virt-inspector.pod:25
19465 msgid "Virt-inspector produces XML output for feeding into other programs."
19469 #: ../inspector/virt-inspector.pod:27
19471 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
19472 "the libvirt domain (see: C<virsh list --all>)."
19476 #: ../inspector/virt-inspector.pod:30
19478 "You can also run virt-inspector directly on disk images from a single "
19479 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
19480 "has several block devices, in which case you should list several I<-a> "
19481 "options one after another, with the first corresponding to the guest's C</"
19482 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
19486 #: ../inspector/virt-inspector.pod:37
19488 "You can also run virt-inspector on install disks, live CDs, bootable USB "
19489 "keys and similar."
19493 #: ../inspector/virt-inspector.pod:40
19495 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
19496 "inspect several virtual machines, you have to run virt-inspector several "
19497 "times (for example, from a shell script for-loop)."
19501 #: ../inspector/virt-inspector.pod:45
19503 "Because virt-inspector needs direct access to guest images, it won't "
19504 "normally work over remote libvirt connections."
19508 #: ../inspector/virt-inspector.pod:48
19510 "All of the information available from virt-inspector is also available "
19511 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
19512 "The same information can also be fetched using guestfish or via libguestfs "
19513 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
19514 "WITH OTHER PROGRAMMING LANGUAGES>)."
19518 #: ../inspector/virt-inspector.pod:81
19520 "Libvirt is only used if you specify a C<domname> on the command line. If "
19521 "you specify guest block devices directly (I<-a>), then libvirt is not used "
19526 #: ../inspector/virt-inspector.pod:94
19528 "When prompting for keys and passphrases, virt-inspector normally turns "
19529 "echoing off so you cannot see what you are typing. If you are not worried "
19530 "about Tempest attacks and there is no one else in the room you can specify "
19531 "this flag to see what you are typing."
19535 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
19536 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
19537 #: ../tools/virt-win-reg.pl:144
19539 "Specify the format of disk images given on the command line. If this is "
19540 "omitted then the format is autodetected from the content of the disk image."
19544 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
19545 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
19546 #: ../tools/virt-win-reg.pl:148
19548 "If disk images are requested from libvirt, then this program asks libvirt "
19549 "for this information. In this case, the value of the format parameter is "
19554 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
19555 #: ../resize/virt-resize.pod:406 ../tools/virt-list-filesystems.pl:101
19556 #: ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151
19557 #: ../tools/virt-win-reg.pl:152
19559 "If working with untrusted raw-format guest disk images, you should ensure "
19560 "the format is always specified."
19564 #: ../inspector/virt-inspector.pod:139
19565 msgid "Previous versions of virt-inspector allowed you to write either:"
19569 #: ../inspector/virt-inspector.pod:145
19572 " virt-inspector guestname\n"
19577 #: ../inspector/virt-inspector.pod:153
19582 #: ../inspector/virt-inspector.pod:155
19584 "The virt-inspector XML is described precisely in a RELAX NG schema file "
19585 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
19586 "just an overview."
19590 #: ../inspector/virt-inspector.pod:159
19592 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
19593 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
19594 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
19595 "which is vanishingly rare in real world VMs."
19599 #: ../inspector/virt-inspector.pod:164
19600 msgid "E<lt>operatingsystemE<gt>"
19604 #: ../inspector/virt-inspector.pod:166
19606 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
19607 "describe the operating system, its architecture, the descriptive \"product "
19608 "name\" string, the type of OS and so on, as in this example:"
19612 #: ../inspector/virt-inspector.pod:170
19615 " <operatingsystems>\n"
19616 " <operatingsystem>\n"
19617 " <root>/dev/sda2</root>\n"
19618 " <name>windows</name>\n"
19619 " <arch>i386</arch>\n"
19620 " <distro>windows</distro>\n"
19621 " <product_name>Windows 7 Enterprise</product_name>\n"
19622 " <product_variant>Client</product_variant>\n"
19623 " <major_version>6</major_version>\n"
19624 " <minor_version>1</minor_version>\n"
19625 " <windows_systemroot>/Windows</windows_systemroot>\n"
19626 " <format>installed</format>\n"
19631 #: ../inspector/virt-inspector.pod:183
19633 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
19634 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
19635 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
19636 "architecture. The other fields are fairly self-explanatory, but because "
19637 "these fields are taken directly from the libguestfs inspection API you can "
19638 "find precise information from L<guestfs(3)/INSPECTION>."
19642 #: ../inspector/virt-inspector.pod:191
19644 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
19645 "of view of libguestfs (block devices may have completely different names "
19646 "inside the VM itself)."
19650 #: ../inspector/virt-inspector.pod:195
19651 msgid "E<lt>mountpointsE<gt>"
19655 #: ../inspector/virt-inspector.pod:197
19657 "Un*x-like guests typically have multiple filesystems which are mounted at "
19658 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
19659 "element which looks like this:"
19663 #: ../inspector/virt-inspector.pod:201
19666 " <operatingsystems>\n"
19667 " <operatingsystem>\n"
19670 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19671 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19672 " </mountpoints>\n"
19677 #: ../inspector/virt-inspector.pod:209
19679 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19680 "and may have completely different names inside the guest. Only mountable "
19681 "filesystems appear in this list, not things like swap devices."
19685 #: ../inspector/virt-inspector.pod:214
19686 msgid "E<lt>filesystemsE<gt>"
19690 #: ../inspector/virt-inspector.pod:216
19692 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19693 "filesystems belonging to the guest, including swap and empty partitions. "
19694 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19695 "this OS or shared with this OS and other OSes)."
19699 #: ../inspector/virt-inspector.pod:222
19700 msgid "You might see something like this:"
19704 #: ../inspector/virt-inspector.pod:224
19707 " <operatingsystems>\n"
19708 " <operatingsystem>\n"
19711 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19712 " <type>ext4</type>\n"
19713 " <label>Fedora-13-x86_64</label>\n"
19714 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19720 #: ../inspector/virt-inspector.pod:234
19722 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19723 "the label, and the UUID."
19727 #: ../inspector/virt-inspector.pod:237
19728 msgid "E<lt>applicationsE<gt>"
19732 #: ../inspector/virt-inspector.pod:239
19734 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19735 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19740 #: ../inspector/virt-inspector.pod:243
19742 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19743 "Typical values would be C<rpm> and C<deb>."
19747 #: ../inspector/virt-inspector.pod:246
19749 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19750 "Typical values include C<yum>, C<up2date> and C<apt>"
19754 #: ../inspector/virt-inspector.pod:249
19755 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19759 #: ../inspector/virt-inspector.pod:252
19762 " <operatingsystems>\n"
19763 " <operatingsystem>\n"
19765 " <applications>\n"
19767 " <name>coreutils</name>\n"
19768 " <version>8.5</version>\n"
19769 " <release>1</release>\n"
19770 " </application>\n"
19775 #: ../inspector/virt-inspector.pod:262
19777 "The version and release fields may not be available for some types guests. "
19778 "Other fields are possible, see L<guestfs(3)/"
19779 "guestfs_inspect_list_applications>."
19783 #: ../inspector/virt-inspector.pod:266
19784 msgid "E<lt>drive_mappingsE<gt>"
19788 #: ../inspector/virt-inspector.pod:268
19790 "For operating systems like Windows which use drive letters, virt-inspector "
19791 "is able to find out how drive letters map to filesystems."
19795 #: ../inspector/virt-inspector.pod:272
19798 " <operatingsystems>\n"
19799 " <operatingsystem>\n"
19801 " <drive_mappings>\n"
19802 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19803 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19804 " </drive_mappings>\n"
19809 #: ../inspector/virt-inspector.pod:280
19811 "In the example above, drive C maps to the filesystem on the second partition "
19812 "on the first disk, and drive E maps to the filesystem on the first partition "
19813 "on the second disk."
19817 #: ../inspector/virt-inspector.pod:284
19819 "Note that this only covers permanent local filesystem mappings, not things "
19820 "like network shares. Furthermore NTFS volume mount points may not be listed "
19825 #: ../inspector/virt-inspector.pod:288
19826 msgid "E<lt>iconE<gt>"
19830 #: ../inspector/virt-inspector.pod:290
19832 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19833 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19834 "very large and high quality."
19838 #: ../inspector/virt-inspector.pod:294
19841 " <operatingsystems>\n"
19842 " <operatingsystem>\n"
19845 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19846 " [... many lines of base64 data ...]\n"
19852 #: ../inspector/virt-inspector.pod:302
19854 "To display the icon, you have to extract it and convert the base64 data back "
19855 "to a binary file. Use an XPath query or simply an editor to extract the "
19856 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19861 #: ../inspector/virt-inspector.pod:307
19864 " base64 -i -d < icon.data > icon.png\n"
19869 #: ../inspector/virt-inspector.pod:309
19870 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19874 #: ../inspector/virt-inspector.pod:311
19876 "Virt-inspector can detect some operating system installers on install disks, "
19877 "live CDs, bootable USB keys and more."
19881 #: ../inspector/virt-inspector.pod:314
19883 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19884 "fields may be present to indicate a live CD, network installer, or one part "
19885 "of a multipart CD. For example:"
19889 #: ../inspector/virt-inspector.pod:318
19892 " <operatingsystems>\n"
19893 " <operatingsystem>\n"
19894 " <root>/dev/sda</root>\n"
19895 " <name>linux</name>\n"
19896 " <arch>i386</arch>\n"
19897 " <distro>ubuntu</distro>\n"
19898 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
19899 " <major_version>10</major_version>\n"
19900 " <minor_version>10</minor_version>\n"
19901 " <format>installer</format>\n"
19907 #: ../inspector/virt-inspector.pod:330
19908 msgid "USING XPATH"
19912 #: ../inspector/virt-inspector.pod:332
19914 "You can use the XPath query language to select parts of the XML. We "
19915 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
19919 #: ../inspector/virt-inspector.pod:338
19922 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
19924 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19925 " <type>ext4</type>\n"
19931 #: ../inspector/virt-inspector.pod:344
19934 " $ virt-inspector -d Guest | \\\n"
19935 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
19941 #: ../inspector/virt-inspector.pod:348
19944 " $ virt-inspector -d Guest | \\\n"
19945 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
19946 " [displays the guest icon, if there is one]\n"
19951 #: ../inspector/virt-inspector.pod:359
19952 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
19956 #: ../inspector/virt-inspector.pod:361
19958 "Early versions of libguestfs shipped with a different virt-inspector program "
19959 "written in Perl (the current version is written in C). The XML output of "
19960 "the Perl virt-inspector was different and it could also output in other "
19961 "formats like text."
19965 #: ../inspector/virt-inspector.pod:366
19967 "The old virt-inspector is no longer supported or shipped with libguestfs."
19971 #: ../inspector/virt-inspector.pod:369
19973 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
19974 "versions of virt-inspector with different names:"
19978 #: ../inspector/virt-inspector.pod:372
19981 " virt-inspector Old Perl version.\n"
19982 " virt-inspector2 New C version.\n"
19987 #: ../inspector/virt-inspector.pod:382
19989 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
19990 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
19994 #: ../inspector/virt-inspector.pod:399
19995 msgid "Matthew Booth L<mbooth@redhat.com>"
19999 #: ../java/examples/guestfs-java.pod:5
20000 msgid "guestfs-java - How to use libguestfs from Java"
20004 #: ../java/examples/guestfs-java.pod:9
20007 " import com.redhat.et.libguestfs.*;\n"
20012 #: ../java/examples/guestfs-java.pod:11
20015 " GuestFS g = new GuestFS ();\n"
20016 " g.add_drive_opts (\"disk.img\", null);\n"
20022 #: ../java/examples/guestfs-java.pod:17
20024 "This manual page documents how to call libguestfs from the Java programming "
20025 "language. This page just documents the differences from the C API and gives "
20026 "some examples. If you are not familiar with using libguestfs, you also need "
20027 "to read L<guestfs(3)>."
20031 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
20032 msgid "CLOSING THE HANDLE"
20036 #: ../java/examples/guestfs-java.pod:24
20038 "The handle is closed when it is reaped by the garbage collector. Because "
20039 "libguestfs handles include a lot of state, it is also possible to close (and "
20040 "hence free) them explicitly by calling the C<close> method."
20044 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
20045 #: ../python/examples/guestfs-python.pod:21
20046 #: ../ruby/examples/guestfs-ruby.pod:22
20051 #: ../java/examples/guestfs-java.pod:31
20053 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
20054 "exception. This has a single parameter which is the error message (a "
20059 #: ../java/examples/guestfs-java.pod:35
20060 msgid "Calling any method on a closed handle raises the same exception."
20064 #: ../java/examples/guestfs-java.pod:47
20066 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)"
20067 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20068 "libguestfs.org/>, L<http://caml.inria.fr/>."
20072 #: ../java/examples/guestfs-java.pod:63 ../perl/examples/guestfs-perl.pod:57
20073 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20077 #: ../ocaml/examples/guestfs-ocaml.pod:5
20078 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
20082 #: ../ocaml/examples/guestfs-ocaml.pod:9
20083 msgid "Module style:"
20087 #: ../ocaml/examples/guestfs-ocaml.pod:11
20090 " let g = Guestfs.create () in\n"
20091 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20092 " Guestfs.launch g;\n"
20097 #: ../ocaml/examples/guestfs-ocaml.pod:15
20098 msgid "Object-oriented style:"
20102 #: ../ocaml/examples/guestfs-ocaml.pod:17
20105 " let g = new Guestfs.guestfs () in\n"
20106 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20112 #: ../ocaml/examples/guestfs-ocaml.pod:21
20115 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
20117 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
20122 #: ../ocaml/examples/guestfs-ocaml.pod:27
20124 "This manual page documents how to call libguestfs from the OCaml programming "
20125 "language. This page just documents the differences from the C API and gives "
20126 "some examples. If you are not familiar with using libguestfs, you also need "
20127 "to read L<guestfs(3)>."
20131 #: ../ocaml/examples/guestfs-ocaml.pod:32
20132 msgid "PROGRAMMING STYLES"
20136 #: ../ocaml/examples/guestfs-ocaml.pod:34
20138 "There are two different programming styles supported by the OCaml bindings. "
20139 "You can use a module style, with each C function mapped to an OCaml function:"
20143 #: ../ocaml/examples/guestfs-ocaml.pod:38
20146 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
20151 #: ../ocaml/examples/guestfs-ocaml.pod:40
20156 #: ../ocaml/examples/guestfs-ocaml.pod:42
20159 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
20164 #: ../ocaml/examples/guestfs-ocaml.pod:44
20166 "Alternately you can use an object-oriented style, calling methods on the "
20167 "class C<Guestfs.guestfs>:"
20171 #: ../ocaml/examples/guestfs-ocaml.pod:47
20174 " method set_verbose : bool -> unit\n"
20179 #: ../ocaml/examples/guestfs-ocaml.pod:49
20181 "The object-oriented style is usually briefer, and the minor performance "
20182 "penalty isn't noticable in the general overhead of performing libguestfs "
20187 #: ../ocaml/examples/guestfs-ocaml.pod:55
20189 "The handle is closed when it is reaped by the garbage collector. Because "
20190 "libguestfs handles include a lot of state, it is also possible to close (and "
20191 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
20196 #: ../ocaml/examples/guestfs-ocaml.pod:62
20198 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
20199 "exception. This has a single parameter which is the error message (a "
20204 #: ../ocaml/examples/guestfs-ocaml.pod:66
20206 "Calling any function/method on a closed handle raises C<Guestfs."
20207 "Handle_closed>. The single parameter is the name of the function that you "
20212 #: ../ocaml/examples/guestfs-ocaml.pod:80
20214 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-perl(3)"
20215 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20216 "libguestfs.org/>, L<http://caml.inria.fr/>."
20220 #: ../perl/examples/guestfs-perl.pod:5
20221 msgid "guestfs-perl - How to use libguestfs from Perl"
20225 #: ../perl/examples/guestfs-perl.pod:9
20228 " use Sys::Guestfs;\n"
20233 #: ../perl/examples/guestfs-perl.pod:11
20236 " my $h = Sys::Guestfs->new ();\n"
20237 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
20238 " $h->launch ();\n"
20239 " $h->mount_options ('', '/dev/sda1', '/');\n"
20240 " $h->touch ('/hello');\n"
20246 #: ../perl/examples/guestfs-perl.pod:20
20248 "This manual page documents how to call libguestfs from the Perl programming "
20249 "language. This page just documents the differences from the C API and gives "
20250 "some examples. If you are not familiar with using libguestfs, you also need "
20251 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
20255 #: ../perl/examples/guestfs-perl.pod:26
20260 #: ../perl/examples/guestfs-perl.pod:28
20262 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
20267 #: ../perl/examples/guestfs-perl.pod:41
20269 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)"
20270 ">, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20271 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20275 #: ../python/examples/guestfs-python.pod:5
20276 msgid "guestfs-python - How to use libguestfs from Python"
20280 #: ../python/examples/guestfs-python.pod:9
20283 " import guestfs\n"
20284 " g = guestfs.GuestFS ()\n"
20285 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
20291 #: ../python/examples/guestfs-python.pod:16
20293 "This manual page documents how to call libguestfs from the Python "
20294 "programming language. This page just documents the differences from the C "
20295 "API and gives some examples. If you are not familiar with using libguestfs, "
20296 "you also need to read L<guestfs(3)>."
20300 #: ../python/examples/guestfs-python.pod:23
20302 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
20303 "single string argument which is the error message."
20307 #: ../python/examples/guestfs-python.pod:26
20308 msgid "MORE DOCUMENTATION"
20312 #: ../python/examples/guestfs-python.pod:28
20317 #: ../python/examples/guestfs-python.pod:30
20321 " >>> import guestfs\n"
20322 " >>> help (guestfs)\n"
20327 #: ../python/examples/guestfs-python.pod:44
20329 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
20330 ">, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20331 "libguestfs.org/>."
20335 #: ../rescue/virt-rescue.pod:5
20336 msgid "virt-rescue - Run a rescue shell on a virtual machine"
20340 #: ../rescue/virt-rescue.pod:9
20343 " virt-rescue [--options] -d domname\n"
20348 #: ../rescue/virt-rescue.pod:11
20351 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
20356 #: ../rescue/virt-rescue.pod:15
20359 " virt-rescue [--options] domname\n"
20364 #: ../rescue/virt-rescue.pod:17
20367 " virt-rescue [--options] disk.img [disk.img ...]\n"
20372 #: ../rescue/virt-rescue.pod:21
20374 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
20375 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
20376 "you from doing this, but doesn't catch all cases."
20380 #: ../rescue/virt-rescue.pod:25
20382 "However if you use the I<--ro> (read only) option, then you can attach a "
20383 "shell to a live virtual machine. The results might be strange or "
20384 "inconsistent at times but you won't get disk corruption."
20388 #: ../rescue/virt-rescue.pod:31
20390 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
20391 "need for a CD. virt-rescue gives you a rescue shell and some simple "
20392 "recovery tools which you can use to examine or rescue a virtual machine or "
20397 #: ../rescue/virt-rescue.pod:36
20399 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
20400 "on disk image(s):"
20404 #: ../rescue/virt-rescue.pod:39
20407 " virt-rescue -d GuestName\n"
20412 #: ../rescue/virt-rescue.pod:41
20415 " virt-rescue --ro -a /path/to/disk.img\n"
20420 #: ../rescue/virt-rescue.pod:43
20423 " virt-rescue -a /dev/sdc\n"
20428 #: ../rescue/virt-rescue.pod:45
20429 msgid "For live VMs you I<must> use the --ro option."
20433 #: ../rescue/virt-rescue.pod:47
20435 "When you run virt-rescue on a virtual machine or disk image, you are placed "
20436 "in an interactive bash shell where you can use many ordinary Linux "
20437 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
20438 "appliance. You must mount the virtual machine's filesystems by hand. There "
20439 "is an empty directory called C</sysroot> where you can mount filesystems."
20443 #: ../rescue/virt-rescue.pod:54
20445 "In the example below, we list logical volumes, then choose one to mount "
20446 "under C</sysroot>:"
20450 #: ../rescue/virt-rescue.pod:57
20454 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
20455 " lv_root vg_f11x64 -wi-a- 8.83G\n"
20456 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
20457 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
20458 " ><rescue> ls /sysroot\n"
20463 #: ../rescue/virt-rescue.pod:64
20465 "If you don't know what filesystems are available on the virtual machine then "
20466 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
20470 #: ../rescue/virt-rescue.pod:70
20472 "Virt-rescue can be used on I<any> disk image file or device, not just a "
20473 "virtual machine. For example you can use it on a blank file if you want to "
20474 "partition that file (although we would recommend using L<guestfish(1)> "
20475 "instead as it is more suitable for this purpose). You can even use virt-"
20476 "rescue on things like SD cards."
20480 #: ../rescue/virt-rescue.pod:76
20482 "Virt-rescue does not require root. You only need to run it as root if you "
20483 "need root to open the disk image."
20487 #: ../rescue/virt-rescue.pod:79
20489 "This tool is just designed for quick interactive hacking on a virtual "
20490 "machine. For more structured access to a virtual machine disk image, you "
20491 "should use L<guestfs(3)>. To get a structured shell that you can use to "
20492 "make scripted changes to guests, use L<guestfish(1)>."
20496 #: ../rescue/virt-rescue.pod:103
20497 msgid "B<--append kernelopts>"
20501 #: ../rescue/virt-rescue.pod:105
20502 msgid "Pass additional options to the rescue kernel."
20506 #: ../rescue/virt-rescue.pod:135
20509 " virt-rescue --format=raw -a disk.img\n"
20514 #: ../rescue/virt-rescue.pod:139
20517 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
20522 #: ../rescue/virt-rescue.pod:148
20527 #: ../rescue/virt-rescue.pod:150
20528 msgid "B<--memsize MB>"
20532 #: ../rescue/virt-rescue.pod:152
20534 "Change the amount of memory allocated to the rescue system. The default is "
20535 "set by libguestfs and is small but adequate for running system tools. The "
20536 "occasional program might need more memory. The parameter is specified in "
20541 #: ../rescue/virt-rescue.pod:157
20542 msgid "B<--network>"
20546 #: ../rescue/virt-rescue.pod:159
20547 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
20551 #: ../rescue/virt-rescue.pod:165
20552 msgid "Open the image read-only."
20556 #: ../rescue/virt-rescue.pod:175
20558 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
20559 "SELINUX> before using this option."
20563 #: ../rescue/virt-rescue.pod:194
20565 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
20566 "are done read-write."
20570 #: ../rescue/virt-rescue.pod:207
20571 msgid "Previous versions of virt-rescue allowed you to write either:"
20575 #: ../rescue/virt-rescue.pod:209
20578 " virt-rescue disk.img [disk.img ...]\n"
20583 #: ../rescue/virt-rescue.pod:213
20586 " virt-rescue guestname\n"
20591 #: ../rescue/virt-rescue.pod:221
20596 #: ../rescue/virt-rescue.pod:223
20598 "Adding the I<--network> option enables QEMU user networking in the rescue "
20599 "appliance. There are some differences between user networking and ordinary "
20604 #: ../rescue/virt-rescue.pod:229
20605 msgid "ping does not work"
20609 #: ../rescue/virt-rescue.pod:231
20611 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
20612 "send the ping packets, and because virt-rescue must be able to run as non-"
20613 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
20614 "The ping command will appear to resolve addresses but will not be able to "
20615 "send or receive any packets. This does not mean that the network is not "
20620 #: ../rescue/virt-rescue.pod:238
20621 msgid "cannot receive connections"
20625 #: ../rescue/virt-rescue.pod:240
20626 msgid "QEMU user networking cannot receive incoming connections."
20630 #: ../rescue/virt-rescue.pod:242
20631 msgid "making TCP connections"
20635 #: ../rescue/virt-rescue.pod:244
20637 "The virt-rescue appliance needs to be small and so does not include many "
20638 "network tools. In particular there is no L<telnet(1)> command. You can "
20639 "make TCP connections from the shell using the magical C</dev/tcp/"
20640 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
20644 #: ../rescue/virt-rescue.pod:249
20647 " exec 3<>/dev/tcp/redhat.com/80\n"
20648 " echo \"GET /\" >&3\n"
20654 #: ../rescue/virt-rescue.pod:253
20655 msgid "See L<bash(1)> for more details."
20659 #: ../rescue/virt-rescue.pod:259
20661 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
20662 "ENVIRONMENT VARIABLES> for the complete list."
20666 #: ../rescue/virt-rescue.pod:286
20668 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
20669 "libguestfs.org/>."
20673 #: ../resize/virt-resize.pod:5
20674 msgid "virt-resize - Resize a virtual machine disk"
20678 #: ../resize/virt-resize.pod:9
20681 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20682 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20683 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20688 #: ../resize/virt-resize.pod:15
20690 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20691 "larger or smaller overall, and resizing or deleting any partitions contained "
20696 #: ../resize/virt-resize.pod:19
20698 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20699 "not> be used on live virtual machines - for consistent results, shut the "
20700 "virtual machine down before resizing it."
20704 #: ../resize/virt-resize.pod:23
20706 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20707 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20711 #: ../resize/virt-resize.pod:31 ../src/guestfs.pod:469 ../src/guestfs.pod:1257
20712 #: ../src/guestfs.pod:1395 ../src/guestfs.pod:2558
20717 #: ../resize/virt-resize.pod:33
20719 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20720 "fill the extra 5GB of space."
20724 #: ../resize/virt-resize.pod:36
20727 " virt-filesystems --long -h --all -a olddisk\n"
20732 #: ../resize/virt-resize.pod:38
20735 " truncate -r olddisk newdisk\n"
20736 " truncate -s +5G newdisk\n"
20741 #: ../resize/virt-resize.pod:41
20744 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20745 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20750 #: ../resize/virt-resize.pod:44 ../src/guestfs.pod:475 ../src/guestfs.pod:1261
20751 #: ../src/guestfs.pod:1399 ../src/guestfs.pod:2583
20756 #: ../resize/virt-resize.pod:46
20758 "As above, but make the /boot partition 200MB bigger, while giving the "
20759 "remaining space to /dev/sda2:"
20763 #: ../resize/virt-resize.pod:49
20766 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20767 " olddisk newdisk\n"
20772 #: ../resize/virt-resize.pod:52 ../src/guestfs.pod:486 ../src/guestfs.pod:1405
20777 #: ../resize/virt-resize.pod:54
20779 "As in the first example, but expand a logical volume as the final step. "
20780 "This is what you would typically use for Linux guests that use LVM:"
20784 #: ../resize/virt-resize.pod:58
20787 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20788 " olddisk newdisk\n"
20793 #: ../resize/virt-resize.pod:61
20798 #: ../resize/virt-resize.pod:63
20800 "As in the first example, but the output format will be qcow2 instead of a "
20805 #: ../resize/virt-resize.pod:66
20808 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20809 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20814 #: ../resize/virt-resize.pod:71
20815 msgid "DETAILED USAGE"
20819 #: ../resize/virt-resize.pod:73
20820 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20824 #: ../resize/virt-resize.pod:77
20825 msgid "1. Shut down the virtual machine"
20829 #: ../resize/virt-resize.pod:79
20830 msgid "2. Locate input disk image"
20834 #: ../resize/virt-resize.pod:81
20836 "Locate the input disk image (ie. the file or device on the host containing "
20837 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20838 "dumpxml> like this to find the disk image name:"
20842 #: ../resize/virt-resize.pod:85
20845 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20846 " Found 1 nodes:\n"
20848 " <source dev=\"/dev/vg/lv_guest\" />\n"
20853 #: ../resize/virt-resize.pod:90
20854 msgid "3. Look at current sizing"
20858 #: ../resize/virt-resize.pod:92
20859 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20863 #: ../resize/virt-resize.pod:95
20866 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20867 " Name Type Size Parent\n"
20868 " /dev/sda1 partition 101M /dev/sda\n"
20869 " /dev/sda2 partition 7.9G /dev/sda\n"
20870 " /dev/sda device 8.0G -\n"
20875 #: ../resize/virt-resize.pod:101
20877 "(This example is a virtual machine with an 8 GB disk which we would like to "
20878 "expand up to 10 GB)."
20882 #: ../resize/virt-resize.pod:104
20883 msgid "4. Create output disk"
20887 #: ../resize/virt-resize.pod:106
20889 "Virt-resize cannot do in-place disk modifications. You have to have space "
20890 "to store the resized output disk."
20894 #: ../resize/virt-resize.pod:109
20896 "To store the resized disk image in a file, create a file of a suitable size:"
20900 #: ../resize/virt-resize.pod:112
20903 " # rm -f outdisk\n"
20904 " # truncate -s 10G outdisk\n"
20909 #: ../resize/virt-resize.pod:115
20910 msgid "Or use L<lvcreate(1)> to create a logical volume:"
20914 #: ../resize/virt-resize.pod:117
20917 " # lvcreate -L 10G -n lv_name vg_name\n"
20922 #: ../resize/virt-resize.pod:119
20923 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
20927 #: ../resize/virt-resize.pod:121
20930 " # virsh pool-list\n"
20931 " # virsh vol-create-as poolname newvol 10G\n"
20936 #: ../resize/virt-resize.pod:124
20941 #: ../resize/virt-resize.pod:126
20943 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
20944 "file) and the output disk. The output disk is the one created in the "
20949 #: ../resize/virt-resize.pod:130
20952 " # virt-resize indisk outdisk\n"
20957 #: ../resize/virt-resize.pod:132
20959 "This command just copies disk image C<indisk> to disk image C<outdisk> "
20960 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
20961 "larger, then an extra, empty partition is created at the end of the disk "
20962 "covering the extra space. If C<outdisk> is smaller, then it will give an "
20967 #: ../resize/virt-resize.pod:138
20969 "More realistically you'd want to expand existing partitions in the disk "
20970 "image by passing extra options (for the full list see the L</OPTIONS> "
20975 #: ../resize/virt-resize.pod:142
20977 "L</--expand> is the most useful option. It expands the named partition "
20978 "within the disk to fill any extra space:"
20982 #: ../resize/virt-resize.pod:145
20985 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
20990 #: ../resize/virt-resize.pod:147
20992 "(In this case, an extra partition is I<not> created at the end of the disk, "
20993 "because there will be no unused space)."
20997 #: ../resize/virt-resize.pod:150
20999 "L</--resize> is the other commonly used option. The following would "
21000 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
21001 "rest of the available space:"
21005 #: ../resize/virt-resize.pod:154
21008 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21009 " indisk outdisk\n"
21014 #: ../resize/virt-resize.pod:157
21016 "If the expanded partition in the image contains a filesystem or LVM PV, then "
21017 "if virt-resize knows how, it will resize the contents, the equivalent of "
21018 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
21019 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
21020 "filesystems, so you would have to online resize them after booting the guest."
21024 #: ../resize/virt-resize.pod:164
21025 msgid "Other options are covered below."
21029 #: ../resize/virt-resize.pod:166
21034 #: ../resize/virt-resize.pod:168
21035 msgid "Thoroughly test the new disk image I<before> discarding the old one."
21039 #: ../resize/virt-resize.pod:170
21040 msgid "If you are using libvirt, edit the XML to point at the new disk:"
21044 #: ../resize/virt-resize.pod:172
21047 " # virsh edit guestname\n"
21052 #: ../resize/virt-resize.pod:174
21054 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
21055 "html#elementsDisks>"
21059 #: ../resize/virt-resize.pod:177
21060 msgid "Then start up the domain with the new, resized disk:"
21064 #: ../resize/virt-resize.pod:179
21067 " # virsh start guestname\n"
21072 #: ../resize/virt-resize.pod:181
21074 "and check that it still works. See also the L</NOTES> section below for "
21075 "additional information."
21079 #: ../resize/virt-resize.pod:184
21080 msgid "7. Resize LVs etc inside the guest"
21084 #: ../resize/virt-resize.pod:186
21085 msgid "(This can also be done offline using L<guestfish(1)>)"
21089 #: ../resize/virt-resize.pod:188
21091 "Once the guest has booted you should see the new space available, at least "
21092 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
21093 "may need to resize LVs inside PVs, and also resize filesystem types that "
21094 "virt-resize does not know how to expand."
21098 #: ../resize/virt-resize.pod:195
21099 msgid "SHRINKING A VIRTUAL MACHINE DISK"
21103 #: ../resize/virt-resize.pod:197
21105 "Shrinking is somewhat more complex than expanding, and only an overview is "
21110 #: ../resize/virt-resize.pod:200
21112 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
21113 "filesystems). The user has to shrink content before passing the disk image "
21114 "to virt-resize, and virt-resize will check that the content has been shrunk "
21119 #: ../resize/virt-resize.pod:205
21120 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
21124 #: ../resize/virt-resize.pod:207
21126 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
21127 "steps 3 and 4 above to allocate a new disk image."
21131 #: ../resize/virt-resize.pod:210
21133 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
21137 #: ../resize/virt-resize.pod:213
21138 msgid "IGNORING OR DELETING PARTITIONS"
21142 #: ../resize/virt-resize.pod:215
21144 "virt-resize also gives a convenient way to ignore or delete partitions when "
21145 "copying from the input disk to the output disk. Ignoring a partition speeds "
21146 "up the copy where you don't care about the existing contents of a "
21147 "partition. Deleting a partition removes it completely, but note that it "
21148 "also renumbers any partitions after the one which is deleted, which can "
21149 "leave some guests unbootable."
21153 #: ../resize/virt-resize.pod:222
21154 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
21158 #: ../resize/virt-resize.pod:224
21160 "If the input disk is in qcow2 format, then you may prefer that the output is "
21161 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
21162 "the fly. The output format is simply determined by the format of the empty "
21163 "output container that you provide. Thus to create qcow2 output, use:"
21167 #: ../resize/virt-resize.pod:230
21170 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
21175 #: ../resize/virt-resize.pod:232
21176 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
21180 #: ../resize/virt-resize.pod:234
21181 msgid "Similarly, to get non-sparse raw output use:"
21185 #: ../resize/virt-resize.pod:236
21188 " fallocate -l size outdisk\n"
21193 #: ../resize/virt-resize.pod:238
21195 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
21196 "dev/zero of=outdisk bs=1M count=..>)"
21200 #: ../resize/virt-resize.pod:247
21201 msgid "Display help."
21205 #: ../resize/virt-resize.pod:249
21210 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
21211 #: ../tools/virt-win-reg.pl:120
21216 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
21217 msgid "Enable debugging messages."
21221 #: ../resize/virt-resize.pod:255
21222 msgid "B<--delete part>"
21226 #: ../resize/virt-resize.pod:257
21228 "Delete the named partition. It would be more accurate to describe this as "
21229 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
21230 "the original disk image is left intact."
21234 #: ../resize/virt-resize.pod:261
21236 "Note that when you delete a partition, then anything contained in the "
21237 "partition is also deleted. Furthermore, this causes any partitions that "
21238 "come after to be I<renumbered>, which can easily make your guest unbootable."
21242 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
21243 #: ../resize/virt-resize.pod:454
21244 msgid "You can give this option multiple times."
21248 #: ../resize/virt-resize.pod:268
21249 msgid "B<--expand part>"
21253 #: ../resize/virt-resize.pod:270
21255 "Expand the named partition so it uses up all extra space (space left over "
21256 "after any other resize changes that you request have been done)."
21260 #: ../resize/virt-resize.pod:273
21262 "If virt-resize knows how, it will expand the direct content of the "
21263 "partition. For example, if the partition is an LVM PV, it will expand the "
21264 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
21265 "content it doesn't know about alone."
21269 #: ../resize/virt-resize.pod:278
21270 msgid "Currently virt-resize can resize:"
21274 #: ../resize/virt-resize.pod:284
21275 msgid "ext2, ext3 and ext4 filesystems."
21279 #: ../resize/virt-resize.pod:288
21280 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
21284 #: ../resize/virt-resize.pod:290
21286 "The filesystem must have been shut down consistently last time it was used. "
21287 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
21288 "consistency check, so at the first boot after resizing Windows will check "
21293 #: ../resize/virt-resize.pod:297
21295 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
21296 "inside the PV, but see the I<--LV-expand> option. The user could also "
21297 "resize LVs as desired after boot."
21301 #: ../resize/virt-resize.pod:303
21302 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
21306 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
21307 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
21311 #: ../resize/virt-resize.pod:309 ../tools/virt-list-filesystems.pl:91
21312 #: ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141
21313 #: ../tools/virt-win-reg.pl:142
21314 msgid "B<--format> raw"
21318 #: ../resize/virt-resize.pod:311
21320 "Specify the format of the input disk image. If this flag is not given then "
21321 "it is auto-detected from the image itself."
21325 #: ../resize/virt-resize.pod:317
21327 "Note that this option I<does not> affect the output format. See L</QCOW2 "
21328 "AND NON-SPARSE RAW FORMATS>."
21332 #: ../resize/virt-resize.pod:320
21333 msgid "B<--ignore part>"
21337 #: ../resize/virt-resize.pod:322
21339 "Ignore the named partition. Effectively this means the partition is "
21340 "allocated on the destination disk, but the content is not copied across from "
21341 "the source disk. The content of the partition will be blank (all zero "
21346 #: ../resize/virt-resize.pod:329
21347 msgid "B<--LV-expand logvol>"
21351 #: ../resize/virt-resize.pod:331
21353 "This takes the logical volume and, as a final step, expands it to fill all "
21354 "the space available in its volume group. A typical usage, assuming a Linux "
21355 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
21356 "lv_root> would be:"
21360 #: ../resize/virt-resize.pod:336
21363 " virt-resize indisk outdisk \\\n"
21364 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
21369 #: ../resize/virt-resize.pod:339
21371 "This would first expand the partition (and PV), and then expand the root "
21372 "device to fill the extra space in the PV."
21376 #: ../resize/virt-resize.pod:342
21378 "The contents of the LV are also resized if virt-resize knows how to do "
21379 "that. You can stop virt-resize from trying to expand the content by using "
21380 "the option I<--no-expand-content>."
21384 #: ../resize/virt-resize.pod:346
21385 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
21389 #: ../resize/virt-resize.pod:348
21391 "You can give this option multiple times, I<but> it doesn't make sense to do "
21392 "this unless the logical volumes you specify are all in different volume "
21397 #: ../resize/virt-resize.pod:352
21398 msgid "B<--machine-readable>"
21402 #: ../resize/virt-resize.pod:354
21404 "This option is used to make the output more machine friendly when being "
21405 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
21409 #: ../resize/virt-resize.pod:360
21410 msgid "B<--dryrun>"
21414 #: ../resize/virt-resize.pod:362
21415 msgid "Print a summary of what would be done, but don't do anything."
21419 #: ../resize/virt-resize.pod:364
21420 msgid "B<--no-copy-boot-loader>"
21424 #: ../resize/virt-resize.pod:366
21426 "By default, virt-resize copies over some sectors at the start of the disk "
21427 "(up to the beginning of the first partition). Commonly these sectors "
21428 "contain the Master Boot Record (MBR) and the boot loader, and are required "
21429 "in order for the guest to boot correctly."
21433 #: ../resize/virt-resize.pod:371
21435 "If you specify this flag, then this initial copy is not done. You may need "
21436 "to reinstall the boot loader in this case."
21440 #: ../resize/virt-resize.pod:374
21441 msgid "B<--no-extra-partition>"
21445 #: ../resize/virt-resize.pod:376
21447 "By default, virt-resize creates an extra partition if there is any extra, "
21448 "unused space after all resizing has happened. Use this option to prevent "
21449 "the extra partition from being created. If you do this then the extra space "
21450 "will be inaccessible until you run fdisk, parted, or some other partitioning "
21451 "tool in the guest."
21455 #: ../resize/virt-resize.pod:382
21457 "Note that if the surplus space is smaller than 10 MB, no extra partition "
21462 #: ../resize/virt-resize.pod:385
21463 msgid "B<--no-expand-content>"
21467 #: ../resize/virt-resize.pod:387
21469 "By default, virt-resize will try to expand the direct contents of "
21470 "partitions, if it knows how (see I<--expand> option above)."
21474 #: ../resize/virt-resize.pod:390
21476 "If you give the I<--no-expand-content> option then virt-resize will not "
21481 #: ../resize/virt-resize.pod:393
21482 msgid "B<--ntfsresize-force>"
21486 #: ../resize/virt-resize.pod:395
21488 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
21489 "the NTFS disk is marked as needing a consistency check. You have to use "
21490 "this option if you want to resize a Windows guest multiple times without "
21491 "booting into Windows between each resize."
21495 #: ../resize/virt-resize.pod:401
21496 msgid "B<--output-format> raw"
21500 #: ../resize/virt-resize.pod:403
21502 "Specify the format of the output disk image. If this flag is not given then "
21503 "it is auto-detected from the image itself."
21507 #: ../resize/virt-resize.pod:409
21509 "Note that this option I<does not create> the output format. This option "
21510 "just tells libguestfs what it is so it doesn't try to guess it. You still "
21511 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
21512 "SPARSE RAW FORMATS>."
21516 #: ../resize/virt-resize.pod:414
21521 #: ../resize/virt-resize.pod:416
21526 #: ../resize/virt-resize.pod:418
21527 msgid "Don't print the summary."
21531 #: ../resize/virt-resize.pod:420
21532 msgid "B<--resize part=size>"
21536 #: ../resize/virt-resize.pod:422
21538 "Resize the named partition (expanding or shrinking it) so that it has the "
21543 #: ../resize/virt-resize.pod:425
21545 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
21546 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
21547 "size; or as a relative number or percentage. For example:"
21551 #: ../resize/virt-resize.pod:431
21554 " --resize /dev/sda2=10G\n"
21559 #: ../resize/virt-resize.pod:433
21562 " --resize /dev/sda4=90%\n"
21567 #: ../resize/virt-resize.pod:435
21570 " --resize /dev/sda2=+1G\n"
21575 #: ../resize/virt-resize.pod:437
21578 " --resize /dev/sda2=-200M\n"
21583 #: ../resize/virt-resize.pod:439
21586 " --resize /dev/sda1=+128K\n"
21591 #: ../resize/virt-resize.pod:441
21594 " --resize /dev/sda1=+10%\n"
21599 #: ../resize/virt-resize.pod:443
21602 " --resize /dev/sda1=-10%\n"
21607 #: ../resize/virt-resize.pod:445
21609 "You can increase the size of any partition. Virt-resize will expand the "
21610 "direct content of the partition if it knows how (see I<--expand> below)."
21614 #: ../resize/virt-resize.pod:449
21616 "You can only I<decrease> the size of partitions that contain filesystems or "
21617 "PVs which have already been shrunk. Virt-resize will check this has been "
21618 "done before proceeding, or else will print an error (see also I<--resize-"
21623 #: ../resize/virt-resize.pod:456
21624 msgid "B<--resize-force part=size>"
21628 #: ../resize/virt-resize.pod:458
21630 "This is the same as I<--resize> except that it will let you decrease the "
21631 "size of any partition. Generally this means you will lose any data which "
21632 "was at the end of the partition you shrink, but you may not care about that "
21633 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
21634 "as a swap partition)."
21638 #: ../resize/virt-resize.pod:464
21639 msgid "See also the I<--ignore> option."
21643 #: ../resize/virt-resize.pod:466
21644 msgid "B<--shrink part>"
21648 #: ../resize/virt-resize.pod:468
21650 "Shrink the named partition until the overall disk image fits in the "
21651 "destination. The named partition B<must> contain a filesystem or PV which "
21652 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
21653 "online tools). Virt-resize will check this and give an error if it has not "
21658 #: ../resize/virt-resize.pod:474
21660 "The amount by which the overall disk must be shrunk (after carrying out all "
21661 "other operations requested by the user) is called the \"deficit\". For "
21662 "example, a straight copy (assume no other operations) from a 5GB disk image "
21663 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
21664 "would give an error unless the user specified a partition to shrink and that "
21665 "partition had more than a gigabyte of free space."
21669 #: ../resize/virt-resize.pod:492
21670 msgid "MACHINE READABLE OUTPUT"
21674 #: ../resize/virt-resize.pod:494
21676 "The I<--machine-readable> option can be used to make the output more machine "
21677 "friendly, which is useful when calling virt-resize from other programs, GUIs "
21682 #: ../resize/virt-resize.pod:498
21684 "Use the option on its own to query the capabilities of the virt-resize "
21685 "binary. Typical output looks like this:"
21689 #: ../resize/virt-resize.pod:501
21692 " $ virt-resize --machine-readable\n"
21694 " ntfsresize-force\n"
21702 #: ../resize/virt-resize.pod:508
21704 "A list of features is printed, one per line, and the program exits with "
21709 #: ../resize/virt-resize.pod:513
21710 msgid "\"Partition 1 does not end on cylinder boundary.\""
21714 #: ../resize/virt-resize.pod:515
21716 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
21717 "means the partitions will not be aligned to the ancient CHS geometry. "
21718 "However CHS geometry is meaningless for disks manufactured since the early "
21719 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
21720 "cylinders is not required by any modern operating system."
21724 #: ../resize/virt-resize.pod:522
21725 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
21729 #: ../resize/virt-resize.pod:524
21731 "In Windows Vista and later versions, Microsoft switched to using a separate "
21732 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
21733 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
21734 "the boot partition. Doing so seems to break the guest completely. However "
21735 "expanding the second partition (ie. C: drive) should work."
21739 #: ../resize/virt-resize.pod:531
21741 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21742 "NTFS partitions have been expanded. This is just a safety check and (unless "
21743 "it find errors) is nothing to worry about."
21747 #: ../resize/virt-resize.pod:535
21748 msgid "GUEST BOOT STUCK AT \"GRUB\""
21752 #: ../resize/virt-resize.pod:537
21754 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21755 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21756 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21757 "although we think is to do with partition alignment."
21761 #: ../resize/virt-resize.pod:542
21764 " guestfish -i -a newdisk\n"
21765 " ><fs> cat /boot/grub/device.map\n"
21766 " # check the contents of this file are sensible or\n"
21767 " # edit the file if necessary\n"
21768 " ><fs> grub-install / /dev/vda\n"
21774 #: ../resize/virt-resize.pod:549
21776 "For more flexible guest reconfiguration, including if you need to specify "
21777 "other parameters to grub-install, use L<virt-rescue(1)>."
21781 #: ../resize/virt-resize.pod:552
21782 msgid "ALTERNATIVE TOOLS"
21786 #: ../resize/virt-resize.pod:554
21788 "There are several proprietary tools for resizing partitions. We won't "
21789 "mention any here."
21793 #: ../resize/virt-resize.pod:557
21795 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21796 "operations on disk images. They can resize and move partitions, but I don't "
21797 "think they can do anything with the contents, and they certainly don't "
21802 #: ../resize/virt-resize.pod:562
21804 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21805 "but at a much lower level. You will probably end up hand-calculating sector "
21806 "offsets, which is something that virt-resize was designed to avoid. If you "
21807 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21812 #: ../resize/virt-resize.pod:582
21814 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
21815 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
21816 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
21817 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<http://libguestfs.org/>."
21821 #: ../ruby/examples/guestfs-ruby.pod:5
21822 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21826 #: ../ruby/examples/guestfs-ruby.pod:9
21829 " require 'guestfs'\n"
21830 " g = Guestfs::Guestfs.new()\n"
21831 " g.add_drive_opts(\"disk.img\",\n"
21832 " :readonly => 1, :format => \"raw\")\n"
21838 #: ../ruby/examples/guestfs-ruby.pod:17
21840 "This manual page documents how to call libguestfs from the Ruby programming "
21841 "language. This page just documents the differences from the C API and gives "
21842 "some examples. If you are not familiar with using libguestfs, you also need "
21843 "to read L<guestfs(3)>."
21847 #: ../ruby/examples/guestfs-ruby.pod:24
21849 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21850 "This has a single parameter which is the error message (a string)."
21854 #: ../ruby/examples/guestfs-ruby.pod:38
21856 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
21857 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://"
21858 "libguestfs.org/>."
21862 #: ../src/guestfs-actions.pod:1
21863 msgid "guestfs_add_cdrom"
21867 #: ../src/guestfs-actions.pod:3
21871 " guestfs_add_cdrom (guestfs_h *g,\n"
21872 " const char *filename);\n"
21877 #: ../src/guestfs-actions.pod:17
21879 "This call checks for the existence of C<filename>. This stops you from "
21880 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21881 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21886 #: ../src/guestfs-actions.pod:24
21888 "If you just want to add an ISO file (often you use this as an efficient way "
21889 "to transfer large files into the guest), then you should probably use "
21890 "C<guestfs_add_drive_ro> instead."
21894 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:140
21895 #: ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238
21896 #: ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273
21897 #: ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307
21898 #: ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447
21899 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506
21900 #: ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552
21901 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652
21902 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681
21903 #: ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798
21904 #: ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826
21905 #: ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046
21906 #: ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084
21907 #: ../src/guestfs-actions.pod:1168 ../src/guestfs-actions.pod:1186
21908 #: ../src/guestfs-actions.pod:1205 ../src/guestfs-actions.pod:1219
21909 #: ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1309
21910 #: ../src/guestfs-actions.pod:1340 ../src/guestfs-actions.pod:1365
21911 #: ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1513
21912 #: ../src/guestfs-actions.pod:1547 ../src/guestfs-actions.pod:1762
21913 #: ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1871
21914 #: ../src/guestfs-actions.pod:2368 ../src/guestfs-actions.pod:2512
21915 #: ../src/guestfs-actions.pod:2573 ../src/guestfs-actions.pod:2608
21916 #: ../src/guestfs-actions.pod:3648 ../src/guestfs-actions.pod:3663
21917 #: ../src/guestfs-actions.pod:3688 ../src/guestfs-actions.pod:3877
21918 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3904
21919 #: ../src/guestfs-actions.pod:3918 ../src/guestfs-actions.pod:3933
21920 #: ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:4041
21921 #: ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4078
21922 #: ../src/guestfs-actions.pod:4101 ../src/guestfs-actions.pod:4124
21923 #: ../src/guestfs-actions.pod:4159 ../src/guestfs-actions.pod:4178
21924 #: ../src/guestfs-actions.pod:4197 ../src/guestfs-actions.pod:4232
21925 #: ../src/guestfs-actions.pod:4244 ../src/guestfs-actions.pod:4280
21926 #: ../src/guestfs-actions.pod:4296 ../src/guestfs-actions.pod:4309
21927 #: ../src/guestfs-actions.pod:4324 ../src/guestfs-actions.pod:4341
21928 #: ../src/guestfs-actions.pod:4434 ../src/guestfs-actions.pod:4454
21929 #: ../src/guestfs-actions.pod:4467 ../src/guestfs-actions.pod:4518
21930 #: ../src/guestfs-actions.pod:4536 ../src/guestfs-actions.pod:4554
21931 #: ../src/guestfs-actions.pod:4570 ../src/guestfs-actions.pod:4584
21932 #: ../src/guestfs-actions.pod:4598 ../src/guestfs-actions.pod:4615
21933 #: ../src/guestfs-actions.pod:4630 ../src/guestfs-actions.pod:4650
21934 #: ../src/guestfs-actions.pod:4720 ../src/guestfs-actions.pod:4793
21935 #: ../src/guestfs-actions.pod:4824 ../src/guestfs-actions.pod:4843
21936 #: ../src/guestfs-actions.pod:4862 ../src/guestfs-actions.pod:4874
21937 #: ../src/guestfs-actions.pod:4891 ../src/guestfs-actions.pod:4904
21938 #: ../src/guestfs-actions.pod:4919 ../src/guestfs-actions.pod:4934
21939 #: ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:5002
21940 #: ../src/guestfs-actions.pod:5041 ../src/guestfs-actions.pod:5061
21941 #: ../src/guestfs-actions.pod:5075 ../src/guestfs-actions.pod:5092
21942 #: ../src/guestfs-actions.pod:5141 ../src/guestfs-actions.pod:5187
21943 #: ../src/guestfs-actions.pod:5241 ../src/guestfs-actions.pod:5277
21944 #: ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5329
21945 #: ../src/guestfs-actions.pod:5347 ../src/guestfs-actions.pod:5487
21946 #: ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5566
21947 #: ../src/guestfs-actions.pod:5584 ../src/guestfs-actions.pod:5616
21948 #: ../src/guestfs-actions.pod:5682 ../src/guestfs-actions.pod:5699
21949 #: ../src/guestfs-actions.pod:5712 ../src/guestfs-actions.pod:5726
21950 #: ../src/guestfs-actions.pod:6015 ../src/guestfs-actions.pod:6034
21951 #: ../src/guestfs-actions.pod:6053 ../src/guestfs-actions.pod:6067
21952 #: ../src/guestfs-actions.pod:6079 ../src/guestfs-actions.pod:6093
21953 #: ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6119
21954 #: ../src/guestfs-actions.pod:6135 ../src/guestfs-actions.pod:6156
21955 #: ../src/guestfs-actions.pod:6175 ../src/guestfs-actions.pod:6194
21956 #: ../src/guestfs-actions.pod:6224 ../src/guestfs-actions.pod:6242
21957 #: ../src/guestfs-actions.pod:6265 ../src/guestfs-actions.pod:6283
21958 #: ../src/guestfs-actions.pod:6302 ../src/guestfs-actions.pod:6323
21959 #: ../src/guestfs-actions.pod:6342 ../src/guestfs-actions.pod:6359
21960 #: ../src/guestfs-actions.pod:6378 ../src/guestfs-actions.pod:6406
21961 #: ../src/guestfs-actions.pod:6430 ../src/guestfs-actions.pod:6449
21962 #: ../src/guestfs-actions.pod:6473 ../src/guestfs-actions.pod:6492
21963 #: ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:6526
21964 #: ../src/guestfs-actions.pod:6563 ../src/guestfs-actions.pod:6593
21965 #: ../src/guestfs-actions.pod:6626 ../src/guestfs-actions.pod:6748
21966 #: ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:6881
21967 #: ../src/guestfs-actions.pod:6894 ../src/guestfs-actions.pod:6907
21968 #: ../src/guestfs-actions.pod:6929 ../src/guestfs-actions.pod:6942
21969 #: ../src/guestfs-actions.pod:6955 ../src/guestfs-actions.pod:6968
21970 #: ../src/guestfs-actions.pod:6983 ../src/guestfs-actions.pod:7042
21971 #: ../src/guestfs-actions.pod:7059 ../src/guestfs-actions.pod:7075
21972 #: ../src/guestfs-actions.pod:7091 ../src/guestfs-actions.pod:7108
21973 #: ../src/guestfs-actions.pod:7121 ../src/guestfs-actions.pod:7141
21974 #: ../src/guestfs-actions.pod:7177 ../src/guestfs-actions.pod:7191
21975 #: ../src/guestfs-actions.pod:7232 ../src/guestfs-actions.pod:7245
21976 #: ../src/guestfs-actions.pod:7263 ../src/guestfs-actions.pod:7297
21977 #: ../src/guestfs-actions.pod:7333 ../src/guestfs-actions.pod:7449
21978 #: ../src/guestfs-actions.pod:7464 ../src/guestfs-actions.pod:7478
21979 #: ../src/guestfs-actions.pod:7533 ../src/guestfs-actions.pod:7546
21980 #: ../src/guestfs-actions.pod:7591 ../src/guestfs-actions.pod:7624
21981 #: ../src/guestfs-actions.pod:7687 ../src/guestfs-actions.pod:7707
21982 #: ../src/guestfs-actions.pod:7733 ../src/guestfs-actions.pod:7804
21983 #: ../src/guestfs-actions.pod:7827 ../src/guestfs-actions.pod:7856
21984 msgid "This function returns 0 on success or -1 on error."
21988 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:254
21989 #: ../src/guestfs-actions.pod:275
21991 "This function is deprecated. In new code, use the L</"
21992 "guestfs_add_drive_opts> call instead."
21996 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
21997 #: ../src/guestfs-actions.pod:1170 ../src/guestfs-actions.pod:1985
21998 #: ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2197
21999 #: ../src/guestfs-actions.pod:3650 ../src/guestfs-actions.pod:3670
22000 #: ../src/guestfs-actions.pod:4978 ../src/guestfs-actions.pod:6244
22001 #: ../src/guestfs-actions.pod:6361 ../src/guestfs-actions.pod:6494
22002 #: ../src/guestfs-actions.pod:6985 ../src/guestfs-actions.pod:7110
22003 #: ../src/guestfs-actions.pod:7633
22004 msgid "(Added in 0.3)"
22008 #: ../src/guestfs-actions.pod:41
22009 msgid "guestfs_add_domain"
22013 #: ../src/guestfs-actions.pod:43
22017 " guestfs_add_domain (guestfs_h *g,\n"
22018 " const char *dom,\n"
22024 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
22025 #: ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:2853
22026 #: ../src/guestfs-actions.pod:4669 ../src/guestfs-actions.pod:4988
22027 #: ../src/guestfs-actions.pod:5205
22029 "You may supply a list of optional arguments to this call. Use zero or more "
22030 "of the following pairs of parameters, and terminate the list with C<-1> on "
22031 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
22035 #: ../src/guestfs-actions.pod:53
22038 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
22039 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
22040 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
22041 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
22042 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
22047 #: ../src/guestfs-actions.pod:59
22049 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
22050 "It works by connecting to libvirt, requesting the domain and domain XML from "
22051 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
22056 #: ../src/guestfs-actions.pod:94
22058 "The other optional parameters are passed directly through to "
22059 "C<guestfs_add_drive_opts>."
22063 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350
22064 #: ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698
22065 #: ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747
22066 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1385
22067 #: ../src/guestfs-actions.pod:1741 ../src/guestfs-actions.pod:1944
22068 #: ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2106
22069 #: ../src/guestfs-actions.pod:2161 ../src/guestfs-actions.pod:2184
22070 #: ../src/guestfs-actions.pod:2499 ../src/guestfs-actions.pod:2971
22071 #: ../src/guestfs-actions.pod:2989 ../src/guestfs-actions.pod:5164
22072 #: ../src/guestfs-actions.pod:5384 ../src/guestfs-actions.pod:5796
22073 #: ../src/guestfs-actions.pod:5822 ../src/guestfs-actions.pod:7218
22074 #: ../src/guestfs-actions.pod:7644 ../src/guestfs-actions.pod:7657
22075 #: ../src/guestfs-actions.pod:7670
22076 msgid "On error this function returns -1."
22080 #: ../src/guestfs-actions.pod:99
22081 msgid "(Added in 1.7.4)"
22085 #: ../src/guestfs-actions.pod:101
22086 msgid "guestfs_add_domain_va"
22090 #: ../src/guestfs-actions.pod:103
22094 " guestfs_add_domain_va (guestfs_h *g,\n"
22095 " const char *dom,\n"
22096 " va_list args);\n"
22101 #: ../src/guestfs-actions.pod:108
22102 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
22106 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
22107 #: ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225
22108 #: ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887
22109 #: ../src/guestfs-actions.pod:2937 ../src/guestfs-actions.pod:2949
22110 #: ../src/guestfs-actions.pod:4734 ../src/guestfs-actions.pod:4746
22111 #: ../src/guestfs-actions.pod:5016 ../src/guestfs-actions.pod:5028
22112 #: ../src/guestfs-actions.pod:5254 ../src/guestfs-actions.pod:5265
22113 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
22117 #: ../src/guestfs-actions.pod:112
22118 msgid "guestfs_add_domain_argv"
22122 #: ../src/guestfs-actions.pod:114
22126 " guestfs_add_domain_argv (guestfs_h *g,\n"
22127 " const char *dom,\n"
22128 " const struct guestfs_add_domain_argv *optargs);\n"
22133 #: ../src/guestfs-actions.pod:119
22134 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
22138 #: ../src/guestfs-actions.pod:123
22139 msgid "guestfs_add_drive"
22143 #: ../src/guestfs-actions.pod:125
22147 " guestfs_add_drive (guestfs_h *g,\n"
22148 " const char *filename);\n"
22153 #: ../src/guestfs-actions.pod:129
22155 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
22156 "optional parameters, so the disk is added writable, with the format being "
22157 "detected automatically."
22161 #: ../src/guestfs-actions.pod:133
22163 "Automatic detection of the format opens you up to a potential security hole "
22164 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
22165 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
22166 "you should think about replacing calls to this function with calls to "
22167 "C<guestfs_add_drive_opts>, and specifying the format."
22171 #: ../src/guestfs-actions.pod:144
22172 msgid "guestfs_add_drive_opts"
22176 #: ../src/guestfs-actions.pod:146
22180 " guestfs_add_drive_opts (guestfs_h *g,\n"
22181 " const char *filename,\n"
22187 #: ../src/guestfs-actions.pod:156
22190 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
22191 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
22192 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
22197 #: ../src/guestfs-actions.pod:185
22199 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
22200 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
22201 "Possible formats include C<raw> and C<qcow2>."
22205 #: ../src/guestfs-actions.pod:196
22207 "This rarely-used option lets you emulate the behaviour of the deprecated "
22208 "C<guestfs_add_drive_with_if> call (q.v.)"
22212 #: ../src/guestfs-actions.pod:203
22213 msgid "(Added in 1.5.23)"
22217 #: ../src/guestfs-actions.pod:205
22218 msgid "guestfs_add_drive_opts_va"
22222 #: ../src/guestfs-actions.pod:207
22226 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
22227 " const char *filename,\n"
22228 " va_list args);\n"
22233 #: ../src/guestfs-actions.pod:212
22234 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
22238 #: ../src/guestfs-actions.pod:216
22239 msgid "guestfs_add_drive_opts_argv"
22243 #: ../src/guestfs-actions.pod:218
22247 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
22248 " const char *filename,\n"
22249 " const struct guestfs_add_drive_opts_argv *optargs);\n"
22254 #: ../src/guestfs-actions.pod:223
22255 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
22259 #: ../src/guestfs-actions.pod:227
22260 msgid "guestfs_add_drive_ro"
22264 #: ../src/guestfs-actions.pod:229
22268 " guestfs_add_drive_ro (guestfs_h *g,\n"
22269 " const char *filename);\n"
22274 #: ../src/guestfs-actions.pod:233
22276 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
22277 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
22278 "disk is added read-only, with the format being detected automatically."
22282 #: ../src/guestfs-actions.pod:240
22283 msgid "(Added in 1.0.38)"
22287 #: ../src/guestfs-actions.pod:242
22288 msgid "guestfs_add_drive_ro_with_if"
22292 #: ../src/guestfs-actions.pod:244
22296 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
22297 " const char *filename,\n"
22298 " const char *iface);\n"
22303 #: ../src/guestfs-actions.pod:249
22305 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
22306 "QEMU interface emulation to use at run time."
22310 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282
22311 #: ../src/guestfs-actions.pod:2458
22312 msgid "(Added in 1.0.84)"
22316 #: ../src/guestfs-actions.pod:263
22317 msgid "guestfs_add_drive_with_if"
22321 #: ../src/guestfs-actions.pod:265
22325 " guestfs_add_drive_with_if (guestfs_h *g,\n"
22326 " const char *filename,\n"
22327 " const char *iface);\n"
22332 #: ../src/guestfs-actions.pod:270
22334 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
22335 "QEMU interface emulation to use at run time."
22339 #: ../src/guestfs-actions.pod:284
22340 msgid "guestfs_aug_clear"
22344 #: ../src/guestfs-actions.pod:286
22348 " guestfs_aug_clear (guestfs_h *g,\n"
22349 " const char *augpath);\n"
22354 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2186
22355 msgid "(Added in 1.3.4)"
22359 #: ../src/guestfs-actions.pod:297
22360 msgid "guestfs_aug_close"
22364 #: ../src/guestfs-actions.pod:299
22368 " guestfs_aug_close (guestfs_h *g);\n"
22373 #: ../src/guestfs-actions.pod:302
22375 "Close the current Augeas handle and free up any resources used by it. After "
22376 "calling this, you have to call C<guestfs_aug_init> again before you can use "
22377 "any other Augeas functions."
22381 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334
22382 #: ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366
22383 #: ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449
22384 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494
22385 #: ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522
22386 #: ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554
22387 #: ../src/guestfs-actions.pod:5873
22388 msgid "(Added in 0.7)"
22392 #: ../src/guestfs-actions.pod:311
22393 msgid "guestfs_aug_defnode"
22397 #: ../src/guestfs-actions.pod:313
22400 " struct guestfs_int_bool *\n"
22401 " guestfs_aug_defnode (guestfs_h *g,\n"
22402 " const char *name,\n"
22403 " const char *expr,\n"
22404 " const char *val);\n"
22409 #: ../src/guestfs-actions.pod:322
22411 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
22412 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
22413 "containing that single node."
22417 #: ../src/guestfs-actions.pod:330
22419 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
22420 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
22424 #: ../src/guestfs-actions.pod:336
22425 msgid "guestfs_aug_defvar"
22429 #: ../src/guestfs-actions.pod:338
22433 " guestfs_aug_defvar (guestfs_h *g,\n"
22434 " const char *name,\n"
22435 " const char *expr);\n"
22440 #: ../src/guestfs-actions.pod:354
22441 msgid "guestfs_aug_get"
22445 #: ../src/guestfs-actions.pod:356
22449 " guestfs_aug_get (guestfs_h *g,\n"
22450 " const char *augpath);\n"
22455 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927
22456 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005
22457 #: ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124
22458 #: ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1271
22459 #: ../src/guestfs-actions.pod:1290 ../src/guestfs-actions.pod:1424
22460 #: ../src/guestfs-actions.pod:1612 ../src/guestfs-actions.pod:1724
22461 #: ../src/guestfs-actions.pod:1887 ../src/guestfs-actions.pod:1904
22462 #: ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:2007
22463 #: ../src/guestfs-actions.pod:2028 ../src/guestfs-actions.pod:2209
22464 #: ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2627
22465 #: ../src/guestfs-actions.pod:2717 ../src/guestfs-actions.pod:2821
22466 #: ../src/guestfs-actions.pod:2840 ../src/guestfs-actions.pod:3054
22467 #: ../src/guestfs-actions.pod:3082 ../src/guestfs-actions.pod:3103
22468 #: ../src/guestfs-actions.pod:3137 ../src/guestfs-actions.pod:3196
22469 #: ../src/guestfs-actions.pod:3216 ../src/guestfs-actions.pod:3236
22470 #: ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:4216
22471 #: ../src/guestfs-actions.pod:4386 ../src/guestfs-actions.pod:4496
22472 #: ../src/guestfs-actions.pod:5402 ../src/guestfs-actions.pod:5601
22473 #: ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5949
22474 #: ../src/guestfs-actions.pod:5998 ../src/guestfs-actions.pod:6654
22475 #: ../src/guestfs-actions.pod:6670 ../src/guestfs-actions.pod:6687
22476 #: ../src/guestfs-actions.pod:6718 ../src/guestfs-actions.pod:7392
22477 #: ../src/guestfs-actions.pod:7411 ../src/guestfs-actions.pod:7429
22478 #: ../src/guestfs-actions.pod:7603 ../src/guestfs-actions.pod:7913
22480 "This function returns a string, or NULL on error. I<The caller must free "
22481 "the returned string after use>."
22485 #: ../src/guestfs-actions.pod:368
22486 msgid "guestfs_aug_init"
22490 #: ../src/guestfs-actions.pod:370
22494 " guestfs_aug_init (guestfs_h *g,\n"
22495 " const char *root,\n"
22501 #: ../src/guestfs-actions.pod:379
22502 msgid "You must call this before using any other C<guestfs_aug_*> commands."
22506 #: ../src/guestfs-actions.pod:404
22508 "This option is only useful when debugging Augeas lenses. Use of this option "
22509 "may require additional memory for the libguestfs appliance. You may need to "
22510 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
22511 "C<guestfs_set_memsize>."
22515 #: ../src/guestfs-actions.pod:419
22516 msgid "Do not load the tree in C<guestfs_aug_init>."
22520 #: ../src/guestfs-actions.pod:423
22521 msgid "To close the handle, you can call C<guestfs_aug_close>."
22525 #: ../src/guestfs-actions.pod:431
22526 msgid "guestfs_aug_insert"
22530 #: ../src/guestfs-actions.pod:433
22534 " guestfs_aug_insert (guestfs_h *g,\n"
22535 " const char *augpath,\n"
22536 " const char *label,\n"
22542 #: ../src/guestfs-actions.pod:451
22543 msgid "guestfs_aug_load"
22547 #: ../src/guestfs-actions.pod:453
22551 " guestfs_aug_load (guestfs_h *g);\n"
22556 #: ../src/guestfs-actions.pod:465
22557 msgid "guestfs_aug_ls"
22561 #: ../src/guestfs-actions.pod:467
22565 " guestfs_aug_ls (guestfs_h *g,\n"
22566 " const char *augpath);\n"
22571 #: ../src/guestfs-actions.pod:471
22573 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
22574 "sorting the resulting nodes into alphabetical order."
22578 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490
22579 #: ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143
22580 #: ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1458
22581 #: ../src/guestfs-actions.pod:1561 ../src/guestfs-actions.pod:1580
22582 #: ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:2281
22583 #: ../src/guestfs-actions.pod:2297 ../src/guestfs-actions.pod:2316
22584 #: ../src/guestfs-actions.pod:2381 ../src/guestfs-actions.pod:2405
22585 #: ../src/guestfs-actions.pod:2476 ../src/guestfs-actions.pod:2525
22586 #: ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:3156
22587 #: ../src/guestfs-actions.pod:3432 ../src/guestfs-actions.pod:3746
22588 #: ../src/guestfs-actions.pod:3763 ../src/guestfs-actions.pod:3783
22589 #: ../src/guestfs-actions.pod:3845 ../src/guestfs-actions.pod:3950
22590 #: ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:5125
22591 #: ../src/guestfs-actions.pod:5743 ../src/guestfs-actions.pod:5869
22592 #: ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6734
22593 #: ../src/guestfs-actions.pod:6795 ../src/guestfs-actions.pod:6850
22594 #: ../src/guestfs-actions.pod:6996 ../src/guestfs-actions.pod:7020
22595 #: ../src/guestfs-actions.pod:7496 ../src/guestfs-actions.pod:7516
22596 #: ../src/guestfs-actions.pod:7563 ../src/guestfs-actions.pod:7757
22597 #: ../src/guestfs-actions.pod:7776 ../src/guestfs-actions.pod:7870
22598 #: ../src/guestfs-actions.pod:7889 ../src/guestfs-actions.pod:7935
22599 #: ../src/guestfs-actions.pod:7954
22601 "This function returns a NULL-terminated array of strings (like L<environ(3)"
22602 ">), or NULL if there was an error. I<The caller must free the strings and "
22603 "the array after use>."
22607 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068
22608 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1496
22609 #: ../src/guestfs-actions.pod:3510 ../src/guestfs-actions.pod:3541
22610 #: ../src/guestfs-actions.pod:4199 ../src/guestfs-actions.pod:4249
22611 #: ../src/guestfs-actions.pod:4436 ../src/guestfs-actions.pod:4469
22612 #: ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:5129
22613 #: ../src/guestfs-actions.pod:5684 ../src/guestfs-actions.pod:6081
22614 #: ../src/guestfs-actions.pod:6095 ../src/guestfs-actions.pod:6107
22615 #: ../src/guestfs-actions.pod:6575 ../src/guestfs-actions.pod:7234
22616 #: ../src/guestfs-actions.pod:7247 ../src/guestfs-actions.pod:7480
22617 #: ../src/guestfs-actions.pod:7745
22618 msgid "(Added in 0.8)"
22622 #: ../src/guestfs-actions.pod:480
22623 msgid "guestfs_aug_match"
22627 #: ../src/guestfs-actions.pod:482
22631 " guestfs_aug_match (guestfs_h *g,\n"
22632 " const char *augpath);\n"
22637 #: ../src/guestfs-actions.pod:496
22638 msgid "guestfs_aug_mv"
22642 #: ../src/guestfs-actions.pod:498
22646 " guestfs_aug_mv (guestfs_h *g,\n"
22647 " const char *src,\n"
22648 " const char *dest);\n"
22653 #: ../src/guestfs-actions.pod:510
22654 msgid "guestfs_aug_rm"
22658 #: ../src/guestfs-actions.pod:512
22662 " guestfs_aug_rm (guestfs_h *g,\n"
22663 " const char *augpath);\n"
22668 #: ../src/guestfs-actions.pod:524
22669 msgid "guestfs_aug_save"
22673 #: ../src/guestfs-actions.pod:526
22677 " guestfs_aug_save (guestfs_h *g);\n"
22682 #: ../src/guestfs-actions.pod:531
22684 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
22689 #: ../src/guestfs-actions.pod:538
22690 msgid "guestfs_aug_set"
22694 #: ../src/guestfs-actions.pod:540
22698 " guestfs_aug_set (guestfs_h *g,\n"
22699 " const char *augpath,\n"
22700 " const char *val);\n"
22705 #: ../src/guestfs-actions.pod:547
22707 "In the Augeas API, it is possible to clear a node by setting the value to "
22708 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
22709 "this call. Instead you must use the C<guestfs_aug_clear> call."
22713 #: ../src/guestfs-actions.pod:556
22714 msgid "guestfs_available"
22718 #: ../src/guestfs-actions.pod:558
22722 " guestfs_available (guestfs_h *g,\n"
22723 " char *const *groups);\n"
22728 #: ../src/guestfs-actions.pod:566
22730 "The libguestfs groups, and the functions that those groups correspond to, "
22731 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
22732 "runtime by calling C<guestfs_available_all_groups>."
22736 #: ../src/guestfs-actions.pod:590
22737 msgid "You must call C<guestfs_launch> before calling this function."
22741 #: ../src/guestfs-actions.pod:612
22743 "This call was added in version C<1.0.80>. In previous versions of "
22744 "libguestfs all you could do would be to speculatively execute a command to "
22745 "find out if the daemon implemented it. See also C<guestfs_version>."
22749 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1241
22750 msgid "(Added in 1.0.80)"
22754 #: ../src/guestfs-actions.pod:623
22755 msgid "guestfs_available_all_groups"
22759 #: ../src/guestfs-actions.pod:625
22763 " guestfs_available_all_groups (guestfs_h *g);\n"
22768 #: ../src/guestfs-actions.pod:628
22770 "This command returns a list of all optional groups that this daemon knows "
22771 "about. Note this returns both supported and unsupported groups. To find "
22772 "out which ones the daemon can actually support you have to call "
22773 "C<guestfs_available> on each member of the returned list."
22777 #: ../src/guestfs-actions.pod:634
22778 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
22782 #: ../src/guestfs-actions.pod:640
22783 msgid "(Added in 1.3.15)"
22787 #: ../src/guestfs-actions.pod:642
22788 msgid "guestfs_base64_in"
22792 #: ../src/guestfs-actions.pod:644
22796 " guestfs_base64_in (guestfs_h *g,\n"
22797 " const char *base64file,\n"
22798 " const char *filename);\n"
22803 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
22804 msgid "(Added in 1.3.5)"
22808 #: ../src/guestfs-actions.pod:656
22809 msgid "guestfs_base64_out"
22813 #: ../src/guestfs-actions.pod:658
22817 " guestfs_base64_out (guestfs_h *g,\n"
22818 " const char *filename,\n"
22819 " const char *base64file);\n"
22824 #: ../src/guestfs-actions.pod:670
22825 msgid "guestfs_blockdev_flushbufs"
22829 #: ../src/guestfs-actions.pod:672
22833 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
22834 " const char *device);\n"
22839 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700
22840 #: ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731
22841 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768
22842 #: ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800
22843 #: ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
22844 msgid "(Added in 0.9.3)"
22848 #: ../src/guestfs-actions.pod:685
22849 msgid "guestfs_blockdev_getbsz"
22853 #: ../src/guestfs-actions.pod:687
22857 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
22858 " const char *device);\n"
22863 #: ../src/guestfs-actions.pod:702
22864 msgid "guestfs_blockdev_getro"
22868 #: ../src/guestfs-actions.pod:704
22872 " guestfs_blockdev_getro (guestfs_h *g,\n"
22873 " const char *device);\n"
22878 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1479
22879 #: ../src/guestfs-actions.pod:1494 ../src/guestfs-actions.pod:1983
22880 #: ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:2066
22881 #: ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:2132
22882 #: ../src/guestfs-actions.pod:2147 ../src/guestfs-actions.pod:2172
22883 #: ../src/guestfs-actions.pod:2195 ../src/guestfs-actions.pod:3253
22884 #: ../src/guestfs-actions.pod:3269 ../src/guestfs-actions.pod:3287
22885 #: ../src/guestfs-actions.pod:3449 ../src/guestfs-actions.pod:3463
22886 #: ../src/guestfs-actions.pod:3478 ../src/guestfs-actions.pod:3492
22887 #: ../src/guestfs-actions.pod:3508 ../src/guestfs-actions.pod:3523
22888 #: ../src/guestfs-actions.pod:3539 ../src/guestfs-actions.pod:3553
22889 #: ../src/guestfs-actions.pod:3566 ../src/guestfs-actions.pod:3580
22890 #: ../src/guestfs-actions.pod:3595 ../src/guestfs-actions.pod:3610
22891 #: ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3637
22892 #: ../src/guestfs-actions.pod:5366
22893 msgid "This function returns a C truth value on success or -1 on error."
22897 #: ../src/guestfs-actions.pod:717
22898 msgid "guestfs_blockdev_getsize64"
22902 #: ../src/guestfs-actions.pod:719
22906 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
22907 " const char *device);\n"
22912 #: ../src/guestfs-actions.pod:725
22913 msgid "See also C<guestfs_blockdev_getsz>."
22917 #: ../src/guestfs-actions.pod:733
22918 msgid "guestfs_blockdev_getss"
22922 #: ../src/guestfs-actions.pod:735
22926 " guestfs_blockdev_getss (guestfs_h *g,\n"
22927 " const char *device);\n"
22932 #: ../src/guestfs-actions.pod:742
22934 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
22939 #: ../src/guestfs-actions.pod:751
22940 msgid "guestfs_blockdev_getsz"
22944 #: ../src/guestfs-actions.pod:753
22948 " guestfs_blockdev_getsz (guestfs_h *g,\n"
22949 " const char *device);\n"
22954 #: ../src/guestfs-actions.pod:760
22956 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
22957 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
22961 #: ../src/guestfs-actions.pod:770
22962 msgid "guestfs_blockdev_rereadpt"
22966 #: ../src/guestfs-actions.pod:772
22970 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
22971 " const char *device);\n"
22976 #: ../src/guestfs-actions.pod:784
22977 msgid "guestfs_blockdev_setbsz"
22981 #: ../src/guestfs-actions.pod:786
22985 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
22986 " const char *device,\n"
22987 " int blocksize);\n"
22992 #: ../src/guestfs-actions.pod:802
22993 msgid "guestfs_blockdev_setro"
22997 #: ../src/guestfs-actions.pod:804
23001 " guestfs_blockdev_setro (guestfs_h *g,\n"
23002 " const char *device);\n"
23007 #: ../src/guestfs-actions.pod:816
23008 msgid "guestfs_blockdev_setrw"
23012 #: ../src/guestfs-actions.pod:818
23016 " guestfs_blockdev_setrw (guestfs_h *g,\n"
23017 " const char *device);\n"
23022 #: ../src/guestfs-actions.pod:830
23023 msgid "guestfs_btrfs_filesystem_resize"
23027 #: ../src/guestfs-actions.pod:832
23031 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
23032 " const char *mountpoint,\n"
23038 #: ../src/guestfs-actions.pod:842
23041 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
23046 #: ../src/guestfs-actions.pod:865
23047 msgid "(Added in 1.11.17)"
23051 #: ../src/guestfs-actions.pod:867
23052 msgid "guestfs_btrfs_filesystem_resize_va"
23056 #: ../src/guestfs-actions.pod:869
23060 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
23061 " const char *mountpoint,\n"
23062 " va_list args);\n"
23067 #: ../src/guestfs-actions.pod:874
23068 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
23072 #: ../src/guestfs-actions.pod:878
23073 msgid "guestfs_btrfs_filesystem_resize_argv"
23077 #: ../src/guestfs-actions.pod:880
23081 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
23082 " const char *mountpoint,\n"
23083 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
23088 #: ../src/guestfs-actions.pod:885
23089 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
23093 #: ../src/guestfs-actions.pod:889
23094 msgid "guestfs_case_sensitive_path"
23098 #: ../src/guestfs-actions.pod:891
23102 " guestfs_case_sensitive_path (guestfs_h *g,\n"
23103 " const char *path);\n"
23108 #: ../src/guestfs-actions.pod:917
23110 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
23111 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
23112 "how the directories were originally created under Windows)."
23116 #: ../src/guestfs-actions.pod:925
23117 msgid "See also C<guestfs_realpath>."
23121 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7414
23122 msgid "(Added in 1.0.75)"
23126 #: ../src/guestfs-actions.pod:932
23127 msgid "guestfs_cat"
23131 #: ../src/guestfs-actions.pod:934
23135 " guestfs_cat (guestfs_h *g,\n"
23136 " const char *path);\n"
23141 #: ../src/guestfs-actions.pod:940
23143 "Note that this function cannot correctly handle binary files (specifically, "
23144 "files containing C<\\0> character which is treated as end of string). For "
23145 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
23146 "functions which have a more complex interface."
23150 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3767
23151 #: ../src/guestfs-actions.pod:3849 ../src/guestfs-actions.pod:3866
23152 #: ../src/guestfs-actions.pod:3954 ../src/guestfs-actions.pod:4362
23153 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:5747
23154 #: ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:7567
23155 #: ../src/guestfs-actions.pod:7581
23156 msgid "(Added in 0.4)"
23160 #: ../src/guestfs-actions.pod:953
23161 msgid "guestfs_checksum"
23165 #: ../src/guestfs-actions.pod:955
23169 " guestfs_checksum (guestfs_h *g,\n"
23170 " const char *csumtype,\n"
23171 " const char *path);\n"
23176 #: ../src/guestfs-actions.pod:1001
23177 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
23181 #: ../src/guestfs-actions.pod:1003
23182 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
23186 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1316
23187 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:3465
23188 #: ../src/guestfs-actions.pod:3494 ../src/guestfs-actions.pod:3555
23189 #: ../src/guestfs-actions.pod:3582 ../src/guestfs-actions.pod:7270
23190 msgid "(Added in 1.0.2)"
23194 #: ../src/guestfs-actions.pod:1010
23195 msgid "guestfs_checksum_device"
23199 #: ../src/guestfs-actions.pod:1012
23203 " guestfs_checksum_device (guestfs_h *g,\n"
23204 " const char *csumtype,\n"
23205 " const char *device);\n"
23210 #: ../src/guestfs-actions.pod:1017
23212 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
23213 "device named C<device>. For the types of checksums supported see the "
23214 "C<guestfs_checksum> command."
23218 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5196
23219 #: ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5368
23220 #: ../src/guestfs-actions.pod:5386 ../src/guestfs-actions.pod:5568
23221 #: ../src/guestfs-actions.pod:7179 ../src/guestfs-actions.pod:7193
23222 #: ../src/guestfs-actions.pod:7593
23223 msgid "(Added in 1.3.2)"
23227 #: ../src/guestfs-actions.pod:1026
23228 msgid "guestfs_checksums_out"
23232 #: ../src/guestfs-actions.pod:1028
23236 " guestfs_checksums_out (guestfs_h *g,\n"
23237 " const char *csumtype,\n"
23238 " const char *directory,\n"
23239 " const char *sumsfile);\n"
23244 #: ../src/guestfs-actions.pod:1048
23245 msgid "(Added in 1.3.7)"
23249 #: ../src/guestfs-actions.pod:1050
23250 msgid "guestfs_chmod"
23254 #: ../src/guestfs-actions.pod:1052
23258 " guestfs_chmod (guestfs_h *g,\n"
23260 " const char *path);\n"
23265 #: ../src/guestfs-actions.pod:1070
23266 msgid "guestfs_chown"
23270 #: ../src/guestfs-actions.pod:1072
23274 " guestfs_chown (guestfs_h *g,\n"
23277 " const char *path);\n"
23282 #: ../src/guestfs-actions.pod:1088
23283 msgid "guestfs_command"
23287 #: ../src/guestfs-actions.pod:1090
23291 " guestfs_command (guestfs_h *g,\n"
23292 " char *const *arguments);\n"
23297 #: ../src/guestfs-actions.pod:1099
23299 "The single parameter is an argv-style list of arguments. The first element "
23300 "is the name of the program to run. Subsequent elements are parameters. The "
23301 "list must be non-empty (ie. must contain a program name). Note that the "
23302 "command runs directly, and is I<not> invoked via the shell (see "
23307 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150
23308 #: ../src/guestfs-actions.pod:1615
23309 msgid "(Added in 0.9.1)"
23313 #: ../src/guestfs-actions.pod:1132
23314 msgid "guestfs_command_lines"
23318 #: ../src/guestfs-actions.pod:1134
23322 " guestfs_command_lines (guestfs_h *g,\n"
23323 " char *const *arguments);\n"
23328 #: ../src/guestfs-actions.pod:1138
23330 "This is the same as C<guestfs_command>, but splits the result into a list of "
23335 #: ../src/guestfs-actions.pod:1141
23336 msgid "See also: C<guestfs_sh_lines>"
23340 #: ../src/guestfs-actions.pod:1152
23341 msgid "guestfs_config"
23345 #: ../src/guestfs-actions.pod:1154
23349 " guestfs_config (guestfs_h *g,\n"
23350 " const char *qemuparam,\n"
23351 " const char *qemuvalue);\n"
23356 #: ../src/guestfs-actions.pod:1172
23357 msgid "guestfs_copy_size"
23361 #: ../src/guestfs-actions.pod:1174
23365 " guestfs_copy_size (guestfs_h *g,\n"
23366 " const char *src,\n"
23367 " const char *dest,\n"
23368 " int64_t size);\n"
23373 #: ../src/guestfs-actions.pod:1188 ../src/guestfs-actions.pod:1311
23374 #: ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:1387
23375 #: ../src/guestfs-actions.pod:1764 ../src/guestfs-actions.pod:1786
23376 #: ../src/guestfs-actions.pod:3665 ../src/guestfs-actions.pod:7265
23377 #: ../src/guestfs-actions.pod:7299 ../src/guestfs-actions.pod:7806
23378 #: ../src/guestfs-actions.pod:7829
23380 "This long-running command can generate progress notification messages so "
23381 "that the caller can display a progress bar or indicator. To receive these "
23382 "messages, the caller must register a progress event callback. See L<guestfs"
23383 "(3)/GUESTFS_EVENT_PROGRESS>."
23387 #: ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:4389
23388 #: ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:7500
23389 #: ../src/guestfs-actions.pod:7520 ../src/guestfs-actions.pod:7606
23390 msgid "(Added in 1.0.87)"
23394 #: ../src/guestfs-actions.pod:1195
23399 #: ../src/guestfs-actions.pod:1197
23403 " guestfs_cp (guestfs_h *g,\n"
23404 " const char *src,\n"
23405 " const char *dest);\n"
23410 #: ../src/guestfs-actions.pod:1207 ../src/guestfs-actions.pod:1221
23411 #: ../src/guestfs-actions.pod:1293 ../src/guestfs-actions.pod:1367
23412 #: ../src/guestfs-actions.pod:1481 ../src/guestfs-actions.pod:5143
23413 #: ../src/guestfs-actions.pod:5618
23414 msgid "(Added in 1.0.18)"
23418 #: ../src/guestfs-actions.pod:1209
23419 msgid "guestfs_cp_a"
23423 #: ../src/guestfs-actions.pod:1211
23427 " guestfs_cp_a (guestfs_h *g,\n"
23428 " const char *src,\n"
23429 " const char *dest);\n"
23434 #: ../src/guestfs-actions.pod:1223
23439 #: ../src/guestfs-actions.pod:1225
23443 " guestfs_dd (guestfs_h *g,\n"
23444 " const char *src,\n"
23445 " const char *dest);\n"
23450 #: ../src/guestfs-actions.pod:1235
23452 "If the destination is a device, it must be as large or larger than the "
23453 "source file or device, otherwise the copy will fail. This command cannot do "
23454 "partial copies (see C<guestfs_copy_size>)."
23458 #: ../src/guestfs-actions.pod:1243
23463 #: ../src/guestfs-actions.pod:1245
23467 " guestfs_df (guestfs_h *g);\n"
23472 #: ../src/guestfs-actions.pod:1250 ../src/guestfs-actions.pod:1267
23474 "This command is mostly useful for interactive sessions. It is I<not> "
23475 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
23480 #: ../src/guestfs-actions.pod:1257 ../src/guestfs-actions.pod:1274
23481 #: ../src/guestfs-actions.pod:1392 ../src/guestfs-actions.pod:2388
23482 #: ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2480
23483 #: ../src/guestfs-actions.pod:4499 ../src/guestfs-actions.pod:5043
23484 #: ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7027
23485 #: ../src/guestfs-actions.pod:7646 ../src/guestfs-actions.pod:7659
23486 #: ../src/guestfs-actions.pod:7672
23487 msgid "(Added in 1.0.54)"
23491 #: ../src/guestfs-actions.pod:1259
23492 msgid "guestfs_df_h"
23496 #: ../src/guestfs-actions.pod:1261
23500 " guestfs_df_h (guestfs_h *g);\n"
23505 #: ../src/guestfs-actions.pod:1276
23506 msgid "guestfs_dmesg"
23510 #: ../src/guestfs-actions.pod:1278
23514 " guestfs_dmesg (guestfs_h *g);\n"
23519 #: ../src/guestfs-actions.pod:1285
23521 "Another way to get the same information is to enable verbose messages with "
23522 "C<guestfs_set_verbose> or by setting the environment variable "
23523 "C<LIBGUESTFS_DEBUG=1> before running the program."
23527 #: ../src/guestfs-actions.pod:1295
23528 msgid "guestfs_download"
23532 #: ../src/guestfs-actions.pod:1297
23536 " guestfs_download (guestfs_h *g,\n"
23537 " const char *remotefilename,\n"
23538 " const char *filename);\n"
23543 #: ../src/guestfs-actions.pod:1307
23544 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
23548 #: ../src/guestfs-actions.pod:1318
23549 msgid "guestfs_download_offset"
23553 #: ../src/guestfs-actions.pod:1320
23557 " guestfs_download_offset (guestfs_h *g,\n"
23558 " const char *remotefilename,\n"
23559 " const char *filename,\n"
23560 " int64_t offset,\n"
23561 " int64_t size);\n"
23566 #: ../src/guestfs-actions.pod:1333
23568 "Note that there is no limit on the amount of data that can be downloaded "
23569 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
23570 "full amount unless an error occurs."
23574 #: ../src/guestfs-actions.pod:1338
23575 msgid "See also C<guestfs_download>, C<guestfs_pread>."
23579 #: ../src/guestfs-actions.pod:1347 ../src/guestfs-actions.pod:7304
23580 msgid "(Added in 1.5.17)"
23584 #: ../src/guestfs-actions.pod:1349
23585 msgid "guestfs_drop_caches"
23589 #: ../src/guestfs-actions.pod:1351
23593 " guestfs_drop_caches (guestfs_h *g,\n"
23594 " int whattodrop);\n"
23599 #: ../src/guestfs-actions.pod:1369
23604 #: ../src/guestfs-actions.pod:1371
23608 " guestfs_du (guestfs_h *g,\n"
23609 " const char *path);\n"
23614 #: ../src/guestfs-actions.pod:1394
23615 msgid "guestfs_e2fsck_f"
23619 #: ../src/guestfs-actions.pod:1396
23623 " guestfs_e2fsck_f (guestfs_h *g,\n"
23624 " const char *device);\n"
23629 #: ../src/guestfs-actions.pod:1404
23631 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
23632 "Normally you should use C<guestfs_fsck>."
23636 #: ../src/guestfs-actions.pod:1409
23637 msgid "(Added in 1.0.29)"
23641 #: ../src/guestfs-actions.pod:1411
23642 msgid "guestfs_echo_daemon"
23646 #: ../src/guestfs-actions.pod:1413
23650 " guestfs_echo_daemon (guestfs_h *g,\n"
23651 " char *const *words);\n"
23656 #: ../src/guestfs-actions.pod:1422
23657 msgid "See also C<guestfs_ping_daemon>."
23661 #: ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:2174
23662 #: ../src/guestfs-actions.pod:6475
23663 msgid "(Added in 1.0.69)"
23667 #: ../src/guestfs-actions.pod:1429
23668 msgid "guestfs_egrep"
23672 #: ../src/guestfs-actions.pod:1431
23676 " guestfs_egrep (guestfs_h *g,\n"
23677 " const char *regex,\n"
23678 " const char *path);\n"
23683 #: ../src/guestfs-actions.pod:1446 ../src/guestfs-actions.pod:1465
23684 #: ../src/guestfs-actions.pod:1522 ../src/guestfs-actions.pod:1568
23685 #: ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:2304
23686 #: ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:2501
23687 #: ../src/guestfs-actions.pod:2514 ../src/guestfs-actions.pod:2529
23688 #: ../src/guestfs-actions.pod:2575 ../src/guestfs-actions.pod:2597
23689 #: ../src/guestfs-actions.pod:2610 ../src/guestfs-actions.pod:3879
23690 #: ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3906
23691 #: ../src/guestfs-actions.pod:3920 ../src/guestfs-actions.pod:4921
23692 #: ../src/guestfs-actions.pod:5952 ../src/guestfs-actions.pod:6001
23693 #: ../src/guestfs-actions.pod:6871 ../src/guestfs-actions.pod:6883
23694 #: ../src/guestfs-actions.pod:6896 ../src/guestfs-actions.pod:6909
23695 #: ../src/guestfs-actions.pod:6931 ../src/guestfs-actions.pod:6944
23696 #: ../src/guestfs-actions.pod:6957 ../src/guestfs-actions.pod:6970
23697 #: ../src/guestfs-actions.pod:7764 ../src/guestfs-actions.pod:7783
23698 #: ../src/guestfs-actions.pod:7877 ../src/guestfs-actions.pod:7896
23699 #: ../src/guestfs-actions.pod:7942 ../src/guestfs-actions.pod:7961
23700 msgid "(Added in 1.0.66)"
23704 #: ../src/guestfs-actions.pod:1448
23705 msgid "guestfs_egrepi"
23709 #: ../src/guestfs-actions.pod:1450
23713 " guestfs_egrepi (guestfs_h *g,\n"
23714 " const char *regex,\n"
23715 " const char *path);\n"
23720 #: ../src/guestfs-actions.pod:1467
23721 msgid "guestfs_equal"
23725 #: ../src/guestfs-actions.pod:1469
23729 " guestfs_equal (guestfs_h *g,\n"
23730 " const char *file1,\n"
23731 " const char *file2);\n"
23736 #: ../src/guestfs-actions.pod:1483
23737 msgid "guestfs_exists"
23741 #: ../src/guestfs-actions.pod:1485
23745 " guestfs_exists (guestfs_h *g,\n"
23746 " const char *path);\n"
23751 #: ../src/guestfs-actions.pod:1492
23752 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
23756 #: ../src/guestfs-actions.pod:1498
23757 msgid "guestfs_fallocate"
23761 #: ../src/guestfs-actions.pod:1500
23765 " guestfs_fallocate (guestfs_h *g,\n"
23766 " const char *path,\n"
23772 #: ../src/guestfs-actions.pod:1515
23774 "This function is deprecated. In new code, use the L</guestfs_fallocate64> "
23779 #: ../src/guestfs-actions.pod:1524
23780 msgid "guestfs_fallocate64"
23784 #: ../src/guestfs-actions.pod:1526
23788 " guestfs_fallocate64 (guestfs_h *g,\n"
23789 " const char *path,\n"
23795 #: ../src/guestfs-actions.pod:1535
23797 "Note that this call allocates disk blocks for the file. To create a sparse "
23798 "file use C<guestfs_truncate_size> instead."
23802 #: ../src/guestfs-actions.pod:1538
23804 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
23805 "oversight it only allowed 30 bit lengths to be specified, effectively "
23806 "limiting the maximum size of files created through that call to 1GB."
23810 #: ../src/guestfs-actions.pod:1549
23811 msgid "(Added in 1.3.17)"
23815 #: ../src/guestfs-actions.pod:1551
23816 msgid "guestfs_fgrep"
23820 #: ../src/guestfs-actions.pod:1553
23824 " guestfs_fgrep (guestfs_h *g,\n"
23825 " const char *pattern,\n"
23826 " const char *path);\n"
23831 #: ../src/guestfs-actions.pod:1570
23832 msgid "guestfs_fgrepi"
23836 #: ../src/guestfs-actions.pod:1572
23840 " guestfs_fgrepi (guestfs_h *g,\n"
23841 " const char *pattern,\n"
23842 " const char *path);\n"
23847 #: ../src/guestfs-actions.pod:1589
23848 msgid "guestfs_file"
23852 #: ../src/guestfs-actions.pod:1591
23856 " guestfs_file (guestfs_h *g,\n"
23857 " const char *path);\n"
23862 #: ../src/guestfs-actions.pod:1609
23864 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
23865 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
23869 #: ../src/guestfs-actions.pod:1617
23870 msgid "guestfs_file_architecture"
23874 #: ../src/guestfs-actions.pod:1619
23878 " guestfs_file_architecture (guestfs_h *g,\n"
23879 " const char *filename);\n"
23884 #: ../src/guestfs-actions.pod:1727 ../src/guestfs-actions.pod:1890
23885 #: ../src/guestfs-actions.pod:1907 ../src/guestfs-actions.pod:2630
23886 #: ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:2786
23887 #: ../src/guestfs-actions.pod:2973 ../src/guestfs-actions.pod:2991
23888 #: ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:3106
23889 #: ../src/guestfs-actions.pod:3199 ../src/guestfs-actions.pod:3436
23890 #: ../src/guestfs-actions.pod:3568
23891 msgid "(Added in 1.5.3)"
23895 #: ../src/guestfs-actions.pod:1729
23896 msgid "guestfs_filesize"
23900 #: ../src/guestfs-actions.pod:1731
23904 " guestfs_filesize (guestfs_h *g,\n"
23905 " const char *file);\n"
23910 #: ../src/guestfs-actions.pod:1737
23912 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
23913 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
23914 "devices, use C<guestfs_blockdev_getsize64>."
23918 #: ../src/guestfs-actions.pod:1743
23919 msgid "(Added in 1.0.82)"
23923 #: ../src/guestfs-actions.pod:1745
23924 msgid "guestfs_fill"
23928 #: ../src/guestfs-actions.pod:1747
23932 " guestfs_fill (guestfs_h *g,\n"
23935 " const char *path);\n"
23940 #: ../src/guestfs-actions.pod:1757
23942 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
23943 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
23944 "bytes use C<guestfs_fill_pattern>."
23948 #: ../src/guestfs-actions.pod:1769
23949 msgid "(Added in 1.0.79)"
23953 #: ../src/guestfs-actions.pod:1771
23954 msgid "guestfs_fill_pattern"
23958 #: ../src/guestfs-actions.pod:1773
23962 " guestfs_fill_pattern (guestfs_h *g,\n"
23963 " const char *pattern,\n"
23965 " const char *path);\n"
23970 #: ../src/guestfs-actions.pod:1779
23972 "This function is like C<guestfs_fill> except that it creates a new file of "
23973 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
23974 "pattern is truncated if necessary to ensure the length of the file is "
23975 "exactly C<len> bytes."
23979 #: ../src/guestfs-actions.pod:1791
23980 msgid "(Added in 1.3.12)"
23984 #: ../src/guestfs-actions.pod:1793
23985 msgid "guestfs_find"
23989 #: ../src/guestfs-actions.pod:1795
23993 " guestfs_find (guestfs_h *g,\n"
23994 " const char *directory);\n"
23999 #: ../src/guestfs-actions.pod:1811
24001 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
24005 #: ../src/guestfs-actions.pod:1824
24006 msgid "See also C<guestfs_find0>."
24010 #: ../src/guestfs-actions.pod:1833 ../src/guestfs-actions.pod:4326
24011 #: ../src/guestfs-actions.pod:6036
24012 msgid "(Added in 1.0.27)"
24016 #: ../src/guestfs-actions.pod:1835
24017 msgid "guestfs_find0"
24021 #: ../src/guestfs-actions.pod:1837
24025 " guestfs_find0 (guestfs_h *g,\n"
24026 " const char *directory,\n"
24027 " const char *files);\n"
24032 #: ../src/guestfs-actions.pod:1846
24034 "This command works the same way as C<guestfs_find> with the following "
24039 #: ../src/guestfs-actions.pod:1873
24040 msgid "(Added in 1.0.74)"
24044 #: ../src/guestfs-actions.pod:1875
24045 msgid "guestfs_findfs_label"
24049 #: ../src/guestfs-actions.pod:1877
24053 " guestfs_findfs_label (guestfs_h *g,\n"
24054 " const char *label);\n"
24059 #: ../src/guestfs-actions.pod:1885
24060 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
24064 #: ../src/guestfs-actions.pod:1892
24065 msgid "guestfs_findfs_uuid"
24069 #: ../src/guestfs-actions.pod:1894
24073 " guestfs_findfs_uuid (guestfs_h *g,\n"
24074 " const char *uuid);\n"
24079 #: ../src/guestfs-actions.pod:1902
24080 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
24084 #: ../src/guestfs-actions.pod:1909
24085 msgid "guestfs_fsck"
24089 #: ../src/guestfs-actions.pod:1911
24093 " guestfs_fsck (guestfs_h *g,\n"
24094 " const char *fstype,\n"
24095 " const char *device);\n"
24100 #: ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:7811
24101 msgid "(Added in 1.0.16)"
24105 #: ../src/guestfs-actions.pod:1948
24106 msgid "guestfs_get_append"
24110 #: ../src/guestfs-actions.pod:1950
24114 " guestfs_get_append (guestfs_h *g);\n"
24119 #: ../src/guestfs-actions.pod:1958
24121 "This function returns a string which may be NULL. There is no way to return "
24122 "an error from this function. The string is owned by the guest handle and "
24123 "must I<not> be freed."
24127 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:5714
24128 #: ../src/guestfs-actions.pod:6196 ../src/guestfs-actions.pod:6638
24129 #: ../src/guestfs-actions.pod:6657 ../src/guestfs-actions.pod:6673
24130 #: ../src/guestfs-actions.pod:6697 ../src/guestfs-actions.pod:7451
24131 #: ../src/guestfs-actions.pod:7466 ../src/guestfs-actions.pod:7858
24132 msgid "(Added in 1.0.26)"
24136 #: ../src/guestfs-actions.pod:1964
24137 msgid "guestfs_get_attach_method"
24141 #: ../src/guestfs-actions.pod:1966
24145 " guestfs_get_attach_method (guestfs_h *g);\n"
24150 #: ../src/guestfs-actions.pod:1969
24151 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
24155 #: ../src/guestfs-actions.pod:1974 ../src/guestfs-actions.pod:6226
24156 msgid "(Added in 1.9.8)"
24160 #: ../src/guestfs-actions.pod:1976
24161 msgid "guestfs_get_autosync"
24165 #: ../src/guestfs-actions.pod:1978
24169 " guestfs_get_autosync (guestfs_h *g);\n"
24174 #: ../src/guestfs-actions.pod:1987
24175 msgid "guestfs_get_direct"
24179 #: ../src/guestfs-actions.pod:1989
24183 " guestfs_get_direct (guestfs_h *g);\n"
24188 #: ../src/guestfs-actions.pod:1996 ../src/guestfs-actions.pod:6267
24189 msgid "(Added in 1.0.72)"
24193 #: ../src/guestfs-actions.pod:1998
24194 msgid "guestfs_get_e2label"
24198 #: ../src/guestfs-actions.pod:2000
24202 " guestfs_get_e2label (guestfs_h *g,\n"
24203 " const char *device);\n"
24208 #: ../src/guestfs-actions.pod:2010
24210 "This function is deprecated. In new code, use the L</guestfs_vfs_label> "
24215 #: ../src/guestfs-actions.pod:2017 ../src/guestfs-actions.pod:2038
24216 #: ../src/guestfs-actions.pod:6285 ../src/guestfs-actions.pod:6304
24217 msgid "(Added in 1.0.15)"
24221 #: ../src/guestfs-actions.pod:2019
24222 msgid "guestfs_get_e2uuid"
24226 #: ../src/guestfs-actions.pod:2021
24230 " guestfs_get_e2uuid (guestfs_h *g,\n"
24231 " const char *device);\n"
24236 #: ../src/guestfs-actions.pod:2031
24238 "This function is deprecated. In new code, use the L</guestfs_vfs_uuid> call "
24243 #: ../src/guestfs-actions.pod:2040
24244 msgid "guestfs_get_memsize"
24248 #: ../src/guestfs-actions.pod:2042
24252 " guestfs_get_memsize (guestfs_h *g);\n"
24257 #: ../src/guestfs-actions.pod:2048
24259 "If C<guestfs_set_memsize> was not called on this handle, and if "
24260 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
24261 "value for memsize."
24265 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:4617
24266 #: ../src/guestfs-actions.pod:4826 ../src/guestfs-actions.pod:4845
24267 #: ../src/guestfs-actions.pod:4864 ../src/guestfs-actions.pod:4876
24268 #: ../src/guestfs-actions.pod:4893 ../src/guestfs-actions.pod:4906
24269 #: ../src/guestfs-actions.pod:5939 ../src/guestfs-actions.pod:6325
24270 #: ../src/guestfs-actions.pod:6605 ../src/guestfs-actions.pod:7220
24271 msgid "(Added in 1.0.55)"
24275 #: ../src/guestfs-actions.pod:2059
24276 msgid "guestfs_get_network"
24280 #: ../src/guestfs-actions.pod:2061
24284 " guestfs_get_network (guestfs_h *g);\n"
24289 #: ../src/guestfs-actions.pod:2068 ../src/guestfs-actions.pod:6344
24290 msgid "(Added in 1.5.4)"
24294 #: ../src/guestfs-actions.pod:2070
24295 msgid "guestfs_get_path"
24299 #: ../src/guestfs-actions.pod:2072
24303 " guestfs_get_path (guestfs_h *g);\n"
24308 #: ../src/guestfs-actions.pod:2080 ../src/guestfs-actions.pod:2120
24310 "This function returns a string, or NULL on error. The string is owned by "
24311 "the guest handle and must I<not> be freed."
24315 #: ../src/guestfs-actions.pod:2085
24316 msgid "guestfs_get_pgroup"
24320 #: ../src/guestfs-actions.pod:2087
24324 " guestfs_get_pgroup (guestfs_h *g);\n"
24329 #: ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:6380
24330 #: ../src/guestfs-actions.pod:7712
24331 msgid "(Added in 1.11.18)"
24335 #: ../src/guestfs-actions.pod:2096
24336 msgid "guestfs_get_pid"
24340 #: ../src/guestfs-actions.pod:2098
24344 " guestfs_get_pid (guestfs_h *g);\n"
24349 #: ../src/guestfs-actions.pod:2108
24350 msgid "(Added in 1.0.56)"
24354 #: ../src/guestfs-actions.pod:2110
24355 msgid "guestfs_get_qemu"
24359 #: ../src/guestfs-actions.pod:2112
24363 " guestfs_get_qemu (guestfs_h *g);\n"
24368 #: ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:6408
24369 msgid "(Added in 1.0.6)"
24373 #: ../src/guestfs-actions.pod:2125
24374 msgid "guestfs_get_recovery_proc"
24378 #: ../src/guestfs-actions.pod:2127
24382 " guestfs_get_recovery_proc (guestfs_h *g);\n"
24387 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:3690
24388 #: ../src/guestfs-actions.pod:4021 ../src/guestfs-actions.pod:4424
24389 #: ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:5644
24390 #: ../src/guestfs-actions.pod:5987 ../src/guestfs-actions.pod:6432
24391 #: ../src/guestfs-actions.pod:7123 ../src/guestfs-actions.pod:7143
24392 #: ../src/guestfs-actions.pod:7335
24393 msgid "(Added in 1.0.77)"
24397 #: ../src/guestfs-actions.pod:2136
24398 msgid "guestfs_get_selinux"
24402 #: ../src/guestfs-actions.pod:2138
24406 " guestfs_get_selinux (guestfs_h *g);\n"
24411 #: ../src/guestfs-actions.pod:2141
24413 "This returns the current setting of the selinux flag which is passed to the "
24414 "appliance at boot time. See C<guestfs_set_selinux>."
24418 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2212
24419 #: ../src/guestfs-actions.pod:6451 ../src/guestfs-actions.pod:6509
24420 msgid "(Added in 1.0.67)"
24424 #: ../src/guestfs-actions.pod:2151
24425 msgid "guestfs_get_state"
24429 #: ../src/guestfs-actions.pod:2153
24433 " guestfs_get_state (guestfs_h *g);\n"
24438 #: ../src/guestfs-actions.pod:2165
24439 msgid "guestfs_get_trace"
24443 #: ../src/guestfs-actions.pod:2167
24447 " guestfs_get_trace (guestfs_h *g);\n"
24452 #: ../src/guestfs-actions.pod:2176
24453 msgid "guestfs_get_umask"
24457 #: ../src/guestfs-actions.pod:2178
24461 " guestfs_get_umask (guestfs_h *g);\n"
24466 #: ../src/guestfs-actions.pod:2181
24468 "Return the current umask. By default the umask is C<022> unless it has been "
24469 "set by calling C<guestfs_umask>."
24473 #: ../src/guestfs-actions.pod:2188
24474 msgid "guestfs_get_verbose"
24478 #: ../src/guestfs-actions.pod:2190
24482 " guestfs_get_verbose (guestfs_h *g);\n"
24487 #: ../src/guestfs-actions.pod:2199
24488 msgid "guestfs_getcon"
24492 #: ../src/guestfs-actions.pod:2201
24496 " guestfs_getcon (guestfs_h *g);\n"
24501 #: ../src/guestfs-actions.pod:2206
24503 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
24507 #: ../src/guestfs-actions.pod:2214
24508 msgid "guestfs_getxattr"
24512 #: ../src/guestfs-actions.pod:2216
24516 " guestfs_getxattr (guestfs_h *g,\n"
24517 " const char *path,\n"
24518 " const char *name,\n"
24519 " size_t *size_r);\n"
24524 #: ../src/guestfs-actions.pod:2222
24526 "Get a single extended attribute from file C<path> named C<name>. This call "
24527 "follows symlinks. If you want to lookup an extended attribute for the "
24528 "symlink itself, use C<guestfs_lgetxattr>."
24532 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:3704
24534 "Normally it is better to get all extended attributes from a file in one go "
24535 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
24536 "implementations are buggy and do not provide a way to list out attributes. "
24537 "For these filesystems (notably ntfs-3g) you have to know the names of the "
24538 "extended attributes you want in advance and call this function."
24542 #: ../src/guestfs-actions.pod:2236
24543 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
24547 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2451
24548 #: ../src/guestfs-actions.pod:2921 ../src/guestfs-actions.pod:3716
24549 #: ../src/guestfs-actions.pod:5637 ../src/guestfs-actions.pod:5663
24550 #: ../src/guestfs-actions.pod:5844
24552 "This function returns a buffer, or NULL on error. The size of the returned "
24553 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
24558 #: ../src/guestfs-actions.pod:2242 ../src/guestfs-actions.pod:3720
24559 msgid "(Added in 1.7.24)"
24563 #: ../src/guestfs-actions.pod:2244
24564 msgid "guestfs_getxattrs"
24568 #: ../src/guestfs-actions.pod:2246
24571 " struct guestfs_xattr_list *\n"
24572 " guestfs_getxattrs (guestfs_h *g,\n"
24573 " const char *path);\n"
24578 #: ../src/guestfs-actions.pod:2256
24579 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
24583 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:3732
24584 #: ../src/guestfs-actions.pod:4420
24586 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
24587 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
24591 #: ../src/guestfs-actions.pod:2262 ../src/guestfs-actions.pod:3736
24592 #: ../src/guestfs-actions.pod:3935 ../src/guestfs-actions.pod:3971
24593 #: ../src/guestfs-actions.pod:6017 ../src/guestfs-actions.pod:6528
24594 #: ../src/guestfs-actions.pod:7923
24595 msgid "(Added in 1.0.59)"
24599 #: ../src/guestfs-actions.pod:2264
24600 msgid "guestfs_glob_expand"
24604 #: ../src/guestfs-actions.pod:2266
24608 " guestfs_glob_expand (guestfs_h *g,\n"
24609 " const char *pattern);\n"
24614 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:6721
24615 #: ../src/guestfs-actions.pod:6738
24616 msgid "(Added in 1.0.50)"
24620 #: ../src/guestfs-actions.pod:2287
24621 msgid "guestfs_grep"
24625 #: ../src/guestfs-actions.pod:2289
24629 " guestfs_grep (guestfs_h *g,\n"
24630 " const char *regex,\n"
24631 " const char *path);\n"
24636 #: ../src/guestfs-actions.pod:2306
24637 msgid "guestfs_grepi"
24641 #: ../src/guestfs-actions.pod:2308
24645 " guestfs_grepi (guestfs_h *g,\n"
24646 " const char *regex,\n"
24647 " const char *path);\n"
24652 #: ../src/guestfs-actions.pod:2325
24653 msgid "guestfs_grub_install"
24657 #: ../src/guestfs-actions.pod:2327
24661 " guestfs_grub_install (guestfs_h *g,\n"
24662 " const char *root,\n"
24663 " const char *device);\n"
24668 #: ../src/guestfs-actions.pod:2370
24669 msgid "(Added in 1.0.17)"
24673 #: ../src/guestfs-actions.pod:2372
24674 msgid "guestfs_head"
24678 #: ../src/guestfs-actions.pod:2374
24682 " guestfs_head (guestfs_h *g,\n"
24683 " const char *path);\n"
24688 #: ../src/guestfs-actions.pod:2390
24689 msgid "guestfs_head_n"
24693 #: ../src/guestfs-actions.pod:2392
24697 " guestfs_head_n (guestfs_h *g,\n"
24699 " const char *path);\n"
24704 #: ../src/guestfs-actions.pod:2414
24705 msgid "guestfs_hexdump"
24709 #: ../src/guestfs-actions.pod:2416
24713 " guestfs_hexdump (guestfs_h *g,\n"
24714 " const char *path);\n"
24719 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:6802
24720 #: ../src/guestfs-actions.pod:6857
24721 msgid "(Added in 1.0.22)"
24725 #: ../src/guestfs-actions.pod:2431
24726 msgid "guestfs_initrd_cat"
24730 #: ../src/guestfs-actions.pod:2433
24734 " guestfs_initrd_cat (guestfs_h *g,\n"
24735 " const char *initrdpath,\n"
24736 " const char *filename,\n"
24737 " size_t *size_r);\n"
24742 #: ../src/guestfs-actions.pod:2449
24743 msgid "See also C<guestfs_initrd_list>."
24747 #: ../src/guestfs-actions.pod:2460
24748 msgid "guestfs_initrd_list"
24752 #: ../src/guestfs-actions.pod:2462
24756 " guestfs_initrd_list (guestfs_h *g,\n"
24757 " const char *path);\n"
24762 #: ../src/guestfs-actions.pod:2482
24763 msgid "guestfs_inotify_add_watch"
24767 #: ../src/guestfs-actions.pod:2484
24771 " guestfs_inotify_add_watch (guestfs_h *g,\n"
24772 " const char *path,\n"
24778 #: ../src/guestfs-actions.pod:2503
24779 msgid "guestfs_inotify_close"
24783 #: ../src/guestfs-actions.pod:2505
24787 " guestfs_inotify_close (guestfs_h *g);\n"
24792 #: ../src/guestfs-actions.pod:2516
24793 msgid "guestfs_inotify_files"
24797 #: ../src/guestfs-actions.pod:2518
24801 " guestfs_inotify_files (guestfs_h *g);\n"
24806 #: ../src/guestfs-actions.pod:2521
24808 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
24809 "returns a list of pathnames of objects that were touched. The returned "
24810 "pathnames are sorted and deduplicated."
24814 #: ../src/guestfs-actions.pod:2531
24815 msgid "guestfs_inotify_init"
24819 #: ../src/guestfs-actions.pod:2533
24823 " guestfs_inotify_init (guestfs_h *g,\n"
24824 " int maxevents);\n"
24829 #: ../src/guestfs-actions.pod:2541
24831 "C<maxevents> is the maximum number of events which will be queued up between "
24832 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
24833 "passed as C<0>, then the kernel (or previously set) default is used. For "
24834 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
24835 "throws away events, but records the fact that it threw them away by setting "
24836 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
24837 "C<guestfs_inotify_read>)."
24841 #: ../src/guestfs-actions.pod:2551
24843 "Before any events are generated, you have to add some watches to the "
24844 "internal watch list. See: C<guestfs_inotify_add_watch>, "
24845 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
24849 #: ../src/guestfs-actions.pod:2557
24851 "Queued up events should be read periodically by calling "
24852 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
24853 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
24854 "often enough then you risk the internal queue overflowing."
24858 #: ../src/guestfs-actions.pod:2564
24860 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
24861 "This also removes any watches automatically."
24865 #: ../src/guestfs-actions.pod:2577
24866 msgid "guestfs_inotify_read"
24870 #: ../src/guestfs-actions.pod:2579
24873 " struct guestfs_inotify_event_list *\n"
24874 " guestfs_inotify_read (guestfs_h *g);\n"
24879 #: ../src/guestfs-actions.pod:2593
24881 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
24882 "there was an error. I<The caller must call "
24883 "C<guestfs_free_inotify_event_list> after use>."
24887 #: ../src/guestfs-actions.pod:2599
24888 msgid "guestfs_inotify_rm_watch"
24892 #: ../src/guestfs-actions.pod:2601
24896 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
24902 #: ../src/guestfs-actions.pod:2605
24904 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
24908 #: ../src/guestfs-actions.pod:2612
24909 msgid "guestfs_inspect_get_arch"
24913 #: ../src/guestfs-actions.pod:2614
24917 " guestfs_inspect_get_arch (guestfs_h *g,\n"
24918 " const char *root);\n"
24923 #: ../src/guestfs-actions.pod:2618
24925 "This returns the architecture of the inspected operating system. The "
24926 "possible return values are listed under C<guestfs_file_architecture>."
24930 #: ../src/guestfs-actions.pod:2632
24931 msgid "guestfs_inspect_get_distro"
24935 #: ../src/guestfs-actions.pod:2634
24939 " guestfs_inspect_get_distro (guestfs_h *g,\n"
24940 " const char *root);\n"
24945 #: ../src/guestfs-actions.pod:2722
24946 msgid "guestfs_inspect_get_drive_mappings"
24950 #: ../src/guestfs-actions.pod:2724
24954 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
24955 " const char *root);\n"
24960 #: ../src/guestfs-actions.pod:2753
24962 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24963 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
24967 #: ../src/guestfs-actions.pod:2757 ../src/guestfs-actions.pod:3025
24968 #: ../src/guestfs-actions.pod:3823 ../src/guestfs-actions.pod:5105
24969 #: ../src/guestfs-actions.pod:7159
24971 "This function returns a NULL-terminated array of strings, or NULL if there "
24972 "was an error. The array of strings will always have length C<2n+1>, where "
24973 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
24974 "caller must free the strings and the array after use>."
24978 #: ../src/guestfs-actions.pod:2763 ../src/guestfs-actions.pod:3219
24979 msgid "(Added in 1.9.17)"
24983 #: ../src/guestfs-actions.pod:2765
24984 msgid "guestfs_inspect_get_filesystems"
24988 #: ../src/guestfs-actions.pod:2767
24992 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
24993 " const char *root);\n"
24998 #: ../src/guestfs-actions.pod:2779
25000 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25001 "C<guestfs_inspect_get_mountpoints>."
25005 #: ../src/guestfs-actions.pod:2788
25006 msgid "guestfs_inspect_get_format"
25010 #: ../src/guestfs-actions.pod:2790
25014 " guestfs_inspect_get_format (guestfs_h *g,\n"
25015 " const char *root);\n"
25020 #: ../src/guestfs-actions.pod:2824 ../src/guestfs-actions.pod:3255
25021 #: ../src/guestfs-actions.pod:3271 ../src/guestfs-actions.pod:3289
25022 #: ../src/guestfs-actions.pod:6055
25023 msgid "(Added in 1.9.4)"
25027 #: ../src/guestfs-actions.pod:2826
25028 msgid "guestfs_inspect_get_hostname"
25032 #: ../src/guestfs-actions.pod:2828
25036 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
25037 " const char *root);\n"
25042 #: ../src/guestfs-actions.pod:2843
25043 msgid "(Added in 1.7.9)"
25047 #: ../src/guestfs-actions.pod:2845
25048 msgid "guestfs_inspect_get_icon"
25052 #: ../src/guestfs-actions.pod:2847
25056 " guestfs_inspect_get_icon (guestfs_h *g,\n"
25057 " const char *root,\n"
25058 " size_t *size_r,\n"
25064 #: ../src/guestfs-actions.pod:2858
25067 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
25068 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
25073 #: ../src/guestfs-actions.pod:2925 ../src/guestfs-actions.pod:3750
25074 #: ../src/guestfs-actions.pod:5004
25075 msgid "(Added in 1.11.12)"
25079 #: ../src/guestfs-actions.pod:2927
25080 msgid "guestfs_inspect_get_icon_va"
25084 #: ../src/guestfs-actions.pod:2929
25088 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
25089 " const char *root,\n"
25090 " size_t *size_r,\n"
25091 " va_list args);\n"
25096 #: ../src/guestfs-actions.pod:2935
25097 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
25101 #: ../src/guestfs-actions.pod:2939
25102 msgid "guestfs_inspect_get_icon_argv"
25106 #: ../src/guestfs-actions.pod:2941
25110 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
25111 " const char *root,\n"
25112 " size_t *size_r,\n"
25113 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
25118 #: ../src/guestfs-actions.pod:2947
25119 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
25123 #: ../src/guestfs-actions.pod:2951
25124 msgid "guestfs_inspect_get_major_version"
25128 #: ../src/guestfs-actions.pod:2953
25132 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
25133 " const char *root);\n"
25138 #: ../src/guestfs-actions.pod:2975
25139 msgid "guestfs_inspect_get_minor_version"
25143 #: ../src/guestfs-actions.pod:2977
25147 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
25148 " const char *root);\n"
25153 #: ../src/guestfs-actions.pod:2986
25155 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25156 "C<guestfs_inspect_get_major_version>."
25160 #: ../src/guestfs-actions.pod:2993
25161 msgid "guestfs_inspect_get_mountpoints"
25165 #: ../src/guestfs-actions.pod:2995
25169 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
25170 " const char *root);\n"
25175 #: ../src/guestfs-actions.pod:3016
25177 "For operating systems like Windows which still use drive letters, this call "
25178 "will only return an entry for the first drive \"mounted on\" C</>. For "
25179 "information about the mapping of drive letters to partitions, see "
25180 "C<guestfs_inspect_get_drive_mappings>."
25184 #: ../src/guestfs-actions.pod:3022
25186 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25187 "C<guestfs_inspect_get_filesystems>."
25191 #: ../src/guestfs-actions.pod:3033
25192 msgid "guestfs_inspect_get_package_format"
25196 #: ../src/guestfs-actions.pod:3035
25200 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
25201 " const char *root);\n"
25206 #: ../src/guestfs-actions.pod:3039
25208 "This function and C<guestfs_inspect_get_package_management> return the "
25209 "package format and package management tool used by the inspected operating "
25210 "system. For example for Fedora these functions would return C<rpm> (package "
25211 "format) and C<yum> (package management)."
25215 #: ../src/guestfs-actions.pod:3057 ../src/guestfs-actions.pod:3085
25216 msgid "(Added in 1.7.5)"
25220 #: ../src/guestfs-actions.pod:3059
25221 msgid "guestfs_inspect_get_package_management"
25225 #: ../src/guestfs-actions.pod:3061
25229 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
25230 " const char *root);\n"
25235 #: ../src/guestfs-actions.pod:3065
25237 "C<guestfs_inspect_get_package_format> and this function return the package "
25238 "format and package management tool used by the inspected operating system. "
25239 "For example for Fedora these functions would return C<rpm> (package format) "
25240 "and C<yum> (package management)."
25244 #: ../src/guestfs-actions.pod:3087
25245 msgid "guestfs_inspect_get_product_name"
25249 #: ../src/guestfs-actions.pod:3089
25253 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
25254 " const char *root);\n"
25259 #: ../src/guestfs-actions.pod:3108
25260 msgid "guestfs_inspect_get_product_variant"
25264 #: ../src/guestfs-actions.pod:3110
25268 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
25269 " const char *root);\n"
25274 #: ../src/guestfs-actions.pod:3133
25276 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25277 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
25281 #: ../src/guestfs-actions.pod:3140
25282 msgid "(Added in 1.9.13)"
25286 #: ../src/guestfs-actions.pod:3142
25287 msgid "guestfs_inspect_get_roots"
25291 #: ../src/guestfs-actions.pod:3144
25295 " guestfs_inspect_get_roots (guestfs_h *g);\n"
25300 #: ../src/guestfs-actions.pod:3147
25302 "This function is a convenient way to get the list of root devices, as "
25303 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
25304 "the whole inspection process."
25308 #: ../src/guestfs-actions.pod:3151
25310 "This returns an empty list if either no root devices were found or the "
25311 "caller has not called C<guestfs_inspect_os>."
25315 #: ../src/guestfs-actions.pod:3160
25316 msgid "(Added in 1.7.3)"
25320 #: ../src/guestfs-actions.pod:3162
25321 msgid "guestfs_inspect_get_type"
25325 #: ../src/guestfs-actions.pod:3164
25329 " guestfs_inspect_get_type (guestfs_h *g,\n"
25330 " const char *root);\n"
25335 #: ../src/guestfs-actions.pod:3201
25336 msgid "guestfs_inspect_get_windows_current_control_set"
25340 #: ../src/guestfs-actions.pod:3203
25344 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
25345 " const char *root);\n"
25350 #: ../src/guestfs-actions.pod:3221
25351 msgid "guestfs_inspect_get_windows_systemroot"
25355 #: ../src/guestfs-actions.pod:3223
25359 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
25360 " const char *root);\n"
25365 #: ../src/guestfs-actions.pod:3239
25366 msgid "(Added in 1.5.25)"
25370 #: ../src/guestfs-actions.pod:3241
25371 msgid "guestfs_inspect_is_live"
25375 #: ../src/guestfs-actions.pod:3243
25379 " guestfs_inspect_is_live (guestfs_h *g,\n"
25380 " const char *root);\n"
25385 #: ../src/guestfs-actions.pod:3247
25387 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25388 "disk), then this returns true if a live image was detected on the disk."
25392 #: ../src/guestfs-actions.pod:3257
25393 msgid "guestfs_inspect_is_multipart"
25397 #: ../src/guestfs-actions.pod:3259
25401 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
25402 " const char *root);\n"
25407 #: ../src/guestfs-actions.pod:3263
25409 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25410 "disk), then this returns true if the disk is part of a set."
25414 #: ../src/guestfs-actions.pod:3273
25415 msgid "guestfs_inspect_is_netinst"
25419 #: ../src/guestfs-actions.pod:3275
25423 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
25424 " const char *root);\n"
25429 #: ../src/guestfs-actions.pod:3279
25431 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25432 "disk), then this returns true if the disk is a network installer, ie. not a "
25433 "self-contained install CD but one which is likely to require network access "
25434 "to complete the install."
25438 #: ../src/guestfs-actions.pod:3291
25439 msgid "guestfs_inspect_list_applications"
25443 #: ../src/guestfs-actions.pod:3293
25446 " struct guestfs_application_list *\n"
25447 " guestfs_inspect_list_applications (guestfs_h *g,\n"
25448 " const char *root);\n"
25453 #: ../src/guestfs-actions.pod:3299
25455 "I<Note:> This call works differently from other parts of the inspection "
25456 "API. You have to call C<guestfs_inspect_os>, then "
25457 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
25458 "this. Listing applications is a significantly more difficult operation "
25459 "which requires access to the full filesystem. Also note that unlike the "
25460 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
25461 "the libguestfs handle, this call actually reads parts of the mounted "
25462 "filesystems during the call."
25466 #: ../src/guestfs-actions.pod:3389
25468 "This function returns a C<struct guestfs_application_list *>, or NULL if "
25469 "there was an error. I<The caller must call C<guestfs_free_application_list> "
25474 #: ../src/guestfs-actions.pod:3393
25475 msgid "(Added in 1.7.8)"
25479 #: ../src/guestfs-actions.pod:3395
25480 msgid "guestfs_inspect_os"
25484 #: ../src/guestfs-actions.pod:3397
25488 " guestfs_inspect_os (guestfs_h *g);\n"
25493 #: ../src/guestfs-actions.pod:3413
25495 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
25496 "functions in order to query further information about each operating system, "
25497 "such as the name and version."
25501 #: ../src/guestfs-actions.pod:3418
25503 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
25504 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
25505 "the contents. This should be called with no disks currently mounted. The "
25506 "function may also use Augeas, so any existing Augeas handle will be closed."
25510 #: ../src/guestfs-actions.pod:3430 ../src/guestfs-actions.pod:3761
25511 #: ../src/guestfs-actions.pod:3843
25512 msgid "See also C<guestfs_list_filesystems>."
25516 #: ../src/guestfs-actions.pod:3438
25517 msgid "guestfs_is_blockdev"
25521 #: ../src/guestfs-actions.pod:3440
25525 " guestfs_is_blockdev (guestfs_h *g,\n"
25526 " const char *path);\n"
25531 #: ../src/guestfs-actions.pod:3447 ../src/guestfs-actions.pod:3476
25532 #: ../src/guestfs-actions.pod:3506 ../src/guestfs-actions.pod:3521
25533 #: ../src/guestfs-actions.pod:3537 ../src/guestfs-actions.pod:3593
25534 #: ../src/guestfs-actions.pod:3608
25535 msgid "See also C<guestfs_stat>."
25539 #: ../src/guestfs-actions.pod:3451 ../src/guestfs-actions.pod:3480
25540 #: ../src/guestfs-actions.pod:3525 ../src/guestfs-actions.pod:3597
25541 #: ../src/guestfs-actions.pod:3612
25542 msgid "(Added in 1.5.10)"
25546 #: ../src/guestfs-actions.pod:3453
25547 msgid "guestfs_is_busy"
25551 #: ../src/guestfs-actions.pod:3455
25555 " guestfs_is_busy (guestfs_h *g);\n"
25560 #: ../src/guestfs-actions.pod:3467
25561 msgid "guestfs_is_chardev"
25565 #: ../src/guestfs-actions.pod:3469
25569 " guestfs_is_chardev (guestfs_h *g,\n"
25570 " const char *path);\n"
25575 #: ../src/guestfs-actions.pod:3482
25576 msgid "guestfs_is_config"
25580 #: ../src/guestfs-actions.pod:3484
25584 " guestfs_is_config (guestfs_h *g);\n"
25589 #: ../src/guestfs-actions.pod:3496
25590 msgid "guestfs_is_dir"
25594 #: ../src/guestfs-actions.pod:3498
25598 " guestfs_is_dir (guestfs_h *g,\n"
25599 " const char *path);\n"
25604 #: ../src/guestfs-actions.pod:3512
25605 msgid "guestfs_is_fifo"
25609 #: ../src/guestfs-actions.pod:3514
25613 " guestfs_is_fifo (guestfs_h *g,\n"
25614 " const char *path);\n"
25619 #: ../src/guestfs-actions.pod:3527
25620 msgid "guestfs_is_file"
25624 #: ../src/guestfs-actions.pod:3529
25628 " guestfs_is_file (guestfs_h *g,\n"
25629 " const char *path);\n"
25634 #: ../src/guestfs-actions.pod:3543
25635 msgid "guestfs_is_launching"
25639 #: ../src/guestfs-actions.pod:3545
25643 " guestfs_is_launching (guestfs_h *g);\n"
25648 #: ../src/guestfs-actions.pod:3557
25649 msgid "guestfs_is_lv"
25653 #: ../src/guestfs-actions.pod:3559
25657 " guestfs_is_lv (guestfs_h *g,\n"
25658 " const char *device);\n"
25663 #: ../src/guestfs-actions.pod:3570
25664 msgid "guestfs_is_ready"
25668 #: ../src/guestfs-actions.pod:3572
25672 " guestfs_is_ready (guestfs_h *g);\n"
25677 #: ../src/guestfs-actions.pod:3584
25678 msgid "guestfs_is_socket"
25682 #: ../src/guestfs-actions.pod:3586
25686 " guestfs_is_socket (guestfs_h *g,\n"
25687 " const char *path);\n"
25692 #: ../src/guestfs-actions.pod:3599
25693 msgid "guestfs_is_symlink"
25697 #: ../src/guestfs-actions.pod:3601
25701 " guestfs_is_symlink (guestfs_h *g,\n"
25702 " const char *path);\n"
25707 #: ../src/guestfs-actions.pod:3614
25708 msgid "guestfs_is_zero"
25712 #: ../src/guestfs-actions.pod:3616
25716 " guestfs_is_zero (guestfs_h *g,\n"
25717 " const char *path);\n"
25722 #: ../src/guestfs-actions.pod:3625 ../src/guestfs-actions.pod:3639
25723 msgid "(Added in 1.11.8)"
25727 #: ../src/guestfs-actions.pod:3627
25728 msgid "guestfs_is_zero_device"
25732 #: ../src/guestfs-actions.pod:3629
25736 " guestfs_is_zero_device (guestfs_h *g,\n"
25737 " const char *device);\n"
25742 #: ../src/guestfs-actions.pod:3641
25743 msgid "guestfs_kill_subprocess"
25747 #: ../src/guestfs-actions.pod:3643
25751 " guestfs_kill_subprocess (guestfs_h *g);\n"
25756 #: ../src/guestfs-actions.pod:3652
25757 msgid "guestfs_launch"
25761 #: ../src/guestfs-actions.pod:3654
25765 " guestfs_launch (guestfs_h *g);\n"
25770 #: ../src/guestfs-actions.pod:3672
25771 msgid "guestfs_lchown"
25775 #: ../src/guestfs-actions.pod:3674
25779 " guestfs_lchown (guestfs_h *g,\n"
25782 " const char *path);\n"
25787 #: ../src/guestfs-actions.pod:3680
25789 "Change the file owner to C<owner> and group to C<group>. This is like "
25790 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
25791 "changed, not the target."
25795 #: ../src/guestfs-actions.pod:3692
25796 msgid "guestfs_lgetxattr"
25800 #: ../src/guestfs-actions.pod:3694
25804 " guestfs_lgetxattr (guestfs_h *g,\n"
25805 " const char *path,\n"
25806 " const char *name,\n"
25807 " size_t *size_r);\n"
25812 #: ../src/guestfs-actions.pod:3714
25813 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
25817 #: ../src/guestfs-actions.pod:3722
25818 msgid "guestfs_lgetxattrs"
25822 #: ../src/guestfs-actions.pod:3724
25825 " struct guestfs_xattr_list *\n"
25826 " guestfs_lgetxattrs (guestfs_h *g,\n"
25827 " const char *path);\n"
25832 #: ../src/guestfs-actions.pod:3728
25834 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
25835 "then it returns the extended attributes of the link itself."
25839 #: ../src/guestfs-actions.pod:3738
25840 msgid "guestfs_list_9p"
25844 #: ../src/guestfs-actions.pod:3740
25848 " guestfs_list_9p (guestfs_h *g);\n"
25853 #: ../src/guestfs-actions.pod:3752
25854 msgid "guestfs_list_devices"
25858 #: ../src/guestfs-actions.pod:3754
25862 " guestfs_list_devices (guestfs_h *g);\n"
25867 #: ../src/guestfs-actions.pod:3769
25868 msgid "guestfs_list_dm_devices"
25872 #: ../src/guestfs-actions.pod:3771
25876 " guestfs_list_dm_devices (guestfs_h *g);\n"
25881 #: ../src/guestfs-actions.pod:3776
25883 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
25884 "previous call to C<guestfs_luks_open>."
25888 #: ../src/guestfs-actions.pod:3779
25890 "Device mapper devices which correspond to logical volumes are I<not> "
25891 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
25896 #: ../src/guestfs-actions.pod:3787 ../src/guestfs-actions.pod:5243
25897 msgid "(Added in 1.11.15)"
25901 #: ../src/guestfs-actions.pod:3789
25902 msgid "guestfs_list_filesystems"
25906 #: ../src/guestfs-actions.pod:3791
25910 " guestfs_list_filesystems (guestfs_h *g);\n"
25915 #: ../src/guestfs-actions.pod:3811
25917 "This command runs other libguestfs commands, which might include "
25918 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
25919 "soon after launch and only when nothing is mounted."
25923 #: ../src/guestfs-actions.pod:3815
25925 "Not all of the filesystems returned will be mountable. In particular, swap "
25926 "partitions are returned in the list. Also this command does not check that "
25927 "each filesystem found is valid and mountable, and some filesystems might be "
25928 "mountable but require special options. Filesystems may not all belong to a "
25929 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
25933 #: ../src/guestfs-actions.pod:3829 ../src/guestfs-actions.pod:5604
25934 msgid "(Added in 1.5.15)"
25938 #: ../src/guestfs-actions.pod:3831
25939 msgid "guestfs_list_partitions"
25943 #: ../src/guestfs-actions.pod:3833
25947 " guestfs_list_partitions (guestfs_h *g);\n"
25952 #: ../src/guestfs-actions.pod:3840
25954 "This does not return logical volumes. For that you will need to call "
25959 #: ../src/guestfs-actions.pod:3851
25964 #: ../src/guestfs-actions.pod:3853
25968 " guestfs_ll (guestfs_h *g,\n"
25969 " const char *directory);\n"
25974 #: ../src/guestfs-actions.pod:3868
25979 #: ../src/guestfs-actions.pod:3870
25983 " guestfs_ln (guestfs_h *g,\n"
25984 " const char *target,\n"
25985 " const char *linkname);\n"
25990 #: ../src/guestfs-actions.pod:3881
25991 msgid "guestfs_ln_f"
25995 #: ../src/guestfs-actions.pod:3883
25999 " guestfs_ln_f (guestfs_h *g,\n"
26000 " const char *target,\n"
26001 " const char *linkname);\n"
26006 #: ../src/guestfs-actions.pod:3895
26007 msgid "guestfs_ln_s"
26011 #: ../src/guestfs-actions.pod:3897
26015 " guestfs_ln_s (guestfs_h *g,\n"
26016 " const char *target,\n"
26017 " const char *linkname);\n"
26022 #: ../src/guestfs-actions.pod:3908
26023 msgid "guestfs_ln_sf"
26027 #: ../src/guestfs-actions.pod:3910
26031 " guestfs_ln_sf (guestfs_h *g,\n"
26032 " const char *target,\n"
26033 " const char *linkname);\n"
26038 #: ../src/guestfs-actions.pod:3922
26039 msgid "guestfs_lremovexattr"
26043 #: ../src/guestfs-actions.pod:3924
26047 " guestfs_lremovexattr (guestfs_h *g,\n"
26048 " const char *xattr,\n"
26049 " const char *path);\n"
26054 #: ../src/guestfs-actions.pod:3929
26056 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
26057 "link, then it removes an extended attribute of the link itself."
26061 #: ../src/guestfs-actions.pod:3937
26066 #: ../src/guestfs-actions.pod:3939
26070 " guestfs_ls (guestfs_h *g,\n"
26071 " const char *directory);\n"
26076 #: ../src/guestfs-actions.pod:3947
26078 "This command is mostly useful for interactive sessions. Programs should "
26079 "probably use C<guestfs_readdir> instead."
26083 #: ../src/guestfs-actions.pod:3956
26084 msgid "guestfs_lsetxattr"
26088 #: ../src/guestfs-actions.pod:3958
26092 " guestfs_lsetxattr (guestfs_h *g,\n"
26093 " const char *xattr,\n"
26094 " const char *val,\n"
26096 " const char *path);\n"
26101 #: ../src/guestfs-actions.pod:3965
26103 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
26104 "then it sets an extended attribute of the link itself."
26108 #: ../src/guestfs-actions.pod:3973
26109 msgid "guestfs_lstat"
26113 #: ../src/guestfs-actions.pod:3975
26116 " struct guestfs_stat *\n"
26117 " guestfs_lstat (guestfs_h *g,\n"
26118 " const char *path);\n"
26123 #: ../src/guestfs-actions.pod:3981
26125 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
26126 "link, then the link is stat-ed, not the file it refers to."
26130 #: ../src/guestfs-actions.pod:3987 ../src/guestfs-actions.pod:6762
26132 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
26133 "error. I<The caller must call C<guestfs_free_stat> after use>."
26137 #: ../src/guestfs-actions.pod:3991 ../src/guestfs-actions.pod:6766
26138 #: ../src/guestfs-actions.pod:6784 ../src/guestfs-actions.pod:7165
26139 msgid "(Added in 0.9.2)"
26143 #: ../src/guestfs-actions.pod:3993
26144 msgid "guestfs_lstatlist"
26148 #: ../src/guestfs-actions.pod:3995
26151 " struct guestfs_stat_list *\n"
26152 " guestfs_lstatlist (guestfs_h *g,\n"
26153 " const char *path,\n"
26154 " char *const *names);\n"
26159 #: ../src/guestfs-actions.pod:4000
26161 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
26162 "files, where all files are in the directory C<path>. C<names> is the list "
26163 "of files from this directory."
26167 #: ../src/guestfs-actions.pod:4009
26169 "This call is intended for programs that want to efficiently list a directory "
26170 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
26171 "for a similarly efficient call for getting extended attributes. Very long "
26172 "directory listings might cause the protocol message size to be exceeded, "
26173 "causing this call to fail. The caller must split up such requests into "
26174 "smaller groups of names."
26178 #: ../src/guestfs-actions.pod:4017
26180 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
26181 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
26185 #: ../src/guestfs-actions.pod:4023
26186 msgid "guestfs_luks_add_key"
26190 #: ../src/guestfs-actions.pod:4025
26194 " guestfs_luks_add_key (guestfs_h *g,\n"
26195 " const char *device,\n"
26196 " const char *key,\n"
26197 " const char *newkey,\n"
26203 #: ../src/guestfs-actions.pod:4037
26205 "Note that if C<keyslot> already contains a key, then this command will "
26206 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
26210 #: ../src/guestfs-actions.pod:4043 ../src/guestfs-actions.pod:4083
26211 #: ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4126
26212 #: ../src/guestfs-actions.pod:4161 ../src/guestfs-actions.pod:4180
26214 "This function takes a key or passphrase parameter which could contain "
26215 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
26220 #: ../src/guestfs-actions.pod:4047 ../src/guestfs-actions.pod:4087
26221 #: ../src/guestfs-actions.pod:4110 ../src/guestfs-actions.pod:4130
26222 msgid "(Added in 1.5.2)"
26226 #: ../src/guestfs-actions.pod:4049
26227 msgid "guestfs_luks_close"
26231 #: ../src/guestfs-actions.pod:4051
26235 " guestfs_luks_close (guestfs_h *g,\n"
26236 " const char *device);\n"
26241 #: ../src/guestfs-actions.pod:4055
26243 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
26244 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
26245 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
26246 "underlying block device."
26250 #: ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4165
26251 #: ../src/guestfs-actions.pod:4184 ../src/guestfs-actions.pod:4234
26252 #: ../src/guestfs-actions.pod:4282
26253 msgid "(Added in 1.5.1)"
26257 #: ../src/guestfs-actions.pod:4065
26258 msgid "guestfs_luks_format"
26262 #: ../src/guestfs-actions.pod:4067
26266 " guestfs_luks_format (guestfs_h *g,\n"
26267 " const char *device,\n"
26268 " const char *key,\n"
26274 #: ../src/guestfs-actions.pod:4089
26275 msgid "guestfs_luks_format_cipher"
26279 #: ../src/guestfs-actions.pod:4091
26283 " guestfs_luks_format_cipher (guestfs_h *g,\n"
26284 " const char *device,\n"
26285 " const char *key,\n"
26287 " const char *cipher);\n"
26292 #: ../src/guestfs-actions.pod:4098
26294 "This command is the same as C<guestfs_luks_format> but it also allows you to "
26295 "set the C<cipher> used."
26299 #: ../src/guestfs-actions.pod:4112
26300 msgid "guestfs_luks_kill_slot"
26304 #: ../src/guestfs-actions.pod:4114
26308 " guestfs_luks_kill_slot (guestfs_h *g,\n"
26309 " const char *device,\n"
26310 " const char *key,\n"
26316 #: ../src/guestfs-actions.pod:4132
26317 msgid "guestfs_luks_open"
26321 #: ../src/guestfs-actions.pod:4134
26325 " guestfs_luks_open (guestfs_h *g,\n"
26326 " const char *device,\n"
26327 " const char *key,\n"
26328 " const char *mapname);\n"
26333 #: ../src/guestfs-actions.pod:4152
26335 "If this block device contains LVM volume groups, then calling "
26336 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
26341 #: ../src/guestfs-actions.pod:4156
26342 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
26346 #: ../src/guestfs-actions.pod:4167
26347 msgid "guestfs_luks_open_ro"
26351 #: ../src/guestfs-actions.pod:4169
26355 " guestfs_luks_open_ro (guestfs_h *g,\n"
26356 " const char *device,\n"
26357 " const char *key,\n"
26358 " const char *mapname);\n"
26363 #: ../src/guestfs-actions.pod:4175
26365 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
26370 #: ../src/guestfs-actions.pod:4186
26371 msgid "guestfs_lvcreate"
26375 #: ../src/guestfs-actions.pod:4188
26379 " guestfs_lvcreate (guestfs_h *g,\n"
26380 " const char *logvol,\n"
26381 " const char *volgroup,\n"
26387 #: ../src/guestfs-actions.pod:4201
26388 msgid "guestfs_lvm_canonical_lv_name"
26392 #: ../src/guestfs-actions.pod:4203
26396 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
26397 " const char *lvname);\n"
26402 #: ../src/guestfs-actions.pod:4214
26403 msgid "See also C<guestfs_is_lv>."
26407 #: ../src/guestfs-actions.pod:4219
26408 msgid "(Added in 1.5.24)"
26412 #: ../src/guestfs-actions.pod:4221
26413 msgid "guestfs_lvm_clear_filter"
26417 #: ../src/guestfs-actions.pod:4223
26421 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
26426 #: ../src/guestfs-actions.pod:4226
26428 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
26429 "see every block device."
26433 #: ../src/guestfs-actions.pod:4236
26434 msgid "guestfs_lvm_remove_all"
26438 #: ../src/guestfs-actions.pod:4238
26442 " guestfs_lvm_remove_all (guestfs_h *g);\n"
26447 #: ../src/guestfs-actions.pod:4251
26448 msgid "guestfs_lvm_set_filter"
26452 #: ../src/guestfs-actions.pod:4253
26456 " guestfs_lvm_set_filter (guestfs_h *g,\n"
26457 " char *const *devices);\n"
26462 #: ../src/guestfs-actions.pod:4284
26463 msgid "guestfs_lvremove"
26467 #: ../src/guestfs-actions.pod:4286
26471 " guestfs_lvremove (guestfs_h *g,\n"
26472 " const char *device);\n"
26477 #: ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:5701
26478 #: ../src/guestfs-actions.pod:7535
26479 msgid "(Added in 1.0.13)"
26483 #: ../src/guestfs-actions.pod:4300
26484 msgid "guestfs_lvrename"
26488 #: ../src/guestfs-actions.pod:4302
26492 " guestfs_lvrename (guestfs_h *g,\n"
26493 " const char *logvol,\n"
26494 " const char *newlogvol);\n"
26499 #: ../src/guestfs-actions.pod:4311 ../src/guestfs-actions.pod:7548
26500 msgid "(Added in 1.0.83)"
26504 #: ../src/guestfs-actions.pod:4313
26505 msgid "guestfs_lvresize"
26509 #: ../src/guestfs-actions.pod:4315
26513 " guestfs_lvresize (guestfs_h *g,\n"
26514 " const char *device,\n"
26520 #: ../src/guestfs-actions.pod:4328
26521 msgid "guestfs_lvresize_free"
26525 #: ../src/guestfs-actions.pod:4330
26529 " guestfs_lvresize_free (guestfs_h *g,\n"
26530 " const char *lv,\n"
26536 #: ../src/guestfs-actions.pod:4343
26537 msgid "(Added in 1.3.3)"
26541 #: ../src/guestfs-actions.pod:4345
26542 msgid "guestfs_lvs"
26546 #: ../src/guestfs-actions.pod:4347
26550 " guestfs_lvs (guestfs_h *g);\n"
26555 #: ../src/guestfs-actions.pod:4356
26556 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
26560 #: ../src/guestfs-actions.pod:4364
26561 msgid "guestfs_lvs_full"
26565 #: ../src/guestfs-actions.pod:4366
26568 " struct guestfs_lvm_lv_list *\n"
26569 " guestfs_lvs_full (guestfs_h *g);\n"
26574 #: ../src/guestfs-actions.pod:4372
26576 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
26577 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
26581 #: ../src/guestfs-actions.pod:4378
26582 msgid "guestfs_lvuuid"
26586 #: ../src/guestfs-actions.pod:4380
26590 " guestfs_lvuuid (guestfs_h *g,\n"
26591 " const char *device);\n"
26596 #: ../src/guestfs-actions.pod:4391
26597 msgid "guestfs_lxattrlist"
26601 #: ../src/guestfs-actions.pod:4393
26604 " struct guestfs_xattr_list *\n"
26605 " guestfs_lxattrlist (guestfs_h *g,\n"
26606 " const char *path,\n"
26607 " char *const *names);\n"
26612 #: ../src/guestfs-actions.pod:4412
26614 "This call is intended for programs that want to efficiently list a directory "
26615 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
26616 "a similarly efficient call for getting standard stats. Very long directory "
26617 "listings might cause the protocol message size to be exceeded, causing this "
26618 "call to fail. The caller must split up such requests into smaller groups of "
26623 #: ../src/guestfs-actions.pod:4426
26624 msgid "guestfs_mkdir"
26628 #: ../src/guestfs-actions.pod:4428
26632 " guestfs_mkdir (guestfs_h *g,\n"
26633 " const char *path);\n"
26638 #: ../src/guestfs-actions.pod:4438
26639 msgid "guestfs_mkdir_mode"
26643 #: ../src/guestfs-actions.pod:4440
26647 " guestfs_mkdir_mode (guestfs_h *g,\n"
26648 " const char *path,\n"
26654 #: ../src/guestfs-actions.pod:4452
26655 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
26659 #: ../src/guestfs-actions.pod:4458
26660 msgid "guestfs_mkdir_p"
26664 #: ../src/guestfs-actions.pod:4460
26668 " guestfs_mkdir_p (guestfs_h *g,\n"
26669 " const char *path);\n"
26674 #: ../src/guestfs-actions.pod:4471
26675 msgid "guestfs_mkdtemp"
26679 #: ../src/guestfs-actions.pod:4473
26683 " guestfs_mkdtemp (guestfs_h *g,\n"
26684 " const char *template);\n"
26689 #: ../src/guestfs-actions.pod:4501
26690 msgid "guestfs_mke2fs_J"
26694 #: ../src/guestfs-actions.pod:4503
26698 " guestfs_mke2fs_J (guestfs_h *g,\n"
26699 " const char *fstype,\n"
26700 " int blocksize,\n"
26701 " const char *device,\n"
26702 " const char *journal);\n"
26707 #: ../src/guestfs-actions.pod:4516
26708 msgid "See also C<guestfs_mke2journal>."
26712 #: ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4538
26713 #: ../src/guestfs-actions.pod:4556 ../src/guestfs-actions.pod:4572
26714 #: ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4600
26715 #: ../src/guestfs-actions.pod:4659 ../src/guestfs-actions.pod:4936
26716 msgid "(Added in 1.0.68)"
26720 #: ../src/guestfs-actions.pod:4522
26721 msgid "guestfs_mke2fs_JL"
26725 #: ../src/guestfs-actions.pod:4524
26729 " guestfs_mke2fs_JL (guestfs_h *g,\n"
26730 " const char *fstype,\n"
26731 " int blocksize,\n"
26732 " const char *device,\n"
26733 " const char *label);\n"
26738 #: ../src/guestfs-actions.pod:4534
26739 msgid "See also C<guestfs_mke2journal_L>."
26743 #: ../src/guestfs-actions.pod:4540
26744 msgid "guestfs_mke2fs_JU"
26748 #: ../src/guestfs-actions.pod:4542
26752 " guestfs_mke2fs_JU (guestfs_h *g,\n"
26753 " const char *fstype,\n"
26754 " int blocksize,\n"
26755 " const char *device,\n"
26756 " const char *uuid);\n"
26761 #: ../src/guestfs-actions.pod:4552
26762 msgid "See also C<guestfs_mke2journal_U>."
26766 #: ../src/guestfs-actions.pod:4558
26767 msgid "guestfs_mke2journal"
26771 #: ../src/guestfs-actions.pod:4560
26775 " guestfs_mke2journal (guestfs_h *g,\n"
26776 " int blocksize,\n"
26777 " const char *device);\n"
26782 #: ../src/guestfs-actions.pod:4574
26783 msgid "guestfs_mke2journal_L"
26787 #: ../src/guestfs-actions.pod:4576
26791 " guestfs_mke2journal_L (guestfs_h *g,\n"
26792 " int blocksize,\n"
26793 " const char *label,\n"
26794 " const char *device);\n"
26799 #: ../src/guestfs-actions.pod:4588
26800 msgid "guestfs_mke2journal_U"
26804 #: ../src/guestfs-actions.pod:4590
26808 " guestfs_mke2journal_U (guestfs_h *g,\n"
26809 " int blocksize,\n"
26810 " const char *uuid,\n"
26811 " const char *device);\n"
26816 #: ../src/guestfs-actions.pod:4602
26817 msgid "guestfs_mkfifo"
26821 #: ../src/guestfs-actions.pod:4604
26825 " guestfs_mkfifo (guestfs_h *g,\n"
26827 " const char *path);\n"
26832 #: ../src/guestfs-actions.pod:4609
26834 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
26835 "is just a convenient wrapper around C<guestfs_mknod>."
26839 #: ../src/guestfs-actions.pod:4619
26840 msgid "guestfs_mkfs"
26844 #: ../src/guestfs-actions.pod:4621
26848 " guestfs_mkfs (guestfs_h *g,\n"
26849 " const char *fstype,\n"
26850 " const char *device);\n"
26855 #: ../src/guestfs-actions.pod:4634
26856 msgid "guestfs_mkfs_b"
26860 #: ../src/guestfs-actions.pod:4636
26864 " guestfs_mkfs_b (guestfs_h *g,\n"
26865 " const char *fstype,\n"
26866 " int blocksize,\n"
26867 " const char *device);\n"
26872 #: ../src/guestfs-actions.pod:4642
26874 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
26875 "block size of the resulting filesystem. Supported block sizes depend on the "
26876 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
26880 #: ../src/guestfs-actions.pod:4652
26882 "This function is deprecated. In new code, use the L</guestfs_mkfs_opts> "
26887 #: ../src/guestfs-actions.pod:4661
26888 msgid "guestfs_mkfs_opts"
26892 #: ../src/guestfs-actions.pod:4663
26896 " guestfs_mkfs_opts (guestfs_h *g,\n"
26897 " const char *fstype,\n"
26898 " const char *device,\n"
26904 #: ../src/guestfs-actions.pod:4674
26907 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
26908 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
26909 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
26910 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
26915 #: ../src/guestfs-actions.pod:4722
26916 msgid "(Added in 1.7.19)"
26920 #: ../src/guestfs-actions.pod:4724
26921 msgid "guestfs_mkfs_opts_va"
26925 #: ../src/guestfs-actions.pod:4726
26929 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
26930 " const char *fstype,\n"
26931 " const char *device,\n"
26932 " va_list args);\n"
26937 #: ../src/guestfs-actions.pod:4732
26938 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
26942 #: ../src/guestfs-actions.pod:4736
26943 msgid "guestfs_mkfs_opts_argv"
26947 #: ../src/guestfs-actions.pod:4738
26951 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
26952 " const char *fstype,\n"
26953 " const char *device,\n"
26954 " const struct guestfs_mkfs_opts_argv *optargs);\n"
26959 #: ../src/guestfs-actions.pod:4744
26960 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
26964 #: ../src/guestfs-actions.pod:4748
26965 msgid "guestfs_mkmountpoint"
26969 #: ../src/guestfs-actions.pod:4750
26973 " guestfs_mkmountpoint (guestfs_h *g,\n"
26974 " const char *exemptpath);\n"
26979 #: ../src/guestfs-actions.pod:4754
26981 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
26982 "that can be used to create extra mountpoints before mounting the first "
26987 #: ../src/guestfs-actions.pod:4778
26989 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
26990 "may get unexpected errors if you try to mix these calls. It is safest to "
26991 "manually unmount filesystems and remove mountpoints after use."
26995 #: ../src/guestfs-actions.pod:4782
26997 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
26998 "first, so for this to work for manual mountpoints, you must ensure that the "
26999 "innermost mountpoints have the longest pathnames, as in the example code "
27004 #: ../src/guestfs-actions.pod:4789
27006 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
27007 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
27008 "can also trigger these issues."
27012 #: ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:5111
27013 #: ../src/guestfs-actions.pod:6121
27014 msgid "(Added in 1.0.62)"
27018 #: ../src/guestfs-actions.pod:4797
27019 msgid "guestfs_mknod"
27023 #: ../src/guestfs-actions.pod:4799
27027 " guestfs_mknod (guestfs_h *g,\n"
27031 " const char *path);\n"
27036 #: ../src/guestfs-actions.pod:4814
27038 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
27039 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
27040 "regular file). These constants are available in the standard Linux header "
27041 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
27042 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
27043 "the appropriate constant for you."
27047 #: ../src/guestfs-actions.pod:4828
27048 msgid "guestfs_mknod_b"
27052 #: ../src/guestfs-actions.pod:4830
27056 " guestfs_mknod_b (guestfs_h *g,\n"
27060 " const char *path);\n"
27065 #: ../src/guestfs-actions.pod:4837
27067 "This call creates a block device node called C<path> with mode C<mode> and "
27068 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27069 "wrapper around C<guestfs_mknod>."
27073 #: ../src/guestfs-actions.pod:4847
27074 msgid "guestfs_mknod_c"
27078 #: ../src/guestfs-actions.pod:4849
27082 " guestfs_mknod_c (guestfs_h *g,\n"
27086 " const char *path);\n"
27091 #: ../src/guestfs-actions.pod:4856
27093 "This call creates a char device node called C<path> with mode C<mode> and "
27094 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27095 "wrapper around C<guestfs_mknod>."
27099 #: ../src/guestfs-actions.pod:4866
27100 msgid "guestfs_mkswap"
27104 #: ../src/guestfs-actions.pod:4868
27108 " guestfs_mkswap (guestfs_h *g,\n"
27109 " const char *device);\n"
27114 #: ../src/guestfs-actions.pod:4878
27115 msgid "guestfs_mkswap_L"
27119 #: ../src/guestfs-actions.pod:4880
27123 " guestfs_mkswap_L (guestfs_h *g,\n"
27124 " const char *label,\n"
27125 " const char *device);\n"
27130 #: ../src/guestfs-actions.pod:4895
27131 msgid "guestfs_mkswap_U"
27135 #: ../src/guestfs-actions.pod:4897
27139 " guestfs_mkswap_U (guestfs_h *g,\n"
27140 " const char *uuid,\n"
27141 " const char *device);\n"
27146 #: ../src/guestfs-actions.pod:4908
27147 msgid "guestfs_mkswap_file"
27151 #: ../src/guestfs-actions.pod:4910
27155 " guestfs_mkswap_file (guestfs_h *g,\n"
27156 " const char *path);\n"
27161 #: ../src/guestfs-actions.pod:4916
27163 "This command just writes a swap file signature to an existing file. To "
27164 "create the file itself, use something like C<guestfs_fallocate>."
27168 #: ../src/guestfs-actions.pod:4923
27169 msgid "guestfs_modprobe"
27173 #: ../src/guestfs-actions.pod:4925
27177 " guestfs_modprobe (guestfs_h *g,\n"
27178 " const char *modulename);\n"
27183 #: ../src/guestfs-actions.pod:4938
27184 msgid "guestfs_mount"
27188 #: ../src/guestfs-actions.pod:4940
27192 " guestfs_mount (guestfs_h *g,\n"
27193 " const char *device,\n"
27194 " const char *mountpoint);\n"
27199 #: ../src/guestfs-actions.pod:4959
27201 "B<Important note:> When you use this call, the filesystem options C<sync> "
27202 "and C<noatime> are set implicitly. This was originally done because we "
27203 "thought it would improve reliability, but it turns out that I<-o sync> has a "
27204 "very large negative performance impact and negligible effect on "
27205 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
27206 "in any code that needs performance, and instead use C<guestfs_mount_options> "
27207 "(use an empty string for the first parameter if you don't want any options)."
27211 #: ../src/guestfs-actions.pod:4971
27213 "This function is deprecated. In new code, use the L</guestfs_mount_options> "
27218 #: ../src/guestfs-actions.pod:4980
27219 msgid "guestfs_mount_9p"
27223 #: ../src/guestfs-actions.pod:4982
27227 " guestfs_mount_9p (guestfs_h *g,\n"
27228 " const char *mounttag,\n"
27229 " const char *mountpoint,\n"
27235 #: ../src/guestfs-actions.pod:4993
27238 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
27243 #: ../src/guestfs-actions.pod:5006
27244 msgid "guestfs_mount_9p_va"
27248 #: ../src/guestfs-actions.pod:5008
27252 " guestfs_mount_9p_va (guestfs_h *g,\n"
27253 " const char *mounttag,\n"
27254 " const char *mountpoint,\n"
27255 " va_list args);\n"
27260 #: ../src/guestfs-actions.pod:5014
27261 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
27265 #: ../src/guestfs-actions.pod:5018
27266 msgid "guestfs_mount_9p_argv"
27270 #: ../src/guestfs-actions.pod:5020
27274 " guestfs_mount_9p_argv (guestfs_h *g,\n"
27275 " const char *mounttag,\n"
27276 " const char *mountpoint,\n"
27277 " const struct guestfs_mount_9p_argv *optargs);\n"
27282 #: ../src/guestfs-actions.pod:5026
27283 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
27287 #: ../src/guestfs-actions.pod:5030
27288 msgid "guestfs_mount_loop"
27292 #: ../src/guestfs-actions.pod:5032
27296 " guestfs_mount_loop (guestfs_h *g,\n"
27297 " const char *file,\n"
27298 " const char *mountpoint);\n"
27303 #: ../src/guestfs-actions.pod:5045
27304 msgid "guestfs_mount_options"
27308 #: ../src/guestfs-actions.pod:5047
27312 " guestfs_mount_options (guestfs_h *g,\n"
27313 " const char *options,\n"
27314 " const char *device,\n"
27315 " const char *mountpoint);\n"
27320 #: ../src/guestfs-actions.pod:5053
27322 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27323 "the mount options as for the L<mount(8)> I<-o> flag."
27327 #: ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5077
27328 #: ../src/guestfs-actions.pod:5094
27329 msgid "(Added in 1.0.10)"
27333 #: ../src/guestfs-actions.pod:5065
27334 msgid "guestfs_mount_ro"
27338 #: ../src/guestfs-actions.pod:5067
27342 " guestfs_mount_ro (guestfs_h *g,\n"
27343 " const char *device,\n"
27344 " const char *mountpoint);\n"
27349 #: ../src/guestfs-actions.pod:5072
27351 "This is the same as the C<guestfs_mount> command, but it mounts the "
27352 "filesystem with the read-only (I<-o ro>) flag."
27356 #: ../src/guestfs-actions.pod:5079
27357 msgid "guestfs_mount_vfs"
27361 #: ../src/guestfs-actions.pod:5081
27365 " guestfs_mount_vfs (guestfs_h *g,\n"
27366 " const char *options,\n"
27367 " const char *vfstype,\n"
27368 " const char *device,\n"
27369 " const char *mountpoint);\n"
27374 #: ../src/guestfs-actions.pod:5088
27376 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27377 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
27382 #: ../src/guestfs-actions.pod:5096
27383 msgid "guestfs_mountpoints"
27387 #: ../src/guestfs-actions.pod:5098
27391 " guestfs_mountpoints (guestfs_h *g);\n"
27396 #: ../src/guestfs-actions.pod:5101
27398 "This call is similar to C<guestfs_mounts>. That call returns a list of "
27399 "devices. This one returns a hash table (map) of device name to directory "
27400 "where the device is mounted."
27404 #: ../src/guestfs-actions.pod:5113
27405 msgid "guestfs_mounts"
27409 #: ../src/guestfs-actions.pod:5115
27413 " guestfs_mounts (guestfs_h *g);\n"
27418 #: ../src/guestfs-actions.pod:5123
27419 msgid "See also: C<guestfs_mountpoints>"
27423 #: ../src/guestfs-actions.pod:5131
27428 #: ../src/guestfs-actions.pod:5133
27432 " guestfs_mv (guestfs_h *g,\n"
27433 " const char *src,\n"
27434 " const char *dest);\n"
27439 #: ../src/guestfs-actions.pod:5145
27440 msgid "guestfs_ntfs_3g_probe"
27444 #: ../src/guestfs-actions.pod:5147
27448 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
27450 " const char *device);\n"
27455 #: ../src/guestfs-actions.pod:5166
27456 msgid "(Added in 1.0.43)"
27460 #: ../src/guestfs-actions.pod:5168
27461 msgid "guestfs_ntfsresize"
27465 #: ../src/guestfs-actions.pod:5170
27469 " guestfs_ntfsresize (guestfs_h *g,\n"
27470 " const char *device);\n"
27475 #: ../src/guestfs-actions.pod:5189 ../src/guestfs-actions.pod:5279
27477 "This function is deprecated. In new code, use the L</"
27478 "guestfs_ntfsresize_opts> call instead."
27482 #: ../src/guestfs-actions.pod:5198
27483 msgid "guestfs_ntfsresize_opts"
27487 #: ../src/guestfs-actions.pod:5200
27491 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
27492 " const char *device,\n"
27498 #: ../src/guestfs-actions.pod:5210
27501 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
27502 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
27507 #: ../src/guestfs-actions.pod:5230
27509 "After the resize operation, the filesystem is always marked as requiring a "
27510 "consistency check (for safety). You have to boot into Windows to perform "
27511 "this check and clear this condition. If you I<don't> set the C<force> "
27512 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
27513 "times on a single filesystem without booting into Windows between each "
27518 #: ../src/guestfs-actions.pod:5245
27519 msgid "guestfs_ntfsresize_opts_va"
27523 #: ../src/guestfs-actions.pod:5247
27527 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
27528 " const char *device,\n"
27529 " va_list args);\n"
27534 #: ../src/guestfs-actions.pod:5252
27535 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
27539 #: ../src/guestfs-actions.pod:5256
27540 msgid "guestfs_ntfsresize_opts_argv"
27544 #: ../src/guestfs-actions.pod:5258
27548 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
27549 " const char *device,\n"
27550 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
27555 #: ../src/guestfs-actions.pod:5263
27556 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
27560 #: ../src/guestfs-actions.pod:5267
27561 msgid "guestfs_ntfsresize_size"
27565 #: ../src/guestfs-actions.pod:5269
27569 " guestfs_ntfsresize_size (guestfs_h *g,\n"
27570 " const char *device,\n"
27571 " int64_t size);\n"
27576 #: ../src/guestfs-actions.pod:5274
27578 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
27579 "to specify the new size (in bytes) explicitly."
27583 #: ../src/guestfs-actions.pod:5286 ../src/guestfs-actions.pod:5728
27584 #: ../src/guestfs-actions.pod:5801 ../src/guestfs-actions.pod:6069
27585 #: ../src/guestfs-actions.pod:7692
27586 msgid "(Added in 1.3.14)"
27590 #: ../src/guestfs-actions.pod:5288
27591 msgid "guestfs_part_add"
27595 #: ../src/guestfs-actions.pod:5290
27599 " guestfs_part_add (guestfs_h *g,\n"
27600 " const char *device,\n"
27601 " const char *prlogex,\n"
27602 " int64_t startsect,\n"
27603 " int64_t endsect);\n"
27608 #: ../src/guestfs-actions.pod:5297
27610 "This command adds a partition to C<device>. If there is no partition table "
27611 "on the device, call C<guestfs_part_init> first."
27615 #: ../src/guestfs-actions.pod:5309
27617 "Creating a partition which covers the whole disk is not so easy. Use "
27618 "C<guestfs_part_disk> to do that."
27622 #: ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:5352
27623 #: ../src/guestfs-actions.pod:5405 ../src/guestfs-actions.pod:5489
27624 #: ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:5546
27625 #: ../src/guestfs-actions.pod:5586
27626 msgid "(Added in 1.0.78)"
27630 #: ../src/guestfs-actions.pod:5316
27631 msgid "guestfs_part_del"
27635 #: ../src/guestfs-actions.pod:5318
27639 " guestfs_part_del (guestfs_h *g,\n"
27640 " const char *device,\n"
27646 #: ../src/guestfs-actions.pod:5333
27647 msgid "guestfs_part_disk"
27651 #: ../src/guestfs-actions.pod:5335
27655 " guestfs_part_disk (guestfs_h *g,\n"
27656 " const char *device,\n"
27657 " const char *parttype);\n"
27662 #: ../src/guestfs-actions.pod:5340
27664 "This command is simply a combination of C<guestfs_part_init> followed by "
27665 "C<guestfs_part_add> to create a single primary partition covering the whole "
27670 #: ../src/guestfs-actions.pod:5344
27672 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27673 "possible values are described in C<guestfs_part_init>."
27677 #: ../src/guestfs-actions.pod:5354
27678 msgid "guestfs_part_get_bootable"
27682 #: ../src/guestfs-actions.pod:5356
27686 " guestfs_part_get_bootable (guestfs_h *g,\n"
27687 " const char *device,\n"
27693 #: ../src/guestfs-actions.pod:5364
27694 msgid "See also C<guestfs_part_set_bootable>."
27698 #: ../src/guestfs-actions.pod:5370
27699 msgid "guestfs_part_get_mbr_id"
27703 #: ../src/guestfs-actions.pod:5372
27707 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
27708 " const char *device,\n"
27714 #: ../src/guestfs-actions.pod:5380 ../src/guestfs-actions.pod:5562
27716 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
27717 "undefined results for other partition table types (see "
27718 "C<guestfs_part_get_parttype>)."
27722 #: ../src/guestfs-actions.pod:5388
27723 msgid "guestfs_part_get_parttype"
27727 #: ../src/guestfs-actions.pod:5390
27731 " guestfs_part_get_parttype (guestfs_h *g,\n"
27732 " const char *device);\n"
27737 #: ../src/guestfs-actions.pod:5397
27739 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
27740 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
27741 "possible, although unusual. See C<guestfs_part_init> for a full list."
27745 #: ../src/guestfs-actions.pod:5407
27746 msgid "guestfs_part_init"
27750 #: ../src/guestfs-actions.pod:5409
27754 " guestfs_part_init (guestfs_h *g,\n"
27755 " const char *device,\n"
27756 " const char *parttype);\n"
27761 #: ../src/guestfs-actions.pod:5418
27763 "Initially there are no partitions. Following this, you should call "
27764 "C<guestfs_part_add> for each partition required."
27768 #: ../src/guestfs-actions.pod:5491
27769 msgid "guestfs_part_list"
27773 #: ../src/guestfs-actions.pod:5493
27776 " struct guestfs_partition_list *\n"
27777 " guestfs_part_list (guestfs_h *g,\n"
27778 " const char *device);\n"
27783 #: ../src/guestfs-actions.pod:5510
27785 "Start of the partition I<in bytes>. To get sectors you have to divide by "
27786 "the device's sector size, see C<guestfs_blockdev_getss>."
27790 #: ../src/guestfs-actions.pod:5523
27792 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
27793 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
27798 #: ../src/guestfs-actions.pod:5529
27799 msgid "guestfs_part_set_bootable"
27803 #: ../src/guestfs-actions.pod:5531
27807 " guestfs_part_set_bootable (guestfs_h *g,\n"
27808 " const char *device,\n"
27810 " int bootable);\n"
27815 #: ../src/guestfs-actions.pod:5548
27816 msgid "guestfs_part_set_mbr_id"
27820 #: ../src/guestfs-actions.pod:5550
27824 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
27825 " const char *device,\n"
27832 #: ../src/guestfs-actions.pod:5570
27833 msgid "guestfs_part_set_name"
27837 #: ../src/guestfs-actions.pod:5572
27841 " guestfs_part_set_name (guestfs_h *g,\n"
27842 " const char *device,\n"
27844 " const char *name);\n"
27849 #: ../src/guestfs-actions.pod:5588
27850 msgid "guestfs_part_to_dev"
27854 #: ../src/guestfs-actions.pod:5590
27858 " guestfs_part_to_dev (guestfs_h *g,\n"
27859 " const char *partition);\n"
27864 #: ../src/guestfs-actions.pod:5598
27866 "The named partition must exist, for example as a string returned from "
27867 "C<guestfs_list_partitions>."
27871 #: ../src/guestfs-actions.pod:5606
27872 msgid "guestfs_ping_daemon"
27876 #: ../src/guestfs-actions.pod:5608
27880 " guestfs_ping_daemon (guestfs_h *g);\n"
27885 #: ../src/guestfs-actions.pod:5620
27886 msgid "guestfs_pread"
27890 #: ../src/guestfs-actions.pod:5622
27894 " guestfs_pread (guestfs_h *g,\n"
27895 " const char *path,\n"
27897 " int64_t offset,\n"
27898 " size_t *size_r);\n"
27903 #: ../src/guestfs-actions.pod:5635
27904 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
27908 #: ../src/guestfs-actions.pod:5646
27909 msgid "guestfs_pread_device"
27913 #: ../src/guestfs-actions.pod:5648
27917 " guestfs_pread_device (guestfs_h *g,\n"
27918 " const char *device,\n"
27920 " int64_t offset,\n"
27921 " size_t *size_r);\n"
27926 #: ../src/guestfs-actions.pod:5661
27927 msgid "See also C<guestfs_pread>."
27931 #: ../src/guestfs-actions.pod:5670
27932 msgid "(Added in 1.5.21)"
27936 #: ../src/guestfs-actions.pod:5672
27937 msgid "guestfs_pvcreate"
27941 #: ../src/guestfs-actions.pod:5674
27945 " guestfs_pvcreate (guestfs_h *g,\n"
27946 " const char *device);\n"
27951 #: ../src/guestfs-actions.pod:5686
27952 msgid "guestfs_pvremove"
27956 #: ../src/guestfs-actions.pod:5688
27960 " guestfs_pvremove (guestfs_h *g,\n"
27961 " const char *device);\n"
27966 #: ../src/guestfs-actions.pod:5703
27967 msgid "guestfs_pvresize"
27971 #: ../src/guestfs-actions.pod:5705
27975 " guestfs_pvresize (guestfs_h *g,\n"
27976 " const char *device);\n"
27981 #: ../src/guestfs-actions.pod:5716
27982 msgid "guestfs_pvresize_size"
27986 #: ../src/guestfs-actions.pod:5718
27990 " guestfs_pvresize_size (guestfs_h *g,\n"
27991 " const char *device,\n"
27992 " int64_t size);\n"
27997 #: ../src/guestfs-actions.pod:5723
27999 "This command is the same as C<guestfs_pvresize> except that it allows you to "
28000 "specify the new size (in bytes) explicitly."
28004 #: ../src/guestfs-actions.pod:5730
28005 msgid "guestfs_pvs"
28009 #: ../src/guestfs-actions.pod:5732
28013 " guestfs_pvs (guestfs_h *g);\n"
28018 #: ../src/guestfs-actions.pod:5741
28019 msgid "See also C<guestfs_pvs_full>."
28023 #: ../src/guestfs-actions.pod:5749
28024 msgid "guestfs_pvs_full"
28028 #: ../src/guestfs-actions.pod:5751
28031 " struct guestfs_lvm_pv_list *\n"
28032 " guestfs_pvs_full (guestfs_h *g);\n"
28037 #: ../src/guestfs-actions.pod:5757
28039 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
28040 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
28044 #: ../src/guestfs-actions.pod:5763
28045 msgid "guestfs_pvuuid"
28049 #: ../src/guestfs-actions.pod:5765
28053 " guestfs_pvuuid (guestfs_h *g,\n"
28054 " const char *device);\n"
28059 #: ../src/guestfs-actions.pod:5776
28060 msgid "guestfs_pwrite"
28064 #: ../src/guestfs-actions.pod:5778
28068 " guestfs_pwrite (guestfs_h *g,\n"
28069 " const char *path,\n"
28070 " const char *content,\n"
28071 " size_t content_size,\n"
28072 " int64_t offset);\n"
28077 #: ../src/guestfs-actions.pod:5794
28078 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
28082 #: ../src/guestfs-actions.pod:5803
28083 msgid "guestfs_pwrite_device"
28087 #: ../src/guestfs-actions.pod:5805
28091 " guestfs_pwrite_device (guestfs_h *g,\n"
28092 " const char *device,\n"
28093 " const char *content,\n"
28094 " size_t content_size,\n"
28095 " int64_t offset);\n"
28100 #: ../src/guestfs-actions.pod:5820
28101 msgid "See also C<guestfs_pwrite>."
28105 #: ../src/guestfs-actions.pod:5827
28106 msgid "(Added in 1.5.20)"
28110 #: ../src/guestfs-actions.pod:5829
28111 msgid "guestfs_read_file"
28115 #: ../src/guestfs-actions.pod:5831
28119 " guestfs_read_file (guestfs_h *g,\n"
28120 " const char *path,\n"
28121 " size_t *size_r);\n"
28126 #: ../src/guestfs-actions.pod:5839
28128 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
28129 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
28130 "function is limited in the total size of file that can be handled."
28134 #: ../src/guestfs-actions.pod:5851
28135 msgid "(Added in 1.0.63)"
28139 #: ../src/guestfs-actions.pod:5853
28140 msgid "guestfs_read_lines"
28144 #: ../src/guestfs-actions.pod:5855
28148 " guestfs_read_lines (guestfs_h *g,\n"
28149 " const char *path);\n"
28154 #: ../src/guestfs-actions.pod:5864
28156 "Note that this function cannot correctly handle binary files (specifically, "
28157 "files containing C<\\0> character which is treated as end of line). For "
28158 "those you need to use the C<guestfs_read_file> function which has a more "
28159 "complex interface."
28163 #: ../src/guestfs-actions.pod:5875
28164 msgid "guestfs_readdir"
28168 #: ../src/guestfs-actions.pod:5877
28171 " struct guestfs_dirent_list *\n"
28172 " guestfs_readdir (guestfs_h *g,\n"
28173 " const char *dir);\n"
28178 #: ../src/guestfs-actions.pod:5931
28180 "This function is primarily intended for use by programs. To get a simple "
28181 "list of names, use C<guestfs_ls>. To get a printable directory for human "
28182 "consumption, use C<guestfs_ll>."
28186 #: ../src/guestfs-actions.pod:5935
28188 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
28189 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
28193 #: ../src/guestfs-actions.pod:5941
28194 msgid "guestfs_readlink"
28198 #: ../src/guestfs-actions.pod:5943
28202 " guestfs_readlink (guestfs_h *g,\n"
28203 " const char *path);\n"
28208 #: ../src/guestfs-actions.pod:5954
28209 msgid "guestfs_readlinklist"
28213 #: ../src/guestfs-actions.pod:5956
28217 " guestfs_readlinklist (guestfs_h *g,\n"
28218 " const char *path,\n"
28219 " char *const *names);\n"
28224 #: ../src/guestfs-actions.pod:5989
28225 msgid "guestfs_realpath"
28229 #: ../src/guestfs-actions.pod:5991
28233 " guestfs_realpath (guestfs_h *g,\n"
28234 " const char *path);\n"
28239 #: ../src/guestfs-actions.pod:6003
28240 msgid "guestfs_removexattr"
28244 #: ../src/guestfs-actions.pod:6005
28248 " guestfs_removexattr (guestfs_h *g,\n"
28249 " const char *xattr,\n"
28250 " const char *path);\n"
28255 #: ../src/guestfs-actions.pod:6013
28256 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
28260 #: ../src/guestfs-actions.pod:6019
28261 msgid "guestfs_resize2fs"
28265 #: ../src/guestfs-actions.pod:6021
28269 " guestfs_resize2fs (guestfs_h *g,\n"
28270 " const char *device);\n"
28275 #: ../src/guestfs-actions.pod:6028
28277 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
28278 "C<device> before calling this command. For unknown reasons C<resize2fs> "
28279 "sometimes gives an error about this and sometimes not. In any case, it is "
28280 "always safe to call C<guestfs_e2fsck_f> before calling this function."
28284 #: ../src/guestfs-actions.pod:6038
28285 msgid "guestfs_resize2fs_M"
28289 #: ../src/guestfs-actions.pod:6040
28293 " guestfs_resize2fs_M (guestfs_h *g,\n"
28294 " const char *device);\n"
28299 #: ../src/guestfs-actions.pod:6044
28301 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
28302 "resized to its minimum size. This works like the I<-M> option to the "
28303 "C<resize2fs> command."
28307 #: ../src/guestfs-actions.pod:6048
28309 "To get the resulting size of the filesystem you should call "
28310 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
28311 "These two numbers, multiplied together, give the resulting size of the "
28312 "minimal filesystem in bytes."
28316 #: ../src/guestfs-actions.pod:6057
28317 msgid "guestfs_resize2fs_size"
28321 #: ../src/guestfs-actions.pod:6059
28325 " guestfs_resize2fs_size (guestfs_h *g,\n"
28326 " const char *device,\n"
28327 " int64_t size);\n"
28332 #: ../src/guestfs-actions.pod:6064
28334 "This command is the same as C<guestfs_resize2fs> except that it allows you "
28335 "to specify the new size (in bytes) explicitly."
28339 #: ../src/guestfs-actions.pod:6071
28344 #: ../src/guestfs-actions.pod:6073
28348 " guestfs_rm (guestfs_h *g,\n"
28349 " const char *path);\n"
28354 #: ../src/guestfs-actions.pod:6083
28355 msgid "guestfs_rm_rf"
28359 #: ../src/guestfs-actions.pod:6085
28363 " guestfs_rm_rf (guestfs_h *g,\n"
28364 " const char *path);\n"
28369 #: ../src/guestfs-actions.pod:6097
28370 msgid "guestfs_rmdir"
28374 #: ../src/guestfs-actions.pod:6099
28378 " guestfs_rmdir (guestfs_h *g,\n"
28379 " const char *path);\n"
28384 #: ../src/guestfs-actions.pod:6109
28385 msgid "guestfs_rmmountpoint"
28389 #: ../src/guestfs-actions.pod:6111
28393 " guestfs_rmmountpoint (guestfs_h *g,\n"
28394 " const char *exemptpath);\n"
28399 #: ../src/guestfs-actions.pod:6115
28401 "This calls removes a mountpoint that was previously created with "
28402 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
28406 #: ../src/guestfs-actions.pod:6123
28407 msgid "guestfs_scrub_device"
28411 #: ../src/guestfs-actions.pod:6125
28415 " guestfs_scrub_device (guestfs_h *g,\n"
28416 " const char *device);\n"
28421 #: ../src/guestfs-actions.pod:6140 ../src/guestfs-actions.pod:6158
28422 #: ../src/guestfs-actions.pod:6177
28423 msgid "(Added in 1.0.52)"
28427 #: ../src/guestfs-actions.pod:6142
28428 msgid "guestfs_scrub_file"
28432 #: ../src/guestfs-actions.pod:6144
28436 " guestfs_scrub_file (guestfs_h *g,\n"
28437 " const char *file);\n"
28442 #: ../src/guestfs-actions.pod:6160
28443 msgid "guestfs_scrub_freespace"
28447 #: ../src/guestfs-actions.pod:6162
28451 " guestfs_scrub_freespace (guestfs_h *g,\n"
28452 " const char *dir);\n"
28457 #: ../src/guestfs-actions.pod:6166
28459 "This command creates the directory C<dir> and then fills it with files until "
28460 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
28461 "and deletes them. The intention is to scrub any free space on the partition "
28462 "containing C<dir>."
28466 #: ../src/guestfs-actions.pod:6179
28467 msgid "guestfs_set_append"
28471 #: ../src/guestfs-actions.pod:6181
28475 " guestfs_set_append (guestfs_h *g,\n"
28476 " const char *append);\n"
28481 #: ../src/guestfs-actions.pod:6198
28482 msgid "guestfs_set_attach_method"
28486 #: ../src/guestfs-actions.pod:6200
28490 " guestfs_set_attach_method (guestfs_h *g,\n"
28491 " const char *attachmethod);\n"
28496 #: ../src/guestfs-actions.pod:6228
28497 msgid "guestfs_set_autosync"
28501 #: ../src/guestfs-actions.pod:6230
28505 " guestfs_set_autosync (guestfs_h *g,\n"
28506 " int autosync);\n"
28511 #: ../src/guestfs-actions.pod:6246
28512 msgid "guestfs_set_direct"
28516 #: ../src/guestfs-actions.pod:6248
28520 " guestfs_set_direct (guestfs_h *g,\n"
28526 #: ../src/guestfs-actions.pod:6256
28528 "One consequence of this is that log messages aren't caught by the library "
28529 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
28534 #: ../src/guestfs-actions.pod:6269
28535 msgid "guestfs_set_e2label"
28539 #: ../src/guestfs-actions.pod:6271
28543 " guestfs_set_e2label (guestfs_h *g,\n"
28544 " const char *device,\n"
28545 " const char *label);\n"
28550 #: ../src/guestfs-actions.pod:6280
28552 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
28553 "the existing label on a filesystem."
28557 #: ../src/guestfs-actions.pod:6287
28558 msgid "guestfs_set_e2uuid"
28562 #: ../src/guestfs-actions.pod:6289
28566 " guestfs_set_e2uuid (guestfs_h *g,\n"
28567 " const char *device,\n"
28568 " const char *uuid);\n"
28573 #: ../src/guestfs-actions.pod:6299
28575 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
28576 "the existing UUID of a filesystem."
28580 #: ../src/guestfs-actions.pod:6306
28581 msgid "guestfs_set_memsize"
28585 #: ../src/guestfs-actions.pod:6308
28589 " guestfs_set_memsize (guestfs_h *g,\n"
28595 #: ../src/guestfs-actions.pod:6312
28597 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28598 "This only has any effect if called before C<guestfs_launch>."
28602 #: ../src/guestfs-actions.pod:6327
28603 msgid "guestfs_set_network"
28607 #: ../src/guestfs-actions.pod:6329
28611 " guestfs_set_network (guestfs_h *g,\n"
28617 #: ../src/guestfs-actions.pod:6339
28619 "You must call this before calling C<guestfs_launch>, otherwise it has no "
28624 #: ../src/guestfs-actions.pod:6346
28625 msgid "guestfs_set_path"
28629 #: ../src/guestfs-actions.pod:6348
28633 " guestfs_set_path (guestfs_h *g,\n"
28634 " const char *searchpath);\n"
28639 #: ../src/guestfs-actions.pod:6363
28640 msgid "guestfs_set_pgroup"
28644 #: ../src/guestfs-actions.pod:6365
28648 " guestfs_set_pgroup (guestfs_h *g,\n"
28654 #: ../src/guestfs-actions.pod:6382
28655 msgid "guestfs_set_qemu"
28659 #: ../src/guestfs-actions.pod:6384
28663 " guestfs_set_qemu (guestfs_h *g,\n"
28664 " const char *qemu);\n"
28669 #: ../src/guestfs-actions.pod:6410
28670 msgid "guestfs_set_recovery_proc"
28674 #: ../src/guestfs-actions.pod:6412
28678 " guestfs_set_recovery_proc (guestfs_h *g,\n"
28679 " int recoveryproc);\n"
28684 #: ../src/guestfs-actions.pod:6416
28686 "If this is called with the parameter C<false> then C<guestfs_launch> does "
28687 "not create a recovery process. The purpose of the recovery process is to "
28688 "stop runaway qemu processes in the case where the main program aborts "
28693 #: ../src/guestfs-actions.pod:6421
28695 "This only has any effect if called before C<guestfs_launch>, and the default "
28700 #: ../src/guestfs-actions.pod:6434
28701 msgid "guestfs_set_selinux"
28705 #: ../src/guestfs-actions.pod:6436
28709 " guestfs_set_selinux (guestfs_h *g,\n"
28715 #: ../src/guestfs-actions.pod:6453
28716 msgid "guestfs_set_trace"
28720 #: ../src/guestfs-actions.pod:6455
28724 " guestfs_set_trace (guestfs_h *g,\n"
28730 #: ../src/guestfs-actions.pod:6469
28732 "Trace messages are normally sent to C<stderr>, unless you register a "
28733 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28737 #: ../src/guestfs-actions.pod:6477
28738 msgid "guestfs_set_verbose"
28742 #: ../src/guestfs-actions.pod:6479
28746 " guestfs_set_verbose (guestfs_h *g,\n"
28752 #: ../src/guestfs-actions.pod:6488
28754 "Verbose messages are normally sent to C<stderr>, unless you register a "
28755 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28759 #: ../src/guestfs-actions.pod:6496
28760 msgid "guestfs_setcon"
28764 #: ../src/guestfs-actions.pod:6498
28768 " guestfs_setcon (guestfs_h *g,\n"
28769 " const char *context);\n"
28774 #: ../src/guestfs-actions.pod:6511
28775 msgid "guestfs_setxattr"
28779 #: ../src/guestfs-actions.pod:6513
28783 " guestfs_setxattr (guestfs_h *g,\n"
28784 " const char *xattr,\n"
28785 " const char *val,\n"
28787 " const char *path);\n"
28792 #: ../src/guestfs-actions.pod:6524
28793 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
28797 #: ../src/guestfs-actions.pod:6530
28798 msgid "guestfs_sfdisk"
28802 #: ../src/guestfs-actions.pod:6532
28806 " guestfs_sfdisk (guestfs_h *g,\n"
28807 " const char *device,\n"
28811 " char *const *lines);\n"
28816 #: ../src/guestfs-actions.pod:6560
28818 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
28822 #: ../src/guestfs-actions.pod:6568 ../src/guestfs-actions.pod:6598
28823 #: ../src/guestfs-actions.pod:6631
28825 "This function is deprecated. In new code, use the L</guestfs_part_add> call "
28830 #: ../src/guestfs-actions.pod:6577
28831 msgid "guestfs_sfdiskM"
28835 #: ../src/guestfs-actions.pod:6579
28839 " guestfs_sfdiskM (guestfs_h *g,\n"
28840 " const char *device,\n"
28841 " char *const *lines);\n"
28846 #: ../src/guestfs-actions.pod:6584
28848 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
28849 "partition sizes are specified in megabytes only (rounded to the nearest "
28850 "cylinder) and you don't need to specify the cyls, heads and sectors "
28851 "parameters which were rarely if ever used anyway."
28855 #: ../src/guestfs-actions.pod:6590
28857 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
28858 "C<guestfs_part_disk>"
28862 #: ../src/guestfs-actions.pod:6607
28863 msgid "guestfs_sfdisk_N"
28867 #: ../src/guestfs-actions.pod:6609
28871 " guestfs_sfdisk_N (guestfs_h *g,\n"
28872 " const char *device,\n"
28877 " const char *line);\n"
28882 #: ../src/guestfs-actions.pod:6621
28884 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
28885 "for the cyls/heads/sectors parameters."
28889 #: ../src/guestfs-actions.pod:6624
28890 msgid "See also: C<guestfs_part_add>"
28894 #: ../src/guestfs-actions.pod:6640
28895 msgid "guestfs_sfdisk_disk_geometry"
28899 #: ../src/guestfs-actions.pod:6642
28903 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
28904 " const char *device);\n"
28909 #: ../src/guestfs-actions.pod:6646
28911 "This displays the disk geometry of C<device> read from the partition table. "
28912 "Especially in the case where the underlying block device has been resized, "
28913 "this can be different from the kernel's idea of the geometry (see "
28914 "C<guestfs_sfdisk_kernel_geometry>)."
28918 #: ../src/guestfs-actions.pod:6659
28919 msgid "guestfs_sfdisk_kernel_geometry"
28923 #: ../src/guestfs-actions.pod:6661
28927 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
28928 " const char *device);\n"
28933 #: ../src/guestfs-actions.pod:6675
28934 msgid "guestfs_sfdisk_l"
28938 #: ../src/guestfs-actions.pod:6677
28942 " guestfs_sfdisk_l (guestfs_h *g,\n"
28943 " const char *device);\n"
28948 #: ../src/guestfs-actions.pod:6685
28949 msgid "See also: C<guestfs_part_list>"
28953 #: ../src/guestfs-actions.pod:6690
28955 "This function is deprecated. In new code, use the L</guestfs_part_list> "
28960 #: ../src/guestfs-actions.pod:6699
28965 #: ../src/guestfs-actions.pod:6701
28969 " guestfs_sh (guestfs_h *g,\n"
28970 " const char *command);\n"
28975 #: ../src/guestfs-actions.pod:6708
28976 msgid "This is like C<guestfs_command>, but passes the command to:"
28980 #: ../src/guestfs-actions.pod:6716
28981 msgid "All the provisos about C<guestfs_command> apply to this call."
28985 #: ../src/guestfs-actions.pod:6723
28986 msgid "guestfs_sh_lines"
28990 #: ../src/guestfs-actions.pod:6725
28994 " guestfs_sh_lines (guestfs_h *g,\n"
28995 " const char *command);\n"
29000 #: ../src/guestfs-actions.pod:6729
29002 "This is the same as C<guestfs_sh>, but splits the result into a list of "
29007 #: ../src/guestfs-actions.pod:6732
29008 msgid "See also: C<guestfs_command_lines>"
29012 #: ../src/guestfs-actions.pod:6740
29013 msgid "guestfs_sleep"
29017 #: ../src/guestfs-actions.pod:6742
29021 " guestfs_sleep (guestfs_h *g,\n"
29027 #: ../src/guestfs-actions.pod:6750
29028 msgid "(Added in 1.0.41)"
29032 #: ../src/guestfs-actions.pod:6752 ../src/guestfs-structs.pod:109
29033 msgid "guestfs_stat"
29037 #: ../src/guestfs-actions.pod:6754
29040 " struct guestfs_stat *\n"
29041 " guestfs_stat (guestfs_h *g,\n"
29042 " const char *path);\n"
29047 #: ../src/guestfs-actions.pod:6768 ../src/guestfs-structs.pod:135
29048 msgid "guestfs_statvfs"
29052 #: ../src/guestfs-actions.pod:6770
29055 " struct guestfs_statvfs *\n"
29056 " guestfs_statvfs (guestfs_h *g,\n"
29057 " const char *path);\n"
29062 #: ../src/guestfs-actions.pod:6780
29064 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
29065 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
29069 #: ../src/guestfs-actions.pod:6786
29070 msgid "guestfs_strings"
29074 #: ../src/guestfs-actions.pod:6788
29078 " guestfs_strings (guestfs_h *g,\n"
29079 " const char *path);\n"
29084 #: ../src/guestfs-actions.pod:6804
29085 msgid "guestfs_strings_e"
29089 #: ../src/guestfs-actions.pod:6806
29093 " guestfs_strings_e (guestfs_h *g,\n"
29094 " const char *encoding,\n"
29095 " const char *path);\n"
29100 #: ../src/guestfs-actions.pod:6811
29102 "This is like the C<guestfs_strings> command, but allows you to specify the "
29103 "encoding of strings that are looked for in the source file C<path>."
29107 #: ../src/guestfs-actions.pod:6821
29109 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29110 "ISO-8859-X (this is what C<guestfs_strings> uses)."
29114 #: ../src/guestfs-actions.pod:6859
29115 msgid "guestfs_swapoff_device"
29119 #: ../src/guestfs-actions.pod:6861
29123 " guestfs_swapoff_device (guestfs_h *g,\n"
29124 " const char *device);\n"
29129 #: ../src/guestfs-actions.pod:6865
29131 "This command disables the libguestfs appliance swap device or partition "
29132 "named C<device>. See C<guestfs_swapon_device>."
29136 #: ../src/guestfs-actions.pod:6873
29137 msgid "guestfs_swapoff_file"
29141 #: ../src/guestfs-actions.pod:6875
29145 " guestfs_swapoff_file (guestfs_h *g,\n"
29146 " const char *file);\n"
29151 #: ../src/guestfs-actions.pod:6885
29152 msgid "guestfs_swapoff_label"
29156 #: ../src/guestfs-actions.pod:6887
29160 " guestfs_swapoff_label (guestfs_h *g,\n"
29161 " const char *label);\n"
29166 #: ../src/guestfs-actions.pod:6898
29167 msgid "guestfs_swapoff_uuid"
29171 #: ../src/guestfs-actions.pod:6900
29175 " guestfs_swapoff_uuid (guestfs_h *g,\n"
29176 " const char *uuid);\n"
29181 #: ../src/guestfs-actions.pod:6911
29182 msgid "guestfs_swapon_device"
29186 #: ../src/guestfs-actions.pod:6913
29190 " guestfs_swapon_device (guestfs_h *g,\n"
29191 " const char *device);\n"
29196 #: ../src/guestfs-actions.pod:6917
29198 "This command enables the libguestfs appliance to use the swap device or "
29199 "partition named C<device>. The increased memory is made available for all "
29200 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
29204 #: ../src/guestfs-actions.pod:6933
29205 msgid "guestfs_swapon_file"
29209 #: ../src/guestfs-actions.pod:6935
29213 " guestfs_swapon_file (guestfs_h *g,\n"
29214 " const char *file);\n"
29219 #: ../src/guestfs-actions.pod:6939
29221 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
29226 #: ../src/guestfs-actions.pod:6946
29227 msgid "guestfs_swapon_label"
29231 #: ../src/guestfs-actions.pod:6948
29235 " guestfs_swapon_label (guestfs_h *g,\n"
29236 " const char *label);\n"
29241 #: ../src/guestfs-actions.pod:6952
29243 "This command enables swap to a labeled swap partition. See "
29244 "C<guestfs_swapon_device> for other notes."
29248 #: ../src/guestfs-actions.pod:6959
29249 msgid "guestfs_swapon_uuid"
29253 #: ../src/guestfs-actions.pod:6961
29257 " guestfs_swapon_uuid (guestfs_h *g,\n"
29258 " const char *uuid);\n"
29263 #: ../src/guestfs-actions.pod:6965
29265 "This command enables swap to a swap partition with the given UUID. See "
29266 "C<guestfs_swapon_device> for other notes."
29270 #: ../src/guestfs-actions.pod:6972
29271 msgid "guestfs_sync"
29275 #: ../src/guestfs-actions.pod:6974
29279 " guestfs_sync (guestfs_h *g);\n"
29284 #: ../src/guestfs-actions.pod:6987
29285 msgid "guestfs_tail"
29289 #: ../src/guestfs-actions.pod:6989
29293 " guestfs_tail (guestfs_h *g,\n"
29294 " const char *path);\n"
29299 #: ../src/guestfs-actions.pod:7005
29300 msgid "guestfs_tail_n"
29304 #: ../src/guestfs-actions.pod:7007
29308 " guestfs_tail_n (guestfs_h *g,\n"
29310 " const char *path);\n"
29315 #: ../src/guestfs-actions.pod:7029
29316 msgid "guestfs_tar_in"
29320 #: ../src/guestfs-actions.pod:7031
29324 " guestfs_tar_in (guestfs_h *g,\n"
29325 " const char *tarfile,\n"
29326 " const char *directory);\n"
29331 #: ../src/guestfs-actions.pod:7039
29333 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
29337 #: ../src/guestfs-actions.pod:7044 ../src/guestfs-actions.pod:7061
29338 #: ../src/guestfs-actions.pod:7077 ../src/guestfs-actions.pod:7093
29339 msgid "(Added in 1.0.3)"
29343 #: ../src/guestfs-actions.pod:7046
29344 msgid "guestfs_tar_out"
29348 #: ../src/guestfs-actions.pod:7048
29352 " guestfs_tar_out (guestfs_h *g,\n"
29353 " const char *directory,\n"
29354 " const char *tarfile);\n"
29359 #: ../src/guestfs-actions.pod:7056
29361 "To download a compressed tarball, use C<guestfs_tgz_out> or "
29362 "C<guestfs_txz_out>."
29366 #: ../src/guestfs-actions.pod:7063
29367 msgid "guestfs_tgz_in"
29371 #: ../src/guestfs-actions.pod:7065
29375 " guestfs_tgz_in (guestfs_h *g,\n"
29376 " const char *tarball,\n"
29377 " const char *directory);\n"
29382 #: ../src/guestfs-actions.pod:7073
29383 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
29387 #: ../src/guestfs-actions.pod:7079
29388 msgid "guestfs_tgz_out"
29392 #: ../src/guestfs-actions.pod:7081
29396 " guestfs_tgz_out (guestfs_h *g,\n"
29397 " const char *directory,\n"
29398 " const char *tarball);\n"
29403 #: ../src/guestfs-actions.pod:7089
29404 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
29408 #: ../src/guestfs-actions.pod:7095
29409 msgid "guestfs_touch"
29413 #: ../src/guestfs-actions.pod:7097
29417 " guestfs_touch (guestfs_h *g,\n"
29418 " const char *path);\n"
29423 #: ../src/guestfs-actions.pod:7112
29424 msgid "guestfs_truncate"
29428 #: ../src/guestfs-actions.pod:7114
29432 " guestfs_truncate (guestfs_h *g,\n"
29433 " const char *path);\n"
29438 #: ../src/guestfs-actions.pod:7125
29439 msgid "guestfs_truncate_size"
29443 #: ../src/guestfs-actions.pod:7127
29447 " guestfs_truncate_size (guestfs_h *g,\n"
29448 " const char *path,\n"
29449 " int64_t size);\n"
29454 #: ../src/guestfs-actions.pod:7135
29456 "If the current file size is less than C<size> then the file is extended to "
29457 "the required size with zero bytes. This creates a sparse file (ie. disk "
29458 "blocks are not allocated for the file until you write to it). To create a "
29459 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
29463 #: ../src/guestfs-actions.pod:7145
29464 msgid "guestfs_tune2fs_l"
29468 #: ../src/guestfs-actions.pod:7147
29472 " guestfs_tune2fs_l (guestfs_h *g,\n"
29473 " const char *device);\n"
29478 #: ../src/guestfs-actions.pod:7167
29479 msgid "guestfs_txz_in"
29483 #: ../src/guestfs-actions.pod:7169
29487 " guestfs_txz_in (guestfs_h *g,\n"
29488 " const char *tarball,\n"
29489 " const char *directory);\n"
29494 #: ../src/guestfs-actions.pod:7181
29495 msgid "guestfs_txz_out"
29499 #: ../src/guestfs-actions.pod:7183
29503 " guestfs_txz_out (guestfs_h *g,\n"
29504 " const char *directory,\n"
29505 " const char *tarball);\n"
29510 #: ../src/guestfs-actions.pod:7195
29511 msgid "guestfs_umask"
29515 #: ../src/guestfs-actions.pod:7197
29519 " guestfs_umask (guestfs_h *g,\n"
29525 #: ../src/guestfs-actions.pod:7213
29527 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
29528 "C<guestfs_mkdir>."
29532 #: ../src/guestfs-actions.pod:7222
29533 msgid "guestfs_umount"
29537 #: ../src/guestfs-actions.pod:7224
29541 " guestfs_umount (guestfs_h *g,\n"
29542 " const char *pathordevice);\n"
29547 #: ../src/guestfs-actions.pod:7236
29548 msgid "guestfs_umount_all"
29552 #: ../src/guestfs-actions.pod:7238
29556 " guestfs_umount_all (guestfs_h *g);\n"
29561 #: ../src/guestfs-actions.pod:7249
29562 msgid "guestfs_upload"
29566 #: ../src/guestfs-actions.pod:7251
29570 " guestfs_upload (guestfs_h *g,\n"
29571 " const char *filename,\n"
29572 " const char *remotefilename);\n"
29577 #: ../src/guestfs-actions.pod:7261
29578 msgid "See also C<guestfs_download>."
29582 #: ../src/guestfs-actions.pod:7272
29583 msgid "guestfs_upload_offset"
29587 #: ../src/guestfs-actions.pod:7274
29591 " guestfs_upload_offset (guestfs_h *g,\n"
29592 " const char *filename,\n"
29593 " const char *remotefilename,\n"
29594 " int64_t offset);\n"
29599 #: ../src/guestfs-actions.pod:7290
29601 "Note that there is no limit on the amount of data that can be uploaded with "
29602 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
29603 "full amount unless an error occurs."
29607 #: ../src/guestfs-actions.pod:7295
29608 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
29612 #: ../src/guestfs-actions.pod:7306
29613 msgid "guestfs_utimens"
29617 #: ../src/guestfs-actions.pod:7308
29621 " guestfs_utimens (guestfs_h *g,\n"
29622 " const char *path,\n"
29623 " int64_t atsecs,\n"
29624 " int64_t atnsecs,\n"
29625 " int64_t mtsecs,\n"
29626 " int64_t mtnsecs);\n"
29631 #: ../src/guestfs-actions.pod:7337 ../src/guestfs-structs.pod:175
29632 msgid "guestfs_version"
29636 #: ../src/guestfs-actions.pod:7339
29639 " struct guestfs_version *\n"
29640 " guestfs_version (guestfs_h *g);\n"
29645 #: ../src/guestfs-actions.pod:7367
29647 "I<Note:> Don't use this call to test for availability of features. In "
29648 "enterprise distributions we backport features from later versions into "
29649 "earlier versions, making this an unreliable way to test for features. Use "
29650 "C<guestfs_available> instead."
29654 #: ../src/guestfs-actions.pod:7373
29656 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
29657 "error. I<The caller must call C<guestfs_free_version> after use>."
29661 #: ../src/guestfs-actions.pod:7377
29662 msgid "(Added in 1.0.58)"
29666 #: ../src/guestfs-actions.pod:7379
29667 msgid "guestfs_vfs_label"
29671 #: ../src/guestfs-actions.pod:7381
29675 " guestfs_vfs_label (guestfs_h *g,\n"
29676 " const char *device);\n"
29681 #: ../src/guestfs-actions.pod:7390
29682 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
29686 #: ../src/guestfs-actions.pod:7395 ../src/guestfs-actions.pod:7432
29687 msgid "(Added in 1.3.18)"
29691 #: ../src/guestfs-actions.pod:7397
29692 msgid "guestfs_vfs_type"
29696 #: ../src/guestfs-actions.pod:7399
29700 " guestfs_vfs_type (guestfs_h *g,\n"
29701 " const char *device);\n"
29706 #: ../src/guestfs-actions.pod:7416
29707 msgid "guestfs_vfs_uuid"
29711 #: ../src/guestfs-actions.pod:7418
29715 " guestfs_vfs_uuid (guestfs_h *g,\n"
29716 " const char *device);\n"
29721 #: ../src/guestfs-actions.pod:7427
29722 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
29726 #: ../src/guestfs-actions.pod:7434
29727 msgid "guestfs_vg_activate"
29731 #: ../src/guestfs-actions.pod:7436
29735 " guestfs_vg_activate (guestfs_h *g,\n"
29737 " char *const *volgroups);\n"
29742 #: ../src/guestfs-actions.pod:7453
29743 msgid "guestfs_vg_activate_all"
29747 #: ../src/guestfs-actions.pod:7455
29751 " guestfs_vg_activate_all (guestfs_h *g,\n"
29752 " int activate);\n"
29757 #: ../src/guestfs-actions.pod:7468
29758 msgid "guestfs_vgcreate"
29762 #: ../src/guestfs-actions.pod:7470
29766 " guestfs_vgcreate (guestfs_h *g,\n"
29767 " const char *volgroup,\n"
29768 " char *const *physvols);\n"
29773 #: ../src/guestfs-actions.pod:7482
29774 msgid "guestfs_vglvuuids"
29778 #: ../src/guestfs-actions.pod:7484
29782 " guestfs_vglvuuids (guestfs_h *g,\n"
29783 " const char *vgname);\n"
29788 #: ../src/guestfs-actions.pod:7491
29790 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
29791 "associate logical volumes and volume groups."
29795 #: ../src/guestfs-actions.pod:7494
29796 msgid "See also C<guestfs_vgpvuuids>."
29800 #: ../src/guestfs-actions.pod:7502
29801 msgid "guestfs_vgpvuuids"
29805 #: ../src/guestfs-actions.pod:7504
29809 " guestfs_vgpvuuids (guestfs_h *g,\n"
29810 " const char *vgname);\n"
29815 #: ../src/guestfs-actions.pod:7511
29817 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
29818 "associate physical volumes and volume groups."
29822 #: ../src/guestfs-actions.pod:7514
29823 msgid "See also C<guestfs_vglvuuids>."
29827 #: ../src/guestfs-actions.pod:7522
29828 msgid "guestfs_vgremove"
29832 #: ../src/guestfs-actions.pod:7524
29836 " guestfs_vgremove (guestfs_h *g,\n"
29837 " const char *vgname);\n"
29842 #: ../src/guestfs-actions.pod:7537
29843 msgid "guestfs_vgrename"
29847 #: ../src/guestfs-actions.pod:7539
29851 " guestfs_vgrename (guestfs_h *g,\n"
29852 " const char *volgroup,\n"
29853 " const char *newvolgroup);\n"
29858 #: ../src/guestfs-actions.pod:7550
29859 msgid "guestfs_vgs"
29863 #: ../src/guestfs-actions.pod:7552
29867 " guestfs_vgs (guestfs_h *g);\n"
29872 #: ../src/guestfs-actions.pod:7561
29873 msgid "See also C<guestfs_vgs_full>."
29877 #: ../src/guestfs-actions.pod:7569
29878 msgid "guestfs_vgs_full"
29882 #: ../src/guestfs-actions.pod:7571
29885 " struct guestfs_lvm_vg_list *\n"
29886 " guestfs_vgs_full (guestfs_h *g);\n"
29891 #: ../src/guestfs-actions.pod:7577
29893 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
29894 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
29898 #: ../src/guestfs-actions.pod:7583
29899 msgid "guestfs_vgscan"
29903 #: ../src/guestfs-actions.pod:7585
29907 " guestfs_vgscan (guestfs_h *g);\n"
29912 #: ../src/guestfs-actions.pod:7595
29913 msgid "guestfs_vguuid"
29917 #: ../src/guestfs-actions.pod:7597
29921 " guestfs_vguuid (guestfs_h *g,\n"
29922 " const char *vgname);\n"
29927 #: ../src/guestfs-actions.pod:7608
29928 msgid "guestfs_wait_ready"
29932 #: ../src/guestfs-actions.pod:7610
29936 " guestfs_wait_ready (guestfs_h *g);\n"
29941 #: ../src/guestfs-actions.pod:7613
29942 msgid "This function is a no op."
29946 #: ../src/guestfs-actions.pod:7615
29948 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
29949 "calling C<guestfs_launch> to wait for the launch to complete. However this "
29950 "is no longer necessary because C<guestfs_launch> now does the waiting."
29954 #: ../src/guestfs-actions.pod:7620
29956 "If you see any calls to this function in code then you can just remove them, "
29957 "unless you want to retain compatibility with older versions of the API."
29961 #: ../src/guestfs-actions.pod:7626
29963 "This function is deprecated. In new code, use the L</guestfs_launch> call "
29968 #: ../src/guestfs-actions.pod:7635
29969 msgid "guestfs_wc_c"
29973 #: ../src/guestfs-actions.pod:7637
29977 " guestfs_wc_c (guestfs_h *g,\n"
29978 " const char *path);\n"
29983 #: ../src/guestfs-actions.pod:7648
29984 msgid "guestfs_wc_l"
29988 #: ../src/guestfs-actions.pod:7650
29992 " guestfs_wc_l (guestfs_h *g,\n"
29993 " const char *path);\n"
29998 #: ../src/guestfs-actions.pod:7661
29999 msgid "guestfs_wc_w"
30003 #: ../src/guestfs-actions.pod:7663
30007 " guestfs_wc_w (guestfs_h *g,\n"
30008 " const char *path);\n"
30013 #: ../src/guestfs-actions.pod:7674
30014 msgid "guestfs_write"
30018 #: ../src/guestfs-actions.pod:7676
30022 " guestfs_write (guestfs_h *g,\n"
30023 " const char *path,\n"
30024 " const char *content,\n"
30025 " size_t content_size);\n"
30030 #: ../src/guestfs-actions.pod:7685
30031 msgid "See also C<guestfs_write_append>."
30035 #: ../src/guestfs-actions.pod:7694
30036 msgid "guestfs_write_append"
30040 #: ../src/guestfs-actions.pod:7696
30044 " guestfs_write_append (guestfs_h *g,\n"
30045 " const char *path,\n"
30046 " const char *content,\n"
30047 " size_t content_size);\n"
30052 #: ../src/guestfs-actions.pod:7705
30053 msgid "See also C<guestfs_write>."
30057 #: ../src/guestfs-actions.pod:7714
30058 msgid "guestfs_write_file"
30062 #: ../src/guestfs-actions.pod:7716
30066 " guestfs_write_file (guestfs_h *g,\n"
30067 " const char *path,\n"
30068 " const char *content,\n"
30074 #: ../src/guestfs-actions.pod:7738
30076 "This function is deprecated. In new code, use the L</guestfs_write> call "
30081 #: ../src/guestfs-actions.pod:7747
30082 msgid "guestfs_zegrep"
30086 #: ../src/guestfs-actions.pod:7749
30090 " guestfs_zegrep (guestfs_h *g,\n"
30091 " const char *regex,\n"
30092 " const char *path);\n"
30097 #: ../src/guestfs-actions.pod:7766
30098 msgid "guestfs_zegrepi"
30102 #: ../src/guestfs-actions.pod:7768
30106 " guestfs_zegrepi (guestfs_h *g,\n"
30107 " const char *regex,\n"
30108 " const char *path);\n"
30113 #: ../src/guestfs-actions.pod:7785
30114 msgid "guestfs_zero"
30118 #: ../src/guestfs-actions.pod:7787
30122 " guestfs_zero (guestfs_h *g,\n"
30123 " const char *device);\n"
30128 #: ../src/guestfs-actions.pod:7801
30130 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
30131 "C<guestfs_is_zero_device>"
30135 #: ../src/guestfs-actions.pod:7813
30136 msgid "guestfs_zero_device"
30140 #: ../src/guestfs-actions.pod:7815
30144 " guestfs_zero_device (guestfs_h *g,\n"
30145 " const char *device);\n"
30150 #: ../src/guestfs-actions.pod:7819
30152 "This command writes zeroes over the entire C<device>. Compare with "
30153 "C<guestfs_zero> which just zeroes the first few blocks of a device."
30157 #: ../src/guestfs-actions.pod:7837
30158 msgid "(Added in 1.3.1)"
30162 #: ../src/guestfs-actions.pod:7839
30163 msgid "guestfs_zerofree"
30167 #: ../src/guestfs-actions.pod:7841
30171 " guestfs_zerofree (guestfs_h *g,\n"
30172 " const char *device);\n"
30177 #: ../src/guestfs-actions.pod:7860
30178 msgid "guestfs_zfgrep"
30182 #: ../src/guestfs-actions.pod:7862
30186 " guestfs_zfgrep (guestfs_h *g,\n"
30187 " const char *pattern,\n"
30188 " const char *path);\n"
30193 #: ../src/guestfs-actions.pod:7879
30194 msgid "guestfs_zfgrepi"
30198 #: ../src/guestfs-actions.pod:7881
30202 " guestfs_zfgrepi (guestfs_h *g,\n"
30203 " const char *pattern,\n"
30204 " const char *path);\n"
30209 #: ../src/guestfs-actions.pod:7898
30210 msgid "guestfs_zfile"
30214 #: ../src/guestfs-actions.pod:7900
30218 " guestfs_zfile (guestfs_h *g,\n"
30219 " const char *meth,\n"
30220 " const char *path);\n"
30225 #: ../src/guestfs-actions.pod:7910
30227 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
30232 #: ../src/guestfs-actions.pod:7916
30234 "This function is deprecated. In new code, use the L</guestfs_file> call "
30239 #: ../src/guestfs-actions.pod:7925
30240 msgid "guestfs_zgrep"
30244 #: ../src/guestfs-actions.pod:7927
30248 " guestfs_zgrep (guestfs_h *g,\n"
30249 " const char *regex,\n"
30250 " const char *path);\n"
30255 #: ../src/guestfs-actions.pod:7944
30256 msgid "guestfs_zgrepi"
30260 #: ../src/guestfs-actions.pod:7946
30264 " guestfs_zgrepi (guestfs_h *g,\n"
30265 " const char *regex,\n"
30266 " const char *path);\n"
30271 #: ../src/guestfs-availability.pod:3
30276 #: ../src/guestfs-availability.pod:5
30278 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
30279 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
30280 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
30281 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
30282 "L</guestfs_aug_save> L</guestfs_aug_set>"
30286 #: ../src/guestfs-availability.pod:21
30291 #: ../src/guestfs-availability.pod:23
30292 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
30296 #: ../src/guestfs-availability.pod:26
30301 #: ../src/guestfs-availability.pod:28
30302 msgid "The following functions: L</guestfs_grub_install>"
30306 #: ../src/guestfs-availability.pod:31
30311 #: ../src/guestfs-availability.pod:33
30313 "The following functions: L</guestfs_inotify_add_watch> L</"
30314 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
30315 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
30319 #: ../src/guestfs-availability.pod:41
30320 msgid "B<linuxfsuuid>"
30324 #: ../src/guestfs-availability.pod:43
30326 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
30327 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
30331 #: ../src/guestfs-availability.pod:50
30332 msgid "B<linuxmodules>"
30336 #: ../src/guestfs-availability.pod:52
30337 msgid "The following functions: L</guestfs_modprobe>"
30341 #: ../src/guestfs-availability.pod:55
30342 msgid "B<linuxxattrs>"
30346 #: ../src/guestfs-availability.pod:57
30348 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
30349 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
30350 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
30351 "guestfs_setxattr>"
30355 #: ../src/guestfs-availability.pod:68
30360 #: ../src/guestfs-availability.pod:70
30362 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
30363 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
30364 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
30368 #: ../src/guestfs-availability.pod:79
30373 #: ../src/guestfs-availability.pod:81
30375 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
30376 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
30377 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
30378 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
30379 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
30380 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
30381 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
30385 #: ../src/guestfs-availability.pod:104
30390 #: ../src/guestfs-availability.pod:106
30392 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
30393 "guestfs_mknod_b> L</guestfs_mknod_c>"
30397 #: ../src/guestfs-availability.pod:112
30402 #: ../src/guestfs-availability.pod:114
30403 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
30407 #: ../src/guestfs-availability.pod:117
30408 msgid "B<ntfsprogs>"
30412 #: ../src/guestfs-availability.pod:119
30414 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
30415 "L</guestfs_ntfsresize_size>"
30419 #: ../src/guestfs-availability.pod:124
30420 msgid "B<realpath>"
30424 #: ../src/guestfs-availability.pod:126
30425 msgid "The following functions: L</guestfs_realpath>"
30429 #: ../src/guestfs-availability.pod:129
30434 #: ../src/guestfs-availability.pod:131
30436 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
30437 "guestfs_scrub_freespace>"
30441 #: ../src/guestfs-availability.pod:136
30446 #: ../src/guestfs-availability.pod:138
30447 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
30451 #: ../src/guestfs-availability.pod:142
30456 #: ../src/guestfs-availability.pod:144
30457 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
30461 #: ../src/guestfs-availability.pod:148
30462 msgid "B<zerofree>"
30466 #: ../src/guestfs-availability.pod:150
30467 msgid "The following functions: L</guestfs_zerofree>"
30471 #: ../src/guestfs-structs.pod:1
30472 msgid "guestfs_int_bool"
30476 #: ../src/guestfs-structs.pod:3
30479 " struct guestfs_int_bool {\n"
30487 #: ../src/guestfs-structs.pod:8
30490 " struct guestfs_int_bool_list {\n"
30491 " uint32_t len; /* Number of elements in list. */\n"
30492 " struct guestfs_int_bool *val; /* Elements. */\n"
30498 #: ../src/guestfs-structs.pod:13
30501 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
30502 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
30507 #: ../src/guestfs-structs.pod:16
30508 msgid "guestfs_lvm_pv"
30512 #: ../src/guestfs-structs.pod:18
30515 " struct guestfs_lvm_pv {\n"
30516 " char *pv_name;\n"
30517 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30518 " char pv_uuid[32];\n"
30520 " uint64_t pv_size;\n"
30521 " uint64_t dev_size;\n"
30522 " uint64_t pv_free;\n"
30523 " uint64_t pv_used;\n"
30524 " char *pv_attr;\n"
30525 " int64_t pv_pe_count;\n"
30526 " int64_t pv_pe_alloc_count;\n"
30527 " char *pv_tags;\n"
30528 " uint64_t pe_start;\n"
30529 " int64_t pv_mda_count;\n"
30530 " uint64_t pv_mda_free;\n"
30536 #: ../src/guestfs-structs.pod:36
30539 " struct guestfs_lvm_pv_list {\n"
30540 " uint32_t len; /* Number of elements in list. */\n"
30541 " struct guestfs_lvm_pv *val; /* Elements. */\n"
30547 #: ../src/guestfs-structs.pod:41
30550 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
30551 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
30556 #: ../src/guestfs-structs.pod:44
30557 msgid "guestfs_lvm_vg"
30561 #: ../src/guestfs-structs.pod:46
30564 " struct guestfs_lvm_vg {\n"
30565 " char *vg_name;\n"
30566 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30567 " char vg_uuid[32];\n"
30569 " char *vg_attr;\n"
30570 " uint64_t vg_size;\n"
30571 " uint64_t vg_free;\n"
30572 " char *vg_sysid;\n"
30573 " uint64_t vg_extent_size;\n"
30574 " int64_t vg_extent_count;\n"
30575 " int64_t vg_free_count;\n"
30576 " int64_t max_lv;\n"
30577 " int64_t max_pv;\n"
30578 " int64_t pv_count;\n"
30579 " int64_t lv_count;\n"
30580 " int64_t snap_count;\n"
30581 " int64_t vg_seqno;\n"
30582 " char *vg_tags;\n"
30583 " int64_t vg_mda_count;\n"
30584 " uint64_t vg_mda_free;\n"
30590 #: ../src/guestfs-structs.pod:69
30593 " struct guestfs_lvm_vg_list {\n"
30594 " uint32_t len; /* Number of elements in list. */\n"
30595 " struct guestfs_lvm_vg *val; /* Elements. */\n"
30601 #: ../src/guestfs-structs.pod:74
30604 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
30605 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
30610 #: ../src/guestfs-structs.pod:77
30611 msgid "guestfs_lvm_lv"
30615 #: ../src/guestfs-structs.pod:79
30618 " struct guestfs_lvm_lv {\n"
30619 " char *lv_name;\n"
30620 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30621 " char lv_uuid[32];\n"
30622 " char *lv_attr;\n"
30623 " int64_t lv_major;\n"
30624 " int64_t lv_minor;\n"
30625 " int64_t lv_kernel_major;\n"
30626 " int64_t lv_kernel_minor;\n"
30627 " uint64_t lv_size;\n"
30628 " int64_t seg_count;\n"
30630 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30631 " float snap_percent;\n"
30632 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30633 " float copy_percent;\n"
30634 " char *move_pv;\n"
30635 " char *lv_tags;\n"
30636 " char *mirror_log;\n"
30637 " char *modules;\n"
30643 #: ../src/guestfs-structs.pod:101
30646 " struct guestfs_lvm_lv_list {\n"
30647 " uint32_t len; /* Number of elements in list. */\n"
30648 " struct guestfs_lvm_lv *val; /* Elements. */\n"
30654 #: ../src/guestfs-structs.pod:106
30657 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
30658 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
30663 #: ../src/guestfs-structs.pod:111
30666 " struct guestfs_stat {\n"
30670 " int64_t nlink;\n"
30675 " int64_t blksize;\n"
30676 " int64_t blocks;\n"
30677 " int64_t atime;\n"
30678 " int64_t mtime;\n"
30679 " int64_t ctime;\n"
30685 #: ../src/guestfs-structs.pod:127
30688 " struct guestfs_stat_list {\n"
30689 " uint32_t len; /* Number of elements in list. */\n"
30690 " struct guestfs_stat *val; /* Elements. */\n"
30696 #: ../src/guestfs-structs.pod:132
30699 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
30700 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
30705 #: ../src/guestfs-structs.pod:137
30708 " struct guestfs_statvfs {\n"
30709 " int64_t bsize;\n"
30710 " int64_t frsize;\n"
30711 " int64_t blocks;\n"
30712 " int64_t bfree;\n"
30713 " int64_t bavail;\n"
30714 " int64_t files;\n"
30715 " int64_t ffree;\n"
30716 " int64_t favail;\n"
30719 " int64_t namemax;\n"
30725 #: ../src/guestfs-structs.pod:151
30728 " struct guestfs_statvfs_list {\n"
30729 " uint32_t len; /* Number of elements in list. */\n"
30730 " struct guestfs_statvfs *val; /* Elements. */\n"
30736 #: ../src/guestfs-structs.pod:156
30739 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
30740 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
30745 #: ../src/guestfs-structs.pod:159
30746 msgid "guestfs_dirent"
30750 #: ../src/guestfs-structs.pod:161
30753 " struct guestfs_dirent {\n"
30762 #: ../src/guestfs-structs.pod:167
30765 " struct guestfs_dirent_list {\n"
30766 " uint32_t len; /* Number of elements in list. */\n"
30767 " struct guestfs_dirent *val; /* Elements. */\n"
30773 #: ../src/guestfs-structs.pod:172
30776 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
30777 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
30782 #: ../src/guestfs-structs.pod:177
30785 " struct guestfs_version {\n"
30786 " int64_t major;\n"
30787 " int64_t minor;\n"
30788 " int64_t release;\n"
30795 #: ../src/guestfs-structs.pod:184
30798 " struct guestfs_version_list {\n"
30799 " uint32_t len; /* Number of elements in list. */\n"
30800 " struct guestfs_version *val; /* Elements. */\n"
30806 #: ../src/guestfs-structs.pod:189
30809 " void guestfs_free_version (struct guestfs_free_version *);\n"
30810 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
30815 #: ../src/guestfs-structs.pod:192
30816 msgid "guestfs_xattr"
30820 #: ../src/guestfs-structs.pod:194
30823 " struct guestfs_xattr {\n"
30824 " char *attrname;\n"
30825 " /* The next two fields describe a byte array. */\n"
30826 " uint32_t attrval_len;\n"
30827 " char *attrval;\n"
30833 #: ../src/guestfs-structs.pod:201
30836 " struct guestfs_xattr_list {\n"
30837 " uint32_t len; /* Number of elements in list. */\n"
30838 " struct guestfs_xattr *val; /* Elements. */\n"
30844 #: ../src/guestfs-structs.pod:206
30847 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
30848 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
30853 #: ../src/guestfs-structs.pod:209
30854 msgid "guestfs_inotify_event"
30858 #: ../src/guestfs-structs.pod:211
30861 " struct guestfs_inotify_event {\n"
30862 " int64_t in_wd;\n"
30863 " uint32_t in_mask;\n"
30864 " uint32_t in_cookie;\n"
30865 " char *in_name;\n"
30871 #: ../src/guestfs-structs.pod:218
30874 " struct guestfs_inotify_event_list {\n"
30875 " uint32_t len; /* Number of elements in list. */\n"
30876 " struct guestfs_inotify_event *val; /* Elements. */\n"
30882 #: ../src/guestfs-structs.pod:223
30885 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
30886 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
30891 #: ../src/guestfs-structs.pod:226
30892 msgid "guestfs_partition"
30896 #: ../src/guestfs-structs.pod:228
30899 " struct guestfs_partition {\n"
30900 " int32_t part_num;\n"
30901 " uint64_t part_start;\n"
30902 " uint64_t part_end;\n"
30903 " uint64_t part_size;\n"
30909 #: ../src/guestfs-structs.pod:235
30912 " struct guestfs_partition_list {\n"
30913 " uint32_t len; /* Number of elements in list. */\n"
30914 " struct guestfs_partition *val; /* Elements. */\n"
30920 #: ../src/guestfs-structs.pod:240
30923 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
30924 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
30929 #: ../src/guestfs-structs.pod:243
30930 msgid "guestfs_application"
30934 #: ../src/guestfs-structs.pod:245
30937 " struct guestfs_application {\n"
30938 " char *app_name;\n"
30939 " char *app_display_name;\n"
30940 " int32_t app_epoch;\n"
30941 " char *app_version;\n"
30942 " char *app_release;\n"
30943 " char *app_install_path;\n"
30944 " char *app_trans_path;\n"
30945 " char *app_publisher;\n"
30946 " char *app_url;\n"
30947 " char *app_source_package;\n"
30948 " char *app_summary;\n"
30949 " char *app_description;\n"
30955 #: ../src/guestfs-structs.pod:260
30958 " struct guestfs_application_list {\n"
30959 " uint32_t len; /* Number of elements in list. */\n"
30960 " struct guestfs_application *val; /* Elements. */\n"
30966 #: ../src/guestfs-structs.pod:265
30969 " void guestfs_free_application (struct guestfs_free_application *);\n"
30970 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
30975 #: ../src/guestfs.pod:5
30976 msgid "guestfs - Library for accessing and modifying virtual machine images"
30980 #: ../src/guestfs.pod:11
30983 " guestfs_h *g = guestfs_create ();\n"
30984 " guestfs_add_drive (g, \"guest.img\");\n"
30985 " guestfs_launch (g);\n"
30986 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30987 " guestfs_touch (g, \"/hello\");\n"
30988 " guestfs_umount (g, \"/\");\n"
30989 " guestfs_close (g);\n"
30994 #: ../src/guestfs.pod:25
30996 "Libguestfs is a library for accessing and modifying guest disk images. "
30997 "Amongst the things this is good for: making batch configuration changes to "
30998 "guests, getting disk used/free statistics (see also: virt-df), migrating "
30999 "between virtualization systems (see also: virt-p2v), performing partial "
31000 "backups, performing partial guest clones, cloning guests and changing "
31001 "registry/UUID/hostname info, and much else besides."
31005 #: ../src/guestfs.pod:33
31007 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
31008 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
31009 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
31014 #: ../src/guestfs.pod:38
31016 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
31017 "what filesystem is in each LV, etc.). It can also run commands in the "
31018 "context of the guest. Also you can access filesystems over FUSE."
31022 #: ../src/guestfs.pod:43
31024 "Libguestfs is a library that can be linked with C and C++ management "
31025 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
31026 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
31031 #: ../src/guestfs.pod:48
31033 "You don't need to be root to use libguestfs, although obviously you do need "
31034 "enough permissions to access the disk images."
31038 #: ../src/guestfs.pod:51
31040 "Libguestfs is a large API because it can do many things. For a gentle "
31041 "introduction, please read the L</API OVERVIEW> section next."
31045 #: ../src/guestfs.pod:54
31047 "There are also some example programs in the L<guestfs-examples(3)> manual "
31052 #: ../src/guestfs.pod:57
31053 msgid "API OVERVIEW"
31057 #: ../src/guestfs.pod:59
31059 "This section provides a gentler overview of the libguestfs API. We also try "
31060 "to group API calls together, where that may not be obvious from reading "
31061 "about the individual calls in the main section of this manual."
31065 #: ../src/guestfs.pod:64
31070 #: ../src/guestfs.pod:66
31072 "Before you can use libguestfs calls, you have to create a handle. Then you "
31073 "must add at least one disk image to the handle, followed by launching the "
31074 "handle, then performing whatever operations you want, and finally closing "
31075 "the handle. By convention we use the single letter C<g> for the name of the "
31076 "handle variable, although of course you can use any name you want."
31080 #: ../src/guestfs.pod:73
31081 msgid "The general structure of all libguestfs-using programs looks like this:"
31085 #: ../src/guestfs.pod:76
31088 " guestfs_h *g = guestfs_create ();\n"
31093 #: ../src/guestfs.pod:78
31096 " /* Call guestfs_add_drive additional times if there are\n"
31097 " * multiple disk images.\n"
31099 " guestfs_add_drive (g, \"guest.img\");\n"
31104 #: ../src/guestfs.pod:83
31107 " /* Most manipulation calls won't work until you've launched\n"
31108 " * the handle 'g'. You have to do this _after_ adding drives\n"
31109 " * and _before_ other commands.\n"
31111 " guestfs_launch (g);\n"
31116 #: ../src/guestfs.pod:89
31119 " /* Now you can examine what partitions, LVs etc are available.\n"
31121 " char **partitions = guestfs_list_partitions (g);\n"
31122 " char **logvols = guestfs_lvs (g);\n"
31127 #: ../src/guestfs.pod:94
31130 " /* To access a filesystem in the image, you must mount it.\n"
31132 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
31137 #: ../src/guestfs.pod:98
31140 " /* Now you can perform filesystem actions on the guest\n"
31143 " guestfs_touch (g, \"/hello\");\n"
31148 #: ../src/guestfs.pod:103
31151 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
31152 " * it is done automatically when you close the handle. See\n"
31153 " * discussion of autosync in this page.\n"
31155 " guestfs_sync (g);\n"
31160 #: ../src/guestfs.pod:109
31163 " /* Close the handle 'g'. */\n"
31164 " guestfs_close (g);\n"
31169 #: ../src/guestfs.pod:112
31171 "The code above doesn't include any error checking. In real code you should "
31172 "check return values carefully for errors. In general all functions that "
31173 "return integers return C<-1> on error, and all functions that return "
31174 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
31175 "how to handle errors, and consult the documentation for each function call "
31176 "below to see precisely how they return error indications. See L<guestfs-"
31177 "examples(3)> for fully worked examples."
31181 #: ../src/guestfs.pod:121
31182 msgid "DISK IMAGES"
31186 #: ../src/guestfs.pod:123
31188 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
31189 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
31190 "actual block device, or simply an empty file of zeroes that you have created "
31191 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
31196 #: ../src/guestfs.pod:129
31198 "The call you should use in modern code for adding drives is L</"
31199 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
31200 "specifying that the format is raw, do:"
31204 #: ../src/guestfs.pod:133
31207 " guestfs_add_drive_opts (g, filename,\n"
31208 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31214 #: ../src/guestfs.pod:137
31215 msgid "You can add a disk read-only using:"
31219 #: ../src/guestfs.pod:139
31222 " guestfs_add_drive_opts (g, filename,\n"
31223 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31224 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
31230 #: ../src/guestfs.pod:144
31232 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
31233 "libguestfs won't modify the file."
31237 #: ../src/guestfs.pod:147
31239 "Be extremely cautious if the disk image is in use, eg. if it is being used "
31240 "by a virtual machine. Adding it read-write will almost certainly cause disk "
31241 "corruption, but adding it read-only is safe."
31245 #: ../src/guestfs.pod:151
31247 "You must add at least one disk image, and you may add multiple disk images. "
31248 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
31249 "first one you added), C</dev/sdb> (for the second one you added), etc."
31253 #: ../src/guestfs.pod:156
31255 "Once L</guestfs_launch> has been called you cannot add any more images. You "
31256 "can call L</guestfs_list_devices> to get a list of the device names, in the "
31257 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
31261 #: ../src/guestfs.pod:161
31266 #: ../src/guestfs.pod:163
31268 "Before you can read or write files, create directories and so on in a disk "
31269 "image that contains filesystems, you have to mount those filesystems using "
31270 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
31271 "a disk image contains (for example) one partition with a filesystem on that "
31272 "partition, then you can mount it directly:"
31276 #: ../src/guestfs.pod:170
31279 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
31284 #: ../src/guestfs.pod:172
31286 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
31287 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
31288 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
31289 "that these are libguestfs virtual devices, and are nothing to do with host "
31294 #: ../src/guestfs.pod:178
31296 "If you are given a disk image and you don't know what it contains then you "
31297 "have to find out. Libguestfs can do that too: use L</"
31298 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
31299 "LVs, and either try mounting each to see what is mountable, or else examine "
31300 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
31301 "filesystems, use L</guestfs_list_filesystems>."
31305 #: ../src/guestfs.pod:186
31307 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
31308 "L</INSPECTION> below). But you might find it easier to look at higher level "
31309 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
31313 #: ../src/guestfs.pod:191
31315 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
31316 "several other variations of the C<guestfs_mount_*> call."
31320 #: ../src/guestfs.pod:194
31321 msgid "FILESYSTEM ACCESS AND MODIFICATION"
31325 #: ../src/guestfs.pod:196
31327 "The majority of the libguestfs API consists of fairly low-level calls for "
31328 "accessing and modifying the files, directories, symlinks etc on mounted "
31329 "filesystems. There are over a hundred such calls which you can find listed "
31330 "in detail below in this man page, and we don't even pretend to cover them "
31331 "all in this overview."
31335 #: ../src/guestfs.pod:202
31337 "Specify filenames as full paths, starting with C<\"/\"> and including the "
31342 #: ../src/guestfs.pod:205
31344 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
31345 "the file called C<\"etc/passwd\"> then you could do:"
31349 #: ../src/guestfs.pod:208
31352 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
31357 #: ../src/guestfs.pod:210
31359 "This would return C<data> as a newly allocated buffer containing the full "
31360 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
31361 "or C<NULL> if there was an error."
31365 #: ../src/guestfs.pod:214
31367 "As another example, to create a top-level directory on that filesystem "
31368 "called C<\"var\"> you would do:"
31372 #: ../src/guestfs.pod:217
31375 " guestfs_mkdir (g, \"/var\");\n"
31380 #: ../src/guestfs.pod:219
31381 msgid "To create a symlink you could do:"
31385 #: ../src/guestfs.pod:221
31388 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
31389 " \"/etc/rc3.d/S30portmap\");\n"
31394 #: ../src/guestfs.pod:224
31396 "Libguestfs will reject attempts to use relative paths and there is no "
31397 "concept of a current working directory."
31401 #: ../src/guestfs.pod:227
31403 "Libguestfs can return errors in many situations: for example if the "
31404 "filesystem isn't writable, or if a file or directory that you requested "
31405 "doesn't exist. If you are using the C API (documented here) you have to "
31406 "check for those error conditions after each call. (Other language bindings "
31407 "turn these errors into exceptions)."
31411 #: ../src/guestfs.pod:233
31413 "File writes are affected by the per-handle umask, set by calling L</"
31414 "guestfs_umask> and defaulting to 022. See L</UMASK>."
31418 #: ../src/guestfs.pod:236
31419 msgid "PARTITIONING"
31423 #: ../src/guestfs.pod:238
31425 "Libguestfs contains API calls to read, create and modify partition tables on "
31430 #: ../src/guestfs.pod:241
31432 "In the common case where you want to create a single partition covering the "
31433 "whole disk, you should use the L</guestfs_part_disk> call:"
31437 #: ../src/guestfs.pod:245
31440 " const char *parttype = \"mbr\";\n"
31441 " if (disk_is_larger_than_2TB)\n"
31442 " parttype = \"gpt\";\n"
31443 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
31448 #: ../src/guestfs.pod:250
31450 "Obviously this effectively wipes anything that was on that disk image before."
31454 #: ../src/guestfs.pod:253
31459 #: ../src/guestfs.pod:255
31461 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
31462 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
31463 "you familiarize yourself with the concepts of physical volumes, volume "
31464 "groups and logical volumes."
31468 #: ../src/guestfs.pod:260
31470 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
31471 "tldp.org/HOWTO/LVM-HOWTO/>."
31475 #: ../src/guestfs.pod:263
31476 msgid "DOWNLOADING"
31480 #: ../src/guestfs.pod:265
31482 "Use L</guestfs_cat> to download small, text only files. This call is "
31483 "limited to files which are less than 2 MB and which cannot contain any ASCII "
31484 "NUL (C<\\0>) characters. However the API is very simple to use."
31488 #: ../src/guestfs.pod:269
31490 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
31491 "bit data, since it returns a (pointer, size) pair. However it is still "
31492 "limited to \"small\" files, less than 2 MB."
31496 #: ../src/guestfs.pod:273
31498 "L</guestfs_download> can be used to download any file, with no limits on "
31499 "content or size (even files larger than 4 GB)."
31503 #: ../src/guestfs.pod:276
31505 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
31509 #: ../src/guestfs.pod:279
31514 #: ../src/guestfs.pod:281
31516 "It's often the case that you want to write a file or files to the disk image."
31520 #: ../src/guestfs.pod:284
31522 "To write a small file with fixed content, use L</guestfs_write>. To create "
31523 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
31524 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
31525 "of other functions for creating test files, for example L</guestfs_fill> and "
31526 "L</guestfs_fill_pattern>."
31530 #: ../src/guestfs.pod:290
31532 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
31533 "file content or size (even files larger than 4 GB)."
31537 #: ../src/guestfs.pod:293
31539 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
31543 #: ../src/guestfs.pod:295
31545 "However the fastest way to upload I<large numbers of arbitrary files> is to "
31546 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
31547 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
31548 "in a predictable way (eg. adding it last after all other drives) then you "
31549 "can get the device name from L</guestfs_list_devices> and mount it directly "
31550 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
31551 "portable between kernel versions, and they don't support labels or UUIDs. "
31552 "If you want to pre-build an image or you need to mount it using a label or "
31553 "UUID, use an ISO image instead."
31557 #: ../src/guestfs.pod:306
31562 #: ../src/guestfs.pod:308
31564 "There are various different commands for copying between files and devices "
31565 "and in and out of the guest filesystem. These are summarised in the table "
31570 #: ../src/guestfs.pod:314
31571 msgid "B<file> to B<file>"
31575 #: ../src/guestfs.pod:316
31577 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
31578 "directories recursively."
31582 #: ../src/guestfs.pod:319
31583 msgid "B<file or device> to B<file or device>"
31587 #: ../src/guestfs.pod:321
31589 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
31590 "devices in the guest."
31594 #: ../src/guestfs.pod:324
31595 msgid "Example: duplicate the contents of an LV:"
31599 #: ../src/guestfs.pod:326
31602 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
31607 #: ../src/guestfs.pod:328
31609 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
31610 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
31611 "guestfs_copy_size>."
31615 #: ../src/guestfs.pod:332
31616 msgid "B<file on the host> to B<file or device>"
31620 #: ../src/guestfs.pod:334
31621 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
31625 #: ../src/guestfs.pod:336
31626 msgid "B<file or device> to B<file on the host>"
31630 #: ../src/guestfs.pod:338
31631 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
31635 #: ../src/guestfs.pod:342
31636 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
31640 #: ../src/guestfs.pod:344
31642 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
31643 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
31644 "appears you can only upload and download to files. However many Un*x-like "
31645 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
31646 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
31647 "and arbitrary file descriptor N."
31651 #: ../src/guestfs.pod:352
31652 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
31656 #: ../src/guestfs.pod:355
31659 " guestfs_download (g, filename, \"/dev/stdout\");\n"
31664 #: ../src/guestfs.pod:357
31665 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
31669 #: ../src/guestfs.pod:359
31672 " char devfd[64];\n"
31673 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
31674 " guestfs_tar_out (g, \"/\", devfd);\n"
31679 #: ../src/guestfs.pod:363
31680 msgid "LISTING FILES"
31684 #: ../src/guestfs.pod:365
31686 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
31687 "L<guestfish(1)>-equivalent command C<ll>)."
31691 #: ../src/guestfs.pod:368
31693 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
31694 "programs, as a flat list of strings."
31698 #: ../src/guestfs.pod:371
31700 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
31701 "directory, plus additional information about each one. It is more "
31702 "equivalent to using the L<readdir(3)> call on a local filesystem."
31706 #: ../src/guestfs.pod:375
31708 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
31712 #: ../src/guestfs.pod:378
31713 msgid "RUNNING COMMANDS"
31717 #: ../src/guestfs.pod:380
31719 "Although libguestfs is primarily an API for manipulating files inside guest "
31720 "images, we also provide some limited facilities for running commands inside "
31725 #: ../src/guestfs.pod:384
31726 msgid "There are many limitations to this:"
31730 #: ../src/guestfs.pod:390
31732 "The kernel version that the command runs under will be different from what "
31737 #: ../src/guestfs.pod:395
31739 "If the command needs to communicate with daemons, then most likely they "
31740 "won't be running."
31744 #: ../src/guestfs.pod:400
31745 msgid "The command will be running in limited memory."
31749 #: ../src/guestfs.pod:404
31751 "The network may not be available unless you enable it (see L</"
31752 "guestfs_set_network>)."
31756 #: ../src/guestfs.pod:409
31757 msgid "Only supports Linux guests (not Windows, BSD, etc)."
31761 #: ../src/guestfs.pod:413
31763 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
31767 #: ../src/guestfs.pod:418
31769 "For SELinux guests, you may need to enable SELinux and load policy first. "
31770 "See L</SELINUX> in this manpage."
31774 #: ../src/guestfs.pod:423
31776 "I<Security:> It is not safe to run commands from untrusted, possibly "
31777 "malicious guests. These commands may attempt to exploit your program by "
31778 "sending unexpected output. They could also try to exploit the Linux kernel "
31779 "or qemu provided by the libguestfs appliance. They could use the network "
31780 "provided by the libguestfs appliance to bypass ordinary network partitions "
31781 "and firewalls. They could use the elevated privileges or different SELinux "
31782 "context of your program to their advantage."
31786 #: ../src/guestfs.pod:432
31788 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
31789 "(a script which runs when the guest next boots normally), and to have this "
31790 "script run the commands you want in the normal context of the running guest, "
31791 "network security and so on. For information about other security issues, "
31792 "see L</SECURITY>."
31796 #: ../src/guestfs.pod:440
31798 "The two main API calls to run commands are L</guestfs_command> and L</"
31799 "guestfs_sh> (there are also variations)."
31803 #: ../src/guestfs.pod:443
31805 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
31806 "shell globs, redirections, etc will work."
31810 #: ../src/guestfs.pod:446
31811 msgid "CONFIGURATION FILES"
31815 #: ../src/guestfs.pod:448
31817 "To read and write configuration files in Linux guest filesystems, we "
31818 "strongly recommend using Augeas. For example, Augeas understands how to "
31819 "read and write, say, a Linux shadow password file or X.org configuration "
31820 "file, and so avoids you having to write that code."
31824 #: ../src/guestfs.pod:453
31826 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
31827 "document Augeas itself here because there is excellent documentation on the "
31828 "L<http://augeas.net/> website."
31832 #: ../src/guestfs.pod:457
31834 "If you don't want to use Augeas (you fool!) then try calling L</"
31835 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
31840 #: ../src/guestfs.pod:461
31845 #: ../src/guestfs.pod:463
31847 "We support SELinux guests. To ensure that labeling happens correctly in "
31848 "SELinux guests, you need to enable SELinux and load the guest's policy:"
31852 #: ../src/guestfs.pod:471
31853 msgid "Before launching, do:"
31857 #: ../src/guestfs.pod:473
31860 " guestfs_set_selinux (g, 1);\n"
31865 #: ../src/guestfs.pod:477
31867 "After mounting the guest's filesystem(s), load the policy. This is best "
31868 "done by running the L<load_policy(8)> command in the guest itself:"
31872 #: ../src/guestfs.pod:481
31875 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
31880 #: ../src/guestfs.pod:483
31882 "(Older versions of C<load_policy> require you to specify the name of the "
31887 #: ../src/guestfs.pod:488
31889 "Optionally, set the security context for the API. The correct security "
31890 "context to use can only be known by inspecting the guest. As an example:"
31894 #: ../src/guestfs.pod:492
31897 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
31902 #: ../src/guestfs.pod:496
31903 msgid "This will work for running commands and editing existing files."
31907 #: ../src/guestfs.pod:498
31909 "When new files are created, you may need to label them explicitly, for "
31910 "example by running the external command C<restorecon pathname>."
31914 #: ../src/guestfs.pod:502
31919 #: ../src/guestfs.pod:504
31921 "Certain calls are affected by the current file mode creation mask (the "
31922 "\"umask\"). In particular ones which create files or directories, such as "
31923 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
31924 "either the default mode that the file is created with or modifies the mode "
31929 #: ../src/guestfs.pod:510
31931 "The default umask is C<022>, so files are created with modes such as C<0644> "
31932 "and directories with C<0755>."
31936 #: ../src/guestfs.pod:513
31938 "There are two ways to avoid being affected by umask. Either set umask to 0 "
31939 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
31940 "guestfs_chmod> after creating each file or directory."
31944 #: ../src/guestfs.pod:517
31945 msgid "For more information about umask, see L<umask(2)>."
31949 #: ../src/guestfs.pod:521
31951 "Libguestfs allows you to access Linux guests which have been encrypted using "
31952 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
31953 "standard. This includes nearly all whole disk encryption systems used by "
31954 "modern Linux guests."
31958 #: ../src/guestfs.pod:527
31960 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
31961 "returns the string C<crypto_LUKS>)."
31965 #: ../src/guestfs.pod:530
31967 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
31968 "will require the passphrase!"
31972 #: ../src/guestfs.pod:533
31974 "Opening a LUKS device creates a new device mapper device called C</dev/"
31975 "mapper/mapname> (where C<mapname> is the string you supply to L</"
31976 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
31977 "from and encrypted to the underlying block device respectively."
31981 #: ../src/guestfs.pod:539
31983 "LVM volume groups on the device can be made visible by calling L</"
31984 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
31985 "(s) can now be mounted in the usual way."
31989 #: ../src/guestfs.pod:543
31991 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
31992 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
31993 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
31994 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
31995 "underlying encrypted block device)."
31999 #: ../src/guestfs.pod:550
32004 #: ../src/guestfs.pod:552
32006 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
32007 "contains operating systems, an install CD or a live CD. (These APIs used to "
32008 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
32009 "version 1.5.3 the most frequently used part of this library has been "
32010 "rewritten in C and moved into the core code)."
32014 #: ../src/guestfs.pod:559
32016 "Add all disks belonging to the unknown virtual machine and call L</"
32017 "guestfs_launch> in the usual way."
32021 #: ../src/guestfs.pod:562
32023 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
32024 "and certain heuristics, and returns a list of operating systems that were "
32025 "found. An empty list means none were found. A single element is the root "
32026 "filesystem of the operating system. For dual- or multi-boot guests, "
32027 "multiple roots can be returned, each one corresponding to a separate "
32028 "operating system. (Multi-boot virtual machines are extremely rare in the "
32029 "world of virtualization, but since this scenario can happen, we have built "
32030 "libguestfs to deal with it.)"
32034 #: ../src/guestfs.pod:571
32036 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
32037 "to get additional details about that operating system. For example, call L</"
32038 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
32039 "Windows and Linux-based operating systems respectively."
32043 #: ../src/guestfs.pod:577
32045 "Un*x-like and Linux-based operating systems usually consist of several "
32046 "filesystems which are mounted at boot time (for example, a separate boot "
32047 "partition mounted on C</boot>). The inspection rules are able to detect how "
32048 "filesystems correspond to mount points. Call "
32049 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
32050 "hash table like this example:"
32054 #: ../src/guestfs.pod:584
32057 " /boot => /dev/sda1\n"
32058 " / => /dev/vg_guest/lv_root\n"
32059 " /usr => /dev/vg_guest/lv_usr\n"
32064 #: ../src/guestfs.pod:588
32066 "The caller can then make calls to L</guestfs_mount_options> to mount the "
32067 "filesystems as suggested."
32071 #: ../src/guestfs.pod:591
32073 "Be careful to mount filesystems in the right order (eg. C</> before C</"
32074 "usr>). Sorting the keys of the hash by length, shortest first, should work."
32078 #: ../src/guestfs.pod:595
32080 "Inspection currently only works for some common operating systems. "
32081 "Contributors are welcome to send patches for other operating systems that we "
32082 "currently cannot detect."
32086 #: ../src/guestfs.pod:599
32088 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
32089 "for more details. The L</guestfs_inspect_os> function just ignores any "
32090 "encrypted devices."
32094 #: ../src/guestfs.pod:603
32096 "A note on the implementation: The call L</guestfs_inspect_os> performs "
32097 "inspection and caches the results in the guest handle. Subsequent calls to "
32098 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
32099 "read the disks. If you change the content of the guest disks, you can redo "
32100 "inspection by calling L</guestfs_inspect_os> again. (L</"
32101 "guestfs_inspect_list_applications> works a little differently from the other "
32102 "calls and does read the disks. See documentation for that function for "
32107 #: ../src/guestfs.pod:612
32108 msgid "INSPECTING INSTALL DISKS"
32112 #: ../src/guestfs.pod:614
32114 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
32119 #: ../src/guestfs.pod:617
32121 "Call L</guestfs_inspect_get_format> to return the format of the operating "
32122 "system, which currently can be C<installed> (a regular operating system) or "
32123 "C<installer> (some sort of install disk)."
32127 #: ../src/guestfs.pod:621
32129 "Further information is available about the operating system that can be "
32130 "installed using the regular inspection APIs like L</"
32131 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
32135 #: ../src/guestfs.pod:626
32137 "Some additional information specific to installer disks is also available "
32138 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
32139 "guestfs_inspect_is_multipart> calls."
32143 #: ../src/guestfs.pod:631
32144 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
32148 #: ../src/guestfs.pod:633
32150 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
32151 "ntfs-3g.org/> driver."
32155 #: ../src/guestfs.pod:636
32156 msgid "DRIVE LETTERS AND PATHS"
32160 #: ../src/guestfs.pod:638
32162 "DOS and Windows still use drive letters, and the filesystems are always "
32163 "treated as case insensitive by Windows itself, and therefore you might find "
32164 "a Windows configuration file referring to a path like C<c:\\windows"
32165 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
32166 "might be referred to as C</WINDOWS/System32>."
32170 #: ../src/guestfs.pod:644
32172 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
32173 "L</guestfs_inspect_get_drive_mappings>)"
32177 #: ../src/guestfs.pod:647
32179 "Dealing with separator characters (backslash vs forward slash) is outside "
32180 "the scope of libguestfs, but usually a simple character replacement will "
32185 #: ../src/guestfs.pod:651
32187 "To resolve the case insensitivity of paths, call L</"
32188 "guestfs_case_sensitive_path>."
32192 #: ../src/guestfs.pod:654
32193 msgid "ACCESSING THE WINDOWS REGISTRY"
32197 #: ../src/guestfs.pod:656
32199 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
32200 "files, through the library C<hivex> which is part of the libguestfs project "
32201 "although ships as a separate tarball. You have to locate and download the "
32202 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
32203 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
32204 "reg(1)> for more help on this issue."
32208 #: ../src/guestfs.pod:664
32209 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
32213 #: ../src/guestfs.pod:666
32215 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
32216 "provide something which looks like a Linux symlink. The way it tries to do "
32217 "the rewriting is described here:"
32221 #: ../src/guestfs.pod:670
32223 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
32228 #: ../src/guestfs.pod:672
32230 "The essential problem is that ntfs-3g simply does not have enough "
32231 "information to do a correct job. NTFS links can contain drive letters and "
32232 "references to external device GUIDs that ntfs-3g has no way of resolving. "
32233 "It is almost certainly the case that libguestfs callers should ignore what "
32234 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
32238 #: ../src/guestfs.pod:679
32240 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
32241 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
32242 "attribute, and read the raw reparse data from that (you can find the format "
32243 "documented in various places around the web)."
32247 #: ../src/guestfs.pod:684
32248 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
32252 #: ../src/guestfs.pod:686
32254 "There are other useful extended attributes that can be read from ntfs-3g "
32255 "filesystems (using L</guestfs_getxattr>). See:"
32259 #: ../src/guestfs.pod:689
32261 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
32265 #: ../src/guestfs.pod:691
32266 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
32270 #: ../src/guestfs.pod:693
32272 "Although we don't want to discourage you from using the C API, we will "
32273 "mention here that the same API is also available in other languages."
32277 #: ../src/guestfs.pod:696
32279 "The API is broadly identical in all supported languages. This means that "
32280 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
32281 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
32282 "OCaml. In other words, a straightforward, predictable isomorphism between "
32287 #: ../src/guestfs.pod:702
32289 "Error messages are automatically transformed into exceptions if the language "
32294 #: ../src/guestfs.pod:705
32296 "We don't try to \"object orientify\" parts of the API in OO languages, "
32297 "although contributors are welcome to write higher level APIs above what we "
32298 "provide in their favourite languages if they wish."
32302 #: ../src/guestfs.pod:711
32307 #: ../src/guestfs.pod:713
32309 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
32310 "identical to the C API. C++ classes and exceptions are not used."
32314 #: ../src/guestfs.pod:717
32319 #: ../src/guestfs.pod:719
32321 "The C# bindings are highly experimental. Please read the warnings at the "
32322 "top of C<csharp/Libguestfs.cs>."
32326 #: ../src/guestfs.pod:722
32331 #: ../src/guestfs.pod:724
32333 "This is the only language binding that is working but incomplete. Only "
32334 "calls which return simple integers have been bound in Haskell, and we are "
32335 "looking for help to complete this binding."
32339 #: ../src/guestfs.pod:728
32344 #: ../src/guestfs.pod:730
32346 "Full documentation is contained in the Javadoc which is distributed with "
32347 "libguestfs. For examples, see L<guestfs-java(3)>."
32351 #: ../src/guestfs.pod:733
32356 #: ../src/guestfs.pod:735
32357 msgid "See L<guestfs-ocaml(3)>."
32361 #: ../src/guestfs.pod:737
32366 #: ../src/guestfs.pod:739
32367 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
32371 #: ../src/guestfs.pod:741
32376 #: ../src/guestfs.pod:743
32378 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
32379 "the php-libguestfs package for your distribution."
32383 #: ../src/guestfs.pod:746
32384 msgid "The PHP binding only works correctly on 64 bit machines."
32388 #: ../src/guestfs.pod:748
32393 #: ../src/guestfs.pod:750
32394 msgid "See L<guestfs-python(3)>."
32398 #: ../src/guestfs.pod:752
32403 #: ../src/guestfs.pod:754
32404 msgid "See L<guestfs-ruby(3)>."
32408 #: ../src/guestfs.pod:756
32409 msgid "B<shell scripts>"
32413 #: ../src/guestfs.pod:758
32414 msgid "See L<guestfish(1)>."
32418 #: ../src/guestfs.pod:762
32419 msgid "LIBGUESTFS GOTCHAS"
32423 #: ../src/guestfs.pod:764
32425 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
32426 "system [...] that works in the way it is documented but is counterintuitive "
32427 "and almost invites mistakes.\""
32431 #: ../src/guestfs.pod:768
32433 "Since we developed libguestfs and the associated tools, there are several "
32434 "things we would have designed differently, but are now stuck with for "
32435 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
32436 "release, you can expect these to change. Beware of them."
32440 #: ../src/guestfs.pod:776
32441 msgid "Autosync / forgetting to sync."
32445 #: ../src/guestfs.pod:778
32447 "I<Update:> Autosync is enabled by default for all API users starting from "
32448 "libguestfs 1.5.24. This section only applies to older versions."
32452 #: ../src/guestfs.pod:781
32454 "When modifying a filesystem from C or another language, you B<must> unmount "
32455 "all filesystems and call L</guestfs_sync> explicitly before you close the "
32456 "libguestfs handle. You can also call:"
32460 #: ../src/guestfs.pod:785
32463 " guestfs_set_autosync (g, 1);\n"
32468 #: ../src/guestfs.pod:787
32470 "to have the unmount/sync done automatically for you when the handle 'g' is "
32471 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
32475 #: ../src/guestfs.pod:791
32477 "If you forget to do this, then it is entirely possible that your changes "
32478 "won't be written out, or will be partially written, or (very rarely) that "
32479 "you'll get disk corruption."
32483 #: ../src/guestfs.pod:795
32485 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
32486 "guestfish scripts that forget to sync will work just fine, which can make "
32487 "this very puzzling if you are trying to debug a problem."
32491 #: ../src/guestfs.pod:799
32492 msgid "Mount option C<-o sync> should not be the default."
32496 #: ../src/guestfs.pod:801
32498 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
32499 "However C<-o sync> does not add any reliability benefit, but does have a "
32500 "very large performance impact."
32504 #: ../src/guestfs.pod:805
32506 "The work around is to use L</guestfs_mount_options> and set the mount "
32507 "options that you actually want to use."
32511 #: ../src/guestfs.pod:808
32512 msgid "Read-only should be the default."
32516 #: ../src/guestfs.pod:810
32518 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
32519 "specify I<--rw> if you want to make changes to the image."
32523 #: ../src/guestfs.pod:813
32524 msgid "This would reduce the potential to corrupt live VM images."
32528 #: ../src/guestfs.pod:815
32530 "Note that many filesystems change the disk when you just mount and unmount, "
32531 "even if you didn't perform any writes. You need to use L</"
32532 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
32536 #: ../src/guestfs.pod:819
32537 msgid "guestfish command line is hard to use."
32541 #: ../src/guestfs.pod:821
32543 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
32544 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
32545 "exist, so it fails. In earlier versions of guestfish the error message was "
32546 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
32547 "we should have used C<guestfish -c command> to run commands."
32551 #: ../src/guestfs.pod:828
32552 msgid "guestfish megabyte modifiers don't work right on all commands"
32556 #: ../src/guestfs.pod:830
32558 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
32559 "other modifiers). What guestfish actually does is to multiply the number "
32560 "part by the modifier part and pass the result to the C API. However this "
32561 "doesn't work for a few APIs which aren't expecting bytes, but are already "
32562 "expecting some other unit (eg. megabytes)."
32566 #: ../src/guestfs.pod:837
32567 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
32571 #: ../src/guestfs.pod:839
32574 " lvcreate LV VG 100M\n"
32579 #: ../src/guestfs.pod:841
32581 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
32582 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
32583 "megabytes * megabytes) logical volume. The error message you get from this "
32584 "is also a little obscure."
32588 #: ../src/guestfs.pod:846
32590 "This could be fixed in the generator by specially marking parameters and "
32591 "return values which take bytes or other units."
32595 #: ../src/guestfs.pod:849
32596 msgid "Ambiguity between devices and paths"
32600 #: ../src/guestfs.pod:851
32602 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
32603 "sdb2>) and a similar pathname. A file might just happen to be called "
32604 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
32608 #: ../src/guestfs.pod:856
32610 "In the current API we usually resolve this ambiguity by having two separate "
32611 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
32612 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
32613 "detecting if the path supplied begins with C</dev/>."
32617 #: ../src/guestfs.pod:862
32619 "To avoid both the ambiguity and the need to duplicate some calls, we could "
32620 "make paths/devices into structured names. One way to do this would be to "
32621 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
32622 "aspect of grub. Another way would be to use a structured type, equivalent "
32623 "to this OCaml type:"
32627 #: ../src/guestfs.pod:868
32630 " type path = Path of string | Device of int | Partition of int * int\n"
32635 #: ../src/guestfs.pod:870
32636 msgid "which would allow you to pass arguments like:"
32640 #: ../src/guestfs.pod:872
32643 " Path \"/foo/bar\"\n"
32644 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
32645 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
32646 " Path \"/dev/sdb2\" (* not a device *)\n"
32651 #: ../src/guestfs.pod:877
32653 "As you can see there are still problems to resolve even with this "
32654 "representation. Also consider how it might work in guestfish."
32658 #: ../src/guestfs.pod:882
32659 msgid "KEYS AND PASSPHRASES"
32663 #: ../src/guestfs.pod:884
32665 "Certain libguestfs calls take a parameter that contains sensitive key "
32666 "material, passed in as a C string."
32670 #: ../src/guestfs.pod:887
32672 "In the future we would hope to change the libguestfs implementation so that "
32673 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
32674 "swap. However this is I<not> done at the moment, because of the complexity "
32675 "of such an implementation."
32679 #: ../src/guestfs.pod:892
32681 "Therefore you should be aware that any key parameter you pass to libguestfs "
32682 "might end up being written out to the swap partition. If this is a concern, "
32683 "scrub the swap partition or don't use libguestfs on encrypted devices."
32687 #: ../src/guestfs.pod:897
32688 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
32692 #: ../src/guestfs.pod:899
32694 "All high-level libguestfs actions are synchronous. If you want to use "
32695 "libguestfs asynchronously then you must create a thread."
32699 #: ../src/guestfs.pod:902
32701 "Only use the handle from a single thread. Either use the handle exclusively "
32702 "from one thread, or provide your own mutex so that two threads cannot issue "
32703 "calls on the same handle at the same time."
32707 #: ../src/guestfs.pod:906
32709 "See the graphical program guestfs-browser for one possible architecture for "
32710 "multithreaded programs using libvirt and libguestfs."
32714 #: ../src/guestfs.pod:909
32719 #: ../src/guestfs.pod:911
32721 "Libguestfs needs a supermin appliance, which it finds by looking along an "
32726 #: ../src/guestfs.pod:914
32728 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
32729 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
32733 #: ../src/guestfs.pod:917
32735 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
32736 "to change the directories that libguestfs will search in. The value is a "
32737 "colon-separated list of paths. The current directory is I<not> searched "
32738 "unless the path contains an empty element or C<.>. For example "
32739 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
32740 "then C</usr/lib/guestfs>."
32744 #: ../src/guestfs.pod:924
32745 msgid "QEMU WRAPPERS"
32749 #: ../src/guestfs.pod:926
32751 "If you want to compile your own qemu, run qemu from a non-standard location, "
32752 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
32757 #: ../src/guestfs.pod:930
32759 "There is one important rule to remember: you I<must C<exec qemu>> as the "
32760 "last command in the shell script (so that qemu replaces the shell and "
32761 "becomes the direct child of the libguestfs-using program). If you don't do "
32762 "this, then the qemu process won't be cleaned up correctly."
32766 #: ../src/guestfs.pod:935
32768 "Here is an example of a wrapper, where I have built my own copy of qemu from "
32773 #: ../src/guestfs.pod:938
32777 " qemudir=/home/rjones/d/qemu\n"
32778 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
32783 #: ../src/guestfs.pod:942
32785 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
32786 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
32791 #: ../src/guestfs.pod:946
32794 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
32799 #: ../src/guestfs.pod:948
32801 "Note that libguestfs also calls qemu with the -help and -version options in "
32802 "order to determine features."
32806 #: ../src/guestfs.pod:951
32807 msgid "ATTACHING TO RUNNING DAEMONS"
32811 #: ../src/guestfs.pod:953
32813 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
32814 "babies. Use with caution."
32818 #: ../src/guestfs.pod:956
32820 "I<Note (2):> This section explains how to attach to a running daemon from a "
32821 "low level perspective. For most users, simply using virt tools such as "
32822 "L<guestfish(1)> with the I<--live> option will \"just work\"."
32826 #: ../src/guestfs.pod:960
32827 msgid "Using guestfs_set_attach_method"
32831 #: ../src/guestfs.pod:962
32833 "By calling L</guestfs_set_attach_method> you can change how the library "
32834 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
32835 "ARCHITECTURE> for some background)."
32839 #: ../src/guestfs.pod:966
32841 "The normal attach method is C<appliance>, where a small appliance is created "
32842 "containing the daemon, and then the library connects to this."
32846 #: ../src/guestfs.pod:969
32848 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
32849 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
32850 "daemon over the Unix domain socket."
32854 #: ../src/guestfs.pod:973
32856 "The normal use for this is to connect to a running virtual machine that "
32857 "contains a C<guestfsd> daemon, and send commands so you can read and write "
32858 "files inside the live virtual machine."
32862 #: ../src/guestfs.pod:977
32863 msgid "Using guestfs_add_domain with live flag"
32867 #: ../src/guestfs.pod:979
32869 "L</guestfs_add_domain> provides some help for getting the correct attach "
32870 "method. If you pass the C<live> option to this function, then (if the "
32871 "virtual machine is running) it will examine the libvirt XML looking for a "
32872 "virtio-serial channel to connect to:"
32876 #: ../src/guestfs.pod:985
32883 " <channel type='unix'>\n"
32884 " <source mode='bind' path='/path/to/socket'/>\n"
32885 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
32894 #: ../src/guestfs.pod:997
32896 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
32897 "method to C<unix:/path/to/socket>."
32901 #: ../src/guestfs.pod:1000
32903 "Some of the libguestfs tools (including guestfish) support a I<--live> "
32904 "option which is passed through to L</guestfs_add_domain> thus allowing you "
32905 "to attach to and modify live virtual machines."
32909 #: ../src/guestfs.pod:1004
32911 "The virtual machine needs to have been set up beforehand so that it has the "
32912 "virtio-serial channel and so that guestfsd is running inside it."
32916 #: ../src/guestfs.pod:1008
32917 msgid "ABI GUARANTEE"
32921 #: ../src/guestfs.pod:1010
32923 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
32924 "actions as outlined in this section. Although we will deprecate some "
32925 "actions, for example if they get replaced by newer calls, we will keep the "
32926 "old actions forever. This allows you the developer to program in confidence "
32927 "against the libguestfs API."
32931 #: ../src/guestfs.pod:1016
32932 msgid "BLOCK DEVICE NAMING"
32936 #: ../src/guestfs.pod:1018
32938 "In the kernel there is now quite a profusion of schemata for naming block "
32939 "devices (in this context, by I<block device> I mean a physical or virtual "
32940 "hard drive). The original Linux IDE driver used names starting with C</dev/"
32941 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
32942 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
32943 "for the old IDE driver (particularly for SATA devices) those devices also "
32944 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
32945 "paravirtualized drivers. This has created several different naming systems, "
32946 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
32950 #: ../src/guestfs.pod:1030
32952 "As discussed above, libguestfs uses a qemu appliance running an embedded "
32953 "Linux kernel to access block devices. We can run a variety of appliances "
32954 "based on a variety of Linux kernels."
32958 #: ../src/guestfs.pod:1034
32960 "This causes a problem for libguestfs because many API calls use device or "
32961 "partition names. Working scripts and the recipe (example) scripts that we "
32962 "make available over the internet could fail if the naming scheme changes."
32966 #: ../src/guestfs.pod:1039
32968 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
32969 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
32970 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
32971 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
32975 #: ../src/guestfs.pod:1045
32977 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
32978 "L</guestfs_list_partitions> and similar calls return the true names of the "
32979 "devices and partitions as known to the appliance."
32983 #: ../src/guestfs.pod:1050
32984 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
32988 #: ../src/guestfs.pod:1052
32990 "Usually this translation is transparent. However in some (very rare) cases "
32991 "you may need to know the exact algorithm. Such cases include where you use "
32992 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
32993 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
32997 #: ../src/guestfs.pod:1058
32999 "The algorithm is applied only to I<parameters> which are known to be either "
33000 "device or partition names. Return values from functions such as L</"
33001 "guestfs_list_devices> are never changed."
33005 #: ../src/guestfs.pod:1066
33006 msgid "Is the string a parameter which is a device or partition name?"
33010 #: ../src/guestfs.pod:1070
33011 msgid "Does the string begin with C</dev/sd>?"
33015 #: ../src/guestfs.pod:1074
33017 "Does the named device exist? If so, we use that device. However if I<not> "
33018 "then we continue with this algorithm."
33022 #: ../src/guestfs.pod:1079
33023 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
33027 #: ../src/guestfs.pod:1081
33028 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
33032 #: ../src/guestfs.pod:1083
33033 msgid "If that named device exists, use it. If not, continue."
33037 #: ../src/guestfs.pod:1087
33038 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
33042 #: ../src/guestfs.pod:1089
33043 msgid "If that named device exists, use it. If not, return an error."
33047 #: ../src/guestfs.pod:1093
33048 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
33052 #: ../src/guestfs.pod:1095
33054 "Although the standard naming scheme and automatic translation is useful for "
33055 "simple programs and guestfish scripts, for larger programs it is best not to "
33056 "rely on this mechanism."
33060 #: ../src/guestfs.pod:1099
33062 "Where possible for maximum future portability programs using libguestfs "
33063 "should use these future-proof techniques:"
33067 #: ../src/guestfs.pod:1106
33069 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
33070 "device names, and then use those names directly."
33074 #: ../src/guestfs.pod:1109
33076 "Since those device names exist by definition, they will never be translated."
33080 #: ../src/guestfs.pod:1114
33082 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
33083 "filesystem labels."
33087 #: ../src/guestfs.pod:1119
33092 #: ../src/guestfs.pod:1121
33094 "This section discusses security implications of using libguestfs, "
33095 "particularly with untrusted or malicious guests or disk images."
33099 #: ../src/guestfs.pod:1124
33100 msgid "GENERAL SECURITY CONSIDERATIONS"
33104 #: ../src/guestfs.pod:1126
33106 "Be careful with any files or data that you download from a guest (by "
33107 "\"download\" we mean not just the L</guestfs_download> command but any "
33108 "command that reads files, filenames, directories or anything else from a "
33109 "disk image). An attacker could manipulate the data to fool your program "
33110 "into doing the wrong thing. Consider cases such as:"
33114 #: ../src/guestfs.pod:1136
33115 msgid "the data (file etc) not being present"
33119 #: ../src/guestfs.pod:1140
33120 msgid "being present but empty"
33124 #: ../src/guestfs.pod:1144
33125 msgid "being much larger than normal"
33129 #: ../src/guestfs.pod:1148
33130 msgid "containing arbitrary 8 bit data"
33134 #: ../src/guestfs.pod:1152
33135 msgid "being in an unexpected character encoding"
33139 #: ../src/guestfs.pod:1156
33140 msgid "containing homoglyphs."
33144 #: ../src/guestfs.pod:1160
33145 msgid "SECURITY OF MOUNTING FILESYSTEMS"
33149 #: ../src/guestfs.pod:1162
33151 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
33152 "(VFS) module can sometimes be escalated into exploits by deliberately "
33153 "creating a malicious, malformed filesystem. These exploits are very severe "
33154 "for two reasons. Firstly there are very many filesystem drivers in the "
33155 "kernel, and many of them are infrequently used and not much developer "
33156 "attention has been paid to the code. Linux userspace helps potential "
33157 "crackers by detecting the filesystem type and automatically choosing the "
33158 "right VFS driver, even if that filesystem type is obscure or unexpected for "
33159 "the administrator. Secondly, a kernel-level exploit is like a local root "
33160 "exploit (worse in some ways), giving immediate and total access to the "
33161 "system right down to the hardware level."
33165 #: ../src/guestfs.pod:1175
33167 "That explains why you should never mount a filesystem from an untrusted "
33168 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
33169 "inside a qemu virtual machine, usually running as a non-root user. The "
33170 "attacker would need to write a filesystem which first exploited the kernel, "
33171 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
33172 "the libguestfs protocol, and finally to be as serious as the host kernel "
33173 "exploit it would need to escalate its privileges to root. This multi-step "
33174 "escalation, performed by a static piece of data, is thought to be extremely "
33175 "hard to do, although we never say 'never' about security issues."
33179 #: ../src/guestfs.pod:1186
33181 "In any case callers can reduce the attack surface by forcing the filesystem "
33182 "type when mounting (use L</guestfs_mount_vfs>)."
33186 #: ../src/guestfs.pod:1189
33187 msgid "PROTOCOL SECURITY"
33191 #: ../src/guestfs.pod:1191
33193 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
33194 "defined upper message size. However a program that uses libguestfs must "
33195 "also take care - for example you can write a program that downloads a binary "
33196 "from a disk image and executes it locally, and no amount of protocol "
33197 "security will save you from the consequences."
33201 #: ../src/guestfs.pod:1197
33202 msgid "INSPECTION SECURITY"
33206 #: ../src/guestfs.pod:1199
33208 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
33209 "directly from the guest, and these could contain any 8 bit data. Callers "
33210 "should be careful to escape these before printing them to a structured file "
33211 "(for example, use HTML escaping if creating a web page)."
33215 #: ../src/guestfs.pod:1205
33217 "Guest configuration may be altered in unusual ways by the administrator of "
33218 "the virtual machine, and may not reflect reality (particularly for untrusted "
33219 "or actively malicious guests). For example we parse the hostname from "
33220 "configuration files like C</etc/sysconfig/network> that we find in the "
33221 "guest, but the guest administrator can easily manipulate these files to "
33222 "provide the wrong hostname."
33226 #: ../src/guestfs.pod:1213
33228 "The inspection API parses guest configuration using two external libraries: "
33229 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
33230 "designed to be robust in the face of malicious data, although denial of "
33231 "service attacks are still possible, for example with oversized configuration "
33236 #: ../src/guestfs.pod:1219
33237 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
33241 #: ../src/guestfs.pod:1221
33243 "Be very cautious about running commands from the guest. By running a "
33244 "command in the guest, you are giving CPU time to a binary that you do not "
33245 "control, under the same user account as the library, albeit wrapped in qemu "
33246 "virtualization. More information and alternatives can be found in the "
33247 "section L</RUNNING COMMANDS>."
33251 #: ../src/guestfs.pod:1227
33252 msgid "CVE-2010-3851"
33256 #: ../src/guestfs.pod:1229
33257 msgid "https://bugzilla.redhat.com/642934"
33261 #: ../src/guestfs.pod:1231
33263 "This security bug concerns the automatic disk format detection that qemu "
33264 "does on disk images."
33268 #: ../src/guestfs.pod:1234
33270 "A raw disk image is just the raw bytes, there is no header. Other disk "
33271 "images like qcow2 contain a special header. Qemu deals with this by looking "
33272 "for one of the known headers, and if none is found then assuming the disk "
33273 "image must be raw."
33277 #: ../src/guestfs.pod:1239
33279 "This allows a guest which has been given a raw disk image to write some "
33280 "other header. At next boot (or when the disk image is accessed by "
33281 "libguestfs) qemu would do autodetection and think the disk image format was, "
33282 "say, qcow2 based on the header written by the guest."
33286 #: ../src/guestfs.pod:1244
33288 "This in itself would not be a problem, but qcow2 offers many features, one "
33289 "of which is to allow a disk image to refer to another image (called the "
33290 "\"backing disk\"). It does this by placing the path to the backing disk "
33291 "into the qcow2 header. This path is not validated and could point to any "
33292 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
33293 "\"holes\" in the qcow2 disk image, which of course is completely under the "
33294 "control of the attacker."
33298 #: ../src/guestfs.pod:1252
33300 "In libguestfs this is rather hard to exploit except under two circumstances:"
33304 #: ../src/guestfs.pod:1259
33305 msgid "You have enabled the network or have opened the disk in write mode."
33309 #: ../src/guestfs.pod:1263
33311 "You are also running untrusted code from the guest (see L</RUNNING "
33316 #: ../src/guestfs.pod:1268
33318 "The way to avoid this is to specify the expected disk format when adding "
33319 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
33320 "should always do this if the disk is raw format, and it's a good idea for "
33325 #: ../src/guestfs.pod:1273
33327 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
33328 "format is fetched from libvirt and passed through."
33332 #: ../src/guestfs.pod:1276
33334 "For libguestfs tools, use the I<--format> command line parameter as "
33339 #: ../src/guestfs.pod:1279
33340 msgid "CONNECTION MANAGEMENT"
33344 #: ../src/guestfs.pod:1281
33345 msgid "guestfs_h *"
33349 #: ../src/guestfs.pod:1283
33351 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
33352 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
33353 "handle and release all resources used."
33357 #: ../src/guestfs.pod:1287
33359 "For information on using multiple handles and threads, see the section L</"
33360 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
33364 #: ../src/guestfs.pod:1290
33365 msgid "guestfs_create"
33369 #: ../src/guestfs.pod:1292
33372 " guestfs_h *guestfs_create (void);\n"
33377 #: ../src/guestfs.pod:1294
33378 msgid "Create a connection handle."
33382 #: ../src/guestfs.pod:1296
33384 "On success this returns a non-NULL pointer to a handle. On error it returns "
33389 #: ../src/guestfs.pod:1299
33391 "You have to \"configure\" the handle after creating it. This includes "
33392 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
33393 "handle at least once."
33397 #: ../src/guestfs.pod:1303
33398 msgid "After configuring the handle, you have to call L</guestfs_launch>."
33402 #: ../src/guestfs.pod:1305
33404 "You may also want to configure error handling for the handle. See the L</"
33405 "ERROR HANDLING> section below."
33409 #: ../src/guestfs.pod:1308
33410 msgid "guestfs_close"
33414 #: ../src/guestfs.pod:1310
33417 " void guestfs_close (guestfs_h *g);\n"
33422 #: ../src/guestfs.pod:1312
33423 msgid "This closes the connection handle and frees up all resources used."
33427 #: ../src/guestfs.pod:1314
33429 "If autosync was set on the handle and the handle was launched, then this "
33430 "implicitly calls various functions to unmount filesystems and sync the "
33431 "disk. See L</guestfs_set_autosync> for more details."
33435 #: ../src/guestfs.pod:1318
33436 msgid "If a close callback was set on the handle, then it is called."
33440 #: ../src/guestfs.pod:1320
33441 msgid "ERROR HANDLING"
33445 #: ../src/guestfs.pod:1322
33447 "API functions can return errors. For example, almost all functions that "
33448 "return C<int> will return C<-1> to indicate an error."
33452 #: ../src/guestfs.pod:1325
33454 "Additional information is available for errors: an error message string and "
33455 "optionally an error number (errno) if the thing that failed was a system "
33460 #: ../src/guestfs.pod:1329
33462 "You can get at the additional information about the last error on the handle "
33463 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
33464 "up an error handler with L</guestfs_set_error_handler>."
33468 #: ../src/guestfs.pod:1334
33470 "When the handle is created, a default error handler is installed which "
33471 "prints the error message string to C<stderr>. For small short-running "
33472 "command line programs it is sufficient to do:"
33476 #: ../src/guestfs.pod:1338
33479 " if (guestfs_launch (g) == -1)\n"
33480 " exit (EXIT_FAILURE);\n"
33485 #: ../src/guestfs.pod:1341
33487 "since the default error handler will ensure that an error message has been "
33488 "printed to C<stderr> before the program exits."
33492 #: ../src/guestfs.pod:1344
33494 "For other programs the caller will almost certainly want to install an "
33495 "alternate error handler or do error handling in-line like this:"
33499 #: ../src/guestfs.pod:1347
33502 " g = guestfs_create ();\n"
33507 #: ../src/guestfs.pod:1349
33510 " /* This disables the default behaviour of printing errors\n"
33512 " guestfs_set_error_handler (g, NULL, NULL);\n"
33517 #: ../src/guestfs.pod:1353
33520 " if (guestfs_launch (g) == -1) {\n"
33521 " /* Examine the error message and print it etc. */\n"
33522 " char *msg = guestfs_last_error (g);\n"
33523 " int errnum = guestfs_last_errno (g);\n"
33524 " fprintf (stderr, \"%s\\n\", msg);\n"
33531 #: ../src/guestfs.pod:1361
33533 "Out of memory errors are handled differently. The default action is to call "
33534 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
33535 "guestfs_set_out_of_memory_handler>."
33539 #: ../src/guestfs.pod:1365
33541 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
33542 "because there is no handle if this happens there is no way to get additional "
33543 "error information. However L</guestfs_create> is supposed to be a "
33544 "lightweight operation which can only fail because of insufficient memory (it "
33545 "returns NULL in this case)."
33549 #: ../src/guestfs.pod:1371
33550 msgid "guestfs_last_error"
33554 #: ../src/guestfs.pod:1373
33557 " const char *guestfs_last_error (guestfs_h *g);\n"
33562 #: ../src/guestfs.pod:1375
33564 "This returns the last error message that happened on C<g>. If there has not "
33565 "been an error since the handle was created, then this returns C<NULL>."
33569 #: ../src/guestfs.pod:1379
33571 "The lifetime of the returned string is until the next error occurs, or L</"
33572 "guestfs_close> is called."
33576 #: ../src/guestfs.pod:1382
33577 msgid "guestfs_last_errno"
33581 #: ../src/guestfs.pod:1384
33584 " int guestfs_last_errno (guestfs_h *g);\n"
33589 #: ../src/guestfs.pod:1386
33590 msgid "This returns the last error number (errno) that happened on C<g>."
33594 #: ../src/guestfs.pod:1388
33595 msgid "If successful, an errno integer not equal to zero is returned."
33599 #: ../src/guestfs.pod:1390
33601 "If no error, this returns 0. This call can return 0 in three situations:"
33605 #: ../src/guestfs.pod:1397
33606 msgid "There has not been any error on the handle."
33610 #: ../src/guestfs.pod:1401
33612 "There has been an error but the errno was meaningless. This corresponds to "
33613 "the case where the error did not come from a failed system call, but for "
33614 "some other reason."
33618 #: ../src/guestfs.pod:1407
33620 "There was an error from a failed system call, but for some reason the errno "
33621 "was not captured and returned. This usually indicates a bug in libguestfs."
33625 #: ../src/guestfs.pod:1413
33627 "Libguestfs tries to convert the errno from inside the applicance into a "
33628 "corresponding errno for the caller (not entirely trivial: the appliance "
33629 "might be running a completely different operating system from the library "
33630 "and error numbers are not standardized across Un*xen). If this could not be "
33631 "done, then the error is translated to C<EINVAL>. In practice this should "
33632 "only happen in very rare circumstances."
33636 #: ../src/guestfs.pod:1421
33637 msgid "guestfs_set_error_handler"
33641 #: ../src/guestfs.pod:1423
33644 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
33646 " const char *msg);\n"
33647 " void guestfs_set_error_handler (guestfs_h *g,\n"
33648 " guestfs_error_handler_cb cb,\n"
33649 " void *opaque);\n"
33654 #: ../src/guestfs.pod:1430
33656 "The callback C<cb> will be called if there is an error. The parameters "
33657 "passed to the callback are an opaque data pointer and the error message "
33662 #: ../src/guestfs.pod:1434
33664 "C<errno> is not passed to the callback. To get that the callback must call "
33665 "L</guestfs_last_errno>."
33669 #: ../src/guestfs.pod:1437
33671 "Note that the message string C<msg> is freed as soon as the callback "
33672 "function returns, so if you want to stash it somewhere you must make your "
33677 #: ../src/guestfs.pod:1441
33678 msgid "The default handler prints messages on C<stderr>."
33682 #: ../src/guestfs.pod:1443
33683 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
33687 #: ../src/guestfs.pod:1445
33688 msgid "guestfs_get_error_handler"
33692 #: ../src/guestfs.pod:1447
33695 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
33696 " void **opaque_rtn);\n"
33701 #: ../src/guestfs.pod:1450
33702 msgid "Returns the current error handler callback."
33706 #: ../src/guestfs.pod:1452
33707 msgid "guestfs_set_out_of_memory_handler"
33711 #: ../src/guestfs.pod:1454
33714 " typedef void (*guestfs_abort_cb) (void);\n"
33715 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
33716 " guestfs_abort_cb);\n"
33721 #: ../src/guestfs.pod:1458
33723 "The callback C<cb> will be called if there is an out of memory situation. "
33724 "I<Note this callback must not return>."
33728 #: ../src/guestfs.pod:1461
33729 msgid "The default is to call L<abort(3)>."
33733 #: ../src/guestfs.pod:1463
33735 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
33739 #: ../src/guestfs.pod:1466
33740 msgid "guestfs_get_out_of_memory_handler"
33744 #: ../src/guestfs.pod:1468
33747 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
33752 #: ../src/guestfs.pod:1470
33753 msgid "This returns the current out of memory handler."
33757 #: ../src/guestfs.pod:1472
33762 #: ../src/guestfs.pod:1476
33767 #: ../src/guestfs.pod:1478
33772 #: ../src/guestfs.pod:1480
33773 msgid "AVAILABILITY"
33777 #: ../src/guestfs.pod:1482
33778 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
33782 #: ../src/guestfs.pod:1484
33784 "Using L</guestfs_available> you can test availability of the following "
33785 "groups of functions. This test queries the appliance to see if the "
33786 "appliance you are currently using supports the functionality."
33790 #: ../src/guestfs.pod:1489
33791 msgid "@AVAILABILITY@"
33795 #: ../src/guestfs.pod:1491
33796 msgid "GUESTFISH supported COMMAND"
33800 #: ../src/guestfs.pod:1493
33802 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
33803 "prints out the available groups and whether they are supported by this build "
33804 "of libguestfs. Note however that you have to do C<run> first."
33808 #: ../src/guestfs.pod:1498
33809 msgid "SINGLE CALLS AT COMPILE TIME"
33813 #: ../src/guestfs.pod:1500
33815 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
33816 "function, such as:"
33820 #: ../src/guestfs.pod:1503
33823 " #define LIBGUESTFS_HAVE_DD 1\n"
33828 #: ../src/guestfs.pod:1505
33829 msgid "if L</guestfs_dd> is available."
33833 #: ../src/guestfs.pod:1507
33835 "Before version 1.5.8, if you needed to test whether a single libguestfs "
33836 "function is available at compile time, we recommended using build tools such "
33837 "as autoconf or cmake. For example in autotools you could use:"
33841 #: ../src/guestfs.pod:1512
33844 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
33845 " AC_CHECK_FUNCS([guestfs_dd])\n"
33850 #: ../src/guestfs.pod:1515
33852 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
33857 #: ../src/guestfs.pod:1518
33858 msgid "SINGLE CALLS AT RUN TIME"
33862 #: ../src/guestfs.pod:1520
33864 "Testing at compile time doesn't guarantee that a function really exists in "
33865 "the library. The reason is that you might be dynamically linked against a "
33866 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
33867 "This situation unfortunately results in a segmentation fault, which is a "
33868 "shortcoming of the C dynamic linking system itself."
33872 #: ../src/guestfs.pod:1527
33874 "You can use L<dlopen(3)> to test if a function is available at run time, as "
33875 "in this example program (note that you still need the compile time check as "
33880 #: ../src/guestfs.pod:1531
33883 " #include <stdio.h>\n"
33884 " #include <stdlib.h>\n"
33885 " #include <unistd.h>\n"
33886 " #include <dlfcn.h>\n"
33887 " #include <guestfs.h>\n"
33892 #: ../src/guestfs.pod:1537
33897 " #ifdef LIBGUESTFS_HAVE_DD\n"
33899 " int has_function;\n"
33904 #: ../src/guestfs.pod:1543
33907 " /* Test if the function guestfs_dd is really available. */\n"
33908 " dl = dlopen (NULL, RTLD_LAZY);\n"
33910 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
33911 " exit (EXIT_FAILURE);\n"
33913 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
33919 #: ../src/guestfs.pod:1552
33922 " if (!has_function)\n"
33923 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
33925 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
33926 " /* Now it's safe to call\n"
33927 " guestfs_dd (g, \"foo\", \"bar\");\n"
33931 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
33938 #: ../src/guestfs.pod:1565
33940 "You may think the above is an awful lot of hassle, and it is. There are "
33941 "other ways outside of the C linking system to ensure that this kind of "
33942 "incompatibility never arises, such as using package versioning:"
33946 #: ../src/guestfs.pod:1570
33949 " Requires: libguestfs >= 1.0.80\n"
33954 #: ../src/guestfs.pod:1572
33955 msgid "CALLS WITH OPTIONAL ARGUMENTS"
33959 #: ../src/guestfs.pod:1574
33961 "A recent feature of the API is the introduction of calls which take optional "
33962 "arguments. In C these are declared 3 ways. The main way is as a call which "
33963 "takes variable arguments (ie. C<...>), as in this example:"
33967 #: ../src/guestfs.pod:1579
33970 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
33975 #: ../src/guestfs.pod:1581
33977 "Call this with a list of optional arguments, terminated by C<-1>. So to "
33978 "call with no optional arguments specified:"
33982 #: ../src/guestfs.pod:1584
33985 " guestfs_add_drive_opts (g, filename, -1);\n"
33990 #: ../src/guestfs.pod:1586
33991 msgid "With a single optional argument:"
33995 #: ../src/guestfs.pod:1588
33998 " guestfs_add_drive_opts (g, filename,\n"
33999 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
34005 #: ../src/guestfs.pod:1592
34010 #: ../src/guestfs.pod:1594
34013 " guestfs_add_drive_opts (g, filename,\n"
34014 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
34015 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
34021 #: ../src/guestfs.pod:1599
34023 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
34028 #: ../src/guestfs.pod:1602
34029 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
34033 #: ../src/guestfs.pod:1604
34035 "The second variant has the same name with the suffix C<_va>, which works the "
34036 "same way but takes a C<va_list>. See the C manual for details. For the "
34037 "example function, this is declared:"
34041 #: ../src/guestfs.pod:1608
34044 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
34045 " va_list args);\n"
34050 #: ../src/guestfs.pod:1611
34051 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
34055 #: ../src/guestfs.pod:1613
34057 "The third variant is useful where you need to construct these calls. You "
34058 "pass in a structure where you fill in the optional fields. The structure "
34059 "has a bitmask as the first element which you must set to indicate which "
34060 "fields you have filled in. For our example function the structure and call "
34065 #: ../src/guestfs.pod:1619
34068 " struct guestfs_add_drive_opts_argv {\n"
34069 " uint64_t bitmask;\n"
34071 " const char *format;\n"
34074 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
34075 " const struct guestfs_add_drive_opts_argv *optargs);\n"
34080 #: ../src/guestfs.pod:1628
34081 msgid "You could call it like this:"
34085 #: ../src/guestfs.pod:1630
34088 " struct guestfs_add_drive_opts_argv optargs = {\n"
34089 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
34090 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
34091 " .readonly = 1,\n"
34092 " .format = \"qcow2\"\n"
34098 #: ../src/guestfs.pod:1637
34101 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
34106 #: ../src/guestfs.pod:1645
34107 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
34111 #: ../src/guestfs.pod:1650
34112 msgid "You do not need to fill in all fields of the structure."
34116 #: ../src/guestfs.pod:1654
34118 "There must be a one-to-one correspondence between fields of the structure "
34119 "that are filled in, and bits set in the bitmask."
34123 #: ../src/guestfs.pod:1659
34124 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
34128 #: ../src/guestfs.pod:1661
34130 "In other languages, optional arguments are expressed in the way that is "
34131 "natural for that language. We refer you to the language-specific "
34132 "documentation for more details on that."
34136 #: ../src/guestfs.pod:1665
34137 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
34141 #: ../src/guestfs.pod:1667
34142 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
34146 #: ../src/guestfs.pod:1669
34148 "B<Note:> This section documents the generic event mechanism introduced in "
34149 "libguestfs 1.10, which you should use in new code if possible. The old "
34150 "functions C<guestfs_set_log_message_callback>, "
34151 "C<guestfs_set_subprocess_quit_callback>, "
34152 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
34153 "C<guestfs_set_progress_callback> are no longer documented in this manual "
34154 "page. Because of the ABI guarantee, the old functions continue to work."
34158 #: ../src/guestfs.pod:1678
34160 "Handles generate events when certain things happen, such as log messages "
34161 "being generated, progress messages during long-running operations, or the "
34162 "handle being closed. The API calls described below let you register a "
34163 "callback to be called when events happen. You can register multiple "
34164 "callbacks (for the same, different or overlapping sets of events), and "
34165 "individually remove callbacks. If callbacks are not removed, then they "
34166 "remain in force until the handle is closed."
34170 #: ../src/guestfs.pod:1686
34172 "In the current implementation, events are only generated synchronously: that "
34173 "means that events (and hence callbacks) can only happen while you are in the "
34174 "middle of making another libguestfs call. The callback is called in the "
34179 #: ../src/guestfs.pod:1691
34181 "Events may contain a payload, usually nothing (void), an array of 64 bit "
34182 "unsigned integers, or a message buffer. Payloads are discussed later on."
34186 #: ../src/guestfs.pod:1695
34187 msgid "CLASSES OF EVENTS"
34191 #: ../src/guestfs.pod:1699
34192 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
34196 #: ../src/guestfs.pod:1702
34198 "The callback function will be called while the handle is being closed "
34199 "(synchronously from L</guestfs_close>)."
34203 #: ../src/guestfs.pod:1705
34205 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
34206 "handles that are open when the program exits. This means that this callback "
34207 "might be called indirectly from L<exit(3)>, which can cause unexpected "
34208 "problems in higher-level languages (eg. if your HLL interpreter has already "
34209 "been cleaned up by the time this is called, and if your callback then jumps "
34210 "into some HLL function)."
34214 #: ../src/guestfs.pod:1712
34216 "If no callback is registered: the handle is closed without any callback "
34221 #: ../src/guestfs.pod:1715
34222 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
34226 #: ../src/guestfs.pod:1718
34228 "The callback function will be called when the child process quits, either "
34229 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
34230 "corresponds to a transition from any state to the CONFIG state)."
34234 #: ../src/guestfs.pod:1722 ../src/guestfs.pod:1731
34235 msgid "If no callback is registered: the event is ignored."
34239 #: ../src/guestfs.pod:1724
34240 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
34244 #: ../src/guestfs.pod:1727
34246 "The callback function will be called when the child process becomes ready "
34247 "first time after it has been launched. (This corresponds to a transition "
34248 "from LAUNCHING to the READY state)."
34252 #: ../src/guestfs.pod:1733
34253 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
34257 #: ../src/guestfs.pod:1736
34259 "Some long-running operations can generate progress messages. If this "
34260 "callback is registered, then it will be called each time a progress message "
34261 "is generated (usually two seconds after the operation started, and three "
34262 "times per second thereafter until it completes, although the frequency may "
34263 "change in future versions)."
34267 #: ../src/guestfs.pod:1742
34269 "The callback receives in the payload four unsigned 64 bit numbers which are "
34270 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
34274 #: ../src/guestfs.pod:1745
34276 "The units of C<total> are not defined, although for some operations C<total> "
34277 "may relate in some way to the amount of data to be transferred (eg. in bytes "
34278 "or megabytes), and C<position> may be the portion which has been transferred."
34282 #: ../src/guestfs.pod:1750
34283 msgid "The only defined and stable parts of the API are:"
34287 #: ../src/guestfs.pod:1756
34289 "The callback can display to the user some type of progress bar or indicator "
34290 "which shows the ratio of C<position>:C<total>."
34294 #: ../src/guestfs.pod:1761
34295 msgid "0 E<lt>= C<position> E<lt>= C<total>"
34299 #: ../src/guestfs.pod:1765
34301 "If any progress notification is sent during a call, then a final progress "
34302 "notification is always sent when C<position> = C<total> (I<unless> the call "
34303 "fails with an error)."
34307 #: ../src/guestfs.pod:1769
34309 "This is to simplify caller code, so callers can easily set the progress "
34310 "indicator to \"100%\" at the end of the operation, without requiring special "
34311 "code to detect this case."
34315 #: ../src/guestfs.pod:1775
34317 "For some calls we are unable to estimate the progress of the call, but we "
34318 "can still generate progress messages to indicate activity. This is known as "
34319 "\"pulse mode\", and is directly supported by certain progress bar "
34320 "implementations (eg. GtkProgressBar)."
34324 #: ../src/guestfs.pod:1780
34326 "For these calls, zero or more progress messages are generated with "
34327 "C<position = 0> and C<total = 1>, followed by a final message with "
34328 "C<position = total = 1>."
34332 #: ../src/guestfs.pod:1784
34334 "As noted above, if the call fails with an error then the final message may "
34335 "not be generated."
34339 #: ../src/guestfs.pod:1789
34341 "The callback also receives the procedure number (C<proc_nr>) and serial "
34342 "number (C<serial>) of the call. These are only useful for debugging "
34343 "protocol issues, and the callback can normally ignore them. The callback "
34344 "may want to print these numbers in error messages or debugging messages."
34348 #: ../src/guestfs.pod:1795
34349 msgid "If no callback is registered: progress messages are discarded."
34353 #: ../src/guestfs.pod:1797
34354 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
34358 #: ../src/guestfs.pod:1800
34360 "The callback function is called whenever a log message is generated by qemu, "
34361 "the appliance kernel, guestfsd (daemon), or utility programs."
34365 #: ../src/guestfs.pod:1803
34367 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
34368 "guestfs_launch>) then additional debug messages are generated."
34372 #: ../src/guestfs.pod:1806 ../src/guestfs.pod:1820
34374 "If no callback is registered: the messages are discarded unless the verbose "
34375 "flag is set in which case they are sent to stderr. You can override the "
34376 "printing of verbose messages to stderr by setting up a callback."
34380 #: ../src/guestfs.pod:1811
34381 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
34385 #: ../src/guestfs.pod:1814
34387 "The callback function is called whenever a log message is generated by the "
34388 "library part of libguestfs."
34392 #: ../src/guestfs.pod:1817
34394 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
34395 "messages are generated."
34399 #: ../src/guestfs.pod:1825
34400 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
34404 #: ../src/guestfs.pod:1828
34406 "The callback function is called whenever a trace message is generated. This "
34407 "only applies if the trace flag (L</guestfs_set_trace>) is set."
34411 #: ../src/guestfs.pod:1831
34413 "If no callback is registered: the messages are sent to stderr. You can "
34414 "override the printing of trace messages to stderr by setting up a callback."
34418 #: ../src/guestfs.pod:1837
34419 msgid "guestfs_set_event_callback"
34423 #: ../src/guestfs.pod:1839
34426 " int guestfs_set_event_callback (guestfs_h *g,\n"
34427 " guestfs_event_callback cb,\n"
34428 " uint64_t event_bitmask,\n"
34430 " void *opaque);\n"
34435 #: ../src/guestfs.pod:1845
34437 "This function registers a callback (C<cb>) for all event classes in the "
34438 "C<event_bitmask>."
34442 #: ../src/guestfs.pod:1848
34444 "For example, to register for all log message events, you could call this "
34445 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
34446 "To register a single callback for all possible classes of events, use "
34447 "C<GUESTFS_EVENT_ALL>."
34451 #: ../src/guestfs.pod:1854
34452 msgid "C<flags> should always be passed as 0."
34456 #: ../src/guestfs.pod:1856
34458 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
34459 "it for any purpose."
34463 #: ../src/guestfs.pod:1859
34465 "The return value is the event handle (an integer) which you can use to "
34466 "delete the callback (see below)."
34470 #: ../src/guestfs.pod:1862
34472 "If there is an error, this function returns C<-1>, and sets the error in the "
34473 "handle in the usual way (see L</guestfs_last_error> etc.)"
34477 #: ../src/guestfs.pod:1865
34479 "Callbacks remain in effect until they are deleted, or until the handle is "
34484 #: ../src/guestfs.pod:1868
34486 "In the case where multiple callbacks are registered for a particular event "
34487 "class, all of the callbacks are called. The order in which multiple "
34488 "callbacks are called is not defined."
34492 #: ../src/guestfs.pod:1872
34493 msgid "guestfs_delete_event_callback"
34497 #: ../src/guestfs.pod:1874
34500 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
34505 #: ../src/guestfs.pod:1876
34507 "Delete a callback that was previously registered. C<event_handle> should be "
34508 "the integer that was returned by a previous call to "
34509 "C<guestfs_set_event_callback> on the same handle."
34513 #: ../src/guestfs.pod:1880
34514 msgid "guestfs_event_callback"
34518 #: ../src/guestfs.pod:1882
34521 " typedef void (*guestfs_event_callback) (\n"
34524 " uint64_t event,\n"
34525 " int event_handle,\n"
34527 " const char *buf, size_t buf_len,\n"
34528 " const uint64_t *array, size_t array_len);\n"
34533 #: ../src/guestfs.pod:1891
34535 "This is the type of the event callback function that you have to provide."
34539 #: ../src/guestfs.pod:1894
34541 "The basic parameters are: the handle (C<g>), the opaque user pointer "
34542 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
34543 "handle, and C<flags> which in the current API you should ignore."
34547 #: ../src/guestfs.pod:1898
34549 "The remaining parameters contain the event payload (if any). Each event may "
34550 "contain a payload, which usually relates to the event class, but for future "
34551 "proofing your code should be written to handle any payload for any event "
34556 #: ../src/guestfs.pod:1903
34558 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
34559 "there is no message buffer). Note that this message buffer can contain "
34560 "arbitrary 8 bit data, including NUL bytes."
34564 #: ../src/guestfs.pod:1907
34566 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
34567 "moment this is only used for progress messages."
34571 #: ../src/guestfs.pod:1910
34572 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
34576 #: ../src/guestfs.pod:1912
34578 "One motivation for the generic event API was to allow GUI programs to "
34579 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
34580 "unconditionally to C<stderr>."
34584 #: ../src/guestfs.pod:1916
34586 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
34587 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
34588 "messages are not events; you must capture error messages separately)."
34592 #: ../src/guestfs.pod:1921
34594 "Programs have to set up a callback to capture the classes of events of "
34599 #: ../src/guestfs.pod:1924
34603 " guestfs_set_event_callback\n"
34604 " (g, message_callback,\n"
34605 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
34606 " GUESTFS_EVENT_TRACE,\n"
34607 " 0, NULL) == -1)\n"
34608 " if (eh == -1) {\n"
34609 " // handle error in the usual way\n"
34615 #: ../src/guestfs.pod:1934
34617 "The callback can then direct messages to the appropriate place. In this "
34618 "example, messages are directed to syslog:"
34622 #: ../src/guestfs.pod:1937
34626 " message_callback (\n"
34629 " uint64_t event,\n"
34630 " int event_handle,\n"
34632 " const char *buf, size_t buf_len,\n"
34633 " const uint64_t *array, size_t array_len)\n"
34635 " const int priority = LOG_USER|LOG_INFO;\n"
34636 " if (buf_len > 0)\n"
34637 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
34643 #: ../src/guestfs.pod:1952
34644 msgid "CANCELLING LONG TRANSFERS"
34648 #: ../src/guestfs.pod:1954
34650 "Some operations can be cancelled by the caller while they are in progress. "
34651 "Currently only operations that involve uploading or downloading data can be "
34652 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
34653 "parameters in the generator)."
34657 #: ../src/guestfs.pod:1959
34658 msgid "guestfs_user_cancel"
34662 #: ../src/guestfs.pod:1961
34665 " void guestfs_user_cancel (guestfs_h *g);\n"
34670 #: ../src/guestfs.pod:1963
34672 "C<guestfs_user_cancel> cancels the current upload or download operation."
34676 #: ../src/guestfs.pod:1966
34678 "Unlike most other libguestfs calls, this function is signal safe and thread "
34679 "safe. You can call it from a signal handler or from another thread, without "
34680 "needing to do any locking."
34684 #: ../src/guestfs.pod:1970
34686 "The transfer that was in progress (if there is one) will stop shortly "
34687 "afterwards, and will return an error. The errno (see L</"
34688 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
34689 "out if the operation was cancelled or failed because of another error."
34693 #: ../src/guestfs.pod:1976
34695 "No cleanup is performed: for example, if a file was being uploaded then "
34696 "after cancellation there may be a partially uploaded file. It is the "
34697 "caller's responsibility to clean up if necessary."
34701 #: ../src/guestfs.pod:1980
34702 msgid "There are two common places that you might call C<guestfs_user_cancel>."
34706 #: ../src/guestfs.pod:1982
34708 "In an interactive text-based program, you might call it from a C<SIGINT> "
34709 "signal handler so that pressing C<^C> cancels the current operation. (You "
34710 "also need to call L</guestfs_set_pgroup> so that child processes don't "
34711 "receive the C<^C> signal)."
34715 #: ../src/guestfs.pod:1987
34717 "In a graphical program, when the main thread is displaying a progress bar "
34718 "with a cancel button, wire up the cancel button to call this function."
34722 #: ../src/guestfs.pod:1991
34723 msgid "PRIVATE DATA AREA"
34727 #: ../src/guestfs.pod:1993
34729 "You can attach named pieces of private data to the libguestfs handle, fetch "
34730 "them by name, and walk over them, for the lifetime of the handle. This is "
34731 "called the private data area and is only available from the C API."
34735 #: ../src/guestfs.pod:1998
34736 msgid "To attach a named piece of data, use the following call:"
34740 #: ../src/guestfs.pod:2000
34743 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
34748 #: ../src/guestfs.pod:2002
34750 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
34751 "pointer (which can be C<NULL>). Any previous item with the same key is "
34756 #: ../src/guestfs.pod:2006
34758 "You can use any C<key> you want, but your key should I<not> start with an "
34759 "underscore character. Keys beginning with an underscore character are "
34760 "reserved for internal libguestfs purposes (eg. for implementing language "
34761 "bindings). It is recommended that you prefix the key with some unique "
34762 "string to avoid collisions with other users."
34766 #: ../src/guestfs.pod:2012
34767 msgid "To retrieve the pointer, use:"
34771 #: ../src/guestfs.pod:2014
34774 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
34779 #: ../src/guestfs.pod:2016
34781 "This function returns C<NULL> if either no data is found associated with "
34782 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
34787 #: ../src/guestfs.pod:2020
34789 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
34790 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
34791 "all. In particular, libguestfs does I<not> try to free the data when the "
34792 "handle is closed. If the data must be freed, then the caller must either "
34793 "free it before calling L</guestfs_close> or must set up a close callback to "
34794 "do it (see L</GUESTFS_EVENT_CLOSE>)."
34798 #: ../src/guestfs.pod:2027
34799 msgid "To walk over all entries, use these two functions:"
34803 #: ../src/guestfs.pod:2029
34806 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
34811 #: ../src/guestfs.pod:2031
34814 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
34819 #: ../src/guestfs.pod:2033
34821 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
34822 "not have any particular meaning -- keys are not returned in any defined "
34823 "order). A pointer to the key is returned in C<*key_rtn> and the "
34824 "corresponding data pointer is returned from the function. C<NULL> is "
34825 "returned if there are no keys stored in the handle."
34829 #: ../src/guestfs.pod:2039
34831 "C<guestfs_next_private> returns the next key, pointer pair. The return "
34832 "value of this function is also C<NULL> is there are no further entries to "
34837 #: ../src/guestfs.pod:2043
34838 msgid "Notes about walking over entries:"
34842 #: ../src/guestfs.pod:2049
34844 "You must not call C<guestfs_set_private> while walking over the entries."
34848 #: ../src/guestfs.pod:2054
34850 "The handle maintains an internal iterator which is reset when you call "
34851 "C<guestfs_first_private>. This internal iterator is invalidated when you "
34852 "call C<guestfs_set_private>."
34856 #: ../src/guestfs.pod:2060
34857 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
34861 #: ../src/guestfs.pod:2062
34864 " guestfs_set_private (g, key, NULL);\n"
34869 #: ../src/guestfs.pod:2064
34870 msgid "then that C<key> is not returned when walking."
34874 #: ../src/guestfs.pod:2068
34876 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
34877 "C<guestfs_next_private> or C<guestfs_set_private>."
34881 #: ../src/guestfs.pod:2074
34883 "The following example code shows how to print all keys and data pointers "
34884 "that are associated with the handle C<g>:"
34888 #: ../src/guestfs.pod:2077
34891 " const char *key;\n"
34892 " void *data = guestfs_first_private (g, &key);\n"
34893 " while (data != NULL)\n"
34895 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34896 " data = guestfs_next_private (g, &key);\n"
34902 #: ../src/guestfs.pod:2085
34904 "More commonly you are only interested in keys that begin with an application-"
34905 "specific prefix C<foo_>. Modify the loop like so:"
34909 #: ../src/guestfs.pod:2088
34912 " const char *key;\n"
34913 " void *data = guestfs_first_private (g, &key);\n"
34914 " while (data != NULL)\n"
34916 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34917 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34918 " data = guestfs_next_private (g, &key);\n"
34924 #: ../src/guestfs.pod:2097
34926 "If you need to modify keys while walking, then you have to jump back to the "
34927 "beginning of the loop. For example, to delete all keys prefixed with "
34932 #: ../src/guestfs.pod:2101
34935 " const char *key;\n"
34938 " data = guestfs_first_private (g, &key);\n"
34939 " while (data != NULL)\n"
34941 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34943 " guestfs_set_private (g, key, NULL);\n"
34944 " /* note that 'key' pointer is now invalid, and so is\n"
34945 " the internal iterator */\n"
34948 " data = guestfs_next_private (g, &key);\n"
34954 #: ../src/guestfs.pod:2117
34956 "Note that the above loop is guaranteed to terminate because the keys are "
34957 "being deleted, but other manipulations of keys within the loop might not "
34958 "terminate unless you also maintain an indication of which keys have been "
34963 #: ../src/guestfs.pod:2122 ../src/guestfs.pod:2127
34968 #: ../src/guestfs.pod:2124
34970 "<!-- old anchor for the next section --> <a name="
34971 "\"state_machine_and_low_level_event_api\"/>"
34975 #: ../src/guestfs.pod:2129
34976 msgid "ARCHITECTURE"
34980 #: ../src/guestfs.pod:2131
34982 "Internally, libguestfs is implemented by running an appliance (a special "
34983 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
34984 "process of the main program."
34988 #: ../src/guestfs.pod:2135
34991 " ___________________\n"
34993 " | main program |\n"
34995 " | | child process / appliance\n"
34996 " | | __________________________\n"
34998 " +-------------------+ RPC | +-----------------+ |\n"
34999 " | libguestfs <--------------------> guestfsd | |\n"
35000 " | | | +-----------------+ |\n"
35001 " \\___________________/ | | Linux kernel | |\n"
35002 " | +--^--------------+ |\n"
35003 " \\_________|________________/\n"
35005 " _______v______\n"
35008 " | disk image |\n"
35009 " \\______________/\n"
35014 #: ../src/guestfs.pod:2155
35016 "The library, linked to the main program, creates the child process and hence "
35017 "the appliance in the L</guestfs_launch> function."
35021 #: ../src/guestfs.pod:2158
35023 "Inside the appliance is a Linux kernel and a complete stack of userspace "
35024 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
35025 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
35026 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
35027 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
35028 "attached to the qemu process which translates device access by the "
35029 "appliance's Linux kernel into accesses to the image."
35033 #: ../src/guestfs.pod:2167
35035 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
35036 "Although the disk image you are attached to might also be used by some "
35037 "virtual machine, libguestfs doesn't know or care about this. (But you will "
35038 "care if both libguestfs's qemu process and your virtual machine are trying "
35039 "to update the disk image at the same time, since these usually results in "
35040 "massive disk corruption)."
35044 #: ../src/guestfs.pod:2174
35045 msgid "STATE MACHINE"
35049 #: ../src/guestfs.pod:2176
35050 msgid "libguestfs uses a state machine to model the child process:"
35054 #: ../src/guestfs.pod:2178
35058 " guestfs_create\n"
35066 " / | \\ \\ guestfs_launch\n"
35067 " / | _\\__V______\n"
35069 " / | | LAUNCHING |\n"
35070 " / | \\___________/\n"
35072 " / | guestfs_launch\n"
35074 " ______ / __|____V\n"
35075 " / \\ ------> / \\\n"
35076 " | BUSY | | READY |\n"
35077 " \\______/ <------ \\________/\n"
35082 #: ../src/guestfs.pod:2200
35084 "The normal transitions are (1) CONFIG (when the handle is created, but there "
35085 "is no child process), (2) LAUNCHING (when the child process is booting up), "
35086 "(3) alternating between READY and BUSY as commands are issued to, and "
35087 "carried out by, the child process."
35091 #: ../src/guestfs.pod:2205
35093 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
35094 "asynchronously at any time (eg. due to some internal error), and that causes "
35095 "the state to transition back to CONFIG."
35099 #: ../src/guestfs.pod:2209
35101 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
35102 "issued when in the CONFIG state."
35106 #: ../src/guestfs.pod:2212
35108 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
35109 "L</guestfs_launch> blocks until the child process is READY to accept "
35110 "commands (or until some failure or timeout). L</guestfs_launch> internally "
35111 "moves the state from CONFIG to LAUNCHING while it is running."
35115 #: ../src/guestfs.pod:2218
35117 "API actions such as L</guestfs_mount> can only be issued when in the READY "
35118 "state. These API calls block waiting for the command to be carried out (ie. "
35119 "the state to transition to BUSY and then back to READY). There are no non-"
35120 "blocking versions, and no way to issue more than one command per handle at "
35125 #: ../src/guestfs.pod:2224
35127 "Finally, the child process sends asynchronous messages back to the main "
35128 "program, such as kernel log messages. You can register a callback to "
35129 "receive these messages."
35133 #: ../src/guestfs.pod:2228
35138 #: ../src/guestfs.pod:2230
35139 msgid "APPLIANCE BOOT PROCESS"
35143 #: ../src/guestfs.pod:2232
35145 "This process has evolved and continues to evolve. The description here "
35146 "corresponds only to the current version of libguestfs and is provided for "
35147 "information only."
35151 #: ../src/guestfs.pod:2236
35153 "In order to follow the stages involved below, enable libguestfs debugging "
35154 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
35158 #: ../src/guestfs.pod:2241
35159 msgid "Create the appliance"
35163 #: ../src/guestfs.pod:2243
35165 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
35166 "initrd and the appliance."
35170 #: ../src/guestfs.pod:2246
35172 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
35173 "directory if C<TMPDIR> is set)."
35177 #: ../src/guestfs.pod:2249
35179 "For a complete description of how the appliance is created and cached, read "
35180 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
35184 #: ../src/guestfs.pod:2253
35185 msgid "Start qemu and boot the kernel"
35189 #: ../src/guestfs.pod:2255
35190 msgid "qemu is invoked to boot the kernel."
35194 #: ../src/guestfs.pod:2257
35195 msgid "Run the initrd"
35199 #: ../src/guestfs.pod:2259
35201 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
35202 "appliance. The purpose of the initrd is to load enough kernel modules in "
35203 "order that the appliance itself can be mounted and started."
35207 #: ../src/guestfs.pod:2263
35209 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
35214 #: ../src/guestfs.pod:2266
35216 "When the initrd has started you will see messages showing that kernel "
35217 "modules are being loaded, similar to this:"
35221 #: ../src/guestfs.pod:2269
35224 " febootstrap: ext2 mini initrd starting up\n"
35225 " febootstrap: mounting /sys\n"
35226 " febootstrap: internal insmod libcrc32c.ko\n"
35227 " febootstrap: internal insmod crc32c-intel.ko\n"
35232 #: ../src/guestfs.pod:2274
35233 msgid "Find and mount the appliance device"
35237 #: ../src/guestfs.pod:2276
35239 "The appliance is a sparse file containing an ext2 filesystem which contains "
35240 "a familiar (although reduced in size) Linux operating system. It would "
35241 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
35245 #: ../src/guestfs.pod:2280
35247 "The regular disks being inspected by libguestfs are the first devices "
35248 "exposed by qemu (eg. as C</dev/vda>)."
35252 #: ../src/guestfs.pod:2283
35254 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
35255 "there was only one regular disk)."
35259 #: ../src/guestfs.pod:2286
35261 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
35262 "and switch root into the appliance, and run C</init> from the appliance."
35266 #: ../src/guestfs.pod:2290
35267 msgid "If this works successfully you will see messages such as:"
35271 #: ../src/guestfs.pod:2292
35274 " febootstrap: picked /sys/block/vdb/dev as root device\n"
35275 " febootstrap: creating /dev/root as block special 252:16\n"
35276 " febootstrap: mounting new root on /root\n"
35277 " febootstrap: chroot\n"
35278 " Starting /init script ...\n"
35283 #: ../src/guestfs.pod:2298
35285 "Note that C<Starting /init script ...> indicates that the appliance's init "
35286 "script is now running."
35290 #: ../src/guestfs.pod:2301
35291 msgid "Initialize the appliance"
35295 #: ../src/guestfs.pod:2303
35297 "The appliance itself now initializes itself. This involves starting certain "
35298 "processes like C<udev>, possibly printing some debug information, and "
35299 "finally running the daemon (C<guestfsd>)."
35303 #: ../src/guestfs.pod:2307
35308 #: ../src/guestfs.pod:2309
35310 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
35315 #: ../src/guestfs.pod:2312
35318 " verbose daemon enabled\n"
35323 #: ../src/guestfs.pod:2314
35325 "The daemon expects to see a named virtio-serial port exposed by qemu and "
35326 "connected on the other end to the library."
35330 #: ../src/guestfs.pod:2317
35332 "The daemon connects to this port (and hence to the library) and sends a four "
35333 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
35334 "protocol (see below)."
35338 #: ../src/guestfs.pod:2323
35339 msgid "COMMUNICATION PROTOCOL"
35343 #: ../src/guestfs.pod:2325
35345 "Don't rely on using this protocol directly. This section documents how it "
35346 "currently works, but it may change at any time."
35350 #: ../src/guestfs.pod:2328
35352 "The protocol used to talk between the library and the daemon running inside "
35353 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
35354 "1014, RFC 1832, RFC 4506)."
35358 #: ../src/guestfs.pod:2332
35360 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
35361 "this file is automatically generated)."
35365 #: ../src/guestfs.pod:2335
35367 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
35368 "and C<FileOut> parameters, which are handled with very simple request/reply "
35369 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
35370 "parameters, which use the same request and reply messages, but they may also "
35371 "be followed by files sent using a chunked encoding."
35375 #: ../src/guestfs.pod:2342
35376 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
35380 #: ../src/guestfs.pod:2344
35381 msgid "For ordinary functions, the request message is:"
35385 #: ../src/guestfs.pod:2346
35388 " total length (header + arguments,\n"
35389 " but not including the length word itself)\n"
35390 " struct guestfs_message_header (encoded as XDR)\n"
35391 " struct guestfs_<foo>_args (encoded as XDR)\n"
35396 #: ../src/guestfs.pod:2351
35398 "The total length field allows the daemon to allocate a fixed size buffer "
35399 "into which it slurps the rest of the message. As a result, the total length "
35400 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
35401 "effective size of any request is limited to somewhere under this size."
35405 #: ../src/guestfs.pod:2357
35407 "Note also that many functions don't take any arguments, in which case the "
35408 "C<guestfs_I<foo>_args> is completely omitted."
35412 #: ../src/guestfs.pod:2360
35414 "The header contains the procedure number (C<guestfs_proc>) which is how the "
35415 "receiver knows what type of args structure to expect, or none at all."
35419 #: ../src/guestfs.pod:2364
35421 "For functions that take optional arguments, the optional arguments are "
35422 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
35423 "arguments. A bitmask in the header indicates which optional arguments are "
35424 "meaningful. The bitmask is also checked to see if it contains bits set "
35425 "which the daemon does not know about (eg. if more optional arguments were "
35426 "added in a later version of the library), and this causes the call to be "
35431 #: ../src/guestfs.pod:2372
35432 msgid "The reply message for ordinary functions is:"
35436 #: ../src/guestfs.pod:2374
35439 " total length (header + ret,\n"
35440 " but not including the length word itself)\n"
35441 " struct guestfs_message_header (encoded as XDR)\n"
35442 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35447 #: ../src/guestfs.pod:2379
35449 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
35450 "functions that return no formal return values."
35454 #: ../src/guestfs.pod:2382
35456 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
35460 #: ../src/guestfs.pod:2385
35462 "In the case of an error, a flag is set in the header, and the reply message "
35463 "is slightly changed:"
35467 #: ../src/guestfs.pod:2388
35470 " total length (header + error,\n"
35471 " but not including the length word itself)\n"
35472 " struct guestfs_message_header (encoded as XDR)\n"
35473 " struct guestfs_message_error (encoded as XDR)\n"
35478 #: ../src/guestfs.pod:2393
35480 "The C<guestfs_message_error> structure contains the error message as a "
35485 #: ../src/guestfs.pod:2396
35486 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
35490 #: ../src/guestfs.pod:2398
35492 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
35493 "The normal request message is sent (see above). However this is followed by "
35494 "a sequence of file chunks."
35498 #: ../src/guestfs.pod:2402
35501 " total length (header + arguments,\n"
35502 " but not including the length word itself,\n"
35503 " and not including the chunks)\n"
35504 " struct guestfs_message_header (encoded as XDR)\n"
35505 " struct guestfs_<foo>_args (encoded as XDR)\n"
35506 " sequence of chunks for FileIn param #0\n"
35507 " sequence of chunks for FileIn param #1 etc.\n"
35512 #: ../src/guestfs.pod:2410
35513 msgid "The \"sequence of chunks\" is:"
35517 #: ../src/guestfs.pod:2412
35520 " length of chunk (not including length word itself)\n"
35521 " struct guestfs_chunk (encoded as XDR)\n"
35522 " length of chunk\n"
35523 " struct guestfs_chunk (encoded as XDR)\n"
35525 " length of chunk\n"
35526 " struct guestfs_chunk (with data.data_len == 0)\n"
35531 #: ../src/guestfs.pod:2420
35533 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
35534 "is set in the final chunk to indicate either successful completion or early "
35539 #: ../src/guestfs.pod:2424
35541 "At time of writing there are no functions that have more than one FileIn "
35542 "parameter. However this is (theoretically) supported, by sending the "
35543 "sequence of chunks for each FileIn parameter one after another (from left to "
35548 #: ../src/guestfs.pod:2429
35550 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
35551 "transfer. The library does this by sending a chunk with a special flag set "
35552 "to indicate cancellation. When the daemon sees this, it cancels the whole "
35553 "RPC, does I<not> send any reply, and goes back to reading the next request."
35557 #: ../src/guestfs.pod:2435
35559 "The daemon may also cancel. It does this by writing a special word "
35560 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
35561 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
35562 "cancel chunk). The special word is chosen so that even if cancellation "
35563 "happens right at the end of the transfer (after the library has finished "
35564 "writing and has started listening for the reply), the \"spurious\" cancel "
35565 "flag will not be confused with the reply message."
35569 #: ../src/guestfs.pod:2444
35571 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
35572 "limit), and also files where the size is not known in advance (eg. from "
35573 "pipes or sockets). However the chunks are rather small "
35574 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
35575 "to keep much in memory."
35579 #: ../src/guestfs.pod:2450
35580 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
35584 #: ../src/guestfs.pod:2452
35586 "The protocol for FileOut parameters is exactly the same as for FileIn "
35587 "parameters, but with the roles of daemon and library reversed."
35591 #: ../src/guestfs.pod:2455
35594 " total length (header + ret,\n"
35595 " but not including the length word itself,\n"
35596 " and not including the chunks)\n"
35597 " struct guestfs_message_header (encoded as XDR)\n"
35598 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35599 " sequence of chunks for FileOut param #0\n"
35600 " sequence of chunks for FileOut param #1 etc.\n"
35605 #: ../src/guestfs.pod:2463
35606 msgid "INITIAL MESSAGE"
35610 #: ../src/guestfs.pod:2465
35612 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
35613 "which indicates that the guest and daemon is alive. This is what L</"
35614 "guestfs_launch> waits for."
35618 #: ../src/guestfs.pod:2469
35619 msgid "PROGRESS NOTIFICATION MESSAGES"
35623 #: ../src/guestfs.pod:2471
35625 "The daemon may send progress notification messages at any time. These are "
35626 "distinguished by the normal length word being replaced by "
35627 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
35631 #: ../src/guestfs.pod:2475
35633 "The library turns them into progress callbacks (see L</"
35634 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
35639 #: ../src/guestfs.pod:2479
35641 "The daemon self-limits the frequency of progress messages it sends (see "
35642 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
35647 #: ../src/guestfs.pod:2483
35648 msgid "LIBGUESTFS VERSION NUMBERS"
35652 #: ../src/guestfs.pod:2485
35654 "Since April 2010, libguestfs has started to make separate development and "
35655 "stable releases, along with corresponding branches in our git repository. "
35656 "These separate releases can be identified by version number:"
35660 #: ../src/guestfs.pod:2490
35663 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
35664 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
35670 " | `-------- sub-version\n"
35672 " `------ always '1' because we don't change the ABI\n"
35677 #: ../src/guestfs.pod:2501
35678 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
35682 #: ../src/guestfs.pod:2503
35684 "As time passes we cherry pick fixes from the development branch and backport "
35685 "those into the stable branch, the effect being that the stable branch should "
35686 "get more stable and less buggy over time. So the stable releases are ideal "
35687 "for people who don't need new features but would just like the software to "
35692 #: ../src/guestfs.pod:2509
35693 msgid "Our criteria for backporting changes are:"
35697 #: ../src/guestfs.pod:2515
35699 "Documentation changes which don't affect any code are backported unless the "
35700 "documentation refers to a future feature which is not in stable."
35704 #: ../src/guestfs.pod:2521
35706 "Bug fixes which are not controversial, fix obvious problems, and have been "
35707 "well tested are backported."
35711 #: ../src/guestfs.pod:2526
35713 "Simple rearrangements of code which shouldn't affect how it works get "
35714 "backported. This is so that the code in the two branches doesn't get too "
35715 "far out of step, allowing us to backport future fixes more easily."
35719 #: ../src/guestfs.pod:2532
35721 "We I<don't> backport new features, new APIs, new tools etc, except in one "
35722 "exceptional case: the new feature is required in order to implement an "
35723 "important bug fix."
35727 #: ../src/guestfs.pod:2538
35729 "A new stable branch starts when we think the new features in development are "
35730 "substantial and compelling enough over the current stable branch to warrant "
35731 "it. When that happens we create new stable and development versions 1.N.0 "
35732 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
35733 "stable at this point, but by backporting fixes from development, that branch "
35734 "will stabilize over time."
35738 #: ../src/guestfs.pod:2546
35739 msgid "EXTENDING LIBGUESTFS"
35743 #: ../src/guestfs.pod:2548
35744 msgid "ADDING A NEW API ACTION"
35748 #: ../src/guestfs.pod:2550
35750 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
35751 "documentation) are generated, and this makes it easy to extend the "
35756 #: ../src/guestfs.pod:2554
35757 msgid "To add a new API action there are two changes:"
35761 #: ../src/guestfs.pod:2560
35763 "You need to add a description of the call (name, parameters, return type, "
35764 "tests, documentation) to C<generator/generator_actions.ml>."
35768 #: ../src/guestfs.pod:2563
35770 "There are two sorts of API action, depending on whether the call goes "
35771 "through to the daemon in the appliance, or is serviced entirely by the "
35772 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
35773 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
35774 "an example of the latter, since a trace flag is maintained in the handle and "
35775 "all tracing is done on the library side."
35779 #: ../src/guestfs.pod:2571
35781 "Most new actions are of the first type, and get added to the "
35782 "C<daemon_functions> list. Each function has a unique procedure number used "
35783 "in the RPC protocol which is assigned to that action when we publish "
35784 "libguestfs and cannot be reused. Take the latest procedure number and "
35789 #: ../src/guestfs.pod:2577
35791 "For library-only actions of the second type, add to the "
35792 "C<non_daemon_functions> list. Since these functions are serviced by the "
35793 "library and do not travel over the RPC mechanism to the daemon, these "
35794 "functions do not need a procedure number, and so the procedure number is set "
35799 #: ../src/guestfs.pod:2585
35800 msgid "Implement the action (in C):"
35804 #: ../src/guestfs.pod:2587
35806 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
35807 "C<daemon/> directory."
35811 #: ../src/guestfs.pod:2590
35813 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
35814 "(note: double underscore) in the C<src/> directory."
35818 #: ../src/guestfs.pod:2593
35819 msgid "In either case, use another function as an example of what to do."
35823 #: ../src/guestfs.pod:2597
35824 msgid "After making these changes, use C<make> to compile."
35828 #: ../src/guestfs.pod:2599
35830 "Note that you don't need to implement the RPC, language bindings, manual "
35831 "pages or anything else. It's all automatically generated from the OCaml "
35836 #: ../src/guestfs.pod:2603
35837 msgid "ADDING TESTS FOR AN API ACTION"
35841 #: ../src/guestfs.pod:2605
35843 "You can supply zero or as many tests as you want per API call. The tests "
35844 "can either be added as part of the API description (C<generator/"
35845 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
35846 "into C<regressions/>. Note that adding a script to C<regressions/> is "
35847 "slower, so if possible use the first method."
35851 #: ../src/guestfs.pod:2611
35853 "The following describes the test environment used when you add an API test "
35854 "in C<generator_actions.ml>."
35858 #: ../src/guestfs.pod:2614
35859 msgid "The test environment has 4 block devices:"
35863 #: ../src/guestfs.pod:2618
35864 msgid "C</dev/sda> 500MB"
35868 #: ../src/guestfs.pod:2620
35869 msgid "General block device for testing."
35873 #: ../src/guestfs.pod:2622
35874 msgid "C</dev/sdb> 50MB"
35878 #: ../src/guestfs.pod:2624
35880 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
35885 #: ../src/guestfs.pod:2627
35886 msgid "C</dev/sdc> 10MB"
35890 #: ../src/guestfs.pod:2629
35891 msgid "Used in a few tests where two block devices are needed."
35895 #: ../src/guestfs.pod:2631
35896 msgid "C</dev/sdd>"
35900 #: ../src/guestfs.pod:2633
35901 msgid "ISO with fixed content (see C<images/test.iso>)."
35905 #: ../src/guestfs.pod:2637
35907 "To be able to run the tests in a reasonable amount of time, the libguestfs "
35908 "appliance and block devices are reused between tests. So don't try testing "
35909 "L</guestfs_kill_subprocess> :-x"
35913 #: ../src/guestfs.pod:2641
35915 "Each test starts with an initial scenario, selected using one of the "
35916 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
35917 "initialize the disks mentioned above in a particular way as documented in "
35918 "C<generator_types.ml>. You should not assume anything about the previous "
35919 "contents of other disks that are not initialized."
35923 #: ../src/guestfs.pod:2647
35925 "You can add a prerequisite clause to any individual test. This is a run-"
35926 "time check, which, if it fails, causes the test to be skipped. Useful if "
35927 "testing a command which might not work on all variations of libguestfs "
35928 "builds. A test that has prerequisite of C<Always> means to run "
35933 #: ../src/guestfs.pod:2653
35935 "In addition, packagers can skip individual tests by setting environment "
35936 "variables before running C<make check>."
35940 #: ../src/guestfs.pod:2656
35943 " SKIP_TEST_<CMD>_<NUM>=1\n"
35948 #: ../src/guestfs.pod:2658
35949 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
35953 #: ../src/guestfs.pod:2660
35958 #: ../src/guestfs.pod:2662
35961 " SKIP_TEST_<CMD>=1\n"
35966 #: ../src/guestfs.pod:2664
35967 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
35971 #: ../src/guestfs.pod:2666
35972 msgid "Packagers can run only certain tests by setting for example:"
35976 #: ../src/guestfs.pod:2668
35979 " TEST_ONLY=\"vfs_type zerofree\"\n"
35984 #: ../src/guestfs.pod:2670
35986 "See C<capitests/tests.c> for more details of how these environment variables "
35991 #: ../src/guestfs.pod:2673
35992 msgid "DEBUGGING NEW API ACTIONS"
35996 #: ../src/guestfs.pod:2675
35997 msgid "Test new actions work before submitting them."
36001 #: ../src/guestfs.pod:2677
36002 msgid "You can use guestfish to try out new commands."
36006 #: ../src/guestfs.pod:2679
36008 "Debugging the daemon is a problem because it runs inside a minimal "
36009 "environment. However you can fprintf messages in the daemon to stderr, and "
36010 "they will show up if you use C<guestfish -v>."
36014 #: ../src/guestfs.pod:2683
36015 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
36019 #: ../src/guestfs.pod:2685
36021 "Our C source code generally adheres to some basic code-formatting "
36022 "conventions. The existing code base is not totally consistent on this "
36023 "front, but we do prefer that contributed code be formatted similarly. In "
36024 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
36025 "indentation level, and other than that, follow the K&R style."
36029 #: ../src/guestfs.pod:2691
36031 "If you use Emacs, add the following to one of one of your start-up files (e."
36032 "g., ~/.emacs), to help ensure that you get indentation right:"
36036 #: ../src/guestfs.pod:2694
36039 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
36040 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
36041 " (add-hook 'find-file-hook\n"
36042 " '(lambda () (if (and buffer-file-name\n"
36043 " (string-match \"/libguestfs\\\\>\"\n"
36044 " (buffer-file-name))\n"
36045 " (not (string-equal mode-name \"Change Log\"))\n"
36046 " (not (string-equal mode-name \"Makefile\")))\n"
36047 " (setq indent-tabs-mode nil))))\n"
36052 #: ../src/guestfs.pod:2704
36055 " ;;; When editing C sources in libguestfs, use this style.\n"
36056 " (defun libguestfs-c-mode ()\n"
36057 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
36059 " (c-set-style \"K&R\")\n"
36060 " (setq c-indent-level 2)\n"
36061 " (setq c-basic-offset 2))\n"
36062 " (add-hook 'c-mode-hook\n"
36063 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
36064 " (buffer-file-name))\n"
36065 " (libguestfs-c-mode))))\n"
36070 #: ../src/guestfs.pod:2716
36071 msgid "Enable warnings when compiling (and fix any problems this finds):"
36075 #: ../src/guestfs.pod:2719
36078 " ./configure --enable-gcc-warnings\n"
36083 #: ../src/guestfs.pod:2721
36084 msgid "Useful targets are:"
36088 #: ../src/guestfs.pod:2723
36091 " make syntax-check # checks the syntax of the C code\n"
36092 " make check # runs the test suite\n"
36097 #: ../src/guestfs.pod:2726
36098 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
36102 #: ../src/guestfs.pod:2728
36104 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
36105 "which are used to do shell quoting."
36109 #: ../src/guestfs.pod:2733
36114 #: ../src/guestfs.pod:2735
36116 "Simple shell quoted string. Any spaces or other shell characters are "
36121 #: ../src/guestfs.pod:2738
36126 #: ../src/guestfs.pod:2740
36128 "Same as C<%Q> except the string is treated as a path which is prefixed by "
36133 #: ../src/guestfs.pod:2747
36136 " asprintf (&cmd, \"cat %R\", path);\n"
36141 #: ../src/guestfs.pod:2749
36142 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
36146 #: ../src/guestfs.pod:2751
36148 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
36149 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
36150 "they are not passed via the shell (instead, straight to exec). You probably "
36151 "want to use the C<sysroot_path()> function however."
36155 #: ../src/guestfs.pod:2757
36156 msgid "SUBMITTING YOUR NEW API ACTIONS"
36160 #: ../src/guestfs.pod:2759
36162 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
36163 "libguestfs> and CC to L<rjones@redhat.com>."
36167 #: ../src/guestfs.pod:2763
36168 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
36172 #: ../src/guestfs.pod:2765
36173 msgid "We support i18n (gettext anyhow) in the library."
36177 #: ../src/guestfs.pod:2767
36179 "However many messages come from the daemon, and we don't translate those at "
36180 "the moment. One reason is that the appliance generally has all locale files "
36181 "removed from it, because they take up a lot of space. So we'd have to readd "
36182 "some of those, as well as copying our PO files into the appliance."
36186 #: ../src/guestfs.pod:2773
36188 "Debugging messages are never translated, since they are intended for the "
36193 #: ../src/guestfs.pod:2776
36194 msgid "SOURCE CODE SUBDIRECTORIES"
36198 #: ../src/guestfs.pod:2782
36199 msgid "The libguestfs appliance, build scripts and so on."
36203 #: ../src/guestfs.pod:2784
36204 msgid "C<capitests>"
36208 #: ../src/guestfs.pod:2786
36209 msgid "Automated tests of the C API."
36213 #: ../src/guestfs.pod:2788
36218 #: ../src/guestfs.pod:2790
36220 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
36225 #: ../src/guestfs.pod:2793
36230 #: ../src/guestfs.pod:2795
36232 "Safety and liveness tests of components that libguestfs depends upon (not of "
36233 "libguestfs itself). Mainly this is for qemu and the kernel."
36237 #: ../src/guestfs.pod:2798
36242 #: ../src/guestfs.pod:2800
36243 msgid "Outside contributions, experimental parts."
36247 #: ../src/guestfs.pod:2802
36252 #: ../src/guestfs.pod:2804
36254 "The daemon that runs inside the libguestfs appliance and carries out actions."
36258 #: ../src/guestfs.pod:2807
36263 #: ../src/guestfs.pod:2809
36264 msgid "L<virt-df(1)> command and documentation."
36268 #: ../src/guestfs.pod:2811
36273 #: ../src/guestfs.pod:2813
36274 msgid "L<virt-edit(1)> command and documentation."
36278 #: ../src/guestfs.pod:2815
36279 msgid "C<examples>"
36283 #: ../src/guestfs.pod:2817
36284 msgid "C API example code."
36288 #: ../src/guestfs.pod:2819
36293 #: ../src/guestfs.pod:2821
36295 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
36296 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
36297 "L<virt-tar-out(1)>."
36301 #: ../src/guestfs.pod:2825
36306 #: ../src/guestfs.pod:2827
36308 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
36312 #: ../src/guestfs.pod:2829
36313 msgid "C<generator>"
36317 #: ../src/guestfs.pod:2831
36319 "The crucially important generator, used to automatically generate large "
36320 "amounts of boilerplate C code for things like RPC and bindings."
36324 #: ../src/guestfs.pod:2834
36329 #: ../src/guestfs.pod:2836
36330 msgid "Files used by the test suite."
36334 #: ../src/guestfs.pod:2838
36335 msgid "Some \"phony\" guest images which we test against."
36339 #: ../src/guestfs.pod:2840
36340 msgid "C<inspector>"
36344 #: ../src/guestfs.pod:2842
36345 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
36349 #: ../src/guestfs.pod:2844
36354 #: ../src/guestfs.pod:2846
36355 msgid "Logo used on the website. The fish is called Arthur by the way."
36359 #: ../src/guestfs.pod:2848
36364 #: ../src/guestfs.pod:2850
36365 msgid "M4 macros used by autoconf."
36369 #: ../src/guestfs.pod:2852
36374 #: ../src/guestfs.pod:2854
36375 msgid "Translations of simple gettext strings."
36379 #: ../src/guestfs.pod:2856
36384 #: ../src/guestfs.pod:2858
36386 "The build infrastructure and PO files for translations of manpages and POD "
36387 "files. Eventually this will be combined with the C<po> directory, but that "
36388 "is rather complicated."
36392 #: ../src/guestfs.pod:2862
36393 msgid "C<regressions>"
36397 #: ../src/guestfs.pod:2864
36398 msgid "Regression tests."
36402 #: ../src/guestfs.pod:2866
36407 #: ../src/guestfs.pod:2868
36408 msgid "L<virt-rescue(1)> command and documentation."
36412 #: ../src/guestfs.pod:2870
36417 #: ../src/guestfs.pod:2872
36418 msgid "Source code to the C library."
36422 #: ../src/guestfs.pod:2874
36427 #: ../src/guestfs.pod:2876
36428 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
36432 #: ../src/guestfs.pod:2878
36433 msgid "C<test-tool>"
36437 #: ../src/guestfs.pod:2880
36439 "Test tool for end users to test if their qemu/kernel combination will work "
36444 #: ../src/guestfs.pod:2883
36449 #: ../src/guestfs.pod:2885
36454 #: ../src/guestfs.pod:2887
36459 #: ../src/guestfs.pod:2889
36464 #: ../src/guestfs.pod:2891
36469 #: ../src/guestfs.pod:2893
36474 #: ../src/guestfs.pod:2895
36479 #: ../src/guestfs.pod:2897
36484 #: ../src/guestfs.pod:2899
36485 msgid "Language bindings."
36489 #: ../src/guestfs.pod:2903
36490 msgid "MAKING A STABLE RELEASE"
36494 #: ../src/guestfs.pod:2905
36496 "When we make a stable release, there are several steps documented here. See "
36497 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
36502 #: ../src/guestfs.pod:2913
36504 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
36508 #: ../src/guestfs.pod:2918
36509 msgid "Finalize RELEASE-NOTES."
36513 #: ../src/guestfs.pod:2922
36514 msgid "Update ROADMAP."
36518 #: ../src/guestfs.pod:2926
36519 msgid "Run C<src/api-support/update-from-tarballs.sh>."
36523 #: ../src/guestfs.pod:2930
36524 msgid "Push and pull from Transifex."
36528 #: ../src/guestfs.pod:2932
36533 #: ../src/guestfs.pod:2934
36541 #: ../src/guestfs.pod:2936
36542 msgid "to push the latest POT files to Transifex. Then run:"
36546 #: ../src/guestfs.pod:2938
36554 #: ../src/guestfs.pod:2940
36555 msgid "which is a wrapper to pull the latest translated C<*.po> files."
36559 #: ../src/guestfs.pod:2944
36561 "Create new stable and development directories under L<http://libguestfs.org/"
36566 #: ../src/guestfs.pod:2949
36567 msgid "Create the branch in git:"
36571 #: ../src/guestfs.pod:2951
36574 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
36575 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
36576 " git branch stable-1.XX\n"
36577 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
36582 #: ../src/guestfs.pod:2958
36587 #: ../src/guestfs.pod:2960
36588 msgid "PROTOCOL LIMITS"
36592 #: ../src/guestfs.pod:2962
36594 "Internally libguestfs uses a message-based protocol to pass API calls and "
36595 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
36596 "plenty more detail about this). The maximum message size used by the "
36597 "protocol is slightly less than 4 MB. For some API calls you may need to be "
36598 "aware of this limit. The API calls which may be affected are individually "
36599 "documented, with a link back to this section of the documentation."
36603 #: ../src/guestfs.pod:2970
36605 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
36606 "a simple string. Because this string is at some point internally encoded as "
36607 "a message, the maximum size that it can return is slightly under 4 MB. If "
36608 "the requested file is larger than this then you will get an error."
36612 #: ../src/guestfs.pod:2976
36614 "In order to transfer large files into and out of the guest filesystem, you "
36615 "need to use particular calls that support this. The sections L</UPLOADING> "
36616 "and L</DOWNLOADING> document how to do this."
36620 #: ../src/guestfs.pod:2980
36622 "You might also consider mounting the disk image using our FUSE filesystem "
36623 "support (L<guestmount(1)>)."
36627 #: ../src/guestfs.pod:2983
36628 msgid "MAXIMUM NUMBER OF DISKS"
36632 #: ../src/guestfs.pod:2985
36633 msgid "When using virtio disks (the default) the current limit is B<25> disks."
36637 #: ../src/guestfs.pod:2988
36639 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
36640 "slots. However febootstrap only understands disks with names C</dev/vda> "
36641 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
36646 #: ../src/guestfs.pod:2993
36648 "We are working to substantially raise this limit in future versions but it "
36649 "requires complex changes to qemu."
36653 #: ../src/guestfs.pod:2996
36655 "In future versions of libguestfs it should also be possible to \"hot plug\" "
36656 "disks (add and remove disks after calling L</guestfs_launch>). This also "
36657 "requires changes to qemu."
36661 #: ../src/guestfs.pod:3000
36662 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
36666 #: ../src/guestfs.pod:3002
36667 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
36671 #: ../src/guestfs.pod:3004
36673 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
36674 "vda>, and C</dev/vda1> through C</dev/vda15>)."
36678 #: ../src/guestfs.pod:3007
36680 "If you attach a disk with more than 15 partitions, the extra partitions are "
36681 "ignored by libguestfs."
36685 #: ../src/guestfs.pod:3010
36686 msgid "MAXIMUM SIZE OF A DISK"
36690 #: ../src/guestfs.pod:3012
36691 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
36695 #: ../src/guestfs.pod:3014
36697 "We have tested block devices up to 1 exabyte (2**60 or "
36698 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
36703 #: ../src/guestfs.pod:3018
36705 "Although libguestfs probably does not impose any limit, the underlying host "
36706 "storage will. If you store disk images on a host ext4 filesystem, then the "
36707 "maximum size will be limited by the maximum ext4 file size (currently 16 "
36708 "TB). If you store disk images as host logical volumes then you are limited "
36709 "by the maximum size of an LV."
36713 #: ../src/guestfs.pod:3024
36715 "For the hugest disk image files, we recommend using XFS on the host for "
36720 #: ../src/guestfs.pod:3027
36721 msgid "MAXIMUM SIZE OF A PARTITION"
36725 #: ../src/guestfs.pod:3029
36727 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
36728 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
36729 "address a partition located beyond 2 TB on the disk."
36733 #: ../src/guestfs.pod:3033
36735 "It is recommended that you use GPT partitions on disks which are larger than "
36736 "this size. GPT uses 64 bit sector numbers and so can address partitions "
36737 "which are theoretically larger than the largest disk we could support."
36741 #: ../src/guestfs.pod:3038
36742 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
36746 #: ../src/guestfs.pod:3040
36748 "This depends on the filesystem type. libguestfs itself does not impose any "
36749 "known limit. Consult Wikipedia or the filesystem documentation to find out "
36750 "what these limits are."
36754 #: ../src/guestfs.pod:3044
36755 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
36759 #: ../src/guestfs.pod:3046
36761 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
36762 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
36763 "uploads and downloads."
36767 #: ../src/guestfs.pod:3050
36768 msgid "INSPECTION LIMITS"
36772 #: ../src/guestfs.pod:3052
36774 "The inspection code has several arbitrary limits on things like the size of "
36775 "Windows Registry hive it will read, and the length of product name. These "
36776 "are intended to stop a malicious guest from consuming arbitrary amounts of "
36777 "memory and disk space on the host, and should not be reached in practice. "
36778 "See the source code for more information."
36782 #: ../src/guestfs.pod:3078
36784 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
36785 "effect as calling C<guestfs_set_verbose (g, 1)>."
36789 #: ../src/guestfs.pod:3090
36791 "Set the path that libguestfs uses to search for a supermin appliance. See "
36792 "the discussion of paths in section L</PATH> above."
36796 #: ../src/guestfs.pod:3099
36797 msgid "See also L</QEMU WRAPPERS> above."
36801 #: ../src/guestfs.pod:3103
36803 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
36804 "effect as calling C<guestfs_set_trace (g, 1)>."
36808 #: ../src/guestfs.pod:3121
36810 "L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-"
36811 "perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, L<guestfish(1)>, "
36812 "L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
36813 "L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)"
36814 ">, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
36815 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
36816 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
36817 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
36821 #: ../src/guestfs.pod:3151
36823 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
36824 "(8)>, L<disktype(1)>."
36828 #: ../src/guestfs.pod:3158 ../tools/virt-make-fs.pl:553
36829 #: ../tools/virt-win-reg.pl:761
36834 #: ../src/guestfs.pod:3160
36835 msgid "To get a list of bugs against libguestfs use this link:"
36839 #: ../src/guestfs.pod:3162
36841 "L<https://bugzilla.redhat.com/buglist.cgi?"
36842 "component=libguestfs&product=Virtualization+Tools>"
36846 #: ../src/guestfs.pod:3164
36847 msgid "To report a new bug against libguestfs use this link:"
36851 #: ../src/guestfs.pod:3166
36853 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
36854 "component=libguestfs&product=Virtualization+Tools>"
36858 #: ../src/guestfs.pod:3168
36859 msgid "When reporting a bug, please check:"
36863 #: ../src/guestfs.pod:3174
36864 msgid "That the bug hasn't been reported already."
36868 #: ../src/guestfs.pod:3178
36869 msgid "That you are testing a recent version."
36873 #: ../src/guestfs.pod:3182
36874 msgid "Describe the bug accurately, and give a way to reproduce it."
36878 #: ../src/guestfs.pod:3186
36880 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
36885 #: ../test-tool/libguestfs-test-tool.pod:5
36886 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
36890 #: ../test-tool/libguestfs-test-tool.pod:9
36893 " libguestfs-test-tool [--options]\n"
36898 #: ../test-tool/libguestfs-test-tool.pod:13
36900 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
36901 "to check basic libguestfs functionality is working. This is needed because "
36902 "libguestfs occasionally breaks for reasons beyond our control: usually "
36903 "because of changes in the underlying qemu or kernel packages, or the host "
36908 #: ../test-tool/libguestfs-test-tool.pod:19
36909 msgid "If you suspect a problem in libguestfs, then just run:"
36913 #: ../test-tool/libguestfs-test-tool.pod:21
36916 " libguestfs-test-tool\n"
36921 #: ../test-tool/libguestfs-test-tool.pod:23
36922 msgid "It will print lots of diagnostic messages."
36926 #: ../test-tool/libguestfs-test-tool.pod:25
36927 msgid "If it runs to completion successfully, you will see this near the end:"
36931 #: ../test-tool/libguestfs-test-tool.pod:27
36934 " ===== TEST FINISHED OK =====\n"
36939 #: ../test-tool/libguestfs-test-tool.pod:29
36940 msgid "and the test tool will exit with code 0."
36944 #: ../test-tool/libguestfs-test-tool.pod:31
36946 "If it fails (and/or exits with non-zero error code), please paste the "
36947 "I<complete, unedited> output of the test tool into a bug report. More "
36948 "information about reporting bugs can be found on the L<http://libguestfs.org/"
36953 #: ../test-tool/libguestfs-test-tool.pod:42
36954 msgid "Display short usage information and exit."
36958 #: ../test-tool/libguestfs-test-tool.pod:44
36959 msgid "B<--qemu qemu_binary>"
36963 #: ../test-tool/libguestfs-test-tool.pod:46
36965 "If you have downloaded another qemu binary, point this option at the full "
36966 "path of the binary to try it."
36970 #: ../test-tool/libguestfs-test-tool.pod:49
36971 msgid "B<--qemudir qemu_source_dir>"
36975 #: ../test-tool/libguestfs-test-tool.pod:51
36977 "If you have compiled qemu from source, point this option at the source "
36978 "directory to try it."
36982 #: ../test-tool/libguestfs-test-tool.pod:54
36987 #: ../test-tool/libguestfs-test-tool.pod:56
36988 msgid "B<--timeout N>"
36992 #: ../test-tool/libguestfs-test-tool.pod:58
36994 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
36995 "minutes) which does not usually need to be adjusted."
36999 #: ../test-tool/libguestfs-test-tool.pod:63
37000 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
37004 #: ../test-tool/libguestfs-test-tool.pod:65
37006 "If you have compiled another version of qemu from source and would like to "
37007 "try that, then you can use the I<--qemudir> option to point to the qemu "
37008 "source directory."
37012 #: ../test-tool/libguestfs-test-tool.pod:69
37014 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
37015 "option to point to the binary."
37019 #: ../test-tool/libguestfs-test-tool.pod:72
37021 "Note when using these options, you can ignore the business of qemu wrapper "
37022 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
37023 "wrapper script for you if one is needed."
37027 #: ../test-tool/libguestfs-test-tool.pod:76
37028 msgid "TRYING OUT A DIFFERENT KERNEL"
37032 #: ../test-tool/libguestfs-test-tool.pod:78
37034 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
37035 "libguestfs tries. You do this by setting the environment variables "
37036 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
37040 #: ../test-tool/libguestfs-test-tool.pod:82
37042 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
37047 #: ../test-tool/libguestfs-test-tool.pod:85
37048 msgid "SELF-DIAGNOSIS"
37052 #: ../test-tool/libguestfs-test-tool.pod:87
37054 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
37055 "produced by libguestfs-test-tool and/or possible errors."
37059 #: ../test-tool/libguestfs-test-tool.pod:92
37061 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
37062 "I<1> if there was an error."
37066 #: ../test-tool/libguestfs-test-tool.pod:97
37068 "For the full list of environment variables which may affect libguestfs, "
37069 "please see the L<guestfs(3)> manual page."
37073 #: ../test-tool/libguestfs-test-tool.pod:102
37074 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
37078 #: ../tools/virt-list-filesystems.pl:32
37080 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
37084 #: ../tools/virt-list-filesystems.pl:36
37087 " virt-list-filesystems [--options] domname\n"
37092 #: ../tools/virt-list-filesystems.pl:38
37095 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
37100 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
37102 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
37107 #: ../tools/virt-list-filesystems.pl:45
37109 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
37110 "are contained in a virtual machine or disk image."
37114 #: ../tools/virt-list-filesystems.pl:49
37116 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
37117 "functionality. For more complex cases you should look at the L<guestfish(1)"
37122 #: ../tools/virt-list-filesystems.pl:112
37124 "With this option, C<virt-list-filesystems> displays the type of each "
37125 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
37129 #: ../tools/virt-list-filesystems.pl:119
37134 #: ../tools/virt-list-filesystems.pl:123
37136 "Normally we only show mountable filesystems. If this option is given then "
37137 "swap devices are shown too."
37141 #: ../tools/virt-list-filesystems.pl:197
37143 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
37144 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
37145 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37149 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
37150 msgid "Copyright (C) 2009 Red Hat Inc."
37154 #: ../tools/virt-list-partitions.pl:32
37156 "virt-list-partitions - List partitions in a virtual machine or disk image"
37160 #: ../tools/virt-list-partitions.pl:36
37163 " virt-list-partitions [--options] domname\n"
37168 #: ../tools/virt-list-partitions.pl:38
37171 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
37176 #: ../tools/virt-list-partitions.pl:45
37178 "C<virt-list-partitions> is a command line tool to list the partitions that "
37179 "are contained in a virtual machine or disk image. It is mainly useful as a "
37180 "first step to using L<virt-resize(1)>."
37184 #: ../tools/virt-list-partitions.pl:50
37186 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
37187 "functionality. For more complex cases you should look at the L<guestfish(1)"
37192 #: ../tools/virt-list-partitions.pl:113
37193 msgid "Show sizes in human-readable form (eg. \"1G\")."
37197 #: ../tools/virt-list-partitions.pl:123
37199 "With this option, C<virt-list-partitions> displays the type and size of each "
37200 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
37204 #: ../tools/virt-list-partitions.pl:130
37209 #: ../tools/virt-list-partitions.pl:132
37214 #: ../tools/virt-list-partitions.pl:134
37216 "Display the total size of each block device (as a separate row or rows)."
37220 #: ../tools/virt-list-partitions.pl:267
37222 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
37223 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
37224 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
37228 #: ../tools/virt-list-partitions.pl:283
37229 msgid "Copyright (C) 2009-2010 Red Hat Inc."
37233 #: ../tools/virt-make-fs.pl:37
37234 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
37238 #: ../tools/virt-make-fs.pl:41
37241 " virt-make-fs [--options] input.tar output.img\n"
37246 #: ../tools/virt-make-fs.pl:43
37249 " virt-make-fs [--options] input.tar.gz output.img\n"
37254 #: ../tools/virt-make-fs.pl:45
37257 " virt-make-fs [--options] directory output.img\n"
37262 #: ../tools/virt-make-fs.pl:49
37264 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
37265 "archive or some files in a directory. It is similar to tools like L<mkisofs"
37266 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
37267 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
37268 "you want to attach these filesystems to existing virtual machines (eg. to "
37269 "import large amounts of read-only data to a VM)."
37273 #: ../tools/virt-make-fs.pl:57
37274 msgid "Basic usage is:"
37278 #: ../tools/virt-make-fs.pl:59
37281 " virt-make-fs input output\n"
37286 #: ../tools/virt-make-fs.pl:61
37288 "where C<input> is either a directory containing files that you want to add, "
37289 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
37290 "C<output> is a disk image. The input type is detected automatically. The "
37291 "output disk image defaults to a raw ext2 image unless you specify extra "
37292 "flags (see L</OPTIONS> below)."
37296 #: ../tools/virt-make-fs.pl:67
37297 msgid "EXTRA SPACE"
37301 #: ../tools/virt-make-fs.pl:69
37303 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
37304 "the files that it contains, but might have extra space. Depending on how "
37305 "you are going to use the output, you might think this extra space is wasted "
37306 "and want to minimize it, or you might want to leave space so that more files "
37307 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
37308 "but you can use the I<--size> flag to leave space in the filesystem if you "
37313 #: ../tools/virt-make-fs.pl:77
37315 "An alternative way to leave extra space but not make the output image any "
37316 "bigger is to use an alternative disk image format (instead of the default "
37317 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
37318 "image format (check your hypervisor supports this before using it). This "
37319 "allows you to choose a large I<--size> but the extra space won't actually be "
37320 "allocated in the image until you try to store something in it."
37324 #: ../tools/virt-make-fs.pl:85
37326 "Don't forget that you can also use local commands including L<resize2fs(8)> "
37327 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
37328 "to build another image from scratch."
37332 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
37333 #: ../tools/virt-make-fs.pl:142
37338 #: ../tools/virt-make-fs.pl:91
37341 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
37346 #: ../tools/virt-make-fs.pl:93
37347 msgid "FILESYSTEM TYPE"
37351 #: ../tools/virt-make-fs.pl:95
37353 "The default filesystem type is C<ext2>. Just about any filesystem type that "
37354 "libguestfs supports can be used (but I<not> read-only formats like "
37355 "ISO9660). Here are some of the more common choices:"
37359 #: ../tools/virt-make-fs.pl:101
37364 #: ../tools/virt-make-fs.pl:103
37366 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
37367 "you are not going to use the filesystem in a way that requires the journal, "
37368 "then this is just wasted overhead."
37372 #: ../tools/virt-make-fs.pl:107
37373 msgid "I<ntfs> or I<vfat>"
37377 #: ../tools/virt-make-fs.pl:109
37378 msgid "Useful if exporting data to a Windows guest."
37382 #: ../tools/virt-make-fs.pl:111
37384 "I<Note for vfat>: The tar archive or local directory must only contain files "
37385 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
37386 "program running within libguestfs is unable to change the ownership of non-"
37387 "root files, since vfat itself does not support this."
37391 #: ../tools/virt-make-fs.pl:116
37396 #: ../tools/virt-make-fs.pl:118
37398 "Lower overhead than C<ext2>, but certain limitations on filename length and "
37399 "total filesystem size."
37403 #: ../tools/virt-make-fs.pl:125
37406 " virt-make-fs --type=minix input minixfs.img\n"
37411 #: ../tools/virt-make-fs.pl:127
37412 msgid "TO PARTITION OR NOT TO PARTITION"
37416 #: ../tools/virt-make-fs.pl:129
37417 msgid "Optionally virt-make-fs can add a partition table to the output disk."
37421 #: ../tools/virt-make-fs.pl:131
37423 "Adding a partition can make the disk image more compatible with certain "
37424 "virtualized operating systems which don't expect to see a filesystem "
37425 "directly located on a block device (Linux doesn't care and will happily "
37426 "handle both types)."
37430 #: ../tools/virt-make-fs.pl:136
37432 "On the other hand, if you have a partition table then the output image is no "
37433 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
37434 "directly on a partitioned disk image. (However libguestfs tools such as "
37435 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
37439 #: ../tools/virt-make-fs.pl:144
37440 msgid "Add an MBR partition:"
37444 #: ../tools/virt-make-fs.pl:146
37447 " virt-make-fs --partition -- input disk.img\n"
37452 #: ../tools/virt-make-fs.pl:148
37454 "If the output disk image could be terabyte-sized or larger, it's better to "
37455 "use an EFI/GPT-compatible partition table:"
37459 #: ../tools/virt-make-fs.pl:151
37462 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
37467 #: ../tools/virt-make-fs.pl:179
37468 msgid "Enable debugging information."
37472 #: ../tools/virt-make-fs.pl:185
37473 msgid "B<--size=E<lt>NE<gt>>"
37477 #: ../tools/virt-make-fs.pl:187
37478 msgid "B<--size=+E<lt>NE<gt>>"
37482 #: ../tools/virt-make-fs.pl:189
37483 msgid "B<-s E<lt>NE<gt>>"
37487 #: ../tools/virt-make-fs.pl:191
37488 msgid "B<-s +E<lt>NE<gt>>"
37492 #: ../tools/virt-make-fs.pl:193
37494 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
37498 #: ../tools/virt-make-fs.pl:196
37500 "If this option is I<not> given, then the output image will be just large "
37501 "enough to contain all the files, with not much wasted space."
37505 #: ../tools/virt-make-fs.pl:199
37507 "To choose a fixed size output disk, specify an absolute number followed by b/"
37508 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37509 "Petabytes or Exabytes. This must be large enough to contain all the input "
37510 "files, else you will get an error."
37514 #: ../tools/virt-make-fs.pl:204
37516 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
37517 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37518 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
37519 "the input files, and (approximately) an extra 200 MB free space."
37523 #: ../tools/virt-make-fs.pl:210
37525 "Note that virt-make-fs estimates free space, and therefore will not produce "
37526 "filesystems containing precisely the free space requested. (It is much more "
37527 "expensive and time-consuming to produce a filesystem which has precisely the "
37528 "desired free space)."
37532 #: ../tools/virt-make-fs.pl:219
37533 msgid "B<--format=E<lt>fmtE<gt>>"
37537 #: ../tools/virt-make-fs.pl:221
37538 msgid "B<-F E<lt>fmtE<gt>>"
37542 #: ../tools/virt-make-fs.pl:223
37543 msgid "Choose the output disk image format."
37547 #: ../tools/virt-make-fs.pl:225
37548 msgid "The default is C<raw> (raw disk image)."
37552 #: ../tools/virt-make-fs.pl:227
37554 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
37555 "that would really make sense here is C<qcow2>."
37559 #: ../tools/virt-make-fs.pl:234
37560 msgid "B<--type=E<lt>fsE<gt>>"
37564 #: ../tools/virt-make-fs.pl:236
37565 msgid "B<-t E<lt>fsE<gt>>"
37569 #: ../tools/virt-make-fs.pl:238
37570 msgid "Choose the output filesystem type."
37574 #: ../tools/virt-make-fs.pl:240
37575 msgid "The default is C<ext2>."
37579 #: ../tools/virt-make-fs.pl:242
37581 "Any filesystem which is supported read-write by libguestfs can be used here."
37585 #: ../tools/virt-make-fs.pl:249
37586 msgid "B<--partition>"
37590 #: ../tools/virt-make-fs.pl:251
37591 msgid "B<--partition=E<lt>parttypeE<gt>>"
37595 #: ../tools/virt-make-fs.pl:253
37597 "If specified, this flag adds an MBR partition table to the output disk image."
37601 #: ../tools/virt-make-fs.pl:256
37603 "You can change the partition table type, eg. I<--partition=gpt> for large "
37608 #: ../tools/virt-make-fs.pl:259
37610 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
37611 "might consider the next parameter to be the partition type. For example:"
37615 #: ../tools/virt-make-fs.pl:263
37618 " virt-make-fs --partition input.tar ...\n"
37623 #: ../tools/virt-make-fs.pl:265
37625 "would cause virt-make-fs to think you wanted to use a partition type of "
37626 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
37627 "dash) between options and the input file argument:"
37631 #: ../tools/virt-make-fs.pl:269
37634 " virt-make-fs --partition -- input.tar ...\n"
37639 #: ../tools/virt-make-fs.pl:541
37641 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
37642 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
37643 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
37647 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
37649 "When reporting bugs, please enable debugging and capture the I<complete> "
37654 #: ../tools/virt-make-fs.pl:558
37657 " export LIBGUESTFS_DEBUG=1\n"
37658 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
37663 #: ../tools/virt-make-fs.pl:561
37665 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
37670 #: ../tools/virt-tar.pl:33
37671 msgid "virt-tar - Extract or upload files to a virtual machine"
37675 #: ../tools/virt-tar.pl:37
37678 " virt-tar [--options] -x domname directory tarball\n"
37683 #: ../tools/virt-tar.pl:39
37686 " virt-tar [--options] -u domname tarball directory\n"
37691 #: ../tools/virt-tar.pl:41
37694 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
37699 #: ../tools/virt-tar.pl:43
37702 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
37707 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
37712 #: ../tools/virt-tar.pl:47
37714 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
37715 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
37719 #: ../tools/virt-tar.pl:52
37720 msgid "Download C</home> from the VM into a local tarball:"
37724 #: ../tools/virt-tar.pl:54
37727 " virt-tar -x domname /home home.tar\n"
37732 #: ../tools/virt-tar.pl:56
37735 " virt-tar -zx domname /home home.tar.gz\n"
37740 #: ../tools/virt-tar.pl:58
37741 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
37745 #: ../tools/virt-tar.pl:60
37748 " virt-tar -u domname uploadstuff.tar /tmp\n"
37753 #: ../tools/virt-tar.pl:62
37756 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
37761 #: ../tools/virt-tar.pl:66
37763 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
37764 "virtual machines. If you do this, you risk disk corruption in the VM. "
37765 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
37769 #: ../tools/virt-tar.pl:71
37771 "You can use I<-x> (extract) on live virtual machines, but you might get "
37772 "inconsistent results or errors if there is filesystem activity inside the "
37773 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
37774 "work, but the only way to guarantee consistent results is if the virtual "
37775 "machine is shut down."
37779 #: ../tools/virt-tar.pl:79
37781 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
37782 "parts of a guest filesystem. There are many possibilities: making backups, "
37783 "uploading data files, snooping on guest activity, fixing or customizing "
37788 #: ../tools/virt-tar.pl:84
37790 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
37791 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
37792 "should look at the L<guestfish(1)> tool."
37796 #: ../tools/virt-tar.pl:88
37798 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
37799 "its contents (recursively) from the virtual machine into a local tarball. "
37800 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
37801 "virtual machine. You cannot use these two options together."
37805 #: ../tools/virt-tar.pl:94
37807 "In addition, you may need to use the I<-z> (gZip) option to enable "
37808 "compression. When uploading, you have to specify I<-z> if the upload file "
37809 "is compressed because virt-tar won't detect this on its own."
37813 #: ../tools/virt-tar.pl:98
37815 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
37816 "example it cannot do PKZip files or bzip2 compression. If you want that "
37817 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
37818 "the L<libguestfs(3)> API)."
37822 #: ../tools/virt-tar.pl:160
37823 msgid "B<--extract>"
37827 #: ../tools/virt-tar.pl:162
37828 msgid "B<--download>"
37832 #: ../tools/virt-tar.pl:164
37837 #: ../tools/virt-tar.pl:166
37838 msgid "B<--upload>"
37842 #: ../tools/virt-tar.pl:168
37844 "Use I<-x> to extract (download) a directory from a virtual machine to a "
37849 #: ../tools/virt-tar.pl:171
37851 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
37852 "Please read the L</WARNING> section above before using this option."
37856 #: ../tools/virt-tar.pl:175
37857 msgid "You must specify exactly one of these options."
37861 #: ../tools/virt-tar.pl:181
37866 #: ../tools/virt-tar.pl:183
37871 #: ../tools/virt-tar.pl:185
37872 msgid "Specify that the input or output tarball is gzip-compressed."
37876 #: ../tools/virt-tar.pl:298
37878 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
37879 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
37880 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
37885 #: ../tools/virt-win-reg.pl:37
37887 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
37891 #: ../tools/virt-win-reg.pl:41
37894 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
37899 #: ../tools/virt-win-reg.pl:43
37902 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
37907 #: ../tools/virt-win-reg.pl:45
37910 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
37915 #: ../tools/virt-win-reg.pl:47
37918 " virt-win-reg --merge domname [input.reg ...]\n"
37923 #: ../tools/virt-win-reg.pl:49
37926 " virt-win-reg [--options] disk.img ... # instead of domname\n"
37931 #: ../tools/virt-win-reg.pl:53
37933 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
37934 "virtual machines. If you do this, you I<will> get irreversible disk "
37935 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
37936 "but doesn't catch all cases."
37940 #: ../tools/virt-win-reg.pl:58
37942 "Modifying the Windows Registry is an inherently risky operation. The format "
37943 "is deliberately obscure and undocumented, and Registry changes can leave the "
37944 "system unbootable. Therefore when using the I<--merge> option, make sure "
37945 "you have a reliable backup first."
37949 #: ../tools/virt-win-reg.pl:65
37951 "This program can export and merge Windows Registry entries from a Windows "
37956 #: ../tools/virt-win-reg.pl:68
37958 "The first parameter is the libvirt guest name or the raw disk image of a "
37963 #: ../tools/virt-win-reg.pl:71
37965 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
37966 "exported (recursively). For example:"
37970 #: ../tools/virt-win-reg.pl:74
37973 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
37978 #: ../tools/virt-win-reg.pl:76
37980 "You can also display single values from within registry keys, for example:"
37984 #: ../tools/virt-win-reg.pl:79
37987 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
37988 " $ virt-win-reg Windows7 $cvkey ProductName\n"
37989 " Windows 7 Enterprise\n"
37994 #: ../tools/virt-win-reg.pl:83
37996 "With I<--merge>, you can merge a textual regedit file into the Windows "
38001 #: ../tools/virt-win-reg.pl:86
38004 " $ virt-win-reg --merge Windows7 changes.reg\n"
38009 #: ../tools/virt-win-reg.pl:90
38011 "This program is only meant for simple access to the registry. If you want "
38012 "to do complicated things with the registry, we suggest you download the "
38013 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
38014 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
38015 "L<hivexregedit(1)>."
38019 #: ../tools/virt-win-reg.pl:159
38024 #: ../tools/virt-win-reg.pl:161
38026 "In merge mode, this merges a textual regedit file into the Windows Registry "
38027 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
38028 "displays or exports Registry entries instead."
38032 #: ../tools/virt-win-reg.pl:165
38034 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
38035 "result in disk corruption. However exporting (without this flag) is always "
38040 #: ../tools/virt-win-reg.pl:173
38041 msgid "B<--encoding> UTF-16LE|ASCII"
38045 #: ../tools/virt-win-reg.pl:175
38047 "When merging (only), you may need to specify the encoding for strings to be "
38048 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
38049 "(3)/ENCODING STRINGS>."
38053 #: ../tools/virt-win-reg.pl:179
38055 "The default is to use UTF-16LE, which should work with recent versions of "
38060 #: ../tools/virt-win-reg.pl:186
38061 msgid "B<--unsafe-printable-strings>"
38065 #: ../tools/virt-win-reg.pl:188
38067 "When exporting (only), assume strings are UTF-16LE and print them as strings "
38068 "instead of hex sequences. Remove the final zero codepoint from strings if "
38073 #: ../tools/virt-win-reg.pl:192
38075 "This is unsafe and does not preserve the fidelity of strings in the original "
38076 "Registry for various reasons:"
38080 #: ../tools/virt-win-reg.pl:199
38082 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
38083 "other encodings will be corrupted by this transformation."
38087 #: ../tools/virt-win-reg.pl:204
38089 "Assumes that everything which has type 1 or 2 is really a string and that "
38090 "everything else is not a string, but the type field in real Registries is "
38095 #: ../tools/virt-win-reg.pl:210
38097 "Loses information about whether a zero codepoint followed the string in the "
38102 #: ../tools/virt-win-reg.pl:215
38104 "This all happens because the Registry itself contains no information about "
38105 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
38109 #: ../tools/virt-win-reg.pl:219
38111 "You should only use this option for quick hacking and debugging of the "
38112 "Registry contents, and I<never> use it if the output is going to be passed "
38113 "into another program or stored in another Registry."
38117 #: ../tools/virt-win-reg.pl:556
38118 msgid "SUPPORTED SYSTEMS"
38122 #: ../tools/virt-win-reg.pl:558
38124 "The program currently supports Windows NT-derived guests starting with "
38125 "Windows XP through to at least Windows 7."
38129 #: ../tools/virt-win-reg.pl:561
38130 msgid "The following Registry keys are supported:"
38134 #: ../tools/virt-win-reg.pl:565
38135 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
38139 #: ../tools/virt-win-reg.pl:567
38140 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
38144 #: ../tools/virt-win-reg.pl:569
38145 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
38149 #: ../tools/virt-win-reg.pl:571
38150 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
38154 #: ../tools/virt-win-reg.pl:573
38155 msgid "C<HKEY_USERS\\.DEFAULT>"
38159 #: ../tools/virt-win-reg.pl:575
38160 msgid "C<HKEY_USERS\\I<SID>>"
38164 #: ../tools/virt-win-reg.pl:577
38165 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
38169 #: ../tools/virt-win-reg.pl:579
38170 msgid "C<HKEY_USERS\\I<username>>"
38174 #: ../tools/virt-win-reg.pl:581
38176 "where I<username> is a local user name (this is a libguestfs extension)."
38180 #: ../tools/virt-win-reg.pl:585
38182 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
38187 #: ../tools/virt-win-reg.pl:588
38189 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
38190 "supported (there is no \"current user\")."
38194 #: ../tools/virt-win-reg.pl:591
38199 #: ../tools/virt-win-reg.pl:593
38201 "C<virt-win-reg> expects that regedit files have already been reencoded in "
38202 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
38203 "style line endings. Since Windows regedit files are often in UTF-16LE with "
38204 "Windows-style line endings, you may need to reencode the whole file before "
38205 "or after processing."
38209 #: ../tools/virt-win-reg.pl:599
38211 "To reencode a file from Windows format to Linux (before processing it with "
38212 "the I<--merge> option), you would do something like this:"
38216 #: ../tools/virt-win-reg.pl:602
38219 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
38224 #: ../tools/virt-win-reg.pl:604
38226 "To go in the opposite direction, after exporting and before sending the file "
38227 "to a Windows user, do something like this:"
38231 #: ../tools/virt-win-reg.pl:607
38234 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
38239 #: ../tools/virt-win-reg.pl:609
38240 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
38244 #: ../tools/virt-win-reg.pl:611
38246 "If you are unsure about the current encoding, use the L<file(1)> command. "
38247 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
38248 "style (CRLF) line endings, like this:"
38252 #: ../tools/virt-win-reg.pl:615
38255 " $ file software.reg\n"
38256 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
38257 " with CRLF line terminators\n"
38262 #: ../tools/virt-win-reg.pl:619
38263 msgid "This file would need conversion before you could I<--merge> it."
38267 #: ../tools/virt-win-reg.pl:621
38268 msgid "CurrentControlSet etc."
38272 #: ../tools/virt-win-reg.pl:623
38274 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
38275 "Registry at the level of the hive file, and therefore you cannot modify "
38280 #: ../tools/virt-win-reg.pl:627
38282 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
38283 "circumstances it might refer to another control set. The way to find out is "
38284 "to look at the C<HKLM\\SYSTEM\\Select> key:"
38288 #: ../tools/virt-win-reg.pl:631
38291 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
38292 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
38293 " \"Current\"=dword:00000001\n"
38294 " \"Default\"=dword:00000001\n"
38295 " \"Failed\"=dword:00000000\n"
38296 " \"LastKnownGood\"=dword:00000002\n"
38301 #: ../tools/virt-win-reg.pl:638
38302 msgid "\"Current\" is the one which Windows will choose when it boots."
38306 #: ../tools/virt-win-reg.pl:640
38308 "Similarly, other C<Current...> keys in the path may need to be replaced."
38312 #: ../tools/virt-win-reg.pl:643
38313 msgid "WINDOWS TIPS"
38317 #: ../tools/virt-win-reg.pl:645
38319 "Note that some of these tips modify the guest disk image. The guest I<must> "
38320 "be shut off, else you will get disk corruption."
38324 #: ../tools/virt-win-reg.pl:648
38325 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
38329 #: ../tools/virt-win-reg.pl:650
38331 "Prepare a DOS batch script, VBScript or executable. Upload this using "
38332 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
38333 "is uploaded into C<C:\\>:"
38337 #: ../tools/virt-win-reg.pl:654
38340 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
38345 #: ../tools/virt-win-reg.pl:656
38346 msgid "Prepare a regedit file containing the registry change:"
38350 #: ../tools/virt-win-reg.pl:658
38353 " cat > test.reg <<'EOF'\n"
38354 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
38355 " \"Test\"=\"c:\\\\test.bat\"\n"
38361 #: ../tools/virt-win-reg.pl:663
38363 "In this example we use the key C<RunOnce> which means that the script will "
38364 "run precisely once when the first user logs in. If you want it to run every "
38365 "time a user logs in, replace C<RunOnce> with C<Run>."
38369 #: ../tools/virt-win-reg.pl:667
38370 msgid "Now update the registry:"
38374 #: ../tools/virt-win-reg.pl:669
38377 " virt-win-reg --merge WindowsGuest test.reg\n"
38382 #: ../tools/virt-win-reg.pl:671
38383 msgid "INSTALLING A SERVICE"
38387 #: ../tools/virt-win-reg.pl:673
38389 "This section assumes you are familiar with Windows services, and you either "
38390 "have a program which handles the Windows Service Control Protocol directly "
38391 "or you want to run any program using a service wrapper like SrvAny or the "
38396 #: ../tools/virt-win-reg.pl:678
38398 "First upload the program and optionally the service wrapper. In this case "
38399 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
38403 #: ../tools/virt-win-reg.pl:682
38406 " guestfish -i -d WindowsGuest <<EOF\n"
38407 " upload rhsrvany.exe /rhsrvany.exe\n"
38408 " upload test.exe /test.exe\n"
38414 #: ../tools/virt-win-reg.pl:687
38416 "Prepare a regedit file containing the registry changes. In this example, "
38417 "the first registry change is needed for the service itself or the service "
38418 "wrapper (if used). The second registry change is only needed because I am "
38419 "using the RHSrvAny service wrapper."
38423 #: ../tools/virt-win-reg.pl:692
38426 " cat > service.reg <<'EOF'\n"
38427 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
38428 " \"Type\"=dword:00000010\n"
38429 " \"Start\"=dword:00000002\n"
38430 " \"ErrorControl\"=dword:00000001\n"
38431 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
38432 " \"DisplayName\"=\"RHSrvAny\"\n"
38433 " \"ObjectName\"=\"NetworkService\"\n"
38438 #: ../tools/virt-win-reg.pl:701
38441 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
38442 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
38443 " \"PWD\"=\"c:\\\\Temp\"\n"
38449 #: ../tools/virt-win-reg.pl:712
38451 "For use of C<ControlSet001> see the section above in this manual page. You "
38452 "may need to adjust this according to the control set that is in use by the "
38457 #: ../tools/virt-win-reg.pl:718
38459 "C<\"ObjectName\"> controls the privileges that the service will have. An "
38460 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
38461 "privileged account."
38465 #: ../tools/virt-win-reg.pl:724
38467 "For the meaning of the magic numbers, see this Microsoft KB article: "
38468 "L<http://support.microsoft.com/kb/103000>."
38472 #: ../tools/virt-win-reg.pl:729
38473 msgid "Update the registry:"
38477 #: ../tools/virt-win-reg.pl:731
38480 " virt-win-reg --merge WindowsGuest service.reg\n"
38485 #: ../tools/virt-win-reg.pl:735
38487 "Be careful when passing parameters containing C<\\> (backslash) in the "
38488 "shell. Usually you will have to use 'single quotes' or double backslashes "
38489 "(but not both) to protect them from the shell."
38493 #: ../tools/virt-win-reg.pl:739
38494 msgid "Paths and value names are case-insensitive."
38498 #: ../tools/virt-win-reg.pl:748
38500 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
38501 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
38502 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38506 #: ../tools/virt-win-reg.pl:766
38509 " export LIBGUESTFS_DEBUG=1\n"
38510 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
38515 #: ../tools/virt-win-reg.pl:769
38517 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."