1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
6 # rjones <rjones@redhat.com>, 2011.
7 # <www.carrotsoft@gmail.com>, 2011.
10 "Project-Id-Version: libguestfs\n"
11 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
12 "POT-Creation-Date: 2011-10-24 17:16+0200\n"
13 "PO-Revision-Date: 2011-10-19 15:46+0000\n"
14 "Last-Translator: rjones <rjones@redhat.com>\n"
15 "Language-Team: Japanese <trans-ja@lists.fedoraproject.org>\n"
18 "Content-Type: text/plain; charset=UTF-8\n"
19 "Content-Transfer-Encoding: 8bit\n"
20 "Plural-Forms: nplurals=1; plural=0\n"
23 #: ../align/virt-alignment-scan.pod:3 ../cat/virt-cat.pod:3
24 #: ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3
25 #: ../clone/virt-sysprep.pod:3 ../df/virt-df.pod:3 ../edit/virt-edit.pod:3
26 #: ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3
27 #: ../examples/guestfs-recipes.pod:14 ../fish/guestfish.pod:3
28 #: ../fish/virt-copy-in.pod:3 ../fish/virt-copy-out.pod:3
29 #: ../fish/virt-tar-in.pod:3 ../fish/virt-tar-out.pod:3
30 #: ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pod:3
31 #: ../java/examples/guestfs-java.pod:3 ../ocaml/examples/guestfs-ocaml.pod:3
32 #: ../perl/examples/guestfs-perl.pod:3 ../python/examples/guestfs-python.pod:3
33 #: ../rescue/virt-rescue.pod:3 ../resize/virt-resize.pod:3
34 #: ../ruby/examples/guestfs-ruby.pod:3 ../sparsify/virt-sparsify.pod:3
35 #: ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3
36 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
37 #: ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31
38 #: ../tools/virt-win-reg.pl:35
43 #: ../align/virt-alignment-scan.pod:5
44 msgid "virt-alignment-scan - Check alignment of virtual machine partitions"
48 #: ../align/virt-alignment-scan.pod:7 ../cat/virt-cat.pod:7
49 #: ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7
50 #: ../clone/virt-sysprep.pod:7 ../df/virt-df.pod:7 ../edit/virt-edit.pod:7
51 #: ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7
52 #: ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7
53 #: ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7
54 #: ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7
55 #: ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7
56 #: ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7
57 #: ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7
58 #: ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7
59 #: ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7
60 #: ../test-tool/libguestfs-test-tool.pod:7
61 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
62 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
63 #: ../tools/virt-win-reg.pl:39
68 #: ../align/virt-alignment-scan.pod:9
71 " virt-alignment-scan [--options] -d domname\n"
76 #: ../align/virt-alignment-scan.pod:11
79 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
84 #: ../align/virt-alignment-scan.pod:13 ../cat/virt-cat.pod:19
85 #: ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19
86 #: ../clone/virt-sysprep.pod:13 ../df/virt-df.pod:21 ../edit/virt-edit.pod:27
87 #: ../erlang/examples/guestfs-erlang.pod:16
88 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
89 #: ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19
90 #: ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21
91 #: ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20
92 #: ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15
93 #: ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18
94 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29
95 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
96 #: ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23
97 #: ../test-tool/libguestfs-test-tool.pod:11
98 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
99 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
100 #: ../tools/virt-win-reg.pl:63
105 #: ../align/virt-alignment-scan.pod:15
107 "When older operating systems install themselves, the partitioning tools "
108 "place partitions at a sector misaligned with the underlying storage "
109 "(commonly the first partition starts on sector C<63>). Misaligned "
110 "partitions can result in an operating system issuing more I/O than should be "
115 #: ../align/virt-alignment-scan.pod:21
117 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
118 "machines and disk images and warns you if there are alignment problems."
122 #: ../align/virt-alignment-scan.pod:25
124 "Currently there is no virt tool for fixing alignment problems. You can only "
125 "reinstall the guest operating system. The following NetApp document "
126 "summarises the problem and possible solutions: L<http://media.netapp.com/"
127 "documents/tr-3747.pdf>"
131 #: ../align/virt-alignment-scan.pod:30
136 #: ../align/virt-alignment-scan.pod:32
137 msgid "To run this tool on a disk image directly, use the I<-a> option:"
141 #: ../align/virt-alignment-scan.pod:34
144 " $ virt-alignment-scan -a winxp.img\n"
145 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
150 #: ../align/virt-alignment-scan.pod:37
153 " $ virt-alignment-scan -a fedora16.img\n"
154 " /dev/sda1 1048576 1024K ok\n"
155 " /dev/sda2 2097152 2048K ok\n"
156 " /dev/sda3 526385152 2048K ok\n"
161 #: ../align/virt-alignment-scan.pod:42
163 "To run the tool on a guest known to libvirt, use the I<-d> option and "
164 "possibly the I<-c> option:"
168 #: ../align/virt-alignment-scan.pod:45
171 " # virt-alignment-scan -d RHEL5\n"
172 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
173 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
178 #: ../align/virt-alignment-scan.pod:49
181 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
182 " /dev/sda1 1048576 1024K ok\n"
183 " /dev/sda2 105906176 1024K ok\n"
184 " /dev/sdb1 65536 64K ok\n"
189 #: ../align/virt-alignment-scan.pod:54
191 "The output consists of 4 or more whitespace-separated columns. Only the "
192 "first 4 columns are signficant if you want to parse this from a program. "
197 #: ../align/virt-alignment-scan.pod:60
202 #: ../align/virt-alignment-scan.pod:62
204 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
205 "on the first block device)"
209 #: ../align/virt-alignment-scan.pod:65
214 #: ../align/virt-alignment-scan.pod:67
215 msgid "the start of the partition in bytes"
219 #: ../align/virt-alignment-scan.pod:69
224 #: ../align/virt-alignment-scan.pod:71
225 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
229 #: ../align/virt-alignment-scan.pod:73
234 #: ../align/virt-alignment-scan.pod:75
236 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
237 "can cause performance problems"
241 #: ../align/virt-alignment-scan.pod:78
246 #: ../align/virt-alignment-scan.pod:80
247 msgid "optional free-text explanation."
251 #: ../align/virt-alignment-scan.pod:84
253 "The exit code from the program changes depending on whether poorly aligned "
254 "partitions were found. See L</EXIT STATUS> below."
258 #: ../align/virt-alignment-scan.pod:87
259 msgid "If you just want the exit code with no output, use the I<-q> option."
263 #: ../align/virt-alignment-scan.pod:89 ../cat/virt-cat.pod:62
264 #: ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261
265 #: ../clone/virt-sysprep.pod:42 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62
266 #: ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45
267 #: ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42
268 #: ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:92
269 #: ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84
270 #: ../resize/virt-resize.pod:241 ../sparsify/virt-sparsify.pod:99
271 #: ../test-tool/libguestfs-test-tool.pod:36
272 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
273 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
274 #: ../tools/virt-win-reg.pl:96
279 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66
280 #: ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265
281 #: ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66
282 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:160
283 #: ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88
284 #: ../resize/virt-resize.pod:245 ../sparsify/virt-sparsify.pod:103
285 #: ../test-tool/libguestfs-test-tool.pod:40
286 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62
287 #: ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111
288 #: ../tools/virt-win-reg.pl:104
293 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68
294 #: ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267
295 #: ../clone/virt-sysprep.pod:48 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68
296 #: ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90
297 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64
298 #: ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113
299 #: ../tools/virt-win-reg.pl:106
300 msgid "Display brief help."
304 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:70
305 #: ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269
306 #: ../clone/virt-sysprep.pod:50 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70
307 #: ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
312 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:72
313 #: ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271
314 #: ../clone/virt-sysprep.pod:52 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72
315 #: ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
316 msgid "B<--add> file"
320 #: ../align/virt-alignment-scan.pod:101 ../clone/virt-sysprep.pod:54
321 msgid "Add I<file> which should be a disk image from a virtual machine."
325 #: ../align/virt-alignment-scan.pod:103 ../cat/virt-cat.pod:78
326 #: ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277
327 #: ../clone/virt-sysprep.pod:56 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78
328 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:102
329 #: ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
331 "The format of the disk image is auto-detected. To override this and force a "
332 "particular format use the I<--format=..> option."
336 #: ../align/virt-alignment-scan.pod:106 ../cat/virt-cat.pod:81
337 #: ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291
338 #: ../clone/virt-sysprep.pod:59 ../df/virt-df.pod:78
339 #: ../rescue/virt-rescue.pod:107
344 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:83
345 #: ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293
346 #: ../clone/virt-sysprep.pod:61 ../df/virt-df.pod:80
347 #: ../rescue/virt-rescue.pod:109
348 msgid "B<--connect> URI"
352 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:85
353 #: ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295
354 #: ../clone/virt-sysprep.pod:63 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99
355 #: ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111
356 #: ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82
357 #: ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
359 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
360 "to the default libvirt hypervisor."
364 #: ../align/virt-alignment-scan.pod:113 ../cat/virt-cat.pod:88
365 #: ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298
366 #: ../clone/virt-sysprep.pod:66 ../df/virt-df.pod:85
367 #: ../rescue/virt-rescue.pod:114
369 "If you specify guest block devices directly (I<-a>), then libvirt is not "
374 #: ../align/virt-alignment-scan.pod:116 ../cat/virt-cat.pod:91
375 #: ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307
376 #: ../clone/virt-sysprep.pod:69 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105
377 #: ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
382 #: ../align/virt-alignment-scan.pod:118 ../cat/virt-cat.pod:93
383 #: ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309
384 #: ../clone/virt-sysprep.pod:71 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107
385 #: ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
386 msgid "B<--domain> guest"
390 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:95
391 #: ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311
392 #: ../clone/virt-sysprep.pod:73 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109
393 #: ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
395 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
400 #: ../align/virt-alignment-scan.pod:123 ../cat/virt-cat.pod:105
401 #: ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328
402 #: ../clone/virt-sysprep.pod:95 ../df/virt-df.pod:101
403 #: ../fish/guestfish.pod:233 ../fuse/guestmount.pod:142
404 #: ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:124
405 msgid "B<--format=raw|qcow2|..>"
409 #: ../align/virt-alignment-scan.pod:125 ../cat/virt-cat.pod:107
410 #: ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330
411 #: ../clone/virt-sysprep.pod:97 ../df/virt-df.pod:103
412 #: ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235
413 #: ../fuse/guestmount.pod:144 ../inspector/virt-inspector.pod:101
414 #: ../rescue/virt-rescue.pod:126
419 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:109
420 #: ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332
421 #: ../clone/virt-sysprep.pod:99 ../df/virt-df.pod:105
422 #: ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237
423 #: ../fuse/guestmount.pod:146 ../rescue/virt-rescue.pod:128
425 "The default for the I<-a> option is to auto-detect the format of the disk "
426 "image. Using this forces the disk format for I<-a> options which follow on "
427 "the command line. Using I<--format> with no argument switches back to auto-"
428 "detection for subsequent I<-a> options."
432 #: ../align/virt-alignment-scan.pod:132 ../cat/virt-cat.pod:114
433 #: ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337
434 #: ../clone/virt-sysprep.pod:104 ../df/virt-df.pod:110
435 #: ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242
436 #: ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:336
437 #: ../rescue/virt-rescue.pod:133 ../src/guestfs.pod:2862
442 #: ../align/virt-alignment-scan.pod:134
445 " virt-alignment-scan --format=raw -a disk.img\n"
450 #: ../align/virt-alignment-scan.pod:136 ../cat/virt-cat.pod:118
451 #: ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341
452 #: ../clone/virt-sysprep.pod:108 ../df/virt-df.pod:114
453 #: ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246
454 #: ../rescue/virt-rescue.pod:137
455 msgid "forces raw format (no auto-detection) for C<disk.img>."
459 #: ../align/virt-alignment-scan.pod:138
462 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
467 #: ../align/virt-alignment-scan.pod:140 ../cat/virt-cat.pod:122
468 #: ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345
469 #: ../clone/virt-sysprep.pod:112 ../df/virt-df.pod:118
470 #: ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250
471 #: ../rescue/virt-rescue.pod:141
473 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
474 "detection for C<another.img>."
478 #: ../align/virt-alignment-scan.pod:143 ../cat/virt-cat.pod:125
479 #: ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348
480 #: ../clone/virt-sysprep.pod:115 ../df/virt-df.pod:121
481 #: ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:144
483 "If you have untrusted raw-format guest disk images, you should use this "
484 "option to specify the disk format. This avoids a possible security problem "
485 "with malicious guests (CVE-2010-3851)."
489 #: ../align/virt-alignment-scan.pod:147 ../resize/virt-resize.pod:470
490 #: ../sparsify/virt-sparsify.pod:153
495 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:472
496 #: ../sparsify/virt-sparsify.pod:155
501 #: ../align/virt-alignment-scan.pod:151
503 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
508 #: ../align/virt-alignment-scan.pod:154 ../cat/virt-cat.pod:134
509 #: ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425
510 #: ../clone/virt-sysprep.pod:138 ../df/virt-df.pod:173
511 #: ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390
512 #: ../fuse/guestmount.pod:266 ../inspector/virt-inspector.pod:119
513 #: ../rescue/virt-rescue.pod:182 ../sparsify/virt-sparsify.pod:159
518 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:136
519 #: ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427
520 #: ../clone/virt-sysprep.pod:140 ../df/virt-df.pod:175
521 #: ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392
522 #: ../fuse/guestmount.pod:268 ../inspector/virt-inspector.pod:121
523 #: ../rescue/virt-rescue.pod:184 ../sparsify/virt-sparsify.pod:161
528 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:138
529 #: ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429
530 #: ../clone/virt-sysprep.pod:142 ../df/virt-df.pod:177
531 #: ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123
532 #: ../rescue/virt-rescue.pod:186 ../sparsify/virt-sparsify.pod:163
533 msgid "Enable verbose messages for debugging."
537 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:140
538 #: ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431
539 #: ../clone/virt-sysprep.pod:144 ../df/virt-df.pod:179
540 #: ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397
541 #: ../fuse/guestmount.pod:272 ../inspector/virt-inspector.pod:125
542 #: ../rescue/virt-rescue.pod:188 ../resize/virt-resize.pod:540
543 #: ../sparsify/virt-sparsify.pod:165
548 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:142
549 #: ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433
550 #: ../clone/virt-sysprep.pod:146 ../df/virt-df.pod:181
551 #: ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399
552 #: ../fuse/guestmount.pod:274 ../inspector/virt-inspector.pod:127
553 #: ../rescue/virt-rescue.pod:190 ../resize/virt-resize.pod:542
554 #: ../sparsify/virt-sparsify.pod:167 ../tools/virt-list-filesystems.pl:69
555 #: ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169
556 #: ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
561 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:144
562 #: ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435
563 #: ../clone/virt-sysprep.pod:148 ../df/virt-df.pod:183
564 #: ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129
565 #: ../rescue/virt-rescue.pod:192 ../resize/virt-resize.pod:544
566 #: ../sparsify/virt-sparsify.pod:169 ../tools/virt-list-filesystems.pl:71
567 #: ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171
568 #: ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
569 msgid "Display version number and exit."
573 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146
574 #: ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437
575 #: ../clone/virt-sysprep.pod:150 ../df/virt-df.pod:185
576 #: ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412
577 #: ../fuse/guestmount.pod:287 ../inspector/virt-inspector.pod:131
578 #: ../rescue/virt-rescue.pod:203 ../sparsify/virt-sparsify.pod:171
579 #: ../tools/virt-tar.pl:158
584 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148
585 #: ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439
586 #: ../clone/virt-sysprep.pod:152 ../df/virt-df.pod:187
587 #: ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133
588 #: ../rescue/virt-rescue.pod:205 ../sparsify/virt-sparsify.pod:173
589 msgid "Enable tracing of libguestfs API calls."
593 #: ../align/virt-alignment-scan.pod:172
594 msgid "RECOMMENDED ALIGNMENT"
598 #: ../align/virt-alignment-scan.pod:174
600 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
601 "first sector of the first partition at sector 63, with a 512 byte sector "
602 "size. This happens because of a historical accident. Drives have to report "
603 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
604 "completely meaningless on modern drives, but it happens that the geometry "
605 "reported always has 63 sectors per track. The operating system therefore "
606 "places the first partition at the start of the second \"track\", at sector "
611 #: ../align/virt-alignment-scan.pod:183
613 "When the guest OS is virtualized, the host operating system and hypervisor "
614 "may prefer accesses aligned to one of:"
618 #: ../align/virt-alignment-scan.pod:188
623 #: ../align/virt-alignment-scan.pod:190
625 "if the host OS uses local storage directly on hard drive partitions, and the "
626 "hard drive has 512 byte physical sectors."
630 #: ../align/virt-alignment-scan.pod:193
635 #: ../align/virt-alignment-scan.pod:195
637 "for local storage on new hard drives with 4Kbyte physical sectors; for file-"
638 "backed storage on filesystems with 4Kbyte block size; or for some types of "
639 "network-attached storage."
643 #: ../align/virt-alignment-scan.pod:199
648 #: ../align/virt-alignment-scan.pod:201
650 "for high-end network-attached storage. This is the optimal block size for "
651 "some NetApp hardware."
655 #: ../align/virt-alignment-scan.pod:204
660 #: ../align/virt-alignment-scan.pod:206
661 msgid "see L</1 MB PARTITION ALIGNMENT> below."
665 #: ../align/virt-alignment-scan.pod:210
667 "Partitions which are not aligned correctly to the underlying storage cause "
668 "extra I/O. For example:"
672 #: ../align/virt-alignment-scan.pod:213
676 " +--------------------------+------\n"
678 " | filesystem block |\n"
679 " ---+------------------+------+-------------------+-----+---\n"
680 " | host block | host block |\n"
682 " ---+-------------------------+-------------------------+---\n"
687 #: ../align/virt-alignment-scan.pod:222
689 "In this example, each time a 4K guest block is read, two blocks on the host "
690 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
691 "written, two host blocks must first be read, the old and new data combined, "
692 "and the two blocks written back (4x I/O)."
696 #: ../align/virt-alignment-scan.pod:227
697 msgid "LINUX HOST BLOCK AND I/O SIZE"
701 #: ../align/virt-alignment-scan.pod:229
703 "New versions of the Linux kernel expose the physical and logical block size, "
704 "and minimum and recommended I/O size."
708 #: ../align/virt-alignment-scan.pod:232
709 msgid "For a typical hard drive with 512 byte sectors:"
713 #: ../align/virt-alignment-scan.pod:234
716 " $ cat /sys/block/sda/queue/physical_block_size\n"
718 " $ cat /sys/block/sda/queue/logical_block_size\n"
720 " $ cat /sys/block/sda/queue/minimum_io_size\n"
722 " $ cat /sys/block/sda/queue/optimal_io_size\n"
728 #: ../align/virt-alignment-scan.pod:243
729 msgid "For a NetApp LUN:"
733 #: ../align/virt-alignment-scan.pod:245
736 " $ cat /sys/block/sdc/queue/logical_block_size\n"
738 " $ cat /sys/block/sdc/queue/physical_block_size\n"
740 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
742 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
748 #: ../align/virt-alignment-scan.pod:254
750 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
751 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
755 #: ../align/virt-alignment-scan.pod:258
757 "For detailed information about what these numbers mean, see L<http://docs."
758 "redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/"
759 "Storage_Administration_Guide/newstorage-iolimits.html>"
763 #: ../align/virt-alignment-scan.pod:261
765 "[Thanks to Mike Snitzer for providing NetApp data and additional "
770 #: ../align/virt-alignment-scan.pod:264
771 msgid "1 MB PARTITION ALIGNMENT"
775 #: ../align/virt-alignment-scan.pod:266
777 "Microsoft picked 1 MB as the default alignment for all partitions starting "
778 "with Windows 2008 Server, and Linux has followed this."
782 #: ../align/virt-alignment-scan.pod:269
784 "Assuming 512 byte sectors in the guest, you will now see the first partition "
785 "starting at sector 2048, and subsequent partitions (if any) will start at a "
786 "multiple of 2048 sectors."
790 #: ../align/virt-alignment-scan.pod:273
792 "1 MB alignment is compatible with all current alignment requirements (4K, "
793 "64K) and provides room for future growth in physical block sizes."
797 #: ../align/virt-alignment-scan.pod:276
798 msgid "SETTING ALIGNMENT"
802 #: ../align/virt-alignment-scan.pod:278
804 "L<virt-resize(1)> can change the alignment of the partitions of some "
805 "guests. Currently it can fully align all the partitions of all Windows "
806 "guests, and it will fix the bootloader where necessary. For Linux guests, "
807 "it can align the second and subsequent partitions, so the majority of OS "
808 "accesses except at boot will be aligned."
812 #: ../align/virt-alignment-scan.pod:284
814 "Another way to correct partition alignment problems is to reinstall your "
815 "guest operating systems. If you install operating systems from templates, "
816 "ensure these have correct partition alignment too."
820 #: ../align/virt-alignment-scan.pod:288
822 "For older versions of Windows, the following NetApp document contains useful "
823 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
827 #: ../align/virt-alignment-scan.pod:291
829 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
830 "an explicit C<%pre> section that creates aligned partitions using L<parted(8)"
831 ">. Do not use the Kickstart C<part> command. The NetApp document above "
832 "contains an example."
836 #: ../align/virt-alignment-scan.pod:296 ../cat/virt-cat.pod:191
837 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483
838 #: ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:215
839 #: ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352
840 #: ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:655
841 #: ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258
842 #: ../tools/virt-make-fs.pl:550 ../tools/virt-tar.pl:289
843 #: ../tools/virt-win-reg.pl:744
844 msgid "SHELL QUOTING"
848 #: ../align/virt-alignment-scan.pod:298 ../cat/virt-cat.pod:193
849 #: ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485
850 #: ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:217
851 #: ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354
852 #: ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:657
853 #: ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260
854 #: ../tools/virt-make-fs.pl:552 ../tools/virt-tar.pl:291
855 #: ../tools/virt-win-reg.pl:752
857 "Libvirt guest names can contain arbitrary characters, some of which have "
858 "meaning to the shell such as C<#> and space. You may need to quote or "
859 "escape these characters on the command line. See the shell manual page L<sh"
864 #: ../align/virt-alignment-scan.pod:303 ../cat/virt-cat.pod:198
865 #: ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490
866 #: ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:222
867 #: ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114
868 #: ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:375
869 #: ../resize/virt-resize.pod:662 ../sparsify/virt-sparsify.pod:227
870 #: ../test-tool/libguestfs-test-tool.pod:90
875 #: ../align/virt-alignment-scan.pod:305
876 msgid "This program returns:"
880 #: ../align/virt-alignment-scan.pod:309 ../align/virt-alignment-scan.pod:315
881 #: ../align/virt-alignment-scan.pod:321 ../align/virt-alignment-scan.pod:328
882 #: ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287
883 #: ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295
884 #: ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314
885 #: ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322
886 #: ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362
887 #: ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388
888 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
889 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
890 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
891 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
892 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
893 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
894 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
895 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
896 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
897 #: ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:403
898 #: ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:417
899 #: ../fish/guestfish-actions.pod:1144 ../fish/guestfish-actions.pod:1148
900 #: ../fish/guestfish-actions.pod:1152 ../fish/guestfish-actions.pod:1156
901 #: ../fish/guestfish-actions.pod:1164 ../fish/guestfish-actions.pod:1168
902 #: ../fish/guestfish-actions.pod:1172 ../fish/guestfish-actions.pod:1182
903 #: ../fish/guestfish-actions.pod:1186 ../fish/guestfish-actions.pod:1190
904 #: ../fish/guestfish-actions.pod:1280 ../fish/guestfish-actions.pod:1284
905 #: ../fish/guestfish-actions.pod:1289 ../fish/guestfish-actions.pod:1294
906 #: ../fish/guestfish-actions.pod:1336 ../fish/guestfish-actions.pod:1340
907 #: ../fish/guestfish-actions.pod:1345 ../fish/guestfish-actions.pod:1601
908 #: ../fish/guestfish-actions.pod:1608 ../fish/guestfish-actions.pod:1615
909 #: ../fish/guestfish-actions.pod:2018 ../fish/guestfish-actions.pod:2024
910 #: ../fish/guestfish-actions.pod:2032 ../fish/guestfish-actions.pod:2039
911 #: ../fish/guestfish-actions.pod:2046 ../fish/guestfish.pod:445
912 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
913 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393
914 #: ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:338
915 #: ../resize/virt-resize.pod:342 ../resize/virt-resize.pod:351
916 #: ../resize/virt-resize.pod:357 ../sparsify/virt-sparsify.pod:32
917 #: ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43
918 #: ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54
919 #: ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64
920 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
921 #: ../src/guestfs-actions.pod:594 ../src/guestfs-actions.pod:602
922 #: ../src/guestfs-actions.pod:609 ../src/guestfs-actions.pod:616
923 #: ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1788
924 #: ../src/guestfs-actions.pod:1792 ../src/guestfs-actions.pod:1796
925 #: ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1808
926 #: ../src/guestfs-actions.pod:1812 ../src/guestfs-actions.pod:1822
927 #: ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:1830
928 #: ../src/guestfs-actions.pod:1968 ../src/guestfs-actions.pod:1972
929 #: ../src/guestfs-actions.pod:1977 ../src/guestfs-actions.pod:1982
930 #: ../src/guestfs-actions.pod:2043 ../src/guestfs-actions.pod:2047
931 #: ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2467
932 #: ../src/guestfs-actions.pod:2474 ../src/guestfs-actions.pod:2481
933 #: ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3032
934 #: ../src/guestfs-actions.pod:3040 ../src/guestfs-actions.pod:3047
935 #: ../src/guestfs-actions.pod:3054 ../src/guestfs.pod:388
936 #: ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402
937 #: ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416
938 #: ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098
939 #: ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115
940 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164
941 #: ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176
942 #: ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674
943 #: ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785
944 #: ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804
945 #: ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104
946 #: ../src/guestfs.pod:2112 ../src/guestfs.pod:2630 ../src/guestfs.pod:2636
947 #: ../src/guestfs.pod:2641 ../src/guestfs.pod:2647 ../src/guestfs.pod:3047
948 #: ../src/guestfs.pod:3052 ../src/guestfs.pod:3056 ../src/guestfs.pod:3060
949 #: ../src/guestfs.pod:3064 ../src/guestfs.pod:3078 ../src/guestfs.pod:3083
950 #: ../src/guestfs.pod:3314 ../src/guestfs.pod:3318 ../src/guestfs.pod:3322
951 #: ../src/guestfs.pod:3326 ../tools/virt-win-reg.pl:197
952 #: ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208
953 #: ../tools/virt-win-reg.pl:721 ../tools/virt-win-reg.pl:727
954 #: ../tools/virt-win-reg.pl:733
959 #: ../align/virt-alignment-scan.pod:311
964 #: ../align/virt-alignment-scan.pod:313
966 "successful exit, all partitions are aligned E<ge> 64K for best performance"
970 #: ../align/virt-alignment-scan.pod:317
975 #: ../align/virt-alignment-scan.pod:319
976 msgid "an error scanning the disk image or guest"
980 #: ../align/virt-alignment-scan.pod:323
985 #: ../align/virt-alignment-scan.pod:325
987 "successful exit, some partitions have alignment E<lt> 64K which can result "
988 "in poor performance on high end network storage"
992 #: ../align/virt-alignment-scan.pod:330
997 #: ../align/virt-alignment-scan.pod:332
999 "successful exit, some partitions have alignment E<lt> 4K which can result in "
1000 "poor performance on most hypervisors"
1004 #: ../align/virt-alignment-scan.pod:337 ../cat/virt-cat.pod:203
1005 #: ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495
1006 #: ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:227
1007 #: ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97
1008 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
1009 #: ../fish/guestfish.pod:1268 ../fish/virt-copy-in.pod:50
1010 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
1011 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:317
1012 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
1013 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
1014 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288
1015 #: ../resize/virt-resize.pod:667 ../ruby/examples/guestfs-ruby.pod:36
1016 #: ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3255
1017 #: ../test-tool/libguestfs-test-tool.pod:100
1018 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
1019 #: ../tools/virt-make-fs.pl:557 ../tools/virt-tar.pl:296
1020 #: ../tools/virt-win-reg.pl:757
1025 #: ../align/virt-alignment-scan.pod:339
1027 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
1028 "L<virt-resize(1)>, L<http://libguestfs.org/>."
1032 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:212
1033 #: ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507
1034 #: ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:235
1035 #: ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296
1036 #: ../resize/virt-resize.pod:690 ../sparsify/virt-sparsify.pod:264
1037 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277
1038 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:311
1039 #: ../tools/virt-win-reg.pl:783
1044 #: ../align/virt-alignment-scan.pod:348 ../cat/virt-cat.pod:214
1045 #: ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509
1046 #: ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:237
1047 #: ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395
1048 #: ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:692
1049 #: ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210
1050 #: ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:584
1051 #: ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:785
1052 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
1056 #: ../align/virt-alignment-scan.pod:350 ../cat/virt-cat.pod:216
1057 #: ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511
1058 #: ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:239
1059 #: ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114
1060 #: ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401
1061 #: ../fish/guestfish.pod:1300 ../fish/virt-copy-in.pod:64
1062 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
1063 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:332
1064 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62
1065 #: ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56
1066 #: ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300
1067 #: ../resize/virt-resize.pod:694 ../ruby/examples/guestfs-ruby.pod:52
1068 #: ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3337
1069 #: ../test-tool/libguestfs-test-tool.pod:110
1070 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
1071 #: ../tools/virt-make-fs.pl:586 ../tools/virt-tar.pl:315
1072 #: ../tools/virt-win-reg.pl:787
1077 #: ../align/virt-alignment-scan.pod:352 ../clone/virt-sysprep.pod:507
1078 #: ../sparsify/virt-sparsify.pod:270
1079 msgid "Copyright (C) 2011 Red Hat Inc."
1083 #: ../align/virt-alignment-scan.pod:354 ../cat/virt-cat.pod:220
1084 #: ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515
1085 #: ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:243
1086 #: ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305
1087 #: ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58
1088 #: ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60
1089 #: ../fuse/guestmount.pod:337 ../inspector/virt-inspector.pod:407
1090 #: ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:698
1091 #: ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115
1092 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
1093 #: ../tools/virt-make-fs.pl:590 ../tools/virt-tar.pl:319
1094 #: ../tools/virt-win-reg.pl:791
1096 "This program is free software; you can redistribute it and/or modify it "
1097 "under the terms of the GNU General Public License as published by the Free "
1098 "Software Foundation; either version 2 of the License, or (at your option) "
1099 "any later version."
1103 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:225
1104 #: ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520
1105 #: ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:248
1106 #: ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310
1107 #: ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63
1108 #: ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65
1109 #: ../fuse/guestmount.pod:342 ../inspector/virt-inspector.pod:412
1110 #: ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:703
1111 #: ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120
1112 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
1113 #: ../tools/virt-make-fs.pl:595 ../tools/virt-tar.pl:324
1114 #: ../tools/virt-win-reg.pl:796
1116 "This program is distributed in the hope that it will be useful, but WITHOUT "
1117 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
1118 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
1123 #: ../align/virt-alignment-scan.pod:364 ../cat/virt-cat.pod:230
1124 #: ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525
1125 #: ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:253
1126 #: ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315
1127 #: ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68
1128 #: ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70
1129 #: ../fuse/guestmount.pod:347 ../inspector/virt-inspector.pod:417
1130 #: ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:708
1131 #: ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125
1132 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
1133 #: ../tools/virt-make-fs.pl:600 ../tools/virt-tar.pl:329
1134 #: ../tools/virt-win-reg.pl:801
1136 "You should have received a copy of the GNU General Public License along with "
1137 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
1138 "Ave, Cambridge, MA 02139, USA."
1142 #: ../cat/virt-cat.pod:5
1143 msgid "virt-cat - Display files in a virtual machine"
1147 #: ../cat/virt-cat.pod:9
1150 " virt-cat [--options] -d domname file [file ...]\n"
1155 #: ../cat/virt-cat.pod:11
1158 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
1163 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
1164 #: ../inspector/virt-inspector.pod:13
1169 #: ../cat/virt-cat.pod:15
1172 " virt-cat domname file\n"
1177 #: ../cat/virt-cat.pod:17
1180 " virt-cat disk.img file\n"
1185 #: ../cat/virt-cat.pod:21
1187 "C<virt-cat> is a command line tool to display the contents of C<file> where "
1188 "C<file> exists in the named virtual machine (or disk image)."
1192 #: ../cat/virt-cat.pod:24
1194 "Multiple filenames can be given, in which case they are concatenated "
1195 "together. Each filename must be a full path, starting at the root directory "
1196 "(starting with '/')."
1200 #: ../cat/virt-cat.pod:28
1202 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
1203 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
1204 "(see L</USING GUESTFISH> below)."
1208 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
1209 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
1210 #: ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29
1211 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
1212 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
1213 #: ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75
1214 #: ../tools/virt-tar.pl:50
1219 #: ../cat/virt-cat.pod:34
1221 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
1225 #: ../cat/virt-cat.pod:37
1228 " virt-cat -d mydomain /etc/fstab\n"
1233 #: ../cat/virt-cat.pod:39
1234 msgid "List syslog messages from a VM disk image file:"
1238 #: ../cat/virt-cat.pod:41
1241 " virt-cat -a disk.img /var/log/messages | tail\n"
1246 #: ../cat/virt-cat.pod:43
1247 msgid "Find out what DHCP IP address a VM acquired:"
1251 #: ../cat/virt-cat.pod:45
1254 " virt-cat -d mydomain /var/log/messages | \\\n"
1255 " grep 'dhclient: bound to' | tail\n"
1260 #: ../cat/virt-cat.pod:48
1261 msgid "Find out what packages were recently installed:"
1265 #: ../cat/virt-cat.pod:50
1268 " virt-cat -d mydomain /var/log/yum.log | tail\n"
1273 #: ../cat/virt-cat.pod:52
1274 msgid "Find out who is logged on inside a virtual machine:"
1278 #: ../cat/virt-cat.pod:54
1281 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
1287 #: ../cat/virt-cat.pod:57
1288 msgid "or who was logged on:"
1292 #: ../cat/virt-cat.pod:59
1295 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
1296 " last -f /tmp/wtmp\n"
1301 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
1302 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
1303 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
1305 "Add I<file> which should be a disk image from a virtual machine. If the "
1306 "virtual machine has multiple block devices, you must supply all of them with "
1307 "separate I<-a> options."
1311 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
1312 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
1313 #: ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
1314 msgid "B<--echo-keys>"
1318 #: ../cat/virt-cat.pod:100
1320 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
1321 "so you cannot see what you are typing. If you are not worried about Tempest "
1322 "attacks and there is no one else in the room you can specify this flag to "
1323 "see what you are typing."
1327 #: ../cat/virt-cat.pod:116
1330 " virt-cat --format=raw -a disk.img file\n"
1335 #: ../cat/virt-cat.pod:120
1338 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
1343 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
1344 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
1345 #: ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
1346 msgid "B<--keys-from-stdin>"
1350 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
1351 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
1352 #: ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
1354 "Read key or passphrase parameters from stdin. The default is to try to read "
1355 "passphrases from the user by opening C</dev/tty>."
1359 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
1360 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
1361 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1365 #: ../cat/virt-cat.pod:154
1366 msgid "Previous versions of virt-cat allowed you to write either:"
1370 #: ../cat/virt-cat.pod:156
1373 " virt-cat disk.img [disk.img ...] file\n"
1378 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
1379 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1384 #: ../cat/virt-cat.pod:160
1387 " virt-cat guestname file\n"
1392 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
1393 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1395 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1396 "the confusing case where a disk image might have the same name as a guest."
1400 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
1401 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1402 msgid "For compatibility the old style is still supported."
1406 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
1407 msgid "USING GUESTFISH"
1411 #: ../cat/virt-cat.pod:170
1413 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1414 "C<virt-cat> doesn't work."
1418 #: ../cat/virt-cat.pod:173
1419 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1423 #: ../cat/virt-cat.pod:175
1426 " guestfish --ro -i -d domname download file -\n"
1431 #: ../cat/virt-cat.pod:177
1433 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1434 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1438 #: ../cat/virt-cat.pod:181
1440 "The command above uses libguestfs's guest inspection feature and so does not "
1441 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1442 "disk images that don't contain guests. To display a file from a disk image "
1447 #: ../cat/virt-cat.pod:186
1450 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1455 #: ../cat/virt-cat.pod:188
1457 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1458 "the disk image, and C<file> is the full path to the file."
1462 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374
1463 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
1464 #: ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:377
1465 #: ../resize/virt-resize.pod:664 ../sparsify/virt-sparsify.pod:229
1467 "This program returns 0 if successful, or non-zero if there was an error."
1471 #: ../cat/virt-cat.pod:205
1473 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
1474 "tar-out(1)>, L<http://libguestfs.org/>."
1478 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405
1479 #: ../resize/virt-resize.pod:696 ../tools/virt-make-fs.pl:588
1480 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1484 #: ../cat/virt-filesystems.pod:5
1486 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1487 "virtual machine or disk image"
1491 #: ../cat/virt-filesystems.pod:9
1494 " virt-filesystems [--options] -d domname\n"
1499 #: ../cat/virt-filesystems.pod:11
1502 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1507 #: ../cat/virt-filesystems.pod:15
1509 "This tool allows you to discover filesystems, partitions, logical volumes, "
1510 "and their sizes in a disk image or virtual machine. It is a replacement for "
1511 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1515 #: ../cat/virt-filesystems.pod:20
1517 "One use for this tool is from shell scripts to iterate over all filesystems "
1518 "from a disk image:"
1522 #: ../cat/virt-filesystems.pod:23
1525 " for fs in $(virt-filesystems -a disk.img); do\n"
1532 #: ../cat/virt-filesystems.pod:27
1534 "Another use is to list partitions before using another tool to modify those "
1535 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1536 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1540 #: ../cat/virt-filesystems.pod:32
1542 "Various command line options control what this program displays. You need "
1543 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1544 "guest respectively. If you just specify that then the program shows "
1545 "filesystems found, one per line, like this:"
1549 #: ../cat/virt-filesystems.pod:37
1552 " $ virt-filesystems -a disk.img\n"
1554 " /dev/vg_guest/lv_root\n"
1559 #: ../cat/virt-filesystems.pod:41
1561 "If you add I<-l> or I<--long> then the output includes extra information:"
1565 #: ../cat/virt-filesystems.pod:44
1568 " $ virt-filesystems -a disk.img -l\n"
1569 " Name Type VFS Label Size\n"
1570 " /dev/sda1 filesystem ext4 boot 524288000\n"
1571 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1576 #: ../cat/virt-filesystems.pod:49
1578 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1583 #: ../cat/virt-filesystems.pod:52
1586 " $ virt-filesystems -a disk.img --extra\n"
1588 " /dev/vg_guest/lv_root\n"
1589 " /dev/vg_guest/lv_swap\n"
1590 " /dev/vg_guest/lv_data\n"
1595 #: ../cat/virt-filesystems.pod:58
1597 "If you add I<--partitions> then partitions are shown instead of filesystems:"
1601 #: ../cat/virt-filesystems.pod:60
1604 " $ virt-filesystems -a disk.img --partitions\n"
1611 #: ../cat/virt-filesystems.pod:64
1613 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
1614 "volumes>, I<--block-devices> to list those items."
1618 #: ../cat/virt-filesystems.pod:67
1620 "You can use these options in combination as well (if you want a combination "
1621 "including filesystems, you have to add I<--filesystems>). Notice that some "
1622 "items fall into several categories (eg. C</dev/sda1> might be both a "
1623 "partition and a filesystem). These items are listed several times. To get "
1624 "a list which includes absolutely everything that virt-filesystems knows "
1625 "about, use the I<--all> option."
1629 #: ../cat/virt-filesystems.pod:74
1631 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
1632 "uuid> option to display device and filesystem UUIDs in the long output."
1636 #: ../cat/virt-filesystems.pod:78
1638 "I<--all --long --uuid> is a useful combination to display all possible "
1639 "information about everything."
1643 #: ../cat/virt-filesystems.pod:81
1646 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1647 " Name Type VFS Label Size Parent UUID\n"
1648 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1649 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1650 " /dev/sda1 partition - - 100M /dev/sda -\n"
1651 " /dev/sda2 partition - - 20G /dev/sda -\n"
1652 " /dev/sda device - - 20G - -\n"
1657 #: ../cat/virt-filesystems.pod:89
1659 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1663 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1668 #: ../cat/virt-filesystems.pod:112
1670 "Display everything. This is currently the same as specifying these options: "
1671 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
1672 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
1673 "added to this list in future)."
1677 #: ../cat/virt-filesystems.pod:117
1678 msgid "See also I<--long>."
1682 #: ../cat/virt-filesystems.pod:119
1683 msgid "B<--blkdevs>"
1687 #: ../cat/virt-filesystems.pod:121
1688 msgid "B<--block-devices>"
1692 #: ../cat/virt-filesystems.pod:123
1693 msgid "Display block devices."
1697 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1702 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1704 "Write out the results in CSV format (comma-separated values). This format "
1705 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1706 "ABOUT CSV FORMAT> below."
1710 #: ../cat/virt-filesystems.pod:150
1712 "When prompting for keys and passphrases, virt-filesystems normally turns "
1713 "echoing off so you cannot see what you are typing. If you are not worried "
1714 "about Tempest attacks and there is no one else in the room you can specify "
1715 "this flag to see what you are typing."
1719 #: ../cat/virt-filesystems.pod:155
1724 #: ../cat/virt-filesystems.pod:157
1726 "This causes filesystems that are not ordinary, mountable filesystems to be "
1727 "displayed. This category includes swapspace, and filesystems that are empty "
1728 "or contain unknown data."
1732 #: ../cat/virt-filesystems.pod:161
1733 msgid "This option implies I<--filesystems>."
1737 #: ../cat/virt-filesystems.pod:163
1738 msgid "B<--filesystems>"
1742 #: ../cat/virt-filesystems.pod:165
1744 "Display mountable filesystems. If no display option was selected then this "
1745 "option is implied."
1749 #: ../cat/virt-filesystems.pod:168
1750 msgid "With I<--extra>, non-mountable filesystems are shown too."
1754 #: ../cat/virt-filesystems.pod:181
1757 " virt-filesystems --format=raw -a disk.img\n"
1762 #: ../cat/virt-filesystems.pod:185
1765 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1770 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1771 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1772 #: ../tools/virt-list-partitions.pl:109
1777 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1778 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1779 msgid "B<--human-readable>"
1783 #: ../cat/virt-filesystems.pod:198
1784 msgid "In I<--long> mode, display sizes in human-readable format."
1788 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1789 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1794 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1795 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1800 #: ../cat/virt-filesystems.pod:209
1801 msgid "Display extra columns of data (\"long format\")."
1805 #: ../cat/virt-filesystems.pod:211
1806 msgid "A title row is added unless you also specify I<--no-title>."
1810 #: ../cat/virt-filesystems.pod:213
1812 "The extra columns displayed depend on what output you select, and the "
1813 "ordering of columns may change in future versions. Use the title row, I<--"
1814 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1819 #: ../cat/virt-filesystems.pod:218
1821 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1822 "default is to show raw numbers of I<bytes>."
1826 #: ../cat/virt-filesystems.pod:221
1827 msgid "Use I<--uuid> to display UUIDs too."
1831 #: ../cat/virt-filesystems.pod:223
1836 #: ../cat/virt-filesystems.pod:225
1837 msgid "B<--logvols>"
1841 #: ../cat/virt-filesystems.pod:227
1842 msgid "B<--logical-volumes>"
1846 #: ../cat/virt-filesystems.pod:229
1848 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1849 "of whether the LVs contain filesystems."
1853 #: ../cat/virt-filesystems.pod:232
1854 msgid "B<--no-title>"
1858 #: ../cat/virt-filesystems.pod:234
1859 msgid "In I<--long> mode, don't add a title row."
1863 #: ../cat/virt-filesystems.pod:236
1865 "Note that the order of the columns is not fixed, and may change in future "
1866 "versions of virt-filesystems, so using this option may give you unexpected "
1871 #: ../cat/virt-filesystems.pod:240
1876 #: ../cat/virt-filesystems.pod:242
1877 msgid "B<--partitions>"
1881 #: ../cat/virt-filesystems.pod:244
1883 "Display partitions. In this mode, these are displayed irrespective of "
1884 "whether the partitions contain filesystems."
1888 #: ../cat/virt-filesystems.pod:247
1893 #: ../cat/virt-filesystems.pod:249
1894 msgid "B<--physvols>"
1898 #: ../cat/virt-filesystems.pod:251
1899 msgid "B<--physical-volumes>"
1903 #: ../cat/virt-filesystems.pod:253
1904 msgid "Display LVM physical volumes."
1908 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1913 #: ../cat/virt-filesystems.pod:257
1918 #: ../cat/virt-filesystems.pod:259
1919 msgid "In I<--long> mode, display UUIDs as well."
1923 #: ../cat/virt-filesystems.pod:273
1928 #: ../cat/virt-filesystems.pod:275
1929 msgid "B<--volgroups>"
1933 #: ../cat/virt-filesystems.pod:277
1934 msgid "B<--volume-groups>"
1938 #: ../cat/virt-filesystems.pod:279
1939 msgid "Display LVM volume groups."
1943 #: ../cat/virt-filesystems.pod:287
1948 #: ../cat/virt-filesystems.pod:289
1950 "Note that columns in the output are subject to reordering and change in "
1951 "future versions of this tool."
1955 #: ../cat/virt-filesystems.pod:294
1960 #: ../cat/virt-filesystems.pod:296
1961 msgid "The filesystem, partition, block device or LVM name."
1965 #: ../cat/virt-filesystems.pod:298
1967 "For device and partition names these are displayed as canonical libguestfs "
1968 "names, so that for example C</dev/sda2> is the second partition on the first "
1973 #: ../cat/virt-filesystems.pod:302
1975 "If the I<--long> option is B<not> specified, then only the name column is "
1976 "shown in the output."
1980 #: ../cat/virt-filesystems.pod:305
1985 #: ../cat/virt-filesystems.pod:307
1986 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1990 #: ../cat/virt-filesystems.pod:309
1995 #: ../cat/virt-filesystems.pod:311
1997 "If there is a filesystem, then this column displays the filesystem type if "
1998 "one could be detected, eg. C<ext4>."
2002 #: ../cat/virt-filesystems.pod:314
2007 #: ../cat/virt-filesystems.pod:316
2009 "If the object has a label (used for identifying and mounting filesystems) "
2010 "then this column contains the label."
2014 #: ../cat/virt-filesystems.pod:319
2019 #: ../cat/virt-filesystems.pod:321
2021 "The size of the object in bytes. If the I<--human> option is used then the "
2022 "size is displayed in a human-readable form."
2026 #: ../cat/virt-filesystems.pod:324
2031 #: ../cat/virt-filesystems.pod:326
2033 "The parent column records the parent relationship between objects. For "
2034 "example, if the object is a partition, then this column contains the name of "
2035 "the containing device. If the object is a logical volume, then this column "
2036 "is the name of the volume group."
2040 #: ../cat/virt-filesystems.pod:331
2045 #: ../cat/virt-filesystems.pod:333
2047 "If the object has a UUID (used for identifying and mounting filesystems and "
2048 "block devices) then this column contains the UUID as a string."
2052 #: ../cat/virt-filesystems.pod:337
2053 msgid "The UUID is only displayed if the I<--uuid> option is given."
2057 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459
2058 #: ../df/virt-df.pod:191
2059 msgid "NOTE ABOUT CSV FORMAT"
2063 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461
2064 #: ../df/virt-df.pod:193
2066 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
2067 "should be easy to parse, but it is definitely not easy to parse."
2071 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464
2072 #: ../df/virt-df.pod:196
2074 "Myth: Just split fields at commas. Reality: This does I<not> work "
2075 "reliably. This example has two columns:"
2079 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467
2080 #: ../df/virt-df.pod:199
2083 " \"foo,bar\",baz\n"
2088 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469
2089 #: ../df/virt-df.pod:201
2091 "Myth: Read the file one line at a time. Reality: This does I<not> work "
2092 "reliably. This example has one row:"
2096 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472
2097 #: ../df/virt-df.pod:204
2106 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475
2107 #: ../df/virt-df.pod:207
2109 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
2110 "packaged in major Linux distributions)."
2114 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478
2115 #: ../df/virt-df.pod:210
2117 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
2118 "or Python's built-in csv library)."
2122 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481
2123 #: ../df/virt-df.pod:213
2124 msgid "Most spreadsheets and databases can import CSV directly."
2128 #: ../cat/virt-filesystems.pod:379
2130 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
2131 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
2136 #: ../cat/virt-filesystems.pod:394 ../tools/virt-win-reg.pl:789
2137 msgid "Copyright (C) 2010 Red Hat Inc."
2141 #: ../cat/virt-ls.pod:5
2142 msgid "virt-ls - List files in a virtual machine"
2146 #: ../cat/virt-ls.pod:9
2149 " virt-ls [--options] -d domname directory [directory ...]\n"
2154 #: ../cat/virt-ls.pod:11
2157 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
2162 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
2167 #: ../cat/virt-ls.pod:15
2170 " virt-ls [--options] domname directory\n"
2175 #: ../cat/virt-ls.pod:17
2178 " virt-ls [--options] disk.img [disk.img ...] directory\n"
2183 #: ../cat/virt-ls.pod:21
2185 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
2186 "more from a virtual machine or disk image."
2190 #: ../cat/virt-ls.pod:24
2192 "Multiple directory names can be given, in which case the output from each is "
2197 #: ../cat/virt-ls.pod:27
2199 "To list directories from a libvirt guest use the I<-d> option to specify the "
2200 "name of the guest. For a disk image, use the I<-a> option."
2204 #: ../cat/virt-ls.pod:31
2206 "C<virt-ls> can do many simple file listings. For more complicated cases you "
2207 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
2212 #: ../cat/virt-ls.pod:37
2213 msgid "Get a list of all files and directories in a virtual machine:"
2217 #: ../cat/virt-ls.pod:39
2220 " virt-ls -R -d guest /\n"
2225 #: ../cat/virt-ls.pod:41
2226 msgid "List all setuid or setgid programs in a Linux virtual machine:"
2230 #: ../cat/virt-ls.pod:43
2233 " virt-ls -lR -d guest / | grep '^- [42]'\n"
2238 #: ../cat/virt-ls.pod:45
2239 msgid "List all public-writable directories in a Linux virtual machine:"
2243 #: ../cat/virt-ls.pod:47
2246 " virt-ls -lR -d guest / | grep '^d ...7'\n"
2251 #: ../cat/virt-ls.pod:49
2252 msgid "List all Unix domain sockets in a Linux virtual machine:"
2256 #: ../cat/virt-ls.pod:51
2259 " virt-ls -lR -d guest / | grep '^s'\n"
2264 #: ../cat/virt-ls.pod:53
2265 msgid "List all regular files with filenames ending in '.png':"
2269 #: ../cat/virt-ls.pod:55
2272 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
2277 #: ../cat/virt-ls.pod:57
2278 msgid "To display files larger than 10MB in home directories:"
2282 #: ../cat/virt-ls.pod:59
2285 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
2290 #: ../cat/virt-ls.pod:61
2291 msgid "Find everything modified in the last 7 days:"
2295 #: ../cat/virt-ls.pod:63
2298 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
2303 #: ../cat/virt-ls.pod:65
2304 msgid "Find regular files modified in the last 24 hours:"
2308 #: ../cat/virt-ls.pod:67
2311 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2316 #: ../cat/virt-ls.pod:69
2317 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2321 #: ../cat/virt-ls.pod:71
2323 "Find the differences between files in a guest and an earlier snapshot of the "
2328 #: ../cat/virt-ls.pod:74
2331 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2332 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2333 " diff -u old new | less\n"
2338 #: ../cat/virt-ls.pod:78
2340 "The commands above won't find files where the content has changed but the "
2341 "metadata (eg. file size and modification date) is the same. To do that, you "
2342 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
2343 "checksum> can be quite slow since it has to read and compute a checksum of "
2344 "every regular file in the virtual machine."
2348 #: ../cat/virt-ls.pod:84
2349 msgid "OUTPUT MODES"
2353 #: ../cat/virt-ls.pod:86
2355 "C<virt-ls> has four output modes, controlled by different combinations of "
2356 "the I<-l> and I<-R> options."
2360 #: ../cat/virt-ls.pod:89
2361 msgid "SIMPLE LISTING"
2365 #: ../cat/virt-ls.pod:91
2366 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2370 #: ../cat/virt-ls.pod:93
2373 " $ virt-ls -d guest /\n"
2381 #: ../cat/virt-ls.pod:98
2382 msgid "LONG LISTING"
2386 #: ../cat/virt-ls.pod:100
2388 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2389 "(more specifically, like the C<guestfs_ll> function)."
2393 #: ../cat/virt-ls.pod:103
2396 " $ virt-ls -l -d guest /\n"
2398 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2399 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2405 #: ../cat/virt-ls.pod:109
2407 "Note that while this is useful for displaying a directory, do not try "
2408 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2413 #: ../cat/virt-ls.pod:113
2414 msgid "RECURSIVE LISTING"
2418 #: ../cat/virt-ls.pod:115
2420 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2421 "and directories recursively:"
2425 #: ../cat/virt-ls.pod:118
2428 " $ virt-ls -R -d guest /tmp\n"
2436 #: ../cat/virt-ls.pod:123
2438 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2439 "converts C<\\0> characters to C<\\n>."
2443 #: ../cat/virt-ls.pod:126
2444 msgid "RECURSIVE LONG LISTING"
2448 #: ../cat/virt-ls.pod:128
2450 "Using I<-lR> options together changes the output to display directories "
2451 "recursively, with file stats, and optionally other features such as "
2452 "checksums and extended attributes."
2456 #: ../cat/virt-ls.pod:132
2458 "Most of the interesting features of C<virt-ls> are only available when using "
2463 #: ../cat/virt-ls.pod:135
2465 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2466 "you cannot use the output in another program (because filenames can contain "
2467 "spaces and other unsafe characters). If the guest was untrusted and someone "
2468 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2469 "on you by creating filenames with embedded newline characters. To B<safely> "
2470 "parse the output in another program, use the I<--csv> (Comma-Separated "
2475 #: ../cat/virt-ls.pod:143
2477 "Note that this output format is completely unrelated to the C<ls -lR> "
2482 #: ../cat/virt-ls.pod:146
2485 " $ virt-ls -lR -d guest /bin\n"
2486 " d 0555 4096 /bin\n"
2487 " - 0755 123 /bin/alsaunmute\n"
2488 " - 0755 28328 /bin/arch\n"
2489 " l 0777 4 /bin/awk -> gawk\n"
2490 " - 0755 27216 /bin/basename\n"
2491 " - 0755 943360 /bin/bash\n"
2497 #: ../cat/virt-ls.pod:155
2498 msgid "These basic fields are always shown:"
2502 #: ../cat/virt-ls.pod:159
2507 #: ../cat/virt-ls.pod:161
2509 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2510 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2511 "link), C<s> (socket) or C<u> (unknown)."
2515 #: ../cat/virt-ls.pod:171
2520 #: ../cat/virt-ls.pod:173
2521 msgid "The Unix permissions, displayed as a 4 digit octal number."
2525 #: ../cat/virt-ls.pod:175
2530 #: ../cat/virt-ls.pod:177
2532 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
2533 "readable> option is given, in which case this is shown as a human-readable "
2538 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4263
2543 #: ../cat/virt-ls.pod:183
2544 msgid "The full path of the file or directory."
2548 #: ../cat/virt-ls.pod:185
2553 #: ../cat/virt-ls.pod:187
2554 msgid "For symbolic links only, the link target."
2558 #: ../cat/virt-ls.pod:191
2560 "In I<-lR> mode, additional command line options enable the display of more "
2565 #: ../cat/virt-ls.pod:194
2567 "With the I<--uids> flag, these additional fields are displayed before the "
2572 #: ../cat/virt-ls.pod:199
2577 #: ../cat/virt-ls.pod:201
2582 #: ../cat/virt-ls.pod:203
2584 "The UID and GID of the owner of the file (displayed numerically). Note "
2585 "these only make sense in the context of a Unix-like guest."
2589 #: ../cat/virt-ls.pod:208
2590 msgid "With the I<--times> flag, these additional fields are displayed:"
2594 #: ../cat/virt-ls.pod:212
2599 #: ../cat/virt-ls.pod:214
2600 msgid "The time of last access."
2604 #: ../cat/virt-ls.pod:216
2609 #: ../cat/virt-ls.pod:218
2610 msgid "The time of last modification."
2614 #: ../cat/virt-ls.pod:220
2619 #: ../cat/virt-ls.pod:222
2620 msgid "The time of last status change."
2624 #: ../cat/virt-ls.pod:226
2626 "The time fields are displayed as string dates and times, unless one of the "
2627 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2631 #: ../cat/virt-ls.pod:229
2632 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2636 #: ../cat/virt-ls.pod:233
2641 #: ../cat/virt-ls.pod:235
2643 "The device containing the file (displayed as major:minor). This may not "
2644 "match devices as known to the guest."
2648 #: ../cat/virt-ls.pod:238
2653 #: ../cat/virt-ls.pod:240
2654 msgid "The inode number."
2658 #: ../cat/virt-ls.pod:242
2663 #: ../cat/virt-ls.pod:244
2664 msgid "The number of hard links."
2668 #: ../cat/virt-ls.pod:246
2673 #: ../cat/virt-ls.pod:248
2675 "For block and char special files, the device (displayed as major:minor)."
2679 #: ../cat/virt-ls.pod:251
2684 #: ../cat/virt-ls.pod:253
2685 msgid "The number of 512 byte blocks allocated to the file."
2689 #: ../cat/virt-ls.pod:257
2691 "With the I<--checksum> flag, the checksum of the file contents is shown "
2692 "(only for regular files). Computing file checksums can take a considerable "
2697 #: ../cat/virt-ls.pod:280
2698 msgid "B<--checksum>"
2702 #: ../cat/virt-ls.pod:282
2703 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2707 #: ../cat/virt-ls.pod:284
2709 "Display checksum over file contents for regular files. With no argument, "
2710 "this defaults to using I<md5>. Using an argument, you can select the "
2711 "checksum type to use."
2715 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2716 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2717 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2719 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2724 #: ../cat/virt-ls.pod:316
2726 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2727 "so you cannot see what you are typing. If you are not worried about Tempest "
2728 "attacks and there is no one else in the room you can specify this flag to "
2729 "see what you are typing."
2733 #: ../cat/virt-ls.pod:321
2734 msgid "B<--extra-stats>"
2738 #: ../cat/virt-ls.pod:323
2739 msgid "Display extra stats."
2743 #: ../cat/virt-ls.pod:339
2746 " virt-ls --format=raw -a disk.img /dir\n"
2751 #: ../cat/virt-ls.pod:343
2754 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2759 #: ../cat/virt-ls.pod:356
2760 msgid "Display file sizes in human-readable format."
2764 #: ../cat/virt-ls.pod:370
2769 #: ../cat/virt-ls.pod:372
2770 msgid "B<--recursive>"
2774 #: ../cat/virt-ls.pod:374
2776 "Select the mode. With neither of these options, C<virt-ls> produces a "
2777 "simple, flat list of the files in the named directory. See L</SIMPLE "
2782 #: ../cat/virt-ls.pod:378
2784 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2789 #: ../cat/virt-ls.pod:381
2791 "C<virt-ls -R> produces a recursive list of files starting at the named "
2792 "directory. See L</RECURSIVE LISTING>."
2796 #: ../cat/virt-ls.pod:384
2798 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2799 "parsed. See L</RECURSIVE LONG LISTING>."
2803 #: ../cat/virt-ls.pod:387
2808 #: ../cat/virt-ls.pod:389
2809 msgid "Display time fields."
2813 #: ../cat/virt-ls.pod:394
2814 msgid "B<--time-days>"
2818 #: ../cat/virt-ls.pod:396
2819 msgid "Display time fields as days before now (negative if in the future)."
2823 #: ../cat/virt-ls.pod:398
2825 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2826 "of the file is between 0 and 86399 seconds."
2830 #: ../cat/virt-ls.pod:404
2831 msgid "B<--time-relative>"
2835 #: ../cat/virt-ls.pod:406
2836 msgid "Display time fields as seconds before now (negative if in the future)."
2840 #: ../cat/virt-ls.pod:411
2845 #: ../cat/virt-ls.pod:413
2846 msgid "Display time fields as seconds since the Unix epoch."
2850 #: ../cat/virt-ls.pod:418
2855 #: ../cat/virt-ls.pod:420
2856 msgid "Display UID and GID fields."
2860 #: ../cat/virt-ls.pod:445
2861 msgid "Previous versions of virt-ls allowed you to write either:"
2865 #: ../cat/virt-ls.pod:447
2868 " virt-ls disk.img [disk.img ...] /dir\n"
2873 #: ../cat/virt-ls.pod:451
2876 " virt-ls guestname /dir\n"
2881 #: ../cat/virt-ls.pod:497
2883 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2884 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2885 "L<http://libguestfs.org/>."
2889 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2890 #: ../rescue/virt-rescue.pod:302
2891 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2895 #: ../clone/virt-sysprep.pod:5
2897 "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2901 #: ../clone/virt-sysprep.pod:9
2904 " virt-sysprep [--options] -d domname\n"
2909 #: ../clone/virt-sysprep.pod:11
2912 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2917 #: ../clone/virt-sysprep.pod:15
2919 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2920 "can be made from it. Steps in this process include removing SSH host keys, "
2921 "removing persistent network MAC configuration, and removing user accounts. "
2922 "Each step can be enabled or disabled as required."
2926 #: ../clone/virt-sysprep.pod:21
2928 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2929 "customization by the system administrator."
2933 #: ../clone/virt-sysprep.pod:24
2935 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2936 "be shut down. If you want to preserve the existing contents of the guest, "
2937 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> below."
2941 #: ../clone/virt-sysprep.pod:29
2943 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2944 "recommend that you don't. The time you might want to run it as root is when "
2945 "you need root in order to access the disk image, but even in this case it "
2946 "would be better to change the permissions on the disk image to be writable "
2947 "as the non-root user running virt-sysprep."
2951 #: ../clone/virt-sysprep.pod:35
2953 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2954 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2955 "machines in preparation for cloning them. Having said that, virt-sysprep "
2956 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2957 "Windows sysprepping in a future version, and we already have code to do it."
2961 #: ../clone/virt-sysprep.pod:76
2962 msgid "B<--enable=...>"
2966 #: ../clone/virt-sysprep.pod:78
2968 "Choose which sysprep operations to perform. Give a comma-separated list of "
2969 "operations, for example:"
2973 #: ../clone/virt-sysprep.pod:81
2976 " --enable=ssh-hostkeys,udev-persistent-net\n"
2981 #: ../clone/virt-sysprep.pod:83
2983 "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2987 #: ../clone/virt-sysprep.pod:85
2989 "If the I<--enable> option is not given, then we default to trying all "
2990 "possible sysprep operations. But some sysprep operations are skipped for "
2995 #: ../clone/virt-sysprep.pod:89
2997 "Use I<--list-operations> to list operations supported by a particular "
2998 "version of virt-sysprep."
3002 #: ../clone/virt-sysprep.pod:92
3004 "See L</OPERATIONS> below for a list and an explanation of each operation."
3008 #: ../clone/virt-sysprep.pod:106
3011 " virt-sysprep --format=raw -a disk.img\n"
3016 #: ../clone/virt-sysprep.pod:110
3019 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
3024 #: ../clone/virt-sysprep.pod:119
3025 msgid "B<--hostname> newhostname"
3029 #: ../clone/virt-sysprep.pod:121
3031 "Change the hostname. See the L</hostname> operation below. If not given, "
3032 "defaults to C<localhost.localdomain>."
3036 #: ../clone/virt-sysprep.pod:124
3037 msgid "B<--list-operations>"
3041 #: ../clone/virt-sysprep.pod:126
3042 msgid "List the operations supported by the virt-sysprep program."
3046 #: ../clone/virt-sysprep.pod:128
3047 msgid "B<--selinux-relabel>"
3051 #: ../clone/virt-sysprep.pod:130
3052 msgid "B<--no-selinux-relabel>"
3056 #: ../clone/virt-sysprep.pod:132
3058 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
3059 "I<--no-selinux-relabel> disables relabelling."
3063 #: ../clone/virt-sysprep.pod:135
3065 "The default is to try to detect if SELinux relabelling is required. See L</"
3066 "SELINUX RELABELLING> below for more details."
3070 #: ../clone/virt-sysprep.pod:156
3075 #: ../clone/virt-sysprep.pod:158
3077 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
3078 "enabled>, although some are skipped depending on the type of guest."
3082 #: ../clone/virt-sysprep.pod:162
3084 "Operations can be individually enabled using the I<--enable> option. Use a "
3085 "comma-separated list, for example:"
3089 #: ../clone/virt-sysprep.pod:165
3092 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
3097 #: ../clone/virt-sysprep.pod:167
3099 "To list the operations supported by the current version of virt-sysprep, use "
3100 "I<--list-operations>."
3104 #: ../clone/virt-sysprep.pod:170
3106 "Future versions of virt-sysprep may add more operations. If you are using "
3107 "virt-sysprep and want predictable behaviour, specify only the operations "
3108 "that you want to have enabled."
3112 #: ../clone/virt-sysprep.pod:174
3117 #: ../clone/virt-sysprep.pod:176
3118 msgid "Remove user at-jobs and cron-jobs."
3122 #: ../clone/virt-sysprep.pod:178
3123 msgid "dhcp-client-state"
3127 #: ../clone/virt-sysprep.pod:180
3128 msgid "Remove DHCP client leases."
3132 #: ../clone/virt-sysprep.pod:182
3133 msgid "dhcp-server-state"
3137 #: ../clone/virt-sysprep.pod:184
3138 msgid "Remove DHCP server leases."
3142 #: ../clone/virt-sysprep.pod:186
3147 #: ../clone/virt-sysprep.pod:188
3149 "Changes the hostname of the guest to the value given in the I<--hostname> "
3154 #: ../clone/virt-sysprep.pod:191
3156 "If the I<--hostname> parameter is not given, then the hostname is changed to "
3157 "C<localhost.localdomain>."
3161 #: ../clone/virt-sysprep.pod:194
3166 #: ../clone/virt-sysprep.pod:196
3167 msgid "Remove many log files."
3171 #: ../clone/virt-sysprep.pod:198
3176 #: ../clone/virt-sysprep.pod:200
3177 msgid "Remove email from the local mail spool directory."
3181 #: ../clone/virt-sysprep.pod:202
3186 #: ../clone/virt-sysprep.pod:204
3188 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
3189 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
3193 #: ../clone/virt-sysprep.pod:207
3198 #: ../clone/virt-sysprep.pod:209
3200 "Write some random bytes from the host into the random seed file of the guest."
3204 #: ../clone/virt-sysprep.pod:212
3205 msgid "See L</RANDOM SEED> below."
3209 #: ../clone/virt-sysprep.pod:214
3210 msgid "rhn-systemid"
3214 #: ../clone/virt-sysprep.pod:216
3215 msgid "Remove the RHN system ID."
3219 #: ../clone/virt-sysprep.pod:218
3224 #: ../clone/virt-sysprep.pod:220
3225 msgid "Remove the Smolt hardware UUID."
3229 #: ../clone/virt-sysprep.pod:222
3230 msgid "ssh-hostkeys"
3234 #: ../clone/virt-sysprep.pod:224
3235 msgid "Remove the SSH host keys in the guest."
3239 #: ../clone/virt-sysprep.pod:226
3241 "The SSH host keys are regenerated (differently) next time the guest is "
3246 #: ../clone/virt-sysprep.pod:229
3248 "If, after cloning, the guest gets the same IP address, ssh will give you a "
3249 "stark warning about the host key changing:"
3253 #: ../clone/virt-sysprep.pod:232
3256 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3257 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
3258 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3259 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
3264 #: ../clone/virt-sysprep.pod:237
3265 msgid "udev-persistent-net"
3269 #: ../clone/virt-sysprep.pod:239
3271 "Remove udev persistent net rules which map the guest's existing MAC address "
3272 "to a fixed ethernet device (eg. eth0)."
3276 #: ../clone/virt-sysprep.pod:242
3278 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
3279 "address occupies the old name (eg. eth0), this means the fresh MAC address "
3280 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
3281 "Erasing the udev persistent net rules avoids this."
3285 #: ../clone/virt-sysprep.pod:247
3290 #: ../clone/virt-sysprep.pod:249
3291 msgid "Remove the utmp file."
3295 #: ../clone/virt-sysprep.pod:251
3297 "This records who is currently logged in on a machine. In modern Linux "
3298 "distros it is stored in a ramdisk and hence not part of the virtual "
3299 "machine's disk, but it was stored on disk in older distros."
3303 #: ../clone/virt-sysprep.pod:255
3308 #: ../clone/virt-sysprep.pod:257
3309 msgid "Remove the yum UUID."
3313 #: ../clone/virt-sysprep.pod:259
3315 "Yum creates a fresh UUID the next time it runs when it notices that the "
3316 "original UUID has been erased."
3320 #: ../clone/virt-sysprep.pod:262
3321 msgid "COPYING AND CLONING"
3325 #: ../clone/virt-sysprep.pod:264
3327 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3328 "prepare a template from which guests can be cloned. There are many "
3329 "different ways to achieve this using the virt tools, and this section is "
3330 "just an introduction."
3334 #: ../clone/virt-sysprep.pod:269
3335 msgid "A virtual machine (when switched off) consists of two parts:"
3339 #: ../clone/virt-sysprep.pod:273
3340 msgid "I<configuration>"
3344 #: ../clone/virt-sysprep.pod:275
3346 "The configuration or description of the guest. eg. The libvirt XML (see "
3347 "C<virsh dumpxml>), the running configuration of the guest, or another "
3348 "external format like OVF."
3352 #: ../clone/virt-sysprep.pod:279
3353 msgid "Some configuration items that might need to be changed:"
3357 #: ../clone/virt-sysprep.pod:285
3362 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3367 #: ../clone/virt-sysprep.pod:293
3368 msgid "path to block device(s)"
3372 #: ../clone/virt-sysprep.pod:297
3373 msgid "network card MAC address"
3377 #: ../clone/virt-sysprep.pod:301
3378 msgid "I<block device(s)>"
3382 #: ../clone/virt-sysprep.pod:303
3384 "One or more hard disk images, themselves containing files, directories, "
3385 "applications, kernels, configuration, etc."
3389 #: ../clone/virt-sysprep.pod:306
3390 msgid "Some things inside the block devices that might need to be changed:"
3394 #: ../clone/virt-sysprep.pod:312
3395 msgid "hostname and other net configuration"
3399 #: ../clone/virt-sysprep.pod:320
3400 msgid "SSH host keys"
3404 #: ../clone/virt-sysprep.pod:324
3405 msgid "Windows unique security ID (SID)"
3409 #: ../clone/virt-sysprep.pod:328
3410 msgid "Puppet registration"
3414 #: ../clone/virt-sysprep.pod:334
3415 msgid "COPYING THE BLOCK DEVICE"
3419 #: ../clone/virt-sysprep.pod:336
3421 "Starting with an original guest, you probably wish to copy the guest block "
3422 "device and its configuration to make a template. Then once you are happy "
3423 "with the template, you will want to make many clones from it."
3427 #: ../clone/virt-sysprep.pod:341
3433 " original guest --------> template ---------->\n"
3434 " \\------> cloned\n"
3435 " \\-----> guests\n"
3441 #: ../clone/virt-sysprep.pod:349
3443 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3448 #: ../clone/virt-sysprep.pod:352
3452 " original guest --------> template ---------->\n"
3453 " \\------> cloned\n"
3454 " \\-----> guests\n"
3460 #: ../clone/virt-sysprep.pod:358
3461 msgid "There are some smarter (and faster) ways too:"
3465 #: ../clone/virt-sysprep.pod:364
3469 " template ---------->\n"
3470 " \\------> cloned\n"
3471 " \\-----> guests\n"
3477 #: ../clone/virt-sysprep.pod:370
3479 "Use the block device as a backing file and create a snapshot on top for each "
3480 "guest. The advantage is that you don't need to copy the block device (very "
3481 "fast) and only changes are stored (less storage required)."
3485 #: ../clone/virt-sysprep.pod:375
3487 "Note that writing to the backing file once you have created guests on top of "
3488 "it is not possible: you will corrupt the guests."
3492 #: ../clone/virt-sysprep.pod:378
3494 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 -"
3495 "o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3496 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3497 "also create cheap snapshots from files or LUNs."
3501 #: ../clone/virt-sysprep.pod:386
3502 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3506 #: ../clone/virt-sysprep.pod:390
3507 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3511 #: ../clone/virt-sysprep.pod:394
3516 #: ../clone/virt-sysprep.pod:396
3518 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3519 "and/or modify the external libvirt configuration of a guest. It will reset "
3520 "the name, UUID and MAC address of the guest in the libvirt XML."
3524 #: ../clone/virt-sysprep.pod:401
3526 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3527 "image. This was the original motivation to write virt-sysprep."
3531 #: ../clone/virt-sysprep.pod:404
3536 #: ../clone/virt-sysprep.pod:406
3540 " original guest --------> template\n"
3545 #: ../clone/virt-sysprep.pod:409
3547 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3548 "it easier to compress and/or faster to copy."
3552 #: ../clone/virt-sysprep.pod:412
3554 "Notice that since virt-sparsify also copies the image, you can use it to "
3555 "make the initial copy (instead of C<dd>)."
3559 #: ../clone/virt-sysprep.pod:415
3564 #: ../clone/virt-sysprep.pod:417
3568 " template ---------->\n"
3569 " \\------> cloned\n"
3570 " \\-----> guests\n"
3576 #: ../clone/virt-sysprep.pod:423
3578 "If you want to give people cloned guests, but let them pick the size of the "
3579 "guest themselves (eg. depending on how much they are prepared to pay for "
3580 "disk space), then instead of copying the template, you can run L<virt-resize"
3581 "(1)>. Virt-resize performs a copy and resize, and thus is ideal for cloning "
3582 "guests from a template."
3586 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1149
3591 #: ../clone/virt-sysprep.pod:431
3593 "Although virt-sysprep removes some sensitive information from the guest, it "
3594 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3595 "above, and the implementation of the operations in the shell script. You "
3596 "should also examine the guest afterwards."
3600 #: ../clone/virt-sysprep.pod:436
3602 "Sensitive files are simply removed. The data they contained may still exist "
3603 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3604 "L<virt-sparsify(1)> as one way to remove this content. See also the L<scrub"
3605 "(1)> command to get rid of deleted content in directory entries and inodes."
3609 #: ../clone/virt-sysprep.pod:442
3614 #: ../clone/virt-sysprep.pod:444
3615 msgid "I<(This section applies to Linux guests only)>"
3619 #: ../clone/virt-sysprep.pod:446
3621 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3622 "from the host into the guest's random seed file."
3626 #: ../clone/virt-sysprep.pod:449
3628 "If this is just done once and the guest is cloned from the same template, "
3629 "then each guest will start with the same entropy, and things like SSH host "
3630 "keys and TCP sequence numbers may be predictable."
3634 #: ../clone/virt-sysprep.pod:453
3636 "Therefore you should arrange to add more randomness I<after> cloning from a "
3637 "template too, which can be done by just enabling the C<random-seed> "
3642 #: ../clone/virt-sysprep.pod:457
3645 " cp template.img newguest.img\n"
3646 " virt-sysprep --enable=random-seed -a newguest.img\n"
3651 #: ../clone/virt-sysprep.pod:460
3652 msgid "SELINUX RELABELLING"
3656 #: ../clone/virt-sysprep.pod:462
3657 msgid "I<(This section applies to Linux guests using SELinux only)>"
3661 #: ../clone/virt-sysprep.pod:464
3663 "If any new files are created by virt-sysprep, then virt-sysprep touches C</."
3664 "autorelabel> so that these will be correctly labelled by SELinux the next "
3665 "time the guest is booted. This process interrupts boot and can take some "
3670 #: ../clone/virt-sysprep.pod:469
3672 "You can force relabelling for all guests by supplying the I<--selinux-"
3677 #: ../clone/virt-sysprep.pod:472
3679 "You can disable relabelling entirely by supplying the I<--no-selinux-"
3684 #: ../clone/virt-sysprep.pod:484
3685 msgid "This program returns 0 on success, or 1 if there was an error."
3689 #: ../clone/virt-sysprep.pod:488
3691 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, L<virt-"
3692 "resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, L<qemu-img(1)"
3693 ">, L<scrub(1)>, L<http://libguestfs.org/>, L<http://libvirt.org/>."
3697 #: ../df/virt-df.pod:5
3698 msgid "virt-df - Display free space on virtual filesystems"
3702 #: ../df/virt-df.pod:9
3705 " virt-df [--options]\n"
3710 #: ../df/virt-df.pod:11
3713 " virt-df [--options] -d domname\n"
3718 #: ../df/virt-df.pod:13
3721 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3726 #: ../df/virt-df.pod:17
3729 " virt-df [--options] domname\n"
3734 #: ../df/virt-df.pod:19
3737 " virt-df [--options] disk.img [disk.img ...]\n"
3742 #: ../df/virt-df.pod:23
3744 "C<virt-df> is a command line tool to display free space on virtual machine "
3745 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3746 "allocated to a virtual machine, but can look inside disk images to see how "
3747 "much space is really being used."
3751 #: ../df/virt-df.pod:28
3753 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3754 "to get a list of all active and inactive guests, and performs a C<df>-type "
3755 "operation on each one in turn, printing out the results."
3759 #: ../df/virt-df.pod:32
3761 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
3762 "type operation on either the single named libvirt domain, or on the disk "
3763 "image(s) listed on the command line (which must all belong to a single VM). "
3764 "In this mode (with arguments), C<virt-df> will I<only work for a single "
3765 "guest>. If you want to run on multiple guests, then you have to invoke "
3766 "C<virt-df> multiple times."
3770 #: ../df/virt-df.pod:39
3772 "Use the I<--csv> option to get a format which can be easily parsed by other "
3773 "programs. Other options are similar to the standard L<df(1)> command."
3777 #: ../df/virt-df.pod:45
3779 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3780 "output human-readable:"
3784 #: ../df/virt-df.pod:48
3787 " # virt-df -d F14x64 -h\n"
3788 " Filesystem Size Used Available Use%\n"
3789 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3790 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3795 #: ../df/virt-df.pod:53
3796 msgid "Show disk usage for a disk image file called C<test.img>:"
3800 #: ../df/virt-df.pod:55
3803 " $ virt-df -a test1.img\n"
3804 " Filesystem 1K-blocks Used Available Use%\n"
3805 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3810 #: ../df/virt-df.pod:112
3813 " virt-df --format=raw -a disk.img\n"
3818 #: ../df/virt-df.pod:116
3821 " virt-df --format=raw -a disk.img --format -a another.img\n"
3826 #: ../df/virt-df.pod:129
3827 msgid "Print sizes in human-readable format."
3831 #: ../df/virt-df.pod:131
3832 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3836 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3841 #: ../df/virt-df.pod:135
3846 #: ../df/virt-df.pod:137
3847 msgid "Print inodes instead of blocks."
3851 #: ../df/virt-df.pod:139
3852 msgid "B<--one-per-guest>"
3856 #: ../df/virt-df.pod:141
3858 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3859 "disks from several guests to a single libguestfs appliance."
3863 #: ../df/virt-df.pod:144
3864 msgid "You might use this option in the following circumstances:"
3868 #: ../df/virt-df.pod:150
3870 "If you think an untrusted guest might actively try to exploit the libguestfs "
3871 "appliance kernel, then this prevents one guest from interfering with the "
3872 "stats printed for another guest."
3876 #: ../df/virt-df.pod:156
3878 "If the kernel has a bug which stops it from accessing a filesystem in one "
3879 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3880 "and report stats for further guests."
3884 #: ../df/virt-df.pod:165
3886 "Print UUIDs instead of names. This is useful for following a guest even "
3887 "when the guest is migrated or renamed, or when two guests happen to have the "
3892 #: ../df/virt-df.pod:169
3894 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3895 "images, we still print the disk image name even when this option is "
3900 #: ../df/virt-df.pod:229
3902 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
3907 #: ../edit/virt-edit.pod:5
3908 msgid "virt-edit - Edit a file in a virtual machine"
3912 #: ../edit/virt-edit.pod:9
3915 " virt-edit [--options] -d domname file [file ...]\n"
3920 #: ../edit/virt-edit.pod:11
3923 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3928 #: ../edit/virt-edit.pod:13
3931 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3936 #: ../edit/virt-edit.pod:17
3939 " virt-edit domname file\n"
3944 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3947 " virt-edit disk.img [disk.img ...] file\n"
3952 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
3953 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
3954 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
3955 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3960 #: ../edit/virt-edit.pod:23
3962 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3963 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3964 "doing this, but doesn't catch all cases."
3968 #: ../edit/virt-edit.pod:29
3970 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3971 "exists in the named virtual machine (or disk image)."
3975 #: ../edit/virt-edit.pod:32
3977 "Multiple filenames can be given, in which case they are each edited in "
3978 "turn. Each filename must be a full path, starting at the root directory "
3979 "(starting with '/')."
3983 #: ../edit/virt-edit.pod:36
3984 msgid "If you want to just view a file, use L<virt-cat(1)>."
3988 #: ../edit/virt-edit.pod:38
3990 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
3991 "USING GUESTFISH> below)."
3995 #: ../edit/virt-edit.pod:41
3997 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3998 "that and much more."
4002 #: ../edit/virt-edit.pod:46
4003 msgid "Edit the named files interactively:"
4007 #: ../edit/virt-edit.pod:48
4010 " virt-edit -d mydomain /boot/grub/grub.conf\n"
4015 #: ../edit/virt-edit.pod:50
4018 " virt-edit -d mydomain /etc/passwd\n"
4023 #: ../edit/virt-edit.pod:52
4024 msgid "For Windows guests, some Windows paths are understood:"
4028 #: ../edit/virt-edit.pod:54
4031 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
4036 #: ../edit/virt-edit.pod:56
4038 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
4039 "INTERACTIVE EDITING> below). To change the init default level to 5:"
4043 #: ../edit/virt-edit.pod:60
4046 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
4051 #: ../edit/virt-edit.pod:81
4052 msgid "B<-b> extension"
4056 #: ../edit/virt-edit.pod:83
4057 msgid "B<--backup> extension"
4061 #: ../edit/virt-edit.pod:85
4063 "Create a backup of the original file I<in the guest disk image>. The backup "
4064 "has the original filename with C<extension> added."
4068 #: ../edit/virt-edit.pod:88
4070 "Usually the first character of C<extension> would be a dot C<.> so you would "
4075 #: ../edit/virt-edit.pod:91
4078 " virt-edit -b .orig [etc]\n"
4083 #: ../edit/virt-edit.pod:93
4084 msgid "By default, no backup file is made."
4088 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
4089 #: ../fuse/guestmount.pod:105 ../inspector/virt-inspector.pod:74
4090 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
4091 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
4096 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
4097 #: ../fuse/guestmount.pod:107 ../inspector/virt-inspector.pod:76
4098 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
4099 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
4100 msgid "B<--connect URI>"
4104 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
4105 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
4106 #: ../tools/virt-win-reg.pl:135
4108 "If you specify guest block devices directly, then libvirt is not used at all."
4112 #: ../edit/virt-edit.pod:114
4114 "When prompting for keys and passphrases, virt-edit normally turns echoing "
4115 "off so you cannot see what you are typing. If you are not worried about "
4116 "Tempest attacks and there is no one else in the room you can specify this "
4117 "flag to see what you are typing."
4121 #: ../edit/virt-edit.pod:119
4126 #: ../edit/virt-edit.pod:121
4127 msgid "B<--expr> EXPR"
4131 #: ../edit/virt-edit.pod:123
4133 "Instead of launching the external editor, non-interactively apply the Perl "
4134 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
4139 #: ../edit/virt-edit.pod:127
4141 "Be careful to properly quote the expression to prevent it from being altered "
4146 #: ../edit/virt-edit.pod:130
4147 msgid "Note that this option is only available when Perl 5 is installed."
4151 #: ../edit/virt-edit.pod:132
4152 msgid "B<--format> raw|qcow2|..."
4156 #: ../edit/virt-edit.pod:143
4159 " virt-edit --format=raw -a disk.img file\n"
4164 #: ../edit/virt-edit.pod:147
4167 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
4172 #: ../edit/virt-edit.pod:181
4173 msgid "Previous versions of virt-edit allowed you to write either:"
4177 #: ../edit/virt-edit.pod:187
4180 " virt-edit guestname file\n"
4185 #: ../edit/virt-edit.pod:195
4186 msgid "NON-INTERACTIVE EDITING"
4190 #: ../edit/virt-edit.pod:197
4192 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
4193 "administrator can interactively edit the file."
4197 #: ../edit/virt-edit.pod:200
4199 "There are two ways also to use C<virt-edit> from scripts in order to make "
4200 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
4201 "like this, it's less error-prone to write scripts directly using the "
4202 "libguestfs API and Augeas for configuration file editing.)"
4206 #: ../edit/virt-edit.pod:206
4208 "The first method is to temporarily set C<$EDITOR> to any script or program "
4209 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
4210 "update C<tmpfile> in place however it likes."
4214 #: ../edit/virt-edit.pod:210
4216 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
4217 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
4218 "instances of C<foo> with C<bar> in a file:"
4222 #: ../edit/virt-edit.pod:214
4225 " virt-edit -d domname filename -e 's/foo/bar/'\n"
4230 #: ../edit/virt-edit.pod:216
4232 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
4233 "For example to delete root's password you could do:"
4237 #: ../edit/virt-edit.pod:219
4240 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
4245 #: ../edit/virt-edit.pod:221
4247 "What really happens is that the snippet is evaluated as a Perl expression "
4248 "for each line of the file. The line, including the final C<\\n>, is passed "
4249 "in C<$_> and the expression should update C<$_> or leave it unchanged."
4253 #: ../edit/virt-edit.pod:226
4255 "To delete a line, set C<$_> to the empty string. For example, to delete the "
4256 "C<apache> user account from the password file you can do:"
4260 #: ../edit/virt-edit.pod:229
4263 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
4268 #: ../edit/virt-edit.pod:231
4270 "To insert a line, prepend or append it to C<$_>. However appending lines to "
4271 "the end of the file is rather difficult this way since there is no concept "
4272 "of \"last line of the file\" - your expression just doesn't get called "
4273 "again. You might want to use the first method (setting C<$EDITOR>) if you "
4278 #: ../edit/virt-edit.pod:237
4280 "The variable C<$lineno> contains the current line number. As is "
4281 "traditional, the first line in the file is number C<1>."
4285 #: ../edit/virt-edit.pod:240
4287 "The return value from the expression is ignored, but the expression may call "
4288 "C<die> in order to abort the whole program, leaving the original file "
4293 #: ../edit/virt-edit.pod:244
4295 "Remember when matching the end of a line that C<$_> may contain the final C<"
4296 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
4297 "newline then neither of these. Thus to match or substitute some text at the "
4298 "end of a line, use this regular expression:"
4302 #: ../edit/virt-edit.pod:249
4305 " /some text(\\r?\\n)?$/\n"
4310 #: ../edit/virt-edit.pod:251
4312 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
4313 "$_> itself (since that would remove all newlines from the file):"
4317 #: ../edit/virt-edit.pod:255
4320 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4325 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
4326 msgid "WINDOWS PATHS"
4330 #: ../edit/virt-edit.pod:259
4332 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4333 "paths (eg. C<E:\\foo\\bar.txt>)."
4337 #: ../edit/virt-edit.pod:262
4338 msgid "If and only if the guest is running Windows then:"
4342 #: ../edit/virt-edit.pod:268
4344 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
4345 "to the correct filesystem."
4349 #: ../edit/virt-edit.pod:273
4351 "Any backslash (C<\\>) characters in the path are replaced with forward "
4352 "slashes so that libguestfs can process it."
4356 #: ../edit/virt-edit.pod:278
4358 "The path is resolved case insensitively to locate the file that should be "
4363 #: ../edit/virt-edit.pod:283
4364 msgid "There are some known shortcomings:"
4368 #: ../edit/virt-edit.pod:289
4369 msgid "Some NTFS symbolic links may not be followed correctly."
4373 #: ../edit/virt-edit.pod:293
4374 msgid "NTFS junction points that cross filesystems are not followed."
4378 #: ../edit/virt-edit.pod:299
4380 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4381 "C<virt-edit> doesn't work."
4385 #: ../edit/virt-edit.pod:302
4386 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4390 #: ../edit/virt-edit.pod:304
4393 " guestfish --rw -i -d domname edit /file\n"
4398 #: ../edit/virt-edit.pod:306
4400 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4405 #: ../edit/virt-edit.pod:309
4407 "The command above uses libguestfs's guest inspection feature and so does not "
4408 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4409 "disk images that don't contain guests. To edit a file on a disk image "
4414 #: ../edit/virt-edit.pod:314
4417 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4422 #: ../edit/virt-edit.pod:316
4424 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4425 "the disk image to edit, and C</file> is the full path to the file."
4429 #: ../edit/virt-edit.pod:320
4431 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4432 "C<write> or C<upload> instead:"
4436 #: ../edit/virt-edit.pod:323
4439 " guestfish --rw -i -d domname touch /newfile\n"
4444 #: ../edit/virt-edit.pod:325
4447 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4452 #: ../edit/virt-edit.pod:327
4455 " guestfish --rw -i -d domname upload localfile /newfile\n"
4460 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119
4461 #: ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232
4462 #: ../src/guestfs.pod:3194 ../test-tool/libguestfs-test-tool.pod:95
4463 msgid "ENVIRONMENT VARIABLES"
4467 #: ../edit/virt-edit.pod:333
4472 #: ../edit/virt-edit.pod:335
4474 "If set, this string is used as the editor. It may contain arguments, eg. C<"
4479 #: ../edit/virt-edit.pod:338
4480 msgid "If not set, C<vi> is used."
4484 #: ../edit/virt-edit.pod:356
4486 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
4487 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
4488 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4492 #: ../erlang/examples/guestfs-erlang.pod:5
4493 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4497 #: ../erlang/examples/guestfs-erlang.pod:9
4500 " {ok, G} = guestfs:create(),\n"
4501 " ok = guestfs:add_drive_opts(G, Disk,\n"
4502 " [{format, \"raw\"}, {readonly, true}]),\n"
4503 " ok = guestfs:launch(G),\n"
4504 " [Device] = guestfs:list_devices(G),\n"
4505 " ok = guestfs:close(G).\n"
4510 #: ../erlang/examples/guestfs-erlang.pod:18
4512 "This manual page documents how to call libguestfs from the Erlang "
4513 "programming language. This page just documents the differences from the C "
4514 "API and gives some examples. If you are not familiar with using libguestfs, "
4515 "you also need to read L<guestfs(3)>."
4519 #: ../erlang/examples/guestfs-erlang.pod:23
4520 msgid "OPENING AND CLOSING THE HANDLE"
4524 #: ../erlang/examples/guestfs-erlang.pod:25
4526 "The Erlang bindings are implemented using an external program called C<erl-"
4527 "guestfs>. This program must be on the current PATH, or else you should "
4528 "specify the full path to the program:"
4532 #: ../erlang/examples/guestfs-erlang.pod:29
4535 " {ok, G} = guestfs:create().\n"
4540 #: ../erlang/examples/guestfs-erlang.pod:31
4543 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4548 #: ../erlang/examples/guestfs-erlang.pod:33
4549 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4553 #: ../erlang/examples/guestfs-erlang.pod:36
4554 msgid "To close the handle:"
4558 #: ../erlang/examples/guestfs-erlang.pod:38
4561 " ok = guestfs:close(G).\n"
4566 #: ../erlang/examples/guestfs-erlang.pod:40
4567 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4571 #: ../erlang/examples/guestfs-erlang.pod:42
4573 "For functions that take optional arguments, the first arguments are the non-"
4574 "optional ones. The last argument is a list of tuples supplying the "
4575 "remaining optional arguments."
4579 #: ../erlang/examples/guestfs-erlang.pod:46
4582 " ok = guestfs:add_drive_opts(G, Disk,\n"
4583 " [{format, \"raw\"}, {readonly, true}]).\n"
4588 #: ../erlang/examples/guestfs-erlang.pod:49
4589 msgid "If the last argument would be an empty list, you can also omit it:"
4593 #: ../erlang/examples/guestfs-erlang.pod:51
4596 " ok = guestfs:add_drive_opts(G, Disk).\n"
4601 #: ../erlang/examples/guestfs-erlang.pod:53
4602 msgid "RETURN VALUES AND ERRORS"
4606 #: ../erlang/examples/guestfs-erlang.pod:55
4608 "On success, most functions return a C<Result> term (which could be a list, "
4609 "string, tuple etc.). If there is nothing for the function to return, then "
4610 "the atom C<ok> is returned."
4614 #: ../erlang/examples/guestfs-erlang.pod:59
4615 msgid "On error, you would see one of the following tuples:"
4619 #: ../erlang/examples/guestfs-erlang.pod:63
4620 msgid "C<{error, Msg, Errno}>"
4624 #: ../erlang/examples/guestfs-erlang.pod:65
4625 msgid "This indicates an ordinary error from the function."
4629 #: ../erlang/examples/guestfs-erlang.pod:67
4631 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4636 #: ../erlang/examples/guestfs-erlang.pod:70
4637 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4641 #: ../erlang/examples/guestfs-erlang.pod:72
4642 msgid "C<{unknown, Function}>"
4646 #: ../erlang/examples/guestfs-erlang.pod:74
4648 "This indicates that the function you called is not known. Generally this "
4649 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4650 "which you should not do."
4654 #: ../erlang/examples/guestfs-erlang.pod:78
4655 msgid "C<Function> is the name of the unknown function."
4659 #: ../erlang/examples/guestfs-erlang.pod:80
4660 msgid "C<{unknownarg, Arg}>"
4664 #: ../erlang/examples/guestfs-erlang.pod:82
4666 "This indicates that you called a function with optional arguments, with an "
4667 "unknown argument name."
4671 #: ../erlang/examples/guestfs-erlang.pod:85
4672 msgid "C<Arg> is the name of the unknown argument."
4676 #: ../erlang/examples/guestfs-erlang.pod:89
4677 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
4678 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
4679 #: ../python/examples/guestfs-python.pod:34
4680 #: ../ruby/examples/guestfs-ruby.pod:28
4681 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4685 #: ../erlang/examples/guestfs-erlang.pod:91
4686 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
4687 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
4688 #: ../python/examples/guestfs-python.pod:36
4689 #: ../ruby/examples/guestfs-ruby.pod:30
4694 #: ../erlang/examples/guestfs-erlang.pod:93
4695 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
4696 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
4697 #: ../python/examples/guestfs-python.pod:38
4698 #: ../ruby/examples/guestfs-ruby.pod:32
4699 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4703 #: ../erlang/examples/guestfs-erlang.pod:95
4704 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
4705 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
4706 #: ../python/examples/guestfs-python.pod:40
4707 #: ../ruby/examples/guestfs-ruby.pod:34
4712 #: ../erlang/examples/guestfs-erlang.pod:99
4714 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4715 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4716 "L<guestfs-ruby(3)>, L<http://www.erlang.org/>. L<http://libguestfs.org/>."
4720 #: ../erlang/examples/guestfs-erlang.pod:110
4721 #: ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397
4722 #: ../fish/guestfish.pod:1296 ../fish/virt-copy-in.pod:60
4723 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
4724 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:328
4725 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58
4726 #: ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52
4727 #: ../python/examples/guestfs-python.pod:54
4728 #: ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3333
4729 #: ../test-tool/libguestfs-test-tool.pod:106
4734 #: ../erlang/examples/guestfs-erlang.pod:112
4735 #: ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399
4736 #: ../fish/guestfish.pod:1298 ../fish/virt-copy-in.pod:62
4737 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
4738 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:330
4739 #: ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93
4740 #: ../perl/examples/guestfs-perl.pod:54
4741 #: ../python/examples/guestfs-python.pod:56
4742 #: ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3335
4743 #: ../test-tool/libguestfs-test-tool.pod:108
4744 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4748 #: ../erlang/examples/guestfs-erlang.pod:116
4749 #: ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4750 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4754 #: ../erlang/examples/guestfs-erlang.pod:118
4755 #: ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405
4756 #: ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99
4757 #: ../perl/examples/guestfs-perl.pod:60
4758 #: ../python/examples/guestfs-python.pod:62
4759 #: ../ruby/examples/guestfs-ruby.pod:56
4761 "The examples in this manual page may be freely copied, modified and "
4762 "distributed without any restrictions."
4766 #: ../erlang/examples/guestfs-erlang.pod:121
4767 #: ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408
4768 #: ../java/examples/guestfs-java.pod:69
4769 #: ../ocaml/examples/guestfs-ocaml.pod:102
4770 #: ../perl/examples/guestfs-perl.pod:63
4771 #: ../python/examples/guestfs-python.pod:65
4772 #: ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3342
4774 "This library is free software; you can redistribute it and/or modify it "
4775 "under the terms of the GNU Lesser General Public License as published by the "
4776 "Free Software Foundation; either version 2 of the License, or (at your "
4777 "option) any later version."
4781 #: ../erlang/examples/guestfs-erlang.pod:126
4782 #: ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413
4783 #: ../java/examples/guestfs-java.pod:74
4784 #: ../ocaml/examples/guestfs-ocaml.pod:107
4785 #: ../perl/examples/guestfs-perl.pod:68
4786 #: ../python/examples/guestfs-python.pod:70
4787 #: ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3347
4789 "This library is distributed in the hope that it will be useful, but WITHOUT "
4790 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4791 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4796 #: ../erlang/examples/guestfs-erlang.pod:131
4797 #: ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418
4798 #: ../java/examples/guestfs-java.pod:79
4799 #: ../ocaml/examples/guestfs-ocaml.pod:112
4800 #: ../perl/examples/guestfs-perl.pod:73
4801 #: ../python/examples/guestfs-python.pod:75
4802 #: ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3352
4804 "You should have received a copy of the GNU Lesser General Public License "
4805 "along with this library; if not, write to the Free Software Foundation, "
4806 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4810 #: ../examples/guestfs-examples.pod:5
4811 msgid "guestfs-examples - Examples of using libguestfs from C"
4815 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4818 " #include <guestfs.h>\n"
4820 msgstr "#include <guestfs.h>\n"
4823 #: ../examples/guestfs-examples.pod:11
4826 " guestfs_h *g = guestfs_create ();\n"
4827 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4828 " guestfs_launch (g);\n"
4833 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4836 " cc prog.c -o prog -lguestfs\n"
4838 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4841 " cc prog.c -o prog -lguestfs\n"
4843 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4847 #: ../examples/guestfs-examples.pod:21
4849 "This manual page contains examples of calling libguestfs from the C "
4850 "programming language. If you are not familiar with using libguestfs, you "
4851 "also need to read L<guestfs(3)>."
4855 #: ../examples/guestfs-examples.pod:35
4857 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4858 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4859 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4863 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97
4864 #: ../python/examples/guestfs-python.pod:60
4865 #: ../ruby/examples/guestfs-ruby.pod:54
4866 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4870 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4875 #: ../examples/guestfs-recipes.pod:5
4877 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4878 "here. The only way which works for both sorts of output is to just write "
4879 "the URL directly. Do NOT use L<...> for URLs."
4883 #: ../examples/guestfs-recipes.pod:9
4885 "We break with tradition here and don't use ALL CAPS for the section "
4886 "headings, as this makes them much easier to read."
4890 #: ../examples/guestfs-recipes.pod:16
4891 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4895 #: ../examples/guestfs-recipes.pod:20
4897 "This page contains recipes for and links to things you can do using "
4898 "libguestfs, L<guestfish(1)> and the virt tools."
4902 #: ../examples/guestfs-recipes.pod:23
4903 msgid "Audit a virtual machine for setuid files"
4907 #: ../examples/guestfs-recipes.pod:25
4909 "The link below contains a small program which can be used to audit a Linux "
4910 "virtual machine to see what setuid and setgid files it contains."
4914 #: ../examples/guestfs-recipes.pod:28
4916 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
4921 #: ../examples/guestfs-recipes.pod:30
4922 msgid "Change the background image in a Windows XP VM"
4926 #: ../examples/guestfs-recipes.pod:32
4928 "The links below explain how to use L<guestfish(1)> to change the background "
4929 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4930 "be substantially different for each version of Windows."
4934 #: ../examples/guestfs-recipes.pod:37
4936 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
4937 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4941 #: ../examples/guestfs-recipes.pod:40
4942 msgid "Cloning a virtual machine (Linux)"
4946 #: ../examples/guestfs-recipes.pod:42
4948 "The guestfish technique described in the link below works well for most "
4949 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4954 #: ../examples/guestfs-recipes.pod:46
4956 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
4961 #: ../examples/guestfs-recipes.pod:48
4963 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4968 #: ../examples/guestfs-recipes.pod:51
4969 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4973 #: ../examples/guestfs-recipes.pod:53
4974 msgid "Cloning a virtual machine (Windows)"
4978 #: ../examples/guestfs-recipes.pod:55
4980 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4981 "straightforward. Currently there is code in the Aeolus Oz project which "
4982 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4983 "we may add sysprepping ability."
4987 #: ../examples/guestfs-recipes.pod:60
4989 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
4990 "list/2011-May/msg00019.html"
4994 #: ../examples/guestfs-recipes.pod:63
4995 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4999 #: ../examples/guestfs-recipes.pod:65
5000 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
5004 #: ../examples/guestfs-recipes.pod:67
5007 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
5012 #: ../examples/guestfs-recipes.pod:69
5013 msgid "To export just a subdirectory, eg. C</files>, do:"
5017 #: ../examples/guestfs-recipes.pod:71
5020 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
5025 #: ../examples/guestfs-recipes.pod:73
5026 msgid "Create empty disk images"
5030 #: ../examples/guestfs-recipes.pod:75
5032 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
5033 "The useful guide below explains the options available."
5037 #: ../examples/guestfs-recipes.pod:78
5039 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
5044 #: ../examples/guestfs-recipes.pod:80
5045 msgid "Dump raw filesystem content from inside a disk image or VM"
5049 #: ../examples/guestfs-recipes.pod:82
5051 "You can use the L<guestfish(1)> C<download> command to extract the raw "
5052 "filesystem content from any filesystem in a disk image or a VM (even one "
5053 "which is encrypted or buried inside an LV):"
5057 #: ../examples/guestfs-recipes.pod:86
5060 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
5065 #: ../examples/guestfs-recipes.pod:88
5068 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
5073 #: ../examples/guestfs-recipes.pod:90
5074 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
5078 #: ../examples/guestfs-recipes.pod:92
5079 msgid "Edit grub configuration in a VM"
5083 #: ../examples/guestfs-recipes.pod:94
5084 msgid "You can use this to:"
5088 #: ../examples/guestfs-recipes.pod:100
5089 msgid "Fix a virtual machine that does not boot."
5093 #: ../examples/guestfs-recipes.pod:104
5094 msgid "Change which kernel is used to boot the VM."
5098 #: ../examples/guestfs-recipes.pod:108
5099 msgid "Change kernel command line options."
5103 #: ../examples/guestfs-recipes.pod:112
5104 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
5108 #: ../examples/guestfs-recipes.pod:114
5111 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
5116 #: ../examples/guestfs-recipes.pod:116
5118 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
5123 #: ../examples/guestfs-recipes.pod:119
5126 " virt-rescue -d BrokenGuest\n"
5131 #: ../examples/guestfs-recipes.pod:121
5132 msgid "Export any directory from a VM"
5136 #: ../examples/guestfs-recipes.pod:123
5138 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
5142 #: ../examples/guestfs-recipes.pod:126
5145 " virt-copy-out -d Guest /home .\n"
5150 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
5151 #: ../fish/guestfish-actions.pod:1332 ../fish/guestfish-actions.pod:1597
5152 #: ../fish/guestfish-actions.pod:2014 ../src/guestfs-actions.pod:18
5153 #: ../src/guestfs-actions.pod:2039 ../src/guestfs-actions.pod:2463
5154 #: ../src/guestfs-actions.pod:3022 ../src/guestfs.pod:1670
5155 #: ../tools/virt-win-reg.pl:717
5160 #: ../examples/guestfs-recipes.pod:134
5162 "The final dot of the command is not a printing error. It means we want to "
5163 "copy out to the current directory."
5167 #: ../examples/guestfs-recipes.pod:139
5168 msgid "This creates a directory called C<home> under the current directory."
5172 #: ../examples/guestfs-recipes.pod:143
5174 "If the guest is a Windows guest then you can use drive letters and "
5175 "backslashes, but you must prefix the path with C<win:> and quote it to "
5176 "protect it from the shell, like this:"
5180 #: ../examples/guestfs-recipes.pod:147
5183 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
5188 #: ../examples/guestfs-recipes.pod:149
5189 msgid "To get the output as a compressed tarball, do:"
5193 #: ../examples/guestfs-recipes.pod:151
5196 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
5201 #: ../examples/guestfs-recipes.pod:153
5203 "Although it sounds tempting, this is usually not a reliable way to get a "
5204 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
5205 "org/FAQ.html#backup"
5209 #: ../examples/guestfs-recipes.pod:157
5210 msgid "Find out which user is using the most space"
5214 #: ../examples/guestfs-recipes.pod:159
5216 "This simple script examines a Linux guest to find out which user is using "
5217 "the most space in their home directory:"
5221 #: ../examples/guestfs-recipes.pod:162
5229 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
5237 #: ../examples/guestfs-recipes.pod:166
5246 #: ../examples/guestfs-recipes.pod:169
5249 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
5254 #: ../examples/guestfs-recipes.pod:171
5257 " for d in $(guestfish --remote ls \"$dir\"); do\n"
5258 " echo -n \"$dir/$d\"\n"
5260 " guestfish --remote du \"$dir/$d\";\n"
5261 " done | sort -nr -k 2\n"
5266 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
5269 " guestfish --remote exit\n"
5274 #: ../examples/guestfs-recipes.pod:179
5275 msgid "Get DHCP address from a VM"
5279 #: ../examples/guestfs-recipes.pod:181
5281 "The link below explains the many different possible techniques for getting "
5282 "the last assigned DHCP address of a virtual machine."
5286 #: ../examples/guestfs-recipes.pod:184
5288 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
5289 "a-virtual-machine-disk-image/#content"
5293 #: ../examples/guestfs-recipes.pod:186
5295 "In the libguestfs source examples directory you will find the latest version "
5296 "of the C<virt-dhcp-address.c> program."
5300 #: ../examples/guestfs-recipes.pod:189
5301 msgid "Get the operating system product name string"
5305 #: ../examples/guestfs-recipes.pod:191
5306 msgid "Save the following script into a file called C<product-name.sh>:"
5310 #: ../examples/guestfs-recipes.pod:193
5315 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5316 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5317 " guestfish --remote inspect-get-product-name \"$root\"\n"
5318 " guestfish --remote exit\n"
5323 #: ../examples/guestfs-recipes.pod:200
5324 msgid "Make the script executable and run it on a named guest:"
5328 #: ../examples/guestfs-recipes.pod:202
5331 " # product-name.sh RHEL60x64\n"
5332 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
5337 #: ../examples/guestfs-recipes.pod:205
5339 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
5340 "C<xpath> command line tool or from your favourite programming language:"
5344 #: ../examples/guestfs-recipes.pod:209
5347 " # virt-inspector RHEL60x64 > xml\n"
5348 " # xpath '//product_name' < xml\n"
5351 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
5356 #: ../examples/guestfs-recipes.pod:215
5357 msgid "Get the default boot kernel for a Linux VM"
5361 #: ../examples/guestfs-recipes.pod:217
5363 "The link below contains a program to print the default boot kernel for a "
5368 #: ../examples/guestfs-recipes.pod:220
5370 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
5371 "kernel-for-a-vm/#content"
5375 #: ../examples/guestfs-recipes.pod:222
5377 "It uses Augeas, and the technique is generally applicable for many different "
5382 #: ../examples/guestfs-recipes.pod:229
5383 msgid "listing the user accounts in the guest"
5387 #: ../examples/guestfs-recipes.pod:233
5388 msgid "what repositories is it configured to use"
5392 #: ../examples/guestfs-recipes.pod:237
5393 msgid "what NTP servers does it connect to"
5397 #: ../examples/guestfs-recipes.pod:241
5398 msgid "what were the boot messages last time it booted"
5402 #: ../examples/guestfs-recipes.pod:245
5403 msgid "listing who was logged in recently"
5407 #: ../examples/guestfs-recipes.pod:249
5408 msgid "http://augeas.net/"
5412 #: ../examples/guestfs-recipes.pod:251
5413 msgid "Install RPMs in a guest"
5417 #: ../examples/guestfs-recipes.pod:253
5419 "The link below contains a method to install RPMs in a guest. In fact the "
5420 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
5421 "installs them next time the guest is booted. You could use this technique "
5422 "to install vital security updates in an offline guest."
5426 #: ../examples/guestfs-recipes.pod:259
5428 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
5432 #: ../examples/guestfs-recipes.pod:261
5433 msgid "List applications installed in a VM"
5437 #: ../examples/guestfs-recipes.pod:263
5438 msgid "Save the following to a file C<list-apps.sh>:"
5442 #: ../examples/guestfs-recipes.pod:265
5447 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5448 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5449 " guestfish --remote inspect-list-applications \"$root\"\n"
5450 " guestfish --remote exit\n"
5455 #: ../examples/guestfs-recipes.pod:272
5457 "Make the file executable and then you can run it on any named virtual "
5462 #: ../examples/guestfs-recipes.pod:275
5465 " # list-apps.sh WinGuest\n"
5467 " app_name: Mozilla Firefox (3.6.12)\n"
5468 " app_display_name: Mozilla Firefox (3.6.12)\n"
5470 " app_version: 3.6.12 (en-GB)\n"
5472 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5473 " app_trans_path:\n"
5474 " app_publisher: Mozilla\n"
5475 " app_url: http://www.mozilla.com/en-GB/\n"
5476 " app_source_package:\n"
5478 " app_description: Mozilla Firefox\n"
5481 " app_name: VLC media player\n"
5482 " app_display_name: VLC media player 1.1.5\n"
5484 " app_version: 1.1.5\n"
5486 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5487 " app_trans_path:\n"
5488 " app_publisher: VideoLAN\n"
5489 " app_url: http://www.videolan.org/\n"
5490 " app_source_package:\n"
5492 " app_description:\n"
5498 #: ../examples/guestfs-recipes.pod:305
5500 "If you want to run the script on disk images (instead of libvirt virtual "
5501 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
5506 #: ../examples/guestfs-recipes.pod:309
5507 msgid "List files and directories in a VM"
5511 #: ../examples/guestfs-recipes.pod:311
5512 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5516 #: ../examples/guestfs-recipes.pod:313
5519 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5524 #: ../examples/guestfs-recipes.pod:315
5525 msgid "List services in a Windows VM"
5529 #: ../examples/guestfs-recipes.pod:317
5531 "The link below contains a script that can be used to list out the services "
5532 "from a Windows VM, and whether those services run at boot time or are loaded "
5537 #: ../examples/guestfs-recipes.pod:321
5539 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
5544 #: ../examples/guestfs-recipes.pod:323
5545 msgid "Make a disk image sparse"
5549 #: ../examples/guestfs-recipes.pod:325
5551 "The link below contains some guides for making a disk image sparse (or "
5552 "reintroducing sparseness)."
5556 #: ../examples/guestfs-recipes.pod:328
5558 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5562 #: ../examples/guestfs-recipes.pod:330
5563 msgid "Monitor disk usage over time"
5567 #: ../examples/guestfs-recipes.pod:332
5569 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5570 "The link below contains a guide."
5574 #: ../examples/guestfs-recipes.pod:335
5575 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5579 #: ../examples/guestfs-recipes.pod:337
5580 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5584 #: ../examples/guestfs-recipes.pod:339
5586 "L<guestfish(1)> plus the tools described in the link below can be used to "
5587 "read out the Windows Event Log from any virtual machine running Windows "
5588 "Vista or a later version."
5592 #: ../examples/guestfs-recipes.pod:343
5594 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
5595 "guestfish/#content"
5599 #: ../examples/guestfs-recipes.pod:345
5600 msgid "Remove root password (Linux)"
5604 #: ../examples/guestfs-recipes.pod:347
5606 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5607 "files. One use is to remove the root password from a Linux guest:"
5611 #: ../examples/guestfs-recipes.pod:350
5614 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5619 #: ../examples/guestfs-recipes.pod:352
5620 msgid "Remove Administrator password (Windows)"
5624 #: ../examples/guestfs-recipes.pod:354
5626 "The link below contains one technique for removing the Administrator "
5627 "password from a Windows VM, or to be more precise, it gives you a command "
5628 "prompt the next time you log in which you can use to bypass any security:"
5632 #: ../examples/guestfs-recipes.pod:359
5634 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
5635 "administrator-password-with-guestfish/"
5639 #: ../examples/guestfs-recipes.pod:361
5640 msgid "Unpack a live CD"
5644 #: ../examples/guestfs-recipes.pod:363
5646 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5647 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5648 "layers, as outlined in the guide below."
5652 #: ../examples/guestfs-recipes.pod:367
5654 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
5659 #: ../examples/guestfs-recipes.pod:369
5660 msgid "Uploading and downloading files"
5664 #: ../examples/guestfs-recipes.pod:371
5666 "The link below contains general tips on uploading (copying in) and "
5667 "downloading (copying out) files from VMs."
5671 #: ../examples/guestfs-recipes.pod:374
5673 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5677 #: ../examples/guestfs-recipes.pod:376
5678 msgid "Use libguestfs tools on VMware ESX guests"
5682 #: ../examples/guestfs-recipes.pod:378
5684 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5685 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5689 #: ../examples/guestfs-recipes.pod:382
5691 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
5696 #: ../examples/guestfs-recipes.pod:386
5698 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)"
5699 ">, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
5700 "python(3)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
5704 #: ../examples/guestfs-recipes.pod:403
5705 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5709 #: ../fish/guestfish-actions.pod:1
5714 #: ../fish/guestfish-actions.pod:3
5717 " add-cdrom filename\n"
5722 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5723 msgid "This function adds a virtual CD-ROM disk image to the guest."
5727 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5728 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5732 #: ../fish/guestfish-actions.pod:15
5734 "This call checks for the existence of C<filename>. This stops you from "
5735 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5736 "and C<http:> URLs. To specify those, use the general L</config> call "
5741 #: ../fish/guestfish-actions.pod:22
5743 "If you just want to add an ISO file (often you use this as an efficient way "
5744 "to transfer large files into the guest), then you should probably use L</add-"
5745 "drive-ro> instead."
5749 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:168
5750 #: ../fish/guestfish-actions.pod:182
5752 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5757 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:171
5758 #: ../fish/guestfish-actions.pod:185 ../fish/guestfish-actions.pod:1031
5759 #: ../fish/guestfish-actions.pod:1391 ../fish/guestfish-actions.pod:1405
5760 #: ../fish/guestfish-actions.pod:3175 ../fish/guestfish-actions.pod:3486
5761 #: ../fish/guestfish-actions.pod:3534 ../fish/guestfish-actions.pod:4447
5762 #: ../fish/guestfish-actions.pod:4470 ../fish/guestfish-actions.pod:4492
5763 #: ../fish/guestfish-actions.pod:4530 ../fish/guestfish-actions.pod:5179
5764 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:10
5765 #: ../src/guestfs-actions.pod:258 ../src/guestfs-actions.pod:279
5766 #: ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:2124
5767 #: ../src/guestfs-actions.pod:2145 ../src/guestfs-actions.pod:4790
5768 #: ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5412
5769 #: ../src/guestfs-actions.pod:6694 ../src/guestfs-actions.pod:6738
5770 #: ../src/guestfs-actions.pod:6772 ../src/guestfs-actions.pod:6835
5771 #: ../src/guestfs-actions.pod:7767 ../src/guestfs-actions.pod:7876
5772 #: ../src/guestfs-actions.pod:8059
5774 "Deprecated functions will not be removed from the API, but the fact that "
5775 "they are deprecated indicates that there are problems with correct use of "
5780 #: ../fish/guestfish-actions.pod:35
5785 #: ../fish/guestfish-actions.pod:37
5790 #: ../fish/guestfish-actions.pod:39
5793 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
5798 #: ../fish/guestfish-actions.pod:41
5800 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5801 "It works by connecting to libvirt, requesting the domain and domain XML from "
5802 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5806 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5808 "The number of disks added is returned. This operation is atomic: if an "
5809 "error is returned, then no disks are added."
5813 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5815 "This function does some minimal checks to make sure the libvirt domain is "
5816 "not running (unless C<readonly> is true). In a future version we will try "
5817 "to acquire the libvirt lock on each disk."
5821 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5823 "Disks must be accessible locally. This often means that adding disks from a "
5824 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5825 "unless those disks are accessible via the same device path locally too."
5829 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5831 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
5832 "libvirt.org/uri.html>). If this is not set then we connect to the default "
5833 "libvirt URI (or one set through an environment variable, see the libvirt "
5834 "documentation for full details)."
5838 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5840 "The optional C<live> flag controls whether this call will try to connect to "
5841 "a running virtual machine C<guestfsd> process if it sees a suitable "
5842 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5843 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5844 "DAEMONS> for more information."
5848 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5850 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5851 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5852 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5857 #: ../fish/guestfish-actions.pod:76
5859 "The other optional parameters are passed directly through to L</add-drive-"
5864 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:148
5865 #: ../fish/guestfish-actions.pod:578 ../fish/guestfish-actions.pod:789
5866 #: ../fish/guestfish-actions.pod:810 ../fish/guestfish-actions.pod:2053
5867 #: ../fish/guestfish-actions.pod:3224 ../fish/guestfish-actions.pod:3387
5868 #: ../fish/guestfish-actions.pod:3522
5870 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
5874 #: ../fish/guestfish-actions.pod:81
5879 #: ../fish/guestfish-actions.pod:83
5882 " add-drive filename\n"
5887 #: ../fish/guestfish-actions.pod:85
5889 "This function is the equivalent of calling L</add-drive-opts> with no "
5890 "optional parameters, so the disk is added writable, with the format being "
5891 "detected automatically."
5895 #: ../fish/guestfish-actions.pod:89
5897 "Automatic detection of the format opens you up to a potential security hole "
5898 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5899 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5900 "you should think about replacing calls to this function with calls to L</add-"
5901 "drive-opts>, and specifying the format."
5905 #: ../fish/guestfish-actions.pod:96
5906 msgid "add-drive-opts"
5910 #: ../fish/guestfish-actions.pod:98
5915 #: ../fish/guestfish-actions.pod:100
5918 " add-drive-opts filename [readonly:..] [format:..] [iface:..] [name:..]\n"
5923 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:161
5925 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5926 "The first time you call this function, the disk appears as C</dev/sda>, the "
5927 "second time as C</dev/sdb>, and so on."
5931 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:166
5933 "You don't necessarily need to be root when using libguestfs. However you "
5934 "obviously do need sufficient permissions to access the filename for whatever "
5935 "operations you want to perform (ie. read access if you just want to read the "
5936 "image or write access if you want to modify the image)."
5940 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:172
5941 msgid "This call checks that C<filename> exists."
5945 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3186
5946 #: ../src/guestfs-actions.pod:174 ../src/guestfs-actions.pod:4827
5947 msgid "The optional arguments are:"
5951 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:178
5956 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:180
5958 "If true then the image is treated as read-only. Writes are still allowed, "
5959 "but they are stored in a temporary snapshot overlay which is discarded at "
5960 "the end. The disk that you add is not modified."
5964 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:184
5969 #: ../fish/guestfish-actions.pod:127
5971 "This forces the image format. If you omit this (or use L</add-drive> or L</"
5972 "add-drive-ro>) then the format is automatically detected. Possible formats "
5973 "include C<raw> and C<qcow2>."
5977 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:190
5979 "Automatic detection of the format opens you up to a potential security hole "
5980 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5981 "RHBZ#642934. Specifying the format closes this security hole."
5985 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:195
5990 #: ../fish/guestfish-actions.pod:138
5992 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
5993 "add-drive-with-if> call (q.v.)"
5997 #: ../fish/guestfish-actions.pod:141 ../src/guestfs-actions.pod:200
6002 #: ../fish/guestfish-actions.pod:143 ../src/guestfs-actions.pod:202
6004 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
6005 "a hint to the guest inspection process if it is available."
6009 #: ../fish/guestfish-actions.pod:150
6010 msgid "add-drive-ro"
6014 #: ../fish/guestfish-actions.pod:152
6019 #: ../fish/guestfish-actions.pod:154
6022 " add-drive-ro filename\n"
6027 #: ../fish/guestfish-actions.pod:156
6029 "This function is the equivalent of calling L</add-drive-opts> with the "
6030 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
6031 "is added read-only, with the format being detected automatically."
6035 #: ../fish/guestfish-actions.pod:161
6036 msgid "add-drive-ro-with-if"
6040 #: ../fish/guestfish-actions.pod:163
6043 " add-drive-ro-with-if filename iface\n"
6048 #: ../fish/guestfish-actions.pod:165
6050 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
6051 "interface emulation to use at run time."
6055 #: ../fish/guestfish-actions.pod:175
6056 msgid "add-drive-with-if"
6060 #: ../fish/guestfish-actions.pod:177
6063 " add-drive-with-if filename iface\n"
6068 #: ../fish/guestfish-actions.pod:179
6070 "This is the same as L</add-drive> but it allows you to specify the QEMU "
6071 "interface emulation to use at run time."
6075 #: ../fish/guestfish-actions.pod:189
6080 #: ../fish/guestfish-actions.pod:191
6083 " aug-clear augpath\n"
6088 #: ../fish/guestfish-actions.pod:193 ../src/guestfs-actions.pod:296
6090 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6091 "L<augtool(1)> C<clear> command."
6095 #: ../fish/guestfish-actions.pod:196
6100 #: ../fish/guestfish-actions.pod:198
6108 #: ../fish/guestfish-actions.pod:200
6110 "Close the current Augeas handle and free up any resources used by it. After "
6111 "calling this, you have to call L</aug-init> again before you can use any "
6112 "other Augeas functions."
6116 #: ../fish/guestfish-actions.pod:205
6121 #: ../fish/guestfish-actions.pod:207
6124 " aug-defnode name expr val\n"
6129 #: ../fish/guestfish-actions.pod:209 ../src/guestfs-actions.pod:325
6131 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6135 #: ../fish/guestfish-actions.pod:212
6137 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6138 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
6139 "containing that single node."
6143 #: ../fish/guestfish-actions.pod:216 ../src/guestfs-actions.pod:332
6145 "On success this returns a pair containing the number of nodes in the "
6146 "nodeset, and a boolean flag if a node was created."
6150 #: ../fish/guestfish-actions.pod:220
6155 #: ../fish/guestfish-actions.pod:222
6158 " aug-defvar name expr\n"
6163 #: ../fish/guestfish-actions.pod:224 ../src/guestfs-actions.pod:349
6165 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6166 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6170 #: ../fish/guestfish-actions.pod:228 ../src/guestfs-actions.pod:353
6172 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6173 "evaluates to something which is not a nodeset."
6177 #: ../fish/guestfish-actions.pod:231
6182 #: ../fish/guestfish-actions.pod:233
6185 " aug-get augpath\n"
6190 #: ../fish/guestfish-actions.pod:235 ../src/guestfs-actions.pod:366
6192 "Look up the value associated with C<path>. If C<path> matches exactly one "
6193 "node, the C<value> is returned."
6197 #: ../fish/guestfish-actions.pod:238
6202 #: ../fish/guestfish-actions.pod:240
6205 " aug-init root flags\n"
6210 #: ../fish/guestfish-actions.pod:242 ../src/guestfs-actions.pod:381
6212 "Create a new Augeas handle for editing configuration files. If there was "
6213 "any previous Augeas handle associated with this guestfs session, then it is "
6218 #: ../fish/guestfish-actions.pod:246
6219 msgid "You must call this before using any other L</aug-*> commands."
6223 #: ../fish/guestfish-actions.pod:249 ../src/guestfs-actions.pod:388
6225 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6229 #: ../fish/guestfish-actions.pod:252 ../src/guestfs-actions.pod:391
6231 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6232 "logical I<or> of the following integers:"
6236 #: ../fish/guestfish-actions.pod:258 ../src/guestfs-actions.pod:397
6237 msgid "C<AUG_SAVE_BACKUP> = 1"
6241 #: ../fish/guestfish-actions.pod:260 ../src/guestfs-actions.pod:399
6242 msgid "Keep the original file with a C<.augsave> extension."
6246 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:401
6247 msgid "C<AUG_SAVE_NEWFILE> = 2"
6251 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:403
6253 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6254 "original. Overrides C<AUG_SAVE_BACKUP>."
6258 #: ../fish/guestfish-actions.pod:267 ../src/guestfs-actions.pod:406
6259 msgid "C<AUG_TYPE_CHECK> = 4"
6263 #: ../fish/guestfish-actions.pod:269 ../src/guestfs-actions.pod:408
6264 msgid "Typecheck lenses."
6268 #: ../fish/guestfish-actions.pod:271
6270 "This option is only useful when debugging Augeas lenses. Use of this option "
6271 "may require additional memory for the libguestfs appliance. You may need to "
6272 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
6276 #: ../fish/guestfish-actions.pod:276 ../src/guestfs-actions.pod:415
6277 msgid "C<AUG_NO_STDINC> = 8"
6281 #: ../fish/guestfish-actions.pod:278 ../src/guestfs-actions.pod:417
6282 msgid "Do not use standard load path for modules."
6286 #: ../fish/guestfish-actions.pod:280 ../src/guestfs-actions.pod:419
6287 msgid "C<AUG_SAVE_NOOP> = 16"
6291 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:421
6292 msgid "Make save a no-op, just record what would have been changed."
6296 #: ../fish/guestfish-actions.pod:284 ../src/guestfs-actions.pod:423
6297 msgid "C<AUG_NO_LOAD> = 32"
6301 #: ../fish/guestfish-actions.pod:286
6302 msgid "Do not load the tree in L</aug-init>."
6306 #: ../fish/guestfish-actions.pod:290
6307 msgid "To close the handle, you can call L</aug-close>."
6311 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:431
6312 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6316 #: ../fish/guestfish-actions.pod:294
6321 #: ../fish/guestfish-actions.pod:296
6324 " aug-insert augpath label true|false\n"
6329 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:445
6331 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6332 "or after C<path> (depending on the boolean flag C<before>)."
6336 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:449
6338 "C<path> must match exactly one existing node in the tree, and C<label> must "
6339 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6343 #: ../fish/guestfish-actions.pod:306
6348 #: ../fish/guestfish-actions.pod:308
6356 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:462
6357 msgid "Load files into the tree."
6361 #: ../fish/guestfish-actions.pod:312 ../src/guestfs-actions.pod:464
6362 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6366 #: ../fish/guestfish-actions.pod:315
6371 #: ../fish/guestfish-actions.pod:317
6379 #: ../fish/guestfish-actions.pod:319
6381 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
6382 "resulting nodes into alphabetical order."
6386 #: ../fish/guestfish-actions.pod:322
6391 #: ../fish/guestfish-actions.pod:324
6394 " aug-match augpath\n"
6399 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:492
6401 "Returns a list of paths which match the path expression C<path>. The "
6402 "returned paths are sufficiently qualified so that they match exactly one "
6403 "node in the current tree."
6407 #: ../fish/guestfish-actions.pod:330
6412 #: ../fish/guestfish-actions.pod:332
6415 " aug-mv src dest\n"
6420 #: ../fish/guestfish-actions.pod:334 ../src/guestfs-actions.pod:509
6422 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6423 "C<dest> is overwritten if it exists."
6427 #: ../fish/guestfish-actions.pod:337
6432 #: ../fish/guestfish-actions.pod:339
6440 #: ../fish/guestfish-actions.pod:341 ../src/guestfs-actions.pod:522
6441 msgid "Remove C<path> and all of its children."
6445 #: ../fish/guestfish-actions.pod:343 ../src/guestfs-actions.pod:524
6446 msgid "On success this returns the number of entries which were removed."
6450 #: ../fish/guestfish-actions.pod:345
6455 #: ../fish/guestfish-actions.pod:347
6463 #: ../fish/guestfish-actions.pod:349 ../src/guestfs-actions.pod:535
6464 msgid "This writes all pending changes to disk."
6468 #: ../fish/guestfish-actions.pod:351
6470 "The flags which were passed to L</aug-init> affect exactly how files are "
6475 #: ../fish/guestfish-actions.pod:354
6480 #: ../fish/guestfish-actions.pod:356
6483 " aug-set augpath val\n"
6488 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:551
6489 msgid "Set the value associated with C<path> to C<val>."
6493 #: ../fish/guestfish-actions.pod:360
6495 "In the Augeas API, it is possible to clear a node by setting the value to "
6496 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6497 "this call. Instead you must use the L</aug-clear> call."
6501 #: ../fish/guestfish-actions.pod:365
6506 #: ../fish/guestfish-actions.pod:367
6509 " available 'groups ...'\n"
6514 #: ../fish/guestfish-actions.pod:369 ../src/guestfs-actions.pod:568
6516 "This command is used to check the availability of some groups of "
6517 "functionality in the appliance, which not all builds of the libguestfs "
6518 "appliance will be able to provide."
6522 #: ../fish/guestfish-actions.pod:373
6524 "The libguestfs groups, and the functions that those groups correspond to, "
6525 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6526 "runtime by calling L</available-all-groups>."
6530 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:577
6532 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
6533 "\"]> would check for the availability of the Linux inotify functions and "
6534 "Augeas (configuration file editing) functions."
6538 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:582
6539 msgid "The command returns no error if I<all> requested groups are available."
6543 #: ../fish/guestfish-actions.pod:385 ../src/guestfs-actions.pod:584
6545 "It fails with an error if one or more of the requested groups is unavailable "
6550 #: ../fish/guestfish-actions.pod:388 ../src/guestfs-actions.pod:587
6552 "If an unknown group name is included in the list of groups then an error is "
6557 #: ../fish/guestfish-actions.pod:391 ../src/guestfs-actions.pod:590
6562 #: ../fish/guestfish-actions.pod:397
6563 msgid "You must call L</launch> before calling this function."
6567 #: ../fish/guestfish-actions.pod:399 ../src/guestfs-actions.pod:598
6569 "The reason is because we don't know what groups are supported by the "
6570 "appliance/daemon until it is running and can be queried."
6574 #: ../fish/guestfish-actions.pod:405 ../src/guestfs-actions.pod:604
6576 "If a group of functions is available, this does not necessarily mean that "
6577 "they will work. You still have to check for errors when calling individual "
6578 "API functions even if they are available."
6582 #: ../fish/guestfish-actions.pod:412 ../src/guestfs-actions.pod:611
6584 "It is usually the job of distro packagers to build complete functionality "
6585 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6586 "with all requirements satisfied, will support everything."
6590 #: ../fish/guestfish-actions.pod:419
6592 "This call was added in version C<1.0.80>. In previous versions of "
6593 "libguestfs all you could do would be to speculatively execute a command to "
6594 "find out if the daemon implemented it. See also L</version>."
6598 #: ../fish/guestfish-actions.pod:426
6599 msgid "available-all-groups"
6603 #: ../fish/guestfish-actions.pod:428
6606 " available-all-groups\n"
6611 #: ../fish/guestfish-actions.pod:430
6613 "This command returns a list of all optional groups that this daemon knows "
6614 "about. Note this returns both supported and unsupported groups. To find "
6615 "out which ones the daemon can actually support you have to call L</"
6616 "available> on each member of the returned list."
6620 #: ../fish/guestfish-actions.pod:436
6621 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6625 #: ../fish/guestfish-actions.pod:438
6630 #: ../fish/guestfish-actions.pod:440
6633 " base64-in (base64file|-) filename\n"
6638 #: ../fish/guestfish-actions.pod:442 ../src/guestfs-actions.pod:655
6640 "This command uploads base64-encoded data from C<base64file> to C<filename>."
6644 #: ../fish/guestfish-actions.pod:445 ../fish/guestfish-actions.pod:454
6645 #: ../fish/guestfish-actions.pod:703 ../fish/guestfish-actions.pod:787
6646 #: ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:907
6647 #: ../fish/guestfish-actions.pod:926 ../fish/guestfish-actions.pod:1300
6648 #: ../fish/guestfish-actions.pod:4750 ../fish/guestfish-actions.pod:4762
6649 #: ../fish/guestfish-actions.pod:4773 ../fish/guestfish-actions.pod:4784
6650 #: ../fish/guestfish-actions.pod:4836 ../fish/guestfish-actions.pod:4845
6651 #: ../fish/guestfish-actions.pod:4899 ../fish/guestfish-actions.pod:4922
6652 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6656 #: ../fish/guestfish-actions.pod:447
6661 #: ../fish/guestfish-actions.pod:449
6664 " base64-out filename (base64file|-)\n"
6669 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:669
6671 "This command downloads the contents of C<filename>, writing it out to local "
6672 "file C<base64file> encoded as base64."
6676 #: ../fish/guestfish-actions.pod:456
6677 msgid "blockdev-flushbufs"
6681 #: ../fish/guestfish-actions.pod:458
6684 " blockdev-flushbufs device\n"
6689 #: ../fish/guestfish-actions.pod:460 ../src/guestfs-actions.pod:682
6691 "This tells the kernel to flush internal buffers associated with C<device>."
6695 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:474
6696 #: ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:493
6697 #: ../fish/guestfish-actions.pod:505 ../fish/guestfish-actions.pod:518
6698 #: ../fish/guestfish-actions.pod:526 ../fish/guestfish-actions.pod:537
6699 #: ../fish/guestfish-actions.pod:545 ../fish/guestfish-actions.pod:553
6700 #: ../src/guestfs-actions.pod:685 ../src/guestfs-actions.pod:702
6701 #: ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:733
6702 #: ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:770
6703 #: ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802
6704 #: ../src/guestfs-actions.pod:816 ../src/guestfs-actions.pod:830
6705 msgid "This uses the L<blockdev(8)> command."
6709 #: ../fish/guestfish-actions.pod:465
6710 msgid "blockdev-getbsz"
6714 #: ../fish/guestfish-actions.pod:467
6717 " blockdev-getbsz device\n"
6722 #: ../fish/guestfish-actions.pod:469 ../src/guestfs-actions.pod:697
6723 msgid "This returns the block size of a device."
6727 #: ../fish/guestfish-actions.pod:471 ../fish/guestfish-actions.pod:534
6728 #: ../src/guestfs-actions.pod:699 ../src/guestfs-actions.pod:799
6730 "(Note this is different from both I<size in blocks> and I<filesystem block "
6735 #: ../fish/guestfish-actions.pod:476
6736 msgid "blockdev-getro"
6740 #: ../fish/guestfish-actions.pod:478
6743 " blockdev-getro device\n"
6748 #: ../fish/guestfish-actions.pod:480 ../src/guestfs-actions.pod:714
6750 "Returns a boolean indicating if the block device is read-only (true if read-"
6751 "only, false if not)."
6755 #: ../fish/guestfish-actions.pod:485
6756 msgid "blockdev-getsize64"
6760 #: ../fish/guestfish-actions.pod:487
6763 " blockdev-getsize64 device\n"
6768 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:729
6769 msgid "This returns the size of the device in bytes."
6773 #: ../fish/guestfish-actions.pod:491
6774 msgid "See also L</blockdev-getsz>."
6778 #: ../fish/guestfish-actions.pod:495
6779 msgid "blockdev-getss"
6783 #: ../fish/guestfish-actions.pod:497
6786 " blockdev-getss device\n"
6791 #: ../fish/guestfish-actions.pod:499 ../src/guestfs-actions.pod:745
6793 "This returns the size of sectors on a block device. Usually 512, but can be "
6794 "larger for modern devices."
6798 #: ../fish/guestfish-actions.pod:502
6800 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6804 #: ../fish/guestfish-actions.pod:507
6805 msgid "blockdev-getsz"
6809 #: ../fish/guestfish-actions.pod:509
6812 " blockdev-getsz device\n"
6817 #: ../fish/guestfish-actions.pod:511 ../src/guestfs-actions.pod:763
6819 "This returns the size of the device in units of 512-byte sectors (even if "
6820 "the sectorsize isn't 512 bytes ... weird)."
6824 #: ../fish/guestfish-actions.pod:514
6826 "See also L</blockdev-getss> for the real sector size of the device, and L</"
6827 "blockdev-getsize64> for the more useful I<size in bytes>."
6831 #: ../fish/guestfish-actions.pod:520
6832 msgid "blockdev-rereadpt"
6836 #: ../fish/guestfish-actions.pod:522
6839 " blockdev-rereadpt device\n"
6844 #: ../fish/guestfish-actions.pod:524 ../src/guestfs-actions.pod:782
6845 msgid "Reread the partition table on C<device>."
6849 #: ../fish/guestfish-actions.pod:528
6850 msgid "blockdev-setbsz"
6854 #: ../fish/guestfish-actions.pod:530
6857 " blockdev-setbsz device blocksize\n"
6862 #: ../fish/guestfish-actions.pod:532 ../src/guestfs-actions.pod:797
6863 msgid "This sets the block size of a device."
6867 #: ../fish/guestfish-actions.pod:539
6868 msgid "blockdev-setro"
6872 #: ../fish/guestfish-actions.pod:541
6875 " blockdev-setro device\n"
6880 #: ../fish/guestfish-actions.pod:543 ../src/guestfs-actions.pod:814
6881 msgid "Sets the block device named C<device> to read-only."
6885 #: ../fish/guestfish-actions.pod:547
6886 msgid "blockdev-setrw"
6890 #: ../fish/guestfish-actions.pod:549
6893 " blockdev-setrw device\n"
6898 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:828
6899 msgid "Sets the block device named C<device> to read-write."
6903 #: ../fish/guestfish-actions.pod:555
6904 msgid "btrfs-filesystem-resize"
6908 #: ../fish/guestfish-actions.pod:557
6911 " btrfs-filesystem-resize mountpoint [size:..]\n"
6916 #: ../fish/guestfish-actions.pod:559 ../src/guestfs-actions.pod:850
6917 msgid "This command resizes a btrfs filesystem."
6921 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:852
6923 "Note that unlike other resize calls, the filesystem has to be mounted and "
6924 "the parameter is the mountpoint not the device (this is a requirement of "
6929 #: ../fish/guestfish-actions.pod:565 ../fish/guestfish-actions.pod:3497
6930 #: ../src/guestfs-actions.pod:856 ../src/guestfs-actions.pod:5351
6931 msgid "The optional parameters are:"
6935 #: ../fish/guestfish-actions.pod:569 ../fish/guestfish-actions.pod:3501
6936 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5355
6941 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:862
6943 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6944 "resized to the maximum size."
6948 #: ../fish/guestfish-actions.pod:576 ../src/guestfs-actions.pod:867
6949 msgid "See also L<btrfs(8)>."
6953 #: ../fish/guestfish-actions.pod:580
6954 msgid "case-sensitive-path"
6958 #: ../fish/guestfish-actions.pod:582
6961 " case-sensitive-path path\n"
6966 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:901
6968 "This can be used to resolve case insensitive paths on a filesystem which is "
6969 "case sensitive. The use case is to resolve paths which you have read from "
6970 "Windows configuration files or the Windows Registry, to the true path."
6974 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:906
6976 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6977 "(and probably others), which is that although the underlying filesystem is "
6978 "case-insensitive, the driver exports the filesystem to Linux as case-"
6983 #: ../fish/guestfish-actions.pod:594 ../src/guestfs-actions.pod:911
6985 "One consequence of this is that special directories such as C<c:\\windows> "
6986 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6987 "precise details of how they were created. In Windows itself this would not "
6992 #: ../fish/guestfish-actions.pod:600 ../src/guestfs-actions.pod:917
6994 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
6999 #: ../fish/guestfish-actions.pod:603 ../src/guestfs-actions.pod:920
7001 "This function resolves the true case of each element in the path and returns "
7002 "the case-sensitive path."
7006 #: ../fish/guestfish-actions.pod:606
7008 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
7009 "WINDOWS/system32\"> (the exact return value would depend on details of how "
7010 "the directories were originally created under Windows)."
7014 #: ../fish/guestfish-actions.pod:611 ../src/guestfs-actions.pod:928
7015 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7019 #: ../fish/guestfish-actions.pod:614
7020 msgid "See also L</realpath>."
7024 #: ../fish/guestfish-actions.pod:616
7029 #: ../fish/guestfish-actions.pod:618
7037 #: ../fish/guestfish-actions.pod:620 ../fish/guestfish-actions.pod:3917
7038 #: ../src/guestfs-actions.pod:944 ../src/guestfs-actions.pod:5994
7039 msgid "Return the contents of the file named C<path>."
7043 #: ../fish/guestfish-actions.pod:622
7045 "Note that this function cannot correctly handle binary files (specifically, "
7046 "files containing C<\\0> character which is treated as end of string). For "
7047 "those you need to use the L</read-file> or L</download> functions which have "
7048 "a more complex interface."
7052 #: ../fish/guestfish-actions.pod:627 ../fish/guestfish-actions.pod:762
7053 #: ../fish/guestfish-actions.pod:774 ../fish/guestfish-actions.pod:985
7054 #: ../fish/guestfish-actions.pod:995 ../fish/guestfish-actions.pod:1062
7055 #: ../fish/guestfish-actions.pod:1072 ../fish/guestfish-actions.pod:1264
7056 #: ../fish/guestfish-actions.pod:1577 ../fish/guestfish-actions.pod:1587
7057 #: ../fish/guestfish-actions.pod:1637 ../fish/guestfish-actions.pod:1652
7058 #: ../fish/guestfish-actions.pod:1662 ../fish/guestfish-actions.pod:1681
7059 #: ../fish/guestfish-actions.pod:3787 ../fish/guestfish-actions.pod:3802
7060 #: ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:3895
7061 #: ../fish/guestfish-actions.pod:3910 ../fish/guestfish-actions.pod:4591
7062 #: ../fish/guestfish-actions.pod:4637 ../fish/guestfish-actions.pod:4722
7063 #: ../fish/guestfish-actions.pod:4737 ../fish/guestfish-actions.pod:5143
7064 #: ../fish/guestfish-actions.pod:5155 ../fish/guestfish-actions.pod:5173
7065 #: ../fish/guestfish-actions.pod:5190 ../fish/guestfish-actions.pod:5200
7066 #: ../fish/guestfish-actions.pod:5257 ../fish/guestfish-actions.pod:5267
7067 #: ../fish/guestfish-actions.pod:5296 ../fish/guestfish-actions.pod:5306
7068 #: ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:1133
7069 #: ../src/guestfs-actions.pod:1153 ../src/guestfs-actions.pod:1560
7070 #: ../src/guestfs-actions.pod:1579 ../src/guestfs-actions.pod:1682
7071 #: ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1947
7072 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2448
7073 #: ../src/guestfs-actions.pod:2513 ../src/guestfs-actions.pod:2537
7074 #: ../src/guestfs-actions.pod:2554 ../src/guestfs-actions.pod:2583
7075 #: ../src/guestfs-actions.pod:5776 ../src/guestfs-actions.pod:5802
7076 #: ../src/guestfs-actions.pod:5933 ../src/guestfs-actions.pod:5959
7077 #: ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6950
7078 #: ../src/guestfs-actions.pod:7005 ../src/guestfs-actions.pod:7151
7079 #: ../src/guestfs-actions.pod:7175 ../src/guestfs-actions.pod:7840
7080 #: ../src/guestfs-actions.pod:7860 ../src/guestfs-actions.pod:7893
7081 #: ../src/guestfs-actions.pod:7912 ../src/guestfs-actions.pod:7931
7082 #: ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8044
7083 #: ../src/guestfs-actions.pod:8090 ../src/guestfs-actions.pod:8109
7085 "Because of the message protocol, there is a transfer limit of somewhere "
7086 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7090 #: ../fish/guestfish-actions.pod:630
7095 #: ../fish/guestfish-actions.pod:632
7098 " checksum csumtype path\n"
7103 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:966
7105 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7109 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:969
7111 "The type of checksum to compute is given by the C<csumtype> parameter which "
7112 "must have one of the following values:"
7116 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:974
7121 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:976
7123 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7128 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:979
7133 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:981
7134 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7138 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:983
7143 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:985
7144 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7148 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:987
7153 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:989
7154 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7158 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:991
7163 #: ../fish/guestfish-actions.pod:661 ../src/guestfs-actions.pod:993
7164 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7168 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:995
7173 #: ../fish/guestfish-actions.pod:665 ../src/guestfs-actions.pod:997
7174 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7178 #: ../fish/guestfish-actions.pod:667 ../src/guestfs-actions.pod:999
7183 #: ../fish/guestfish-actions.pod:669 ../src/guestfs-actions.pod:1001
7184 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7188 #: ../fish/guestfish-actions.pod:673 ../src/guestfs-actions.pod:1005
7189 msgid "The checksum is returned as a printable string."
7193 #: ../fish/guestfish-actions.pod:675
7194 msgid "To get the checksum for a device, use L</checksum-device>."
7198 #: ../fish/guestfish-actions.pod:677
7199 msgid "To get the checksums for many files, use L</checksums-out>."
7203 #: ../fish/guestfish-actions.pod:679
7204 msgid "checksum-device"
7208 #: ../fish/guestfish-actions.pod:681
7211 " checksum-device csumtype device\n"
7216 #: ../fish/guestfish-actions.pod:683
7218 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7219 "device named C<device>. For the types of checksums supported see the L</"
7220 "checksum> command."
7224 #: ../fish/guestfish-actions.pod:687
7225 msgid "checksums-out"
7229 #: ../fish/guestfish-actions.pod:689
7232 " checksums-out csumtype directory (sumsfile|-)\n"
7237 #: ../fish/guestfish-actions.pod:691 ../src/guestfs-actions.pod:1040
7239 "This command computes the checksums of all regular files in C<directory> and "
7240 "then emits a list of those checksums to the local output file C<sumsfile>."
7244 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1044
7246 "This can be used for verifying the integrity of a virtual machine. However "
7247 "to be properly secure you should pay attention to the output of the checksum "
7248 "command (it uses the ones from GNU coreutils). In particular when the "
7249 "filename is not printable, coreutils uses a special backslash syntax. For "
7250 "more information, see the GNU coreutils info file."
7254 #: ../fish/guestfish-actions.pod:705
7259 #: ../fish/guestfish-actions.pod:707
7262 " chmod mode path\n"
7267 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1063
7269 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7274 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1066
7276 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7277 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7282 #: ../fish/guestfish-actions.pod:716 ../fish/guestfish-actions.pod:3150
7283 #: ../fish/guestfish-actions.pod:3289 ../fish/guestfish-actions.pod:3299
7284 #: ../fish/guestfish-actions.pod:3309 ../src/guestfs-actions.pod:1070
7285 #: ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:4967
7286 #: ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:5005
7287 msgid "The mode actually set is affected by the umask."
7291 #: ../fish/guestfish-actions.pod:718
7296 #: ../fish/guestfish-actions.pod:720
7299 " chown owner group path\n"
7304 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1084
7305 msgid "Change the file owner to C<owner> and group to C<group>."
7309 #: ../fish/guestfish-actions.pod:724 ../fish/guestfish-actions.pod:2585
7310 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:3829
7312 "Only numeric uid and gid are supported. If you want to use names, you will "
7313 "need to locate and parse the password file yourself (Augeas support makes "
7314 "this relatively easy)."
7318 #: ../fish/guestfish-actions.pod:728
7323 #: ../fish/guestfish-actions.pod:730
7326 " command 'arguments ...'\n"
7331 #: ../fish/guestfish-actions.pod:732 ../src/guestfs-actions.pod:1100
7333 "This call runs a command from the guest filesystem. The filesystem must be "
7334 "mounted, and must contain a compatible operating system (ie. something "
7335 "Linux, with the same or compatible processor architecture)."
7339 #: ../fish/guestfish-actions.pod:737
7341 "The single parameter is an argv-style list of arguments. The first element "
7342 "is the name of the program to run. Subsequent elements are parameters. The "
7343 "list must be non-empty (ie. must contain a program name). Note that the "
7344 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
7348 #: ../fish/guestfish-actions.pod:744 ../src/guestfs-actions.pod:1112
7349 msgid "The return value is anything printed to I<stdout> by the command."
7353 #: ../fish/guestfish-actions.pod:747 ../src/guestfs-actions.pod:1115
7355 "If the command returns a non-zero exit status, then this function returns an "
7356 "error message. The error message string is the content of I<stderr> from "
7361 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1119
7363 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
7364 "bin>. If you require a program from another location, you should provide "
7365 "the full path in the first parameter."
7369 #: ../fish/guestfish-actions.pod:756 ../src/guestfs-actions.pod:1124
7371 "Shared libraries and data files required by the program must be available on "
7372 "filesystems which are mounted in the correct places. It is the caller's "
7373 "responsibility to ensure all filesystems that are needed are mounted at the "
7378 #: ../fish/guestfish-actions.pod:765
7379 msgid "command-lines"
7383 #: ../fish/guestfish-actions.pod:767
7386 " command-lines 'arguments ...'\n"
7391 #: ../fish/guestfish-actions.pod:769
7393 "This is the same as L</command>, but splits the result into a list of lines."
7397 #: ../fish/guestfish-actions.pod:772
7398 msgid "See also: L</sh-lines>"
7402 #: ../fish/guestfish-actions.pod:777
7403 msgid "compress-device-out"
7407 #: ../fish/guestfish-actions.pod:779
7410 " compress-device-out ctype device (zdevice|-) [level:..]\n"
7415 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1174
7417 "This command compresses C<device> and writes it out to the local file "
7422 #: ../fish/guestfish-actions.pod:784
7424 "The C<ctype> and optional C<level> parameters have the same meaning as in L</"
7429 #: ../fish/guestfish-actions.pod:791
7430 msgid "compress-out"
7434 #: ../fish/guestfish-actions.pod:793
7437 " compress-out ctype file (zfile|-) [level:..]\n"
7442 #: ../fish/guestfish-actions.pod:795 ../src/guestfs-actions.pod:1226
7444 "This command compresses C<file> and writes it out to the local file C<zfile>."
7448 #: ../fish/guestfish-actions.pod:798 ../src/guestfs-actions.pod:1229
7450 "The compression program used is controlled by the C<ctype> parameter. "
7451 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
7452 "Some compression types may not be supported by particular builds of "
7453 "libguestfs, in which case you will get an error containing the substring "
7454 "\"not supported\"."
7458 #: ../fish/guestfish-actions.pod:804 ../src/guestfs-actions.pod:1235
7460 "The optional C<level> parameter controls compression level. The meaning and "
7461 "default for this parameter depends on the compression program being used."
7465 #: ../fish/guestfish-actions.pod:812
7470 #: ../fish/guestfish-actions.pod:814
7473 " config qemuparam qemuvalue\n"
7478 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1276
7480 "This can be used to add arbitrary qemu command line parameters of the form "
7481 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7482 "setting some parameters which would interfere with parameters that we use."
7486 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1281
7487 msgid "The first character of C<param> string must be a C<-> (dash)."
7491 #: ../fish/guestfish-actions.pod:823 ../src/guestfs-actions.pod:1283
7492 msgid "C<value> can be NULL."
7496 #: ../fish/guestfish-actions.pod:825
7501 #: ../fish/guestfish-actions.pod:827
7504 " copy-size src dest size\n"
7509 #: ../fish/guestfish-actions.pod:829 ../src/guestfs-actions.pod:1297
7511 "This command copies exactly C<size> bytes from one source device or file "
7512 "C<src> to another destination device or file C<dest>."
7516 #: ../fish/guestfish-actions.pod:832 ../src/guestfs-actions.pod:1300
7518 "Note this will fail if the source is too short or if the destination is not "
7523 #: ../fish/guestfish-actions.pod:835
7528 #: ../fish/guestfish-actions.pod:837
7536 #: ../fish/guestfish-actions.pod:839 ../src/guestfs-actions.pod:1319
7538 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7539 "destination filename or destination directory."
7543 #: ../fish/guestfish-actions.pod:842
7548 #: ../fish/guestfish-actions.pod:844
7556 #: ../fish/guestfish-actions.pod:846 ../src/guestfs-actions.pod:1333
7558 "This copies a file or directory from C<src> to C<dest> recursively using the "
7563 #: ../fish/guestfish-actions.pod:849
7568 #: ../fish/guestfish-actions.pod:851
7576 #: ../fish/guestfish-actions.pod:853 ../src/guestfs-actions.pod:1347
7578 "This command copies from one source device or file C<src> to another "
7579 "destination device or file C<dest>. Normally you would use this to copy to "
7580 "or from a device or partition, for example to duplicate a filesystem."
7584 #: ../fish/guestfish-actions.pod:858
7586 "If the destination is a device, it must be as large or larger than the "
7587 "source file or device, otherwise the copy will fail. This command cannot do "
7588 "partial copies (see L</copy-size>)."
7592 #: ../fish/guestfish-actions.pod:862
7597 #: ../fish/guestfish-actions.pod:864
7605 #: ../fish/guestfish-actions.pod:866 ../src/guestfs-actions.pod:1365
7606 msgid "This command runs the C<df> command to report disk space used."
7610 #: ../fish/guestfish-actions.pod:868 ../fish/guestfish-actions.pod:879
7612 "This command is mostly useful for interactive sessions. It is I<not> "
7613 "intended that you try to parse the output string. Use L</statvfs> from "
7618 #: ../fish/guestfish-actions.pod:872
7623 #: ../fish/guestfish-actions.pod:874
7631 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1381
7633 "This command runs the C<df -h> command to report disk space used in human-"
7638 #: ../fish/guestfish-actions.pod:883
7643 #: ../fish/guestfish-actions.pod:885
7651 #: ../fish/guestfish-actions.pod:887 ../src/guestfs-actions.pod:1398
7653 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7654 "This is sometimes useful for extended debugging of problems."
7658 #: ../fish/guestfish-actions.pod:891
7660 "Another way to get the same information is to enable verbose messages with "
7661 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7662 "before running the program."
7666 #: ../fish/guestfish-actions.pod:896
7671 #: ../fish/guestfish-actions.pod:898
7674 " download remotefilename (filename|-)\n"
7679 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:913
7680 #: ../src/guestfs-actions.pod:1419 ../src/guestfs-actions.pod:1444
7682 "Download file C<remotefilename> and save it as C<filename> on the local "
7687 #: ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:4895
7688 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:7410
7689 msgid "C<filename> can also be a named pipe."
7693 #: ../fish/guestfish-actions.pod:905
7694 msgid "See also L</upload>, L</cat>."
7698 #: ../fish/guestfish-actions.pod:909
7699 msgid "download-offset"
7703 #: ../fish/guestfish-actions.pod:911
7706 " download-offset remotefilename (filename|-) offset size\n"
7711 #: ../fish/guestfish-actions.pod:916 ../src/guestfs-actions.pod:1447
7713 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7714 "region must be within the file or device)."
7718 #: ../fish/guestfish-actions.pod:919
7720 "Note that there is no limit on the amount of data that can be downloaded "
7721 "with this call, unlike with L</pread>, and this call always reads the full "
7722 "amount unless an error occurs."
7726 #: ../fish/guestfish-actions.pod:924
7727 msgid "See also L</download>, L</pread>."
7731 #: ../fish/guestfish-actions.pod:928
7736 #: ../fish/guestfish-actions.pod:930
7739 " drop-caches whattodrop\n"
7744 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1472
7746 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7747 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7748 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7752 #: ../fish/guestfish-actions.pod:937 ../src/guestfs-actions.pod:1477
7753 msgid "Setting C<whattodrop> to 3 should drop everything."
7757 #: ../fish/guestfish-actions.pod:939 ../src/guestfs-actions.pod:1479
7759 "This automatically calls L<sync(2)> before the operation, so that the "
7760 "maximum guest memory is freed."
7764 #: ../fish/guestfish-actions.pod:942
7769 #: ../fish/guestfish-actions.pod:944
7777 #: ../fish/guestfish-actions.pod:946 ../src/guestfs-actions.pod:1492
7779 "This command runs the C<du -s> command to estimate file space usage for "
7784 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1495
7786 "C<path> can be a file or a directory. If C<path> is a directory then the "
7787 "estimate includes the contents of the directory and all subdirectories "
7792 #: ../fish/guestfish-actions.pod:953 ../src/guestfs-actions.pod:1499
7794 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7798 #: ../fish/guestfish-actions.pod:956
7803 #: ../fish/guestfish-actions.pod:958
7806 " e2fsck-f device\n"
7811 #: ../fish/guestfish-actions.pod:960 ../src/guestfs-actions.pod:1517
7813 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7814 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7819 #: ../fish/guestfish-actions.pod:964
7821 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7822 "should use L</fsck>."
7826 #: ../fish/guestfish-actions.pod:967
7831 #: ../fish/guestfish-actions.pod:969
7834 " echo-daemon 'words ...'\n"
7839 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1534
7841 "This command concatenates the list of C<words> passed with single spaces "
7842 "between them and returns the resulting string."
7846 #: ../fish/guestfish-actions.pod:974 ../src/guestfs-actions.pod:1537
7847 msgid "You can use this command to test the connection through to the daemon."
7851 #: ../fish/guestfish-actions.pod:976
7852 msgid "See also L</ping-daemon>."
7856 #: ../fish/guestfish-actions.pod:978
7861 #: ../fish/guestfish-actions.pod:980
7864 " egrep regex path\n"
7869 #: ../fish/guestfish-actions.pod:982 ../src/guestfs-actions.pod:1553
7871 "This calls the external C<egrep> program and returns the matching lines."
7875 #: ../fish/guestfish-actions.pod:988
7880 #: ../fish/guestfish-actions.pod:990
7883 " egrepi regex path\n"
7888 #: ../fish/guestfish-actions.pod:992 ../src/guestfs-actions.pod:1572
7890 "This calls the external C<egrep -i> program and returns the matching lines."
7894 #: ../fish/guestfish-actions.pod:998
7899 #: ../fish/guestfish-actions.pod:1000
7902 " equal file1 file2\n"
7907 #: ../fish/guestfish-actions.pod:1002 ../src/guestfs-actions.pod:1591
7909 "This compares the two files C<file1> and C<file2> and returns true if their "
7910 "content is exactly equal, or false otherwise."
7914 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1594
7915 msgid "The external L<cmp(1)> program is used for the comparison."
7919 #: ../fish/guestfish-actions.pod:1007
7924 #: ../fish/guestfish-actions.pod:1009
7932 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1606
7934 "This returns C<true> if and only if there is a file, directory (or anything) "
7935 "with the given C<path> name."
7939 #: ../fish/guestfish-actions.pod:1014
7940 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7944 #: ../fish/guestfish-actions.pod:1016
7949 #: ../fish/guestfish-actions.pod:1018
7952 " fallocate path len\n"
7957 #: ../fish/guestfish-actions.pod:1020 ../fish/guestfish-actions.pod:1039
7958 #: ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1648
7960 "This command preallocates a file (containing zero bytes) named C<path> of "
7961 "size C<len> bytes. If the file exists already, it is overwritten."
7965 #: ../fish/guestfish-actions.pod:1024 ../src/guestfs-actions.pod:1633
7967 "Do not confuse this with the guestfish-specific C<alloc> command which "
7968 "allocates a file in the host and attaches it as a device."
7972 #: ../fish/guestfish-actions.pod:1028
7974 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7979 #: ../fish/guestfish-actions.pod:1035
7984 #: ../fish/guestfish-actions.pod:1037
7987 " fallocate64 path len\n"
7992 #: ../fish/guestfish-actions.pod:1043
7994 "Note that this call allocates disk blocks for the file. To create a sparse "
7995 "file use L</truncate-size> instead."
7999 #: ../fish/guestfish-actions.pod:1046
8001 "The deprecated call L</fallocate> does the same, but owing to an oversight "
8002 "it only allowed 30 bit lengths to be specified, effectively limiting the "
8003 "maximum size of files created through that call to 1GB."
8007 #: ../fish/guestfish-actions.pod:1051 ../src/guestfs-actions.pod:1660
8009 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8010 "commands which create a file in the host and attach it as a device."
8014 #: ../fish/guestfish-actions.pod:1055
8019 #: ../fish/guestfish-actions.pod:1057
8022 " fgrep pattern path\n"
8027 #: ../fish/guestfish-actions.pod:1059 ../src/guestfs-actions.pod:1675
8029 "This calls the external C<fgrep> program and returns the matching lines."
8033 #: ../fish/guestfish-actions.pod:1065
8038 #: ../fish/guestfish-actions.pod:1067
8041 " fgrepi pattern path\n"
8046 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1694
8048 "This calls the external C<fgrep -i> program and returns the matching lines."
8052 #: ../fish/guestfish-actions.pod:1075
8057 #: ../fish/guestfish-actions.pod:1077
8065 #: ../fish/guestfish-actions.pod:1079 ../src/guestfs-actions.pod:1712
8067 "This call uses the standard L<file(1)> command to determine the type or "
8068 "contents of the file."
8072 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1715
8074 "This call will also transparently look inside various types of compressed "
8079 #: ../fish/guestfish-actions.pod:1085 ../src/guestfs-actions.pod:1718
8081 "The exact command which runs is C<file -zb path>. Note in particular that "
8082 "the filename is not prepended to the output (the I<-b> option)."
8086 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1722
8088 "The output depends on the output of the underlying L<file(1)> command and it "
8089 "can change in future in ways beyond our control. In other words, the output "
8090 "is not guaranteed by the ABI."
8094 #: ../fish/guestfish-actions.pod:1093
8096 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
8097 "(etc), L</is-zero>."
8101 #: ../fish/guestfish-actions.pod:1096
8102 msgid "file-architecture"
8106 #: ../fish/guestfish-actions.pod:1098
8109 " file-architecture filename\n"
8114 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1740
8116 "This detects the architecture of the binary C<filename>, and returns it if "
8121 #: ../fish/guestfish-actions.pod:1103 ../src/guestfs-actions.pod:1743
8122 msgid "Currently defined architectures are:"
8126 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1747
8131 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1749
8133 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8134 "irrespective of the precise processor requirements of the binary."
8138 #: ../fish/guestfish-actions.pod:1112 ../src/guestfs-actions.pod:1752
8143 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1754
8144 msgid "64 bit x86-64."
8148 #: ../fish/guestfish-actions.pod:1116 ../src/guestfs-actions.pod:1756
8153 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1758
8154 msgid "32 bit SPARC."
8158 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1760
8163 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1762
8164 msgid "64 bit SPARC V9 and above."
8168 #: ../fish/guestfish-actions.pod:1124 ../src/guestfs-actions.pod:1764
8173 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1766
8174 msgid "Intel Itanium."
8178 #: ../fish/guestfish-actions.pod:1128 ../src/guestfs-actions.pod:1768
8183 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1770
8184 msgid "32 bit Power PC."
8188 #: ../fish/guestfish-actions.pod:1132 ../src/guestfs-actions.pod:1772
8193 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1774
8194 msgid "64 bit Power PC."
8198 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1778
8199 msgid "Libguestfs may return other architecture strings in future."
8203 #: ../fish/guestfish-actions.pod:1140 ../src/guestfs-actions.pod:1780
8204 msgid "The function works on at least the following types of files:"
8208 #: ../fish/guestfish-actions.pod:1146 ../src/guestfs-actions.pod:1786
8209 msgid "many types of Un*x and Linux binary"
8213 #: ../fish/guestfish-actions.pod:1150 ../src/guestfs-actions.pod:1790
8214 msgid "many types of Un*x and Linux shared library"
8218 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1794
8219 msgid "Windows Win32 and Win64 binaries"
8223 #: ../fish/guestfish-actions.pod:1158 ../src/guestfs-actions.pod:1798
8224 msgid "Windows Win32 and Win64 DLLs"
8228 #: ../fish/guestfish-actions.pod:1160 ../src/guestfs-actions.pod:1800
8229 msgid "Win32 binaries and DLLs return C<i386>."
8233 #: ../fish/guestfish-actions.pod:1162 ../src/guestfs-actions.pod:1802
8234 msgid "Win64 binaries and DLLs return C<x86_64>."
8238 #: ../fish/guestfish-actions.pod:1166 ../src/guestfs-actions.pod:1806
8239 msgid "Linux kernel modules"
8243 #: ../fish/guestfish-actions.pod:1170 ../src/guestfs-actions.pod:1810
8244 msgid "Linux new-style initrd images"
8248 #: ../fish/guestfish-actions.pod:1174 ../src/guestfs-actions.pod:1814
8249 msgid "some non-x86 Linux vmlinuz kernels"
8253 #: ../fish/guestfish-actions.pod:1178 ../src/guestfs-actions.pod:1818
8254 msgid "What it can't do currently:"
8258 #: ../fish/guestfish-actions.pod:1184 ../src/guestfs-actions.pod:1824
8259 msgid "static libraries (libfoo.a)"
8263 #: ../fish/guestfish-actions.pod:1188 ../src/guestfs-actions.pod:1828
8264 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8268 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:1832
8269 msgid "x86 Linux vmlinuz kernels"
8273 #: ../fish/guestfish-actions.pod:1194 ../src/guestfs-actions.pod:1834
8275 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8276 "compressed code, and are horribly hard to unpack. If you want to find the "
8277 "architecture of a kernel, use the architecture of the associated initrd or "
8278 "kernel module(s) instead."
8282 #: ../fish/guestfish-actions.pod:1201
8287 #: ../fish/guestfish-actions.pod:1203
8295 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1852
8296 msgid "This command returns the size of C<file> in bytes."
8300 #: ../fish/guestfish-actions.pod:1207
8302 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
8303 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
8307 #: ../fish/guestfish-actions.pod:1211
8312 #: ../fish/guestfish-actions.pod:1213
8315 " fill c len path\n"
8320 #: ../fish/guestfish-actions.pod:1215 ../src/guestfs-actions.pod:1870
8322 "This command creates a new file called C<path>. The initial content of the "
8323 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
8328 #: ../fish/guestfish-actions.pod:1219
8330 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8331 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
8336 #: ../fish/guestfish-actions.pod:1224
8337 msgid "fill-pattern"
8341 #: ../fish/guestfish-actions.pod:1226
8344 " fill-pattern pattern len path\n"
8349 #: ../fish/guestfish-actions.pod:1228
8351 "This function is like L</fill> except that it creates a new file of length "
8352 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
8353 "is truncated if necessary to ensure the length of the file is exactly C<len> "
8358 #: ../fish/guestfish-actions.pod:1233
8363 #: ../fish/guestfish-actions.pod:1235
8371 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1916
8373 "This command lists out all files and directories, recursively, starting at "
8374 "C<directory>. It is essentially equivalent to running the shell command "
8375 "C<find directory -print> but some post-processing happens on the output, "
8380 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1921
8382 "This returns a list of strings I<without any prefix>. Thus if the directory "
8387 #: ../fish/guestfish-actions.pod:1245 ../src/guestfs-actions.pod:1924
8397 #: ../fish/guestfish-actions.pod:1249
8398 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8402 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1931
8413 #: ../fish/guestfish-actions.pod:1257 ../src/guestfs-actions.pod:1936
8414 msgid "If C<directory> is not a directory, then this command returns an error."
8418 #: ../fish/guestfish-actions.pod:1260 ../src/guestfs-actions.pod:1939
8419 msgid "The returned list is sorted."
8423 #: ../fish/guestfish-actions.pod:1262
8424 msgid "See also L</find0>."
8428 #: ../fish/guestfish-actions.pod:1267
8433 #: ../fish/guestfish-actions.pod:1269
8436 " find0 directory (files|-)\n"
8441 #: ../fish/guestfish-actions.pod:1271 ../src/guestfs-actions.pod:1959
8443 "This command lists out all files and directories, recursively, starting at "
8444 "C<directory>, placing the resulting list in the external file called "
8449 #: ../fish/guestfish-actions.pod:1275
8451 "This command works the same way as L</find> with the following exceptions:"
8455 #: ../fish/guestfish-actions.pod:1282 ../src/guestfs-actions.pod:1970
8456 msgid "The resulting list is written to an external file."
8460 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1974
8462 "Items (filenames) in the result are separated by C<\\0> characters. See "
8463 "L<find(1)> option I<-print0>."
8467 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1979
8468 msgid "This command is not limited in the number of names that it can return."
8472 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:1984
8473 msgid "The result list is not sorted."
8477 #: ../fish/guestfish-actions.pod:1302
8478 msgid "findfs-label"
8482 #: ../fish/guestfish-actions.pod:1304
8485 " findfs-label label\n"
8490 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:1998
8492 "This command searches the filesystems and returns the one which has the "
8493 "given label. An error is returned if no such filesystem can be found."
8497 #: ../fish/guestfish-actions.pod:1310
8498 msgid "To find the label of a filesystem, use L</vfs-label>."
8502 #: ../fish/guestfish-actions.pod:1312
8507 #: ../fish/guestfish-actions.pod:1314
8510 " findfs-uuid uuid\n"
8515 #: ../fish/guestfish-actions.pod:1316 ../src/guestfs-actions.pod:2015
8517 "This command searches the filesystems and returns the one which has the "
8518 "given UUID. An error is returned if no such filesystem can be found."
8522 #: ../fish/guestfish-actions.pod:1320
8523 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8527 #: ../fish/guestfish-actions.pod:1322
8532 #: ../fish/guestfish-actions.pod:1324
8535 " fsck fstype device\n"
8540 #: ../fish/guestfish-actions.pod:1326 ../src/guestfs-actions.pod:2033
8542 "This runs the filesystem checker (fsck) on C<device> which should have "
8543 "filesystem type C<fstype>."
8547 #: ../fish/guestfish-actions.pod:1329 ../src/guestfs-actions.pod:2036
8549 "The returned integer is the status. See L<fsck(8)> for the list of status "
8550 "codes from C<fsck>."
8554 #: ../fish/guestfish-actions.pod:1338 ../src/guestfs-actions.pod:2045
8555 msgid "Multiple status codes can be summed together."
8559 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2049
8561 "A non-zero return code can mean \"success\", for example if errors have been "
8562 "corrected on the filesystem."
8566 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2054
8567 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8571 #: ../fish/guestfish-actions.pod:1352 ../src/guestfs-actions.pod:2059
8573 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8577 #: ../fish/guestfish-actions.pod:1354
8582 #: ../fish/guestfish-actions.pod:1356
8590 #: ../fish/guestfish-actions.pod:1358 ../src/guestfs-actions.pod:2070
8592 "Return the additional kernel options which are added to the guest kernel "
8597 #: ../fish/guestfish-actions.pod:1361 ../src/guestfs-actions.pod:2073
8598 msgid "If C<NULL> then no options are added."
8602 #: ../fish/guestfish-actions.pod:1363
8603 msgid "get-attach-method"
8607 #: ../fish/guestfish-actions.pod:1365
8610 " get-attach-method\n"
8615 #: ../fish/guestfish-actions.pod:1367
8616 msgid "Return the current attach method. See L</set-attach-method>."
8620 #: ../fish/guestfish-actions.pod:1369
8621 msgid "get-autosync"
8625 #: ../fish/guestfish-actions.pod:1371
8633 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2098
8634 msgid "Get the autosync flag."
8638 #: ../fish/guestfish-actions.pod:1375
8643 #: ../fish/guestfish-actions.pod:1377
8651 #: ../fish/guestfish-actions.pod:1379 ../src/guestfs-actions.pod:2109
8652 msgid "Return the direct appliance mode flag."
8656 #: ../fish/guestfish-actions.pod:1381
8661 #: ../fish/guestfish-actions.pod:1383
8664 " get-e2label device\n"
8669 #: ../fish/guestfish-actions.pod:1385 ../src/guestfs-actions.pod:2128
8671 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8675 #: ../fish/guestfish-actions.pod:1388
8677 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8682 #: ../fish/guestfish-actions.pod:1395
8687 #: ../fish/guestfish-actions.pod:1397
8690 " get-e2uuid device\n"
8695 #: ../fish/guestfish-actions.pod:1399 ../src/guestfs-actions.pod:2149
8697 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8701 #: ../fish/guestfish-actions.pod:1402
8703 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8708 #: ../fish/guestfish-actions.pod:1409
8713 #: ../fish/guestfish-actions.pod:1411
8721 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2162
8723 "This gets the memory size in megabytes allocated to the qemu subprocess."
8727 #: ../fish/guestfish-actions.pod:1416
8729 "If L</set-memsize> was not called on this handle, and if "
8730 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8731 "value for memsize."
8735 #: ../fish/guestfish-actions.pod:1420 ../fish/guestfish-actions.pod:1477
8736 #: ../fish/guestfish-actions.pod:4243 ../fish/guestfish-actions.pod:4345
8737 #: ../src/guestfs-actions.pod:2169 ../src/guestfs-actions.pod:2261
8738 #: ../src/guestfs-actions.pod:6455 ../src/guestfs-actions.pod:6581
8740 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8744 #: ../fish/guestfish-actions.pod:1423
8749 #: ../fish/guestfish-actions.pod:1425
8757 #: ../fish/guestfish-actions.pod:1427 ../src/guestfs-actions.pod:2181
8758 msgid "This returns the enable network flag."
8762 #: ../fish/guestfish-actions.pod:1429
8767 #: ../fish/guestfish-actions.pod:1431
8775 #: ../fish/guestfish-actions.pod:1433 ../src/guestfs-actions.pod:2192
8776 msgid "Return the current search path."
8780 #: ../fish/guestfish-actions.pod:1435 ../src/guestfs-actions.pod:2194
8782 "This is always non-NULL. If it wasn't set already, then this will return "
8787 #: ../fish/guestfish-actions.pod:1438
8792 #: ../fish/guestfish-actions.pod:1440
8800 #: ../fish/guestfish-actions.pod:1442 ../src/guestfs-actions.pod:2207
8801 msgid "This returns the process group flag."
8805 #: ../fish/guestfish-actions.pod:1444
8810 #: ../fish/guestfish-actions.pod:1446
8815 #: ../fish/guestfish-actions.pod:1448
8823 #: ../fish/guestfish-actions.pod:1450 ../src/guestfs-actions.pod:2218
8825 "Return the process ID of the qemu subprocess. If there is no qemu "
8826 "subprocess, then this will return an error."
8830 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2221
8831 msgid "This is an internal call used for debugging and testing."
8835 #: ../fish/guestfish-actions.pod:1455
8840 #: ../fish/guestfish-actions.pod:1457
8848 #: ../fish/guestfish-actions.pod:1459 ../src/guestfs-actions.pod:2232
8849 msgid "Return the current qemu binary."
8853 #: ../fish/guestfish-actions.pod:1461 ../src/guestfs-actions.pod:2234
8855 "This is always non-NULL. If it wasn't set already, then this will return "
8856 "the default qemu binary name."
8860 #: ../fish/guestfish-actions.pod:1464
8861 msgid "get-recovery-proc"
8865 #: ../fish/guestfish-actions.pod:1466
8868 " get-recovery-proc\n"
8873 #: ../fish/guestfish-actions.pod:1468 ../src/guestfs-actions.pod:2247
8874 msgid "Return the recovery process enabled flag."
8878 #: ../fish/guestfish-actions.pod:1470
8883 #: ../fish/guestfish-actions.pod:1472
8891 #: ../fish/guestfish-actions.pod:1474
8893 "This returns the current setting of the selinux flag which is passed to the "
8894 "appliance at boot time. See L</set-selinux>."
8898 #: ../fish/guestfish-actions.pod:1480
8903 #: ../fish/guestfish-actions.pod:1482
8911 #: ../fish/guestfish-actions.pod:1484 ../src/guestfs-actions.pod:2273
8912 msgid "This returns the number of virtual CPUs assigned to the appliance."
8916 #: ../fish/guestfish-actions.pod:1486
8921 #: ../fish/guestfish-actions.pod:1488
8929 #: ../fish/guestfish-actions.pod:1490 ../src/guestfs-actions.pod:2284
8931 "This returns the current state as an opaque integer. This is only useful "
8932 "for printing debug and internal error messages."
8936 #: ../fish/guestfish-actions.pod:1493 ../fish/guestfish-actions.pod:2452
8937 #: ../fish/guestfish-actions.pod:2470 ../fish/guestfish-actions.pod:2508
8938 #: ../fish/guestfish-actions.pod:2524 ../src/guestfs-actions.pod:2287
8939 #: ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:3635
8940 #: ../src/guestfs-actions.pod:3696 ../src/guestfs-actions.pod:3723
8941 msgid "For more information on states, see L<guestfs(3)>."
8945 #: ../fish/guestfish-actions.pod:1495
8950 #: ../fish/guestfish-actions.pod:1497
8958 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2298
8959 msgid "Return the command trace flag."
8963 #: ../fish/guestfish-actions.pod:1501
8968 #: ../fish/guestfish-actions.pod:1503
8976 #: ../fish/guestfish-actions.pod:1505
8978 "Return the current umask. By default the umask is C<022> unless it has been "
8979 "set by calling L</umask>."
8983 #: ../fish/guestfish-actions.pod:1508
8988 #: ../fish/guestfish-actions.pod:1510
8996 #: ../fish/guestfish-actions.pod:1512 ../src/guestfs-actions.pod:2321
8997 msgid "This returns the verbose messages flag."
9001 #: ../fish/guestfish-actions.pod:1514
9006 #: ../fish/guestfish-actions.pod:1516
9014 #: ../fish/guestfish-actions.pod:1518 ../src/guestfs-actions.pod:2332
9015 msgid "This gets the SELinux security context of the daemon."
9019 #: ../fish/guestfish-actions.pod:1520
9020 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
9024 #: ../fish/guestfish-actions.pod:1523
9029 #: ../fish/guestfish-actions.pod:1525
9032 " getxattr path name\n"
9037 #: ../fish/guestfish-actions.pod:1527
9039 "Get a single extended attribute from file C<path> named C<name>. This call "
9040 "follows symlinks. If you want to lookup an extended attribute for the "
9041 "symlink itself, use L</lgetxattr>."
9045 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:2597
9047 "Normally it is better to get all extended attributes from a file in one go "
9048 "by calling L</getxattrs>. However some Linux filesystem implementations are "
9049 "buggy and do not provide a way to list out attributes. For these "
9050 "filesystems (notably ntfs-3g) you have to know the names of the extended "
9051 "attributes you want in advance and call this function."
9055 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:2604
9056 #: ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:3856
9058 "Extended attribute values are blobs of binary data. If there is no extended "
9059 "attribute named C<name>, this returns an error."
9063 #: ../fish/guestfish-actions.pod:1541
9064 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
9068 #: ../fish/guestfish-actions.pod:1543
9073 #: ../fish/guestfish-actions.pod:1545
9081 #: ../fish/guestfish-actions.pod:1547 ../src/guestfs-actions.pod:2378
9083 "This call lists the extended attributes of the file or directory C<path>."
9087 #: ../fish/guestfish-actions.pod:1550 ../src/guestfs-actions.pod:2381
9089 "At the system call level, this is a combination of the L<listxattr(2)> and "
9090 "L<getxattr(2)> calls."
9094 #: ../fish/guestfish-actions.pod:1553
9095 msgid "See also: L</lgetxattrs>, L<attr(5)>."
9099 #: ../fish/guestfish-actions.pod:1555
9104 #: ../fish/guestfish-actions.pod:1557
9107 " glob-expand pattern\n"
9112 #: ../fish/guestfish-actions.pod:1559 ../src/guestfs-actions.pod:2398
9114 "This command searches for all the pathnames matching C<pattern> according to "
9115 "the wildcard expansion rules used by the shell."
9119 #: ../fish/guestfish-actions.pod:1563 ../src/guestfs-actions.pod:2402
9121 "If no paths match, then this returns an empty list (note: not an error)."
9125 #: ../fish/guestfish-actions.pod:1566 ../src/guestfs-actions.pod:2405
9127 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
9128 "GLOB_BRACE>. See that manual page for more details."
9132 #: ../fish/guestfish-actions.pod:1570
9137 #: ../fish/guestfish-actions.pod:1572
9140 " grep regex path\n"
9145 #: ../fish/guestfish-actions.pod:1574 ../src/guestfs-actions.pod:2422
9146 msgid "This calls the external C<grep> program and returns the matching lines."
9150 #: ../fish/guestfish-actions.pod:1580
9155 #: ../fish/guestfish-actions.pod:1582
9158 " grepi regex path\n"
9163 #: ../fish/guestfish-actions.pod:1584 ../src/guestfs-actions.pod:2441
9165 "This calls the external C<grep -i> program and returns the matching lines."
9169 #: ../fish/guestfish-actions.pod:1590
9170 msgid "grub-install"
9174 #: ../fish/guestfish-actions.pod:1592
9177 " grub-install root device\n"
9182 #: ../fish/guestfish-actions.pod:1594 ../src/guestfs-actions.pod:2460
9184 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
9185 "with the root directory being C<root>."
9189 #: ../fish/guestfish-actions.pod:1603 ../src/guestfs-actions.pod:2469
9191 "There is currently no way in the API to install grub2, which is used by most "
9192 "modern Linux guests. It is possible to run the grub2 command from the "
9193 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
9197 #: ../fish/guestfish-actions.pod:1610 ../src/guestfs-actions.pod:2476
9199 "This uses C<grub-install> from the host. Unfortunately grub is not always "
9200 "compatible with itself, so this only works in rather narrow circumstances. "
9201 "Careful testing with each guest version is advisable."
9205 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2483
9207 "If grub-install reports the error \"No suitable drive was found in the "
9208 "generated device map.\" it may be that you need to create a C</boot/grub/"
9209 "device.map> file first that contains the mapping between grub device names "
9210 "and Linux device names. It is usually sufficient to create a file "
9215 #: ../fish/guestfish-actions.pod:1624 ../src/guestfs-actions.pod:2490
9223 #: ../fish/guestfish-actions.pod:1626 ../src/guestfs-actions.pod:2492
9224 msgid "replacing C</dev/vda> with the name of the installation device."
9228 #: ../fish/guestfish-actions.pod:1630
9233 #: ../fish/guestfish-actions.pod:1632
9241 #: ../fish/guestfish-actions.pod:1634 ../src/guestfs-actions.pod:2506
9243 "This command returns up to the first 10 lines of a file as a list of strings."
9247 #: ../fish/guestfish-actions.pod:1640
9252 #: ../fish/guestfish-actions.pod:1642
9255 " head-n nrlines path\n"
9260 #: ../fish/guestfish-actions.pod:1644 ../src/guestfs-actions.pod:2525
9262 "If the parameter C<nrlines> is a positive number, this returns the first "
9263 "C<nrlines> lines of the file C<path>."
9267 #: ../fish/guestfish-actions.pod:1647 ../src/guestfs-actions.pod:2528
9269 "If the parameter C<nrlines> is a negative number, this returns lines from "
9270 "the file C<path>, excluding the last C<nrlines> lines."
9274 #: ../fish/guestfish-actions.pod:1650 ../fish/guestfish-actions.pod:4735
9275 #: ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:7169
9276 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9280 #: ../fish/guestfish-actions.pod:1655
9285 #: ../fish/guestfish-actions.pod:1657
9293 #: ../fish/guestfish-actions.pod:1659 ../src/guestfs-actions.pod:2548
9295 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
9296 "readable, canonical hex dump of the file."
9300 #: ../fish/guestfish-actions.pod:1665
9305 #: ../fish/guestfish-actions.pod:1667
9308 " initrd-cat initrdpath filename\n"
9313 #: ../fish/guestfish-actions.pod:1669 ../src/guestfs-actions.pod:2567
9315 "This command unpacks the file C<filename> from the initrd file called "
9316 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9321 #: ../fish/guestfish-actions.pod:1673 ../src/guestfs-actions.pod:2571
9323 "For example, in guestfish you could use the following command to examine the "
9324 "boot script (usually called C</init>) contained in a Linux initrd or "
9329 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2575
9332 " initrd-cat /boot/initrd-<version>.img init\n"
9337 #: ../fish/guestfish-actions.pod:1679
9338 msgid "See also L</initrd-list>."
9342 #: ../fish/guestfish-actions.pod:1684
9347 #: ../fish/guestfish-actions.pod:1686
9350 " initrd-list path\n"
9355 #: ../fish/guestfish-actions.pod:1688 ../src/guestfs-actions.pod:2594
9356 msgid "This command lists out files contained in an initrd."
9360 #: ../fish/guestfish-actions.pod:1690 ../src/guestfs-actions.pod:2596
9362 "The files are listed without any initial C</> character. The files are "
9363 "listed in the order they appear (not necessarily alphabetical). Directory "
9364 "names are listed as separate items."
9368 #: ../fish/guestfish-actions.pod:1694 ../src/guestfs-actions.pod:2600
9370 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9371 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9376 #: ../fish/guestfish-actions.pod:1698
9377 msgid "inotify-add-watch"
9381 #: ../fish/guestfish-actions.pod:1700
9384 " inotify-add-watch path mask\n"
9389 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2617
9390 msgid "Watch C<path> for the events listed in C<mask>."
9394 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2619
9396 "Note that if C<path> is a directory then events within that directory are "
9397 "watched, but this does I<not> happen recursively (in subdirectories)."
9401 #: ../fish/guestfish-actions.pod:1708 ../src/guestfs-actions.pod:2623
9403 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9404 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9408 #: ../fish/guestfish-actions.pod:1712
9409 msgid "inotify-close"
9413 #: ../fish/guestfish-actions.pod:1714
9421 #: ../fish/guestfish-actions.pod:1716 ../src/guestfs-actions.pod:2636
9423 "This closes the inotify handle which was previously opened by inotify_init. "
9424 "It removes all watches, throws away any pending events, and deallocates all "
9429 #: ../fish/guestfish-actions.pod:1720
9430 msgid "inotify-files"
9434 #: ../fish/guestfish-actions.pod:1722
9442 #: ../fish/guestfish-actions.pod:1724
9444 "This function is a helpful wrapper around L</inotify-read> which just "
9445 "returns a list of pathnames of objects that were touched. The returned "
9446 "pathnames are sorted and deduplicated."
9450 #: ../fish/guestfish-actions.pod:1728
9451 msgid "inotify-init"
9455 #: ../fish/guestfish-actions.pod:1730
9458 " inotify-init maxevents\n"
9463 #: ../fish/guestfish-actions.pod:1732 ../src/guestfs-actions.pod:2665
9465 "This command creates a new inotify handle. The inotify subsystem can be "
9466 "used to notify events which happen to objects in the guest filesystem."
9470 #: ../fish/guestfish-actions.pod:1736
9472 "C<maxevents> is the maximum number of events which will be queued up between "
9473 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9474 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9475 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9476 "but records the fact that it threw them away by setting a flag "
9477 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9481 #: ../fish/guestfish-actions.pod:1746
9483 "Before any events are generated, you have to add some watches to the "
9484 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9485 "L</inotify-watch-all>."
9489 #: ../fish/guestfish-actions.pod:1752
9491 "Queued up events should be read periodically by calling L</inotify-read> (or "
9492 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9493 "If you don't read the events out often enough then you risk the internal "
9494 "queue overflowing."
9498 #: ../fish/guestfish-actions.pod:1759
9500 "The handle should be closed after use by calling L</inotify-close>. This "
9501 "also removes any watches automatically."
9505 #: ../fish/guestfish-actions.pod:1763 ../src/guestfs-actions.pod:2696
9507 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9508 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9509 "that there is one global inotify handle per libguestfs instance."
9513 #: ../fish/guestfish-actions.pod:1768
9514 msgid "inotify-read"
9518 #: ../fish/guestfish-actions.pod:1770
9526 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2710
9528 "Return the complete queue of events that have happened since the previous "
9533 #: ../fish/guestfish-actions.pod:1775 ../src/guestfs-actions.pod:2713
9534 msgid "If no events have happened, this returns an empty list."
9538 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2715
9540 "I<Note>: In order to make sure that all events have been read, you must call "
9541 "this function repeatedly until it returns an empty list. The reason is that "
9542 "the call will read events up to the maximum appliance-to-host message size "
9543 "and leave remaining events in the queue."
9547 #: ../fish/guestfish-actions.pod:1783
9548 msgid "inotify-rm-watch"
9552 #: ../fish/guestfish-actions.pod:1785
9555 " inotify-rm-watch wd\n"
9560 #: ../fish/guestfish-actions.pod:1787
9561 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9565 #: ../fish/guestfish-actions.pod:1790
9566 msgid "inspect-get-arch"
9570 #: ../fish/guestfish-actions.pod:1792
9573 " inspect-get-arch root\n"
9578 #: ../fish/guestfish-actions.pod:1794
9580 "This returns the architecture of the inspected operating system. The "
9581 "possible return values are listed under L</file-architecture>."
9585 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2750
9587 "If the architecture could not be determined, then the string C<unknown> is "
9592 #: ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:1896
9593 #: ../fish/guestfish-actions.pod:1975 ../fish/guestfish-actions.pod:1987
9594 #: ../fish/guestfish-actions.pod:2071 ../fish/guestfish-actions.pod:2133
9595 #: ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2168
9596 #: ../fish/guestfish-actions.pod:2208 ../fish/guestfish-actions.pod:2244
9597 #: ../fish/guestfish-actions.pod:2257 ../fish/guestfish-actions.pod:2270
9598 #: ../fish/guestfish-actions.pod:2280 ../fish/guestfish-actions.pod:2290
9599 #: ../fish/guestfish-actions.pod:2302 ../fish/guestfish-actions.pod:2398
9600 #: ../fish/guestfish-actions.pod:2432 ../src/guestfs-actions.pod:2753
9601 #: ../src/guestfs-actions.pod:2855 ../src/guestfs-actions.pod:2959
9602 #: ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:3109
9603 #: ../src/guestfs-actions.pod:3193 ../src/guestfs-actions.pod:3221
9604 #: ../src/guestfs-actions.pod:3242 ../src/guestfs-actions.pod:3295
9605 #: ../src/guestfs-actions.pod:3339 ../src/guestfs-actions.pod:3359
9606 #: ../src/guestfs-actions.pod:3379 ../src/guestfs-actions.pod:3396
9607 #: ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3430
9608 #: ../src/guestfs-actions.pod:3532 ../src/guestfs-actions.pod:3573
9609 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9613 #: ../fish/guestfish-actions.pod:1803
9614 msgid "inspect-get-distro"
9618 #: ../fish/guestfish-actions.pod:1805
9621 " inspect-get-distro root\n"
9626 #: ../fish/guestfish-actions.pod:1807 ../src/guestfs-actions.pod:2766
9628 "This returns the distro (distribution) of the inspected operating system."
9632 #: ../fish/guestfish-actions.pod:1810 ../src/guestfs-actions.pod:2769
9633 msgid "Currently defined distros are:"
9637 #: ../fish/guestfish-actions.pod:1814 ../src/guestfs-actions.pod:2773
9638 msgid "\"archlinux\""
9642 #: ../fish/guestfish-actions.pod:1816 ../src/guestfs-actions.pod:2775
9647 #: ../fish/guestfish-actions.pod:1818 ../src/guestfs-actions.pod:2777
9652 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2779
9657 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2781
9662 #: ../fish/guestfish-actions.pod:1824 ../src/guestfs-actions.pod:2783
9667 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2785
9672 #: ../fish/guestfish-actions.pod:1828 ../src/guestfs-actions.pod:2787
9677 #: ../fish/guestfish-actions.pod:1830 ../src/guestfs-actions.pod:2789
9682 #: ../fish/guestfish-actions.pod:1832 ../src/guestfs-actions.pod:2791
9687 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2793
9688 msgid "\"linuxmint\""
9692 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2795
9697 #: ../fish/guestfish-actions.pod:1838 ../src/guestfs-actions.pod:2797
9702 #: ../fish/guestfish-actions.pod:1840 ../src/guestfs-actions.pod:2799
9707 #: ../fish/guestfish-actions.pod:1842 ../src/guestfs-actions.pod:2801
9708 msgid "\"mandriva\""
9712 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2803
9717 #: ../fish/guestfish-actions.pod:1846 ../src/guestfs-actions.pod:2805
9722 #: ../fish/guestfish-actions.pod:1848 ../src/guestfs-actions.pod:2807
9727 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2809
9728 msgid "\"opensuse\""
9732 #: ../fish/guestfish-actions.pod:1852 ../src/guestfs-actions.pod:2811
9737 #: ../fish/guestfish-actions.pod:1854 ../src/guestfs-actions.pod:2813
9742 #: ../fish/guestfish-actions.pod:1856 ../src/guestfs-actions.pod:2815
9747 #: ../fish/guestfish-actions.pod:1858 ../src/guestfs-actions.pod:2817
9748 msgid "\"redhat-based\""
9752 #: ../fish/guestfish-actions.pod:1860 ../src/guestfs-actions.pod:2819
9753 msgid "Some Red Hat-derived distro."
9757 #: ../fish/guestfish-actions.pod:1862 ../src/guestfs-actions.pod:2821
9762 #: ../fish/guestfish-actions.pod:1864 ../src/guestfs-actions.pod:2823
9763 msgid "Red Hat Enterprise Linux."
9767 #: ../fish/guestfish-actions.pod:1866 ../src/guestfs-actions.pod:2825
9768 msgid "\"scientificlinux\""
9772 #: ../fish/guestfish-actions.pod:1868 ../src/guestfs-actions.pod:2827
9773 msgid "Scientific Linux."
9777 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2829
9778 msgid "\"slackware\""
9782 #: ../fish/guestfish-actions.pod:1872 ../src/guestfs-actions.pod:2831
9787 #: ../fish/guestfish-actions.pod:1874 ../src/guestfs-actions.pod:2833
9788 msgid "\"ttylinux\""
9792 #: ../fish/guestfish-actions.pod:1876 ../src/guestfs-actions.pod:2835
9797 #: ../fish/guestfish-actions.pod:1878 ../src/guestfs-actions.pod:2837
9802 #: ../fish/guestfish-actions.pod:1880 ../src/guestfs-actions.pod:2839
9807 #: ../fish/guestfish-actions.pod:1882 ../fish/guestfish-actions.pod:1966
9808 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:2841
9809 #: ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3330
9814 #: ../fish/guestfish-actions.pod:1884 ../src/guestfs-actions.pod:2843
9815 msgid "The distro could not be determined."
9819 #: ../fish/guestfish-actions.pod:1886 ../fish/guestfish-actions.pod:2223
9820 #: ../src/guestfs-actions.pod:2845 ../src/guestfs-actions.pod:3318
9825 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:2847
9827 "Windows does not have distributions. This string is returned if the OS type "
9832 #: ../fish/guestfish-actions.pod:1893 ../fish/guestfish-actions.pod:1972
9833 #: ../fish/guestfish-actions.pod:2241 ../src/guestfs-actions.pod:2852
9834 #: ../src/guestfs-actions.pod:2956 ../src/guestfs-actions.pod:3336
9836 "Future versions of libguestfs may return other strings here. The caller "
9837 "should be prepared to handle any string."
9841 #: ../fish/guestfish-actions.pod:1898
9842 msgid "inspect-get-drive-mappings"
9846 #: ../fish/guestfish-actions.pod:1900
9849 " inspect-get-drive-mappings root\n"
9854 #: ../fish/guestfish-actions.pod:1902 ../src/guestfs-actions.pod:2868
9856 "This call is useful for Windows which uses a primitive system of assigning "
9857 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9858 "Windows Registry to find out how disks/partitions are mapped to drive "
9859 "letters, and returns a hash table as in the example below:"
9863 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2874
9873 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:2878
9875 "Note that keys are drive letters. For Windows, the key is case insensitive "
9876 "and just contains the drive letter, without the customary colon separator "
9881 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:2882
9883 "In future we may support other operating systems that also used drive "
9884 "letters, but the keys for those might not be case insensitive and might be "
9885 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9890 #: ../fish/guestfish-actions.pod:1921 ../src/guestfs-actions.pod:2887
9892 "For Windows guests, currently only hard drive mappings are returned. "
9893 "Removable disks (eg. DVD-ROMs) are ignored."
9897 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:2890
9899 "For guests that do not use drive mappings, or if the drive mappings could "
9900 "not be determined, this returns an empty hash table."
9904 #: ../fish/guestfish-actions.pod:1927
9906 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9907 "get-mountpoints>, L</inspect-get-filesystems>."
9911 #: ../fish/guestfish-actions.pod:1931
9912 msgid "inspect-get-filesystems"
9916 #: ../fish/guestfish-actions.pod:1933
9919 " inspect-get-filesystems root\n"
9924 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2911
9926 "This returns a list of all the filesystems that we think are associated with "
9927 "this operating system. This includes the root filesystem, other ordinary "
9928 "filesystems, and non-mounted devices like swap partitions."
9932 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2916
9934 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9935 "to be shared between operating systems."
9939 #: ../fish/guestfish-actions.pod:1943
9941 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9946 #: ../fish/guestfish-actions.pod:1946
9947 msgid "inspect-get-format"
9951 #: ../fish/guestfish-actions.pod:1948
9954 " inspect-get-format root\n"
9959 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2934
9961 "This returns the format of the inspected operating system. You can use it "
9962 "to detect install images, live CDs and similar."
9966 #: ../fish/guestfish-actions.pod:1953 ../src/guestfs-actions.pod:2937
9967 msgid "Currently defined formats are:"
9971 #: ../fish/guestfish-actions.pod:1957 ../src/guestfs-actions.pod:2941
9972 msgid "\"installed\""
9976 #: ../fish/guestfish-actions.pod:1959 ../src/guestfs-actions.pod:2943
9977 msgid "This is an installed operating system."
9981 #: ../fish/guestfish-actions.pod:1961 ../src/guestfs-actions.pod:2945
9982 msgid "\"installer\""
9986 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:2947
9988 "The disk image being inspected is not an installed operating system, but a "
9989 "I<bootable> install disk, live CD, or similar."
9993 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2952
9994 msgid "The format of this disk image is not known."
9998 #: ../fish/guestfish-actions.pod:1977
9999 msgid "inspect-get-hostname"
10003 #: ../fish/guestfish-actions.pod:1979
10006 " inspect-get-hostname root\n"
10011 #: ../fish/guestfish-actions.pod:1981 ../src/guestfs-actions.pod:2972
10013 "This function returns the hostname of the operating system as found by "
10014 "inspection of the guest's configuration files."
10018 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2975
10020 "If the hostname could not be determined, then the string C<unknown> is "
10025 #: ../fish/guestfish-actions.pod:1989
10026 msgid "inspect-get-icon"
10030 #: ../fish/guestfish-actions.pod:1991
10033 " inspect-get-icon root [favicon:..] [highquality:..]\n"
10038 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3001
10040 "This function returns an icon corresponding to the inspected operating "
10041 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
10042 "to PNG if necessary)."
10046 #: ../fish/guestfish-actions.pod:1997 ../src/guestfs-actions.pod:3005
10048 "If it was not possible to get an icon this function returns a zero-length "
10049 "(non-NULL) buffer. I<Callers must check for this case>."
10053 #: ../fish/guestfish-actions.pod:2000 ../src/guestfs-actions.pod:3008
10055 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
10056 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
10057 "this file will be returned. You can disable favicons by passing the "
10058 "optional C<favicon> boolean as false (default is true)."
10062 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3014
10064 "If finding the favicon fails, then we look in other places in the guest for "
10069 #: ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:3017
10071 "If the optional C<highquality> boolean is true then only high quality icons "
10072 "are returned, which means only icons of high resolution with an alpha "
10073 "channel. The default (false) is to return any icon we can, even if it is of "
10074 "substandard quality."
10078 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3028
10080 "Unlike most other inspection API calls, the guest's disks must be mounted up "
10081 "before you call this, since it needs to read information from the guest "
10082 "filesystem during the call."
10086 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3034
10088 "B<Security:> The icon data comes from the untrusted guest, and should be "
10089 "treated with caution. PNG files have been known to contain exploits. "
10090 "Ensure that libpng (or other relevant libraries) are fully up to date before "
10091 "trying to process or display the icon."
10095 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3042
10097 "The PNG image returned can be any size. It might not be square. Libguestfs "
10098 "tries to return the largest, highest quality icon available. The "
10099 "application must scale the icon to the required size."
10103 #: ../fish/guestfish-actions.pod:2041 ../src/guestfs-actions.pod:3049
10105 "Extracting icons from Windows guests requires the external C<wrestool> "
10106 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
10107 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
10108 "installed separately."
10112 #: ../fish/guestfish-actions.pod:2048 ../src/guestfs-actions.pod:3056
10114 "Operating system icons are usually trademarks. Seek legal advice before "
10115 "using trademarks in applications."
10119 #: ../fish/guestfish-actions.pod:2055
10120 msgid "inspect-get-major-version"
10124 #: ../fish/guestfish-actions.pod:2057
10127 " inspect-get-major-version root\n"
10132 #: ../fish/guestfish-actions.pod:2059 ../src/guestfs-actions.pod:3097
10134 "This returns the major version number of the inspected operating system."
10138 #: ../fish/guestfish-actions.pod:2062 ../src/guestfs-actions.pod:3100
10140 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
10141 "popular public names used by the operating system. Notably the operating "
10142 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
10143 "1). You can find out the real versions corresponding to releases of Windows "
10144 "by consulting Wikipedia or MSDN."
10148 #: ../fish/guestfish-actions.pod:2069 ../fish/guestfish-actions.pod:2080
10149 #: ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3124
10150 msgid "If the version could not be determined, then C<0> is returned."
10154 #: ../fish/guestfish-actions.pod:2073
10155 msgid "inspect-get-minor-version"
10159 #: ../fish/guestfish-actions.pod:2075
10162 " inspect-get-minor-version root\n"
10167 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3121
10169 "This returns the minor version number of the inspected operating system."
10173 #: ../fish/guestfish-actions.pod:2082
10175 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10176 "get-major-version>."
10180 #: ../fish/guestfish-actions.pod:2085
10181 msgid "inspect-get-mountpoints"
10185 #: ../fish/guestfish-actions.pod:2087
10188 " inspect-get-mountpoints root\n"
10193 #: ../fish/guestfish-actions.pod:2089 ../src/guestfs-actions.pod:3139
10195 "This returns a hash of where we think the filesystems associated with this "
10196 "operating system should be mounted. Callers should note that this is at "
10197 "best an educated guess made by reading configuration files such as C</etc/"
10198 "fstab>. I<In particular note> that this may return filesystems which are "
10199 "non-existent or not mountable and callers should be prepared to handle or "
10200 "ignore failures if they try to mount them."
10204 #: ../fish/guestfish-actions.pod:2098 ../src/guestfs-actions.pod:3148
10206 "Each element in the returned hashtable has a key which is the path of the "
10207 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
10208 "mounted there (eg. C</dev/sda1>)."
10212 #: ../fish/guestfish-actions.pod:2103 ../src/guestfs-actions.pod:3153
10214 "Non-mounted devices such as swap devices are I<not> returned in this list."
10218 #: ../fish/guestfish-actions.pod:2106
10220 "For operating systems like Windows which still use drive letters, this call "
10221 "will only return an entry for the first drive \"mounted on\" C</>. For "
10222 "information about the mapping of drive letters to partitions, see L</inspect-"
10223 "get-drive-mappings>."
10227 #: ../fish/guestfish-actions.pod:2112
10229 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10230 "get-filesystems>."
10234 #: ../fish/guestfish-actions.pod:2115
10235 msgid "inspect-get-package-format"
10239 #: ../fish/guestfish-actions.pod:2117
10242 " inspect-get-package-format root\n"
10247 #: ../fish/guestfish-actions.pod:2119
10249 "This function and L</inspect-get-package-management> return the package "
10250 "format and package management tool used by the inspected operating system. "
10251 "For example for Fedora these functions would return C<rpm> (package format) "
10252 "and C<yum> (package management)."
10256 #: ../fish/guestfish-actions.pod:2125 ../src/guestfs-actions.pod:3185
10258 "This returns the string C<unknown> if we could not determine the package "
10259 "format I<or> if the operating system does not have a real packaging system "
10264 #: ../fish/guestfish-actions.pod:2129 ../src/guestfs-actions.pod:3189
10266 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
10267 "C<pkgsrc>. Future versions of libguestfs may return other strings."
10271 #: ../fish/guestfish-actions.pod:2135
10272 msgid "inspect-get-package-management"
10276 #: ../fish/guestfish-actions.pod:2137
10279 " inspect-get-package-management root\n"
10284 #: ../fish/guestfish-actions.pod:2139
10286 "L</inspect-get-package-format> and this function return the package format "
10287 "and package management tool used by the inspected operating system. For "
10288 "example for Fedora these functions would return C<rpm> (package format) and "
10289 "C<yum> (package management)."
10293 #: ../fish/guestfish-actions.pod:2145 ../src/guestfs-actions.pod:3212
10295 "This returns the string C<unknown> if we could not determine the package "
10296 "management tool I<or> if the operating system does not have a real packaging "
10297 "system (eg. Windows)."
10301 #: ../fish/guestfish-actions.pod:2149 ../src/guestfs-actions.pod:3216
10303 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10304 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
10305 "versions of libguestfs may return other strings."
10309 #: ../fish/guestfish-actions.pod:2156
10310 msgid "inspect-get-product-name"
10314 #: ../fish/guestfish-actions.pod:2158
10317 " inspect-get-product-name root\n"
10322 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3234
10324 "This returns the product name of the inspected operating system. The "
10325 "product name is generally some freeform string which can be displayed to the "
10326 "user, but should not be parsed by programs."
10330 #: ../fish/guestfish-actions.pod:2165 ../src/guestfs-actions.pod:3239
10332 "If the product name could not be determined, then the string C<unknown> is "
10337 #: ../fish/guestfish-actions.pod:2170
10338 msgid "inspect-get-product-variant"
10342 #: ../fish/guestfish-actions.pod:2172
10345 " inspect-get-product-variant root\n"
10350 #: ../fish/guestfish-actions.pod:2174 ../src/guestfs-actions.pod:3255
10351 msgid "This returns the product variant of the inspected operating system."
10355 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3258
10357 "For Windows guests, this returns the contents of the Registry key C<HKLM"
10358 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
10359 "is usually a string such as C<Client> or C<Server> (other values are "
10360 "possible). This can be used to distinguish consumer and enterprise versions "
10361 "of Windows that have the same version number (for example, Windows 7 and "
10362 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10363 "the latter is C<Server>)."
10367 #: ../fish/guestfish-actions.pod:2186 ../src/guestfs-actions.pod:3267
10369 "For enterprise Linux guests, in future we intend this to return the product "
10370 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10371 "implemented at present."
10375 #: ../fish/guestfish-actions.pod:2190 ../src/guestfs-actions.pod:3271
10377 "If the product variant could not be determined, then the string C<unknown> "
10382 #: ../fish/guestfish-actions.pod:2193
10384 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10385 "get-product-name>, L</inspect-get-major-version>."
10389 #: ../fish/guestfish-actions.pod:2197
10390 msgid "inspect-get-roots"
10394 #: ../fish/guestfish-actions.pod:2199
10397 " inspect-get-roots\n"
10402 #: ../fish/guestfish-actions.pod:2201
10404 "This function is a convenient way to get the list of root devices, as "
10405 "returned from a previous call to L</inspect-os>, but without redoing the "
10406 "whole inspection process."
10410 #: ../fish/guestfish-actions.pod:2205
10412 "This returns an empty list if either no root devices were found or the "
10413 "caller has not called L</inspect-os>."
10417 #: ../fish/guestfish-actions.pod:2210
10418 msgid "inspect-get-type"
10422 #: ../fish/guestfish-actions.pod:2212
10425 " inspect-get-type root\n"
10430 #: ../fish/guestfish-actions.pod:2214 ../src/guestfs-actions.pod:3309
10432 "This returns the type of the inspected operating system. Currently defined "
10437 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3314
10442 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3316
10443 msgid "Any Linux-based operating system."
10447 #: ../fish/guestfish-actions.pod:2225 ../src/guestfs-actions.pod:3320
10448 msgid "Any Microsoft Windows operating system."
10452 #: ../fish/guestfish-actions.pod:2227 ../src/guestfs-actions.pod:3322
10453 msgid "\"freebsd\""
10457 #: ../fish/guestfish-actions.pod:2229 ../src/guestfs-actions.pod:3324
10462 #: ../fish/guestfish-actions.pod:2231 ../src/guestfs-actions.pod:3326
10467 #: ../fish/guestfish-actions.pod:2233 ../src/guestfs-actions.pod:3328
10472 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3332
10473 msgid "The operating system type could not be determined."
10477 #: ../fish/guestfish-actions.pod:2246
10478 msgid "inspect-get-windows-current-control-set"
10482 #: ../fish/guestfish-actions.pod:2248
10485 " inspect-get-windows-current-control-set root\n"
10490 #: ../fish/guestfish-actions.pod:2250 ../src/guestfs-actions.pod:3352
10492 "This returns the Windows CurrentControlSet of the inspected guest. The "
10493 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10497 #: ../fish/guestfish-actions.pod:2253 ../src/guestfs-actions.pod:3355
10499 "This call assumes that the guest is Windows and that the Registry could be "
10500 "examined by inspection. If this is not the case then an error is returned."
10504 #: ../fish/guestfish-actions.pod:2259
10505 msgid "inspect-get-windows-systemroot"
10509 #: ../fish/guestfish-actions.pod:2261
10512 " inspect-get-windows-systemroot root\n"
10517 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3372
10519 "This returns the Windows systemroot of the inspected guest. The systemroot "
10520 "is a directory path such as C</WINDOWS>."
10524 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3375
10526 "This call assumes that the guest is Windows and that the systemroot could be "
10527 "determined by inspection. If this is not the case then an error is returned."
10531 #: ../fish/guestfish-actions.pod:2272
10532 msgid "inspect-is-live"
10536 #: ../fish/guestfish-actions.pod:2274
10539 " inspect-is-live root\n"
10544 #: ../fish/guestfish-actions.pod:2276
10546 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10547 "then this returns true if a live image was detected on the disk."
10551 #: ../fish/guestfish-actions.pod:2282
10552 msgid "inspect-is-multipart"
10556 #: ../fish/guestfish-actions.pod:2284
10559 " inspect-is-multipart root\n"
10564 #: ../fish/guestfish-actions.pod:2286
10566 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10567 "then this returns true if the disk is part of a set."
10571 #: ../fish/guestfish-actions.pod:2292
10572 msgid "inspect-is-netinst"
10576 #: ../fish/guestfish-actions.pod:2294
10579 " inspect-is-netinst root\n"
10584 #: ../fish/guestfish-actions.pod:2296
10586 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10587 "then this returns true if the disk is a network installer, ie. not a self-"
10588 "contained install CD but one which is likely to require network access to "
10589 "complete the install."
10593 #: ../fish/guestfish-actions.pod:2304
10594 msgid "inspect-list-applications"
10598 #: ../fish/guestfish-actions.pod:2306
10601 " inspect-list-applications root\n"
10606 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3442
10607 msgid "Return the list of applications installed in the operating system."
10611 #: ../fish/guestfish-actions.pod:2310
10613 "I<Note:> This call works differently from other parts of the inspection "
10614 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10615 "then mount up the disks, before calling this. Listing applications is a "
10616 "significantly more difficult operation which requires access to the full "
10617 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10618 "are just returning data cached in the libguestfs handle, this call actually "
10619 "reads parts of the mounted filesystems during the call."
10623 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3454
10625 "This returns an empty list if the inspection code was not able to determine "
10626 "the list of applications."
10630 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3457
10631 msgid "The application structure contains the following fields:"
10635 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3461
10636 msgid "C<app_name>"
10640 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3463
10642 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10643 "guests, this is the package name."
10647 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3466
10648 msgid "C<app_display_name>"
10652 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3468
10654 "The display name of the application, sometimes localized to the install "
10655 "language of the guest operating system."
10659 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3471
10661 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10662 "to display something can use C<app_name> instead."
10666 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3474
10667 msgid "C<app_epoch>"
10671 #: ../fish/guestfish-actions.pod:2342 ../src/guestfs-actions.pod:3476
10673 "For package managers which use epochs, this contains the epoch of the "
10674 "package (an integer). If unavailable, this is returned as C<0>."
10678 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3479
10679 msgid "C<app_version>"
10683 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3481
10685 "The version string of the application or package. If unavailable this is "
10686 "returned as an empty string C<\"\">."
10690 #: ../fish/guestfish-actions.pod:2350 ../src/guestfs-actions.pod:3484
10691 msgid "C<app_release>"
10695 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3486
10697 "The release string of the application or package, for package managers that "
10698 "use this. If unavailable this is returned as an empty string C<\"\">."
10702 #: ../fish/guestfish-actions.pod:2356 ../src/guestfs-actions.pod:3490
10703 msgid "C<app_install_path>"
10707 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3492
10709 "The installation path of the application (on operating systems such as "
10710 "Windows which use installation paths). This path is in the format used by "
10711 "the guest operating system, it is not a libguestfs path."
10715 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3497
10716 msgid "If unavailable this is returned as an empty string C<\"\">."
10720 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3499
10721 msgid "C<app_trans_path>"
10725 #: ../fish/guestfish-actions.pod:2367 ../src/guestfs-actions.pod:3501
10727 "The install path translated into a libguestfs path. If unavailable this is "
10728 "returned as an empty string C<\"\">."
10732 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3504
10733 msgid "C<app_publisher>"
10737 #: ../fish/guestfish-actions.pod:2372 ../src/guestfs-actions.pod:3506
10739 "The name of the publisher of the application, for package managers that use "
10740 "this. If unavailable this is returned as an empty string C<\"\">."
10744 #: ../fish/guestfish-actions.pod:2376 ../src/guestfs-actions.pod:3510
10749 #: ../fish/guestfish-actions.pod:2378 ../src/guestfs-actions.pod:3512
10751 "The URL (eg. upstream URL) of the application. If unavailable this is "
10752 "returned as an empty string C<\"\">."
10756 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3515
10757 msgid "C<app_source_package>"
10761 #: ../fish/guestfish-actions.pod:2383 ../src/guestfs-actions.pod:3517
10763 "For packaging systems which support this, the name of the source package. "
10764 "If unavailable this is returned as an empty string C<\"\">."
10768 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3520
10769 msgid "C<app_summary>"
10773 #: ../fish/guestfish-actions.pod:2388 ../src/guestfs-actions.pod:3522
10775 "A short (usually one line) description of the application or package. If "
10776 "unavailable this is returned as an empty string C<\"\">."
10780 #: ../fish/guestfish-actions.pod:2391 ../src/guestfs-actions.pod:3525
10781 msgid "C<app_description>"
10785 #: ../fish/guestfish-actions.pod:2393 ../src/guestfs-actions.pod:3527
10787 "A longer description of the application or package. If unavailable this is "
10788 "returned as an empty string C<\"\">."
10792 #: ../fish/guestfish-actions.pod:2400
10797 #: ../fish/guestfish-actions.pod:2402
10805 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3545
10807 "This function uses other libguestfs functions and certain heuristics to "
10808 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10809 "for operating systems."
10813 #: ../fish/guestfish-actions.pod:2408 ../src/guestfs-actions.pod:3549
10814 msgid "The list returned is empty if no operating systems were found."
10818 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3551
10820 "If one operating system was found, then this returns a list with a single "
10821 "element, which is the name of the root filesystem of this operating system. "
10822 "It is also possible for this function to return a list containing more than "
10823 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10824 "element being the root filesystem of one of the operating systems."
10828 #: ../fish/guestfish-actions.pod:2417
10830 "You can pass the root string(s) returned to other L</inspect-get-*> "
10831 "functions in order to query further information about each operating system, "
10832 "such as the name and version."
10836 #: ../fish/guestfish-actions.pod:2422
10838 "This function uses other libguestfs features such as L</mount-ro> and L</"
10839 "umount-all> in order to mount and unmount filesystems and look at the "
10840 "contents. This should be called with no disks currently mounted. The "
10841 "function may also use Augeas, so any existing Augeas handle will be closed."
10845 #: ../fish/guestfish-actions.pod:2428 ../src/guestfs-actions.pod:3569
10847 "This function cannot decrypt encrypted disks. The caller must do that first "
10848 "(supplying the necessary keys) if the disk is encrypted."
10852 #: ../fish/guestfish-actions.pod:2434 ../fish/guestfish-actions.pod:2632
10853 #: ../fish/guestfish-actions.pod:2691
10854 msgid "See also L</list-filesystems>."
10858 #: ../fish/guestfish-actions.pod:2436
10859 msgid "is-blockdev"
10863 #: ../fish/guestfish-actions.pod:2438
10866 " is-blockdev path\n"
10871 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3589
10873 "This returns C<true> if and only if there is a block device with the given "
10878 #: ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2461
10879 #: ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2489
10880 #: ../fish/guestfish-actions.pod:2499 ../fish/guestfish-actions.pod:2533
10881 #: ../fish/guestfish-actions.pod:2542
10882 msgid "See also L</stat>."
10886 #: ../fish/guestfish-actions.pod:2445
10891 #: ../fish/guestfish-actions.pod:2447
10899 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3603
10901 "This returns true iff this handle is busy processing a command (in the "
10906 #: ../fish/guestfish-actions.pod:2454
10911 #: ../fish/guestfish-actions.pod:2456
10914 " is-chardev path\n"
10919 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3618
10921 "This returns C<true> if and only if there is a character device with the "
10922 "given C<path> name."
10926 #: ../fish/guestfish-actions.pod:2463
10931 #: ../fish/guestfish-actions.pod:2465
10939 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3632
10941 "This returns true iff this handle is being configured (in the C<CONFIG> "
10946 #: ../fish/guestfish-actions.pod:2472
10951 #: ../fish/guestfish-actions.pod:2474
10959 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3647
10961 "This returns C<true> if and only if there is a directory with the given "
10962 "C<path> name. Note that it returns false for other objects like files."
10966 #: ../fish/guestfish-actions.pod:2482
10971 #: ../fish/guestfish-actions.pod:2484
10979 #: ../fish/guestfish-actions.pod:2486 ../src/guestfs-actions.pod:3663
10981 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10982 "given C<path> name."
10986 #: ../fish/guestfish-actions.pod:2491
10991 #: ../fish/guestfish-actions.pod:2493
10999 #: ../fish/guestfish-actions.pod:2495 ../src/guestfs-actions.pod:3678
11001 "This returns C<true> if and only if there is a regular file with the given "
11002 "C<path> name. Note that it returns false for other objects like directories."
11006 #: ../fish/guestfish-actions.pod:2501
11007 msgid "is-launching"
11011 #: ../fish/guestfish-actions.pod:2503
11019 #: ../fish/guestfish-actions.pod:2505 ../src/guestfs-actions.pod:3693
11021 "This returns true iff this handle is launching the subprocess (in the "
11022 "C<LAUNCHING> state)."
11026 #: ../fish/guestfish-actions.pod:2510
11031 #: ../fish/guestfish-actions.pod:2512
11039 #: ../fish/guestfish-actions.pod:2514 ../src/guestfs-actions.pod:3708
11041 "This command tests whether C<device> is a logical volume, and returns true "
11042 "iff this is the case."
11046 #: ../fish/guestfish-actions.pod:2517
11051 #: ../fish/guestfish-actions.pod:2519
11059 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3720
11061 "This returns true iff this handle is ready to accept commands (in the "
11066 #: ../fish/guestfish-actions.pod:2526
11071 #: ../fish/guestfish-actions.pod:2528
11074 " is-socket path\n"
11079 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3735
11081 "This returns C<true> if and only if there is a Unix domain socket with the "
11082 "given C<path> name."
11086 #: ../fish/guestfish-actions.pod:2535
11091 #: ../fish/guestfish-actions.pod:2537
11094 " is-symlink path\n"
11099 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3750
11101 "This returns C<true> if and only if there is a symbolic link with the given "
11106 #: ../fish/guestfish-actions.pod:2544
11111 #: ../fish/guestfish-actions.pod:2546
11119 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3765
11121 "This returns true iff the file exists and the file is empty or it contains "
11126 #: ../fish/guestfish-actions.pod:2551
11127 msgid "is-zero-device"
11131 #: ../fish/guestfish-actions.pod:2553
11134 " is-zero-device device\n"
11139 #: ../fish/guestfish-actions.pod:2555 ../src/guestfs-actions.pod:3778
11140 msgid "This returns true iff the device exists and contains all zero bytes."
11144 #: ../fish/guestfish-actions.pod:2557 ../src/guestfs-actions.pod:3780
11145 msgid "Note that for large devices this can take a long time to run."
11149 #: ../fish/guestfish-actions.pod:2559
11150 msgid "kill-subprocess"
11154 #: ../fish/guestfish-actions.pod:2561
11157 " kill-subprocess\n"
11162 #: ../fish/guestfish-actions.pod:2563 ../src/guestfs-actions.pod:3791
11163 msgid "This kills the qemu subprocess. You should never need to call this."
11167 #: ../fish/guestfish-actions.pod:2565
11172 #: ../fish/guestfish-actions.pod:2567
11177 #: ../fish/guestfish-actions.pod:2569
11185 #: ../fish/guestfish-actions.pod:2571 ../src/guestfs-actions.pod:3802
11187 "Internally libguestfs is implemented by running a virtual machine using "
11192 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3805
11194 "You should call this after configuring the handle (eg. adding drives) but "
11195 "before performing any actions."
11199 #: ../fish/guestfish-actions.pod:2577
11204 #: ../fish/guestfish-actions.pod:2579
11207 " lchown owner group path\n"
11212 #: ../fish/guestfish-actions.pod:2581
11214 "Change the file owner to C<owner> and group to C<group>. This is like L</"
11215 "chown> but if C<path> is a symlink then the link itself is changed, not the "
11220 #: ../fish/guestfish-actions.pod:2589
11225 #: ../fish/guestfish-actions.pod:2591
11228 " lgetxattr path name\n"
11233 #: ../fish/guestfish-actions.pod:2593 ../src/guestfs-actions.pod:3845
11235 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
11236 "is a symlink, then this call returns an extended attribute from the symlink."
11240 #: ../fish/guestfish-actions.pod:2607
11241 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
11245 #: ../fish/guestfish-actions.pod:2609
11250 #: ../fish/guestfish-actions.pod:2611
11253 " lgetxattrs path\n"
11258 #: ../fish/guestfish-actions.pod:2613
11260 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
11261 "it returns the extended attributes of the link itself."
11265 #: ../fish/guestfish-actions.pod:2617
11270 #: ../fish/guestfish-actions.pod:2619
11278 #: ../fish/guestfish-actions.pod:2621 ../src/guestfs-actions.pod:3888
11280 "List all 9p filesystems attached to the guest. A list of mount tags is "
11285 #: ../fish/guestfish-actions.pod:2624
11286 msgid "list-devices"
11290 #: ../fish/guestfish-actions.pod:2626
11298 #: ../fish/guestfish-actions.pod:2628 ../src/guestfs-actions.pod:3902
11299 msgid "List all the block devices."
11303 #: ../fish/guestfish-actions.pod:2630 ../src/guestfs-actions.pod:3904
11304 msgid "The full block device names are returned, eg. C</dev/sda>."
11308 #: ../fish/guestfish-actions.pod:2634
11309 msgid "list-dm-devices"
11313 #: ../fish/guestfish-actions.pod:2636
11316 " list-dm-devices\n"
11321 #: ../fish/guestfish-actions.pod:2638 ../src/guestfs-actions.pod:3919
11322 msgid "List all device mapper devices."
11326 #: ../fish/guestfish-actions.pod:2640
11328 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
11329 "previous call to L</luks-open>."
11333 #: ../fish/guestfish-actions.pod:2643
11335 "Device mapper devices which correspond to logical volumes are I<not> "
11336 "returned in this list. Call L</lvs> if you want to list logical volumes."
11340 #: ../fish/guestfish-actions.pod:2647
11341 msgid "list-filesystems"
11345 #: ../fish/guestfish-actions.pod:2649
11348 " list-filesystems\n"
11353 #: ../fish/guestfish-actions.pod:2651 ../src/guestfs-actions.pod:3939
11355 "This inspection command looks for filesystems on partitions, block devices "
11356 "and logical volumes, returning a list of devices containing filesystems and "
11361 #: ../fish/guestfish-actions.pod:2655 ../src/guestfs-actions.pod:3943
11363 "The return value is a hash, where the keys are the devices containing "
11364 "filesystems, and the values are the filesystem types. For example:"
11368 #: ../fish/guestfish-actions.pod:2659 ../src/guestfs-actions.pod:3947
11371 " \"/dev/sda1\" => \"ntfs\"\n"
11372 " \"/dev/sda2\" => \"ext2\"\n"
11373 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11374 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11379 #: ../fish/guestfish-actions.pod:2664 ../src/guestfs-actions.pod:3952
11381 "The value can have the special value \"unknown\", meaning the content of the "
11382 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11386 #: ../fish/guestfish-actions.pod:2668
11388 "This command runs other libguestfs commands, which might include L</mount> "
11389 "and L</umount>, and therefore you should use this soon after launch and only "
11390 "when nothing is mounted."
11394 #: ../fish/guestfish-actions.pod:2672
11396 "Not all of the filesystems returned will be mountable. In particular, swap "
11397 "partitions are returned in the list. Also this command does not check that "
11398 "each filesystem found is valid and mountable, and some filesystems might be "
11399 "mountable but require special options. Filesystems may not all belong to a "
11400 "single logical operating system (use L</inspect-os> to look for OSes)."
11404 #: ../fish/guestfish-actions.pod:2680
11405 msgid "list-partitions"
11409 #: ../fish/guestfish-actions.pod:2682
11412 " list-partitions\n"
11417 #: ../fish/guestfish-actions.pod:2684 ../src/guestfs-actions.pod:3981
11418 msgid "List all the partitions detected on all block devices."
11422 #: ../fish/guestfish-actions.pod:2686 ../src/guestfs-actions.pod:3983
11423 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11427 #: ../fish/guestfish-actions.pod:2688
11429 "This does not return logical volumes. For that you will need to call L</"
11434 #: ../fish/guestfish-actions.pod:2693
11439 #: ../fish/guestfish-actions.pod:2695
11447 #: ../fish/guestfish-actions.pod:2697 ../src/guestfs-actions.pod:4002
11449 "List the files in C<directory> (relative to the root directory, there is no "
11450 "cwd) in the format of 'ls -la'."
11454 #: ../fish/guestfish-actions.pod:2700 ../src/guestfs-actions.pod:4005
11456 "This command is mostly useful for interactive sessions. It is I<not> "
11457 "intended that you try to parse the output string."
11461 #: ../fish/guestfish-actions.pod:2703
11466 #: ../fish/guestfish-actions.pod:2705
11469 " ln target linkname\n"
11474 #: ../fish/guestfish-actions.pod:2707 ../src/guestfs-actions.pod:4020
11475 msgid "This command creates a hard link using the C<ln> command."
11479 #: ../fish/guestfish-actions.pod:2709
11484 #: ../fish/guestfish-actions.pod:2711
11487 " ln-f target linkname\n"
11492 #: ../fish/guestfish-actions.pod:2713 ../src/guestfs-actions.pod:4033
11494 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11495 "option removes the link (C<linkname>) if it exists already."
11499 #: ../fish/guestfish-actions.pod:2716
11504 #: ../fish/guestfish-actions.pod:2718
11507 " ln-s target linkname\n"
11512 #: ../fish/guestfish-actions.pod:2720 ../src/guestfs-actions.pod:4047
11513 msgid "This command creates a symbolic link using the C<ln -s> command."
11517 #: ../fish/guestfish-actions.pod:2722
11522 #: ../fish/guestfish-actions.pod:2724
11525 " ln-sf target linkname\n"
11530 #: ../fish/guestfish-actions.pod:2726 ../src/guestfs-actions.pod:4060
11532 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11533 "option removes the link (C<linkname>) if it exists already."
11537 #: ../fish/guestfish-actions.pod:2729
11538 msgid "lremovexattr"
11542 #: ../fish/guestfish-actions.pod:2731
11545 " lremovexattr xattr path\n"
11550 #: ../fish/guestfish-actions.pod:2733
11552 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11553 "it removes an extended attribute of the link itself."
11557 #: ../fish/guestfish-actions.pod:2737
11562 #: ../fish/guestfish-actions.pod:2739
11570 #: ../fish/guestfish-actions.pod:2741 ../src/guestfs-actions.pod:4088
11572 "List the files in C<directory> (relative to the root directory, there is no "
11573 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
11577 #: ../fish/guestfish-actions.pod:2745
11579 "This command is mostly useful for interactive sessions. Programs should "
11580 "probably use L</readdir> instead."
11584 #: ../fish/guestfish-actions.pod:2748
11589 #: ../fish/guestfish-actions.pod:2750
11592 " lsetxattr xattr val vallen path\n"
11597 #: ../fish/guestfish-actions.pod:2752
11599 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11600 "sets an extended attribute of the link itself."
11604 #: ../fish/guestfish-actions.pod:2756
11609 #: ../fish/guestfish-actions.pod:2758
11617 #: ../fish/guestfish-actions.pod:2760 ../fish/guestfish-actions.pod:4570
11618 #: ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:6909
11619 msgid "Returns file information for the given C<path>."
11623 #: ../fish/guestfish-actions.pod:2762
11625 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11626 "the link is stat-ed, not the file it refers to."
11630 #: ../fish/guestfish-actions.pod:2766 ../src/guestfs-actions.pod:4130
11631 msgid "This is the same as the C<lstat(2)> system call."
11635 #: ../fish/guestfish-actions.pod:2768
11640 #: ../fish/guestfish-actions.pod:2770
11643 " lstatlist path 'names ...'\n"
11648 #: ../fish/guestfish-actions.pod:2772
11650 "This call allows you to perform the L</lstat> operation on multiple files, "
11651 "where all files are in the directory C<path>. C<names> is the list of files "
11652 "from this directory."
11656 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4149
11658 "On return you get a list of stat structs, with a one-to-one correspondence "
11659 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11660 "then the C<ino> field of that structure is set to C<-1>."
11664 #: ../fish/guestfish-actions.pod:2781
11666 "This call is intended for programs that want to efficiently list a directory "
11667 "contents without making many round-trips. See also L</lxattrlist> for a "
11668 "similarly efficient call for getting extended attributes. Very long "
11669 "directory listings might cause the protocol message size to be exceeded, "
11670 "causing this call to fail. The caller must split up such requests into "
11671 "smaller groups of names."
11675 #: ../fish/guestfish-actions.pod:2789
11676 msgid "luks-add-key"
11680 #: ../fish/guestfish-actions.pod:2791
11683 " luks-add-key device keyslot\n"
11688 #: ../fish/guestfish-actions.pod:2793 ../src/guestfs-actions.pod:4177
11690 "This command adds a new key on LUKS device C<device>. C<key> is any "
11691 "existing key, and is used to access the device. C<newkey> is the new key to "
11692 "add. C<keyslot> is the key slot that will be replaced."
11696 #: ../fish/guestfish-actions.pod:2798
11698 "Note that if C<keyslot> already contains a key, then this command will "
11699 "fail. You have to use L</luks-kill-slot> first to remove that key."
11703 #: ../fish/guestfish-actions.pod:2802 ../fish/guestfish-actions.pod:2824
11704 #: ../fish/guestfish-actions.pod:2837 ../fish/guestfish-actions.pod:2851
11705 #: ../fish/guestfish-actions.pod:2877 ../fish/guestfish-actions.pod:2887
11707 "This command has one or more key or passphrase parameters. Guestfish will "
11708 "prompt for these separately."
11712 #: ../fish/guestfish-actions.pod:2805
11717 #: ../fish/guestfish-actions.pod:2807
11720 " luks-close device\n"
11725 #: ../fish/guestfish-actions.pod:2809
11727 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
11728 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
11729 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
11734 #: ../fish/guestfish-actions.pod:2815
11735 msgid "luks-format"
11739 #: ../fish/guestfish-actions.pod:2817
11742 " luks-format device keyslot\n"
11747 #: ../fish/guestfish-actions.pod:2819 ../src/guestfs-actions.pod:4218
11749 "This command erases existing data on C<device> and formats the device as a "
11750 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11751 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11755 #: ../fish/guestfish-actions.pod:2827 ../fish/guestfish-actions.pod:2840
11756 #: ../fish/guestfish-actions.pod:2927 ../fish/guestfish-actions.pod:3578
11757 #: ../fish/guestfish-actions.pod:4104 ../fish/guestfish-actions.pod:4441
11758 #: ../fish/guestfish-actions.pod:4464 ../fish/guestfish-actions.pod:4486
11759 #: ../fish/guestfish-actions.pod:5232 ../src/guestfs-actions.pod:4225
11760 #: ../src/guestfs-actions.pod:4248 ../src/guestfs-actions.pod:4391
11761 #: ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:6272
11762 #: ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:6753
11763 #: ../src/guestfs-actions.pod:6786 ../src/guestfs-actions.pod:7985
11765 "B<This command is dangerous. Without careful use you can easily destroy all "
11770 #: ../fish/guestfish-actions.pod:2830
11771 msgid "luks-format-cipher"
11775 #: ../fish/guestfish-actions.pod:2832
11778 " luks-format-cipher device keyslot cipher\n"
11783 #: ../fish/guestfish-actions.pod:2834
11785 "This command is the same as L</luks-format> but it also allows you to set "
11786 "the C<cipher> used."
11790 #: ../fish/guestfish-actions.pod:2843
11791 msgid "luks-kill-slot"
11795 #: ../fish/guestfish-actions.pod:2845
11798 " luks-kill-slot device keyslot\n"
11803 #: ../fish/guestfish-actions.pod:2847 ../src/guestfs-actions.pod:4265
11805 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11806 "device C<device>. C<key> must be one of the I<other> keys."
11810 #: ../fish/guestfish-actions.pod:2854
11815 #: ../fish/guestfish-actions.pod:2856
11818 " luks-open device mapname\n"
11823 #: ../fish/guestfish-actions.pod:2858 ../src/guestfs-actions.pod:4285
11825 "This command opens a block device which has been encrypted according to the "
11826 "Linux Unified Key Setup (LUKS) standard."
11830 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4288
11831 msgid "C<device> is the encrypted block device or partition."
11835 #: ../fish/guestfish-actions.pod:2863 ../src/guestfs-actions.pod:4290
11837 "The caller must supply one of the keys associated with the LUKS block "
11838 "device, in the C<key> parameter."
11842 #: ../fish/guestfish-actions.pod:2866 ../src/guestfs-actions.pod:4293
11844 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11845 "writes to this block device are decrypted from and encrypted to the "
11846 "underlying C<device> respectively."
11850 #: ../fish/guestfish-actions.pod:2870
11852 "If this block device contains LVM volume groups, then calling L</vgscan> "
11853 "followed by L</vg-activate-all> will make them visible."
11857 #: ../fish/guestfish-actions.pod:2874
11858 msgid "Use L</list-dm-devices> to list all device mapper devices."
11862 #: ../fish/guestfish-actions.pod:2880
11863 msgid "luks-open-ro"
11867 #: ../fish/guestfish-actions.pod:2882
11870 " luks-open-ro device mapname\n"
11875 #: ../fish/guestfish-actions.pod:2884
11877 "This is the same as L</luks-open> except that a read-only mapping is created."
11881 #: ../fish/guestfish-actions.pod:2890
11886 #: ../fish/guestfish-actions.pod:2892
11889 " lvcreate logvol volgroup mbytes\n"
11894 #: ../fish/guestfish-actions.pod:2894 ../src/guestfs-actions.pod:4339
11896 "This creates an LVM logical volume called C<logvol> on the volume group "
11897 "C<volgroup>, with C<size> megabytes."
11901 #: ../fish/guestfish-actions.pod:2897
11902 msgid "lvm-canonical-lv-name"
11906 #: ../fish/guestfish-actions.pod:2899
11909 " lvm-canonical-lv-name lvname\n"
11914 #: ../fish/guestfish-actions.pod:2901 ../src/guestfs-actions.pod:4352
11916 "This converts alternative naming schemes for LVs that you might find to the "
11917 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
11922 #: ../fish/guestfish-actions.pod:2905 ../src/guestfs-actions.pod:4356
11924 "This command returns an error if the C<lvname> parameter does not refer to a "
11929 #: ../fish/guestfish-actions.pod:2908
11930 msgid "See also L</is-lv>."
11934 #: ../fish/guestfish-actions.pod:2910
11935 msgid "lvm-clear-filter"
11939 #: ../fish/guestfish-actions.pod:2912
11942 " lvm-clear-filter\n"
11947 #: ../fish/guestfish-actions.pod:2914
11949 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11954 #: ../fish/guestfish-actions.pod:2917 ../fish/guestfish-actions.pod:2948
11955 #: ../src/guestfs-actions.pod:4374 ../src/guestfs-actions.pod:4416
11957 "This command also clears the LVM cache and performs a volume group scan."
11961 #: ../fish/guestfish-actions.pod:2920
11962 msgid "lvm-remove-all"
11966 #: ../fish/guestfish-actions.pod:2922
11969 " lvm-remove-all\n"
11974 #: ../fish/guestfish-actions.pod:2924 ../src/guestfs-actions.pod:4386
11976 "This command removes all LVM logical volumes, volume groups and physical "
11981 #: ../fish/guestfish-actions.pod:2930
11982 msgid "lvm-set-filter"
11986 #: ../fish/guestfish-actions.pod:2932
11989 " lvm-set-filter 'devices ...'\n"
11994 #: ../fish/guestfish-actions.pod:2934 ../src/guestfs-actions.pod:4402
11996 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11997 "block devices in the list C<devices>, and will ignore all other attached "
12002 #: ../fish/guestfish-actions.pod:2938 ../src/guestfs-actions.pod:4406
12004 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12005 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12006 "there are two types of duplication possible: either cloned PVs/VGs which "
12007 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12008 "same name. In normal operation you cannot create this situation, but you "
12009 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12010 "inside the LVM metadata."
12014 #: ../fish/guestfish-actions.pod:2951 ../src/guestfs-actions.pod:4419
12015 msgid "You can filter whole block devices or individual partitions."
12019 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4421
12021 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12022 "filesystem), even if you are not filtering out that VG."
12026 #: ../fish/guestfish-actions.pod:2957
12031 #: ../fish/guestfish-actions.pod:2959
12034 " lvremove device\n"
12039 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4435
12041 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12042 "LV, such as C</dev/VG/LV>."
12046 #: ../fish/guestfish-actions.pod:2964 ../src/guestfs-actions.pod:4438
12048 "You can also remove all LVs in a volume group by specifying the VG name, C</"
12053 #: ../fish/guestfish-actions.pod:2967
12058 #: ../fish/guestfish-actions.pod:2969
12061 " lvrename logvol newlogvol\n"
12066 #: ../fish/guestfish-actions.pod:2971 ../src/guestfs-actions.pod:4452
12067 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
12071 #: ../fish/guestfish-actions.pod:2973
12076 #: ../fish/guestfish-actions.pod:2975
12079 " lvresize device mbytes\n"
12084 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4465
12086 "This resizes (expands or shrinks) an existing LVM logical volume to "
12087 "C<mbytes>. When reducing, data in the reduced part is lost."
12091 #: ../fish/guestfish-actions.pod:2981
12092 msgid "lvresize-free"
12096 #: ../fish/guestfish-actions.pod:2983
12099 " lvresize-free lv percent\n"
12104 #: ../fish/guestfish-actions.pod:2985 ../src/guestfs-actions.pod:4480
12106 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
12107 "remaining free space in the volume group. Commonly you would call this with "
12108 "pc = 100 which expands the logical volume as much as possible, using all "
12109 "remaining free space in the volume group."
12113 #: ../fish/guestfish-actions.pod:2991
12118 #: ../fish/guestfish-actions.pod:2993
12126 #: ../fish/guestfish-actions.pod:2995 ../src/guestfs-actions.pod:4495
12128 "List all the logical volumes detected. This is the equivalent of the L<lvs"
12133 #: ../fish/guestfish-actions.pod:2998 ../src/guestfs-actions.pod:4498
12135 "This returns a list of the logical volume device names (eg. C</dev/"
12136 "VolGroup00/LogVol00>)."
12140 #: ../fish/guestfish-actions.pod:3001
12141 msgid "See also L</lvs-full>, L</list-filesystems>."
12145 #: ../fish/guestfish-actions.pod:3003
12150 #: ../fish/guestfish-actions.pod:3005
12158 #: ../fish/guestfish-actions.pod:3007 ../src/guestfs-actions.pod:4514
12160 "List all the logical volumes detected. This is the equivalent of the L<lvs"
12161 "(8)> command. The \"full\" version includes all fields."
12165 #: ../fish/guestfish-actions.pod:3010
12170 #: ../fish/guestfish-actions.pod:3012
12178 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4529
12179 msgid "This command returns the UUID of the LVM LV C<device>."
12183 #: ../fish/guestfish-actions.pod:3016
12188 #: ../fish/guestfish-actions.pod:3018
12191 " lxattrlist path 'names ...'\n"
12196 #: ../fish/guestfish-actions.pod:3020 ../src/guestfs-actions.pod:4543
12198 "This call allows you to get the extended attributes of multiple files, where "
12199 "all files are in the directory C<path>. C<names> is the list of files from "
12204 #: ../fish/guestfish-actions.pod:3024 ../src/guestfs-actions.pod:4547
12206 "On return you get a flat list of xattr structs which must be interpreted "
12207 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
12208 "C<attrval> in this struct is zero-length to indicate there was an error "
12209 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
12210 "number (the number of following attributes for this file, which could be C<"
12211 "\"0\">). Then after the first xattr struct are the zero or more attributes "
12212 "for the first named file. This repeats for the second and subsequent files."
12216 #: ../fish/guestfish-actions.pod:3034
12218 "This call is intended for programs that want to efficiently list a directory "
12219 "contents without making many round-trips. See also L</lstatlist> for a "
12220 "similarly efficient call for getting standard stats. Very long directory "
12221 "listings might cause the protocol message size to be exceeded, causing this "
12222 "call to fail. The caller must split up such requests into smaller groups of "
12227 #: ../fish/guestfish-actions.pod:3042
12232 #: ../fish/guestfish-actions.pod:3044
12240 #: ../fish/guestfish-actions.pod:3046 ../src/guestfs-actions.pod:4577
12241 msgid "Create a directory named C<path>."
12245 #: ../fish/guestfish-actions.pod:3048
12250 #: ../fish/guestfish-actions.pod:3050
12253 " mkdir-mode path mode\n"
12258 #: ../fish/guestfish-actions.pod:3052 ../src/guestfs-actions.pod:4590
12260 "This command creates a directory, setting the initial permissions of the "
12261 "directory to C<mode>."
12265 #: ../fish/guestfish-actions.pod:3055 ../src/guestfs-actions.pod:4593
12267 "For common Linux filesystems, the actual mode which is set will be C<mode & "
12268 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
12273 #: ../fish/guestfish-actions.pod:3059
12274 msgid "See also L</mkdir>, L</umask>"
12278 #: ../fish/guestfish-actions.pod:3061
12283 #: ../fish/guestfish-actions.pod:3063
12291 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4609
12293 "Create a directory named C<path>, creating any parent directories as "
12294 "necessary. This is like the C<mkdir -p> shell command."
12298 #: ../fish/guestfish-actions.pod:3068
12303 #: ../fish/guestfish-actions.pod:3070
12306 " mkdtemp template\n"
12311 #: ../fish/guestfish-actions.pod:3072 ../src/guestfs-actions.pod:4622
12313 "This command creates a temporary directory. The C<template> parameter "
12314 "should be a full pathname for the temporary directory name with the final "
12315 "six characters being \"XXXXXX\"."
12319 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4627
12321 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12322 "being suitable for Windows filesystems."
12326 #: ../fish/guestfish-actions.pod:3080 ../src/guestfs-actions.pod:4630
12327 msgid "The name of the temporary directory that was created is returned."
12331 #: ../fish/guestfish-actions.pod:3083 ../src/guestfs-actions.pod:4633
12332 msgid "The temporary directory is created with mode 0700 and is owned by root."
12336 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4636
12338 "The caller is responsible for deleting the temporary directory and its "
12339 "contents after use."
12343 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4639
12344 msgid "See also: L<mkdtemp(3)>"
12348 #: ../fish/guestfish-actions.pod:3091
12353 #: ../fish/guestfish-actions.pod:3093
12356 " mke2fs-J fstype blocksize device journal\n"
12361 #: ../fish/guestfish-actions.pod:3095 ../src/guestfs-actions.pod:4655
12363 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12364 "C<journal>. It is equivalent to the command:"
12368 #: ../fish/guestfish-actions.pod:3099 ../src/guestfs-actions.pod:4659
12371 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
12376 #: ../fish/guestfish-actions.pod:3101
12377 msgid "See also L</mke2journal>."
12381 #: ../fish/guestfish-actions.pod:3103
12386 #: ../fish/guestfish-actions.pod:3105
12389 " mke2fs-JL fstype blocksize device label\n"
12394 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4676
12396 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12397 "the journal labeled C<label>."
12401 #: ../fish/guestfish-actions.pod:3110
12402 msgid "See also L</mke2journal-L>."
12406 #: ../fish/guestfish-actions.pod:3112
12411 #: ../fish/guestfish-actions.pod:3114
12414 " mke2fs-JU fstype blocksize device uuid\n"
12419 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4694
12421 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12422 "the journal with UUID C<uuid>."
12426 #: ../fish/guestfish-actions.pod:3119
12427 msgid "See also L</mke2journal-U>."
12431 #: ../fish/guestfish-actions.pod:3121
12432 msgid "mke2journal"
12436 #: ../fish/guestfish-actions.pod:3123
12439 " mke2journal blocksize device\n"
12444 #: ../fish/guestfish-actions.pod:3125 ../src/guestfs-actions.pod:4710
12446 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12451 #: ../fish/guestfish-actions.pod:3128 ../src/guestfs-actions.pod:4713
12454 " mke2fs -O journal_dev -b blocksize device\n"
12459 #: ../fish/guestfish-actions.pod:3130
12460 msgid "mke2journal-L"
12464 #: ../fish/guestfish-actions.pod:3132
12467 " mke2journal-L blocksize label device\n"
12472 #: ../fish/guestfish-actions.pod:3134 ../src/guestfs-actions.pod:4727
12473 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12477 #: ../fish/guestfish-actions.pod:3136
12478 msgid "mke2journal-U"
12482 #: ../fish/guestfish-actions.pod:3138
12485 " mke2journal-U blocksize uuid device\n"
12490 #: ../fish/guestfish-actions.pod:3140 ../src/guestfs-actions.pod:4741
12491 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12495 #: ../fish/guestfish-actions.pod:3142
12500 #: ../fish/guestfish-actions.pod:3144
12503 " mkfifo mode path\n"
12508 #: ../fish/guestfish-actions.pod:3146
12510 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12511 "is just a convenient wrapper around L</mknod>."
12515 #: ../fish/guestfish-actions.pod:3152
12520 #: ../fish/guestfish-actions.pod:3154
12523 " mkfs fstype device\n"
12528 #: ../fish/guestfish-actions.pod:3156 ../src/guestfs-actions.pod:4771
12530 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12531 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12535 #: ../fish/guestfish-actions.pod:3160
12540 #: ../fish/guestfish-actions.pod:3162
12543 " mkfs-b fstype blocksize device\n"
12548 #: ../fish/guestfish-actions.pod:3164
12550 "This call is similar to L</mkfs>, but it allows you to control the block "
12551 "size of the resulting filesystem. Supported block sizes depend on the "
12552 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12556 #: ../fish/guestfish-actions.pod:3169 ../fish/guestfish-actions.pod:3196
12557 #: ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4837
12559 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12564 #: ../fish/guestfish-actions.pod:3172
12566 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
12571 #: ../fish/guestfish-actions.pod:3179
12576 #: ../fish/guestfish-actions.pod:3181
12579 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
12584 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4824
12586 "This function creates a filesystem on C<device>. The filesystem type is "
12587 "C<fstype>, for example C<ext3>."
12591 #: ../fish/guestfish-actions.pod:3190 ../src/guestfs-actions.pod:4831
12592 msgid "C<blocksize>"
12596 #: ../fish/guestfish-actions.pod:3192 ../src/guestfs-actions.pod:4833
12598 "The filesystem block size. Supported block sizes depend on the filesystem "
12599 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12604 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4840
12605 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12609 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4842
12610 msgid "C<features>"
12614 #: ../fish/guestfish-actions.pod:3203 ../src/guestfs-actions.pod:4844
12615 msgid "This passes the I<-O> parameter to the external mkfs program."
12619 #: ../fish/guestfish-actions.pod:3205 ../src/guestfs-actions.pod:4846
12621 "For certain filesystem types, this allows extra filesystem features to be "
12622 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12626 #: ../fish/guestfish-actions.pod:3209 ../src/guestfs-actions.pod:4850
12628 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12633 #: ../fish/guestfish-actions.pod:3212 ../src/guestfs-actions.pod:4853
12638 #: ../fish/guestfish-actions.pod:3214 ../src/guestfs-actions.pod:4855
12640 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12641 "sets the inode size (only for ext2/3/4 filesystems at present)."
12645 #: ../fish/guestfish-actions.pod:3217 ../src/guestfs-actions.pod:4858
12646 msgid "C<sectorsize>"
12650 #: ../fish/guestfish-actions.pod:3219 ../src/guestfs-actions.pod:4860
12652 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12653 "sets sector size for ufs filesystem."
12657 #: ../fish/guestfish-actions.pod:3226
12658 msgid "mkmountpoint"
12662 #: ../fish/guestfish-actions.pod:3228
12665 " mkmountpoint exemptpath\n"
12670 #: ../fish/guestfish-actions.pod:3230
12672 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12673 "to create extra mountpoints before mounting the first filesystem."
12677 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4903
12679 "These calls are I<only> necessary in some very limited circumstances, mainly "
12680 "the case where you want to mount a mix of unrelated and/or read-only "
12681 "filesystems together."
12685 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4907
12687 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12688 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12689 "inside that. You can unpack this as follows in guestfish:"
12693 #: ../fish/guestfish-actions.pod:3243 ../src/guestfs-actions.pod:4912
12696 " add-ro Fedora-11-i686-Live.iso\n"
12698 " mkmountpoint /cd\n"
12699 " mkmountpoint /sqsh\n"
12700 " mkmountpoint /ext3fs\n"
12701 " mount /dev/sda /cd\n"
12702 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12703 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12708 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4921
12709 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12713 #: ../fish/guestfish-actions.pod:3254
12715 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12716 "unexpected errors if you try to mix these calls. It is safest to manually "
12717 "unmount filesystems and remove mountpoints after use."
12721 #: ../fish/guestfish-actions.pod:3258
12723 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12724 "for this to work for manual mountpoints, you must ensure that the innermost "
12725 "mountpoints have the longest pathnames, as in the example code above."
12729 #: ../fish/guestfish-actions.pod:3263 ../src/guestfs-actions.pod:4932
12731 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12735 #: ../fish/guestfish-actions.pod:3265
12737 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12738 "L</umount-all> to be called when the handle is closed which can also trigger "
12743 #: ../fish/guestfish-actions.pod:3269
12748 #: ../fish/guestfish-actions.pod:3271
12751 " mknod mode devmajor devminor path\n"
12756 #: ../fish/guestfish-actions.pod:3273 ../src/guestfs-actions.pod:4951
12758 "This call creates block or character special devices, or named pipes (FIFOs)."
12762 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4954
12764 "The C<mode> parameter should be the mode, using the standard constants. "
12765 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12766 "used when creating block and character special devices."
12770 #: ../fish/guestfish-actions.pod:3281
12772 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12773 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12774 "regular file). These constants are available in the standard Linux header "
12775 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12776 "wrappers around this command which bitwise OR in the appropriate constant "
12781 #: ../fish/guestfish-actions.pod:3291
12786 #: ../fish/guestfish-actions.pod:3293
12789 " mknod-b mode devmajor devminor path\n"
12794 #: ../fish/guestfish-actions.pod:3295
12796 "This call creates a block device node called C<path> with mode C<mode> and "
12797 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12798 "wrapper around L</mknod>."
12802 #: ../fish/guestfish-actions.pod:3301
12807 #: ../fish/guestfish-actions.pod:3303
12810 " mknod-c mode devmajor devminor path\n"
12815 #: ../fish/guestfish-actions.pod:3305
12817 "This call creates a char device node called C<path> with mode C<mode> and "
12818 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12819 "wrapper around L</mknod>."
12823 #: ../fish/guestfish-actions.pod:3311
12828 #: ../fish/guestfish-actions.pod:3313
12836 #: ../fish/guestfish-actions.pod:3315 ../src/guestfs-actions.pod:5017
12837 msgid "Create a swap partition on C<device>."
12841 #: ../fish/guestfish-actions.pod:3317
12846 #: ../fish/guestfish-actions.pod:3319
12849 " mkswap-L label device\n"
12854 #: ../fish/guestfish-actions.pod:3321 ../src/guestfs-actions.pod:5030
12855 msgid "Create a swap partition on C<device> with label C<label>."
12859 #: ../fish/guestfish-actions.pod:3323 ../src/guestfs-actions.pod:5032
12861 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
12862 "sda>), just to a partition. This appears to be a limitation of the kernel "
12867 #: ../fish/guestfish-actions.pod:3327
12872 #: ../fish/guestfish-actions.pod:3329
12875 " mkswap-U uuid device\n"
12880 #: ../fish/guestfish-actions.pod:3331 ../src/guestfs-actions.pod:5047
12881 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12885 #: ../fish/guestfish-actions.pod:3333
12886 msgid "mkswap-file"
12890 #: ../fish/guestfish-actions.pod:3335
12893 " mkswap-file path\n"
12898 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5059
12899 msgid "Create a swap file."
12903 #: ../fish/guestfish-actions.pod:3339
12905 "This command just writes a swap file signature to an existing file. To "
12906 "create the file itself, use something like L</fallocate>."
12910 #: ../fish/guestfish-actions.pod:3342
12915 #: ../fish/guestfish-actions.pod:3344
12918 " modprobe modulename\n"
12923 #: ../fish/guestfish-actions.pod:3346 ../src/guestfs-actions.pod:5074
12924 msgid "This loads a kernel module in the appliance."
12928 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5076
12930 "The kernel module must have been whitelisted when libguestfs was built (see "
12931 "C<appliance/kmod.whitelist.in> in the source)."
12935 #: ../fish/guestfish-actions.pod:3351
12940 #: ../fish/guestfish-actions.pod:3353
12943 " mount device mountpoint\n"
12948 #: ../fish/guestfish-actions.pod:3355 ../src/guestfs-actions.pod:5090
12950 "Mount a guest disk at a position in the filesystem. Block devices are named "
12951 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12952 "those block devices contain partitions, they will have the usual names (eg. "
12953 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12957 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5096
12959 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12960 "mounted on C</> before others can be mounted. Other filesystems can only be "
12961 "mounted on directories which already exist."
12965 #: ../fish/guestfish-actions.pod:3366 ../src/guestfs-actions.pod:5101
12967 "The mounted filesystem is writable, if we have sufficient permissions on the "
12968 "underlying device."
12972 #: ../fish/guestfish-actions.pod:3369
12974 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12975 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12976 "problems for users. If your program might need to work with older versions "
12977 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12978 "first parameter if you don't want any options)."
12982 #: ../fish/guestfish-actions.pod:3376
12987 #: ../fish/guestfish-actions.pod:3378
12990 " mount-9p mounttag mountpoint [options:..]\n"
12995 #: ../fish/guestfish-actions.pod:3380 ../src/guestfs-actions.pod:5130
12997 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
13002 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5133
13004 "If required, C<trans=virtio> will be automatically added to the options. "
13005 "Any other options required can be passed in the optional C<options> "
13010 #: ../fish/guestfish-actions.pod:3389
13015 #: ../fish/guestfish-actions.pod:3391
13018 " mount-loop file mountpoint\n"
13023 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5172
13025 "This command lets you mount C<file> (a filesystem image in a file) on a "
13026 "mount point. It is entirely equivalent to the command C<mount -o loop file "
13031 #: ../fish/guestfish-actions.pod:3397
13032 msgid "mount-options"
13036 #: ../fish/guestfish-actions.pod:3399
13039 " mount-options options device mountpoint\n"
13044 #: ../fish/guestfish-actions.pod:3401
13046 "This is the same as the L</mount> command, but it allows you to set the "
13047 "mount options as for the L<mount(8)> I<-o> flag."
13051 #: ../fish/guestfish-actions.pod:3405 ../src/guestfs-actions.pod:5192
13053 "If the C<options> parameter is an empty string, then no options are passed "
13054 "(all options default to whatever the filesystem uses)."
13058 #: ../fish/guestfish-actions.pod:3409
13063 #: ../fish/guestfish-actions.pod:3411
13066 " mount-ro device mountpoint\n"
13071 #: ../fish/guestfish-actions.pod:3413
13073 "This is the same as the L</mount> command, but it mounts the filesystem with "
13074 "the read-only (I<-o ro>) flag."
13078 #: ../fish/guestfish-actions.pod:3416
13083 #: ../fish/guestfish-actions.pod:3418
13086 " mount-vfs options vfstype device mountpoint\n"
13091 #: ../fish/guestfish-actions.pod:3420
13093 "This is the same as the L</mount> command, but it allows you to set both the "
13094 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
13098 #: ../fish/guestfish-actions.pod:3424
13099 msgid "mountpoints"
13103 #: ../fish/guestfish-actions.pod:3426
13111 #: ../fish/guestfish-actions.pod:3428
13113 "This call is similar to L</mounts>. That call returns a list of devices. "
13114 "This one returns a hash table (map) of device name to directory where the "
13115 "device is mounted."
13119 #: ../fish/guestfish-actions.pod:3432
13124 #: ../fish/guestfish-actions.pod:3434
13132 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5253
13134 "This returns the list of currently mounted filesystems. It returns the list "
13135 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
13139 #: ../fish/guestfish-actions.pod:3439 ../src/guestfs-actions.pod:5256
13140 msgid "Some internal mounts are not shown."
13144 #: ../fish/guestfish-actions.pod:3441
13145 msgid "See also: L</mountpoints>"
13149 #: ../fish/guestfish-actions.pod:3443
13154 #: ../fish/guestfish-actions.pod:3445
13162 #: ../fish/guestfish-actions.pod:3447 ../src/guestfs-actions.pod:5273
13164 "This moves a file from C<src> to C<dest> where C<dest> is either a "
13165 "destination filename or destination directory."
13169 #: ../fish/guestfish-actions.pod:3450
13170 msgid "ntfs-3g-probe"
13174 #: ../fish/guestfish-actions.pod:3452
13177 " ntfs-3g-probe true|false device\n"
13182 #: ../fish/guestfish-actions.pod:3454 ../src/guestfs-actions.pod:5287
13184 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
13185 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
13186 "write, and some cannot be mounted at all)."
13190 #: ../fish/guestfish-actions.pod:3458 ../src/guestfs-actions.pod:5291
13192 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
13193 "can be mounted read-write. Set it to false if you want to test if the "
13194 "volume can be mounted read-only."
13198 #: ../fish/guestfish-actions.pod:3462 ../src/guestfs-actions.pod:5295
13200 "The return value is an integer which C<0> if the operation would succeed, or "
13201 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
13205 #: ../fish/guestfish-actions.pod:3466
13210 #: ../fish/guestfish-actions.pod:3468
13213 " ntfsresize device\n"
13218 #: ../fish/guestfish-actions.pod:3470 ../fish/guestfish-actions.pod:3494
13219 #: ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5348
13221 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
13222 "size of the underlying device."
13226 #: ../fish/guestfish-actions.pod:3473 ../src/guestfs-actions.pod:5319
13228 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
13229 "consistency check (for safety). You have to boot into Windows to perform "
13230 "this check and clear this condition. Furthermore, ntfsresize refuses to "
13231 "resize filesystems which have been marked in this way. So in effect it is "
13232 "not possible to call ntfsresize multiple times on a single filesystem "
13233 "without booting into Windows between each resize."
13237 #: ../fish/guestfish-actions.pod:3481 ../fish/guestfish-actions.pod:3520
13238 #: ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:5374
13239 msgid "See also L<ntfsresize(8)>."
13243 #: ../fish/guestfish-actions.pod:3483 ../fish/guestfish-actions.pod:3531
13245 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
13250 #: ../fish/guestfish-actions.pod:3490
13251 msgid "ntfsresize-opts"
13255 #: ../fish/guestfish-actions.pod:3492
13258 " ntfsresize-opts device [size:..] [force:..]\n"
13263 #: ../fish/guestfish-actions.pod:3503 ../src/guestfs-actions.pod:5357
13265 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
13266 "resized to fit the container (eg. partition)."
13270 #: ../fish/guestfish-actions.pod:3506 ../src/guestfs-actions.pod:5360
13275 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5362
13277 "If this option is true, then force the resize of the filesystem even if the "
13278 "filesystem is marked as requiring a consistency check."
13282 #: ../fish/guestfish-actions.pod:3511
13284 "After the resize operation, the filesystem is always marked as requiring a "
13285 "consistency check (for safety). You have to boot into Windows to perform "
13286 "this check and clear this condition. If you I<don't> set the C<force> "
13287 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
13288 "a single filesystem without booting into Windows between each resize."
13292 #: ../fish/guestfish-actions.pod:3524
13293 msgid "ntfsresize-size"
13297 #: ../fish/guestfish-actions.pod:3526
13300 " ntfsresize-size device size\n"
13305 #: ../fish/guestfish-actions.pod:3528
13307 "This command is the same as L</ntfsresize> except that it allows you to "
13308 "specify the new size (in bytes) explicitly."
13312 #: ../fish/guestfish-actions.pod:3538
13317 #: ../fish/guestfish-actions.pod:3540
13320 " part-add device prlogex startsect endsect\n"
13325 #: ../fish/guestfish-actions.pod:3542
13327 "This command adds a partition to C<device>. If there is no partition table "
13328 "on the device, call L</part-init> first."
13332 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5435
13334 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13335 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13336 "C<logical>) and C<e> (or C<extended>) partition types."
13340 #: ../fish/guestfish-actions.pod:3550 ../src/guestfs-actions.pod:5440
13342 "C<startsect> and C<endsect> are the start and end of the partition in "
13343 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13344 "from the end of the disk (C<-1> is the last sector)."
13348 #: ../fish/guestfish-actions.pod:3554
13350 "Creating a partition which covers the whole disk is not so easy. Use L</"
13351 "part-disk> to do that."
13355 #: ../fish/guestfish-actions.pod:3557
13360 #: ../fish/guestfish-actions.pod:3559
13363 " part-del device partnum\n"
13368 #: ../fish/guestfish-actions.pod:3561 ../src/guestfs-actions.pod:5458
13369 msgid "This command deletes the partition numbered C<partnum> on C<device>."
13373 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5460
13375 "Note that in the case of MBR partitioning, deleting an extended partition "
13376 "also deletes any logical partitions it contains."
13380 #: ../fish/guestfish-actions.pod:3567
13385 #: ../fish/guestfish-actions.pod:3569
13388 " part-disk device parttype\n"
13393 #: ../fish/guestfish-actions.pod:3571
13395 "This command is simply a combination of L</part-init> followed by L</part-"
13396 "add> to create a single primary partition covering the whole disk."
13400 #: ../fish/guestfish-actions.pod:3575
13402 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
13403 "possible values are described in L</part-init>."
13407 #: ../fish/guestfish-actions.pod:3581
13408 msgid "part-get-bootable"
13412 #: ../fish/guestfish-actions.pod:3583
13415 " part-get-bootable device partnum\n"
13420 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5496
13422 "This command returns true if the partition C<partnum> on C<device> has the "
13423 "bootable flag set."
13427 #: ../fish/guestfish-actions.pod:3588
13428 msgid "See also L</part-set-bootable>."
13432 #: ../fish/guestfish-actions.pod:3590
13433 msgid "part-get-mbr-id"
13437 #: ../fish/guestfish-actions.pod:3592
13440 " part-get-mbr-id device partnum\n"
13445 #: ../fish/guestfish-actions.pod:3594 ../src/guestfs-actions.pod:5512
13447 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13448 "partition C<partnum>."
13452 #: ../fish/guestfish-actions.pod:3597 ../fish/guestfish-actions.pod:3741
13454 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13455 "undefined results for other partition table types (see L</part-get-"
13460 #: ../fish/guestfish-actions.pod:3601
13461 msgid "part-get-parttype"
13465 #: ../fish/guestfish-actions.pod:3603
13468 " part-get-parttype device\n"
13473 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5529
13475 "This command examines the partition table on C<device> and returns the "
13476 "partition table type (format) being used."
13480 #: ../fish/guestfish-actions.pod:3608
13482 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13483 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13484 "possible, although unusual. See L</part-init> for a full list."
13488 #: ../fish/guestfish-actions.pod:3613
13493 #: ../fish/guestfish-actions.pod:3615
13496 " part-init device parttype\n"
13501 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5549
13503 "This creates an empty partition table on C<device> of one of the partition "
13504 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
13505 "(for large disks)."
13509 #: ../fish/guestfish-actions.pod:3621
13511 "Initially there are no partitions. Following this, you should call L</part-"
13512 "add> for each partition required."
13516 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5556
13517 msgid "Possible values for C<parttype> are:"
13521 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5560
13526 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5562
13531 #: ../fish/guestfish-actions.pod:3632 ../src/guestfs-actions.pod:5564
13532 msgid "Intel EFI / GPT partition table."
13536 #: ../fish/guestfish-actions.pod:3634 ../src/guestfs-actions.pod:5566
13538 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13539 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13540 "the C<mbr> format."
13544 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5570
13549 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5572
13554 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5574
13556 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13557 "Windows. This partition type will B<only> work for device sizes up to 2 "
13558 "TB. For large disks we recommend using C<gpt>."
13562 #: ../fish/guestfish-actions.pod:3649 ../src/guestfs-actions.pod:5581
13564 "Other partition table types that may work but are not supported include:"
13568 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5586
13573 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5588
13574 msgid "AIX disk labels."
13578 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5590
13583 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5592
13588 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5594
13589 msgid "Amiga \"Rigid Disk Block\" format."
13593 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5596
13598 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5598
13599 msgid "BSD disk labels."
13603 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5600
13608 #: ../fish/guestfish-actions.pod:3670 ../src/guestfs-actions.pod:5602
13609 msgid "DASD, used on IBM mainframes."
13613 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5604
13618 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5606
13619 msgid "MIPS/SGI volumes."
13623 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5608
13628 #: ../fish/guestfish-actions.pod:3678 ../src/guestfs-actions.pod:5610
13629 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13633 #: ../fish/guestfish-actions.pod:3680 ../src/guestfs-actions.pod:5612
13638 #: ../fish/guestfish-actions.pod:3682 ../src/guestfs-actions.pod:5614
13639 msgid "NEC PC-98 format, common in Japan apparently."
13643 #: ../fish/guestfish-actions.pod:3684 ../src/guestfs-actions.pod:5616
13648 #: ../fish/guestfish-actions.pod:3686 ../src/guestfs-actions.pod:5618
13649 msgid "Sun disk labels."
13653 #: ../fish/guestfish-actions.pod:3690
13658 #: ../fish/guestfish-actions.pod:3692
13661 " part-list device\n"
13666 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5632
13668 "This command parses the partition table on C<device> and returns the list of "
13669 "partitions found."
13673 #: ../fish/guestfish-actions.pod:3697 ../src/guestfs-actions.pod:5635
13674 msgid "The fields in the returned structure are:"
13678 #: ../fish/guestfish-actions.pod:3701 ../src/guestfs-actions.pod:5639
13679 msgid "B<part_num>"
13683 #: ../fish/guestfish-actions.pod:3703 ../src/guestfs-actions.pod:5641
13684 msgid "Partition number, counting from 1."
13688 #: ../fish/guestfish-actions.pod:3705 ../src/guestfs-actions.pod:5643
13689 msgid "B<part_start>"
13693 #: ../fish/guestfish-actions.pod:3707
13695 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13696 "the device's sector size, see L</blockdev-getss>."
13700 #: ../fish/guestfish-actions.pod:3710 ../src/guestfs-actions.pod:5648
13701 msgid "B<part_end>"
13705 #: ../fish/guestfish-actions.pod:3712 ../src/guestfs-actions.pod:5650
13706 msgid "End of the partition in bytes."
13710 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5652
13711 msgid "B<part_size>"
13715 #: ../fish/guestfish-actions.pod:3716 ../src/guestfs-actions.pod:5654
13716 msgid "Size of the partition in bytes."
13720 #: ../fish/guestfish-actions.pod:3720
13721 msgid "part-set-bootable"
13725 #: ../fish/guestfish-actions.pod:3722
13728 " part-set-bootable device partnum true|false\n"
13733 #: ../fish/guestfish-actions.pod:3724 ../src/guestfs-actions.pod:5672
13735 "This sets the bootable flag on partition numbered C<partnum> on device "
13736 "C<device>. Note that partitions are numbered from 1."
13740 #: ../fish/guestfish-actions.pod:3727 ../src/guestfs-actions.pod:5675
13742 "The bootable flag is used by some operating systems (notably Windows) to "
13743 "determine which partition to boot from. It is by no means universally "
13748 #: ../fish/guestfish-actions.pod:3731
13749 msgid "part-set-mbr-id"
13753 #: ../fish/guestfish-actions.pod:3733
13756 " part-set-mbr-id device partnum idbyte\n"
13761 #: ../fish/guestfish-actions.pod:3735 ../src/guestfs-actions.pod:5691
13763 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13764 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13765 "documentation are in fact hexadecimal numbers, but usually documented "
13766 "without any leading \"0x\" which might be confusing."
13770 #: ../fish/guestfish-actions.pod:3745
13771 msgid "part-set-name"
13775 #: ../fish/guestfish-actions.pod:3747
13778 " part-set-name device partnum name\n"
13783 #: ../fish/guestfish-actions.pod:3749 ../src/guestfs-actions.pod:5713
13785 "This sets the partition name on partition numbered C<partnum> on device "
13786 "C<device>. Note that partitions are numbered from 1."
13790 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5716
13792 "The partition name can only be set on certain types of partition table. "
13793 "This works on C<gpt> but not on C<mbr> partitions."
13797 #: ../fish/guestfish-actions.pod:3755
13798 msgid "part-to-dev"
13802 #: ../fish/guestfish-actions.pod:3757
13805 " part-to-dev partition\n"
13810 #: ../fish/guestfish-actions.pod:3759 ../src/guestfs-actions.pod:5729
13812 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13813 "partition number, returning the device name (eg. \"/dev/sdb\")."
13817 #: ../fish/guestfish-actions.pod:3763
13819 "The named partition must exist, for example as a string returned from L</"
13820 "list-partitions>."
13824 #: ../fish/guestfish-actions.pod:3766
13825 msgid "ping-daemon"
13829 #: ../fish/guestfish-actions.pod:3768
13837 #: ../fish/guestfish-actions.pod:3770 ../src/guestfs-actions.pod:5746
13839 "This is a test probe into the guestfs daemon running inside the qemu "
13840 "subprocess. Calling this function checks that the daemon responds to the "
13841 "ping message, without affecting the daemon or attached block device(s) in "
13846 #: ../fish/guestfish-actions.pod:3775
13851 #: ../fish/guestfish-actions.pod:3777
13854 " pread path count offset\n"
13859 #: ../fish/guestfish-actions.pod:3779 ../src/guestfs-actions.pod:5764
13861 "This command lets you read part of a file. It reads C<count> bytes of the "
13862 "file, starting at C<offset>, from file C<path>."
13866 #: ../fish/guestfish-actions.pod:3782 ../fish/guestfish-actions.pod:3797
13867 #: ../src/guestfs-actions.pod:5767 ../src/guestfs-actions.pod:5793
13869 "This may read fewer bytes than requested. For further details see the "
13870 "L<pread(2)> system call."
13874 #: ../fish/guestfish-actions.pod:3785
13875 msgid "See also L</pwrite>, L</pread-device>."
13879 #: ../fish/guestfish-actions.pod:3790
13880 msgid "pread-device"
13884 #: ../fish/guestfish-actions.pod:3792
13887 " pread-device device count offset\n"
13892 #: ../fish/guestfish-actions.pod:3794 ../src/guestfs-actions.pod:5790
13894 "This command lets you read part of a file. It reads C<count> bytes of "
13895 "C<device>, starting at C<offset>."
13899 #: ../fish/guestfish-actions.pod:3800
13900 msgid "See also L</pread>."
13904 #: ../fish/guestfish-actions.pod:3805
13909 #: ../fish/guestfish-actions.pod:3807
13912 " pvcreate device\n"
13917 #: ../fish/guestfish-actions.pod:3809 ../src/guestfs-actions.pod:5813
13919 "This creates an LVM physical volume on the named C<device>, where C<device> "
13920 "should usually be a partition name such as C</dev/sda1>."
13924 #: ../fish/guestfish-actions.pod:3813
13929 #: ../fish/guestfish-actions.pod:3815
13932 " pvremove device\n"
13937 #: ../fish/guestfish-actions.pod:3817 ../src/guestfs-actions.pod:5827
13939 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13944 #: ../fish/guestfish-actions.pod:3820 ../src/guestfs-actions.pod:5830
13946 "The implementation uses the C<pvremove> command which refuses to wipe "
13947 "physical volumes that contain any volume groups, so you have to remove those "
13952 #: ../fish/guestfish-actions.pod:3824
13957 #: ../fish/guestfish-actions.pod:3826
13960 " pvresize device\n"
13965 #: ../fish/guestfish-actions.pod:3828 ../src/guestfs-actions.pod:5844
13967 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13968 "the new size of the underlying device."
13972 #: ../fish/guestfish-actions.pod:3831
13973 msgid "pvresize-size"
13977 #: ../fish/guestfish-actions.pod:3833
13980 " pvresize-size device size\n"
13985 #: ../fish/guestfish-actions.pod:3835
13987 "This command is the same as L</pvresize> except that it allows you to "
13988 "specify the new size (in bytes) explicitly."
13992 #: ../fish/guestfish-actions.pod:3838
13997 #: ../fish/guestfish-actions.pod:3840
14005 #: ../fish/guestfish-actions.pod:3842 ../src/guestfs-actions.pod:5870
14007 "List all the physical volumes detected. This is the equivalent of the L<pvs"
14012 #: ../fish/guestfish-actions.pod:3845 ../src/guestfs-actions.pod:5873
14014 "This returns a list of just the device names that contain PVs (eg. C</dev/"
14019 #: ../fish/guestfish-actions.pod:3848
14020 msgid "See also L</pvs-full>."
14024 #: ../fish/guestfish-actions.pod:3850
14029 #: ../fish/guestfish-actions.pod:3852
14037 #: ../fish/guestfish-actions.pod:3854 ../src/guestfs-actions.pod:5889
14039 "List all the physical volumes detected. This is the equivalent of the L<pvs"
14040 "(8)> command. The \"full\" version includes all fields."
14044 #: ../fish/guestfish-actions.pod:3857
14049 #: ../fish/guestfish-actions.pod:3859
14057 #: ../fish/guestfish-actions.pod:3861 ../src/guestfs-actions.pod:5904
14058 msgid "This command returns the UUID of the LVM PV C<device>."
14062 #: ../fish/guestfish-actions.pod:3863
14067 #: ../fish/guestfish-actions.pod:3865
14070 " pwrite path content offset\n"
14075 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5920
14077 "This command writes to part of a file. It writes the data buffer C<content> "
14078 "to the file C<path> starting at offset C<offset>."
14082 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5923
14084 "This command implements the L<pwrite(2)> system call, and like that system "
14085 "call it may not write the full data requested. The return value is the "
14086 "number of bytes that were actually written to the file. This could even be "
14087 "0, although short writes are unlikely for regular files in ordinary "
14092 #: ../fish/guestfish-actions.pod:3876
14093 msgid "See also L</pread>, L</pwrite-device>."
14097 #: ../fish/guestfish-actions.pod:3881
14098 msgid "pwrite-device"
14102 #: ../fish/guestfish-actions.pod:3883
14105 " pwrite-device device content offset\n"
14110 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:5947
14112 "This command writes to part of a device. It writes the data buffer "
14113 "C<content> to C<device> starting at offset C<offset>."
14117 #: ../fish/guestfish-actions.pod:3888 ../src/guestfs-actions.pod:5950
14119 "This command implements the L<pwrite(2)> system call, and like that system "
14120 "call it may not write the full data requested (although short writes to disk "
14121 "devices and partitions are probably impossible with standard Linux kernels)."
14125 #: ../fish/guestfish-actions.pod:3893
14126 msgid "See also L</pwrite>."
14130 #: ../fish/guestfish-actions.pod:3898
14135 #: ../fish/guestfish-actions.pod:3900
14138 " read-file path\n"
14143 #: ../fish/guestfish-actions.pod:3902 ../src/guestfs-actions.pod:5971
14144 msgid "This calls returns the contents of the file C<path> as a buffer."
14148 #: ../fish/guestfish-actions.pod:3905
14150 "Unlike L</cat>, this function can correctly handle files that contain "
14151 "embedded ASCII NUL characters. However unlike L</download>, this function "
14152 "is limited in the total size of file that can be handled."
14156 #: ../fish/guestfish-actions.pod:3913
14161 #: ../fish/guestfish-actions.pod:3915
14164 " read-lines path\n"
14169 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5996
14171 "The file contents are returned as a list of lines. Trailing C<LF> and "
14172 "C<CRLF> character sequences are I<not> returned."
14176 #: ../fish/guestfish-actions.pod:3922
14178 "Note that this function cannot correctly handle binary files (specifically, "
14179 "files containing C<\\0> character which is treated as end of line). For "
14180 "those you need to use the L</read-file> function which has a more complex "
14185 #: ../fish/guestfish-actions.pod:3927
14190 #: ../fish/guestfish-actions.pod:3929
14198 #: ../fish/guestfish-actions.pod:3931 ../src/guestfs-actions.pod:6016
14199 msgid "This returns the list of directory entries in directory C<dir>."
14203 #: ../fish/guestfish-actions.pod:3933 ../src/guestfs-actions.pod:6018
14205 "All entries in the directory are returned, including C<.> and C<..>. The "
14206 "entries are I<not> sorted, but returned in the same order as the underlying "
14211 #: ../fish/guestfish-actions.pod:3937 ../src/guestfs-actions.pod:6022
14213 "Also this call returns basic file type information about each file. The "
14214 "C<ftyp> field will contain one of the following characters:"
14218 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6027
14223 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6029
14224 msgid "Block special"
14228 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6031
14233 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6033
14234 msgid "Char special"
14238 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6035
14243 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6037
14248 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6039
14253 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6041
14254 msgid "FIFO (named pipe)"
14258 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6043
14263 #: ../fish/guestfish-actions.pod:3960 ../src/guestfs-actions.pod:6045
14264 msgid "Symbolic link"
14268 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6047
14273 #: ../fish/guestfish-actions.pod:3964 ../src/guestfs-actions.pod:6049
14274 msgid "Regular file"
14278 #: ../fish/guestfish-actions.pod:3966 ../src/guestfs-actions.pod:6051
14283 #: ../fish/guestfish-actions.pod:3968 ../src/guestfs-actions.pod:6053
14288 #: ../fish/guestfish-actions.pod:3970 ../src/guestfs-actions.pod:6055
14293 #: ../fish/guestfish-actions.pod:3972 ../src/guestfs-actions.pod:6057
14294 msgid "Unknown file type"
14298 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6059
14303 #: ../fish/guestfish-actions.pod:3976 ../src/guestfs-actions.pod:6061
14305 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14309 #: ../fish/guestfish-actions.pod:3981
14311 "This function is primarily intended for use by programs. To get a simple "
14312 "list of names, use L</ls>. To get a printable directory for human "
14313 "consumption, use L</ll>."
14317 #: ../fish/guestfish-actions.pod:3985
14322 #: ../fish/guestfish-actions.pod:3987
14330 #: ../fish/guestfish-actions.pod:3989 ../src/guestfs-actions.pod:6082
14331 msgid "This command reads the target of a symbolic link."
14335 #: ../fish/guestfish-actions.pod:3991
14336 msgid "readlinklist"
14340 #: ../fish/guestfish-actions.pod:3993
14343 " readlinklist path 'names ...'\n"
14348 #: ../fish/guestfish-actions.pod:3995 ../src/guestfs-actions.pod:6096
14350 "This call allows you to do a C<readlink> operation on multiple files, where "
14351 "all files are in the directory C<path>. C<names> is the list of files from "
14356 #: ../fish/guestfish-actions.pod:3999 ../src/guestfs-actions.pod:6100
14358 "On return you get a list of strings, with a one-to-one correspondence to the "
14359 "C<names> list. Each string is the value of the symbolic link."
14363 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6104
14365 "If the C<readlink(2)> operation fails on any name, then the corresponding "
14366 "result string is the empty string C<\"\">. However the whole operation is "
14367 "completed even if there were C<readlink(2)> errors, and so you can call this "
14368 "function with names where you don't know if they are symbolic links already "
14369 "(albeit slightly less efficient)."
14373 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6111
14375 "This call is intended for programs that want to efficiently list a directory "
14376 "contents without making many round-trips. Very long directory listings "
14377 "might cause the protocol message size to be exceeded, causing this call to "
14378 "fail. The caller must split up such requests into smaller groups of names."
14382 #: ../fish/guestfish-actions.pod:4017
14387 #: ../fish/guestfish-actions.pod:4019
14395 #: ../fish/guestfish-actions.pod:4021 ../src/guestfs-actions.pod:6130
14397 "Return the canonicalized absolute pathname of C<path>. The returned path "
14398 "has no C<.>, C<..> or symbolic link path elements."
14402 #: ../fish/guestfish-actions.pod:4024
14403 msgid "removexattr"
14407 #: ../fish/guestfish-actions.pod:4026
14410 " removexattr xattr path\n"
14415 #: ../fish/guestfish-actions.pod:4028 ../src/guestfs-actions.pod:6145
14417 "This call removes the extended attribute named C<xattr> of the file C<path>."
14421 #: ../fish/guestfish-actions.pod:4031
14422 msgid "See also: L</lremovexattr>, L<attr(5)>."
14426 #: ../fish/guestfish-actions.pod:4033
14431 #: ../fish/guestfish-actions.pod:4035
14434 " resize2fs device\n"
14439 #: ../fish/guestfish-actions.pod:4037 ../src/guestfs-actions.pod:6160
14441 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
14442 "underlying device."
14446 #: ../fish/guestfish-actions.pod:4040
14448 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
14449 "before calling this command. For unknown reasons C<resize2fs> sometimes "
14450 "gives an error about this and sometimes not. In any case, it is always safe "
14451 "to call L</e2fsck-f> before calling this function."
14455 #: ../fish/guestfish-actions.pod:4046
14456 msgid "resize2fs-M"
14460 #: ../fish/guestfish-actions.pod:4048
14463 " resize2fs-M device\n"
14468 #: ../fish/guestfish-actions.pod:4050
14470 "This command is the same as L</resize2fs>, but the filesystem is resized to "
14471 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
14476 #: ../fish/guestfish-actions.pod:4054
14478 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
14479 "and read the C<Block size> and C<Block count> values. These two numbers, "
14480 "multiplied together, give the resulting size of the minimal filesystem in "
14485 #: ../fish/guestfish-actions.pod:4059
14486 msgid "resize2fs-size"
14490 #: ../fish/guestfish-actions.pod:4061
14493 " resize2fs-size device size\n"
14498 #: ../fish/guestfish-actions.pod:4063
14500 "This command is the same as L</resize2fs> except that it allows you to "
14501 "specify the new size (in bytes) explicitly."
14505 #: ../fish/guestfish-actions.pod:4066
14510 #: ../fish/guestfish-actions.pod:4068
14518 #: ../fish/guestfish-actions.pod:4070 ../src/guestfs-actions.pod:6212
14519 msgid "Remove the single file C<path>."
14523 #: ../fish/guestfish-actions.pod:4072
14528 #: ../fish/guestfish-actions.pod:4074
14536 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6224
14538 "Remove the file or directory C<path>, recursively removing the contents if "
14539 "its a directory. This is like the C<rm -rf> shell command."
14543 #: ../fish/guestfish-actions.pod:4080
14548 #: ../fish/guestfish-actions.pod:4082
14556 #: ../fish/guestfish-actions.pod:4084 ../src/guestfs-actions.pod:6238
14557 msgid "Remove the single directory C<path>."
14561 #: ../fish/guestfish-actions.pod:4086
14562 msgid "rmmountpoint"
14566 #: ../fish/guestfish-actions.pod:4088
14569 " rmmountpoint exemptpath\n"
14574 #: ../fish/guestfish-actions.pod:4090
14576 "This calls removes a mountpoint that was previously created with L</"
14577 "mkmountpoint>. See L</mkmountpoint> for full details."
14581 #: ../fish/guestfish-actions.pod:4094
14582 msgid "scrub-device"
14586 #: ../fish/guestfish-actions.pod:4096
14589 " scrub-device device\n"
14594 #: ../fish/guestfish-actions.pod:4098 ../src/guestfs-actions.pod:6264
14596 "This command writes patterns over C<device> to make data retrieval more "
14601 #: ../fish/guestfish-actions.pod:4101 ../fish/guestfish-actions.pod:4116
14602 #: ../fish/guestfish-actions.pod:4129 ../src/guestfs-actions.pod:6267
14603 #: ../src/guestfs-actions.pod:6288 ../src/guestfs-actions.pod:6307
14605 "It is an interface to the L<scrub(1)> program. See that manual page for "
14610 #: ../fish/guestfish-actions.pod:4107
14615 #: ../fish/guestfish-actions.pod:4109
14618 " scrub-file file\n"
14623 #: ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6283
14625 "This command writes patterns over a file to make data retrieval more "
14630 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6286
14631 msgid "The file is I<removed> after scrubbing."
14635 #: ../fish/guestfish-actions.pod:4119
14636 msgid "scrub-freespace"
14640 #: ../fish/guestfish-actions.pod:4121
14643 " scrub-freespace dir\n"
14648 #: ../fish/guestfish-actions.pod:4123
14650 "This command creates the directory C<dir> and then fills it with files until "
14651 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14652 "deletes them. The intention is to scrub any free space on the partition "
14653 "containing C<dir>."
14657 #: ../fish/guestfish-actions.pod:4132
14662 #: ../fish/guestfish-actions.pod:4134
14667 #: ../fish/guestfish-actions.pod:4136
14670 " set-append append\n"
14675 #: ../fish/guestfish-actions.pod:4138 ../src/guestfs-actions.pod:6320
14677 "This function is used to add additional options to the guest kernel command "
14682 #: ../fish/guestfish-actions.pod:4141 ../src/guestfs-actions.pod:6323
14684 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14685 "environment variable."
14689 #: ../fish/guestfish-actions.pod:4144 ../src/guestfs-actions.pod:6326
14691 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14692 "(libguestfs always adds a few of its own)."
14696 #: ../fish/guestfish-actions.pod:4147
14697 msgid "set-attach-method"
14701 #: ../fish/guestfish-actions.pod:4149
14702 msgid "attach-method"
14706 #: ../fish/guestfish-actions.pod:4151
14709 " set-attach-method attachmethod\n"
14714 #: ../fish/guestfish-actions.pod:4153 ../src/guestfs-actions.pod:6339
14716 "Set the method that libguestfs uses to connect to the back end guestfsd "
14717 "daemon. Possible methods are:"
14721 #: ../fish/guestfish-actions.pod:4158 ../src/guestfs-actions.pod:6344
14722 #: ../src/guestfs.pod:2901
14723 msgid "C<appliance>"
14727 #: ../fish/guestfish-actions.pod:4160 ../src/guestfs-actions.pod:6346
14729 "Launch an appliance and connect to it. This is the ordinary method and the "
14734 #: ../fish/guestfish-actions.pod:4163 ../src/guestfs-actions.pod:6349
14735 msgid "C<unix:I<path>>"
14739 #: ../fish/guestfish-actions.pod:4165 ../src/guestfs-actions.pod:6351
14740 msgid "Connect to the Unix domain socket I<path>."
14744 #: ../fish/guestfish-actions.pod:4167 ../src/guestfs-actions.pod:6353
14746 "This method lets you connect to an existing daemon or (using virtio-serial) "
14747 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14748 "RUNNING DAEMONS>."
14752 #: ../fish/guestfish-actions.pod:4173
14753 msgid "set-autosync"
14757 #: ../fish/guestfish-actions.pod:4175
14762 #: ../fish/guestfish-actions.pod:4177
14765 " set-autosync true|false\n"
14770 #: ../fish/guestfish-actions.pod:4179 ../src/guestfs-actions.pod:6369
14772 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14773 "effort attempt to make filesystems consistent and synchronized when the "
14774 "handle is closed (also if the program exits without closing handles)."
14778 #: ../fish/guestfish-actions.pod:4184 ../src/guestfs-actions.pod:6374
14780 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14781 "disabled by default)."
14785 #: ../fish/guestfish-actions.pod:4187
14790 #: ../fish/guestfish-actions.pod:4189
14795 #: ../fish/guestfish-actions.pod:4191
14798 " set-direct true|false\n"
14803 #: ../fish/guestfish-actions.pod:4193 ../src/guestfs-actions.pod:6387
14805 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14806 "passed directly through to the appliance once it is launched."
14810 #: ../fish/guestfish-actions.pod:4197
14812 "One consequence of this is that log messages aren't caught by the library "
14813 "and handled by L</set-log-message-callback>, but go straight to stdout."
14817 #: ../fish/guestfish-actions.pod:4201 ../src/guestfs-actions.pod:6395
14818 msgid "You probably don't want to use this unless you know what you are doing."
14822 #: ../fish/guestfish-actions.pod:4204 ../src/guestfs-actions.pod:6398
14823 msgid "The default is disabled."
14827 #: ../fish/guestfish-actions.pod:4206
14828 msgid "set-e2label"
14832 #: ../fish/guestfish-actions.pod:4208
14835 " set-e2label device label\n"
14840 #: ../fish/guestfish-actions.pod:4210 ../src/guestfs-actions.pod:6411
14842 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14843 "C<label>. Filesystem labels are limited to 16 characters."
14847 #: ../fish/guestfish-actions.pod:4214
14849 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14850 "label on a filesystem."
14854 #: ../fish/guestfish-actions.pod:4217
14859 #: ../fish/guestfish-actions.pod:4219
14862 " set-e2uuid device uuid\n"
14867 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6429
14869 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14870 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14871 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14875 #: ../fish/guestfish-actions.pod:4226
14877 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14878 "UUID of a filesystem."
14882 #: ../fish/guestfish-actions.pod:4229
14883 msgid "set-memsize"
14887 #: ../fish/guestfish-actions.pod:4231
14892 #: ../fish/guestfish-actions.pod:4233
14895 " set-memsize memsize\n"
14900 #: ../fish/guestfish-actions.pod:4235
14902 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14903 "This only has any effect if called before L</launch>."
14907 #: ../fish/guestfish-actions.pod:4239 ../src/guestfs-actions.pod:6451
14909 "You can also change this by setting the environment variable "
14910 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14914 #: ../fish/guestfish-actions.pod:4246
14915 msgid "set-network"
14919 #: ../fish/guestfish-actions.pod:4248
14924 #: ../fish/guestfish-actions.pod:4250
14927 " set-network true|false\n"
14932 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6468
14934 "If C<network> is true, then the network is enabled in the libguestfs "
14935 "appliance. The default is false."
14939 #: ../fish/guestfish-actions.pod:4255 ../src/guestfs-actions.pod:6471
14941 "This affects whether commands are able to access the network (see L<guestfs"
14942 "(3)/RUNNING COMMANDS>)."
14946 #: ../fish/guestfish-actions.pod:4258
14948 "You must call this before calling L</launch>, otherwise it has no effect."
14952 #: ../fish/guestfish-actions.pod:4261
14957 #: ../fish/guestfish-actions.pod:4265
14960 " set-path searchpath\n"
14965 #: ../fish/guestfish-actions.pod:4267 ../src/guestfs-actions.pod:6487
14966 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14970 #: ../fish/guestfish-actions.pod:4269 ../src/guestfs-actions.pod:6489
14972 "The default is C<$libdir/guestfs> unless overridden by setting "
14973 "C<LIBGUESTFS_PATH> environment variable."
14977 #: ../fish/guestfish-actions.pod:4272 ../src/guestfs-actions.pod:6492
14978 msgid "Setting C<path> to C<NULL> restores the default path."
14982 #: ../fish/guestfish-actions.pod:4274
14987 #: ../fish/guestfish-actions.pod:4276
14992 #: ../fish/guestfish-actions.pod:4278
14995 " set-pgroup true|false\n"
15000 #: ../fish/guestfish-actions.pod:4280 ../src/guestfs-actions.pod:6504
15002 "If C<pgroup> is true, child processes are placed into their own process "
15007 #: ../fish/guestfish-actions.pod:4283 ../src/guestfs-actions.pod:6507
15009 "The practical upshot of this is that signals like C<SIGINT> (from users "
15010 "pressing C<^C>) won't be received by the child process."
15014 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6510
15016 "The default for this flag is false, because usually you want C<^C> to kill "
15021 #: ../fish/guestfish-actions.pod:4289
15026 #: ../fish/guestfish-actions.pod:4291
15031 #: ../fish/guestfish-actions.pod:4293
15039 #: ../fish/guestfish-actions.pod:4295 ../src/guestfs-actions.pod:6523
15040 msgid "Set the qemu binary that we will use."
15044 #: ../fish/guestfish-actions.pod:4297 ../src/guestfs-actions.pod:6525
15046 "The default is chosen when the library was compiled by the configure script."
15050 #: ../fish/guestfish-actions.pod:4300 ../src/guestfs-actions.pod:6528
15052 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
15057 #: ../fish/guestfish-actions.pod:4303 ../src/guestfs-actions.pod:6531
15058 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
15062 #: ../fish/guestfish-actions.pod:4305 ../src/guestfs-actions.pod:6533
15064 "Note that you should call this function as early as possible after creating "
15065 "the handle. This is because some pre-launch operations depend on testing "
15066 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
15067 "don't retest features, and so you might see inconsistent results. Using the "
15068 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
15069 "the qemu binary at the same time as the handle is created."
15073 #: ../fish/guestfish-actions.pod:4313
15074 msgid "set-recovery-proc"
15078 #: ../fish/guestfish-actions.pod:4315
15079 msgid "recovery-proc"
15083 #: ../fish/guestfish-actions.pod:4317
15086 " set-recovery-proc true|false\n"
15091 #: ../fish/guestfish-actions.pod:4319
15093 "If this is called with the parameter C<false> then L</launch> does not "
15094 "create a recovery process. The purpose of the recovery process is to stop "
15095 "runaway qemu processes in the case where the main program aborts abruptly."
15099 #: ../fish/guestfish-actions.pod:4324
15101 "This only has any effect if called before L</launch>, and the default is "
15106 #: ../fish/guestfish-actions.pod:4327 ../src/guestfs-actions.pod:6559
15108 "About the only time when you would want to disable this is if the main "
15109 "process will fork itself into the background (\"daemonize\" itself). In "
15110 "this case the recovery process thinks that the main program has disappeared "
15111 "and so kills qemu, which is not very helpful."
15115 #: ../fish/guestfish-actions.pod:4333
15116 msgid "set-selinux"
15120 #: ../fish/guestfish-actions.pod:4335
15125 #: ../fish/guestfish-actions.pod:4337
15128 " set-selinux true|false\n"
15133 #: ../fish/guestfish-actions.pod:4339 ../src/guestfs-actions.pod:6575
15135 "This sets the selinux flag that is passed to the appliance at boot time. "
15136 "The default is C<selinux=0> (disabled)."
15140 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6578
15142 "Note that if SELinux is enabled, it is always in Permissive mode "
15143 "(C<enforcing=0>)."
15147 #: ../fish/guestfish-actions.pod:4348
15152 #: ../fish/guestfish-actions.pod:4350
15157 #: ../fish/guestfish-actions.pod:4352
15165 #: ../fish/guestfish-actions.pod:4354 ../src/guestfs-actions.pod:6594
15167 "Change the number of virtual CPUs assigned to the appliance. The default is "
15168 "C<1>. Increasing this may improve performance, though often it has no "
15173 #: ../fish/guestfish-actions.pod:4358
15174 msgid "This function must be called before L</launch>."
15178 #: ../fish/guestfish-actions.pod:4360
15183 #: ../fish/guestfish-actions.pod:4362
15188 #: ../fish/guestfish-actions.pod:4364
15191 " set-trace true|false\n"
15196 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6610
15198 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
15199 "return values are traced."
15203 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6613
15205 "If you want to trace C API calls into libguestfs (and other libraries) then "
15206 "possibly a better way is to use the external ltrace(1) command."
15210 #: ../fish/guestfish-actions.pod:4373 ../src/guestfs-actions.pod:6617
15212 "Command traces are disabled unless the environment variable "
15213 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
15217 #: ../fish/guestfish-actions.pod:4376
15219 "Trace messages are normally sent to C<stderr>, unless you register a "
15220 "callback to send them somewhere else (see L</set-event-callback>)."
15224 #: ../fish/guestfish-actions.pod:4380
15225 msgid "set-verbose"
15229 #: ../fish/guestfish-actions.pod:4382
15234 #: ../fish/guestfish-actions.pod:4384
15237 " set-verbose true|false\n"
15242 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6634
15243 msgid "If C<verbose> is true, this turns on verbose messages."
15247 #: ../fish/guestfish-actions.pod:4388 ../src/guestfs-actions.pod:6636
15249 "Verbose messages are disabled unless the environment variable "
15250 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
15254 #: ../fish/guestfish-actions.pod:4391
15256 "Verbose messages are normally sent to C<stderr>, unless you register a "
15257 "callback to send them somewhere else (see L</set-event-callback>)."
15261 #: ../fish/guestfish-actions.pod:4395
15266 #: ../fish/guestfish-actions.pod:4397
15269 " setcon context\n"
15274 #: ../fish/guestfish-actions.pod:4399 ../src/guestfs-actions.pod:6653
15276 "This sets the SELinux security context of the daemon to the string "
15281 #: ../fish/guestfish-actions.pod:4402 ../src/guestfs-actions.pod:6656
15282 msgid "See the documentation about SELINUX in L<guestfs(3)>."
15286 #: ../fish/guestfish-actions.pod:4404
15291 #: ../fish/guestfish-actions.pod:4406
15294 " setxattr xattr val vallen path\n"
15299 #: ../fish/guestfish-actions.pod:4408 ../src/guestfs-actions.pod:6671
15301 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15302 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15306 #: ../fish/guestfish-actions.pod:4412
15307 msgid "See also: L</lsetxattr>, L<attr(5)>."
15311 #: ../fish/guestfish-actions.pod:4414
15316 #: ../fish/guestfish-actions.pod:4416
15319 " sfdisk device cyls heads sectors 'lines ...'\n"
15324 #: ../fish/guestfish-actions.pod:4418 ../src/guestfs-actions.pod:6698
15326 "This is a direct interface to the L<sfdisk(8)> program for creating "
15327 "partitions on block devices."
15331 #: ../fish/guestfish-actions.pod:4421 ../src/guestfs-actions.pod:6701
15332 msgid "C<device> should be a block device, for example C</dev/sda>."
15336 #: ../fish/guestfish-actions.pod:4423 ../src/guestfs-actions.pod:6703
15338 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15339 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
15340 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15341 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15342 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15343 "the kernel) cannot work out the right geometry and you will need to tell it."
15347 #: ../fish/guestfish-actions.pod:4431 ../src/guestfs-actions.pod:6711
15349 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15350 "refer to the L<sfdisk(8)> manpage."
15354 #: ../fish/guestfish-actions.pod:4434 ../src/guestfs-actions.pod:6714
15356 "To create a single partition occupying the whole disk, you would pass "
15357 "C<lines> as a single element list, when the single element being the string "
15362 #: ../fish/guestfish-actions.pod:4438
15363 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
15367 #: ../fish/guestfish-actions.pod:4444 ../fish/guestfish-actions.pod:4467
15368 #: ../fish/guestfish-actions.pod:4489
15370 "I<This function is deprecated.> In new code, use the L</part_add> call "
15375 #: ../fish/guestfish-actions.pod:4451
15380 #: ../fish/guestfish-actions.pod:4453
15383 " sfdiskM device 'lines ...'\n"
15388 #: ../fish/guestfish-actions.pod:4455
15390 "This is a simplified interface to the L</sfdisk> command, where partition "
15391 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
15392 "you don't need to specify the cyls, heads and sectors parameters which were "
15393 "rarely if ever used anyway."
15397 #: ../fish/guestfish-actions.pod:4461
15398 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
15402 #: ../fish/guestfish-actions.pod:4474
15407 #: ../fish/guestfish-actions.pod:4476
15410 " sfdisk-N device partnum cyls heads sectors line\n"
15415 #: ../fish/guestfish-actions.pod:4478 ../src/guestfs-actions.pod:6776
15417 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
15418 "(note: C<n> counts from 1)."
15422 #: ../fish/guestfish-actions.pod:4481
15424 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
15425 "cyls/heads/sectors parameters."
15429 #: ../fish/guestfish-actions.pod:4484
15430 msgid "See also: L</part-add>"
15434 #: ../fish/guestfish-actions.pod:4496
15435 msgid "sfdisk-disk-geometry"
15439 #: ../fish/guestfish-actions.pod:4498
15442 " sfdisk-disk-geometry device\n"
15447 #: ../fish/guestfish-actions.pod:4500
15449 "This displays the disk geometry of C<device> read from the partition table. "
15450 "Especially in the case where the underlying block device has been resized, "
15451 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
15452 "kernel-geometry>)."
15456 #: ../fish/guestfish-actions.pod:4505 ../fish/guestfish-actions.pod:4514
15457 #: ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6818
15458 msgid "The result is in human-readable format, and not designed to be parsed."
15462 #: ../fish/guestfish-actions.pod:4508
15463 msgid "sfdisk-kernel-geometry"
15467 #: ../fish/guestfish-actions.pod:4510
15470 " sfdisk-kernel-geometry device\n"
15475 #: ../fish/guestfish-actions.pod:4512 ../src/guestfs-actions.pod:6816
15476 msgid "This displays the kernel's idea of the geometry of C<device>."
15480 #: ../fish/guestfish-actions.pod:4517
15485 #: ../fish/guestfish-actions.pod:4519
15488 " sfdisk-l device\n"
15493 #: ../fish/guestfish-actions.pod:4521 ../src/guestfs-actions.pod:6839
15495 "This displays the partition table on C<device>, in the human-readable output "
15496 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15500 #: ../fish/guestfish-actions.pod:4525
15501 msgid "See also: L</part-list>"
15505 #: ../fish/guestfish-actions.pod:4527
15507 "I<This function is deprecated.> In new code, use the L</part_list> call "
15512 #: ../fish/guestfish-actions.pod:4534
15517 #: ../fish/guestfish-actions.pod:4536
15525 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:6856
15527 "This call runs a command from the guest filesystem via the guest's C</bin/"
15532 #: ../fish/guestfish-actions.pod:4541
15533 msgid "This is like L</command>, but passes the command to:"
15537 #: ../fish/guestfish-actions.pod:4543 ../src/guestfs-actions.pod:6861
15540 " /bin/sh -c \"command\"\n"
15545 #: ../fish/guestfish-actions.pod:4545 ../src/guestfs-actions.pod:6863
15547 "Depending on the guest's shell, this usually results in wildcards being "
15548 "expanded, shell expressions being interpolated and so on."
15552 #: ../fish/guestfish-actions.pod:4549
15553 msgid "All the provisos about L</command> apply to this call."
15557 #: ../fish/guestfish-actions.pod:4551
15562 #: ../fish/guestfish-actions.pod:4553
15565 " sh-lines command\n"
15570 #: ../fish/guestfish-actions.pod:4555
15571 msgid "This is the same as L</sh>, but splits the result into a list of lines."
15575 #: ../fish/guestfish-actions.pod:4558
15576 msgid "See also: L</command-lines>"
15580 #: ../fish/guestfish-actions.pod:4560
15585 #: ../fish/guestfish-actions.pod:4562
15593 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6897
15594 msgid "Sleep for C<secs> seconds."
15598 #: ../fish/guestfish-actions.pod:4566
15603 #: ../fish/guestfish-actions.pod:4568
15611 #: ../fish/guestfish-actions.pod:4572 ../src/guestfs-actions.pod:6911
15612 msgid "This is the same as the C<stat(2)> system call."
15616 #: ../fish/guestfish-actions.pod:4574
15621 #: ../fish/guestfish-actions.pod:4576
15629 #: ../fish/guestfish-actions.pod:4578 ../src/guestfs-actions.pod:6925
15631 "Returns file system statistics for any mounted file system. C<path> should "
15632 "be a file or directory in the mounted file system (typically it is the mount "
15633 "point itself, but it doesn't need to be)."
15637 #: ../fish/guestfish-actions.pod:4582 ../src/guestfs-actions.pod:6929
15638 msgid "This is the same as the C<statvfs(2)> system call."
15642 #: ../fish/guestfish-actions.pod:4584
15647 #: ../fish/guestfish-actions.pod:4586
15655 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6943
15657 "This runs the L<strings(1)> command on a file and returns the list of "
15658 "printable strings found."
15662 #: ../fish/guestfish-actions.pod:4594
15667 #: ../fish/guestfish-actions.pod:4596
15670 " strings-e encoding path\n"
15675 #: ../fish/guestfish-actions.pod:4598
15677 "This is like the L</strings> command, but allows you to specify the encoding "
15678 "of strings that are looked for in the source file C<path>."
15682 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6966
15683 msgid "Allowed encodings are:"
15687 #: ../fish/guestfish-actions.pod:4606 ../src/guestfs-actions.pod:6970
15692 #: ../fish/guestfish-actions.pod:4608
15694 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15695 "ISO-8859-X (this is what L</strings> uses)."
15699 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6975
15704 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6977
15705 msgid "Single 8-bit-byte characters."
15709 #: ../fish/guestfish-actions.pod:4615 ../src/guestfs-actions.pod:6979
15714 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6981
15715 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15719 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:6984
15720 msgid "l (lower case letter L)"
15724 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:6986
15726 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15727 "examining binaries in Windows guests."
15731 #: ../fish/guestfish-actions.pod:4625 ../src/guestfs-actions.pod:6989
15736 #: ../fish/guestfish-actions.pod:4627 ../src/guestfs-actions.pod:6991
15737 msgid "32-bit big endian such as UCS-4BE."
15741 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:6993
15746 #: ../fish/guestfish-actions.pod:4631 ../src/guestfs-actions.pod:6995
15747 msgid "32-bit little endian such as UCS-4LE."
15751 #: ../fish/guestfish-actions.pod:4635 ../src/guestfs-actions.pod:6999
15752 msgid "The returned strings are transcoded to UTF-8."
15756 #: ../fish/guestfish-actions.pod:4640
15757 msgid "swapoff-device"
15761 #: ../fish/guestfish-actions.pod:4642
15764 " swapoff-device device\n"
15769 #: ../fish/guestfish-actions.pod:4644
15771 "This command disables the libguestfs appliance swap device or partition "
15772 "named C<device>. See L</swapon-device>."
15776 #: ../fish/guestfish-actions.pod:4648
15777 msgid "swapoff-file"
15781 #: ../fish/guestfish-actions.pod:4650
15784 " swapoff-file file\n"
15789 #: ../fish/guestfish-actions.pod:4652 ../src/guestfs-actions.pod:7030
15790 msgid "This command disables the libguestfs appliance swap on file."
15794 #: ../fish/guestfish-actions.pod:4654
15795 msgid "swapoff-label"
15799 #: ../fish/guestfish-actions.pod:4656
15802 " swapoff-label label\n"
15807 #: ../fish/guestfish-actions.pod:4658 ../src/guestfs-actions.pod:7042
15809 "This command disables the libguestfs appliance swap on labeled swap "
15814 #: ../fish/guestfish-actions.pod:4661
15815 msgid "swapoff-uuid"
15819 #: ../fish/guestfish-actions.pod:4663
15822 " swapoff-uuid uuid\n"
15827 #: ../fish/guestfish-actions.pod:4665 ../src/guestfs-actions.pod:7055
15829 "This command disables the libguestfs appliance swap partition with the given "
15834 #: ../fish/guestfish-actions.pod:4668
15835 msgid "swapon-device"
15839 #: ../fish/guestfish-actions.pod:4670
15842 " swapon-device device\n"
15847 #: ../fish/guestfish-actions.pod:4672
15849 "This command enables the libguestfs appliance to use the swap device or "
15850 "partition named C<device>. The increased memory is made available for all "
15851 "commands, for example those run using L</command> or L</sh>."
15855 #: ../fish/guestfish-actions.pod:4677 ../src/guestfs-actions.pod:7073
15857 "Note that you should not swap to existing guest swap partitions unless you "
15858 "know what you are doing. They may contain hibernation information, or other "
15859 "information that the guest doesn't want you to trash. You also risk leaking "
15860 "information about the host to the guest this way. Instead, attach a new "
15861 "host device to the guest and swap on that."
15865 #: ../fish/guestfish-actions.pod:4684
15866 msgid "swapon-file"
15870 #: ../fish/guestfish-actions.pod:4686
15873 " swapon-file file\n"
15878 #: ../fish/guestfish-actions.pod:4688
15880 "This command enables swap to a file. See L</swapon-device> for other notes."
15884 #: ../fish/guestfish-actions.pod:4691
15885 msgid "swapon-label"
15889 #: ../fish/guestfish-actions.pod:4693
15892 " swapon-label label\n"
15897 #: ../fish/guestfish-actions.pod:4695
15899 "This command enables swap to a labeled swap partition. See L</swapon-"
15900 "device> for other notes."
15904 #: ../fish/guestfish-actions.pod:4698
15905 msgid "swapon-uuid"
15909 #: ../fish/guestfish-actions.pod:4700
15912 " swapon-uuid uuid\n"
15917 #: ../fish/guestfish-actions.pod:4702
15919 "This command enables swap to a swap partition with the given UUID. See L</"
15920 "swapon-device> for other notes."
15924 #: ../fish/guestfish-actions.pod:4705
15929 #: ../fish/guestfish-actions.pod:4707
15937 #: ../fish/guestfish-actions.pod:4709 ../src/guestfs-actions.pod:7128
15939 "This syncs the disk, so that any writes are flushed through to the "
15940 "underlying disk image."
15944 #: ../fish/guestfish-actions.pod:4712 ../src/guestfs-actions.pod:7131
15946 "You should always call this if you have modified a disk image, before "
15947 "closing the handle."
15951 #: ../fish/guestfish-actions.pod:4715
15956 #: ../fish/guestfish-actions.pod:4717
15964 #: ../fish/guestfish-actions.pod:4719 ../src/guestfs-actions.pod:7144
15966 "This command returns up to the last 10 lines of a file as a list of strings."
15970 #: ../fish/guestfish-actions.pod:4725
15975 #: ../fish/guestfish-actions.pod:4727
15978 " tail-n nrlines path\n"
15983 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7163
15985 "If the parameter C<nrlines> is a positive number, this returns the last "
15986 "C<nrlines> lines of the file C<path>."
15990 #: ../fish/guestfish-actions.pod:4732 ../src/guestfs-actions.pod:7166
15992 "If the parameter C<nrlines> is a negative number, this returns lines from "
15993 "the file C<path>, starting with the C<-nrlines>th line."
15997 #: ../fish/guestfish-actions.pod:4740
16002 #: ../fish/guestfish-actions.pod:4742
16005 " tar-in (tarfile|-) directory\n"
16010 #: ../fish/guestfish-actions.pod:4744 ../src/guestfs-actions.pod:7187
16012 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
16013 "tar file) into C<directory>."
16017 #: ../fish/guestfish-actions.pod:4747
16018 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
16022 #: ../fish/guestfish-actions.pod:4752
16027 #: ../fish/guestfish-actions.pod:4754
16030 " tar-out directory (tarfile|-)\n"
16035 #: ../fish/guestfish-actions.pod:4756 ../src/guestfs-actions.pod:7204
16037 "This command packs the contents of C<directory> and downloads it to local "
16042 #: ../fish/guestfish-actions.pod:4759
16043 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
16047 #: ../fish/guestfish-actions.pod:4764
16052 #: ../fish/guestfish-actions.pod:4766
16055 " tgz-in (tarball|-) directory\n"
16060 #: ../fish/guestfish-actions.pod:4768 ../src/guestfs-actions.pod:7221
16062 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
16063 "tar file) into C<directory>."
16067 #: ../fish/guestfish-actions.pod:4771
16068 msgid "To upload an uncompressed tarball, use L</tar-in>."
16072 #: ../fish/guestfish-actions.pod:4775
16077 #: ../fish/guestfish-actions.pod:4777
16080 " tgz-out directory (tarball|-)\n"
16085 #: ../fish/guestfish-actions.pod:4779 ../src/guestfs-actions.pod:7237
16087 "This command packs the contents of C<directory> and downloads it to local "
16092 #: ../fish/guestfish-actions.pod:4782
16093 msgid "To download an uncompressed tarball, use L</tar-out>."
16097 #: ../fish/guestfish-actions.pod:4786
16102 #: ../fish/guestfish-actions.pod:4788
16110 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7252
16112 "Touch acts like the L<touch(1)> command. It can be used to update the "
16113 "timestamps on a file, or, if the file does not exist, to create a new zero-"
16118 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7256
16120 "This command only works on regular files, and will fail on other file types "
16121 "such as directories, symbolic links, block special etc."
16125 #: ../fish/guestfish-actions.pod:4797
16130 #: ../fish/guestfish-actions.pod:4799
16138 #: ../fish/guestfish-actions.pod:4801 ../src/guestfs-actions.pod:7269
16140 "This command truncates C<path> to a zero-length file. The file must exist "
16145 #: ../fish/guestfish-actions.pod:4804
16146 msgid "truncate-size"
16150 #: ../fish/guestfish-actions.pod:4806
16153 " truncate-size path size\n"
16158 #: ../fish/guestfish-actions.pod:4808 ../src/guestfs-actions.pod:7283
16160 "This command truncates C<path> to size C<size> bytes. The file must exist "
16165 #: ../fish/guestfish-actions.pod:4811
16167 "If the current file size is less than C<size> then the file is extended to "
16168 "the required size with zero bytes. This creates a sparse file (ie. disk "
16169 "blocks are not allocated for the file until you write to it). To create a "
16170 "non-sparse file of zeroes, use L</fallocate64> instead."
16174 #: ../fish/guestfish-actions.pod:4817
16179 #: ../fish/guestfish-actions.pod:4819
16182 " tune2fs-l device\n"
16187 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7302
16189 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
16194 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7305
16196 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
16197 "for more details. The list of fields returned isn't clearly defined, and "
16198 "depends on both the version of C<tune2fs> that libguestfs was built against, "
16199 "and the filesystem itself."
16203 #: ../fish/guestfish-actions.pod:4829
16208 #: ../fish/guestfish-actions.pod:4831
16211 " txz-in (tarball|-) directory\n"
16216 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7325
16218 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
16219 "tar file) into C<directory>."
16223 #: ../fish/guestfish-actions.pod:4838
16228 #: ../fish/guestfish-actions.pod:4840
16231 " txz-out directory (tarball|-)\n"
16236 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7339
16238 "This command packs the contents of C<directory> and downloads it to local "
16239 "file C<tarball> (as an xz compressed tar archive)."
16243 #: ../fish/guestfish-actions.pod:4847
16248 #: ../fish/guestfish-actions.pod:4849
16256 #: ../fish/guestfish-actions.pod:4851 ../src/guestfs-actions.pod:7352
16258 "This function sets the mask used for creating new files and device nodes to "
16263 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7355
16265 "Typical umask values would be C<022> which creates new files with "
16266 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
16267 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
16271 #: ../fish/guestfish-actions.pod:4859 ../src/guestfs-actions.pod:7360
16273 "The default umask is C<022>. This is important because it means that "
16274 "directories and device nodes will be created with C<0644> or C<0755> mode "
16275 "even if you specify C<0777>."
16279 #: ../fish/guestfish-actions.pod:4863
16280 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
16284 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7367
16285 msgid "This call returns the previous umask."
16289 #: ../fish/guestfish-actions.pod:4868
16294 #: ../fish/guestfish-actions.pod:4870
16299 #: ../fish/guestfish-actions.pod:4872
16302 " umount pathordevice\n"
16307 #: ../fish/guestfish-actions.pod:4874 ../src/guestfs-actions.pod:7379
16309 "This unmounts the given filesystem. The filesystem may be specified either "
16310 "by its mountpoint (path) or the device which contains the filesystem."
16314 #: ../fish/guestfish-actions.pod:4878
16319 #: ../fish/guestfish-actions.pod:4880
16320 msgid "unmount-all"
16324 #: ../fish/guestfish-actions.pod:4882
16332 #: ../fish/guestfish-actions.pod:4884 ../src/guestfs-actions.pod:7392
16333 msgid "This unmounts all mounted filesystems."
16337 #: ../fish/guestfish-actions.pod:4886 ../src/guestfs-actions.pod:7394
16338 msgid "Some internal mounts are not unmounted by this call."
16342 #: ../fish/guestfish-actions.pod:4888
16347 #: ../fish/guestfish-actions.pod:4890
16350 " upload (filename|-) remotefilename\n"
16355 #: ../fish/guestfish-actions.pod:4892 ../fish/guestfish-actions.pod:4905
16356 #: ../src/guestfs-actions.pod:7407 ../src/guestfs-actions.pod:7431
16357 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
16361 #: ../fish/guestfish-actions.pod:4897
16362 msgid "See also L</download>."
16366 #: ../fish/guestfish-actions.pod:4901
16367 msgid "upload-offset"
16371 #: ../fish/guestfish-actions.pod:4903
16374 " upload-offset (filename|-) remotefilename offset\n"
16379 #: ../fish/guestfish-actions.pod:4908 ../src/guestfs-actions.pod:7434
16381 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
16382 "The intention is to overwrite parts of existing files or devices, although "
16383 "if a non-existant file is specified then it is created with a \"hole\" "
16384 "before C<offset>. The size of the data written is implicit in the size of "
16385 "the source C<filename>."
16389 #: ../fish/guestfish-actions.pod:4915
16391 "Note that there is no limit on the amount of data that can be uploaded with "
16392 "this call, unlike with L</pwrite>, and this call always writes the full "
16393 "amount unless an error occurs."
16397 #: ../fish/guestfish-actions.pod:4920
16398 msgid "See also L</upload>, L</pwrite>."
16402 #: ../fish/guestfish-actions.pod:4924
16407 #: ../fish/guestfish-actions.pod:4926
16410 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
16415 #: ../fish/guestfish-actions.pod:4928 ../src/guestfs-actions.pod:7467
16416 msgid "This command sets the timestamps of a file with nanosecond precision."
16420 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7470
16422 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
16427 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7473
16429 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
16430 "nanoseconds from the epoch."
16434 #: ../fish/guestfish-actions.pod:4937 ../src/guestfs-actions.pod:7476
16436 "If the C<*nsecs> field contains the special value C<-1> then the "
16437 "corresponding timestamp is set to the current time. (The C<*secs> field is "
16438 "ignored in this case)."
16442 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7480
16444 "If the C<*nsecs> field contains the special value C<-2> then the "
16445 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
16450 #: ../fish/guestfish-actions.pod:4945
16455 #: ../fish/guestfish-actions.pod:4947
16463 #: ../fish/guestfish-actions.pod:4949 ../src/guestfs-actions.pod:7493
16465 "Return the libguestfs version number that the program is linked against."
16469 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7496
16471 "Note that because of dynamic linking this is not necessarily the version of "
16472 "libguestfs that you compiled against. You can compile the program, and then "
16473 "at runtime dynamically link against a completely different C<libguestfs.so> "
16478 #: ../fish/guestfish-actions.pod:4957 ../src/guestfs-actions.pod:7501
16480 "This call was added in version C<1.0.58>. In previous versions of "
16481 "libguestfs there was no way to get the version number. From C code you can "
16482 "use dynamic linker functions to find out if this symbol exists (if it "
16483 "doesn't, then it's an earlier version)."
16487 #: ../fish/guestfish-actions.pod:4963 ../src/guestfs-actions.pod:7507
16489 "The call returns a structure with four elements. The first three (C<major>, "
16490 "C<minor> and C<release>) are numbers and correspond to the usual version "
16491 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
16492 "but may be used for distro-specific information."
16496 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7513
16498 "To construct the original version string: C<$major.$minor.$release$extra>"
16502 #: ../fish/guestfish-actions.pod:4972 ../src/guestfs-actions.pod:7516
16503 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16507 #: ../fish/guestfish-actions.pod:4974
16509 "I<Note:> Don't use this call to test for availability of features. In "
16510 "enterprise distributions we backport features from later versions into "
16511 "earlier versions, making this an unreliable way to test for features. Use "
16512 "L</available> instead."
16516 #: ../fish/guestfish-actions.pod:4980
16521 #: ../fish/guestfish-actions.pod:4982
16524 " vfs-label device\n"
16529 #: ../fish/guestfish-actions.pod:4984 ../src/guestfs-actions.pod:7536
16530 msgid "This returns the filesystem label of the filesystem on C<device>."
16534 #: ../fish/guestfish-actions.pod:4987 ../src/guestfs-actions.pod:7539
16535 msgid "If the filesystem is unlabeled, this returns the empty string."
16539 #: ../fish/guestfish-actions.pod:4989
16540 msgid "To find a filesystem from the label, use L</findfs-label>."
16544 #: ../fish/guestfish-actions.pod:4991
16549 #: ../fish/guestfish-actions.pod:4993
16552 " vfs-type device\n"
16557 #: ../fish/guestfish-actions.pod:4995 ../src/guestfs-actions.pod:7554
16559 "This command gets the filesystem type corresponding to the filesystem on "
16564 #: ../fish/guestfish-actions.pod:4998 ../src/guestfs-actions.pod:7557
16566 "For most filesystems, the result is the name of the Linux VFS module which "
16567 "would be used to mount this filesystem if you mounted it without specifying "
16568 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
16572 #: ../fish/guestfish-actions.pod:5003
16577 #: ../fish/guestfish-actions.pod:5005
16580 " vfs-uuid device\n"
16585 #: ../fish/guestfish-actions.pod:5007 ../src/guestfs-actions.pod:7573
16586 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16590 #: ../fish/guestfish-actions.pod:5010 ../src/guestfs-actions.pod:7576
16591 msgid "If the filesystem does not have a UUID, this returns the empty string."
16595 #: ../fish/guestfish-actions.pod:5012
16596 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
16600 #: ../fish/guestfish-actions.pod:5014
16601 msgid "vg-activate"
16605 #: ../fish/guestfish-actions.pod:5016
16608 " vg-activate true|false 'volgroups ...'\n"
16613 #: ../fish/guestfish-actions.pod:5018 ../src/guestfs-actions.pod:7592
16615 "This command activates or (if C<activate> is false) deactivates all logical "
16616 "volumes in the listed volume groups C<volgroups>."
16620 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7595
16621 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16625 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7597
16627 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16628 "activated or deactivated."
16632 #: ../fish/guestfish-actions.pod:5026
16633 msgid "vg-activate-all"
16637 #: ../fish/guestfish-actions.pod:5028
16640 " vg-activate-all true|false\n"
16645 #: ../fish/guestfish-actions.pod:5030 ../src/guestfs-actions.pod:7610
16647 "This command activates or (if C<activate> is false) deactivates all logical "
16648 "volumes in all volume groups."
16652 #: ../fish/guestfish-actions.pod:5033 ../src/guestfs-actions.pod:7613
16653 msgid "This command is the same as running C<vgchange -a y|n>"
16657 #: ../fish/guestfish-actions.pod:5035
16662 #: ../fish/guestfish-actions.pod:5037
16665 " vgcreate volgroup 'physvols ...'\n"
16670 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7626
16672 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16673 "of physical volumes C<physvols>."
16677 #: ../fish/guestfish-actions.pod:5042
16682 #: ../fish/guestfish-actions.pod:5044
16685 " vglvuuids vgname\n"
16690 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7639
16692 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16693 "volumes created in this volume group."
16697 #: ../fish/guestfish-actions.pod:5049
16699 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16700 "logical volumes and volume groups."
16704 #: ../fish/guestfish-actions.pod:5052
16705 msgid "See also L</vgpvuuids>."
16709 #: ../fish/guestfish-actions.pod:5054
16714 #: ../fish/guestfish-actions.pod:5056
16717 " vgpvuuids vgname\n"
16722 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7659
16724 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16725 "volumes that this volume group resides on."
16729 #: ../fish/guestfish-actions.pod:5061
16731 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16732 "physical volumes and volume groups."
16736 #: ../fish/guestfish-actions.pod:5064
16737 msgid "See also L</vglvuuids>."
16741 #: ../fish/guestfish-actions.pod:5066
16746 #: ../fish/guestfish-actions.pod:5068
16749 " vgremove vgname\n"
16754 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7679
16755 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16759 #: ../fish/guestfish-actions.pod:5072 ../src/guestfs-actions.pod:7681
16761 "This also forcibly removes all logical volumes in the volume group (if any)."
16765 #: ../fish/guestfish-actions.pod:5075
16770 #: ../fish/guestfish-actions.pod:5077
16773 " vgrename volgroup newvolgroup\n"
16778 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7695
16779 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16783 #: ../fish/guestfish-actions.pod:5081
16788 #: ../fish/guestfish-actions.pod:5083
16796 #: ../fish/guestfish-actions.pod:5085 ../src/guestfs-actions.pod:7706
16798 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16803 #: ../fish/guestfish-actions.pod:5088 ../src/guestfs-actions.pod:7709
16805 "This returns a list of just the volume group names that were detected (eg. "
16810 #: ../fish/guestfish-actions.pod:5091
16811 msgid "See also L</vgs-full>."
16815 #: ../fish/guestfish-actions.pod:5093
16820 #: ../fish/guestfish-actions.pod:5095
16828 #: ../fish/guestfish-actions.pod:5097 ../src/guestfs-actions.pod:7725
16830 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16831 "> command. The \"full\" version includes all fields."
16835 #: ../fish/guestfish-actions.pod:5100
16840 #: ../fish/guestfish-actions.pod:5102
16848 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7739
16850 "This rescans all block devices and rebuilds the list of LVM physical "
16851 "volumes, volume groups and logical volumes."
16855 #: ../fish/guestfish-actions.pod:5107
16860 #: ../fish/guestfish-actions.pod:5109
16868 #: ../fish/guestfish-actions.pod:5111 ../src/guestfs-actions.pod:7752
16869 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16873 #: ../fish/guestfish-actions.pod:5113
16878 #: ../fish/guestfish-actions.pod:5115
16886 #: ../fish/guestfish-actions.pod:5117 ../src/guestfs-actions.pod:7792
16888 "This command counts the characters in a file, using the C<wc -c> external "
16893 #: ../fish/guestfish-actions.pod:5120
16898 #: ../fish/guestfish-actions.pod:5122
16906 #: ../fish/guestfish-actions.pod:5124 ../src/guestfs-actions.pod:7805
16908 "This command counts the lines in a file, using the C<wc -l> external command."
16912 #: ../fish/guestfish-actions.pod:5127
16917 #: ../fish/guestfish-actions.pod:5129
16925 #: ../fish/guestfish-actions.pod:5131 ../src/guestfs-actions.pod:7818
16927 "This command counts the words in a file, using the C<wc -w> external command."
16931 #: ../fish/guestfish-actions.pod:5134
16936 #: ../fish/guestfish-actions.pod:5136
16939 " write path content\n"
16944 #: ../fish/guestfish-actions.pod:5138 ../src/guestfs-actions.pod:7833
16946 "This call creates a file called C<path>. The content of the file is the "
16947 "string C<content> (which can contain any 8 bit data)."
16951 #: ../fish/guestfish-actions.pod:5141
16952 msgid "See also L</write-append>."
16956 #: ../fish/guestfish-actions.pod:5146
16957 msgid "write-append"
16961 #: ../fish/guestfish-actions.pod:5148
16964 " write-append path content\n"
16969 #: ../fish/guestfish-actions.pod:5150 ../src/guestfs-actions.pod:7853
16971 "This call appends C<content> to the end of file C<path>. If C<path> does "
16972 "not exist, then a new file is created."
16976 #: ../fish/guestfish-actions.pod:5153
16977 msgid "See also L</write>."
16981 #: ../fish/guestfish-actions.pod:5158
16986 #: ../fish/guestfish-actions.pod:5160
16989 " write-file path content size\n"
16994 #: ../fish/guestfish-actions.pod:5162 ../src/guestfs-actions.pod:7880
16996 "This call creates a file called C<path>. The contents of the file is the "
16997 "string C<content> (which can contain any 8 bit data), with length C<size>."
17001 #: ../fish/guestfish-actions.pod:5166 ../src/guestfs-actions.pod:7884
17003 "As a special case, if C<size> is C<0> then the length is calculated using "
17004 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
17008 #: ../fish/guestfish-actions.pod:5170 ../src/guestfs-actions.pod:7888
17010 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
17011 "I<not> work, even if the length is specified."
17015 #: ../fish/guestfish-actions.pod:5176
17017 "I<This function is deprecated.> In new code, use the L</write> call instead."
17021 #: ../fish/guestfish-actions.pod:5183
17026 #: ../fish/guestfish-actions.pod:5185
17029 " zegrep regex path\n"
17034 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7905
17036 "This calls the external C<zegrep> program and returns the matching lines."
17040 #: ../fish/guestfish-actions.pod:5193
17045 #: ../fish/guestfish-actions.pod:5195
17048 " zegrepi regex path\n"
17053 #: ../fish/guestfish-actions.pod:5197 ../src/guestfs-actions.pod:7924
17055 "This calls the external C<zegrep -i> program and returns the matching lines."
17059 #: ../fish/guestfish-actions.pod:5203
17064 #: ../fish/guestfish-actions.pod:5205
17072 #: ../fish/guestfish-actions.pod:5207 ../src/guestfs-actions.pod:7942
17073 msgid "This command writes zeroes over the first few blocks of C<device>."
17077 #: ../fish/guestfish-actions.pod:5209 ../src/guestfs-actions.pod:7944
17079 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
17080 "securely wipe the device). It should be sufficient to remove any partition "
17081 "tables, filesystem superblocks and so on."
17085 #: ../fish/guestfish-actions.pod:5213 ../fish/guestfish-actions.pod:5228
17086 #: ../src/guestfs-actions.pod:7948 ../src/guestfs-actions.pod:7974
17088 "If blocks are already zero, then this command avoids writing zeroes. This "
17089 "prevents the underlying device from becoming non-sparse or growing "
17094 #: ../fish/guestfish-actions.pod:5217
17095 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
17099 #: ../fish/guestfish-actions.pod:5220
17100 msgid "zero-device"
17104 #: ../fish/guestfish-actions.pod:5222
17107 " zero-device device\n"
17112 #: ../fish/guestfish-actions.pod:5224
17114 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
17115 "which just zeroes the first few blocks of a device."
17119 #: ../fish/guestfish-actions.pod:5235
17124 #: ../fish/guestfish-actions.pod:5237
17127 " zerofree device\n"
17132 #: ../fish/guestfish-actions.pod:5239 ../src/guestfs-actions.pod:7996
17134 "This runs the I<zerofree> program on C<device>. This program claims to zero "
17135 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
17136 "possible to compress the filesystem more effectively."
17140 #: ../fish/guestfish-actions.pod:5244 ../src/guestfs-actions.pod:8001
17141 msgid "You should B<not> run this program if the filesystem is mounted."
17145 #: ../fish/guestfish-actions.pod:5247 ../src/guestfs-actions.pod:8004
17147 "It is possible that using this program can damage the filesystem or data on "
17152 #: ../fish/guestfish-actions.pod:5250
17157 #: ../fish/guestfish-actions.pod:5252
17160 " zfgrep pattern path\n"
17165 #: ../fish/guestfish-actions.pod:5254 ../src/guestfs-actions.pod:8018
17167 "This calls the external C<zfgrep> program and returns the matching lines."
17171 #: ../fish/guestfish-actions.pod:5260
17176 #: ../fish/guestfish-actions.pod:5262
17179 " zfgrepi pattern path\n"
17184 #: ../fish/guestfish-actions.pod:5264 ../src/guestfs-actions.pod:8037
17186 "This calls the external C<zfgrep -i> program and returns the matching lines."
17190 #: ../fish/guestfish-actions.pod:5270
17195 #: ../fish/guestfish-actions.pod:5272
17198 " zfile meth path\n"
17203 #: ../fish/guestfish-actions.pod:5274 ../src/guestfs-actions.pod:8063
17205 "This command runs C<file> after first decompressing C<path> using C<method>."
17209 #: ../fish/guestfish-actions.pod:5277 ../src/guestfs-actions.pod:8066
17210 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
17214 #: ../fish/guestfish-actions.pod:5279
17216 "Since 1.0.63, use L</file> instead which can now process compressed files."
17220 #: ../fish/guestfish-actions.pod:5282
17222 "I<This function is deprecated.> In new code, use the L</file> call instead."
17226 #: ../fish/guestfish-actions.pod:5289
17231 #: ../fish/guestfish-actions.pod:5291
17234 " zgrep regex path\n"
17239 #: ../fish/guestfish-actions.pod:5293 ../src/guestfs-actions.pod:8083
17241 "This calls the external C<zgrep> program and returns the matching lines."
17245 #: ../fish/guestfish-actions.pod:5299
17250 #: ../fish/guestfish-actions.pod:5301
17253 " zgrepi regex path\n"
17258 #: ../fish/guestfish-actions.pod:5303 ../src/guestfs-actions.pod:8102
17260 "This calls the external C<zgrep -i> program and returns the matching lines."
17264 #: ../fish/guestfish-commands.pod:1
17269 #: ../fish/guestfish-commands.pod:3
17274 #: ../fish/guestfish-commands.pod:5
17277 " alloc filename size\n"
17282 #: ../fish/guestfish-commands.pod:7
17284 "This creates an empty (zeroed) file of the given size, and then adds so it "
17285 "can be further examined."
17289 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
17290 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
17294 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
17295 msgid "Size can be specified using standard suffixes, eg. C<1M>."
17299 #: ../fish/guestfish-commands.pod:14
17301 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
17302 "image, see L</PREPARED DISK IMAGES>."
17306 #: ../fish/guestfish-commands.pod:17
17311 #: ../fish/guestfish-commands.pod:19
17314 " copy-in local [local ...] /remotedir\n"
17319 #: ../fish/guestfish-commands.pod:21
17321 "C<copy-in> copies local files or directories recursively into the disk "
17322 "image, placing them in the directory called C</remotedir> (which must "
17323 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
17324 "other commands as necessary."
17328 #: ../fish/guestfish-commands.pod:26
17330 "Multiple local files and directories can be specified, but the last "
17331 "parameter must always be a remote directory. Wildcards cannot be used."
17335 #: ../fish/guestfish-commands.pod:30
17340 #: ../fish/guestfish-commands.pod:32
17343 " copy-out remote [remote ...] localdir\n"
17348 #: ../fish/guestfish-commands.pod:34
17350 "C<copy-out> copies remote files or directories recursively out of the disk "
17351 "image, placing them on the host disk in a local directory called C<localdir> "
17352 "(which must exist). This guestfish meta-command turns into a sequence of L</"
17353 "download>, L</tar-out> and other commands as necessary."
17357 #: ../fish/guestfish-commands.pod:40
17359 "Multiple remote files and directories can be specified, but the last "
17360 "parameter must always be a local directory. To download to the current "
17361 "directory, use C<.> as in:"
17365 #: ../fish/guestfish-commands.pod:44
17368 " copy-out /home .\n"
17373 #: ../fish/guestfish-commands.pod:46
17375 "Wildcards cannot be used in the ordinary command, but you can use them with "
17376 "the help of L</glob> like this:"
17380 #: ../fish/guestfish-commands.pod:49
17383 " glob copy-out /home/* .\n"
17388 #: ../fish/guestfish-commands.pod:51
17393 #: ../fish/guestfish-commands.pod:53
17396 " display filename\n"
17401 #: ../fish/guestfish-commands.pod:55
17403 "Use C<display> (a graphical display program) to display an image file. It "
17404 "downloads the file, and runs C<display> on it."
17408 #: ../fish/guestfish-commands.pod:58
17410 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
17411 "environment variable. For example to use the GNOME display program:"
17415 #: ../fish/guestfish-commands.pod:61
17418 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
17423 #: ../fish/guestfish-commands.pod:63
17424 msgid "See also L<display(1)>."
17428 #: ../fish/guestfish-commands.pod:65
17433 #: ../fish/guestfish-commands.pod:67
17436 " echo [params ...]\n"
17441 #: ../fish/guestfish-commands.pod:69
17442 msgid "This echos the parameters to the terminal."
17446 #: ../fish/guestfish-commands.pod:71
17451 #: ../fish/guestfish-commands.pod:73
17456 #: ../fish/guestfish-commands.pod:75
17461 #: ../fish/guestfish-commands.pod:77
17469 #: ../fish/guestfish-commands.pod:79
17471 "This is used to edit a file. It downloads the file, edits it locally using "
17472 "your editor, then uploads the result."
17476 #: ../fish/guestfish-commands.pod:82
17478 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
17479 "or C<emacs> you will get those corresponding editors."
17483 #: ../fish/guestfish-commands.pod:86
17488 #: ../fish/guestfish-commands.pod:88
17491 " glob command args...\n"
17496 #: ../fish/guestfish-commands.pod:90
17498 "Expand wildcards in any paths in the args list, and run C<command> "
17499 "repeatedly on each matching path."
17503 #: ../fish/guestfish-commands.pod:93
17504 msgid "See L</WILDCARDS AND GLOBBING>."
17508 #: ../fish/guestfish-commands.pod:95
17513 #: ../fish/guestfish-commands.pod:97
17516 " hexedit <filename|device>\n"
17517 " hexedit <filename|device> <max>\n"
17518 " hexedit <filename|device> <start> <max>\n"
17523 #: ../fish/guestfish-commands.pod:101
17525 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
17530 #: ../fish/guestfish-commands.pod:104
17532 "This command works by downloading potentially the whole file or device, "
17533 "editing it locally, then uploading it. If the file or device is large, you "
17534 "have to specify which part you wish to edit by using C<max> and/or C<start> "
17535 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
17536 "usual modifiers allowed such as C<1M> (1 megabyte)."
17540 #: ../fish/guestfish-commands.pod:111
17541 msgid "For example to edit the first few sectors of a disk you might do:"
17545 #: ../fish/guestfish-commands.pod:114
17548 " hexedit /dev/sda 1M\n"
17553 #: ../fish/guestfish-commands.pod:116
17555 "which would allow you to edit anywhere within the first megabyte of the disk."
17559 #: ../fish/guestfish-commands.pod:119
17560 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
17564 #: ../fish/guestfish-commands.pod:121
17567 " hexedit /dev/sda1 0x400 0x400\n"
17572 #: ../fish/guestfish-commands.pod:123
17573 msgid "(assuming the superblock is in the standard location)."
17577 #: ../fish/guestfish-commands.pod:125
17579 "This command requires the external L<hexedit(1)> program. You can specify "
17580 "another program to use by setting the C<HEXEDITOR> environment variable."
17584 #: ../fish/guestfish-commands.pod:129
17585 msgid "See also L</hexdump>."
17589 #: ../fish/guestfish-commands.pod:131
17594 #: ../fish/guestfish-commands.pod:133
17602 #: ../fish/guestfish-commands.pod:135
17604 "Change the local directory, ie. the current directory of guestfish itself."
17608 #: ../fish/guestfish-commands.pod:138
17609 msgid "Note that C<!cd> won't do what you might expect."
17613 #: ../fish/guestfish-commands.pod:140
17618 #: ../fish/guestfish-commands.pod:142
17623 #: ../fish/guestfish-commands.pod:144
17631 #: ../fish/guestfish-commands.pod:146
17632 msgid "Opens the manual page for guestfish."
17636 #: ../fish/guestfish-commands.pod:148
17641 #: ../fish/guestfish-commands.pod:150
17646 #: ../fish/guestfish-commands.pod:152
17654 #: ../fish/guestfish-commands.pod:154
17662 #: ../fish/guestfish-commands.pod:156
17663 msgid "This is used to view a file."
17667 #: ../fish/guestfish-commands.pod:158
17669 "The default viewer is C<$PAGER>. However if you use the alternate command "
17670 "C<less> you will get the C<less> command specifically."
17674 #: ../fish/guestfish-commands.pod:161
17679 #: ../fish/guestfish-commands.pod:163
17687 #: ../fish/guestfish-commands.pod:165
17689 "Close and reopen the libguestfs handle. It is not necessary to use this "
17690 "normally, because the handle is closed properly when guestfish exits. "
17691 "However this is occasionally useful for testing."
17695 #: ../fish/guestfish-commands.pod:169
17700 #: ../fish/guestfish-commands.pod:171
17703 " setenv VAR value\n"
17708 #: ../fish/guestfish-commands.pod:173
17709 msgid "Set the environment variable C<VAR> to the string C<value>."
17713 #: ../fish/guestfish-commands.pod:175
17715 "To print the value of an environment variable use a shell command such as:"
17719 #: ../fish/guestfish-commands.pod:178
17727 #: ../fish/guestfish-commands.pod:180
17732 #: ../fish/guestfish-commands.pod:182
17735 " sparse filename size\n"
17740 #: ../fish/guestfish-commands.pod:184
17742 "This creates an empty sparse file of the given size, and then adds so it can "
17743 "be further examined."
17747 #: ../fish/guestfish-commands.pod:187
17749 "In all respects it works the same as the L</alloc> command, except that the "
17750 "image file is allocated sparsely, which means that disk blocks are not "
17751 "assigned to the file until they are needed. Sparse disk files only use "
17752 "space when written to, but they are slower and there is a danger you could "
17753 "run out of real disk space during a write operation."
17757 #: ../fish/guestfish-commands.pod:197
17762 #: ../fish/guestfish-commands.pod:199
17770 #: ../fish/guestfish-commands.pod:201
17772 "This command returns a list of the optional groups known to the daemon, and "
17773 "indicates which ones are supported by this build of the libguestfs appliance."
17777 #: ../fish/guestfish-commands.pod:205
17778 msgid "See also L<guestfs(3)/AVAILABILITY>."
17782 #: ../fish/guestfish-commands.pod:207
17787 #: ../fish/guestfish-commands.pod:209
17790 " time command args...\n"
17795 #: ../fish/guestfish-commands.pod:211
17797 "Run the command as usual, but print the elapsed time afterwards. This can "
17798 "be useful for benchmarking operations."
17802 #: ../fish/guestfish-commands.pod:214
17807 #: ../fish/guestfish-commands.pod:216
17815 #: ../fish/guestfish-commands.pod:218
17816 msgid "Remove C<VAR> from the environment."
17820 #: ../fish/guestfish.pod:5
17821 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17825 #: ../fish/guestfish.pod:9
17828 " guestfish [--options] [commands]\n"
17833 #: ../fish/guestfish.pod:11
17841 #: ../fish/guestfish.pod:13
17844 " guestfish [--ro|--rw] -a disk.img\n"
17849 #: ../fish/guestfish.pod:15
17852 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17857 #: ../fish/guestfish.pod:17
17860 " guestfish -d libvirt-domain\n"
17865 #: ../fish/guestfish.pod:19
17868 " guestfish [--ro|--rw] -a disk.img -i\n"
17873 #: ../fish/guestfish.pod:21
17876 " guestfish -d libvirt-domain -i\n"
17881 #: ../fish/guestfish.pod:25
17883 "Using guestfish in read/write mode on live virtual machines can be "
17884 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17885 "option to use guestfish safely if the disk image or virtual machine might be "
17890 #: ../fish/guestfish.pod:32
17892 "Guestfish is a shell and command-line tool for examining and modifying "
17893 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17894 "functionality of the guestfs API, see L<guestfs(3)>."
17898 #: ../fish/guestfish.pod:36
17900 "Guestfish gives you structured access to the libguestfs API, from shell "
17901 "scripts or the command line or interactively. If you want to rescue a "
17902 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17907 #: ../fish/guestfish.pod:43
17908 msgid "As an interactive shell"
17912 #: ../fish/guestfish.pod:45
17920 #: ../fish/guestfish.pod:47
17923 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17924 " editing virtual machine filesystems.\n"
17929 #: ../fish/guestfish.pod:50
17932 " Type: 'help' for a list of commands\n"
17933 " 'man' to read the manual\n"
17934 " 'quit' to quit the shell\n"
17939 #: ../fish/guestfish.pod:54
17942 " ><fs> add-ro disk.img\n"
17944 " ><fs> list-filesystems\n"
17945 " /dev/sda1: ext4\n"
17946 " /dev/vg_guest/lv_root: ext4\n"
17947 " /dev/vg_guest/lv_swap: swap\n"
17948 " ><fs> mount /dev/vg_guest/lv_root /\n"
17949 " ><fs> cat /etc/fstab\n"
17951 " # Created by anaconda\n"
17958 #: ../fish/guestfish.pod:67
17959 msgid "From shell scripts"
17963 #: ../fish/guestfish.pod:69
17964 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17968 #: ../fish/guestfish.pod:71
17971 " guestfish <<_EOF_\n"
17974 " mount /dev/vg_guest/lv_root /\n"
17975 " write /etc/motd \"Welcome, new users\"\n"
17981 #: ../fish/guestfish.pod:78
17982 msgid "List the LVM logical volumes in a disk image:"
17986 #: ../fish/guestfish.pod:80
17989 " guestfish -a disk.img --ro <<_EOF_\n"
17997 #: ../fish/guestfish.pod:85
17998 msgid "List all the filesystems in a disk image:"
18002 #: ../fish/guestfish.pod:87
18005 " guestfish -a disk.img --ro <<_EOF_\n"
18007 " list-filesystems\n"
18013 #: ../fish/guestfish.pod:92
18014 msgid "On one command line"
18018 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
18019 msgid "Update C</etc/resolv.conf> in a guest:"
18023 #: ../fish/guestfish.pod:96
18027 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
18028 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
18033 #: ../fish/guestfish.pod:100
18034 msgid "Edit C</boot/grub/grub.conf> interactively:"
18038 #: ../fish/guestfish.pod:102
18041 " guestfish --rw --add disk.img \\\n"
18042 " --mount /dev/vg_guest/lv_root \\\n"
18043 " --mount /dev/sda1:/boot \\\n"
18044 " edit /boot/grub/grub.conf\n"
18049 #: ../fish/guestfish.pod:107
18050 msgid "Mount disks automatically"
18054 #: ../fish/guestfish.pod:109
18056 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
18060 #: ../fish/guestfish.pod:112
18063 " guestfish --ro -a disk.img -i cat /etc/group\n"
18068 #: ../fish/guestfish.pod:114
18071 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
18076 #: ../fish/guestfish.pod:116
18077 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
18081 #: ../fish/guestfish.pod:118
18084 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
18089 #: ../fish/guestfish.pod:120
18090 msgid "As a script interpreter"
18094 #: ../fish/guestfish.pod:122
18095 msgid "Create a 100MB disk containing an ext2-formatted partition:"
18099 #: ../fish/guestfish.pod:124
18102 " #!/usr/bin/guestfish -f\n"
18103 " sparse test1.img 100M\n"
18105 " part-disk /dev/sda mbr\n"
18106 " mkfs ext2 /dev/sda1\n"
18111 #: ../fish/guestfish.pod:130
18112 msgid "Start with a prepared disk"
18116 #: ../fish/guestfish.pod:132
18118 "An alternate way to create a 100MB disk called C<test1.img> containing a "
18119 "single ext2-formatted partition:"
18123 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2228
18126 " guestfish -N fs\n"
18131 #: ../fish/guestfish.pod:137
18132 msgid "To list what is available do:"
18136 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
18139 " guestfish -N help | less\n"
18144 #: ../fish/guestfish.pod:141
18145 msgid "Remote control"
18149 #: ../fish/guestfish.pod:143
18152 " eval \"`guestfish --listen`\"\n"
18153 " guestfish --remote add-ro disk.img\n"
18154 " guestfish --remote run\n"
18155 " guestfish --remote lvs\n"
18160 #: ../fish/guestfish.pod:154
18161 msgid "Displays general help on options."
18165 #: ../fish/guestfish.pod:158
18166 msgid "B<--cmd-help>"
18170 #: ../fish/guestfish.pod:160
18171 msgid "Lists all available guestfish commands."
18175 #: ../fish/guestfish.pod:162
18180 #: ../fish/guestfish.pod:164
18181 msgid "B<--cmd-help cmd>"
18185 #: ../fish/guestfish.pod:166
18186 msgid "Displays detailed help on a single command C<cmd>."
18190 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
18191 msgid "B<-a image>"
18195 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
18196 msgid "B<--add image>"
18200 #: ../fish/guestfish.pod:172
18201 msgid "Add a block device or virtual machine image to the shell."
18205 #: ../fish/guestfish.pod:177
18207 "Using this flag is mostly equivalent to using the C<add> command, with "
18208 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
18209 "the I<--format=...> flag was given."
18213 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
18215 "When used in conjunction with the I<-d> option, this specifies the libvirt "
18216 "URI to use. The default is to use the default libvirt connection."
18220 #: ../fish/guestfish.pod:189
18225 #: ../fish/guestfish.pod:191
18227 "If using the I<--listen> option and a csh-like shell, use this option. See "
18228 "section L</REMOTE CONTROL AND CSH> below."
18232 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
18233 msgid "B<-d libvirt-domain>"
18237 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
18238 msgid "B<--domain libvirt-domain>"
18242 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
18244 "Add disks from the named libvirt domain. If the I<--ro> option is also "
18245 "used, then any libvirt domain can be used. However in write mode, only "
18246 "libvirt domains which are shut down can be named here."
18250 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
18251 msgid "Domain UUIDs can be used instead of names."
18255 #: ../fish/guestfish.pod:204
18257 "Using this flag is mostly equivalent to using the C<add-domain> command, "
18258 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
18259 "if the I<--format:...> flag was given."
18263 #: ../fish/guestfish.pod:208
18268 #: ../fish/guestfish.pod:210
18269 msgid "B<--no-dest-paths>"
18273 #: ../fish/guestfish.pod:212
18275 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
18276 "to hit the tab key to complete paths on the guest filesystem, but this "
18277 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
18278 "allow this feature to be disabled."
18282 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
18284 "When prompting for keys and passphrases, guestfish normally turns echoing "
18285 "off so you cannot see what you are typing. If you are not worried about "
18286 "Tempest attacks and there is no one else in the room you can specify this "
18287 "flag to see what you are typing."
18291 #: ../fish/guestfish.pod:224
18296 #: ../fish/guestfish.pod:226
18297 msgid "B<--file file>"
18301 #: ../fish/guestfish.pod:228
18302 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
18306 #: ../fish/guestfish.pod:231
18309 " #!/usr/bin/guestfish -f\n"
18314 #: ../fish/guestfish.pod:244
18317 " guestfish --format=raw -a disk.img\n"
18322 #: ../fish/guestfish.pod:248
18325 " guestfish --format=raw -a disk.img --format -a another.img\n"
18330 #: ../fish/guestfish.pod:253
18332 "If you have untrusted raw-format guest disk images, you should use this "
18333 "option to specify the disk format. This avoids a possible security problem "
18334 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
18338 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
18339 msgid "B<--inspector>"
18343 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
18345 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
18346 "system and mount filesystems as they would be mounted on the real virtual "
18351 #: ../fish/guestfish.pod:266
18352 msgid "Typical usage is either:"
18356 #: ../fish/guestfish.pod:268
18359 " guestfish -d myguest -i\n"
18364 #: ../fish/guestfish.pod:270
18365 msgid "(for an inactive libvirt domain called I<myguest>), or:"
18369 #: ../fish/guestfish.pod:272
18372 " guestfish --ro -d myguest -i\n"
18377 #: ../fish/guestfish.pod:274
18378 msgid "(for active domains, readonly), or specify the block device directly:"
18382 #: ../fish/guestfish.pod:276
18385 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
18390 #: ../fish/guestfish.pod:278
18392 "Note that the command line syntax changed slightly over older versions of "
18393 "guestfish. You can still use the old syntax:"
18397 #: ../fish/guestfish.pod:281
18400 " guestfish [--ro] -i disk.img\n"
18405 #: ../fish/guestfish.pod:283
18408 " guestfish [--ro] -i libvirt-domain\n"
18413 #: ../fish/guestfish.pod:285
18415 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
18416 "then using other commands to mount the filesystems that were found."
18420 #: ../fish/guestfish.pod:294
18421 msgid "B<--listen>"
18425 #: ../fish/guestfish.pod:296
18427 "Fork into the background and listen for remote commands. See section L</"
18428 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
18432 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
18437 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
18439 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
18440 "ATTACHING TO RUNNING DAEMONS>)."
18444 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
18445 msgid "B<-m dev[:mountpoint[:options]]>"
18449 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
18450 msgid "B<--mount dev[:mountpoint[:options]]>"
18454 #: ../fish/guestfish.pod:308
18455 msgid "Mount the named partition or logical volume on the given mountpoint."
18459 #: ../fish/guestfish.pod:310
18460 msgid "If the mountpoint is omitted, it defaults to C</>."
18464 #: ../fish/guestfish.pod:312
18465 msgid "You have to mount something on C</> before most commands will work."
18469 #: ../fish/guestfish.pod:314
18471 "If any I<-m> or I<--mount> options are given, the guest is automatically "
18476 #: ../fish/guestfish.pod:317
18478 "If you don't know what filesystems a disk image contains, you can either run "
18479 "guestfish without this option, then list the partitions, filesystems and LVs "
18480 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
18481 "commands), or you can use the L<virt-filesystems(1)> program."
18485 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
18487 "The third (and rarely used) part of the mount parameter is the list of mount "
18488 "options used to mount the underlying filesystem. If this is not given, then "
18489 "the mount options are either the empty string or C<ro> (the latter if the "
18490 "I<--ro> flag is used). By specifying the mount options, you override this "
18491 "default choice. Probably the only time you would use this is to enable ACLs "
18492 "and/or extended attributes if the filesystem can support them:"
18496 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
18499 " -m /dev/sda1:/:acl,user_xattr\n"
18504 #: ../fish/guestfish.pod:333
18505 msgid "Using this flag is equivalent to using the C<mount-options> command."
18509 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202
18510 #: ../resize/virt-resize.pod:414
18515 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
18516 msgid "B<--no-sync>"
18520 #: ../fish/guestfish.pod:339
18522 "Disable autosync. This is enabled by default. See the discussion of "
18523 "autosync in the L<guestfs(3)> manpage."
18527 #: ../fish/guestfish.pod:342
18532 #: ../fish/guestfish.pod:344
18533 msgid "B<--new type>"
18537 #: ../fish/guestfish.pod:346
18542 #: ../fish/guestfish.pod:348
18544 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18545 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18546 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18551 #: ../fish/guestfish.pod:353
18552 msgid "B<--progress-bars>"
18556 #: ../fish/guestfish.pod:355
18557 msgid "Enable progress bars, even when guestfish is used non-interactively."
18561 #: ../fish/guestfish.pod:357
18563 "Progress bars are enabled by default when guestfish is used as an "
18564 "interactive shell."
18568 #: ../fish/guestfish.pod:360
18569 msgid "B<--no-progress-bars>"
18573 #: ../fish/guestfish.pod:362
18574 msgid "Disable progress bars."
18578 #: ../fish/guestfish.pod:364
18579 msgid "B<--remote[=pid]>"
18583 #: ../fish/guestfish.pod:366
18585 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18586 "CONTROL GUESTFISH OVER A SOCKET> below."
18590 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248
18591 #: ../rescue/virt-rescue.pod:161
18596 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250
18597 #: ../rescue/virt-rescue.pod:163
18602 #: ../fish/guestfish.pod:373
18604 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18605 "mounts are done read-only."
18609 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
18611 "The option must always be used if the disk image or virtual machine might be "
18612 "running, and is generally recommended in cases where you don't need write "
18613 "access to the disk."
18617 #: ../fish/guestfish.pod:380
18619 "Note that prepared disk images created with I<-N> are not affected by this "
18620 "option. Also commands like C<add> are not affected - you have to specify "
18621 "the C<readonly:true> option explicitly if you need it."
18625 #: ../fish/guestfish.pod:384
18626 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18630 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262
18631 #: ../rescue/virt-rescue.pod:173
18632 msgid "B<--selinux>"
18636 #: ../fish/guestfish.pod:388
18637 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18641 #: ../fish/guestfish.pod:394
18643 "Enable very verbose messages. This is particularly useful if you find a bug."
18647 #: ../fish/guestfish.pod:401
18648 msgid "Display the guestfish / libguestfs version number and exit."
18652 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278
18653 #: ../rescue/virt-rescue.pod:194
18658 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280
18659 #: ../rescue/virt-rescue.pod:196
18664 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
18666 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18667 "mounts are done read-write."
18671 #: ../fish/guestfish.pod:410
18672 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18676 #: ../fish/guestfish.pod:414
18677 msgid "Echo each command before executing it."
18681 #: ../fish/guestfish.pod:418
18682 msgid "COMMANDS ON COMMAND LINE"
18686 #: ../fish/guestfish.pod:420
18688 "Any additional (non-option) arguments are treated as commands to execute."
18692 #: ../fish/guestfish.pod:423
18694 "Commands to execute should be separated by a colon (C<:>), where the colon "
18695 "is a separate parameter. Thus:"
18699 #: ../fish/guestfish.pod:426
18702 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18707 #: ../fish/guestfish.pod:428
18709 "If there are no additional arguments, then we enter a shell, either an "
18710 "interactive shell with a prompt (if the input is a terminal) or a non-"
18711 "interactive shell."
18715 #: ../fish/guestfish.pod:432
18717 "In either command line mode or non-interactive shell, the first command that "
18718 "gives an error causes the whole shell to exit. In interactive mode (with a "
18719 "prompt) if a command fails, you can continue to enter commands."
18723 #: ../fish/guestfish.pod:437
18724 msgid "USING launch (OR run)"
18728 #: ../fish/guestfish.pod:439
18730 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18731 "then launch it, then mount any disks you need, and finally issue actions/"
18732 "commands. So the general order of the day is:"
18736 #: ../fish/guestfish.pod:447
18737 msgid "add or -a/--add"
18741 #: ../fish/guestfish.pod:451
18742 msgid "launch (aka run)"
18746 #: ../fish/guestfish.pod:455
18747 msgid "mount or -m/--mount"
18751 #: ../fish/guestfish.pod:459
18752 msgid "any other commands"
18756 #: ../fish/guestfish.pod:463
18758 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18759 "guest before mounting or performing any other commands."
18763 #: ../fish/guestfish.pod:466
18765 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18766 "I<--new> options were given then C<run> is done automatically, simply "
18767 "because guestfish can't perform the action you asked for without doing this."
18771 #: ../fish/guestfish.pod:471
18772 msgid "OPENING DISKS FOR READ AND WRITE"
18776 #: ../fish/guestfish.pod:473
18778 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18779 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18780 "I<-i> and I<-m> open disk images read-only or for writing."
18784 #: ../fish/guestfish.pod:478
18786 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18787 "opening disk images supplied on the command line for write. To open a disk "
18788 "image read-only you have to do I<-a image --ro>."
18792 #: ../fish/guestfish.pod:482
18794 "This matters: If you accidentally open a live VM disk image writable then "
18795 "you will cause irreversible disk corruption."
18799 #: ../fish/guestfish.pod:485
18801 "In a future libguestfs we intend to change the default the other way. Disk "
18802 "images will be opened read-only. You will have to either specify "
18803 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18804 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18805 "access for disk images specified by those other command line options."
18809 #: ../fish/guestfish.pod:492
18811 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18812 "which does nothing (it is already the default). However it is highly "
18813 "recommended that you use this option to indicate that you need write access, "
18814 "and prepare your scripts for the day when this option will be required for "
18819 #: ../fish/guestfish.pod:498
18821 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18822 "other libguestfs program apart from guestfish and guestmount."
18826 #: ../fish/guestfish.pod:501
18831 #: ../fish/guestfish.pod:503
18833 "You can quote ordinary parameters using either single or double quotes. For "
18838 #: ../fish/guestfish.pod:506
18841 " add \"file with a space.img\"\n"
18846 #: ../fish/guestfish.pod:508
18849 " rm '/file name'\n"
18854 #: ../fish/guestfish.pod:510
18862 #: ../fish/guestfish.pod:512
18864 "A few commands require a list of strings to be passed. For these, use a "
18865 "whitespace-separated list, enclosed in quotes. Strings containing "
18866 "whitespace to be passed through must be enclosed in single quotes. A "
18867 "literal single quote must be escaped with a backslash."
18871 #: ../fish/guestfish.pod:517
18874 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18875 " command \"/bin/echo 'foo bar'\"\n"
18876 " command \"/bin/echo \\'foo\\'\"\n"
18881 #: ../fish/guestfish.pod:521
18882 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18886 #: ../fish/guestfish.pod:523
18888 "In double-quoted arguments (only) use backslash to insert special characters:"
18892 #: ../fish/guestfish.pod:528
18897 #: ../fish/guestfish.pod:530
18898 msgid "Alert (bell) character."
18902 #: ../fish/guestfish.pod:532
18907 #: ../fish/guestfish.pod:534
18908 msgid "Backspace character."
18912 #: ../fish/guestfish.pod:536
18917 #: ../fish/guestfish.pod:538
18918 msgid "Form feed character."
18922 #: ../fish/guestfish.pod:540
18927 #: ../fish/guestfish.pod:542
18928 msgid "Newline character."
18932 #: ../fish/guestfish.pod:544
18937 #: ../fish/guestfish.pod:546
18938 msgid "Carriage return character."
18942 #: ../fish/guestfish.pod:548
18947 #: ../fish/guestfish.pod:550
18948 msgid "Horizontal tab character."
18952 #: ../fish/guestfish.pod:552
18957 #: ../fish/guestfish.pod:554
18958 msgid "Vertical tab character."
18962 #: ../fish/guestfish.pod:556
18967 #: ../fish/guestfish.pod:558
18968 msgid "A literal double quote character."
18972 #: ../fish/guestfish.pod:560
18977 #: ../fish/guestfish.pod:562
18979 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18984 #: ../fish/guestfish.pod:565
18989 #: ../fish/guestfish.pod:567
18991 "A character with hex value I<hh>. There must be precisely 2 hex digits."
18995 #: ../fish/guestfish.pod:570
18997 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
19002 #: ../fish/guestfish.pod:573
19007 #: ../fish/guestfish.pod:575
19008 msgid "A literal backslash character."
19012 #: ../fish/guestfish.pod:579
19013 msgid "OPTIONAL ARGUMENTS"
19017 #: ../fish/guestfish.pod:581
19019 "Some commands take optional arguments. These arguments appear in this "
19020 "documentation as C<[argname:..]>. You can use them as in these examples:"
19024 #: ../fish/guestfish.pod:585
19027 " add-drive-opts filename\n"
19032 #: ../fish/guestfish.pod:587
19035 " add-drive-opts filename readonly:true\n"
19040 #: ../fish/guestfish.pod:589
19043 " add-drive-opts filename format:qcow2 readonly:false\n"
19048 #: ../fish/guestfish.pod:591
19050 "Each optional argument can appear at most once. All optional arguments must "
19051 "appear after the required ones."
19055 #: ../fish/guestfish.pod:594
19060 #: ../fish/guestfish.pod:596
19062 "This section applies to all commands which can take integers as parameters."
19066 #: ../fish/guestfish.pod:599
19067 msgid "SIZE SUFFIX"
19071 #: ../fish/guestfish.pod:601
19073 "When the command takes a parameter measured in bytes, you can use one of the "
19074 "following suffixes to specify kilobytes, megabytes and larger sizes:"
19078 #: ../fish/guestfish.pod:607
19079 msgid "B<k> or B<K> or B<KiB>"
19083 #: ../fish/guestfish.pod:609
19084 msgid "The size in kilobytes (multiplied by 1024)."
19088 #: ../fish/guestfish.pod:611
19093 #: ../fish/guestfish.pod:613
19094 msgid "The size in SI 1000 byte units."
19098 #: ../fish/guestfish.pod:615
19099 msgid "B<M> or B<MiB>"
19103 #: ../fish/guestfish.pod:617
19104 msgid "The size in megabytes (multiplied by 1048576)."
19108 #: ../fish/guestfish.pod:619
19113 #: ../fish/guestfish.pod:621
19114 msgid "The size in SI 1000000 byte units."
19118 #: ../fish/guestfish.pod:623
19119 msgid "B<G> or B<GiB>"
19123 #: ../fish/guestfish.pod:625
19124 msgid "The size in gigabytes (multiplied by 2**30)."
19128 #: ../fish/guestfish.pod:627
19133 #: ../fish/guestfish.pod:629
19134 msgid "The size in SI 10**9 byte units."
19138 #: ../fish/guestfish.pod:631
19139 msgid "B<T> or B<TiB>"
19143 #: ../fish/guestfish.pod:633
19144 msgid "The size in terabytes (multiplied by 2**40)."
19148 #: ../fish/guestfish.pod:635
19153 #: ../fish/guestfish.pod:637
19154 msgid "The size in SI 10**12 byte units."
19158 #: ../fish/guestfish.pod:639
19159 msgid "B<P> or B<PiB>"
19163 #: ../fish/guestfish.pod:641
19164 msgid "The size in petabytes (multiplied by 2**50)."
19168 #: ../fish/guestfish.pod:643
19173 #: ../fish/guestfish.pod:645
19174 msgid "The size in SI 10**15 byte units."
19178 #: ../fish/guestfish.pod:647
19179 msgid "B<E> or B<EiB>"
19183 #: ../fish/guestfish.pod:649
19184 msgid "The size in exabytes (multiplied by 2**60)."
19188 #: ../fish/guestfish.pod:651
19193 #: ../fish/guestfish.pod:653
19194 msgid "The size in SI 10**18 byte units."
19198 #: ../fish/guestfish.pod:655
19199 msgid "B<Z> or B<ZiB>"
19203 #: ../fish/guestfish.pod:657
19204 msgid "The size in zettabytes (multiplied by 2**70)."
19208 #: ../fish/guestfish.pod:659
19213 #: ../fish/guestfish.pod:661
19214 msgid "The size in SI 10**21 byte units."
19218 #: ../fish/guestfish.pod:663
19219 msgid "B<Y> or B<YiB>"
19223 #: ../fish/guestfish.pod:665
19224 msgid "The size in yottabytes (multiplied by 2**80)."
19228 #: ../fish/guestfish.pod:667
19233 #: ../fish/guestfish.pod:669
19234 msgid "The size in SI 10**24 byte units."
19238 #: ../fish/guestfish.pod:675
19241 " truncate-size /file 1G\n"
19246 #: ../fish/guestfish.pod:677
19247 msgid "would truncate the file to 1 gigabyte."
19251 #: ../fish/guestfish.pod:679
19253 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
19254 "the parameter to L</memsize> is specified in megabytes already). Adding a "
19255 "suffix will probably not do what you expect."
19259 #: ../fish/guestfish.pod:683
19260 msgid "OCTAL AND HEXADECIMAL NUMBERS"
19264 #: ../fish/guestfish.pod:685
19266 "For specifying the radix (base) use the C convention: C<0> to prefix an "
19267 "octal number or C<0x> to prefix a hexadecimal number. For example:"
19271 #: ../fish/guestfish.pod:688
19274 " 1234 decimal number 1234\n"
19275 " 02322 octal number, equivalent to decimal 1234\n"
19276 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
19281 #: ../fish/guestfish.pod:692
19283 "When using the C<chmod> command, you almost always want to specify an octal "
19284 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
19285 "L<chmod(1)> program):"
19289 #: ../fish/guestfish.pod:696
19292 " chmod 0777 /public # OK\n"
19293 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
19298 #: ../fish/guestfish.pod:699
19300 "Commands that return numbers usually print them in decimal, but some "
19301 "commands print numbers in other radices (eg. C<umask> prints the mode in "
19302 "octal, preceeded by C<0>)."
19306 #: ../fish/guestfish.pod:703
19307 msgid "WILDCARDS AND GLOBBING"
19311 #: ../fish/guestfish.pod:705
19313 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
19314 "(globbing) by default. So for example the following will not do what you "
19319 #: ../fish/guestfish.pod:709
19327 #: ../fish/guestfish.pod:711
19329 "Assuming you don't have a directory called literally C</home/*> then the "
19330 "above command will return an error."
19334 #: ../fish/guestfish.pod:714
19335 msgid "To perform wildcard expansion, use the C<glob> command."
19339 #: ../fish/guestfish.pod:716
19342 " glob rm-rf /home/*\n"
19347 #: ../fish/guestfish.pod:718
19349 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
19350 "many times), equivalent to:"
19354 #: ../fish/guestfish.pod:721
19357 " rm-rf /home/jim\n"
19358 " rm-rf /home/joe\n"
19359 " rm-rf /home/mary\n"
19364 #: ../fish/guestfish.pod:725
19365 msgid "C<glob> only works on simple guest paths and not on device names."
19369 #: ../fish/guestfish.pod:727
19371 "If you have several parameters, each containing a wildcard, then glob will "
19372 "perform a Cartesian product."
19376 #: ../fish/guestfish.pod:730
19381 #: ../fish/guestfish.pod:732
19383 "Any line which starts with a I<#> character is treated as a comment and "
19384 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
19385 "a command. For example:"
19389 #: ../fish/guestfish.pod:736
19392 " # this is a comment\n"
19393 " # this is a comment\n"
19394 " foo # NOT a comment\n"
19399 #: ../fish/guestfish.pod:740
19400 msgid "Blank lines are also ignored."
19404 #: ../fish/guestfish.pod:742
19405 msgid "RUNNING COMMANDS LOCALLY"
19409 #: ../fish/guestfish.pod:744
19411 "Any line which starts with a I<!> character is treated as a command sent to "
19412 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
19416 #: ../fish/guestfish.pod:748
19420 " tgz-out /remote local/remote-data.tar.gz\n"
19425 #: ../fish/guestfish.pod:751
19427 "will create a directory C<local> on the host, and then export the contents "
19428 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
19429 "(See C<tgz-out>)."
19433 #: ../fish/guestfish.pod:755
19435 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
19436 "effect, due to the way that subprocesses work in Unix."
19440 #: ../fish/guestfish.pod:758
19441 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
19445 #: ../fish/guestfish.pod:760
19447 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
19448 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
19449 "and executed as guestfish commands."
19453 #: ../fish/guestfish.pod:764
19455 "Thus you can use shell script to construct arbitrary guestfish commands "
19456 "which are then parsed by guestfish."
19460 #: ../fish/guestfish.pod:767
19462 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
19463 "through C</foo.100>) using guestfish commands alone. However this is simple "
19464 "if we use a shell script to create the guestfish commands for us:"
19468 #: ../fish/guestfish.pod:772
19471 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
19476 #: ../fish/guestfish.pod:774
19477 msgid "or with names like C</foo.001>:"
19481 #: ../fish/guestfish.pod:776
19484 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
19489 #: ../fish/guestfish.pod:778
19491 "When using guestfish interactively it can be helpful to just run the shell "
19492 "script first (ie. remove the initial C<E<lt>> character so it is just an "
19493 "ordinary I<!> local command), see what guestfish commands it would run, and "
19494 "when you are happy with those prepend the C<E<lt>> character to run the "
19495 "guestfish commands for real."
19499 #: ../fish/guestfish.pod:784
19504 #: ../fish/guestfish.pod:786
19506 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
19507 "command (a guestfish command) to the second command (any host command). For "
19512 #: ../fish/guestfish.pod:790
19515 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19520 #: ../fish/guestfish.pod:792
19522 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19523 "program). The above command would list all accounts in the guest filesystem "
19524 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19528 #: ../fish/guestfish.pod:797
19531 " hexdump /bin/ls | head\n"
19532 " list-devices | tail -1\n"
19533 " tgz-out / - | tar ztf -\n"
19538 #: ../fish/guestfish.pod:801
19540 "The space before the pipe symbol is required, any space after the pipe "
19541 "symbol is optional. Everything after the pipe symbol is just passed "
19542 "straight to the host shell, so it can contain redirections, globs and "
19543 "anything else that makes sense on the host side."
19547 #: ../fish/guestfish.pod:806
19549 "To use a literal argument which begins with a pipe symbol, you have to quote "
19554 #: ../fish/guestfish.pod:809
19562 #: ../fish/guestfish.pod:811
19563 msgid "HOME DIRECTORIES"
19567 #: ../fish/guestfish.pod:813
19569 "If a parameter starts with the character C<~> then the tilde may be expanded "
19570 "as a home directory path (either C<~> for the current user's home directory, "
19571 "or C<~user> for another user)."
19575 #: ../fish/guestfish.pod:817
19577 "Note that home directory expansion happens for users known I<on the host>, "
19578 "not in the guest filesystem."
19582 #: ../fish/guestfish.pod:820
19584 "To use a literal argument which begins with a tilde, you have to quote it, "
19589 #: ../fish/guestfish.pod:823
19597 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
19598 msgid "ENCRYPTED DISKS"
19602 #: ../fish/guestfish.pod:827
19604 "Libguestfs has some support for Linux guests encrypted according to the "
19605 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19606 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
19607 "LUKS is supported."
19611 #: ../fish/guestfish.pod:832
19612 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19616 #: ../fish/guestfish.pod:834
19619 " ><fs> vfs-type /dev/sda2\n"
19625 #: ../fish/guestfish.pod:837
19627 "Then open those devices using L</luks-open>. This creates a device-mapper "
19628 "device called C</dev/mapper/luksdev>."
19632 #: ../fish/guestfish.pod:840
19635 " ><fs> luks-open /dev/sda2 luksdev\n"
19636 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19641 #: ../fish/guestfish.pod:843
19643 "Finally you have to tell LVM to scan for volume groups on the newly created "
19648 #: ../fish/guestfish.pod:846
19652 " vg-activate-all true\n"
19657 #: ../fish/guestfish.pod:849
19658 msgid "The logical volume(s) can now be mounted in the usual way."
19662 #: ../fish/guestfish.pod:851
19664 "Before closing a LUKS device you must unmount any logical volumes on it and "
19665 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19666 "one. Then you can close the mapper device:"
19670 #: ../fish/guestfish.pod:855
19673 " vg-activate false /dev/VG\n"
19674 " luks-close /dev/mapper/luksdev\n"
19679 #: ../fish/guestfish.pod:860
19681 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19682 "letters and paths (with some limitations). The following commands are "
19687 #: ../fish/guestfish.pod:864
19690 " file /WINDOWS/system32/config/system.LOG\n"
19695 #: ../fish/guestfish.pod:866
19698 " file win:\\windows\\system32\\config\\system.log\n"
19703 #: ../fish/guestfish.pod:868
19706 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19711 #: ../fish/guestfish.pod:870
19713 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19714 "where the drive is mounted, prepending that to the path, changing all "
19715 "backslash characters to forward slash, then resolving the result using L</"
19716 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
19717 "the parameter might be rewritten like this:"
19721 #: ../fish/guestfish.pod:876
19724 " win:e:\\foo\\bar => /e/FOO/bar\n"
19729 #: ../fish/guestfish.pod:878
19730 msgid "This only works in argument positions that expect a path."
19734 #: ../fish/guestfish.pod:880
19735 msgid "UPLOADING AND DOWNLOADING FILES"
19739 #: ../fish/guestfish.pod:882
19741 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19742 "others which upload from or download to a local file, you can use the "
19743 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19747 #: ../fish/guestfish.pod:886
19755 #: ../fish/guestfish.pod:888
19757 "reads stdin and creates from that a file C</foo> in the disk image, and:"
19761 #: ../fish/guestfish.pod:891
19764 " tar-out /etc - | tar tf -\n"
19769 #: ../fish/guestfish.pod:893
19771 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19772 "command (see L</PIPES>)."
19776 #: ../fish/guestfish.pod:896
19778 "When using C<-> to read from stdin, the input is read up to the end of "
19779 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19780 "some arbitrary end marker:"
19784 #: ../fish/guestfish.pod:900
19787 " upload -<<END /foo\n"
19796 #: ../fish/guestfish.pod:906
19798 "Any string of characters can be used instead of C<END>. The end marker must "
19799 "appear on a line of its own, without any preceeding or following characters "
19800 "(not even spaces)."
19804 #: ../fish/guestfish.pod:910
19806 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19807 "upload local files (so-called \"FileIn\" parameters in the generator)."
19811 #: ../fish/guestfish.pod:913
19812 msgid "EXIT ON ERROR BEHAVIOUR"
19816 #: ../fish/guestfish.pod:915
19818 "By default, guestfish will ignore any errors when in interactive mode (ie. "
19819 "taking commands from a human over a tty), and will exit on the first error "
19820 "in non-interactive mode (scripts, commands given on the command line)."
19824 #: ../fish/guestfish.pod:920
19826 "If you prefix a command with a I<-> character, then that command will not "
19827 "cause guestfish to exit, even if that (one) command returns an error."
19831 #: ../fish/guestfish.pod:924
19832 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19836 #: ../fish/guestfish.pod:926
19838 "Guestfish can be remote-controlled over a socket. This is useful "
19839 "particularly in shell scripts where you want to make several different "
19840 "changes to a filesystem, but you don't want the overhead of starting up a "
19841 "guestfish process each time."
19845 #: ../fish/guestfish.pod:931
19846 msgid "Start a guestfish server process using:"
19850 #: ../fish/guestfish.pod:933
19853 " eval \"`guestfish --listen`\"\n"
19858 #: ../fish/guestfish.pod:935
19859 msgid "and then send it commands by doing:"
19863 #: ../fish/guestfish.pod:937
19866 " guestfish --remote cmd [...]\n"
19871 #: ../fish/guestfish.pod:939
19872 msgid "To cause the server to exit, send it the exit command:"
19876 #: ../fish/guestfish.pod:943
19878 "Note that the server will normally exit if there is an error in a command. "
19879 "You can change this in the usual way. See section L</EXIT ON ERROR "
19884 #: ../fish/guestfish.pod:947
19885 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19889 #: ../fish/guestfish.pod:949
19891 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19892 "is how the I<--remote> option knows where to send the commands. You can "
19893 "have several guestfish listener processes running using:"
19897 #: ../fish/guestfish.pod:953
19900 " eval \"`guestfish --listen`\"\n"
19901 " pid1=$GUESTFISH_PID\n"
19902 " eval \"`guestfish --listen`\"\n"
19903 " pid2=$GUESTFISH_PID\n"
19905 " guestfish --remote=$pid1 cmd\n"
19906 " guestfish --remote=$pid2 cmd\n"
19911 #: ../fish/guestfish.pod:961
19912 msgid "REMOTE CONTROL AND CSH"
19916 #: ../fish/guestfish.pod:963
19918 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19923 #: ../fish/guestfish.pod:966
19926 " eval \"`guestfish --listen --csh`\"\n"
19931 #: ../fish/guestfish.pod:968
19932 msgid "REMOTE CONTROL DETAILS"
19936 #: ../fish/guestfish.pod:970
19938 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
19939 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
19940 "and C<$PID> is the process ID of the server."
19944 #: ../fish/guestfish.pod:974
19945 msgid "Guestfish client and server versions must match exactly."
19949 #: ../fish/guestfish.pod:976
19950 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19954 #: ../fish/guestfish.pod:978
19956 "From Bash, you can use the following code which creates a guestfish "
19957 "instance, correctly quotes the command line, handles failure to start, and "
19958 "cleans up guestfish when the script exits:"
19962 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:965
19970 #: ../fish/guestfish.pod:986
19973 " guestfish[0]=\"guestfish\"\n"
19974 " guestfish[1]=\"--listen\"\n"
19975 " guestfish[2]=\"--ro\"\n"
19976 " guestfish[3]=\"-a\"\n"
19977 " guestfish[4]=\"disk.img\"\n"
19982 #: ../fish/guestfish.pod:992
19985 " GUESTFISH_PID=\n"
19986 " eval $(\"${guestfish[@]}\")\n"
19987 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19988 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19995 #: ../fish/guestfish.pod:999
19998 " cleanup_guestfish ()\n"
20000 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
20002 " trap cleanup_guestfish EXIT ERR\n"
20007 #: ../fish/guestfish.pod:1005
20010 " guestfish --remote -- run\n"
20015 #: ../fish/guestfish.pod:1007
20023 #: ../fish/guestfish.pod:1009
20024 msgid "REMOTE CONTROL RUN COMMAND HANGING"
20028 #: ../fish/guestfish.pod:1011
20030 "Using the C<run> (or C<launch>) command remotely in a command substitution "
20031 "context hangs, ie. don't do (note the backquotes):"
20035 #: ../fish/guestfish.pod:1014
20038 " a=`guestfish --remote run`\n"
20043 #: ../fish/guestfish.pod:1016
20045 "Since the C<run> command produces no output on stdout, this is not useful "
20046 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
20051 #: ../fish/guestfish.pod:1020
20052 msgid "PREPARED DISK IMAGES"
20056 #: ../fish/guestfish.pod:1022
20058 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
20059 "preformatted disk images that guestfish can make for you to save typing. "
20060 "This is particularly useful for testing purposes. This option is used "
20061 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
20062 "can be mixed with I<-a>)."
20066 #: ../fish/guestfish.pod:1028
20068 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
20069 "the second and so on. Existing files in the current directory are "
20074 #: ../fish/guestfish.pod:1032
20076 "The type briefly describes how the disk should be sized, partitioned, how "
20077 "filesystem(s) should be created, and how content should be added. "
20078 "Optionally the type can be followed by extra parameters, separated by C<:> "
20079 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
20080 "allocated disk, containing a single partition, with the partition formatted "
20081 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
20086 #: ../fish/guestfish.pod:1040
20087 msgid "To list the available types and any extra parameters they take, run:"
20091 #: ../fish/guestfish.pod:1044
20093 "Note that the prepared filesystem is not mounted. You would usually have to "
20094 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
20098 #: ../fish/guestfish.pod:1048
20100 "If any I<-N> or I<--new> options are given, the guest is automatically "
20105 #: ../fish/guestfish.pod:1053
20106 msgid "Create a 100MB disk with an ext4-formatted partition:"
20110 #: ../fish/guestfish.pod:1055
20113 " guestfish -N fs:ext4\n"
20118 #: ../fish/guestfish.pod:1057
20119 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
20123 #: ../fish/guestfish.pod:1059
20126 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
20131 #: ../fish/guestfish.pod:1061
20132 msgid "Create a blank 200MB disk:"
20136 #: ../fish/guestfish.pod:1063
20139 " guestfish -N disk:200M\n"
20144 #: ../fish/guestfish.pod:1065
20145 msgid "PROGRESS BARS"
20149 #: ../fish/guestfish.pod:1067
20151 "Some (not all) long-running commands send progress notification messages as "
20152 "they are running. Guestfish turns these messages into progress bars."
20156 #: ../fish/guestfish.pod:1071
20158 "When a command that supports progress bars takes longer than two seconds to "
20159 "run, and if progress bars are enabled, then you will see one appearing below "
20164 #: ../fish/guestfish.pod:1075
20167 " ><fs> copy-size /large-file /another-file 2048M\n"
20168 " / 10% [#####-----------------------------------------] 00:30\n"
20173 #: ../fish/guestfish.pod:1078
20175 "The spinner on the left hand side moves round once for every progress "
20176 "notification received from the backend. This is a (reasonably) golden "
20177 "assurance that the command is \"doing something\" even if the progress bar "
20178 "is not moving, because the command is able to send the progress "
20179 "notifications. When the bar reaches 100% and the command finishes, the "
20180 "spinner disappears."
20184 #: ../fish/guestfish.pod:1085
20186 "Progress bars are enabled by default when guestfish is used interactively. "
20187 "You can enable them even for non-interactive modes using I<--progress-bars>, "
20188 "and you can disable them completely using I<--no-progress-bars>."
20192 #: ../fish/guestfish.pod:1090
20193 msgid "GUESTFISH COMMANDS"
20197 #: ../fish/guestfish.pod:1092
20199 "The commands in this section are guestfish convenience commands, in other "
20200 "words, they are not part of the L<guestfs(3)> API."
20204 #: ../fish/guestfish.pod:1095
20209 #: ../fish/guestfish.pod:1097
20218 #: ../fish/guestfish.pod:1100
20219 msgid "Without any parameter, this provides general help."
20223 #: ../fish/guestfish.pod:1102
20224 msgid "With a C<cmd> parameter, this displays detailed help for that command."
20228 #: ../fish/guestfish.pod:1104
20229 msgid "quit | exit"
20233 #: ../fish/guestfish.pod:1106
20234 msgid "This exits guestfish. You can also use C<^D> key."
20238 #: ../fish/guestfish.pod:1108
20239 msgid "@FISH_COMMANDS@"
20243 #: ../fish/guestfish.pod:1110
20248 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1505
20253 #: ../fish/guestfish.pod:1116
20255 "guestfish returns 0 if the commands completed without error, or 1 if there "
20260 #: ../fish/guestfish.pod:1123
20265 #: ../fish/guestfish.pod:1125
20267 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
20272 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3198
20273 msgid "FEBOOTSTRAP_KERNEL"
20277 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3200
20278 msgid "FEBOOTSTRAP_MODULES"
20282 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3202
20284 "These two environment variables allow the kernel that libguestfs uses in the "
20285 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
20286 "most recent host kernel is chosen. For more information about kernel "
20287 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
20288 "available in febootstrap E<ge> 3.8."
20292 #: ../fish/guestfish.pod:1138
20293 msgid "GUESTFISH_DISPLAY_IMAGE"
20297 #: ../fish/guestfish.pod:1140
20299 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
20300 "If not set, it uses L<display(1)>."
20304 #: ../fish/guestfish.pod:1143
20305 msgid "GUESTFISH_PID"
20309 #: ../fish/guestfish.pod:1145
20311 "Used with the I<--remote> option to specify the remote guestfish process to "
20312 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
20316 #: ../fish/guestfish.pod:1149
20321 #: ../fish/guestfish.pod:1151
20323 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
20324 "not specified, the external L<hexedit(1)> program is used."
20328 #: ../fish/guestfish.pod:1155
20333 #: ../fish/guestfish.pod:1157
20335 "If compiled with GNU readline support, various files in the home directory "
20336 "can be used. See L</FILES>."
20340 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3208
20341 msgid "LIBGUESTFS_APPEND"
20345 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3210
20346 msgid "Pass additional options to the guest kernel."
20350 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3212
20351 msgid "LIBGUESTFS_DEBUG"
20355 #: ../fish/guestfish.pod:1166
20357 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
20358 "effect as using the B<-v> option."
20362 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3217
20363 msgid "LIBGUESTFS_MEMSIZE"
20367 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3219
20369 "Set the memory allocated to the qemu process, in megabytes. For example:"
20373 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3222
20376 " LIBGUESTFS_MEMSIZE=700\n"
20381 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3224
20382 msgid "LIBGUESTFS_PATH"
20386 #: ../fish/guestfish.pod:1178
20388 "Set the path that guestfish uses to search for kernel and initrd.img. See "
20389 "the discussion of paths in L<guestfs(3)>."
20393 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3229
20394 msgid "LIBGUESTFS_QEMU"
20398 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3231
20400 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
20401 "which was found at compile time by the configure script is used."
20405 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3237
20406 msgid "LIBGUESTFS_TRACE"
20410 #: ../fish/guestfish.pod:1189
20411 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
20415 #: ../fish/guestfish.pod:1191
20420 #: ../fish/guestfish.pod:1193
20422 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
20427 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236
20428 #: ../src/guestfs.pod:3242
20433 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3244
20435 "Location of temporary directory, defaults to C</tmp> except for the cached "
20436 "supermin appliance which defaults to C</var/tmp>."
20440 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3247
20442 "If libguestfs was compiled to use the supermin appliance then the real "
20443 "appliance is cached in this directory, shared between all handles belonging "
20444 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
20445 "use in case C</var/tmp> is not large enough."
20449 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297
20450 #: ../rescue/virt-rescue.pod:273
20455 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301
20456 #: ../rescue/virt-rescue.pod:277
20457 msgid "$HOME/.libguestfs-tools.rc"
20461 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303
20462 #: ../rescue/virt-rescue.pod:279
20463 msgid "/etc/libguestfs-tools.conf"
20467 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305
20468 #: ../rescue/virt-rescue.pod:281
20470 "This configuration file controls the default read-only or read-write mode "
20471 "(I<--ro> or I<--rw>)."
20475 #: ../fish/guestfish.pod:1220
20476 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
20480 #: ../fish/guestfish.pod:1222
20481 msgid "$HOME/.guestfish"
20485 #: ../fish/guestfish.pod:1224
20487 "If compiled with GNU readline support, then the command history is saved in "
20492 #: ../fish/guestfish.pod:1227
20493 msgid "$HOME/.inputrc"
20497 #: ../fish/guestfish.pod:1229
20498 msgid "/etc/inputrc"
20502 #: ../fish/guestfish.pod:1231
20504 "If compiled with GNU readline support, then these files can be used to "
20505 "configure readline. For further information, please see L<readline(3)/"
20506 "INITIALIZATION FILE>."
20510 #: ../fish/guestfish.pod:1235
20511 msgid "To write rules which only apply to guestfish, use:"
20515 #: ../fish/guestfish.pod:1237
20525 #: ../fish/guestfish.pod:1241
20527 "Variables that you can set in inputrc that change the behaviour of guestfish "
20528 "in useful ways include:"
20532 #: ../fish/guestfish.pod:1246
20533 msgid "completion-ignore-case (default: on)"
20537 #: ../fish/guestfish.pod:1248
20539 "By default, guestfish will ignore case when tab-completing paths on the "
20544 #: ../fish/guestfish.pod:1251
20547 " set completion-ignore-case off\n"
20552 #: ../fish/guestfish.pod:1253
20553 msgid "to make guestfish case sensitive."
20557 #: ../fish/guestfish.pod:1257
20562 #: ../fish/guestfish.pod:1259
20563 msgid "test2.img (etc)"
20567 #: ../fish/guestfish.pod:1261
20569 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
20570 "will be created in the file C<test1.img> in the current directory. The "
20571 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
20572 "the same name will be overwritten."
20576 #: ../fish/guestfish.pod:1270
20578 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, L<virt-"
20579 "cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit"
20580 "(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems"
20581 "(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-"
20582 "rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, "
20583 "L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, "
20584 "L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
20588 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3339
20589 #: ../test-tool/libguestfs-test-tool.pod:112
20590 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
20594 #: ../fish/virt-copy-in.pod:5
20596 "virt-copy-in - Copy files and directories into a virtual machine disk image."
20600 #: ../fish/virt-copy-in.pod:9
20603 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
20608 #: ../fish/virt-copy-in.pod:11
20611 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
20616 #: ../fish/virt-copy-in.pod:15
20618 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
20619 "causing disk corruption. The virtual machine must be shut down before you "
20620 "use this command."
20624 #: ../fish/virt-copy-in.pod:21
20626 "C<virt-copy-in> copies files and directories from the local disk into a "
20627 "virtual machine disk image or named libvirt domain."
20631 #: ../fish/virt-copy-in.pod:24
20633 "You can give one of more filenames and directories on the command line. "
20634 "Directories are copied in recursively. The final parameter must be the "
20635 "destination directory in the disk image which must be an absolute path "
20636 "starting with a C</> character."
20640 #: ../fish/virt-copy-in.pod:33
20643 " virt-copy-in -d MyGuest resolv.conf /etc\n"
20648 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
20649 msgid "Upload a home directory to a guest:"
20653 #: ../fish/virt-copy-in.pod:37
20656 " virt-copy-in -d MyGuest skel /home\n"
20661 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
20662 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
20663 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
20667 #: ../fish/virt-copy-in.pod:41
20669 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20670 "> C<copy-in> command. For anything more complex than a trivial copy, you "
20671 "are probably better off using guestfish directly."
20675 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
20676 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
20678 "Since the shell script just passes options straight to guestfish, read "
20679 "L<guestfish(1)> to see the full list of options."
20683 #: ../fish/virt-copy-in.pod:52
20685 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20686 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20690 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
20691 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20692 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20696 #: ../fish/virt-copy-out.pod:5
20698 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20703 #: ../fish/virt-copy-out.pod:9
20706 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20711 #: ../fish/virt-copy-out.pod:11
20714 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20719 #: ../fish/virt-copy-out.pod:15
20721 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20722 "image or named libvirt domain."
20726 #: ../fish/virt-copy-out.pod:18
20728 "You can give one of more filenames and directories on the command line. "
20729 "Directories are copied out recursively."
20733 #: ../fish/virt-copy-out.pod:23
20734 msgid "Download the home directories from a virtual machine:"
20738 #: ../fish/virt-copy-out.pod:25
20742 " virt-copy-out -d MyGuest /home homes\n"
20747 #: ../fish/virt-copy-out.pod:30
20749 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20750 "> C<copy-out> command. For anything more complex than a trivial copy, you "
20751 "are probably better off using guestfish directly."
20755 #: ../fish/virt-copy-out.pod:41
20757 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
20758 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20762 #: ../fish/virt-tar-in.pod:5
20763 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20767 #: ../fish/virt-tar-in.pod:9
20770 " virt-tar-in -a disk.img data.tar /destination\n"
20775 #: ../fish/virt-tar-in.pod:11
20778 " virt-tar-in -d domain data.tar /destination\n"
20783 #: ../fish/virt-tar-in.pod:13
20786 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20791 #: ../fish/virt-tar-in.pod:17
20793 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20794 "causing disk corruption. The virtual machine must be shut down before you "
20795 "use this command."
20799 #: ../fish/virt-tar-in.pod:23
20801 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20802 "image or named libvirt domain."
20806 #: ../fish/virt-tar-in.pod:26
20808 "The first parameter is the tar file. Use C<-> to read the tar file from "
20809 "standard input. The second parameter is the absolute target directory to "
20814 #: ../fish/virt-tar-in.pod:34
20817 " virt-tar-in -d MyGuest homes.tar /home\n"
20822 #: ../fish/virt-tar-in.pod:38
20824 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20825 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
20826 "probably better off using guestfish directly."
20830 #: ../fish/virt-tar-in.pod:49
20832 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20833 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
20838 #: ../fish/virt-tar-out.pod:5
20840 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20844 #: ../fish/virt-tar-out.pod:9
20847 " virt-tar-out -a disk.img /dir files.tar\n"
20852 #: ../fish/virt-tar-out.pod:11
20855 " virt-tar-out -d domain /dir files.tar\n"
20860 #: ../fish/virt-tar-out.pod:13
20863 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20868 #: ../fish/virt-tar-out.pod:17
20870 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20874 #: ../fish/virt-tar-out.pod:20
20876 "The first parameter is the absolute path of the virtual machine directory. "
20877 "The second parameter is the tar file to write. Use C<-> to write to "
20882 #: ../fish/virt-tar-out.pod:26
20883 msgid "Download the home directories from a guest:"
20887 #: ../fish/virt-tar-out.pod:28
20890 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20895 #: ../fish/virt-tar-out.pod:32
20897 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20898 "> C<tar-out> command. For anything more complex than a trivial copy, you "
20899 "are probably better off using guestfish directly."
20903 #: ../fish/virt-tar-out.pod:43
20905 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20906 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20910 #: ../fuse/guestmount.pod:5
20912 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20916 #: ../fuse/guestmount.pod:9
20919 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20924 #: ../fuse/guestmount.pod:11
20927 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20932 #: ../fuse/guestmount.pod:13
20935 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20940 #: ../fuse/guestmount.pod:17
20942 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20943 "machines. If you do this, you risk disk corruption in the VM."
20947 #: ../fuse/guestmount.pod:22
20949 "The guestmount program can be used to mount virtual machine filesystems and "
20950 "other disk images on the host. It uses libguestfs for access to the guest "
20951 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20952 "a mountable device."
20956 #: ../fuse/guestmount.pod:27
20958 "Along with other options, you have to give at least one device (I<-a> "
20959 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20960 "option) or use the I<-i> inspection option. How this works is better "
20961 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
20966 #: ../fuse/guestmount.pod:33
20968 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20969 "by you, and the filesystem will not be visible to any other users unless you "
20970 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20971 "the filesystem, use the C<fusermount -u> command."
20975 #: ../fuse/guestmount.pod:41
20977 "For a typical Windows guest which has its main filesystem on the first "
20982 #: ../fuse/guestmount.pod:44
20985 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20990 #: ../fuse/guestmount.pod:46
20992 "For a typical Linux guest which has a /boot filesystem on the first "
20993 "partition, and the root filesystem on a logical volume:"
20997 #: ../fuse/guestmount.pod:49
21000 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
21005 #: ../fuse/guestmount.pod:51
21006 msgid "To get libguestfs to detect guest mountpoints for you:"
21010 #: ../fuse/guestmount.pod:53
21013 " guestmount -a guest.img -i --ro /mnt\n"
21018 #: ../fuse/guestmount.pod:55
21019 msgid "For a libvirt guest called \"Guest\" you could do:"
21023 #: ../fuse/guestmount.pod:57
21026 " guestmount -d Guest -i --ro /mnt\n"
21031 #: ../fuse/guestmount.pod:59
21033 "If you don't know what filesystems are contained in a guest or disk image, "
21034 "use L<virt-filesystems(1)> first:"
21038 #: ../fuse/guestmount.pod:62
21041 " virt-filesystems MyGuest\n"
21046 #: ../fuse/guestmount.pod:64
21048 "If you want to trace the libguestfs calls but without excessive debugging "
21049 "information, we recommend:"
21053 #: ../fuse/guestmount.pod:67
21056 " guestmount [...] --trace /mnt\n"
21061 #: ../fuse/guestmount.pod:69
21062 msgid "If you want to debug the program, we recommend:"
21066 #: ../fuse/guestmount.pod:71
21069 " guestmount [...] --trace --verbose /mnt\n"
21074 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
21075 #: ../resize/virt-resize.pod:600
21080 #: ../fuse/guestmount.pod:75
21081 msgid "Other users cannot see the filesystem by default"
21085 #: ../fuse/guestmount.pod:77
21087 "If you mount a filesystem as one user (eg. root), then other users will not "
21088 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
21089 "option when mounting:"
21093 #: ../fuse/guestmount.pod:81
21096 " sudo guestmount [...] -o allow_other /mnt\n"
21101 #: ../fuse/guestmount.pod:83
21102 msgid "Enabling FUSE"
21106 #: ../fuse/guestmount.pod:85
21108 "On some distros, you may need to add yourself to a special group (eg. "
21109 "C<fuse>) before you can use any FUSE filesystem. This is necessary on "
21110 "Debian and derivatives."
21114 #: ../fuse/guestmount.pod:89
21116 "On other distros, no special group is required. It is not necessary on "
21117 "Fedora or Red Hat Enterprise Linux."
21121 #: ../fuse/guestmount.pod:100
21122 msgid "Add a block device or virtual machine image."
21126 #: ../fuse/guestmount.pod:123
21127 msgid "B<--dir-cache-timeout N>"
21131 #: ../fuse/guestmount.pod:125
21133 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
21134 "seconds. The readdir cache [actually, there are several semi-independent "
21135 "caches] is populated after a readdir(2) call with the stat and extended "
21136 "attributes of the files in the directory, in anticipation that they will be "
21137 "requested soon after."
21141 #: ../fuse/guestmount.pod:131
21143 "There is also a different attribute cache implemented by FUSE (see the FUSE "
21144 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
21145 "requests, only cache existing ones."
21149 #: ../fuse/guestmount.pod:151
21151 "If you have untrusted raw-format guest disk images, you should use this "
21152 "option to specify the disk format. This avoids a possible security problem "
21153 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
21154 "guestfs_add_drive_opts>."
21158 #: ../fuse/guestmount.pod:156
21159 msgid "B<--fuse-help>"
21163 #: ../fuse/guestmount.pod:158
21164 msgid "Display help on special FUSE options (see I<-o> below)."
21168 #: ../fuse/guestmount.pod:162
21169 msgid "Display brief help and exit."
21173 #: ../fuse/guestmount.pod:186
21175 "Mount the named partition or logical volume on the given mountpoint B<in the "
21176 "guest> (this has nothing to do with mountpoints in the host)."
21180 #: ../fuse/guestmount.pod:189
21182 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
21183 "something on C</>."
21187 #: ../fuse/guestmount.pod:206
21189 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
21190 "unmounted. If you specify this option, then we don't attempt to sync the "
21191 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
21195 #: ../fuse/guestmount.pod:211
21196 msgid "B<-o option>"
21200 #: ../fuse/guestmount.pod:213
21201 msgid "B<--option option>"
21205 #: ../fuse/guestmount.pod:215
21206 msgid "Pass extra options to FUSE."
21210 #: ../fuse/guestmount.pod:217
21212 "To get a list of all the extra options supported by FUSE, use the command "
21213 "below. Note that only the FUSE I<-o> options can be passed, and only some "
21214 "of them are a good idea."
21218 #: ../fuse/guestmount.pod:221
21221 " guestmount --fuse-help\n"
21226 #: ../fuse/guestmount.pod:223
21227 msgid "Some potentially useful FUSE options:"
21231 #: ../fuse/guestmount.pod:227
21232 msgid "B<-o allow_other>"
21236 #: ../fuse/guestmount.pod:229
21237 msgid "Allow other users to see the filesystem."
21241 #: ../fuse/guestmount.pod:231
21242 msgid "B<-o attr_timeout=N>"
21246 #: ../fuse/guestmount.pod:233
21247 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
21251 #: ../fuse/guestmount.pod:235
21252 msgid "B<-o kernel_cache>"
21256 #: ../fuse/guestmount.pod:237
21258 "Allow the kernel to cache files (reduces the number of reads that have to go "
21259 "through the L<guestfs(3)> API). This is generally a good idea if you can "
21260 "afford the extra memory usage."
21264 #: ../fuse/guestmount.pod:241
21265 msgid "B<-o uid=N> B<-o gid=N>"
21269 #: ../fuse/guestmount.pod:243
21271 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
21272 "the chosen values."
21276 #: ../fuse/guestmount.pod:252
21278 "Add devices and mount everything read-only. Also disallow writes and make "
21279 "the disk appear read-only to FUSE."
21283 #: ../fuse/guestmount.pod:255
21285 "This is highly recommended if you are not going to edit the guest disk. If "
21286 "the guest is running and this option is I<not> supplied, then there is a "
21287 "strong risk of disk corruption in the guest. We try to prevent this from "
21288 "happening, but it is not always possible."
21292 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
21293 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
21297 #: ../fuse/guestmount.pod:264
21298 msgid "Enable SELinux support for the guest."
21302 #: ../fuse/guestmount.pod:270
21303 msgid "Enable verbose messages from underlying libguestfs."
21307 #: ../fuse/guestmount.pod:276
21308 msgid "Display the program version and exit."
21312 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308
21313 #: ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
21314 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
21318 #: ../fuse/guestmount.pod:289
21323 #: ../fuse/guestmount.pod:291
21324 msgid "Trace libguestfs calls and entry into each FUSE function."
21328 #: ../fuse/guestmount.pod:293
21329 msgid "This also stops the daemon from forking into the background."
21333 #: ../fuse/guestmount.pod:319
21335 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21336 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
21341 #: ../fuse/guestmount.pod:334
21342 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
21346 #: ../inspector/virt-inspector.pod:5
21348 "virt-inspector - Display operating system version and other information "
21349 "about a virtual machine"
21353 #: ../inspector/virt-inspector.pod:9
21356 " virt-inspector [--options] -d domname\n"
21361 #: ../inspector/virt-inspector.pod:11
21364 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
21369 #: ../inspector/virt-inspector.pod:15
21372 " virt-inspector domname\n"
21377 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
21380 " virt-inspector disk.img [disk.img ...]\n"
21385 #: ../inspector/virt-inspector.pod:21
21387 "B<virt-inspector> examines a virtual machine or disk image and tries to "
21388 "determine the version of the operating system and other information about "
21389 "the virtual machine."
21393 #: ../inspector/virt-inspector.pod:25
21394 msgid "Virt-inspector produces XML output for feeding into other programs."
21398 #: ../inspector/virt-inspector.pod:27
21400 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
21401 "the libvirt domain (see: C<virsh list --all>)."
21405 #: ../inspector/virt-inspector.pod:30
21407 "You can also run virt-inspector directly on disk images from a single "
21408 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
21409 "has several block devices, in which case you should list several I<-a> "
21410 "options one after another, with the first corresponding to the guest's C</"
21411 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
21415 #: ../inspector/virt-inspector.pod:37
21417 "You can also run virt-inspector on install disks, live CDs, bootable USB "
21418 "keys and similar."
21422 #: ../inspector/virt-inspector.pod:40
21424 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
21425 "inspect several virtual machines, you have to run virt-inspector several "
21426 "times (for example, from a shell script for-loop)."
21430 #: ../inspector/virt-inspector.pod:45
21432 "Because virt-inspector needs direct access to guest images, it won't "
21433 "normally work over remote libvirt connections."
21437 #: ../inspector/virt-inspector.pod:48
21439 "All of the information available from virt-inspector is also available "
21440 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
21441 "The same information can also be fetched using guestfish or via libguestfs "
21442 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
21443 "WITH OTHER PROGRAMMING LANGUAGES>)."
21447 #: ../inspector/virt-inspector.pod:81
21449 "Libvirt is only used if you specify a C<domname> on the command line. If "
21450 "you specify guest block devices directly (I<-a>), then libvirt is not used "
21455 #: ../inspector/virt-inspector.pod:94
21457 "When prompting for keys and passphrases, virt-inspector normally turns "
21458 "echoing off so you cannot see what you are typing. If you are not worried "
21459 "about Tempest attacks and there is no one else in the room you can specify "
21460 "this flag to see what you are typing."
21464 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
21465 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
21466 #: ../tools/virt-win-reg.pl:144
21468 "Specify the format of disk images given on the command line. If this is "
21469 "omitted then the format is autodetected from the content of the disk image."
21473 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
21474 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
21475 #: ../tools/virt-win-reg.pl:148
21477 "If disk images are requested from libvirt, then this program asks libvirt "
21478 "for this information. In this case, the value of the format parameter is "
21483 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:370
21484 #: ../resize/virt-resize.pod:462 ../sparsify/virt-sparsify.pod:132
21485 #: ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102
21486 #: ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
21488 "If working with untrusted raw-format guest disk images, you should ensure "
21489 "the format is always specified."
21493 #: ../inspector/virt-inspector.pod:139
21494 msgid "Previous versions of virt-inspector allowed you to write either:"
21498 #: ../inspector/virt-inspector.pod:145
21501 " virt-inspector guestname\n"
21506 #: ../inspector/virt-inspector.pod:153
21511 #: ../inspector/virt-inspector.pod:155
21513 "The virt-inspector XML is described precisely in a RELAX NG schema file "
21514 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
21515 "just an overview."
21519 #: ../inspector/virt-inspector.pod:159
21521 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
21522 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
21523 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
21524 "which is vanishingly rare in real world VMs."
21528 #: ../inspector/virt-inspector.pod:164
21529 msgid "E<lt>operatingsystemE<gt>"
21533 #: ../inspector/virt-inspector.pod:166
21535 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
21536 "describe the operating system, its architecture, the descriptive \"product "
21537 "name\" string, the type of OS and so on, as in this example:"
21541 #: ../inspector/virt-inspector.pod:170
21544 " <operatingsystems>\n"
21545 " <operatingsystem>\n"
21546 " <root>/dev/sda2</root>\n"
21547 " <name>windows</name>\n"
21548 " <arch>i386</arch>\n"
21549 " <distro>windows</distro>\n"
21550 " <product_name>Windows 7 Enterprise</product_name>\n"
21551 " <product_variant>Client</product_variant>\n"
21552 " <major_version>6</major_version>\n"
21553 " <minor_version>1</minor_version>\n"
21554 " <windows_systemroot>/Windows</windows_systemroot>\n"
21555 " <format>installed</format>\n"
21560 #: ../inspector/virt-inspector.pod:183
21562 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
21563 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
21564 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
21565 "architecture. The other fields are fairly self-explanatory, but because "
21566 "these fields are taken directly from the libguestfs inspection API you can "
21567 "find precise information from L<guestfs(3)/INSPECTION>."
21571 #: ../inspector/virt-inspector.pod:191
21573 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
21574 "of view of libguestfs (block devices may have completely different names "
21575 "inside the VM itself)."
21579 #: ../inspector/virt-inspector.pod:195
21580 msgid "E<lt>mountpointsE<gt>"
21584 #: ../inspector/virt-inspector.pod:197
21586 "Un*x-like guests typically have multiple filesystems which are mounted at "
21587 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
21588 "element which looks like this:"
21592 #: ../inspector/virt-inspector.pod:201
21595 " <operatingsystems>\n"
21596 " <operatingsystem>\n"
21599 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
21600 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
21601 " </mountpoints>\n"
21606 #: ../inspector/virt-inspector.pod:209
21608 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
21609 "and may have completely different names inside the guest. Only mountable "
21610 "filesystems appear in this list, not things like swap devices."
21614 #: ../inspector/virt-inspector.pod:214
21615 msgid "E<lt>filesystemsE<gt>"
21619 #: ../inspector/virt-inspector.pod:216
21621 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
21622 "filesystems belonging to the guest, including swap and empty partitions. "
21623 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
21624 "this OS or shared with this OS and other OSes)."
21628 #: ../inspector/virt-inspector.pod:222
21629 msgid "You might see something like this:"
21633 #: ../inspector/virt-inspector.pod:224
21636 " <operatingsystems>\n"
21637 " <operatingsystem>\n"
21640 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21641 " <type>ext4</type>\n"
21642 " <label>Fedora-13-x86_64</label>\n"
21643 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
21649 #: ../inspector/virt-inspector.pod:234
21651 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
21652 "the label, and the UUID."
21656 #: ../inspector/virt-inspector.pod:237
21657 msgid "E<lt>applicationsE<gt>"
21661 #: ../inspector/virt-inspector.pod:239
21663 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
21664 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
21669 #: ../inspector/virt-inspector.pod:243
21671 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
21672 "Typical values would be C<rpm> and C<deb>."
21676 #: ../inspector/virt-inspector.pod:246
21678 "E<lt>package_managementE<gt>, if present, describes the package manager. "
21679 "Typical values include C<yum>, C<up2date> and C<apt>"
21683 #: ../inspector/virt-inspector.pod:249
21684 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
21688 #: ../inspector/virt-inspector.pod:252
21691 " <operatingsystems>\n"
21692 " <operatingsystem>\n"
21694 " <applications>\n"
21696 " <name>coreutils</name>\n"
21697 " <version>8.5</version>\n"
21698 " <release>1</release>\n"
21699 " </application>\n"
21704 #: ../inspector/virt-inspector.pod:262
21706 "The version and release fields may not be available for some types guests. "
21707 "Other fields are possible, see L<guestfs(3)/"
21708 "guestfs_inspect_list_applications>."
21712 #: ../inspector/virt-inspector.pod:266
21713 msgid "E<lt>drive_mappingsE<gt>"
21717 #: ../inspector/virt-inspector.pod:268
21719 "For operating systems like Windows which use drive letters, virt-inspector "
21720 "is able to find out how drive letters map to filesystems."
21724 #: ../inspector/virt-inspector.pod:272
21727 " <operatingsystems>\n"
21728 " <operatingsystem>\n"
21730 " <drive_mappings>\n"
21731 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21732 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21733 " </drive_mappings>\n"
21738 #: ../inspector/virt-inspector.pod:280
21740 "In the example above, drive C maps to the filesystem on the second partition "
21741 "on the first disk, and drive E maps to the filesystem on the first partition "
21742 "on the second disk."
21746 #: ../inspector/virt-inspector.pod:284
21748 "Note that this only covers permanent local filesystem mappings, not things "
21749 "like network shares. Furthermore NTFS volume mount points may not be listed "
21754 #: ../inspector/virt-inspector.pod:288
21755 msgid "E<lt>iconE<gt>"
21759 #: ../inspector/virt-inspector.pod:290
21761 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21762 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21763 "very large and high quality."
21767 #: ../inspector/virt-inspector.pod:294
21770 " <operatingsystems>\n"
21771 " <operatingsystem>\n"
21774 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21775 " [... many lines of base64 data ...]\n"
21781 #: ../inspector/virt-inspector.pod:302
21783 "To display the icon, you have to extract it and convert the base64 data back "
21784 "to a binary file. Use an XPath query or simply an editor to extract the "
21785 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21790 #: ../inspector/virt-inspector.pod:307
21793 " base64 -i -d < icon.data > icon.png\n"
21798 #: ../inspector/virt-inspector.pod:309
21799 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21803 #: ../inspector/virt-inspector.pod:311
21805 "Virt-inspector can detect some operating system installers on install disks, "
21806 "live CDs, bootable USB keys and more."
21810 #: ../inspector/virt-inspector.pod:314
21812 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21813 "fields may be present to indicate a live CD, network installer, or one part "
21814 "of a multipart CD. For example:"
21818 #: ../inspector/virt-inspector.pod:318
21821 " <operatingsystems>\n"
21822 " <operatingsystem>\n"
21823 " <root>/dev/sda</root>\n"
21824 " <name>linux</name>\n"
21825 " <arch>i386</arch>\n"
21826 " <distro>ubuntu</distro>\n"
21827 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
21828 " <major_version>10</major_version>\n"
21829 " <minor_version>10</minor_version>\n"
21830 " <format>installer</format>\n"
21836 #: ../inspector/virt-inspector.pod:330
21837 msgid "USING XPATH"
21841 #: ../inspector/virt-inspector.pod:332
21843 "You can use the XPath query language to select parts of the XML. We "
21844 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
21848 #: ../inspector/virt-inspector.pod:338
21851 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21853 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21854 " <type>ext4</type>\n"
21860 #: ../inspector/virt-inspector.pod:344
21863 " $ virt-inspector -d Guest | \\\n"
21864 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21870 #: ../inspector/virt-inspector.pod:348
21873 " $ virt-inspector -d Guest | \\\n"
21874 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21875 " [displays the guest icon, if there is one]\n"
21880 #: ../inspector/virt-inspector.pod:359
21881 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21885 #: ../inspector/virt-inspector.pod:361
21887 "Early versions of libguestfs shipped with a different virt-inspector program "
21888 "written in Perl (the current version is written in C). The XML output of "
21889 "the Perl virt-inspector was different and it could also output in other "
21890 "formats like text."
21894 #: ../inspector/virt-inspector.pod:366
21896 "The old virt-inspector is no longer supported or shipped with libguestfs."
21900 #: ../inspector/virt-inspector.pod:369
21902 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21903 "versions of virt-inspector with different names:"
21907 #: ../inspector/virt-inspector.pod:372
21910 " virt-inspector Old Perl version.\n"
21911 " virt-inspector2 New C version.\n"
21916 #: ../inspector/virt-inspector.pod:382
21918 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
21919 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21923 #: ../inspector/virt-inspector.pod:399
21924 msgid "Matthew Booth L<mbooth@redhat.com>"
21928 #: ../java/examples/guestfs-java.pod:5
21929 msgid "guestfs-java - How to use libguestfs from Java"
21933 #: ../java/examples/guestfs-java.pod:9
21936 " import com.redhat.et.libguestfs.*;\n"
21941 #: ../java/examples/guestfs-java.pod:11
21944 " GuestFS g = new GuestFS ();\n"
21945 " g.add_drive_opts (\"disk.img\", null);\n"
21951 #: ../java/examples/guestfs-java.pod:17
21953 "This manual page documents how to call libguestfs from the Java programming "
21954 "language. This page just documents the differences from the C API and gives "
21955 "some examples. If you are not familiar with using libguestfs, you also need "
21956 "to read L<guestfs(3)>."
21960 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21961 msgid "CLOSING THE HANDLE"
21965 #: ../java/examples/guestfs-java.pod:24
21967 "The handle is closed when it is reaped by the garbage collector. Because "
21968 "libguestfs handles include a lot of state, it is also possible to close (and "
21969 "hence free) them explicitly by calling the C<close> method."
21973 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
21974 #: ../python/examples/guestfs-python.pod:21
21975 #: ../ruby/examples/guestfs-ruby.pod:22
21980 #: ../java/examples/guestfs-java.pod:31
21982 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21983 "exception. This has a single parameter which is the error message (a "
21988 #: ../java/examples/guestfs-java.pod:35
21989 msgid "Calling any method on a closed handle raises the same exception."
21993 #: ../java/examples/guestfs-java.pod:47
21995 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-ocaml"
21996 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
21997 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
22001 #: ../ocaml/examples/guestfs-ocaml.pod:5
22002 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
22006 #: ../ocaml/examples/guestfs-ocaml.pod:9
22007 msgid "Module style:"
22011 #: ../ocaml/examples/guestfs-ocaml.pod:11
22014 " let g = Guestfs.create () in\n"
22015 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22016 " Guestfs.launch g;\n"
22021 #: ../ocaml/examples/guestfs-ocaml.pod:15
22022 msgid "Object-oriented style:"
22026 #: ../ocaml/examples/guestfs-ocaml.pod:17
22029 " let g = new Guestfs.guestfs () in\n"
22030 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22036 #: ../ocaml/examples/guestfs-ocaml.pod:21
22039 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
22041 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
22046 #: ../ocaml/examples/guestfs-ocaml.pod:27
22048 "This manual page documents how to call libguestfs from the OCaml programming "
22049 "language. This page just documents the differences from the C API and gives "
22050 "some examples. If you are not familiar with using libguestfs, you also need "
22051 "to read L<guestfs(3)>."
22055 #: ../ocaml/examples/guestfs-ocaml.pod:32
22056 msgid "PROGRAMMING STYLES"
22060 #: ../ocaml/examples/guestfs-ocaml.pod:34
22062 "There are two different programming styles supported by the OCaml bindings. "
22063 "You can use a module style, with each C function mapped to an OCaml function:"
22067 #: ../ocaml/examples/guestfs-ocaml.pod:38
22070 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
22075 #: ../ocaml/examples/guestfs-ocaml.pod:40
22080 #: ../ocaml/examples/guestfs-ocaml.pod:42
22083 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
22088 #: ../ocaml/examples/guestfs-ocaml.pod:44
22090 "Alternately you can use an object-oriented style, calling methods on the "
22091 "class C<Guestfs.guestfs>:"
22095 #: ../ocaml/examples/guestfs-ocaml.pod:47
22098 " method set_verbose : bool -> unit\n"
22103 #: ../ocaml/examples/guestfs-ocaml.pod:49
22105 "The object-oriented style is usually briefer, and the minor performance "
22106 "penalty isn't noticable in the general overhead of performing libguestfs "
22111 #: ../ocaml/examples/guestfs-ocaml.pod:55
22113 "The handle is closed when it is reaped by the garbage collector. Because "
22114 "libguestfs handles include a lot of state, it is also possible to close (and "
22115 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
22120 #: ../ocaml/examples/guestfs-ocaml.pod:62
22122 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
22123 "exception. This has a single parameter which is the error message (a "
22128 #: ../ocaml/examples/guestfs-ocaml.pod:66
22130 "Calling any function/method on a closed handle raises C<Guestfs."
22131 "Handle_closed>. The single parameter is the name of the function that you "
22136 #: ../ocaml/examples/guestfs-ocaml.pod:80
22138 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22139 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
22140 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
22144 #: ../perl/examples/guestfs-perl.pod:5
22145 msgid "guestfs-perl - How to use libguestfs from Perl"
22149 #: ../perl/examples/guestfs-perl.pod:9
22152 " use Sys::Guestfs;\n"
22157 #: ../perl/examples/guestfs-perl.pod:11
22160 " my $h = Sys::Guestfs->new ();\n"
22161 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
22162 " $h->launch ();\n"
22163 " $h->mount_options ('', '/dev/sda1', '/');\n"
22164 " $h->touch ('/hello');\n"
22170 #: ../perl/examples/guestfs-perl.pod:20
22172 "This manual page documents how to call libguestfs from the Perl programming "
22173 "language. This page just documents the differences from the C API and gives "
22174 "some examples. If you are not familiar with using libguestfs, you also need "
22175 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
22179 #: ../perl/examples/guestfs-perl.pod:26
22184 #: ../perl/examples/guestfs-perl.pod:28
22186 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
22191 #: ../perl/examples/guestfs-perl.pod:41
22193 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang"
22194 "(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
22195 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
22199 #: ../python/examples/guestfs-python.pod:5
22200 msgid "guestfs-python - How to use libguestfs from Python"
22204 #: ../python/examples/guestfs-python.pod:9
22207 " import guestfs\n"
22208 " g = guestfs.GuestFS ()\n"
22209 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
22215 #: ../python/examples/guestfs-python.pod:16
22217 "This manual page documents how to call libguestfs from the Python "
22218 "programming language. This page just documents the differences from the C "
22219 "API and gives some examples. If you are not familiar with using libguestfs, "
22220 "you also need to read L<guestfs(3)>."
22224 #: ../python/examples/guestfs-python.pod:23
22226 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
22227 "single string argument which is the error message."
22231 #: ../python/examples/guestfs-python.pod:26
22232 msgid "MORE DOCUMENTATION"
22236 #: ../python/examples/guestfs-python.pod:28
22241 #: ../python/examples/guestfs-python.pod:30
22245 " >>> import guestfs\n"
22246 " >>> help (guestfs)\n"
22251 #: ../python/examples/guestfs-python.pod:44
22253 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22254 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
22255 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
22259 #: ../rescue/virt-rescue.pod:5
22260 msgid "virt-rescue - Run a rescue shell on a virtual machine"
22264 #: ../rescue/virt-rescue.pod:9
22267 " virt-rescue [--options] -d domname\n"
22272 #: ../rescue/virt-rescue.pod:11
22275 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
22280 #: ../rescue/virt-rescue.pod:15
22283 " virt-rescue [--options] domname\n"
22288 #: ../rescue/virt-rescue.pod:17
22291 " virt-rescue [--options] disk.img [disk.img ...]\n"
22296 #: ../rescue/virt-rescue.pod:21
22298 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
22299 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
22300 "you from doing this, but doesn't catch all cases."
22304 #: ../rescue/virt-rescue.pod:25
22306 "However if you use the I<--ro> (read only) option, then you can attach a "
22307 "shell to a live virtual machine. The results might be strange or "
22308 "inconsistent at times but you won't get disk corruption."
22312 #: ../rescue/virt-rescue.pod:31
22314 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
22315 "need for a CD. virt-rescue gives you a rescue shell and some simple "
22316 "recovery tools which you can use to examine or rescue a virtual machine or "
22321 #: ../rescue/virt-rescue.pod:36
22323 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
22324 "on disk image(s):"
22328 #: ../rescue/virt-rescue.pod:39
22331 " virt-rescue -d GuestName\n"
22336 #: ../rescue/virt-rescue.pod:41
22339 " virt-rescue --ro -a /path/to/disk.img\n"
22344 #: ../rescue/virt-rescue.pod:43
22347 " virt-rescue -a /dev/sdc\n"
22352 #: ../rescue/virt-rescue.pod:45
22353 msgid "For live VMs you I<must> use the --ro option."
22357 #: ../rescue/virt-rescue.pod:47
22359 "When you run virt-rescue on a virtual machine or disk image, you are placed "
22360 "in an interactive bash shell where you can use many ordinary Linux "
22361 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
22362 "appliance. You must mount the virtual machine's filesystems by hand. There "
22363 "is an empty directory called C</sysroot> where you can mount filesystems."
22367 #: ../rescue/virt-rescue.pod:54
22369 "In the example below, we list logical volumes, then choose one to mount "
22370 "under C</sysroot>:"
22374 #: ../rescue/virt-rescue.pod:57
22378 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
22379 " lv_root vg_f11x64 -wi-a- 8.83G\n"
22380 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
22381 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
22382 " ><rescue> ls /sysroot\n"
22387 #: ../rescue/virt-rescue.pod:64
22389 "If you don't know what filesystems are available on the virtual machine then "
22390 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
22394 #: ../rescue/virt-rescue.pod:70
22396 "Virt-rescue can be used on I<any> disk image file or device, not just a "
22397 "virtual machine. For example you can use it on a blank file if you want to "
22398 "partition that file (although we would recommend using L<guestfish(1)> "
22399 "instead as it is more suitable for this purpose). You can even use virt-"
22400 "rescue on things like SD cards."
22404 #: ../rescue/virt-rescue.pod:76
22406 "Virt-rescue does not require root. You only need to run it as root if you "
22407 "need root to open the disk image."
22411 #: ../rescue/virt-rescue.pod:79
22413 "This tool is just designed for quick interactive hacking on a virtual "
22414 "machine. For more structured access to a virtual machine disk image, you "
22415 "should use L<guestfs(3)>. To get a structured shell that you can use to "
22416 "make scripted changes to guests, use L<guestfish(1)>."
22420 #: ../rescue/virt-rescue.pod:103
22421 msgid "B<--append kernelopts>"
22425 #: ../rescue/virt-rescue.pod:105
22426 msgid "Pass additional options to the rescue kernel."
22430 #: ../rescue/virt-rescue.pod:135
22433 " virt-rescue --format=raw -a disk.img\n"
22438 #: ../rescue/virt-rescue.pod:139
22441 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
22446 #: ../rescue/virt-rescue.pod:148
22451 #: ../rescue/virt-rescue.pod:150
22452 msgid "B<--memsize MB>"
22456 #: ../rescue/virt-rescue.pod:152
22458 "Change the amount of memory allocated to the rescue system. The default is "
22459 "set by libguestfs and is small but adequate for running system tools. The "
22460 "occasional program might need more memory. The parameter is specified in "
22465 #: ../rescue/virt-rescue.pod:157
22466 msgid "B<--network>"
22470 #: ../rescue/virt-rescue.pod:159
22471 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
22475 #: ../rescue/virt-rescue.pod:165
22476 msgid "Open the image read-only."
22480 #: ../rescue/virt-rescue.pod:175
22482 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
22483 "SELINUX> before using this option."
22487 #: ../rescue/virt-rescue.pod:178
22492 #: ../rescue/virt-rescue.pod:180
22493 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
22497 #: ../rescue/virt-rescue.pod:198
22499 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
22500 "are done read-write."
22504 #: ../rescue/virt-rescue.pod:211
22505 msgid "Previous versions of virt-rescue allowed you to write either:"
22509 #: ../rescue/virt-rescue.pod:213
22512 " virt-rescue disk.img [disk.img ...]\n"
22517 #: ../rescue/virt-rescue.pod:217
22520 " virt-rescue guestname\n"
22525 #: ../rescue/virt-rescue.pod:225
22530 #: ../rescue/virt-rescue.pod:227
22532 "Adding the I<--network> option enables QEMU user networking in the rescue "
22533 "appliance. There are some differences between user networking and ordinary "
22538 #: ../rescue/virt-rescue.pod:233
22539 msgid "ping does not work"
22543 #: ../rescue/virt-rescue.pod:235
22545 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
22546 "send the ping packets, and because virt-rescue must be able to run as non-"
22547 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
22548 "The ping command will appear to resolve addresses but will not be able to "
22549 "send or receive any packets. This does not mean that the network is not "
22554 #: ../rescue/virt-rescue.pod:242
22555 msgid "cannot receive connections"
22559 #: ../rescue/virt-rescue.pod:244
22560 msgid "QEMU user networking cannot receive incoming connections."
22564 #: ../rescue/virt-rescue.pod:246
22565 msgid "making TCP connections"
22569 #: ../rescue/virt-rescue.pod:248
22571 "The virt-rescue appliance needs to be small and so does not include many "
22572 "network tools. In particular there is no L<telnet(1)> command. You can "
22573 "make TCP connections from the shell using the magical C</dev/tcp/"
22574 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
22578 #: ../rescue/virt-rescue.pod:253
22581 " exec 3<>/dev/tcp/redhat.com/80\n"
22582 " echo \"GET /\" >&3\n"
22588 #: ../rescue/virt-rescue.pod:257
22589 msgid "See L<bash(1)> for more details."
22593 #: ../rescue/virt-rescue.pod:263
22595 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
22596 "ENVIRONMENT VARIABLES> for the complete list."
22600 #: ../rescue/virt-rescue.pod:290
22602 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
22603 "libguestfs.org/>."
22607 #: ../resize/virt-resize.pod:5
22608 msgid "virt-resize - Resize a virtual machine disk"
22612 #: ../resize/virt-resize.pod:9
22615 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
22616 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
22617 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
22622 #: ../resize/virt-resize.pod:15
22624 "Virt-resize is a tool which can resize a virtual machine disk, making it "
22625 "larger or smaller overall, and resizing or deleting any partitions contained "
22630 #: ../resize/virt-resize.pod:19
22632 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
22633 "not> be used on live virtual machines - for consistent results, shut the "
22634 "virtual machine down before resizing it."
22638 #: ../resize/virt-resize.pod:23
22640 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
22641 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
22645 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:576
22646 #: ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469
22647 #: ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2675
22652 #: ../resize/virt-resize.pod:33
22654 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
22655 "fill the extra 5GB of space."
22659 #: ../resize/virt-resize.pod:36
22662 " virt-filesystems --long -h --all -a olddisk\n"
22667 #: ../resize/virt-resize.pod:38
22670 " truncate -r olddisk newdisk\n"
22671 " truncate -s +5G newdisk\n"
22676 #: ../resize/virt-resize.pod:41
22679 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
22680 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
22685 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:583
22686 #: ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475
22687 #: ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2700
22692 #: ../resize/virt-resize.pod:46
22694 "As above, but make the /boot partition 200MB bigger, while giving the "
22695 "remaining space to /dev/sda2:"
22699 #: ../resize/virt-resize.pod:49
22702 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22703 " olddisk newdisk\n"
22708 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:589
22709 #: ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486
22710 #: ../src/guestfs.pod:1436
22715 #: ../resize/virt-resize.pod:54
22717 "As in the first example, but expand a logical volume as the final step. "
22718 "This is what you would typically use for Linux guests that use LVM:"
22722 #: ../resize/virt-resize.pod:58
22725 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22726 " olddisk newdisk\n"
22731 #: ../resize/virt-resize.pod:61
22736 #: ../resize/virt-resize.pod:63
22738 "As in the first example, but the output format will be qcow2 instead of a "
22743 #: ../resize/virt-resize.pod:66
22746 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22747 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22752 #: ../resize/virt-resize.pod:71
22753 msgid "DETAILED USAGE"
22757 #: ../resize/virt-resize.pod:73
22758 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22762 #: ../resize/virt-resize.pod:77
22763 msgid "1. Shut down the virtual machine"
22767 #: ../resize/virt-resize.pod:79
22768 msgid "2. Locate input disk image"
22772 #: ../resize/virt-resize.pod:81
22774 "Locate the input disk image (ie. the file or device on the host containing "
22775 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22776 "dumpxml> like this to find the disk image name:"
22780 #: ../resize/virt-resize.pod:85
22783 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22784 " Found 1 nodes:\n"
22786 " <source dev=\"/dev/vg/lv_guest\" />\n"
22791 #: ../resize/virt-resize.pod:90
22792 msgid "3. Look at current sizing"
22796 #: ../resize/virt-resize.pod:92
22797 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22801 #: ../resize/virt-resize.pod:95
22804 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22805 " Name Type Size Parent\n"
22806 " /dev/sda1 partition 101M /dev/sda\n"
22807 " /dev/sda2 partition 7.9G /dev/sda\n"
22808 " /dev/sda device 8.0G -\n"
22813 #: ../resize/virt-resize.pod:101
22815 "(This example is a virtual machine with an 8 GB disk which we would like to "
22816 "expand up to 10 GB)."
22820 #: ../resize/virt-resize.pod:104
22821 msgid "4. Create output disk"
22825 #: ../resize/virt-resize.pod:106
22827 "Virt-resize cannot do in-place disk modifications. You have to have space "
22828 "to store the resized output disk."
22832 #: ../resize/virt-resize.pod:109
22834 "To store the resized disk image in a file, create a file of a suitable size:"
22838 #: ../resize/virt-resize.pod:112
22841 " # rm -f outdisk\n"
22842 " # truncate -s 10G outdisk\n"
22847 #: ../resize/virt-resize.pod:115
22848 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22852 #: ../resize/virt-resize.pod:117
22855 " # lvcreate -L 10G -n lv_name vg_name\n"
22860 #: ../resize/virt-resize.pod:119
22861 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22865 #: ../resize/virt-resize.pod:121
22868 " # virsh pool-list\n"
22869 " # virsh vol-create-as poolname newvol 10G\n"
22874 #: ../resize/virt-resize.pod:124
22879 #: ../resize/virt-resize.pod:126
22881 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22882 "file) and the output disk. The output disk is the one created in the "
22887 #: ../resize/virt-resize.pod:130
22890 " # virt-resize indisk outdisk\n"
22895 #: ../resize/virt-resize.pod:132
22897 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22898 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22899 "larger, then an extra, empty partition is created at the end of the disk "
22900 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22905 #: ../resize/virt-resize.pod:138
22907 "More realistically you'd want to expand existing partitions in the disk "
22908 "image by passing extra options (for the full list see the L</OPTIONS> "
22913 #: ../resize/virt-resize.pod:142
22915 "L</--expand> is the most useful option. It expands the named partition "
22916 "within the disk to fill any extra space:"
22920 #: ../resize/virt-resize.pod:145
22923 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22928 #: ../resize/virt-resize.pod:147
22930 "(In this case, an extra partition is I<not> created at the end of the disk, "
22931 "because there will be no unused space)."
22935 #: ../resize/virt-resize.pod:150
22937 "L</--resize> is the other commonly used option. The following would "
22938 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22939 "rest of the available space:"
22943 #: ../resize/virt-resize.pod:154
22946 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22947 " indisk outdisk\n"
22952 #: ../resize/virt-resize.pod:157
22954 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22955 "if virt-resize knows how, it will resize the contents, the equivalent of "
22956 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22957 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22958 "filesystems, so you would have to online resize them after booting the guest."
22962 #: ../resize/virt-resize.pod:164
22963 msgid "Other options are covered below."
22967 #: ../resize/virt-resize.pod:166
22972 #: ../resize/virt-resize.pod:168
22973 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22977 #: ../resize/virt-resize.pod:170
22978 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22982 #: ../resize/virt-resize.pod:172
22985 " # virsh edit guestname\n"
22990 #: ../resize/virt-resize.pod:174
22992 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
22993 "html#elementsDisks>"
22997 #: ../resize/virt-resize.pod:177
22998 msgid "Then start up the domain with the new, resized disk:"
23002 #: ../resize/virt-resize.pod:179
23005 " # virsh start guestname\n"
23010 #: ../resize/virt-resize.pod:181
23012 "and check that it still works. See also the L</NOTES> section below for "
23013 "additional information."
23017 #: ../resize/virt-resize.pod:184
23018 msgid "7. Resize LVs etc inside the guest"
23022 #: ../resize/virt-resize.pod:186
23023 msgid "(This can also be done offline using L<guestfish(1)>)"
23027 #: ../resize/virt-resize.pod:188
23029 "Once the guest has booted you should see the new space available, at least "
23030 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
23031 "may need to resize LVs inside PVs, and also resize filesystem types that "
23032 "virt-resize does not know how to expand."
23036 #: ../resize/virt-resize.pod:195
23037 msgid "SHRINKING A VIRTUAL MACHINE DISK"
23041 #: ../resize/virt-resize.pod:197
23043 "Shrinking is somewhat more complex than expanding, and only an overview is "
23048 #: ../resize/virt-resize.pod:200
23050 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
23051 "filesystems). The user has to shrink content before passing the disk image "
23052 "to virt-resize, and virt-resize will check that the content has been shrunk "
23057 #: ../resize/virt-resize.pod:205
23058 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
23062 #: ../resize/virt-resize.pod:207
23064 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
23065 "steps 3 and 4 above to allocate a new disk image."
23069 #: ../resize/virt-resize.pod:210
23071 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
23075 #: ../resize/virt-resize.pod:213
23076 msgid "IGNORING OR DELETING PARTITIONS"
23080 #: ../resize/virt-resize.pod:215
23082 "virt-resize also gives a convenient way to ignore or delete partitions when "
23083 "copying from the input disk to the output disk. Ignoring a partition speeds "
23084 "up the copy where you don't care about the existing contents of a "
23085 "partition. Deleting a partition removes it completely, but note that it "
23086 "also renumbers any partitions after the one which is deleted, which can "
23087 "leave some guests unbootable."
23091 #: ../resize/virt-resize.pod:222
23092 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
23096 #: ../resize/virt-resize.pod:224
23098 "If the input disk is in qcow2 format, then you may prefer that the output is "
23099 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
23100 "the fly. The output format is simply determined by the format of the empty "
23101 "output container that you provide. Thus to create qcow2 output, use:"
23105 #: ../resize/virt-resize.pod:230
23108 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
23113 #: ../resize/virt-resize.pod:232
23114 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
23118 #: ../resize/virt-resize.pod:234
23119 msgid "Similarly, to get non-sparse raw output use:"
23123 #: ../resize/virt-resize.pod:236
23126 " fallocate -l size outdisk\n"
23131 #: ../resize/virt-resize.pod:238
23133 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
23134 "dev/zero of=outdisk bs=1M count=..>)"
23138 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
23139 msgid "Display help."
23143 #: ../resize/virt-resize.pod:249
23144 msgid "B<--align-first auto>"
23148 #: ../resize/virt-resize.pod:251
23149 msgid "B<--align-first never>"
23153 #: ../resize/virt-resize.pod:253
23154 msgid "B<--align-first always>"
23158 #: ../resize/virt-resize.pod:255
23160 "Align the first partition for improved performance (see also the I<--"
23161 "alignment> option)."
23165 #: ../resize/virt-resize.pod:258
23167 "The default is I<--align-first auto> which only aligns the first partition "
23168 "if it is safe to do so. That is, only when we know how to fix the "
23169 "bootloader automatically, and at the moment that can only be done for "
23174 #: ../resize/virt-resize.pod:263
23176 "I<--align-first never> means we never move the first partition. This is the "
23177 "safest option. Try this if the guest does not boot after resizing."
23181 #: ../resize/virt-resize.pod:267
23183 "I<--align-first always> means we always align the first partition (if it "
23184 "needs to be aligned). For some guests this will break the bootloader, "
23185 "making the guest unbootable."
23189 #: ../resize/virt-resize.pod:271
23190 msgid "B<--alignment N>"
23194 #: ../resize/virt-resize.pod:273
23196 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
23197 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
23201 #: ../resize/virt-resize.pod:277
23203 "Assuming 512 byte sector size inside the guest, here are some suitable "
23208 #: ../resize/virt-resize.pod:282
23209 msgid "I<--alignment 1> (512 bytes)"
23213 #: ../resize/virt-resize.pod:284
23215 "The partitions would be packed together as closely as possible, but would be "
23216 "completely unaligned. In some cases this can cause very poor performance. "
23217 "See L<virt-alignment-scan(1)> for further details."
23221 #: ../resize/virt-resize.pod:288
23222 msgid "I<--alignment 8> (4K)"
23226 #: ../resize/virt-resize.pod:290
23228 "This would be the minimum acceptable alignment for reasonable performance on "
23233 #: ../resize/virt-resize.pod:293
23234 msgid "I<--alignment 128> (64K)"
23238 #: ../resize/virt-resize.pod:295
23240 "This alignment provides good performance when the host is using high end "
23245 #: ../resize/virt-resize.pod:298
23246 msgid "I<--alignment 2048> (1M)"
23250 #: ../resize/virt-resize.pod:300
23252 "This is the standard alignment used by all newly installed guests since "
23257 #: ../resize/virt-resize.pod:305
23262 #: ../resize/virt-resize.pod:307 ../tools/virt-make-fs.pl:177
23263 #: ../tools/virt-win-reg.pl:120
23268 #: ../resize/virt-resize.pod:309 ../tools/virt-win-reg.pl:122
23269 msgid "Enable debugging messages."
23273 #: ../resize/virt-resize.pod:311
23274 msgid "B<--delete part>"
23278 #: ../resize/virt-resize.pod:313
23280 "Delete the named partition. It would be more accurate to describe this as "
23281 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
23282 "the original disk image is left intact."
23286 #: ../resize/virt-resize.pod:317
23288 "Note that when you delete a partition, then anything contained in the "
23289 "partition is also deleted. Furthermore, this causes any partitions that "
23290 "come after to be I<renumbered>, which can easily make your guest unbootable."
23294 #: ../resize/virt-resize.pod:322 ../resize/virt-resize.pod:383
23295 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:145
23296 msgid "You can give this option multiple times."
23300 #: ../resize/virt-resize.pod:324
23301 msgid "B<--expand part>"
23305 #: ../resize/virt-resize.pod:326
23307 "Expand the named partition so it uses up all extra space (space left over "
23308 "after any other resize changes that you request have been done)."
23312 #: ../resize/virt-resize.pod:329
23314 "If virt-resize knows how, it will expand the direct content of the "
23315 "partition. For example, if the partition is an LVM PV, it will expand the "
23316 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
23317 "content it doesn't know about alone."
23321 #: ../resize/virt-resize.pod:334
23322 msgid "Currently virt-resize can resize:"
23326 #: ../resize/virt-resize.pod:340
23327 msgid "ext2, ext3 and ext4 filesystems."
23331 #: ../resize/virt-resize.pod:344
23332 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
23336 #: ../resize/virt-resize.pod:346
23338 "The filesystem must have been shut down consistently last time it was used. "
23339 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
23340 "consistency check, so at the first boot after resizing Windows will check "
23345 #: ../resize/virt-resize.pod:353
23347 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
23348 "inside the PV, but see the I<--LV-expand> option. The user could also "
23349 "resize LVs as desired after boot."
23353 #: ../resize/virt-resize.pod:359
23354 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
23358 #: ../resize/virt-resize.pod:363 ../resize/virt-resize.pod:538
23359 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
23363 #: ../resize/virt-resize.pod:365 ../sparsify/virt-sparsify.pod:125
23364 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92
23365 #: ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
23366 msgid "B<--format> raw"
23370 #: ../resize/virt-resize.pod:367 ../sparsify/virt-sparsify.pod:129
23372 "Specify the format of the input disk image. If this flag is not given then "
23373 "it is auto-detected from the image itself."
23377 #: ../resize/virt-resize.pod:373
23379 "Note that this option I<does not> affect the output format. See L</QCOW2 "
23380 "AND NON-SPARSE RAW FORMATS>."
23384 #: ../resize/virt-resize.pod:376
23385 msgid "B<--ignore part>"
23389 #: ../resize/virt-resize.pod:378
23391 "Ignore the named partition. Effectively this means the partition is "
23392 "allocated on the destination disk, but the content is not copied across from "
23393 "the source disk. The content of the partition will be blank (all zero "
23398 #: ../resize/virt-resize.pod:385
23399 msgid "B<--LV-expand logvol>"
23403 #: ../resize/virt-resize.pod:387
23405 "This takes the logical volume and, as a final step, expands it to fill all "
23406 "the space available in its volume group. A typical usage, assuming a Linux "
23407 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
23408 "lv_root> would be:"
23412 #: ../resize/virt-resize.pod:392
23415 " virt-resize indisk outdisk \\\n"
23416 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
23421 #: ../resize/virt-resize.pod:395
23423 "This would first expand the partition (and PV), and then expand the root "
23424 "device to fill the extra space in the PV."
23428 #: ../resize/virt-resize.pod:398
23430 "The contents of the LV are also resized if virt-resize knows how to do "
23431 "that. You can stop virt-resize from trying to expand the content by using "
23432 "the option I<--no-expand-content>."
23436 #: ../resize/virt-resize.pod:402
23437 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
23441 #: ../resize/virt-resize.pod:404
23443 "You can give this option multiple times, I<but> it doesn't make sense to do "
23444 "this unless the logical volumes you specify are all in different volume "
23449 #: ../resize/virt-resize.pod:408 ../sparsify/virt-sparsify.pod:147
23450 msgid "B<--machine-readable>"
23454 #: ../resize/virt-resize.pod:410 ../sparsify/virt-sparsify.pod:149
23456 "This option is used to make the output more machine friendly when being "
23457 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
23461 #: ../resize/virt-resize.pod:416
23462 msgid "B<--dryrun>"
23466 #: ../resize/virt-resize.pod:418
23467 msgid "Print a summary of what would be done, but don't do anything."
23471 #: ../resize/virt-resize.pod:420
23472 msgid "B<--no-copy-boot-loader>"
23476 #: ../resize/virt-resize.pod:422
23478 "By default, virt-resize copies over some sectors at the start of the disk "
23479 "(up to the beginning of the first partition). Commonly these sectors "
23480 "contain the Master Boot Record (MBR) and the boot loader, and are required "
23481 "in order for the guest to boot correctly."
23485 #: ../resize/virt-resize.pod:427
23487 "If you specify this flag, then this initial copy is not done. You may need "
23488 "to reinstall the boot loader in this case."
23492 #: ../resize/virt-resize.pod:430
23493 msgid "B<--no-extra-partition>"
23497 #: ../resize/virt-resize.pod:432
23499 "By default, virt-resize creates an extra partition if there is any extra, "
23500 "unused space after all resizing has happened. Use this option to prevent "
23501 "the extra partition from being created. If you do this then the extra space "
23502 "will be inaccessible until you run fdisk, parted, or some other partitioning "
23503 "tool in the guest."
23507 #: ../resize/virt-resize.pod:438
23509 "Note that if the surplus space is smaller than 10 MB, no extra partition "
23514 #: ../resize/virt-resize.pod:441
23515 msgid "B<--no-expand-content>"
23519 #: ../resize/virt-resize.pod:443
23521 "By default, virt-resize will try to expand the direct contents of "
23522 "partitions, if it knows how (see I<--expand> option above)."
23526 #: ../resize/virt-resize.pod:446
23528 "If you give the I<--no-expand-content> option then virt-resize will not "
23533 #: ../resize/virt-resize.pod:449
23534 msgid "B<--ntfsresize-force>"
23538 #: ../resize/virt-resize.pod:451
23540 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
23541 "the NTFS disk is marked as needing a consistency check. You have to use "
23542 "this option if you want to resize a Windows guest multiple times without "
23543 "booting into Windows between each resize."
23547 #: ../resize/virt-resize.pod:457
23548 msgid "B<--output-format> raw"
23552 #: ../resize/virt-resize.pod:459
23554 "Specify the format of the output disk image. If this flag is not given then "
23555 "it is auto-detected from the image itself."
23559 #: ../resize/virt-resize.pod:465
23561 "Note that this option I<does not create> the output format. This option "
23562 "just tells libguestfs what it is so it doesn't try to guess it. You still "
23563 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
23564 "SPARSE RAW FORMATS>."
23568 #: ../resize/virt-resize.pod:474
23569 msgid "Don't print the summary."
23573 #: ../resize/virt-resize.pod:476
23574 msgid "B<--resize part=size>"
23578 #: ../resize/virt-resize.pod:478
23580 "Resize the named partition (expanding or shrinking it) so that it has the "
23585 #: ../resize/virt-resize.pod:481
23587 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
23588 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
23589 "size; or as a relative number or percentage. For example:"
23593 #: ../resize/virt-resize.pod:487
23596 " --resize /dev/sda2=10G\n"
23601 #: ../resize/virt-resize.pod:489
23604 " --resize /dev/sda4=90%\n"
23609 #: ../resize/virt-resize.pod:491
23612 " --resize /dev/sda2=+1G\n"
23617 #: ../resize/virt-resize.pod:493
23620 " --resize /dev/sda2=-200M\n"
23625 #: ../resize/virt-resize.pod:495
23628 " --resize /dev/sda1=+128K\n"
23633 #: ../resize/virt-resize.pod:497
23636 " --resize /dev/sda1=+10%\n"
23641 #: ../resize/virt-resize.pod:499
23644 " --resize /dev/sda1=-10%\n"
23649 #: ../resize/virt-resize.pod:501
23651 "You can increase the size of any partition. Virt-resize will expand the "
23652 "direct content of the partition if it knows how (see I<--expand> below)."
23656 #: ../resize/virt-resize.pod:505
23658 "You can only I<decrease> the size of partitions that contain filesystems or "
23659 "PVs which have already been shrunk. Virt-resize will check this has been "
23660 "done before proceeding, or else will print an error (see also I<--resize-"
23665 #: ../resize/virt-resize.pod:512
23666 msgid "B<--resize-force part=size>"
23670 #: ../resize/virt-resize.pod:514
23672 "This is the same as I<--resize> except that it will let you decrease the "
23673 "size of any partition. Generally this means you will lose any data which "
23674 "was at the end of the partition you shrink, but you may not care about that "
23675 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
23676 "as a swap partition)."
23680 #: ../resize/virt-resize.pod:520
23681 msgid "See also the I<--ignore> option."
23685 #: ../resize/virt-resize.pod:522
23686 msgid "B<--shrink part>"
23690 #: ../resize/virt-resize.pod:524
23692 "Shrink the named partition until the overall disk image fits in the "
23693 "destination. The named partition B<must> contain a filesystem or PV which "
23694 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
23695 "online tools). Virt-resize will check this and give an error if it has not "
23700 #: ../resize/virt-resize.pod:530
23702 "The amount by which the overall disk must be shrunk (after carrying out all "
23703 "other operations requested by the user) is called the \"deficit\". For "
23704 "example, a straight copy (assume no other operations) from a 5GB disk image "
23705 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
23706 "would give an error unless the user specified a partition to shrink and that "
23707 "partition had more than a gigabyte of free space."
23711 #: ../resize/virt-resize.pod:548 ../sparsify/virt-sparsify.pod:177
23712 msgid "MACHINE READABLE OUTPUT"
23716 #: ../resize/virt-resize.pod:550
23718 "The I<--machine-readable> option can be used to make the output more machine "
23719 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23724 #: ../resize/virt-resize.pod:554 ../sparsify/virt-sparsify.pod:183
23725 msgid "There are two ways to use this option."
23729 #: ../resize/virt-resize.pod:556
23731 "Firstly use the option on its own to query the capabilities of the virt-"
23732 "resize binary. Typical output looks like this:"
23736 #: ../resize/virt-resize.pod:559
23739 " $ virt-resize --machine-readable\n"
23741 " ntfsresize-force\n"
23749 #: ../resize/virt-resize.pod:566 ../sparsify/virt-sparsify.pod:193
23751 "A list of features is printed, one per line, and the program exits with "
23756 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:196
23758 "Secondly use the option in conjunction with other options to make the "
23759 "regular program output more machine friendly."
23763 #: ../resize/virt-resize.pod:572 ../sparsify/virt-sparsify.pod:199
23764 msgid "At the moment this means:"
23768 #: ../resize/virt-resize.pod:578 ../sparsify/virt-sparsify.pod:205
23770 "Progress bar messages can be parsed from stdout by looking for this regular "
23775 #: ../resize/virt-resize.pod:581 ../sparsify/virt-sparsify.pod:208
23778 " ^[0-9]+/[0-9]+$\n"
23783 #: ../resize/virt-resize.pod:585 ../sparsify/virt-sparsify.pod:212
23785 "The calling program should treat messages sent to stdout (except for "
23786 "progress bar messages) as status messages. They can be logged and/or "
23787 "displayed to the user."
23791 #: ../resize/virt-resize.pod:591
23793 "The calling program should treat messages sent to stderr as error messages. "
23794 "In addition, virt-resize exits with a non-zero status code if there was a "
23799 #: ../resize/virt-resize.pod:597
23801 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
23802 "readable> option and will return an error."
23806 #: ../resize/virt-resize.pod:602
23807 msgid "\"Partition 1 does not end on cylinder boundary.\""
23811 #: ../resize/virt-resize.pod:604
23813 "Virt-resize aligns partitions to multiples of 128 sectors (see the I<--"
23814 "alignment> parameter). Usually this means the partitions will not be "
23815 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
23816 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
23817 "drives. Alignment of partitions to cylinders is not required by any modern "
23818 "operating system."
23822 #: ../resize/virt-resize.pod:611
23823 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23827 #: ../resize/virt-resize.pod:613
23829 "In Windows Vista and later versions, Microsoft switched to using a separate "
23830 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23831 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
23832 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
23833 "the second partition (ie. C: drive) should work."
23837 #: ../resize/virt-resize.pod:620
23839 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23840 "NTFS partitions have been expanded. This is just a safety check and (unless "
23841 "it find errors) is nothing to worry about."
23845 #: ../resize/virt-resize.pod:624
23846 msgid "GUEST BOOT STUCK AT \"GRUB\""
23850 #: ../resize/virt-resize.pod:626
23852 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23853 "printing C<GRUB> on the console, try reinstalling grub."
23857 #: ../resize/virt-resize.pod:629
23860 " guestfish -i -a newdisk\n"
23861 " ><fs> cat /boot/grub/device.map\n"
23862 " # check the contents of this file are sensible or\n"
23863 " # edit the file if necessary\n"
23864 " ><fs> grub-install / /dev/vda\n"
23870 #: ../resize/virt-resize.pod:636
23872 "For more flexible guest reconfiguration, including if you need to specify "
23873 "other parameters to grub-install, use L<virt-rescue(1)>."
23877 #: ../resize/virt-resize.pod:639
23878 msgid "ALTERNATIVE TOOLS"
23882 #: ../resize/virt-resize.pod:641
23884 "There are several proprietary tools for resizing partitions. We won't "
23885 "mention any here."
23889 #: ../resize/virt-resize.pod:644
23891 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23892 "operations on disk images. They can resize and move partitions, but I don't "
23893 "think they can do anything with the contents, and they certainly don't "
23898 #: ../resize/virt-resize.pod:649
23900 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23901 "but at a much lower level. You will probably end up hand-calculating sector "
23902 "offsets, which is something that virt-resize was designed to avoid. If you "
23903 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23908 #: ../resize/virt-resize.pod:669
23910 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
23911 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
23912 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
23913 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<virt-sparsify(1)>, "
23914 "L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
23918 #: ../ruby/examples/guestfs-ruby.pod:5
23919 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23923 #: ../ruby/examples/guestfs-ruby.pod:9
23926 " require 'guestfs'\n"
23927 " g = Guestfs::Guestfs.new()\n"
23928 " g.add_drive_opts(\"disk.img\",\n"
23929 " :readonly => 1, :format => \"raw\")\n"
23935 #: ../ruby/examples/guestfs-ruby.pod:17
23937 "This manual page documents how to call libguestfs from the Ruby programming "
23938 "language. This page just documents the differences from the C API and gives "
23939 "some examples. If you are not familiar with using libguestfs, you also need "
23940 "to read L<guestfs(3)>."
23944 #: ../ruby/examples/guestfs-ruby.pod:24
23946 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23947 "This has a single parameter which is the error message (a string)."
23951 #: ../ruby/examples/guestfs-ruby.pod:38
23953 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
23954 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
23955 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23959 #: ../sparsify/virt-sparsify.pod:5
23960 msgid "virt-sparsify - Make a virtual machine disk sparse"
23964 #: ../sparsify/virt-sparsify.pod:9
23967 " virt-sparsify [--options] indisk outdisk\n"
23972 #: ../sparsify/virt-sparsify.pod:13
23974 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23975 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23976 "the disk image can be converted back to free space on the host."
23980 #: ../sparsify/virt-sparsify.pod:18
23982 "Virt-sparsify can locate and sparsify free space in most filesystems (eg. "
23983 "ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23987 #: ../sparsify/virt-sparsify.pod:21
23989 "Virt-sparsify can also convert between some disk formats, for example "
23990 "converting a raw disk image to a thin-provisioned qcow2 image."
23994 #: ../sparsify/virt-sparsify.pod:24
23996 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23997 "machines. If a virtual machine has more than one attached disk, you must "
23998 "sparsify each one separately."
24002 #: ../sparsify/virt-sparsify.pod:28
24003 msgid "IMPORTANT LIMITATIONS"
24007 #: ../sparsify/virt-sparsify.pod:34
24009 "Virt-sparsify does not do in-place modifications. It copies from a source "
24010 "image to a destination image, leaving the source unchanged. I<Check that "
24011 "the sparsification was successful before deleting the source image>."
24015 #: ../sparsify/virt-sparsify.pod:41
24016 msgid "The virtual machine I<must be shut down> before using this tool."
24020 #: ../sparsify/virt-sparsify.pod:45
24022 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
24023 "(1 temporary copy + 1 destination image). This is in the worst case and "
24024 "usually much less space is required."
24028 #: ../sparsify/virt-sparsify.pod:51
24030 "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
24034 #: ../sparsify/virt-sparsify.pod:56
24035 msgid "Virt-sparsify cannot handle encrypted disks."
24039 #: ../sparsify/virt-sparsify.pod:60
24041 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
24042 "this space is often used for critical items like bootloaders so it's not "
24047 #: ../sparsify/virt-sparsify.pod:66
24049 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
24050 "to do this unless we can be sure there is no hibernation data, so at the "
24051 "moment swap partitions are ignored."
24055 #: ../sparsify/virt-sparsify.pod:72
24057 "You may also want to read the manual pages for the associated tools L<virt-"
24058 "filesystems(1)> and L<virt-df(1)> before starting."
24062 #: ../sparsify/virt-sparsify.pod:77
24063 msgid "Typical usage is:"
24067 #: ../sparsify/virt-sparsify.pod:79
24070 " virt-sparsify indisk outdisk\n"
24075 #: ../sparsify/virt-sparsify.pod:81
24077 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
24078 "is created, or overwritten if it already exists. The format of the input "
24079 "disk is detected (eg. qcow2) and the same format is used for the output disk."
24083 #: ../sparsify/virt-sparsify.pod:86
24084 msgid "To convert between formats, use the I<--convert> option:"
24088 #: ../sparsify/virt-sparsify.pod:88
24091 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
24096 #: ../sparsify/virt-sparsify.pod:90
24098 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
24099 "can find within the source disk image. You can get it to ignore (don't zero "
24100 "free space on) certain filesystems by doing:"
24104 #: ../sparsify/virt-sparsify.pod:94
24107 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
24112 #: ../sparsify/virt-sparsify.pod:96
24114 "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
24118 #: ../sparsify/virt-sparsify.pod:107
24119 msgid "B<--convert> raw"
24123 #: ../sparsify/virt-sparsify.pod:109
24124 msgid "B<--convert> qcow2"
24128 #: ../sparsify/virt-sparsify.pod:111
24129 msgid "B<--convert> [other formats]"
24133 #: ../sparsify/virt-sparsify.pod:113
24135 "Use C<output-format> as the format for the destination image. If this is "
24136 "not specified, then the input format is used."
24140 #: ../sparsify/virt-sparsify.pod:116
24141 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
24145 #: ../sparsify/virt-sparsify.pod:118
24147 "You can also use any format supported by the L<qemu-img(1)> program, eg. "
24148 "C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
24152 #: ../sparsify/virt-sparsify.pod:122
24154 "Specifying the I<--convert> option is usually a good idea, because then virt-"
24155 "sparsify doesn't need to try to guess the input format."
24159 #: ../sparsify/virt-sparsify.pod:127
24160 msgid "B<--format> qcow2"
24164 #: ../sparsify/virt-sparsify.pod:135
24165 msgid "B<--ignore> filesystem"
24169 #: ../sparsify/virt-sparsify.pod:137
24170 msgid "B<--ignore> volgroup"
24174 #: ../sparsify/virt-sparsify.pod:139
24176 "Ignore the named filesystem. Free space on the filesystem will not be "
24177 "zeroed, but existing blocks of zeroes will still be sparsified."
24181 #: ../sparsify/virt-sparsify.pod:142
24183 "In the second form, this ignores the named volume group. Use the volume "
24184 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
24188 #: ../sparsify/virt-sparsify.pod:157
24189 msgid "This disables progress bars and other unnecessary output."
24193 #: ../sparsify/virt-sparsify.pod:179
24195 "The I<--machine-readable> option can be used to make the output more machine "
24196 "friendly, which is useful when calling virt-sparsify from other programs, "
24201 #: ../sparsify/virt-sparsify.pod:185
24203 "Firstly use the option on its own to query the capabilities of the virt-"
24204 "sparsify binary. Typical output looks like this:"
24208 #: ../sparsify/virt-sparsify.pod:188
24211 " $ virt-sparsify --machine-readable\n"
24219 #: ../sparsify/virt-sparsify.pod:218
24221 "The calling program should treat messages sent to stderr as error messages. "
24222 "In addition, virt-sparsify exits with a non-zero status code if there was a "
24227 #: ../sparsify/virt-sparsify.pod:224
24229 "All versions of virt-sparsify have supported the I<--machine-readable> "
24234 #: ../sparsify/virt-sparsify.pod:238
24236 "Location of the temporary directory used for the potentially large temporary "
24241 #: ../sparsify/virt-sparsify.pod:241
24243 "You should ensure there is enough free space in the worst case for a full "
24244 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
24245 "to another directory that has enough space."
24249 #: ../sparsify/virt-sparsify.pod:245
24250 msgid "This defaults to C</tmp>."
24254 #: ../sparsify/virt-sparsify.pod:249
24256 "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
24260 #: ../sparsify/virt-sparsify.pod:253
24262 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
24263 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, L<qemu-img"
24264 "(1)>, L<http://libguestfs.org/>."
24268 #: ../src/guestfs-actions.pod:1
24269 msgid "guestfs_add_cdrom"
24273 #: ../src/guestfs-actions.pod:3
24277 " guestfs_add_cdrom (guestfs_h *g,\n"
24278 " const char *filename);\n"
24283 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:255
24284 #: ../src/guestfs-actions.pod:276
24286 "I<This function is deprecated.> In new code, use the L</"
24287 "guestfs_add_drive_opts> call instead."
24291 #: ../src/guestfs-actions.pod:24
24293 "This call checks for the existence of C<filename>. This stops you from "
24294 "specifying other types of drive which are supported by qemu such as C<nbd:> "
24295 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
24300 #: ../src/guestfs-actions.pod:31
24302 "If you just want to add an ISO file (often you use this as an efficient way "
24303 "to transfer large files into the guest), then you should probably use "
24304 "C<guestfs_add_drive_ro> instead."
24308 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
24309 #: ../src/guestfs-actions.pod:207 ../src/guestfs-actions.pod:244
24310 #: ../src/guestfs-actions.pod:265 ../src/guestfs-actions.pod:286
24311 #: ../src/guestfs-actions.pod:299 ../src/guestfs-actions.pod:313
24312 #: ../src/guestfs-actions.pod:433 ../src/guestfs-actions.pod:453
24313 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:512
24314 #: ../src/guestfs-actions.pod:540 ../src/guestfs-actions.pod:558
24315 #: ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:658
24316 #: ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:687
24317 #: ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:804
24318 #: ../src/guestfs-actions.pod:818 ../src/guestfs-actions.pod:832
24319 #: ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:1052
24320 #: ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1090
24321 #: ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1239
24322 #: ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1303
24323 #: ../src/guestfs-actions.pod:1322 ../src/guestfs-actions.pod:1336
24324 #: ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1426
24325 #: ../src/guestfs-actions.pod:1457 ../src/guestfs-actions.pod:1482
24326 #: ../src/guestfs-actions.pod:1524 ../src/guestfs-actions.pod:1637
24327 #: ../src/guestfs-actions.pod:1664 ../src/guestfs-actions.pod:1879
24328 #: ../src/guestfs-actions.pod:1901 ../src/guestfs-actions.pod:1988
24329 #: ../src/guestfs-actions.pod:2496 ../src/guestfs-actions.pod:2640
24330 #: ../src/guestfs-actions.pod:2701 ../src/guestfs-actions.pod:2736
24331 #: ../src/guestfs-actions.pod:3793 ../src/guestfs-actions.pod:3808
24332 #: ../src/guestfs-actions.pod:3833 ../src/guestfs-actions.pod:4022
24333 #: ../src/guestfs-actions.pod:4036 ../src/guestfs-actions.pod:4049
24334 #: ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4078
24335 #: ../src/guestfs-actions.pod:4114 ../src/guestfs-actions.pod:4186
24336 #: ../src/guestfs-actions.pod:4206 ../src/guestfs-actions.pod:4223
24337 #: ../src/guestfs-actions.pod:4246 ../src/guestfs-actions.pod:4269
24338 #: ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:4323
24339 #: ../src/guestfs-actions.pod:4342 ../src/guestfs-actions.pod:4377
24340 #: ../src/guestfs-actions.pod:4389 ../src/guestfs-actions.pod:4425
24341 #: ../src/guestfs-actions.pod:4441 ../src/guestfs-actions.pod:4454
24342 #: ../src/guestfs-actions.pod:4469 ../src/guestfs-actions.pod:4486
24343 #: ../src/guestfs-actions.pod:4579 ../src/guestfs-actions.pod:4599
24344 #: ../src/guestfs-actions.pod:4612 ../src/guestfs-actions.pod:4663
24345 #: ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4699
24346 #: ../src/guestfs-actions.pod:4715 ../src/guestfs-actions.pod:4729
24347 #: ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:4760
24348 #: ../src/guestfs-actions.pod:4775 ../src/guestfs-actions.pod:4802
24349 #: ../src/guestfs-actions.pod:4865 ../src/guestfs-actions.pod:4938
24350 #: ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:4988
24351 #: ../src/guestfs-actions.pod:5007 ../src/guestfs-actions.pod:5019
24352 #: ../src/guestfs-actions.pod:5036 ../src/guestfs-actions.pod:5049
24353 #: ../src/guestfs-actions.pod:5064 ../src/guestfs-actions.pod:5079
24354 #: ../src/guestfs-actions.pod:5111 ../src/guestfs-actions.pod:5137
24355 #: ../src/guestfs-actions.pod:5176 ../src/guestfs-actions.pod:5196
24356 #: ../src/guestfs-actions.pod:5210 ../src/guestfs-actions.pod:5227
24357 #: ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5329
24358 #: ../src/guestfs-actions.pod:5376 ../src/guestfs-actions.pod:5419
24359 #: ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5464
24360 #: ../src/guestfs-actions.pod:5482 ../src/guestfs-actions.pod:5622
24361 #: ../src/guestfs-actions.pod:5679 ../src/guestfs-actions.pod:5701
24362 #: ../src/guestfs-actions.pod:5719 ../src/guestfs-actions.pod:5751
24363 #: ../src/guestfs-actions.pod:5817 ../src/guestfs-actions.pod:5834
24364 #: ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:5861
24365 #: ../src/guestfs-actions.pod:6150 ../src/guestfs-actions.pod:6169
24366 #: ../src/guestfs-actions.pod:6188 ../src/guestfs-actions.pod:6202
24367 #: ../src/guestfs-actions.pod:6214 ../src/guestfs-actions.pod:6228
24368 #: ../src/guestfs-actions.pod:6240 ../src/guestfs-actions.pod:6254
24369 #: ../src/guestfs-actions.pod:6270 ../src/guestfs-actions.pod:6291
24370 #: ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6329
24371 #: ../src/guestfs-actions.pod:6359 ../src/guestfs-actions.pod:6377
24372 #: ../src/guestfs-actions.pod:6400 ../src/guestfs-actions.pod:6418
24373 #: ../src/guestfs-actions.pod:6437 ../src/guestfs-actions.pod:6458
24374 #: ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6494
24375 #: ../src/guestfs-actions.pod:6513 ../src/guestfs-actions.pod:6541
24376 #: ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6584
24377 #: ../src/guestfs-actions.pod:6600 ../src/guestfs-actions.pod:6624
24378 #: ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6658
24379 #: ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6721
24380 #: ../src/guestfs-actions.pod:6751 ../src/guestfs-actions.pod:6784
24381 #: ../src/guestfs-actions.pod:6899 ../src/guestfs-actions.pod:7020
24382 #: ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7045
24383 #: ../src/guestfs-actions.pod:7058 ../src/guestfs-actions.pod:7080
24384 #: ../src/guestfs-actions.pod:7093 ../src/guestfs-actions.pod:7106
24385 #: ../src/guestfs-actions.pod:7119 ../src/guestfs-actions.pod:7134
24386 #: ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7210
24387 #: ../src/guestfs-actions.pod:7226 ../src/guestfs-actions.pod:7242
24388 #: ../src/guestfs-actions.pod:7259 ../src/guestfs-actions.pod:7272
24389 #: ../src/guestfs-actions.pod:7292 ../src/guestfs-actions.pod:7328
24390 #: ../src/guestfs-actions.pod:7342 ../src/guestfs-actions.pod:7383
24391 #: ../src/guestfs-actions.pod:7396 ../src/guestfs-actions.pod:7414
24392 #: ../src/guestfs-actions.pod:7448 ../src/guestfs-actions.pod:7484
24393 #: ../src/guestfs-actions.pod:7600 ../src/guestfs-actions.pod:7615
24394 #: ../src/guestfs-actions.pod:7629 ../src/guestfs-actions.pod:7684
24395 #: ../src/guestfs-actions.pod:7697 ../src/guestfs-actions.pod:7742
24396 #: ../src/guestfs-actions.pod:7782 ../src/guestfs-actions.pod:7838
24397 #: ../src/guestfs-actions.pod:7858 ../src/guestfs-actions.pod:7891
24398 #: ../src/guestfs-actions.pod:7955 ../src/guestfs-actions.pod:7978
24399 #: ../src/guestfs-actions.pod:8007
24400 msgid "This function returns 0 on success or -1 on error."
24404 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
24405 #: ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:2102
24406 #: ../src/guestfs-actions.pod:2200 ../src/guestfs-actions.pod:2325
24407 #: ../src/guestfs-actions.pod:3795 ../src/guestfs-actions.pod:3815
24408 #: ../src/guestfs-actions.pod:5113 ../src/guestfs-actions.pod:6379
24409 #: ../src/guestfs-actions.pod:6496 ../src/guestfs-actions.pod:6645
24410 #: ../src/guestfs-actions.pod:7136 ../src/guestfs-actions.pod:7261
24411 #: ../src/guestfs-actions.pod:7784
24412 msgid "(Added in 0.3)"
24416 #: ../src/guestfs-actions.pod:41
24417 msgid "guestfs_add_domain"
24421 #: ../src/guestfs-actions.pod:43
24425 " guestfs_add_domain (guestfs_h *g,\n"
24426 " const char *dom,\n"
24432 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
24433 #: ../src/guestfs-actions.pod:843 ../src/guestfs-actions.pod:1167
24434 #: ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:2993
24435 #: ../src/guestfs-actions.pod:4814 ../src/guestfs-actions.pod:5123
24436 #: ../src/guestfs-actions.pod:5340
24438 "You may supply a list of optional arguments to this call. Use zero or more "
24439 "of the following pairs of parameters, and terminate the list with C<-1> on "
24440 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
24444 #: ../src/guestfs-actions.pod:53
24447 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
24448 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
24449 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
24450 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
24451 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
24456 #: ../src/guestfs-actions.pod:59
24458 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
24459 "It works by connecting to libvirt, requesting the domain and domain XML from "
24460 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
24465 #: ../src/guestfs-actions.pod:94
24467 "The other optional parameters are passed directly through to "
24468 "C<guestfs_add_drive_opts>."
24472 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:356
24473 #: ../src/guestfs-actions.pod:526 ../src/guestfs-actions.pod:704
24474 #: ../src/guestfs-actions.pod:735 ../src/guestfs-actions.pod:753
24475 #: ../src/guestfs-actions.pod:772 ../src/guestfs-actions.pod:1502
24476 #: ../src/guestfs-actions.pod:1858 ../src/guestfs-actions.pod:2061
24477 #: ../src/guestfs-actions.pod:2172 ../src/guestfs-actions.pod:2223
24478 #: ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:2289
24479 #: ../src/guestfs-actions.pod:2312 ../src/guestfs-actions.pod:2627
24480 #: ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3129
24481 #: ../src/guestfs-actions.pod:5299 ../src/guestfs-actions.pod:5519
24482 #: ../src/guestfs-actions.pod:5931 ../src/guestfs-actions.pod:5957
24483 #: ../src/guestfs-actions.pod:7369 ../src/guestfs-actions.pod:7795
24484 #: ../src/guestfs-actions.pod:7808 ../src/guestfs-actions.pod:7821
24485 msgid "On error this function returns -1."
24489 #: ../src/guestfs-actions.pod:99
24490 msgid "(Added in 1.7.4)"
24494 #: ../src/guestfs-actions.pod:101
24495 msgid "guestfs_add_domain_va"
24499 #: ../src/guestfs-actions.pod:103
24503 " guestfs_add_domain_va (guestfs_h *g,\n"
24504 " const char *dom,\n"
24505 " va_list args);\n"
24510 #: ../src/guestfs-actions.pod:108
24511 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
24515 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
24516 #: ../src/guestfs-actions.pod:220 ../src/guestfs-actions.pod:231
24517 #: ../src/guestfs-actions.pod:882 ../src/guestfs-actions.pod:893
24518 #: ../src/guestfs-actions.pod:1195 ../src/guestfs-actions.pod:1208
24519 #: ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1267
24520 #: ../src/guestfs-actions.pod:3077 ../src/guestfs-actions.pod:3089
24521 #: ../src/guestfs-actions.pod:4879 ../src/guestfs-actions.pod:4891
24522 #: ../src/guestfs-actions.pod:5151 ../src/guestfs-actions.pod:5163
24523 #: ../src/guestfs-actions.pod:5389 ../src/guestfs-actions.pod:5400
24524 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
24528 #: ../src/guestfs-actions.pod:112
24529 msgid "guestfs_add_domain_argv"
24533 #: ../src/guestfs-actions.pod:114
24537 " guestfs_add_domain_argv (guestfs_h *g,\n"
24538 " const char *dom,\n"
24539 " const struct guestfs_add_domain_argv *optargs);\n"
24544 #: ../src/guestfs-actions.pod:119
24545 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
24549 #: ../src/guestfs-actions.pod:123
24550 msgid "guestfs_add_drive"
24554 #: ../src/guestfs-actions.pod:125
24558 " guestfs_add_drive (guestfs_h *g,\n"
24559 " const char *filename);\n"
24564 #: ../src/guestfs-actions.pod:129
24566 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
24567 "optional parameters, so the disk is added writable, with the format being "
24568 "detected automatically."
24572 #: ../src/guestfs-actions.pod:133
24574 "Automatic detection of the format opens you up to a potential security hole "
24575 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24576 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24577 "you should think about replacing calls to this function with calls to "
24578 "C<guestfs_add_drive_opts>, and specifying the format."
24582 #: ../src/guestfs-actions.pod:144
24583 msgid "guestfs_add_drive_opts"
24587 #: ../src/guestfs-actions.pod:146
24591 " guestfs_add_drive_opts (guestfs_h *g,\n"
24592 " const char *filename,\n"
24598 #: ../src/guestfs-actions.pod:156
24601 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
24602 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
24603 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
24604 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
24609 #: ../src/guestfs-actions.pod:186
24611 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
24612 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
24613 "Possible formats include C<raw> and C<qcow2>."
24617 #: ../src/guestfs-actions.pod:197
24619 "This rarely-used option lets you emulate the behaviour of the deprecated "
24620 "C<guestfs_add_drive_with_if> call (q.v.)"
24624 #: ../src/guestfs-actions.pod:209
24625 msgid "(Added in 1.5.23)"
24629 #: ../src/guestfs-actions.pod:211
24630 msgid "guestfs_add_drive_opts_va"
24634 #: ../src/guestfs-actions.pod:213
24638 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
24639 " const char *filename,\n"
24640 " va_list args);\n"
24645 #: ../src/guestfs-actions.pod:218
24646 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
24650 #: ../src/guestfs-actions.pod:222
24651 msgid "guestfs_add_drive_opts_argv"
24655 #: ../src/guestfs-actions.pod:224
24659 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
24660 " const char *filename,\n"
24661 " const struct guestfs_add_drive_opts_argv *optargs);\n"
24666 #: ../src/guestfs-actions.pod:229
24667 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
24671 #: ../src/guestfs-actions.pod:233
24672 msgid "guestfs_add_drive_ro"
24676 #: ../src/guestfs-actions.pod:235
24680 " guestfs_add_drive_ro (guestfs_h *g,\n"
24681 " const char *filename);\n"
24686 #: ../src/guestfs-actions.pod:239
24688 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
24689 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
24690 "disk is added read-only, with the format being detected automatically."
24694 #: ../src/guestfs-actions.pod:246
24695 msgid "(Added in 1.0.38)"
24699 #: ../src/guestfs-actions.pod:248
24700 msgid "guestfs_add_drive_ro_with_if"
24704 #: ../src/guestfs-actions.pod:250
24708 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
24709 " const char *filename,\n"
24710 " const char *iface);\n"
24715 #: ../src/guestfs-actions.pod:262
24717 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
24718 "QEMU interface emulation to use at run time."
24722 #: ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:288
24723 #: ../src/guestfs-actions.pod:2586
24724 msgid "(Added in 1.0.84)"
24728 #: ../src/guestfs-actions.pod:269
24729 msgid "guestfs_add_drive_with_if"
24733 #: ../src/guestfs-actions.pod:271
24737 " guestfs_add_drive_with_if (guestfs_h *g,\n"
24738 " const char *filename,\n"
24739 " const char *iface);\n"
24744 #: ../src/guestfs-actions.pod:283
24746 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
24747 "QEMU interface emulation to use at run time."
24751 #: ../src/guestfs-actions.pod:290
24752 msgid "guestfs_aug_clear"
24756 #: ../src/guestfs-actions.pod:292
24760 " guestfs_aug_clear (guestfs_h *g,\n"
24761 " const char *augpath);\n"
24766 #: ../src/guestfs-actions.pod:301 ../src/guestfs-actions.pod:2314
24767 msgid "(Added in 1.3.4)"
24771 #: ../src/guestfs-actions.pod:303
24772 msgid "guestfs_aug_close"
24776 #: ../src/guestfs-actions.pod:305
24780 " guestfs_aug_close (guestfs_h *g);\n"
24785 #: ../src/guestfs-actions.pod:308
24787 "Close the current Augeas handle and free up any resources used by it. After "
24788 "calling this, you have to call C<guestfs_aug_init> again before you can use "
24789 "any other Augeas functions."
24793 #: ../src/guestfs-actions.pod:315 ../src/guestfs-actions.pod:340
24794 #: ../src/guestfs-actions.pod:358 ../src/guestfs-actions.pod:372
24795 #: ../src/guestfs-actions.pod:435 ../src/guestfs-actions.pod:455
24796 #: ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:500
24797 #: ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:528
24798 #: ../src/guestfs-actions.pod:542 ../src/guestfs-actions.pod:560
24799 #: ../src/guestfs-actions.pod:6008
24800 msgid "(Added in 0.7)"
24804 #: ../src/guestfs-actions.pod:317
24805 msgid "guestfs_aug_defnode"
24809 #: ../src/guestfs-actions.pod:319
24812 " struct guestfs_int_bool *\n"
24813 " guestfs_aug_defnode (guestfs_h *g,\n"
24814 " const char *name,\n"
24815 " const char *expr,\n"
24816 " const char *val);\n"
24821 #: ../src/guestfs-actions.pod:328
24823 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24824 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
24825 "containing that single node."
24829 #: ../src/guestfs-actions.pod:336
24831 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
24832 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
24836 #: ../src/guestfs-actions.pod:342
24837 msgid "guestfs_aug_defvar"
24841 #: ../src/guestfs-actions.pod:344
24845 " guestfs_aug_defvar (guestfs_h *g,\n"
24846 " const char *name,\n"
24847 " const char *expr);\n"
24852 #: ../src/guestfs-actions.pod:360
24853 msgid "guestfs_aug_get"
24857 #: ../src/guestfs-actions.pod:362
24861 " guestfs_aug_get (guestfs_h *g,\n"
24862 " const char *augpath);\n"
24867 #: ../src/guestfs-actions.pod:369 ../src/guestfs-actions.pod:933
24868 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1011
24869 #: ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1130
24870 #: ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1388
24871 #: ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1541
24872 #: ../src/guestfs-actions.pod:1729 ../src/guestfs-actions.pod:1841
24873 #: ../src/guestfs-actions.pod:2004 ../src/guestfs-actions.pod:2021
24874 #: ../src/guestfs-actions.pod:2088 ../src/guestfs-actions.pod:2131
24875 #: ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:2337
24876 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2755
24877 #: ../src/guestfs-actions.pod:2857 ../src/guestfs-actions.pod:2961
24878 #: ../src/guestfs-actions.pod:2980 ../src/guestfs-actions.pod:3195
24879 #: ../src/guestfs-actions.pod:3223 ../src/guestfs-actions.pod:3244
24880 #: ../src/guestfs-actions.pod:3278 ../src/guestfs-actions.pod:3341
24881 #: ../src/guestfs-actions.pod:3361 ../src/guestfs-actions.pod:3381
24882 #: ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4361
24883 #: ../src/guestfs-actions.pod:4531 ../src/guestfs-actions.pod:4641
24884 #: ../src/guestfs-actions.pod:5537 ../src/guestfs-actions.pod:5736
24885 #: ../src/guestfs-actions.pod:5906 ../src/guestfs-actions.pod:6084
24886 #: ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6805
24887 #: ../src/guestfs-actions.pod:6821 ../src/guestfs-actions.pod:6845
24888 #: ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:7543
24889 #: ../src/guestfs-actions.pod:7562 ../src/guestfs-actions.pod:7580
24890 #: ../src/guestfs-actions.pod:7754 ../src/guestfs-actions.pod:8071
24892 "This function returns a string, or NULL on error. I<The caller must free "
24893 "the returned string after use>."
24897 #: ../src/guestfs-actions.pod:374
24898 msgid "guestfs_aug_init"
24902 #: ../src/guestfs-actions.pod:376
24906 " guestfs_aug_init (guestfs_h *g,\n"
24907 " const char *root,\n"
24913 #: ../src/guestfs-actions.pod:385
24914 msgid "You must call this before using any other C<guestfs_aug_*> commands."
24918 #: ../src/guestfs-actions.pod:410
24920 "This option is only useful when debugging Augeas lenses. Use of this option "
24921 "may require additional memory for the libguestfs appliance. You may need to "
24922 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
24923 "C<guestfs_set_memsize>."
24927 #: ../src/guestfs-actions.pod:425
24928 msgid "Do not load the tree in C<guestfs_aug_init>."
24932 #: ../src/guestfs-actions.pod:429
24933 msgid "To close the handle, you can call C<guestfs_aug_close>."
24937 #: ../src/guestfs-actions.pod:437
24938 msgid "guestfs_aug_insert"
24942 #: ../src/guestfs-actions.pod:439
24946 " guestfs_aug_insert (guestfs_h *g,\n"
24947 " const char *augpath,\n"
24948 " const char *label,\n"
24954 #: ../src/guestfs-actions.pod:457
24955 msgid "guestfs_aug_load"
24959 #: ../src/guestfs-actions.pod:459
24963 " guestfs_aug_load (guestfs_h *g);\n"
24968 #: ../src/guestfs-actions.pod:471
24969 msgid "guestfs_aug_ls"
24973 #: ../src/guestfs-actions.pod:473
24977 " guestfs_aug_ls (guestfs_h *g,\n"
24978 " const char *augpath);\n"
24983 #: ../src/guestfs-actions.pod:477
24985 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24986 "sorting the resulting nodes into alphabetical order."
24990 #: ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:496
24991 #: ../src/guestfs-actions.pod:642 ../src/guestfs-actions.pod:1149
24992 #: ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1575
24993 #: ../src/guestfs-actions.pod:1678 ../src/guestfs-actions.pod:1697
24994 #: ../src/guestfs-actions.pod:1943 ../src/guestfs-actions.pod:2409
24995 #: ../src/guestfs-actions.pod:2425 ../src/guestfs-actions.pod:2444
24996 #: ../src/guestfs-actions.pod:2509 ../src/guestfs-actions.pod:2533
24997 #: ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2653
24998 #: ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:3297
24999 #: ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3891
25000 #: ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3928
25001 #: ../src/guestfs-actions.pod:3990 ../src/guestfs-actions.pod:4095
25002 #: ../src/guestfs-actions.pod:4503 ../src/guestfs-actions.pod:5260
25003 #: ../src/guestfs-actions.pod:5878 ../src/guestfs-actions.pod:6004
25004 #: ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6885
25005 #: ../src/guestfs-actions.pod:6946 ../src/guestfs-actions.pod:7001
25006 #: ../src/guestfs-actions.pod:7147 ../src/guestfs-actions.pod:7171
25007 #: ../src/guestfs-actions.pod:7647 ../src/guestfs-actions.pod:7667
25008 #: ../src/guestfs-actions.pod:7714 ../src/guestfs-actions.pod:7908
25009 #: ../src/guestfs-actions.pod:7927 ../src/guestfs-actions.pod:8021
25010 #: ../src/guestfs-actions.pod:8040 ../src/guestfs-actions.pod:8086
25011 #: ../src/guestfs-actions.pod:8105
25013 "This function returns a NULL-terminated array of strings (like L<environ(3)"
25014 ">), or NULL if there was an error. I<The caller must free the strings and "
25015 "the array after use>."
25019 #: ../src/guestfs-actions.pod:484 ../src/guestfs-actions.pod:1074
25020 #: ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1613
25021 #: ../src/guestfs-actions.pod:3655 ../src/guestfs-actions.pod:3686
25022 #: ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4394
25023 #: ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4614
25024 #: ../src/guestfs-actions.pod:4777 ../src/guestfs-actions.pod:5264
25025 #: ../src/guestfs-actions.pod:5819 ../src/guestfs-actions.pod:6216
25026 #: ../src/guestfs-actions.pod:6230 ../src/guestfs-actions.pod:6242
25027 #: ../src/guestfs-actions.pod:6726 ../src/guestfs-actions.pod:7385
25028 #: ../src/guestfs-actions.pod:7398 ../src/guestfs-actions.pod:7631
25029 #: ../src/guestfs-actions.pod:7896
25030 msgid "(Added in 0.8)"
25034 #: ../src/guestfs-actions.pod:486
25035 msgid "guestfs_aug_match"
25039 #: ../src/guestfs-actions.pod:488
25043 " guestfs_aug_match (guestfs_h *g,\n"
25044 " const char *augpath);\n"
25049 #: ../src/guestfs-actions.pod:502
25050 msgid "guestfs_aug_mv"
25054 #: ../src/guestfs-actions.pod:504
25058 " guestfs_aug_mv (guestfs_h *g,\n"
25059 " const char *src,\n"
25060 " const char *dest);\n"
25065 #: ../src/guestfs-actions.pod:516
25066 msgid "guestfs_aug_rm"
25070 #: ../src/guestfs-actions.pod:518
25074 " guestfs_aug_rm (guestfs_h *g,\n"
25075 " const char *augpath);\n"
25080 #: ../src/guestfs-actions.pod:530
25081 msgid "guestfs_aug_save"
25085 #: ../src/guestfs-actions.pod:532
25089 " guestfs_aug_save (guestfs_h *g);\n"
25094 #: ../src/guestfs-actions.pod:537
25096 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
25101 #: ../src/guestfs-actions.pod:544
25102 msgid "guestfs_aug_set"
25106 #: ../src/guestfs-actions.pod:546
25110 " guestfs_aug_set (guestfs_h *g,\n"
25111 " const char *augpath,\n"
25112 " const char *val);\n"
25117 #: ../src/guestfs-actions.pod:553
25119 "In the Augeas API, it is possible to clear a node by setting the value to "
25120 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
25121 "this call. Instead you must use the C<guestfs_aug_clear> call."
25125 #: ../src/guestfs-actions.pod:562
25126 msgid "guestfs_available"
25130 #: ../src/guestfs-actions.pod:564
25134 " guestfs_available (guestfs_h *g,\n"
25135 " char *const *groups);\n"
25140 #: ../src/guestfs-actions.pod:572
25142 "The libguestfs groups, and the functions that those groups correspond to, "
25143 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
25144 "runtime by calling C<guestfs_available_all_groups>."
25148 #: ../src/guestfs-actions.pod:596
25149 msgid "You must call C<guestfs_launch> before calling this function."
25153 #: ../src/guestfs-actions.pod:618
25155 "This call was added in version C<1.0.80>. In previous versions of "
25156 "libguestfs all you could do would be to speculatively execute a command to "
25157 "find out if the daemon implemented it. See also C<guestfs_version>."
25161 #: ../src/guestfs-actions.pod:627 ../src/guestfs-actions.pod:1358
25162 msgid "(Added in 1.0.80)"
25166 #: ../src/guestfs-actions.pod:629
25167 msgid "guestfs_available_all_groups"
25171 #: ../src/guestfs-actions.pod:631
25175 " guestfs_available_all_groups (guestfs_h *g);\n"
25180 #: ../src/guestfs-actions.pod:634
25182 "This command returns a list of all optional groups that this daemon knows "
25183 "about. Note this returns both supported and unsupported groups. To find "
25184 "out which ones the daemon can actually support you have to call "
25185 "C<guestfs_available> on each member of the returned list."
25189 #: ../src/guestfs-actions.pod:640
25190 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
25194 #: ../src/guestfs-actions.pod:646
25195 msgid "(Added in 1.3.15)"
25199 #: ../src/guestfs-actions.pod:648
25200 msgid "guestfs_base64_in"
25204 #: ../src/guestfs-actions.pod:650
25208 " guestfs_base64_in (guestfs_h *g,\n"
25209 " const char *base64file,\n"
25210 " const char *filename);\n"
25215 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:674
25216 msgid "(Added in 1.3.5)"
25220 #: ../src/guestfs-actions.pod:662
25221 msgid "guestfs_base64_out"
25225 #: ../src/guestfs-actions.pod:664
25229 " guestfs_base64_out (guestfs_h *g,\n"
25230 " const char *filename,\n"
25231 " const char *base64file);\n"
25236 #: ../src/guestfs-actions.pod:676
25237 msgid "guestfs_blockdev_flushbufs"
25241 #: ../src/guestfs-actions.pod:678
25245 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
25246 " const char *device);\n"
25251 #: ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:706
25252 #: ../src/guestfs-actions.pod:721 ../src/guestfs-actions.pod:737
25253 #: ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:774
25254 #: ../src/guestfs-actions.pod:788 ../src/guestfs-actions.pod:806
25255 #: ../src/guestfs-actions.pod:820 ../src/guestfs-actions.pod:834
25256 msgid "(Added in 0.9.3)"
25260 #: ../src/guestfs-actions.pod:691
25261 msgid "guestfs_blockdev_getbsz"
25265 #: ../src/guestfs-actions.pod:693
25269 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
25270 " const char *device);\n"
25275 #: ../src/guestfs-actions.pod:708
25276 msgid "guestfs_blockdev_getro"
25280 #: ../src/guestfs-actions.pod:710
25284 " guestfs_blockdev_getro (guestfs_h *g,\n"
25285 " const char *device);\n"
25290 #: ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:1596
25291 #: ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:2100
25292 #: ../src/guestfs-actions.pod:2111 ../src/guestfs-actions.pod:2183
25293 #: ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2249
25294 #: ../src/guestfs-actions.pod:2264 ../src/guestfs-actions.pod:2300
25295 #: ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:3398
25296 #: ../src/guestfs-actions.pod:3414 ../src/guestfs-actions.pod:3432
25297 #: ../src/guestfs-actions.pod:3594 ../src/guestfs-actions.pod:3608
25298 #: ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3637
25299 #: ../src/guestfs-actions.pod:3653 ../src/guestfs-actions.pod:3668
25300 #: ../src/guestfs-actions.pod:3684 ../src/guestfs-actions.pod:3698
25301 #: ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3725
25302 #: ../src/guestfs-actions.pod:3740 ../src/guestfs-actions.pod:3755
25303 #: ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:3782
25304 #: ../src/guestfs-actions.pod:5501
25305 msgid "This function returns a C truth value on success or -1 on error."
25309 #: ../src/guestfs-actions.pod:723
25310 msgid "guestfs_blockdev_getsize64"
25314 #: ../src/guestfs-actions.pod:725
25318 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
25319 " const char *device);\n"
25324 #: ../src/guestfs-actions.pod:731
25325 msgid "See also C<guestfs_blockdev_getsz>."
25329 #: ../src/guestfs-actions.pod:739
25330 msgid "guestfs_blockdev_getss"
25334 #: ../src/guestfs-actions.pod:741
25338 " guestfs_blockdev_getss (guestfs_h *g,\n"
25339 " const char *device);\n"
25344 #: ../src/guestfs-actions.pod:748
25346 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
25351 #: ../src/guestfs-actions.pod:757
25352 msgid "guestfs_blockdev_getsz"
25356 #: ../src/guestfs-actions.pod:759
25360 " guestfs_blockdev_getsz (guestfs_h *g,\n"
25361 " const char *device);\n"
25366 #: ../src/guestfs-actions.pod:766
25368 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
25369 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
25373 #: ../src/guestfs-actions.pod:776
25374 msgid "guestfs_blockdev_rereadpt"
25378 #: ../src/guestfs-actions.pod:778
25382 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
25383 " const char *device);\n"
25388 #: ../src/guestfs-actions.pod:790
25389 msgid "guestfs_blockdev_setbsz"
25393 #: ../src/guestfs-actions.pod:792
25397 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
25398 " const char *device,\n"
25399 " int blocksize);\n"
25404 #: ../src/guestfs-actions.pod:808
25405 msgid "guestfs_blockdev_setro"
25409 #: ../src/guestfs-actions.pod:810
25413 " guestfs_blockdev_setro (guestfs_h *g,\n"
25414 " const char *device);\n"
25419 #: ../src/guestfs-actions.pod:822
25420 msgid "guestfs_blockdev_setrw"
25424 #: ../src/guestfs-actions.pod:824
25428 " guestfs_blockdev_setrw (guestfs_h *g,\n"
25429 " const char *device);\n"
25434 #: ../src/guestfs-actions.pod:836
25435 msgid "guestfs_btrfs_filesystem_resize"
25439 #: ../src/guestfs-actions.pod:838
25443 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
25444 " const char *mountpoint,\n"
25450 #: ../src/guestfs-actions.pod:848
25453 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
25458 #: ../src/guestfs-actions.pod:871
25459 msgid "(Added in 1.11.17)"
25463 #: ../src/guestfs-actions.pod:873
25464 msgid "guestfs_btrfs_filesystem_resize_va"
25468 #: ../src/guestfs-actions.pod:875
25472 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
25473 " const char *mountpoint,\n"
25474 " va_list args);\n"
25479 #: ../src/guestfs-actions.pod:880
25480 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
25484 #: ../src/guestfs-actions.pod:884
25485 msgid "guestfs_btrfs_filesystem_resize_argv"
25489 #: ../src/guestfs-actions.pod:886
25493 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
25494 " const char *mountpoint,\n"
25495 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
25500 #: ../src/guestfs-actions.pod:891
25501 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
25505 #: ../src/guestfs-actions.pod:895
25506 msgid "guestfs_case_sensitive_path"
25510 #: ../src/guestfs-actions.pod:897
25514 " guestfs_case_sensitive_path (guestfs_h *g,\n"
25515 " const char *path);\n"
25520 #: ../src/guestfs-actions.pod:923
25522 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
25523 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
25524 "how the directories were originally created under Windows)."
25528 #: ../src/guestfs-actions.pod:931
25529 msgid "See also C<guestfs_realpath>."
25533 #: ../src/guestfs-actions.pod:936 ../src/guestfs-actions.pod:7565
25534 msgid "(Added in 1.0.75)"
25538 #: ../src/guestfs-actions.pod:938
25539 msgid "guestfs_cat"
25543 #: ../src/guestfs-actions.pod:940
25547 " guestfs_cat (guestfs_h *g,\n"
25548 " const char *path);\n"
25553 #: ../src/guestfs-actions.pod:946
25555 "Note that this function cannot correctly handle binary files (specifically, "
25556 "files containing C<\\0> character which is treated as end of string). For "
25557 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
25558 "functions which have a more complex interface."
25562 #: ../src/guestfs-actions.pod:957 ../src/guestfs-actions.pod:3912
25563 #: ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4011
25564 #: ../src/guestfs-actions.pod:4099 ../src/guestfs-actions.pod:4507
25565 #: ../src/guestfs-actions.pod:4521 ../src/guestfs-actions.pod:5882
25566 #: ../src/guestfs-actions.pod:5896 ../src/guestfs-actions.pod:7718
25567 #: ../src/guestfs-actions.pod:7732
25568 msgid "(Added in 0.4)"
25572 #: ../src/guestfs-actions.pod:959
25573 msgid "guestfs_checksum"
25577 #: ../src/guestfs-actions.pod:961
25581 " guestfs_checksum (guestfs_h *g,\n"
25582 " const char *csumtype,\n"
25583 " const char *path);\n"
25588 #: ../src/guestfs-actions.pod:1007
25589 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
25593 #: ../src/guestfs-actions.pod:1009
25594 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
25598 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1433
25599 #: ../src/guestfs-actions.pod:2291 ../src/guestfs-actions.pod:3610
25600 #: ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3700
25601 #: ../src/guestfs-actions.pod:3727 ../src/guestfs-actions.pod:7421
25602 msgid "(Added in 1.0.2)"
25606 #: ../src/guestfs-actions.pod:1016
25607 msgid "guestfs_checksum_device"
25611 #: ../src/guestfs-actions.pod:1018
25615 " guestfs_checksum_device (guestfs_h *g,\n"
25616 " const char *csumtype,\n"
25617 " const char *device);\n"
25622 #: ../src/guestfs-actions.pod:1023
25624 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
25625 "device named C<device>. For the types of checksums supported see the "
25626 "C<guestfs_checksum> command."
25630 #: ../src/guestfs-actions.pod:1030 ../src/guestfs-actions.pod:5331
25631 #: ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5503
25632 #: ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5703
25633 #: ../src/guestfs-actions.pod:7330 ../src/guestfs-actions.pod:7344
25634 #: ../src/guestfs-actions.pod:7744
25635 msgid "(Added in 1.3.2)"
25639 #: ../src/guestfs-actions.pod:1032
25640 msgid "guestfs_checksums_out"
25644 #: ../src/guestfs-actions.pod:1034
25648 " guestfs_checksums_out (guestfs_h *g,\n"
25649 " const char *csumtype,\n"
25650 " const char *directory,\n"
25651 " const char *sumsfile);\n"
25656 #: ../src/guestfs-actions.pod:1054
25657 msgid "(Added in 1.3.7)"
25661 #: ../src/guestfs-actions.pod:1056
25662 msgid "guestfs_chmod"
25666 #: ../src/guestfs-actions.pod:1058
25670 " guestfs_chmod (guestfs_h *g,\n"
25672 " const char *path);\n"
25677 #: ../src/guestfs-actions.pod:1076
25678 msgid "guestfs_chown"
25682 #: ../src/guestfs-actions.pod:1078
25686 " guestfs_chown (guestfs_h *g,\n"
25689 " const char *path);\n"
25694 #: ../src/guestfs-actions.pod:1094
25695 msgid "guestfs_command"
25699 #: ../src/guestfs-actions.pod:1096
25703 " guestfs_command (guestfs_h *g,\n"
25704 " char *const *arguments);\n"
25709 #: ../src/guestfs-actions.pod:1105
25711 "The single parameter is an argv-style list of arguments. The first element "
25712 "is the name of the program to run. Subsequent elements are parameters. The "
25713 "list must be non-empty (ie. must contain a program name). Note that the "
25714 "command runs directly, and is I<not> invoked via the shell (see "
25719 #: ../src/guestfs-actions.pod:1136 ../src/guestfs-actions.pod:1156
25720 #: ../src/guestfs-actions.pod:1732
25721 msgid "(Added in 0.9.1)"
25725 #: ../src/guestfs-actions.pod:1138
25726 msgid "guestfs_command_lines"
25730 #: ../src/guestfs-actions.pod:1140
25734 " guestfs_command_lines (guestfs_h *g,\n"
25735 " char *const *arguments);\n"
25740 #: ../src/guestfs-actions.pod:1144
25742 "This is the same as C<guestfs_command>, but splits the result into a list of "
25747 #: ../src/guestfs-actions.pod:1147
25748 msgid "See also: C<guestfs_sh_lines>"
25752 #: ../src/guestfs-actions.pod:1158
25753 msgid "guestfs_compress_device_out"
25757 #: ../src/guestfs-actions.pod:1160
25761 " guestfs_compress_device_out (guestfs_h *g,\n"
25762 " const char *ctype,\n"
25763 " const char *device,\n"
25764 " const char *zdevice,\n"
25770 #: ../src/guestfs-actions.pod:1172
25773 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
25778 #: ../src/guestfs-actions.pod:1177
25780 "The C<ctype> and optional C<level> parameters have the same meaning as in "
25781 "C<guestfs_compress_out>."
25785 #: ../src/guestfs-actions.pod:1182 ../src/guestfs-actions.pod:1241
25786 #: ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:6602
25787 msgid "(Added in 1.13.15)"
25791 #: ../src/guestfs-actions.pod:1184
25792 msgid "guestfs_compress_device_out_va"
25796 #: ../src/guestfs-actions.pod:1186
25800 " guestfs_compress_device_out_va (guestfs_h *g,\n"
25801 " const char *ctype,\n"
25802 " const char *device,\n"
25803 " const char *zdevice,\n"
25804 " va_list args);\n"
25809 #: ../src/guestfs-actions.pod:1193
25810 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
25814 #: ../src/guestfs-actions.pod:1197
25815 msgid "guestfs_compress_device_out_argv"
25819 #: ../src/guestfs-actions.pod:1199
25823 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
25824 " const char *ctype,\n"
25825 " const char *device,\n"
25826 " const char *zdevice,\n"
25827 " const struct guestfs_compress_device_out_argv *optargs);\n"
25832 #: ../src/guestfs-actions.pod:1206
25833 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
25837 #: ../src/guestfs-actions.pod:1210
25838 msgid "guestfs_compress_out"
25842 #: ../src/guestfs-actions.pod:1212
25846 " guestfs_compress_out (guestfs_h *g,\n"
25847 " const char *ctype,\n"
25848 " const char *file,\n"
25849 " const char *zfile,\n"
25855 #: ../src/guestfs-actions.pod:1224
25858 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
25863 #: ../src/guestfs-actions.pod:1243
25864 msgid "guestfs_compress_out_va"
25868 #: ../src/guestfs-actions.pod:1245
25872 " guestfs_compress_out_va (guestfs_h *g,\n"
25873 " const char *ctype,\n"
25874 " const char *file,\n"
25875 " const char *zfile,\n"
25876 " va_list args);\n"
25881 #: ../src/guestfs-actions.pod:1252
25882 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
25886 #: ../src/guestfs-actions.pod:1256
25887 msgid "guestfs_compress_out_argv"
25891 #: ../src/guestfs-actions.pod:1258
25895 " guestfs_compress_out_argv (guestfs_h *g,\n"
25896 " const char *ctype,\n"
25897 " const char *file,\n"
25898 " const char *zfile,\n"
25899 " const struct guestfs_compress_out_argv *optargs);\n"
25904 #: ../src/guestfs-actions.pod:1265
25905 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
25909 #: ../src/guestfs-actions.pod:1269
25910 msgid "guestfs_config"
25914 #: ../src/guestfs-actions.pod:1271
25918 " guestfs_config (guestfs_h *g,\n"
25919 " const char *qemuparam,\n"
25920 " const char *qemuvalue);\n"
25925 #: ../src/guestfs-actions.pod:1289
25926 msgid "guestfs_copy_size"
25930 #: ../src/guestfs-actions.pod:1291
25934 " guestfs_copy_size (guestfs_h *g,\n"
25935 " const char *src,\n"
25936 " const char *dest,\n"
25937 " int64_t size);\n"
25942 #: ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:1428
25943 #: ../src/guestfs-actions.pod:1459 ../src/guestfs-actions.pod:1504
25944 #: ../src/guestfs-actions.pod:1881 ../src/guestfs-actions.pod:1903
25945 #: ../src/guestfs-actions.pod:3810 ../src/guestfs-actions.pod:7416
25946 #: ../src/guestfs-actions.pod:7450 ../src/guestfs-actions.pod:7957
25947 #: ../src/guestfs-actions.pod:7980
25949 "This long-running command can generate progress notification messages so "
25950 "that the caller can display a progress bar or indicator. To receive these "
25951 "messages, the caller must register a progress event callback. See L<guestfs"
25952 "(3)/GUESTFS_EVENT_PROGRESS>."
25956 #: ../src/guestfs-actions.pod:1310 ../src/guestfs-actions.pod:4534
25957 #: ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:7651
25958 #: ../src/guestfs-actions.pod:7671 ../src/guestfs-actions.pod:7757
25959 msgid "(Added in 1.0.87)"
25963 #: ../src/guestfs-actions.pod:1312
25968 #: ../src/guestfs-actions.pod:1314
25972 " guestfs_cp (guestfs_h *g,\n"
25973 " const char *src,\n"
25974 " const char *dest);\n"
25979 #: ../src/guestfs-actions.pod:1324 ../src/guestfs-actions.pod:1338
25980 #: ../src/guestfs-actions.pod:1410 ../src/guestfs-actions.pod:1484
25981 #: ../src/guestfs-actions.pod:1598 ../src/guestfs-actions.pod:5278
25982 #: ../src/guestfs-actions.pod:5753
25983 msgid "(Added in 1.0.18)"
25987 #: ../src/guestfs-actions.pod:1326
25988 msgid "guestfs_cp_a"
25992 #: ../src/guestfs-actions.pod:1328
25996 " guestfs_cp_a (guestfs_h *g,\n"
25997 " const char *src,\n"
25998 " const char *dest);\n"
26003 #: ../src/guestfs-actions.pod:1340
26008 #: ../src/guestfs-actions.pod:1342
26012 " guestfs_dd (guestfs_h *g,\n"
26013 " const char *src,\n"
26014 " const char *dest);\n"
26019 #: ../src/guestfs-actions.pod:1352
26021 "If the destination is a device, it must be as large or larger than the "
26022 "source file or device, otherwise the copy will fail. This command cannot do "
26023 "partial copies (see C<guestfs_copy_size>)."
26027 #: ../src/guestfs-actions.pod:1360
26032 #: ../src/guestfs-actions.pod:1362
26036 " guestfs_df (guestfs_h *g);\n"
26041 #: ../src/guestfs-actions.pod:1367 ../src/guestfs-actions.pod:1384
26043 "This command is mostly useful for interactive sessions. It is I<not> "
26044 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
26049 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1391
26050 #: ../src/guestfs-actions.pod:1509 ../src/guestfs-actions.pod:2516
26051 #: ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2608
26052 #: ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:5178
26053 #: ../src/guestfs-actions.pod:7154 ../src/guestfs-actions.pod:7178
26054 #: ../src/guestfs-actions.pod:7797 ../src/guestfs-actions.pod:7810
26055 #: ../src/guestfs-actions.pod:7823
26056 msgid "(Added in 1.0.54)"
26060 #: ../src/guestfs-actions.pod:1376
26061 msgid "guestfs_df_h"
26065 #: ../src/guestfs-actions.pod:1378
26069 " guestfs_df_h (guestfs_h *g);\n"
26074 #: ../src/guestfs-actions.pod:1393
26075 msgid "guestfs_dmesg"
26079 #: ../src/guestfs-actions.pod:1395
26083 " guestfs_dmesg (guestfs_h *g);\n"
26088 #: ../src/guestfs-actions.pod:1402
26090 "Another way to get the same information is to enable verbose messages with "
26091 "C<guestfs_set_verbose> or by setting the environment variable "
26092 "C<LIBGUESTFS_DEBUG=1> before running the program."
26096 #: ../src/guestfs-actions.pod:1412
26097 msgid "guestfs_download"
26101 #: ../src/guestfs-actions.pod:1414
26105 " guestfs_download (guestfs_h *g,\n"
26106 " const char *remotefilename,\n"
26107 " const char *filename);\n"
26112 #: ../src/guestfs-actions.pod:1424
26113 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
26117 #: ../src/guestfs-actions.pod:1435
26118 msgid "guestfs_download_offset"
26122 #: ../src/guestfs-actions.pod:1437
26126 " guestfs_download_offset (guestfs_h *g,\n"
26127 " const char *remotefilename,\n"
26128 " const char *filename,\n"
26129 " int64_t offset,\n"
26130 " int64_t size);\n"
26135 #: ../src/guestfs-actions.pod:1450
26137 "Note that there is no limit on the amount of data that can be downloaded "
26138 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
26139 "full amount unless an error occurs."
26143 #: ../src/guestfs-actions.pod:1455
26144 msgid "See also C<guestfs_download>, C<guestfs_pread>."
26148 #: ../src/guestfs-actions.pod:1464 ../src/guestfs-actions.pod:7455
26149 msgid "(Added in 1.5.17)"
26153 #: ../src/guestfs-actions.pod:1466
26154 msgid "guestfs_drop_caches"
26158 #: ../src/guestfs-actions.pod:1468
26162 " guestfs_drop_caches (guestfs_h *g,\n"
26163 " int whattodrop);\n"
26168 #: ../src/guestfs-actions.pod:1486
26173 #: ../src/guestfs-actions.pod:1488
26177 " guestfs_du (guestfs_h *g,\n"
26178 " const char *path);\n"
26183 #: ../src/guestfs-actions.pod:1511
26184 msgid "guestfs_e2fsck_f"
26188 #: ../src/guestfs-actions.pod:1513
26192 " guestfs_e2fsck_f (guestfs_h *g,\n"
26193 " const char *device);\n"
26198 #: ../src/guestfs-actions.pod:1521
26200 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
26201 "Normally you should use C<guestfs_fsck>."
26205 #: ../src/guestfs-actions.pod:1526
26206 msgid "(Added in 1.0.29)"
26210 #: ../src/guestfs-actions.pod:1528
26211 msgid "guestfs_echo_daemon"
26215 #: ../src/guestfs-actions.pod:1530
26219 " guestfs_echo_daemon (guestfs_h *g,\n"
26220 " char *const *words);\n"
26225 #: ../src/guestfs-actions.pod:1539
26226 msgid "See also C<guestfs_ping_daemon>."
26230 #: ../src/guestfs-actions.pod:1544 ../src/guestfs-actions.pod:2302
26231 #: ../src/guestfs-actions.pod:6626
26232 msgid "(Added in 1.0.69)"
26236 #: ../src/guestfs-actions.pod:1546
26237 msgid "guestfs_egrep"
26241 #: ../src/guestfs-actions.pod:1548
26245 " guestfs_egrep (guestfs_h *g,\n"
26246 " const char *regex,\n"
26247 " const char *path);\n"
26252 #: ../src/guestfs-actions.pod:1563 ../src/guestfs-actions.pod:1582
26253 #: ../src/guestfs-actions.pod:1639 ../src/guestfs-actions.pod:1685
26254 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:2432
26255 #: ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:2629
26256 #: ../src/guestfs-actions.pod:2642 ../src/guestfs-actions.pod:2657
26257 #: ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2725
26258 #: ../src/guestfs-actions.pod:2738 ../src/guestfs-actions.pod:4024
26259 #: ../src/guestfs-actions.pod:4038 ../src/guestfs-actions.pod:4051
26260 #: ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:5066
26261 #: ../src/guestfs-actions.pod:6087 ../src/guestfs-actions.pod:6136
26262 #: ../src/guestfs-actions.pod:7022 ../src/guestfs-actions.pod:7034
26263 #: ../src/guestfs-actions.pod:7047 ../src/guestfs-actions.pod:7060
26264 #: ../src/guestfs-actions.pod:7082 ../src/guestfs-actions.pod:7095
26265 #: ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7121
26266 #: ../src/guestfs-actions.pod:7915 ../src/guestfs-actions.pod:7934
26267 #: ../src/guestfs-actions.pod:8028 ../src/guestfs-actions.pod:8047
26268 #: ../src/guestfs-actions.pod:8093 ../src/guestfs-actions.pod:8112
26269 msgid "(Added in 1.0.66)"
26273 #: ../src/guestfs-actions.pod:1565
26274 msgid "guestfs_egrepi"
26278 #: ../src/guestfs-actions.pod:1567
26282 " guestfs_egrepi (guestfs_h *g,\n"
26283 " const char *regex,\n"
26284 " const char *path);\n"
26289 #: ../src/guestfs-actions.pod:1584
26290 msgid "guestfs_equal"
26294 #: ../src/guestfs-actions.pod:1586
26298 " guestfs_equal (guestfs_h *g,\n"
26299 " const char *file1,\n"
26300 " const char *file2);\n"
26305 #: ../src/guestfs-actions.pod:1600
26306 msgid "guestfs_exists"
26310 #: ../src/guestfs-actions.pod:1602
26314 " guestfs_exists (guestfs_h *g,\n"
26315 " const char *path);\n"
26320 #: ../src/guestfs-actions.pod:1609
26321 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
26325 #: ../src/guestfs-actions.pod:1615
26326 msgid "guestfs_fallocate"
26330 #: ../src/guestfs-actions.pod:1617
26334 " guestfs_fallocate (guestfs_h *g,\n"
26335 " const char *path,\n"
26341 #: ../src/guestfs-actions.pod:1622
26343 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
26348 #: ../src/guestfs-actions.pod:1641
26349 msgid "guestfs_fallocate64"
26353 #: ../src/guestfs-actions.pod:1643
26357 " guestfs_fallocate64 (guestfs_h *g,\n"
26358 " const char *path,\n"
26364 #: ../src/guestfs-actions.pod:1652
26366 "Note that this call allocates disk blocks for the file. To create a sparse "
26367 "file use C<guestfs_truncate_size> instead."
26371 #: ../src/guestfs-actions.pod:1655
26373 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
26374 "oversight it only allowed 30 bit lengths to be specified, effectively "
26375 "limiting the maximum size of files created through that call to 1GB."
26379 #: ../src/guestfs-actions.pod:1666
26380 msgid "(Added in 1.3.17)"
26384 #: ../src/guestfs-actions.pod:1668
26385 msgid "guestfs_fgrep"
26389 #: ../src/guestfs-actions.pod:1670
26393 " guestfs_fgrep (guestfs_h *g,\n"
26394 " const char *pattern,\n"
26395 " const char *path);\n"
26400 #: ../src/guestfs-actions.pod:1687
26401 msgid "guestfs_fgrepi"
26405 #: ../src/guestfs-actions.pod:1689
26409 " guestfs_fgrepi (guestfs_h *g,\n"
26410 " const char *pattern,\n"
26411 " const char *path);\n"
26416 #: ../src/guestfs-actions.pod:1706
26417 msgid "guestfs_file"
26421 #: ../src/guestfs-actions.pod:1708
26425 " guestfs_file (guestfs_h *g,\n"
26426 " const char *path);\n"
26431 #: ../src/guestfs-actions.pod:1726
26433 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
26434 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
26438 #: ../src/guestfs-actions.pod:1734
26439 msgid "guestfs_file_architecture"
26443 #: ../src/guestfs-actions.pod:1736
26447 " guestfs_file_architecture (guestfs_h *g,\n"
26448 " const char *filename);\n"
26453 #: ../src/guestfs-actions.pod:1844 ../src/guestfs-actions.pod:2007
26454 #: ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2758
26455 #: ../src/guestfs-actions.pod:2860 ../src/guestfs-actions.pod:2926
26456 #: ../src/guestfs-actions.pod:3113 ../src/guestfs-actions.pod:3131
26457 #: ../src/guestfs-actions.pod:3171 ../src/guestfs-actions.pod:3247
26458 #: ../src/guestfs-actions.pod:3344 ../src/guestfs-actions.pod:3581
26459 #: ../src/guestfs-actions.pod:3713
26460 msgid "(Added in 1.5.3)"
26464 #: ../src/guestfs-actions.pod:1846
26465 msgid "guestfs_filesize"
26469 #: ../src/guestfs-actions.pod:1848
26473 " guestfs_filesize (guestfs_h *g,\n"
26474 " const char *file);\n"
26479 #: ../src/guestfs-actions.pod:1854
26481 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
26482 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
26483 "devices, use C<guestfs_blockdev_getsize64>."
26487 #: ../src/guestfs-actions.pod:1860
26488 msgid "(Added in 1.0.82)"
26492 #: ../src/guestfs-actions.pod:1862
26493 msgid "guestfs_fill"
26497 #: ../src/guestfs-actions.pod:1864
26501 " guestfs_fill (guestfs_h *g,\n"
26504 " const char *path);\n"
26509 #: ../src/guestfs-actions.pod:1874
26511 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
26512 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
26513 "bytes use C<guestfs_fill_pattern>."
26517 #: ../src/guestfs-actions.pod:1886
26518 msgid "(Added in 1.0.79)"
26522 #: ../src/guestfs-actions.pod:1888
26523 msgid "guestfs_fill_pattern"
26527 #: ../src/guestfs-actions.pod:1890
26531 " guestfs_fill_pattern (guestfs_h *g,\n"
26532 " const char *pattern,\n"
26534 " const char *path);\n"
26539 #: ../src/guestfs-actions.pod:1896
26541 "This function is like C<guestfs_fill> except that it creates a new file of "
26542 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
26543 "pattern is truncated if necessary to ensure the length of the file is "
26544 "exactly C<len> bytes."
26548 #: ../src/guestfs-actions.pod:1908
26549 msgid "(Added in 1.3.12)"
26553 #: ../src/guestfs-actions.pod:1910
26554 msgid "guestfs_find"
26558 #: ../src/guestfs-actions.pod:1912
26562 " guestfs_find (guestfs_h *g,\n"
26563 " const char *directory);\n"
26568 #: ../src/guestfs-actions.pod:1928
26570 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
26574 #: ../src/guestfs-actions.pod:1941
26575 msgid "See also C<guestfs_find0>."
26579 #: ../src/guestfs-actions.pod:1950 ../src/guestfs-actions.pod:4471
26580 #: ../src/guestfs-actions.pod:6171
26581 msgid "(Added in 1.0.27)"
26585 #: ../src/guestfs-actions.pod:1952
26586 msgid "guestfs_find0"
26590 #: ../src/guestfs-actions.pod:1954
26594 " guestfs_find0 (guestfs_h *g,\n"
26595 " const char *directory,\n"
26596 " const char *files);\n"
26601 #: ../src/guestfs-actions.pod:1963
26603 "This command works the same way as C<guestfs_find> with the following "
26608 #: ../src/guestfs-actions.pod:1990
26609 msgid "(Added in 1.0.74)"
26613 #: ../src/guestfs-actions.pod:1992
26614 msgid "guestfs_findfs_label"
26618 #: ../src/guestfs-actions.pod:1994
26622 " guestfs_findfs_label (guestfs_h *g,\n"
26623 " const char *label);\n"
26628 #: ../src/guestfs-actions.pod:2002
26629 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
26633 #: ../src/guestfs-actions.pod:2009
26634 msgid "guestfs_findfs_uuid"
26638 #: ../src/guestfs-actions.pod:2011
26642 " guestfs_findfs_uuid (guestfs_h *g,\n"
26643 " const char *uuid);\n"
26648 #: ../src/guestfs-actions.pod:2019
26649 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
26653 #: ../src/guestfs-actions.pod:2026
26654 msgid "guestfs_fsck"
26658 #: ../src/guestfs-actions.pod:2028
26662 " guestfs_fsck (guestfs_h *g,\n"
26663 " const char *fstype,\n"
26664 " const char *device);\n"
26669 #: ../src/guestfs-actions.pod:2063 ../src/guestfs-actions.pod:7962
26670 msgid "(Added in 1.0.16)"
26674 #: ../src/guestfs-actions.pod:2065
26675 msgid "guestfs_get_append"
26679 #: ../src/guestfs-actions.pod:2067
26683 " guestfs_get_append (guestfs_h *g);\n"
26688 #: ../src/guestfs-actions.pod:2075
26690 "This function returns a string which may be NULL. There is no way to return "
26691 "an error from this function. The string is owned by the guest handle and "
26692 "must I<not> be freed."
26696 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:5849
26697 #: ../src/guestfs-actions.pod:6331 ../src/guestfs-actions.pod:6789
26698 #: ../src/guestfs-actions.pod:6808 ../src/guestfs-actions.pod:6824
26699 #: ../src/guestfs-actions.pod:6848 ../src/guestfs-actions.pod:7602
26700 #: ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:8009
26701 msgid "(Added in 1.0.26)"
26705 #: ../src/guestfs-actions.pod:2081
26706 msgid "guestfs_get_attach_method"
26710 #: ../src/guestfs-actions.pod:2083
26714 " guestfs_get_attach_method (guestfs_h *g);\n"
26719 #: ../src/guestfs-actions.pod:2086
26720 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
26724 #: ../src/guestfs-actions.pod:2091 ../src/guestfs-actions.pod:6361
26725 msgid "(Added in 1.9.8)"
26729 #: ../src/guestfs-actions.pod:2093
26730 msgid "guestfs_get_autosync"
26734 #: ../src/guestfs-actions.pod:2095
26738 " guestfs_get_autosync (guestfs_h *g);\n"
26743 #: ../src/guestfs-actions.pod:2104
26744 msgid "guestfs_get_direct"
26748 #: ../src/guestfs-actions.pod:2106
26752 " guestfs_get_direct (guestfs_h *g);\n"
26757 #: ../src/guestfs-actions.pod:2113 ../src/guestfs-actions.pod:6402
26758 msgid "(Added in 1.0.72)"
26762 #: ../src/guestfs-actions.pod:2115
26763 msgid "guestfs_get_e2label"
26767 #: ../src/guestfs-actions.pod:2117
26771 " guestfs_get_e2label (guestfs_h *g,\n"
26772 " const char *device);\n"
26777 #: ../src/guestfs-actions.pod:2121
26779 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
26784 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:2155
26785 #: ../src/guestfs-actions.pod:6420 ../src/guestfs-actions.pod:6439
26786 msgid "(Added in 1.0.15)"
26790 #: ../src/guestfs-actions.pod:2136
26791 msgid "guestfs_get_e2uuid"
26795 #: ../src/guestfs-actions.pod:2138
26799 " guestfs_get_e2uuid (guestfs_h *g,\n"
26800 " const char *device);\n"
26805 #: ../src/guestfs-actions.pod:2142
26807 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
26812 #: ../src/guestfs-actions.pod:2157
26813 msgid "guestfs_get_memsize"
26817 #: ../src/guestfs-actions.pod:2159
26821 " guestfs_get_memsize (guestfs_h *g);\n"
26826 #: ../src/guestfs-actions.pod:2165
26828 "If C<guestfs_set_memsize> was not called on this handle, and if "
26829 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
26830 "value for memsize."
26834 #: ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:4762
26835 #: ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:4990
26836 #: ../src/guestfs-actions.pod:5009 ../src/guestfs-actions.pod:5021
26837 #: ../src/guestfs-actions.pod:5038 ../src/guestfs-actions.pod:5051
26838 #: ../src/guestfs-actions.pod:6074 ../src/guestfs-actions.pod:6460
26839 #: ../src/guestfs-actions.pod:6756 ../src/guestfs-actions.pod:7371
26840 msgid "(Added in 1.0.55)"
26844 #: ../src/guestfs-actions.pod:2176
26845 msgid "guestfs_get_network"
26849 #: ../src/guestfs-actions.pod:2178
26853 " guestfs_get_network (guestfs_h *g);\n"
26858 #: ../src/guestfs-actions.pod:2185 ../src/guestfs-actions.pod:6479
26859 msgid "(Added in 1.5.4)"
26863 #: ../src/guestfs-actions.pod:2187
26864 msgid "guestfs_get_path"
26868 #: ../src/guestfs-actions.pod:2189
26872 " guestfs_get_path (guestfs_h *g);\n"
26877 #: ../src/guestfs-actions.pod:2197 ../src/guestfs-actions.pod:2237
26879 "This function returns a string, or NULL on error. The string is owned by "
26880 "the guest handle and must I<not> be freed."
26884 #: ../src/guestfs-actions.pod:2202
26885 msgid "guestfs_get_pgroup"
26889 #: ../src/guestfs-actions.pod:2204
26893 " guestfs_get_pgroup (guestfs_h *g);\n"
26898 #: ../src/guestfs-actions.pod:2211 ../src/guestfs-actions.pod:6515
26899 #: ../src/guestfs-actions.pod:7863
26900 msgid "(Added in 1.11.18)"
26904 #: ../src/guestfs-actions.pod:2213
26905 msgid "guestfs_get_pid"
26909 #: ../src/guestfs-actions.pod:2215
26913 " guestfs_get_pid (guestfs_h *g);\n"
26918 #: ../src/guestfs-actions.pod:2225
26919 msgid "(Added in 1.0.56)"
26923 #: ../src/guestfs-actions.pod:2227
26924 msgid "guestfs_get_qemu"
26928 #: ../src/guestfs-actions.pod:2229
26932 " guestfs_get_qemu (guestfs_h *g);\n"
26937 #: ../src/guestfs-actions.pod:2240 ../src/guestfs-actions.pod:6543
26938 msgid "(Added in 1.0.6)"
26942 #: ../src/guestfs-actions.pod:2242
26943 msgid "guestfs_get_recovery_proc"
26947 #: ../src/guestfs-actions.pod:2244
26951 " guestfs_get_recovery_proc (guestfs_h *g);\n"
26956 #: ../src/guestfs-actions.pod:2251 ../src/guestfs-actions.pod:3835
26957 #: ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4569
26958 #: ../src/guestfs-actions.pod:4601 ../src/guestfs-actions.pod:5779
26959 #: ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6567
26960 #: ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7294
26961 #: ../src/guestfs-actions.pod:7486
26962 msgid "(Added in 1.0.77)"
26966 #: ../src/guestfs-actions.pod:2253
26967 msgid "guestfs_get_selinux"
26971 #: ../src/guestfs-actions.pod:2255
26975 " guestfs_get_selinux (guestfs_h *g);\n"
26980 #: ../src/guestfs-actions.pod:2258
26982 "This returns the current setting of the selinux flag which is passed to the "
26983 "appliance at boot time. See C<guestfs_set_selinux>."
26987 #: ../src/guestfs-actions.pod:2266 ../src/guestfs-actions.pod:2340
26988 #: ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:6660
26989 msgid "(Added in 1.0.67)"
26993 #: ../src/guestfs-actions.pod:2268
26994 msgid "guestfs_get_smp"
26998 #: ../src/guestfs-actions.pod:2270
27002 " guestfs_get_smp (guestfs_h *g);\n"
27007 #: ../src/guestfs-actions.pod:2279
27008 msgid "guestfs_get_state"
27012 #: ../src/guestfs-actions.pod:2281
27016 " guestfs_get_state (guestfs_h *g);\n"
27021 #: ../src/guestfs-actions.pod:2293
27022 msgid "guestfs_get_trace"
27026 #: ../src/guestfs-actions.pod:2295
27030 " guestfs_get_trace (guestfs_h *g);\n"
27035 #: ../src/guestfs-actions.pod:2304
27036 msgid "guestfs_get_umask"
27040 #: ../src/guestfs-actions.pod:2306
27044 " guestfs_get_umask (guestfs_h *g);\n"
27049 #: ../src/guestfs-actions.pod:2309
27051 "Return the current umask. By default the umask is C<022> unless it has been "
27052 "set by calling C<guestfs_umask>."
27056 #: ../src/guestfs-actions.pod:2316
27057 msgid "guestfs_get_verbose"
27061 #: ../src/guestfs-actions.pod:2318
27065 " guestfs_get_verbose (guestfs_h *g);\n"
27070 #: ../src/guestfs-actions.pod:2327
27071 msgid "guestfs_getcon"
27075 #: ../src/guestfs-actions.pod:2329
27079 " guestfs_getcon (guestfs_h *g);\n"
27084 #: ../src/guestfs-actions.pod:2334
27086 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
27090 #: ../src/guestfs-actions.pod:2342
27091 msgid "guestfs_getxattr"
27095 #: ../src/guestfs-actions.pod:2344
27099 " guestfs_getxattr (guestfs_h *g,\n"
27100 " const char *path,\n"
27101 " const char *name,\n"
27102 " size_t *size_r);\n"
27107 #: ../src/guestfs-actions.pod:2350
27109 "Get a single extended attribute from file C<path> named C<name>. This call "
27110 "follows symlinks. If you want to lookup an extended attribute for the "
27111 "symlink itself, use C<guestfs_lgetxattr>."
27115 #: ../src/guestfs-actions.pod:2354 ../src/guestfs-actions.pod:3849
27117 "Normally it is better to get all extended attributes from a file in one go "
27118 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
27119 "implementations are buggy and do not provide a way to list out attributes. "
27120 "For these filesystems (notably ntfs-3g) you have to know the names of the "
27121 "extended attributes you want in advance and call this function."
27125 #: ../src/guestfs-actions.pod:2364
27126 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
27130 #: ../src/guestfs-actions.pod:2366 ../src/guestfs-actions.pod:2579
27131 #: ../src/guestfs-actions.pod:3061 ../src/guestfs-actions.pod:3861
27132 #: ../src/guestfs-actions.pod:5772 ../src/guestfs-actions.pod:5798
27133 #: ../src/guestfs-actions.pod:5979
27135 "This function returns a buffer, or NULL on error. The size of the returned "
27136 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
27141 #: ../src/guestfs-actions.pod:2370 ../src/guestfs-actions.pod:3865
27142 msgid "(Added in 1.7.24)"
27146 #: ../src/guestfs-actions.pod:2372
27147 msgid "guestfs_getxattrs"
27151 #: ../src/guestfs-actions.pod:2374
27154 " struct guestfs_xattr_list *\n"
27155 " guestfs_getxattrs (guestfs_h *g,\n"
27156 " const char *path);\n"
27161 #: ../src/guestfs-actions.pod:2384
27162 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
27166 #: ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:3877
27167 #: ../src/guestfs-actions.pod:4565
27169 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
27170 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
27174 #: ../src/guestfs-actions.pod:2390 ../src/guestfs-actions.pod:3881
27175 #: ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4116
27176 #: ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6679
27177 #: ../src/guestfs-actions.pod:8074
27178 msgid "(Added in 1.0.59)"
27182 #: ../src/guestfs-actions.pod:2392
27183 msgid "guestfs_glob_expand"
27187 #: ../src/guestfs-actions.pod:2394
27191 " guestfs_glob_expand (guestfs_h *g,\n"
27192 " const char *pattern);\n"
27197 #: ../src/guestfs-actions.pod:2413 ../src/guestfs-actions.pod:6872
27198 #: ../src/guestfs-actions.pod:6889
27199 msgid "(Added in 1.0.50)"
27203 #: ../src/guestfs-actions.pod:2415
27204 msgid "guestfs_grep"
27208 #: ../src/guestfs-actions.pod:2417
27212 " guestfs_grep (guestfs_h *g,\n"
27213 " const char *regex,\n"
27214 " const char *path);\n"
27219 #: ../src/guestfs-actions.pod:2434
27220 msgid "guestfs_grepi"
27224 #: ../src/guestfs-actions.pod:2436
27228 " guestfs_grepi (guestfs_h *g,\n"
27229 " const char *regex,\n"
27230 " const char *path);\n"
27235 #: ../src/guestfs-actions.pod:2453
27236 msgid "guestfs_grub_install"
27240 #: ../src/guestfs-actions.pod:2455
27244 " guestfs_grub_install (guestfs_h *g,\n"
27245 " const char *root,\n"
27246 " const char *device);\n"
27251 #: ../src/guestfs-actions.pod:2498
27252 msgid "(Added in 1.0.17)"
27256 #: ../src/guestfs-actions.pod:2500
27257 msgid "guestfs_head"
27261 #: ../src/guestfs-actions.pod:2502
27265 " guestfs_head (guestfs_h *g,\n"
27266 " const char *path);\n"
27271 #: ../src/guestfs-actions.pod:2518
27272 msgid "guestfs_head_n"
27276 #: ../src/guestfs-actions.pod:2520
27280 " guestfs_head_n (guestfs_h *g,\n"
27282 " const char *path);\n"
27287 #: ../src/guestfs-actions.pod:2542
27288 msgid "guestfs_hexdump"
27292 #: ../src/guestfs-actions.pod:2544
27296 " guestfs_hexdump (guestfs_h *g,\n"
27297 " const char *path);\n"
27302 #: ../src/guestfs-actions.pod:2557 ../src/guestfs-actions.pod:6953
27303 #: ../src/guestfs-actions.pod:7008
27304 msgid "(Added in 1.0.22)"
27308 #: ../src/guestfs-actions.pod:2559
27309 msgid "guestfs_initrd_cat"
27313 #: ../src/guestfs-actions.pod:2561
27317 " guestfs_initrd_cat (guestfs_h *g,\n"
27318 " const char *initrdpath,\n"
27319 " const char *filename,\n"
27320 " size_t *size_r);\n"
27325 #: ../src/guestfs-actions.pod:2577
27326 msgid "See also C<guestfs_initrd_list>."
27330 #: ../src/guestfs-actions.pod:2588
27331 msgid "guestfs_initrd_list"
27335 #: ../src/guestfs-actions.pod:2590
27339 " guestfs_initrd_list (guestfs_h *g,\n"
27340 " const char *path);\n"
27345 #: ../src/guestfs-actions.pod:2610
27346 msgid "guestfs_inotify_add_watch"
27350 #: ../src/guestfs-actions.pod:2612
27354 " guestfs_inotify_add_watch (guestfs_h *g,\n"
27355 " const char *path,\n"
27361 #: ../src/guestfs-actions.pod:2631
27362 msgid "guestfs_inotify_close"
27366 #: ../src/guestfs-actions.pod:2633
27370 " guestfs_inotify_close (guestfs_h *g);\n"
27375 #: ../src/guestfs-actions.pod:2644
27376 msgid "guestfs_inotify_files"
27380 #: ../src/guestfs-actions.pod:2646
27384 " guestfs_inotify_files (guestfs_h *g);\n"
27389 #: ../src/guestfs-actions.pod:2649
27391 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
27392 "returns a list of pathnames of objects that were touched. The returned "
27393 "pathnames are sorted and deduplicated."
27397 #: ../src/guestfs-actions.pod:2659
27398 msgid "guestfs_inotify_init"
27402 #: ../src/guestfs-actions.pod:2661
27406 " guestfs_inotify_init (guestfs_h *g,\n"
27407 " int maxevents);\n"
27412 #: ../src/guestfs-actions.pod:2669
27414 "C<maxevents> is the maximum number of events which will be queued up between "
27415 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
27416 "passed as C<0>, then the kernel (or previously set) default is used. For "
27417 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
27418 "throws away events, but records the fact that it threw them away by setting "
27419 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
27420 "C<guestfs_inotify_read>)."
27424 #: ../src/guestfs-actions.pod:2679
27426 "Before any events are generated, you have to add some watches to the "
27427 "internal watch list. See: C<guestfs_inotify_add_watch>, "
27428 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
27432 #: ../src/guestfs-actions.pod:2685
27434 "Queued up events should be read periodically by calling "
27435 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
27436 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
27437 "often enough then you risk the internal queue overflowing."
27441 #: ../src/guestfs-actions.pod:2692
27443 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
27444 "This also removes any watches automatically."
27448 #: ../src/guestfs-actions.pod:2705
27449 msgid "guestfs_inotify_read"
27453 #: ../src/guestfs-actions.pod:2707
27456 " struct guestfs_inotify_event_list *\n"
27457 " guestfs_inotify_read (guestfs_h *g);\n"
27462 #: ../src/guestfs-actions.pod:2721
27464 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
27465 "there was an error. I<The caller must call "
27466 "C<guestfs_free_inotify_event_list> after use>."
27470 #: ../src/guestfs-actions.pod:2727
27471 msgid "guestfs_inotify_rm_watch"
27475 #: ../src/guestfs-actions.pod:2729
27479 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
27485 #: ../src/guestfs-actions.pod:2733
27487 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
27491 #: ../src/guestfs-actions.pod:2740
27492 msgid "guestfs_inspect_get_arch"
27496 #: ../src/guestfs-actions.pod:2742
27500 " guestfs_inspect_get_arch (guestfs_h *g,\n"
27501 " const char *root);\n"
27506 #: ../src/guestfs-actions.pod:2746
27508 "This returns the architecture of the inspected operating system. The "
27509 "possible return values are listed under C<guestfs_file_architecture>."
27513 #: ../src/guestfs-actions.pod:2760
27514 msgid "guestfs_inspect_get_distro"
27518 #: ../src/guestfs-actions.pod:2762
27522 " guestfs_inspect_get_distro (guestfs_h *g,\n"
27523 " const char *root);\n"
27528 #: ../src/guestfs-actions.pod:2862
27529 msgid "guestfs_inspect_get_drive_mappings"
27533 #: ../src/guestfs-actions.pod:2864
27537 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
27538 " const char *root);\n"
27543 #: ../src/guestfs-actions.pod:2893
27545 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27546 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
27550 #: ../src/guestfs-actions.pod:2897 ../src/guestfs-actions.pod:3165
27551 #: ../src/guestfs-actions.pod:3968 ../src/guestfs-actions.pod:5240
27552 #: ../src/guestfs-actions.pod:7310
27554 "This function returns a NULL-terminated array of strings, or NULL if there "
27555 "was an error. The array of strings will always have length C<2n+1>, where "
27556 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
27557 "caller must free the strings and the array after use>."
27561 #: ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:3364
27562 msgid "(Added in 1.9.17)"
27566 #: ../src/guestfs-actions.pod:2905
27567 msgid "guestfs_inspect_get_filesystems"
27571 #: ../src/guestfs-actions.pod:2907
27575 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
27576 " const char *root);\n"
27581 #: ../src/guestfs-actions.pod:2919
27583 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27584 "C<guestfs_inspect_get_mountpoints>."
27588 #: ../src/guestfs-actions.pod:2928
27589 msgid "guestfs_inspect_get_format"
27593 #: ../src/guestfs-actions.pod:2930
27597 " guestfs_inspect_get_format (guestfs_h *g,\n"
27598 " const char *root);\n"
27603 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3400
27604 #: ../src/guestfs-actions.pod:3416 ../src/guestfs-actions.pod:3434
27605 #: ../src/guestfs-actions.pod:6190
27606 msgid "(Added in 1.9.4)"
27610 #: ../src/guestfs-actions.pod:2966
27611 msgid "guestfs_inspect_get_hostname"
27615 #: ../src/guestfs-actions.pod:2968
27619 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
27620 " const char *root);\n"
27625 #: ../src/guestfs-actions.pod:2983
27626 msgid "(Added in 1.7.9)"
27630 #: ../src/guestfs-actions.pod:2985
27631 msgid "guestfs_inspect_get_icon"
27635 #: ../src/guestfs-actions.pod:2987
27639 " guestfs_inspect_get_icon (guestfs_h *g,\n"
27640 " const char *root,\n"
27641 " size_t *size_r,\n"
27647 #: ../src/guestfs-actions.pod:2998
27650 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
27651 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
27656 #: ../src/guestfs-actions.pod:3065 ../src/guestfs-actions.pod:3895
27657 #: ../src/guestfs-actions.pod:5139
27658 msgid "(Added in 1.11.12)"
27662 #: ../src/guestfs-actions.pod:3067
27663 msgid "guestfs_inspect_get_icon_va"
27667 #: ../src/guestfs-actions.pod:3069
27671 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
27672 " const char *root,\n"
27673 " size_t *size_r,\n"
27674 " va_list args);\n"
27679 #: ../src/guestfs-actions.pod:3075
27680 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
27684 #: ../src/guestfs-actions.pod:3079
27685 msgid "guestfs_inspect_get_icon_argv"
27689 #: ../src/guestfs-actions.pod:3081
27693 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
27694 " const char *root,\n"
27695 " size_t *size_r,\n"
27696 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
27701 #: ../src/guestfs-actions.pod:3087
27702 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
27706 #: ../src/guestfs-actions.pod:3091
27707 msgid "guestfs_inspect_get_major_version"
27711 #: ../src/guestfs-actions.pod:3093
27715 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
27716 " const char *root);\n"
27721 #: ../src/guestfs-actions.pod:3115
27722 msgid "guestfs_inspect_get_minor_version"
27726 #: ../src/guestfs-actions.pod:3117
27730 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
27731 " const char *root);\n"
27736 #: ../src/guestfs-actions.pod:3126
27738 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27739 "C<guestfs_inspect_get_major_version>."
27743 #: ../src/guestfs-actions.pod:3133
27744 msgid "guestfs_inspect_get_mountpoints"
27748 #: ../src/guestfs-actions.pod:3135
27752 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
27753 " const char *root);\n"
27758 #: ../src/guestfs-actions.pod:3156
27760 "For operating systems like Windows which still use drive letters, this call "
27761 "will only return an entry for the first drive \"mounted on\" C</>. For "
27762 "information about the mapping of drive letters to partitions, see "
27763 "C<guestfs_inspect_get_drive_mappings>."
27767 #: ../src/guestfs-actions.pod:3162
27769 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27770 "C<guestfs_inspect_get_filesystems>."
27774 #: ../src/guestfs-actions.pod:3173
27775 msgid "guestfs_inspect_get_package_format"
27779 #: ../src/guestfs-actions.pod:3175
27783 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
27784 " const char *root);\n"
27789 #: ../src/guestfs-actions.pod:3179
27791 "This function and C<guestfs_inspect_get_package_management> return the "
27792 "package format and package management tool used by the inspected operating "
27793 "system. For example for Fedora these functions would return C<rpm> (package "
27794 "format) and C<yum> (package management)."
27798 #: ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3226
27799 msgid "(Added in 1.7.5)"
27803 #: ../src/guestfs-actions.pod:3200
27804 msgid "guestfs_inspect_get_package_management"
27808 #: ../src/guestfs-actions.pod:3202
27812 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
27813 " const char *root);\n"
27818 #: ../src/guestfs-actions.pod:3206
27820 "C<guestfs_inspect_get_package_format> and this function return the package "
27821 "format and package management tool used by the inspected operating system. "
27822 "For example for Fedora these functions would return C<rpm> (package format) "
27823 "and C<yum> (package management)."
27827 #: ../src/guestfs-actions.pod:3228
27828 msgid "guestfs_inspect_get_product_name"
27832 #: ../src/guestfs-actions.pod:3230
27836 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
27837 " const char *root);\n"
27842 #: ../src/guestfs-actions.pod:3249
27843 msgid "guestfs_inspect_get_product_variant"
27847 #: ../src/guestfs-actions.pod:3251
27851 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
27852 " const char *root);\n"
27857 #: ../src/guestfs-actions.pod:3274
27859 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27860 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
27864 #: ../src/guestfs-actions.pod:3281
27865 msgid "(Added in 1.9.13)"
27869 #: ../src/guestfs-actions.pod:3283
27870 msgid "guestfs_inspect_get_roots"
27874 #: ../src/guestfs-actions.pod:3285
27878 " guestfs_inspect_get_roots (guestfs_h *g);\n"
27883 #: ../src/guestfs-actions.pod:3288
27885 "This function is a convenient way to get the list of root devices, as "
27886 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
27887 "the whole inspection process."
27891 #: ../src/guestfs-actions.pod:3292
27893 "This returns an empty list if either no root devices were found or the "
27894 "caller has not called C<guestfs_inspect_os>."
27898 #: ../src/guestfs-actions.pod:3301
27899 msgid "(Added in 1.7.3)"
27903 #: ../src/guestfs-actions.pod:3303
27904 msgid "guestfs_inspect_get_type"
27908 #: ../src/guestfs-actions.pod:3305
27912 " guestfs_inspect_get_type (guestfs_h *g,\n"
27913 " const char *root);\n"
27918 #: ../src/guestfs-actions.pod:3346
27919 msgid "guestfs_inspect_get_windows_current_control_set"
27923 #: ../src/guestfs-actions.pod:3348
27927 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
27928 " const char *root);\n"
27933 #: ../src/guestfs-actions.pod:3366
27934 msgid "guestfs_inspect_get_windows_systemroot"
27938 #: ../src/guestfs-actions.pod:3368
27942 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
27943 " const char *root);\n"
27948 #: ../src/guestfs-actions.pod:3384
27949 msgid "(Added in 1.5.25)"
27953 #: ../src/guestfs-actions.pod:3386
27954 msgid "guestfs_inspect_is_live"
27958 #: ../src/guestfs-actions.pod:3388
27962 " guestfs_inspect_is_live (guestfs_h *g,\n"
27963 " const char *root);\n"
27968 #: ../src/guestfs-actions.pod:3392
27970 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27971 "disk), then this returns true if a live image was detected on the disk."
27975 #: ../src/guestfs-actions.pod:3402
27976 msgid "guestfs_inspect_is_multipart"
27980 #: ../src/guestfs-actions.pod:3404
27984 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
27985 " const char *root);\n"
27990 #: ../src/guestfs-actions.pod:3408
27992 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27993 "disk), then this returns true if the disk is part of a set."
27997 #: ../src/guestfs-actions.pod:3418
27998 msgid "guestfs_inspect_is_netinst"
28002 #: ../src/guestfs-actions.pod:3420
28006 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
28007 " const char *root);\n"
28012 #: ../src/guestfs-actions.pod:3424
28014 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
28015 "disk), then this returns true if the disk is a network installer, ie. not a "
28016 "self-contained install CD but one which is likely to require network access "
28017 "to complete the install."
28021 #: ../src/guestfs-actions.pod:3436
28022 msgid "guestfs_inspect_list_applications"
28026 #: ../src/guestfs-actions.pod:3438
28029 " struct guestfs_application_list *\n"
28030 " guestfs_inspect_list_applications (guestfs_h *g,\n"
28031 " const char *root);\n"
28036 #: ../src/guestfs-actions.pod:3444
28038 "I<Note:> This call works differently from other parts of the inspection "
28039 "API. You have to call C<guestfs_inspect_os>, then "
28040 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
28041 "this. Listing applications is a significantly more difficult operation "
28042 "which requires access to the full filesystem. Also note that unlike the "
28043 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
28044 "the libguestfs handle, this call actually reads parts of the mounted "
28045 "filesystems during the call."
28049 #: ../src/guestfs-actions.pod:3534
28051 "This function returns a C<struct guestfs_application_list *>, or NULL if "
28052 "there was an error. I<The caller must call C<guestfs_free_application_list> "
28057 #: ../src/guestfs-actions.pod:3538
28058 msgid "(Added in 1.7.8)"
28062 #: ../src/guestfs-actions.pod:3540
28063 msgid "guestfs_inspect_os"
28067 #: ../src/guestfs-actions.pod:3542
28071 " guestfs_inspect_os (guestfs_h *g);\n"
28076 #: ../src/guestfs-actions.pod:3558
28078 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
28079 "functions in order to query further information about each operating system, "
28080 "such as the name and version."
28084 #: ../src/guestfs-actions.pod:3563
28086 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
28087 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
28088 "the contents. This should be called with no disks currently mounted. The "
28089 "function may also use Augeas, so any existing Augeas handle will be closed."
28093 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3906
28094 #: ../src/guestfs-actions.pod:3988
28095 msgid "See also C<guestfs_list_filesystems>."
28099 #: ../src/guestfs-actions.pod:3583
28100 msgid "guestfs_is_blockdev"
28104 #: ../src/guestfs-actions.pod:3585
28108 " guestfs_is_blockdev (guestfs_h *g,\n"
28109 " const char *path);\n"
28114 #: ../src/guestfs-actions.pod:3592 ../src/guestfs-actions.pod:3621
28115 #: ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3666
28116 #: ../src/guestfs-actions.pod:3682 ../src/guestfs-actions.pod:3738
28117 #: ../src/guestfs-actions.pod:3753
28118 msgid "See also C<guestfs_stat>."
28122 #: ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3625
28123 #: ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:3742
28124 #: ../src/guestfs-actions.pod:3757
28125 msgid "(Added in 1.5.10)"
28129 #: ../src/guestfs-actions.pod:3598
28130 msgid "guestfs_is_busy"
28134 #: ../src/guestfs-actions.pod:3600
28138 " guestfs_is_busy (guestfs_h *g);\n"
28143 #: ../src/guestfs-actions.pod:3612
28144 msgid "guestfs_is_chardev"
28148 #: ../src/guestfs-actions.pod:3614
28152 " guestfs_is_chardev (guestfs_h *g,\n"
28153 " const char *path);\n"
28158 #: ../src/guestfs-actions.pod:3627
28159 msgid "guestfs_is_config"
28163 #: ../src/guestfs-actions.pod:3629
28167 " guestfs_is_config (guestfs_h *g);\n"
28172 #: ../src/guestfs-actions.pod:3641
28173 msgid "guestfs_is_dir"
28177 #: ../src/guestfs-actions.pod:3643
28181 " guestfs_is_dir (guestfs_h *g,\n"
28182 " const char *path);\n"
28187 #: ../src/guestfs-actions.pod:3657
28188 msgid "guestfs_is_fifo"
28192 #: ../src/guestfs-actions.pod:3659
28196 " guestfs_is_fifo (guestfs_h *g,\n"
28197 " const char *path);\n"
28202 #: ../src/guestfs-actions.pod:3672
28203 msgid "guestfs_is_file"
28207 #: ../src/guestfs-actions.pod:3674
28211 " guestfs_is_file (guestfs_h *g,\n"
28212 " const char *path);\n"
28217 #: ../src/guestfs-actions.pod:3688
28218 msgid "guestfs_is_launching"
28222 #: ../src/guestfs-actions.pod:3690
28226 " guestfs_is_launching (guestfs_h *g);\n"
28231 #: ../src/guestfs-actions.pod:3702
28232 msgid "guestfs_is_lv"
28236 #: ../src/guestfs-actions.pod:3704
28240 " guestfs_is_lv (guestfs_h *g,\n"
28241 " const char *device);\n"
28246 #: ../src/guestfs-actions.pod:3715
28247 msgid "guestfs_is_ready"
28251 #: ../src/guestfs-actions.pod:3717
28255 " guestfs_is_ready (guestfs_h *g);\n"
28260 #: ../src/guestfs-actions.pod:3729
28261 msgid "guestfs_is_socket"
28265 #: ../src/guestfs-actions.pod:3731
28269 " guestfs_is_socket (guestfs_h *g,\n"
28270 " const char *path);\n"
28275 #: ../src/guestfs-actions.pod:3744
28276 msgid "guestfs_is_symlink"
28280 #: ../src/guestfs-actions.pod:3746
28284 " guestfs_is_symlink (guestfs_h *g,\n"
28285 " const char *path);\n"
28290 #: ../src/guestfs-actions.pod:3759
28291 msgid "guestfs_is_zero"
28295 #: ../src/guestfs-actions.pod:3761
28299 " guestfs_is_zero (guestfs_h *g,\n"
28300 " const char *path);\n"
28305 #: ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:3784
28306 msgid "(Added in 1.11.8)"
28310 #: ../src/guestfs-actions.pod:3772
28311 msgid "guestfs_is_zero_device"
28315 #: ../src/guestfs-actions.pod:3774
28319 " guestfs_is_zero_device (guestfs_h *g,\n"
28320 " const char *device);\n"
28325 #: ../src/guestfs-actions.pod:3786
28326 msgid "guestfs_kill_subprocess"
28330 #: ../src/guestfs-actions.pod:3788
28334 " guestfs_kill_subprocess (guestfs_h *g);\n"
28339 #: ../src/guestfs-actions.pod:3797
28340 msgid "guestfs_launch"
28344 #: ../src/guestfs-actions.pod:3799
28348 " guestfs_launch (guestfs_h *g);\n"
28353 #: ../src/guestfs-actions.pod:3817
28354 msgid "guestfs_lchown"
28358 #: ../src/guestfs-actions.pod:3819
28362 " guestfs_lchown (guestfs_h *g,\n"
28365 " const char *path);\n"
28370 #: ../src/guestfs-actions.pod:3825
28372 "Change the file owner to C<owner> and group to C<group>. This is like "
28373 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
28374 "changed, not the target."
28378 #: ../src/guestfs-actions.pod:3837
28379 msgid "guestfs_lgetxattr"
28383 #: ../src/guestfs-actions.pod:3839
28387 " guestfs_lgetxattr (guestfs_h *g,\n"
28388 " const char *path,\n"
28389 " const char *name,\n"
28390 " size_t *size_r);\n"
28395 #: ../src/guestfs-actions.pod:3859
28396 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
28400 #: ../src/guestfs-actions.pod:3867
28401 msgid "guestfs_lgetxattrs"
28405 #: ../src/guestfs-actions.pod:3869
28408 " struct guestfs_xattr_list *\n"
28409 " guestfs_lgetxattrs (guestfs_h *g,\n"
28410 " const char *path);\n"
28415 #: ../src/guestfs-actions.pod:3873
28417 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
28418 "then it returns the extended attributes of the link itself."
28422 #: ../src/guestfs-actions.pod:3883
28423 msgid "guestfs_list_9p"
28427 #: ../src/guestfs-actions.pod:3885
28431 " guestfs_list_9p (guestfs_h *g);\n"
28436 #: ../src/guestfs-actions.pod:3897
28437 msgid "guestfs_list_devices"
28441 #: ../src/guestfs-actions.pod:3899
28445 " guestfs_list_devices (guestfs_h *g);\n"
28450 #: ../src/guestfs-actions.pod:3914
28451 msgid "guestfs_list_dm_devices"
28455 #: ../src/guestfs-actions.pod:3916
28459 " guestfs_list_dm_devices (guestfs_h *g);\n"
28464 #: ../src/guestfs-actions.pod:3921
28466 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
28467 "previous call to C<guestfs_luks_open>."
28471 #: ../src/guestfs-actions.pod:3924
28473 "Device mapper devices which correspond to logical volumes are I<not> "
28474 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
28479 #: ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:5378
28480 msgid "(Added in 1.11.15)"
28484 #: ../src/guestfs-actions.pod:3934
28485 msgid "guestfs_list_filesystems"
28489 #: ../src/guestfs-actions.pod:3936
28493 " guestfs_list_filesystems (guestfs_h *g);\n"
28498 #: ../src/guestfs-actions.pod:3956
28500 "This command runs other libguestfs commands, which might include "
28501 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
28502 "soon after launch and only when nothing is mounted."
28506 #: ../src/guestfs-actions.pod:3960
28508 "Not all of the filesystems returned will be mountable. In particular, swap "
28509 "partitions are returned in the list. Also this command does not check that "
28510 "each filesystem found is valid and mountable, and some filesystems might be "
28511 "mountable but require special options. Filesystems may not all belong to a "
28512 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
28516 #: ../src/guestfs-actions.pod:3974 ../src/guestfs-actions.pod:5739
28517 msgid "(Added in 1.5.15)"
28521 #: ../src/guestfs-actions.pod:3976
28522 msgid "guestfs_list_partitions"
28526 #: ../src/guestfs-actions.pod:3978
28530 " guestfs_list_partitions (guestfs_h *g);\n"
28535 #: ../src/guestfs-actions.pod:3985
28537 "This does not return logical volumes. For that you will need to call "
28542 #: ../src/guestfs-actions.pod:3996
28547 #: ../src/guestfs-actions.pod:3998
28551 " guestfs_ll (guestfs_h *g,\n"
28552 " const char *directory);\n"
28557 #: ../src/guestfs-actions.pod:4013
28562 #: ../src/guestfs-actions.pod:4015
28566 " guestfs_ln (guestfs_h *g,\n"
28567 " const char *target,\n"
28568 " const char *linkname);\n"
28573 #: ../src/guestfs-actions.pod:4026
28574 msgid "guestfs_ln_f"
28578 #: ../src/guestfs-actions.pod:4028
28582 " guestfs_ln_f (guestfs_h *g,\n"
28583 " const char *target,\n"
28584 " const char *linkname);\n"
28589 #: ../src/guestfs-actions.pod:4040
28590 msgid "guestfs_ln_s"
28594 #: ../src/guestfs-actions.pod:4042
28598 " guestfs_ln_s (guestfs_h *g,\n"
28599 " const char *target,\n"
28600 " const char *linkname);\n"
28605 #: ../src/guestfs-actions.pod:4053
28606 msgid "guestfs_ln_sf"
28610 #: ../src/guestfs-actions.pod:4055
28614 " guestfs_ln_sf (guestfs_h *g,\n"
28615 " const char *target,\n"
28616 " const char *linkname);\n"
28621 #: ../src/guestfs-actions.pod:4067
28622 msgid "guestfs_lremovexattr"
28626 #: ../src/guestfs-actions.pod:4069
28630 " guestfs_lremovexattr (guestfs_h *g,\n"
28631 " const char *xattr,\n"
28632 " const char *path);\n"
28637 #: ../src/guestfs-actions.pod:4074
28639 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
28640 "link, then it removes an extended attribute of the link itself."
28644 #: ../src/guestfs-actions.pod:4082
28649 #: ../src/guestfs-actions.pod:4084
28653 " guestfs_ls (guestfs_h *g,\n"
28654 " const char *directory);\n"
28659 #: ../src/guestfs-actions.pod:4092
28661 "This command is mostly useful for interactive sessions. Programs should "
28662 "probably use C<guestfs_readdir> instead."
28666 #: ../src/guestfs-actions.pod:4101
28667 msgid "guestfs_lsetxattr"
28671 #: ../src/guestfs-actions.pod:4103
28675 " guestfs_lsetxattr (guestfs_h *g,\n"
28676 " const char *xattr,\n"
28677 " const char *val,\n"
28679 " const char *path);\n"
28684 #: ../src/guestfs-actions.pod:4110
28686 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
28687 "then it sets an extended attribute of the link itself."
28691 #: ../src/guestfs-actions.pod:4118
28692 msgid "guestfs_lstat"
28696 #: ../src/guestfs-actions.pod:4120
28699 " struct guestfs_stat *\n"
28700 " guestfs_lstat (guestfs_h *g,\n"
28701 " const char *path);\n"
28706 #: ../src/guestfs-actions.pod:4126
28708 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
28709 "link, then the link is stat-ed, not the file it refers to."
28713 #: ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:6913
28715 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
28716 "error. I<The caller must call C<guestfs_free_stat> after use>."
28720 #: ../src/guestfs-actions.pod:4136 ../src/guestfs-actions.pod:6917
28721 #: ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:7316
28722 msgid "(Added in 0.9.2)"
28726 #: ../src/guestfs-actions.pod:4138
28727 msgid "guestfs_lstatlist"
28731 #: ../src/guestfs-actions.pod:4140
28734 " struct guestfs_stat_list *\n"
28735 " guestfs_lstatlist (guestfs_h *g,\n"
28736 " const char *path,\n"
28737 " char *const *names);\n"
28742 #: ../src/guestfs-actions.pod:4145
28744 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
28745 "files, where all files are in the directory C<path>. C<names> is the list "
28746 "of files from this directory."
28750 #: ../src/guestfs-actions.pod:4154
28752 "This call is intended for programs that want to efficiently list a directory "
28753 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
28754 "for a similarly efficient call for getting extended attributes. Very long "
28755 "directory listings might cause the protocol message size to be exceeded, "
28756 "causing this call to fail. The caller must split up such requests into "
28757 "smaller groups of names."
28761 #: ../src/guestfs-actions.pod:4162
28763 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
28764 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
28768 #: ../src/guestfs-actions.pod:4168
28769 msgid "guestfs_luks_add_key"
28773 #: ../src/guestfs-actions.pod:4170
28777 " guestfs_luks_add_key (guestfs_h *g,\n"
28778 " const char *device,\n"
28779 " const char *key,\n"
28780 " const char *newkey,\n"
28786 #: ../src/guestfs-actions.pod:4182
28788 "Note that if C<keyslot> already contains a key, then this command will "
28789 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
28793 #: ../src/guestfs-actions.pod:4188 ../src/guestfs-actions.pod:4228
28794 #: ../src/guestfs-actions.pod:4251 ../src/guestfs-actions.pod:4271
28795 #: ../src/guestfs-actions.pod:4306 ../src/guestfs-actions.pod:4325
28797 "This function takes a key or passphrase parameter which could contain "
28798 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
28803 #: ../src/guestfs-actions.pod:4192 ../src/guestfs-actions.pod:4232
28804 #: ../src/guestfs-actions.pod:4255 ../src/guestfs-actions.pod:4275
28805 msgid "(Added in 1.5.2)"
28809 #: ../src/guestfs-actions.pod:4194
28810 msgid "guestfs_luks_close"
28814 #: ../src/guestfs-actions.pod:4196
28818 " guestfs_luks_close (guestfs_h *g,\n"
28819 " const char *device);\n"
28824 #: ../src/guestfs-actions.pod:4200
28826 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
28827 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
28828 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
28829 "underlying block device."
28833 #: ../src/guestfs-actions.pod:4208 ../src/guestfs-actions.pod:4310
28834 #: ../src/guestfs-actions.pod:4329 ../src/guestfs-actions.pod:4379
28835 #: ../src/guestfs-actions.pod:4427
28836 msgid "(Added in 1.5.1)"
28840 #: ../src/guestfs-actions.pod:4210
28841 msgid "guestfs_luks_format"
28845 #: ../src/guestfs-actions.pod:4212
28849 " guestfs_luks_format (guestfs_h *g,\n"
28850 " const char *device,\n"
28851 " const char *key,\n"
28857 #: ../src/guestfs-actions.pod:4234
28858 msgid "guestfs_luks_format_cipher"
28862 #: ../src/guestfs-actions.pod:4236
28866 " guestfs_luks_format_cipher (guestfs_h *g,\n"
28867 " const char *device,\n"
28868 " const char *key,\n"
28870 " const char *cipher);\n"
28875 #: ../src/guestfs-actions.pod:4243
28877 "This command is the same as C<guestfs_luks_format> but it also allows you to "
28878 "set the C<cipher> used."
28882 #: ../src/guestfs-actions.pod:4257
28883 msgid "guestfs_luks_kill_slot"
28887 #: ../src/guestfs-actions.pod:4259
28891 " guestfs_luks_kill_slot (guestfs_h *g,\n"
28892 " const char *device,\n"
28893 " const char *key,\n"
28899 #: ../src/guestfs-actions.pod:4277
28900 msgid "guestfs_luks_open"
28904 #: ../src/guestfs-actions.pod:4279
28908 " guestfs_luks_open (guestfs_h *g,\n"
28909 " const char *device,\n"
28910 " const char *key,\n"
28911 " const char *mapname);\n"
28916 #: ../src/guestfs-actions.pod:4297
28918 "If this block device contains LVM volume groups, then calling "
28919 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
28924 #: ../src/guestfs-actions.pod:4301
28925 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
28929 #: ../src/guestfs-actions.pod:4312
28930 msgid "guestfs_luks_open_ro"
28934 #: ../src/guestfs-actions.pod:4314
28938 " guestfs_luks_open_ro (guestfs_h *g,\n"
28939 " const char *device,\n"
28940 " const char *key,\n"
28941 " const char *mapname);\n"
28946 #: ../src/guestfs-actions.pod:4320
28948 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
28953 #: ../src/guestfs-actions.pod:4331
28954 msgid "guestfs_lvcreate"
28958 #: ../src/guestfs-actions.pod:4333
28962 " guestfs_lvcreate (guestfs_h *g,\n"
28963 " const char *logvol,\n"
28964 " const char *volgroup,\n"
28970 #: ../src/guestfs-actions.pod:4346
28971 msgid "guestfs_lvm_canonical_lv_name"
28975 #: ../src/guestfs-actions.pod:4348
28979 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
28980 " const char *lvname);\n"
28985 #: ../src/guestfs-actions.pod:4359
28986 msgid "See also C<guestfs_is_lv>."
28990 #: ../src/guestfs-actions.pod:4364
28991 msgid "(Added in 1.5.24)"
28995 #: ../src/guestfs-actions.pod:4366
28996 msgid "guestfs_lvm_clear_filter"
29000 #: ../src/guestfs-actions.pod:4368
29004 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
29009 #: ../src/guestfs-actions.pod:4371
29011 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
29012 "see every block device."
29016 #: ../src/guestfs-actions.pod:4381
29017 msgid "guestfs_lvm_remove_all"
29021 #: ../src/guestfs-actions.pod:4383
29025 " guestfs_lvm_remove_all (guestfs_h *g);\n"
29030 #: ../src/guestfs-actions.pod:4396
29031 msgid "guestfs_lvm_set_filter"
29035 #: ../src/guestfs-actions.pod:4398
29039 " guestfs_lvm_set_filter (guestfs_h *g,\n"
29040 " char *const *devices);\n"
29045 #: ../src/guestfs-actions.pod:4429
29046 msgid "guestfs_lvremove"
29050 #: ../src/guestfs-actions.pod:4431
29054 " guestfs_lvremove (guestfs_h *g,\n"
29055 " const char *device);\n"
29060 #: ../src/guestfs-actions.pod:4443 ../src/guestfs-actions.pod:5836
29061 #: ../src/guestfs-actions.pod:7686
29062 msgid "(Added in 1.0.13)"
29066 #: ../src/guestfs-actions.pod:4445
29067 msgid "guestfs_lvrename"
29071 #: ../src/guestfs-actions.pod:4447
29075 " guestfs_lvrename (guestfs_h *g,\n"
29076 " const char *logvol,\n"
29077 " const char *newlogvol);\n"
29082 #: ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:7699
29083 msgid "(Added in 1.0.83)"
29087 #: ../src/guestfs-actions.pod:4458
29088 msgid "guestfs_lvresize"
29092 #: ../src/guestfs-actions.pod:4460
29096 " guestfs_lvresize (guestfs_h *g,\n"
29097 " const char *device,\n"
29103 #: ../src/guestfs-actions.pod:4473
29104 msgid "guestfs_lvresize_free"
29108 #: ../src/guestfs-actions.pod:4475
29112 " guestfs_lvresize_free (guestfs_h *g,\n"
29113 " const char *lv,\n"
29119 #: ../src/guestfs-actions.pod:4488
29120 msgid "(Added in 1.3.3)"
29124 #: ../src/guestfs-actions.pod:4490
29125 msgid "guestfs_lvs"
29129 #: ../src/guestfs-actions.pod:4492
29133 " guestfs_lvs (guestfs_h *g);\n"
29138 #: ../src/guestfs-actions.pod:4501
29139 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
29143 #: ../src/guestfs-actions.pod:4509
29144 msgid "guestfs_lvs_full"
29148 #: ../src/guestfs-actions.pod:4511
29151 " struct guestfs_lvm_lv_list *\n"
29152 " guestfs_lvs_full (guestfs_h *g);\n"
29157 #: ../src/guestfs-actions.pod:4517
29159 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
29160 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
29164 #: ../src/guestfs-actions.pod:4523
29165 msgid "guestfs_lvuuid"
29169 #: ../src/guestfs-actions.pod:4525
29173 " guestfs_lvuuid (guestfs_h *g,\n"
29174 " const char *device);\n"
29179 #: ../src/guestfs-actions.pod:4536
29180 msgid "guestfs_lxattrlist"
29184 #: ../src/guestfs-actions.pod:4538
29187 " struct guestfs_xattr_list *\n"
29188 " guestfs_lxattrlist (guestfs_h *g,\n"
29189 " const char *path,\n"
29190 " char *const *names);\n"
29195 #: ../src/guestfs-actions.pod:4557
29197 "This call is intended for programs that want to efficiently list a directory "
29198 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
29199 "a similarly efficient call for getting standard stats. Very long directory "
29200 "listings might cause the protocol message size to be exceeded, causing this "
29201 "call to fail. The caller must split up such requests into smaller groups of "
29206 #: ../src/guestfs-actions.pod:4571
29207 msgid "guestfs_mkdir"
29211 #: ../src/guestfs-actions.pod:4573
29215 " guestfs_mkdir (guestfs_h *g,\n"
29216 " const char *path);\n"
29221 #: ../src/guestfs-actions.pod:4583
29222 msgid "guestfs_mkdir_mode"
29226 #: ../src/guestfs-actions.pod:4585
29230 " guestfs_mkdir_mode (guestfs_h *g,\n"
29231 " const char *path,\n"
29237 #: ../src/guestfs-actions.pod:4597
29238 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
29242 #: ../src/guestfs-actions.pod:4603
29243 msgid "guestfs_mkdir_p"
29247 #: ../src/guestfs-actions.pod:4605
29251 " guestfs_mkdir_p (guestfs_h *g,\n"
29252 " const char *path);\n"
29257 #: ../src/guestfs-actions.pod:4616
29258 msgid "guestfs_mkdtemp"
29262 #: ../src/guestfs-actions.pod:4618
29266 " guestfs_mkdtemp (guestfs_h *g,\n"
29267 " const char *template);\n"
29272 #: ../src/guestfs-actions.pod:4646
29273 msgid "guestfs_mke2fs_J"
29277 #: ../src/guestfs-actions.pod:4648
29281 " guestfs_mke2fs_J (guestfs_h *g,\n"
29282 " const char *fstype,\n"
29283 " int blocksize,\n"
29284 " const char *device,\n"
29285 " const char *journal);\n"
29290 #: ../src/guestfs-actions.pod:4661
29291 msgid "See also C<guestfs_mke2journal>."
29295 #: ../src/guestfs-actions.pod:4665 ../src/guestfs-actions.pod:4683
29296 #: ../src/guestfs-actions.pod:4701 ../src/guestfs-actions.pod:4717
29297 #: ../src/guestfs-actions.pod:4731 ../src/guestfs-actions.pod:4745
29298 #: ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:5081
29299 msgid "(Added in 1.0.68)"
29303 #: ../src/guestfs-actions.pod:4667
29304 msgid "guestfs_mke2fs_JL"
29308 #: ../src/guestfs-actions.pod:4669
29312 " guestfs_mke2fs_JL (guestfs_h *g,\n"
29313 " const char *fstype,\n"
29314 " int blocksize,\n"
29315 " const char *device,\n"
29316 " const char *label);\n"
29321 #: ../src/guestfs-actions.pod:4679
29322 msgid "See also C<guestfs_mke2journal_L>."
29326 #: ../src/guestfs-actions.pod:4685
29327 msgid "guestfs_mke2fs_JU"
29331 #: ../src/guestfs-actions.pod:4687
29335 " guestfs_mke2fs_JU (guestfs_h *g,\n"
29336 " const char *fstype,\n"
29337 " int blocksize,\n"
29338 " const char *device,\n"
29339 " const char *uuid);\n"
29344 #: ../src/guestfs-actions.pod:4697
29345 msgid "See also C<guestfs_mke2journal_U>."
29349 #: ../src/guestfs-actions.pod:4703
29350 msgid "guestfs_mke2journal"
29354 #: ../src/guestfs-actions.pod:4705
29358 " guestfs_mke2journal (guestfs_h *g,\n"
29359 " int blocksize,\n"
29360 " const char *device);\n"
29365 #: ../src/guestfs-actions.pod:4719
29366 msgid "guestfs_mke2journal_L"
29370 #: ../src/guestfs-actions.pod:4721
29374 " guestfs_mke2journal_L (guestfs_h *g,\n"
29375 " int blocksize,\n"
29376 " const char *label,\n"
29377 " const char *device);\n"
29382 #: ../src/guestfs-actions.pod:4733
29383 msgid "guestfs_mke2journal_U"
29387 #: ../src/guestfs-actions.pod:4735
29391 " guestfs_mke2journal_U (guestfs_h *g,\n"
29392 " int blocksize,\n"
29393 " const char *uuid,\n"
29394 " const char *device);\n"
29399 #: ../src/guestfs-actions.pod:4747
29400 msgid "guestfs_mkfifo"
29404 #: ../src/guestfs-actions.pod:4749
29408 " guestfs_mkfifo (guestfs_h *g,\n"
29410 " const char *path);\n"
29415 #: ../src/guestfs-actions.pod:4754
29417 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
29418 "is just a convenient wrapper around C<guestfs_mknod>."
29422 #: ../src/guestfs-actions.pod:4764
29423 msgid "guestfs_mkfs"
29427 #: ../src/guestfs-actions.pod:4766
29431 " guestfs_mkfs (guestfs_h *g,\n"
29432 " const char *fstype,\n"
29433 " const char *device);\n"
29438 #: ../src/guestfs-actions.pod:4779
29439 msgid "guestfs_mkfs_b"
29443 #: ../src/guestfs-actions.pod:4781
29447 " guestfs_mkfs_b (guestfs_h *g,\n"
29448 " const char *fstype,\n"
29449 " int blocksize,\n"
29450 " const char *device);\n"
29455 #: ../src/guestfs-actions.pod:4787
29457 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
29462 #: ../src/guestfs-actions.pod:4794
29464 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
29465 "block size of the resulting filesystem. Supported block sizes depend on the "
29466 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
29470 #: ../src/guestfs-actions.pod:4806
29471 msgid "guestfs_mkfs_opts"
29475 #: ../src/guestfs-actions.pod:4808
29479 " guestfs_mkfs_opts (guestfs_h *g,\n"
29480 " const char *fstype,\n"
29481 " const char *device,\n"
29487 #: ../src/guestfs-actions.pod:4819
29490 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
29491 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
29492 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
29493 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
29498 #: ../src/guestfs-actions.pod:4867
29499 msgid "(Added in 1.7.19)"
29503 #: ../src/guestfs-actions.pod:4869
29504 msgid "guestfs_mkfs_opts_va"
29508 #: ../src/guestfs-actions.pod:4871
29512 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
29513 " const char *fstype,\n"
29514 " const char *device,\n"
29515 " va_list args);\n"
29520 #: ../src/guestfs-actions.pod:4877
29521 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
29525 #: ../src/guestfs-actions.pod:4881
29526 msgid "guestfs_mkfs_opts_argv"
29530 #: ../src/guestfs-actions.pod:4883
29534 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
29535 " const char *fstype,\n"
29536 " const char *device,\n"
29537 " const struct guestfs_mkfs_opts_argv *optargs);\n"
29542 #: ../src/guestfs-actions.pod:4889
29543 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
29547 #: ../src/guestfs-actions.pod:4893
29548 msgid "guestfs_mkmountpoint"
29552 #: ../src/guestfs-actions.pod:4895
29556 " guestfs_mkmountpoint (guestfs_h *g,\n"
29557 " const char *exemptpath);\n"
29562 #: ../src/guestfs-actions.pod:4899
29564 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
29565 "that can be used to create extra mountpoints before mounting the first "
29570 #: ../src/guestfs-actions.pod:4923
29572 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
29573 "may get unexpected errors if you try to mix these calls. It is safest to "
29574 "manually unmount filesystems and remove mountpoints after use."
29578 #: ../src/guestfs-actions.pod:4927
29580 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
29581 "first, so for this to work for manual mountpoints, you must ensure that the "
29582 "innermost mountpoints have the longest pathnames, as in the example code "
29587 #: ../src/guestfs-actions.pod:4934
29589 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
29590 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
29591 "can also trigger these issues."
29595 #: ../src/guestfs-actions.pod:4940 ../src/guestfs-actions.pod:5246
29596 #: ../src/guestfs-actions.pod:6256
29597 msgid "(Added in 1.0.62)"
29601 #: ../src/guestfs-actions.pod:4942
29602 msgid "guestfs_mknod"
29606 #: ../src/guestfs-actions.pod:4944
29610 " guestfs_mknod (guestfs_h *g,\n"
29614 " const char *path);\n"
29619 #: ../src/guestfs-actions.pod:4959
29621 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
29622 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
29623 "regular file). These constants are available in the standard Linux header "
29624 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
29625 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
29626 "the appropriate constant for you."
29630 #: ../src/guestfs-actions.pod:4973
29631 msgid "guestfs_mknod_b"
29635 #: ../src/guestfs-actions.pod:4975
29639 " guestfs_mknod_b (guestfs_h *g,\n"
29643 " const char *path);\n"
29648 #: ../src/guestfs-actions.pod:4982
29650 "This call creates a block device node called C<path> with mode C<mode> and "
29651 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29652 "wrapper around C<guestfs_mknod>."
29656 #: ../src/guestfs-actions.pod:4992
29657 msgid "guestfs_mknod_c"
29661 #: ../src/guestfs-actions.pod:4994
29665 " guestfs_mknod_c (guestfs_h *g,\n"
29669 " const char *path);\n"
29674 #: ../src/guestfs-actions.pod:5001
29676 "This call creates a char device node called C<path> with mode C<mode> and "
29677 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29678 "wrapper around C<guestfs_mknod>."
29682 #: ../src/guestfs-actions.pod:5011
29683 msgid "guestfs_mkswap"
29687 #: ../src/guestfs-actions.pod:5013
29691 " guestfs_mkswap (guestfs_h *g,\n"
29692 " const char *device);\n"
29697 #: ../src/guestfs-actions.pod:5023
29698 msgid "guestfs_mkswap_L"
29702 #: ../src/guestfs-actions.pod:5025
29706 " guestfs_mkswap_L (guestfs_h *g,\n"
29707 " const char *label,\n"
29708 " const char *device);\n"
29713 #: ../src/guestfs-actions.pod:5040
29714 msgid "guestfs_mkswap_U"
29718 #: ../src/guestfs-actions.pod:5042
29722 " guestfs_mkswap_U (guestfs_h *g,\n"
29723 " const char *uuid,\n"
29724 " const char *device);\n"
29729 #: ../src/guestfs-actions.pod:5053
29730 msgid "guestfs_mkswap_file"
29734 #: ../src/guestfs-actions.pod:5055
29738 " guestfs_mkswap_file (guestfs_h *g,\n"
29739 " const char *path);\n"
29744 #: ../src/guestfs-actions.pod:5061
29746 "This command just writes a swap file signature to an existing file. To "
29747 "create the file itself, use something like C<guestfs_fallocate>."
29751 #: ../src/guestfs-actions.pod:5068
29752 msgid "guestfs_modprobe"
29756 #: ../src/guestfs-actions.pod:5070
29760 " guestfs_modprobe (guestfs_h *g,\n"
29761 " const char *modulename);\n"
29766 #: ../src/guestfs-actions.pod:5083
29767 msgid "guestfs_mount"
29771 #: ../src/guestfs-actions.pod:5085
29775 " guestfs_mount (guestfs_h *g,\n"
29776 " const char *device,\n"
29777 " const char *mountpoint);\n"
29782 #: ../src/guestfs-actions.pod:5104
29784 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
29785 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
29786 "problems for users. If your program might need to work with older versions "
29787 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
29788 "for the first parameter if you don't want any options)."
29792 #: ../src/guestfs-actions.pod:5115
29793 msgid "guestfs_mount_9p"
29797 #: ../src/guestfs-actions.pod:5117
29801 " guestfs_mount_9p (guestfs_h *g,\n"
29802 " const char *mounttag,\n"
29803 " const char *mountpoint,\n"
29809 #: ../src/guestfs-actions.pod:5128
29812 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
29817 #: ../src/guestfs-actions.pod:5141
29818 msgid "guestfs_mount_9p_va"
29822 #: ../src/guestfs-actions.pod:5143
29826 " guestfs_mount_9p_va (guestfs_h *g,\n"
29827 " const char *mounttag,\n"
29828 " const char *mountpoint,\n"
29829 " va_list args);\n"
29834 #: ../src/guestfs-actions.pod:5149
29835 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
29839 #: ../src/guestfs-actions.pod:5153
29840 msgid "guestfs_mount_9p_argv"
29844 #: ../src/guestfs-actions.pod:5155
29848 " guestfs_mount_9p_argv (guestfs_h *g,\n"
29849 " const char *mounttag,\n"
29850 " const char *mountpoint,\n"
29851 " const struct guestfs_mount_9p_argv *optargs);\n"
29856 #: ../src/guestfs-actions.pod:5161
29857 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
29861 #: ../src/guestfs-actions.pod:5165
29862 msgid "guestfs_mount_loop"
29866 #: ../src/guestfs-actions.pod:5167
29870 " guestfs_mount_loop (guestfs_h *g,\n"
29871 " const char *file,\n"
29872 " const char *mountpoint);\n"
29877 #: ../src/guestfs-actions.pod:5180
29878 msgid "guestfs_mount_options"
29882 #: ../src/guestfs-actions.pod:5182
29886 " guestfs_mount_options (guestfs_h *g,\n"
29887 " const char *options,\n"
29888 " const char *device,\n"
29889 " const char *mountpoint);\n"
29894 #: ../src/guestfs-actions.pod:5188
29896 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29897 "the mount options as for the L<mount(8)> I<-o> flag."
29901 #: ../src/guestfs-actions.pod:5198 ../src/guestfs-actions.pod:5212
29902 #: ../src/guestfs-actions.pod:5229
29903 msgid "(Added in 1.0.10)"
29907 #: ../src/guestfs-actions.pod:5200
29908 msgid "guestfs_mount_ro"
29912 #: ../src/guestfs-actions.pod:5202
29916 " guestfs_mount_ro (guestfs_h *g,\n"
29917 " const char *device,\n"
29918 " const char *mountpoint);\n"
29923 #: ../src/guestfs-actions.pod:5207
29925 "This is the same as the C<guestfs_mount> command, but it mounts the "
29926 "filesystem with the read-only (I<-o ro>) flag."
29930 #: ../src/guestfs-actions.pod:5214
29931 msgid "guestfs_mount_vfs"
29935 #: ../src/guestfs-actions.pod:5216
29939 " guestfs_mount_vfs (guestfs_h *g,\n"
29940 " const char *options,\n"
29941 " const char *vfstype,\n"
29942 " const char *device,\n"
29943 " const char *mountpoint);\n"
29948 #: ../src/guestfs-actions.pod:5223
29950 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29951 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
29956 #: ../src/guestfs-actions.pod:5231
29957 msgid "guestfs_mountpoints"
29961 #: ../src/guestfs-actions.pod:5233
29965 " guestfs_mountpoints (guestfs_h *g);\n"
29970 #: ../src/guestfs-actions.pod:5236
29972 "This call is similar to C<guestfs_mounts>. That call returns a list of "
29973 "devices. This one returns a hash table (map) of device name to directory "
29974 "where the device is mounted."
29978 #: ../src/guestfs-actions.pod:5248
29979 msgid "guestfs_mounts"
29983 #: ../src/guestfs-actions.pod:5250
29987 " guestfs_mounts (guestfs_h *g);\n"
29992 #: ../src/guestfs-actions.pod:5258
29993 msgid "See also: C<guestfs_mountpoints>"
29997 #: ../src/guestfs-actions.pod:5266
30002 #: ../src/guestfs-actions.pod:5268
30006 " guestfs_mv (guestfs_h *g,\n"
30007 " const char *src,\n"
30008 " const char *dest);\n"
30013 #: ../src/guestfs-actions.pod:5280
30014 msgid "guestfs_ntfs_3g_probe"
30018 #: ../src/guestfs-actions.pod:5282
30022 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
30024 " const char *device);\n"
30029 #: ../src/guestfs-actions.pod:5301
30030 msgid "(Added in 1.0.43)"
30034 #: ../src/guestfs-actions.pod:5303
30035 msgid "guestfs_ntfsresize"
30039 #: ../src/guestfs-actions.pod:5305
30043 " guestfs_ntfsresize (guestfs_h *g,\n"
30044 " const char *device);\n"
30049 #: ../src/guestfs-actions.pod:5309 ../src/guestfs-actions.pod:5409
30051 "I<This function is deprecated.> In new code, use the L</"
30052 "guestfs_ntfsresize_opts> call instead."
30056 #: ../src/guestfs-actions.pod:5333
30057 msgid "guestfs_ntfsresize_opts"
30061 #: ../src/guestfs-actions.pod:5335
30065 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
30066 " const char *device,\n"
30072 #: ../src/guestfs-actions.pod:5345
30075 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
30076 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
30081 #: ../src/guestfs-actions.pod:5365
30083 "After the resize operation, the filesystem is always marked as requiring a "
30084 "consistency check (for safety). You have to boot into Windows to perform "
30085 "this check and clear this condition. If you I<don't> set the C<force> "
30086 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
30087 "times on a single filesystem without booting into Windows between each "
30092 #: ../src/guestfs-actions.pod:5380
30093 msgid "guestfs_ntfsresize_opts_va"
30097 #: ../src/guestfs-actions.pod:5382
30101 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
30102 " const char *device,\n"
30103 " va_list args);\n"
30108 #: ../src/guestfs-actions.pod:5387
30109 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
30113 #: ../src/guestfs-actions.pod:5391
30114 msgid "guestfs_ntfsresize_opts_argv"
30118 #: ../src/guestfs-actions.pod:5393
30122 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
30123 " const char *device,\n"
30124 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
30129 #: ../src/guestfs-actions.pod:5398
30130 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
30134 #: ../src/guestfs-actions.pod:5402
30135 msgid "guestfs_ntfsresize_size"
30139 #: ../src/guestfs-actions.pod:5404
30143 " guestfs_ntfsresize_size (guestfs_h *g,\n"
30144 " const char *device,\n"
30145 " int64_t size);\n"
30150 #: ../src/guestfs-actions.pod:5416
30152 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
30153 "to specify the new size (in bytes) explicitly."
30157 #: ../src/guestfs-actions.pod:5421 ../src/guestfs-actions.pod:5863
30158 #: ../src/guestfs-actions.pod:5936 ../src/guestfs-actions.pod:6204
30159 #: ../src/guestfs-actions.pod:7843
30160 msgid "(Added in 1.3.14)"
30164 #: ../src/guestfs-actions.pod:5423
30165 msgid "guestfs_part_add"
30169 #: ../src/guestfs-actions.pod:5425
30173 " guestfs_part_add (guestfs_h *g,\n"
30174 " const char *device,\n"
30175 " const char *prlogex,\n"
30176 " int64_t startsect,\n"
30177 " int64_t endsect);\n"
30182 #: ../src/guestfs-actions.pod:5432
30184 "This command adds a partition to C<device>. If there is no partition table "
30185 "on the device, call C<guestfs_part_init> first."
30189 #: ../src/guestfs-actions.pod:5444
30191 "Creating a partition which covers the whole disk is not so easy. Use "
30192 "C<guestfs_part_disk> to do that."
30196 #: ../src/guestfs-actions.pod:5449 ../src/guestfs-actions.pod:5487
30197 #: ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5624
30198 #: ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:5681
30199 #: ../src/guestfs-actions.pod:5721
30200 msgid "(Added in 1.0.78)"
30204 #: ../src/guestfs-actions.pod:5451
30205 msgid "guestfs_part_del"
30209 #: ../src/guestfs-actions.pod:5453
30213 " guestfs_part_del (guestfs_h *g,\n"
30214 " const char *device,\n"
30220 #: ../src/guestfs-actions.pod:5468
30221 msgid "guestfs_part_disk"
30225 #: ../src/guestfs-actions.pod:5470
30229 " guestfs_part_disk (guestfs_h *g,\n"
30230 " const char *device,\n"
30231 " const char *parttype);\n"
30236 #: ../src/guestfs-actions.pod:5475
30238 "This command is simply a combination of C<guestfs_part_init> followed by "
30239 "C<guestfs_part_add> to create a single primary partition covering the whole "
30244 #: ../src/guestfs-actions.pod:5479
30246 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
30247 "possible values are described in C<guestfs_part_init>."
30251 #: ../src/guestfs-actions.pod:5489
30252 msgid "guestfs_part_get_bootable"
30256 #: ../src/guestfs-actions.pod:5491
30260 " guestfs_part_get_bootable (guestfs_h *g,\n"
30261 " const char *device,\n"
30267 #: ../src/guestfs-actions.pod:5499
30268 msgid "See also C<guestfs_part_set_bootable>."
30272 #: ../src/guestfs-actions.pod:5505
30273 msgid "guestfs_part_get_mbr_id"
30277 #: ../src/guestfs-actions.pod:5507
30281 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
30282 " const char *device,\n"
30288 #: ../src/guestfs-actions.pod:5515 ../src/guestfs-actions.pod:5697
30290 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
30291 "undefined results for other partition table types (see "
30292 "C<guestfs_part_get_parttype>)."
30296 #: ../src/guestfs-actions.pod:5523
30297 msgid "guestfs_part_get_parttype"
30301 #: ../src/guestfs-actions.pod:5525
30305 " guestfs_part_get_parttype (guestfs_h *g,\n"
30306 " const char *device);\n"
30311 #: ../src/guestfs-actions.pod:5532
30313 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
30314 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
30315 "possible, although unusual. See C<guestfs_part_init> for a full list."
30319 #: ../src/guestfs-actions.pod:5542
30320 msgid "guestfs_part_init"
30324 #: ../src/guestfs-actions.pod:5544
30328 " guestfs_part_init (guestfs_h *g,\n"
30329 " const char *device,\n"
30330 " const char *parttype);\n"
30335 #: ../src/guestfs-actions.pod:5553
30337 "Initially there are no partitions. Following this, you should call "
30338 "C<guestfs_part_add> for each partition required."
30342 #: ../src/guestfs-actions.pod:5626
30343 msgid "guestfs_part_list"
30347 #: ../src/guestfs-actions.pod:5628
30350 " struct guestfs_partition_list *\n"
30351 " guestfs_part_list (guestfs_h *g,\n"
30352 " const char *device);\n"
30357 #: ../src/guestfs-actions.pod:5645
30359 "Start of the partition I<in bytes>. To get sectors you have to divide by "
30360 "the device's sector size, see C<guestfs_blockdev_getss>."
30364 #: ../src/guestfs-actions.pod:5658
30366 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
30367 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
30372 #: ../src/guestfs-actions.pod:5664
30373 msgid "guestfs_part_set_bootable"
30377 #: ../src/guestfs-actions.pod:5666
30381 " guestfs_part_set_bootable (guestfs_h *g,\n"
30382 " const char *device,\n"
30384 " int bootable);\n"
30389 #: ../src/guestfs-actions.pod:5683
30390 msgid "guestfs_part_set_mbr_id"
30394 #: ../src/guestfs-actions.pod:5685
30398 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
30399 " const char *device,\n"
30406 #: ../src/guestfs-actions.pod:5705
30407 msgid "guestfs_part_set_name"
30411 #: ../src/guestfs-actions.pod:5707
30415 " guestfs_part_set_name (guestfs_h *g,\n"
30416 " const char *device,\n"
30418 " const char *name);\n"
30423 #: ../src/guestfs-actions.pod:5723
30424 msgid "guestfs_part_to_dev"
30428 #: ../src/guestfs-actions.pod:5725
30432 " guestfs_part_to_dev (guestfs_h *g,\n"
30433 " const char *partition);\n"
30438 #: ../src/guestfs-actions.pod:5733
30440 "The named partition must exist, for example as a string returned from "
30441 "C<guestfs_list_partitions>."
30445 #: ../src/guestfs-actions.pod:5741
30446 msgid "guestfs_ping_daemon"
30450 #: ../src/guestfs-actions.pod:5743
30454 " guestfs_ping_daemon (guestfs_h *g);\n"
30459 #: ../src/guestfs-actions.pod:5755
30460 msgid "guestfs_pread"
30464 #: ../src/guestfs-actions.pod:5757
30468 " guestfs_pread (guestfs_h *g,\n"
30469 " const char *path,\n"
30471 " int64_t offset,\n"
30472 " size_t *size_r);\n"
30477 #: ../src/guestfs-actions.pod:5770
30478 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
30482 #: ../src/guestfs-actions.pod:5781
30483 msgid "guestfs_pread_device"
30487 #: ../src/guestfs-actions.pod:5783
30491 " guestfs_pread_device (guestfs_h *g,\n"
30492 " const char *device,\n"
30494 " int64_t offset,\n"
30495 " size_t *size_r);\n"
30500 #: ../src/guestfs-actions.pod:5796
30501 msgid "See also C<guestfs_pread>."
30505 #: ../src/guestfs-actions.pod:5805
30506 msgid "(Added in 1.5.21)"
30510 #: ../src/guestfs-actions.pod:5807
30511 msgid "guestfs_pvcreate"
30515 #: ../src/guestfs-actions.pod:5809
30519 " guestfs_pvcreate (guestfs_h *g,\n"
30520 " const char *device);\n"
30525 #: ../src/guestfs-actions.pod:5821
30526 msgid "guestfs_pvremove"
30530 #: ../src/guestfs-actions.pod:5823
30534 " guestfs_pvremove (guestfs_h *g,\n"
30535 " const char *device);\n"
30540 #: ../src/guestfs-actions.pod:5838
30541 msgid "guestfs_pvresize"
30545 #: ../src/guestfs-actions.pod:5840
30549 " guestfs_pvresize (guestfs_h *g,\n"
30550 " const char *device);\n"
30555 #: ../src/guestfs-actions.pod:5851
30556 msgid "guestfs_pvresize_size"
30560 #: ../src/guestfs-actions.pod:5853
30564 " guestfs_pvresize_size (guestfs_h *g,\n"
30565 " const char *device,\n"
30566 " int64_t size);\n"
30571 #: ../src/guestfs-actions.pod:5858
30573 "This command is the same as C<guestfs_pvresize> except that it allows you to "
30574 "specify the new size (in bytes) explicitly."
30578 #: ../src/guestfs-actions.pod:5865
30579 msgid "guestfs_pvs"
30583 #: ../src/guestfs-actions.pod:5867
30587 " guestfs_pvs (guestfs_h *g);\n"
30592 #: ../src/guestfs-actions.pod:5876
30593 msgid "See also C<guestfs_pvs_full>."
30597 #: ../src/guestfs-actions.pod:5884
30598 msgid "guestfs_pvs_full"
30602 #: ../src/guestfs-actions.pod:5886
30605 " struct guestfs_lvm_pv_list *\n"
30606 " guestfs_pvs_full (guestfs_h *g);\n"
30611 #: ../src/guestfs-actions.pod:5892
30613 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
30614 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
30618 #: ../src/guestfs-actions.pod:5898
30619 msgid "guestfs_pvuuid"
30623 #: ../src/guestfs-actions.pod:5900
30627 " guestfs_pvuuid (guestfs_h *g,\n"
30628 " const char *device);\n"
30633 #: ../src/guestfs-actions.pod:5911
30634 msgid "guestfs_pwrite"
30638 #: ../src/guestfs-actions.pod:5913
30642 " guestfs_pwrite (guestfs_h *g,\n"
30643 " const char *path,\n"
30644 " const char *content,\n"
30645 " size_t content_size,\n"
30646 " int64_t offset);\n"
30651 #: ../src/guestfs-actions.pod:5929
30652 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
30656 #: ../src/guestfs-actions.pod:5938
30657 msgid "guestfs_pwrite_device"
30661 #: ../src/guestfs-actions.pod:5940
30665 " guestfs_pwrite_device (guestfs_h *g,\n"
30666 " const char *device,\n"
30667 " const char *content,\n"
30668 " size_t content_size,\n"
30669 " int64_t offset);\n"
30674 #: ../src/guestfs-actions.pod:5955
30675 msgid "See also C<guestfs_pwrite>."
30679 #: ../src/guestfs-actions.pod:5962
30680 msgid "(Added in 1.5.20)"
30684 #: ../src/guestfs-actions.pod:5964
30685 msgid "guestfs_read_file"
30689 #: ../src/guestfs-actions.pod:5966
30693 " guestfs_read_file (guestfs_h *g,\n"
30694 " const char *path,\n"
30695 " size_t *size_r);\n"
30700 #: ../src/guestfs-actions.pod:5974
30702 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
30703 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
30704 "function is limited in the total size of file that can be handled."
30708 #: ../src/guestfs-actions.pod:5986
30709 msgid "(Added in 1.0.63)"
30713 #: ../src/guestfs-actions.pod:5988
30714 msgid "guestfs_read_lines"
30718 #: ../src/guestfs-actions.pod:5990
30722 " guestfs_read_lines (guestfs_h *g,\n"
30723 " const char *path);\n"
30728 #: ../src/guestfs-actions.pod:5999
30730 "Note that this function cannot correctly handle binary files (specifically, "
30731 "files containing C<\\0> character which is treated as end of line). For "
30732 "those you need to use the C<guestfs_read_file> function which has a more "
30733 "complex interface."
30737 #: ../src/guestfs-actions.pod:6010
30738 msgid "guestfs_readdir"
30742 #: ../src/guestfs-actions.pod:6012
30745 " struct guestfs_dirent_list *\n"
30746 " guestfs_readdir (guestfs_h *g,\n"
30747 " const char *dir);\n"
30752 #: ../src/guestfs-actions.pod:6066
30754 "This function is primarily intended for use by programs. To get a simple "
30755 "list of names, use C<guestfs_ls>. To get a printable directory for human "
30756 "consumption, use C<guestfs_ll>."
30760 #: ../src/guestfs-actions.pod:6070
30762 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
30763 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
30767 #: ../src/guestfs-actions.pod:6076
30768 msgid "guestfs_readlink"
30772 #: ../src/guestfs-actions.pod:6078
30776 " guestfs_readlink (guestfs_h *g,\n"
30777 " const char *path);\n"
30782 #: ../src/guestfs-actions.pod:6089
30783 msgid "guestfs_readlinklist"
30787 #: ../src/guestfs-actions.pod:6091
30791 " guestfs_readlinklist (guestfs_h *g,\n"
30792 " const char *path,\n"
30793 " char *const *names);\n"
30798 #: ../src/guestfs-actions.pod:6124
30799 msgid "guestfs_realpath"
30803 #: ../src/guestfs-actions.pod:6126
30807 " guestfs_realpath (guestfs_h *g,\n"
30808 " const char *path);\n"
30813 #: ../src/guestfs-actions.pod:6138
30814 msgid "guestfs_removexattr"
30818 #: ../src/guestfs-actions.pod:6140
30822 " guestfs_removexattr (guestfs_h *g,\n"
30823 " const char *xattr,\n"
30824 " const char *path);\n"
30829 #: ../src/guestfs-actions.pod:6148
30830 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
30834 #: ../src/guestfs-actions.pod:6154
30835 msgid "guestfs_resize2fs"
30839 #: ../src/guestfs-actions.pod:6156
30843 " guestfs_resize2fs (guestfs_h *g,\n"
30844 " const char *device);\n"
30849 #: ../src/guestfs-actions.pod:6163
30851 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
30852 "C<device> before calling this command. For unknown reasons C<resize2fs> "
30853 "sometimes gives an error about this and sometimes not. In any case, it is "
30854 "always safe to call C<guestfs_e2fsck_f> before calling this function."
30858 #: ../src/guestfs-actions.pod:6173
30859 msgid "guestfs_resize2fs_M"
30863 #: ../src/guestfs-actions.pod:6175
30867 " guestfs_resize2fs_M (guestfs_h *g,\n"
30868 " const char *device);\n"
30873 #: ../src/guestfs-actions.pod:6179
30875 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
30876 "resized to its minimum size. This works like the I<-M> option to the "
30877 "C<resize2fs> command."
30881 #: ../src/guestfs-actions.pod:6183
30883 "To get the resulting size of the filesystem you should call "
30884 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
30885 "These two numbers, multiplied together, give the resulting size of the "
30886 "minimal filesystem in bytes."
30890 #: ../src/guestfs-actions.pod:6192
30891 msgid "guestfs_resize2fs_size"
30895 #: ../src/guestfs-actions.pod:6194
30899 " guestfs_resize2fs_size (guestfs_h *g,\n"
30900 " const char *device,\n"
30901 " int64_t size);\n"
30906 #: ../src/guestfs-actions.pod:6199
30908 "This command is the same as C<guestfs_resize2fs> except that it allows you "
30909 "to specify the new size (in bytes) explicitly."
30913 #: ../src/guestfs-actions.pod:6206
30918 #: ../src/guestfs-actions.pod:6208
30922 " guestfs_rm (guestfs_h *g,\n"
30923 " const char *path);\n"
30928 #: ../src/guestfs-actions.pod:6218
30929 msgid "guestfs_rm_rf"
30933 #: ../src/guestfs-actions.pod:6220
30937 " guestfs_rm_rf (guestfs_h *g,\n"
30938 " const char *path);\n"
30943 #: ../src/guestfs-actions.pod:6232
30944 msgid "guestfs_rmdir"
30948 #: ../src/guestfs-actions.pod:6234
30952 " guestfs_rmdir (guestfs_h *g,\n"
30953 " const char *path);\n"
30958 #: ../src/guestfs-actions.pod:6244
30959 msgid "guestfs_rmmountpoint"
30963 #: ../src/guestfs-actions.pod:6246
30967 " guestfs_rmmountpoint (guestfs_h *g,\n"
30968 " const char *exemptpath);\n"
30973 #: ../src/guestfs-actions.pod:6250
30975 "This calls removes a mountpoint that was previously created with "
30976 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
30980 #: ../src/guestfs-actions.pod:6258
30981 msgid "guestfs_scrub_device"
30985 #: ../src/guestfs-actions.pod:6260
30989 " guestfs_scrub_device (guestfs_h *g,\n"
30990 " const char *device);\n"
30995 #: ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6293
30996 #: ../src/guestfs-actions.pod:6312
30997 msgid "(Added in 1.0.52)"
31001 #: ../src/guestfs-actions.pod:6277
31002 msgid "guestfs_scrub_file"
31006 #: ../src/guestfs-actions.pod:6279
31010 " guestfs_scrub_file (guestfs_h *g,\n"
31011 " const char *file);\n"
31016 #: ../src/guestfs-actions.pod:6295
31017 msgid "guestfs_scrub_freespace"
31021 #: ../src/guestfs-actions.pod:6297
31025 " guestfs_scrub_freespace (guestfs_h *g,\n"
31026 " const char *dir);\n"
31031 #: ../src/guestfs-actions.pod:6301
31033 "This command creates the directory C<dir> and then fills it with files until "
31034 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
31035 "and deletes them. The intention is to scrub any free space on the partition "
31036 "containing C<dir>."
31040 #: ../src/guestfs-actions.pod:6314
31041 msgid "guestfs_set_append"
31045 #: ../src/guestfs-actions.pod:6316
31049 " guestfs_set_append (guestfs_h *g,\n"
31050 " const char *append);\n"
31055 #: ../src/guestfs-actions.pod:6333
31056 msgid "guestfs_set_attach_method"
31060 #: ../src/guestfs-actions.pod:6335
31064 " guestfs_set_attach_method (guestfs_h *g,\n"
31065 " const char *attachmethod);\n"
31070 #: ../src/guestfs-actions.pod:6363
31071 msgid "guestfs_set_autosync"
31075 #: ../src/guestfs-actions.pod:6365
31079 " guestfs_set_autosync (guestfs_h *g,\n"
31080 " int autosync);\n"
31085 #: ../src/guestfs-actions.pod:6381
31086 msgid "guestfs_set_direct"
31090 #: ../src/guestfs-actions.pod:6383
31094 " guestfs_set_direct (guestfs_h *g,\n"
31100 #: ../src/guestfs-actions.pod:6391
31102 "One consequence of this is that log messages aren't caught by the library "
31103 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
31108 #: ../src/guestfs-actions.pod:6404
31109 msgid "guestfs_set_e2label"
31113 #: ../src/guestfs-actions.pod:6406
31117 " guestfs_set_e2label (guestfs_h *g,\n"
31118 " const char *device,\n"
31119 " const char *label);\n"
31124 #: ../src/guestfs-actions.pod:6415
31126 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
31127 "the existing label on a filesystem."
31131 #: ../src/guestfs-actions.pod:6422
31132 msgid "guestfs_set_e2uuid"
31136 #: ../src/guestfs-actions.pod:6424
31140 " guestfs_set_e2uuid (guestfs_h *g,\n"
31141 " const char *device,\n"
31142 " const char *uuid);\n"
31147 #: ../src/guestfs-actions.pod:6434
31149 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
31150 "the existing UUID of a filesystem."
31154 #: ../src/guestfs-actions.pod:6441
31155 msgid "guestfs_set_memsize"
31159 #: ../src/guestfs-actions.pod:6443
31163 " guestfs_set_memsize (guestfs_h *g,\n"
31169 #: ../src/guestfs-actions.pod:6447
31171 "This sets the memory size in megabytes allocated to the qemu subprocess. "
31172 "This only has any effect if called before C<guestfs_launch>."
31176 #: ../src/guestfs-actions.pod:6462
31177 msgid "guestfs_set_network"
31181 #: ../src/guestfs-actions.pod:6464
31185 " guestfs_set_network (guestfs_h *g,\n"
31191 #: ../src/guestfs-actions.pod:6474
31193 "You must call this before calling C<guestfs_launch>, otherwise it has no "
31198 #: ../src/guestfs-actions.pod:6481
31199 msgid "guestfs_set_path"
31203 #: ../src/guestfs-actions.pod:6483
31207 " guestfs_set_path (guestfs_h *g,\n"
31208 " const char *searchpath);\n"
31213 #: ../src/guestfs-actions.pod:6498
31214 msgid "guestfs_set_pgroup"
31218 #: ../src/guestfs-actions.pod:6500
31222 " guestfs_set_pgroup (guestfs_h *g,\n"
31228 #: ../src/guestfs-actions.pod:6517
31229 msgid "guestfs_set_qemu"
31233 #: ../src/guestfs-actions.pod:6519
31237 " guestfs_set_qemu (guestfs_h *g,\n"
31238 " const char *qemu);\n"
31243 #: ../src/guestfs-actions.pod:6545
31244 msgid "guestfs_set_recovery_proc"
31248 #: ../src/guestfs-actions.pod:6547
31252 " guestfs_set_recovery_proc (guestfs_h *g,\n"
31253 " int recoveryproc);\n"
31258 #: ../src/guestfs-actions.pod:6551
31260 "If this is called with the parameter C<false> then C<guestfs_launch> does "
31261 "not create a recovery process. The purpose of the recovery process is to "
31262 "stop runaway qemu processes in the case where the main program aborts "
31267 #: ../src/guestfs-actions.pod:6556
31269 "This only has any effect if called before C<guestfs_launch>, and the default "
31274 #: ../src/guestfs-actions.pod:6569
31275 msgid "guestfs_set_selinux"
31279 #: ../src/guestfs-actions.pod:6571
31283 " guestfs_set_selinux (guestfs_h *g,\n"
31289 #: ../src/guestfs-actions.pod:6588
31290 msgid "guestfs_set_smp"
31294 #: ../src/guestfs-actions.pod:6590
31298 " guestfs_set_smp (guestfs_h *g,\n"
31304 #: ../src/guestfs-actions.pod:6598
31305 msgid "This function must be called before C<guestfs_launch>."
31309 #: ../src/guestfs-actions.pod:6604
31310 msgid "guestfs_set_trace"
31314 #: ../src/guestfs-actions.pod:6606
31318 " guestfs_set_trace (guestfs_h *g,\n"
31324 #: ../src/guestfs-actions.pod:6620
31326 "Trace messages are normally sent to C<stderr>, unless you register a "
31327 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
31331 #: ../src/guestfs-actions.pod:6628
31332 msgid "guestfs_set_verbose"
31336 #: ../src/guestfs-actions.pod:6630
31340 " guestfs_set_verbose (guestfs_h *g,\n"
31346 #: ../src/guestfs-actions.pod:6639
31348 "Verbose messages are normally sent to C<stderr>, unless you register a "
31349 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
31353 #: ../src/guestfs-actions.pod:6647
31354 msgid "guestfs_setcon"
31358 #: ../src/guestfs-actions.pod:6649
31362 " guestfs_setcon (guestfs_h *g,\n"
31363 " const char *context);\n"
31368 #: ../src/guestfs-actions.pod:6662
31369 msgid "guestfs_setxattr"
31373 #: ../src/guestfs-actions.pod:6664
31377 " guestfs_setxattr (guestfs_h *g,\n"
31378 " const char *xattr,\n"
31379 " const char *val,\n"
31381 " const char *path);\n"
31386 #: ../src/guestfs-actions.pod:6675
31387 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
31391 #: ../src/guestfs-actions.pod:6681
31392 msgid "guestfs_sfdisk"
31396 #: ../src/guestfs-actions.pod:6683
31400 " guestfs_sfdisk (guestfs_h *g,\n"
31401 " const char *device,\n"
31405 " char *const *lines);\n"
31410 #: ../src/guestfs-actions.pod:6691 ../src/guestfs-actions.pod:6735
31411 #: ../src/guestfs-actions.pod:6769
31413 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
31418 #: ../src/guestfs-actions.pod:6718
31420 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
31424 #: ../src/guestfs-actions.pod:6728
31425 msgid "guestfs_sfdiskM"
31429 #: ../src/guestfs-actions.pod:6730
31433 " guestfs_sfdiskM (guestfs_h *g,\n"
31434 " const char *device,\n"
31435 " char *const *lines);\n"
31440 #: ../src/guestfs-actions.pod:6742
31442 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
31443 "partition sizes are specified in megabytes only (rounded to the nearest "
31444 "cylinder) and you don't need to specify the cyls, heads and sectors "
31445 "parameters which were rarely if ever used anyway."
31449 #: ../src/guestfs-actions.pod:6748
31451 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
31452 "C<guestfs_part_disk>"
31456 #: ../src/guestfs-actions.pod:6758
31457 msgid "guestfs_sfdisk_N"
31461 #: ../src/guestfs-actions.pod:6760
31465 " guestfs_sfdisk_N (guestfs_h *g,\n"
31466 " const char *device,\n"
31471 " const char *line);\n"
31476 #: ../src/guestfs-actions.pod:6779
31478 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
31479 "for the cyls/heads/sectors parameters."
31483 #: ../src/guestfs-actions.pod:6782
31484 msgid "See also: C<guestfs_part_add>"
31488 #: ../src/guestfs-actions.pod:6791
31489 msgid "guestfs_sfdisk_disk_geometry"
31493 #: ../src/guestfs-actions.pod:6793
31497 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
31498 " const char *device);\n"
31503 #: ../src/guestfs-actions.pod:6797
31505 "This displays the disk geometry of C<device> read from the partition table. "
31506 "Especially in the case where the underlying block device has been resized, "
31507 "this can be different from the kernel's idea of the geometry (see "
31508 "C<guestfs_sfdisk_kernel_geometry>)."
31512 #: ../src/guestfs-actions.pod:6810
31513 msgid "guestfs_sfdisk_kernel_geometry"
31517 #: ../src/guestfs-actions.pod:6812
31521 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
31522 " const char *device);\n"
31527 #: ../src/guestfs-actions.pod:6826
31528 msgid "guestfs_sfdisk_l"
31532 #: ../src/guestfs-actions.pod:6828
31536 " guestfs_sfdisk_l (guestfs_h *g,\n"
31537 " const char *device);\n"
31542 #: ../src/guestfs-actions.pod:6832
31544 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
31549 #: ../src/guestfs-actions.pod:6843
31550 msgid "See also: C<guestfs_part_list>"
31554 #: ../src/guestfs-actions.pod:6850
31559 #: ../src/guestfs-actions.pod:6852
31563 " guestfs_sh (guestfs_h *g,\n"
31564 " const char *command);\n"
31569 #: ../src/guestfs-actions.pod:6859
31570 msgid "This is like C<guestfs_command>, but passes the command to:"
31574 #: ../src/guestfs-actions.pod:6867
31575 msgid "All the provisos about C<guestfs_command> apply to this call."
31579 #: ../src/guestfs-actions.pod:6874
31580 msgid "guestfs_sh_lines"
31584 #: ../src/guestfs-actions.pod:6876
31588 " guestfs_sh_lines (guestfs_h *g,\n"
31589 " const char *command);\n"
31594 #: ../src/guestfs-actions.pod:6880
31596 "This is the same as C<guestfs_sh>, but splits the result into a list of "
31601 #: ../src/guestfs-actions.pod:6883
31602 msgid "See also: C<guestfs_command_lines>"
31606 #: ../src/guestfs-actions.pod:6891
31607 msgid "guestfs_sleep"
31611 #: ../src/guestfs-actions.pod:6893
31615 " guestfs_sleep (guestfs_h *g,\n"
31621 #: ../src/guestfs-actions.pod:6901
31622 msgid "(Added in 1.0.41)"
31626 #: ../src/guestfs-actions.pod:6903 ../src/guestfs-structs.pod:109
31627 msgid "guestfs_stat"
31631 #: ../src/guestfs-actions.pod:6905
31634 " struct guestfs_stat *\n"
31635 " guestfs_stat (guestfs_h *g,\n"
31636 " const char *path);\n"
31641 #: ../src/guestfs-actions.pod:6919 ../src/guestfs-structs.pod:135
31642 msgid "guestfs_statvfs"
31646 #: ../src/guestfs-actions.pod:6921
31649 " struct guestfs_statvfs *\n"
31650 " guestfs_statvfs (guestfs_h *g,\n"
31651 " const char *path);\n"
31656 #: ../src/guestfs-actions.pod:6931
31658 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
31659 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
31663 #: ../src/guestfs-actions.pod:6937
31664 msgid "guestfs_strings"
31668 #: ../src/guestfs-actions.pod:6939
31672 " guestfs_strings (guestfs_h *g,\n"
31673 " const char *path);\n"
31678 #: ../src/guestfs-actions.pod:6955
31679 msgid "guestfs_strings_e"
31683 #: ../src/guestfs-actions.pod:6957
31687 " guestfs_strings_e (guestfs_h *g,\n"
31688 " const char *encoding,\n"
31689 " const char *path);\n"
31694 #: ../src/guestfs-actions.pod:6962
31696 "This is like the C<guestfs_strings> command, but allows you to specify the "
31697 "encoding of strings that are looked for in the source file C<path>."
31701 #: ../src/guestfs-actions.pod:6972
31703 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
31704 "ISO-8859-X (this is what C<guestfs_strings> uses)."
31708 #: ../src/guestfs-actions.pod:7010
31709 msgid "guestfs_swapoff_device"
31713 #: ../src/guestfs-actions.pod:7012
31717 " guestfs_swapoff_device (guestfs_h *g,\n"
31718 " const char *device);\n"
31723 #: ../src/guestfs-actions.pod:7016
31725 "This command disables the libguestfs appliance swap device or partition "
31726 "named C<device>. See C<guestfs_swapon_device>."
31730 #: ../src/guestfs-actions.pod:7024
31731 msgid "guestfs_swapoff_file"
31735 #: ../src/guestfs-actions.pod:7026
31739 " guestfs_swapoff_file (guestfs_h *g,\n"
31740 " const char *file);\n"
31745 #: ../src/guestfs-actions.pod:7036
31746 msgid "guestfs_swapoff_label"
31750 #: ../src/guestfs-actions.pod:7038
31754 " guestfs_swapoff_label (guestfs_h *g,\n"
31755 " const char *label);\n"
31760 #: ../src/guestfs-actions.pod:7049
31761 msgid "guestfs_swapoff_uuid"
31765 #: ../src/guestfs-actions.pod:7051
31769 " guestfs_swapoff_uuid (guestfs_h *g,\n"
31770 " const char *uuid);\n"
31775 #: ../src/guestfs-actions.pod:7062
31776 msgid "guestfs_swapon_device"
31780 #: ../src/guestfs-actions.pod:7064
31784 " guestfs_swapon_device (guestfs_h *g,\n"
31785 " const char *device);\n"
31790 #: ../src/guestfs-actions.pod:7068
31792 "This command enables the libguestfs appliance to use the swap device or "
31793 "partition named C<device>. The increased memory is made available for all "
31794 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
31798 #: ../src/guestfs-actions.pod:7084
31799 msgid "guestfs_swapon_file"
31803 #: ../src/guestfs-actions.pod:7086
31807 " guestfs_swapon_file (guestfs_h *g,\n"
31808 " const char *file);\n"
31813 #: ../src/guestfs-actions.pod:7090
31815 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
31820 #: ../src/guestfs-actions.pod:7097
31821 msgid "guestfs_swapon_label"
31825 #: ../src/guestfs-actions.pod:7099
31829 " guestfs_swapon_label (guestfs_h *g,\n"
31830 " const char *label);\n"
31835 #: ../src/guestfs-actions.pod:7103
31837 "This command enables swap to a labeled swap partition. See "
31838 "C<guestfs_swapon_device> for other notes."
31842 #: ../src/guestfs-actions.pod:7110
31843 msgid "guestfs_swapon_uuid"
31847 #: ../src/guestfs-actions.pod:7112
31851 " guestfs_swapon_uuid (guestfs_h *g,\n"
31852 " const char *uuid);\n"
31857 #: ../src/guestfs-actions.pod:7116
31859 "This command enables swap to a swap partition with the given UUID. See "
31860 "C<guestfs_swapon_device> for other notes."
31864 #: ../src/guestfs-actions.pod:7123
31865 msgid "guestfs_sync"
31869 #: ../src/guestfs-actions.pod:7125
31873 " guestfs_sync (guestfs_h *g);\n"
31878 #: ../src/guestfs-actions.pod:7138
31879 msgid "guestfs_tail"
31883 #: ../src/guestfs-actions.pod:7140
31887 " guestfs_tail (guestfs_h *g,\n"
31888 " const char *path);\n"
31893 #: ../src/guestfs-actions.pod:7156
31894 msgid "guestfs_tail_n"
31898 #: ../src/guestfs-actions.pod:7158
31902 " guestfs_tail_n (guestfs_h *g,\n"
31904 " const char *path);\n"
31909 #: ../src/guestfs-actions.pod:7180
31910 msgid "guestfs_tar_in"
31914 #: ../src/guestfs-actions.pod:7182
31918 " guestfs_tar_in (guestfs_h *g,\n"
31919 " const char *tarfile,\n"
31920 " const char *directory);\n"
31925 #: ../src/guestfs-actions.pod:7190
31927 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
31931 #: ../src/guestfs-actions.pod:7195 ../src/guestfs-actions.pod:7212
31932 #: ../src/guestfs-actions.pod:7228 ../src/guestfs-actions.pod:7244
31933 msgid "(Added in 1.0.3)"
31937 #: ../src/guestfs-actions.pod:7197
31938 msgid "guestfs_tar_out"
31942 #: ../src/guestfs-actions.pod:7199
31946 " guestfs_tar_out (guestfs_h *g,\n"
31947 " const char *directory,\n"
31948 " const char *tarfile);\n"
31953 #: ../src/guestfs-actions.pod:7207
31955 "To download a compressed tarball, use C<guestfs_tgz_out> or "
31956 "C<guestfs_txz_out>."
31960 #: ../src/guestfs-actions.pod:7214
31961 msgid "guestfs_tgz_in"
31965 #: ../src/guestfs-actions.pod:7216
31969 " guestfs_tgz_in (guestfs_h *g,\n"
31970 " const char *tarball,\n"
31971 " const char *directory);\n"
31976 #: ../src/guestfs-actions.pod:7224
31977 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
31981 #: ../src/guestfs-actions.pod:7230
31982 msgid "guestfs_tgz_out"
31986 #: ../src/guestfs-actions.pod:7232
31990 " guestfs_tgz_out (guestfs_h *g,\n"
31991 " const char *directory,\n"
31992 " const char *tarball);\n"
31997 #: ../src/guestfs-actions.pod:7240
31998 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
32002 #: ../src/guestfs-actions.pod:7246
32003 msgid "guestfs_touch"
32007 #: ../src/guestfs-actions.pod:7248
32011 " guestfs_touch (guestfs_h *g,\n"
32012 " const char *path);\n"
32017 #: ../src/guestfs-actions.pod:7263
32018 msgid "guestfs_truncate"
32022 #: ../src/guestfs-actions.pod:7265
32026 " guestfs_truncate (guestfs_h *g,\n"
32027 " const char *path);\n"
32032 #: ../src/guestfs-actions.pod:7276
32033 msgid "guestfs_truncate_size"
32037 #: ../src/guestfs-actions.pod:7278
32041 " guestfs_truncate_size (guestfs_h *g,\n"
32042 " const char *path,\n"
32043 " int64_t size);\n"
32048 #: ../src/guestfs-actions.pod:7286
32050 "If the current file size is less than C<size> then the file is extended to "
32051 "the required size with zero bytes. This creates a sparse file (ie. disk "
32052 "blocks are not allocated for the file until you write to it). To create a "
32053 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
32057 #: ../src/guestfs-actions.pod:7296
32058 msgid "guestfs_tune2fs_l"
32062 #: ../src/guestfs-actions.pod:7298
32066 " guestfs_tune2fs_l (guestfs_h *g,\n"
32067 " const char *device);\n"
32072 #: ../src/guestfs-actions.pod:7318
32073 msgid "guestfs_txz_in"
32077 #: ../src/guestfs-actions.pod:7320
32081 " guestfs_txz_in (guestfs_h *g,\n"
32082 " const char *tarball,\n"
32083 " const char *directory);\n"
32088 #: ../src/guestfs-actions.pod:7332
32089 msgid "guestfs_txz_out"
32093 #: ../src/guestfs-actions.pod:7334
32097 " guestfs_txz_out (guestfs_h *g,\n"
32098 " const char *directory,\n"
32099 " const char *tarball);\n"
32104 #: ../src/guestfs-actions.pod:7346
32105 msgid "guestfs_umask"
32109 #: ../src/guestfs-actions.pod:7348
32113 " guestfs_umask (guestfs_h *g,\n"
32119 #: ../src/guestfs-actions.pod:7364
32121 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
32122 "C<guestfs_mkdir>."
32126 #: ../src/guestfs-actions.pod:7373
32127 msgid "guestfs_umount"
32131 #: ../src/guestfs-actions.pod:7375
32135 " guestfs_umount (guestfs_h *g,\n"
32136 " const char *pathordevice);\n"
32141 #: ../src/guestfs-actions.pod:7387
32142 msgid "guestfs_umount_all"
32146 #: ../src/guestfs-actions.pod:7389
32150 " guestfs_umount_all (guestfs_h *g);\n"
32155 #: ../src/guestfs-actions.pod:7400
32156 msgid "guestfs_upload"
32160 #: ../src/guestfs-actions.pod:7402
32164 " guestfs_upload (guestfs_h *g,\n"
32165 " const char *filename,\n"
32166 " const char *remotefilename);\n"
32171 #: ../src/guestfs-actions.pod:7412
32172 msgid "See also C<guestfs_download>."
32176 #: ../src/guestfs-actions.pod:7423
32177 msgid "guestfs_upload_offset"
32181 #: ../src/guestfs-actions.pod:7425
32185 " guestfs_upload_offset (guestfs_h *g,\n"
32186 " const char *filename,\n"
32187 " const char *remotefilename,\n"
32188 " int64_t offset);\n"
32193 #: ../src/guestfs-actions.pod:7441
32195 "Note that there is no limit on the amount of data that can be uploaded with "
32196 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
32197 "full amount unless an error occurs."
32201 #: ../src/guestfs-actions.pod:7446
32202 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
32206 #: ../src/guestfs-actions.pod:7457
32207 msgid "guestfs_utimens"
32211 #: ../src/guestfs-actions.pod:7459
32215 " guestfs_utimens (guestfs_h *g,\n"
32216 " const char *path,\n"
32217 " int64_t atsecs,\n"
32218 " int64_t atnsecs,\n"
32219 " int64_t mtsecs,\n"
32220 " int64_t mtnsecs);\n"
32225 #: ../src/guestfs-actions.pod:7488 ../src/guestfs-structs.pod:175
32226 msgid "guestfs_version"
32230 #: ../src/guestfs-actions.pod:7490
32233 " struct guestfs_version *\n"
32234 " guestfs_version (guestfs_h *g);\n"
32239 #: ../src/guestfs-actions.pod:7518
32241 "I<Note:> Don't use this call to test for availability of features. In "
32242 "enterprise distributions we backport features from later versions into "
32243 "earlier versions, making this an unreliable way to test for features. Use "
32244 "C<guestfs_available> instead."
32248 #: ../src/guestfs-actions.pod:7524
32250 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
32251 "error. I<The caller must call C<guestfs_free_version> after use>."
32255 #: ../src/guestfs-actions.pod:7528
32256 msgid "(Added in 1.0.58)"
32260 #: ../src/guestfs-actions.pod:7530
32261 msgid "guestfs_vfs_label"
32265 #: ../src/guestfs-actions.pod:7532
32269 " guestfs_vfs_label (guestfs_h *g,\n"
32270 " const char *device);\n"
32275 #: ../src/guestfs-actions.pod:7541
32276 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
32280 #: ../src/guestfs-actions.pod:7546 ../src/guestfs-actions.pod:7583
32281 msgid "(Added in 1.3.18)"
32285 #: ../src/guestfs-actions.pod:7548
32286 msgid "guestfs_vfs_type"
32290 #: ../src/guestfs-actions.pod:7550
32294 " guestfs_vfs_type (guestfs_h *g,\n"
32295 " const char *device);\n"
32300 #: ../src/guestfs-actions.pod:7567
32301 msgid "guestfs_vfs_uuid"
32305 #: ../src/guestfs-actions.pod:7569
32309 " guestfs_vfs_uuid (guestfs_h *g,\n"
32310 " const char *device);\n"
32315 #: ../src/guestfs-actions.pod:7578
32316 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
32320 #: ../src/guestfs-actions.pod:7585
32321 msgid "guestfs_vg_activate"
32325 #: ../src/guestfs-actions.pod:7587
32329 " guestfs_vg_activate (guestfs_h *g,\n"
32331 " char *const *volgroups);\n"
32336 #: ../src/guestfs-actions.pod:7604
32337 msgid "guestfs_vg_activate_all"
32341 #: ../src/guestfs-actions.pod:7606
32345 " guestfs_vg_activate_all (guestfs_h *g,\n"
32346 " int activate);\n"
32351 #: ../src/guestfs-actions.pod:7619
32352 msgid "guestfs_vgcreate"
32356 #: ../src/guestfs-actions.pod:7621
32360 " guestfs_vgcreate (guestfs_h *g,\n"
32361 " const char *volgroup,\n"
32362 " char *const *physvols);\n"
32367 #: ../src/guestfs-actions.pod:7633
32368 msgid "guestfs_vglvuuids"
32372 #: ../src/guestfs-actions.pod:7635
32376 " guestfs_vglvuuids (guestfs_h *g,\n"
32377 " const char *vgname);\n"
32382 #: ../src/guestfs-actions.pod:7642
32384 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
32385 "associate logical volumes and volume groups."
32389 #: ../src/guestfs-actions.pod:7645
32390 msgid "See also C<guestfs_vgpvuuids>."
32394 #: ../src/guestfs-actions.pod:7653
32395 msgid "guestfs_vgpvuuids"
32399 #: ../src/guestfs-actions.pod:7655
32403 " guestfs_vgpvuuids (guestfs_h *g,\n"
32404 " const char *vgname);\n"
32409 #: ../src/guestfs-actions.pod:7662
32411 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
32412 "associate physical volumes and volume groups."
32416 #: ../src/guestfs-actions.pod:7665
32417 msgid "See also C<guestfs_vglvuuids>."
32421 #: ../src/guestfs-actions.pod:7673
32422 msgid "guestfs_vgremove"
32426 #: ../src/guestfs-actions.pod:7675
32430 " guestfs_vgremove (guestfs_h *g,\n"
32431 " const char *vgname);\n"
32436 #: ../src/guestfs-actions.pod:7688
32437 msgid "guestfs_vgrename"
32441 #: ../src/guestfs-actions.pod:7690
32445 " guestfs_vgrename (guestfs_h *g,\n"
32446 " const char *volgroup,\n"
32447 " const char *newvolgroup);\n"
32452 #: ../src/guestfs-actions.pod:7701
32453 msgid "guestfs_vgs"
32457 #: ../src/guestfs-actions.pod:7703
32461 " guestfs_vgs (guestfs_h *g);\n"
32466 #: ../src/guestfs-actions.pod:7712
32467 msgid "See also C<guestfs_vgs_full>."
32471 #: ../src/guestfs-actions.pod:7720
32472 msgid "guestfs_vgs_full"
32476 #: ../src/guestfs-actions.pod:7722
32479 " struct guestfs_lvm_vg_list *\n"
32480 " guestfs_vgs_full (guestfs_h *g);\n"
32485 #: ../src/guestfs-actions.pod:7728
32487 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
32488 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
32492 #: ../src/guestfs-actions.pod:7734
32493 msgid "guestfs_vgscan"
32497 #: ../src/guestfs-actions.pod:7736
32501 " guestfs_vgscan (guestfs_h *g);\n"
32506 #: ../src/guestfs-actions.pod:7746
32507 msgid "guestfs_vguuid"
32511 #: ../src/guestfs-actions.pod:7748
32515 " guestfs_vguuid (guestfs_h *g,\n"
32516 " const char *vgname);\n"
32521 #: ../src/guestfs-actions.pod:7759
32522 msgid "guestfs_wait_ready"
32526 #: ../src/guestfs-actions.pod:7761
32530 " guestfs_wait_ready (guestfs_h *g);\n"
32535 #: ../src/guestfs-actions.pod:7764
32537 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
32542 #: ../src/guestfs-actions.pod:7771
32543 msgid "This function is a no op."
32547 #: ../src/guestfs-actions.pod:7773
32549 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
32550 "calling C<guestfs_launch> to wait for the launch to complete. However this "
32551 "is no longer necessary because C<guestfs_launch> now does the waiting."
32555 #: ../src/guestfs-actions.pod:7778
32557 "If you see any calls to this function in code then you can just remove them, "
32558 "unless you want to retain compatibility with older versions of the API."
32562 #: ../src/guestfs-actions.pod:7786
32563 msgid "guestfs_wc_c"
32567 #: ../src/guestfs-actions.pod:7788
32571 " guestfs_wc_c (guestfs_h *g,\n"
32572 " const char *path);\n"
32577 #: ../src/guestfs-actions.pod:7799
32578 msgid "guestfs_wc_l"
32582 #: ../src/guestfs-actions.pod:7801
32586 " guestfs_wc_l (guestfs_h *g,\n"
32587 " const char *path);\n"
32592 #: ../src/guestfs-actions.pod:7812
32593 msgid "guestfs_wc_w"
32597 #: ../src/guestfs-actions.pod:7814
32601 " guestfs_wc_w (guestfs_h *g,\n"
32602 " const char *path);\n"
32607 #: ../src/guestfs-actions.pod:7825
32608 msgid "guestfs_write"
32612 #: ../src/guestfs-actions.pod:7827
32616 " guestfs_write (guestfs_h *g,\n"
32617 " const char *path,\n"
32618 " const char *content,\n"
32619 " size_t content_size);\n"
32624 #: ../src/guestfs-actions.pod:7836
32625 msgid "See also C<guestfs_write_append>."
32629 #: ../src/guestfs-actions.pod:7845
32630 msgid "guestfs_write_append"
32634 #: ../src/guestfs-actions.pod:7847
32638 " guestfs_write_append (guestfs_h *g,\n"
32639 " const char *path,\n"
32640 " const char *content,\n"
32641 " size_t content_size);\n"
32646 #: ../src/guestfs-actions.pod:7856
32647 msgid "See also C<guestfs_write>."
32651 #: ../src/guestfs-actions.pod:7865
32652 msgid "guestfs_write_file"
32656 #: ../src/guestfs-actions.pod:7867
32660 " guestfs_write_file (guestfs_h *g,\n"
32661 " const char *path,\n"
32662 " const char *content,\n"
32668 #: ../src/guestfs-actions.pod:7873
32670 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
32675 #: ../src/guestfs-actions.pod:7898
32676 msgid "guestfs_zegrep"
32680 #: ../src/guestfs-actions.pod:7900
32684 " guestfs_zegrep (guestfs_h *g,\n"
32685 " const char *regex,\n"
32686 " const char *path);\n"
32691 #: ../src/guestfs-actions.pod:7917
32692 msgid "guestfs_zegrepi"
32696 #: ../src/guestfs-actions.pod:7919
32700 " guestfs_zegrepi (guestfs_h *g,\n"
32701 " const char *regex,\n"
32702 " const char *path);\n"
32707 #: ../src/guestfs-actions.pod:7936
32708 msgid "guestfs_zero"
32712 #: ../src/guestfs-actions.pod:7938
32716 " guestfs_zero (guestfs_h *g,\n"
32717 " const char *device);\n"
32722 #: ../src/guestfs-actions.pod:7952
32724 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
32725 "C<guestfs_is_zero_device>"
32729 #: ../src/guestfs-actions.pod:7964
32730 msgid "guestfs_zero_device"
32734 #: ../src/guestfs-actions.pod:7966
32738 " guestfs_zero_device (guestfs_h *g,\n"
32739 " const char *device);\n"
32744 #: ../src/guestfs-actions.pod:7970
32746 "This command writes zeroes over the entire C<device>. Compare with "
32747 "C<guestfs_zero> which just zeroes the first few blocks of a device."
32751 #: ../src/guestfs-actions.pod:7988
32752 msgid "(Added in 1.3.1)"
32756 #: ../src/guestfs-actions.pod:7990
32757 msgid "guestfs_zerofree"
32761 #: ../src/guestfs-actions.pod:7992
32765 " guestfs_zerofree (guestfs_h *g,\n"
32766 " const char *device);\n"
32771 #: ../src/guestfs-actions.pod:8011
32772 msgid "guestfs_zfgrep"
32776 #: ../src/guestfs-actions.pod:8013
32780 " guestfs_zfgrep (guestfs_h *g,\n"
32781 " const char *pattern,\n"
32782 " const char *path);\n"
32787 #: ../src/guestfs-actions.pod:8030
32788 msgid "guestfs_zfgrepi"
32792 #: ../src/guestfs-actions.pod:8032
32796 " guestfs_zfgrepi (guestfs_h *g,\n"
32797 " const char *pattern,\n"
32798 " const char *path);\n"
32803 #: ../src/guestfs-actions.pod:8049
32804 msgid "guestfs_zfile"
32808 #: ../src/guestfs-actions.pod:8051
32812 " guestfs_zfile (guestfs_h *g,\n"
32813 " const char *meth,\n"
32814 " const char *path);\n"
32819 #: ../src/guestfs-actions.pod:8056
32821 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
32826 #: ../src/guestfs-actions.pod:8068
32828 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
32833 #: ../src/guestfs-actions.pod:8076
32834 msgid "guestfs_zgrep"
32838 #: ../src/guestfs-actions.pod:8078
32842 " guestfs_zgrep (guestfs_h *g,\n"
32843 " const char *regex,\n"
32844 " const char *path);\n"
32849 #: ../src/guestfs-actions.pod:8095
32850 msgid "guestfs_zgrepi"
32854 #: ../src/guestfs-actions.pod:8097
32858 " guestfs_zgrepi (guestfs_h *g,\n"
32859 " const char *regex,\n"
32860 " const char *path);\n"
32865 #: ../src/guestfs-availability.pod:3
32870 #: ../src/guestfs-availability.pod:5
32872 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
32873 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
32874 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
32875 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
32876 "L</guestfs_aug_save> L</guestfs_aug_set>"
32880 #: ../src/guestfs-availability.pod:21
32885 #: ../src/guestfs-availability.pod:23
32886 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
32890 #: ../src/guestfs-availability.pod:26
32895 #: ../src/guestfs-availability.pod:28
32896 msgid "The following functions: L</guestfs_grub_install>"
32900 #: ../src/guestfs-availability.pod:31
32905 #: ../src/guestfs-availability.pod:33
32907 "The following functions: L</guestfs_inotify_add_watch> L</"
32908 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
32909 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
32913 #: ../src/guestfs-availability.pod:41
32914 msgid "B<linuxfsuuid>"
32918 #: ../src/guestfs-availability.pod:43
32920 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
32921 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
32925 #: ../src/guestfs-availability.pod:50
32926 msgid "B<linuxmodules>"
32930 #: ../src/guestfs-availability.pod:52
32931 msgid "The following functions: L</guestfs_modprobe>"
32935 #: ../src/guestfs-availability.pod:55
32936 msgid "B<linuxxattrs>"
32940 #: ../src/guestfs-availability.pod:57
32942 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
32943 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
32944 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
32945 "guestfs_setxattr>"
32949 #: ../src/guestfs-availability.pod:68
32954 #: ../src/guestfs-availability.pod:70
32956 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
32957 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
32958 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
32962 #: ../src/guestfs-availability.pod:79
32967 #: ../src/guestfs-availability.pod:81
32969 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
32970 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
32971 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
32972 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
32973 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
32974 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
32975 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
32979 #: ../src/guestfs-availability.pod:104
32984 #: ../src/guestfs-availability.pod:106
32986 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
32987 "guestfs_mknod_b> L</guestfs_mknod_c>"
32991 #: ../src/guestfs-availability.pod:112
32996 #: ../src/guestfs-availability.pod:114
32997 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
33001 #: ../src/guestfs-availability.pod:117
33002 msgid "B<ntfsprogs>"
33006 #: ../src/guestfs-availability.pod:119
33008 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
33009 "L</guestfs_ntfsresize_size>"
33013 #: ../src/guestfs-availability.pod:124
33014 msgid "B<realpath>"
33018 #: ../src/guestfs-availability.pod:126
33019 msgid "The following functions: L</guestfs_realpath>"
33023 #: ../src/guestfs-availability.pod:129
33028 #: ../src/guestfs-availability.pod:131
33030 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
33031 "guestfs_scrub_freespace>"
33035 #: ../src/guestfs-availability.pod:136
33040 #: ../src/guestfs-availability.pod:138
33041 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
33045 #: ../src/guestfs-availability.pod:142
33050 #: ../src/guestfs-availability.pod:144
33051 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
33055 #: ../src/guestfs-availability.pod:148
33056 msgid "B<zerofree>"
33060 #: ../src/guestfs-availability.pod:150
33061 msgid "The following functions: L</guestfs_zerofree>"
33065 #: ../src/guestfs-structs.pod:1
33066 msgid "guestfs_int_bool"
33070 #: ../src/guestfs-structs.pod:3
33073 " struct guestfs_int_bool {\n"
33081 #: ../src/guestfs-structs.pod:8
33084 " struct guestfs_int_bool_list {\n"
33085 " uint32_t len; /* Number of elements in list. */\n"
33086 " struct guestfs_int_bool *val; /* Elements. */\n"
33092 #: ../src/guestfs-structs.pod:13
33095 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
33096 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
33101 #: ../src/guestfs-structs.pod:16
33102 msgid "guestfs_lvm_pv"
33106 #: ../src/guestfs-structs.pod:18
33109 " struct guestfs_lvm_pv {\n"
33110 " char *pv_name;\n"
33111 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33112 " char pv_uuid[32];\n"
33114 " uint64_t pv_size;\n"
33115 " uint64_t dev_size;\n"
33116 " uint64_t pv_free;\n"
33117 " uint64_t pv_used;\n"
33118 " char *pv_attr;\n"
33119 " int64_t pv_pe_count;\n"
33120 " int64_t pv_pe_alloc_count;\n"
33121 " char *pv_tags;\n"
33122 " uint64_t pe_start;\n"
33123 " int64_t pv_mda_count;\n"
33124 " uint64_t pv_mda_free;\n"
33130 #: ../src/guestfs-structs.pod:36
33133 " struct guestfs_lvm_pv_list {\n"
33134 " uint32_t len; /* Number of elements in list. */\n"
33135 " struct guestfs_lvm_pv *val; /* Elements. */\n"
33141 #: ../src/guestfs-structs.pod:41
33144 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
33145 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
33150 #: ../src/guestfs-structs.pod:44
33151 msgid "guestfs_lvm_vg"
33155 #: ../src/guestfs-structs.pod:46
33158 " struct guestfs_lvm_vg {\n"
33159 " char *vg_name;\n"
33160 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33161 " char vg_uuid[32];\n"
33163 " char *vg_attr;\n"
33164 " uint64_t vg_size;\n"
33165 " uint64_t vg_free;\n"
33166 " char *vg_sysid;\n"
33167 " uint64_t vg_extent_size;\n"
33168 " int64_t vg_extent_count;\n"
33169 " int64_t vg_free_count;\n"
33170 " int64_t max_lv;\n"
33171 " int64_t max_pv;\n"
33172 " int64_t pv_count;\n"
33173 " int64_t lv_count;\n"
33174 " int64_t snap_count;\n"
33175 " int64_t vg_seqno;\n"
33176 " char *vg_tags;\n"
33177 " int64_t vg_mda_count;\n"
33178 " uint64_t vg_mda_free;\n"
33184 #: ../src/guestfs-structs.pod:69
33187 " struct guestfs_lvm_vg_list {\n"
33188 " uint32_t len; /* Number of elements in list. */\n"
33189 " struct guestfs_lvm_vg *val; /* Elements. */\n"
33195 #: ../src/guestfs-structs.pod:74
33198 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
33199 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
33204 #: ../src/guestfs-structs.pod:77
33205 msgid "guestfs_lvm_lv"
33209 #: ../src/guestfs-structs.pod:79
33212 " struct guestfs_lvm_lv {\n"
33213 " char *lv_name;\n"
33214 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33215 " char lv_uuid[32];\n"
33216 " char *lv_attr;\n"
33217 " int64_t lv_major;\n"
33218 " int64_t lv_minor;\n"
33219 " int64_t lv_kernel_major;\n"
33220 " int64_t lv_kernel_minor;\n"
33221 " uint64_t lv_size;\n"
33222 " int64_t seg_count;\n"
33224 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
33225 " float snap_percent;\n"
33226 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
33227 " float copy_percent;\n"
33228 " char *move_pv;\n"
33229 " char *lv_tags;\n"
33230 " char *mirror_log;\n"
33231 " char *modules;\n"
33237 #: ../src/guestfs-structs.pod:101
33240 " struct guestfs_lvm_lv_list {\n"
33241 " uint32_t len; /* Number of elements in list. */\n"
33242 " struct guestfs_lvm_lv *val; /* Elements. */\n"
33248 #: ../src/guestfs-structs.pod:106
33251 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
33252 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
33257 #: ../src/guestfs-structs.pod:111
33260 " struct guestfs_stat {\n"
33264 " int64_t nlink;\n"
33269 " int64_t blksize;\n"
33270 " int64_t blocks;\n"
33271 " int64_t atime;\n"
33272 " int64_t mtime;\n"
33273 " int64_t ctime;\n"
33279 #: ../src/guestfs-structs.pod:127
33282 " struct guestfs_stat_list {\n"
33283 " uint32_t len; /* Number of elements in list. */\n"
33284 " struct guestfs_stat *val; /* Elements. */\n"
33290 #: ../src/guestfs-structs.pod:132
33293 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
33294 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
33299 #: ../src/guestfs-structs.pod:137
33302 " struct guestfs_statvfs {\n"
33303 " int64_t bsize;\n"
33304 " int64_t frsize;\n"
33305 " int64_t blocks;\n"
33306 " int64_t bfree;\n"
33307 " int64_t bavail;\n"
33308 " int64_t files;\n"
33309 " int64_t ffree;\n"
33310 " int64_t favail;\n"
33313 " int64_t namemax;\n"
33319 #: ../src/guestfs-structs.pod:151
33322 " struct guestfs_statvfs_list {\n"
33323 " uint32_t len; /* Number of elements in list. */\n"
33324 " struct guestfs_statvfs *val; /* Elements. */\n"
33330 #: ../src/guestfs-structs.pod:156
33333 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
33334 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
33339 #: ../src/guestfs-structs.pod:159
33340 msgid "guestfs_dirent"
33344 #: ../src/guestfs-structs.pod:161
33347 " struct guestfs_dirent {\n"
33356 #: ../src/guestfs-structs.pod:167
33359 " struct guestfs_dirent_list {\n"
33360 " uint32_t len; /* Number of elements in list. */\n"
33361 " struct guestfs_dirent *val; /* Elements. */\n"
33367 #: ../src/guestfs-structs.pod:172
33370 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
33371 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
33376 #: ../src/guestfs-structs.pod:177
33379 " struct guestfs_version {\n"
33380 " int64_t major;\n"
33381 " int64_t minor;\n"
33382 " int64_t release;\n"
33389 #: ../src/guestfs-structs.pod:184
33392 " struct guestfs_version_list {\n"
33393 " uint32_t len; /* Number of elements in list. */\n"
33394 " struct guestfs_version *val; /* Elements. */\n"
33400 #: ../src/guestfs-structs.pod:189
33403 " void guestfs_free_version (struct guestfs_free_version *);\n"
33404 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
33409 #: ../src/guestfs-structs.pod:192
33410 msgid "guestfs_xattr"
33414 #: ../src/guestfs-structs.pod:194
33417 " struct guestfs_xattr {\n"
33418 " char *attrname;\n"
33419 " /* The next two fields describe a byte array. */\n"
33420 " uint32_t attrval_len;\n"
33421 " char *attrval;\n"
33427 #: ../src/guestfs-structs.pod:201
33430 " struct guestfs_xattr_list {\n"
33431 " uint32_t len; /* Number of elements in list. */\n"
33432 " struct guestfs_xattr *val; /* Elements. */\n"
33438 #: ../src/guestfs-structs.pod:206
33441 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
33442 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
33447 #: ../src/guestfs-structs.pod:209
33448 msgid "guestfs_inotify_event"
33452 #: ../src/guestfs-structs.pod:211
33455 " struct guestfs_inotify_event {\n"
33456 " int64_t in_wd;\n"
33457 " uint32_t in_mask;\n"
33458 " uint32_t in_cookie;\n"
33459 " char *in_name;\n"
33465 #: ../src/guestfs-structs.pod:218
33468 " struct guestfs_inotify_event_list {\n"
33469 " uint32_t len; /* Number of elements in list. */\n"
33470 " struct guestfs_inotify_event *val; /* Elements. */\n"
33476 #: ../src/guestfs-structs.pod:223
33479 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
33480 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
33485 #: ../src/guestfs-structs.pod:226
33486 msgid "guestfs_partition"
33490 #: ../src/guestfs-structs.pod:228
33493 " struct guestfs_partition {\n"
33494 " int32_t part_num;\n"
33495 " uint64_t part_start;\n"
33496 " uint64_t part_end;\n"
33497 " uint64_t part_size;\n"
33503 #: ../src/guestfs-structs.pod:235
33506 " struct guestfs_partition_list {\n"
33507 " uint32_t len; /* Number of elements in list. */\n"
33508 " struct guestfs_partition *val; /* Elements. */\n"
33514 #: ../src/guestfs-structs.pod:240
33517 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
33518 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
33523 #: ../src/guestfs-structs.pod:243
33524 msgid "guestfs_application"
33528 #: ../src/guestfs-structs.pod:245
33531 " struct guestfs_application {\n"
33532 " char *app_name;\n"
33533 " char *app_display_name;\n"
33534 " int32_t app_epoch;\n"
33535 " char *app_version;\n"
33536 " char *app_release;\n"
33537 " char *app_install_path;\n"
33538 " char *app_trans_path;\n"
33539 " char *app_publisher;\n"
33540 " char *app_url;\n"
33541 " char *app_source_package;\n"
33542 " char *app_summary;\n"
33543 " char *app_description;\n"
33549 #: ../src/guestfs-structs.pod:260
33552 " struct guestfs_application_list {\n"
33553 " uint32_t len; /* Number of elements in list. */\n"
33554 " struct guestfs_application *val; /* Elements. */\n"
33560 #: ../src/guestfs-structs.pod:265
33563 " void guestfs_free_application (struct guestfs_free_application *);\n"
33564 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
33569 #: ../src/guestfs.pod:5
33570 msgid "guestfs - Library for accessing and modifying virtual machine images"
33574 #: ../src/guestfs.pod:11
33577 " guestfs_h *g = guestfs_create ();\n"
33578 " guestfs_add_drive (g, \"guest.img\");\n"
33579 " guestfs_launch (g);\n"
33580 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33581 " guestfs_touch (g, \"/hello\");\n"
33582 " guestfs_umount (g, \"/\");\n"
33583 " guestfs_close (g);\n"
33586 " guestfs_h *g = guestfs_create ();\n"
33587 " guestfs_add_drive (g, \"guest.img\");\n"
33588 " guestfs_launch (g);\n"
33589 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33590 " guestfs_touch (g, \"/hello\");\n"
33591 " guestfs_umount (g, \"/\");\n"
33592 " guestfs_close (g);\n"
33596 #: ../src/guestfs.pod:25
33598 "Libguestfs is a library for accessing and modifying guest disk images. "
33599 "Amongst the things this is good for: making batch configuration changes to "
33600 "guests, getting disk used/free statistics (see also: virt-df), migrating "
33601 "between virtualization systems (see also: virt-p2v), performing partial "
33602 "backups, performing partial guest clones, cloning guests and changing "
33603 "registry/UUID/hostname info, and much else besides."
33607 #: ../src/guestfs.pod:33
33609 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
33610 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
33611 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
33616 #: ../src/guestfs.pod:38
33618 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
33619 "what filesystem is in each LV, etc.). It can also run commands in the "
33620 "context of the guest. Also you can access filesystems over FUSE."
33624 #: ../src/guestfs.pod:43
33626 "Libguestfs is a library that can be linked with C and C++ management "
33627 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
33628 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
33633 #: ../src/guestfs.pod:48
33635 "You don't need to be root to use libguestfs, although obviously you do need "
33636 "enough permissions to access the disk images."
33640 #: ../src/guestfs.pod:51
33642 "Libguestfs is a large API because it can do many things. For a gentle "
33643 "introduction, please read the L</API OVERVIEW> section next."
33647 #: ../src/guestfs.pod:54
33649 "There are also some example programs in the L<guestfs-examples(3)> manual "
33654 #: ../src/guestfs.pod:57
33655 msgid "API OVERVIEW"
33659 #: ../src/guestfs.pod:59
33661 "This section provides a gentler overview of the libguestfs API. We also try "
33662 "to group API calls together, where that may not be obvious from reading "
33663 "about the individual calls in the main section of this manual."
33667 #: ../src/guestfs.pod:64
33672 #: ../src/guestfs.pod:66
33674 "Before you can use libguestfs calls, you have to create a handle. Then you "
33675 "must add at least one disk image to the handle, followed by launching the "
33676 "handle, then performing whatever operations you want, and finally closing "
33677 "the handle. By convention we use the single letter C<g> for the name of the "
33678 "handle variable, although of course you can use any name you want."
33682 #: ../src/guestfs.pod:73
33683 msgid "The general structure of all libguestfs-using programs looks like this:"
33687 #: ../src/guestfs.pod:76
33690 " guestfs_h *g = guestfs_create ();\n"
33695 #: ../src/guestfs.pod:78
33698 " /* Call guestfs_add_drive additional times if there are\n"
33699 " * multiple disk images.\n"
33701 " guestfs_add_drive (g, \"guest.img\");\n"
33706 #: ../src/guestfs.pod:83
33709 " /* Most manipulation calls won't work until you've launched\n"
33710 " * the handle 'g'. You have to do this _after_ adding drives\n"
33711 " * and _before_ other commands.\n"
33713 " guestfs_launch (g);\n"
33718 #: ../src/guestfs.pod:89
33721 " /* Now you can examine what partitions, LVs etc are available.\n"
33723 " char **partitions = guestfs_list_partitions (g);\n"
33724 " char **logvols = guestfs_lvs (g);\n"
33729 #: ../src/guestfs.pod:94
33732 " /* To access a filesystem in the image, you must mount it.\n"
33734 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33739 #: ../src/guestfs.pod:98
33742 " /* Now you can perform filesystem actions on the guest\n"
33745 " guestfs_touch (g, \"/hello\");\n"
33750 #: ../src/guestfs.pod:103
33753 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
33754 " * it is done automatically when you close the handle. See\n"
33755 " * discussion of autosync in this page.\n"
33757 " guestfs_sync (g);\n"
33762 #: ../src/guestfs.pod:109
33765 " /* Close the handle 'g'. */\n"
33766 " guestfs_close (g);\n"
33771 #: ../src/guestfs.pod:112
33773 "The code above doesn't include any error checking. In real code you should "
33774 "check return values carefully for errors. In general all functions that "
33775 "return integers return C<-1> on error, and all functions that return "
33776 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
33777 "how to handle errors, and consult the documentation for each function call "
33778 "below to see precisely how they return error indications. See L<guestfs-"
33779 "examples(3)> for fully worked examples."
33783 #: ../src/guestfs.pod:121
33784 msgid "DISK IMAGES"
33788 #: ../src/guestfs.pod:123
33790 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
33791 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
33792 "actual block device, or simply an empty file of zeroes that you have created "
33793 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
33798 #: ../src/guestfs.pod:129
33800 "The call you should use in modern code for adding drives is L</"
33801 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
33802 "specifying that the format is raw, do:"
33806 #: ../src/guestfs.pod:133
33809 " guestfs_add_drive_opts (g, filename,\n"
33810 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33816 #: ../src/guestfs.pod:137
33817 msgid "You can add a disk read-only using:"
33821 #: ../src/guestfs.pod:139
33824 " guestfs_add_drive_opts (g, filename,\n"
33825 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33826 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33832 #: ../src/guestfs.pod:144
33834 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
33835 "libguestfs won't modify the file."
33839 #: ../src/guestfs.pod:147
33841 "Be extremely cautious if the disk image is in use, eg. if it is being used "
33842 "by a virtual machine. Adding it read-write will almost certainly cause disk "
33843 "corruption, but adding it read-only is safe."
33847 #: ../src/guestfs.pod:151
33849 "You must add at least one disk image, and you may add multiple disk images. "
33850 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
33851 "first one you added), C</dev/sdb> (for the second one you added), etc."
33855 #: ../src/guestfs.pod:156
33857 "Once L</guestfs_launch> has been called you cannot add any more images. You "
33858 "can call L</guestfs_list_devices> to get a list of the device names, in the "
33859 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
33863 #: ../src/guestfs.pod:161
33868 #: ../src/guestfs.pod:163
33870 "Before you can read or write files, create directories and so on in a disk "
33871 "image that contains filesystems, you have to mount those filesystems using "
33872 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
33873 "a disk image contains (for example) one partition with a filesystem on that "
33874 "partition, then you can mount it directly:"
33878 #: ../src/guestfs.pod:170
33881 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
33886 #: ../src/guestfs.pod:172
33888 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
33889 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
33890 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
33891 "that these are libguestfs virtual devices, and are nothing to do with host "
33896 #: ../src/guestfs.pod:178
33898 "If you are given a disk image and you don't know what it contains then you "
33899 "have to find out. Libguestfs can do that too: use L</"
33900 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
33901 "LVs, and either try mounting each to see what is mountable, or else examine "
33902 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
33903 "filesystems, use L</guestfs_list_filesystems>."
33907 #: ../src/guestfs.pod:186
33909 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
33910 "L</INSPECTION> below). But you might find it easier to look at higher level "
33911 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
33915 #: ../src/guestfs.pod:191
33917 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
33918 "several other variations of the C<guestfs_mount_*> call."
33922 #: ../src/guestfs.pod:194
33923 msgid "FILESYSTEM ACCESS AND MODIFICATION"
33927 #: ../src/guestfs.pod:196
33929 "The majority of the libguestfs API consists of fairly low-level calls for "
33930 "accessing and modifying the files, directories, symlinks etc on mounted "
33931 "filesystems. There are over a hundred such calls which you can find listed "
33932 "in detail below in this man page, and we don't even pretend to cover them "
33933 "all in this overview."
33937 #: ../src/guestfs.pod:202
33939 "Specify filenames as full paths, starting with C<\"/\"> and including the "
33944 #: ../src/guestfs.pod:205
33946 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
33947 "the file called C<\"etc/passwd\"> then you could do:"
33951 #: ../src/guestfs.pod:208
33954 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
33959 #: ../src/guestfs.pod:210
33961 "This would return C<data> as a newly allocated buffer containing the full "
33962 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
33963 "or C<NULL> if there was an error."
33967 #: ../src/guestfs.pod:214
33969 "As another example, to create a top-level directory on that filesystem "
33970 "called C<\"var\"> you would do:"
33974 #: ../src/guestfs.pod:217
33977 " guestfs_mkdir (g, \"/var\");\n"
33982 #: ../src/guestfs.pod:219
33983 msgid "To create a symlink you could do:"
33987 #: ../src/guestfs.pod:221
33990 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
33991 " \"/etc/rc3.d/S30portmap\");\n"
33996 #: ../src/guestfs.pod:224
33998 "Libguestfs will reject attempts to use relative paths and there is no "
33999 "concept of a current working directory."
34003 #: ../src/guestfs.pod:227
34005 "Libguestfs can return errors in many situations: for example if the "
34006 "filesystem isn't writable, or if a file or directory that you requested "
34007 "doesn't exist. If you are using the C API (documented here) you have to "
34008 "check for those error conditions after each call. (Other language bindings "
34009 "turn these errors into exceptions)."
34013 #: ../src/guestfs.pod:233
34015 "File writes are affected by the per-handle umask, set by calling L</"
34016 "guestfs_umask> and defaulting to 022. See L</UMASK>."
34020 #: ../src/guestfs.pod:236
34021 msgid "PARTITIONING"
34025 #: ../src/guestfs.pod:238
34027 "Libguestfs contains API calls to read, create and modify partition tables on "
34032 #: ../src/guestfs.pod:241
34034 "In the common case where you want to create a single partition covering the "
34035 "whole disk, you should use the L</guestfs_part_disk> call:"
34039 #: ../src/guestfs.pod:245
34042 " const char *parttype = \"mbr\";\n"
34043 " if (disk_is_larger_than_2TB)\n"
34044 " parttype = \"gpt\";\n"
34045 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
34050 #: ../src/guestfs.pod:250
34052 "Obviously this effectively wipes anything that was on that disk image before."
34056 #: ../src/guestfs.pod:253
34061 #: ../src/guestfs.pod:255
34063 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
34064 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
34065 "you familiarize yourself with the concepts of physical volumes, volume "
34066 "groups and logical volumes."
34070 #: ../src/guestfs.pod:260
34072 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
34073 "tldp.org/HOWTO/LVM-HOWTO/>."
34077 #: ../src/guestfs.pod:263
34078 msgid "DOWNLOADING"
34082 #: ../src/guestfs.pod:265
34084 "Use L</guestfs_cat> to download small, text only files. This call is "
34085 "limited to files which are less than 2 MB and which cannot contain any ASCII "
34086 "NUL (C<\\0>) characters. However the API is very simple to use."
34090 #: ../src/guestfs.pod:269
34092 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
34093 "bit data, since it returns a (pointer, size) pair. However it is still "
34094 "limited to \"small\" files, less than 2 MB."
34098 #: ../src/guestfs.pod:273
34100 "L</guestfs_download> can be used to download any file, with no limits on "
34101 "content or size (even files larger than 4 GB)."
34105 #: ../src/guestfs.pod:276
34107 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
34111 #: ../src/guestfs.pod:279
34116 #: ../src/guestfs.pod:281
34118 "It's often the case that you want to write a file or files to the disk image."
34122 #: ../src/guestfs.pod:284
34124 "To write a small file with fixed content, use L</guestfs_write>. To create "
34125 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
34126 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
34127 "of other functions for creating test files, for example L</guestfs_fill> and "
34128 "L</guestfs_fill_pattern>."
34132 #: ../src/guestfs.pod:290
34134 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
34135 "file content or size (even files larger than 4 GB)."
34139 #: ../src/guestfs.pod:293
34141 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
34145 #: ../src/guestfs.pod:295
34147 "However the fastest way to upload I<large numbers of arbitrary files> is to "
34148 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
34149 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
34150 "in a predictable way (eg. adding it last after all other drives) then you "
34151 "can get the device name from L</guestfs_list_devices> and mount it directly "
34152 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
34153 "portable between kernel versions, and they don't support labels or UUIDs. "
34154 "If you want to pre-build an image or you need to mount it using a label or "
34155 "UUID, use an ISO image instead."
34159 #: ../src/guestfs.pod:306
34164 #: ../src/guestfs.pod:308
34166 "There are various different commands for copying between files and devices "
34167 "and in and out of the guest filesystem. These are summarised in the table "
34172 #: ../src/guestfs.pod:314
34173 msgid "B<file> to B<file>"
34177 #: ../src/guestfs.pod:316
34179 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
34180 "directories recursively."
34184 #: ../src/guestfs.pod:319
34185 msgid "B<file or device> to B<file or device>"
34189 #: ../src/guestfs.pod:321
34191 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
34192 "devices in the guest."
34196 #: ../src/guestfs.pod:324
34197 msgid "Example: duplicate the contents of an LV:"
34201 #: ../src/guestfs.pod:326
34204 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
34209 #: ../src/guestfs.pod:328
34211 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
34212 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
34213 "guestfs_copy_size>."
34217 #: ../src/guestfs.pod:332
34218 msgid "B<file on the host> to B<file or device>"
34222 #: ../src/guestfs.pod:334
34223 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
34227 #: ../src/guestfs.pod:336
34228 msgid "B<file or device> to B<file on the host>"
34232 #: ../src/guestfs.pod:338
34233 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
34237 #: ../src/guestfs.pod:342
34238 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
34242 #: ../src/guestfs.pod:344
34244 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
34245 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
34246 "appears you can only upload and download to files. However many Un*x-like "
34247 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
34248 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
34249 "and arbitrary file descriptor N."
34253 #: ../src/guestfs.pod:352
34254 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
34258 #: ../src/guestfs.pod:355
34261 " guestfs_download (g, filename, \"/dev/stdout\");\n"
34266 #: ../src/guestfs.pod:357
34267 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
34271 #: ../src/guestfs.pod:359
34274 " char devfd[64];\n"
34275 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
34276 " guestfs_tar_out (g, \"/\", devfd);\n"
34281 #: ../src/guestfs.pod:363
34282 msgid "LISTING FILES"
34286 #: ../src/guestfs.pod:365
34288 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
34289 "L<guestfish(1)>-equivalent command C<ll>)."
34293 #: ../src/guestfs.pod:368
34295 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
34296 "programs, as a flat list of strings."
34300 #: ../src/guestfs.pod:371
34302 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
34303 "directory, plus additional information about each one. It is more "
34304 "equivalent to using the L<readdir(3)> call on a local filesystem."
34308 #: ../src/guestfs.pod:375
34310 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
34314 #: ../src/guestfs.pod:378
34315 msgid "RUNNING COMMANDS"
34319 #: ../src/guestfs.pod:380
34321 "Although libguestfs is primarily an API for manipulating files inside guest "
34322 "images, we also provide some limited facilities for running commands inside "
34327 #: ../src/guestfs.pod:384
34328 msgid "There are many limitations to this:"
34332 #: ../src/guestfs.pod:390
34334 "The kernel version that the command runs under will be different from what "
34339 #: ../src/guestfs.pod:395
34341 "If the command needs to communicate with daemons, then most likely they "
34342 "won't be running."
34346 #: ../src/guestfs.pod:400
34347 msgid "The command will be running in limited memory."
34351 #: ../src/guestfs.pod:404
34353 "The network may not be available unless you enable it (see L</"
34354 "guestfs_set_network>)."
34358 #: ../src/guestfs.pod:409
34359 msgid "Only supports Linux guests (not Windows, BSD, etc)."
34363 #: ../src/guestfs.pod:413
34365 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
34369 #: ../src/guestfs.pod:418
34371 "For SELinux guests, you may need to enable SELinux and load policy first. "
34372 "See L</SELINUX> in this manpage."
34376 #: ../src/guestfs.pod:423
34378 "I<Security:> It is not safe to run commands from untrusted, possibly "
34379 "malicious guests. These commands may attempt to exploit your program by "
34380 "sending unexpected output. They could also try to exploit the Linux kernel "
34381 "or qemu provided by the libguestfs appliance. They could use the network "
34382 "provided by the libguestfs appliance to bypass ordinary network partitions "
34383 "and firewalls. They could use the elevated privileges or different SELinux "
34384 "context of your program to their advantage."
34388 #: ../src/guestfs.pod:432
34390 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
34391 "(a script which runs when the guest next boots normally), and to have this "
34392 "script run the commands you want in the normal context of the running guest, "
34393 "network security and so on. For information about other security issues, "
34394 "see L</SECURITY>."
34398 #: ../src/guestfs.pod:440
34400 "The two main API calls to run commands are L</guestfs_command> and L</"
34401 "guestfs_sh> (there are also variations)."
34405 #: ../src/guestfs.pod:443
34407 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
34408 "shell globs, redirections, etc will work."
34412 #: ../src/guestfs.pod:446
34413 msgid "CONFIGURATION FILES"
34417 #: ../src/guestfs.pod:448
34419 "To read and write configuration files in Linux guest filesystems, we "
34420 "strongly recommend using Augeas. For example, Augeas understands how to "
34421 "read and write, say, a Linux shadow password file or X.org configuration "
34422 "file, and so avoids you having to write that code."
34426 #: ../src/guestfs.pod:453
34428 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
34429 "document Augeas itself here because there is excellent documentation on the "
34430 "L<http://augeas.net/> website."
34434 #: ../src/guestfs.pod:457
34436 "If you don't want to use Augeas (you fool!) then try calling L</"
34437 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
34442 #: ../src/guestfs.pod:461
34447 #: ../src/guestfs.pod:463
34449 "We support SELinux guests. To ensure that labeling happens correctly in "
34450 "SELinux guests, you need to enable SELinux and load the guest's policy:"
34454 #: ../src/guestfs.pod:471
34455 msgid "Before launching, do:"
34459 #: ../src/guestfs.pod:473
34462 " guestfs_set_selinux (g, 1);\n"
34467 #: ../src/guestfs.pod:477
34469 "After mounting the guest's filesystem(s), load the policy. This is best "
34470 "done by running the L<load_policy(8)> command in the guest itself:"
34474 #: ../src/guestfs.pod:481
34477 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
34482 #: ../src/guestfs.pod:483
34484 "(Older versions of C<load_policy> require you to specify the name of the "
34489 #: ../src/guestfs.pod:488
34491 "Optionally, set the security context for the API. The correct security "
34492 "context to use can only be known by inspecting the guest. As an example:"
34496 #: ../src/guestfs.pod:492
34499 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
34504 #: ../src/guestfs.pod:496
34505 msgid "This will work for running commands and editing existing files."
34509 #: ../src/guestfs.pod:498
34511 "When new files are created, you may need to label them explicitly, for "
34512 "example by running the external command C<restorecon pathname>."
34516 #: ../src/guestfs.pod:502
34521 #: ../src/guestfs.pod:504
34523 "Certain calls are affected by the current file mode creation mask (the "
34524 "\"umask\"). In particular ones which create files or directories, such as "
34525 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
34526 "either the default mode that the file is created with or modifies the mode "
34531 #: ../src/guestfs.pod:510
34533 "The default umask is C<022>, so files are created with modes such as C<0644> "
34534 "and directories with C<0755>."
34538 #: ../src/guestfs.pod:513
34540 "There are two ways to avoid being affected by umask. Either set umask to 0 "
34541 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
34542 "guestfs_chmod> after creating each file or directory."
34546 #: ../src/guestfs.pod:517
34547 msgid "For more information about umask, see L<umask(2)>."
34551 #: ../src/guestfs.pod:521
34553 "Libguestfs allows you to access Linux guests which have been encrypted using "
34554 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
34555 "standard. This includes nearly all whole disk encryption systems used by "
34556 "modern Linux guests."
34560 #: ../src/guestfs.pod:527
34562 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
34563 "returns the string C<crypto_LUKS>)."
34567 #: ../src/guestfs.pod:530
34569 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
34570 "will require the passphrase!"
34574 #: ../src/guestfs.pod:533
34576 "Opening a LUKS device creates a new device mapper device called C</dev/"
34577 "mapper/mapname> (where C<mapname> is the string you supply to L</"
34578 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
34579 "from and encrypted to the underlying block device respectively."
34583 #: ../src/guestfs.pod:539
34585 "LVM volume groups on the device can be made visible by calling L</"
34586 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
34587 "(s) can now be mounted in the usual way."
34591 #: ../src/guestfs.pod:543
34593 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
34594 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
34595 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
34596 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
34597 "underlying encrypted block device)."
34601 #: ../src/guestfs.pod:550
34606 #: ../src/guestfs.pod:552
34608 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
34609 "contains operating systems, an install CD or a live CD. (These APIs used to "
34610 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
34611 "version 1.5.3 the most frequently used part of this library has been "
34612 "rewritten in C and moved into the core code)."
34616 #: ../src/guestfs.pod:559
34618 "Add all disks belonging to the unknown virtual machine and call L</"
34619 "guestfs_launch> in the usual way."
34623 #: ../src/guestfs.pod:562
34625 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
34626 "and certain heuristics, and returns a list of operating systems that were "
34627 "found. An empty list means none were found. A single element is the root "
34628 "filesystem of the operating system. For dual- or multi-boot guests, "
34629 "multiple roots can be returned, each one corresponding to a separate "
34630 "operating system. (Multi-boot virtual machines are extremely rare in the "
34631 "world of virtualization, but since this scenario can happen, we have built "
34632 "libguestfs to deal with it.)"
34636 #: ../src/guestfs.pod:571
34638 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
34639 "to get additional details about that operating system. For example, call L</"
34640 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
34641 "Windows and Linux-based operating systems respectively."
34645 #: ../src/guestfs.pod:577
34647 "Un*x-like and Linux-based operating systems usually consist of several "
34648 "filesystems which are mounted at boot time (for example, a separate boot "
34649 "partition mounted on C</boot>). The inspection rules are able to detect how "
34650 "filesystems correspond to mount points. Call "
34651 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
34652 "hash table like this example:"
34656 #: ../src/guestfs.pod:584
34659 " /boot => /dev/sda1\n"
34660 " / => /dev/vg_guest/lv_root\n"
34661 " /usr => /dev/vg_guest/lv_usr\n"
34666 #: ../src/guestfs.pod:588
34668 "The caller can then make calls to L</guestfs_mount_options> to mount the "
34669 "filesystems as suggested."
34673 #: ../src/guestfs.pod:591
34675 "Be careful to mount filesystems in the right order (eg. C</> before C</"
34676 "usr>). Sorting the keys of the hash by length, shortest first, should work."
34680 #: ../src/guestfs.pod:595
34682 "Inspection currently only works for some common operating systems. "
34683 "Contributors are welcome to send patches for other operating systems that we "
34684 "currently cannot detect."
34688 #: ../src/guestfs.pod:599
34690 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
34691 "for more details. The L</guestfs_inspect_os> function just ignores any "
34692 "encrypted devices."
34696 #: ../src/guestfs.pod:603
34698 "A note on the implementation: The call L</guestfs_inspect_os> performs "
34699 "inspection and caches the results in the guest handle. Subsequent calls to "
34700 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
34701 "read the disks. If you change the content of the guest disks, you can redo "
34702 "inspection by calling L</guestfs_inspect_os> again. (L</"
34703 "guestfs_inspect_list_applications> works a little differently from the other "
34704 "calls and does read the disks. See documentation for that function for "
34709 #: ../src/guestfs.pod:612
34710 msgid "INSPECTING INSTALL DISKS"
34714 #: ../src/guestfs.pod:614
34716 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
34721 #: ../src/guestfs.pod:617
34723 "Call L</guestfs_inspect_get_format> to return the format of the operating "
34724 "system, which currently can be C<installed> (a regular operating system) or "
34725 "C<installer> (some sort of install disk)."
34729 #: ../src/guestfs.pod:621
34731 "Further information is available about the operating system that can be "
34732 "installed using the regular inspection APIs like L</"
34733 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
34737 #: ../src/guestfs.pod:626
34739 "Some additional information specific to installer disks is also available "
34740 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
34741 "guestfs_inspect_is_multipart> calls."
34745 #: ../src/guestfs.pod:631
34746 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
34750 #: ../src/guestfs.pod:633
34752 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
34753 "ntfs-3g.org/> driver."
34757 #: ../src/guestfs.pod:636
34758 msgid "DRIVE LETTERS AND PATHS"
34762 #: ../src/guestfs.pod:638
34764 "DOS and Windows still use drive letters, and the filesystems are always "
34765 "treated as case insensitive by Windows itself, and therefore you might find "
34766 "a Windows configuration file referring to a path like C<c:\\windows"
34767 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
34768 "might be referred to as C</WINDOWS/System32>."
34772 #: ../src/guestfs.pod:644
34774 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
34775 "L</guestfs_inspect_get_drive_mappings>)"
34779 #: ../src/guestfs.pod:647
34781 "Dealing with separator characters (backslash vs forward slash) is outside "
34782 "the scope of libguestfs, but usually a simple character replacement will "
34787 #: ../src/guestfs.pod:651
34789 "To resolve the case insensitivity of paths, call L</"
34790 "guestfs_case_sensitive_path>."
34794 #: ../src/guestfs.pod:654
34795 msgid "ACCESSING THE WINDOWS REGISTRY"
34799 #: ../src/guestfs.pod:656
34801 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
34802 "files, through the library C<hivex> which is part of the libguestfs project "
34803 "although ships as a separate tarball. You have to locate and download the "
34804 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
34805 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
34806 "reg(1)> for more help on this issue."
34810 #: ../src/guestfs.pod:664
34811 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
34815 #: ../src/guestfs.pod:666
34817 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
34818 "provide something which looks like a Linux symlink. The way it tries to do "
34819 "the rewriting is described here:"
34823 #: ../src/guestfs.pod:670
34825 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
34830 #: ../src/guestfs.pod:672
34832 "The essential problem is that ntfs-3g simply does not have enough "
34833 "information to do a correct job. NTFS links can contain drive letters and "
34834 "references to external device GUIDs that ntfs-3g has no way of resolving. "
34835 "It is almost certainly the case that libguestfs callers should ignore what "
34836 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
34840 #: ../src/guestfs.pod:679
34842 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
34843 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
34844 "attribute, and read the raw reparse data from that (you can find the format "
34845 "documented in various places around the web)."
34849 #: ../src/guestfs.pod:684
34850 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
34854 #: ../src/guestfs.pod:686
34856 "There are other useful extended attributes that can be read from ntfs-3g "
34857 "filesystems (using L</guestfs_getxattr>). See:"
34861 #: ../src/guestfs.pod:689
34863 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
34867 #: ../src/guestfs.pod:691
34868 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
34872 #: ../src/guestfs.pod:693
34874 "Although we don't want to discourage you from using the C API, we will "
34875 "mention here that the same API is also available in other languages."
34879 #: ../src/guestfs.pod:696
34881 "The API is broadly identical in all supported languages. This means that "
34882 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
34883 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
34884 "OCaml. In other words, a straightforward, predictable isomorphism between "
34889 #: ../src/guestfs.pod:702
34891 "Error messages are automatically transformed into exceptions if the language "
34896 #: ../src/guestfs.pod:705
34898 "We don't try to \"object orientify\" parts of the API in OO languages, "
34899 "although contributors are welcome to write higher level APIs above what we "
34900 "provide in their favourite languages if they wish."
34904 #: ../src/guestfs.pod:711
34909 #: ../src/guestfs.pod:713
34911 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
34912 "identical to the C API. C++ classes and exceptions are not used."
34916 #: ../src/guestfs.pod:717
34921 #: ../src/guestfs.pod:719
34923 "The C# bindings are highly experimental. Please read the warnings at the "
34924 "top of C<csharp/Libguestfs.cs>."
34928 #: ../src/guestfs.pod:722
34933 #: ../src/guestfs.pod:724
34934 msgid "See L<guestfs-erlang(3)>."
34938 #: ../src/guestfs.pod:726
34943 #: ../src/guestfs.pod:728
34945 "This is the only language binding that is working but incomplete. Only "
34946 "calls which return simple integers have been bound in Haskell, and we are "
34947 "looking for help to complete this binding."
34951 #: ../src/guestfs.pod:732
34956 #: ../src/guestfs.pod:734
34958 "Full documentation is contained in the Javadoc which is distributed with "
34959 "libguestfs. For examples, see L<guestfs-java(3)>."
34963 #: ../src/guestfs.pod:737
34968 #: ../src/guestfs.pod:739
34969 msgid "See L<guestfs-ocaml(3)>."
34973 #: ../src/guestfs.pod:741
34978 #: ../src/guestfs.pod:743
34979 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
34983 #: ../src/guestfs.pod:745
34988 #: ../src/guestfs.pod:747
34990 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
34991 "the php-libguestfs package for your distribution."
34995 #: ../src/guestfs.pod:750
34996 msgid "The PHP binding only works correctly on 64 bit machines."
35000 #: ../src/guestfs.pod:752
35005 #: ../src/guestfs.pod:754
35006 msgid "See L<guestfs-python(3)>."
35010 #: ../src/guestfs.pod:756
35015 #: ../src/guestfs.pod:758
35016 msgid "See L<guestfs-ruby(3)>."
35020 #: ../src/guestfs.pod:760
35021 msgid "B<shell scripts>"
35025 #: ../src/guestfs.pod:762
35026 msgid "See L<guestfish(1)>."
35030 #: ../src/guestfs.pod:766
35031 msgid "LIBGUESTFS GOTCHAS"
35035 #: ../src/guestfs.pod:768
35037 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
35038 "system [...] that works in the way it is documented but is counterintuitive "
35039 "and almost invites mistakes.\""
35043 #: ../src/guestfs.pod:772
35045 "Since we developed libguestfs and the associated tools, there are several "
35046 "things we would have designed differently, but are now stuck with for "
35047 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
35048 "release, you can expect these to change. Beware of them."
35052 #: ../src/guestfs.pod:780
35053 msgid "Autosync / forgetting to sync."
35057 #: ../src/guestfs.pod:782
35059 "I<Update:> Autosync is enabled by default for all API users starting from "
35060 "libguestfs 1.5.24. This section only applies to older versions."
35064 #: ../src/guestfs.pod:785
35066 "When modifying a filesystem from C or another language, you B<must> unmount "
35067 "all filesystems and call L</guestfs_sync> explicitly before you close the "
35068 "libguestfs handle. You can also call:"
35072 #: ../src/guestfs.pod:789
35075 " guestfs_set_autosync (g, 1);\n"
35080 #: ../src/guestfs.pod:791
35082 "to have the unmount/sync done automatically for you when the handle 'g' is "
35083 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
35087 #: ../src/guestfs.pod:795
35089 "If you forget to do this, then it is entirely possible that your changes "
35090 "won't be written out, or will be partially written, or (very rarely) that "
35091 "you'll get disk corruption."
35095 #: ../src/guestfs.pod:799
35097 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
35098 "guestfish scripts that forget to sync will work just fine, which can make "
35099 "this very puzzling if you are trying to debug a problem."
35103 #: ../src/guestfs.pod:803
35104 msgid "Mount option C<-o sync> should not be the default."
35108 #: ../src/guestfs.pod:805
35110 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
35111 "libguestfs 1.13.16. This section only applies to older versions."
35115 #: ../src/guestfs.pod:808
35117 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
35118 "However C<-o sync> does not add any reliability benefit, but does have a "
35119 "very large performance impact."
35123 #: ../src/guestfs.pod:812
35125 "The work around is to use L</guestfs_mount_options> and set the mount "
35126 "options that you actually want to use."
35130 #: ../src/guestfs.pod:815
35131 msgid "Read-only should be the default."
35135 #: ../src/guestfs.pod:817
35137 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
35138 "specify I<--rw> if you want to make changes to the image."
35142 #: ../src/guestfs.pod:820
35143 msgid "This would reduce the potential to corrupt live VM images."
35147 #: ../src/guestfs.pod:822
35149 "Note that many filesystems change the disk when you just mount and unmount, "
35150 "even if you didn't perform any writes. You need to use L</"
35151 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
35155 #: ../src/guestfs.pod:826
35156 msgid "guestfish command line is hard to use."
35160 #: ../src/guestfs.pod:828
35162 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
35163 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
35164 "exist, so it fails. In earlier versions of guestfish the error message was "
35165 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
35166 "we should have used C<guestfish -c command> to run commands."
35170 #: ../src/guestfs.pod:835
35171 msgid "guestfish megabyte modifiers don't work right on all commands"
35175 #: ../src/guestfs.pod:837
35177 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
35178 "other modifiers). What guestfish actually does is to multiply the number "
35179 "part by the modifier part and pass the result to the C API. However this "
35180 "doesn't work for a few APIs which aren't expecting bytes, but are already "
35181 "expecting some other unit (eg. megabytes)."
35185 #: ../src/guestfs.pod:844
35186 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
35190 #: ../src/guestfs.pod:846
35193 " lvcreate LV VG 100M\n"
35198 #: ../src/guestfs.pod:848
35200 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
35201 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
35202 "megabytes * megabytes) logical volume. The error message you get from this "
35203 "is also a little obscure."
35207 #: ../src/guestfs.pod:853
35209 "This could be fixed in the generator by specially marking parameters and "
35210 "return values which take bytes or other units."
35214 #: ../src/guestfs.pod:856
35215 msgid "Ambiguity between devices and paths"
35219 #: ../src/guestfs.pod:858
35221 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
35222 "sdb2>) and a similar pathname. A file might just happen to be called "
35223 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
35227 #: ../src/guestfs.pod:863
35229 "In the current API we usually resolve this ambiguity by having two separate "
35230 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
35231 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
35232 "detecting if the path supplied begins with C</dev/>."
35236 #: ../src/guestfs.pod:869
35238 "To avoid both the ambiguity and the need to duplicate some calls, we could "
35239 "make paths/devices into structured names. One way to do this would be to "
35240 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
35241 "aspect of grub. Another way would be to use a structured type, equivalent "
35242 "to this OCaml type:"
35246 #: ../src/guestfs.pod:875
35249 " type path = Path of string | Device of int | Partition of int * int\n"
35254 #: ../src/guestfs.pod:877
35255 msgid "which would allow you to pass arguments like:"
35259 #: ../src/guestfs.pod:879
35262 " Path \"/foo/bar\"\n"
35263 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
35264 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
35265 " Path \"/dev/sdb2\" (* not a device *)\n"
35270 #: ../src/guestfs.pod:884
35272 "As you can see there are still problems to resolve even with this "
35273 "representation. Also consider how it might work in guestfish."
35277 #: ../src/guestfs.pod:889
35278 msgid "KEYS AND PASSPHRASES"
35282 #: ../src/guestfs.pod:891
35284 "Certain libguestfs calls take a parameter that contains sensitive key "
35285 "material, passed in as a C string."
35289 #: ../src/guestfs.pod:894
35291 "In the future we would hope to change the libguestfs implementation so that "
35292 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
35293 "swap. However this is I<not> done at the moment, because of the complexity "
35294 "of such an implementation."
35298 #: ../src/guestfs.pod:899
35300 "Therefore you should be aware that any key parameter you pass to libguestfs "
35301 "might end up being written out to the swap partition. If this is a concern, "
35302 "scrub the swap partition or don't use libguestfs on encrypted devices."
35306 #: ../src/guestfs.pod:904
35307 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
35311 #: ../src/guestfs.pod:906
35313 "All high-level libguestfs actions are synchronous. If you want to use "
35314 "libguestfs asynchronously then you must create a thread."
35318 #: ../src/guestfs.pod:909
35320 "Only use the handle from a single thread. Either use the handle exclusively "
35321 "from one thread, or provide your own mutex so that two threads cannot issue "
35322 "calls on the same handle at the same time."
35326 #: ../src/guestfs.pod:913
35328 "See the graphical program guestfs-browser for one possible architecture for "
35329 "multithreaded programs using libvirt and libguestfs."
35333 #: ../src/guestfs.pod:916
35338 #: ../src/guestfs.pod:918
35340 "Libguestfs needs a supermin appliance, which it finds by looking along an "
35345 #: ../src/guestfs.pod:921
35347 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
35348 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
35352 #: ../src/guestfs.pod:924
35354 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
35355 "to change the directories that libguestfs will search in. The value is a "
35356 "colon-separated list of paths. The current directory is I<not> searched "
35357 "unless the path contains an empty element or C<.>. For example "
35358 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
35359 "then C</usr/lib/guestfs>."
35363 #: ../src/guestfs.pod:931
35364 msgid "QEMU WRAPPERS"
35368 #: ../src/guestfs.pod:933
35370 "If you want to compile your own qemu, run qemu from a non-standard location, "
35371 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
35376 #: ../src/guestfs.pod:937
35378 "There is one important rule to remember: you I<must C<exec qemu>> as the "
35379 "last command in the shell script (so that qemu replaces the shell and "
35380 "becomes the direct child of the libguestfs-using program). If you don't do "
35381 "this, then the qemu process won't be cleaned up correctly."
35385 #: ../src/guestfs.pod:942
35387 "Here is an example of a wrapper, where I have built my own copy of qemu from "
35392 #: ../src/guestfs.pod:945
35396 " qemudir=/home/rjones/d/qemu\n"
35397 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
35402 #: ../src/guestfs.pod:949
35404 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
35405 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
35410 #: ../src/guestfs.pod:953
35413 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
35418 #: ../src/guestfs.pod:955
35420 "Note that libguestfs also calls qemu with the -help and -version options in "
35421 "order to determine features."
35425 #: ../src/guestfs.pod:958
35427 "Wrappers can also be used to edit the options passed to qemu. In the "
35428 "following example, the C<-machine ...> option (C<-machine> and the following "
35429 "argument) are removed from the command line and replaced with C<-machine pc,"
35430 "accel=tcg>. The while loop iterates over the options until it finds the "
35431 "right one to remove, putting the remaining options into the C<args> array."
35435 #: ../src/guestfs.pod:967
35439 " while [ $# -gt 0 ]; do\n"
35440 " case \"$1\" in\n"
35444 " args[i]=\"$1\"\n"
35453 #: ../src/guestfs.pod:979
35456 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
35461 #: ../src/guestfs.pod:981
35462 msgid "ATTACHING TO RUNNING DAEMONS"
35466 #: ../src/guestfs.pod:983
35468 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
35469 "babies. Use with caution."
35473 #: ../src/guestfs.pod:986
35475 "I<Note (2):> This section explains how to attach to a running daemon from a "
35476 "low level perspective. For most users, simply using virt tools such as "
35477 "L<guestfish(1)> with the I<--live> option will \"just work\"."
35481 #: ../src/guestfs.pod:990
35482 msgid "Using guestfs_set_attach_method"
35486 #: ../src/guestfs.pod:992
35488 "By calling L</guestfs_set_attach_method> you can change how the library "
35489 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
35490 "ARCHITECTURE> for some background)."
35494 #: ../src/guestfs.pod:996
35496 "The normal attach method is C<appliance>, where a small appliance is created "
35497 "containing the daemon, and then the library connects to this."
35501 #: ../src/guestfs.pod:999
35503 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
35504 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
35505 "daemon over the Unix domain socket."
35509 #: ../src/guestfs.pod:1003
35511 "The normal use for this is to connect to a running virtual machine that "
35512 "contains a C<guestfsd> daemon, and send commands so you can read and write "
35513 "files inside the live virtual machine."
35517 #: ../src/guestfs.pod:1007
35518 msgid "Using guestfs_add_domain with live flag"
35522 #: ../src/guestfs.pod:1009
35524 "L</guestfs_add_domain> provides some help for getting the correct attach "
35525 "method. If you pass the C<live> option to this function, then (if the "
35526 "virtual machine is running) it will examine the libvirt XML looking for a "
35527 "virtio-serial channel to connect to:"
35531 #: ../src/guestfs.pod:1015
35538 " <channel type='unix'>\n"
35539 " <source mode='bind' path='/path/to/socket'/>\n"
35540 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
35549 #: ../src/guestfs.pod:1027
35551 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
35552 "method to C<unix:/path/to/socket>."
35556 #: ../src/guestfs.pod:1030
35558 "Some of the libguestfs tools (including guestfish) support a I<--live> "
35559 "option which is passed through to L</guestfs_add_domain> thus allowing you "
35560 "to attach to and modify live virtual machines."
35564 #: ../src/guestfs.pod:1034
35566 "The virtual machine needs to have been set up beforehand so that it has the "
35567 "virtio-serial channel and so that guestfsd is running inside it."
35571 #: ../src/guestfs.pod:1038
35572 msgid "ABI GUARANTEE"
35576 #: ../src/guestfs.pod:1040
35578 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
35579 "actions as outlined in this section. Although we will deprecate some "
35580 "actions, for example if they get replaced by newer calls, we will keep the "
35581 "old actions forever. This allows you the developer to program in confidence "
35582 "against the libguestfs API."
35586 #: ../src/guestfs.pod:1046
35587 msgid "BLOCK DEVICE NAMING"
35591 #: ../src/guestfs.pod:1048
35593 "In the kernel there is now quite a profusion of schemata for naming block "
35594 "devices (in this context, by I<block device> I mean a physical or virtual "
35595 "hard drive). The original Linux IDE driver used names starting with C</dev/"
35596 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
35597 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
35598 "for the old IDE driver (particularly for SATA devices) those devices also "
35599 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
35600 "paravirtualized drivers. This has created several different naming systems, "
35601 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
35605 #: ../src/guestfs.pod:1060
35607 "As discussed above, libguestfs uses a qemu appliance running an embedded "
35608 "Linux kernel to access block devices. We can run a variety of appliances "
35609 "based on a variety of Linux kernels."
35613 #: ../src/guestfs.pod:1064
35615 "This causes a problem for libguestfs because many API calls use device or "
35616 "partition names. Working scripts and the recipe (example) scripts that we "
35617 "make available over the internet could fail if the naming scheme changes."
35621 #: ../src/guestfs.pod:1069
35623 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
35624 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
35625 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
35626 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
35630 #: ../src/guestfs.pod:1075
35632 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
35633 "L</guestfs_list_partitions> and similar calls return the true names of the "
35634 "devices and partitions as known to the appliance."
35638 #: ../src/guestfs.pod:1080
35639 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
35643 #: ../src/guestfs.pod:1082
35645 "Usually this translation is transparent. However in some (very rare) cases "
35646 "you may need to know the exact algorithm. Such cases include where you use "
35647 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
35648 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
35652 #: ../src/guestfs.pod:1088
35654 "The algorithm is applied only to I<parameters> which are known to be either "
35655 "device or partition names. Return values from functions such as L</"
35656 "guestfs_list_devices> are never changed."
35660 #: ../src/guestfs.pod:1096
35661 msgid "Is the string a parameter which is a device or partition name?"
35665 #: ../src/guestfs.pod:1100
35666 msgid "Does the string begin with C</dev/sd>?"
35670 #: ../src/guestfs.pod:1104
35672 "Does the named device exist? If so, we use that device. However if I<not> "
35673 "then we continue with this algorithm."
35677 #: ../src/guestfs.pod:1109
35678 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
35682 #: ../src/guestfs.pod:1111
35683 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
35687 #: ../src/guestfs.pod:1113
35688 msgid "If that named device exists, use it. If not, continue."
35692 #: ../src/guestfs.pod:1117
35693 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
35697 #: ../src/guestfs.pod:1119
35698 msgid "If that named device exists, use it. If not, return an error."
35702 #: ../src/guestfs.pod:1123
35703 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
35707 #: ../src/guestfs.pod:1125
35709 "Although the standard naming scheme and automatic translation is useful for "
35710 "simple programs and guestfish scripts, for larger programs it is best not to "
35711 "rely on this mechanism."
35715 #: ../src/guestfs.pod:1129
35717 "Where possible for maximum future portability programs using libguestfs "
35718 "should use these future-proof techniques:"
35722 #: ../src/guestfs.pod:1136
35724 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
35725 "device names, and then use those names directly."
35729 #: ../src/guestfs.pod:1139
35731 "Since those device names exist by definition, they will never be translated."
35735 #: ../src/guestfs.pod:1144
35737 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
35738 "filesystem labels."
35742 #: ../src/guestfs.pod:1151
35744 "This section discusses security implications of using libguestfs, "
35745 "particularly with untrusted or malicious guests or disk images."
35749 #: ../src/guestfs.pod:1154
35750 msgid "GENERAL SECURITY CONSIDERATIONS"
35754 #: ../src/guestfs.pod:1156
35756 "Be careful with any files or data that you download from a guest (by "
35757 "\"download\" we mean not just the L</guestfs_download> command but any "
35758 "command that reads files, filenames, directories or anything else from a "
35759 "disk image). An attacker could manipulate the data to fool your program "
35760 "into doing the wrong thing. Consider cases such as:"
35764 #: ../src/guestfs.pod:1166
35765 msgid "the data (file etc) not being present"
35769 #: ../src/guestfs.pod:1170
35770 msgid "being present but empty"
35774 #: ../src/guestfs.pod:1174
35775 msgid "being much larger than normal"
35779 #: ../src/guestfs.pod:1178
35780 msgid "containing arbitrary 8 bit data"
35784 #: ../src/guestfs.pod:1182
35785 msgid "being in an unexpected character encoding"
35789 #: ../src/guestfs.pod:1186
35790 msgid "containing homoglyphs."
35794 #: ../src/guestfs.pod:1190
35795 msgid "SECURITY OF MOUNTING FILESYSTEMS"
35799 #: ../src/guestfs.pod:1192
35801 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
35802 "(VFS) module can sometimes be escalated into exploits by deliberately "
35803 "creating a malicious, malformed filesystem. These exploits are very severe "
35804 "for two reasons. Firstly there are very many filesystem drivers in the "
35805 "kernel, and many of them are infrequently used and not much developer "
35806 "attention has been paid to the code. Linux userspace helps potential "
35807 "crackers by detecting the filesystem type and automatically choosing the "
35808 "right VFS driver, even if that filesystem type is obscure or unexpected for "
35809 "the administrator. Secondly, a kernel-level exploit is like a local root "
35810 "exploit (worse in some ways), giving immediate and total access to the "
35811 "system right down to the hardware level."
35815 #: ../src/guestfs.pod:1205
35817 "That explains why you should never mount a filesystem from an untrusted "
35818 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
35819 "inside a qemu virtual machine, usually running as a non-root user. The "
35820 "attacker would need to write a filesystem which first exploited the kernel, "
35821 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
35822 "the libguestfs protocol, and finally to be as serious as the host kernel "
35823 "exploit it would need to escalate its privileges to root. This multi-step "
35824 "escalation, performed by a static piece of data, is thought to be extremely "
35825 "hard to do, although we never say 'never' about security issues."
35829 #: ../src/guestfs.pod:1216
35831 "In any case callers can reduce the attack surface by forcing the filesystem "
35832 "type when mounting (use L</guestfs_mount_vfs>)."
35836 #: ../src/guestfs.pod:1219
35837 msgid "PROTOCOL SECURITY"
35841 #: ../src/guestfs.pod:1221
35843 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
35844 "defined upper message size. However a program that uses libguestfs must "
35845 "also take care - for example you can write a program that downloads a binary "
35846 "from a disk image and executes it locally, and no amount of protocol "
35847 "security will save you from the consequences."
35851 #: ../src/guestfs.pod:1227
35852 msgid "INSPECTION SECURITY"
35856 #: ../src/guestfs.pod:1229
35858 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
35859 "directly from the guest, and these could contain any 8 bit data. Callers "
35860 "should be careful to escape these before printing them to a structured file "
35861 "(for example, use HTML escaping if creating a web page)."
35865 #: ../src/guestfs.pod:1235
35867 "Guest configuration may be altered in unusual ways by the administrator of "
35868 "the virtual machine, and may not reflect reality (particularly for untrusted "
35869 "or actively malicious guests). For example we parse the hostname from "
35870 "configuration files like C</etc/sysconfig/network> that we find in the "
35871 "guest, but the guest administrator can easily manipulate these files to "
35872 "provide the wrong hostname."
35876 #: ../src/guestfs.pod:1243
35878 "The inspection API parses guest configuration using two external libraries: "
35879 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
35880 "designed to be robust in the face of malicious data, although denial of "
35881 "service attacks are still possible, for example with oversized configuration "
35886 #: ../src/guestfs.pod:1249
35887 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
35891 #: ../src/guestfs.pod:1251
35893 "Be very cautious about running commands from the guest. By running a "
35894 "command in the guest, you are giving CPU time to a binary that you do not "
35895 "control, under the same user account as the library, albeit wrapped in qemu "
35896 "virtualization. More information and alternatives can be found in the "
35897 "section L</RUNNING COMMANDS>."
35901 #: ../src/guestfs.pod:1257
35902 msgid "CVE-2010-3851"
35906 #: ../src/guestfs.pod:1259
35907 msgid "https://bugzilla.redhat.com/642934"
35911 #: ../src/guestfs.pod:1261
35913 "This security bug concerns the automatic disk format detection that qemu "
35914 "does on disk images."
35918 #: ../src/guestfs.pod:1264
35920 "A raw disk image is just the raw bytes, there is no header. Other disk "
35921 "images like qcow2 contain a special header. Qemu deals with this by looking "
35922 "for one of the known headers, and if none is found then assuming the disk "
35923 "image must be raw."
35927 #: ../src/guestfs.pod:1269
35929 "This allows a guest which has been given a raw disk image to write some "
35930 "other header. At next boot (or when the disk image is accessed by "
35931 "libguestfs) qemu would do autodetection and think the disk image format was, "
35932 "say, qcow2 based on the header written by the guest."
35936 #: ../src/guestfs.pod:1274
35938 "This in itself would not be a problem, but qcow2 offers many features, one "
35939 "of which is to allow a disk image to refer to another image (called the "
35940 "\"backing disk\"). It does this by placing the path to the backing disk "
35941 "into the qcow2 header. This path is not validated and could point to any "
35942 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
35943 "\"holes\" in the qcow2 disk image, which of course is completely under the "
35944 "control of the attacker."
35948 #: ../src/guestfs.pod:1282
35950 "In libguestfs this is rather hard to exploit except under two circumstances:"
35954 #: ../src/guestfs.pod:1289
35955 msgid "You have enabled the network or have opened the disk in write mode."
35959 #: ../src/guestfs.pod:1293
35961 "You are also running untrusted code from the guest (see L</RUNNING "
35966 #: ../src/guestfs.pod:1298
35968 "The way to avoid this is to specify the expected disk format when adding "
35969 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
35970 "should always do this if the disk is raw format, and it's a good idea for "
35975 #: ../src/guestfs.pod:1303
35977 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
35978 "format is fetched from libvirt and passed through."
35982 #: ../src/guestfs.pod:1306
35984 "For libguestfs tools, use the I<--format> command line parameter as "
35989 #: ../src/guestfs.pod:1309
35990 msgid "CONNECTION MANAGEMENT"
35994 #: ../src/guestfs.pod:1311
35995 msgid "guestfs_h *"
35999 #: ../src/guestfs.pod:1313
36001 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
36002 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
36003 "handle and release all resources used."
36007 #: ../src/guestfs.pod:1317
36009 "For information on using multiple handles and threads, see the section L</"
36010 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
36014 #: ../src/guestfs.pod:1320
36015 msgid "guestfs_create"
36019 #: ../src/guestfs.pod:1322
36022 " guestfs_h *guestfs_create (void);\n"
36027 #: ../src/guestfs.pod:1324
36028 msgid "Create a connection handle."
36032 #: ../src/guestfs.pod:1326
36034 "On success this returns a non-NULL pointer to a handle. On error it returns "
36039 #: ../src/guestfs.pod:1329
36041 "You have to \"configure\" the handle after creating it. This includes "
36042 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
36043 "handle at least once."
36047 #: ../src/guestfs.pod:1333
36048 msgid "After configuring the handle, you have to call L</guestfs_launch>."
36052 #: ../src/guestfs.pod:1335
36054 "You may also want to configure error handling for the handle. See the L</"
36055 "ERROR HANDLING> section below."
36059 #: ../src/guestfs.pod:1338
36060 msgid "guestfs_close"
36064 #: ../src/guestfs.pod:1340
36067 " void guestfs_close (guestfs_h *g);\n"
36072 #: ../src/guestfs.pod:1342
36073 msgid "This closes the connection handle and frees up all resources used."
36077 #: ../src/guestfs.pod:1344
36079 "If autosync was set on the handle and the handle was launched, then this "
36080 "implicitly calls various functions to unmount filesystems and sync the "
36081 "disk. See L</guestfs_set_autosync> for more details."
36085 #: ../src/guestfs.pod:1348
36086 msgid "If a close callback was set on the handle, then it is called."
36090 #: ../src/guestfs.pod:1350
36091 msgid "ERROR HANDLING"
36095 #: ../src/guestfs.pod:1352
36097 "API functions can return errors. For example, almost all functions that "
36098 "return C<int> will return C<-1> to indicate an error."
36102 #: ../src/guestfs.pod:1355
36104 "Additional information is available for errors: an error message string and "
36105 "optionally an error number (errno) if the thing that failed was a system "
36110 #: ../src/guestfs.pod:1359
36112 "You can get at the additional information about the last error on the handle "
36113 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
36114 "up an error handler with L</guestfs_set_error_handler>."
36118 #: ../src/guestfs.pod:1364
36120 "When the handle is created, a default error handler is installed which "
36121 "prints the error message string to C<stderr>. For small short-running "
36122 "command line programs it is sufficient to do:"
36126 #: ../src/guestfs.pod:1368
36129 " if (guestfs_launch (g) == -1)\n"
36130 " exit (EXIT_FAILURE);\n"
36135 #: ../src/guestfs.pod:1371
36137 "since the default error handler will ensure that an error message has been "
36138 "printed to C<stderr> before the program exits."
36142 #: ../src/guestfs.pod:1374
36144 "For other programs the caller will almost certainly want to install an "
36145 "alternate error handler or do error handling in-line like this:"
36149 #: ../src/guestfs.pod:1377
36152 " /* This disables the default behaviour of printing errors\n"
36154 " guestfs_set_error_handler (g, NULL, NULL);\n"
36159 #: ../src/guestfs.pod:1381
36162 " if (guestfs_launch (g) == -1) {\n"
36163 " /* Examine the error message and print it etc. */\n"
36164 " char *msg = guestfs_last_error (g);\n"
36165 " int errnum = guestfs_last_errno (g);\n"
36166 " fprintf (stderr, \"%s\", msg);\n"
36167 " if (errnum != 0)\n"
36168 " fprintf (stderr, \": %s\", strerror (errnum));\n"
36169 " fprintf (stderr, \"\\n\");\n"
36176 #: ../src/guestfs.pod:1392
36178 "Out of memory errors are handled differently. The default action is to call "
36179 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
36180 "guestfs_set_out_of_memory_handler>."
36184 #: ../src/guestfs.pod:1396
36186 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
36187 "because there is no handle if this happens there is no way to get additional "
36188 "error information. However L</guestfs_create> is supposed to be a "
36189 "lightweight operation which can only fail because of insufficient memory (it "
36190 "returns NULL in this case)."
36194 #: ../src/guestfs.pod:1402
36195 msgid "guestfs_last_error"
36199 #: ../src/guestfs.pod:1404
36202 " const char *guestfs_last_error (guestfs_h *g);\n"
36207 #: ../src/guestfs.pod:1406
36209 "This returns the last error message that happened on C<g>. If there has not "
36210 "been an error since the handle was created, then this returns C<NULL>."
36214 #: ../src/guestfs.pod:1410
36216 "The lifetime of the returned string is until the next error occurs, or L</"
36217 "guestfs_close> is called."
36221 #: ../src/guestfs.pod:1413
36222 msgid "guestfs_last_errno"
36226 #: ../src/guestfs.pod:1415
36229 " int guestfs_last_errno (guestfs_h *g);\n"
36234 #: ../src/guestfs.pod:1417
36235 msgid "This returns the last error number (errno) that happened on C<g>."
36239 #: ../src/guestfs.pod:1419
36240 msgid "If successful, an errno integer not equal to zero is returned."
36244 #: ../src/guestfs.pod:1421
36246 "If no error, this returns 0. This call can return 0 in three situations:"
36250 #: ../src/guestfs.pod:1428
36251 msgid "There has not been any error on the handle."
36255 #: ../src/guestfs.pod:1432
36257 "There has been an error but the errno was meaningless. This corresponds to "
36258 "the case where the error did not come from a failed system call, but for "
36259 "some other reason."
36263 #: ../src/guestfs.pod:1438
36265 "There was an error from a failed system call, but for some reason the errno "
36266 "was not captured and returned. This usually indicates a bug in libguestfs."
36270 #: ../src/guestfs.pod:1444
36272 "Libguestfs tries to convert the errno from inside the applicance into a "
36273 "corresponding errno for the caller (not entirely trivial: the appliance "
36274 "might be running a completely different operating system from the library "
36275 "and error numbers are not standardized across Un*xen). If this could not be "
36276 "done, then the error is translated to C<EINVAL>. In practice this should "
36277 "only happen in very rare circumstances."
36281 #: ../src/guestfs.pod:1452
36282 msgid "guestfs_set_error_handler"
36286 #: ../src/guestfs.pod:1454
36289 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
36291 " const char *msg);\n"
36292 " void guestfs_set_error_handler (guestfs_h *g,\n"
36293 " guestfs_error_handler_cb cb,\n"
36294 " void *opaque);\n"
36299 #: ../src/guestfs.pod:1461
36301 "The callback C<cb> will be called if there is an error. The parameters "
36302 "passed to the callback are an opaque data pointer and the error message "
36307 #: ../src/guestfs.pod:1465
36309 "C<errno> is not passed to the callback. To get that the callback must call "
36310 "L</guestfs_last_errno>."
36314 #: ../src/guestfs.pod:1468
36316 "Note that the message string C<msg> is freed as soon as the callback "
36317 "function returns, so if you want to stash it somewhere you must make your "
36322 #: ../src/guestfs.pod:1472
36323 msgid "The default handler prints messages on C<stderr>."
36327 #: ../src/guestfs.pod:1474
36328 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
36332 #: ../src/guestfs.pod:1476
36333 msgid "guestfs_get_error_handler"
36337 #: ../src/guestfs.pod:1478
36340 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
36341 " void **opaque_rtn);\n"
36346 #: ../src/guestfs.pod:1481
36347 msgid "Returns the current error handler callback."
36351 #: ../src/guestfs.pod:1483
36352 msgid "guestfs_set_out_of_memory_handler"
36356 #: ../src/guestfs.pod:1485
36359 " typedef void (*guestfs_abort_cb) (void);\n"
36360 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
36361 " guestfs_abort_cb);\n"
36366 #: ../src/guestfs.pod:1489
36368 "The callback C<cb> will be called if there is an out of memory situation. "
36369 "I<Note this callback must not return>."
36373 #: ../src/guestfs.pod:1492
36374 msgid "The default is to call L<abort(3)>."
36378 #: ../src/guestfs.pod:1494
36380 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
36384 #: ../src/guestfs.pod:1497
36385 msgid "guestfs_get_out_of_memory_handler"
36389 #: ../src/guestfs.pod:1499
36392 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
36397 #: ../src/guestfs.pod:1501
36398 msgid "This returns the current out of memory handler."
36402 #: ../src/guestfs.pod:1503
36407 #: ../src/guestfs.pod:1507
36412 #: ../src/guestfs.pod:1509
36417 #: ../src/guestfs.pod:1511
36418 msgid "AVAILABILITY"
36422 #: ../src/guestfs.pod:1513
36423 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
36427 #: ../src/guestfs.pod:1515
36429 "Using L</guestfs_available> you can test availability of the following "
36430 "groups of functions. This test queries the appliance to see if the "
36431 "appliance you are currently using supports the functionality."
36435 #: ../src/guestfs.pod:1520
36436 msgid "@AVAILABILITY@"
36440 #: ../src/guestfs.pod:1522
36441 msgid "GUESTFISH supported COMMAND"
36445 #: ../src/guestfs.pod:1524
36447 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
36448 "prints out the available groups and whether they are supported by this build "
36449 "of libguestfs. Note however that you have to do C<run> first."
36453 #: ../src/guestfs.pod:1529
36454 msgid "SINGLE CALLS AT COMPILE TIME"
36458 #: ../src/guestfs.pod:1531
36460 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
36461 "function, such as:"
36465 #: ../src/guestfs.pod:1534
36468 " #define LIBGUESTFS_HAVE_DD 1\n"
36473 #: ../src/guestfs.pod:1536
36474 msgid "if L</guestfs_dd> is available."
36478 #: ../src/guestfs.pod:1538
36480 "Before version 1.5.8, if you needed to test whether a single libguestfs "
36481 "function is available at compile time, we recommended using build tools such "
36482 "as autoconf or cmake. For example in autotools you could use:"
36486 #: ../src/guestfs.pod:1543
36489 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
36490 " AC_CHECK_FUNCS([guestfs_dd])\n"
36495 #: ../src/guestfs.pod:1546
36497 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
36502 #: ../src/guestfs.pod:1549
36503 msgid "SINGLE CALLS AT RUN TIME"
36507 #: ../src/guestfs.pod:1551
36509 "Testing at compile time doesn't guarantee that a function really exists in "
36510 "the library. The reason is that you might be dynamically linked against a "
36511 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
36512 "This situation unfortunately results in a segmentation fault, which is a "
36513 "shortcoming of the C dynamic linking system itself."
36517 #: ../src/guestfs.pod:1558
36519 "You can use L<dlopen(3)> to test if a function is available at run time, as "
36520 "in this example program (note that you still need the compile time check as "
36525 #: ../src/guestfs.pod:1562
36528 " #include <stdio.h>\n"
36529 " #include <stdlib.h>\n"
36530 " #include <unistd.h>\n"
36531 " #include <dlfcn.h>\n"
36532 " #include <guestfs.h>\n"
36537 #: ../src/guestfs.pod:1568
36542 " #ifdef LIBGUESTFS_HAVE_DD\n"
36544 " int has_function;\n"
36549 #: ../src/guestfs.pod:1574
36552 " /* Test if the function guestfs_dd is really available. */\n"
36553 " dl = dlopen (NULL, RTLD_LAZY);\n"
36555 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
36556 " exit (EXIT_FAILURE);\n"
36558 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
36564 #: ../src/guestfs.pod:1583
36567 " if (!has_function)\n"
36568 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
36570 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
36571 " /* Now it's safe to call\n"
36572 " guestfs_dd (g, \"foo\", \"bar\");\n"
36576 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
36583 #: ../src/guestfs.pod:1596
36585 "You may think the above is an awful lot of hassle, and it is. There are "
36586 "other ways outside of the C linking system to ensure that this kind of "
36587 "incompatibility never arises, such as using package versioning:"
36591 #: ../src/guestfs.pod:1601
36594 " Requires: libguestfs >= 1.0.80\n"
36599 #: ../src/guestfs.pod:1603
36600 msgid "CALLS WITH OPTIONAL ARGUMENTS"
36604 #: ../src/guestfs.pod:1605
36606 "A recent feature of the API is the introduction of calls which take optional "
36607 "arguments. In C these are declared 3 ways. The main way is as a call which "
36608 "takes variable arguments (ie. C<...>), as in this example:"
36612 #: ../src/guestfs.pod:1610
36615 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
36620 #: ../src/guestfs.pod:1612
36622 "Call this with a list of optional arguments, terminated by C<-1>. So to "
36623 "call with no optional arguments specified:"
36627 #: ../src/guestfs.pod:1615
36630 " guestfs_add_drive_opts (g, filename, -1);\n"
36635 #: ../src/guestfs.pod:1617
36636 msgid "With a single optional argument:"
36640 #: ../src/guestfs.pod:1619
36643 " guestfs_add_drive_opts (g, filename,\n"
36644 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36650 #: ../src/guestfs.pod:1623
36655 #: ../src/guestfs.pod:1625
36658 " guestfs_add_drive_opts (g, filename,\n"
36659 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36660 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
36666 #: ../src/guestfs.pod:1630
36668 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
36673 #: ../src/guestfs.pod:1633
36674 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
36678 #: ../src/guestfs.pod:1635
36680 "The second variant has the same name with the suffix C<_va>, which works the "
36681 "same way but takes a C<va_list>. See the C manual for details. For the "
36682 "example function, this is declared:"
36686 #: ../src/guestfs.pod:1639
36689 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
36690 " va_list args);\n"
36695 #: ../src/guestfs.pod:1642
36696 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
36700 #: ../src/guestfs.pod:1644
36702 "The third variant is useful where you need to construct these calls. You "
36703 "pass in a structure where you fill in the optional fields. The structure "
36704 "has a bitmask as the first element which you must set to indicate which "
36705 "fields you have filled in. For our example function the structure and call "
36710 #: ../src/guestfs.pod:1650
36713 " struct guestfs_add_drive_opts_argv {\n"
36714 " uint64_t bitmask;\n"
36716 " const char *format;\n"
36719 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
36720 " const struct guestfs_add_drive_opts_argv *optargs);\n"
36725 #: ../src/guestfs.pod:1659
36726 msgid "You could call it like this:"
36730 #: ../src/guestfs.pod:1661
36733 " struct guestfs_add_drive_opts_argv optargs = {\n"
36734 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
36735 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
36736 " .readonly = 1,\n"
36737 " .format = \"qcow2\"\n"
36743 #: ../src/guestfs.pod:1668
36746 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
36751 #: ../src/guestfs.pod:1676
36752 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
36756 #: ../src/guestfs.pod:1681
36757 msgid "You do not need to fill in all fields of the structure."
36761 #: ../src/guestfs.pod:1685
36763 "There must be a one-to-one correspondence between fields of the structure "
36764 "that are filled in, and bits set in the bitmask."
36768 #: ../src/guestfs.pod:1690
36769 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
36773 #: ../src/guestfs.pod:1692
36775 "In other languages, optional arguments are expressed in the way that is "
36776 "natural for that language. We refer you to the language-specific "
36777 "documentation for more details on that."
36781 #: ../src/guestfs.pod:1696
36782 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
36786 #: ../src/guestfs.pod:1698
36787 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
36791 #: ../src/guestfs.pod:1700
36793 "B<Note:> This section documents the generic event mechanism introduced in "
36794 "libguestfs 1.10, which you should use in new code if possible. The old "
36795 "functions C<guestfs_set_log_message_callback>, "
36796 "C<guestfs_set_subprocess_quit_callback>, "
36797 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
36798 "C<guestfs_set_progress_callback> are no longer documented in this manual "
36799 "page. Because of the ABI guarantee, the old functions continue to work."
36803 #: ../src/guestfs.pod:1709
36805 "Handles generate events when certain things happen, such as log messages "
36806 "being generated, progress messages during long-running operations, or the "
36807 "handle being closed. The API calls described below let you register a "
36808 "callback to be called when events happen. You can register multiple "
36809 "callbacks (for the same, different or overlapping sets of events), and "
36810 "individually remove callbacks. If callbacks are not removed, then they "
36811 "remain in force until the handle is closed."
36815 #: ../src/guestfs.pod:1717
36817 "In the current implementation, events are only generated synchronously: that "
36818 "means that events (and hence callbacks) can only happen while you are in the "
36819 "middle of making another libguestfs call. The callback is called in the "
36824 #: ../src/guestfs.pod:1722
36826 "Events may contain a payload, usually nothing (void), an array of 64 bit "
36827 "unsigned integers, or a message buffer. Payloads are discussed later on."
36831 #: ../src/guestfs.pod:1726
36832 msgid "CLASSES OF EVENTS"
36836 #: ../src/guestfs.pod:1730
36837 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
36841 #: ../src/guestfs.pod:1733
36843 "The callback function will be called while the handle is being closed "
36844 "(synchronously from L</guestfs_close>)."
36848 #: ../src/guestfs.pod:1736
36850 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
36851 "handles that are open when the program exits. This means that this callback "
36852 "might be called indirectly from L<exit(3)>, which can cause unexpected "
36853 "problems in higher-level languages (eg. if your HLL interpreter has already "
36854 "been cleaned up by the time this is called, and if your callback then jumps "
36855 "into some HLL function)."
36859 #: ../src/guestfs.pod:1743
36861 "If no callback is registered: the handle is closed without any callback "
36866 #: ../src/guestfs.pod:1746
36867 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
36871 #: ../src/guestfs.pod:1749
36873 "The callback function will be called when the child process quits, either "
36874 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
36875 "corresponds to a transition from any state to the CONFIG state)."
36879 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
36880 msgid "If no callback is registered: the event is ignored."
36884 #: ../src/guestfs.pod:1755
36885 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
36889 #: ../src/guestfs.pod:1758
36891 "The callback function will be called when the child process becomes ready "
36892 "first time after it has been launched. (This corresponds to a transition "
36893 "from LAUNCHING to the READY state)."
36897 #: ../src/guestfs.pod:1764
36898 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
36902 #: ../src/guestfs.pod:1767
36904 "Some long-running operations can generate progress messages. If this "
36905 "callback is registered, then it will be called each time a progress message "
36906 "is generated (usually two seconds after the operation started, and three "
36907 "times per second thereafter until it completes, although the frequency may "
36908 "change in future versions)."
36912 #: ../src/guestfs.pod:1773
36914 "The callback receives in the payload four unsigned 64 bit numbers which are "
36915 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
36919 #: ../src/guestfs.pod:1776
36921 "The units of C<total> are not defined, although for some operations C<total> "
36922 "may relate in some way to the amount of data to be transferred (eg. in bytes "
36923 "or megabytes), and C<position> may be the portion which has been transferred."
36927 #: ../src/guestfs.pod:1781
36928 msgid "The only defined and stable parts of the API are:"
36932 #: ../src/guestfs.pod:1787
36934 "The callback can display to the user some type of progress bar or indicator "
36935 "which shows the ratio of C<position>:C<total>."
36939 #: ../src/guestfs.pod:1792
36940 msgid "0 E<lt>= C<position> E<lt>= C<total>"
36944 #: ../src/guestfs.pod:1796
36946 "If any progress notification is sent during a call, then a final progress "
36947 "notification is always sent when C<position> = C<total> (I<unless> the call "
36948 "fails with an error)."
36952 #: ../src/guestfs.pod:1800
36954 "This is to simplify caller code, so callers can easily set the progress "
36955 "indicator to \"100%\" at the end of the operation, without requiring special "
36956 "code to detect this case."
36960 #: ../src/guestfs.pod:1806
36962 "For some calls we are unable to estimate the progress of the call, but we "
36963 "can still generate progress messages to indicate activity. This is known as "
36964 "\"pulse mode\", and is directly supported by certain progress bar "
36965 "implementations (eg. GtkProgressBar)."
36969 #: ../src/guestfs.pod:1811
36971 "For these calls, zero or more progress messages are generated with "
36972 "C<position = 0> and C<total = 1>, followed by a final message with "
36973 "C<position = total = 1>."
36977 #: ../src/guestfs.pod:1815
36979 "As noted above, if the call fails with an error then the final message may "
36980 "not be generated."
36984 #: ../src/guestfs.pod:1820
36986 "The callback also receives the procedure number (C<proc_nr>) and serial "
36987 "number (C<serial>) of the call. These are only useful for debugging "
36988 "protocol issues, and the callback can normally ignore them. The callback "
36989 "may want to print these numbers in error messages or debugging messages."
36993 #: ../src/guestfs.pod:1826
36994 msgid "If no callback is registered: progress messages are discarded."
36998 #: ../src/guestfs.pod:1828
36999 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
37003 #: ../src/guestfs.pod:1831
37005 "The callback function is called whenever a log message is generated by qemu, "
37006 "the appliance kernel, guestfsd (daemon), or utility programs."
37010 #: ../src/guestfs.pod:1834
37012 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
37013 "guestfs_launch>) then additional debug messages are generated."
37017 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
37019 "If no callback is registered: the messages are discarded unless the verbose "
37020 "flag is set in which case they are sent to stderr. You can override the "
37021 "printing of verbose messages to stderr by setting up a callback."
37025 #: ../src/guestfs.pod:1842
37026 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
37030 #: ../src/guestfs.pod:1845
37032 "The callback function is called whenever a log message is generated by the "
37033 "library part of libguestfs."
37037 #: ../src/guestfs.pod:1848
37039 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
37040 "messages are generated."
37044 #: ../src/guestfs.pod:1856
37045 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
37049 #: ../src/guestfs.pod:1859
37051 "The callback function is called whenever a trace message is generated. This "
37052 "only applies if the trace flag (L</guestfs_set_trace>) is set."
37056 #: ../src/guestfs.pod:1862
37058 "If no callback is registered: the messages are sent to stderr. You can "
37059 "override the printing of trace messages to stderr by setting up a callback."
37063 #: ../src/guestfs.pod:1866
37064 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
37068 #: ../src/guestfs.pod:1869
37070 "The callback function is called whenever a libguestfs function is entered."
37074 #: ../src/guestfs.pod:1872
37076 "The payload is a string which contains the name of the function that we are "
37077 "entering (not including C<guestfs_> prefix)."
37081 #: ../src/guestfs.pod:1875
37083 "Note that libguestfs functions can call themselves, so you may see many "
37084 "events from a single call. A few libguestfs functions do not generate this "
37089 #: ../src/guestfs.pod:1883
37090 msgid "guestfs_set_event_callback"
37094 #: ../src/guestfs.pod:1885
37097 " int guestfs_set_event_callback (guestfs_h *g,\n"
37098 " guestfs_event_callback cb,\n"
37099 " uint64_t event_bitmask,\n"
37101 " void *opaque);\n"
37106 #: ../src/guestfs.pod:1891
37108 "This function registers a callback (C<cb>) for all event classes in the "
37109 "C<event_bitmask>."
37113 #: ../src/guestfs.pod:1894
37115 "For example, to register for all log message events, you could call this "
37116 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
37117 "To register a single callback for all possible classes of events, use "
37118 "C<GUESTFS_EVENT_ALL>."
37122 #: ../src/guestfs.pod:1900
37123 msgid "C<flags> should always be passed as 0."
37127 #: ../src/guestfs.pod:1902
37129 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
37130 "it for any purpose."
37134 #: ../src/guestfs.pod:1905
37136 "The return value is the event handle (an integer) which you can use to "
37137 "delete the callback (see below)."
37141 #: ../src/guestfs.pod:1908
37143 "If there is an error, this function returns C<-1>, and sets the error in the "
37144 "handle in the usual way (see L</guestfs_last_error> etc.)"
37148 #: ../src/guestfs.pod:1911
37150 "Callbacks remain in effect until they are deleted, or until the handle is "
37155 #: ../src/guestfs.pod:1914
37157 "In the case where multiple callbacks are registered for a particular event "
37158 "class, all of the callbacks are called. The order in which multiple "
37159 "callbacks are called is not defined."
37163 #: ../src/guestfs.pod:1918
37164 msgid "guestfs_delete_event_callback"
37168 #: ../src/guestfs.pod:1920
37171 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
37176 #: ../src/guestfs.pod:1922
37178 "Delete a callback that was previously registered. C<event_handle> should be "
37179 "the integer that was returned by a previous call to "
37180 "C<guestfs_set_event_callback> on the same handle."
37184 #: ../src/guestfs.pod:1926
37185 msgid "guestfs_event_callback"
37189 #: ../src/guestfs.pod:1928
37192 " typedef void (*guestfs_event_callback) (\n"
37195 " uint64_t event,\n"
37196 " int event_handle,\n"
37198 " const char *buf, size_t buf_len,\n"
37199 " const uint64_t *array, size_t array_len);\n"
37204 #: ../src/guestfs.pod:1937
37206 "This is the type of the event callback function that you have to provide."
37210 #: ../src/guestfs.pod:1940
37212 "The basic parameters are: the handle (C<g>), the opaque user pointer "
37213 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
37214 "handle, and C<flags> which in the current API you should ignore."
37218 #: ../src/guestfs.pod:1944
37220 "The remaining parameters contain the event payload (if any). Each event may "
37221 "contain a payload, which usually relates to the event class, but for future "
37222 "proofing your code should be written to handle any payload for any event "
37227 #: ../src/guestfs.pod:1949
37229 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
37230 "there is no message buffer). Note that this message buffer can contain "
37231 "arbitrary 8 bit data, including NUL bytes."
37235 #: ../src/guestfs.pod:1953
37237 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
37238 "moment this is only used for progress messages."
37242 #: ../src/guestfs.pod:1956
37243 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
37247 #: ../src/guestfs.pod:1958
37249 "One motivation for the generic event API was to allow GUI programs to "
37250 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
37251 "unconditionally to C<stderr>."
37255 #: ../src/guestfs.pod:1962
37257 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
37258 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
37259 "messages are not events; you must capture error messages separately)."
37263 #: ../src/guestfs.pod:1967
37265 "Programs have to set up a callback to capture the classes of events of "
37270 #: ../src/guestfs.pod:1970
37274 " guestfs_set_event_callback\n"
37275 " (g, message_callback,\n"
37276 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
37277 " GUESTFS_EVENT_TRACE,\n"
37278 " 0, NULL) == -1)\n"
37279 " if (eh == -1) {\n"
37280 " // handle error in the usual way\n"
37286 #: ../src/guestfs.pod:1980
37288 "The callback can then direct messages to the appropriate place. In this "
37289 "example, messages are directed to syslog:"
37293 #: ../src/guestfs.pod:1983
37297 " message_callback (\n"
37300 " uint64_t event,\n"
37301 " int event_handle,\n"
37303 " const char *buf, size_t buf_len,\n"
37304 " const uint64_t *array, size_t array_len)\n"
37306 " const int priority = LOG_USER|LOG_INFO;\n"
37307 " if (buf_len > 0)\n"
37308 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
37314 #: ../src/guestfs.pod:1998
37315 msgid "CANCELLING LONG TRANSFERS"
37319 #: ../src/guestfs.pod:2000
37321 "Some operations can be cancelled by the caller while they are in progress. "
37322 "Currently only operations that involve uploading or downloading data can be "
37323 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
37324 "parameters in the generator)."
37328 #: ../src/guestfs.pod:2005
37329 msgid "guestfs_user_cancel"
37333 #: ../src/guestfs.pod:2007
37336 " void guestfs_user_cancel (guestfs_h *g);\n"
37341 #: ../src/guestfs.pod:2009
37343 "C<guestfs_user_cancel> cancels the current upload or download operation."
37347 #: ../src/guestfs.pod:2012
37349 "Unlike most other libguestfs calls, this function is signal safe and thread "
37350 "safe. You can call it from a signal handler or from another thread, without "
37351 "needing to do any locking."
37355 #: ../src/guestfs.pod:2016
37357 "The transfer that was in progress (if there is one) will stop shortly "
37358 "afterwards, and will return an error. The errno (see L</"
37359 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
37360 "out if the operation was cancelled or failed because of another error."
37364 #: ../src/guestfs.pod:2022
37366 "No cleanup is performed: for example, if a file was being uploaded then "
37367 "after cancellation there may be a partially uploaded file. It is the "
37368 "caller's responsibility to clean up if necessary."
37372 #: ../src/guestfs.pod:2026
37373 msgid "There are two common places that you might call C<guestfs_user_cancel>."
37377 #: ../src/guestfs.pod:2028
37379 "In an interactive text-based program, you might call it from a C<SIGINT> "
37380 "signal handler so that pressing C<^C> cancels the current operation. (You "
37381 "also need to call L</guestfs_set_pgroup> so that child processes don't "
37382 "receive the C<^C> signal)."
37386 #: ../src/guestfs.pod:2033
37388 "In a graphical program, when the main thread is displaying a progress bar "
37389 "with a cancel button, wire up the cancel button to call this function."
37393 #: ../src/guestfs.pod:2037
37394 msgid "PRIVATE DATA AREA"
37398 #: ../src/guestfs.pod:2039
37400 "You can attach named pieces of private data to the libguestfs handle, fetch "
37401 "them by name, and walk over them, for the lifetime of the handle. This is "
37402 "called the private data area and is only available from the C API."
37406 #: ../src/guestfs.pod:2044
37407 msgid "To attach a named piece of data, use the following call:"
37411 #: ../src/guestfs.pod:2046
37414 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
37419 #: ../src/guestfs.pod:2048
37421 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
37422 "pointer (which can be C<NULL>). Any previous item with the same key is "
37427 #: ../src/guestfs.pod:2052
37429 "You can use any C<key> you want, but your key should I<not> start with an "
37430 "underscore character. Keys beginning with an underscore character are "
37431 "reserved for internal libguestfs purposes (eg. for implementing language "
37432 "bindings). It is recommended that you prefix the key with some unique "
37433 "string to avoid collisions with other users."
37437 #: ../src/guestfs.pod:2058
37438 msgid "To retrieve the pointer, use:"
37442 #: ../src/guestfs.pod:2060
37445 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
37450 #: ../src/guestfs.pod:2062
37452 "This function returns C<NULL> if either no data is found associated with "
37453 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
37458 #: ../src/guestfs.pod:2066
37460 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
37461 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
37462 "all. In particular, libguestfs does I<not> try to free the data when the "
37463 "handle is closed. If the data must be freed, then the caller must either "
37464 "free it before calling L</guestfs_close> or must set up a close callback to "
37465 "do it (see L</GUESTFS_EVENT_CLOSE>)."
37469 #: ../src/guestfs.pod:2073
37470 msgid "To walk over all entries, use these two functions:"
37474 #: ../src/guestfs.pod:2075
37477 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
37482 #: ../src/guestfs.pod:2077
37485 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
37490 #: ../src/guestfs.pod:2079
37492 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
37493 "not have any particular meaning -- keys are not returned in any defined "
37494 "order). A pointer to the key is returned in C<*key_rtn> and the "
37495 "corresponding data pointer is returned from the function. C<NULL> is "
37496 "returned if there are no keys stored in the handle."
37500 #: ../src/guestfs.pod:2085
37502 "C<guestfs_next_private> returns the next key, pointer pair. The return "
37503 "value of this function is also C<NULL> is there are no further entries to "
37508 #: ../src/guestfs.pod:2089
37509 msgid "Notes about walking over entries:"
37513 #: ../src/guestfs.pod:2095
37515 "You must not call C<guestfs_set_private> while walking over the entries."
37519 #: ../src/guestfs.pod:2100
37521 "The handle maintains an internal iterator which is reset when you call "
37522 "C<guestfs_first_private>. This internal iterator is invalidated when you "
37523 "call C<guestfs_set_private>."
37527 #: ../src/guestfs.pod:2106
37528 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
37532 #: ../src/guestfs.pod:2108
37535 " guestfs_set_private (g, key, NULL);\n"
37540 #: ../src/guestfs.pod:2110
37541 msgid "then that C<key> is not returned when walking."
37545 #: ../src/guestfs.pod:2114
37547 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
37548 "C<guestfs_next_private> or C<guestfs_set_private>."
37552 #: ../src/guestfs.pod:2120
37554 "The following example code shows how to print all keys and data pointers "
37555 "that are associated with the handle C<g>:"
37559 #: ../src/guestfs.pod:2123
37562 " const char *key;\n"
37563 " void *data = guestfs_first_private (g, &key);\n"
37564 " while (data != NULL)\n"
37566 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37567 " data = guestfs_next_private (g, &key);\n"
37573 #: ../src/guestfs.pod:2131
37575 "More commonly you are only interested in keys that begin with an application-"
37576 "specific prefix C<foo_>. Modify the loop like so:"
37580 #: ../src/guestfs.pod:2134
37583 " const char *key;\n"
37584 " void *data = guestfs_first_private (g, &key);\n"
37585 " while (data != NULL)\n"
37587 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37588 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37589 " data = guestfs_next_private (g, &key);\n"
37595 #: ../src/guestfs.pod:2143
37597 "If you need to modify keys while walking, then you have to jump back to the "
37598 "beginning of the loop. For example, to delete all keys prefixed with "
37603 #: ../src/guestfs.pod:2147
37606 " const char *key;\n"
37609 " data = guestfs_first_private (g, &key);\n"
37610 " while (data != NULL)\n"
37612 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37614 " guestfs_set_private (g, key, NULL);\n"
37615 " /* note that 'key' pointer is now invalid, and so is\n"
37616 " the internal iterator */\n"
37619 " data = guestfs_next_private (g, &key);\n"
37625 #: ../src/guestfs.pod:2163
37627 "Note that the above loop is guaranteed to terminate because the keys are "
37628 "being deleted, but other manipulations of keys within the loop might not "
37629 "terminate unless you also maintain an indication of which keys have been "
37634 #: ../src/guestfs.pod:2168
37639 #: ../src/guestfs.pod:2170
37641 "The libguestfs C library can be probed using systemtap or DTrace. This is "
37642 "true of any library, not just libguestfs. However libguestfs also contains "
37643 "static markers to help in probing internal operations."
37647 #: ../src/guestfs.pod:2174
37648 msgid "You can list all the static markers by doing:"
37652 #: ../src/guestfs.pod:2176
37655 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
37656 " .provider(\"guestfs\").mark(\"*\")'\n"
37661 #: ../src/guestfs.pod:2179
37663 "B<Note:> These static markers are I<not> part of the stable API and may "
37664 "change in future versions."
37668 #: ../src/guestfs.pod:2182
37669 msgid "SYSTEMTAP SCRIPT EXAMPLE"
37673 #: ../src/guestfs.pod:2184
37675 "This script contains examples of displaying both the static markers and some "
37676 "ordinary C entry points:"
37680 #: ../src/guestfs.pod:2187
37688 #: ../src/guestfs.pod:2189
37691 " function display_time () {\n"
37692 " now = gettimeofday_us ();\n"
37695 " delta = now - last;\n"
37701 #: ../src/guestfs.pod:2196
37704 " printf (\"%d (+%d):\", now, delta);\n"
37710 #: ../src/guestfs.pod:2199
37715 " printf (\"ready\\n\");\n"
37721 #: ../src/guestfs.pod:2204
37724 " /* Display all calls to static markers. */\n"
37725 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37726 " .provider(\"guestfs\").mark(\"*\") ? {\n"
37727 " display_time();\n"
37728 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
37734 #: ../src/guestfs.pod:2211
37737 " /* Display all calls to guestfs_mkfs* functions. */\n"
37738 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37739 " .function(\"guestfs_mkfs*\") ? {\n"
37740 " display_time();\n"
37741 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
37747 #: ../src/guestfs.pod:2218
37749 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
37750 "program. Note that you either have to be root, or you have to add yourself "
37751 "to several special stap groups. Consult the systemtap documentation for "
37752 "more information."
37756 #: ../src/guestfs.pod:2223
37759 " # stap /tmp/test.stap\n"
37765 #: ../src/guestfs.pod:2226
37766 msgid "In another terminal, run a guestfish command such as this:"
37770 #: ../src/guestfs.pod:2230
37771 msgid "In the first terminal, stap trace output similar to this is shown:"
37775 #: ../src/guestfs.pod:2232
37778 " 1318248056692655 (+0):\tlaunch_start\n"
37779 " 1318248056692850 (+195): launch_build_appliance_start\n"
37780 " 1318248056818285 (+125435): launch_build_appliance_end\n"
37781 " 1318248056838059 (+19774): launch_run_qemu\n"
37782 " 1318248061071167 (+4233108): launch_end\n"
37783 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f device=0x1024e60\n"
37788 #: ../src/guestfs.pod:2239 ../src/guestfs.pod:2244
37793 #: ../src/guestfs.pod:2241
37795 "<!-- old anchor for the next section --> <a name="
37796 "\"state_machine_and_low_level_event_api\"/>"
37800 #: ../src/guestfs.pod:2246
37801 msgid "ARCHITECTURE"
37805 #: ../src/guestfs.pod:2248
37807 "Internally, libguestfs is implemented by running an appliance (a special "
37808 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
37809 "process of the main program."
37813 #: ../src/guestfs.pod:2252
37816 " ___________________\n"
37818 " | main program |\n"
37820 " | | child process / appliance\n"
37821 " | | __________________________\n"
37823 " +-------------------+ RPC | +-----------------+ |\n"
37824 " | libguestfs <--------------------> guestfsd | |\n"
37825 " | | | +-----------------+ |\n"
37826 " \\___________________/ | | Linux kernel | |\n"
37827 " | +--^--------------+ |\n"
37828 " \\_________|________________/\n"
37830 " _______v______\n"
37833 " | disk image |\n"
37834 " \\______________/\n"
37839 #: ../src/guestfs.pod:2272
37841 "The library, linked to the main program, creates the child process and hence "
37842 "the appliance in the L</guestfs_launch> function."
37846 #: ../src/guestfs.pod:2275
37848 "Inside the appliance is a Linux kernel and a complete stack of userspace "
37849 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
37850 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
37851 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
37852 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
37853 "attached to the qemu process which translates device access by the "
37854 "appliance's Linux kernel into accesses to the image."
37858 #: ../src/guestfs.pod:2284
37860 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
37861 "Although the disk image you are attached to might also be used by some "
37862 "virtual machine, libguestfs doesn't know or care about this. (But you will "
37863 "care if both libguestfs's qemu process and your virtual machine are trying "
37864 "to update the disk image at the same time, since these usually results in "
37865 "massive disk corruption)."
37869 #: ../src/guestfs.pod:2291
37870 msgid "STATE MACHINE"
37874 #: ../src/guestfs.pod:2293
37875 msgid "libguestfs uses a state machine to model the child process:"
37879 #: ../src/guestfs.pod:2295
37883 " guestfs_create\n"
37891 " / | \\ \\ guestfs_launch\n"
37892 " / | _\\__V______\n"
37894 " / | | LAUNCHING |\n"
37895 " / | \\___________/\n"
37897 " / | guestfs_launch\n"
37899 " ______ / __|____V\n"
37900 " / \\ ------> / \\\n"
37901 " | BUSY | | READY |\n"
37902 " \\______/ <------ \\________/\n"
37907 #: ../src/guestfs.pod:2317
37909 "The normal transitions are (1) CONFIG (when the handle is created, but there "
37910 "is no child process), (2) LAUNCHING (when the child process is booting up), "
37911 "(3) alternating between READY and BUSY as commands are issued to, and "
37912 "carried out by, the child process."
37916 #: ../src/guestfs.pod:2322
37918 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
37919 "asynchronously at any time (eg. due to some internal error), and that causes "
37920 "the state to transition back to CONFIG."
37924 #: ../src/guestfs.pod:2326
37926 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
37927 "issued when in the CONFIG state."
37931 #: ../src/guestfs.pod:2329
37933 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
37934 "L</guestfs_launch> blocks until the child process is READY to accept "
37935 "commands (or until some failure or timeout). L</guestfs_launch> internally "
37936 "moves the state from CONFIG to LAUNCHING while it is running."
37940 #: ../src/guestfs.pod:2335
37942 "API actions such as L</guestfs_mount> can only be issued when in the READY "
37943 "state. These API calls block waiting for the command to be carried out (ie. "
37944 "the state to transition to BUSY and then back to READY). There are no non-"
37945 "blocking versions, and no way to issue more than one command per handle at "
37950 #: ../src/guestfs.pod:2341
37952 "Finally, the child process sends asynchronous messages back to the main "
37953 "program, such as kernel log messages. You can register a callback to "
37954 "receive these messages."
37958 #: ../src/guestfs.pod:2345
37963 #: ../src/guestfs.pod:2347
37964 msgid "APPLIANCE BOOT PROCESS"
37968 #: ../src/guestfs.pod:2349
37970 "This process has evolved and continues to evolve. The description here "
37971 "corresponds only to the current version of libguestfs and is provided for "
37972 "information only."
37976 #: ../src/guestfs.pod:2353
37978 "In order to follow the stages involved below, enable libguestfs debugging "
37979 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
37983 #: ../src/guestfs.pod:2358
37984 msgid "Create the appliance"
37988 #: ../src/guestfs.pod:2360
37990 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
37991 "initrd and the appliance."
37995 #: ../src/guestfs.pod:2363
37997 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
37998 "directory if C<TMPDIR> is set)."
38002 #: ../src/guestfs.pod:2366
38004 "For a complete description of how the appliance is created and cached, read "
38005 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
38009 #: ../src/guestfs.pod:2370
38010 msgid "Start qemu and boot the kernel"
38014 #: ../src/guestfs.pod:2372
38015 msgid "qemu is invoked to boot the kernel."
38019 #: ../src/guestfs.pod:2374
38020 msgid "Run the initrd"
38024 #: ../src/guestfs.pod:2376
38026 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
38027 "appliance. The purpose of the initrd is to load enough kernel modules in "
38028 "order that the appliance itself can be mounted and started."
38032 #: ../src/guestfs.pod:2380
38034 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
38039 #: ../src/guestfs.pod:2383
38041 "When the initrd has started you will see messages showing that kernel "
38042 "modules are being loaded, similar to this:"
38046 #: ../src/guestfs.pod:2386
38049 " febootstrap: ext2 mini initrd starting up\n"
38050 " febootstrap: mounting /sys\n"
38051 " febootstrap: internal insmod libcrc32c.ko\n"
38052 " febootstrap: internal insmod crc32c-intel.ko\n"
38057 #: ../src/guestfs.pod:2391
38058 msgid "Find and mount the appliance device"
38062 #: ../src/guestfs.pod:2393
38064 "The appliance is a sparse file containing an ext2 filesystem which contains "
38065 "a familiar (although reduced in size) Linux operating system. It would "
38066 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
38070 #: ../src/guestfs.pod:2397
38072 "The regular disks being inspected by libguestfs are the first devices "
38073 "exposed by qemu (eg. as C</dev/vda>)."
38077 #: ../src/guestfs.pod:2400
38079 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
38080 "there was only one regular disk)."
38084 #: ../src/guestfs.pod:2403
38086 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
38087 "and switch root into the appliance, and run C</init> from the appliance."
38091 #: ../src/guestfs.pod:2407
38092 msgid "If this works successfully you will see messages such as:"
38096 #: ../src/guestfs.pod:2409
38099 " febootstrap: picked /sys/block/vdb/dev as root device\n"
38100 " febootstrap: creating /dev/root as block special 252:16\n"
38101 " febootstrap: mounting new root on /root\n"
38102 " febootstrap: chroot\n"
38103 " Starting /init script ...\n"
38108 #: ../src/guestfs.pod:2415
38110 "Note that C<Starting /init script ...> indicates that the appliance's init "
38111 "script is now running."
38115 #: ../src/guestfs.pod:2418
38116 msgid "Initialize the appliance"
38120 #: ../src/guestfs.pod:2420
38122 "The appliance itself now initializes itself. This involves starting certain "
38123 "processes like C<udev>, possibly printing some debug information, and "
38124 "finally running the daemon (C<guestfsd>)."
38128 #: ../src/guestfs.pod:2424
38133 #: ../src/guestfs.pod:2426
38135 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
38140 #: ../src/guestfs.pod:2429
38143 " verbose daemon enabled\n"
38148 #: ../src/guestfs.pod:2431
38150 "The daemon expects to see a named virtio-serial port exposed by qemu and "
38151 "connected on the other end to the library."
38155 #: ../src/guestfs.pod:2434
38157 "The daemon connects to this port (and hence to the library) and sends a four "
38158 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
38159 "protocol (see below)."
38163 #: ../src/guestfs.pod:2440
38164 msgid "COMMUNICATION PROTOCOL"
38168 #: ../src/guestfs.pod:2442
38170 "Don't rely on using this protocol directly. This section documents how it "
38171 "currently works, but it may change at any time."
38175 #: ../src/guestfs.pod:2445
38177 "The protocol used to talk between the library and the daemon running inside "
38178 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
38179 "1014, RFC 1832, RFC 4506)."
38183 #: ../src/guestfs.pod:2449
38185 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
38186 "this file is automatically generated)."
38190 #: ../src/guestfs.pod:2452
38192 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
38193 "and C<FileOut> parameters, which are handled with very simple request/reply "
38194 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
38195 "parameters, which use the same request and reply messages, but they may also "
38196 "be followed by files sent using a chunked encoding."
38200 #: ../src/guestfs.pod:2459
38201 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
38205 #: ../src/guestfs.pod:2461
38206 msgid "For ordinary functions, the request message is:"
38210 #: ../src/guestfs.pod:2463
38213 " total length (header + arguments,\n"
38214 " but not including the length word itself)\n"
38215 " struct guestfs_message_header (encoded as XDR)\n"
38216 " struct guestfs_<foo>_args (encoded as XDR)\n"
38221 #: ../src/guestfs.pod:2468
38223 "The total length field allows the daemon to allocate a fixed size buffer "
38224 "into which it slurps the rest of the message. As a result, the total length "
38225 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
38226 "effective size of any request is limited to somewhere under this size."
38230 #: ../src/guestfs.pod:2474
38232 "Note also that many functions don't take any arguments, in which case the "
38233 "C<guestfs_I<foo>_args> is completely omitted."
38237 #: ../src/guestfs.pod:2477
38239 "The header contains the procedure number (C<guestfs_proc>) which is how the "
38240 "receiver knows what type of args structure to expect, or none at all."
38244 #: ../src/guestfs.pod:2481
38246 "For functions that take optional arguments, the optional arguments are "
38247 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
38248 "arguments. A bitmask in the header indicates which optional arguments are "
38249 "meaningful. The bitmask is also checked to see if it contains bits set "
38250 "which the daemon does not know about (eg. if more optional arguments were "
38251 "added in a later version of the library), and this causes the call to be "
38256 #: ../src/guestfs.pod:2489
38257 msgid "The reply message for ordinary functions is:"
38261 #: ../src/guestfs.pod:2491
38264 " total length (header + ret,\n"
38265 " but not including the length word itself)\n"
38266 " struct guestfs_message_header (encoded as XDR)\n"
38267 " struct guestfs_<foo>_ret (encoded as XDR)\n"
38272 #: ../src/guestfs.pod:2496
38274 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
38275 "functions that return no formal return values."
38279 #: ../src/guestfs.pod:2499
38281 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
38285 #: ../src/guestfs.pod:2502
38287 "In the case of an error, a flag is set in the header, and the reply message "
38288 "is slightly changed:"
38292 #: ../src/guestfs.pod:2505
38295 " total length (header + error,\n"
38296 " but not including the length word itself)\n"
38297 " struct guestfs_message_header (encoded as XDR)\n"
38298 " struct guestfs_message_error (encoded as XDR)\n"
38303 #: ../src/guestfs.pod:2510
38305 "The C<guestfs_message_error> structure contains the error message as a "
38310 #: ../src/guestfs.pod:2513
38311 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
38315 #: ../src/guestfs.pod:2515
38317 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
38318 "The normal request message is sent (see above). However this is followed by "
38319 "a sequence of file chunks."
38323 #: ../src/guestfs.pod:2519
38326 " total length (header + arguments,\n"
38327 " but not including the length word itself,\n"
38328 " and not including the chunks)\n"
38329 " struct guestfs_message_header (encoded as XDR)\n"
38330 " struct guestfs_<foo>_args (encoded as XDR)\n"
38331 " sequence of chunks for FileIn param #0\n"
38332 " sequence of chunks for FileIn param #1 etc.\n"
38337 #: ../src/guestfs.pod:2527
38338 msgid "The \"sequence of chunks\" is:"
38342 #: ../src/guestfs.pod:2529
38345 " length of chunk (not including length word itself)\n"
38346 " struct guestfs_chunk (encoded as XDR)\n"
38347 " length of chunk\n"
38348 " struct guestfs_chunk (encoded as XDR)\n"
38350 " length of chunk\n"
38351 " struct guestfs_chunk (with data.data_len == 0)\n"
38356 #: ../src/guestfs.pod:2537
38358 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
38359 "is set in the final chunk to indicate either successful completion or early "
38364 #: ../src/guestfs.pod:2541
38366 "At time of writing there are no functions that have more than one FileIn "
38367 "parameter. However this is (theoretically) supported, by sending the "
38368 "sequence of chunks for each FileIn parameter one after another (from left to "
38373 #: ../src/guestfs.pod:2546
38375 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
38376 "transfer. The library does this by sending a chunk with a special flag set "
38377 "to indicate cancellation. When the daemon sees this, it cancels the whole "
38378 "RPC, does I<not> send any reply, and goes back to reading the next request."
38382 #: ../src/guestfs.pod:2552
38384 "The daemon may also cancel. It does this by writing a special word "
38385 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
38386 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
38387 "cancel chunk). The special word is chosen so that even if cancellation "
38388 "happens right at the end of the transfer (after the library has finished "
38389 "writing and has started listening for the reply), the \"spurious\" cancel "
38390 "flag will not be confused with the reply message."
38394 #: ../src/guestfs.pod:2561
38396 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
38397 "limit), and also files where the size is not known in advance (eg. from "
38398 "pipes or sockets). However the chunks are rather small "
38399 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
38400 "to keep much in memory."
38404 #: ../src/guestfs.pod:2567
38405 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
38409 #: ../src/guestfs.pod:2569
38411 "The protocol for FileOut parameters is exactly the same as for FileIn "
38412 "parameters, but with the roles of daemon and library reversed."
38416 #: ../src/guestfs.pod:2572
38419 " total length (header + ret,\n"
38420 " but not including the length word itself,\n"
38421 " and not including the chunks)\n"
38422 " struct guestfs_message_header (encoded as XDR)\n"
38423 " struct guestfs_<foo>_ret (encoded as XDR)\n"
38424 " sequence of chunks for FileOut param #0\n"
38425 " sequence of chunks for FileOut param #1 etc.\n"
38430 #: ../src/guestfs.pod:2580
38431 msgid "INITIAL MESSAGE"
38435 #: ../src/guestfs.pod:2582
38437 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
38438 "which indicates that the guest and daemon is alive. This is what L</"
38439 "guestfs_launch> waits for."
38443 #: ../src/guestfs.pod:2586
38444 msgid "PROGRESS NOTIFICATION MESSAGES"
38448 #: ../src/guestfs.pod:2588
38450 "The daemon may send progress notification messages at any time. These are "
38451 "distinguished by the normal length word being replaced by "
38452 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
38456 #: ../src/guestfs.pod:2592
38458 "The library turns them into progress callbacks (see L</"
38459 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
38464 #: ../src/guestfs.pod:2596
38466 "The daemon self-limits the frequency of progress messages it sends (see "
38467 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
38472 #: ../src/guestfs.pod:2600
38473 msgid "LIBGUESTFS VERSION NUMBERS"
38477 #: ../src/guestfs.pod:2602
38479 "Since April 2010, libguestfs has started to make separate development and "
38480 "stable releases, along with corresponding branches in our git repository. "
38481 "These separate releases can be identified by version number:"
38485 #: ../src/guestfs.pod:2607
38488 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
38489 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
38495 " | `-------- sub-version\n"
38497 " `------ always '1' because we don't change the ABI\n"
38502 #: ../src/guestfs.pod:2618
38503 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
38507 #: ../src/guestfs.pod:2620
38509 "As time passes we cherry pick fixes from the development branch and backport "
38510 "those into the stable branch, the effect being that the stable branch should "
38511 "get more stable and less buggy over time. So the stable releases are ideal "
38512 "for people who don't need new features but would just like the software to "
38517 #: ../src/guestfs.pod:2626
38518 msgid "Our criteria for backporting changes are:"
38522 #: ../src/guestfs.pod:2632
38524 "Documentation changes which don't affect any code are backported unless the "
38525 "documentation refers to a future feature which is not in stable."
38529 #: ../src/guestfs.pod:2638
38531 "Bug fixes which are not controversial, fix obvious problems, and have been "
38532 "well tested are backported."
38536 #: ../src/guestfs.pod:2643
38538 "Simple rearrangements of code which shouldn't affect how it works get "
38539 "backported. This is so that the code in the two branches doesn't get too "
38540 "far out of step, allowing us to backport future fixes more easily."
38544 #: ../src/guestfs.pod:2649
38546 "We I<don't> backport new features, new APIs, new tools etc, except in one "
38547 "exceptional case: the new feature is required in order to implement an "
38548 "important bug fix."
38552 #: ../src/guestfs.pod:2655
38554 "A new stable branch starts when we think the new features in development are "
38555 "substantial and compelling enough over the current stable branch to warrant "
38556 "it. When that happens we create new stable and development versions 1.N.0 "
38557 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
38558 "stable at this point, but by backporting fixes from development, that branch "
38559 "will stabilize over time."
38563 #: ../src/guestfs.pod:2663
38564 msgid "EXTENDING LIBGUESTFS"
38568 #: ../src/guestfs.pod:2665
38569 msgid "ADDING A NEW API ACTION"
38573 #: ../src/guestfs.pod:2667
38575 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
38576 "documentation) are generated, and this makes it easy to extend the "
38581 #: ../src/guestfs.pod:2671
38582 msgid "To add a new API action there are two changes:"
38586 #: ../src/guestfs.pod:2677
38588 "You need to add a description of the call (name, parameters, return type, "
38589 "tests, documentation) to C<generator/generator_actions.ml>."
38593 #: ../src/guestfs.pod:2680
38595 "There are two sorts of API action, depending on whether the call goes "
38596 "through to the daemon in the appliance, or is serviced entirely by the "
38597 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
38598 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
38599 "an example of the latter, since a trace flag is maintained in the handle and "
38600 "all tracing is done on the library side."
38604 #: ../src/guestfs.pod:2688
38606 "Most new actions are of the first type, and get added to the "
38607 "C<daemon_functions> list. Each function has a unique procedure number used "
38608 "in the RPC protocol which is assigned to that action when we publish "
38609 "libguestfs and cannot be reused. Take the latest procedure number and "
38614 #: ../src/guestfs.pod:2694
38616 "For library-only actions of the second type, add to the "
38617 "C<non_daemon_functions> list. Since these functions are serviced by the "
38618 "library and do not travel over the RPC mechanism to the daemon, these "
38619 "functions do not need a procedure number, and so the procedure number is set "
38624 #: ../src/guestfs.pod:2702
38625 msgid "Implement the action (in C):"
38629 #: ../src/guestfs.pod:2704
38631 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
38632 "C<daemon/> directory."
38636 #: ../src/guestfs.pod:2707
38638 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
38639 "(note: double underscore) in the C<src/> directory."
38643 #: ../src/guestfs.pod:2710
38644 msgid "In either case, use another function as an example of what to do."
38648 #: ../src/guestfs.pod:2714
38649 msgid "After making these changes, use C<make> to compile."
38653 #: ../src/guestfs.pod:2716
38655 "Note that you don't need to implement the RPC, language bindings, manual "
38656 "pages or anything else. It's all automatically generated from the OCaml "
38661 #: ../src/guestfs.pod:2720
38662 msgid "ADDING TESTS FOR AN API ACTION"
38666 #: ../src/guestfs.pod:2722
38668 "You can supply zero or as many tests as you want per API call. The tests "
38669 "can either be added as part of the API description (C<generator/"
38670 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
38671 "into C<regressions/>. Note that adding a script to C<regressions/> is "
38672 "slower, so if possible use the first method."
38676 #: ../src/guestfs.pod:2728
38678 "The following describes the test environment used when you add an API test "
38679 "in C<generator_actions.ml>."
38683 #: ../src/guestfs.pod:2731
38684 msgid "The test environment has 4 block devices:"
38688 #: ../src/guestfs.pod:2735
38689 msgid "C</dev/sda> 500MB"
38693 #: ../src/guestfs.pod:2737
38694 msgid "General block device for testing."
38698 #: ../src/guestfs.pod:2739
38699 msgid "C</dev/sdb> 50MB"
38703 #: ../src/guestfs.pod:2741
38705 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
38710 #: ../src/guestfs.pod:2744
38711 msgid "C</dev/sdc> 10MB"
38715 #: ../src/guestfs.pod:2746
38716 msgid "Used in a few tests where two block devices are needed."
38720 #: ../src/guestfs.pod:2748
38721 msgid "C</dev/sdd>"
38725 #: ../src/guestfs.pod:2750
38726 msgid "ISO with fixed content (see C<images/test.iso>)."
38730 #: ../src/guestfs.pod:2754
38732 "To be able to run the tests in a reasonable amount of time, the libguestfs "
38733 "appliance and block devices are reused between tests. So don't try testing "
38734 "L</guestfs_kill_subprocess> :-x"
38738 #: ../src/guestfs.pod:2758
38740 "Each test starts with an initial scenario, selected using one of the "
38741 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
38742 "initialize the disks mentioned above in a particular way as documented in "
38743 "C<generator_types.ml>. You should not assume anything about the previous "
38744 "contents of other disks that are not initialized."
38748 #: ../src/guestfs.pod:2764
38750 "You can add a prerequisite clause to any individual test. This is a run-"
38751 "time check, which, if it fails, causes the test to be skipped. Useful if "
38752 "testing a command which might not work on all variations of libguestfs "
38753 "builds. A test that has prerequisite of C<Always> means to run "
38758 #: ../src/guestfs.pod:2770
38760 "In addition, packagers can skip individual tests by setting environment "
38761 "variables before running C<make check>."
38765 #: ../src/guestfs.pod:2773
38768 " SKIP_TEST_<CMD>_<NUM>=1\n"
38773 #: ../src/guestfs.pod:2775
38774 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
38778 #: ../src/guestfs.pod:2777
38783 #: ../src/guestfs.pod:2779
38786 " SKIP_TEST_<CMD>=1\n"
38791 #: ../src/guestfs.pod:2781
38792 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
38796 #: ../src/guestfs.pod:2783
38797 msgid "Packagers can run only certain tests by setting for example:"
38801 #: ../src/guestfs.pod:2785
38804 " TEST_ONLY=\"vfs_type zerofree\"\n"
38809 #: ../src/guestfs.pod:2787
38811 "See C<capitests/tests.c> for more details of how these environment variables "
38816 #: ../src/guestfs.pod:2790
38817 msgid "DEBUGGING NEW API ACTIONS"
38821 #: ../src/guestfs.pod:2792
38822 msgid "Test new actions work before submitting them."
38826 #: ../src/guestfs.pod:2794
38827 msgid "You can use guestfish to try out new commands."
38831 #: ../src/guestfs.pod:2796
38833 "Debugging the daemon is a problem because it runs inside a minimal "
38834 "environment. However you can fprintf messages in the daemon to stderr, and "
38835 "they will show up if you use C<guestfish -v>."
38839 #: ../src/guestfs.pod:2800
38840 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
38844 #: ../src/guestfs.pod:2802
38846 "Our C source code generally adheres to some basic code-formatting "
38847 "conventions. The existing code base is not totally consistent on this "
38848 "front, but we do prefer that contributed code be formatted similarly. In "
38849 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
38850 "indentation level, and other than that, follow the K&R style."
38854 #: ../src/guestfs.pod:2808
38856 "If you use Emacs, add the following to one of one of your start-up files (e."
38857 "g., ~/.emacs), to help ensure that you get indentation right:"
38861 #: ../src/guestfs.pod:2811
38864 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
38865 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
38866 " (add-hook 'find-file-hook\n"
38867 " '(lambda () (if (and buffer-file-name\n"
38868 " (string-match \"/libguestfs\\\\>\"\n"
38869 " (buffer-file-name))\n"
38870 " (not (string-equal mode-name \"Change Log\"))\n"
38871 " (not (string-equal mode-name \"Makefile\")))\n"
38872 " (setq indent-tabs-mode nil))))\n"
38877 #: ../src/guestfs.pod:2821
38880 " ;;; When editing C sources in libguestfs, use this style.\n"
38881 " (defun libguestfs-c-mode ()\n"
38882 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
38884 " (c-set-style \"K&R\")\n"
38885 " (setq c-indent-level 2)\n"
38886 " (setq c-basic-offset 2))\n"
38887 " (add-hook 'c-mode-hook\n"
38888 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
38889 " (buffer-file-name))\n"
38890 " (libguestfs-c-mode))))\n"
38895 #: ../src/guestfs.pod:2833
38896 msgid "Enable warnings when compiling (and fix any problems this finds):"
38900 #: ../src/guestfs.pod:2836
38903 " ./configure --enable-gcc-warnings\n"
38908 #: ../src/guestfs.pod:2838
38909 msgid "Useful targets are:"
38913 #: ../src/guestfs.pod:2840
38916 " make syntax-check # checks the syntax of the C code\n"
38917 " make check # runs the test suite\n"
38922 #: ../src/guestfs.pod:2843
38923 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
38927 #: ../src/guestfs.pod:2845
38929 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
38930 "which are used to do shell quoting."
38934 #: ../src/guestfs.pod:2850
38939 #: ../src/guestfs.pod:2852
38941 "Simple shell quoted string. Any spaces or other shell characters are "
38946 #: ../src/guestfs.pod:2855
38951 #: ../src/guestfs.pod:2857
38953 "Same as C<%Q> except the string is treated as a path which is prefixed by "
38958 #: ../src/guestfs.pod:2864
38961 " asprintf (&cmd, \"cat %R\", path);\n"
38966 #: ../src/guestfs.pod:2866
38967 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
38971 #: ../src/guestfs.pod:2868
38973 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
38974 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
38975 "they are not passed via the shell (instead, straight to exec). You probably "
38976 "want to use the C<sysroot_path()> function however."
38980 #: ../src/guestfs.pod:2874
38981 msgid "SUBMITTING YOUR NEW API ACTIONS"
38985 #: ../src/guestfs.pod:2876
38987 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
38988 "libguestfs> and CC to L<rjones@redhat.com>."
38992 #: ../src/guestfs.pod:2880
38993 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
38997 #: ../src/guestfs.pod:2882
38998 msgid "We support i18n (gettext anyhow) in the library."
39002 #: ../src/guestfs.pod:2884
39004 "However many messages come from the daemon, and we don't translate those at "
39005 "the moment. One reason is that the appliance generally has all locale files "
39006 "removed from it, because they take up a lot of space. So we'd have to readd "
39007 "some of those, as well as copying our PO files into the appliance."
39011 #: ../src/guestfs.pod:2890
39013 "Debugging messages are never translated, since they are intended for the "
39018 #: ../src/guestfs.pod:2893
39019 msgid "SOURCE CODE SUBDIRECTORIES"
39023 #: ../src/guestfs.pod:2897
39028 #: ../src/guestfs.pod:2899
39029 msgid "L<virt-alignment-scan(1)> command and documentation."
39033 #: ../src/guestfs.pod:2903
39034 msgid "The libguestfs appliance, build scripts and so on."
39038 #: ../src/guestfs.pod:2905
39039 msgid "C<capitests>"
39043 #: ../src/guestfs.pod:2907
39044 msgid "Automated tests of the C API."
39048 #: ../src/guestfs.pod:2909
39053 #: ../src/guestfs.pod:2911
39055 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
39060 #: ../src/guestfs.pod:2914
39065 #: ../src/guestfs.pod:2916
39067 "Safety and liveness tests of components that libguestfs depends upon (not of "
39068 "libguestfs itself). Mainly this is for qemu and the kernel."
39072 #: ../src/guestfs.pod:2919
39077 #: ../src/guestfs.pod:2921
39079 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
39080 "command and documentation."
39084 #: ../src/guestfs.pod:2924
39089 #: ../src/guestfs.pod:2926
39090 msgid "Outside contributions, experimental parts."
39094 #: ../src/guestfs.pod:2928
39099 #: ../src/guestfs.pod:2930
39101 "The daemon that runs inside the libguestfs appliance and carries out actions."
39105 #: ../src/guestfs.pod:2933
39110 #: ../src/guestfs.pod:2935
39111 msgid "L<virt-df(1)> command and documentation."
39115 #: ../src/guestfs.pod:2937
39120 #: ../src/guestfs.pod:2939
39121 msgid "L<virt-edit(1)> command and documentation."
39125 #: ../src/guestfs.pod:2941
39126 msgid "C<examples>"
39130 #: ../src/guestfs.pod:2943
39131 msgid "C API example code."
39135 #: ../src/guestfs.pod:2945
39140 #: ../src/guestfs.pod:2947
39142 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
39143 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
39144 "L<virt-tar-out(1)>."
39148 #: ../src/guestfs.pod:2951
39153 #: ../src/guestfs.pod:2953
39155 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
39159 #: ../src/guestfs.pod:2955
39160 msgid "C<generator>"
39164 #: ../src/guestfs.pod:2957
39166 "The crucially important generator, used to automatically generate large "
39167 "amounts of boilerplate C code for things like RPC and bindings."
39171 #: ../src/guestfs.pod:2960
39176 #: ../src/guestfs.pod:2962
39177 msgid "Files used by the test suite."
39181 #: ../src/guestfs.pod:2964
39182 msgid "Some \"phony\" guest images which we test against."
39186 #: ../src/guestfs.pod:2966
39187 msgid "C<inspector>"
39191 #: ../src/guestfs.pod:2968
39192 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
39196 #: ../src/guestfs.pod:2970
39201 #: ../src/guestfs.pod:2972
39202 msgid "Logo used on the website. The fish is called Arthur by the way."
39206 #: ../src/guestfs.pod:2974
39211 #: ../src/guestfs.pod:2976
39212 msgid "M4 macros used by autoconf."
39216 #: ../src/guestfs.pod:2978
39221 #: ../src/guestfs.pod:2980
39222 msgid "Translations of simple gettext strings."
39226 #: ../src/guestfs.pod:2982
39231 #: ../src/guestfs.pod:2984
39233 "The build infrastructure and PO files for translations of manpages and POD "
39234 "files. Eventually this will be combined with the C<po> directory, but that "
39235 "is rather complicated."
39239 #: ../src/guestfs.pod:2988
39240 msgid "C<regressions>"
39244 #: ../src/guestfs.pod:2990
39245 msgid "Regression tests."
39249 #: ../src/guestfs.pod:2992
39254 #: ../src/guestfs.pod:2994
39255 msgid "L<virt-rescue(1)> command and documentation."
39259 #: ../src/guestfs.pod:2996
39264 #: ../src/guestfs.pod:2998
39265 msgid "L<virt-resize(1)> command and documentation."
39269 #: ../src/guestfs.pod:3000
39270 msgid "C<sparsify>"
39274 #: ../src/guestfs.pod:3002
39275 msgid "L<virt-sparsify(1)> command and documentation."
39279 #: ../src/guestfs.pod:3004
39284 #: ../src/guestfs.pod:3006
39285 msgid "Source code to the C library."
39289 #: ../src/guestfs.pod:3008
39294 #: ../src/guestfs.pod:3010
39296 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
39300 #: ../src/guestfs.pod:3012
39301 msgid "C<test-tool>"
39305 #: ../src/guestfs.pod:3014
39307 "Test tool for end users to test if their qemu/kernel combination will work "
39312 #: ../src/guestfs.pod:3017
39317 #: ../src/guestfs.pod:3019
39322 #: ../src/guestfs.pod:3021
39327 #: ../src/guestfs.pod:3023
39332 #: ../src/guestfs.pod:3025
39337 #: ../src/guestfs.pod:3027
39342 #: ../src/guestfs.pod:3029
39347 #: ../src/guestfs.pod:3031
39352 #: ../src/guestfs.pod:3033
39357 #: ../src/guestfs.pod:3035
39358 msgid "Language bindings."
39362 #: ../src/guestfs.pod:3039
39363 msgid "MAKING A STABLE RELEASE"
39367 #: ../src/guestfs.pod:3041
39369 "When we make a stable release, there are several steps documented here. See "
39370 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
39375 #: ../src/guestfs.pod:3049
39377 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
39381 #: ../src/guestfs.pod:3054
39382 msgid "Finalize RELEASE-NOTES."
39386 #: ../src/guestfs.pod:3058
39387 msgid "Update ROADMAP."
39391 #: ../src/guestfs.pod:3062
39392 msgid "Run C<src/api-support/update-from-tarballs.sh>."
39396 #: ../src/guestfs.pod:3066
39397 msgid "Push and pull from Transifex."
39401 #: ../src/guestfs.pod:3068
39406 #: ../src/guestfs.pod:3070
39414 #: ../src/guestfs.pod:3072
39415 msgid "to push the latest POT files to Transifex. Then run:"
39419 #: ../src/guestfs.pod:3074
39427 #: ../src/guestfs.pod:3076
39428 msgid "which is a wrapper to pull the latest translated C<*.po> files."
39432 #: ../src/guestfs.pod:3080
39434 "Create new stable and development directories under L<http://libguestfs.org/"
39439 #: ../src/guestfs.pod:3085
39440 msgid "Create the branch in git:"
39444 #: ../src/guestfs.pod:3087
39447 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
39448 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
39449 " git branch stable-1.XX\n"
39450 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
39455 #: ../src/guestfs.pod:3094
39460 #: ../src/guestfs.pod:3096
39461 msgid "PROTOCOL LIMITS"
39465 #: ../src/guestfs.pod:3098
39467 "Internally libguestfs uses a message-based protocol to pass API calls and "
39468 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
39469 "plenty more detail about this). The maximum message size used by the "
39470 "protocol is slightly less than 4 MB. For some API calls you may need to be "
39471 "aware of this limit. The API calls which may be affected are individually "
39472 "documented, with a link back to this section of the documentation."
39476 #: ../src/guestfs.pod:3106
39478 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
39479 "a simple string. Because this string is at some point internally encoded as "
39480 "a message, the maximum size that it can return is slightly under 4 MB. If "
39481 "the requested file is larger than this then you will get an error."
39485 #: ../src/guestfs.pod:3112
39487 "In order to transfer large files into and out of the guest filesystem, you "
39488 "need to use particular calls that support this. The sections L</UPLOADING> "
39489 "and L</DOWNLOADING> document how to do this."
39493 #: ../src/guestfs.pod:3116
39495 "You might also consider mounting the disk image using our FUSE filesystem "
39496 "support (L<guestmount(1)>)."
39500 #: ../src/guestfs.pod:3119
39501 msgid "MAXIMUM NUMBER OF DISKS"
39505 #: ../src/guestfs.pod:3121
39506 msgid "When using virtio disks (the default) the current limit is B<25> disks."
39510 #: ../src/guestfs.pod:3124
39512 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
39513 "slots. However febootstrap only understands disks with names C</dev/vda> "
39514 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
39519 #: ../src/guestfs.pod:3129
39521 "We are working to substantially raise this limit in future versions but it "
39522 "requires complex changes to qemu."
39526 #: ../src/guestfs.pod:3132
39528 "In future versions of libguestfs it should also be possible to \"hot plug\" "
39529 "disks (add and remove disks after calling L</guestfs_launch>). This also "
39530 "requires changes to qemu."
39534 #: ../src/guestfs.pod:3136
39535 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
39539 #: ../src/guestfs.pod:3138
39540 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
39544 #: ../src/guestfs.pod:3140
39546 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
39547 "vda>, and C</dev/vda1> through C</dev/vda15>)."
39551 #: ../src/guestfs.pod:3143
39553 "If you attach a disk with more than 15 partitions, the extra partitions are "
39554 "ignored by libguestfs."
39558 #: ../src/guestfs.pod:3146
39559 msgid "MAXIMUM SIZE OF A DISK"
39563 #: ../src/guestfs.pod:3148
39564 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
39568 #: ../src/guestfs.pod:3150
39570 "We have tested block devices up to 1 exabyte (2**60 or "
39571 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
39576 #: ../src/guestfs.pod:3154
39578 "Although libguestfs probably does not impose any limit, the underlying host "
39579 "storage will. If you store disk images on a host ext4 filesystem, then the "
39580 "maximum size will be limited by the maximum ext4 file size (currently 16 "
39581 "TB). If you store disk images as host logical volumes then you are limited "
39582 "by the maximum size of an LV."
39586 #: ../src/guestfs.pod:3160
39588 "For the hugest disk image files, we recommend using XFS on the host for "
39593 #: ../src/guestfs.pod:3163
39594 msgid "MAXIMUM SIZE OF A PARTITION"
39598 #: ../src/guestfs.pod:3165
39600 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
39601 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
39602 "address a partition located beyond 2 TB on the disk."
39606 #: ../src/guestfs.pod:3169
39608 "It is recommended that you use GPT partitions on disks which are larger than "
39609 "this size. GPT uses 64 bit sector numbers and so can address partitions "
39610 "which are theoretically larger than the largest disk we could support."
39614 #: ../src/guestfs.pod:3174
39615 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
39619 #: ../src/guestfs.pod:3176
39621 "This depends on the filesystem type. libguestfs itself does not impose any "
39622 "known limit. Consult Wikipedia or the filesystem documentation to find out "
39623 "what these limits are."
39627 #: ../src/guestfs.pod:3180
39628 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
39632 #: ../src/guestfs.pod:3182
39634 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
39635 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
39636 "uploads and downloads."
39640 #: ../src/guestfs.pod:3186
39641 msgid "INSPECTION LIMITS"
39645 #: ../src/guestfs.pod:3188
39647 "The inspection code has several arbitrary limits on things like the size of "
39648 "Windows Registry hive it will read, and the length of product name. These "
39649 "are intended to stop a malicious guest from consuming arbitrary amounts of "
39650 "memory and disk space on the host, and should not be reached in practice. "
39651 "See the source code for more information."
39655 #: ../src/guestfs.pod:3214
39657 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
39658 "effect as calling C<guestfs_set_verbose (g, 1)>."
39662 #: ../src/guestfs.pod:3226
39664 "Set the path that libguestfs uses to search for a supermin appliance. See "
39665 "the discussion of paths in section L</PATH> above."
39669 #: ../src/guestfs.pod:3235
39670 msgid "See also L</QEMU WRAPPERS> above."
39674 #: ../src/guestfs.pod:3239
39676 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
39677 "effect as calling C<guestfs_set_trace (g, 1)>."
39681 #: ../src/guestfs.pod:3257
39683 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-"
39684 "ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
39685 "L<guestfish(1)>, L<guestmount(1)>, L<virt-alignment-scan(1)>, L<virt-cat(1)"
39686 ">, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
39687 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
39688 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue"
39689 "(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar"
39690 "(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
39691 "L<febootstrap(1)>, L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)"
39692 ">, L<http://libguestfs.org/>."
39696 #: ../src/guestfs.pod:3293
39698 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
39699 "(8)>, L<disktype(1)>."
39703 #: ../src/guestfs.pod:3300 ../tools/virt-make-fs.pl:571
39704 #: ../tools/virt-win-reg.pl:772
39709 #: ../src/guestfs.pod:3302
39710 msgid "To get a list of bugs against libguestfs use this link:"
39714 #: ../src/guestfs.pod:3304
39716 "L<https://bugzilla.redhat.com/buglist.cgi?"
39717 "component=libguestfs&product=Virtualization+Tools>"
39721 #: ../src/guestfs.pod:3306
39722 msgid "To report a new bug against libguestfs use this link:"
39726 #: ../src/guestfs.pod:3308
39728 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
39729 "component=libguestfs&product=Virtualization+Tools>"
39733 #: ../src/guestfs.pod:3310
39734 msgid "When reporting a bug, please check:"
39738 #: ../src/guestfs.pod:3316
39739 msgid "That the bug hasn't been reported already."
39743 #: ../src/guestfs.pod:3320
39744 msgid "That you are testing a recent version."
39748 #: ../src/guestfs.pod:3324
39749 msgid "Describe the bug accurately, and give a way to reproduce it."
39753 #: ../src/guestfs.pod:3328
39755 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
39760 #: ../test-tool/libguestfs-test-tool.pod:5
39761 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
39765 #: ../test-tool/libguestfs-test-tool.pod:9
39768 " libguestfs-test-tool [--options]\n"
39773 #: ../test-tool/libguestfs-test-tool.pod:13
39775 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
39776 "to check basic libguestfs functionality is working. This is needed because "
39777 "libguestfs occasionally breaks for reasons beyond our control: usually "
39778 "because of changes in the underlying qemu or kernel packages, or the host "
39783 #: ../test-tool/libguestfs-test-tool.pod:19
39784 msgid "If you suspect a problem in libguestfs, then just run:"
39788 #: ../test-tool/libguestfs-test-tool.pod:21
39791 " libguestfs-test-tool\n"
39796 #: ../test-tool/libguestfs-test-tool.pod:23
39797 msgid "It will print lots of diagnostic messages."
39801 #: ../test-tool/libguestfs-test-tool.pod:25
39802 msgid "If it runs to completion successfully, you will see this near the end:"
39806 #: ../test-tool/libguestfs-test-tool.pod:27
39809 " ===== TEST FINISHED OK =====\n"
39814 #: ../test-tool/libguestfs-test-tool.pod:29
39815 msgid "and the test tool will exit with code 0."
39819 #: ../test-tool/libguestfs-test-tool.pod:31
39821 "If it fails (and/or exits with non-zero error code), please paste the "
39822 "I<complete, unedited> output of the test tool into a bug report. More "
39823 "information about reporting bugs can be found on the L<http://libguestfs.org/"
39828 #: ../test-tool/libguestfs-test-tool.pod:42
39829 msgid "Display short usage information and exit."
39833 #: ../test-tool/libguestfs-test-tool.pod:44
39834 msgid "B<--qemu qemu_binary>"
39838 #: ../test-tool/libguestfs-test-tool.pod:46
39840 "If you have downloaded another qemu binary, point this option at the full "
39841 "path of the binary to try it."
39845 #: ../test-tool/libguestfs-test-tool.pod:49
39846 msgid "B<--qemudir qemu_source_dir>"
39850 #: ../test-tool/libguestfs-test-tool.pod:51
39852 "If you have compiled qemu from source, point this option at the source "
39853 "directory to try it."
39857 #: ../test-tool/libguestfs-test-tool.pod:54
39862 #: ../test-tool/libguestfs-test-tool.pod:56
39863 msgid "B<--timeout N>"
39867 #: ../test-tool/libguestfs-test-tool.pod:58
39869 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
39870 "minutes) which does not usually need to be adjusted."
39874 #: ../test-tool/libguestfs-test-tool.pod:63
39875 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
39879 #: ../test-tool/libguestfs-test-tool.pod:65
39881 "If you have compiled another version of qemu from source and would like to "
39882 "try that, then you can use the I<--qemudir> option to point to the qemu "
39883 "source directory."
39887 #: ../test-tool/libguestfs-test-tool.pod:69
39889 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
39890 "option to point to the binary."
39894 #: ../test-tool/libguestfs-test-tool.pod:72
39896 "Note when using these options, you can ignore the business of qemu wrapper "
39897 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
39898 "wrapper script for you if one is needed."
39902 #: ../test-tool/libguestfs-test-tool.pod:76
39903 msgid "TRYING OUT A DIFFERENT KERNEL"
39907 #: ../test-tool/libguestfs-test-tool.pod:78
39909 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
39910 "libguestfs tries. You do this by setting the environment variables "
39911 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
39915 #: ../test-tool/libguestfs-test-tool.pod:82
39917 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
39922 #: ../test-tool/libguestfs-test-tool.pod:85
39923 msgid "SELF-DIAGNOSIS"
39927 #: ../test-tool/libguestfs-test-tool.pod:87
39929 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
39930 "produced by libguestfs-test-tool and/or possible errors."
39934 #: ../test-tool/libguestfs-test-tool.pod:92
39936 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
39937 "I<1> if there was an error."
39941 #: ../test-tool/libguestfs-test-tool.pod:97
39943 "For the full list of environment variables which may affect libguestfs, "
39944 "please see the L<guestfs(3)> manual page."
39948 #: ../test-tool/libguestfs-test-tool.pod:102
39949 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
39953 #: ../tools/virt-list-filesystems.pl:32
39955 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
39959 #: ../tools/virt-list-filesystems.pl:36
39962 " virt-list-filesystems [--options] domname\n"
39967 #: ../tools/virt-list-filesystems.pl:38
39970 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
39975 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
39977 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
39982 #: ../tools/virt-list-filesystems.pl:45
39984 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
39985 "are contained in a virtual machine or disk image."
39989 #: ../tools/virt-list-filesystems.pl:49
39991 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
39992 "functionality. For more complex cases you should look at the L<guestfish(1)"
39997 #: ../tools/virt-list-filesystems.pl:112
39999 "With this option, C<virt-list-filesystems> displays the type of each "
40000 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
40004 #: ../tools/virt-list-filesystems.pl:119
40009 #: ../tools/virt-list-filesystems.pl:123
40011 "Normally we only show mountable filesystems. If this option is given then "
40012 "swap devices are shown too."
40016 #: ../tools/virt-list-filesystems.pl:197
40018 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
40019 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
40020 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40024 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
40025 msgid "Copyright (C) 2009 Red Hat Inc."
40029 #: ../tools/virt-list-partitions.pl:32
40031 "virt-list-partitions - List partitions in a virtual machine or disk image"
40035 #: ../tools/virt-list-partitions.pl:36
40038 " virt-list-partitions [--options] domname\n"
40043 #: ../tools/virt-list-partitions.pl:38
40046 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
40051 #: ../tools/virt-list-partitions.pl:45
40053 "C<virt-list-partitions> is a command line tool to list the partitions that "
40054 "are contained in a virtual machine or disk image. It is mainly useful as a "
40055 "first step to using L<virt-resize(1)>."
40059 #: ../tools/virt-list-partitions.pl:50
40061 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
40062 "functionality. For more complex cases you should look at the L<guestfish(1)"
40067 #: ../tools/virt-list-partitions.pl:113
40068 msgid "Show sizes in human-readable form (eg. \"1G\")."
40072 #: ../tools/virt-list-partitions.pl:123
40074 "With this option, C<virt-list-partitions> displays the type and size of each "
40075 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
40079 #: ../tools/virt-list-partitions.pl:130
40084 #: ../tools/virt-list-partitions.pl:132
40089 #: ../tools/virt-list-partitions.pl:134
40091 "Display the total size of each block device (as a separate row or rows)."
40095 #: ../tools/virt-list-partitions.pl:267
40097 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
40098 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
40099 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40103 #: ../tools/virt-list-partitions.pl:283
40104 msgid "Copyright (C) 2009-2010 Red Hat Inc."
40108 #: ../tools/virt-make-fs.pl:37
40109 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
40113 #: ../tools/virt-make-fs.pl:41
40116 " virt-make-fs [--options] input.tar output.img\n"
40121 #: ../tools/virt-make-fs.pl:43
40124 " virt-make-fs [--options] input.tar.gz output.img\n"
40129 #: ../tools/virt-make-fs.pl:45
40132 " virt-make-fs [--options] directory output.img\n"
40137 #: ../tools/virt-make-fs.pl:49
40139 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
40140 "archive or some files in a directory. It is similar to tools like L<mkisofs"
40141 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
40142 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
40143 "you want to attach these filesystems to existing virtual machines (eg. to "
40144 "import large amounts of read-only data to a VM)."
40148 #: ../tools/virt-make-fs.pl:57
40149 msgid "Basic usage is:"
40153 #: ../tools/virt-make-fs.pl:59
40156 " virt-make-fs input output.img\n"
40161 #: ../tools/virt-make-fs.pl:61
40163 "where C<input> is either a directory containing files that you want to add, "
40164 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
40165 "C<output.img> is a disk image. The input type is detected automatically. "
40166 "The output disk image defaults to a raw ext2 sparse image unless you specify "
40167 "extra flags (see L</OPTIONS> below)."
40171 #: ../tools/virt-make-fs.pl:67
40172 msgid "FILESYSTEM TYPE"
40176 #: ../tools/virt-make-fs.pl:69
40178 "The default filesystem type is C<ext2>. Just about any filesystem type that "
40179 "libguestfs supports can be used (but I<not> read-only formats like "
40180 "ISO9660). Here are some of the more common choices:"
40184 #: ../tools/virt-make-fs.pl:75
40189 #: ../tools/virt-make-fs.pl:77
40191 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
40192 "you are not going to use the filesystem in a way that requires the journal, "
40193 "then this is just wasted overhead."
40197 #: ../tools/virt-make-fs.pl:81
40198 msgid "I<ntfs> or I<vfat>"
40202 #: ../tools/virt-make-fs.pl:83
40203 msgid "Useful if exporting data to a Windows guest."
40207 #: ../tools/virt-make-fs.pl:85
40209 "I<Note for vfat>: The tar archive or local directory must only contain files "
40210 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
40211 "program running within libguestfs is unable to change the ownership of non-"
40212 "root files, since vfat itself does not support this."
40216 #: ../tools/virt-make-fs.pl:90
40221 #: ../tools/virt-make-fs.pl:92
40223 "Lower overhead than C<ext2>, but certain limitations on filename length and "
40224 "total filesystem size."
40228 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116
40229 #: ../tools/virt-make-fs.pl:149
40234 #: ../tools/virt-make-fs.pl:99
40237 " virt-make-fs --type=minix input minixfs.img\n"
40242 #: ../tools/virt-make-fs.pl:101
40243 msgid "TO PARTITION OR NOT TO PARTITION"
40247 #: ../tools/virt-make-fs.pl:103
40248 msgid "Optionally virt-make-fs can add a partition table to the output disk."
40252 #: ../tools/virt-make-fs.pl:105
40254 "Adding a partition can make the disk image more compatible with certain "
40255 "virtualized operating systems which don't expect to see a filesystem "
40256 "directly located on a block device (Linux doesn't care and will happily "
40257 "handle both types)."
40261 #: ../tools/virt-make-fs.pl:110
40263 "On the other hand, if you have a partition table then the output image is no "
40264 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
40265 "directly on a partitioned disk image. (However libguestfs tools such as "
40266 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
40270 #: ../tools/virt-make-fs.pl:118
40271 msgid "Add an MBR partition:"
40275 #: ../tools/virt-make-fs.pl:120
40278 " virt-make-fs --partition -- input disk.img\n"
40283 #: ../tools/virt-make-fs.pl:122
40285 "If the output disk image could be terabyte-sized or larger, it's better to "
40286 "use an EFI/GPT-compatible partition table:"
40290 #: ../tools/virt-make-fs.pl:125
40293 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
40298 #: ../tools/virt-make-fs.pl:127
40299 msgid "EXTRA SPACE"
40303 #: ../tools/virt-make-fs.pl:129
40305 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
40306 "the files that it contains, but might have extra space. Depending on how "
40307 "you are going to use the output, you might think this extra space is wasted "
40308 "and want to minimize it, or you might want to leave space so that more files "
40309 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
40310 "but you can use the I<--size> flag to leave space in the filesystem if you "
40315 #: ../tools/virt-make-fs.pl:137
40317 "An alternative way to leave extra space but not make the output image any "
40318 "bigger is to use an alternative disk image format (instead of the default "
40319 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
40320 "image format (check your hypervisor supports this before using it). This "
40321 "allows you to choose a large I<--size> but the extra space won't actually be "
40322 "allocated in the image until you try to store something in it."
40326 #: ../tools/virt-make-fs.pl:145
40328 "Don't forget that you can also use local commands including L<resize2fs(8)> "
40329 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
40330 "to build another image from scratch."
40334 #: ../tools/virt-make-fs.pl:151
40337 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
40342 #: ../tools/virt-make-fs.pl:179
40343 msgid "Enable debugging information."
40347 #: ../tools/virt-make-fs.pl:185
40348 msgid "B<--size=E<lt>NE<gt>>"
40352 #: ../tools/virt-make-fs.pl:187
40353 msgid "B<--size=+E<lt>NE<gt>>"
40357 #: ../tools/virt-make-fs.pl:189
40358 msgid "B<-s E<lt>NE<gt>>"
40362 #: ../tools/virt-make-fs.pl:191
40363 msgid "B<-s +E<lt>NE<gt>>"
40367 #: ../tools/virt-make-fs.pl:193
40369 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
40373 #: ../tools/virt-make-fs.pl:196
40375 "If this option is I<not> given, then the output image will be just large "
40376 "enough to contain all the files, with not much wasted space."
40380 #: ../tools/virt-make-fs.pl:199
40382 "To choose a fixed size output disk, specify an absolute number followed by b/"
40383 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40384 "Petabytes or Exabytes. This must be large enough to contain all the input "
40385 "files, else you will get an error."
40389 #: ../tools/virt-make-fs.pl:204
40391 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
40392 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40393 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
40394 "the input files, and (approximately) an extra 200 MB free space."
40398 #: ../tools/virt-make-fs.pl:210
40400 "Note that virt-make-fs estimates free space, and therefore will not produce "
40401 "filesystems containing precisely the free space requested. (It is much more "
40402 "expensive and time-consuming to produce a filesystem which has precisely the "
40403 "desired free space)."
40407 #: ../tools/virt-make-fs.pl:219
40408 msgid "B<--format=E<lt>fmtE<gt>>"
40412 #: ../tools/virt-make-fs.pl:221
40413 msgid "B<-F E<lt>fmtE<gt>>"
40417 #: ../tools/virt-make-fs.pl:223
40418 msgid "Choose the output disk image format."
40422 #: ../tools/virt-make-fs.pl:225
40423 msgid "The default is C<raw> (raw sparse disk image)."
40427 #: ../tools/virt-make-fs.pl:227
40429 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
40430 "that would really make sense here is C<qcow2>."
40434 #: ../tools/virt-make-fs.pl:234
40435 msgid "B<--type=E<lt>fsE<gt>>"
40439 #: ../tools/virt-make-fs.pl:236
40440 msgid "B<-t E<lt>fsE<gt>>"
40444 #: ../tools/virt-make-fs.pl:238
40445 msgid "Choose the output filesystem type."
40449 #: ../tools/virt-make-fs.pl:240
40450 msgid "The default is C<ext2>."
40454 #: ../tools/virt-make-fs.pl:242
40456 "Any filesystem which is supported read-write by libguestfs can be used here."
40460 #: ../tools/virt-make-fs.pl:249
40461 msgid "B<--partition>"
40465 #: ../tools/virt-make-fs.pl:251
40466 msgid "B<--partition=E<lt>parttypeE<gt>>"
40470 #: ../tools/virt-make-fs.pl:253
40472 "If specified, this flag adds an MBR partition table to the output disk image."
40476 #: ../tools/virt-make-fs.pl:256
40478 "You can change the partition table type, eg. I<--partition=gpt> for large "
40483 #: ../tools/virt-make-fs.pl:259
40485 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
40486 "might consider the next parameter to be the partition type. For example:"
40490 #: ../tools/virt-make-fs.pl:263
40493 " virt-make-fs --partition input.tar output.img\n"
40498 #: ../tools/virt-make-fs.pl:265
40500 "would cause virt-make-fs to think you wanted to use a partition type of "
40501 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
40502 "dash) between options and the input and output arguments:"
40506 #: ../tools/virt-make-fs.pl:269
40509 " virt-make-fs --partition -- input.tar output.img\n"
40514 #: ../tools/virt-make-fs.pl:271
40515 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
40519 #: ../tools/virt-make-fs.pl:559
40521 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
40522 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
40523 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
40527 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
40529 "When reporting bugs, please enable debugging and capture the I<complete> "
40534 #: ../tools/virt-make-fs.pl:576
40537 " export LIBGUESTFS_DEBUG=1\n"
40538 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
40543 #: ../tools/virt-make-fs.pl:579
40545 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
40550 #: ../tools/virt-tar.pl:33
40551 msgid "virt-tar - Extract or upload files to a virtual machine"
40555 #: ../tools/virt-tar.pl:37
40558 " virt-tar [--options] -x domname directory tarball\n"
40563 #: ../tools/virt-tar.pl:39
40566 " virt-tar [--options] -u domname tarball directory\n"
40571 #: ../tools/virt-tar.pl:41
40574 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
40579 #: ../tools/virt-tar.pl:43
40582 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
40587 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
40592 #: ../tools/virt-tar.pl:47
40594 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
40595 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
40599 #: ../tools/virt-tar.pl:52
40600 msgid "Download C</home> from the VM into a local tarball:"
40604 #: ../tools/virt-tar.pl:54
40607 " virt-tar -x domname /home home.tar\n"
40612 #: ../tools/virt-tar.pl:56
40615 " virt-tar -zx domname /home home.tar.gz\n"
40620 #: ../tools/virt-tar.pl:58
40621 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
40625 #: ../tools/virt-tar.pl:60
40628 " virt-tar -u domname uploadstuff.tar /tmp\n"
40633 #: ../tools/virt-tar.pl:62
40636 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
40641 #: ../tools/virt-tar.pl:66
40643 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
40644 "virtual machines. If you do this, you risk disk corruption in the VM. "
40645 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
40649 #: ../tools/virt-tar.pl:71
40651 "You can use I<-x> (extract) on live virtual machines, but you might get "
40652 "inconsistent results or errors if there is filesystem activity inside the "
40653 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
40654 "work, but the only way to guarantee consistent results is if the virtual "
40655 "machine is shut down."
40659 #: ../tools/virt-tar.pl:79
40661 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
40662 "parts of a guest filesystem. There are many possibilities: making backups, "
40663 "uploading data files, snooping on guest activity, fixing or customizing "
40668 #: ../tools/virt-tar.pl:84
40670 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
40671 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
40672 "should look at the L<guestfish(1)> tool."
40676 #: ../tools/virt-tar.pl:88
40678 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
40679 "its contents (recursively) from the virtual machine into a local tarball. "
40680 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
40681 "virtual machine. You cannot use these two options together."
40685 #: ../tools/virt-tar.pl:94
40687 "In addition, you may need to use the I<-z> (gZip) option to enable "
40688 "compression. When uploading, you have to specify I<-z> if the upload file "
40689 "is compressed because virt-tar won't detect this on its own."
40693 #: ../tools/virt-tar.pl:98
40695 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
40696 "example it cannot do PKZip files or bzip2 compression. If you want that "
40697 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
40698 "the L<libguestfs(3)> API)."
40702 #: ../tools/virt-tar.pl:160
40703 msgid "B<--extract>"
40707 #: ../tools/virt-tar.pl:162
40708 msgid "B<--download>"
40712 #: ../tools/virt-tar.pl:164
40717 #: ../tools/virt-tar.pl:166
40718 msgid "B<--upload>"
40722 #: ../tools/virt-tar.pl:168
40724 "Use I<-x> to extract (download) a directory from a virtual machine to a "
40729 #: ../tools/virt-tar.pl:171
40731 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
40732 "Please read the L</WARNING> section above before using this option."
40736 #: ../tools/virt-tar.pl:175
40737 msgid "You must specify exactly one of these options."
40741 #: ../tools/virt-tar.pl:181
40746 #: ../tools/virt-tar.pl:183
40751 #: ../tools/virt-tar.pl:185
40752 msgid "Specify that the input or output tarball is gzip-compressed."
40756 #: ../tools/virt-tar.pl:298
40758 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
40759 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
40760 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
40765 #: ../tools/virt-win-reg.pl:37
40767 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
40771 #: ../tools/virt-win-reg.pl:41
40774 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
40779 #: ../tools/virt-win-reg.pl:43
40782 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
40787 #: ../tools/virt-win-reg.pl:45
40790 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
40795 #: ../tools/virt-win-reg.pl:47
40798 " virt-win-reg --merge domname [input.reg ...]\n"
40803 #: ../tools/virt-win-reg.pl:49
40806 " virt-win-reg [--options] disk.img ... # instead of domname\n"
40811 #: ../tools/virt-win-reg.pl:53
40813 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
40814 "virtual machines. If you do this, you I<will> get irreversible disk "
40815 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
40816 "but doesn't catch all cases."
40820 #: ../tools/virt-win-reg.pl:58
40822 "Modifying the Windows Registry is an inherently risky operation. The format "
40823 "is deliberately obscure and undocumented, and Registry changes can leave the "
40824 "system unbootable. Therefore when using the I<--merge> option, make sure "
40825 "you have a reliable backup first."
40829 #: ../tools/virt-win-reg.pl:65
40831 "This program can export and merge Windows Registry entries from a Windows "
40836 #: ../tools/virt-win-reg.pl:68
40838 "The first parameter is the libvirt guest name or the raw disk image of a "
40843 #: ../tools/virt-win-reg.pl:71
40845 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
40846 "exported (recursively). For example:"
40850 #: ../tools/virt-win-reg.pl:74
40853 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
40858 #: ../tools/virt-win-reg.pl:76
40860 "You can also display single values from within registry keys, for example:"
40864 #: ../tools/virt-win-reg.pl:79
40867 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
40868 " $ virt-win-reg Windows7 $cvkey ProductName\n"
40869 " Windows 7 Enterprise\n"
40874 #: ../tools/virt-win-reg.pl:83
40876 "With I<--merge>, you can merge a textual regedit file into the Windows "
40881 #: ../tools/virt-win-reg.pl:86
40884 " $ virt-win-reg --merge Windows7 changes.reg\n"
40889 #: ../tools/virt-win-reg.pl:90
40891 "This program is only meant for simple access to the registry. If you want "
40892 "to do complicated things with the registry, we suggest you download the "
40893 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
40894 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
40895 "L<hivexregedit(1)>."
40899 #: ../tools/virt-win-reg.pl:159
40904 #: ../tools/virt-win-reg.pl:161
40906 "In merge mode, this merges a textual regedit file into the Windows Registry "
40907 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
40908 "displays or exports Registry entries instead."
40912 #: ../tools/virt-win-reg.pl:165
40914 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
40915 "result in disk corruption. However exporting (without this flag) is always "
40920 #: ../tools/virt-win-reg.pl:173
40921 msgid "B<--encoding> UTF-16LE|ASCII"
40925 #: ../tools/virt-win-reg.pl:175
40927 "When merging (only), you may need to specify the encoding for strings to be "
40928 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
40929 "(3)/ENCODING STRINGS>."
40933 #: ../tools/virt-win-reg.pl:179
40935 "The default is to use UTF-16LE, which should work with recent versions of "
40940 #: ../tools/virt-win-reg.pl:186
40941 msgid "B<--unsafe-printable-strings>"
40945 #: ../tools/virt-win-reg.pl:188
40947 "When exporting (only), assume strings are UTF-16LE and print them as strings "
40948 "instead of hex sequences. Remove the final zero codepoint from strings if "
40953 #: ../tools/virt-win-reg.pl:192
40955 "This is unsafe and does not preserve the fidelity of strings in the original "
40956 "Registry for various reasons:"
40960 #: ../tools/virt-win-reg.pl:199
40962 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
40963 "other encodings will be corrupted by this transformation."
40967 #: ../tools/virt-win-reg.pl:204
40969 "Assumes that everything which has type 1 or 2 is really a string and that "
40970 "everything else is not a string, but the type field in real Registries is "
40975 #: ../tools/virt-win-reg.pl:210
40977 "Loses information about whether a zero codepoint followed the string in the "
40982 #: ../tools/virt-win-reg.pl:215
40984 "This all happens because the Registry itself contains no information about "
40985 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
40989 #: ../tools/virt-win-reg.pl:219
40991 "You should only use this option for quick hacking and debugging of the "
40992 "Registry contents, and I<never> use it if the output is going to be passed "
40993 "into another program or stored in another Registry."
40997 #: ../tools/virt-win-reg.pl:556
40998 msgid "SUPPORTED SYSTEMS"
41002 #: ../tools/virt-win-reg.pl:558
41004 "The program currently supports Windows NT-derived guests starting with "
41005 "Windows XP through to at least Windows 7."
41009 #: ../tools/virt-win-reg.pl:561
41010 msgid "The following Registry keys are supported:"
41014 #: ../tools/virt-win-reg.pl:565
41015 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
41019 #: ../tools/virt-win-reg.pl:567
41020 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
41024 #: ../tools/virt-win-reg.pl:569
41025 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
41029 #: ../tools/virt-win-reg.pl:571
41030 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
41034 #: ../tools/virt-win-reg.pl:573
41035 msgid "C<HKEY_USERS\\.DEFAULT>"
41039 #: ../tools/virt-win-reg.pl:575
41040 msgid "C<HKEY_USERS\\I<SID>>"
41044 #: ../tools/virt-win-reg.pl:577
41045 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
41049 #: ../tools/virt-win-reg.pl:579
41050 msgid "C<HKEY_USERS\\I<username>>"
41054 #: ../tools/virt-win-reg.pl:581
41056 "where I<username> is a local user name (this is a libguestfs extension)."
41060 #: ../tools/virt-win-reg.pl:585
41062 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
41067 #: ../tools/virt-win-reg.pl:588
41069 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
41070 "supported (there is no \"current user\")."
41074 #: ../tools/virt-win-reg.pl:591
41079 #: ../tools/virt-win-reg.pl:593
41081 "C<virt-win-reg> expects that regedit files have already been reencoded in "
41082 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
41083 "style line endings. Since Windows regedit files are often in UTF-16LE with "
41084 "Windows-style line endings, you may need to reencode the whole file before "
41085 "or after processing."
41089 #: ../tools/virt-win-reg.pl:599
41091 "To reencode a file from Windows format to Linux (before processing it with "
41092 "the I<--merge> option), you would do something like this:"
41096 #: ../tools/virt-win-reg.pl:602
41099 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
41104 #: ../tools/virt-win-reg.pl:604
41106 "To go in the opposite direction, after exporting and before sending the file "
41107 "to a Windows user, do something like this:"
41111 #: ../tools/virt-win-reg.pl:607
41114 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
41119 #: ../tools/virt-win-reg.pl:609
41120 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
41124 #: ../tools/virt-win-reg.pl:611
41126 "If you are unsure about the current encoding, use the L<file(1)> command. "
41127 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
41128 "style (CRLF) line endings, like this:"
41132 #: ../tools/virt-win-reg.pl:615
41135 " $ file software.reg\n"
41136 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
41137 " with CRLF line terminators\n"
41142 #: ../tools/virt-win-reg.pl:619
41143 msgid "This file would need conversion before you could I<--merge> it."
41147 #: ../tools/virt-win-reg.pl:621
41148 msgid "CurrentControlSet etc."
41152 #: ../tools/virt-win-reg.pl:623
41154 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
41155 "Registry at the level of the hive file, and therefore you cannot modify "
41160 #: ../tools/virt-win-reg.pl:627
41162 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
41163 "circumstances it might refer to another control set. The way to find out is "
41164 "to look at the C<HKLM\\SYSTEM\\Select> key:"
41168 #: ../tools/virt-win-reg.pl:631
41171 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
41172 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
41173 " \"Current\"=dword:00000001\n"
41174 " \"Default\"=dword:00000001\n"
41175 " \"Failed\"=dword:00000000\n"
41176 " \"LastKnownGood\"=dword:00000002\n"
41181 #: ../tools/virt-win-reg.pl:638
41182 msgid "\"Current\" is the one which Windows will choose when it boots."
41186 #: ../tools/virt-win-reg.pl:640
41188 "Similarly, other C<Current...> keys in the path may need to be replaced."
41192 #: ../tools/virt-win-reg.pl:643
41193 msgid "DELETING REGISTRY KEYS AND VALUES"
41197 #: ../tools/virt-win-reg.pl:645
41198 msgid "To delete a whole registry key, use the syntax:"
41202 #: ../tools/virt-win-reg.pl:647
41205 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
41210 #: ../tools/virt-win-reg.pl:649
41211 msgid "To delete a single value within a key, use the syntax:"
41215 #: ../tools/virt-win-reg.pl:651
41218 " [HKEY_LOCAL_MACHINE\\Foo]\n"
41224 #: ../tools/virt-win-reg.pl:654
41225 msgid "WINDOWS TIPS"
41229 #: ../tools/virt-win-reg.pl:656
41231 "Note that some of these tips modify the guest disk image. The guest I<must> "
41232 "be shut off, else you will get disk corruption."
41236 #: ../tools/virt-win-reg.pl:659
41237 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
41241 #: ../tools/virt-win-reg.pl:661
41243 "Prepare a DOS batch script, VBScript or executable. Upload this using "
41244 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
41245 "is uploaded into C<C:\\>:"
41249 #: ../tools/virt-win-reg.pl:665
41252 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
41257 #: ../tools/virt-win-reg.pl:667
41258 msgid "Prepare a regedit file containing the registry change:"
41262 #: ../tools/virt-win-reg.pl:669
41265 " cat > test.reg <<'EOF'\n"
41266 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
41267 " \"Test\"=\"c:\\\\test.bat\"\n"
41273 #: ../tools/virt-win-reg.pl:674
41275 "In this example we use the key C<RunOnce> which means that the script will "
41276 "run precisely once when the first user logs in. If you want it to run every "
41277 "time a user logs in, replace C<RunOnce> with C<Run>."
41281 #: ../tools/virt-win-reg.pl:678
41282 msgid "Now update the registry:"
41286 #: ../tools/virt-win-reg.pl:680
41289 " virt-win-reg --merge WindowsGuest test.reg\n"
41294 #: ../tools/virt-win-reg.pl:682
41295 msgid "INSTALLING A SERVICE"
41299 #: ../tools/virt-win-reg.pl:684
41301 "This section assumes you are familiar with Windows services, and you either "
41302 "have a program which handles the Windows Service Control Protocol directly "
41303 "or you want to run any program using a service wrapper like SrvAny or the "
41308 #: ../tools/virt-win-reg.pl:689
41310 "First upload the program and optionally the service wrapper. In this case "
41311 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
41315 #: ../tools/virt-win-reg.pl:693
41318 " guestfish -i -d WindowsGuest <<EOF\n"
41319 " upload rhsrvany.exe /rhsrvany.exe\n"
41320 " upload test.exe /test.exe\n"
41326 #: ../tools/virt-win-reg.pl:698
41328 "Prepare a regedit file containing the registry changes. In this example, "
41329 "the first registry change is needed for the service itself or the service "
41330 "wrapper (if used). The second registry change is only needed because I am "
41331 "using the RHSrvAny service wrapper."
41335 #: ../tools/virt-win-reg.pl:703
41338 " cat > service.reg <<'EOF'\n"
41339 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
41340 " \"Type\"=dword:00000010\n"
41341 " \"Start\"=dword:00000002\n"
41342 " \"ErrorControl\"=dword:00000001\n"
41343 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
41344 " \"DisplayName\"=\"RHSrvAny\"\n"
41345 " \"ObjectName\"=\"NetworkService\"\n"
41350 #: ../tools/virt-win-reg.pl:712
41353 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
41354 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
41355 " \"PWD\"=\"c:\\\\Temp\"\n"
41361 #: ../tools/virt-win-reg.pl:723
41363 "For use of C<ControlSet001> see the section above in this manual page. You "
41364 "may need to adjust this according to the control set that is in use by the "
41369 #: ../tools/virt-win-reg.pl:729
41371 "C<\"ObjectName\"> controls the privileges that the service will have. An "
41372 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
41373 "privileged account."
41377 #: ../tools/virt-win-reg.pl:735
41379 "For the meaning of the magic numbers, see this Microsoft KB article: "
41380 "L<http://support.microsoft.com/kb/103000>."
41384 #: ../tools/virt-win-reg.pl:740
41385 msgid "Update the registry:"
41389 #: ../tools/virt-win-reg.pl:742
41392 " virt-win-reg --merge WindowsGuest service.reg\n"
41397 #: ../tools/virt-win-reg.pl:746
41399 "Be careful when passing parameters containing C<\\> (backslash) in the "
41400 "shell. Usually you will have to use 'single quotes' or double backslashes "
41401 "(but not both) to protect them from the shell."
41405 #: ../tools/virt-win-reg.pl:750
41406 msgid "Paths and value names are case-insensitive."
41410 #: ../tools/virt-win-reg.pl:759
41412 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
41413 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
41414 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41418 #: ../tools/virt-win-reg.pl:777
41421 " export LIBGUESTFS_DEBUG=1\n"
41422 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
41427 #: ../tools/virt-win-reg.pl:780
41429 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."