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-19 17:23+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:414
490 #: ../sparsify/virt-sparsify.pod:153
495 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:416
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:484
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:486
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:488
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 "Currently there is no virt tool for fixing alignment problems in guests. "
805 "This is a difficult problem to fix because simply moving partitions around "
806 "breaks the bootloader, necessitating either manual reinstallation of the "
807 "bootloader using a rescue disk, or complex and error-prone hacks."
811 #: ../align/virt-alignment-scan.pod:284
813 "L<virt-resize(1)> does not change the alignment of the first partition, but "
814 "it does align the second and subsequent partitions to a multiple of 64 or "
815 "128 sectors (depending on the version of virt-resize, 128 in virt-resize "
816 "E<ge> 1.13.19). For operating systems that have a separate boot partition, "
817 "virt-resize could be used to align the main OS partition, so that the "
818 "majority of OS accesses except at boot will be aligned."
822 #: ../align/virt-alignment-scan.pod:292
824 "The easiest way to correct partition alignment problems is to reinstall your "
825 "guest operating systems. If you install operating systems from templates, "
826 "ensure these have correct partition alignment too."
830 #: ../align/virt-alignment-scan.pod:297
832 "For older versions of Windows, the following NetApp document contains useful "
833 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
837 #: ../align/virt-alignment-scan.pod:300
839 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
840 "an explicit C<%pre> section that creates aligned partitions using L<parted(8)"
841 ">. Do not use the Kickstart C<part> command. The NetApp document above "
842 "contains an example."
846 #: ../align/virt-alignment-scan.pod:305 ../cat/virt-cat.pod:191
847 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483
848 #: ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:215
849 #: ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352
850 #: ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:601
851 #: ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258
852 #: ../tools/virt-make-fs.pl:532 ../tools/virt-tar.pl:289
853 #: ../tools/virt-win-reg.pl:733
854 msgid "SHELL QUOTING"
858 #: ../align/virt-alignment-scan.pod:307 ../cat/virt-cat.pod:193
859 #: ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485
860 #: ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:217
861 #: ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354
862 #: ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:603
863 #: ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260
864 #: ../tools/virt-make-fs.pl:534 ../tools/virt-tar.pl:291
865 #: ../tools/virt-win-reg.pl:741
867 "Libvirt guest names can contain arbitrary characters, some of which have "
868 "meaning to the shell such as C<#> and space. You may need to quote or "
869 "escape these characters on the command line. See the shell manual page L<sh"
874 #: ../align/virt-alignment-scan.pod:312 ../cat/virt-cat.pod:198
875 #: ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490
876 #: ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:222
877 #: ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114
878 #: ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:375
879 #: ../resize/virt-resize.pod:608 ../sparsify/virt-sparsify.pod:227
880 #: ../test-tool/libguestfs-test-tool.pod:90
885 #: ../align/virt-alignment-scan.pod:314
886 msgid "This program returns:"
890 #: ../align/virt-alignment-scan.pod:318 ../align/virt-alignment-scan.pod:324
891 #: ../align/virt-alignment-scan.pod:330 ../align/virt-alignment-scan.pod:337
892 #: ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287
893 #: ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295
894 #: ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314
895 #: ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322
896 #: ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362
897 #: ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388
898 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
899 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
900 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
901 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
902 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
903 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
904 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
905 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
906 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
907 #: ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:403
908 #: ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:417
909 #: ../fish/guestfish-actions.pod:1144 ../fish/guestfish-actions.pod:1148
910 #: ../fish/guestfish-actions.pod:1152 ../fish/guestfish-actions.pod:1156
911 #: ../fish/guestfish-actions.pod:1164 ../fish/guestfish-actions.pod:1168
912 #: ../fish/guestfish-actions.pod:1172 ../fish/guestfish-actions.pod:1182
913 #: ../fish/guestfish-actions.pod:1186 ../fish/guestfish-actions.pod:1190
914 #: ../fish/guestfish-actions.pod:1280 ../fish/guestfish-actions.pod:1284
915 #: ../fish/guestfish-actions.pod:1289 ../fish/guestfish-actions.pod:1294
916 #: ../fish/guestfish-actions.pod:1336 ../fish/guestfish-actions.pod:1340
917 #: ../fish/guestfish-actions.pod:1345 ../fish/guestfish-actions.pod:1601
918 #: ../fish/guestfish-actions.pod:1608 ../fish/guestfish-actions.pod:1615
919 #: ../fish/guestfish-actions.pod:2018 ../fish/guestfish-actions.pod:2024
920 #: ../fish/guestfish-actions.pod:2032 ../fish/guestfish-actions.pod:2039
921 #: ../fish/guestfish-actions.pod:2046 ../fish/guestfish.pod:445
922 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
923 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393
924 #: ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:282
925 #: ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295
926 #: ../resize/virt-resize.pod:301 ../sparsify/virt-sparsify.pod:32
927 #: ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43
928 #: ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54
929 #: ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64
930 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
931 #: ../src/guestfs-actions.pod:594 ../src/guestfs-actions.pod:602
932 #: ../src/guestfs-actions.pod:609 ../src/guestfs-actions.pod:616
933 #: ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1788
934 #: ../src/guestfs-actions.pod:1792 ../src/guestfs-actions.pod:1796
935 #: ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1808
936 #: ../src/guestfs-actions.pod:1812 ../src/guestfs-actions.pod:1822
937 #: ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:1830
938 #: ../src/guestfs-actions.pod:1968 ../src/guestfs-actions.pod:1972
939 #: ../src/guestfs-actions.pod:1977 ../src/guestfs-actions.pod:1982
940 #: ../src/guestfs-actions.pod:2043 ../src/guestfs-actions.pod:2047
941 #: ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2467
942 #: ../src/guestfs-actions.pod:2474 ../src/guestfs-actions.pod:2481
943 #: ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3032
944 #: ../src/guestfs-actions.pod:3040 ../src/guestfs-actions.pod:3047
945 #: ../src/guestfs-actions.pod:3054 ../src/guestfs.pod:388
946 #: ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402
947 #: ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416
948 #: ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098
949 #: ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115
950 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164
951 #: ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176
952 #: ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674
953 #: ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785
954 #: ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804
955 #: ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104
956 #: ../src/guestfs.pod:2112 ../src/guestfs.pod:2630 ../src/guestfs.pod:2636
957 #: ../src/guestfs.pod:2641 ../src/guestfs.pod:2647 ../src/guestfs.pod:3047
958 #: ../src/guestfs.pod:3052 ../src/guestfs.pod:3056 ../src/guestfs.pod:3060
959 #: ../src/guestfs.pod:3064 ../src/guestfs.pod:3078 ../src/guestfs.pod:3083
960 #: ../src/guestfs.pod:3314 ../src/guestfs.pod:3318 ../src/guestfs.pod:3322
961 #: ../src/guestfs.pod:3326 ../tools/virt-win-reg.pl:197
962 #: ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208
963 #: ../tools/virt-win-reg.pl:710 ../tools/virt-win-reg.pl:716
964 #: ../tools/virt-win-reg.pl:722
969 #: ../align/virt-alignment-scan.pod:320
974 #: ../align/virt-alignment-scan.pod:322
976 "successful exit, all partitions are aligned E<ge> 64K for best performance"
980 #: ../align/virt-alignment-scan.pod:326
985 #: ../align/virt-alignment-scan.pod:328
986 msgid "an error scanning the disk image or guest"
990 #: ../align/virt-alignment-scan.pod:332
995 #: ../align/virt-alignment-scan.pod:334
997 "successful exit, some partitions have alignment E<lt> 64K which can result "
998 "in poor performance on high end network storage"
1002 #: ../align/virt-alignment-scan.pod:339
1007 #: ../align/virt-alignment-scan.pod:341
1009 "successful exit, some partitions have alignment E<lt> 4K which can result in "
1010 "poor performance on most hypervisors"
1014 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:203
1015 #: ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495
1016 #: ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:227
1017 #: ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97
1018 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
1019 #: ../fish/guestfish.pod:1268 ../fish/virt-copy-in.pod:50
1020 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
1021 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:317
1022 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
1023 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
1024 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288
1025 #: ../resize/virt-resize.pod:613 ../ruby/examples/guestfs-ruby.pod:36
1026 #: ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3255
1027 #: ../test-tool/libguestfs-test-tool.pod:100
1028 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
1029 #: ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296
1030 #: ../tools/virt-win-reg.pl:746
1035 #: ../align/virt-alignment-scan.pod:348
1037 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
1038 "L<virt-resize(1)>, L<http://libguestfs.org/>."
1042 #: ../align/virt-alignment-scan.pod:355 ../cat/virt-cat.pod:212
1043 #: ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507
1044 #: ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:235
1045 #: ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296
1046 #: ../resize/virt-resize.pod:635 ../sparsify/virt-sparsify.pod:264
1047 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277
1048 #: ../tools/virt-make-fs.pl:564 ../tools/virt-tar.pl:311
1049 #: ../tools/virt-win-reg.pl:772
1054 #: ../align/virt-alignment-scan.pod:357 ../cat/virt-cat.pod:214
1055 #: ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509
1056 #: ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:237
1057 #: ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395
1058 #: ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:637
1059 #: ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210
1060 #: ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:566
1061 #: ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:774
1062 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
1066 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:216
1067 #: ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511
1068 #: ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:239
1069 #: ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114
1070 #: ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401
1071 #: ../fish/guestfish.pod:1300 ../fish/virt-copy-in.pod:64
1072 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
1073 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:332
1074 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62
1075 #: ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56
1076 #: ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300
1077 #: ../resize/virt-resize.pod:639 ../ruby/examples/guestfs-ruby.pod:52
1078 #: ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3337
1079 #: ../test-tool/libguestfs-test-tool.pod:110
1080 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
1081 #: ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315
1082 #: ../tools/virt-win-reg.pl:776
1087 #: ../align/virt-alignment-scan.pod:361 ../clone/virt-sysprep.pod:507
1088 #: ../sparsify/virt-sparsify.pod:270
1089 msgid "Copyright (C) 2011 Red Hat Inc."
1093 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:220
1094 #: ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515
1095 #: ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:243
1096 #: ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305
1097 #: ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58
1098 #: ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60
1099 #: ../fuse/guestmount.pod:337 ../inspector/virt-inspector.pod:407
1100 #: ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:643
1101 #: ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115
1102 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
1103 #: ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319
1104 #: ../tools/virt-win-reg.pl:780
1106 "This program is free software; you can redistribute it and/or modify it "
1107 "under the terms of the GNU General Public License as published by the Free "
1108 "Software Foundation; either version 2 of the License, or (at your option) "
1109 "any later version."
1113 #: ../align/virt-alignment-scan.pod:368 ../cat/virt-cat.pod:225
1114 #: ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520
1115 #: ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:248
1116 #: ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310
1117 #: ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63
1118 #: ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65
1119 #: ../fuse/guestmount.pod:342 ../inspector/virt-inspector.pod:412
1120 #: ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:648
1121 #: ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120
1122 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
1123 #: ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324
1124 #: ../tools/virt-win-reg.pl:785
1126 "This program is distributed in the hope that it will be useful, but WITHOUT "
1127 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
1128 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
1133 #: ../align/virt-alignment-scan.pod:373 ../cat/virt-cat.pod:230
1134 #: ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525
1135 #: ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:253
1136 #: ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315
1137 #: ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68
1138 #: ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70
1139 #: ../fuse/guestmount.pod:347 ../inspector/virt-inspector.pod:417
1140 #: ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:653
1141 #: ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125
1142 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
1143 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329
1144 #: ../tools/virt-win-reg.pl:790
1146 "You should have received a copy of the GNU General Public License along with "
1147 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
1148 "Ave, Cambridge, MA 02139, USA."
1152 #: ../cat/virt-cat.pod:5
1153 msgid "virt-cat - Display files in a virtual machine"
1157 #: ../cat/virt-cat.pod:9
1160 " virt-cat [--options] -d domname file [file ...]\n"
1165 #: ../cat/virt-cat.pod:11
1168 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
1173 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
1174 #: ../inspector/virt-inspector.pod:13
1179 #: ../cat/virt-cat.pod:15
1182 " virt-cat domname file\n"
1187 #: ../cat/virt-cat.pod:17
1190 " virt-cat disk.img file\n"
1195 #: ../cat/virt-cat.pod:21
1197 "C<virt-cat> is a command line tool to display the contents of C<file> where "
1198 "C<file> exists in the named virtual machine (or disk image)."
1202 #: ../cat/virt-cat.pod:24
1204 "Multiple filenames can be given, in which case they are concatenated "
1205 "together. Each filename must be a full path, starting at the root directory "
1206 "(starting with '/')."
1210 #: ../cat/virt-cat.pod:28
1212 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
1213 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
1214 "(see L</USING GUESTFISH> below)."
1218 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
1219 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
1220 #: ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29
1221 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
1222 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
1223 #: ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75
1224 #: ../tools/virt-tar.pl:50
1229 #: ../cat/virt-cat.pod:34
1231 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
1235 #: ../cat/virt-cat.pod:37
1238 " virt-cat -d mydomain /etc/fstab\n"
1243 #: ../cat/virt-cat.pod:39
1244 msgid "List syslog messages from a VM disk image file:"
1248 #: ../cat/virt-cat.pod:41
1251 " virt-cat -a disk.img /var/log/messages | tail\n"
1256 #: ../cat/virt-cat.pod:43
1257 msgid "Find out what DHCP IP address a VM acquired:"
1261 #: ../cat/virt-cat.pod:45
1264 " virt-cat -d mydomain /var/log/messages | \\\n"
1265 " grep 'dhclient: bound to' | tail\n"
1270 #: ../cat/virt-cat.pod:48
1271 msgid "Find out what packages were recently installed:"
1275 #: ../cat/virt-cat.pod:50
1278 " virt-cat -d mydomain /var/log/yum.log | tail\n"
1283 #: ../cat/virt-cat.pod:52
1284 msgid "Find out who is logged on inside a virtual machine:"
1288 #: ../cat/virt-cat.pod:54
1291 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
1297 #: ../cat/virt-cat.pod:57
1298 msgid "or who was logged on:"
1302 #: ../cat/virt-cat.pod:59
1305 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
1306 " last -f /tmp/wtmp\n"
1311 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
1312 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
1313 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
1315 "Add I<file> which should be a disk image from a virtual machine. If the "
1316 "virtual machine has multiple block devices, you must supply all of them with "
1317 "separate I<-a> options."
1321 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
1322 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
1323 #: ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
1324 msgid "B<--echo-keys>"
1328 #: ../cat/virt-cat.pod:100
1330 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
1331 "so you cannot see what you are typing. If you are not worried about Tempest "
1332 "attacks and there is no one else in the room you can specify this flag to "
1333 "see what you are typing."
1337 #: ../cat/virt-cat.pod:116
1340 " virt-cat --format=raw -a disk.img file\n"
1345 #: ../cat/virt-cat.pod:120
1348 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
1353 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
1354 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
1355 #: ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
1356 msgid "B<--keys-from-stdin>"
1360 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
1361 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
1362 #: ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
1364 "Read key or passphrase parameters from stdin. The default is to try to read "
1365 "passphrases from the user by opening C</dev/tty>."
1369 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
1370 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
1371 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1375 #: ../cat/virt-cat.pod:154
1376 msgid "Previous versions of virt-cat allowed you to write either:"
1380 #: ../cat/virt-cat.pod:156
1383 " virt-cat disk.img [disk.img ...] file\n"
1388 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
1389 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1394 #: ../cat/virt-cat.pod:160
1397 " virt-cat guestname file\n"
1402 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
1403 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1405 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1406 "the confusing case where a disk image might have the same name as a guest."
1410 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
1411 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1412 msgid "For compatibility the old style is still supported."
1416 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
1417 msgid "USING GUESTFISH"
1421 #: ../cat/virt-cat.pod:170
1423 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1424 "C<virt-cat> doesn't work."
1428 #: ../cat/virt-cat.pod:173
1429 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1433 #: ../cat/virt-cat.pod:175
1436 " guestfish --ro -i -d domname download file -\n"
1441 #: ../cat/virt-cat.pod:177
1443 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1444 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1448 #: ../cat/virt-cat.pod:181
1450 "The command above uses libguestfs's guest inspection feature and so does not "
1451 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1452 "disk images that don't contain guests. To display a file from a disk image "
1457 #: ../cat/virt-cat.pod:186
1460 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1465 #: ../cat/virt-cat.pod:188
1467 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1468 "the disk image, and C<file> is the full path to the file."
1472 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374
1473 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
1474 #: ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:377
1475 #: ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:229
1477 "This program returns 0 if successful, or non-zero if there was an error."
1481 #: ../cat/virt-cat.pod:205
1483 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
1484 "tar-out(1)>, L<http://libguestfs.org/>."
1488 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405
1489 #: ../resize/virt-resize.pod:641
1490 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1494 #: ../cat/virt-filesystems.pod:5
1496 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1497 "virtual machine or disk image"
1501 #: ../cat/virt-filesystems.pod:9
1504 " virt-filesystems [--options] -d domname\n"
1509 #: ../cat/virt-filesystems.pod:11
1512 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1517 #: ../cat/virt-filesystems.pod:15
1519 "This tool allows you to discover filesystems, partitions, logical volumes, "
1520 "and their sizes in a disk image or virtual machine. It is a replacement for "
1521 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1525 #: ../cat/virt-filesystems.pod:20
1527 "One use for this tool is from shell scripts to iterate over all filesystems "
1528 "from a disk image:"
1532 #: ../cat/virt-filesystems.pod:23
1535 " for fs in $(virt-filesystems -a disk.img); do\n"
1542 #: ../cat/virt-filesystems.pod:27
1544 "Another use is to list partitions before using another tool to modify those "
1545 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1546 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1550 #: ../cat/virt-filesystems.pod:32
1552 "Various command line options control what this program displays. You need "
1553 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1554 "guest respectively. If you just specify that then the program shows "
1555 "filesystems found, one per line, like this:"
1559 #: ../cat/virt-filesystems.pod:37
1562 " $ virt-filesystems -a disk.img\n"
1564 " /dev/vg_guest/lv_root\n"
1569 #: ../cat/virt-filesystems.pod:41
1571 "If you add I<-l> or I<--long> then the output includes extra information:"
1575 #: ../cat/virt-filesystems.pod:44
1578 " $ virt-filesystems -a disk.img -l\n"
1579 " Name Type VFS Label Size\n"
1580 " /dev/sda1 filesystem ext4 boot 524288000\n"
1581 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1586 #: ../cat/virt-filesystems.pod:49
1588 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1593 #: ../cat/virt-filesystems.pod:52
1596 " $ virt-filesystems -a disk.img --extra\n"
1598 " /dev/vg_guest/lv_root\n"
1599 " /dev/vg_guest/lv_swap\n"
1600 " /dev/vg_guest/lv_data\n"
1605 #: ../cat/virt-filesystems.pod:58
1607 "If you add I<--partitions> then partitions are shown instead of filesystems:"
1611 #: ../cat/virt-filesystems.pod:60
1614 " $ virt-filesystems -a disk.img --partitions\n"
1621 #: ../cat/virt-filesystems.pod:64
1623 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
1624 "volumes>, I<--block-devices> to list those items."
1628 #: ../cat/virt-filesystems.pod:67
1630 "You can use these options in combination as well (if you want a combination "
1631 "including filesystems, you have to add I<--filesystems>). Notice that some "
1632 "items fall into several categories (eg. C</dev/sda1> might be both a "
1633 "partition and a filesystem). These items are listed several times. To get "
1634 "a list which includes absolutely everything that virt-filesystems knows "
1635 "about, use the I<--all> option."
1639 #: ../cat/virt-filesystems.pod:74
1641 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
1642 "uuid> option to display device and filesystem UUIDs in the long output."
1646 #: ../cat/virt-filesystems.pod:78
1648 "I<--all --long --uuid> is a useful combination to display all possible "
1649 "information about everything."
1653 #: ../cat/virt-filesystems.pod:81
1656 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1657 " Name Type VFS Label Size Parent UUID\n"
1658 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1659 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1660 " /dev/sda1 partition - - 100M /dev/sda -\n"
1661 " /dev/sda2 partition - - 20G /dev/sda -\n"
1662 " /dev/sda device - - 20G - -\n"
1667 #: ../cat/virt-filesystems.pod:89
1669 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1673 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1678 #: ../cat/virt-filesystems.pod:112
1680 "Display everything. This is currently the same as specifying these options: "
1681 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
1682 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
1683 "added to this list in future)."
1687 #: ../cat/virt-filesystems.pod:117
1688 msgid "See also I<--long>."
1692 #: ../cat/virt-filesystems.pod:119
1693 msgid "B<--blkdevs>"
1697 #: ../cat/virt-filesystems.pod:121
1698 msgid "B<--block-devices>"
1702 #: ../cat/virt-filesystems.pod:123
1703 msgid "Display block devices."
1707 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1712 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1714 "Write out the results in CSV format (comma-separated values). This format "
1715 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1716 "ABOUT CSV FORMAT> below."
1720 #: ../cat/virt-filesystems.pod:150
1722 "When prompting for keys and passphrases, virt-filesystems normally turns "
1723 "echoing off so you cannot see what you are typing. If you are not worried "
1724 "about Tempest attacks and there is no one else in the room you can specify "
1725 "this flag to see what you are typing."
1729 #: ../cat/virt-filesystems.pod:155
1734 #: ../cat/virt-filesystems.pod:157
1736 "This causes filesystems that are not ordinary, mountable filesystems to be "
1737 "displayed. This category includes swapspace, and filesystems that are empty "
1738 "or contain unknown data."
1742 #: ../cat/virt-filesystems.pod:161
1743 msgid "This option implies I<--filesystems>."
1747 #: ../cat/virt-filesystems.pod:163
1748 msgid "B<--filesystems>"
1752 #: ../cat/virt-filesystems.pod:165
1754 "Display mountable filesystems. If no display option was selected then this "
1755 "option is implied."
1759 #: ../cat/virt-filesystems.pod:168
1760 msgid "With I<--extra>, non-mountable filesystems are shown too."
1764 #: ../cat/virt-filesystems.pod:181
1767 " virt-filesystems --format=raw -a disk.img\n"
1772 #: ../cat/virt-filesystems.pod:185
1775 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1780 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1781 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1782 #: ../tools/virt-list-partitions.pl:109
1787 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1788 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1789 msgid "B<--human-readable>"
1793 #: ../cat/virt-filesystems.pod:198
1794 msgid "In I<--long> mode, display sizes in human-readable format."
1798 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1799 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1804 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1805 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1810 #: ../cat/virt-filesystems.pod:209
1811 msgid "Display extra columns of data (\"long format\")."
1815 #: ../cat/virt-filesystems.pod:211
1816 msgid "A title row is added unless you also specify I<--no-title>."
1820 #: ../cat/virt-filesystems.pod:213
1822 "The extra columns displayed depend on what output you select, and the "
1823 "ordering of columns may change in future versions. Use the title row, I<--"
1824 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1829 #: ../cat/virt-filesystems.pod:218
1831 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1832 "default is to show raw numbers of I<bytes>."
1836 #: ../cat/virt-filesystems.pod:221
1837 msgid "Use I<--uuid> to display UUIDs too."
1841 #: ../cat/virt-filesystems.pod:223
1846 #: ../cat/virt-filesystems.pod:225
1847 msgid "B<--logvols>"
1851 #: ../cat/virt-filesystems.pod:227
1852 msgid "B<--logical-volumes>"
1856 #: ../cat/virt-filesystems.pod:229
1858 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1859 "of whether the LVs contain filesystems."
1863 #: ../cat/virt-filesystems.pod:232
1864 msgid "B<--no-title>"
1868 #: ../cat/virt-filesystems.pod:234
1869 msgid "In I<--long> mode, don't add a title row."
1873 #: ../cat/virt-filesystems.pod:236
1875 "Note that the order of the columns is not fixed, and may change in future "
1876 "versions of virt-filesystems, so using this option may give you unexpected "
1881 #: ../cat/virt-filesystems.pod:240
1886 #: ../cat/virt-filesystems.pod:242
1887 msgid "B<--partitions>"
1891 #: ../cat/virt-filesystems.pod:244
1893 "Display partitions. In this mode, these are displayed irrespective of "
1894 "whether the partitions contain filesystems."
1898 #: ../cat/virt-filesystems.pod:247
1903 #: ../cat/virt-filesystems.pod:249
1904 msgid "B<--physvols>"
1908 #: ../cat/virt-filesystems.pod:251
1909 msgid "B<--physical-volumes>"
1913 #: ../cat/virt-filesystems.pod:253
1914 msgid "Display LVM physical volumes."
1918 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1923 #: ../cat/virt-filesystems.pod:257
1928 #: ../cat/virt-filesystems.pod:259
1929 msgid "In I<--long> mode, display UUIDs as well."
1933 #: ../cat/virt-filesystems.pod:273
1938 #: ../cat/virt-filesystems.pod:275
1939 msgid "B<--volgroups>"
1943 #: ../cat/virt-filesystems.pod:277
1944 msgid "B<--volume-groups>"
1948 #: ../cat/virt-filesystems.pod:279
1949 msgid "Display LVM volume groups."
1953 #: ../cat/virt-filesystems.pod:287
1958 #: ../cat/virt-filesystems.pod:289
1960 "Note that columns in the output are subject to reordering and change in "
1961 "future versions of this tool."
1965 #: ../cat/virt-filesystems.pod:294
1970 #: ../cat/virt-filesystems.pod:296
1971 msgid "The filesystem, partition, block device or LVM name."
1975 #: ../cat/virt-filesystems.pod:298
1977 "For device and partition names these are displayed as canonical libguestfs "
1978 "names, so that for example C</dev/sda2> is the second partition on the first "
1983 #: ../cat/virt-filesystems.pod:302
1985 "If the I<--long> option is B<not> specified, then only the name column is "
1986 "shown in the output."
1990 #: ../cat/virt-filesystems.pod:305
1995 #: ../cat/virt-filesystems.pod:307
1996 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
2000 #: ../cat/virt-filesystems.pod:309
2005 #: ../cat/virt-filesystems.pod:311
2007 "If there is a filesystem, then this column displays the filesystem type if "
2008 "one could be detected, eg. C<ext4>."
2012 #: ../cat/virt-filesystems.pod:314
2017 #: ../cat/virt-filesystems.pod:316
2019 "If the object has a label (used for identifying and mounting filesystems) "
2020 "then this column contains the label."
2024 #: ../cat/virt-filesystems.pod:319
2029 #: ../cat/virt-filesystems.pod:321
2031 "The size of the object in bytes. If the I<--human> option is used then the "
2032 "size is displayed in a human-readable form."
2036 #: ../cat/virt-filesystems.pod:324
2041 #: ../cat/virt-filesystems.pod:326
2043 "The parent column records the parent relationship between objects. For "
2044 "example, if the object is a partition, then this column contains the name of "
2045 "the containing device. If the object is a logical volume, then this column "
2046 "is the name of the volume group."
2050 #: ../cat/virt-filesystems.pod:331
2055 #: ../cat/virt-filesystems.pod:333
2057 "If the object has a UUID (used for identifying and mounting filesystems and "
2058 "block devices) then this column contains the UUID as a string."
2062 #: ../cat/virt-filesystems.pod:337
2063 msgid "The UUID is only displayed if the I<--uuid> option is given."
2067 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459
2068 #: ../df/virt-df.pod:191
2069 msgid "NOTE ABOUT CSV FORMAT"
2073 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461
2074 #: ../df/virt-df.pod:193
2076 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
2077 "should be easy to parse, but it is definitely not easy to parse."
2081 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464
2082 #: ../df/virt-df.pod:196
2084 "Myth: Just split fields at commas. Reality: This does I<not> work "
2085 "reliably. This example has two columns:"
2089 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467
2090 #: ../df/virt-df.pod:199
2093 " \"foo,bar\",baz\n"
2098 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469
2099 #: ../df/virt-df.pod:201
2101 "Myth: Read the file one line at a time. Reality: This does I<not> work "
2102 "reliably. This example has one row:"
2106 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472
2107 #: ../df/virt-df.pod:204
2116 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475
2117 #: ../df/virt-df.pod:207
2119 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
2120 "packaged in major Linux distributions)."
2124 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478
2125 #: ../df/virt-df.pod:210
2127 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
2128 "or Python's built-in csv library)."
2132 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481
2133 #: ../df/virt-df.pod:213
2134 msgid "Most spreadsheets and databases can import CSV directly."
2138 #: ../cat/virt-filesystems.pod:379
2140 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
2141 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
2146 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570
2147 #: ../tools/virt-win-reg.pl:778
2148 msgid "Copyright (C) 2010 Red Hat Inc."
2152 #: ../cat/virt-ls.pod:5
2153 msgid "virt-ls - List files in a virtual machine"
2157 #: ../cat/virt-ls.pod:9
2160 " virt-ls [--options] -d domname directory [directory ...]\n"
2165 #: ../cat/virt-ls.pod:11
2168 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
2173 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
2178 #: ../cat/virt-ls.pod:15
2181 " virt-ls [--options] domname directory\n"
2186 #: ../cat/virt-ls.pod:17
2189 " virt-ls [--options] disk.img [disk.img ...] directory\n"
2194 #: ../cat/virt-ls.pod:21
2196 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
2197 "more from a virtual machine or disk image."
2201 #: ../cat/virt-ls.pod:24
2203 "Multiple directory names can be given, in which case the output from each is "
2208 #: ../cat/virt-ls.pod:27
2210 "To list directories from a libvirt guest use the I<-d> option to specify the "
2211 "name of the guest. For a disk image, use the I<-a> option."
2215 #: ../cat/virt-ls.pod:31
2217 "C<virt-ls> can do many simple file listings. For more complicated cases you "
2218 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
2223 #: ../cat/virt-ls.pod:37
2224 msgid "Get a list of all files and directories in a virtual machine:"
2228 #: ../cat/virt-ls.pod:39
2231 " virt-ls -R -d guest /\n"
2236 #: ../cat/virt-ls.pod:41
2237 msgid "List all setuid or setgid programs in a Linux virtual machine:"
2241 #: ../cat/virt-ls.pod:43
2244 " virt-ls -lR -d guest / | grep '^- [42]'\n"
2249 #: ../cat/virt-ls.pod:45
2250 msgid "List all public-writable directories in a Linux virtual machine:"
2254 #: ../cat/virt-ls.pod:47
2257 " virt-ls -lR -d guest / | grep '^d ...7'\n"
2262 #: ../cat/virt-ls.pod:49
2263 msgid "List all Unix domain sockets in a Linux virtual machine:"
2267 #: ../cat/virt-ls.pod:51
2270 " virt-ls -lR -d guest / | grep '^s'\n"
2275 #: ../cat/virt-ls.pod:53
2276 msgid "List all regular files with filenames ending in '.png':"
2280 #: ../cat/virt-ls.pod:55
2283 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
2288 #: ../cat/virt-ls.pod:57
2289 msgid "To display files larger than 10MB in home directories:"
2293 #: ../cat/virt-ls.pod:59
2296 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
2301 #: ../cat/virt-ls.pod:61
2302 msgid "Find everything modified in the last 7 days:"
2306 #: ../cat/virt-ls.pod:63
2309 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
2314 #: ../cat/virt-ls.pod:65
2315 msgid "Find regular files modified in the last 24 hours:"
2319 #: ../cat/virt-ls.pod:67
2322 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2327 #: ../cat/virt-ls.pod:69
2328 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2332 #: ../cat/virt-ls.pod:71
2334 "Find the differences between files in a guest and an earlier snapshot of the "
2339 #: ../cat/virt-ls.pod:74
2342 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2343 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2344 " diff -u old new | less\n"
2349 #: ../cat/virt-ls.pod:78
2351 "The commands above won't find files where the content has changed but the "
2352 "metadata (eg. file size and modification date) is the same. To do that, you "
2353 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
2354 "checksum> can be quite slow since it has to read and compute a checksum of "
2355 "every regular file in the virtual machine."
2359 #: ../cat/virt-ls.pod:84
2360 msgid "OUTPUT MODES"
2364 #: ../cat/virt-ls.pod:86
2366 "C<virt-ls> has four output modes, controlled by different combinations of "
2367 "the I<-l> and I<-R> options."
2371 #: ../cat/virt-ls.pod:89
2372 msgid "SIMPLE LISTING"
2376 #: ../cat/virt-ls.pod:91
2377 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2381 #: ../cat/virt-ls.pod:93
2384 " $ virt-ls -d guest /\n"
2392 #: ../cat/virt-ls.pod:98
2393 msgid "LONG LISTING"
2397 #: ../cat/virt-ls.pod:100
2399 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2400 "(more specifically, like the C<guestfs_ll> function)."
2404 #: ../cat/virt-ls.pod:103
2407 " $ virt-ls -l -d guest /\n"
2409 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2410 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2416 #: ../cat/virt-ls.pod:109
2418 "Note that while this is useful for displaying a directory, do not try "
2419 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2424 #: ../cat/virt-ls.pod:113
2425 msgid "RECURSIVE LISTING"
2429 #: ../cat/virt-ls.pod:115
2431 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2432 "and directories recursively:"
2436 #: ../cat/virt-ls.pod:118
2439 " $ virt-ls -R -d guest /tmp\n"
2447 #: ../cat/virt-ls.pod:123
2449 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2450 "converts C<\\0> characters to C<\\n>."
2454 #: ../cat/virt-ls.pod:126
2455 msgid "RECURSIVE LONG LISTING"
2459 #: ../cat/virt-ls.pod:128
2461 "Using I<-lR> options together changes the output to display directories "
2462 "recursively, with file stats, and optionally other features such as "
2463 "checksums and extended attributes."
2467 #: ../cat/virt-ls.pod:132
2469 "Most of the interesting features of C<virt-ls> are only available when using "
2474 #: ../cat/virt-ls.pod:135
2476 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2477 "you cannot use the output in another program (because filenames can contain "
2478 "spaces and other unsafe characters). If the guest was untrusted and someone "
2479 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2480 "on you by creating filenames with embedded newline characters. To B<safely> "
2481 "parse the output in another program, use the I<--csv> (Comma-Separated "
2486 #: ../cat/virt-ls.pod:143
2488 "Note that this output format is completely unrelated to the C<ls -lR> "
2493 #: ../cat/virt-ls.pod:146
2496 " $ virt-ls -lR -d guest /bin\n"
2497 " d 0555 4096 /bin\n"
2498 " - 0755 123 /bin/alsaunmute\n"
2499 " - 0755 28328 /bin/arch\n"
2500 " l 0777 4 /bin/awk -> gawk\n"
2501 " - 0755 27216 /bin/basename\n"
2502 " - 0755 943360 /bin/bash\n"
2508 #: ../cat/virt-ls.pod:155
2509 msgid "These basic fields are always shown:"
2513 #: ../cat/virt-ls.pod:159
2518 #: ../cat/virt-ls.pod:161
2520 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2521 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2522 "link), C<s> (socket) or C<u> (unknown)."
2526 #: ../cat/virt-ls.pod:171
2531 #: ../cat/virt-ls.pod:173
2532 msgid "The Unix permissions, displayed as a 4 digit octal number."
2536 #: ../cat/virt-ls.pod:175
2541 #: ../cat/virt-ls.pod:177
2543 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
2544 "readable> option is given, in which case this is shown as a human-readable "
2549 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4263
2554 #: ../cat/virt-ls.pod:183
2555 msgid "The full path of the file or directory."
2559 #: ../cat/virt-ls.pod:185
2564 #: ../cat/virt-ls.pod:187
2565 msgid "For symbolic links only, the link target."
2569 #: ../cat/virt-ls.pod:191
2571 "In I<-lR> mode, additional command line options enable the display of more "
2576 #: ../cat/virt-ls.pod:194
2578 "With the I<--uids> flag, these additional fields are displayed before the "
2583 #: ../cat/virt-ls.pod:199
2588 #: ../cat/virt-ls.pod:201
2593 #: ../cat/virt-ls.pod:203
2595 "The UID and GID of the owner of the file (displayed numerically). Note "
2596 "these only make sense in the context of a Unix-like guest."
2600 #: ../cat/virt-ls.pod:208
2601 msgid "With the I<--times> flag, these additional fields are displayed:"
2605 #: ../cat/virt-ls.pod:212
2610 #: ../cat/virt-ls.pod:214
2611 msgid "The time of last access."
2615 #: ../cat/virt-ls.pod:216
2620 #: ../cat/virt-ls.pod:218
2621 msgid "The time of last modification."
2625 #: ../cat/virt-ls.pod:220
2630 #: ../cat/virt-ls.pod:222
2631 msgid "The time of last status change."
2635 #: ../cat/virt-ls.pod:226
2637 "The time fields are displayed as string dates and times, unless one of the "
2638 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2642 #: ../cat/virt-ls.pod:229
2643 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2647 #: ../cat/virt-ls.pod:233
2652 #: ../cat/virt-ls.pod:235
2654 "The device containing the file (displayed as major:minor). This may not "
2655 "match devices as known to the guest."
2659 #: ../cat/virt-ls.pod:238
2664 #: ../cat/virt-ls.pod:240
2665 msgid "The inode number."
2669 #: ../cat/virt-ls.pod:242
2674 #: ../cat/virt-ls.pod:244
2675 msgid "The number of hard links."
2679 #: ../cat/virt-ls.pod:246
2684 #: ../cat/virt-ls.pod:248
2686 "For block and char special files, the device (displayed as major:minor)."
2690 #: ../cat/virt-ls.pod:251
2695 #: ../cat/virt-ls.pod:253
2696 msgid "The number of 512 byte blocks allocated to the file."
2700 #: ../cat/virt-ls.pod:257
2702 "With the I<--checksum> flag, the checksum of the file contents is shown "
2703 "(only for regular files). Computing file checksums can take a considerable "
2708 #: ../cat/virt-ls.pod:280
2709 msgid "B<--checksum>"
2713 #: ../cat/virt-ls.pod:282
2714 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2718 #: ../cat/virt-ls.pod:284
2720 "Display checksum over file contents for regular files. With no argument, "
2721 "this defaults to using I<md5>. Using an argument, you can select the "
2722 "checksum type to use."
2726 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2727 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2728 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2730 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2735 #: ../cat/virt-ls.pod:316
2737 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2738 "so you cannot see what you are typing. If you are not worried about Tempest "
2739 "attacks and there is no one else in the room you can specify this flag to "
2740 "see what you are typing."
2744 #: ../cat/virt-ls.pod:321
2745 msgid "B<--extra-stats>"
2749 #: ../cat/virt-ls.pod:323
2750 msgid "Display extra stats."
2754 #: ../cat/virt-ls.pod:339
2757 " virt-ls --format=raw -a disk.img /dir\n"
2762 #: ../cat/virt-ls.pod:343
2765 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2770 #: ../cat/virt-ls.pod:356
2771 msgid "Display file sizes in human-readable format."
2775 #: ../cat/virt-ls.pod:370
2780 #: ../cat/virt-ls.pod:372
2781 msgid "B<--recursive>"
2785 #: ../cat/virt-ls.pod:374
2787 "Select the mode. With neither of these options, C<virt-ls> produces a "
2788 "simple, flat list of the files in the named directory. See L</SIMPLE "
2793 #: ../cat/virt-ls.pod:378
2795 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2800 #: ../cat/virt-ls.pod:381
2802 "C<virt-ls -R> produces a recursive list of files starting at the named "
2803 "directory. See L</RECURSIVE LISTING>."
2807 #: ../cat/virt-ls.pod:384
2809 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2810 "parsed. See L</RECURSIVE LONG LISTING>."
2814 #: ../cat/virt-ls.pod:387
2819 #: ../cat/virt-ls.pod:389
2820 msgid "Display time fields."
2824 #: ../cat/virt-ls.pod:394
2825 msgid "B<--time-days>"
2829 #: ../cat/virt-ls.pod:396
2830 msgid "Display time fields as days before now (negative if in the future)."
2834 #: ../cat/virt-ls.pod:398
2836 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2837 "of the file is between 0 and 86399 seconds."
2841 #: ../cat/virt-ls.pod:404
2842 msgid "B<--time-relative>"
2846 #: ../cat/virt-ls.pod:406
2847 msgid "Display time fields as seconds before now (negative if in the future)."
2851 #: ../cat/virt-ls.pod:411
2856 #: ../cat/virt-ls.pod:413
2857 msgid "Display time fields as seconds since the Unix epoch."
2861 #: ../cat/virt-ls.pod:418
2866 #: ../cat/virt-ls.pod:420
2867 msgid "Display UID and GID fields."
2871 #: ../cat/virt-ls.pod:445
2872 msgid "Previous versions of virt-ls allowed you to write either:"
2876 #: ../cat/virt-ls.pod:447
2879 " virt-ls disk.img [disk.img ...] /dir\n"
2884 #: ../cat/virt-ls.pod:451
2887 " virt-ls guestname /dir\n"
2892 #: ../cat/virt-ls.pod:497
2894 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2895 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2896 "L<http://libguestfs.org/>."
2900 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2901 #: ../rescue/virt-rescue.pod:302
2902 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2906 #: ../clone/virt-sysprep.pod:5
2908 "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2912 #: ../clone/virt-sysprep.pod:9
2915 " virt-sysprep [--options] -d domname\n"
2920 #: ../clone/virt-sysprep.pod:11
2923 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2928 #: ../clone/virt-sysprep.pod:15
2930 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2931 "can be made from it. Steps in this process include removing SSH host keys, "
2932 "removing persistent network MAC configuration, and removing user accounts. "
2933 "Each step can be enabled or disabled as required."
2937 #: ../clone/virt-sysprep.pod:21
2939 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2940 "customization by the system administrator."
2944 #: ../clone/virt-sysprep.pod:24
2946 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2947 "be shut down. If you want to preserve the existing contents of the guest, "
2948 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> below."
2952 #: ../clone/virt-sysprep.pod:29
2954 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2955 "recommend that you don't. The time you might want to run it as root is when "
2956 "you need root in order to access the disk image, but even in this case it "
2957 "would be better to change the permissions on the disk image to be writable "
2958 "as the non-root user running virt-sysprep."
2962 #: ../clone/virt-sysprep.pod:35
2964 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2965 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2966 "machines in preparation for cloning them. Having said that, virt-sysprep "
2967 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2968 "Windows sysprepping in a future version, and we already have code to do it."
2972 #: ../clone/virt-sysprep.pod:76
2973 msgid "B<--enable=...>"
2977 #: ../clone/virt-sysprep.pod:78
2979 "Choose which sysprep operations to perform. Give a comma-separated list of "
2980 "operations, for example:"
2984 #: ../clone/virt-sysprep.pod:81
2987 " --enable=ssh-hostkeys,udev-persistent-net\n"
2992 #: ../clone/virt-sysprep.pod:83
2994 "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2998 #: ../clone/virt-sysprep.pod:85
3000 "If the I<--enable> option is not given, then we default to trying all "
3001 "possible sysprep operations. But some sysprep operations are skipped for "
3006 #: ../clone/virt-sysprep.pod:89
3008 "Use I<--list-operations> to list operations supported by a particular "
3009 "version of virt-sysprep."
3013 #: ../clone/virt-sysprep.pod:92
3015 "See L</OPERATIONS> below for a list and an explanation of each operation."
3019 #: ../clone/virt-sysprep.pod:106
3022 " virt-sysprep --format=raw -a disk.img\n"
3027 #: ../clone/virt-sysprep.pod:110
3030 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
3035 #: ../clone/virt-sysprep.pod:119
3036 msgid "B<--hostname> newhostname"
3040 #: ../clone/virt-sysprep.pod:121
3042 "Change the hostname. See the L</hostname> operation below. If not given, "
3043 "defaults to C<localhost.localdomain>."
3047 #: ../clone/virt-sysprep.pod:124
3048 msgid "B<--list-operations>"
3052 #: ../clone/virt-sysprep.pod:126
3053 msgid "List the operations supported by the virt-sysprep program."
3057 #: ../clone/virt-sysprep.pod:128
3058 msgid "B<--selinux-relabel>"
3062 #: ../clone/virt-sysprep.pod:130
3063 msgid "B<--no-selinux-relabel>"
3067 #: ../clone/virt-sysprep.pod:132
3069 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
3070 "I<--no-selinux-relabel> disables relabelling."
3074 #: ../clone/virt-sysprep.pod:135
3076 "The default is to try to detect if SELinux relabelling is required. See L</"
3077 "SELINUX RELABELLING> below for more details."
3081 #: ../clone/virt-sysprep.pod:156
3086 #: ../clone/virt-sysprep.pod:158
3088 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
3089 "enabled>, although some are skipped depending on the type of guest."
3093 #: ../clone/virt-sysprep.pod:162
3095 "Operations can be individually enabled using the I<--enable> option. Use a "
3096 "comma-separated list, for example:"
3100 #: ../clone/virt-sysprep.pod:165
3103 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
3108 #: ../clone/virt-sysprep.pod:167
3110 "To list the operations supported by the current version of virt-sysprep, use "
3111 "I<--list-operations>."
3115 #: ../clone/virt-sysprep.pod:170
3117 "Future versions of virt-sysprep may add more operations. If you are using "
3118 "virt-sysprep and want predictable behaviour, specify only the operations "
3119 "that you want to have enabled."
3123 #: ../clone/virt-sysprep.pod:174
3128 #: ../clone/virt-sysprep.pod:176
3129 msgid "Remove user at-jobs and cron-jobs."
3133 #: ../clone/virt-sysprep.pod:178
3134 msgid "dhcp-client-state"
3138 #: ../clone/virt-sysprep.pod:180
3139 msgid "Remove DHCP client leases."
3143 #: ../clone/virt-sysprep.pod:182
3144 msgid "dhcp-server-state"
3148 #: ../clone/virt-sysprep.pod:184
3149 msgid "Remove DHCP server leases."
3153 #: ../clone/virt-sysprep.pod:186
3158 #: ../clone/virt-sysprep.pod:188
3160 "Changes the hostname of the guest to the value given in the I<--hostname> "
3165 #: ../clone/virt-sysprep.pod:191
3167 "If the I<--hostname> parameter is not given, then the hostname is changed to "
3168 "C<localhost.localdomain>."
3172 #: ../clone/virt-sysprep.pod:194
3177 #: ../clone/virt-sysprep.pod:196
3178 msgid "Remove many log files."
3182 #: ../clone/virt-sysprep.pod:198
3187 #: ../clone/virt-sysprep.pod:200
3188 msgid "Remove email from the local mail spool directory."
3192 #: ../clone/virt-sysprep.pod:202
3197 #: ../clone/virt-sysprep.pod:204
3199 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
3200 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
3204 #: ../clone/virt-sysprep.pod:207
3209 #: ../clone/virt-sysprep.pod:209
3211 "Write some random bytes from the host into the random seed file of the guest."
3215 #: ../clone/virt-sysprep.pod:212
3216 msgid "See L</RANDOM SEED> below."
3220 #: ../clone/virt-sysprep.pod:214
3221 msgid "rhn-systemid"
3225 #: ../clone/virt-sysprep.pod:216
3226 msgid "Remove the RHN system ID."
3230 #: ../clone/virt-sysprep.pod:218
3235 #: ../clone/virt-sysprep.pod:220
3236 msgid "Remove the Smolt hardware UUID."
3240 #: ../clone/virt-sysprep.pod:222
3241 msgid "ssh-hostkeys"
3245 #: ../clone/virt-sysprep.pod:224
3246 msgid "Remove the SSH host keys in the guest."
3250 #: ../clone/virt-sysprep.pod:226
3252 "The SSH host keys are regenerated (differently) next time the guest is "
3257 #: ../clone/virt-sysprep.pod:229
3259 "If, after cloning, the guest gets the same IP address, ssh will give you a "
3260 "stark warning about the host key changing:"
3264 #: ../clone/virt-sysprep.pod:232
3267 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3268 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
3269 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3270 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
3275 #: ../clone/virt-sysprep.pod:237
3276 msgid "udev-persistent-net"
3280 #: ../clone/virt-sysprep.pod:239
3282 "Remove udev persistent net rules which map the guest's existing MAC address "
3283 "to a fixed ethernet device (eg. eth0)."
3287 #: ../clone/virt-sysprep.pod:242
3289 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
3290 "address occupies the old name (eg. eth0), this means the fresh MAC address "
3291 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
3292 "Erasing the udev persistent net rules avoids this."
3296 #: ../clone/virt-sysprep.pod:247
3301 #: ../clone/virt-sysprep.pod:249
3302 msgid "Remove the utmp file."
3306 #: ../clone/virt-sysprep.pod:251
3308 "This records who is currently logged in on a machine. In modern Linux "
3309 "distros it is stored in a ramdisk and hence not part of the virtual "
3310 "machine's disk, but it was stored on disk in older distros."
3314 #: ../clone/virt-sysprep.pod:255
3319 #: ../clone/virt-sysprep.pod:257
3320 msgid "Remove the yum UUID."
3324 #: ../clone/virt-sysprep.pod:259
3326 "Yum creates a fresh UUID the next time it runs when it notices that the "
3327 "original UUID has been erased."
3331 #: ../clone/virt-sysprep.pod:262
3332 msgid "COPYING AND CLONING"
3336 #: ../clone/virt-sysprep.pod:264
3338 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3339 "prepare a template from which guests can be cloned. There are many "
3340 "different ways to achieve this using the virt tools, and this section is "
3341 "just an introduction."
3345 #: ../clone/virt-sysprep.pod:269
3346 msgid "A virtual machine (when switched off) consists of two parts:"
3350 #: ../clone/virt-sysprep.pod:273
3351 msgid "I<configuration>"
3355 #: ../clone/virt-sysprep.pod:275
3357 "The configuration or description of the guest. eg. The libvirt XML (see "
3358 "C<virsh dumpxml>), the running configuration of the guest, or another "
3359 "external format like OVF."
3363 #: ../clone/virt-sysprep.pod:279
3364 msgid "Some configuration items that might need to be changed:"
3368 #: ../clone/virt-sysprep.pod:285
3373 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3378 #: ../clone/virt-sysprep.pod:293
3379 msgid "path to block device(s)"
3383 #: ../clone/virt-sysprep.pod:297
3384 msgid "network card MAC address"
3388 #: ../clone/virt-sysprep.pod:301
3389 msgid "I<block device(s)>"
3393 #: ../clone/virt-sysprep.pod:303
3395 "One or more hard disk images, themselves containing files, directories, "
3396 "applications, kernels, configuration, etc."
3400 #: ../clone/virt-sysprep.pod:306
3401 msgid "Some things inside the block devices that might need to be changed:"
3405 #: ../clone/virt-sysprep.pod:312
3406 msgid "hostname and other net configuration"
3410 #: ../clone/virt-sysprep.pod:320
3411 msgid "SSH host keys"
3415 #: ../clone/virt-sysprep.pod:324
3416 msgid "Windows unique security ID (SID)"
3420 #: ../clone/virt-sysprep.pod:328
3421 msgid "Puppet registration"
3425 #: ../clone/virt-sysprep.pod:334
3426 msgid "COPYING THE BLOCK DEVICE"
3430 #: ../clone/virt-sysprep.pod:336
3432 "Starting with an original guest, you probably wish to copy the guest block "
3433 "device and its configuration to make a template. Then once you are happy "
3434 "with the template, you will want to make many clones from it."
3438 #: ../clone/virt-sysprep.pod:341
3444 " original guest --------> template ---------->\n"
3445 " \\------> cloned\n"
3446 " \\-----> guests\n"
3452 #: ../clone/virt-sysprep.pod:349
3454 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3459 #: ../clone/virt-sysprep.pod:352
3463 " original guest --------> template ---------->\n"
3464 " \\------> cloned\n"
3465 " \\-----> guests\n"
3471 #: ../clone/virt-sysprep.pod:358
3472 msgid "There are some smarter (and faster) ways too:"
3476 #: ../clone/virt-sysprep.pod:364
3480 " template ---------->\n"
3481 " \\------> cloned\n"
3482 " \\-----> guests\n"
3488 #: ../clone/virt-sysprep.pod:370
3490 "Use the block device as a backing file and create a snapshot on top for each "
3491 "guest. The advantage is that you don't need to copy the block device (very "
3492 "fast) and only changes are stored (less storage required)."
3496 #: ../clone/virt-sysprep.pod:375
3498 "Note that writing to the backing file once you have created guests on top of "
3499 "it is not possible: you will corrupt the guests."
3503 #: ../clone/virt-sysprep.pod:378
3505 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 -"
3506 "o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3507 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3508 "also create cheap snapshots from files or LUNs."
3512 #: ../clone/virt-sysprep.pod:386
3513 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3517 #: ../clone/virt-sysprep.pod:390
3518 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3522 #: ../clone/virt-sysprep.pod:394
3527 #: ../clone/virt-sysprep.pod:396
3529 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3530 "and/or modify the external libvirt configuration of a guest. It will reset "
3531 "the name, UUID and MAC address of the guest in the libvirt XML."
3535 #: ../clone/virt-sysprep.pod:401
3537 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3538 "image. This was the original motivation to write virt-sysprep."
3542 #: ../clone/virt-sysprep.pod:404
3547 #: ../clone/virt-sysprep.pod:406
3551 " original guest --------> template\n"
3556 #: ../clone/virt-sysprep.pod:409
3558 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3559 "it easier to compress and/or faster to copy."
3563 #: ../clone/virt-sysprep.pod:412
3565 "Notice that since virt-sparsify also copies the image, you can use it to "
3566 "make the initial copy (instead of C<dd>)."
3570 #: ../clone/virt-sysprep.pod:415
3575 #: ../clone/virt-sysprep.pod:417
3579 " template ---------->\n"
3580 " \\------> cloned\n"
3581 " \\-----> guests\n"
3587 #: ../clone/virt-sysprep.pod:423
3589 "If you want to give people cloned guests, but let them pick the size of the "
3590 "guest themselves (eg. depending on how much they are prepared to pay for "
3591 "disk space), then instead of copying the template, you can run L<virt-resize"
3592 "(1)>. Virt-resize performs a copy and resize, and thus is ideal for cloning "
3593 "guests from a template."
3597 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1149
3602 #: ../clone/virt-sysprep.pod:431
3604 "Although virt-sysprep removes some sensitive information from the guest, it "
3605 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3606 "above, and the implementation of the operations in the shell script. You "
3607 "should also examine the guest afterwards."
3611 #: ../clone/virt-sysprep.pod:436
3613 "Sensitive files are simply removed. The data they contained may still exist "
3614 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3615 "L<virt-sparsify(1)> as one way to remove this content. See also the L<scrub"
3616 "(1)> command to get rid of deleted content in directory entries and inodes."
3620 #: ../clone/virt-sysprep.pod:442
3625 #: ../clone/virt-sysprep.pod:444
3626 msgid "I<(This section applies to Linux guests only)>"
3630 #: ../clone/virt-sysprep.pod:446
3632 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3633 "from the host into the guest's random seed file."
3637 #: ../clone/virt-sysprep.pod:449
3639 "If this is just done once and the guest is cloned from the same template, "
3640 "then each guest will start with the same entropy, and things like SSH host "
3641 "keys and TCP sequence numbers may be predictable."
3645 #: ../clone/virt-sysprep.pod:453
3647 "Therefore you should arrange to add more randomness I<after> cloning from a "
3648 "template too, which can be done by just enabling the C<random-seed> "
3653 #: ../clone/virt-sysprep.pod:457
3656 " cp template.img newguest.img\n"
3657 " virt-sysprep --enable=random-seed -a newguest.img\n"
3662 #: ../clone/virt-sysprep.pod:460
3663 msgid "SELINUX RELABELLING"
3667 #: ../clone/virt-sysprep.pod:462
3668 msgid "I<(This section applies to Linux guests using SELinux only)>"
3672 #: ../clone/virt-sysprep.pod:464
3674 "If any new files are created by virt-sysprep, then virt-sysprep touches C</."
3675 "autorelabel> so that these will be correctly labelled by SELinux the next "
3676 "time the guest is booted. This process interrupts boot and can take some "
3681 #: ../clone/virt-sysprep.pod:469
3683 "You can force relabelling for all guests by supplying the I<--selinux-"
3688 #: ../clone/virt-sysprep.pod:472
3690 "You can disable relabelling entirely by supplying the I<--no-selinux-"
3695 #: ../clone/virt-sysprep.pod:484
3696 msgid "This program returns 0 on success, or 1 if there was an error."
3700 #: ../clone/virt-sysprep.pod:488
3702 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, L<virt-"
3703 "resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, L<qemu-img(1)"
3704 ">, L<scrub(1)>, L<http://libguestfs.org/>, L<http://libvirt.org/>."
3708 #: ../df/virt-df.pod:5
3709 msgid "virt-df - Display free space on virtual filesystems"
3713 #: ../df/virt-df.pod:9
3716 " virt-df [--options]\n"
3721 #: ../df/virt-df.pod:11
3724 " virt-df [--options] -d domname\n"
3729 #: ../df/virt-df.pod:13
3732 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3737 #: ../df/virt-df.pod:17
3740 " virt-df [--options] domname\n"
3745 #: ../df/virt-df.pod:19
3748 " virt-df [--options] disk.img [disk.img ...]\n"
3753 #: ../df/virt-df.pod:23
3755 "C<virt-df> is a command line tool to display free space on virtual machine "
3756 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3757 "allocated to a virtual machine, but can look inside disk images to see how "
3758 "much space is really being used."
3762 #: ../df/virt-df.pod:28
3764 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3765 "to get a list of all active and inactive guests, and performs a C<df>-type "
3766 "operation on each one in turn, printing out the results."
3770 #: ../df/virt-df.pod:32
3772 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
3773 "type operation on either the single named libvirt domain, or on the disk "
3774 "image(s) listed on the command line (which must all belong to a single VM). "
3775 "In this mode (with arguments), C<virt-df> will I<only work for a single "
3776 "guest>. If you want to run on multiple guests, then you have to invoke "
3777 "C<virt-df> multiple times."
3781 #: ../df/virt-df.pod:39
3783 "Use the I<--csv> option to get a format which can be easily parsed by other "
3784 "programs. Other options are similar to the standard L<df(1)> command."
3788 #: ../df/virt-df.pod:45
3790 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3791 "output human-readable:"
3795 #: ../df/virt-df.pod:48
3798 " # virt-df -d F14x64 -h\n"
3799 " Filesystem Size Used Available Use%\n"
3800 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3801 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3806 #: ../df/virt-df.pod:53
3807 msgid "Show disk usage for a disk image file called C<test.img>:"
3811 #: ../df/virt-df.pod:55
3814 " $ virt-df -a test1.img\n"
3815 " Filesystem 1K-blocks Used Available Use%\n"
3816 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3821 #: ../df/virt-df.pod:112
3824 " virt-df --format=raw -a disk.img\n"
3829 #: ../df/virt-df.pod:116
3832 " virt-df --format=raw -a disk.img --format -a another.img\n"
3837 #: ../df/virt-df.pod:129
3838 msgid "Print sizes in human-readable format."
3842 #: ../df/virt-df.pod:131
3843 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3847 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3852 #: ../df/virt-df.pod:135
3857 #: ../df/virt-df.pod:137
3858 msgid "Print inodes instead of blocks."
3862 #: ../df/virt-df.pod:139
3863 msgid "B<--one-per-guest>"
3867 #: ../df/virt-df.pod:141
3869 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3870 "disks from several guests to a single libguestfs appliance."
3874 #: ../df/virt-df.pod:144
3875 msgid "You might use this option in the following circumstances:"
3879 #: ../df/virt-df.pod:150
3881 "If you think an untrusted guest might actively try to exploit the libguestfs "
3882 "appliance kernel, then this prevents one guest from interfering with the "
3883 "stats printed for another guest."
3887 #: ../df/virt-df.pod:156
3889 "If the kernel has a bug which stops it from accessing a filesystem in one "
3890 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3891 "and report stats for further guests."
3895 #: ../df/virt-df.pod:165
3897 "Print UUIDs instead of names. This is useful for following a guest even "
3898 "when the guest is migrated or renamed, or when two guests happen to have the "
3903 #: ../df/virt-df.pod:169
3905 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3906 "images, we still print the disk image name even when this option is "
3911 #: ../df/virt-df.pod:229
3913 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
3918 #: ../edit/virt-edit.pod:5
3919 msgid "virt-edit - Edit a file in a virtual machine"
3923 #: ../edit/virt-edit.pod:9
3926 " virt-edit [--options] -d domname file [file ...]\n"
3931 #: ../edit/virt-edit.pod:11
3934 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3939 #: ../edit/virt-edit.pod:13
3942 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3947 #: ../edit/virt-edit.pod:17
3950 " virt-edit domname file\n"
3955 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3958 " virt-edit disk.img [disk.img ...] file\n"
3963 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
3964 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
3965 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
3966 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3971 #: ../edit/virt-edit.pod:23
3973 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3974 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3975 "doing this, but doesn't catch all cases."
3979 #: ../edit/virt-edit.pod:29
3981 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3982 "exists in the named virtual machine (or disk image)."
3986 #: ../edit/virt-edit.pod:32
3988 "Multiple filenames can be given, in which case they are each edited in "
3989 "turn. Each filename must be a full path, starting at the root directory "
3990 "(starting with '/')."
3994 #: ../edit/virt-edit.pod:36
3995 msgid "If you want to just view a file, use L<virt-cat(1)>."
3999 #: ../edit/virt-edit.pod:38
4001 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
4002 "USING GUESTFISH> below)."
4006 #: ../edit/virt-edit.pod:41
4008 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
4009 "that and much more."
4013 #: ../edit/virt-edit.pod:46
4014 msgid "Edit the named files interactively:"
4018 #: ../edit/virt-edit.pod:48
4021 " virt-edit -d mydomain /boot/grub/grub.conf\n"
4026 #: ../edit/virt-edit.pod:50
4029 " virt-edit -d mydomain /etc/passwd\n"
4034 #: ../edit/virt-edit.pod:52
4035 msgid "For Windows guests, some Windows paths are understood:"
4039 #: ../edit/virt-edit.pod:54
4042 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
4047 #: ../edit/virt-edit.pod:56
4049 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
4050 "INTERACTIVE EDITING> below). To change the init default level to 5:"
4054 #: ../edit/virt-edit.pod:60
4057 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
4062 #: ../edit/virt-edit.pod:81
4063 msgid "B<-b> extension"
4067 #: ../edit/virt-edit.pod:83
4068 msgid "B<--backup> extension"
4072 #: ../edit/virt-edit.pod:85
4074 "Create a backup of the original file I<in the guest disk image>. The backup "
4075 "has the original filename with C<extension> added."
4079 #: ../edit/virt-edit.pod:88
4081 "Usually the first character of C<extension> would be a dot C<.> so you would "
4086 #: ../edit/virt-edit.pod:91
4089 " virt-edit -b .orig [etc]\n"
4094 #: ../edit/virt-edit.pod:93
4095 msgid "By default, no backup file is made."
4099 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
4100 #: ../fuse/guestmount.pod:105 ../inspector/virt-inspector.pod:74
4101 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
4102 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
4107 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
4108 #: ../fuse/guestmount.pod:107 ../inspector/virt-inspector.pod:76
4109 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
4110 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
4111 msgid "B<--connect URI>"
4115 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
4116 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
4117 #: ../tools/virt-win-reg.pl:135
4119 "If you specify guest block devices directly, then libvirt is not used at all."
4123 #: ../edit/virt-edit.pod:114
4125 "When prompting for keys and passphrases, virt-edit normally turns echoing "
4126 "off so you cannot see what you are typing. If you are not worried about "
4127 "Tempest attacks and there is no one else in the room you can specify this "
4128 "flag to see what you are typing."
4132 #: ../edit/virt-edit.pod:119
4137 #: ../edit/virt-edit.pod:121
4138 msgid "B<--expr> EXPR"
4142 #: ../edit/virt-edit.pod:123
4144 "Instead of launching the external editor, non-interactively apply the Perl "
4145 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
4150 #: ../edit/virt-edit.pod:127
4152 "Be careful to properly quote the expression to prevent it from being altered "
4157 #: ../edit/virt-edit.pod:130
4158 msgid "Note that this option is only available when Perl 5 is installed."
4162 #: ../edit/virt-edit.pod:132
4163 msgid "B<--format> raw|qcow2|..."
4167 #: ../edit/virt-edit.pod:143
4170 " virt-edit --format=raw -a disk.img file\n"
4175 #: ../edit/virt-edit.pod:147
4178 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
4183 #: ../edit/virt-edit.pod:181
4184 msgid "Previous versions of virt-edit allowed you to write either:"
4188 #: ../edit/virt-edit.pod:187
4191 " virt-edit guestname file\n"
4196 #: ../edit/virt-edit.pod:195
4197 msgid "NON-INTERACTIVE EDITING"
4201 #: ../edit/virt-edit.pod:197
4203 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
4204 "administrator can interactively edit the file."
4208 #: ../edit/virt-edit.pod:200
4210 "There are two ways also to use C<virt-edit> from scripts in order to make "
4211 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
4212 "like this, it's less error-prone to write scripts directly using the "
4213 "libguestfs API and Augeas for configuration file editing.)"
4217 #: ../edit/virt-edit.pod:206
4219 "The first method is to temporarily set C<$EDITOR> to any script or program "
4220 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
4221 "update C<tmpfile> in place however it likes."
4225 #: ../edit/virt-edit.pod:210
4227 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
4228 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
4229 "instances of C<foo> with C<bar> in a file:"
4233 #: ../edit/virt-edit.pod:214
4236 " virt-edit -d domname filename -e 's/foo/bar/'\n"
4241 #: ../edit/virt-edit.pod:216
4243 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
4244 "For example to delete root's password you could do:"
4248 #: ../edit/virt-edit.pod:219
4251 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
4256 #: ../edit/virt-edit.pod:221
4258 "What really happens is that the snippet is evaluated as a Perl expression "
4259 "for each line of the file. The line, including the final C<\\n>, is passed "
4260 "in C<$_> and the expression should update C<$_> or leave it unchanged."
4264 #: ../edit/virt-edit.pod:226
4266 "To delete a line, set C<$_> to the empty string. For example, to delete the "
4267 "C<apache> user account from the password file you can do:"
4271 #: ../edit/virt-edit.pod:229
4274 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
4279 #: ../edit/virt-edit.pod:231
4281 "To insert a line, prepend or append it to C<$_>. However appending lines to "
4282 "the end of the file is rather difficult this way since there is no concept "
4283 "of \"last line of the file\" - your expression just doesn't get called "
4284 "again. You might want to use the first method (setting C<$EDITOR>) if you "
4289 #: ../edit/virt-edit.pod:237
4291 "The variable C<$lineno> contains the current line number. As is "
4292 "traditional, the first line in the file is number C<1>."
4296 #: ../edit/virt-edit.pod:240
4298 "The return value from the expression is ignored, but the expression may call "
4299 "C<die> in order to abort the whole program, leaving the original file "
4304 #: ../edit/virt-edit.pod:244
4306 "Remember when matching the end of a line that C<$_> may contain the final C<"
4307 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
4308 "newline then neither of these. Thus to match or substitute some text at the "
4309 "end of a line, use this regular expression:"
4313 #: ../edit/virt-edit.pod:249
4316 " /some text(\\r?\\n)?$/\n"
4321 #: ../edit/virt-edit.pod:251
4323 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
4324 "$_> itself (since that would remove all newlines from the file):"
4328 #: ../edit/virt-edit.pod:255
4331 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4336 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
4337 msgid "WINDOWS PATHS"
4341 #: ../edit/virt-edit.pod:259
4343 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4344 "paths (eg. C<E:\\foo\\bar.txt>)."
4348 #: ../edit/virt-edit.pod:262
4349 msgid "If and only if the guest is running Windows then:"
4353 #: ../edit/virt-edit.pod:268
4355 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
4356 "to the correct filesystem."
4360 #: ../edit/virt-edit.pod:273
4362 "Any backslash (C<\\>) characters in the path are replaced with forward "
4363 "slashes so that libguestfs can process it."
4367 #: ../edit/virt-edit.pod:278
4369 "The path is resolved case insensitively to locate the file that should be "
4374 #: ../edit/virt-edit.pod:283
4375 msgid "There are some known shortcomings:"
4379 #: ../edit/virt-edit.pod:289
4380 msgid "Some NTFS symbolic links may not be followed correctly."
4384 #: ../edit/virt-edit.pod:293
4385 msgid "NTFS junction points that cross filesystems are not followed."
4389 #: ../edit/virt-edit.pod:299
4391 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4392 "C<virt-edit> doesn't work."
4396 #: ../edit/virt-edit.pod:302
4397 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4401 #: ../edit/virt-edit.pod:304
4404 " guestfish --rw -i -d domname edit /file\n"
4409 #: ../edit/virt-edit.pod:306
4411 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4416 #: ../edit/virt-edit.pod:309
4418 "The command above uses libguestfs's guest inspection feature and so does not "
4419 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4420 "disk images that don't contain guests. To edit a file on a disk image "
4425 #: ../edit/virt-edit.pod:314
4428 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4433 #: ../edit/virt-edit.pod:316
4435 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4436 "the disk image to edit, and C</file> is the full path to the file."
4440 #: ../edit/virt-edit.pod:320
4442 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4443 "C<write> or C<upload> instead:"
4447 #: ../edit/virt-edit.pod:323
4450 " guestfish --rw -i -d domname touch /newfile\n"
4455 #: ../edit/virt-edit.pod:325
4458 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4463 #: ../edit/virt-edit.pod:327
4466 " guestfish --rw -i -d domname upload localfile /newfile\n"
4471 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119
4472 #: ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232
4473 #: ../src/guestfs.pod:3194 ../test-tool/libguestfs-test-tool.pod:95
4474 msgid "ENVIRONMENT VARIABLES"
4478 #: ../edit/virt-edit.pod:333
4483 #: ../edit/virt-edit.pod:335
4485 "If set, this string is used as the editor. It may contain arguments, eg. C<"
4490 #: ../edit/virt-edit.pod:338
4491 msgid "If not set, C<vi> is used."
4495 #: ../edit/virt-edit.pod:356
4497 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
4498 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
4499 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4503 #: ../erlang/examples/guestfs-erlang.pod:5
4504 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4508 #: ../erlang/examples/guestfs-erlang.pod:9
4511 " {ok, G} = guestfs:create(),\n"
4512 " ok = guestfs:add_drive_opts(G, Disk,\n"
4513 " [{format, \"raw\"}, {readonly, true}]),\n"
4514 " ok = guestfs:launch(G),\n"
4515 " [Device] = guestfs:list_devices(G),\n"
4516 " ok = guestfs:close(G).\n"
4521 #: ../erlang/examples/guestfs-erlang.pod:18
4523 "This manual page documents how to call libguestfs from the Erlang "
4524 "programming language. This page just documents the differences from the C "
4525 "API and gives some examples. If you are not familiar with using libguestfs, "
4526 "you also need to read L<guestfs(3)>."
4530 #: ../erlang/examples/guestfs-erlang.pod:23
4531 msgid "OPENING AND CLOSING THE HANDLE"
4535 #: ../erlang/examples/guestfs-erlang.pod:25
4537 "The Erlang bindings are implemented using an external program called C<erl-"
4538 "guestfs>. This program must be on the current PATH, or else you should "
4539 "specify the full path to the program:"
4543 #: ../erlang/examples/guestfs-erlang.pod:29
4546 " {ok, G} = guestfs:create().\n"
4551 #: ../erlang/examples/guestfs-erlang.pod:31
4554 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4559 #: ../erlang/examples/guestfs-erlang.pod:33
4560 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4564 #: ../erlang/examples/guestfs-erlang.pod:36
4565 msgid "To close the handle:"
4569 #: ../erlang/examples/guestfs-erlang.pod:38
4572 " ok = guestfs:close(G).\n"
4577 #: ../erlang/examples/guestfs-erlang.pod:40
4578 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4582 #: ../erlang/examples/guestfs-erlang.pod:42
4584 "For functions that take optional arguments, the first arguments are the non-"
4585 "optional ones. The last argument is a list of tuples supplying the "
4586 "remaining optional arguments."
4590 #: ../erlang/examples/guestfs-erlang.pod:46
4593 " ok = guestfs:add_drive_opts(G, Disk,\n"
4594 " [{format, \"raw\"}, {readonly, true}]).\n"
4599 #: ../erlang/examples/guestfs-erlang.pod:49
4600 msgid "If the last argument would be an empty list, you can also omit it:"
4604 #: ../erlang/examples/guestfs-erlang.pod:51
4607 " ok = guestfs:add_drive_opts(G, Disk).\n"
4612 #: ../erlang/examples/guestfs-erlang.pod:53
4613 msgid "RETURN VALUES AND ERRORS"
4617 #: ../erlang/examples/guestfs-erlang.pod:55
4619 "On success, most functions return a C<Result> term (which could be a list, "
4620 "string, tuple etc.). If there is nothing for the function to return, then "
4621 "the atom C<ok> is returned."
4625 #: ../erlang/examples/guestfs-erlang.pod:59
4626 msgid "On error, you would see one of the following tuples:"
4630 #: ../erlang/examples/guestfs-erlang.pod:63
4631 msgid "C<{error, Msg, Errno}>"
4635 #: ../erlang/examples/guestfs-erlang.pod:65
4636 msgid "This indicates an ordinary error from the function."
4640 #: ../erlang/examples/guestfs-erlang.pod:67
4642 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4647 #: ../erlang/examples/guestfs-erlang.pod:70
4648 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4652 #: ../erlang/examples/guestfs-erlang.pod:72
4653 msgid "C<{unknown, Function}>"
4657 #: ../erlang/examples/guestfs-erlang.pod:74
4659 "This indicates that the function you called is not known. Generally this "
4660 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4661 "which you should not do."
4665 #: ../erlang/examples/guestfs-erlang.pod:78
4666 msgid "C<Function> is the name of the unknown function."
4670 #: ../erlang/examples/guestfs-erlang.pod:80
4671 msgid "C<{unknownarg, Arg}>"
4675 #: ../erlang/examples/guestfs-erlang.pod:82
4677 "This indicates that you called a function with optional arguments, with an "
4678 "unknown argument name."
4682 #: ../erlang/examples/guestfs-erlang.pod:85
4683 msgid "C<Arg> is the name of the unknown argument."
4687 #: ../erlang/examples/guestfs-erlang.pod:89
4688 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
4689 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
4690 #: ../python/examples/guestfs-python.pod:34
4691 #: ../ruby/examples/guestfs-ruby.pod:28
4692 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4696 #: ../erlang/examples/guestfs-erlang.pod:91
4697 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
4698 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
4699 #: ../python/examples/guestfs-python.pod:36
4700 #: ../ruby/examples/guestfs-ruby.pod:30
4705 #: ../erlang/examples/guestfs-erlang.pod:93
4706 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
4707 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
4708 #: ../python/examples/guestfs-python.pod:38
4709 #: ../ruby/examples/guestfs-ruby.pod:32
4710 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4714 #: ../erlang/examples/guestfs-erlang.pod:95
4715 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
4716 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
4717 #: ../python/examples/guestfs-python.pod:40
4718 #: ../ruby/examples/guestfs-ruby.pod:34
4723 #: ../erlang/examples/guestfs-erlang.pod:99
4725 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4726 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4727 "L<guestfs-ruby(3)>, L<http://www.erlang.org/>. L<http://libguestfs.org/>."
4731 #: ../erlang/examples/guestfs-erlang.pod:110
4732 #: ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397
4733 #: ../fish/guestfish.pod:1296 ../fish/virt-copy-in.pod:60
4734 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
4735 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:328
4736 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58
4737 #: ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52
4738 #: ../python/examples/guestfs-python.pod:54
4739 #: ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3333
4740 #: ../test-tool/libguestfs-test-tool.pod:106
4745 #: ../erlang/examples/guestfs-erlang.pod:112
4746 #: ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399
4747 #: ../fish/guestfish.pod:1298 ../fish/virt-copy-in.pod:62
4748 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
4749 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:330
4750 #: ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93
4751 #: ../perl/examples/guestfs-perl.pod:54
4752 #: ../python/examples/guestfs-python.pod:56
4753 #: ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3335
4754 #: ../test-tool/libguestfs-test-tool.pod:108
4755 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4759 #: ../erlang/examples/guestfs-erlang.pod:116
4760 #: ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4761 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4765 #: ../erlang/examples/guestfs-erlang.pod:118
4766 #: ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405
4767 #: ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99
4768 #: ../perl/examples/guestfs-perl.pod:60
4769 #: ../python/examples/guestfs-python.pod:62
4770 #: ../ruby/examples/guestfs-ruby.pod:56
4772 "The examples in this manual page may be freely copied, modified and "
4773 "distributed without any restrictions."
4777 #: ../erlang/examples/guestfs-erlang.pod:121
4778 #: ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408
4779 #: ../java/examples/guestfs-java.pod:69
4780 #: ../ocaml/examples/guestfs-ocaml.pod:102
4781 #: ../perl/examples/guestfs-perl.pod:63
4782 #: ../python/examples/guestfs-python.pod:65
4783 #: ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3342
4785 "This library is free software; you can redistribute it and/or modify it "
4786 "under the terms of the GNU Lesser General Public License as published by the "
4787 "Free Software Foundation; either version 2 of the License, or (at your "
4788 "option) any later version."
4792 #: ../erlang/examples/guestfs-erlang.pod:126
4793 #: ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413
4794 #: ../java/examples/guestfs-java.pod:74
4795 #: ../ocaml/examples/guestfs-ocaml.pod:107
4796 #: ../perl/examples/guestfs-perl.pod:68
4797 #: ../python/examples/guestfs-python.pod:70
4798 #: ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3347
4800 "This library is distributed in the hope that it will be useful, but WITHOUT "
4801 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4802 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4807 #: ../erlang/examples/guestfs-erlang.pod:131
4808 #: ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418
4809 #: ../java/examples/guestfs-java.pod:79
4810 #: ../ocaml/examples/guestfs-ocaml.pod:112
4811 #: ../perl/examples/guestfs-perl.pod:73
4812 #: ../python/examples/guestfs-python.pod:75
4813 #: ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3352
4815 "You should have received a copy of the GNU Lesser General Public License "
4816 "along with this library; if not, write to the Free Software Foundation, "
4817 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4821 #: ../examples/guestfs-examples.pod:5
4822 msgid "guestfs-examples - Examples of using libguestfs from C"
4826 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4829 " #include <guestfs.h>\n"
4831 msgstr "#include <guestfs.h>\n"
4834 #: ../examples/guestfs-examples.pod:11
4837 " guestfs_h *g = guestfs_create ();\n"
4838 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4839 " guestfs_launch (g);\n"
4844 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4847 " cc prog.c -o prog -lguestfs\n"
4849 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4852 " cc prog.c -o prog -lguestfs\n"
4854 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4858 #: ../examples/guestfs-examples.pod:21
4860 "This manual page contains examples of calling libguestfs from the C "
4861 "programming language. If you are not familiar with using libguestfs, you "
4862 "also need to read L<guestfs(3)>."
4866 #: ../examples/guestfs-examples.pod:35
4868 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4869 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4870 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4874 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97
4875 #: ../python/examples/guestfs-python.pod:60
4876 #: ../ruby/examples/guestfs-ruby.pod:54
4877 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4881 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4886 #: ../examples/guestfs-recipes.pod:5
4888 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4889 "here. The only way which works for both sorts of output is to just write "
4890 "the URL directly. Do NOT use L<...> for URLs."
4894 #: ../examples/guestfs-recipes.pod:9
4896 "We break with tradition here and don't use ALL CAPS for the section "
4897 "headings, as this makes them much easier to read."
4901 #: ../examples/guestfs-recipes.pod:16
4902 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4906 #: ../examples/guestfs-recipes.pod:20
4908 "This page contains recipes for and links to things you can do using "
4909 "libguestfs, L<guestfish(1)> and the virt tools."
4913 #: ../examples/guestfs-recipes.pod:23
4914 msgid "Audit a virtual machine for setuid files"
4918 #: ../examples/guestfs-recipes.pod:25
4920 "The link below contains a small program which can be used to audit a Linux "
4921 "virtual machine to see what setuid and setgid files it contains."
4925 #: ../examples/guestfs-recipes.pod:28
4927 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
4932 #: ../examples/guestfs-recipes.pod:30
4933 msgid "Change the background image in a Windows XP VM"
4937 #: ../examples/guestfs-recipes.pod:32
4939 "The links below explain how to use L<guestfish(1)> to change the background "
4940 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4941 "be substantially different for each version of Windows."
4945 #: ../examples/guestfs-recipes.pod:37
4947 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
4948 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4952 #: ../examples/guestfs-recipes.pod:40
4953 msgid "Cloning a virtual machine (Linux)"
4957 #: ../examples/guestfs-recipes.pod:42
4959 "The guestfish technique described in the link below works well for most "
4960 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4965 #: ../examples/guestfs-recipes.pod:46
4967 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
4972 #: ../examples/guestfs-recipes.pod:48
4974 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4979 #: ../examples/guestfs-recipes.pod:51
4980 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4984 #: ../examples/guestfs-recipes.pod:53
4985 msgid "Cloning a virtual machine (Windows)"
4989 #: ../examples/guestfs-recipes.pod:55
4991 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4992 "straightforward. Currently there is code in the Aeolus Oz project which "
4993 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4994 "we may add sysprepping ability."
4998 #: ../examples/guestfs-recipes.pod:60
5000 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
5001 "list/2011-May/msg00019.html"
5005 #: ../examples/guestfs-recipes.pod:63
5006 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
5010 #: ../examples/guestfs-recipes.pod:65
5011 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
5015 #: ../examples/guestfs-recipes.pod:67
5018 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
5023 #: ../examples/guestfs-recipes.pod:69
5024 msgid "To export just a subdirectory, eg. C</files>, do:"
5028 #: ../examples/guestfs-recipes.pod:71
5031 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
5036 #: ../examples/guestfs-recipes.pod:73
5037 msgid "Create empty disk images"
5041 #: ../examples/guestfs-recipes.pod:75
5043 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
5044 "The useful guide below explains the options available."
5048 #: ../examples/guestfs-recipes.pod:78
5050 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
5055 #: ../examples/guestfs-recipes.pod:80
5056 msgid "Dump raw filesystem content from inside a disk image or VM"
5060 #: ../examples/guestfs-recipes.pod:82
5062 "You can use the L<guestfish(1)> C<download> command to extract the raw "
5063 "filesystem content from any filesystem in a disk image or a VM (even one "
5064 "which is encrypted or buried inside an LV):"
5068 #: ../examples/guestfs-recipes.pod:86
5071 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
5076 #: ../examples/guestfs-recipes.pod:88
5079 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
5084 #: ../examples/guestfs-recipes.pod:90
5085 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
5089 #: ../examples/guestfs-recipes.pod:92
5090 msgid "Edit grub configuration in a VM"
5094 #: ../examples/guestfs-recipes.pod:94
5095 msgid "You can use this to:"
5099 #: ../examples/guestfs-recipes.pod:100
5100 msgid "Fix a virtual machine that does not boot."
5104 #: ../examples/guestfs-recipes.pod:104
5105 msgid "Change which kernel is used to boot the VM."
5109 #: ../examples/guestfs-recipes.pod:108
5110 msgid "Change kernel command line options."
5114 #: ../examples/guestfs-recipes.pod:112
5115 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
5119 #: ../examples/guestfs-recipes.pod:114
5122 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
5127 #: ../examples/guestfs-recipes.pod:116
5129 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
5134 #: ../examples/guestfs-recipes.pod:119
5137 " virt-rescue -d BrokenGuest\n"
5142 #: ../examples/guestfs-recipes.pod:121
5143 msgid "Export any directory from a VM"
5147 #: ../examples/guestfs-recipes.pod:123
5149 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
5153 #: ../examples/guestfs-recipes.pod:126
5156 " virt-copy-out -d Guest /home .\n"
5161 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
5162 #: ../fish/guestfish-actions.pod:1332 ../fish/guestfish-actions.pod:1597
5163 #: ../fish/guestfish-actions.pod:2014 ../src/guestfs-actions.pod:18
5164 #: ../src/guestfs-actions.pod:2039 ../src/guestfs-actions.pod:2463
5165 #: ../src/guestfs-actions.pod:3022 ../src/guestfs.pod:1670
5166 #: ../tools/virt-win-reg.pl:706
5171 #: ../examples/guestfs-recipes.pod:134
5173 "The final dot of the command is not a printing error. It means we want to "
5174 "copy out to the current directory."
5178 #: ../examples/guestfs-recipes.pod:139
5179 msgid "This creates a directory called C<home> under the current directory."
5183 #: ../examples/guestfs-recipes.pod:143
5185 "If the guest is a Windows guest then you can use drive letters and "
5186 "backslashes, but you must prefix the path with C<win:> and quote it to "
5187 "protect it from the shell, like this:"
5191 #: ../examples/guestfs-recipes.pod:147
5194 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
5199 #: ../examples/guestfs-recipes.pod:149
5200 msgid "To get the output as a compressed tarball, do:"
5204 #: ../examples/guestfs-recipes.pod:151
5207 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
5212 #: ../examples/guestfs-recipes.pod:153
5214 "Although it sounds tempting, this is usually not a reliable way to get a "
5215 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
5216 "org/FAQ.html#backup"
5220 #: ../examples/guestfs-recipes.pod:157
5221 msgid "Find out which user is using the most space"
5225 #: ../examples/guestfs-recipes.pod:159
5227 "This simple script examines a Linux guest to find out which user is using "
5228 "the most space in their home directory:"
5232 #: ../examples/guestfs-recipes.pod:162
5240 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
5248 #: ../examples/guestfs-recipes.pod:166
5257 #: ../examples/guestfs-recipes.pod:169
5260 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
5265 #: ../examples/guestfs-recipes.pod:171
5268 " for d in $(guestfish --remote ls \"$dir\"); do\n"
5269 " echo -n \"$dir/$d\"\n"
5271 " guestfish --remote du \"$dir/$d\";\n"
5272 " done | sort -nr -k 2\n"
5277 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
5280 " guestfish --remote exit\n"
5285 #: ../examples/guestfs-recipes.pod:179
5286 msgid "Get DHCP address from a VM"
5290 #: ../examples/guestfs-recipes.pod:181
5292 "The link below explains the many different possible techniques for getting "
5293 "the last assigned DHCP address of a virtual machine."
5297 #: ../examples/guestfs-recipes.pod:184
5299 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
5300 "a-virtual-machine-disk-image/#content"
5304 #: ../examples/guestfs-recipes.pod:186
5306 "In the libguestfs source examples directory you will find the latest version "
5307 "of the C<virt-dhcp-address.c> program."
5311 #: ../examples/guestfs-recipes.pod:189
5312 msgid "Get the operating system product name string"
5316 #: ../examples/guestfs-recipes.pod:191
5317 msgid "Save the following script into a file called C<product-name.sh>:"
5321 #: ../examples/guestfs-recipes.pod:193
5326 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5327 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5328 " guestfish --remote inspect-get-product-name \"$root\"\n"
5329 " guestfish --remote exit\n"
5334 #: ../examples/guestfs-recipes.pod:200
5335 msgid "Make the script executable and run it on a named guest:"
5339 #: ../examples/guestfs-recipes.pod:202
5342 " # product-name.sh RHEL60x64\n"
5343 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
5348 #: ../examples/guestfs-recipes.pod:205
5350 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
5351 "C<xpath> command line tool or from your favourite programming language:"
5355 #: ../examples/guestfs-recipes.pod:209
5358 " # virt-inspector RHEL60x64 > xml\n"
5359 " # xpath '//product_name' < xml\n"
5362 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
5367 #: ../examples/guestfs-recipes.pod:215
5368 msgid "Get the default boot kernel for a Linux VM"
5372 #: ../examples/guestfs-recipes.pod:217
5374 "The link below contains a program to print the default boot kernel for a "
5379 #: ../examples/guestfs-recipes.pod:220
5381 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
5382 "kernel-for-a-vm/#content"
5386 #: ../examples/guestfs-recipes.pod:222
5388 "It uses Augeas, and the technique is generally applicable for many different "
5393 #: ../examples/guestfs-recipes.pod:229
5394 msgid "listing the user accounts in the guest"
5398 #: ../examples/guestfs-recipes.pod:233
5399 msgid "what repositories is it configured to use"
5403 #: ../examples/guestfs-recipes.pod:237
5404 msgid "what NTP servers does it connect to"
5408 #: ../examples/guestfs-recipes.pod:241
5409 msgid "what were the boot messages last time it booted"
5413 #: ../examples/guestfs-recipes.pod:245
5414 msgid "listing who was logged in recently"
5418 #: ../examples/guestfs-recipes.pod:249
5419 msgid "http://augeas.net/"
5423 #: ../examples/guestfs-recipes.pod:251
5424 msgid "Install RPMs in a guest"
5428 #: ../examples/guestfs-recipes.pod:253
5430 "The link below contains a method to install RPMs in a guest. In fact the "
5431 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
5432 "installs them next time the guest is booted. You could use this technique "
5433 "to install vital security updates in an offline guest."
5437 #: ../examples/guestfs-recipes.pod:259
5439 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
5443 #: ../examples/guestfs-recipes.pod:261
5444 msgid "List applications installed in a VM"
5448 #: ../examples/guestfs-recipes.pod:263
5449 msgid "Save the following to a file C<list-apps.sh>:"
5453 #: ../examples/guestfs-recipes.pod:265
5458 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5459 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5460 " guestfish --remote inspect-list-applications \"$root\"\n"
5461 " guestfish --remote exit\n"
5466 #: ../examples/guestfs-recipes.pod:272
5468 "Make the file executable and then you can run it on any named virtual "
5473 #: ../examples/guestfs-recipes.pod:275
5476 " # list-apps.sh WinGuest\n"
5478 " app_name: Mozilla Firefox (3.6.12)\n"
5479 " app_display_name: Mozilla Firefox (3.6.12)\n"
5481 " app_version: 3.6.12 (en-GB)\n"
5483 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5484 " app_trans_path:\n"
5485 " app_publisher: Mozilla\n"
5486 " app_url: http://www.mozilla.com/en-GB/\n"
5487 " app_source_package:\n"
5489 " app_description: Mozilla Firefox\n"
5492 " app_name: VLC media player\n"
5493 " app_display_name: VLC media player 1.1.5\n"
5495 " app_version: 1.1.5\n"
5497 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5498 " app_trans_path:\n"
5499 " app_publisher: VideoLAN\n"
5500 " app_url: http://www.videolan.org/\n"
5501 " app_source_package:\n"
5503 " app_description:\n"
5509 #: ../examples/guestfs-recipes.pod:305
5511 "If you want to run the script on disk images (instead of libvirt virtual "
5512 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
5517 #: ../examples/guestfs-recipes.pod:309
5518 msgid "List files and directories in a VM"
5522 #: ../examples/guestfs-recipes.pod:311
5523 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5527 #: ../examples/guestfs-recipes.pod:313
5530 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5535 #: ../examples/guestfs-recipes.pod:315
5536 msgid "List services in a Windows VM"
5540 #: ../examples/guestfs-recipes.pod:317
5542 "The link below contains a script that can be used to list out the services "
5543 "from a Windows VM, and whether those services run at boot time or are loaded "
5548 #: ../examples/guestfs-recipes.pod:321
5550 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
5555 #: ../examples/guestfs-recipes.pod:323
5556 msgid "Make a disk image sparse"
5560 #: ../examples/guestfs-recipes.pod:325
5562 "The link below contains some guides for making a disk image sparse (or "
5563 "reintroducing sparseness)."
5567 #: ../examples/guestfs-recipes.pod:328
5569 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5573 #: ../examples/guestfs-recipes.pod:330
5574 msgid "Monitor disk usage over time"
5578 #: ../examples/guestfs-recipes.pod:332
5580 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5581 "The link below contains a guide."
5585 #: ../examples/guestfs-recipes.pod:335
5586 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5590 #: ../examples/guestfs-recipes.pod:337
5591 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5595 #: ../examples/guestfs-recipes.pod:339
5597 "L<guestfish(1)> plus the tools described in the link below can be used to "
5598 "read out the Windows Event Log from any virtual machine running Windows "
5599 "Vista or a later version."
5603 #: ../examples/guestfs-recipes.pod:343
5605 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
5606 "guestfish/#content"
5610 #: ../examples/guestfs-recipes.pod:345
5611 msgid "Remove root password (Linux)"
5615 #: ../examples/guestfs-recipes.pod:347
5617 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5618 "files. One use is to remove the root password from a Linux guest:"
5622 #: ../examples/guestfs-recipes.pod:350
5625 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5630 #: ../examples/guestfs-recipes.pod:352
5631 msgid "Remove Administrator password (Windows)"
5635 #: ../examples/guestfs-recipes.pod:354
5637 "The link below contains one technique for removing the Administrator "
5638 "password from a Windows VM, or to be more precise, it gives you a command "
5639 "prompt the next time you log in which you can use to bypass any security:"
5643 #: ../examples/guestfs-recipes.pod:359
5645 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
5646 "administrator-password-with-guestfish/"
5650 #: ../examples/guestfs-recipes.pod:361
5651 msgid "Unpack a live CD"
5655 #: ../examples/guestfs-recipes.pod:363
5657 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5658 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5659 "layers, as outlined in the guide below."
5663 #: ../examples/guestfs-recipes.pod:367
5665 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
5670 #: ../examples/guestfs-recipes.pod:369
5671 msgid "Uploading and downloading files"
5675 #: ../examples/guestfs-recipes.pod:371
5677 "The link below contains general tips on uploading (copying in) and "
5678 "downloading (copying out) files from VMs."
5682 #: ../examples/guestfs-recipes.pod:374
5684 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5688 #: ../examples/guestfs-recipes.pod:376
5689 msgid "Use libguestfs tools on VMware ESX guests"
5693 #: ../examples/guestfs-recipes.pod:378
5695 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5696 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5700 #: ../examples/guestfs-recipes.pod:382
5702 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
5707 #: ../examples/guestfs-recipes.pod:386
5709 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)"
5710 ">, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
5711 "python(3)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
5715 #: ../examples/guestfs-recipes.pod:403
5716 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5720 #: ../fish/guestfish-actions.pod:1
5725 #: ../fish/guestfish-actions.pod:3
5728 " add-cdrom filename\n"
5733 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5734 msgid "This function adds a virtual CD-ROM disk image to the guest."
5738 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5739 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5743 #: ../fish/guestfish-actions.pod:15
5745 "This call checks for the existence of C<filename>. This stops you from "
5746 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5747 "and C<http:> URLs. To specify those, use the general L</config> call "
5752 #: ../fish/guestfish-actions.pod:22
5754 "If you just want to add an ISO file (often you use this as an efficient way "
5755 "to transfer large files into the guest), then you should probably use L</add-"
5756 "drive-ro> instead."
5760 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:168
5761 #: ../fish/guestfish-actions.pod:182
5763 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5768 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:171
5769 #: ../fish/guestfish-actions.pod:185 ../fish/guestfish-actions.pod:1031
5770 #: ../fish/guestfish-actions.pod:1391 ../fish/guestfish-actions.pod:1405
5771 #: ../fish/guestfish-actions.pod:3175 ../fish/guestfish-actions.pod:3486
5772 #: ../fish/guestfish-actions.pod:3534 ../fish/guestfish-actions.pod:4447
5773 #: ../fish/guestfish-actions.pod:4470 ../fish/guestfish-actions.pod:4492
5774 #: ../fish/guestfish-actions.pod:4530 ../fish/guestfish-actions.pod:5179
5775 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:10
5776 #: ../src/guestfs-actions.pod:258 ../src/guestfs-actions.pod:279
5777 #: ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:2124
5778 #: ../src/guestfs-actions.pod:2145 ../src/guestfs-actions.pod:4790
5779 #: ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5412
5780 #: ../src/guestfs-actions.pod:6694 ../src/guestfs-actions.pod:6738
5781 #: ../src/guestfs-actions.pod:6772 ../src/guestfs-actions.pod:6835
5782 #: ../src/guestfs-actions.pod:7767 ../src/guestfs-actions.pod:7876
5783 #: ../src/guestfs-actions.pod:8059
5785 "Deprecated functions will not be removed from the API, but the fact that "
5786 "they are deprecated indicates that there are problems with correct use of "
5791 #: ../fish/guestfish-actions.pod:35
5796 #: ../fish/guestfish-actions.pod:37
5801 #: ../fish/guestfish-actions.pod:39
5804 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
5809 #: ../fish/guestfish-actions.pod:41
5811 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5812 "It works by connecting to libvirt, requesting the domain and domain XML from "
5813 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5817 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5819 "The number of disks added is returned. This operation is atomic: if an "
5820 "error is returned, then no disks are added."
5824 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5826 "This function does some minimal checks to make sure the libvirt domain is "
5827 "not running (unless C<readonly> is true). In a future version we will try "
5828 "to acquire the libvirt lock on each disk."
5832 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5834 "Disks must be accessible locally. This often means that adding disks from a "
5835 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5836 "unless those disks are accessible via the same device path locally too."
5840 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5842 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
5843 "libvirt.org/uri.html>). If this is not set then we connect to the default "
5844 "libvirt URI (or one set through an environment variable, see the libvirt "
5845 "documentation for full details)."
5849 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5851 "The optional C<live> flag controls whether this call will try to connect to "
5852 "a running virtual machine C<guestfsd> process if it sees a suitable "
5853 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5854 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5855 "DAEMONS> for more information."
5859 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5861 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5862 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5863 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5868 #: ../fish/guestfish-actions.pod:76
5870 "The other optional parameters are passed directly through to L</add-drive-"
5875 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:148
5876 #: ../fish/guestfish-actions.pod:578 ../fish/guestfish-actions.pod:789
5877 #: ../fish/guestfish-actions.pod:810 ../fish/guestfish-actions.pod:2053
5878 #: ../fish/guestfish-actions.pod:3224 ../fish/guestfish-actions.pod:3387
5879 #: ../fish/guestfish-actions.pod:3522
5881 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
5885 #: ../fish/guestfish-actions.pod:81
5890 #: ../fish/guestfish-actions.pod:83
5893 " add-drive filename\n"
5898 #: ../fish/guestfish-actions.pod:85
5900 "This function is the equivalent of calling L</add-drive-opts> with no "
5901 "optional parameters, so the disk is added writable, with the format being "
5902 "detected automatically."
5906 #: ../fish/guestfish-actions.pod:89
5908 "Automatic detection of the format opens you up to a potential security hole "
5909 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5910 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5911 "you should think about replacing calls to this function with calls to L</add-"
5912 "drive-opts>, and specifying the format."
5916 #: ../fish/guestfish-actions.pod:96
5917 msgid "add-drive-opts"
5921 #: ../fish/guestfish-actions.pod:98
5926 #: ../fish/guestfish-actions.pod:100
5929 " add-drive-opts filename [readonly:..] [format:..] [iface:..] [name:..]\n"
5934 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:161
5936 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5937 "The first time you call this function, the disk appears as C</dev/sda>, the "
5938 "second time as C</dev/sdb>, and so on."
5942 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:166
5944 "You don't necessarily need to be root when using libguestfs. However you "
5945 "obviously do need sufficient permissions to access the filename for whatever "
5946 "operations you want to perform (ie. read access if you just want to read the "
5947 "image or write access if you want to modify the image)."
5951 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:172
5952 msgid "This call checks that C<filename> exists."
5956 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3186
5957 #: ../src/guestfs-actions.pod:174 ../src/guestfs-actions.pod:4827
5958 msgid "The optional arguments are:"
5962 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:178
5967 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:180
5969 "If true then the image is treated as read-only. Writes are still allowed, "
5970 "but they are stored in a temporary snapshot overlay which is discarded at "
5971 "the end. The disk that you add is not modified."
5975 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:184
5980 #: ../fish/guestfish-actions.pod:127
5982 "This forces the image format. If you omit this (or use L</add-drive> or L</"
5983 "add-drive-ro>) then the format is automatically detected. Possible formats "
5984 "include C<raw> and C<qcow2>."
5988 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:190
5990 "Automatic detection of the format opens you up to a potential security hole "
5991 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5992 "RHBZ#642934. Specifying the format closes this security hole."
5996 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:195
6001 #: ../fish/guestfish-actions.pod:138
6003 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
6004 "add-drive-with-if> call (q.v.)"
6008 #: ../fish/guestfish-actions.pod:141 ../src/guestfs-actions.pod:200
6013 #: ../fish/guestfish-actions.pod:143 ../src/guestfs-actions.pod:202
6015 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
6016 "a hint to the guest inspection process if it is available."
6020 #: ../fish/guestfish-actions.pod:150
6021 msgid "add-drive-ro"
6025 #: ../fish/guestfish-actions.pod:152
6030 #: ../fish/guestfish-actions.pod:154
6033 " add-drive-ro filename\n"
6038 #: ../fish/guestfish-actions.pod:156
6040 "This function is the equivalent of calling L</add-drive-opts> with the "
6041 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
6042 "is added read-only, with the format being detected automatically."
6046 #: ../fish/guestfish-actions.pod:161
6047 msgid "add-drive-ro-with-if"
6051 #: ../fish/guestfish-actions.pod:163
6054 " add-drive-ro-with-if filename iface\n"
6059 #: ../fish/guestfish-actions.pod:165
6061 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
6062 "interface emulation to use at run time."
6066 #: ../fish/guestfish-actions.pod:175
6067 msgid "add-drive-with-if"
6071 #: ../fish/guestfish-actions.pod:177
6074 " add-drive-with-if filename iface\n"
6079 #: ../fish/guestfish-actions.pod:179
6081 "This is the same as L</add-drive> but it allows you to specify the QEMU "
6082 "interface emulation to use at run time."
6086 #: ../fish/guestfish-actions.pod:189
6091 #: ../fish/guestfish-actions.pod:191
6094 " aug-clear augpath\n"
6099 #: ../fish/guestfish-actions.pod:193 ../src/guestfs-actions.pod:296
6101 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6102 "L<augtool(1)> C<clear> command."
6106 #: ../fish/guestfish-actions.pod:196
6111 #: ../fish/guestfish-actions.pod:198
6119 #: ../fish/guestfish-actions.pod:200
6121 "Close the current Augeas handle and free up any resources used by it. After "
6122 "calling this, you have to call L</aug-init> again before you can use any "
6123 "other Augeas functions."
6127 #: ../fish/guestfish-actions.pod:205
6132 #: ../fish/guestfish-actions.pod:207
6135 " aug-defnode name expr val\n"
6140 #: ../fish/guestfish-actions.pod:209 ../src/guestfs-actions.pod:325
6142 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6146 #: ../fish/guestfish-actions.pod:212
6148 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6149 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
6150 "containing that single node."
6154 #: ../fish/guestfish-actions.pod:216 ../src/guestfs-actions.pod:332
6156 "On success this returns a pair containing the number of nodes in the "
6157 "nodeset, and a boolean flag if a node was created."
6161 #: ../fish/guestfish-actions.pod:220
6166 #: ../fish/guestfish-actions.pod:222
6169 " aug-defvar name expr\n"
6174 #: ../fish/guestfish-actions.pod:224 ../src/guestfs-actions.pod:349
6176 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6177 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6181 #: ../fish/guestfish-actions.pod:228 ../src/guestfs-actions.pod:353
6183 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6184 "evaluates to something which is not a nodeset."
6188 #: ../fish/guestfish-actions.pod:231
6193 #: ../fish/guestfish-actions.pod:233
6196 " aug-get augpath\n"
6201 #: ../fish/guestfish-actions.pod:235 ../src/guestfs-actions.pod:366
6203 "Look up the value associated with C<path>. If C<path> matches exactly one "
6204 "node, the C<value> is returned."
6208 #: ../fish/guestfish-actions.pod:238
6213 #: ../fish/guestfish-actions.pod:240
6216 " aug-init root flags\n"
6221 #: ../fish/guestfish-actions.pod:242 ../src/guestfs-actions.pod:381
6223 "Create a new Augeas handle for editing configuration files. If there was "
6224 "any previous Augeas handle associated with this guestfs session, then it is "
6229 #: ../fish/guestfish-actions.pod:246
6230 msgid "You must call this before using any other L</aug-*> commands."
6234 #: ../fish/guestfish-actions.pod:249 ../src/guestfs-actions.pod:388
6236 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6240 #: ../fish/guestfish-actions.pod:252 ../src/guestfs-actions.pod:391
6242 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6243 "logical I<or> of the following integers:"
6247 #: ../fish/guestfish-actions.pod:258 ../src/guestfs-actions.pod:397
6248 msgid "C<AUG_SAVE_BACKUP> = 1"
6252 #: ../fish/guestfish-actions.pod:260 ../src/guestfs-actions.pod:399
6253 msgid "Keep the original file with a C<.augsave> extension."
6257 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:401
6258 msgid "C<AUG_SAVE_NEWFILE> = 2"
6262 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:403
6264 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6265 "original. Overrides C<AUG_SAVE_BACKUP>."
6269 #: ../fish/guestfish-actions.pod:267 ../src/guestfs-actions.pod:406
6270 msgid "C<AUG_TYPE_CHECK> = 4"
6274 #: ../fish/guestfish-actions.pod:269 ../src/guestfs-actions.pod:408
6275 msgid "Typecheck lenses."
6279 #: ../fish/guestfish-actions.pod:271
6281 "This option is only useful when debugging Augeas lenses. Use of this option "
6282 "may require additional memory for the libguestfs appliance. You may need to "
6283 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
6287 #: ../fish/guestfish-actions.pod:276 ../src/guestfs-actions.pod:415
6288 msgid "C<AUG_NO_STDINC> = 8"
6292 #: ../fish/guestfish-actions.pod:278 ../src/guestfs-actions.pod:417
6293 msgid "Do not use standard load path for modules."
6297 #: ../fish/guestfish-actions.pod:280 ../src/guestfs-actions.pod:419
6298 msgid "C<AUG_SAVE_NOOP> = 16"
6302 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:421
6303 msgid "Make save a no-op, just record what would have been changed."
6307 #: ../fish/guestfish-actions.pod:284 ../src/guestfs-actions.pod:423
6308 msgid "C<AUG_NO_LOAD> = 32"
6312 #: ../fish/guestfish-actions.pod:286
6313 msgid "Do not load the tree in L</aug-init>."
6317 #: ../fish/guestfish-actions.pod:290
6318 msgid "To close the handle, you can call L</aug-close>."
6322 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:431
6323 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6327 #: ../fish/guestfish-actions.pod:294
6332 #: ../fish/guestfish-actions.pod:296
6335 " aug-insert augpath label true|false\n"
6340 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:445
6342 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6343 "or after C<path> (depending on the boolean flag C<before>)."
6347 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:449
6349 "C<path> must match exactly one existing node in the tree, and C<label> must "
6350 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6354 #: ../fish/guestfish-actions.pod:306
6359 #: ../fish/guestfish-actions.pod:308
6367 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:462
6368 msgid "Load files into the tree."
6372 #: ../fish/guestfish-actions.pod:312 ../src/guestfs-actions.pod:464
6373 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6377 #: ../fish/guestfish-actions.pod:315
6382 #: ../fish/guestfish-actions.pod:317
6390 #: ../fish/guestfish-actions.pod:319
6392 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
6393 "resulting nodes into alphabetical order."
6397 #: ../fish/guestfish-actions.pod:322
6402 #: ../fish/guestfish-actions.pod:324
6405 " aug-match augpath\n"
6410 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:492
6412 "Returns a list of paths which match the path expression C<path>. The "
6413 "returned paths are sufficiently qualified so that they match exactly one "
6414 "node in the current tree."
6418 #: ../fish/guestfish-actions.pod:330
6423 #: ../fish/guestfish-actions.pod:332
6426 " aug-mv src dest\n"
6431 #: ../fish/guestfish-actions.pod:334 ../src/guestfs-actions.pod:509
6433 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6434 "C<dest> is overwritten if it exists."
6438 #: ../fish/guestfish-actions.pod:337
6443 #: ../fish/guestfish-actions.pod:339
6451 #: ../fish/guestfish-actions.pod:341 ../src/guestfs-actions.pod:522
6452 msgid "Remove C<path> and all of its children."
6456 #: ../fish/guestfish-actions.pod:343 ../src/guestfs-actions.pod:524
6457 msgid "On success this returns the number of entries which were removed."
6461 #: ../fish/guestfish-actions.pod:345
6466 #: ../fish/guestfish-actions.pod:347
6474 #: ../fish/guestfish-actions.pod:349 ../src/guestfs-actions.pod:535
6475 msgid "This writes all pending changes to disk."
6479 #: ../fish/guestfish-actions.pod:351
6481 "The flags which were passed to L</aug-init> affect exactly how files are "
6486 #: ../fish/guestfish-actions.pod:354
6491 #: ../fish/guestfish-actions.pod:356
6494 " aug-set augpath val\n"
6499 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:551
6500 msgid "Set the value associated with C<path> to C<val>."
6504 #: ../fish/guestfish-actions.pod:360
6506 "In the Augeas API, it is possible to clear a node by setting the value to "
6507 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6508 "this call. Instead you must use the L</aug-clear> call."
6512 #: ../fish/guestfish-actions.pod:365
6517 #: ../fish/guestfish-actions.pod:367
6520 " available 'groups ...'\n"
6525 #: ../fish/guestfish-actions.pod:369 ../src/guestfs-actions.pod:568
6527 "This command is used to check the availability of some groups of "
6528 "functionality in the appliance, which not all builds of the libguestfs "
6529 "appliance will be able to provide."
6533 #: ../fish/guestfish-actions.pod:373
6535 "The libguestfs groups, and the functions that those groups correspond to, "
6536 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6537 "runtime by calling L</available-all-groups>."
6541 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:577
6543 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
6544 "\"]> would check for the availability of the Linux inotify functions and "
6545 "Augeas (configuration file editing) functions."
6549 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:582
6550 msgid "The command returns no error if I<all> requested groups are available."
6554 #: ../fish/guestfish-actions.pod:385 ../src/guestfs-actions.pod:584
6556 "It fails with an error if one or more of the requested groups is unavailable "
6561 #: ../fish/guestfish-actions.pod:388 ../src/guestfs-actions.pod:587
6563 "If an unknown group name is included in the list of groups then an error is "
6568 #: ../fish/guestfish-actions.pod:391 ../src/guestfs-actions.pod:590
6573 #: ../fish/guestfish-actions.pod:397
6574 msgid "You must call L</launch> before calling this function."
6578 #: ../fish/guestfish-actions.pod:399 ../src/guestfs-actions.pod:598
6580 "The reason is because we don't know what groups are supported by the "
6581 "appliance/daemon until it is running and can be queried."
6585 #: ../fish/guestfish-actions.pod:405 ../src/guestfs-actions.pod:604
6587 "If a group of functions is available, this does not necessarily mean that "
6588 "they will work. You still have to check for errors when calling individual "
6589 "API functions even if they are available."
6593 #: ../fish/guestfish-actions.pod:412 ../src/guestfs-actions.pod:611
6595 "It is usually the job of distro packagers to build complete functionality "
6596 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6597 "with all requirements satisfied, will support everything."
6601 #: ../fish/guestfish-actions.pod:419
6603 "This call was added in version C<1.0.80>. In previous versions of "
6604 "libguestfs all you could do would be to speculatively execute a command to "
6605 "find out if the daemon implemented it. See also L</version>."
6609 #: ../fish/guestfish-actions.pod:426
6610 msgid "available-all-groups"
6614 #: ../fish/guestfish-actions.pod:428
6617 " available-all-groups\n"
6622 #: ../fish/guestfish-actions.pod:430
6624 "This command returns a list of all optional groups that this daemon knows "
6625 "about. Note this returns both supported and unsupported groups. To find "
6626 "out which ones the daemon can actually support you have to call L</"
6627 "available> on each member of the returned list."
6631 #: ../fish/guestfish-actions.pod:436
6632 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6636 #: ../fish/guestfish-actions.pod:438
6641 #: ../fish/guestfish-actions.pod:440
6644 " base64-in (base64file|-) filename\n"
6649 #: ../fish/guestfish-actions.pod:442 ../src/guestfs-actions.pod:655
6651 "This command uploads base64-encoded data from C<base64file> to C<filename>."
6655 #: ../fish/guestfish-actions.pod:445 ../fish/guestfish-actions.pod:454
6656 #: ../fish/guestfish-actions.pod:703 ../fish/guestfish-actions.pod:787
6657 #: ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:907
6658 #: ../fish/guestfish-actions.pod:926 ../fish/guestfish-actions.pod:1300
6659 #: ../fish/guestfish-actions.pod:4750 ../fish/guestfish-actions.pod:4762
6660 #: ../fish/guestfish-actions.pod:4773 ../fish/guestfish-actions.pod:4784
6661 #: ../fish/guestfish-actions.pod:4836 ../fish/guestfish-actions.pod:4845
6662 #: ../fish/guestfish-actions.pod:4899 ../fish/guestfish-actions.pod:4922
6663 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6667 #: ../fish/guestfish-actions.pod:447
6672 #: ../fish/guestfish-actions.pod:449
6675 " base64-out filename (base64file|-)\n"
6680 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:669
6682 "This command downloads the contents of C<filename>, writing it out to local "
6683 "file C<base64file> encoded as base64."
6687 #: ../fish/guestfish-actions.pod:456
6688 msgid "blockdev-flushbufs"
6692 #: ../fish/guestfish-actions.pod:458
6695 " blockdev-flushbufs device\n"
6700 #: ../fish/guestfish-actions.pod:460 ../src/guestfs-actions.pod:682
6702 "This tells the kernel to flush internal buffers associated with C<device>."
6706 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:474
6707 #: ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:493
6708 #: ../fish/guestfish-actions.pod:505 ../fish/guestfish-actions.pod:518
6709 #: ../fish/guestfish-actions.pod:526 ../fish/guestfish-actions.pod:537
6710 #: ../fish/guestfish-actions.pod:545 ../fish/guestfish-actions.pod:553
6711 #: ../src/guestfs-actions.pod:685 ../src/guestfs-actions.pod:702
6712 #: ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:733
6713 #: ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:770
6714 #: ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802
6715 #: ../src/guestfs-actions.pod:816 ../src/guestfs-actions.pod:830
6716 msgid "This uses the L<blockdev(8)> command."
6720 #: ../fish/guestfish-actions.pod:465
6721 msgid "blockdev-getbsz"
6725 #: ../fish/guestfish-actions.pod:467
6728 " blockdev-getbsz device\n"
6733 #: ../fish/guestfish-actions.pod:469 ../src/guestfs-actions.pod:697
6734 msgid "This returns the block size of a device."
6738 #: ../fish/guestfish-actions.pod:471 ../fish/guestfish-actions.pod:534
6739 #: ../src/guestfs-actions.pod:699 ../src/guestfs-actions.pod:799
6741 "(Note this is different from both I<size in blocks> and I<filesystem block "
6746 #: ../fish/guestfish-actions.pod:476
6747 msgid "blockdev-getro"
6751 #: ../fish/guestfish-actions.pod:478
6754 " blockdev-getro device\n"
6759 #: ../fish/guestfish-actions.pod:480 ../src/guestfs-actions.pod:714
6761 "Returns a boolean indicating if the block device is read-only (true if read-"
6762 "only, false if not)."
6766 #: ../fish/guestfish-actions.pod:485
6767 msgid "blockdev-getsize64"
6771 #: ../fish/guestfish-actions.pod:487
6774 " blockdev-getsize64 device\n"
6779 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:729
6780 msgid "This returns the size of the device in bytes."
6784 #: ../fish/guestfish-actions.pod:491
6785 msgid "See also L</blockdev-getsz>."
6789 #: ../fish/guestfish-actions.pod:495
6790 msgid "blockdev-getss"
6794 #: ../fish/guestfish-actions.pod:497
6797 " blockdev-getss device\n"
6802 #: ../fish/guestfish-actions.pod:499 ../src/guestfs-actions.pod:745
6804 "This returns the size of sectors on a block device. Usually 512, but can be "
6805 "larger for modern devices."
6809 #: ../fish/guestfish-actions.pod:502
6811 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6815 #: ../fish/guestfish-actions.pod:507
6816 msgid "blockdev-getsz"
6820 #: ../fish/guestfish-actions.pod:509
6823 " blockdev-getsz device\n"
6828 #: ../fish/guestfish-actions.pod:511 ../src/guestfs-actions.pod:763
6830 "This returns the size of the device in units of 512-byte sectors (even if "
6831 "the sectorsize isn't 512 bytes ... weird)."
6835 #: ../fish/guestfish-actions.pod:514
6837 "See also L</blockdev-getss> for the real sector size of the device, and L</"
6838 "blockdev-getsize64> for the more useful I<size in bytes>."
6842 #: ../fish/guestfish-actions.pod:520
6843 msgid "blockdev-rereadpt"
6847 #: ../fish/guestfish-actions.pod:522
6850 " blockdev-rereadpt device\n"
6855 #: ../fish/guestfish-actions.pod:524 ../src/guestfs-actions.pod:782
6856 msgid "Reread the partition table on C<device>."
6860 #: ../fish/guestfish-actions.pod:528
6861 msgid "blockdev-setbsz"
6865 #: ../fish/guestfish-actions.pod:530
6868 " blockdev-setbsz device blocksize\n"
6873 #: ../fish/guestfish-actions.pod:532 ../src/guestfs-actions.pod:797
6874 msgid "This sets the block size of a device."
6878 #: ../fish/guestfish-actions.pod:539
6879 msgid "blockdev-setro"
6883 #: ../fish/guestfish-actions.pod:541
6886 " blockdev-setro device\n"
6891 #: ../fish/guestfish-actions.pod:543 ../src/guestfs-actions.pod:814
6892 msgid "Sets the block device named C<device> to read-only."
6896 #: ../fish/guestfish-actions.pod:547
6897 msgid "blockdev-setrw"
6901 #: ../fish/guestfish-actions.pod:549
6904 " blockdev-setrw device\n"
6909 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:828
6910 msgid "Sets the block device named C<device> to read-write."
6914 #: ../fish/guestfish-actions.pod:555
6915 msgid "btrfs-filesystem-resize"
6919 #: ../fish/guestfish-actions.pod:557
6922 " btrfs-filesystem-resize mountpoint [size:..]\n"
6927 #: ../fish/guestfish-actions.pod:559 ../src/guestfs-actions.pod:850
6928 msgid "This command resizes a btrfs filesystem."
6932 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:852
6934 "Note that unlike other resize calls, the filesystem has to be mounted and "
6935 "the parameter is the mountpoint not the device (this is a requirement of "
6940 #: ../fish/guestfish-actions.pod:565 ../fish/guestfish-actions.pod:3497
6941 #: ../src/guestfs-actions.pod:856 ../src/guestfs-actions.pod:5351
6942 msgid "The optional parameters are:"
6946 #: ../fish/guestfish-actions.pod:569 ../fish/guestfish-actions.pod:3501
6947 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5355
6952 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:862
6954 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6955 "resized to the maximum size."
6959 #: ../fish/guestfish-actions.pod:576 ../src/guestfs-actions.pod:867
6960 msgid "See also L<btrfs(8)>."
6964 #: ../fish/guestfish-actions.pod:580
6965 msgid "case-sensitive-path"
6969 #: ../fish/guestfish-actions.pod:582
6972 " case-sensitive-path path\n"
6977 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:901
6979 "This can be used to resolve case insensitive paths on a filesystem which is "
6980 "case sensitive. The use case is to resolve paths which you have read from "
6981 "Windows configuration files or the Windows Registry, to the true path."
6985 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:906
6987 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6988 "(and probably others), which is that although the underlying filesystem is "
6989 "case-insensitive, the driver exports the filesystem to Linux as case-"
6994 #: ../fish/guestfish-actions.pod:594 ../src/guestfs-actions.pod:911
6996 "One consequence of this is that special directories such as C<c:\\windows> "
6997 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6998 "precise details of how they were created. In Windows itself this would not "
7003 #: ../fish/guestfish-actions.pod:600 ../src/guestfs-actions.pod:917
7005 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
7010 #: ../fish/guestfish-actions.pod:603 ../src/guestfs-actions.pod:920
7012 "This function resolves the true case of each element in the path and returns "
7013 "the case-sensitive path."
7017 #: ../fish/guestfish-actions.pod:606
7019 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
7020 "WINDOWS/system32\"> (the exact return value would depend on details of how "
7021 "the directories were originally created under Windows)."
7025 #: ../fish/guestfish-actions.pod:611 ../src/guestfs-actions.pod:928
7026 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7030 #: ../fish/guestfish-actions.pod:614
7031 msgid "See also L</realpath>."
7035 #: ../fish/guestfish-actions.pod:616
7040 #: ../fish/guestfish-actions.pod:618
7048 #: ../fish/guestfish-actions.pod:620 ../fish/guestfish-actions.pod:3917
7049 #: ../src/guestfs-actions.pod:944 ../src/guestfs-actions.pod:5994
7050 msgid "Return the contents of the file named C<path>."
7054 #: ../fish/guestfish-actions.pod:622
7056 "Note that this function cannot correctly handle binary files (specifically, "
7057 "files containing C<\\0> character which is treated as end of string). For "
7058 "those you need to use the L</read-file> or L</download> functions which have "
7059 "a more complex interface."
7063 #: ../fish/guestfish-actions.pod:627 ../fish/guestfish-actions.pod:762
7064 #: ../fish/guestfish-actions.pod:774 ../fish/guestfish-actions.pod:985
7065 #: ../fish/guestfish-actions.pod:995 ../fish/guestfish-actions.pod:1062
7066 #: ../fish/guestfish-actions.pod:1072 ../fish/guestfish-actions.pod:1264
7067 #: ../fish/guestfish-actions.pod:1577 ../fish/guestfish-actions.pod:1587
7068 #: ../fish/guestfish-actions.pod:1637 ../fish/guestfish-actions.pod:1652
7069 #: ../fish/guestfish-actions.pod:1662 ../fish/guestfish-actions.pod:1681
7070 #: ../fish/guestfish-actions.pod:3787 ../fish/guestfish-actions.pod:3802
7071 #: ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:3895
7072 #: ../fish/guestfish-actions.pod:3910 ../fish/guestfish-actions.pod:4591
7073 #: ../fish/guestfish-actions.pod:4637 ../fish/guestfish-actions.pod:4722
7074 #: ../fish/guestfish-actions.pod:4737 ../fish/guestfish-actions.pod:5143
7075 #: ../fish/guestfish-actions.pod:5155 ../fish/guestfish-actions.pod:5173
7076 #: ../fish/guestfish-actions.pod:5190 ../fish/guestfish-actions.pod:5200
7077 #: ../fish/guestfish-actions.pod:5257 ../fish/guestfish-actions.pod:5267
7078 #: ../fish/guestfish-actions.pod:5296 ../fish/guestfish-actions.pod:5306
7079 #: ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:1133
7080 #: ../src/guestfs-actions.pod:1153 ../src/guestfs-actions.pod:1560
7081 #: ../src/guestfs-actions.pod:1579 ../src/guestfs-actions.pod:1682
7082 #: ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1947
7083 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2448
7084 #: ../src/guestfs-actions.pod:2513 ../src/guestfs-actions.pod:2537
7085 #: ../src/guestfs-actions.pod:2554 ../src/guestfs-actions.pod:2583
7086 #: ../src/guestfs-actions.pod:5776 ../src/guestfs-actions.pod:5802
7087 #: ../src/guestfs-actions.pod:5933 ../src/guestfs-actions.pod:5959
7088 #: ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6950
7089 #: ../src/guestfs-actions.pod:7005 ../src/guestfs-actions.pod:7151
7090 #: ../src/guestfs-actions.pod:7175 ../src/guestfs-actions.pod:7840
7091 #: ../src/guestfs-actions.pod:7860 ../src/guestfs-actions.pod:7893
7092 #: ../src/guestfs-actions.pod:7912 ../src/guestfs-actions.pod:7931
7093 #: ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8044
7094 #: ../src/guestfs-actions.pod:8090 ../src/guestfs-actions.pod:8109
7096 "Because of the message protocol, there is a transfer limit of somewhere "
7097 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7101 #: ../fish/guestfish-actions.pod:630
7106 #: ../fish/guestfish-actions.pod:632
7109 " checksum csumtype path\n"
7114 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:966
7116 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7120 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:969
7122 "The type of checksum to compute is given by the C<csumtype> parameter which "
7123 "must have one of the following values:"
7127 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:974
7132 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:976
7134 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7139 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:979
7144 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:981
7145 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7149 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:983
7154 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:985
7155 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7159 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:987
7164 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:989
7165 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7169 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:991
7174 #: ../fish/guestfish-actions.pod:661 ../src/guestfs-actions.pod:993
7175 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7179 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:995
7184 #: ../fish/guestfish-actions.pod:665 ../src/guestfs-actions.pod:997
7185 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7189 #: ../fish/guestfish-actions.pod:667 ../src/guestfs-actions.pod:999
7194 #: ../fish/guestfish-actions.pod:669 ../src/guestfs-actions.pod:1001
7195 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7199 #: ../fish/guestfish-actions.pod:673 ../src/guestfs-actions.pod:1005
7200 msgid "The checksum is returned as a printable string."
7204 #: ../fish/guestfish-actions.pod:675
7205 msgid "To get the checksum for a device, use L</checksum-device>."
7209 #: ../fish/guestfish-actions.pod:677
7210 msgid "To get the checksums for many files, use L</checksums-out>."
7214 #: ../fish/guestfish-actions.pod:679
7215 msgid "checksum-device"
7219 #: ../fish/guestfish-actions.pod:681
7222 " checksum-device csumtype device\n"
7227 #: ../fish/guestfish-actions.pod:683
7229 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7230 "device named C<device>. For the types of checksums supported see the L</"
7231 "checksum> command."
7235 #: ../fish/guestfish-actions.pod:687
7236 msgid "checksums-out"
7240 #: ../fish/guestfish-actions.pod:689
7243 " checksums-out csumtype directory (sumsfile|-)\n"
7248 #: ../fish/guestfish-actions.pod:691 ../src/guestfs-actions.pod:1040
7250 "This command computes the checksums of all regular files in C<directory> and "
7251 "then emits a list of those checksums to the local output file C<sumsfile>."
7255 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1044
7257 "This can be used for verifying the integrity of a virtual machine. However "
7258 "to be properly secure you should pay attention to the output of the checksum "
7259 "command (it uses the ones from GNU coreutils). In particular when the "
7260 "filename is not printable, coreutils uses a special backslash syntax. For "
7261 "more information, see the GNU coreutils info file."
7265 #: ../fish/guestfish-actions.pod:705
7270 #: ../fish/guestfish-actions.pod:707
7273 " chmod mode path\n"
7278 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1063
7280 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7285 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1066
7287 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7288 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7293 #: ../fish/guestfish-actions.pod:716 ../fish/guestfish-actions.pod:3150
7294 #: ../fish/guestfish-actions.pod:3289 ../fish/guestfish-actions.pod:3299
7295 #: ../fish/guestfish-actions.pod:3309 ../src/guestfs-actions.pod:1070
7296 #: ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:4967
7297 #: ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:5005
7298 msgid "The mode actually set is affected by the umask."
7302 #: ../fish/guestfish-actions.pod:718
7307 #: ../fish/guestfish-actions.pod:720
7310 " chown owner group path\n"
7315 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1084
7316 msgid "Change the file owner to C<owner> and group to C<group>."
7320 #: ../fish/guestfish-actions.pod:724 ../fish/guestfish-actions.pod:2585
7321 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:3829
7323 "Only numeric uid and gid are supported. If you want to use names, you will "
7324 "need to locate and parse the password file yourself (Augeas support makes "
7325 "this relatively easy)."
7329 #: ../fish/guestfish-actions.pod:728
7334 #: ../fish/guestfish-actions.pod:730
7337 " command 'arguments ...'\n"
7342 #: ../fish/guestfish-actions.pod:732 ../src/guestfs-actions.pod:1100
7344 "This call runs a command from the guest filesystem. The filesystem must be "
7345 "mounted, and must contain a compatible operating system (ie. something "
7346 "Linux, with the same or compatible processor architecture)."
7350 #: ../fish/guestfish-actions.pod:737
7352 "The single parameter is an argv-style list of arguments. The first element "
7353 "is the name of the program to run. Subsequent elements are parameters. The "
7354 "list must be non-empty (ie. must contain a program name). Note that the "
7355 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
7359 #: ../fish/guestfish-actions.pod:744 ../src/guestfs-actions.pod:1112
7360 msgid "The return value is anything printed to I<stdout> by the command."
7364 #: ../fish/guestfish-actions.pod:747 ../src/guestfs-actions.pod:1115
7366 "If the command returns a non-zero exit status, then this function returns an "
7367 "error message. The error message string is the content of I<stderr> from "
7372 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1119
7374 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
7375 "bin>. If you require a program from another location, you should provide "
7376 "the full path in the first parameter."
7380 #: ../fish/guestfish-actions.pod:756 ../src/guestfs-actions.pod:1124
7382 "Shared libraries and data files required by the program must be available on "
7383 "filesystems which are mounted in the correct places. It is the caller's "
7384 "responsibility to ensure all filesystems that are needed are mounted at the "
7389 #: ../fish/guestfish-actions.pod:765
7390 msgid "command-lines"
7394 #: ../fish/guestfish-actions.pod:767
7397 " command-lines 'arguments ...'\n"
7402 #: ../fish/guestfish-actions.pod:769
7404 "This is the same as L</command>, but splits the result into a list of lines."
7408 #: ../fish/guestfish-actions.pod:772
7409 msgid "See also: L</sh-lines>"
7413 #: ../fish/guestfish-actions.pod:777
7414 msgid "compress-device-out"
7418 #: ../fish/guestfish-actions.pod:779
7421 " compress-device-out ctype device (zdevice|-) [level:..]\n"
7426 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1174
7428 "This command compresses C<device> and writes it out to the local file "
7433 #: ../fish/guestfish-actions.pod:784
7435 "The C<ctype> and optional C<level> parameters have the same meaning as in L</"
7440 #: ../fish/guestfish-actions.pod:791
7441 msgid "compress-out"
7445 #: ../fish/guestfish-actions.pod:793
7448 " compress-out ctype file (zfile|-) [level:..]\n"
7453 #: ../fish/guestfish-actions.pod:795 ../src/guestfs-actions.pod:1226
7455 "This command compresses C<file> and writes it out to the local file C<zfile>."
7459 #: ../fish/guestfish-actions.pod:798 ../src/guestfs-actions.pod:1229
7461 "The compression program used is controlled by the C<ctype> parameter. "
7462 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
7463 "Some compression types may not be supported by particular builds of "
7464 "libguestfs, in which case you will get an error containing the substring "
7465 "\"not supported\"."
7469 #: ../fish/guestfish-actions.pod:804 ../src/guestfs-actions.pod:1235
7471 "The optional C<level> parameter controls compression level. The meaning and "
7472 "default for this parameter depends on the compression program being used."
7476 #: ../fish/guestfish-actions.pod:812
7481 #: ../fish/guestfish-actions.pod:814
7484 " config qemuparam qemuvalue\n"
7489 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1276
7491 "This can be used to add arbitrary qemu command line parameters of the form "
7492 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7493 "setting some parameters which would interfere with parameters that we use."
7497 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1281
7498 msgid "The first character of C<param> string must be a C<-> (dash)."
7502 #: ../fish/guestfish-actions.pod:823 ../src/guestfs-actions.pod:1283
7503 msgid "C<value> can be NULL."
7507 #: ../fish/guestfish-actions.pod:825
7512 #: ../fish/guestfish-actions.pod:827
7515 " copy-size src dest size\n"
7520 #: ../fish/guestfish-actions.pod:829 ../src/guestfs-actions.pod:1297
7522 "This command copies exactly C<size> bytes from one source device or file "
7523 "C<src> to another destination device or file C<dest>."
7527 #: ../fish/guestfish-actions.pod:832 ../src/guestfs-actions.pod:1300
7529 "Note this will fail if the source is too short or if the destination is not "
7534 #: ../fish/guestfish-actions.pod:835
7539 #: ../fish/guestfish-actions.pod:837
7547 #: ../fish/guestfish-actions.pod:839 ../src/guestfs-actions.pod:1319
7549 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7550 "destination filename or destination directory."
7554 #: ../fish/guestfish-actions.pod:842
7559 #: ../fish/guestfish-actions.pod:844
7567 #: ../fish/guestfish-actions.pod:846 ../src/guestfs-actions.pod:1333
7569 "This copies a file or directory from C<src> to C<dest> recursively using the "
7574 #: ../fish/guestfish-actions.pod:849
7579 #: ../fish/guestfish-actions.pod:851
7587 #: ../fish/guestfish-actions.pod:853 ../src/guestfs-actions.pod:1347
7589 "This command copies from one source device or file C<src> to another "
7590 "destination device or file C<dest>. Normally you would use this to copy to "
7591 "or from a device or partition, for example to duplicate a filesystem."
7595 #: ../fish/guestfish-actions.pod:858
7597 "If the destination is a device, it must be as large or larger than the "
7598 "source file or device, otherwise the copy will fail. This command cannot do "
7599 "partial copies (see L</copy-size>)."
7603 #: ../fish/guestfish-actions.pod:862
7608 #: ../fish/guestfish-actions.pod:864
7616 #: ../fish/guestfish-actions.pod:866 ../src/guestfs-actions.pod:1365
7617 msgid "This command runs the C<df> command to report disk space used."
7621 #: ../fish/guestfish-actions.pod:868 ../fish/guestfish-actions.pod:879
7623 "This command is mostly useful for interactive sessions. It is I<not> "
7624 "intended that you try to parse the output string. Use L</statvfs> from "
7629 #: ../fish/guestfish-actions.pod:872
7634 #: ../fish/guestfish-actions.pod:874
7642 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1381
7644 "This command runs the C<df -h> command to report disk space used in human-"
7649 #: ../fish/guestfish-actions.pod:883
7654 #: ../fish/guestfish-actions.pod:885
7662 #: ../fish/guestfish-actions.pod:887 ../src/guestfs-actions.pod:1398
7664 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7665 "This is sometimes useful for extended debugging of problems."
7669 #: ../fish/guestfish-actions.pod:891
7671 "Another way to get the same information is to enable verbose messages with "
7672 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7673 "before running the program."
7677 #: ../fish/guestfish-actions.pod:896
7682 #: ../fish/guestfish-actions.pod:898
7685 " download remotefilename (filename|-)\n"
7690 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:913
7691 #: ../src/guestfs-actions.pod:1419 ../src/guestfs-actions.pod:1444
7693 "Download file C<remotefilename> and save it as C<filename> on the local "
7698 #: ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:4895
7699 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:7410
7700 msgid "C<filename> can also be a named pipe."
7704 #: ../fish/guestfish-actions.pod:905
7705 msgid "See also L</upload>, L</cat>."
7709 #: ../fish/guestfish-actions.pod:909
7710 msgid "download-offset"
7714 #: ../fish/guestfish-actions.pod:911
7717 " download-offset remotefilename (filename|-) offset size\n"
7722 #: ../fish/guestfish-actions.pod:916 ../src/guestfs-actions.pod:1447
7724 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7725 "region must be within the file or device)."
7729 #: ../fish/guestfish-actions.pod:919
7731 "Note that there is no limit on the amount of data that can be downloaded "
7732 "with this call, unlike with L</pread>, and this call always reads the full "
7733 "amount unless an error occurs."
7737 #: ../fish/guestfish-actions.pod:924
7738 msgid "See also L</download>, L</pread>."
7742 #: ../fish/guestfish-actions.pod:928
7747 #: ../fish/guestfish-actions.pod:930
7750 " drop-caches whattodrop\n"
7755 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1472
7757 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7758 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7759 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7763 #: ../fish/guestfish-actions.pod:937 ../src/guestfs-actions.pod:1477
7764 msgid "Setting C<whattodrop> to 3 should drop everything."
7768 #: ../fish/guestfish-actions.pod:939 ../src/guestfs-actions.pod:1479
7770 "This automatically calls L<sync(2)> before the operation, so that the "
7771 "maximum guest memory is freed."
7775 #: ../fish/guestfish-actions.pod:942
7780 #: ../fish/guestfish-actions.pod:944
7788 #: ../fish/guestfish-actions.pod:946 ../src/guestfs-actions.pod:1492
7790 "This command runs the C<du -s> command to estimate file space usage for "
7795 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1495
7797 "C<path> can be a file or a directory. If C<path> is a directory then the "
7798 "estimate includes the contents of the directory and all subdirectories "
7803 #: ../fish/guestfish-actions.pod:953 ../src/guestfs-actions.pod:1499
7805 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7809 #: ../fish/guestfish-actions.pod:956
7814 #: ../fish/guestfish-actions.pod:958
7817 " e2fsck-f device\n"
7822 #: ../fish/guestfish-actions.pod:960 ../src/guestfs-actions.pod:1517
7824 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7825 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7830 #: ../fish/guestfish-actions.pod:964
7832 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7833 "should use L</fsck>."
7837 #: ../fish/guestfish-actions.pod:967
7842 #: ../fish/guestfish-actions.pod:969
7845 " echo-daemon 'words ...'\n"
7850 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1534
7852 "This command concatenates the list of C<words> passed with single spaces "
7853 "between them and returns the resulting string."
7857 #: ../fish/guestfish-actions.pod:974 ../src/guestfs-actions.pod:1537
7858 msgid "You can use this command to test the connection through to the daemon."
7862 #: ../fish/guestfish-actions.pod:976
7863 msgid "See also L</ping-daemon>."
7867 #: ../fish/guestfish-actions.pod:978
7872 #: ../fish/guestfish-actions.pod:980
7875 " egrep regex path\n"
7880 #: ../fish/guestfish-actions.pod:982 ../src/guestfs-actions.pod:1553
7882 "This calls the external C<egrep> program and returns the matching lines."
7886 #: ../fish/guestfish-actions.pod:988
7891 #: ../fish/guestfish-actions.pod:990
7894 " egrepi regex path\n"
7899 #: ../fish/guestfish-actions.pod:992 ../src/guestfs-actions.pod:1572
7901 "This calls the external C<egrep -i> program and returns the matching lines."
7905 #: ../fish/guestfish-actions.pod:998
7910 #: ../fish/guestfish-actions.pod:1000
7913 " equal file1 file2\n"
7918 #: ../fish/guestfish-actions.pod:1002 ../src/guestfs-actions.pod:1591
7920 "This compares the two files C<file1> and C<file2> and returns true if their "
7921 "content is exactly equal, or false otherwise."
7925 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1594
7926 msgid "The external L<cmp(1)> program is used for the comparison."
7930 #: ../fish/guestfish-actions.pod:1007
7935 #: ../fish/guestfish-actions.pod:1009
7943 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1606
7945 "This returns C<true> if and only if there is a file, directory (or anything) "
7946 "with the given C<path> name."
7950 #: ../fish/guestfish-actions.pod:1014
7951 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7955 #: ../fish/guestfish-actions.pod:1016
7960 #: ../fish/guestfish-actions.pod:1018
7963 " fallocate path len\n"
7968 #: ../fish/guestfish-actions.pod:1020 ../fish/guestfish-actions.pod:1039
7969 #: ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1648
7971 "This command preallocates a file (containing zero bytes) named C<path> of "
7972 "size C<len> bytes. If the file exists already, it is overwritten."
7976 #: ../fish/guestfish-actions.pod:1024 ../src/guestfs-actions.pod:1633
7978 "Do not confuse this with the guestfish-specific C<alloc> command which "
7979 "allocates a file in the host and attaches it as a device."
7983 #: ../fish/guestfish-actions.pod:1028
7985 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7990 #: ../fish/guestfish-actions.pod:1035
7995 #: ../fish/guestfish-actions.pod:1037
7998 " fallocate64 path len\n"
8003 #: ../fish/guestfish-actions.pod:1043
8005 "Note that this call allocates disk blocks for the file. To create a sparse "
8006 "file use L</truncate-size> instead."
8010 #: ../fish/guestfish-actions.pod:1046
8012 "The deprecated call L</fallocate> does the same, but owing to an oversight "
8013 "it only allowed 30 bit lengths to be specified, effectively limiting the "
8014 "maximum size of files created through that call to 1GB."
8018 #: ../fish/guestfish-actions.pod:1051 ../src/guestfs-actions.pod:1660
8020 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8021 "commands which create a file in the host and attach it as a device."
8025 #: ../fish/guestfish-actions.pod:1055
8030 #: ../fish/guestfish-actions.pod:1057
8033 " fgrep pattern path\n"
8038 #: ../fish/guestfish-actions.pod:1059 ../src/guestfs-actions.pod:1675
8040 "This calls the external C<fgrep> program and returns the matching lines."
8044 #: ../fish/guestfish-actions.pod:1065
8049 #: ../fish/guestfish-actions.pod:1067
8052 " fgrepi pattern path\n"
8057 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1694
8059 "This calls the external C<fgrep -i> program and returns the matching lines."
8063 #: ../fish/guestfish-actions.pod:1075
8068 #: ../fish/guestfish-actions.pod:1077
8076 #: ../fish/guestfish-actions.pod:1079 ../src/guestfs-actions.pod:1712
8078 "This call uses the standard L<file(1)> command to determine the type or "
8079 "contents of the file."
8083 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1715
8085 "This call will also transparently look inside various types of compressed "
8090 #: ../fish/guestfish-actions.pod:1085 ../src/guestfs-actions.pod:1718
8092 "The exact command which runs is C<file -zb path>. Note in particular that "
8093 "the filename is not prepended to the output (the I<-b> option)."
8097 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1722
8099 "The output depends on the output of the underlying L<file(1)> command and it "
8100 "can change in future in ways beyond our control. In other words, the output "
8101 "is not guaranteed by the ABI."
8105 #: ../fish/guestfish-actions.pod:1093
8107 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
8108 "(etc), L</is-zero>."
8112 #: ../fish/guestfish-actions.pod:1096
8113 msgid "file-architecture"
8117 #: ../fish/guestfish-actions.pod:1098
8120 " file-architecture filename\n"
8125 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1740
8127 "This detects the architecture of the binary C<filename>, and returns it if "
8132 #: ../fish/guestfish-actions.pod:1103 ../src/guestfs-actions.pod:1743
8133 msgid "Currently defined architectures are:"
8137 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1747
8142 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1749
8144 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8145 "irrespective of the precise processor requirements of the binary."
8149 #: ../fish/guestfish-actions.pod:1112 ../src/guestfs-actions.pod:1752
8154 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1754
8155 msgid "64 bit x86-64."
8159 #: ../fish/guestfish-actions.pod:1116 ../src/guestfs-actions.pod:1756
8164 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1758
8165 msgid "32 bit SPARC."
8169 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1760
8174 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1762
8175 msgid "64 bit SPARC V9 and above."
8179 #: ../fish/guestfish-actions.pod:1124 ../src/guestfs-actions.pod:1764
8184 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1766
8185 msgid "Intel Itanium."
8189 #: ../fish/guestfish-actions.pod:1128 ../src/guestfs-actions.pod:1768
8194 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1770
8195 msgid "32 bit Power PC."
8199 #: ../fish/guestfish-actions.pod:1132 ../src/guestfs-actions.pod:1772
8204 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1774
8205 msgid "64 bit Power PC."
8209 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1778
8210 msgid "Libguestfs may return other architecture strings in future."
8214 #: ../fish/guestfish-actions.pod:1140 ../src/guestfs-actions.pod:1780
8215 msgid "The function works on at least the following types of files:"
8219 #: ../fish/guestfish-actions.pod:1146 ../src/guestfs-actions.pod:1786
8220 msgid "many types of Un*x and Linux binary"
8224 #: ../fish/guestfish-actions.pod:1150 ../src/guestfs-actions.pod:1790
8225 msgid "many types of Un*x and Linux shared library"
8229 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1794
8230 msgid "Windows Win32 and Win64 binaries"
8234 #: ../fish/guestfish-actions.pod:1158 ../src/guestfs-actions.pod:1798
8235 msgid "Windows Win32 and Win64 DLLs"
8239 #: ../fish/guestfish-actions.pod:1160 ../src/guestfs-actions.pod:1800
8240 msgid "Win32 binaries and DLLs return C<i386>."
8244 #: ../fish/guestfish-actions.pod:1162 ../src/guestfs-actions.pod:1802
8245 msgid "Win64 binaries and DLLs return C<x86_64>."
8249 #: ../fish/guestfish-actions.pod:1166 ../src/guestfs-actions.pod:1806
8250 msgid "Linux kernel modules"
8254 #: ../fish/guestfish-actions.pod:1170 ../src/guestfs-actions.pod:1810
8255 msgid "Linux new-style initrd images"
8259 #: ../fish/guestfish-actions.pod:1174 ../src/guestfs-actions.pod:1814
8260 msgid "some non-x86 Linux vmlinuz kernels"
8264 #: ../fish/guestfish-actions.pod:1178 ../src/guestfs-actions.pod:1818
8265 msgid "What it can't do currently:"
8269 #: ../fish/guestfish-actions.pod:1184 ../src/guestfs-actions.pod:1824
8270 msgid "static libraries (libfoo.a)"
8274 #: ../fish/guestfish-actions.pod:1188 ../src/guestfs-actions.pod:1828
8275 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8279 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:1832
8280 msgid "x86 Linux vmlinuz kernels"
8284 #: ../fish/guestfish-actions.pod:1194 ../src/guestfs-actions.pod:1834
8286 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8287 "compressed code, and are horribly hard to unpack. If you want to find the "
8288 "architecture of a kernel, use the architecture of the associated initrd or "
8289 "kernel module(s) instead."
8293 #: ../fish/guestfish-actions.pod:1201
8298 #: ../fish/guestfish-actions.pod:1203
8306 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1852
8307 msgid "This command returns the size of C<file> in bytes."
8311 #: ../fish/guestfish-actions.pod:1207
8313 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
8314 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
8318 #: ../fish/guestfish-actions.pod:1211
8323 #: ../fish/guestfish-actions.pod:1213
8326 " fill c len path\n"
8331 #: ../fish/guestfish-actions.pod:1215 ../src/guestfs-actions.pod:1870
8333 "This command creates a new file called C<path>. The initial content of the "
8334 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
8339 #: ../fish/guestfish-actions.pod:1219
8341 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8342 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
8347 #: ../fish/guestfish-actions.pod:1224
8348 msgid "fill-pattern"
8352 #: ../fish/guestfish-actions.pod:1226
8355 " fill-pattern pattern len path\n"
8360 #: ../fish/guestfish-actions.pod:1228
8362 "This function is like L</fill> except that it creates a new file of length "
8363 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
8364 "is truncated if necessary to ensure the length of the file is exactly C<len> "
8369 #: ../fish/guestfish-actions.pod:1233
8374 #: ../fish/guestfish-actions.pod:1235
8382 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1916
8384 "This command lists out all files and directories, recursively, starting at "
8385 "C<directory>. It is essentially equivalent to running the shell command "
8386 "C<find directory -print> but some post-processing happens on the output, "
8391 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1921
8393 "This returns a list of strings I<without any prefix>. Thus if the directory "
8398 #: ../fish/guestfish-actions.pod:1245 ../src/guestfs-actions.pod:1924
8408 #: ../fish/guestfish-actions.pod:1249
8409 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8413 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1931
8424 #: ../fish/guestfish-actions.pod:1257 ../src/guestfs-actions.pod:1936
8425 msgid "If C<directory> is not a directory, then this command returns an error."
8429 #: ../fish/guestfish-actions.pod:1260 ../src/guestfs-actions.pod:1939
8430 msgid "The returned list is sorted."
8434 #: ../fish/guestfish-actions.pod:1262
8435 msgid "See also L</find0>."
8439 #: ../fish/guestfish-actions.pod:1267
8444 #: ../fish/guestfish-actions.pod:1269
8447 " find0 directory (files|-)\n"
8452 #: ../fish/guestfish-actions.pod:1271 ../src/guestfs-actions.pod:1959
8454 "This command lists out all files and directories, recursively, starting at "
8455 "C<directory>, placing the resulting list in the external file called "
8460 #: ../fish/guestfish-actions.pod:1275
8462 "This command works the same way as L</find> with the following exceptions:"
8466 #: ../fish/guestfish-actions.pod:1282 ../src/guestfs-actions.pod:1970
8467 msgid "The resulting list is written to an external file."
8471 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1974
8473 "Items (filenames) in the result are separated by C<\\0> characters. See "
8474 "L<find(1)> option I<-print0>."
8478 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1979
8479 msgid "This command is not limited in the number of names that it can return."
8483 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:1984
8484 msgid "The result list is not sorted."
8488 #: ../fish/guestfish-actions.pod:1302
8489 msgid "findfs-label"
8493 #: ../fish/guestfish-actions.pod:1304
8496 " findfs-label label\n"
8501 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:1998
8503 "This command searches the filesystems and returns the one which has the "
8504 "given label. An error is returned if no such filesystem can be found."
8508 #: ../fish/guestfish-actions.pod:1310
8509 msgid "To find the label of a filesystem, use L</vfs-label>."
8513 #: ../fish/guestfish-actions.pod:1312
8518 #: ../fish/guestfish-actions.pod:1314
8521 " findfs-uuid uuid\n"
8526 #: ../fish/guestfish-actions.pod:1316 ../src/guestfs-actions.pod:2015
8528 "This command searches the filesystems and returns the one which has the "
8529 "given UUID. An error is returned if no such filesystem can be found."
8533 #: ../fish/guestfish-actions.pod:1320
8534 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8538 #: ../fish/guestfish-actions.pod:1322
8543 #: ../fish/guestfish-actions.pod:1324
8546 " fsck fstype device\n"
8551 #: ../fish/guestfish-actions.pod:1326 ../src/guestfs-actions.pod:2033
8553 "This runs the filesystem checker (fsck) on C<device> which should have "
8554 "filesystem type C<fstype>."
8558 #: ../fish/guestfish-actions.pod:1329 ../src/guestfs-actions.pod:2036
8560 "The returned integer is the status. See L<fsck(8)> for the list of status "
8561 "codes from C<fsck>."
8565 #: ../fish/guestfish-actions.pod:1338 ../src/guestfs-actions.pod:2045
8566 msgid "Multiple status codes can be summed together."
8570 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2049
8572 "A non-zero return code can mean \"success\", for example if errors have been "
8573 "corrected on the filesystem."
8577 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2054
8578 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8582 #: ../fish/guestfish-actions.pod:1352 ../src/guestfs-actions.pod:2059
8584 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8588 #: ../fish/guestfish-actions.pod:1354
8593 #: ../fish/guestfish-actions.pod:1356
8601 #: ../fish/guestfish-actions.pod:1358 ../src/guestfs-actions.pod:2070
8603 "Return the additional kernel options which are added to the guest kernel "
8608 #: ../fish/guestfish-actions.pod:1361 ../src/guestfs-actions.pod:2073
8609 msgid "If C<NULL> then no options are added."
8613 #: ../fish/guestfish-actions.pod:1363
8614 msgid "get-attach-method"
8618 #: ../fish/guestfish-actions.pod:1365
8621 " get-attach-method\n"
8626 #: ../fish/guestfish-actions.pod:1367
8627 msgid "Return the current attach method. See L</set-attach-method>."
8631 #: ../fish/guestfish-actions.pod:1369
8632 msgid "get-autosync"
8636 #: ../fish/guestfish-actions.pod:1371
8644 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2098
8645 msgid "Get the autosync flag."
8649 #: ../fish/guestfish-actions.pod:1375
8654 #: ../fish/guestfish-actions.pod:1377
8662 #: ../fish/guestfish-actions.pod:1379 ../src/guestfs-actions.pod:2109
8663 msgid "Return the direct appliance mode flag."
8667 #: ../fish/guestfish-actions.pod:1381
8672 #: ../fish/guestfish-actions.pod:1383
8675 " get-e2label device\n"
8680 #: ../fish/guestfish-actions.pod:1385 ../src/guestfs-actions.pod:2128
8682 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8686 #: ../fish/guestfish-actions.pod:1388
8688 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8693 #: ../fish/guestfish-actions.pod:1395
8698 #: ../fish/guestfish-actions.pod:1397
8701 " get-e2uuid device\n"
8706 #: ../fish/guestfish-actions.pod:1399 ../src/guestfs-actions.pod:2149
8708 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8712 #: ../fish/guestfish-actions.pod:1402
8714 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8719 #: ../fish/guestfish-actions.pod:1409
8724 #: ../fish/guestfish-actions.pod:1411
8732 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2162
8734 "This gets the memory size in megabytes allocated to the qemu subprocess."
8738 #: ../fish/guestfish-actions.pod:1416
8740 "If L</set-memsize> was not called on this handle, and if "
8741 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8742 "value for memsize."
8746 #: ../fish/guestfish-actions.pod:1420 ../fish/guestfish-actions.pod:1477
8747 #: ../fish/guestfish-actions.pod:4243 ../fish/guestfish-actions.pod:4345
8748 #: ../src/guestfs-actions.pod:2169 ../src/guestfs-actions.pod:2261
8749 #: ../src/guestfs-actions.pod:6455 ../src/guestfs-actions.pod:6581
8751 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8755 #: ../fish/guestfish-actions.pod:1423
8760 #: ../fish/guestfish-actions.pod:1425
8768 #: ../fish/guestfish-actions.pod:1427 ../src/guestfs-actions.pod:2181
8769 msgid "This returns the enable network flag."
8773 #: ../fish/guestfish-actions.pod:1429
8778 #: ../fish/guestfish-actions.pod:1431
8786 #: ../fish/guestfish-actions.pod:1433 ../src/guestfs-actions.pod:2192
8787 msgid "Return the current search path."
8791 #: ../fish/guestfish-actions.pod:1435 ../src/guestfs-actions.pod:2194
8793 "This is always non-NULL. If it wasn't set already, then this will return "
8798 #: ../fish/guestfish-actions.pod:1438
8803 #: ../fish/guestfish-actions.pod:1440
8811 #: ../fish/guestfish-actions.pod:1442 ../src/guestfs-actions.pod:2207
8812 msgid "This returns the process group flag."
8816 #: ../fish/guestfish-actions.pod:1444
8821 #: ../fish/guestfish-actions.pod:1446
8826 #: ../fish/guestfish-actions.pod:1448
8834 #: ../fish/guestfish-actions.pod:1450 ../src/guestfs-actions.pod:2218
8836 "Return the process ID of the qemu subprocess. If there is no qemu "
8837 "subprocess, then this will return an error."
8841 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2221
8842 msgid "This is an internal call used for debugging and testing."
8846 #: ../fish/guestfish-actions.pod:1455
8851 #: ../fish/guestfish-actions.pod:1457
8859 #: ../fish/guestfish-actions.pod:1459 ../src/guestfs-actions.pod:2232
8860 msgid "Return the current qemu binary."
8864 #: ../fish/guestfish-actions.pod:1461 ../src/guestfs-actions.pod:2234
8866 "This is always non-NULL. If it wasn't set already, then this will return "
8867 "the default qemu binary name."
8871 #: ../fish/guestfish-actions.pod:1464
8872 msgid "get-recovery-proc"
8876 #: ../fish/guestfish-actions.pod:1466
8879 " get-recovery-proc\n"
8884 #: ../fish/guestfish-actions.pod:1468 ../src/guestfs-actions.pod:2247
8885 msgid "Return the recovery process enabled flag."
8889 #: ../fish/guestfish-actions.pod:1470
8894 #: ../fish/guestfish-actions.pod:1472
8902 #: ../fish/guestfish-actions.pod:1474
8904 "This returns the current setting of the selinux flag which is passed to the "
8905 "appliance at boot time. See L</set-selinux>."
8909 #: ../fish/guestfish-actions.pod:1480
8914 #: ../fish/guestfish-actions.pod:1482
8922 #: ../fish/guestfish-actions.pod:1484 ../src/guestfs-actions.pod:2273
8923 msgid "This returns the number of virtual CPUs assigned to the appliance."
8927 #: ../fish/guestfish-actions.pod:1486
8932 #: ../fish/guestfish-actions.pod:1488
8940 #: ../fish/guestfish-actions.pod:1490 ../src/guestfs-actions.pod:2284
8942 "This returns the current state as an opaque integer. This is only useful "
8943 "for printing debug and internal error messages."
8947 #: ../fish/guestfish-actions.pod:1493 ../fish/guestfish-actions.pod:2452
8948 #: ../fish/guestfish-actions.pod:2470 ../fish/guestfish-actions.pod:2508
8949 #: ../fish/guestfish-actions.pod:2524 ../src/guestfs-actions.pod:2287
8950 #: ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:3635
8951 #: ../src/guestfs-actions.pod:3696 ../src/guestfs-actions.pod:3723
8952 msgid "For more information on states, see L<guestfs(3)>."
8956 #: ../fish/guestfish-actions.pod:1495
8961 #: ../fish/guestfish-actions.pod:1497
8969 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2298
8970 msgid "Return the command trace flag."
8974 #: ../fish/guestfish-actions.pod:1501
8979 #: ../fish/guestfish-actions.pod:1503
8987 #: ../fish/guestfish-actions.pod:1505
8989 "Return the current umask. By default the umask is C<022> unless it has been "
8990 "set by calling L</umask>."
8994 #: ../fish/guestfish-actions.pod:1508
8999 #: ../fish/guestfish-actions.pod:1510
9007 #: ../fish/guestfish-actions.pod:1512 ../src/guestfs-actions.pod:2321
9008 msgid "This returns the verbose messages flag."
9012 #: ../fish/guestfish-actions.pod:1514
9017 #: ../fish/guestfish-actions.pod:1516
9025 #: ../fish/guestfish-actions.pod:1518 ../src/guestfs-actions.pod:2332
9026 msgid "This gets the SELinux security context of the daemon."
9030 #: ../fish/guestfish-actions.pod:1520
9031 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
9035 #: ../fish/guestfish-actions.pod:1523
9040 #: ../fish/guestfish-actions.pod:1525
9043 " getxattr path name\n"
9048 #: ../fish/guestfish-actions.pod:1527
9050 "Get a single extended attribute from file C<path> named C<name>. This call "
9051 "follows symlinks. If you want to lookup an extended attribute for the "
9052 "symlink itself, use L</lgetxattr>."
9056 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:2597
9058 "Normally it is better to get all extended attributes from a file in one go "
9059 "by calling L</getxattrs>. However some Linux filesystem implementations are "
9060 "buggy and do not provide a way to list out attributes. For these "
9061 "filesystems (notably ntfs-3g) you have to know the names of the extended "
9062 "attributes you want in advance and call this function."
9066 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:2604
9067 #: ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:3856
9069 "Extended attribute values are blobs of binary data. If there is no extended "
9070 "attribute named C<name>, this returns an error."
9074 #: ../fish/guestfish-actions.pod:1541
9075 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
9079 #: ../fish/guestfish-actions.pod:1543
9084 #: ../fish/guestfish-actions.pod:1545
9092 #: ../fish/guestfish-actions.pod:1547 ../src/guestfs-actions.pod:2378
9094 "This call lists the extended attributes of the file or directory C<path>."
9098 #: ../fish/guestfish-actions.pod:1550 ../src/guestfs-actions.pod:2381
9100 "At the system call level, this is a combination of the L<listxattr(2)> and "
9101 "L<getxattr(2)> calls."
9105 #: ../fish/guestfish-actions.pod:1553
9106 msgid "See also: L</lgetxattrs>, L<attr(5)>."
9110 #: ../fish/guestfish-actions.pod:1555
9115 #: ../fish/guestfish-actions.pod:1557
9118 " glob-expand pattern\n"
9123 #: ../fish/guestfish-actions.pod:1559 ../src/guestfs-actions.pod:2398
9125 "This command searches for all the pathnames matching C<pattern> according to "
9126 "the wildcard expansion rules used by the shell."
9130 #: ../fish/guestfish-actions.pod:1563 ../src/guestfs-actions.pod:2402
9132 "If no paths match, then this returns an empty list (note: not an error)."
9136 #: ../fish/guestfish-actions.pod:1566 ../src/guestfs-actions.pod:2405
9138 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
9139 "GLOB_BRACE>. See that manual page for more details."
9143 #: ../fish/guestfish-actions.pod:1570
9148 #: ../fish/guestfish-actions.pod:1572
9151 " grep regex path\n"
9156 #: ../fish/guestfish-actions.pod:1574 ../src/guestfs-actions.pod:2422
9157 msgid "This calls the external C<grep> program and returns the matching lines."
9161 #: ../fish/guestfish-actions.pod:1580
9166 #: ../fish/guestfish-actions.pod:1582
9169 " grepi regex path\n"
9174 #: ../fish/guestfish-actions.pod:1584 ../src/guestfs-actions.pod:2441
9176 "This calls the external C<grep -i> program and returns the matching lines."
9180 #: ../fish/guestfish-actions.pod:1590
9181 msgid "grub-install"
9185 #: ../fish/guestfish-actions.pod:1592
9188 " grub-install root device\n"
9193 #: ../fish/guestfish-actions.pod:1594 ../src/guestfs-actions.pod:2460
9195 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
9196 "with the root directory being C<root>."
9200 #: ../fish/guestfish-actions.pod:1603 ../src/guestfs-actions.pod:2469
9202 "There is currently no way in the API to install grub2, which is used by most "
9203 "modern Linux guests. It is possible to run the grub2 command from the "
9204 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
9208 #: ../fish/guestfish-actions.pod:1610 ../src/guestfs-actions.pod:2476
9210 "This uses C<grub-install> from the host. Unfortunately grub is not always "
9211 "compatible with itself, so this only works in rather narrow circumstances. "
9212 "Careful testing with each guest version is advisable."
9216 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2483
9218 "If grub-install reports the error \"No suitable drive was found in the "
9219 "generated device map.\" it may be that you need to create a C</boot/grub/"
9220 "device.map> file first that contains the mapping between grub device names "
9221 "and Linux device names. It is usually sufficient to create a file "
9226 #: ../fish/guestfish-actions.pod:1624 ../src/guestfs-actions.pod:2490
9234 #: ../fish/guestfish-actions.pod:1626 ../src/guestfs-actions.pod:2492
9235 msgid "replacing C</dev/vda> with the name of the installation device."
9239 #: ../fish/guestfish-actions.pod:1630
9244 #: ../fish/guestfish-actions.pod:1632
9252 #: ../fish/guestfish-actions.pod:1634 ../src/guestfs-actions.pod:2506
9254 "This command returns up to the first 10 lines of a file as a list of strings."
9258 #: ../fish/guestfish-actions.pod:1640
9263 #: ../fish/guestfish-actions.pod:1642
9266 " head-n nrlines path\n"
9271 #: ../fish/guestfish-actions.pod:1644 ../src/guestfs-actions.pod:2525
9273 "If the parameter C<nrlines> is a positive number, this returns the first "
9274 "C<nrlines> lines of the file C<path>."
9278 #: ../fish/guestfish-actions.pod:1647 ../src/guestfs-actions.pod:2528
9280 "If the parameter C<nrlines> is a negative number, this returns lines from "
9281 "the file C<path>, excluding the last C<nrlines> lines."
9285 #: ../fish/guestfish-actions.pod:1650 ../fish/guestfish-actions.pod:4735
9286 #: ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:7169
9287 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9291 #: ../fish/guestfish-actions.pod:1655
9296 #: ../fish/guestfish-actions.pod:1657
9304 #: ../fish/guestfish-actions.pod:1659 ../src/guestfs-actions.pod:2548
9306 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
9307 "readable, canonical hex dump of the file."
9311 #: ../fish/guestfish-actions.pod:1665
9316 #: ../fish/guestfish-actions.pod:1667
9319 " initrd-cat initrdpath filename\n"
9324 #: ../fish/guestfish-actions.pod:1669 ../src/guestfs-actions.pod:2567
9326 "This command unpacks the file C<filename> from the initrd file called "
9327 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9332 #: ../fish/guestfish-actions.pod:1673 ../src/guestfs-actions.pod:2571
9334 "For example, in guestfish you could use the following command to examine the "
9335 "boot script (usually called C</init>) contained in a Linux initrd or "
9340 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2575
9343 " initrd-cat /boot/initrd-<version>.img init\n"
9348 #: ../fish/guestfish-actions.pod:1679
9349 msgid "See also L</initrd-list>."
9353 #: ../fish/guestfish-actions.pod:1684
9358 #: ../fish/guestfish-actions.pod:1686
9361 " initrd-list path\n"
9366 #: ../fish/guestfish-actions.pod:1688 ../src/guestfs-actions.pod:2594
9367 msgid "This command lists out files contained in an initrd."
9371 #: ../fish/guestfish-actions.pod:1690 ../src/guestfs-actions.pod:2596
9373 "The files are listed without any initial C</> character. The files are "
9374 "listed in the order they appear (not necessarily alphabetical). Directory "
9375 "names are listed as separate items."
9379 #: ../fish/guestfish-actions.pod:1694 ../src/guestfs-actions.pod:2600
9381 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9382 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9387 #: ../fish/guestfish-actions.pod:1698
9388 msgid "inotify-add-watch"
9392 #: ../fish/guestfish-actions.pod:1700
9395 " inotify-add-watch path mask\n"
9400 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2617
9401 msgid "Watch C<path> for the events listed in C<mask>."
9405 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2619
9407 "Note that if C<path> is a directory then events within that directory are "
9408 "watched, but this does I<not> happen recursively (in subdirectories)."
9412 #: ../fish/guestfish-actions.pod:1708 ../src/guestfs-actions.pod:2623
9414 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9415 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9419 #: ../fish/guestfish-actions.pod:1712
9420 msgid "inotify-close"
9424 #: ../fish/guestfish-actions.pod:1714
9432 #: ../fish/guestfish-actions.pod:1716 ../src/guestfs-actions.pod:2636
9434 "This closes the inotify handle which was previously opened by inotify_init. "
9435 "It removes all watches, throws away any pending events, and deallocates all "
9440 #: ../fish/guestfish-actions.pod:1720
9441 msgid "inotify-files"
9445 #: ../fish/guestfish-actions.pod:1722
9453 #: ../fish/guestfish-actions.pod:1724
9455 "This function is a helpful wrapper around L</inotify-read> which just "
9456 "returns a list of pathnames of objects that were touched. The returned "
9457 "pathnames are sorted and deduplicated."
9461 #: ../fish/guestfish-actions.pod:1728
9462 msgid "inotify-init"
9466 #: ../fish/guestfish-actions.pod:1730
9469 " inotify-init maxevents\n"
9474 #: ../fish/guestfish-actions.pod:1732 ../src/guestfs-actions.pod:2665
9476 "This command creates a new inotify handle. The inotify subsystem can be "
9477 "used to notify events which happen to objects in the guest filesystem."
9481 #: ../fish/guestfish-actions.pod:1736
9483 "C<maxevents> is the maximum number of events which will be queued up between "
9484 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9485 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9486 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9487 "but records the fact that it threw them away by setting a flag "
9488 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9492 #: ../fish/guestfish-actions.pod:1746
9494 "Before any events are generated, you have to add some watches to the "
9495 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9496 "L</inotify-watch-all>."
9500 #: ../fish/guestfish-actions.pod:1752
9502 "Queued up events should be read periodically by calling L</inotify-read> (or "
9503 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9504 "If you don't read the events out often enough then you risk the internal "
9505 "queue overflowing."
9509 #: ../fish/guestfish-actions.pod:1759
9511 "The handle should be closed after use by calling L</inotify-close>. This "
9512 "also removes any watches automatically."
9516 #: ../fish/guestfish-actions.pod:1763 ../src/guestfs-actions.pod:2696
9518 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9519 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9520 "that there is one global inotify handle per libguestfs instance."
9524 #: ../fish/guestfish-actions.pod:1768
9525 msgid "inotify-read"
9529 #: ../fish/guestfish-actions.pod:1770
9537 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2710
9539 "Return the complete queue of events that have happened since the previous "
9544 #: ../fish/guestfish-actions.pod:1775 ../src/guestfs-actions.pod:2713
9545 msgid "If no events have happened, this returns an empty list."
9549 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2715
9551 "I<Note>: In order to make sure that all events have been read, you must call "
9552 "this function repeatedly until it returns an empty list. The reason is that "
9553 "the call will read events up to the maximum appliance-to-host message size "
9554 "and leave remaining events in the queue."
9558 #: ../fish/guestfish-actions.pod:1783
9559 msgid "inotify-rm-watch"
9563 #: ../fish/guestfish-actions.pod:1785
9566 " inotify-rm-watch wd\n"
9571 #: ../fish/guestfish-actions.pod:1787
9572 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9576 #: ../fish/guestfish-actions.pod:1790
9577 msgid "inspect-get-arch"
9581 #: ../fish/guestfish-actions.pod:1792
9584 " inspect-get-arch root\n"
9589 #: ../fish/guestfish-actions.pod:1794
9591 "This returns the architecture of the inspected operating system. The "
9592 "possible return values are listed under L</file-architecture>."
9596 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2750
9598 "If the architecture could not be determined, then the string C<unknown> is "
9603 #: ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:1896
9604 #: ../fish/guestfish-actions.pod:1975 ../fish/guestfish-actions.pod:1987
9605 #: ../fish/guestfish-actions.pod:2071 ../fish/guestfish-actions.pod:2133
9606 #: ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2168
9607 #: ../fish/guestfish-actions.pod:2208 ../fish/guestfish-actions.pod:2244
9608 #: ../fish/guestfish-actions.pod:2257 ../fish/guestfish-actions.pod:2270
9609 #: ../fish/guestfish-actions.pod:2280 ../fish/guestfish-actions.pod:2290
9610 #: ../fish/guestfish-actions.pod:2302 ../fish/guestfish-actions.pod:2398
9611 #: ../fish/guestfish-actions.pod:2432 ../src/guestfs-actions.pod:2753
9612 #: ../src/guestfs-actions.pod:2855 ../src/guestfs-actions.pod:2959
9613 #: ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:3109
9614 #: ../src/guestfs-actions.pod:3193 ../src/guestfs-actions.pod:3221
9615 #: ../src/guestfs-actions.pod:3242 ../src/guestfs-actions.pod:3295
9616 #: ../src/guestfs-actions.pod:3339 ../src/guestfs-actions.pod:3359
9617 #: ../src/guestfs-actions.pod:3379 ../src/guestfs-actions.pod:3396
9618 #: ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3430
9619 #: ../src/guestfs-actions.pod:3532 ../src/guestfs-actions.pod:3573
9620 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9624 #: ../fish/guestfish-actions.pod:1803
9625 msgid "inspect-get-distro"
9629 #: ../fish/guestfish-actions.pod:1805
9632 " inspect-get-distro root\n"
9637 #: ../fish/guestfish-actions.pod:1807 ../src/guestfs-actions.pod:2766
9639 "This returns the distro (distribution) of the inspected operating system."
9643 #: ../fish/guestfish-actions.pod:1810 ../src/guestfs-actions.pod:2769
9644 msgid "Currently defined distros are:"
9648 #: ../fish/guestfish-actions.pod:1814 ../src/guestfs-actions.pod:2773
9649 msgid "\"archlinux\""
9653 #: ../fish/guestfish-actions.pod:1816 ../src/guestfs-actions.pod:2775
9658 #: ../fish/guestfish-actions.pod:1818 ../src/guestfs-actions.pod:2777
9663 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2779
9668 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2781
9673 #: ../fish/guestfish-actions.pod:1824 ../src/guestfs-actions.pod:2783
9678 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2785
9683 #: ../fish/guestfish-actions.pod:1828 ../src/guestfs-actions.pod:2787
9688 #: ../fish/guestfish-actions.pod:1830 ../src/guestfs-actions.pod:2789
9693 #: ../fish/guestfish-actions.pod:1832 ../src/guestfs-actions.pod:2791
9698 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2793
9699 msgid "\"linuxmint\""
9703 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2795
9708 #: ../fish/guestfish-actions.pod:1838 ../src/guestfs-actions.pod:2797
9713 #: ../fish/guestfish-actions.pod:1840 ../src/guestfs-actions.pod:2799
9718 #: ../fish/guestfish-actions.pod:1842 ../src/guestfs-actions.pod:2801
9719 msgid "\"mandriva\""
9723 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2803
9728 #: ../fish/guestfish-actions.pod:1846 ../src/guestfs-actions.pod:2805
9733 #: ../fish/guestfish-actions.pod:1848 ../src/guestfs-actions.pod:2807
9738 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2809
9739 msgid "\"opensuse\""
9743 #: ../fish/guestfish-actions.pod:1852 ../src/guestfs-actions.pod:2811
9748 #: ../fish/guestfish-actions.pod:1854 ../src/guestfs-actions.pod:2813
9753 #: ../fish/guestfish-actions.pod:1856 ../src/guestfs-actions.pod:2815
9758 #: ../fish/guestfish-actions.pod:1858 ../src/guestfs-actions.pod:2817
9759 msgid "\"redhat-based\""
9763 #: ../fish/guestfish-actions.pod:1860 ../src/guestfs-actions.pod:2819
9764 msgid "Some Red Hat-derived distro."
9768 #: ../fish/guestfish-actions.pod:1862 ../src/guestfs-actions.pod:2821
9773 #: ../fish/guestfish-actions.pod:1864 ../src/guestfs-actions.pod:2823
9774 msgid "Red Hat Enterprise Linux."
9778 #: ../fish/guestfish-actions.pod:1866 ../src/guestfs-actions.pod:2825
9779 msgid "\"scientificlinux\""
9783 #: ../fish/guestfish-actions.pod:1868 ../src/guestfs-actions.pod:2827
9784 msgid "Scientific Linux."
9788 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2829
9789 msgid "\"slackware\""
9793 #: ../fish/guestfish-actions.pod:1872 ../src/guestfs-actions.pod:2831
9798 #: ../fish/guestfish-actions.pod:1874 ../src/guestfs-actions.pod:2833
9799 msgid "\"ttylinux\""
9803 #: ../fish/guestfish-actions.pod:1876 ../src/guestfs-actions.pod:2835
9808 #: ../fish/guestfish-actions.pod:1878 ../src/guestfs-actions.pod:2837
9813 #: ../fish/guestfish-actions.pod:1880 ../src/guestfs-actions.pod:2839
9818 #: ../fish/guestfish-actions.pod:1882 ../fish/guestfish-actions.pod:1966
9819 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:2841
9820 #: ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3330
9825 #: ../fish/guestfish-actions.pod:1884 ../src/guestfs-actions.pod:2843
9826 msgid "The distro could not be determined."
9830 #: ../fish/guestfish-actions.pod:1886 ../fish/guestfish-actions.pod:2223
9831 #: ../src/guestfs-actions.pod:2845 ../src/guestfs-actions.pod:3318
9836 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:2847
9838 "Windows does not have distributions. This string is returned if the OS type "
9843 #: ../fish/guestfish-actions.pod:1893 ../fish/guestfish-actions.pod:1972
9844 #: ../fish/guestfish-actions.pod:2241 ../src/guestfs-actions.pod:2852
9845 #: ../src/guestfs-actions.pod:2956 ../src/guestfs-actions.pod:3336
9847 "Future versions of libguestfs may return other strings here. The caller "
9848 "should be prepared to handle any string."
9852 #: ../fish/guestfish-actions.pod:1898
9853 msgid "inspect-get-drive-mappings"
9857 #: ../fish/guestfish-actions.pod:1900
9860 " inspect-get-drive-mappings root\n"
9865 #: ../fish/guestfish-actions.pod:1902 ../src/guestfs-actions.pod:2868
9867 "This call is useful for Windows which uses a primitive system of assigning "
9868 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9869 "Windows Registry to find out how disks/partitions are mapped to drive "
9870 "letters, and returns a hash table as in the example below:"
9874 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2874
9884 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:2878
9886 "Note that keys are drive letters. For Windows, the key is case insensitive "
9887 "and just contains the drive letter, without the customary colon separator "
9892 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:2882
9894 "In future we may support other operating systems that also used drive "
9895 "letters, but the keys for those might not be case insensitive and might be "
9896 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9901 #: ../fish/guestfish-actions.pod:1921 ../src/guestfs-actions.pod:2887
9903 "For Windows guests, currently only hard drive mappings are returned. "
9904 "Removable disks (eg. DVD-ROMs) are ignored."
9908 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:2890
9910 "For guests that do not use drive mappings, or if the drive mappings could "
9911 "not be determined, this returns an empty hash table."
9915 #: ../fish/guestfish-actions.pod:1927
9917 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9918 "get-mountpoints>, L</inspect-get-filesystems>."
9922 #: ../fish/guestfish-actions.pod:1931
9923 msgid "inspect-get-filesystems"
9927 #: ../fish/guestfish-actions.pod:1933
9930 " inspect-get-filesystems root\n"
9935 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2911
9937 "This returns a list of all the filesystems that we think are associated with "
9938 "this operating system. This includes the root filesystem, other ordinary "
9939 "filesystems, and non-mounted devices like swap partitions."
9943 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2916
9945 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9946 "to be shared between operating systems."
9950 #: ../fish/guestfish-actions.pod:1943
9952 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9957 #: ../fish/guestfish-actions.pod:1946
9958 msgid "inspect-get-format"
9962 #: ../fish/guestfish-actions.pod:1948
9965 " inspect-get-format root\n"
9970 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2934
9972 "This returns the format of the inspected operating system. You can use it "
9973 "to detect install images, live CDs and similar."
9977 #: ../fish/guestfish-actions.pod:1953 ../src/guestfs-actions.pod:2937
9978 msgid "Currently defined formats are:"
9982 #: ../fish/guestfish-actions.pod:1957 ../src/guestfs-actions.pod:2941
9983 msgid "\"installed\""
9987 #: ../fish/guestfish-actions.pod:1959 ../src/guestfs-actions.pod:2943
9988 msgid "This is an installed operating system."
9992 #: ../fish/guestfish-actions.pod:1961 ../src/guestfs-actions.pod:2945
9993 msgid "\"installer\""
9997 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:2947
9999 "The disk image being inspected is not an installed operating system, but a "
10000 "I<bootable> install disk, live CD, or similar."
10004 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2952
10005 msgid "The format of this disk image is not known."
10009 #: ../fish/guestfish-actions.pod:1977
10010 msgid "inspect-get-hostname"
10014 #: ../fish/guestfish-actions.pod:1979
10017 " inspect-get-hostname root\n"
10022 #: ../fish/guestfish-actions.pod:1981 ../src/guestfs-actions.pod:2972
10024 "This function returns the hostname of the operating system as found by "
10025 "inspection of the guest's configuration files."
10029 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2975
10031 "If the hostname could not be determined, then the string C<unknown> is "
10036 #: ../fish/guestfish-actions.pod:1989
10037 msgid "inspect-get-icon"
10041 #: ../fish/guestfish-actions.pod:1991
10044 " inspect-get-icon root [favicon:..] [highquality:..]\n"
10049 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3001
10051 "This function returns an icon corresponding to the inspected operating "
10052 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
10053 "to PNG if necessary)."
10057 #: ../fish/guestfish-actions.pod:1997 ../src/guestfs-actions.pod:3005
10059 "If it was not possible to get an icon this function returns a zero-length "
10060 "(non-NULL) buffer. I<Callers must check for this case>."
10064 #: ../fish/guestfish-actions.pod:2000 ../src/guestfs-actions.pod:3008
10066 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
10067 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
10068 "this file will be returned. You can disable favicons by passing the "
10069 "optional C<favicon> boolean as false (default is true)."
10073 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3014
10075 "If finding the favicon fails, then we look in other places in the guest for "
10080 #: ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:3017
10082 "If the optional C<highquality> boolean is true then only high quality icons "
10083 "are returned, which means only icons of high resolution with an alpha "
10084 "channel. The default (false) is to return any icon we can, even if it is of "
10085 "substandard quality."
10089 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3028
10091 "Unlike most other inspection API calls, the guest's disks must be mounted up "
10092 "before you call this, since it needs to read information from the guest "
10093 "filesystem during the call."
10097 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3034
10099 "B<Security:> The icon data comes from the untrusted guest, and should be "
10100 "treated with caution. PNG files have been known to contain exploits. "
10101 "Ensure that libpng (or other relevant libraries) are fully up to date before "
10102 "trying to process or display the icon."
10106 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3042
10108 "The PNG image returned can be any size. It might not be square. Libguestfs "
10109 "tries to return the largest, highest quality icon available. The "
10110 "application must scale the icon to the required size."
10114 #: ../fish/guestfish-actions.pod:2041 ../src/guestfs-actions.pod:3049
10116 "Extracting icons from Windows guests requires the external C<wrestool> "
10117 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
10118 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
10119 "installed separately."
10123 #: ../fish/guestfish-actions.pod:2048 ../src/guestfs-actions.pod:3056
10125 "Operating system icons are usually trademarks. Seek legal advice before "
10126 "using trademarks in applications."
10130 #: ../fish/guestfish-actions.pod:2055
10131 msgid "inspect-get-major-version"
10135 #: ../fish/guestfish-actions.pod:2057
10138 " inspect-get-major-version root\n"
10143 #: ../fish/guestfish-actions.pod:2059 ../src/guestfs-actions.pod:3097
10145 "This returns the major version number of the inspected operating system."
10149 #: ../fish/guestfish-actions.pod:2062 ../src/guestfs-actions.pod:3100
10151 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
10152 "popular public names used by the operating system. Notably the operating "
10153 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
10154 "1). You can find out the real versions corresponding to releases of Windows "
10155 "by consulting Wikipedia or MSDN."
10159 #: ../fish/guestfish-actions.pod:2069 ../fish/guestfish-actions.pod:2080
10160 #: ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3124
10161 msgid "If the version could not be determined, then C<0> is returned."
10165 #: ../fish/guestfish-actions.pod:2073
10166 msgid "inspect-get-minor-version"
10170 #: ../fish/guestfish-actions.pod:2075
10173 " inspect-get-minor-version root\n"
10178 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3121
10180 "This returns the minor version number of the inspected operating system."
10184 #: ../fish/guestfish-actions.pod:2082
10186 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10187 "get-major-version>."
10191 #: ../fish/guestfish-actions.pod:2085
10192 msgid "inspect-get-mountpoints"
10196 #: ../fish/guestfish-actions.pod:2087
10199 " inspect-get-mountpoints root\n"
10204 #: ../fish/guestfish-actions.pod:2089 ../src/guestfs-actions.pod:3139
10206 "This returns a hash of where we think the filesystems associated with this "
10207 "operating system should be mounted. Callers should note that this is at "
10208 "best an educated guess made by reading configuration files such as C</etc/"
10209 "fstab>. I<In particular note> that this may return filesystems which are "
10210 "non-existent or not mountable and callers should be prepared to handle or "
10211 "ignore failures if they try to mount them."
10215 #: ../fish/guestfish-actions.pod:2098 ../src/guestfs-actions.pod:3148
10217 "Each element in the returned hashtable has a key which is the path of the "
10218 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
10219 "mounted there (eg. C</dev/sda1>)."
10223 #: ../fish/guestfish-actions.pod:2103 ../src/guestfs-actions.pod:3153
10225 "Non-mounted devices such as swap devices are I<not> returned in this list."
10229 #: ../fish/guestfish-actions.pod:2106
10231 "For operating systems like Windows which still use drive letters, this call "
10232 "will only return an entry for the first drive \"mounted on\" C</>. For "
10233 "information about the mapping of drive letters to partitions, see L</inspect-"
10234 "get-drive-mappings>."
10238 #: ../fish/guestfish-actions.pod:2112
10240 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10241 "get-filesystems>."
10245 #: ../fish/guestfish-actions.pod:2115
10246 msgid "inspect-get-package-format"
10250 #: ../fish/guestfish-actions.pod:2117
10253 " inspect-get-package-format root\n"
10258 #: ../fish/guestfish-actions.pod:2119
10260 "This function and L</inspect-get-package-management> return the package "
10261 "format and package management tool used by the inspected operating system. "
10262 "For example for Fedora these functions would return C<rpm> (package format) "
10263 "and C<yum> (package management)."
10267 #: ../fish/guestfish-actions.pod:2125 ../src/guestfs-actions.pod:3185
10269 "This returns the string C<unknown> if we could not determine the package "
10270 "format I<or> if the operating system does not have a real packaging system "
10275 #: ../fish/guestfish-actions.pod:2129 ../src/guestfs-actions.pod:3189
10277 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
10278 "C<pkgsrc>. Future versions of libguestfs may return other strings."
10282 #: ../fish/guestfish-actions.pod:2135
10283 msgid "inspect-get-package-management"
10287 #: ../fish/guestfish-actions.pod:2137
10290 " inspect-get-package-management root\n"
10295 #: ../fish/guestfish-actions.pod:2139
10297 "L</inspect-get-package-format> and this function return the package format "
10298 "and package management tool used by the inspected operating system. For "
10299 "example for Fedora these functions would return C<rpm> (package format) and "
10300 "C<yum> (package management)."
10304 #: ../fish/guestfish-actions.pod:2145 ../src/guestfs-actions.pod:3212
10306 "This returns the string C<unknown> if we could not determine the package "
10307 "management tool I<or> if the operating system does not have a real packaging "
10308 "system (eg. Windows)."
10312 #: ../fish/guestfish-actions.pod:2149 ../src/guestfs-actions.pod:3216
10314 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10315 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
10316 "versions of libguestfs may return other strings."
10320 #: ../fish/guestfish-actions.pod:2156
10321 msgid "inspect-get-product-name"
10325 #: ../fish/guestfish-actions.pod:2158
10328 " inspect-get-product-name root\n"
10333 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3234
10335 "This returns the product name of the inspected operating system. The "
10336 "product name is generally some freeform string which can be displayed to the "
10337 "user, but should not be parsed by programs."
10341 #: ../fish/guestfish-actions.pod:2165 ../src/guestfs-actions.pod:3239
10343 "If the product name could not be determined, then the string C<unknown> is "
10348 #: ../fish/guestfish-actions.pod:2170
10349 msgid "inspect-get-product-variant"
10353 #: ../fish/guestfish-actions.pod:2172
10356 " inspect-get-product-variant root\n"
10361 #: ../fish/guestfish-actions.pod:2174 ../src/guestfs-actions.pod:3255
10362 msgid "This returns the product variant of the inspected operating system."
10366 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3258
10368 "For Windows guests, this returns the contents of the Registry key C<HKLM"
10369 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
10370 "is usually a string such as C<Client> or C<Server> (other values are "
10371 "possible). This can be used to distinguish consumer and enterprise versions "
10372 "of Windows that have the same version number (for example, Windows 7 and "
10373 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10374 "the latter is C<Server>)."
10378 #: ../fish/guestfish-actions.pod:2186 ../src/guestfs-actions.pod:3267
10380 "For enterprise Linux guests, in future we intend this to return the product "
10381 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10382 "implemented at present."
10386 #: ../fish/guestfish-actions.pod:2190 ../src/guestfs-actions.pod:3271
10388 "If the product variant could not be determined, then the string C<unknown> "
10393 #: ../fish/guestfish-actions.pod:2193
10395 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10396 "get-product-name>, L</inspect-get-major-version>."
10400 #: ../fish/guestfish-actions.pod:2197
10401 msgid "inspect-get-roots"
10405 #: ../fish/guestfish-actions.pod:2199
10408 " inspect-get-roots\n"
10413 #: ../fish/guestfish-actions.pod:2201
10415 "This function is a convenient way to get the list of root devices, as "
10416 "returned from a previous call to L</inspect-os>, but without redoing the "
10417 "whole inspection process."
10421 #: ../fish/guestfish-actions.pod:2205
10423 "This returns an empty list if either no root devices were found or the "
10424 "caller has not called L</inspect-os>."
10428 #: ../fish/guestfish-actions.pod:2210
10429 msgid "inspect-get-type"
10433 #: ../fish/guestfish-actions.pod:2212
10436 " inspect-get-type root\n"
10441 #: ../fish/guestfish-actions.pod:2214 ../src/guestfs-actions.pod:3309
10443 "This returns the type of the inspected operating system. Currently defined "
10448 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3314
10453 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3316
10454 msgid "Any Linux-based operating system."
10458 #: ../fish/guestfish-actions.pod:2225 ../src/guestfs-actions.pod:3320
10459 msgid "Any Microsoft Windows operating system."
10463 #: ../fish/guestfish-actions.pod:2227 ../src/guestfs-actions.pod:3322
10464 msgid "\"freebsd\""
10468 #: ../fish/guestfish-actions.pod:2229 ../src/guestfs-actions.pod:3324
10473 #: ../fish/guestfish-actions.pod:2231 ../src/guestfs-actions.pod:3326
10478 #: ../fish/guestfish-actions.pod:2233 ../src/guestfs-actions.pod:3328
10483 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3332
10484 msgid "The operating system type could not be determined."
10488 #: ../fish/guestfish-actions.pod:2246
10489 msgid "inspect-get-windows-current-control-set"
10493 #: ../fish/guestfish-actions.pod:2248
10496 " inspect-get-windows-current-control-set root\n"
10501 #: ../fish/guestfish-actions.pod:2250 ../src/guestfs-actions.pod:3352
10503 "This returns the Windows CurrentControlSet of the inspected guest. The "
10504 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10508 #: ../fish/guestfish-actions.pod:2253 ../src/guestfs-actions.pod:3355
10510 "This call assumes that the guest is Windows and that the Registry could be "
10511 "examined by inspection. If this is not the case then an error is returned."
10515 #: ../fish/guestfish-actions.pod:2259
10516 msgid "inspect-get-windows-systemroot"
10520 #: ../fish/guestfish-actions.pod:2261
10523 " inspect-get-windows-systemroot root\n"
10528 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3372
10530 "This returns the Windows systemroot of the inspected guest. The systemroot "
10531 "is a directory path such as C</WINDOWS>."
10535 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3375
10537 "This call assumes that the guest is Windows and that the systemroot could be "
10538 "determined by inspection. If this is not the case then an error is returned."
10542 #: ../fish/guestfish-actions.pod:2272
10543 msgid "inspect-is-live"
10547 #: ../fish/guestfish-actions.pod:2274
10550 " inspect-is-live root\n"
10555 #: ../fish/guestfish-actions.pod:2276
10557 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10558 "then this returns true if a live image was detected on the disk."
10562 #: ../fish/guestfish-actions.pod:2282
10563 msgid "inspect-is-multipart"
10567 #: ../fish/guestfish-actions.pod:2284
10570 " inspect-is-multipart root\n"
10575 #: ../fish/guestfish-actions.pod:2286
10577 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10578 "then this returns true if the disk is part of a set."
10582 #: ../fish/guestfish-actions.pod:2292
10583 msgid "inspect-is-netinst"
10587 #: ../fish/guestfish-actions.pod:2294
10590 " inspect-is-netinst root\n"
10595 #: ../fish/guestfish-actions.pod:2296
10597 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10598 "then this returns true if the disk is a network installer, ie. not a self-"
10599 "contained install CD but one which is likely to require network access to "
10600 "complete the install."
10604 #: ../fish/guestfish-actions.pod:2304
10605 msgid "inspect-list-applications"
10609 #: ../fish/guestfish-actions.pod:2306
10612 " inspect-list-applications root\n"
10617 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3442
10618 msgid "Return the list of applications installed in the operating system."
10622 #: ../fish/guestfish-actions.pod:2310
10624 "I<Note:> This call works differently from other parts of the inspection "
10625 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10626 "then mount up the disks, before calling this. Listing applications is a "
10627 "significantly more difficult operation which requires access to the full "
10628 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10629 "are just returning data cached in the libguestfs handle, this call actually "
10630 "reads parts of the mounted filesystems during the call."
10634 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3454
10636 "This returns an empty list if the inspection code was not able to determine "
10637 "the list of applications."
10641 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3457
10642 msgid "The application structure contains the following fields:"
10646 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3461
10647 msgid "C<app_name>"
10651 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3463
10653 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10654 "guests, this is the package name."
10658 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3466
10659 msgid "C<app_display_name>"
10663 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3468
10665 "The display name of the application, sometimes localized to the install "
10666 "language of the guest operating system."
10670 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3471
10672 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10673 "to display something can use C<app_name> instead."
10677 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3474
10678 msgid "C<app_epoch>"
10682 #: ../fish/guestfish-actions.pod:2342 ../src/guestfs-actions.pod:3476
10684 "For package managers which use epochs, this contains the epoch of the "
10685 "package (an integer). If unavailable, this is returned as C<0>."
10689 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3479
10690 msgid "C<app_version>"
10694 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3481
10696 "The version string of the application or package. If unavailable this is "
10697 "returned as an empty string C<\"\">."
10701 #: ../fish/guestfish-actions.pod:2350 ../src/guestfs-actions.pod:3484
10702 msgid "C<app_release>"
10706 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3486
10708 "The release string of the application or package, for package managers that "
10709 "use this. If unavailable this is returned as an empty string C<\"\">."
10713 #: ../fish/guestfish-actions.pod:2356 ../src/guestfs-actions.pod:3490
10714 msgid "C<app_install_path>"
10718 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3492
10720 "The installation path of the application (on operating systems such as "
10721 "Windows which use installation paths). This path is in the format used by "
10722 "the guest operating system, it is not a libguestfs path."
10726 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3497
10727 msgid "If unavailable this is returned as an empty string C<\"\">."
10731 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3499
10732 msgid "C<app_trans_path>"
10736 #: ../fish/guestfish-actions.pod:2367 ../src/guestfs-actions.pod:3501
10738 "The install path translated into a libguestfs path. If unavailable this is "
10739 "returned as an empty string C<\"\">."
10743 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3504
10744 msgid "C<app_publisher>"
10748 #: ../fish/guestfish-actions.pod:2372 ../src/guestfs-actions.pod:3506
10750 "The name of the publisher of the application, for package managers that use "
10751 "this. If unavailable this is returned as an empty string C<\"\">."
10755 #: ../fish/guestfish-actions.pod:2376 ../src/guestfs-actions.pod:3510
10760 #: ../fish/guestfish-actions.pod:2378 ../src/guestfs-actions.pod:3512
10762 "The URL (eg. upstream URL) of the application. If unavailable this is "
10763 "returned as an empty string C<\"\">."
10767 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3515
10768 msgid "C<app_source_package>"
10772 #: ../fish/guestfish-actions.pod:2383 ../src/guestfs-actions.pod:3517
10774 "For packaging systems which support this, the name of the source package. "
10775 "If unavailable this is returned as an empty string C<\"\">."
10779 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3520
10780 msgid "C<app_summary>"
10784 #: ../fish/guestfish-actions.pod:2388 ../src/guestfs-actions.pod:3522
10786 "A short (usually one line) description of the application or package. If "
10787 "unavailable this is returned as an empty string C<\"\">."
10791 #: ../fish/guestfish-actions.pod:2391 ../src/guestfs-actions.pod:3525
10792 msgid "C<app_description>"
10796 #: ../fish/guestfish-actions.pod:2393 ../src/guestfs-actions.pod:3527
10798 "A longer description of the application or package. If unavailable this is "
10799 "returned as an empty string C<\"\">."
10803 #: ../fish/guestfish-actions.pod:2400
10808 #: ../fish/guestfish-actions.pod:2402
10816 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3545
10818 "This function uses other libguestfs functions and certain heuristics to "
10819 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10820 "for operating systems."
10824 #: ../fish/guestfish-actions.pod:2408 ../src/guestfs-actions.pod:3549
10825 msgid "The list returned is empty if no operating systems were found."
10829 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3551
10831 "If one operating system was found, then this returns a list with a single "
10832 "element, which is the name of the root filesystem of this operating system. "
10833 "It is also possible for this function to return a list containing more than "
10834 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10835 "element being the root filesystem of one of the operating systems."
10839 #: ../fish/guestfish-actions.pod:2417
10841 "You can pass the root string(s) returned to other L</inspect-get-*> "
10842 "functions in order to query further information about each operating system, "
10843 "such as the name and version."
10847 #: ../fish/guestfish-actions.pod:2422
10849 "This function uses other libguestfs features such as L</mount-ro> and L</"
10850 "umount-all> in order to mount and unmount filesystems and look at the "
10851 "contents. This should be called with no disks currently mounted. The "
10852 "function may also use Augeas, so any existing Augeas handle will be closed."
10856 #: ../fish/guestfish-actions.pod:2428 ../src/guestfs-actions.pod:3569
10858 "This function cannot decrypt encrypted disks. The caller must do that first "
10859 "(supplying the necessary keys) if the disk is encrypted."
10863 #: ../fish/guestfish-actions.pod:2434 ../fish/guestfish-actions.pod:2632
10864 #: ../fish/guestfish-actions.pod:2691
10865 msgid "See also L</list-filesystems>."
10869 #: ../fish/guestfish-actions.pod:2436
10870 msgid "is-blockdev"
10874 #: ../fish/guestfish-actions.pod:2438
10877 " is-blockdev path\n"
10882 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3589
10884 "This returns C<true> if and only if there is a block device with the given "
10889 #: ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2461
10890 #: ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2489
10891 #: ../fish/guestfish-actions.pod:2499 ../fish/guestfish-actions.pod:2533
10892 #: ../fish/guestfish-actions.pod:2542
10893 msgid "See also L</stat>."
10897 #: ../fish/guestfish-actions.pod:2445
10902 #: ../fish/guestfish-actions.pod:2447
10910 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3603
10912 "This returns true iff this handle is busy processing a command (in the "
10917 #: ../fish/guestfish-actions.pod:2454
10922 #: ../fish/guestfish-actions.pod:2456
10925 " is-chardev path\n"
10930 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3618
10932 "This returns C<true> if and only if there is a character device with the "
10933 "given C<path> name."
10937 #: ../fish/guestfish-actions.pod:2463
10942 #: ../fish/guestfish-actions.pod:2465
10950 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3632
10952 "This returns true iff this handle is being configured (in the C<CONFIG> "
10957 #: ../fish/guestfish-actions.pod:2472
10962 #: ../fish/guestfish-actions.pod:2474
10970 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3647
10972 "This returns C<true> if and only if there is a directory with the given "
10973 "C<path> name. Note that it returns false for other objects like files."
10977 #: ../fish/guestfish-actions.pod:2482
10982 #: ../fish/guestfish-actions.pod:2484
10990 #: ../fish/guestfish-actions.pod:2486 ../src/guestfs-actions.pod:3663
10992 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10993 "given C<path> name."
10997 #: ../fish/guestfish-actions.pod:2491
11002 #: ../fish/guestfish-actions.pod:2493
11010 #: ../fish/guestfish-actions.pod:2495 ../src/guestfs-actions.pod:3678
11012 "This returns C<true> if and only if there is a regular file with the given "
11013 "C<path> name. Note that it returns false for other objects like directories."
11017 #: ../fish/guestfish-actions.pod:2501
11018 msgid "is-launching"
11022 #: ../fish/guestfish-actions.pod:2503
11030 #: ../fish/guestfish-actions.pod:2505 ../src/guestfs-actions.pod:3693
11032 "This returns true iff this handle is launching the subprocess (in the "
11033 "C<LAUNCHING> state)."
11037 #: ../fish/guestfish-actions.pod:2510
11042 #: ../fish/guestfish-actions.pod:2512
11050 #: ../fish/guestfish-actions.pod:2514 ../src/guestfs-actions.pod:3708
11052 "This command tests whether C<device> is a logical volume, and returns true "
11053 "iff this is the case."
11057 #: ../fish/guestfish-actions.pod:2517
11062 #: ../fish/guestfish-actions.pod:2519
11070 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3720
11072 "This returns true iff this handle is ready to accept commands (in the "
11077 #: ../fish/guestfish-actions.pod:2526
11082 #: ../fish/guestfish-actions.pod:2528
11085 " is-socket path\n"
11090 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3735
11092 "This returns C<true> if and only if there is a Unix domain socket with the "
11093 "given C<path> name."
11097 #: ../fish/guestfish-actions.pod:2535
11102 #: ../fish/guestfish-actions.pod:2537
11105 " is-symlink path\n"
11110 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3750
11112 "This returns C<true> if and only if there is a symbolic link with the given "
11117 #: ../fish/guestfish-actions.pod:2544
11122 #: ../fish/guestfish-actions.pod:2546
11130 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3765
11132 "This returns true iff the file exists and the file is empty or it contains "
11137 #: ../fish/guestfish-actions.pod:2551
11138 msgid "is-zero-device"
11142 #: ../fish/guestfish-actions.pod:2553
11145 " is-zero-device device\n"
11150 #: ../fish/guestfish-actions.pod:2555 ../src/guestfs-actions.pod:3778
11151 msgid "This returns true iff the device exists and contains all zero bytes."
11155 #: ../fish/guestfish-actions.pod:2557 ../src/guestfs-actions.pod:3780
11156 msgid "Note that for large devices this can take a long time to run."
11160 #: ../fish/guestfish-actions.pod:2559
11161 msgid "kill-subprocess"
11165 #: ../fish/guestfish-actions.pod:2561
11168 " kill-subprocess\n"
11173 #: ../fish/guestfish-actions.pod:2563 ../src/guestfs-actions.pod:3791
11174 msgid "This kills the qemu subprocess. You should never need to call this."
11178 #: ../fish/guestfish-actions.pod:2565
11183 #: ../fish/guestfish-actions.pod:2567
11188 #: ../fish/guestfish-actions.pod:2569
11196 #: ../fish/guestfish-actions.pod:2571 ../src/guestfs-actions.pod:3802
11198 "Internally libguestfs is implemented by running a virtual machine using "
11203 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3805
11205 "You should call this after configuring the handle (eg. adding drives) but "
11206 "before performing any actions."
11210 #: ../fish/guestfish-actions.pod:2577
11215 #: ../fish/guestfish-actions.pod:2579
11218 " lchown owner group path\n"
11223 #: ../fish/guestfish-actions.pod:2581
11225 "Change the file owner to C<owner> and group to C<group>. This is like L</"
11226 "chown> but if C<path> is a symlink then the link itself is changed, not the "
11231 #: ../fish/guestfish-actions.pod:2589
11236 #: ../fish/guestfish-actions.pod:2591
11239 " lgetxattr path name\n"
11244 #: ../fish/guestfish-actions.pod:2593 ../src/guestfs-actions.pod:3845
11246 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
11247 "is a symlink, then this call returns an extended attribute from the symlink."
11251 #: ../fish/guestfish-actions.pod:2607
11252 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
11256 #: ../fish/guestfish-actions.pod:2609
11261 #: ../fish/guestfish-actions.pod:2611
11264 " lgetxattrs path\n"
11269 #: ../fish/guestfish-actions.pod:2613
11271 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
11272 "it returns the extended attributes of the link itself."
11276 #: ../fish/guestfish-actions.pod:2617
11281 #: ../fish/guestfish-actions.pod:2619
11289 #: ../fish/guestfish-actions.pod:2621 ../src/guestfs-actions.pod:3888
11291 "List all 9p filesystems attached to the guest. A list of mount tags is "
11296 #: ../fish/guestfish-actions.pod:2624
11297 msgid "list-devices"
11301 #: ../fish/guestfish-actions.pod:2626
11309 #: ../fish/guestfish-actions.pod:2628 ../src/guestfs-actions.pod:3902
11310 msgid "List all the block devices."
11314 #: ../fish/guestfish-actions.pod:2630 ../src/guestfs-actions.pod:3904
11315 msgid "The full block device names are returned, eg. C</dev/sda>."
11319 #: ../fish/guestfish-actions.pod:2634
11320 msgid "list-dm-devices"
11324 #: ../fish/guestfish-actions.pod:2636
11327 " list-dm-devices\n"
11332 #: ../fish/guestfish-actions.pod:2638 ../src/guestfs-actions.pod:3919
11333 msgid "List all device mapper devices."
11337 #: ../fish/guestfish-actions.pod:2640
11339 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
11340 "previous call to L</luks-open>."
11344 #: ../fish/guestfish-actions.pod:2643
11346 "Device mapper devices which correspond to logical volumes are I<not> "
11347 "returned in this list. Call L</lvs> if you want to list logical volumes."
11351 #: ../fish/guestfish-actions.pod:2647
11352 msgid "list-filesystems"
11356 #: ../fish/guestfish-actions.pod:2649
11359 " list-filesystems\n"
11364 #: ../fish/guestfish-actions.pod:2651 ../src/guestfs-actions.pod:3939
11366 "This inspection command looks for filesystems on partitions, block devices "
11367 "and logical volumes, returning a list of devices containing filesystems and "
11372 #: ../fish/guestfish-actions.pod:2655 ../src/guestfs-actions.pod:3943
11374 "The return value is a hash, where the keys are the devices containing "
11375 "filesystems, and the values are the filesystem types. For example:"
11379 #: ../fish/guestfish-actions.pod:2659 ../src/guestfs-actions.pod:3947
11382 " \"/dev/sda1\" => \"ntfs\"\n"
11383 " \"/dev/sda2\" => \"ext2\"\n"
11384 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11385 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11390 #: ../fish/guestfish-actions.pod:2664 ../src/guestfs-actions.pod:3952
11392 "The value can have the special value \"unknown\", meaning the content of the "
11393 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11397 #: ../fish/guestfish-actions.pod:2668
11399 "This command runs other libguestfs commands, which might include L</mount> "
11400 "and L</umount>, and therefore you should use this soon after launch and only "
11401 "when nothing is mounted."
11405 #: ../fish/guestfish-actions.pod:2672
11407 "Not all of the filesystems returned will be mountable. In particular, swap "
11408 "partitions are returned in the list. Also this command does not check that "
11409 "each filesystem found is valid and mountable, and some filesystems might be "
11410 "mountable but require special options. Filesystems may not all belong to a "
11411 "single logical operating system (use L</inspect-os> to look for OSes)."
11415 #: ../fish/guestfish-actions.pod:2680
11416 msgid "list-partitions"
11420 #: ../fish/guestfish-actions.pod:2682
11423 " list-partitions\n"
11428 #: ../fish/guestfish-actions.pod:2684 ../src/guestfs-actions.pod:3981
11429 msgid "List all the partitions detected on all block devices."
11433 #: ../fish/guestfish-actions.pod:2686 ../src/guestfs-actions.pod:3983
11434 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11438 #: ../fish/guestfish-actions.pod:2688
11440 "This does not return logical volumes. For that you will need to call L</"
11445 #: ../fish/guestfish-actions.pod:2693
11450 #: ../fish/guestfish-actions.pod:2695
11458 #: ../fish/guestfish-actions.pod:2697 ../src/guestfs-actions.pod:4002
11460 "List the files in C<directory> (relative to the root directory, there is no "
11461 "cwd) in the format of 'ls -la'."
11465 #: ../fish/guestfish-actions.pod:2700 ../src/guestfs-actions.pod:4005
11467 "This command is mostly useful for interactive sessions. It is I<not> "
11468 "intended that you try to parse the output string."
11472 #: ../fish/guestfish-actions.pod:2703
11477 #: ../fish/guestfish-actions.pod:2705
11480 " ln target linkname\n"
11485 #: ../fish/guestfish-actions.pod:2707 ../src/guestfs-actions.pod:4020
11486 msgid "This command creates a hard link using the C<ln> command."
11490 #: ../fish/guestfish-actions.pod:2709
11495 #: ../fish/guestfish-actions.pod:2711
11498 " ln-f target linkname\n"
11503 #: ../fish/guestfish-actions.pod:2713 ../src/guestfs-actions.pod:4033
11505 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11506 "option removes the link (C<linkname>) if it exists already."
11510 #: ../fish/guestfish-actions.pod:2716
11515 #: ../fish/guestfish-actions.pod:2718
11518 " ln-s target linkname\n"
11523 #: ../fish/guestfish-actions.pod:2720 ../src/guestfs-actions.pod:4047
11524 msgid "This command creates a symbolic link using the C<ln -s> command."
11528 #: ../fish/guestfish-actions.pod:2722
11533 #: ../fish/guestfish-actions.pod:2724
11536 " ln-sf target linkname\n"
11541 #: ../fish/guestfish-actions.pod:2726 ../src/guestfs-actions.pod:4060
11543 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11544 "option removes the link (C<linkname>) if it exists already."
11548 #: ../fish/guestfish-actions.pod:2729
11549 msgid "lremovexattr"
11553 #: ../fish/guestfish-actions.pod:2731
11556 " lremovexattr xattr path\n"
11561 #: ../fish/guestfish-actions.pod:2733
11563 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11564 "it removes an extended attribute of the link itself."
11568 #: ../fish/guestfish-actions.pod:2737
11573 #: ../fish/guestfish-actions.pod:2739
11581 #: ../fish/guestfish-actions.pod:2741 ../src/guestfs-actions.pod:4088
11583 "List the files in C<directory> (relative to the root directory, there is no "
11584 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
11588 #: ../fish/guestfish-actions.pod:2745
11590 "This command is mostly useful for interactive sessions. Programs should "
11591 "probably use L</readdir> instead."
11595 #: ../fish/guestfish-actions.pod:2748
11600 #: ../fish/guestfish-actions.pod:2750
11603 " lsetxattr xattr val vallen path\n"
11608 #: ../fish/guestfish-actions.pod:2752
11610 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11611 "sets an extended attribute of the link itself."
11615 #: ../fish/guestfish-actions.pod:2756
11620 #: ../fish/guestfish-actions.pod:2758
11628 #: ../fish/guestfish-actions.pod:2760 ../fish/guestfish-actions.pod:4570
11629 #: ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:6909
11630 msgid "Returns file information for the given C<path>."
11634 #: ../fish/guestfish-actions.pod:2762
11636 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11637 "the link is stat-ed, not the file it refers to."
11641 #: ../fish/guestfish-actions.pod:2766 ../src/guestfs-actions.pod:4130
11642 msgid "This is the same as the C<lstat(2)> system call."
11646 #: ../fish/guestfish-actions.pod:2768
11651 #: ../fish/guestfish-actions.pod:2770
11654 " lstatlist path 'names ...'\n"
11659 #: ../fish/guestfish-actions.pod:2772
11661 "This call allows you to perform the L</lstat> operation on multiple files, "
11662 "where all files are in the directory C<path>. C<names> is the list of files "
11663 "from this directory."
11667 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4149
11669 "On return you get a list of stat structs, with a one-to-one correspondence "
11670 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11671 "then the C<ino> field of that structure is set to C<-1>."
11675 #: ../fish/guestfish-actions.pod:2781
11677 "This call is intended for programs that want to efficiently list a directory "
11678 "contents without making many round-trips. See also L</lxattrlist> for a "
11679 "similarly efficient call for getting extended attributes. Very long "
11680 "directory listings might cause the protocol message size to be exceeded, "
11681 "causing this call to fail. The caller must split up such requests into "
11682 "smaller groups of names."
11686 #: ../fish/guestfish-actions.pod:2789
11687 msgid "luks-add-key"
11691 #: ../fish/guestfish-actions.pod:2791
11694 " luks-add-key device keyslot\n"
11699 #: ../fish/guestfish-actions.pod:2793 ../src/guestfs-actions.pod:4177
11701 "This command adds a new key on LUKS device C<device>. C<key> is any "
11702 "existing key, and is used to access the device. C<newkey> is the new key to "
11703 "add. C<keyslot> is the key slot that will be replaced."
11707 #: ../fish/guestfish-actions.pod:2798
11709 "Note that if C<keyslot> already contains a key, then this command will "
11710 "fail. You have to use L</luks-kill-slot> first to remove that key."
11714 #: ../fish/guestfish-actions.pod:2802 ../fish/guestfish-actions.pod:2824
11715 #: ../fish/guestfish-actions.pod:2837 ../fish/guestfish-actions.pod:2851
11716 #: ../fish/guestfish-actions.pod:2877 ../fish/guestfish-actions.pod:2887
11718 "This command has one or more key or passphrase parameters. Guestfish will "
11719 "prompt for these separately."
11723 #: ../fish/guestfish-actions.pod:2805
11728 #: ../fish/guestfish-actions.pod:2807
11731 " luks-close device\n"
11736 #: ../fish/guestfish-actions.pod:2809
11738 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
11739 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
11740 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
11745 #: ../fish/guestfish-actions.pod:2815
11746 msgid "luks-format"
11750 #: ../fish/guestfish-actions.pod:2817
11753 " luks-format device keyslot\n"
11758 #: ../fish/guestfish-actions.pod:2819 ../src/guestfs-actions.pod:4218
11760 "This command erases existing data on C<device> and formats the device as a "
11761 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11762 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11766 #: ../fish/guestfish-actions.pod:2827 ../fish/guestfish-actions.pod:2840
11767 #: ../fish/guestfish-actions.pod:2927 ../fish/guestfish-actions.pod:3578
11768 #: ../fish/guestfish-actions.pod:4104 ../fish/guestfish-actions.pod:4441
11769 #: ../fish/guestfish-actions.pod:4464 ../fish/guestfish-actions.pod:4486
11770 #: ../fish/guestfish-actions.pod:5232 ../src/guestfs-actions.pod:4225
11771 #: ../src/guestfs-actions.pod:4248 ../src/guestfs-actions.pod:4391
11772 #: ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:6272
11773 #: ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:6753
11774 #: ../src/guestfs-actions.pod:6786 ../src/guestfs-actions.pod:7985
11776 "B<This command is dangerous. Without careful use you can easily destroy all "
11781 #: ../fish/guestfish-actions.pod:2830
11782 msgid "luks-format-cipher"
11786 #: ../fish/guestfish-actions.pod:2832
11789 " luks-format-cipher device keyslot cipher\n"
11794 #: ../fish/guestfish-actions.pod:2834
11796 "This command is the same as L</luks-format> but it also allows you to set "
11797 "the C<cipher> used."
11801 #: ../fish/guestfish-actions.pod:2843
11802 msgid "luks-kill-slot"
11806 #: ../fish/guestfish-actions.pod:2845
11809 " luks-kill-slot device keyslot\n"
11814 #: ../fish/guestfish-actions.pod:2847 ../src/guestfs-actions.pod:4265
11816 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11817 "device C<device>. C<key> must be one of the I<other> keys."
11821 #: ../fish/guestfish-actions.pod:2854
11826 #: ../fish/guestfish-actions.pod:2856
11829 " luks-open device mapname\n"
11834 #: ../fish/guestfish-actions.pod:2858 ../src/guestfs-actions.pod:4285
11836 "This command opens a block device which has been encrypted according to the "
11837 "Linux Unified Key Setup (LUKS) standard."
11841 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4288
11842 msgid "C<device> is the encrypted block device or partition."
11846 #: ../fish/guestfish-actions.pod:2863 ../src/guestfs-actions.pod:4290
11848 "The caller must supply one of the keys associated with the LUKS block "
11849 "device, in the C<key> parameter."
11853 #: ../fish/guestfish-actions.pod:2866 ../src/guestfs-actions.pod:4293
11855 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11856 "writes to this block device are decrypted from and encrypted to the "
11857 "underlying C<device> respectively."
11861 #: ../fish/guestfish-actions.pod:2870
11863 "If this block device contains LVM volume groups, then calling L</vgscan> "
11864 "followed by L</vg-activate-all> will make them visible."
11868 #: ../fish/guestfish-actions.pod:2874
11869 msgid "Use L</list-dm-devices> to list all device mapper devices."
11873 #: ../fish/guestfish-actions.pod:2880
11874 msgid "luks-open-ro"
11878 #: ../fish/guestfish-actions.pod:2882
11881 " luks-open-ro device mapname\n"
11886 #: ../fish/guestfish-actions.pod:2884
11888 "This is the same as L</luks-open> except that a read-only mapping is created."
11892 #: ../fish/guestfish-actions.pod:2890
11897 #: ../fish/guestfish-actions.pod:2892
11900 " lvcreate logvol volgroup mbytes\n"
11905 #: ../fish/guestfish-actions.pod:2894 ../src/guestfs-actions.pod:4339
11907 "This creates an LVM logical volume called C<logvol> on the volume group "
11908 "C<volgroup>, with C<size> megabytes."
11912 #: ../fish/guestfish-actions.pod:2897
11913 msgid "lvm-canonical-lv-name"
11917 #: ../fish/guestfish-actions.pod:2899
11920 " lvm-canonical-lv-name lvname\n"
11925 #: ../fish/guestfish-actions.pod:2901 ../src/guestfs-actions.pod:4352
11927 "This converts alternative naming schemes for LVs that you might find to the "
11928 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
11933 #: ../fish/guestfish-actions.pod:2905 ../src/guestfs-actions.pod:4356
11935 "This command returns an error if the C<lvname> parameter does not refer to a "
11940 #: ../fish/guestfish-actions.pod:2908
11941 msgid "See also L</is-lv>."
11945 #: ../fish/guestfish-actions.pod:2910
11946 msgid "lvm-clear-filter"
11950 #: ../fish/guestfish-actions.pod:2912
11953 " lvm-clear-filter\n"
11958 #: ../fish/guestfish-actions.pod:2914
11960 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11965 #: ../fish/guestfish-actions.pod:2917 ../fish/guestfish-actions.pod:2948
11966 #: ../src/guestfs-actions.pod:4374 ../src/guestfs-actions.pod:4416
11968 "This command also clears the LVM cache and performs a volume group scan."
11972 #: ../fish/guestfish-actions.pod:2920
11973 msgid "lvm-remove-all"
11977 #: ../fish/guestfish-actions.pod:2922
11980 " lvm-remove-all\n"
11985 #: ../fish/guestfish-actions.pod:2924 ../src/guestfs-actions.pod:4386
11987 "This command removes all LVM logical volumes, volume groups and physical "
11992 #: ../fish/guestfish-actions.pod:2930
11993 msgid "lvm-set-filter"
11997 #: ../fish/guestfish-actions.pod:2932
12000 " lvm-set-filter 'devices ...'\n"
12005 #: ../fish/guestfish-actions.pod:2934 ../src/guestfs-actions.pod:4402
12007 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
12008 "block devices in the list C<devices>, and will ignore all other attached "
12013 #: ../fish/guestfish-actions.pod:2938 ../src/guestfs-actions.pod:4406
12015 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12016 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12017 "there are two types of duplication possible: either cloned PVs/VGs which "
12018 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12019 "same name. In normal operation you cannot create this situation, but you "
12020 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12021 "inside the LVM metadata."
12025 #: ../fish/guestfish-actions.pod:2951 ../src/guestfs-actions.pod:4419
12026 msgid "You can filter whole block devices or individual partitions."
12030 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4421
12032 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12033 "filesystem), even if you are not filtering out that VG."
12037 #: ../fish/guestfish-actions.pod:2957
12042 #: ../fish/guestfish-actions.pod:2959
12045 " lvremove device\n"
12050 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4435
12052 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12053 "LV, such as C</dev/VG/LV>."
12057 #: ../fish/guestfish-actions.pod:2964 ../src/guestfs-actions.pod:4438
12059 "You can also remove all LVs in a volume group by specifying the VG name, C</"
12064 #: ../fish/guestfish-actions.pod:2967
12069 #: ../fish/guestfish-actions.pod:2969
12072 " lvrename logvol newlogvol\n"
12077 #: ../fish/guestfish-actions.pod:2971 ../src/guestfs-actions.pod:4452
12078 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
12082 #: ../fish/guestfish-actions.pod:2973
12087 #: ../fish/guestfish-actions.pod:2975
12090 " lvresize device mbytes\n"
12095 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4465
12097 "This resizes (expands or shrinks) an existing LVM logical volume to "
12098 "C<mbytes>. When reducing, data in the reduced part is lost."
12102 #: ../fish/guestfish-actions.pod:2981
12103 msgid "lvresize-free"
12107 #: ../fish/guestfish-actions.pod:2983
12110 " lvresize-free lv percent\n"
12115 #: ../fish/guestfish-actions.pod:2985 ../src/guestfs-actions.pod:4480
12117 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
12118 "remaining free space in the volume group. Commonly you would call this with "
12119 "pc = 100 which expands the logical volume as much as possible, using all "
12120 "remaining free space in the volume group."
12124 #: ../fish/guestfish-actions.pod:2991
12129 #: ../fish/guestfish-actions.pod:2993
12137 #: ../fish/guestfish-actions.pod:2995 ../src/guestfs-actions.pod:4495
12139 "List all the logical volumes detected. This is the equivalent of the L<lvs"
12144 #: ../fish/guestfish-actions.pod:2998 ../src/guestfs-actions.pod:4498
12146 "This returns a list of the logical volume device names (eg. C</dev/"
12147 "VolGroup00/LogVol00>)."
12151 #: ../fish/guestfish-actions.pod:3001
12152 msgid "See also L</lvs-full>, L</list-filesystems>."
12156 #: ../fish/guestfish-actions.pod:3003
12161 #: ../fish/guestfish-actions.pod:3005
12169 #: ../fish/guestfish-actions.pod:3007 ../src/guestfs-actions.pod:4514
12171 "List all the logical volumes detected. This is the equivalent of the L<lvs"
12172 "(8)> command. The \"full\" version includes all fields."
12176 #: ../fish/guestfish-actions.pod:3010
12181 #: ../fish/guestfish-actions.pod:3012
12189 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4529
12190 msgid "This command returns the UUID of the LVM LV C<device>."
12194 #: ../fish/guestfish-actions.pod:3016
12199 #: ../fish/guestfish-actions.pod:3018
12202 " lxattrlist path 'names ...'\n"
12207 #: ../fish/guestfish-actions.pod:3020 ../src/guestfs-actions.pod:4543
12209 "This call allows you to get the extended attributes of multiple files, where "
12210 "all files are in the directory C<path>. C<names> is the list of files from "
12215 #: ../fish/guestfish-actions.pod:3024 ../src/guestfs-actions.pod:4547
12217 "On return you get a flat list of xattr structs which must be interpreted "
12218 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
12219 "C<attrval> in this struct is zero-length to indicate there was an error "
12220 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
12221 "number (the number of following attributes for this file, which could be C<"
12222 "\"0\">). Then after the first xattr struct are the zero or more attributes "
12223 "for the first named file. This repeats for the second and subsequent files."
12227 #: ../fish/guestfish-actions.pod:3034
12229 "This call is intended for programs that want to efficiently list a directory "
12230 "contents without making many round-trips. See also L</lstatlist> for a "
12231 "similarly efficient call for getting standard stats. Very long directory "
12232 "listings might cause the protocol message size to be exceeded, causing this "
12233 "call to fail. The caller must split up such requests into smaller groups of "
12238 #: ../fish/guestfish-actions.pod:3042
12243 #: ../fish/guestfish-actions.pod:3044
12251 #: ../fish/guestfish-actions.pod:3046 ../src/guestfs-actions.pod:4577
12252 msgid "Create a directory named C<path>."
12256 #: ../fish/guestfish-actions.pod:3048
12261 #: ../fish/guestfish-actions.pod:3050
12264 " mkdir-mode path mode\n"
12269 #: ../fish/guestfish-actions.pod:3052 ../src/guestfs-actions.pod:4590
12271 "This command creates a directory, setting the initial permissions of the "
12272 "directory to C<mode>."
12276 #: ../fish/guestfish-actions.pod:3055 ../src/guestfs-actions.pod:4593
12278 "For common Linux filesystems, the actual mode which is set will be C<mode & "
12279 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
12284 #: ../fish/guestfish-actions.pod:3059
12285 msgid "See also L</mkdir>, L</umask>"
12289 #: ../fish/guestfish-actions.pod:3061
12294 #: ../fish/guestfish-actions.pod:3063
12302 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4609
12304 "Create a directory named C<path>, creating any parent directories as "
12305 "necessary. This is like the C<mkdir -p> shell command."
12309 #: ../fish/guestfish-actions.pod:3068
12314 #: ../fish/guestfish-actions.pod:3070
12317 " mkdtemp template\n"
12322 #: ../fish/guestfish-actions.pod:3072 ../src/guestfs-actions.pod:4622
12324 "This command creates a temporary directory. The C<template> parameter "
12325 "should be a full pathname for the temporary directory name with the final "
12326 "six characters being \"XXXXXX\"."
12330 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4627
12332 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12333 "being suitable for Windows filesystems."
12337 #: ../fish/guestfish-actions.pod:3080 ../src/guestfs-actions.pod:4630
12338 msgid "The name of the temporary directory that was created is returned."
12342 #: ../fish/guestfish-actions.pod:3083 ../src/guestfs-actions.pod:4633
12343 msgid "The temporary directory is created with mode 0700 and is owned by root."
12347 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4636
12349 "The caller is responsible for deleting the temporary directory and its "
12350 "contents after use."
12354 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4639
12355 msgid "See also: L<mkdtemp(3)>"
12359 #: ../fish/guestfish-actions.pod:3091
12364 #: ../fish/guestfish-actions.pod:3093
12367 " mke2fs-J fstype blocksize device journal\n"
12372 #: ../fish/guestfish-actions.pod:3095 ../src/guestfs-actions.pod:4655
12374 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12375 "C<journal>. It is equivalent to the command:"
12379 #: ../fish/guestfish-actions.pod:3099 ../src/guestfs-actions.pod:4659
12382 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
12387 #: ../fish/guestfish-actions.pod:3101
12388 msgid "See also L</mke2journal>."
12392 #: ../fish/guestfish-actions.pod:3103
12397 #: ../fish/guestfish-actions.pod:3105
12400 " mke2fs-JL fstype blocksize device label\n"
12405 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4676
12407 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12408 "the journal labeled C<label>."
12412 #: ../fish/guestfish-actions.pod:3110
12413 msgid "See also L</mke2journal-L>."
12417 #: ../fish/guestfish-actions.pod:3112
12422 #: ../fish/guestfish-actions.pod:3114
12425 " mke2fs-JU fstype blocksize device uuid\n"
12430 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4694
12432 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12433 "the journal with UUID C<uuid>."
12437 #: ../fish/guestfish-actions.pod:3119
12438 msgid "See also L</mke2journal-U>."
12442 #: ../fish/guestfish-actions.pod:3121
12443 msgid "mke2journal"
12447 #: ../fish/guestfish-actions.pod:3123
12450 " mke2journal blocksize device\n"
12455 #: ../fish/guestfish-actions.pod:3125 ../src/guestfs-actions.pod:4710
12457 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12462 #: ../fish/guestfish-actions.pod:3128 ../src/guestfs-actions.pod:4713
12465 " mke2fs -O journal_dev -b blocksize device\n"
12470 #: ../fish/guestfish-actions.pod:3130
12471 msgid "mke2journal-L"
12475 #: ../fish/guestfish-actions.pod:3132
12478 " mke2journal-L blocksize label device\n"
12483 #: ../fish/guestfish-actions.pod:3134 ../src/guestfs-actions.pod:4727
12484 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12488 #: ../fish/guestfish-actions.pod:3136
12489 msgid "mke2journal-U"
12493 #: ../fish/guestfish-actions.pod:3138
12496 " mke2journal-U blocksize uuid device\n"
12501 #: ../fish/guestfish-actions.pod:3140 ../src/guestfs-actions.pod:4741
12502 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12506 #: ../fish/guestfish-actions.pod:3142
12511 #: ../fish/guestfish-actions.pod:3144
12514 " mkfifo mode path\n"
12519 #: ../fish/guestfish-actions.pod:3146
12521 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12522 "is just a convenient wrapper around L</mknod>."
12526 #: ../fish/guestfish-actions.pod:3152
12531 #: ../fish/guestfish-actions.pod:3154
12534 " mkfs fstype device\n"
12539 #: ../fish/guestfish-actions.pod:3156 ../src/guestfs-actions.pod:4771
12541 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12542 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12546 #: ../fish/guestfish-actions.pod:3160
12551 #: ../fish/guestfish-actions.pod:3162
12554 " mkfs-b fstype blocksize device\n"
12559 #: ../fish/guestfish-actions.pod:3164
12561 "This call is similar to L</mkfs>, but it allows you to control the block "
12562 "size of the resulting filesystem. Supported block sizes depend on the "
12563 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12567 #: ../fish/guestfish-actions.pod:3169 ../fish/guestfish-actions.pod:3196
12568 #: ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4837
12570 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12575 #: ../fish/guestfish-actions.pod:3172
12577 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
12582 #: ../fish/guestfish-actions.pod:3179
12587 #: ../fish/guestfish-actions.pod:3181
12590 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
12595 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4824
12597 "This function creates a filesystem on C<device>. The filesystem type is "
12598 "C<fstype>, for example C<ext3>."
12602 #: ../fish/guestfish-actions.pod:3190 ../src/guestfs-actions.pod:4831
12603 msgid "C<blocksize>"
12607 #: ../fish/guestfish-actions.pod:3192 ../src/guestfs-actions.pod:4833
12609 "The filesystem block size. Supported block sizes depend on the filesystem "
12610 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12615 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4840
12616 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12620 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4842
12621 msgid "C<features>"
12625 #: ../fish/guestfish-actions.pod:3203 ../src/guestfs-actions.pod:4844
12626 msgid "This passes the I<-O> parameter to the external mkfs program."
12630 #: ../fish/guestfish-actions.pod:3205 ../src/guestfs-actions.pod:4846
12632 "For certain filesystem types, this allows extra filesystem features to be "
12633 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12637 #: ../fish/guestfish-actions.pod:3209 ../src/guestfs-actions.pod:4850
12639 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12644 #: ../fish/guestfish-actions.pod:3212 ../src/guestfs-actions.pod:4853
12649 #: ../fish/guestfish-actions.pod:3214 ../src/guestfs-actions.pod:4855
12651 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12652 "sets the inode size (only for ext2/3/4 filesystems at present)."
12656 #: ../fish/guestfish-actions.pod:3217 ../src/guestfs-actions.pod:4858
12657 msgid "C<sectorsize>"
12661 #: ../fish/guestfish-actions.pod:3219 ../src/guestfs-actions.pod:4860
12663 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12664 "sets sector size for ufs filesystem."
12668 #: ../fish/guestfish-actions.pod:3226
12669 msgid "mkmountpoint"
12673 #: ../fish/guestfish-actions.pod:3228
12676 " mkmountpoint exemptpath\n"
12681 #: ../fish/guestfish-actions.pod:3230
12683 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12684 "to create extra mountpoints before mounting the first filesystem."
12688 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4903
12690 "These calls are I<only> necessary in some very limited circumstances, mainly "
12691 "the case where you want to mount a mix of unrelated and/or read-only "
12692 "filesystems together."
12696 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4907
12698 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12699 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12700 "inside that. You can unpack this as follows in guestfish:"
12704 #: ../fish/guestfish-actions.pod:3243 ../src/guestfs-actions.pod:4912
12707 " add-ro Fedora-11-i686-Live.iso\n"
12709 " mkmountpoint /cd\n"
12710 " mkmountpoint /sqsh\n"
12711 " mkmountpoint /ext3fs\n"
12712 " mount /dev/sda /cd\n"
12713 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12714 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12719 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4921
12720 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12724 #: ../fish/guestfish-actions.pod:3254
12726 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12727 "unexpected errors if you try to mix these calls. It is safest to manually "
12728 "unmount filesystems and remove mountpoints after use."
12732 #: ../fish/guestfish-actions.pod:3258
12734 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12735 "for this to work for manual mountpoints, you must ensure that the innermost "
12736 "mountpoints have the longest pathnames, as in the example code above."
12740 #: ../fish/guestfish-actions.pod:3263 ../src/guestfs-actions.pod:4932
12742 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12746 #: ../fish/guestfish-actions.pod:3265
12748 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12749 "L</umount-all> to be called when the handle is closed which can also trigger "
12754 #: ../fish/guestfish-actions.pod:3269
12759 #: ../fish/guestfish-actions.pod:3271
12762 " mknod mode devmajor devminor path\n"
12767 #: ../fish/guestfish-actions.pod:3273 ../src/guestfs-actions.pod:4951
12769 "This call creates block or character special devices, or named pipes (FIFOs)."
12773 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4954
12775 "The C<mode> parameter should be the mode, using the standard constants. "
12776 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12777 "used when creating block and character special devices."
12781 #: ../fish/guestfish-actions.pod:3281
12783 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12784 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12785 "regular file). These constants are available in the standard Linux header "
12786 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12787 "wrappers around this command which bitwise OR in the appropriate constant "
12792 #: ../fish/guestfish-actions.pod:3291
12797 #: ../fish/guestfish-actions.pod:3293
12800 " mknod-b mode devmajor devminor path\n"
12805 #: ../fish/guestfish-actions.pod:3295
12807 "This call creates a block device node called C<path> with mode C<mode> and "
12808 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12809 "wrapper around L</mknod>."
12813 #: ../fish/guestfish-actions.pod:3301
12818 #: ../fish/guestfish-actions.pod:3303
12821 " mknod-c mode devmajor devminor path\n"
12826 #: ../fish/guestfish-actions.pod:3305
12828 "This call creates a char device node called C<path> with mode C<mode> and "
12829 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12830 "wrapper around L</mknod>."
12834 #: ../fish/guestfish-actions.pod:3311
12839 #: ../fish/guestfish-actions.pod:3313
12847 #: ../fish/guestfish-actions.pod:3315 ../src/guestfs-actions.pod:5017
12848 msgid "Create a swap partition on C<device>."
12852 #: ../fish/guestfish-actions.pod:3317
12857 #: ../fish/guestfish-actions.pod:3319
12860 " mkswap-L label device\n"
12865 #: ../fish/guestfish-actions.pod:3321 ../src/guestfs-actions.pod:5030
12866 msgid "Create a swap partition on C<device> with label C<label>."
12870 #: ../fish/guestfish-actions.pod:3323 ../src/guestfs-actions.pod:5032
12872 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
12873 "sda>), just to a partition. This appears to be a limitation of the kernel "
12878 #: ../fish/guestfish-actions.pod:3327
12883 #: ../fish/guestfish-actions.pod:3329
12886 " mkswap-U uuid device\n"
12891 #: ../fish/guestfish-actions.pod:3331 ../src/guestfs-actions.pod:5047
12892 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12896 #: ../fish/guestfish-actions.pod:3333
12897 msgid "mkswap-file"
12901 #: ../fish/guestfish-actions.pod:3335
12904 " mkswap-file path\n"
12909 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5059
12910 msgid "Create a swap file."
12914 #: ../fish/guestfish-actions.pod:3339
12916 "This command just writes a swap file signature to an existing file. To "
12917 "create the file itself, use something like L</fallocate>."
12921 #: ../fish/guestfish-actions.pod:3342
12926 #: ../fish/guestfish-actions.pod:3344
12929 " modprobe modulename\n"
12934 #: ../fish/guestfish-actions.pod:3346 ../src/guestfs-actions.pod:5074
12935 msgid "This loads a kernel module in the appliance."
12939 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5076
12941 "The kernel module must have been whitelisted when libguestfs was built (see "
12942 "C<appliance/kmod.whitelist.in> in the source)."
12946 #: ../fish/guestfish-actions.pod:3351
12951 #: ../fish/guestfish-actions.pod:3353
12954 " mount device mountpoint\n"
12959 #: ../fish/guestfish-actions.pod:3355 ../src/guestfs-actions.pod:5090
12961 "Mount a guest disk at a position in the filesystem. Block devices are named "
12962 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12963 "those block devices contain partitions, they will have the usual names (eg. "
12964 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12968 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5096
12970 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12971 "mounted on C</> before others can be mounted. Other filesystems can only be "
12972 "mounted on directories which already exist."
12976 #: ../fish/guestfish-actions.pod:3366 ../src/guestfs-actions.pod:5101
12978 "The mounted filesystem is writable, if we have sufficient permissions on the "
12979 "underlying device."
12983 #: ../fish/guestfish-actions.pod:3369
12985 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12986 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12987 "problems for users. If your program might need to work with older versions "
12988 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12989 "first parameter if you don't want any options)."
12993 #: ../fish/guestfish-actions.pod:3376
12998 #: ../fish/guestfish-actions.pod:3378
13001 " mount-9p mounttag mountpoint [options:..]\n"
13006 #: ../fish/guestfish-actions.pod:3380 ../src/guestfs-actions.pod:5130
13008 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
13013 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5133
13015 "If required, C<trans=virtio> will be automatically added to the options. "
13016 "Any other options required can be passed in the optional C<options> "
13021 #: ../fish/guestfish-actions.pod:3389
13026 #: ../fish/guestfish-actions.pod:3391
13029 " mount-loop file mountpoint\n"
13034 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5172
13036 "This command lets you mount C<file> (a filesystem image in a file) on a "
13037 "mount point. It is entirely equivalent to the command C<mount -o loop file "
13042 #: ../fish/guestfish-actions.pod:3397
13043 msgid "mount-options"
13047 #: ../fish/guestfish-actions.pod:3399
13050 " mount-options options device mountpoint\n"
13055 #: ../fish/guestfish-actions.pod:3401
13057 "This is the same as the L</mount> command, but it allows you to set the "
13058 "mount options as for the L<mount(8)> I<-o> flag."
13062 #: ../fish/guestfish-actions.pod:3405 ../src/guestfs-actions.pod:5192
13064 "If the C<options> parameter is an empty string, then no options are passed "
13065 "(all options default to whatever the filesystem uses)."
13069 #: ../fish/guestfish-actions.pod:3409
13074 #: ../fish/guestfish-actions.pod:3411
13077 " mount-ro device mountpoint\n"
13082 #: ../fish/guestfish-actions.pod:3413
13084 "This is the same as the L</mount> command, but it mounts the filesystem with "
13085 "the read-only (I<-o ro>) flag."
13089 #: ../fish/guestfish-actions.pod:3416
13094 #: ../fish/guestfish-actions.pod:3418
13097 " mount-vfs options vfstype device mountpoint\n"
13102 #: ../fish/guestfish-actions.pod:3420
13104 "This is the same as the L</mount> command, but it allows you to set both the "
13105 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
13109 #: ../fish/guestfish-actions.pod:3424
13110 msgid "mountpoints"
13114 #: ../fish/guestfish-actions.pod:3426
13122 #: ../fish/guestfish-actions.pod:3428
13124 "This call is similar to L</mounts>. That call returns a list of devices. "
13125 "This one returns a hash table (map) of device name to directory where the "
13126 "device is mounted."
13130 #: ../fish/guestfish-actions.pod:3432
13135 #: ../fish/guestfish-actions.pod:3434
13143 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5253
13145 "This returns the list of currently mounted filesystems. It returns the list "
13146 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
13150 #: ../fish/guestfish-actions.pod:3439 ../src/guestfs-actions.pod:5256
13151 msgid "Some internal mounts are not shown."
13155 #: ../fish/guestfish-actions.pod:3441
13156 msgid "See also: L</mountpoints>"
13160 #: ../fish/guestfish-actions.pod:3443
13165 #: ../fish/guestfish-actions.pod:3445
13173 #: ../fish/guestfish-actions.pod:3447 ../src/guestfs-actions.pod:5273
13175 "This moves a file from C<src> to C<dest> where C<dest> is either a "
13176 "destination filename or destination directory."
13180 #: ../fish/guestfish-actions.pod:3450
13181 msgid "ntfs-3g-probe"
13185 #: ../fish/guestfish-actions.pod:3452
13188 " ntfs-3g-probe true|false device\n"
13193 #: ../fish/guestfish-actions.pod:3454 ../src/guestfs-actions.pod:5287
13195 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
13196 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
13197 "write, and some cannot be mounted at all)."
13201 #: ../fish/guestfish-actions.pod:3458 ../src/guestfs-actions.pod:5291
13203 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
13204 "can be mounted read-write. Set it to false if you want to test if the "
13205 "volume can be mounted read-only."
13209 #: ../fish/guestfish-actions.pod:3462 ../src/guestfs-actions.pod:5295
13211 "The return value is an integer which C<0> if the operation would succeed, or "
13212 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
13216 #: ../fish/guestfish-actions.pod:3466
13221 #: ../fish/guestfish-actions.pod:3468
13224 " ntfsresize device\n"
13229 #: ../fish/guestfish-actions.pod:3470 ../fish/guestfish-actions.pod:3494
13230 #: ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5348
13232 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
13233 "size of the underlying device."
13237 #: ../fish/guestfish-actions.pod:3473 ../src/guestfs-actions.pod:5319
13239 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
13240 "consistency check (for safety). You have to boot into Windows to perform "
13241 "this check and clear this condition. Furthermore, ntfsresize refuses to "
13242 "resize filesystems which have been marked in this way. So in effect it is "
13243 "not possible to call ntfsresize multiple times on a single filesystem "
13244 "without booting into Windows between each resize."
13248 #: ../fish/guestfish-actions.pod:3481 ../fish/guestfish-actions.pod:3520
13249 #: ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:5374
13250 msgid "See also L<ntfsresize(8)>."
13254 #: ../fish/guestfish-actions.pod:3483 ../fish/guestfish-actions.pod:3531
13256 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
13261 #: ../fish/guestfish-actions.pod:3490
13262 msgid "ntfsresize-opts"
13266 #: ../fish/guestfish-actions.pod:3492
13269 " ntfsresize-opts device [size:..] [force:..]\n"
13274 #: ../fish/guestfish-actions.pod:3503 ../src/guestfs-actions.pod:5357
13276 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
13277 "resized to fit the container (eg. partition)."
13281 #: ../fish/guestfish-actions.pod:3506 ../src/guestfs-actions.pod:5360
13286 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5362
13288 "If this option is true, then force the resize of the filesystem even if the "
13289 "filesystem is marked as requiring a consistency check."
13293 #: ../fish/guestfish-actions.pod:3511
13295 "After the resize operation, the filesystem is always marked as requiring a "
13296 "consistency check (for safety). You have to boot into Windows to perform "
13297 "this check and clear this condition. If you I<don't> set the C<force> "
13298 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
13299 "a single filesystem without booting into Windows between each resize."
13303 #: ../fish/guestfish-actions.pod:3524
13304 msgid "ntfsresize-size"
13308 #: ../fish/guestfish-actions.pod:3526
13311 " ntfsresize-size device size\n"
13316 #: ../fish/guestfish-actions.pod:3528
13318 "This command is the same as L</ntfsresize> except that it allows you to "
13319 "specify the new size (in bytes) explicitly."
13323 #: ../fish/guestfish-actions.pod:3538
13328 #: ../fish/guestfish-actions.pod:3540
13331 " part-add device prlogex startsect endsect\n"
13336 #: ../fish/guestfish-actions.pod:3542
13338 "This command adds a partition to C<device>. If there is no partition table "
13339 "on the device, call L</part-init> first."
13343 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5435
13345 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13346 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13347 "C<logical>) and C<e> (or C<extended>) partition types."
13351 #: ../fish/guestfish-actions.pod:3550 ../src/guestfs-actions.pod:5440
13353 "C<startsect> and C<endsect> are the start and end of the partition in "
13354 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13355 "from the end of the disk (C<-1> is the last sector)."
13359 #: ../fish/guestfish-actions.pod:3554
13361 "Creating a partition which covers the whole disk is not so easy. Use L</"
13362 "part-disk> to do that."
13366 #: ../fish/guestfish-actions.pod:3557
13371 #: ../fish/guestfish-actions.pod:3559
13374 " part-del device partnum\n"
13379 #: ../fish/guestfish-actions.pod:3561 ../src/guestfs-actions.pod:5458
13380 msgid "This command deletes the partition numbered C<partnum> on C<device>."
13384 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5460
13386 "Note that in the case of MBR partitioning, deleting an extended partition "
13387 "also deletes any logical partitions it contains."
13391 #: ../fish/guestfish-actions.pod:3567
13396 #: ../fish/guestfish-actions.pod:3569
13399 " part-disk device parttype\n"
13404 #: ../fish/guestfish-actions.pod:3571
13406 "This command is simply a combination of L</part-init> followed by L</part-"
13407 "add> to create a single primary partition covering the whole disk."
13411 #: ../fish/guestfish-actions.pod:3575
13413 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
13414 "possible values are described in L</part-init>."
13418 #: ../fish/guestfish-actions.pod:3581
13419 msgid "part-get-bootable"
13423 #: ../fish/guestfish-actions.pod:3583
13426 " part-get-bootable device partnum\n"
13431 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5496
13433 "This command returns true if the partition C<partnum> on C<device> has the "
13434 "bootable flag set."
13438 #: ../fish/guestfish-actions.pod:3588
13439 msgid "See also L</part-set-bootable>."
13443 #: ../fish/guestfish-actions.pod:3590
13444 msgid "part-get-mbr-id"
13448 #: ../fish/guestfish-actions.pod:3592
13451 " part-get-mbr-id device partnum\n"
13456 #: ../fish/guestfish-actions.pod:3594 ../src/guestfs-actions.pod:5512
13458 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13459 "partition C<partnum>."
13463 #: ../fish/guestfish-actions.pod:3597 ../fish/guestfish-actions.pod:3741
13465 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13466 "undefined results for other partition table types (see L</part-get-"
13471 #: ../fish/guestfish-actions.pod:3601
13472 msgid "part-get-parttype"
13476 #: ../fish/guestfish-actions.pod:3603
13479 " part-get-parttype device\n"
13484 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5529
13486 "This command examines the partition table on C<device> and returns the "
13487 "partition table type (format) being used."
13491 #: ../fish/guestfish-actions.pod:3608
13493 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13494 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13495 "possible, although unusual. See L</part-init> for a full list."
13499 #: ../fish/guestfish-actions.pod:3613
13504 #: ../fish/guestfish-actions.pod:3615
13507 " part-init device parttype\n"
13512 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5549
13514 "This creates an empty partition table on C<device> of one of the partition "
13515 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
13516 "(for large disks)."
13520 #: ../fish/guestfish-actions.pod:3621
13522 "Initially there are no partitions. Following this, you should call L</part-"
13523 "add> for each partition required."
13527 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5556
13528 msgid "Possible values for C<parttype> are:"
13532 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5560
13537 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5562
13542 #: ../fish/guestfish-actions.pod:3632 ../src/guestfs-actions.pod:5564
13543 msgid "Intel EFI / GPT partition table."
13547 #: ../fish/guestfish-actions.pod:3634 ../src/guestfs-actions.pod:5566
13549 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13550 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13551 "the C<mbr> format."
13555 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5570
13560 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5572
13565 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5574
13567 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13568 "Windows. This partition type will B<only> work for device sizes up to 2 "
13569 "TB. For large disks we recommend using C<gpt>."
13573 #: ../fish/guestfish-actions.pod:3649 ../src/guestfs-actions.pod:5581
13575 "Other partition table types that may work but are not supported include:"
13579 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5586
13584 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5588
13585 msgid "AIX disk labels."
13589 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5590
13594 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5592
13599 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5594
13600 msgid "Amiga \"Rigid Disk Block\" format."
13604 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5596
13609 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5598
13610 msgid "BSD disk labels."
13614 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5600
13619 #: ../fish/guestfish-actions.pod:3670 ../src/guestfs-actions.pod:5602
13620 msgid "DASD, used on IBM mainframes."
13624 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5604
13629 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5606
13630 msgid "MIPS/SGI volumes."
13634 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5608
13639 #: ../fish/guestfish-actions.pod:3678 ../src/guestfs-actions.pod:5610
13640 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13644 #: ../fish/guestfish-actions.pod:3680 ../src/guestfs-actions.pod:5612
13649 #: ../fish/guestfish-actions.pod:3682 ../src/guestfs-actions.pod:5614
13650 msgid "NEC PC-98 format, common in Japan apparently."
13654 #: ../fish/guestfish-actions.pod:3684 ../src/guestfs-actions.pod:5616
13659 #: ../fish/guestfish-actions.pod:3686 ../src/guestfs-actions.pod:5618
13660 msgid "Sun disk labels."
13664 #: ../fish/guestfish-actions.pod:3690
13669 #: ../fish/guestfish-actions.pod:3692
13672 " part-list device\n"
13677 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5632
13679 "This command parses the partition table on C<device> and returns the list of "
13680 "partitions found."
13684 #: ../fish/guestfish-actions.pod:3697 ../src/guestfs-actions.pod:5635
13685 msgid "The fields in the returned structure are:"
13689 #: ../fish/guestfish-actions.pod:3701 ../src/guestfs-actions.pod:5639
13690 msgid "B<part_num>"
13694 #: ../fish/guestfish-actions.pod:3703 ../src/guestfs-actions.pod:5641
13695 msgid "Partition number, counting from 1."
13699 #: ../fish/guestfish-actions.pod:3705 ../src/guestfs-actions.pod:5643
13700 msgid "B<part_start>"
13704 #: ../fish/guestfish-actions.pod:3707
13706 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13707 "the device's sector size, see L</blockdev-getss>."
13711 #: ../fish/guestfish-actions.pod:3710 ../src/guestfs-actions.pod:5648
13712 msgid "B<part_end>"
13716 #: ../fish/guestfish-actions.pod:3712 ../src/guestfs-actions.pod:5650
13717 msgid "End of the partition in bytes."
13721 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5652
13722 msgid "B<part_size>"
13726 #: ../fish/guestfish-actions.pod:3716 ../src/guestfs-actions.pod:5654
13727 msgid "Size of the partition in bytes."
13731 #: ../fish/guestfish-actions.pod:3720
13732 msgid "part-set-bootable"
13736 #: ../fish/guestfish-actions.pod:3722
13739 " part-set-bootable device partnum true|false\n"
13744 #: ../fish/guestfish-actions.pod:3724 ../src/guestfs-actions.pod:5672
13746 "This sets the bootable flag on partition numbered C<partnum> on device "
13747 "C<device>. Note that partitions are numbered from 1."
13751 #: ../fish/guestfish-actions.pod:3727 ../src/guestfs-actions.pod:5675
13753 "The bootable flag is used by some operating systems (notably Windows) to "
13754 "determine which partition to boot from. It is by no means universally "
13759 #: ../fish/guestfish-actions.pod:3731
13760 msgid "part-set-mbr-id"
13764 #: ../fish/guestfish-actions.pod:3733
13767 " part-set-mbr-id device partnum idbyte\n"
13772 #: ../fish/guestfish-actions.pod:3735 ../src/guestfs-actions.pod:5691
13774 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13775 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13776 "documentation are in fact hexadecimal numbers, but usually documented "
13777 "without any leading \"0x\" which might be confusing."
13781 #: ../fish/guestfish-actions.pod:3745
13782 msgid "part-set-name"
13786 #: ../fish/guestfish-actions.pod:3747
13789 " part-set-name device partnum name\n"
13794 #: ../fish/guestfish-actions.pod:3749 ../src/guestfs-actions.pod:5713
13796 "This sets the partition name on partition numbered C<partnum> on device "
13797 "C<device>. Note that partitions are numbered from 1."
13801 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5716
13803 "The partition name can only be set on certain types of partition table. "
13804 "This works on C<gpt> but not on C<mbr> partitions."
13808 #: ../fish/guestfish-actions.pod:3755
13809 msgid "part-to-dev"
13813 #: ../fish/guestfish-actions.pod:3757
13816 " part-to-dev partition\n"
13821 #: ../fish/guestfish-actions.pod:3759 ../src/guestfs-actions.pod:5729
13823 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13824 "partition number, returning the device name (eg. \"/dev/sdb\")."
13828 #: ../fish/guestfish-actions.pod:3763
13830 "The named partition must exist, for example as a string returned from L</"
13831 "list-partitions>."
13835 #: ../fish/guestfish-actions.pod:3766
13836 msgid "ping-daemon"
13840 #: ../fish/guestfish-actions.pod:3768
13848 #: ../fish/guestfish-actions.pod:3770 ../src/guestfs-actions.pod:5746
13850 "This is a test probe into the guestfs daemon running inside the qemu "
13851 "subprocess. Calling this function checks that the daemon responds to the "
13852 "ping message, without affecting the daemon or attached block device(s) in "
13857 #: ../fish/guestfish-actions.pod:3775
13862 #: ../fish/guestfish-actions.pod:3777
13865 " pread path count offset\n"
13870 #: ../fish/guestfish-actions.pod:3779 ../src/guestfs-actions.pod:5764
13872 "This command lets you read part of a file. It reads C<count> bytes of the "
13873 "file, starting at C<offset>, from file C<path>."
13877 #: ../fish/guestfish-actions.pod:3782 ../fish/guestfish-actions.pod:3797
13878 #: ../src/guestfs-actions.pod:5767 ../src/guestfs-actions.pod:5793
13880 "This may read fewer bytes than requested. For further details see the "
13881 "L<pread(2)> system call."
13885 #: ../fish/guestfish-actions.pod:3785
13886 msgid "See also L</pwrite>, L</pread-device>."
13890 #: ../fish/guestfish-actions.pod:3790
13891 msgid "pread-device"
13895 #: ../fish/guestfish-actions.pod:3792
13898 " pread-device device count offset\n"
13903 #: ../fish/guestfish-actions.pod:3794 ../src/guestfs-actions.pod:5790
13905 "This command lets you read part of a file. It reads C<count> bytes of "
13906 "C<device>, starting at C<offset>."
13910 #: ../fish/guestfish-actions.pod:3800
13911 msgid "See also L</pread>."
13915 #: ../fish/guestfish-actions.pod:3805
13920 #: ../fish/guestfish-actions.pod:3807
13923 " pvcreate device\n"
13928 #: ../fish/guestfish-actions.pod:3809 ../src/guestfs-actions.pod:5813
13930 "This creates an LVM physical volume on the named C<device>, where C<device> "
13931 "should usually be a partition name such as C</dev/sda1>."
13935 #: ../fish/guestfish-actions.pod:3813
13940 #: ../fish/guestfish-actions.pod:3815
13943 " pvremove device\n"
13948 #: ../fish/guestfish-actions.pod:3817 ../src/guestfs-actions.pod:5827
13950 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13955 #: ../fish/guestfish-actions.pod:3820 ../src/guestfs-actions.pod:5830
13957 "The implementation uses the C<pvremove> command which refuses to wipe "
13958 "physical volumes that contain any volume groups, so you have to remove those "
13963 #: ../fish/guestfish-actions.pod:3824
13968 #: ../fish/guestfish-actions.pod:3826
13971 " pvresize device\n"
13976 #: ../fish/guestfish-actions.pod:3828 ../src/guestfs-actions.pod:5844
13978 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13979 "the new size of the underlying device."
13983 #: ../fish/guestfish-actions.pod:3831
13984 msgid "pvresize-size"
13988 #: ../fish/guestfish-actions.pod:3833
13991 " pvresize-size device size\n"
13996 #: ../fish/guestfish-actions.pod:3835
13998 "This command is the same as L</pvresize> except that it allows you to "
13999 "specify the new size (in bytes) explicitly."
14003 #: ../fish/guestfish-actions.pod:3838
14008 #: ../fish/guestfish-actions.pod:3840
14016 #: ../fish/guestfish-actions.pod:3842 ../src/guestfs-actions.pod:5870
14018 "List all the physical volumes detected. This is the equivalent of the L<pvs"
14023 #: ../fish/guestfish-actions.pod:3845 ../src/guestfs-actions.pod:5873
14025 "This returns a list of just the device names that contain PVs (eg. C</dev/"
14030 #: ../fish/guestfish-actions.pod:3848
14031 msgid "See also L</pvs-full>."
14035 #: ../fish/guestfish-actions.pod:3850
14040 #: ../fish/guestfish-actions.pod:3852
14048 #: ../fish/guestfish-actions.pod:3854 ../src/guestfs-actions.pod:5889
14050 "List all the physical volumes detected. This is the equivalent of the L<pvs"
14051 "(8)> command. The \"full\" version includes all fields."
14055 #: ../fish/guestfish-actions.pod:3857
14060 #: ../fish/guestfish-actions.pod:3859
14068 #: ../fish/guestfish-actions.pod:3861 ../src/guestfs-actions.pod:5904
14069 msgid "This command returns the UUID of the LVM PV C<device>."
14073 #: ../fish/guestfish-actions.pod:3863
14078 #: ../fish/guestfish-actions.pod:3865
14081 " pwrite path content offset\n"
14086 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5920
14088 "This command writes to part of a file. It writes the data buffer C<content> "
14089 "to the file C<path> starting at offset C<offset>."
14093 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5923
14095 "This command implements the L<pwrite(2)> system call, and like that system "
14096 "call it may not write the full data requested. The return value is the "
14097 "number of bytes that were actually written to the file. This could even be "
14098 "0, although short writes are unlikely for regular files in ordinary "
14103 #: ../fish/guestfish-actions.pod:3876
14104 msgid "See also L</pread>, L</pwrite-device>."
14108 #: ../fish/guestfish-actions.pod:3881
14109 msgid "pwrite-device"
14113 #: ../fish/guestfish-actions.pod:3883
14116 " pwrite-device device content offset\n"
14121 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:5947
14123 "This command writes to part of a device. It writes the data buffer "
14124 "C<content> to C<device> starting at offset C<offset>."
14128 #: ../fish/guestfish-actions.pod:3888 ../src/guestfs-actions.pod:5950
14130 "This command implements the L<pwrite(2)> system call, and like that system "
14131 "call it may not write the full data requested (although short writes to disk "
14132 "devices and partitions are probably impossible with standard Linux kernels)."
14136 #: ../fish/guestfish-actions.pod:3893
14137 msgid "See also L</pwrite>."
14141 #: ../fish/guestfish-actions.pod:3898
14146 #: ../fish/guestfish-actions.pod:3900
14149 " read-file path\n"
14154 #: ../fish/guestfish-actions.pod:3902 ../src/guestfs-actions.pod:5971
14155 msgid "This calls returns the contents of the file C<path> as a buffer."
14159 #: ../fish/guestfish-actions.pod:3905
14161 "Unlike L</cat>, this function can correctly handle files that contain "
14162 "embedded ASCII NUL characters. However unlike L</download>, this function "
14163 "is limited in the total size of file that can be handled."
14167 #: ../fish/guestfish-actions.pod:3913
14172 #: ../fish/guestfish-actions.pod:3915
14175 " read-lines path\n"
14180 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5996
14182 "The file contents are returned as a list of lines. Trailing C<LF> and "
14183 "C<CRLF> character sequences are I<not> returned."
14187 #: ../fish/guestfish-actions.pod:3922
14189 "Note that this function cannot correctly handle binary files (specifically, "
14190 "files containing C<\\0> character which is treated as end of line). For "
14191 "those you need to use the L</read-file> function which has a more complex "
14196 #: ../fish/guestfish-actions.pod:3927
14201 #: ../fish/guestfish-actions.pod:3929
14209 #: ../fish/guestfish-actions.pod:3931 ../src/guestfs-actions.pod:6016
14210 msgid "This returns the list of directory entries in directory C<dir>."
14214 #: ../fish/guestfish-actions.pod:3933 ../src/guestfs-actions.pod:6018
14216 "All entries in the directory are returned, including C<.> and C<..>. The "
14217 "entries are I<not> sorted, but returned in the same order as the underlying "
14222 #: ../fish/guestfish-actions.pod:3937 ../src/guestfs-actions.pod:6022
14224 "Also this call returns basic file type information about each file. The "
14225 "C<ftyp> field will contain one of the following characters:"
14229 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6027
14234 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6029
14235 msgid "Block special"
14239 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6031
14244 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6033
14245 msgid "Char special"
14249 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6035
14254 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6037
14259 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6039
14264 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6041
14265 msgid "FIFO (named pipe)"
14269 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6043
14274 #: ../fish/guestfish-actions.pod:3960 ../src/guestfs-actions.pod:6045
14275 msgid "Symbolic link"
14279 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6047
14284 #: ../fish/guestfish-actions.pod:3964 ../src/guestfs-actions.pod:6049
14285 msgid "Regular file"
14289 #: ../fish/guestfish-actions.pod:3966 ../src/guestfs-actions.pod:6051
14294 #: ../fish/guestfish-actions.pod:3968 ../src/guestfs-actions.pod:6053
14299 #: ../fish/guestfish-actions.pod:3970 ../src/guestfs-actions.pod:6055
14304 #: ../fish/guestfish-actions.pod:3972 ../src/guestfs-actions.pod:6057
14305 msgid "Unknown file type"
14309 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6059
14314 #: ../fish/guestfish-actions.pod:3976 ../src/guestfs-actions.pod:6061
14316 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14320 #: ../fish/guestfish-actions.pod:3981
14322 "This function is primarily intended for use by programs. To get a simple "
14323 "list of names, use L</ls>. To get a printable directory for human "
14324 "consumption, use L</ll>."
14328 #: ../fish/guestfish-actions.pod:3985
14333 #: ../fish/guestfish-actions.pod:3987
14341 #: ../fish/guestfish-actions.pod:3989 ../src/guestfs-actions.pod:6082
14342 msgid "This command reads the target of a symbolic link."
14346 #: ../fish/guestfish-actions.pod:3991
14347 msgid "readlinklist"
14351 #: ../fish/guestfish-actions.pod:3993
14354 " readlinklist path 'names ...'\n"
14359 #: ../fish/guestfish-actions.pod:3995 ../src/guestfs-actions.pod:6096
14361 "This call allows you to do a C<readlink> operation on multiple files, where "
14362 "all files are in the directory C<path>. C<names> is the list of files from "
14367 #: ../fish/guestfish-actions.pod:3999 ../src/guestfs-actions.pod:6100
14369 "On return you get a list of strings, with a one-to-one correspondence to the "
14370 "C<names> list. Each string is the value of the symbolic link."
14374 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6104
14376 "If the C<readlink(2)> operation fails on any name, then the corresponding "
14377 "result string is the empty string C<\"\">. However the whole operation is "
14378 "completed even if there were C<readlink(2)> errors, and so you can call this "
14379 "function with names where you don't know if they are symbolic links already "
14380 "(albeit slightly less efficient)."
14384 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6111
14386 "This call is intended for programs that want to efficiently list a directory "
14387 "contents without making many round-trips. Very long directory listings "
14388 "might cause the protocol message size to be exceeded, causing this call to "
14389 "fail. The caller must split up such requests into smaller groups of names."
14393 #: ../fish/guestfish-actions.pod:4017
14398 #: ../fish/guestfish-actions.pod:4019
14406 #: ../fish/guestfish-actions.pod:4021 ../src/guestfs-actions.pod:6130
14408 "Return the canonicalized absolute pathname of C<path>. The returned path "
14409 "has no C<.>, C<..> or symbolic link path elements."
14413 #: ../fish/guestfish-actions.pod:4024
14414 msgid "removexattr"
14418 #: ../fish/guestfish-actions.pod:4026
14421 " removexattr xattr path\n"
14426 #: ../fish/guestfish-actions.pod:4028 ../src/guestfs-actions.pod:6145
14428 "This call removes the extended attribute named C<xattr> of the file C<path>."
14432 #: ../fish/guestfish-actions.pod:4031
14433 msgid "See also: L</lremovexattr>, L<attr(5)>."
14437 #: ../fish/guestfish-actions.pod:4033
14442 #: ../fish/guestfish-actions.pod:4035
14445 " resize2fs device\n"
14450 #: ../fish/guestfish-actions.pod:4037 ../src/guestfs-actions.pod:6160
14452 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
14453 "underlying device."
14457 #: ../fish/guestfish-actions.pod:4040
14459 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
14460 "before calling this command. For unknown reasons C<resize2fs> sometimes "
14461 "gives an error about this and sometimes not. In any case, it is always safe "
14462 "to call L</e2fsck-f> before calling this function."
14466 #: ../fish/guestfish-actions.pod:4046
14467 msgid "resize2fs-M"
14471 #: ../fish/guestfish-actions.pod:4048
14474 " resize2fs-M device\n"
14479 #: ../fish/guestfish-actions.pod:4050
14481 "This command is the same as L</resize2fs>, but the filesystem is resized to "
14482 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
14487 #: ../fish/guestfish-actions.pod:4054
14489 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
14490 "and read the C<Block size> and C<Block count> values. These two numbers, "
14491 "multiplied together, give the resulting size of the minimal filesystem in "
14496 #: ../fish/guestfish-actions.pod:4059
14497 msgid "resize2fs-size"
14501 #: ../fish/guestfish-actions.pod:4061
14504 " resize2fs-size device size\n"
14509 #: ../fish/guestfish-actions.pod:4063
14511 "This command is the same as L</resize2fs> except that it allows you to "
14512 "specify the new size (in bytes) explicitly."
14516 #: ../fish/guestfish-actions.pod:4066
14521 #: ../fish/guestfish-actions.pod:4068
14529 #: ../fish/guestfish-actions.pod:4070 ../src/guestfs-actions.pod:6212
14530 msgid "Remove the single file C<path>."
14534 #: ../fish/guestfish-actions.pod:4072
14539 #: ../fish/guestfish-actions.pod:4074
14547 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6224
14549 "Remove the file or directory C<path>, recursively removing the contents if "
14550 "its a directory. This is like the C<rm -rf> shell command."
14554 #: ../fish/guestfish-actions.pod:4080
14559 #: ../fish/guestfish-actions.pod:4082
14567 #: ../fish/guestfish-actions.pod:4084 ../src/guestfs-actions.pod:6238
14568 msgid "Remove the single directory C<path>."
14572 #: ../fish/guestfish-actions.pod:4086
14573 msgid "rmmountpoint"
14577 #: ../fish/guestfish-actions.pod:4088
14580 " rmmountpoint exemptpath\n"
14585 #: ../fish/guestfish-actions.pod:4090
14587 "This calls removes a mountpoint that was previously created with L</"
14588 "mkmountpoint>. See L</mkmountpoint> for full details."
14592 #: ../fish/guestfish-actions.pod:4094
14593 msgid "scrub-device"
14597 #: ../fish/guestfish-actions.pod:4096
14600 " scrub-device device\n"
14605 #: ../fish/guestfish-actions.pod:4098 ../src/guestfs-actions.pod:6264
14607 "This command writes patterns over C<device> to make data retrieval more "
14612 #: ../fish/guestfish-actions.pod:4101 ../fish/guestfish-actions.pod:4116
14613 #: ../fish/guestfish-actions.pod:4129 ../src/guestfs-actions.pod:6267
14614 #: ../src/guestfs-actions.pod:6288 ../src/guestfs-actions.pod:6307
14616 "It is an interface to the L<scrub(1)> program. See that manual page for "
14621 #: ../fish/guestfish-actions.pod:4107
14626 #: ../fish/guestfish-actions.pod:4109
14629 " scrub-file file\n"
14634 #: ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6283
14636 "This command writes patterns over a file to make data retrieval more "
14641 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6286
14642 msgid "The file is I<removed> after scrubbing."
14646 #: ../fish/guestfish-actions.pod:4119
14647 msgid "scrub-freespace"
14651 #: ../fish/guestfish-actions.pod:4121
14654 " scrub-freespace dir\n"
14659 #: ../fish/guestfish-actions.pod:4123
14661 "This command creates the directory C<dir> and then fills it with files until "
14662 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14663 "deletes them. The intention is to scrub any free space on the partition "
14664 "containing C<dir>."
14668 #: ../fish/guestfish-actions.pod:4132
14673 #: ../fish/guestfish-actions.pod:4134
14678 #: ../fish/guestfish-actions.pod:4136
14681 " set-append append\n"
14686 #: ../fish/guestfish-actions.pod:4138 ../src/guestfs-actions.pod:6320
14688 "This function is used to add additional options to the guest kernel command "
14693 #: ../fish/guestfish-actions.pod:4141 ../src/guestfs-actions.pod:6323
14695 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14696 "environment variable."
14700 #: ../fish/guestfish-actions.pod:4144 ../src/guestfs-actions.pod:6326
14702 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14703 "(libguestfs always adds a few of its own)."
14707 #: ../fish/guestfish-actions.pod:4147
14708 msgid "set-attach-method"
14712 #: ../fish/guestfish-actions.pod:4149
14713 msgid "attach-method"
14717 #: ../fish/guestfish-actions.pod:4151
14720 " set-attach-method attachmethod\n"
14725 #: ../fish/guestfish-actions.pod:4153 ../src/guestfs-actions.pod:6339
14727 "Set the method that libguestfs uses to connect to the back end guestfsd "
14728 "daemon. Possible methods are:"
14732 #: ../fish/guestfish-actions.pod:4158 ../src/guestfs-actions.pod:6344
14733 #: ../src/guestfs.pod:2901
14734 msgid "C<appliance>"
14738 #: ../fish/guestfish-actions.pod:4160 ../src/guestfs-actions.pod:6346
14740 "Launch an appliance and connect to it. This is the ordinary method and the "
14745 #: ../fish/guestfish-actions.pod:4163 ../src/guestfs-actions.pod:6349
14746 msgid "C<unix:I<path>>"
14750 #: ../fish/guestfish-actions.pod:4165 ../src/guestfs-actions.pod:6351
14751 msgid "Connect to the Unix domain socket I<path>."
14755 #: ../fish/guestfish-actions.pod:4167 ../src/guestfs-actions.pod:6353
14757 "This method lets you connect to an existing daemon or (using virtio-serial) "
14758 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14759 "RUNNING DAEMONS>."
14763 #: ../fish/guestfish-actions.pod:4173
14764 msgid "set-autosync"
14768 #: ../fish/guestfish-actions.pod:4175
14773 #: ../fish/guestfish-actions.pod:4177
14776 " set-autosync true|false\n"
14781 #: ../fish/guestfish-actions.pod:4179 ../src/guestfs-actions.pod:6369
14783 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14784 "effort attempt to make filesystems consistent and synchronized when the "
14785 "handle is closed (also if the program exits without closing handles)."
14789 #: ../fish/guestfish-actions.pod:4184 ../src/guestfs-actions.pod:6374
14791 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14792 "disabled by default)."
14796 #: ../fish/guestfish-actions.pod:4187
14801 #: ../fish/guestfish-actions.pod:4189
14806 #: ../fish/guestfish-actions.pod:4191
14809 " set-direct true|false\n"
14814 #: ../fish/guestfish-actions.pod:4193 ../src/guestfs-actions.pod:6387
14816 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14817 "passed directly through to the appliance once it is launched."
14821 #: ../fish/guestfish-actions.pod:4197
14823 "One consequence of this is that log messages aren't caught by the library "
14824 "and handled by L</set-log-message-callback>, but go straight to stdout."
14828 #: ../fish/guestfish-actions.pod:4201 ../src/guestfs-actions.pod:6395
14829 msgid "You probably don't want to use this unless you know what you are doing."
14833 #: ../fish/guestfish-actions.pod:4204 ../src/guestfs-actions.pod:6398
14834 msgid "The default is disabled."
14838 #: ../fish/guestfish-actions.pod:4206
14839 msgid "set-e2label"
14843 #: ../fish/guestfish-actions.pod:4208
14846 " set-e2label device label\n"
14851 #: ../fish/guestfish-actions.pod:4210 ../src/guestfs-actions.pod:6411
14853 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14854 "C<label>. Filesystem labels are limited to 16 characters."
14858 #: ../fish/guestfish-actions.pod:4214
14860 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14861 "label on a filesystem."
14865 #: ../fish/guestfish-actions.pod:4217
14870 #: ../fish/guestfish-actions.pod:4219
14873 " set-e2uuid device uuid\n"
14878 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6429
14880 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14881 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14882 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14886 #: ../fish/guestfish-actions.pod:4226
14888 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14889 "UUID of a filesystem."
14893 #: ../fish/guestfish-actions.pod:4229
14894 msgid "set-memsize"
14898 #: ../fish/guestfish-actions.pod:4231
14903 #: ../fish/guestfish-actions.pod:4233
14906 " set-memsize memsize\n"
14911 #: ../fish/guestfish-actions.pod:4235
14913 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14914 "This only has any effect if called before L</launch>."
14918 #: ../fish/guestfish-actions.pod:4239 ../src/guestfs-actions.pod:6451
14920 "You can also change this by setting the environment variable "
14921 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14925 #: ../fish/guestfish-actions.pod:4246
14926 msgid "set-network"
14930 #: ../fish/guestfish-actions.pod:4248
14935 #: ../fish/guestfish-actions.pod:4250
14938 " set-network true|false\n"
14943 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6468
14945 "If C<network> is true, then the network is enabled in the libguestfs "
14946 "appliance. The default is false."
14950 #: ../fish/guestfish-actions.pod:4255 ../src/guestfs-actions.pod:6471
14952 "This affects whether commands are able to access the network (see L<guestfs"
14953 "(3)/RUNNING COMMANDS>)."
14957 #: ../fish/guestfish-actions.pod:4258
14959 "You must call this before calling L</launch>, otherwise it has no effect."
14963 #: ../fish/guestfish-actions.pod:4261
14968 #: ../fish/guestfish-actions.pod:4265
14971 " set-path searchpath\n"
14976 #: ../fish/guestfish-actions.pod:4267 ../src/guestfs-actions.pod:6487
14977 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14981 #: ../fish/guestfish-actions.pod:4269 ../src/guestfs-actions.pod:6489
14983 "The default is C<$libdir/guestfs> unless overridden by setting "
14984 "C<LIBGUESTFS_PATH> environment variable."
14988 #: ../fish/guestfish-actions.pod:4272 ../src/guestfs-actions.pod:6492
14989 msgid "Setting C<path> to C<NULL> restores the default path."
14993 #: ../fish/guestfish-actions.pod:4274
14998 #: ../fish/guestfish-actions.pod:4276
15003 #: ../fish/guestfish-actions.pod:4278
15006 " set-pgroup true|false\n"
15011 #: ../fish/guestfish-actions.pod:4280 ../src/guestfs-actions.pod:6504
15013 "If C<pgroup> is true, child processes are placed into their own process "
15018 #: ../fish/guestfish-actions.pod:4283 ../src/guestfs-actions.pod:6507
15020 "The practical upshot of this is that signals like C<SIGINT> (from users "
15021 "pressing C<^C>) won't be received by the child process."
15025 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6510
15027 "The default for this flag is false, because usually you want C<^C> to kill "
15032 #: ../fish/guestfish-actions.pod:4289
15037 #: ../fish/guestfish-actions.pod:4291
15042 #: ../fish/guestfish-actions.pod:4293
15050 #: ../fish/guestfish-actions.pod:4295 ../src/guestfs-actions.pod:6523
15051 msgid "Set the qemu binary that we will use."
15055 #: ../fish/guestfish-actions.pod:4297 ../src/guestfs-actions.pod:6525
15057 "The default is chosen when the library was compiled by the configure script."
15061 #: ../fish/guestfish-actions.pod:4300 ../src/guestfs-actions.pod:6528
15063 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
15068 #: ../fish/guestfish-actions.pod:4303 ../src/guestfs-actions.pod:6531
15069 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
15073 #: ../fish/guestfish-actions.pod:4305 ../src/guestfs-actions.pod:6533
15075 "Note that you should call this function as early as possible after creating "
15076 "the handle. This is because some pre-launch operations depend on testing "
15077 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
15078 "don't retest features, and so you might see inconsistent results. Using the "
15079 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
15080 "the qemu binary at the same time as the handle is created."
15084 #: ../fish/guestfish-actions.pod:4313
15085 msgid "set-recovery-proc"
15089 #: ../fish/guestfish-actions.pod:4315
15090 msgid "recovery-proc"
15094 #: ../fish/guestfish-actions.pod:4317
15097 " set-recovery-proc true|false\n"
15102 #: ../fish/guestfish-actions.pod:4319
15104 "If this is called with the parameter C<false> then L</launch> does not "
15105 "create a recovery process. The purpose of the recovery process is to stop "
15106 "runaway qemu processes in the case where the main program aborts abruptly."
15110 #: ../fish/guestfish-actions.pod:4324
15112 "This only has any effect if called before L</launch>, and the default is "
15117 #: ../fish/guestfish-actions.pod:4327 ../src/guestfs-actions.pod:6559
15119 "About the only time when you would want to disable this is if the main "
15120 "process will fork itself into the background (\"daemonize\" itself). In "
15121 "this case the recovery process thinks that the main program has disappeared "
15122 "and so kills qemu, which is not very helpful."
15126 #: ../fish/guestfish-actions.pod:4333
15127 msgid "set-selinux"
15131 #: ../fish/guestfish-actions.pod:4335
15136 #: ../fish/guestfish-actions.pod:4337
15139 " set-selinux true|false\n"
15144 #: ../fish/guestfish-actions.pod:4339 ../src/guestfs-actions.pod:6575
15146 "This sets the selinux flag that is passed to the appliance at boot time. "
15147 "The default is C<selinux=0> (disabled)."
15151 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6578
15153 "Note that if SELinux is enabled, it is always in Permissive mode "
15154 "(C<enforcing=0>)."
15158 #: ../fish/guestfish-actions.pod:4348
15163 #: ../fish/guestfish-actions.pod:4350
15168 #: ../fish/guestfish-actions.pod:4352
15176 #: ../fish/guestfish-actions.pod:4354 ../src/guestfs-actions.pod:6594
15178 "Change the number of virtual CPUs assigned to the appliance. The default is "
15179 "C<1>. Increasing this may improve performance, though often it has no "
15184 #: ../fish/guestfish-actions.pod:4358
15185 msgid "This function must be called before L</launch>."
15189 #: ../fish/guestfish-actions.pod:4360
15194 #: ../fish/guestfish-actions.pod:4362
15199 #: ../fish/guestfish-actions.pod:4364
15202 " set-trace true|false\n"
15207 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6610
15209 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
15210 "return values are traced."
15214 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6613
15216 "If you want to trace C API calls into libguestfs (and other libraries) then "
15217 "possibly a better way is to use the external ltrace(1) command."
15221 #: ../fish/guestfish-actions.pod:4373 ../src/guestfs-actions.pod:6617
15223 "Command traces are disabled unless the environment variable "
15224 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
15228 #: ../fish/guestfish-actions.pod:4376
15230 "Trace messages are normally sent to C<stderr>, unless you register a "
15231 "callback to send them somewhere else (see L</set-event-callback>)."
15235 #: ../fish/guestfish-actions.pod:4380
15236 msgid "set-verbose"
15240 #: ../fish/guestfish-actions.pod:4382
15245 #: ../fish/guestfish-actions.pod:4384
15248 " set-verbose true|false\n"
15253 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6634
15254 msgid "If C<verbose> is true, this turns on verbose messages."
15258 #: ../fish/guestfish-actions.pod:4388 ../src/guestfs-actions.pod:6636
15260 "Verbose messages are disabled unless the environment variable "
15261 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
15265 #: ../fish/guestfish-actions.pod:4391
15267 "Verbose messages are normally sent to C<stderr>, unless you register a "
15268 "callback to send them somewhere else (see L</set-event-callback>)."
15272 #: ../fish/guestfish-actions.pod:4395
15277 #: ../fish/guestfish-actions.pod:4397
15280 " setcon context\n"
15285 #: ../fish/guestfish-actions.pod:4399 ../src/guestfs-actions.pod:6653
15287 "This sets the SELinux security context of the daemon to the string "
15292 #: ../fish/guestfish-actions.pod:4402 ../src/guestfs-actions.pod:6656
15293 msgid "See the documentation about SELINUX in L<guestfs(3)>."
15297 #: ../fish/guestfish-actions.pod:4404
15302 #: ../fish/guestfish-actions.pod:4406
15305 " setxattr xattr val vallen path\n"
15310 #: ../fish/guestfish-actions.pod:4408 ../src/guestfs-actions.pod:6671
15312 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15313 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15317 #: ../fish/guestfish-actions.pod:4412
15318 msgid "See also: L</lsetxattr>, L<attr(5)>."
15322 #: ../fish/guestfish-actions.pod:4414
15327 #: ../fish/guestfish-actions.pod:4416
15330 " sfdisk device cyls heads sectors 'lines ...'\n"
15335 #: ../fish/guestfish-actions.pod:4418 ../src/guestfs-actions.pod:6698
15337 "This is a direct interface to the L<sfdisk(8)> program for creating "
15338 "partitions on block devices."
15342 #: ../fish/guestfish-actions.pod:4421 ../src/guestfs-actions.pod:6701
15343 msgid "C<device> should be a block device, for example C</dev/sda>."
15347 #: ../fish/guestfish-actions.pod:4423 ../src/guestfs-actions.pod:6703
15349 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15350 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
15351 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15352 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15353 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15354 "the kernel) cannot work out the right geometry and you will need to tell it."
15358 #: ../fish/guestfish-actions.pod:4431 ../src/guestfs-actions.pod:6711
15360 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15361 "refer to the L<sfdisk(8)> manpage."
15365 #: ../fish/guestfish-actions.pod:4434 ../src/guestfs-actions.pod:6714
15367 "To create a single partition occupying the whole disk, you would pass "
15368 "C<lines> as a single element list, when the single element being the string "
15373 #: ../fish/guestfish-actions.pod:4438
15374 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
15378 #: ../fish/guestfish-actions.pod:4444 ../fish/guestfish-actions.pod:4467
15379 #: ../fish/guestfish-actions.pod:4489
15381 "I<This function is deprecated.> In new code, use the L</part_add> call "
15386 #: ../fish/guestfish-actions.pod:4451
15391 #: ../fish/guestfish-actions.pod:4453
15394 " sfdiskM device 'lines ...'\n"
15399 #: ../fish/guestfish-actions.pod:4455
15401 "This is a simplified interface to the L</sfdisk> command, where partition "
15402 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
15403 "you don't need to specify the cyls, heads and sectors parameters which were "
15404 "rarely if ever used anyway."
15408 #: ../fish/guestfish-actions.pod:4461
15409 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
15413 #: ../fish/guestfish-actions.pod:4474
15418 #: ../fish/guestfish-actions.pod:4476
15421 " sfdisk-N device partnum cyls heads sectors line\n"
15426 #: ../fish/guestfish-actions.pod:4478 ../src/guestfs-actions.pod:6776
15428 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
15429 "(note: C<n> counts from 1)."
15433 #: ../fish/guestfish-actions.pod:4481
15435 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
15436 "cyls/heads/sectors parameters."
15440 #: ../fish/guestfish-actions.pod:4484
15441 msgid "See also: L</part-add>"
15445 #: ../fish/guestfish-actions.pod:4496
15446 msgid "sfdisk-disk-geometry"
15450 #: ../fish/guestfish-actions.pod:4498
15453 " sfdisk-disk-geometry device\n"
15458 #: ../fish/guestfish-actions.pod:4500
15460 "This displays the disk geometry of C<device> read from the partition table. "
15461 "Especially in the case where the underlying block device has been resized, "
15462 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
15463 "kernel-geometry>)."
15467 #: ../fish/guestfish-actions.pod:4505 ../fish/guestfish-actions.pod:4514
15468 #: ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6818
15469 msgid "The result is in human-readable format, and not designed to be parsed."
15473 #: ../fish/guestfish-actions.pod:4508
15474 msgid "sfdisk-kernel-geometry"
15478 #: ../fish/guestfish-actions.pod:4510
15481 " sfdisk-kernel-geometry device\n"
15486 #: ../fish/guestfish-actions.pod:4512 ../src/guestfs-actions.pod:6816
15487 msgid "This displays the kernel's idea of the geometry of C<device>."
15491 #: ../fish/guestfish-actions.pod:4517
15496 #: ../fish/guestfish-actions.pod:4519
15499 " sfdisk-l device\n"
15504 #: ../fish/guestfish-actions.pod:4521 ../src/guestfs-actions.pod:6839
15506 "This displays the partition table on C<device>, in the human-readable output "
15507 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15511 #: ../fish/guestfish-actions.pod:4525
15512 msgid "See also: L</part-list>"
15516 #: ../fish/guestfish-actions.pod:4527
15518 "I<This function is deprecated.> In new code, use the L</part_list> call "
15523 #: ../fish/guestfish-actions.pod:4534
15528 #: ../fish/guestfish-actions.pod:4536
15536 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:6856
15538 "This call runs a command from the guest filesystem via the guest's C</bin/"
15543 #: ../fish/guestfish-actions.pod:4541
15544 msgid "This is like L</command>, but passes the command to:"
15548 #: ../fish/guestfish-actions.pod:4543 ../src/guestfs-actions.pod:6861
15551 " /bin/sh -c \"command\"\n"
15556 #: ../fish/guestfish-actions.pod:4545 ../src/guestfs-actions.pod:6863
15558 "Depending on the guest's shell, this usually results in wildcards being "
15559 "expanded, shell expressions being interpolated and so on."
15563 #: ../fish/guestfish-actions.pod:4549
15564 msgid "All the provisos about L</command> apply to this call."
15568 #: ../fish/guestfish-actions.pod:4551
15573 #: ../fish/guestfish-actions.pod:4553
15576 " sh-lines command\n"
15581 #: ../fish/guestfish-actions.pod:4555
15582 msgid "This is the same as L</sh>, but splits the result into a list of lines."
15586 #: ../fish/guestfish-actions.pod:4558
15587 msgid "See also: L</command-lines>"
15591 #: ../fish/guestfish-actions.pod:4560
15596 #: ../fish/guestfish-actions.pod:4562
15604 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6897
15605 msgid "Sleep for C<secs> seconds."
15609 #: ../fish/guestfish-actions.pod:4566
15614 #: ../fish/guestfish-actions.pod:4568
15622 #: ../fish/guestfish-actions.pod:4572 ../src/guestfs-actions.pod:6911
15623 msgid "This is the same as the C<stat(2)> system call."
15627 #: ../fish/guestfish-actions.pod:4574
15632 #: ../fish/guestfish-actions.pod:4576
15640 #: ../fish/guestfish-actions.pod:4578 ../src/guestfs-actions.pod:6925
15642 "Returns file system statistics for any mounted file system. C<path> should "
15643 "be a file or directory in the mounted file system (typically it is the mount "
15644 "point itself, but it doesn't need to be)."
15648 #: ../fish/guestfish-actions.pod:4582 ../src/guestfs-actions.pod:6929
15649 msgid "This is the same as the C<statvfs(2)> system call."
15653 #: ../fish/guestfish-actions.pod:4584
15658 #: ../fish/guestfish-actions.pod:4586
15666 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6943
15668 "This runs the L<strings(1)> command on a file and returns the list of "
15669 "printable strings found."
15673 #: ../fish/guestfish-actions.pod:4594
15678 #: ../fish/guestfish-actions.pod:4596
15681 " strings-e encoding path\n"
15686 #: ../fish/guestfish-actions.pod:4598
15688 "This is like the L</strings> command, but allows you to specify the encoding "
15689 "of strings that are looked for in the source file C<path>."
15693 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6966
15694 msgid "Allowed encodings are:"
15698 #: ../fish/guestfish-actions.pod:4606 ../src/guestfs-actions.pod:6970
15703 #: ../fish/guestfish-actions.pod:4608
15705 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15706 "ISO-8859-X (this is what L</strings> uses)."
15710 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6975
15715 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6977
15716 msgid "Single 8-bit-byte characters."
15720 #: ../fish/guestfish-actions.pod:4615 ../src/guestfs-actions.pod:6979
15725 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6981
15726 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15730 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:6984
15731 msgid "l (lower case letter L)"
15735 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:6986
15737 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15738 "examining binaries in Windows guests."
15742 #: ../fish/guestfish-actions.pod:4625 ../src/guestfs-actions.pod:6989
15747 #: ../fish/guestfish-actions.pod:4627 ../src/guestfs-actions.pod:6991
15748 msgid "32-bit big endian such as UCS-4BE."
15752 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:6993
15757 #: ../fish/guestfish-actions.pod:4631 ../src/guestfs-actions.pod:6995
15758 msgid "32-bit little endian such as UCS-4LE."
15762 #: ../fish/guestfish-actions.pod:4635 ../src/guestfs-actions.pod:6999
15763 msgid "The returned strings are transcoded to UTF-8."
15767 #: ../fish/guestfish-actions.pod:4640
15768 msgid "swapoff-device"
15772 #: ../fish/guestfish-actions.pod:4642
15775 " swapoff-device device\n"
15780 #: ../fish/guestfish-actions.pod:4644
15782 "This command disables the libguestfs appliance swap device or partition "
15783 "named C<device>. See L</swapon-device>."
15787 #: ../fish/guestfish-actions.pod:4648
15788 msgid "swapoff-file"
15792 #: ../fish/guestfish-actions.pod:4650
15795 " swapoff-file file\n"
15800 #: ../fish/guestfish-actions.pod:4652 ../src/guestfs-actions.pod:7030
15801 msgid "This command disables the libguestfs appliance swap on file."
15805 #: ../fish/guestfish-actions.pod:4654
15806 msgid "swapoff-label"
15810 #: ../fish/guestfish-actions.pod:4656
15813 " swapoff-label label\n"
15818 #: ../fish/guestfish-actions.pod:4658 ../src/guestfs-actions.pod:7042
15820 "This command disables the libguestfs appliance swap on labeled swap "
15825 #: ../fish/guestfish-actions.pod:4661
15826 msgid "swapoff-uuid"
15830 #: ../fish/guestfish-actions.pod:4663
15833 " swapoff-uuid uuid\n"
15838 #: ../fish/guestfish-actions.pod:4665 ../src/guestfs-actions.pod:7055
15840 "This command disables the libguestfs appliance swap partition with the given "
15845 #: ../fish/guestfish-actions.pod:4668
15846 msgid "swapon-device"
15850 #: ../fish/guestfish-actions.pod:4670
15853 " swapon-device device\n"
15858 #: ../fish/guestfish-actions.pod:4672
15860 "This command enables the libguestfs appliance to use the swap device or "
15861 "partition named C<device>. The increased memory is made available for all "
15862 "commands, for example those run using L</command> or L</sh>."
15866 #: ../fish/guestfish-actions.pod:4677 ../src/guestfs-actions.pod:7073
15868 "Note that you should not swap to existing guest swap partitions unless you "
15869 "know what you are doing. They may contain hibernation information, or other "
15870 "information that the guest doesn't want you to trash. You also risk leaking "
15871 "information about the host to the guest this way. Instead, attach a new "
15872 "host device to the guest and swap on that."
15876 #: ../fish/guestfish-actions.pod:4684
15877 msgid "swapon-file"
15881 #: ../fish/guestfish-actions.pod:4686
15884 " swapon-file file\n"
15889 #: ../fish/guestfish-actions.pod:4688
15891 "This command enables swap to a file. See L</swapon-device> for other notes."
15895 #: ../fish/guestfish-actions.pod:4691
15896 msgid "swapon-label"
15900 #: ../fish/guestfish-actions.pod:4693
15903 " swapon-label label\n"
15908 #: ../fish/guestfish-actions.pod:4695
15910 "This command enables swap to a labeled swap partition. See L</swapon-"
15911 "device> for other notes."
15915 #: ../fish/guestfish-actions.pod:4698
15916 msgid "swapon-uuid"
15920 #: ../fish/guestfish-actions.pod:4700
15923 " swapon-uuid uuid\n"
15928 #: ../fish/guestfish-actions.pod:4702
15930 "This command enables swap to a swap partition with the given UUID. See L</"
15931 "swapon-device> for other notes."
15935 #: ../fish/guestfish-actions.pod:4705
15940 #: ../fish/guestfish-actions.pod:4707
15948 #: ../fish/guestfish-actions.pod:4709 ../src/guestfs-actions.pod:7128
15950 "This syncs the disk, so that any writes are flushed through to the "
15951 "underlying disk image."
15955 #: ../fish/guestfish-actions.pod:4712 ../src/guestfs-actions.pod:7131
15957 "You should always call this if you have modified a disk image, before "
15958 "closing the handle."
15962 #: ../fish/guestfish-actions.pod:4715
15967 #: ../fish/guestfish-actions.pod:4717
15975 #: ../fish/guestfish-actions.pod:4719 ../src/guestfs-actions.pod:7144
15977 "This command returns up to the last 10 lines of a file as a list of strings."
15981 #: ../fish/guestfish-actions.pod:4725
15986 #: ../fish/guestfish-actions.pod:4727
15989 " tail-n nrlines path\n"
15994 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7163
15996 "If the parameter C<nrlines> is a positive number, this returns the last "
15997 "C<nrlines> lines of the file C<path>."
16001 #: ../fish/guestfish-actions.pod:4732 ../src/guestfs-actions.pod:7166
16003 "If the parameter C<nrlines> is a negative number, this returns lines from "
16004 "the file C<path>, starting with the C<-nrlines>th line."
16008 #: ../fish/guestfish-actions.pod:4740
16013 #: ../fish/guestfish-actions.pod:4742
16016 " tar-in (tarfile|-) directory\n"
16021 #: ../fish/guestfish-actions.pod:4744 ../src/guestfs-actions.pod:7187
16023 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
16024 "tar file) into C<directory>."
16028 #: ../fish/guestfish-actions.pod:4747
16029 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
16033 #: ../fish/guestfish-actions.pod:4752
16038 #: ../fish/guestfish-actions.pod:4754
16041 " tar-out directory (tarfile|-)\n"
16046 #: ../fish/guestfish-actions.pod:4756 ../src/guestfs-actions.pod:7204
16048 "This command packs the contents of C<directory> and downloads it to local "
16053 #: ../fish/guestfish-actions.pod:4759
16054 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
16058 #: ../fish/guestfish-actions.pod:4764
16063 #: ../fish/guestfish-actions.pod:4766
16066 " tgz-in (tarball|-) directory\n"
16071 #: ../fish/guestfish-actions.pod:4768 ../src/guestfs-actions.pod:7221
16073 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
16074 "tar file) into C<directory>."
16078 #: ../fish/guestfish-actions.pod:4771
16079 msgid "To upload an uncompressed tarball, use L</tar-in>."
16083 #: ../fish/guestfish-actions.pod:4775
16088 #: ../fish/guestfish-actions.pod:4777
16091 " tgz-out directory (tarball|-)\n"
16096 #: ../fish/guestfish-actions.pod:4779 ../src/guestfs-actions.pod:7237
16098 "This command packs the contents of C<directory> and downloads it to local "
16103 #: ../fish/guestfish-actions.pod:4782
16104 msgid "To download an uncompressed tarball, use L</tar-out>."
16108 #: ../fish/guestfish-actions.pod:4786
16113 #: ../fish/guestfish-actions.pod:4788
16121 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7252
16123 "Touch acts like the L<touch(1)> command. It can be used to update the "
16124 "timestamps on a file, or, if the file does not exist, to create a new zero-"
16129 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7256
16131 "This command only works on regular files, and will fail on other file types "
16132 "such as directories, symbolic links, block special etc."
16136 #: ../fish/guestfish-actions.pod:4797
16141 #: ../fish/guestfish-actions.pod:4799
16149 #: ../fish/guestfish-actions.pod:4801 ../src/guestfs-actions.pod:7269
16151 "This command truncates C<path> to a zero-length file. The file must exist "
16156 #: ../fish/guestfish-actions.pod:4804
16157 msgid "truncate-size"
16161 #: ../fish/guestfish-actions.pod:4806
16164 " truncate-size path size\n"
16169 #: ../fish/guestfish-actions.pod:4808 ../src/guestfs-actions.pod:7283
16171 "This command truncates C<path> to size C<size> bytes. The file must exist "
16176 #: ../fish/guestfish-actions.pod:4811
16178 "If the current file size is less than C<size> then the file is extended to "
16179 "the required size with zero bytes. This creates a sparse file (ie. disk "
16180 "blocks are not allocated for the file until you write to it). To create a "
16181 "non-sparse file of zeroes, use L</fallocate64> instead."
16185 #: ../fish/guestfish-actions.pod:4817
16190 #: ../fish/guestfish-actions.pod:4819
16193 " tune2fs-l device\n"
16198 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7302
16200 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
16205 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7305
16207 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
16208 "for more details. The list of fields returned isn't clearly defined, and "
16209 "depends on both the version of C<tune2fs> that libguestfs was built against, "
16210 "and the filesystem itself."
16214 #: ../fish/guestfish-actions.pod:4829
16219 #: ../fish/guestfish-actions.pod:4831
16222 " txz-in (tarball|-) directory\n"
16227 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7325
16229 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
16230 "tar file) into C<directory>."
16234 #: ../fish/guestfish-actions.pod:4838
16239 #: ../fish/guestfish-actions.pod:4840
16242 " txz-out directory (tarball|-)\n"
16247 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7339
16249 "This command packs the contents of C<directory> and downloads it to local "
16250 "file C<tarball> (as an xz compressed tar archive)."
16254 #: ../fish/guestfish-actions.pod:4847
16259 #: ../fish/guestfish-actions.pod:4849
16267 #: ../fish/guestfish-actions.pod:4851 ../src/guestfs-actions.pod:7352
16269 "This function sets the mask used for creating new files and device nodes to "
16274 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7355
16276 "Typical umask values would be C<022> which creates new files with "
16277 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
16278 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
16282 #: ../fish/guestfish-actions.pod:4859 ../src/guestfs-actions.pod:7360
16284 "The default umask is C<022>. This is important because it means that "
16285 "directories and device nodes will be created with C<0644> or C<0755> mode "
16286 "even if you specify C<0777>."
16290 #: ../fish/guestfish-actions.pod:4863
16291 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
16295 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7367
16296 msgid "This call returns the previous umask."
16300 #: ../fish/guestfish-actions.pod:4868
16305 #: ../fish/guestfish-actions.pod:4870
16310 #: ../fish/guestfish-actions.pod:4872
16313 " umount pathordevice\n"
16318 #: ../fish/guestfish-actions.pod:4874 ../src/guestfs-actions.pod:7379
16320 "This unmounts the given filesystem. The filesystem may be specified either "
16321 "by its mountpoint (path) or the device which contains the filesystem."
16325 #: ../fish/guestfish-actions.pod:4878
16330 #: ../fish/guestfish-actions.pod:4880
16331 msgid "unmount-all"
16335 #: ../fish/guestfish-actions.pod:4882
16343 #: ../fish/guestfish-actions.pod:4884 ../src/guestfs-actions.pod:7392
16344 msgid "This unmounts all mounted filesystems."
16348 #: ../fish/guestfish-actions.pod:4886 ../src/guestfs-actions.pod:7394
16349 msgid "Some internal mounts are not unmounted by this call."
16353 #: ../fish/guestfish-actions.pod:4888
16358 #: ../fish/guestfish-actions.pod:4890
16361 " upload (filename|-) remotefilename\n"
16366 #: ../fish/guestfish-actions.pod:4892 ../fish/guestfish-actions.pod:4905
16367 #: ../src/guestfs-actions.pod:7407 ../src/guestfs-actions.pod:7431
16368 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
16372 #: ../fish/guestfish-actions.pod:4897
16373 msgid "See also L</download>."
16377 #: ../fish/guestfish-actions.pod:4901
16378 msgid "upload-offset"
16382 #: ../fish/guestfish-actions.pod:4903
16385 " upload-offset (filename|-) remotefilename offset\n"
16390 #: ../fish/guestfish-actions.pod:4908 ../src/guestfs-actions.pod:7434
16392 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
16393 "The intention is to overwrite parts of existing files or devices, although "
16394 "if a non-existant file is specified then it is created with a \"hole\" "
16395 "before C<offset>. The size of the data written is implicit in the size of "
16396 "the source C<filename>."
16400 #: ../fish/guestfish-actions.pod:4915
16402 "Note that there is no limit on the amount of data that can be uploaded with "
16403 "this call, unlike with L</pwrite>, and this call always writes the full "
16404 "amount unless an error occurs."
16408 #: ../fish/guestfish-actions.pod:4920
16409 msgid "See also L</upload>, L</pwrite>."
16413 #: ../fish/guestfish-actions.pod:4924
16418 #: ../fish/guestfish-actions.pod:4926
16421 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
16426 #: ../fish/guestfish-actions.pod:4928 ../src/guestfs-actions.pod:7467
16427 msgid "This command sets the timestamps of a file with nanosecond precision."
16431 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7470
16433 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
16438 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7473
16440 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
16441 "nanoseconds from the epoch."
16445 #: ../fish/guestfish-actions.pod:4937 ../src/guestfs-actions.pod:7476
16447 "If the C<*nsecs> field contains the special value C<-1> then the "
16448 "corresponding timestamp is set to the current time. (The C<*secs> field is "
16449 "ignored in this case)."
16453 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7480
16455 "If the C<*nsecs> field contains the special value C<-2> then the "
16456 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
16461 #: ../fish/guestfish-actions.pod:4945
16466 #: ../fish/guestfish-actions.pod:4947
16474 #: ../fish/guestfish-actions.pod:4949 ../src/guestfs-actions.pod:7493
16476 "Return the libguestfs version number that the program is linked against."
16480 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7496
16482 "Note that because of dynamic linking this is not necessarily the version of "
16483 "libguestfs that you compiled against. You can compile the program, and then "
16484 "at runtime dynamically link against a completely different C<libguestfs.so> "
16489 #: ../fish/guestfish-actions.pod:4957 ../src/guestfs-actions.pod:7501
16491 "This call was added in version C<1.0.58>. In previous versions of "
16492 "libguestfs there was no way to get the version number. From C code you can "
16493 "use dynamic linker functions to find out if this symbol exists (if it "
16494 "doesn't, then it's an earlier version)."
16498 #: ../fish/guestfish-actions.pod:4963 ../src/guestfs-actions.pod:7507
16500 "The call returns a structure with four elements. The first three (C<major>, "
16501 "C<minor> and C<release>) are numbers and correspond to the usual version "
16502 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
16503 "but may be used for distro-specific information."
16507 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7513
16509 "To construct the original version string: C<$major.$minor.$release$extra>"
16513 #: ../fish/guestfish-actions.pod:4972 ../src/guestfs-actions.pod:7516
16514 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16518 #: ../fish/guestfish-actions.pod:4974
16520 "I<Note:> Don't use this call to test for availability of features. In "
16521 "enterprise distributions we backport features from later versions into "
16522 "earlier versions, making this an unreliable way to test for features. Use "
16523 "L</available> instead."
16527 #: ../fish/guestfish-actions.pod:4980
16532 #: ../fish/guestfish-actions.pod:4982
16535 " vfs-label device\n"
16540 #: ../fish/guestfish-actions.pod:4984 ../src/guestfs-actions.pod:7536
16541 msgid "This returns the filesystem label of the filesystem on C<device>."
16545 #: ../fish/guestfish-actions.pod:4987 ../src/guestfs-actions.pod:7539
16546 msgid "If the filesystem is unlabeled, this returns the empty string."
16550 #: ../fish/guestfish-actions.pod:4989
16551 msgid "To find a filesystem from the label, use L</findfs-label>."
16555 #: ../fish/guestfish-actions.pod:4991
16560 #: ../fish/guestfish-actions.pod:4993
16563 " vfs-type device\n"
16568 #: ../fish/guestfish-actions.pod:4995 ../src/guestfs-actions.pod:7554
16570 "This command gets the filesystem type corresponding to the filesystem on "
16575 #: ../fish/guestfish-actions.pod:4998 ../src/guestfs-actions.pod:7557
16577 "For most filesystems, the result is the name of the Linux VFS module which "
16578 "would be used to mount this filesystem if you mounted it without specifying "
16579 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
16583 #: ../fish/guestfish-actions.pod:5003
16588 #: ../fish/guestfish-actions.pod:5005
16591 " vfs-uuid device\n"
16596 #: ../fish/guestfish-actions.pod:5007 ../src/guestfs-actions.pod:7573
16597 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16601 #: ../fish/guestfish-actions.pod:5010 ../src/guestfs-actions.pod:7576
16602 msgid "If the filesystem does not have a UUID, this returns the empty string."
16606 #: ../fish/guestfish-actions.pod:5012
16607 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
16611 #: ../fish/guestfish-actions.pod:5014
16612 msgid "vg-activate"
16616 #: ../fish/guestfish-actions.pod:5016
16619 " vg-activate true|false 'volgroups ...'\n"
16624 #: ../fish/guestfish-actions.pod:5018 ../src/guestfs-actions.pod:7592
16626 "This command activates or (if C<activate> is false) deactivates all logical "
16627 "volumes in the listed volume groups C<volgroups>."
16631 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7595
16632 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16636 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7597
16638 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16639 "activated or deactivated."
16643 #: ../fish/guestfish-actions.pod:5026
16644 msgid "vg-activate-all"
16648 #: ../fish/guestfish-actions.pod:5028
16651 " vg-activate-all true|false\n"
16656 #: ../fish/guestfish-actions.pod:5030 ../src/guestfs-actions.pod:7610
16658 "This command activates or (if C<activate> is false) deactivates all logical "
16659 "volumes in all volume groups."
16663 #: ../fish/guestfish-actions.pod:5033 ../src/guestfs-actions.pod:7613
16664 msgid "This command is the same as running C<vgchange -a y|n>"
16668 #: ../fish/guestfish-actions.pod:5035
16673 #: ../fish/guestfish-actions.pod:5037
16676 " vgcreate volgroup 'physvols ...'\n"
16681 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7626
16683 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16684 "of physical volumes C<physvols>."
16688 #: ../fish/guestfish-actions.pod:5042
16693 #: ../fish/guestfish-actions.pod:5044
16696 " vglvuuids vgname\n"
16701 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7639
16703 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16704 "volumes created in this volume group."
16708 #: ../fish/guestfish-actions.pod:5049
16710 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16711 "logical volumes and volume groups."
16715 #: ../fish/guestfish-actions.pod:5052
16716 msgid "See also L</vgpvuuids>."
16720 #: ../fish/guestfish-actions.pod:5054
16725 #: ../fish/guestfish-actions.pod:5056
16728 " vgpvuuids vgname\n"
16733 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7659
16735 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16736 "volumes that this volume group resides on."
16740 #: ../fish/guestfish-actions.pod:5061
16742 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16743 "physical volumes and volume groups."
16747 #: ../fish/guestfish-actions.pod:5064
16748 msgid "See also L</vglvuuids>."
16752 #: ../fish/guestfish-actions.pod:5066
16757 #: ../fish/guestfish-actions.pod:5068
16760 " vgremove vgname\n"
16765 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7679
16766 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16770 #: ../fish/guestfish-actions.pod:5072 ../src/guestfs-actions.pod:7681
16772 "This also forcibly removes all logical volumes in the volume group (if any)."
16776 #: ../fish/guestfish-actions.pod:5075
16781 #: ../fish/guestfish-actions.pod:5077
16784 " vgrename volgroup newvolgroup\n"
16789 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7695
16790 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16794 #: ../fish/guestfish-actions.pod:5081
16799 #: ../fish/guestfish-actions.pod:5083
16807 #: ../fish/guestfish-actions.pod:5085 ../src/guestfs-actions.pod:7706
16809 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16814 #: ../fish/guestfish-actions.pod:5088 ../src/guestfs-actions.pod:7709
16816 "This returns a list of just the volume group names that were detected (eg. "
16821 #: ../fish/guestfish-actions.pod:5091
16822 msgid "See also L</vgs-full>."
16826 #: ../fish/guestfish-actions.pod:5093
16831 #: ../fish/guestfish-actions.pod:5095
16839 #: ../fish/guestfish-actions.pod:5097 ../src/guestfs-actions.pod:7725
16841 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16842 "> command. The \"full\" version includes all fields."
16846 #: ../fish/guestfish-actions.pod:5100
16851 #: ../fish/guestfish-actions.pod:5102
16859 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7739
16861 "This rescans all block devices and rebuilds the list of LVM physical "
16862 "volumes, volume groups and logical volumes."
16866 #: ../fish/guestfish-actions.pod:5107
16871 #: ../fish/guestfish-actions.pod:5109
16879 #: ../fish/guestfish-actions.pod:5111 ../src/guestfs-actions.pod:7752
16880 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16884 #: ../fish/guestfish-actions.pod:5113
16889 #: ../fish/guestfish-actions.pod:5115
16897 #: ../fish/guestfish-actions.pod:5117 ../src/guestfs-actions.pod:7792
16899 "This command counts the characters in a file, using the C<wc -c> external "
16904 #: ../fish/guestfish-actions.pod:5120
16909 #: ../fish/guestfish-actions.pod:5122
16917 #: ../fish/guestfish-actions.pod:5124 ../src/guestfs-actions.pod:7805
16919 "This command counts the lines in a file, using the C<wc -l> external command."
16923 #: ../fish/guestfish-actions.pod:5127
16928 #: ../fish/guestfish-actions.pod:5129
16936 #: ../fish/guestfish-actions.pod:5131 ../src/guestfs-actions.pod:7818
16938 "This command counts the words in a file, using the C<wc -w> external command."
16942 #: ../fish/guestfish-actions.pod:5134
16947 #: ../fish/guestfish-actions.pod:5136
16950 " write path content\n"
16955 #: ../fish/guestfish-actions.pod:5138 ../src/guestfs-actions.pod:7833
16957 "This call creates a file called C<path>. The content of the file is the "
16958 "string C<content> (which can contain any 8 bit data)."
16962 #: ../fish/guestfish-actions.pod:5141
16963 msgid "See also L</write-append>."
16967 #: ../fish/guestfish-actions.pod:5146
16968 msgid "write-append"
16972 #: ../fish/guestfish-actions.pod:5148
16975 " write-append path content\n"
16980 #: ../fish/guestfish-actions.pod:5150 ../src/guestfs-actions.pod:7853
16982 "This call appends C<content> to the end of file C<path>. If C<path> does "
16983 "not exist, then a new file is created."
16987 #: ../fish/guestfish-actions.pod:5153
16988 msgid "See also L</write>."
16992 #: ../fish/guestfish-actions.pod:5158
16997 #: ../fish/guestfish-actions.pod:5160
17000 " write-file path content size\n"
17005 #: ../fish/guestfish-actions.pod:5162 ../src/guestfs-actions.pod:7880
17007 "This call creates a file called C<path>. The contents of the file is the "
17008 "string C<content> (which can contain any 8 bit data), with length C<size>."
17012 #: ../fish/guestfish-actions.pod:5166 ../src/guestfs-actions.pod:7884
17014 "As a special case, if C<size> is C<0> then the length is calculated using "
17015 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
17019 #: ../fish/guestfish-actions.pod:5170 ../src/guestfs-actions.pod:7888
17021 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
17022 "I<not> work, even if the length is specified."
17026 #: ../fish/guestfish-actions.pod:5176
17028 "I<This function is deprecated.> In new code, use the L</write> call instead."
17032 #: ../fish/guestfish-actions.pod:5183
17037 #: ../fish/guestfish-actions.pod:5185
17040 " zegrep regex path\n"
17045 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7905
17047 "This calls the external C<zegrep> program and returns the matching lines."
17051 #: ../fish/guestfish-actions.pod:5193
17056 #: ../fish/guestfish-actions.pod:5195
17059 " zegrepi regex path\n"
17064 #: ../fish/guestfish-actions.pod:5197 ../src/guestfs-actions.pod:7924
17066 "This calls the external C<zegrep -i> program and returns the matching lines."
17070 #: ../fish/guestfish-actions.pod:5203
17075 #: ../fish/guestfish-actions.pod:5205
17083 #: ../fish/guestfish-actions.pod:5207 ../src/guestfs-actions.pod:7942
17084 msgid "This command writes zeroes over the first few blocks of C<device>."
17088 #: ../fish/guestfish-actions.pod:5209 ../src/guestfs-actions.pod:7944
17090 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
17091 "securely wipe the device). It should be sufficient to remove any partition "
17092 "tables, filesystem superblocks and so on."
17096 #: ../fish/guestfish-actions.pod:5213 ../fish/guestfish-actions.pod:5228
17097 #: ../src/guestfs-actions.pod:7948 ../src/guestfs-actions.pod:7974
17099 "If blocks are already zero, then this command avoids writing zeroes. This "
17100 "prevents the underlying device from becoming non-sparse or growing "
17105 #: ../fish/guestfish-actions.pod:5217
17106 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
17110 #: ../fish/guestfish-actions.pod:5220
17111 msgid "zero-device"
17115 #: ../fish/guestfish-actions.pod:5222
17118 " zero-device device\n"
17123 #: ../fish/guestfish-actions.pod:5224
17125 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
17126 "which just zeroes the first few blocks of a device."
17130 #: ../fish/guestfish-actions.pod:5235
17135 #: ../fish/guestfish-actions.pod:5237
17138 " zerofree device\n"
17143 #: ../fish/guestfish-actions.pod:5239 ../src/guestfs-actions.pod:7996
17145 "This runs the I<zerofree> program on C<device>. This program claims to zero "
17146 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
17147 "possible to compress the filesystem more effectively."
17151 #: ../fish/guestfish-actions.pod:5244 ../src/guestfs-actions.pod:8001
17152 msgid "You should B<not> run this program if the filesystem is mounted."
17156 #: ../fish/guestfish-actions.pod:5247 ../src/guestfs-actions.pod:8004
17158 "It is possible that using this program can damage the filesystem or data on "
17163 #: ../fish/guestfish-actions.pod:5250
17168 #: ../fish/guestfish-actions.pod:5252
17171 " zfgrep pattern path\n"
17176 #: ../fish/guestfish-actions.pod:5254 ../src/guestfs-actions.pod:8018
17178 "This calls the external C<zfgrep> program and returns the matching lines."
17182 #: ../fish/guestfish-actions.pod:5260
17187 #: ../fish/guestfish-actions.pod:5262
17190 " zfgrepi pattern path\n"
17195 #: ../fish/guestfish-actions.pod:5264 ../src/guestfs-actions.pod:8037
17197 "This calls the external C<zfgrep -i> program and returns the matching lines."
17201 #: ../fish/guestfish-actions.pod:5270
17206 #: ../fish/guestfish-actions.pod:5272
17209 " zfile meth path\n"
17214 #: ../fish/guestfish-actions.pod:5274 ../src/guestfs-actions.pod:8063
17216 "This command runs C<file> after first decompressing C<path> using C<method>."
17220 #: ../fish/guestfish-actions.pod:5277 ../src/guestfs-actions.pod:8066
17221 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
17225 #: ../fish/guestfish-actions.pod:5279
17227 "Since 1.0.63, use L</file> instead which can now process compressed files."
17231 #: ../fish/guestfish-actions.pod:5282
17233 "I<This function is deprecated.> In new code, use the L</file> call instead."
17237 #: ../fish/guestfish-actions.pod:5289
17242 #: ../fish/guestfish-actions.pod:5291
17245 " zgrep regex path\n"
17250 #: ../fish/guestfish-actions.pod:5293 ../src/guestfs-actions.pod:8083
17252 "This calls the external C<zgrep> program and returns the matching lines."
17256 #: ../fish/guestfish-actions.pod:5299
17261 #: ../fish/guestfish-actions.pod:5301
17264 " zgrepi regex path\n"
17269 #: ../fish/guestfish-actions.pod:5303 ../src/guestfs-actions.pod:8102
17271 "This calls the external C<zgrep -i> program and returns the matching lines."
17275 #: ../fish/guestfish-commands.pod:1
17280 #: ../fish/guestfish-commands.pod:3
17285 #: ../fish/guestfish-commands.pod:5
17288 " alloc filename size\n"
17293 #: ../fish/guestfish-commands.pod:7
17295 "This creates an empty (zeroed) file of the given size, and then adds so it "
17296 "can be further examined."
17300 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
17301 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
17305 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
17306 msgid "Size can be specified using standard suffixes, eg. C<1M>."
17310 #: ../fish/guestfish-commands.pod:14
17312 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
17313 "image, see L</PREPARED DISK IMAGES>."
17317 #: ../fish/guestfish-commands.pod:17
17322 #: ../fish/guestfish-commands.pod:19
17325 " copy-in local [local ...] /remotedir\n"
17330 #: ../fish/guestfish-commands.pod:21
17332 "C<copy-in> copies local files or directories recursively into the disk "
17333 "image, placing them in the directory called C</remotedir> (which must "
17334 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
17335 "other commands as necessary."
17339 #: ../fish/guestfish-commands.pod:26
17341 "Multiple local files and directories can be specified, but the last "
17342 "parameter must always be a remote directory. Wildcards cannot be used."
17346 #: ../fish/guestfish-commands.pod:30
17351 #: ../fish/guestfish-commands.pod:32
17354 " copy-out remote [remote ...] localdir\n"
17359 #: ../fish/guestfish-commands.pod:34
17361 "C<copy-out> copies remote files or directories recursively out of the disk "
17362 "image, placing them on the host disk in a local directory called C<localdir> "
17363 "(which must exist). This guestfish meta-command turns into a sequence of L</"
17364 "download>, L</tar-out> and other commands as necessary."
17368 #: ../fish/guestfish-commands.pod:40
17370 "Multiple remote files and directories can be specified, but the last "
17371 "parameter must always be a local directory. To download to the current "
17372 "directory, use C<.> as in:"
17376 #: ../fish/guestfish-commands.pod:44
17379 " copy-out /home .\n"
17384 #: ../fish/guestfish-commands.pod:46
17386 "Wildcards cannot be used in the ordinary command, but you can use them with "
17387 "the help of L</glob> like this:"
17391 #: ../fish/guestfish-commands.pod:49
17394 " glob copy-out /home/* .\n"
17399 #: ../fish/guestfish-commands.pod:51
17404 #: ../fish/guestfish-commands.pod:53
17407 " display filename\n"
17412 #: ../fish/guestfish-commands.pod:55
17414 "Use C<display> (a graphical display program) to display an image file. It "
17415 "downloads the file, and runs C<display> on it."
17419 #: ../fish/guestfish-commands.pod:58
17421 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
17422 "environment variable. For example to use the GNOME display program:"
17426 #: ../fish/guestfish-commands.pod:61
17429 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
17434 #: ../fish/guestfish-commands.pod:63
17435 msgid "See also L<display(1)>."
17439 #: ../fish/guestfish-commands.pod:65
17444 #: ../fish/guestfish-commands.pod:67
17447 " echo [params ...]\n"
17452 #: ../fish/guestfish-commands.pod:69
17453 msgid "This echos the parameters to the terminal."
17457 #: ../fish/guestfish-commands.pod:71
17462 #: ../fish/guestfish-commands.pod:73
17467 #: ../fish/guestfish-commands.pod:75
17472 #: ../fish/guestfish-commands.pod:77
17480 #: ../fish/guestfish-commands.pod:79
17482 "This is used to edit a file. It downloads the file, edits it locally using "
17483 "your editor, then uploads the result."
17487 #: ../fish/guestfish-commands.pod:82
17489 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
17490 "or C<emacs> you will get those corresponding editors."
17494 #: ../fish/guestfish-commands.pod:86
17499 #: ../fish/guestfish-commands.pod:88
17502 " glob command args...\n"
17507 #: ../fish/guestfish-commands.pod:90
17509 "Expand wildcards in any paths in the args list, and run C<command> "
17510 "repeatedly on each matching path."
17514 #: ../fish/guestfish-commands.pod:93
17515 msgid "See L</WILDCARDS AND GLOBBING>."
17519 #: ../fish/guestfish-commands.pod:95
17524 #: ../fish/guestfish-commands.pod:97
17527 " hexedit <filename|device>\n"
17528 " hexedit <filename|device> <max>\n"
17529 " hexedit <filename|device> <start> <max>\n"
17534 #: ../fish/guestfish-commands.pod:101
17536 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
17541 #: ../fish/guestfish-commands.pod:104
17543 "This command works by downloading potentially the whole file or device, "
17544 "editing it locally, then uploading it. If the file or device is large, you "
17545 "have to specify which part you wish to edit by using C<max> and/or C<start> "
17546 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
17547 "usual modifiers allowed such as C<1M> (1 megabyte)."
17551 #: ../fish/guestfish-commands.pod:111
17552 msgid "For example to edit the first few sectors of a disk you might do:"
17556 #: ../fish/guestfish-commands.pod:114
17559 " hexedit /dev/sda 1M\n"
17564 #: ../fish/guestfish-commands.pod:116
17566 "which would allow you to edit anywhere within the first megabyte of the disk."
17570 #: ../fish/guestfish-commands.pod:119
17571 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
17575 #: ../fish/guestfish-commands.pod:121
17578 " hexedit /dev/sda1 0x400 0x400\n"
17583 #: ../fish/guestfish-commands.pod:123
17584 msgid "(assuming the superblock is in the standard location)."
17588 #: ../fish/guestfish-commands.pod:125
17590 "This command requires the external L<hexedit(1)> program. You can specify "
17591 "another program to use by setting the C<HEXEDITOR> environment variable."
17595 #: ../fish/guestfish-commands.pod:129
17596 msgid "See also L</hexdump>."
17600 #: ../fish/guestfish-commands.pod:131
17605 #: ../fish/guestfish-commands.pod:133
17613 #: ../fish/guestfish-commands.pod:135
17615 "Change the local directory, ie. the current directory of guestfish itself."
17619 #: ../fish/guestfish-commands.pod:138
17620 msgid "Note that C<!cd> won't do what you might expect."
17624 #: ../fish/guestfish-commands.pod:140
17629 #: ../fish/guestfish-commands.pod:142
17634 #: ../fish/guestfish-commands.pod:144
17642 #: ../fish/guestfish-commands.pod:146
17643 msgid "Opens the manual page for guestfish."
17647 #: ../fish/guestfish-commands.pod:148
17652 #: ../fish/guestfish-commands.pod:150
17657 #: ../fish/guestfish-commands.pod:152
17665 #: ../fish/guestfish-commands.pod:154
17673 #: ../fish/guestfish-commands.pod:156
17674 msgid "This is used to view a file."
17678 #: ../fish/guestfish-commands.pod:158
17680 "The default viewer is C<$PAGER>. However if you use the alternate command "
17681 "C<less> you will get the C<less> command specifically."
17685 #: ../fish/guestfish-commands.pod:161
17690 #: ../fish/guestfish-commands.pod:163
17698 #: ../fish/guestfish-commands.pod:165
17700 "Close and reopen the libguestfs handle. It is not necessary to use this "
17701 "normally, because the handle is closed properly when guestfish exits. "
17702 "However this is occasionally useful for testing."
17706 #: ../fish/guestfish-commands.pod:169
17711 #: ../fish/guestfish-commands.pod:171
17714 " setenv VAR value\n"
17719 #: ../fish/guestfish-commands.pod:173
17720 msgid "Set the environment variable C<VAR> to the string C<value>."
17724 #: ../fish/guestfish-commands.pod:175
17726 "To print the value of an environment variable use a shell command such as:"
17730 #: ../fish/guestfish-commands.pod:178
17738 #: ../fish/guestfish-commands.pod:180
17743 #: ../fish/guestfish-commands.pod:182
17746 " sparse filename size\n"
17751 #: ../fish/guestfish-commands.pod:184
17753 "This creates an empty sparse file of the given size, and then adds so it can "
17754 "be further examined."
17758 #: ../fish/guestfish-commands.pod:187
17760 "In all respects it works the same as the L</alloc> command, except that the "
17761 "image file is allocated sparsely, which means that disk blocks are not "
17762 "assigned to the file until they are needed. Sparse disk files only use "
17763 "space when written to, but they are slower and there is a danger you could "
17764 "run out of real disk space during a write operation."
17768 #: ../fish/guestfish-commands.pod:197
17773 #: ../fish/guestfish-commands.pod:199
17781 #: ../fish/guestfish-commands.pod:201
17783 "This command returns a list of the optional groups known to the daemon, and "
17784 "indicates which ones are supported by this build of the libguestfs appliance."
17788 #: ../fish/guestfish-commands.pod:205
17789 msgid "See also L<guestfs(3)/AVAILABILITY>."
17793 #: ../fish/guestfish-commands.pod:207
17798 #: ../fish/guestfish-commands.pod:209
17801 " time command args...\n"
17806 #: ../fish/guestfish-commands.pod:211
17808 "Run the command as usual, but print the elapsed time afterwards. This can "
17809 "be useful for benchmarking operations."
17813 #: ../fish/guestfish-commands.pod:214
17818 #: ../fish/guestfish-commands.pod:216
17826 #: ../fish/guestfish-commands.pod:218
17827 msgid "Remove C<VAR> from the environment."
17831 #: ../fish/guestfish.pod:5
17832 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17836 #: ../fish/guestfish.pod:9
17839 " guestfish [--options] [commands]\n"
17844 #: ../fish/guestfish.pod:11
17852 #: ../fish/guestfish.pod:13
17855 " guestfish [--ro|--rw] -a disk.img\n"
17860 #: ../fish/guestfish.pod:15
17863 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17868 #: ../fish/guestfish.pod:17
17871 " guestfish -d libvirt-domain\n"
17876 #: ../fish/guestfish.pod:19
17879 " guestfish [--ro|--rw] -a disk.img -i\n"
17884 #: ../fish/guestfish.pod:21
17887 " guestfish -d libvirt-domain -i\n"
17892 #: ../fish/guestfish.pod:25
17894 "Using guestfish in read/write mode on live virtual machines can be "
17895 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17896 "option to use guestfish safely if the disk image or virtual machine might be "
17901 #: ../fish/guestfish.pod:32
17903 "Guestfish is a shell and command-line tool for examining and modifying "
17904 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17905 "functionality of the guestfs API, see L<guestfs(3)>."
17909 #: ../fish/guestfish.pod:36
17911 "Guestfish gives you structured access to the libguestfs API, from shell "
17912 "scripts or the command line or interactively. If you want to rescue a "
17913 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17918 #: ../fish/guestfish.pod:43
17919 msgid "As an interactive shell"
17923 #: ../fish/guestfish.pod:45
17931 #: ../fish/guestfish.pod:47
17934 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17935 " editing virtual machine filesystems.\n"
17940 #: ../fish/guestfish.pod:50
17943 " Type: 'help' for a list of commands\n"
17944 " 'man' to read the manual\n"
17945 " 'quit' to quit the shell\n"
17950 #: ../fish/guestfish.pod:54
17953 " ><fs> add-ro disk.img\n"
17955 " ><fs> list-filesystems\n"
17956 " /dev/sda1: ext4\n"
17957 " /dev/vg_guest/lv_root: ext4\n"
17958 " /dev/vg_guest/lv_swap: swap\n"
17959 " ><fs> mount /dev/vg_guest/lv_root /\n"
17960 " ><fs> cat /etc/fstab\n"
17962 " # Created by anaconda\n"
17969 #: ../fish/guestfish.pod:67
17970 msgid "From shell scripts"
17974 #: ../fish/guestfish.pod:69
17975 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17979 #: ../fish/guestfish.pod:71
17982 " guestfish <<_EOF_\n"
17985 " mount /dev/vg_guest/lv_root /\n"
17986 " write /etc/motd \"Welcome, new users\"\n"
17992 #: ../fish/guestfish.pod:78
17993 msgid "List the LVM logical volumes in a disk image:"
17997 #: ../fish/guestfish.pod:80
18000 " guestfish -a disk.img --ro <<_EOF_\n"
18008 #: ../fish/guestfish.pod:85
18009 msgid "List all the filesystems in a disk image:"
18013 #: ../fish/guestfish.pod:87
18016 " guestfish -a disk.img --ro <<_EOF_\n"
18018 " list-filesystems\n"
18024 #: ../fish/guestfish.pod:92
18025 msgid "On one command line"
18029 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
18030 msgid "Update C</etc/resolv.conf> in a guest:"
18034 #: ../fish/guestfish.pod:96
18038 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
18039 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
18044 #: ../fish/guestfish.pod:100
18045 msgid "Edit C</boot/grub/grub.conf> interactively:"
18049 #: ../fish/guestfish.pod:102
18052 " guestfish --rw --add disk.img \\\n"
18053 " --mount /dev/vg_guest/lv_root \\\n"
18054 " --mount /dev/sda1:/boot \\\n"
18055 " edit /boot/grub/grub.conf\n"
18060 #: ../fish/guestfish.pod:107
18061 msgid "Mount disks automatically"
18065 #: ../fish/guestfish.pod:109
18067 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
18071 #: ../fish/guestfish.pod:112
18074 " guestfish --ro -a disk.img -i cat /etc/group\n"
18079 #: ../fish/guestfish.pod:114
18082 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
18087 #: ../fish/guestfish.pod:116
18088 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
18092 #: ../fish/guestfish.pod:118
18095 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
18100 #: ../fish/guestfish.pod:120
18101 msgid "As a script interpreter"
18105 #: ../fish/guestfish.pod:122
18106 msgid "Create a 100MB disk containing an ext2-formatted partition:"
18110 #: ../fish/guestfish.pod:124
18113 " #!/usr/bin/guestfish -f\n"
18114 " sparse test1.img 100M\n"
18116 " part-disk /dev/sda mbr\n"
18117 " mkfs ext2 /dev/sda1\n"
18122 #: ../fish/guestfish.pod:130
18123 msgid "Start with a prepared disk"
18127 #: ../fish/guestfish.pod:132
18129 "An alternate way to create a 100MB disk called C<test1.img> containing a "
18130 "single ext2-formatted partition:"
18134 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2228
18137 " guestfish -N fs\n"
18142 #: ../fish/guestfish.pod:137
18143 msgid "To list what is available do:"
18147 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
18150 " guestfish -N help | less\n"
18155 #: ../fish/guestfish.pod:141
18156 msgid "Remote control"
18160 #: ../fish/guestfish.pod:143
18163 " eval \"`guestfish --listen`\"\n"
18164 " guestfish --remote add-ro disk.img\n"
18165 " guestfish --remote run\n"
18166 " guestfish --remote lvs\n"
18171 #: ../fish/guestfish.pod:154
18172 msgid "Displays general help on options."
18176 #: ../fish/guestfish.pod:158
18177 msgid "B<--cmd-help>"
18181 #: ../fish/guestfish.pod:160
18182 msgid "Lists all available guestfish commands."
18186 #: ../fish/guestfish.pod:162
18191 #: ../fish/guestfish.pod:164
18192 msgid "B<--cmd-help cmd>"
18196 #: ../fish/guestfish.pod:166
18197 msgid "Displays detailed help on a single command C<cmd>."
18201 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
18202 msgid "B<-a image>"
18206 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
18207 msgid "B<--add image>"
18211 #: ../fish/guestfish.pod:172
18212 msgid "Add a block device or virtual machine image to the shell."
18216 #: ../fish/guestfish.pod:177
18218 "Using this flag is mostly equivalent to using the C<add> command, with "
18219 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
18220 "the I<--format=...> flag was given."
18224 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
18226 "When used in conjunction with the I<-d> option, this specifies the libvirt "
18227 "URI to use. The default is to use the default libvirt connection."
18231 #: ../fish/guestfish.pod:189
18236 #: ../fish/guestfish.pod:191
18238 "If using the I<--listen> option and a csh-like shell, use this option. See "
18239 "section L</REMOTE CONTROL AND CSH> below."
18243 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
18244 msgid "B<-d libvirt-domain>"
18248 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
18249 msgid "B<--domain libvirt-domain>"
18253 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
18255 "Add disks from the named libvirt domain. If the I<--ro> option is also "
18256 "used, then any libvirt domain can be used. However in write mode, only "
18257 "libvirt domains which are shut down can be named here."
18261 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
18262 msgid "Domain UUIDs can be used instead of names."
18266 #: ../fish/guestfish.pod:204
18268 "Using this flag is mostly equivalent to using the C<add-domain> command, "
18269 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
18270 "if the I<--format:...> flag was given."
18274 #: ../fish/guestfish.pod:208
18279 #: ../fish/guestfish.pod:210
18280 msgid "B<--no-dest-paths>"
18284 #: ../fish/guestfish.pod:212
18286 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
18287 "to hit the tab key to complete paths on the guest filesystem, but this "
18288 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
18289 "allow this feature to be disabled."
18293 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
18295 "When prompting for keys and passphrases, guestfish normally turns echoing "
18296 "off so you cannot see what you are typing. If you are not worried about "
18297 "Tempest attacks and there is no one else in the room you can specify this "
18298 "flag to see what you are typing."
18302 #: ../fish/guestfish.pod:224
18307 #: ../fish/guestfish.pod:226
18308 msgid "B<--file file>"
18312 #: ../fish/guestfish.pod:228
18313 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
18317 #: ../fish/guestfish.pod:231
18320 " #!/usr/bin/guestfish -f\n"
18325 #: ../fish/guestfish.pod:244
18328 " guestfish --format=raw -a disk.img\n"
18333 #: ../fish/guestfish.pod:248
18336 " guestfish --format=raw -a disk.img --format -a another.img\n"
18341 #: ../fish/guestfish.pod:253
18343 "If you have untrusted raw-format guest disk images, you should use this "
18344 "option to specify the disk format. This avoids a possible security problem "
18345 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
18349 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
18350 msgid "B<--inspector>"
18354 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
18356 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
18357 "system and mount filesystems as they would be mounted on the real virtual "
18362 #: ../fish/guestfish.pod:266
18363 msgid "Typical usage is either:"
18367 #: ../fish/guestfish.pod:268
18370 " guestfish -d myguest -i\n"
18375 #: ../fish/guestfish.pod:270
18376 msgid "(for an inactive libvirt domain called I<myguest>), or:"
18380 #: ../fish/guestfish.pod:272
18383 " guestfish --ro -d myguest -i\n"
18388 #: ../fish/guestfish.pod:274
18389 msgid "(for active domains, readonly), or specify the block device directly:"
18393 #: ../fish/guestfish.pod:276
18396 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
18401 #: ../fish/guestfish.pod:278
18403 "Note that the command line syntax changed slightly over older versions of "
18404 "guestfish. You can still use the old syntax:"
18408 #: ../fish/guestfish.pod:281
18411 " guestfish [--ro] -i disk.img\n"
18416 #: ../fish/guestfish.pod:283
18419 " guestfish [--ro] -i libvirt-domain\n"
18424 #: ../fish/guestfish.pod:285
18426 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
18427 "then using other commands to mount the filesystems that were found."
18431 #: ../fish/guestfish.pod:294
18432 msgid "B<--listen>"
18436 #: ../fish/guestfish.pod:296
18438 "Fork into the background and listen for remote commands. See section L</"
18439 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
18443 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
18448 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
18450 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
18451 "ATTACHING TO RUNNING DAEMONS>)."
18455 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
18456 msgid "B<-m dev[:mountpoint[:options]]>"
18460 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
18461 msgid "B<--mount dev[:mountpoint[:options]]>"
18465 #: ../fish/guestfish.pod:308
18466 msgid "Mount the named partition or logical volume on the given mountpoint."
18470 #: ../fish/guestfish.pod:310
18471 msgid "If the mountpoint is omitted, it defaults to C</>."
18475 #: ../fish/guestfish.pod:312
18476 msgid "You have to mount something on C</> before most commands will work."
18480 #: ../fish/guestfish.pod:314
18482 "If any I<-m> or I<--mount> options are given, the guest is automatically "
18487 #: ../fish/guestfish.pod:317
18489 "If you don't know what filesystems a disk image contains, you can either run "
18490 "guestfish without this option, then list the partitions, filesystems and LVs "
18491 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
18492 "commands), or you can use the L<virt-filesystems(1)> program."
18496 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
18498 "The third (and rarely used) part of the mount parameter is the list of mount "
18499 "options used to mount the underlying filesystem. If this is not given, then "
18500 "the mount options are either the empty string or C<ro> (the latter if the "
18501 "I<--ro> flag is used). By specifying the mount options, you override this "
18502 "default choice. Probably the only time you would use this is to enable ACLs "
18503 "and/or extended attributes if the filesystem can support them:"
18507 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
18510 " -m /dev/sda1:/:acl,user_xattr\n"
18515 #: ../fish/guestfish.pod:333
18516 msgid "Using this flag is equivalent to using the C<mount-options> command."
18520 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202
18521 #: ../resize/virt-resize.pod:358
18526 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
18527 msgid "B<--no-sync>"
18531 #: ../fish/guestfish.pod:339
18533 "Disable autosync. This is enabled by default. See the discussion of "
18534 "autosync in the L<guestfs(3)> manpage."
18538 #: ../fish/guestfish.pod:342
18543 #: ../fish/guestfish.pod:344
18544 msgid "B<--new type>"
18548 #: ../fish/guestfish.pod:346
18553 #: ../fish/guestfish.pod:348
18555 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18556 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18557 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18562 #: ../fish/guestfish.pod:353
18563 msgid "B<--progress-bars>"
18567 #: ../fish/guestfish.pod:355
18568 msgid "Enable progress bars, even when guestfish is used non-interactively."
18572 #: ../fish/guestfish.pod:357
18574 "Progress bars are enabled by default when guestfish is used as an "
18575 "interactive shell."
18579 #: ../fish/guestfish.pod:360
18580 msgid "B<--no-progress-bars>"
18584 #: ../fish/guestfish.pod:362
18585 msgid "Disable progress bars."
18589 #: ../fish/guestfish.pod:364
18590 msgid "B<--remote[=pid]>"
18594 #: ../fish/guestfish.pod:366
18596 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18597 "CONTROL GUESTFISH OVER A SOCKET> below."
18601 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248
18602 #: ../rescue/virt-rescue.pod:161
18607 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250
18608 #: ../rescue/virt-rescue.pod:163
18613 #: ../fish/guestfish.pod:373
18615 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18616 "mounts are done read-only."
18620 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
18622 "The option must always be used if the disk image or virtual machine might be "
18623 "running, and is generally recommended in cases where you don't need write "
18624 "access to the disk."
18628 #: ../fish/guestfish.pod:380
18630 "Note that prepared disk images created with I<-N> are not affected by this "
18631 "option. Also commands like C<add> are not affected - you have to specify "
18632 "the C<readonly:true> option explicitly if you need it."
18636 #: ../fish/guestfish.pod:384
18637 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18641 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262
18642 #: ../rescue/virt-rescue.pod:173
18643 msgid "B<--selinux>"
18647 #: ../fish/guestfish.pod:388
18648 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18652 #: ../fish/guestfish.pod:394
18654 "Enable very verbose messages. This is particularly useful if you find a bug."
18658 #: ../fish/guestfish.pod:401
18659 msgid "Display the guestfish / libguestfs version number and exit."
18663 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278
18664 #: ../rescue/virt-rescue.pod:194
18669 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280
18670 #: ../rescue/virt-rescue.pod:196
18675 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
18677 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18678 "mounts are done read-write."
18682 #: ../fish/guestfish.pod:410
18683 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18687 #: ../fish/guestfish.pod:414
18688 msgid "Echo each command before executing it."
18692 #: ../fish/guestfish.pod:418
18693 msgid "COMMANDS ON COMMAND LINE"
18697 #: ../fish/guestfish.pod:420
18699 "Any additional (non-option) arguments are treated as commands to execute."
18703 #: ../fish/guestfish.pod:423
18705 "Commands to execute should be separated by a colon (C<:>), where the colon "
18706 "is a separate parameter. Thus:"
18710 #: ../fish/guestfish.pod:426
18713 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18718 #: ../fish/guestfish.pod:428
18720 "If there are no additional arguments, then we enter a shell, either an "
18721 "interactive shell with a prompt (if the input is a terminal) or a non-"
18722 "interactive shell."
18726 #: ../fish/guestfish.pod:432
18728 "In either command line mode or non-interactive shell, the first command that "
18729 "gives an error causes the whole shell to exit. In interactive mode (with a "
18730 "prompt) if a command fails, you can continue to enter commands."
18734 #: ../fish/guestfish.pod:437
18735 msgid "USING launch (OR run)"
18739 #: ../fish/guestfish.pod:439
18741 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18742 "then launch it, then mount any disks you need, and finally issue actions/"
18743 "commands. So the general order of the day is:"
18747 #: ../fish/guestfish.pod:447
18748 msgid "add or -a/--add"
18752 #: ../fish/guestfish.pod:451
18753 msgid "launch (aka run)"
18757 #: ../fish/guestfish.pod:455
18758 msgid "mount or -m/--mount"
18762 #: ../fish/guestfish.pod:459
18763 msgid "any other commands"
18767 #: ../fish/guestfish.pod:463
18769 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18770 "guest before mounting or performing any other commands."
18774 #: ../fish/guestfish.pod:466
18776 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18777 "I<--new> options were given then C<run> is done automatically, simply "
18778 "because guestfish can't perform the action you asked for without doing this."
18782 #: ../fish/guestfish.pod:471
18783 msgid "OPENING DISKS FOR READ AND WRITE"
18787 #: ../fish/guestfish.pod:473
18789 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18790 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18791 "I<-i> and I<-m> open disk images read-only or for writing."
18795 #: ../fish/guestfish.pod:478
18797 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18798 "opening disk images supplied on the command line for write. To open a disk "
18799 "image read-only you have to do I<-a image --ro>."
18803 #: ../fish/guestfish.pod:482
18805 "This matters: If you accidentally open a live VM disk image writable then "
18806 "you will cause irreversible disk corruption."
18810 #: ../fish/guestfish.pod:485
18812 "In a future libguestfs we intend to change the default the other way. Disk "
18813 "images will be opened read-only. You will have to either specify "
18814 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18815 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18816 "access for disk images specified by those other command line options."
18820 #: ../fish/guestfish.pod:492
18822 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18823 "which does nothing (it is already the default). However it is highly "
18824 "recommended that you use this option to indicate that you need write access, "
18825 "and prepare your scripts for the day when this option will be required for "
18830 #: ../fish/guestfish.pod:498
18832 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18833 "other libguestfs program apart from guestfish and guestmount."
18837 #: ../fish/guestfish.pod:501
18842 #: ../fish/guestfish.pod:503
18844 "You can quote ordinary parameters using either single or double quotes. For "
18849 #: ../fish/guestfish.pod:506
18852 " add \"file with a space.img\"\n"
18857 #: ../fish/guestfish.pod:508
18860 " rm '/file name'\n"
18865 #: ../fish/guestfish.pod:510
18873 #: ../fish/guestfish.pod:512
18875 "A few commands require a list of strings to be passed. For these, use a "
18876 "whitespace-separated list, enclosed in quotes. Strings containing "
18877 "whitespace to be passed through must be enclosed in single quotes. A "
18878 "literal single quote must be escaped with a backslash."
18882 #: ../fish/guestfish.pod:517
18885 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18886 " command \"/bin/echo 'foo bar'\"\n"
18887 " command \"/bin/echo \\'foo\\'\"\n"
18892 #: ../fish/guestfish.pod:521
18893 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18897 #: ../fish/guestfish.pod:523
18899 "In double-quoted arguments (only) use backslash to insert special characters:"
18903 #: ../fish/guestfish.pod:528
18908 #: ../fish/guestfish.pod:530
18909 msgid "Alert (bell) character."
18913 #: ../fish/guestfish.pod:532
18918 #: ../fish/guestfish.pod:534
18919 msgid "Backspace character."
18923 #: ../fish/guestfish.pod:536
18928 #: ../fish/guestfish.pod:538
18929 msgid "Form feed character."
18933 #: ../fish/guestfish.pod:540
18938 #: ../fish/guestfish.pod:542
18939 msgid "Newline character."
18943 #: ../fish/guestfish.pod:544
18948 #: ../fish/guestfish.pod:546
18949 msgid "Carriage return character."
18953 #: ../fish/guestfish.pod:548
18958 #: ../fish/guestfish.pod:550
18959 msgid "Horizontal tab character."
18963 #: ../fish/guestfish.pod:552
18968 #: ../fish/guestfish.pod:554
18969 msgid "Vertical tab character."
18973 #: ../fish/guestfish.pod:556
18978 #: ../fish/guestfish.pod:558
18979 msgid "A literal double quote character."
18983 #: ../fish/guestfish.pod:560
18988 #: ../fish/guestfish.pod:562
18990 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18995 #: ../fish/guestfish.pod:565
19000 #: ../fish/guestfish.pod:567
19002 "A character with hex value I<hh>. There must be precisely 2 hex digits."
19006 #: ../fish/guestfish.pod:570
19008 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
19013 #: ../fish/guestfish.pod:573
19018 #: ../fish/guestfish.pod:575
19019 msgid "A literal backslash character."
19023 #: ../fish/guestfish.pod:579
19024 msgid "OPTIONAL ARGUMENTS"
19028 #: ../fish/guestfish.pod:581
19030 "Some commands take optional arguments. These arguments appear in this "
19031 "documentation as C<[argname:..]>. You can use them as in these examples:"
19035 #: ../fish/guestfish.pod:585
19038 " add-drive-opts filename\n"
19043 #: ../fish/guestfish.pod:587
19046 " add-drive-opts filename readonly:true\n"
19051 #: ../fish/guestfish.pod:589
19054 " add-drive-opts filename format:qcow2 readonly:false\n"
19059 #: ../fish/guestfish.pod:591
19061 "Each optional argument can appear at most once. All optional arguments must "
19062 "appear after the required ones."
19066 #: ../fish/guestfish.pod:594
19071 #: ../fish/guestfish.pod:596
19073 "This section applies to all commands which can take integers as parameters."
19077 #: ../fish/guestfish.pod:599
19078 msgid "SIZE SUFFIX"
19082 #: ../fish/guestfish.pod:601
19084 "When the command takes a parameter measured in bytes, you can use one of the "
19085 "following suffixes to specify kilobytes, megabytes and larger sizes:"
19089 #: ../fish/guestfish.pod:607
19090 msgid "B<k> or B<K> or B<KiB>"
19094 #: ../fish/guestfish.pod:609
19095 msgid "The size in kilobytes (multiplied by 1024)."
19099 #: ../fish/guestfish.pod:611
19104 #: ../fish/guestfish.pod:613
19105 msgid "The size in SI 1000 byte units."
19109 #: ../fish/guestfish.pod:615
19110 msgid "B<M> or B<MiB>"
19114 #: ../fish/guestfish.pod:617
19115 msgid "The size in megabytes (multiplied by 1048576)."
19119 #: ../fish/guestfish.pod:619
19124 #: ../fish/guestfish.pod:621
19125 msgid "The size in SI 1000000 byte units."
19129 #: ../fish/guestfish.pod:623
19130 msgid "B<G> or B<GiB>"
19134 #: ../fish/guestfish.pod:625
19135 msgid "The size in gigabytes (multiplied by 2**30)."
19139 #: ../fish/guestfish.pod:627
19144 #: ../fish/guestfish.pod:629
19145 msgid "The size in SI 10**9 byte units."
19149 #: ../fish/guestfish.pod:631
19150 msgid "B<T> or B<TiB>"
19154 #: ../fish/guestfish.pod:633
19155 msgid "The size in terabytes (multiplied by 2**40)."
19159 #: ../fish/guestfish.pod:635
19164 #: ../fish/guestfish.pod:637
19165 msgid "The size in SI 10**12 byte units."
19169 #: ../fish/guestfish.pod:639
19170 msgid "B<P> or B<PiB>"
19174 #: ../fish/guestfish.pod:641
19175 msgid "The size in petabytes (multiplied by 2**50)."
19179 #: ../fish/guestfish.pod:643
19184 #: ../fish/guestfish.pod:645
19185 msgid "The size in SI 10**15 byte units."
19189 #: ../fish/guestfish.pod:647
19190 msgid "B<E> or B<EiB>"
19194 #: ../fish/guestfish.pod:649
19195 msgid "The size in exabytes (multiplied by 2**60)."
19199 #: ../fish/guestfish.pod:651
19204 #: ../fish/guestfish.pod:653
19205 msgid "The size in SI 10**18 byte units."
19209 #: ../fish/guestfish.pod:655
19210 msgid "B<Z> or B<ZiB>"
19214 #: ../fish/guestfish.pod:657
19215 msgid "The size in zettabytes (multiplied by 2**70)."
19219 #: ../fish/guestfish.pod:659
19224 #: ../fish/guestfish.pod:661
19225 msgid "The size in SI 10**21 byte units."
19229 #: ../fish/guestfish.pod:663
19230 msgid "B<Y> or B<YiB>"
19234 #: ../fish/guestfish.pod:665
19235 msgid "The size in yottabytes (multiplied by 2**80)."
19239 #: ../fish/guestfish.pod:667
19244 #: ../fish/guestfish.pod:669
19245 msgid "The size in SI 10**24 byte units."
19249 #: ../fish/guestfish.pod:675
19252 " truncate-size /file 1G\n"
19257 #: ../fish/guestfish.pod:677
19258 msgid "would truncate the file to 1 gigabyte."
19262 #: ../fish/guestfish.pod:679
19264 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
19265 "the parameter to L</memsize> is specified in megabytes already). Adding a "
19266 "suffix will probably not do what you expect."
19270 #: ../fish/guestfish.pod:683
19271 msgid "OCTAL AND HEXADECIMAL NUMBERS"
19275 #: ../fish/guestfish.pod:685
19277 "For specifying the radix (base) use the C convention: C<0> to prefix an "
19278 "octal number or C<0x> to prefix a hexadecimal number. For example:"
19282 #: ../fish/guestfish.pod:688
19285 " 1234 decimal number 1234\n"
19286 " 02322 octal number, equivalent to decimal 1234\n"
19287 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
19292 #: ../fish/guestfish.pod:692
19294 "When using the C<chmod> command, you almost always want to specify an octal "
19295 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
19296 "L<chmod(1)> program):"
19300 #: ../fish/guestfish.pod:696
19303 " chmod 0777 /public # OK\n"
19304 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
19309 #: ../fish/guestfish.pod:699
19311 "Commands that return numbers usually print them in decimal, but some "
19312 "commands print numbers in other radices (eg. C<umask> prints the mode in "
19313 "octal, preceeded by C<0>)."
19317 #: ../fish/guestfish.pod:703
19318 msgid "WILDCARDS AND GLOBBING"
19322 #: ../fish/guestfish.pod:705
19324 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
19325 "(globbing) by default. So for example the following will not do what you "
19330 #: ../fish/guestfish.pod:709
19338 #: ../fish/guestfish.pod:711
19340 "Assuming you don't have a directory called literally C</home/*> then the "
19341 "above command will return an error."
19345 #: ../fish/guestfish.pod:714
19346 msgid "To perform wildcard expansion, use the C<glob> command."
19350 #: ../fish/guestfish.pod:716
19353 " glob rm-rf /home/*\n"
19358 #: ../fish/guestfish.pod:718
19360 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
19361 "many times), equivalent to:"
19365 #: ../fish/guestfish.pod:721
19368 " rm-rf /home/jim\n"
19369 " rm-rf /home/joe\n"
19370 " rm-rf /home/mary\n"
19375 #: ../fish/guestfish.pod:725
19376 msgid "C<glob> only works on simple guest paths and not on device names."
19380 #: ../fish/guestfish.pod:727
19382 "If you have several parameters, each containing a wildcard, then glob will "
19383 "perform a Cartesian product."
19387 #: ../fish/guestfish.pod:730
19392 #: ../fish/guestfish.pod:732
19394 "Any line which starts with a I<#> character is treated as a comment and "
19395 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
19396 "a command. For example:"
19400 #: ../fish/guestfish.pod:736
19403 " # this is a comment\n"
19404 " # this is a comment\n"
19405 " foo # NOT a comment\n"
19410 #: ../fish/guestfish.pod:740
19411 msgid "Blank lines are also ignored."
19415 #: ../fish/guestfish.pod:742
19416 msgid "RUNNING COMMANDS LOCALLY"
19420 #: ../fish/guestfish.pod:744
19422 "Any line which starts with a I<!> character is treated as a command sent to "
19423 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
19427 #: ../fish/guestfish.pod:748
19431 " tgz-out /remote local/remote-data.tar.gz\n"
19436 #: ../fish/guestfish.pod:751
19438 "will create a directory C<local> on the host, and then export the contents "
19439 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
19440 "(See C<tgz-out>)."
19444 #: ../fish/guestfish.pod:755
19446 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
19447 "effect, due to the way that subprocesses work in Unix."
19451 #: ../fish/guestfish.pod:758
19452 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
19456 #: ../fish/guestfish.pod:760
19458 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
19459 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
19460 "and executed as guestfish commands."
19464 #: ../fish/guestfish.pod:764
19466 "Thus you can use shell script to construct arbitrary guestfish commands "
19467 "which are then parsed by guestfish."
19471 #: ../fish/guestfish.pod:767
19473 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
19474 "through C</foo.100>) using guestfish commands alone. However this is simple "
19475 "if we use a shell script to create the guestfish commands for us:"
19479 #: ../fish/guestfish.pod:772
19482 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
19487 #: ../fish/guestfish.pod:774
19488 msgid "or with names like C</foo.001>:"
19492 #: ../fish/guestfish.pod:776
19495 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
19500 #: ../fish/guestfish.pod:778
19502 "When using guestfish interactively it can be helpful to just run the shell "
19503 "script first (ie. remove the initial C<E<lt>> character so it is just an "
19504 "ordinary I<!> local command), see what guestfish commands it would run, and "
19505 "when you are happy with those prepend the C<E<lt>> character to run the "
19506 "guestfish commands for real."
19510 #: ../fish/guestfish.pod:784
19515 #: ../fish/guestfish.pod:786
19517 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
19518 "command (a guestfish command) to the second command (any host command). For "
19523 #: ../fish/guestfish.pod:790
19526 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19531 #: ../fish/guestfish.pod:792
19533 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19534 "program). The above command would list all accounts in the guest filesystem "
19535 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19539 #: ../fish/guestfish.pod:797
19542 " hexdump /bin/ls | head\n"
19543 " list-devices | tail -1\n"
19544 " tgz-out / - | tar ztf -\n"
19549 #: ../fish/guestfish.pod:801
19551 "The space before the pipe symbol is required, any space after the pipe "
19552 "symbol is optional. Everything after the pipe symbol is just passed "
19553 "straight to the host shell, so it can contain redirections, globs and "
19554 "anything else that makes sense on the host side."
19558 #: ../fish/guestfish.pod:806
19560 "To use a literal argument which begins with a pipe symbol, you have to quote "
19565 #: ../fish/guestfish.pod:809
19573 #: ../fish/guestfish.pod:811
19574 msgid "HOME DIRECTORIES"
19578 #: ../fish/guestfish.pod:813
19580 "If a parameter starts with the character C<~> then the tilde may be expanded "
19581 "as a home directory path (either C<~> for the current user's home directory, "
19582 "or C<~user> for another user)."
19586 #: ../fish/guestfish.pod:817
19588 "Note that home directory expansion happens for users known I<on the host>, "
19589 "not in the guest filesystem."
19593 #: ../fish/guestfish.pod:820
19595 "To use a literal argument which begins with a tilde, you have to quote it, "
19600 #: ../fish/guestfish.pod:823
19608 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
19609 msgid "ENCRYPTED DISKS"
19613 #: ../fish/guestfish.pod:827
19615 "Libguestfs has some support for Linux guests encrypted according to the "
19616 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19617 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
19618 "LUKS is supported."
19622 #: ../fish/guestfish.pod:832
19623 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19627 #: ../fish/guestfish.pod:834
19630 " ><fs> vfs-type /dev/sda2\n"
19636 #: ../fish/guestfish.pod:837
19638 "Then open those devices using L</luks-open>. This creates a device-mapper "
19639 "device called C</dev/mapper/luksdev>."
19643 #: ../fish/guestfish.pod:840
19646 " ><fs> luks-open /dev/sda2 luksdev\n"
19647 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19652 #: ../fish/guestfish.pod:843
19654 "Finally you have to tell LVM to scan for volume groups on the newly created "
19659 #: ../fish/guestfish.pod:846
19663 " vg-activate-all true\n"
19668 #: ../fish/guestfish.pod:849
19669 msgid "The logical volume(s) can now be mounted in the usual way."
19673 #: ../fish/guestfish.pod:851
19675 "Before closing a LUKS device you must unmount any logical volumes on it and "
19676 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19677 "one. Then you can close the mapper device:"
19681 #: ../fish/guestfish.pod:855
19684 " vg-activate false /dev/VG\n"
19685 " luks-close /dev/mapper/luksdev\n"
19690 #: ../fish/guestfish.pod:860
19692 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19693 "letters and paths (with some limitations). The following commands are "
19698 #: ../fish/guestfish.pod:864
19701 " file /WINDOWS/system32/config/system.LOG\n"
19706 #: ../fish/guestfish.pod:866
19709 " file win:\\windows\\system32\\config\\system.log\n"
19714 #: ../fish/guestfish.pod:868
19717 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19722 #: ../fish/guestfish.pod:870
19724 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19725 "where the drive is mounted, prepending that to the path, changing all "
19726 "backslash characters to forward slash, then resolving the result using L</"
19727 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
19728 "the parameter might be rewritten like this:"
19732 #: ../fish/guestfish.pod:876
19735 " win:e:\\foo\\bar => /e/FOO/bar\n"
19740 #: ../fish/guestfish.pod:878
19741 msgid "This only works in argument positions that expect a path."
19745 #: ../fish/guestfish.pod:880
19746 msgid "UPLOADING AND DOWNLOADING FILES"
19750 #: ../fish/guestfish.pod:882
19752 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19753 "others which upload from or download to a local file, you can use the "
19754 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19758 #: ../fish/guestfish.pod:886
19766 #: ../fish/guestfish.pod:888
19768 "reads stdin and creates from that a file C</foo> in the disk image, and:"
19772 #: ../fish/guestfish.pod:891
19775 " tar-out /etc - | tar tf -\n"
19780 #: ../fish/guestfish.pod:893
19782 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19783 "command (see L</PIPES>)."
19787 #: ../fish/guestfish.pod:896
19789 "When using C<-> to read from stdin, the input is read up to the end of "
19790 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19791 "some arbitrary end marker:"
19795 #: ../fish/guestfish.pod:900
19798 " upload -<<END /foo\n"
19807 #: ../fish/guestfish.pod:906
19809 "Any string of characters can be used instead of C<END>. The end marker must "
19810 "appear on a line of its own, without any preceeding or following characters "
19811 "(not even spaces)."
19815 #: ../fish/guestfish.pod:910
19817 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19818 "upload local files (so-called \"FileIn\" parameters in the generator)."
19822 #: ../fish/guestfish.pod:913
19823 msgid "EXIT ON ERROR BEHAVIOUR"
19827 #: ../fish/guestfish.pod:915
19829 "By default, guestfish will ignore any errors when in interactive mode (ie. "
19830 "taking commands from a human over a tty), and will exit on the first error "
19831 "in non-interactive mode (scripts, commands given on the command line)."
19835 #: ../fish/guestfish.pod:920
19837 "If you prefix a command with a I<-> character, then that command will not "
19838 "cause guestfish to exit, even if that (one) command returns an error."
19842 #: ../fish/guestfish.pod:924
19843 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19847 #: ../fish/guestfish.pod:926
19849 "Guestfish can be remote-controlled over a socket. This is useful "
19850 "particularly in shell scripts where you want to make several different "
19851 "changes to a filesystem, but you don't want the overhead of starting up a "
19852 "guestfish process each time."
19856 #: ../fish/guestfish.pod:931
19857 msgid "Start a guestfish server process using:"
19861 #: ../fish/guestfish.pod:933
19864 " eval \"`guestfish --listen`\"\n"
19869 #: ../fish/guestfish.pod:935
19870 msgid "and then send it commands by doing:"
19874 #: ../fish/guestfish.pod:937
19877 " guestfish --remote cmd [...]\n"
19882 #: ../fish/guestfish.pod:939
19883 msgid "To cause the server to exit, send it the exit command:"
19887 #: ../fish/guestfish.pod:943
19889 "Note that the server will normally exit if there is an error in a command. "
19890 "You can change this in the usual way. See section L</EXIT ON ERROR "
19895 #: ../fish/guestfish.pod:947
19896 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19900 #: ../fish/guestfish.pod:949
19902 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19903 "is how the I<--remote> option knows where to send the commands. You can "
19904 "have several guestfish listener processes running using:"
19908 #: ../fish/guestfish.pod:953
19911 " eval \"`guestfish --listen`\"\n"
19912 " pid1=$GUESTFISH_PID\n"
19913 " eval \"`guestfish --listen`\"\n"
19914 " pid2=$GUESTFISH_PID\n"
19916 " guestfish --remote=$pid1 cmd\n"
19917 " guestfish --remote=$pid2 cmd\n"
19922 #: ../fish/guestfish.pod:961
19923 msgid "REMOTE CONTROL AND CSH"
19927 #: ../fish/guestfish.pod:963
19929 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19934 #: ../fish/guestfish.pod:966
19937 " eval \"`guestfish --listen --csh`\"\n"
19942 #: ../fish/guestfish.pod:968
19943 msgid "REMOTE CONTROL DETAILS"
19947 #: ../fish/guestfish.pod:970
19949 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
19950 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
19951 "and C<$PID> is the process ID of the server."
19955 #: ../fish/guestfish.pod:974
19956 msgid "Guestfish client and server versions must match exactly."
19960 #: ../fish/guestfish.pod:976
19961 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19965 #: ../fish/guestfish.pod:978
19967 "From Bash, you can use the following code which creates a guestfish "
19968 "instance, correctly quotes the command line, handles failure to start, and "
19969 "cleans up guestfish when the script exits:"
19973 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:965
19981 #: ../fish/guestfish.pod:986
19984 " guestfish[0]=\"guestfish\"\n"
19985 " guestfish[1]=\"--listen\"\n"
19986 " guestfish[2]=\"--ro\"\n"
19987 " guestfish[3]=\"-a\"\n"
19988 " guestfish[4]=\"disk.img\"\n"
19993 #: ../fish/guestfish.pod:992
19996 " GUESTFISH_PID=\n"
19997 " eval $(\"${guestfish[@]}\")\n"
19998 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19999 " echo \"error: guestfish didn't start up, see error messages above\"\n"
20006 #: ../fish/guestfish.pod:999
20009 " cleanup_guestfish ()\n"
20011 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
20013 " trap cleanup_guestfish EXIT ERR\n"
20018 #: ../fish/guestfish.pod:1005
20021 " guestfish --remote -- run\n"
20026 #: ../fish/guestfish.pod:1007
20034 #: ../fish/guestfish.pod:1009
20035 msgid "REMOTE CONTROL RUN COMMAND HANGING"
20039 #: ../fish/guestfish.pod:1011
20041 "Using the C<run> (or C<launch>) command remotely in a command substitution "
20042 "context hangs, ie. don't do (note the backquotes):"
20046 #: ../fish/guestfish.pod:1014
20049 " a=`guestfish --remote run`\n"
20054 #: ../fish/guestfish.pod:1016
20056 "Since the C<run> command produces no output on stdout, this is not useful "
20057 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
20062 #: ../fish/guestfish.pod:1020
20063 msgid "PREPARED DISK IMAGES"
20067 #: ../fish/guestfish.pod:1022
20069 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
20070 "preformatted disk images that guestfish can make for you to save typing. "
20071 "This is particularly useful for testing purposes. This option is used "
20072 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
20073 "can be mixed with I<-a>)."
20077 #: ../fish/guestfish.pod:1028
20079 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
20080 "the second and so on. Existing files in the current directory are "
20085 #: ../fish/guestfish.pod:1032
20087 "The type briefly describes how the disk should be sized, partitioned, how "
20088 "filesystem(s) should be created, and how content should be added. "
20089 "Optionally the type can be followed by extra parameters, separated by C<:> "
20090 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
20091 "allocated disk, containing a single partition, with the partition formatted "
20092 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
20097 #: ../fish/guestfish.pod:1040
20098 msgid "To list the available types and any extra parameters they take, run:"
20102 #: ../fish/guestfish.pod:1044
20104 "Note that the prepared filesystem is not mounted. You would usually have to "
20105 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
20109 #: ../fish/guestfish.pod:1048
20111 "If any I<-N> or I<--new> options are given, the guest is automatically "
20116 #: ../fish/guestfish.pod:1053
20117 msgid "Create a 100MB disk with an ext4-formatted partition:"
20121 #: ../fish/guestfish.pod:1055
20124 " guestfish -N fs:ext4\n"
20129 #: ../fish/guestfish.pod:1057
20130 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
20134 #: ../fish/guestfish.pod:1059
20137 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
20142 #: ../fish/guestfish.pod:1061
20143 msgid "Create a blank 200MB disk:"
20147 #: ../fish/guestfish.pod:1063
20150 " guestfish -N disk:200M\n"
20155 #: ../fish/guestfish.pod:1065
20156 msgid "PROGRESS BARS"
20160 #: ../fish/guestfish.pod:1067
20162 "Some (not all) long-running commands send progress notification messages as "
20163 "they are running. Guestfish turns these messages into progress bars."
20167 #: ../fish/guestfish.pod:1071
20169 "When a command that supports progress bars takes longer than two seconds to "
20170 "run, and if progress bars are enabled, then you will see one appearing below "
20175 #: ../fish/guestfish.pod:1075
20178 " ><fs> copy-size /large-file /another-file 2048M\n"
20179 " / 10% [#####-----------------------------------------] 00:30\n"
20184 #: ../fish/guestfish.pod:1078
20186 "The spinner on the left hand side moves round once for every progress "
20187 "notification received from the backend. This is a (reasonably) golden "
20188 "assurance that the command is \"doing something\" even if the progress bar "
20189 "is not moving, because the command is able to send the progress "
20190 "notifications. When the bar reaches 100% and the command finishes, the "
20191 "spinner disappears."
20195 #: ../fish/guestfish.pod:1085
20197 "Progress bars are enabled by default when guestfish is used interactively. "
20198 "You can enable them even for non-interactive modes using I<--progress-bars>, "
20199 "and you can disable them completely using I<--no-progress-bars>."
20203 #: ../fish/guestfish.pod:1090
20204 msgid "GUESTFISH COMMANDS"
20208 #: ../fish/guestfish.pod:1092
20210 "The commands in this section are guestfish convenience commands, in other "
20211 "words, they are not part of the L<guestfs(3)> API."
20215 #: ../fish/guestfish.pod:1095
20220 #: ../fish/guestfish.pod:1097
20229 #: ../fish/guestfish.pod:1100
20230 msgid "Without any parameter, this provides general help."
20234 #: ../fish/guestfish.pod:1102
20235 msgid "With a C<cmd> parameter, this displays detailed help for that command."
20239 #: ../fish/guestfish.pod:1104
20240 msgid "quit | exit"
20244 #: ../fish/guestfish.pod:1106
20245 msgid "This exits guestfish. You can also use C<^D> key."
20249 #: ../fish/guestfish.pod:1108
20250 msgid "@FISH_COMMANDS@"
20254 #: ../fish/guestfish.pod:1110
20259 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1505
20264 #: ../fish/guestfish.pod:1116
20266 "guestfish returns 0 if the commands completed without error, or 1 if there "
20271 #: ../fish/guestfish.pod:1123
20276 #: ../fish/guestfish.pod:1125
20278 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
20283 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3198
20284 msgid "FEBOOTSTRAP_KERNEL"
20288 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3200
20289 msgid "FEBOOTSTRAP_MODULES"
20293 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3202
20295 "These two environment variables allow the kernel that libguestfs uses in the "
20296 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
20297 "most recent host kernel is chosen. For more information about kernel "
20298 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
20299 "available in febootstrap E<ge> 3.8."
20303 #: ../fish/guestfish.pod:1138
20304 msgid "GUESTFISH_DISPLAY_IMAGE"
20308 #: ../fish/guestfish.pod:1140
20310 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
20311 "If not set, it uses L<display(1)>."
20315 #: ../fish/guestfish.pod:1143
20316 msgid "GUESTFISH_PID"
20320 #: ../fish/guestfish.pod:1145
20322 "Used with the I<--remote> option to specify the remote guestfish process to "
20323 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
20327 #: ../fish/guestfish.pod:1149
20332 #: ../fish/guestfish.pod:1151
20334 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
20335 "not specified, the external L<hexedit(1)> program is used."
20339 #: ../fish/guestfish.pod:1155
20344 #: ../fish/guestfish.pod:1157
20346 "If compiled with GNU readline support, various files in the home directory "
20347 "can be used. See L</FILES>."
20351 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3208
20352 msgid "LIBGUESTFS_APPEND"
20356 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3210
20357 msgid "Pass additional options to the guest kernel."
20361 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3212
20362 msgid "LIBGUESTFS_DEBUG"
20366 #: ../fish/guestfish.pod:1166
20368 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
20369 "effect as using the B<-v> option."
20373 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3217
20374 msgid "LIBGUESTFS_MEMSIZE"
20378 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3219
20380 "Set the memory allocated to the qemu process, in megabytes. For example:"
20384 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3222
20387 " LIBGUESTFS_MEMSIZE=700\n"
20392 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3224
20393 msgid "LIBGUESTFS_PATH"
20397 #: ../fish/guestfish.pod:1178
20399 "Set the path that guestfish uses to search for kernel and initrd.img. See "
20400 "the discussion of paths in L<guestfs(3)>."
20404 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3229
20405 msgid "LIBGUESTFS_QEMU"
20409 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3231
20411 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
20412 "which was found at compile time by the configure script is used."
20416 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3237
20417 msgid "LIBGUESTFS_TRACE"
20421 #: ../fish/guestfish.pod:1189
20422 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
20426 #: ../fish/guestfish.pod:1191
20431 #: ../fish/guestfish.pod:1193
20433 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
20438 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236
20439 #: ../src/guestfs.pod:3242
20444 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3244
20446 "Location of temporary directory, defaults to C</tmp> except for the cached "
20447 "supermin appliance which defaults to C</var/tmp>."
20451 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3247
20453 "If libguestfs was compiled to use the supermin appliance then the real "
20454 "appliance is cached in this directory, shared between all handles belonging "
20455 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
20456 "use in case C</var/tmp> is not large enough."
20460 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297
20461 #: ../rescue/virt-rescue.pod:273
20466 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301
20467 #: ../rescue/virt-rescue.pod:277
20468 msgid "$HOME/.libguestfs-tools.rc"
20472 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303
20473 #: ../rescue/virt-rescue.pod:279
20474 msgid "/etc/libguestfs-tools.conf"
20478 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305
20479 #: ../rescue/virt-rescue.pod:281
20481 "This configuration file controls the default read-only or read-write mode "
20482 "(I<--ro> or I<--rw>)."
20486 #: ../fish/guestfish.pod:1220
20487 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
20491 #: ../fish/guestfish.pod:1222
20492 msgid "$HOME/.guestfish"
20496 #: ../fish/guestfish.pod:1224
20498 "If compiled with GNU readline support, then the command history is saved in "
20503 #: ../fish/guestfish.pod:1227
20504 msgid "$HOME/.inputrc"
20508 #: ../fish/guestfish.pod:1229
20509 msgid "/etc/inputrc"
20513 #: ../fish/guestfish.pod:1231
20515 "If compiled with GNU readline support, then these files can be used to "
20516 "configure readline. For further information, please see L<readline(3)/"
20517 "INITIALIZATION FILE>."
20521 #: ../fish/guestfish.pod:1235
20522 msgid "To write rules which only apply to guestfish, use:"
20526 #: ../fish/guestfish.pod:1237
20536 #: ../fish/guestfish.pod:1241
20538 "Variables that you can set in inputrc that change the behaviour of guestfish "
20539 "in useful ways include:"
20543 #: ../fish/guestfish.pod:1246
20544 msgid "completion-ignore-case (default: on)"
20548 #: ../fish/guestfish.pod:1248
20550 "By default, guestfish will ignore case when tab-completing paths on the "
20555 #: ../fish/guestfish.pod:1251
20558 " set completion-ignore-case off\n"
20563 #: ../fish/guestfish.pod:1253
20564 msgid "to make guestfish case sensitive."
20568 #: ../fish/guestfish.pod:1257
20573 #: ../fish/guestfish.pod:1259
20574 msgid "test2.img (etc)"
20578 #: ../fish/guestfish.pod:1261
20580 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
20581 "will be created in the file C<test1.img> in the current directory. The "
20582 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
20583 "the same name will be overwritten."
20587 #: ../fish/guestfish.pod:1270
20589 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, L<virt-"
20590 "cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit"
20591 "(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems"
20592 "(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-"
20593 "rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, "
20594 "L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, "
20595 "L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
20599 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3339
20600 #: ../test-tool/libguestfs-test-tool.pod:112
20601 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
20605 #: ../fish/virt-copy-in.pod:5
20607 "virt-copy-in - Copy files and directories into a virtual machine disk image."
20611 #: ../fish/virt-copy-in.pod:9
20614 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
20619 #: ../fish/virt-copy-in.pod:11
20622 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
20627 #: ../fish/virt-copy-in.pod:15
20629 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
20630 "causing disk corruption. The virtual machine must be shut down before you "
20631 "use this command."
20635 #: ../fish/virt-copy-in.pod:21
20637 "C<virt-copy-in> copies files and directories from the local disk into a "
20638 "virtual machine disk image or named libvirt domain."
20642 #: ../fish/virt-copy-in.pod:24
20644 "You can give one of more filenames and directories on the command line. "
20645 "Directories are copied in recursively. The final parameter must be the "
20646 "destination directory in the disk image which must be an absolute path "
20647 "starting with a C</> character."
20651 #: ../fish/virt-copy-in.pod:33
20654 " virt-copy-in -d MyGuest resolv.conf /etc\n"
20659 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
20660 msgid "Upload a home directory to a guest:"
20664 #: ../fish/virt-copy-in.pod:37
20667 " virt-copy-in -d MyGuest skel /home\n"
20672 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
20673 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
20674 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
20678 #: ../fish/virt-copy-in.pod:41
20680 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20681 "> C<copy-in> command. For anything more complex than a trivial copy, you "
20682 "are probably better off using guestfish directly."
20686 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
20687 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
20689 "Since the shell script just passes options straight to guestfish, read "
20690 "L<guestfish(1)> to see the full list of options."
20694 #: ../fish/virt-copy-in.pod:52
20696 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20697 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20701 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
20702 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20703 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20707 #: ../fish/virt-copy-out.pod:5
20709 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20714 #: ../fish/virt-copy-out.pod:9
20717 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20722 #: ../fish/virt-copy-out.pod:11
20725 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20730 #: ../fish/virt-copy-out.pod:15
20732 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20733 "image or named libvirt domain."
20737 #: ../fish/virt-copy-out.pod:18
20739 "You can give one of more filenames and directories on the command line. "
20740 "Directories are copied out recursively."
20744 #: ../fish/virt-copy-out.pod:23
20745 msgid "Download the home directories from a virtual machine:"
20749 #: ../fish/virt-copy-out.pod:25
20753 " virt-copy-out -d MyGuest /home homes\n"
20758 #: ../fish/virt-copy-out.pod:30
20760 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20761 "> C<copy-out> command. For anything more complex than a trivial copy, you "
20762 "are probably better off using guestfish directly."
20766 #: ../fish/virt-copy-out.pod:41
20768 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
20769 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20773 #: ../fish/virt-tar-in.pod:5
20774 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20778 #: ../fish/virt-tar-in.pod:9
20781 " virt-tar-in -a disk.img data.tar /destination\n"
20786 #: ../fish/virt-tar-in.pod:11
20789 " virt-tar-in -d domain data.tar /destination\n"
20794 #: ../fish/virt-tar-in.pod:13
20797 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20802 #: ../fish/virt-tar-in.pod:17
20804 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20805 "causing disk corruption. The virtual machine must be shut down before you "
20806 "use this command."
20810 #: ../fish/virt-tar-in.pod:23
20812 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20813 "image or named libvirt domain."
20817 #: ../fish/virt-tar-in.pod:26
20819 "The first parameter is the tar file. Use C<-> to read the tar file from "
20820 "standard input. The second parameter is the absolute target directory to "
20825 #: ../fish/virt-tar-in.pod:34
20828 " virt-tar-in -d MyGuest homes.tar /home\n"
20833 #: ../fish/virt-tar-in.pod:38
20835 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20836 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
20837 "probably better off using guestfish directly."
20841 #: ../fish/virt-tar-in.pod:49
20843 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20844 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
20849 #: ../fish/virt-tar-out.pod:5
20851 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20855 #: ../fish/virt-tar-out.pod:9
20858 " virt-tar-out -a disk.img /dir files.tar\n"
20863 #: ../fish/virt-tar-out.pod:11
20866 " virt-tar-out -d domain /dir files.tar\n"
20871 #: ../fish/virt-tar-out.pod:13
20874 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20879 #: ../fish/virt-tar-out.pod:17
20881 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20885 #: ../fish/virt-tar-out.pod:20
20887 "The first parameter is the absolute path of the virtual machine directory. "
20888 "The second parameter is the tar file to write. Use C<-> to write to "
20893 #: ../fish/virt-tar-out.pod:26
20894 msgid "Download the home directories from a guest:"
20898 #: ../fish/virt-tar-out.pod:28
20901 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20906 #: ../fish/virt-tar-out.pod:32
20908 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20909 "> C<tar-out> command. For anything more complex than a trivial copy, you "
20910 "are probably better off using guestfish directly."
20914 #: ../fish/virt-tar-out.pod:43
20916 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20917 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20921 #: ../fuse/guestmount.pod:5
20923 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20927 #: ../fuse/guestmount.pod:9
20930 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20935 #: ../fuse/guestmount.pod:11
20938 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20943 #: ../fuse/guestmount.pod:13
20946 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20951 #: ../fuse/guestmount.pod:17
20953 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20954 "machines. If you do this, you risk disk corruption in the VM."
20958 #: ../fuse/guestmount.pod:22
20960 "The guestmount program can be used to mount virtual machine filesystems and "
20961 "other disk images on the host. It uses libguestfs for access to the guest "
20962 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20963 "a mountable device."
20967 #: ../fuse/guestmount.pod:27
20969 "Along with other options, you have to give at least one device (I<-a> "
20970 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20971 "option) or use the I<-i> inspection option. How this works is better "
20972 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
20977 #: ../fuse/guestmount.pod:33
20979 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20980 "by you, and the filesystem will not be visible to any other users unless you "
20981 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20982 "the filesystem, use the C<fusermount -u> command."
20986 #: ../fuse/guestmount.pod:41
20988 "For a typical Windows guest which has its main filesystem on the first "
20993 #: ../fuse/guestmount.pod:44
20996 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
21001 #: ../fuse/guestmount.pod:46
21003 "For a typical Linux guest which has a /boot filesystem on the first "
21004 "partition, and the root filesystem on a logical volume:"
21008 #: ../fuse/guestmount.pod:49
21011 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
21016 #: ../fuse/guestmount.pod:51
21017 msgid "To get libguestfs to detect guest mountpoints for you:"
21021 #: ../fuse/guestmount.pod:53
21024 " guestmount -a guest.img -i --ro /mnt\n"
21029 #: ../fuse/guestmount.pod:55
21030 msgid "For a libvirt guest called \"Guest\" you could do:"
21034 #: ../fuse/guestmount.pod:57
21037 " guestmount -d Guest -i --ro /mnt\n"
21042 #: ../fuse/guestmount.pod:59
21044 "If you don't know what filesystems are contained in a guest or disk image, "
21045 "use L<virt-filesystems(1)> first:"
21049 #: ../fuse/guestmount.pod:62
21052 " virt-filesystems MyGuest\n"
21057 #: ../fuse/guestmount.pod:64
21059 "If you want to trace the libguestfs calls but without excessive debugging "
21060 "information, we recommend:"
21064 #: ../fuse/guestmount.pod:67
21067 " guestmount [...] --trace /mnt\n"
21072 #: ../fuse/guestmount.pod:69
21073 msgid "If you want to debug the program, we recommend:"
21077 #: ../fuse/guestmount.pod:71
21080 " guestmount [...] --trace --verbose /mnt\n"
21085 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
21086 #: ../resize/virt-resize.pod:544
21091 #: ../fuse/guestmount.pod:75
21092 msgid "Other users cannot see the filesystem by default"
21096 #: ../fuse/guestmount.pod:77
21098 "If you mount a filesystem as one user (eg. root), then other users will not "
21099 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
21100 "option when mounting:"
21104 #: ../fuse/guestmount.pod:81
21107 " sudo guestmount [...] -o allow_other /mnt\n"
21112 #: ../fuse/guestmount.pod:83
21113 msgid "Enabling FUSE"
21117 #: ../fuse/guestmount.pod:85
21119 "On some distros, you may need to add yourself to a special group (eg. "
21120 "C<fuse>) before you can use any FUSE filesystem. This is necessary on "
21121 "Debian and derivatives."
21125 #: ../fuse/guestmount.pod:89
21127 "On other distros, no special group is required. It is not necessary on "
21128 "Fedora or Red Hat Enterprise Linux."
21132 #: ../fuse/guestmount.pod:100
21133 msgid "Add a block device or virtual machine image."
21137 #: ../fuse/guestmount.pod:123
21138 msgid "B<--dir-cache-timeout N>"
21142 #: ../fuse/guestmount.pod:125
21144 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
21145 "seconds. The readdir cache [actually, there are several semi-independent "
21146 "caches] is populated after a readdir(2) call with the stat and extended "
21147 "attributes of the files in the directory, in anticipation that they will be "
21148 "requested soon after."
21152 #: ../fuse/guestmount.pod:131
21154 "There is also a different attribute cache implemented by FUSE (see the FUSE "
21155 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
21156 "requests, only cache existing ones."
21160 #: ../fuse/guestmount.pod:151
21162 "If you have untrusted raw-format guest disk images, you should use this "
21163 "option to specify the disk format. This avoids a possible security problem "
21164 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
21165 "guestfs_add_drive_opts>."
21169 #: ../fuse/guestmount.pod:156
21170 msgid "B<--fuse-help>"
21174 #: ../fuse/guestmount.pod:158
21175 msgid "Display help on special FUSE options (see I<-o> below)."
21179 #: ../fuse/guestmount.pod:162
21180 msgid "Display brief help and exit."
21184 #: ../fuse/guestmount.pod:186
21186 "Mount the named partition or logical volume on the given mountpoint B<in the "
21187 "guest> (this has nothing to do with mountpoints in the host)."
21191 #: ../fuse/guestmount.pod:189
21193 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
21194 "something on C</>."
21198 #: ../fuse/guestmount.pod:206
21200 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
21201 "unmounted. If you specify this option, then we don't attempt to sync the "
21202 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
21206 #: ../fuse/guestmount.pod:211
21207 msgid "B<-o option>"
21211 #: ../fuse/guestmount.pod:213
21212 msgid "B<--option option>"
21216 #: ../fuse/guestmount.pod:215
21217 msgid "Pass extra options to FUSE."
21221 #: ../fuse/guestmount.pod:217
21223 "To get a list of all the extra options supported by FUSE, use the command "
21224 "below. Note that only the FUSE I<-o> options can be passed, and only some "
21225 "of them are a good idea."
21229 #: ../fuse/guestmount.pod:221
21232 " guestmount --fuse-help\n"
21237 #: ../fuse/guestmount.pod:223
21238 msgid "Some potentially useful FUSE options:"
21242 #: ../fuse/guestmount.pod:227
21243 msgid "B<-o allow_other>"
21247 #: ../fuse/guestmount.pod:229
21248 msgid "Allow other users to see the filesystem."
21252 #: ../fuse/guestmount.pod:231
21253 msgid "B<-o attr_timeout=N>"
21257 #: ../fuse/guestmount.pod:233
21258 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
21262 #: ../fuse/guestmount.pod:235
21263 msgid "B<-o kernel_cache>"
21267 #: ../fuse/guestmount.pod:237
21269 "Allow the kernel to cache files (reduces the number of reads that have to go "
21270 "through the L<guestfs(3)> API). This is generally a good idea if you can "
21271 "afford the extra memory usage."
21275 #: ../fuse/guestmount.pod:241
21276 msgid "B<-o uid=N> B<-o gid=N>"
21280 #: ../fuse/guestmount.pod:243
21282 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
21283 "the chosen values."
21287 #: ../fuse/guestmount.pod:252
21289 "Add devices and mount everything read-only. Also disallow writes and make "
21290 "the disk appear read-only to FUSE."
21294 #: ../fuse/guestmount.pod:255
21296 "This is highly recommended if you are not going to edit the guest disk. If "
21297 "the guest is running and this option is I<not> supplied, then there is a "
21298 "strong risk of disk corruption in the guest. We try to prevent this from "
21299 "happening, but it is not always possible."
21303 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
21304 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
21308 #: ../fuse/guestmount.pod:264
21309 msgid "Enable SELinux support for the guest."
21313 #: ../fuse/guestmount.pod:270
21314 msgid "Enable verbose messages from underlying libguestfs."
21318 #: ../fuse/guestmount.pod:276
21319 msgid "Display the program version and exit."
21323 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308
21324 #: ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
21325 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
21329 #: ../fuse/guestmount.pod:289
21334 #: ../fuse/guestmount.pod:291
21335 msgid "Trace libguestfs calls and entry into each FUSE function."
21339 #: ../fuse/guestmount.pod:293
21340 msgid "This also stops the daemon from forking into the background."
21344 #: ../fuse/guestmount.pod:319
21346 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21347 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
21352 #: ../fuse/guestmount.pod:334
21353 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
21357 #: ../inspector/virt-inspector.pod:5
21359 "virt-inspector - Display operating system version and other information "
21360 "about a virtual machine"
21364 #: ../inspector/virt-inspector.pod:9
21367 " virt-inspector [--options] -d domname\n"
21372 #: ../inspector/virt-inspector.pod:11
21375 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
21380 #: ../inspector/virt-inspector.pod:15
21383 " virt-inspector domname\n"
21388 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
21391 " virt-inspector disk.img [disk.img ...]\n"
21396 #: ../inspector/virt-inspector.pod:21
21398 "B<virt-inspector> examines a virtual machine or disk image and tries to "
21399 "determine the version of the operating system and other information about "
21400 "the virtual machine."
21404 #: ../inspector/virt-inspector.pod:25
21405 msgid "Virt-inspector produces XML output for feeding into other programs."
21409 #: ../inspector/virt-inspector.pod:27
21411 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
21412 "the libvirt domain (see: C<virsh list --all>)."
21416 #: ../inspector/virt-inspector.pod:30
21418 "You can also run virt-inspector directly on disk images from a single "
21419 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
21420 "has several block devices, in which case you should list several I<-a> "
21421 "options one after another, with the first corresponding to the guest's C</"
21422 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
21426 #: ../inspector/virt-inspector.pod:37
21428 "You can also run virt-inspector on install disks, live CDs, bootable USB "
21429 "keys and similar."
21433 #: ../inspector/virt-inspector.pod:40
21435 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
21436 "inspect several virtual machines, you have to run virt-inspector several "
21437 "times (for example, from a shell script for-loop)."
21441 #: ../inspector/virt-inspector.pod:45
21443 "Because virt-inspector needs direct access to guest images, it won't "
21444 "normally work over remote libvirt connections."
21448 #: ../inspector/virt-inspector.pod:48
21450 "All of the information available from virt-inspector is also available "
21451 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
21452 "The same information can also be fetched using guestfish or via libguestfs "
21453 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
21454 "WITH OTHER PROGRAMMING LANGUAGES>)."
21458 #: ../inspector/virt-inspector.pod:81
21460 "Libvirt is only used if you specify a C<domname> on the command line. If "
21461 "you specify guest block devices directly (I<-a>), then libvirt is not used "
21466 #: ../inspector/virt-inspector.pod:94
21468 "When prompting for keys and passphrases, virt-inspector normally turns "
21469 "echoing off so you cannot see what you are typing. If you are not worried "
21470 "about Tempest attacks and there is no one else in the room you can specify "
21471 "this flag to see what you are typing."
21475 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
21476 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
21477 #: ../tools/virt-win-reg.pl:144
21479 "Specify the format of disk images given on the command line. If this is "
21480 "omitted then the format is autodetected from the content of the disk image."
21484 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
21485 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
21486 #: ../tools/virt-win-reg.pl:148
21488 "If disk images are requested from libvirt, then this program asks libvirt "
21489 "for this information. In this case, the value of the format parameter is "
21494 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
21495 #: ../resize/virt-resize.pod:406 ../sparsify/virt-sparsify.pod:132
21496 #: ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102
21497 #: ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
21499 "If working with untrusted raw-format guest disk images, you should ensure "
21500 "the format is always specified."
21504 #: ../inspector/virt-inspector.pod:139
21505 msgid "Previous versions of virt-inspector allowed you to write either:"
21509 #: ../inspector/virt-inspector.pod:145
21512 " virt-inspector guestname\n"
21517 #: ../inspector/virt-inspector.pod:153
21522 #: ../inspector/virt-inspector.pod:155
21524 "The virt-inspector XML is described precisely in a RELAX NG schema file "
21525 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
21526 "just an overview."
21530 #: ../inspector/virt-inspector.pod:159
21532 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
21533 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
21534 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
21535 "which is vanishingly rare in real world VMs."
21539 #: ../inspector/virt-inspector.pod:164
21540 msgid "E<lt>operatingsystemE<gt>"
21544 #: ../inspector/virt-inspector.pod:166
21546 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
21547 "describe the operating system, its architecture, the descriptive \"product "
21548 "name\" string, the type of OS and so on, as in this example:"
21552 #: ../inspector/virt-inspector.pod:170
21555 " <operatingsystems>\n"
21556 " <operatingsystem>\n"
21557 " <root>/dev/sda2</root>\n"
21558 " <name>windows</name>\n"
21559 " <arch>i386</arch>\n"
21560 " <distro>windows</distro>\n"
21561 " <product_name>Windows 7 Enterprise</product_name>\n"
21562 " <product_variant>Client</product_variant>\n"
21563 " <major_version>6</major_version>\n"
21564 " <minor_version>1</minor_version>\n"
21565 " <windows_systemroot>/Windows</windows_systemroot>\n"
21566 " <format>installed</format>\n"
21571 #: ../inspector/virt-inspector.pod:183
21573 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
21574 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
21575 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
21576 "architecture. The other fields are fairly self-explanatory, but because "
21577 "these fields are taken directly from the libguestfs inspection API you can "
21578 "find precise information from L<guestfs(3)/INSPECTION>."
21582 #: ../inspector/virt-inspector.pod:191
21584 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
21585 "of view of libguestfs (block devices may have completely different names "
21586 "inside the VM itself)."
21590 #: ../inspector/virt-inspector.pod:195
21591 msgid "E<lt>mountpointsE<gt>"
21595 #: ../inspector/virt-inspector.pod:197
21597 "Un*x-like guests typically have multiple filesystems which are mounted at "
21598 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
21599 "element which looks like this:"
21603 #: ../inspector/virt-inspector.pod:201
21606 " <operatingsystems>\n"
21607 " <operatingsystem>\n"
21610 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
21611 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
21612 " </mountpoints>\n"
21617 #: ../inspector/virt-inspector.pod:209
21619 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
21620 "and may have completely different names inside the guest. Only mountable "
21621 "filesystems appear in this list, not things like swap devices."
21625 #: ../inspector/virt-inspector.pod:214
21626 msgid "E<lt>filesystemsE<gt>"
21630 #: ../inspector/virt-inspector.pod:216
21632 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
21633 "filesystems belonging to the guest, including swap and empty partitions. "
21634 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
21635 "this OS or shared with this OS and other OSes)."
21639 #: ../inspector/virt-inspector.pod:222
21640 msgid "You might see something like this:"
21644 #: ../inspector/virt-inspector.pod:224
21647 " <operatingsystems>\n"
21648 " <operatingsystem>\n"
21651 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21652 " <type>ext4</type>\n"
21653 " <label>Fedora-13-x86_64</label>\n"
21654 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
21660 #: ../inspector/virt-inspector.pod:234
21662 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
21663 "the label, and the UUID."
21667 #: ../inspector/virt-inspector.pod:237
21668 msgid "E<lt>applicationsE<gt>"
21672 #: ../inspector/virt-inspector.pod:239
21674 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
21675 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
21680 #: ../inspector/virt-inspector.pod:243
21682 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
21683 "Typical values would be C<rpm> and C<deb>."
21687 #: ../inspector/virt-inspector.pod:246
21689 "E<lt>package_managementE<gt>, if present, describes the package manager. "
21690 "Typical values include C<yum>, C<up2date> and C<apt>"
21694 #: ../inspector/virt-inspector.pod:249
21695 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
21699 #: ../inspector/virt-inspector.pod:252
21702 " <operatingsystems>\n"
21703 " <operatingsystem>\n"
21705 " <applications>\n"
21707 " <name>coreutils</name>\n"
21708 " <version>8.5</version>\n"
21709 " <release>1</release>\n"
21710 " </application>\n"
21715 #: ../inspector/virt-inspector.pod:262
21717 "The version and release fields may not be available for some types guests. "
21718 "Other fields are possible, see L<guestfs(3)/"
21719 "guestfs_inspect_list_applications>."
21723 #: ../inspector/virt-inspector.pod:266
21724 msgid "E<lt>drive_mappingsE<gt>"
21728 #: ../inspector/virt-inspector.pod:268
21730 "For operating systems like Windows which use drive letters, virt-inspector "
21731 "is able to find out how drive letters map to filesystems."
21735 #: ../inspector/virt-inspector.pod:272
21738 " <operatingsystems>\n"
21739 " <operatingsystem>\n"
21741 " <drive_mappings>\n"
21742 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21743 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21744 " </drive_mappings>\n"
21749 #: ../inspector/virt-inspector.pod:280
21751 "In the example above, drive C maps to the filesystem on the second partition "
21752 "on the first disk, and drive E maps to the filesystem on the first partition "
21753 "on the second disk."
21757 #: ../inspector/virt-inspector.pod:284
21759 "Note that this only covers permanent local filesystem mappings, not things "
21760 "like network shares. Furthermore NTFS volume mount points may not be listed "
21765 #: ../inspector/virt-inspector.pod:288
21766 msgid "E<lt>iconE<gt>"
21770 #: ../inspector/virt-inspector.pod:290
21772 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21773 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21774 "very large and high quality."
21778 #: ../inspector/virt-inspector.pod:294
21781 " <operatingsystems>\n"
21782 " <operatingsystem>\n"
21785 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21786 " [... many lines of base64 data ...]\n"
21792 #: ../inspector/virt-inspector.pod:302
21794 "To display the icon, you have to extract it and convert the base64 data back "
21795 "to a binary file. Use an XPath query or simply an editor to extract the "
21796 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21801 #: ../inspector/virt-inspector.pod:307
21804 " base64 -i -d < icon.data > icon.png\n"
21809 #: ../inspector/virt-inspector.pod:309
21810 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21814 #: ../inspector/virt-inspector.pod:311
21816 "Virt-inspector can detect some operating system installers on install disks, "
21817 "live CDs, bootable USB keys and more."
21821 #: ../inspector/virt-inspector.pod:314
21823 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21824 "fields may be present to indicate a live CD, network installer, or one part "
21825 "of a multipart CD. For example:"
21829 #: ../inspector/virt-inspector.pod:318
21832 " <operatingsystems>\n"
21833 " <operatingsystem>\n"
21834 " <root>/dev/sda</root>\n"
21835 " <name>linux</name>\n"
21836 " <arch>i386</arch>\n"
21837 " <distro>ubuntu</distro>\n"
21838 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
21839 " <major_version>10</major_version>\n"
21840 " <minor_version>10</minor_version>\n"
21841 " <format>installer</format>\n"
21847 #: ../inspector/virt-inspector.pod:330
21848 msgid "USING XPATH"
21852 #: ../inspector/virt-inspector.pod:332
21854 "You can use the XPath query language to select parts of the XML. We "
21855 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
21859 #: ../inspector/virt-inspector.pod:338
21862 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21864 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21865 " <type>ext4</type>\n"
21871 #: ../inspector/virt-inspector.pod:344
21874 " $ virt-inspector -d Guest | \\\n"
21875 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21881 #: ../inspector/virt-inspector.pod:348
21884 " $ virt-inspector -d Guest | \\\n"
21885 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21886 " [displays the guest icon, if there is one]\n"
21891 #: ../inspector/virt-inspector.pod:359
21892 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21896 #: ../inspector/virt-inspector.pod:361
21898 "Early versions of libguestfs shipped with a different virt-inspector program "
21899 "written in Perl (the current version is written in C). The XML output of "
21900 "the Perl virt-inspector was different and it could also output in other "
21901 "formats like text."
21905 #: ../inspector/virt-inspector.pod:366
21907 "The old virt-inspector is no longer supported or shipped with libguestfs."
21911 #: ../inspector/virt-inspector.pod:369
21913 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21914 "versions of virt-inspector with different names:"
21918 #: ../inspector/virt-inspector.pod:372
21921 " virt-inspector Old Perl version.\n"
21922 " virt-inspector2 New C version.\n"
21927 #: ../inspector/virt-inspector.pod:382
21929 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
21930 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21934 #: ../inspector/virt-inspector.pod:399
21935 msgid "Matthew Booth L<mbooth@redhat.com>"
21939 #: ../java/examples/guestfs-java.pod:5
21940 msgid "guestfs-java - How to use libguestfs from Java"
21944 #: ../java/examples/guestfs-java.pod:9
21947 " import com.redhat.et.libguestfs.*;\n"
21952 #: ../java/examples/guestfs-java.pod:11
21955 " GuestFS g = new GuestFS ();\n"
21956 " g.add_drive_opts (\"disk.img\", null);\n"
21962 #: ../java/examples/guestfs-java.pod:17
21964 "This manual page documents how to call libguestfs from the Java programming "
21965 "language. This page just documents the differences from the C API and gives "
21966 "some examples. If you are not familiar with using libguestfs, you also need "
21967 "to read L<guestfs(3)>."
21971 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21972 msgid "CLOSING THE HANDLE"
21976 #: ../java/examples/guestfs-java.pod:24
21978 "The handle is closed when it is reaped by the garbage collector. Because "
21979 "libguestfs handles include a lot of state, it is also possible to close (and "
21980 "hence free) them explicitly by calling the C<close> method."
21984 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
21985 #: ../python/examples/guestfs-python.pod:21
21986 #: ../ruby/examples/guestfs-ruby.pod:22
21991 #: ../java/examples/guestfs-java.pod:31
21993 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21994 "exception. This has a single parameter which is the error message (a "
21999 #: ../java/examples/guestfs-java.pod:35
22000 msgid "Calling any method on a closed handle raises the same exception."
22004 #: ../java/examples/guestfs-java.pod:47
22006 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-ocaml"
22007 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
22008 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
22012 #: ../ocaml/examples/guestfs-ocaml.pod:5
22013 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
22017 #: ../ocaml/examples/guestfs-ocaml.pod:9
22018 msgid "Module style:"
22022 #: ../ocaml/examples/guestfs-ocaml.pod:11
22025 " let g = Guestfs.create () in\n"
22026 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22027 " Guestfs.launch g;\n"
22032 #: ../ocaml/examples/guestfs-ocaml.pod:15
22033 msgid "Object-oriented style:"
22037 #: ../ocaml/examples/guestfs-ocaml.pod:17
22040 " let g = new Guestfs.guestfs () in\n"
22041 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22047 #: ../ocaml/examples/guestfs-ocaml.pod:21
22050 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
22052 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
22057 #: ../ocaml/examples/guestfs-ocaml.pod:27
22059 "This manual page documents how to call libguestfs from the OCaml programming "
22060 "language. This page just documents the differences from the C API and gives "
22061 "some examples. If you are not familiar with using libguestfs, you also need "
22062 "to read L<guestfs(3)>."
22066 #: ../ocaml/examples/guestfs-ocaml.pod:32
22067 msgid "PROGRAMMING STYLES"
22071 #: ../ocaml/examples/guestfs-ocaml.pod:34
22073 "There are two different programming styles supported by the OCaml bindings. "
22074 "You can use a module style, with each C function mapped to an OCaml function:"
22078 #: ../ocaml/examples/guestfs-ocaml.pod:38
22081 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
22086 #: ../ocaml/examples/guestfs-ocaml.pod:40
22091 #: ../ocaml/examples/guestfs-ocaml.pod:42
22094 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
22099 #: ../ocaml/examples/guestfs-ocaml.pod:44
22101 "Alternately you can use an object-oriented style, calling methods on the "
22102 "class C<Guestfs.guestfs>:"
22106 #: ../ocaml/examples/guestfs-ocaml.pod:47
22109 " method set_verbose : bool -> unit\n"
22114 #: ../ocaml/examples/guestfs-ocaml.pod:49
22116 "The object-oriented style is usually briefer, and the minor performance "
22117 "penalty isn't noticable in the general overhead of performing libguestfs "
22122 #: ../ocaml/examples/guestfs-ocaml.pod:55
22124 "The handle is closed when it is reaped by the garbage collector. Because "
22125 "libguestfs handles include a lot of state, it is also possible to close (and "
22126 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
22131 #: ../ocaml/examples/guestfs-ocaml.pod:62
22133 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
22134 "exception. This has a single parameter which is the error message (a "
22139 #: ../ocaml/examples/guestfs-ocaml.pod:66
22141 "Calling any function/method on a closed handle raises C<Guestfs."
22142 "Handle_closed>. The single parameter is the name of the function that you "
22147 #: ../ocaml/examples/guestfs-ocaml.pod:80
22149 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22150 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
22151 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
22155 #: ../perl/examples/guestfs-perl.pod:5
22156 msgid "guestfs-perl - How to use libguestfs from Perl"
22160 #: ../perl/examples/guestfs-perl.pod:9
22163 " use Sys::Guestfs;\n"
22168 #: ../perl/examples/guestfs-perl.pod:11
22171 " my $h = Sys::Guestfs->new ();\n"
22172 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
22173 " $h->launch ();\n"
22174 " $h->mount_options ('', '/dev/sda1', '/');\n"
22175 " $h->touch ('/hello');\n"
22181 #: ../perl/examples/guestfs-perl.pod:20
22183 "This manual page documents how to call libguestfs from the Perl programming "
22184 "language. This page just documents the differences from the C API and gives "
22185 "some examples. If you are not familiar with using libguestfs, you also need "
22186 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
22190 #: ../perl/examples/guestfs-perl.pod:26
22195 #: ../perl/examples/guestfs-perl.pod:28
22197 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
22202 #: ../perl/examples/guestfs-perl.pod:41
22204 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang"
22205 "(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
22206 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
22210 #: ../python/examples/guestfs-python.pod:5
22211 msgid "guestfs-python - How to use libguestfs from Python"
22215 #: ../python/examples/guestfs-python.pod:9
22218 " import guestfs\n"
22219 " g = guestfs.GuestFS ()\n"
22220 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
22226 #: ../python/examples/guestfs-python.pod:16
22228 "This manual page documents how to call libguestfs from the Python "
22229 "programming language. This page just documents the differences from the C "
22230 "API and gives some examples. If you are not familiar with using libguestfs, "
22231 "you also need to read L<guestfs(3)>."
22235 #: ../python/examples/guestfs-python.pod:23
22237 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
22238 "single string argument which is the error message."
22242 #: ../python/examples/guestfs-python.pod:26
22243 msgid "MORE DOCUMENTATION"
22247 #: ../python/examples/guestfs-python.pod:28
22252 #: ../python/examples/guestfs-python.pod:30
22256 " >>> import guestfs\n"
22257 " >>> help (guestfs)\n"
22262 #: ../python/examples/guestfs-python.pod:44
22264 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22265 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
22266 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
22270 #: ../rescue/virt-rescue.pod:5
22271 msgid "virt-rescue - Run a rescue shell on a virtual machine"
22275 #: ../rescue/virt-rescue.pod:9
22278 " virt-rescue [--options] -d domname\n"
22283 #: ../rescue/virt-rescue.pod:11
22286 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
22291 #: ../rescue/virt-rescue.pod:15
22294 " virt-rescue [--options] domname\n"
22299 #: ../rescue/virt-rescue.pod:17
22302 " virt-rescue [--options] disk.img [disk.img ...]\n"
22307 #: ../rescue/virt-rescue.pod:21
22309 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
22310 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
22311 "you from doing this, but doesn't catch all cases."
22315 #: ../rescue/virt-rescue.pod:25
22317 "However if you use the I<--ro> (read only) option, then you can attach a "
22318 "shell to a live virtual machine. The results might be strange or "
22319 "inconsistent at times but you won't get disk corruption."
22323 #: ../rescue/virt-rescue.pod:31
22325 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
22326 "need for a CD. virt-rescue gives you a rescue shell and some simple "
22327 "recovery tools which you can use to examine or rescue a virtual machine or "
22332 #: ../rescue/virt-rescue.pod:36
22334 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
22335 "on disk image(s):"
22339 #: ../rescue/virt-rescue.pod:39
22342 " virt-rescue -d GuestName\n"
22347 #: ../rescue/virt-rescue.pod:41
22350 " virt-rescue --ro -a /path/to/disk.img\n"
22355 #: ../rescue/virt-rescue.pod:43
22358 " virt-rescue -a /dev/sdc\n"
22363 #: ../rescue/virt-rescue.pod:45
22364 msgid "For live VMs you I<must> use the --ro option."
22368 #: ../rescue/virt-rescue.pod:47
22370 "When you run virt-rescue on a virtual machine or disk image, you are placed "
22371 "in an interactive bash shell where you can use many ordinary Linux "
22372 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
22373 "appliance. You must mount the virtual machine's filesystems by hand. There "
22374 "is an empty directory called C</sysroot> where you can mount filesystems."
22378 #: ../rescue/virt-rescue.pod:54
22380 "In the example below, we list logical volumes, then choose one to mount "
22381 "under C</sysroot>:"
22385 #: ../rescue/virt-rescue.pod:57
22389 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
22390 " lv_root vg_f11x64 -wi-a- 8.83G\n"
22391 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
22392 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
22393 " ><rescue> ls /sysroot\n"
22398 #: ../rescue/virt-rescue.pod:64
22400 "If you don't know what filesystems are available on the virtual machine then "
22401 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
22405 #: ../rescue/virt-rescue.pod:70
22407 "Virt-rescue can be used on I<any> disk image file or device, not just a "
22408 "virtual machine. For example you can use it on a blank file if you want to "
22409 "partition that file (although we would recommend using L<guestfish(1)> "
22410 "instead as it is more suitable for this purpose). You can even use virt-"
22411 "rescue on things like SD cards."
22415 #: ../rescue/virt-rescue.pod:76
22417 "Virt-rescue does not require root. You only need to run it as root if you "
22418 "need root to open the disk image."
22422 #: ../rescue/virt-rescue.pod:79
22424 "This tool is just designed for quick interactive hacking on a virtual "
22425 "machine. For more structured access to a virtual machine disk image, you "
22426 "should use L<guestfs(3)>. To get a structured shell that you can use to "
22427 "make scripted changes to guests, use L<guestfish(1)>."
22431 #: ../rescue/virt-rescue.pod:103
22432 msgid "B<--append kernelopts>"
22436 #: ../rescue/virt-rescue.pod:105
22437 msgid "Pass additional options to the rescue kernel."
22441 #: ../rescue/virt-rescue.pod:135
22444 " virt-rescue --format=raw -a disk.img\n"
22449 #: ../rescue/virt-rescue.pod:139
22452 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
22457 #: ../rescue/virt-rescue.pod:148
22462 #: ../rescue/virt-rescue.pod:150
22463 msgid "B<--memsize MB>"
22467 #: ../rescue/virt-rescue.pod:152
22469 "Change the amount of memory allocated to the rescue system. The default is "
22470 "set by libguestfs and is small but adequate for running system tools. The "
22471 "occasional program might need more memory. The parameter is specified in "
22476 #: ../rescue/virt-rescue.pod:157
22477 msgid "B<--network>"
22481 #: ../rescue/virt-rescue.pod:159
22482 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
22486 #: ../rescue/virt-rescue.pod:165
22487 msgid "Open the image read-only."
22491 #: ../rescue/virt-rescue.pod:175
22493 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
22494 "SELINUX> before using this option."
22498 #: ../rescue/virt-rescue.pod:178
22503 #: ../rescue/virt-rescue.pod:180
22504 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
22508 #: ../rescue/virt-rescue.pod:198
22510 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
22511 "are done read-write."
22515 #: ../rescue/virt-rescue.pod:211
22516 msgid "Previous versions of virt-rescue allowed you to write either:"
22520 #: ../rescue/virt-rescue.pod:213
22523 " virt-rescue disk.img [disk.img ...]\n"
22528 #: ../rescue/virt-rescue.pod:217
22531 " virt-rescue guestname\n"
22536 #: ../rescue/virt-rescue.pod:225
22541 #: ../rescue/virt-rescue.pod:227
22543 "Adding the I<--network> option enables QEMU user networking in the rescue "
22544 "appliance. There are some differences between user networking and ordinary "
22549 #: ../rescue/virt-rescue.pod:233
22550 msgid "ping does not work"
22554 #: ../rescue/virt-rescue.pod:235
22556 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
22557 "send the ping packets, and because virt-rescue must be able to run as non-"
22558 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
22559 "The ping command will appear to resolve addresses but will not be able to "
22560 "send or receive any packets. This does not mean that the network is not "
22565 #: ../rescue/virt-rescue.pod:242
22566 msgid "cannot receive connections"
22570 #: ../rescue/virt-rescue.pod:244
22571 msgid "QEMU user networking cannot receive incoming connections."
22575 #: ../rescue/virt-rescue.pod:246
22576 msgid "making TCP connections"
22580 #: ../rescue/virt-rescue.pod:248
22582 "The virt-rescue appliance needs to be small and so does not include many "
22583 "network tools. In particular there is no L<telnet(1)> command. You can "
22584 "make TCP connections from the shell using the magical C</dev/tcp/"
22585 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
22589 #: ../rescue/virt-rescue.pod:253
22592 " exec 3<>/dev/tcp/redhat.com/80\n"
22593 " echo \"GET /\" >&3\n"
22599 #: ../rescue/virt-rescue.pod:257
22600 msgid "See L<bash(1)> for more details."
22604 #: ../rescue/virt-rescue.pod:263
22606 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
22607 "ENVIRONMENT VARIABLES> for the complete list."
22611 #: ../rescue/virt-rescue.pod:290
22613 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
22614 "libguestfs.org/>."
22618 #: ../resize/virt-resize.pod:5
22619 msgid "virt-resize - Resize a virtual machine disk"
22623 #: ../resize/virt-resize.pod:9
22626 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
22627 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
22628 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
22633 #: ../resize/virt-resize.pod:15
22635 "Virt-resize is a tool which can resize a virtual machine disk, making it "
22636 "larger or smaller overall, and resizing or deleting any partitions contained "
22641 #: ../resize/virt-resize.pod:19
22643 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
22644 "not> be used on live virtual machines - for consistent results, shut the "
22645 "virtual machine down before resizing it."
22649 #: ../resize/virt-resize.pod:23
22651 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
22652 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
22656 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520
22657 #: ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469
22658 #: ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2675
22663 #: ../resize/virt-resize.pod:33
22665 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
22666 "fill the extra 5GB of space."
22670 #: ../resize/virt-resize.pod:36
22673 " virt-filesystems --long -h --all -a olddisk\n"
22678 #: ../resize/virt-resize.pod:38
22681 " truncate -r olddisk newdisk\n"
22682 " truncate -s +5G newdisk\n"
22687 #: ../resize/virt-resize.pod:41
22690 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
22691 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
22696 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527
22697 #: ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475
22698 #: ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2700
22703 #: ../resize/virt-resize.pod:46
22705 "As above, but make the /boot partition 200MB bigger, while giving the "
22706 "remaining space to /dev/sda2:"
22710 #: ../resize/virt-resize.pod:49
22713 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22714 " olddisk newdisk\n"
22719 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533
22720 #: ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486
22721 #: ../src/guestfs.pod:1436
22726 #: ../resize/virt-resize.pod:54
22728 "As in the first example, but expand a logical volume as the final step. "
22729 "This is what you would typically use for Linux guests that use LVM:"
22733 #: ../resize/virt-resize.pod:58
22736 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22737 " olddisk newdisk\n"
22742 #: ../resize/virt-resize.pod:61
22747 #: ../resize/virt-resize.pod:63
22749 "As in the first example, but the output format will be qcow2 instead of a "
22754 #: ../resize/virt-resize.pod:66
22757 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22758 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22763 #: ../resize/virt-resize.pod:71
22764 msgid "DETAILED USAGE"
22768 #: ../resize/virt-resize.pod:73
22769 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22773 #: ../resize/virt-resize.pod:77
22774 msgid "1. Shut down the virtual machine"
22778 #: ../resize/virt-resize.pod:79
22779 msgid "2. Locate input disk image"
22783 #: ../resize/virt-resize.pod:81
22785 "Locate the input disk image (ie. the file or device on the host containing "
22786 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22787 "dumpxml> like this to find the disk image name:"
22791 #: ../resize/virt-resize.pod:85
22794 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22795 " Found 1 nodes:\n"
22797 " <source dev=\"/dev/vg/lv_guest\" />\n"
22802 #: ../resize/virt-resize.pod:90
22803 msgid "3. Look at current sizing"
22807 #: ../resize/virt-resize.pod:92
22808 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22812 #: ../resize/virt-resize.pod:95
22815 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22816 " Name Type Size Parent\n"
22817 " /dev/sda1 partition 101M /dev/sda\n"
22818 " /dev/sda2 partition 7.9G /dev/sda\n"
22819 " /dev/sda device 8.0G -\n"
22824 #: ../resize/virt-resize.pod:101
22826 "(This example is a virtual machine with an 8 GB disk which we would like to "
22827 "expand up to 10 GB)."
22831 #: ../resize/virt-resize.pod:104
22832 msgid "4. Create output disk"
22836 #: ../resize/virt-resize.pod:106
22838 "Virt-resize cannot do in-place disk modifications. You have to have space "
22839 "to store the resized output disk."
22843 #: ../resize/virt-resize.pod:109
22845 "To store the resized disk image in a file, create a file of a suitable size:"
22849 #: ../resize/virt-resize.pod:112
22852 " # rm -f outdisk\n"
22853 " # truncate -s 10G outdisk\n"
22858 #: ../resize/virt-resize.pod:115
22859 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22863 #: ../resize/virt-resize.pod:117
22866 " # lvcreate -L 10G -n lv_name vg_name\n"
22871 #: ../resize/virt-resize.pod:119
22872 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22876 #: ../resize/virt-resize.pod:121
22879 " # virsh pool-list\n"
22880 " # virsh vol-create-as poolname newvol 10G\n"
22885 #: ../resize/virt-resize.pod:124
22890 #: ../resize/virt-resize.pod:126
22892 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22893 "file) and the output disk. The output disk is the one created in the "
22898 #: ../resize/virt-resize.pod:130
22901 " # virt-resize indisk outdisk\n"
22906 #: ../resize/virt-resize.pod:132
22908 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22909 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22910 "larger, then an extra, empty partition is created at the end of the disk "
22911 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22916 #: ../resize/virt-resize.pod:138
22918 "More realistically you'd want to expand existing partitions in the disk "
22919 "image by passing extra options (for the full list see the L</OPTIONS> "
22924 #: ../resize/virt-resize.pod:142
22926 "L</--expand> is the most useful option. It expands the named partition "
22927 "within the disk to fill any extra space:"
22931 #: ../resize/virt-resize.pod:145
22934 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22939 #: ../resize/virt-resize.pod:147
22941 "(In this case, an extra partition is I<not> created at the end of the disk, "
22942 "because there will be no unused space)."
22946 #: ../resize/virt-resize.pod:150
22948 "L</--resize> is the other commonly used option. The following would "
22949 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22950 "rest of the available space:"
22954 #: ../resize/virt-resize.pod:154
22957 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22958 " indisk outdisk\n"
22963 #: ../resize/virt-resize.pod:157
22965 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22966 "if virt-resize knows how, it will resize the contents, the equivalent of "
22967 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22968 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22969 "filesystems, so you would have to online resize them after booting the guest."
22973 #: ../resize/virt-resize.pod:164
22974 msgid "Other options are covered below."
22978 #: ../resize/virt-resize.pod:166
22983 #: ../resize/virt-resize.pod:168
22984 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22988 #: ../resize/virt-resize.pod:170
22989 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22993 #: ../resize/virt-resize.pod:172
22996 " # virsh edit guestname\n"
23001 #: ../resize/virt-resize.pod:174
23003 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
23004 "html#elementsDisks>"
23008 #: ../resize/virt-resize.pod:177
23009 msgid "Then start up the domain with the new, resized disk:"
23013 #: ../resize/virt-resize.pod:179
23016 " # virsh start guestname\n"
23021 #: ../resize/virt-resize.pod:181
23023 "and check that it still works. See also the L</NOTES> section below for "
23024 "additional information."
23028 #: ../resize/virt-resize.pod:184
23029 msgid "7. Resize LVs etc inside the guest"
23033 #: ../resize/virt-resize.pod:186
23034 msgid "(This can also be done offline using L<guestfish(1)>)"
23038 #: ../resize/virt-resize.pod:188
23040 "Once the guest has booted you should see the new space available, at least "
23041 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
23042 "may need to resize LVs inside PVs, and also resize filesystem types that "
23043 "virt-resize does not know how to expand."
23047 #: ../resize/virt-resize.pod:195
23048 msgid "SHRINKING A VIRTUAL MACHINE DISK"
23052 #: ../resize/virt-resize.pod:197
23054 "Shrinking is somewhat more complex than expanding, and only an overview is "
23059 #: ../resize/virt-resize.pod:200
23061 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
23062 "filesystems). The user has to shrink content before passing the disk image "
23063 "to virt-resize, and virt-resize will check that the content has been shrunk "
23068 #: ../resize/virt-resize.pod:205
23069 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
23073 #: ../resize/virt-resize.pod:207
23075 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
23076 "steps 3 and 4 above to allocate a new disk image."
23080 #: ../resize/virt-resize.pod:210
23082 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
23086 #: ../resize/virt-resize.pod:213
23087 msgid "IGNORING OR DELETING PARTITIONS"
23091 #: ../resize/virt-resize.pod:215
23093 "virt-resize also gives a convenient way to ignore or delete partitions when "
23094 "copying from the input disk to the output disk. Ignoring a partition speeds "
23095 "up the copy where you don't care about the existing contents of a "
23096 "partition. Deleting a partition removes it completely, but note that it "
23097 "also renumbers any partitions after the one which is deleted, which can "
23098 "leave some guests unbootable."
23102 #: ../resize/virt-resize.pod:222
23103 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
23107 #: ../resize/virt-resize.pod:224
23109 "If the input disk is in qcow2 format, then you may prefer that the output is "
23110 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
23111 "the fly. The output format is simply determined by the format of the empty "
23112 "output container that you provide. Thus to create qcow2 output, use:"
23116 #: ../resize/virt-resize.pod:230
23119 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
23124 #: ../resize/virt-resize.pod:232
23125 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
23129 #: ../resize/virt-resize.pod:234
23130 msgid "Similarly, to get non-sparse raw output use:"
23134 #: ../resize/virt-resize.pod:236
23137 " fallocate -l size outdisk\n"
23142 #: ../resize/virt-resize.pod:238
23144 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
23145 "dev/zero of=outdisk bs=1M count=..>)"
23149 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
23150 msgid "Display help."
23154 #: ../resize/virt-resize.pod:249
23159 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
23160 #: ../tools/virt-win-reg.pl:120
23165 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
23166 msgid "Enable debugging messages."
23170 #: ../resize/virt-resize.pod:255
23171 msgid "B<--delete part>"
23175 #: ../resize/virt-resize.pod:257
23177 "Delete the named partition. It would be more accurate to describe this as "
23178 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
23179 "the original disk image is left intact."
23183 #: ../resize/virt-resize.pod:261
23185 "Note that when you delete a partition, then anything contained in the "
23186 "partition is also deleted. Furthermore, this causes any partitions that "
23187 "come after to be I<renumbered>, which can easily make your guest unbootable."
23191 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
23192 #: ../resize/virt-resize.pod:454 ../sparsify/virt-sparsify.pod:145
23193 msgid "You can give this option multiple times."
23197 #: ../resize/virt-resize.pod:268
23198 msgid "B<--expand part>"
23202 #: ../resize/virt-resize.pod:270
23204 "Expand the named partition so it uses up all extra space (space left over "
23205 "after any other resize changes that you request have been done)."
23209 #: ../resize/virt-resize.pod:273
23211 "If virt-resize knows how, it will expand the direct content of the "
23212 "partition. For example, if the partition is an LVM PV, it will expand the "
23213 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
23214 "content it doesn't know about alone."
23218 #: ../resize/virt-resize.pod:278
23219 msgid "Currently virt-resize can resize:"
23223 #: ../resize/virt-resize.pod:284
23224 msgid "ext2, ext3 and ext4 filesystems."
23228 #: ../resize/virt-resize.pod:288
23229 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
23233 #: ../resize/virt-resize.pod:290
23235 "The filesystem must have been shut down consistently last time it was used. "
23236 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
23237 "consistency check, so at the first boot after resizing Windows will check "
23242 #: ../resize/virt-resize.pod:297
23244 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
23245 "inside the PV, but see the I<--LV-expand> option. The user could also "
23246 "resize LVs as desired after boot."
23250 #: ../resize/virt-resize.pod:303
23251 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
23255 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
23256 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
23260 #: ../resize/virt-resize.pod:309 ../sparsify/virt-sparsify.pod:125
23261 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92
23262 #: ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
23263 msgid "B<--format> raw"
23267 #: ../resize/virt-resize.pod:311 ../sparsify/virt-sparsify.pod:129
23269 "Specify the format of the input disk image. If this flag is not given then "
23270 "it is auto-detected from the image itself."
23274 #: ../resize/virt-resize.pod:317
23276 "Note that this option I<does not> affect the output format. See L</QCOW2 "
23277 "AND NON-SPARSE RAW FORMATS>."
23281 #: ../resize/virt-resize.pod:320
23282 msgid "B<--ignore part>"
23286 #: ../resize/virt-resize.pod:322
23288 "Ignore the named partition. Effectively this means the partition is "
23289 "allocated on the destination disk, but the content is not copied across from "
23290 "the source disk. The content of the partition will be blank (all zero "
23295 #: ../resize/virt-resize.pod:329
23296 msgid "B<--LV-expand logvol>"
23300 #: ../resize/virt-resize.pod:331
23302 "This takes the logical volume and, as a final step, expands it to fill all "
23303 "the space available in its volume group. A typical usage, assuming a Linux "
23304 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
23305 "lv_root> would be:"
23309 #: ../resize/virt-resize.pod:336
23312 " virt-resize indisk outdisk \\\n"
23313 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
23318 #: ../resize/virt-resize.pod:339
23320 "This would first expand the partition (and PV), and then expand the root "
23321 "device to fill the extra space in the PV."
23325 #: ../resize/virt-resize.pod:342
23327 "The contents of the LV are also resized if virt-resize knows how to do "
23328 "that. You can stop virt-resize from trying to expand the content by using "
23329 "the option I<--no-expand-content>."
23333 #: ../resize/virt-resize.pod:346
23334 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
23338 #: ../resize/virt-resize.pod:348
23340 "You can give this option multiple times, I<but> it doesn't make sense to do "
23341 "this unless the logical volumes you specify are all in different volume "
23346 #: ../resize/virt-resize.pod:352 ../sparsify/virt-sparsify.pod:147
23347 msgid "B<--machine-readable>"
23351 #: ../resize/virt-resize.pod:354 ../sparsify/virt-sparsify.pod:149
23353 "This option is used to make the output more machine friendly when being "
23354 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
23358 #: ../resize/virt-resize.pod:360
23359 msgid "B<--dryrun>"
23363 #: ../resize/virt-resize.pod:362
23364 msgid "Print a summary of what would be done, but don't do anything."
23368 #: ../resize/virt-resize.pod:364
23369 msgid "B<--no-copy-boot-loader>"
23373 #: ../resize/virt-resize.pod:366
23375 "By default, virt-resize copies over some sectors at the start of the disk "
23376 "(up to the beginning of the first partition). Commonly these sectors "
23377 "contain the Master Boot Record (MBR) and the boot loader, and are required "
23378 "in order for the guest to boot correctly."
23382 #: ../resize/virt-resize.pod:371
23384 "If you specify this flag, then this initial copy is not done. You may need "
23385 "to reinstall the boot loader in this case."
23389 #: ../resize/virt-resize.pod:374
23390 msgid "B<--no-extra-partition>"
23394 #: ../resize/virt-resize.pod:376
23396 "By default, virt-resize creates an extra partition if there is any extra, "
23397 "unused space after all resizing has happened. Use this option to prevent "
23398 "the extra partition from being created. If you do this then the extra space "
23399 "will be inaccessible until you run fdisk, parted, or some other partitioning "
23400 "tool in the guest."
23404 #: ../resize/virt-resize.pod:382
23406 "Note that if the surplus space is smaller than 10 MB, no extra partition "
23411 #: ../resize/virt-resize.pod:385
23412 msgid "B<--no-expand-content>"
23416 #: ../resize/virt-resize.pod:387
23418 "By default, virt-resize will try to expand the direct contents of "
23419 "partitions, if it knows how (see I<--expand> option above)."
23423 #: ../resize/virt-resize.pod:390
23425 "If you give the I<--no-expand-content> option then virt-resize will not "
23430 #: ../resize/virt-resize.pod:393
23431 msgid "B<--ntfsresize-force>"
23435 #: ../resize/virt-resize.pod:395
23437 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
23438 "the NTFS disk is marked as needing a consistency check. You have to use "
23439 "this option if you want to resize a Windows guest multiple times without "
23440 "booting into Windows between each resize."
23444 #: ../resize/virt-resize.pod:401
23445 msgid "B<--output-format> raw"
23449 #: ../resize/virt-resize.pod:403
23451 "Specify the format of the output disk image. If this flag is not given then "
23452 "it is auto-detected from the image itself."
23456 #: ../resize/virt-resize.pod:409
23458 "Note that this option I<does not create> the output format. This option "
23459 "just tells libguestfs what it is so it doesn't try to guess it. You still "
23460 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
23461 "SPARSE RAW FORMATS>."
23465 #: ../resize/virt-resize.pod:418
23466 msgid "Don't print the summary."
23470 #: ../resize/virt-resize.pod:420
23471 msgid "B<--resize part=size>"
23475 #: ../resize/virt-resize.pod:422
23477 "Resize the named partition (expanding or shrinking it) so that it has the "
23482 #: ../resize/virt-resize.pod:425
23484 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
23485 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
23486 "size; or as a relative number or percentage. For example:"
23490 #: ../resize/virt-resize.pod:431
23493 " --resize /dev/sda2=10G\n"
23498 #: ../resize/virt-resize.pod:433
23501 " --resize /dev/sda4=90%\n"
23506 #: ../resize/virt-resize.pod:435
23509 " --resize /dev/sda2=+1G\n"
23514 #: ../resize/virt-resize.pod:437
23517 " --resize /dev/sda2=-200M\n"
23522 #: ../resize/virt-resize.pod:439
23525 " --resize /dev/sda1=+128K\n"
23530 #: ../resize/virt-resize.pod:441
23533 " --resize /dev/sda1=+10%\n"
23538 #: ../resize/virt-resize.pod:443
23541 " --resize /dev/sda1=-10%\n"
23546 #: ../resize/virt-resize.pod:445
23548 "You can increase the size of any partition. Virt-resize will expand the "
23549 "direct content of the partition if it knows how (see I<--expand> below)."
23553 #: ../resize/virt-resize.pod:449
23555 "You can only I<decrease> the size of partitions that contain filesystems or "
23556 "PVs which have already been shrunk. Virt-resize will check this has been "
23557 "done before proceeding, or else will print an error (see also I<--resize-"
23562 #: ../resize/virt-resize.pod:456
23563 msgid "B<--resize-force part=size>"
23567 #: ../resize/virt-resize.pod:458
23569 "This is the same as I<--resize> except that it will let you decrease the "
23570 "size of any partition. Generally this means you will lose any data which "
23571 "was at the end of the partition you shrink, but you may not care about that "
23572 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
23573 "as a swap partition)."
23577 #: ../resize/virt-resize.pod:464
23578 msgid "See also the I<--ignore> option."
23582 #: ../resize/virt-resize.pod:466
23583 msgid "B<--shrink part>"
23587 #: ../resize/virt-resize.pod:468
23589 "Shrink the named partition until the overall disk image fits in the "
23590 "destination. The named partition B<must> contain a filesystem or PV which "
23591 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
23592 "online tools). Virt-resize will check this and give an error if it has not "
23597 #: ../resize/virt-resize.pod:474
23599 "The amount by which the overall disk must be shrunk (after carrying out all "
23600 "other operations requested by the user) is called the \"deficit\". For "
23601 "example, a straight copy (assume no other operations) from a 5GB disk image "
23602 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
23603 "would give an error unless the user specified a partition to shrink and that "
23604 "partition had more than a gigabyte of free space."
23608 #: ../resize/virt-resize.pod:492 ../sparsify/virt-sparsify.pod:177
23609 msgid "MACHINE READABLE OUTPUT"
23613 #: ../resize/virt-resize.pod:494
23615 "The I<--machine-readable> option can be used to make the output more machine "
23616 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23621 #: ../resize/virt-resize.pod:498 ../sparsify/virt-sparsify.pod:183
23622 msgid "There are two ways to use this option."
23626 #: ../resize/virt-resize.pod:500
23628 "Firstly use the option on its own to query the capabilities of the virt-"
23629 "resize binary. Typical output looks like this:"
23633 #: ../resize/virt-resize.pod:503
23636 " $ virt-resize --machine-readable\n"
23638 " ntfsresize-force\n"
23646 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:193
23648 "A list of features is printed, one per line, and the program exits with "
23653 #: ../resize/virt-resize.pod:513 ../sparsify/virt-sparsify.pod:196
23655 "Secondly use the option in conjunction with other options to make the "
23656 "regular program output more machine friendly."
23660 #: ../resize/virt-resize.pod:516 ../sparsify/virt-sparsify.pod:199
23661 msgid "At the moment this means:"
23665 #: ../resize/virt-resize.pod:522 ../sparsify/virt-sparsify.pod:205
23667 "Progress bar messages can be parsed from stdout by looking for this regular "
23672 #: ../resize/virt-resize.pod:525 ../sparsify/virt-sparsify.pod:208
23675 " ^[0-9]+/[0-9]+$\n"
23680 #: ../resize/virt-resize.pod:529 ../sparsify/virt-sparsify.pod:212
23682 "The calling program should treat messages sent to stdout (except for "
23683 "progress bar messages) as status messages. They can be logged and/or "
23684 "displayed to the user."
23688 #: ../resize/virt-resize.pod:535
23690 "The calling program should treat messages sent to stderr as error messages. "
23691 "In addition, virt-resize exits with a non-zero status code if there was a "
23696 #: ../resize/virt-resize.pod:541
23698 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
23699 "readable> option and will return an error."
23703 #: ../resize/virt-resize.pod:546
23704 msgid "\"Partition 1 does not end on cylinder boundary.\""
23708 #: ../resize/virt-resize.pod:548
23710 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
23711 "means the partitions will not be aligned to the ancient CHS geometry. "
23712 "However CHS geometry is meaningless for disks manufactured since the early "
23713 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
23714 "cylinders is not required by any modern operating system."
23718 #: ../resize/virt-resize.pod:555
23719 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23723 #: ../resize/virt-resize.pod:557
23725 "In Windows Vista and later versions, Microsoft switched to using a separate "
23726 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23727 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
23728 "the boot partition. Doing so seems to break the guest completely. However "
23729 "expanding the second partition (ie. C: drive) should work."
23733 #: ../resize/virt-resize.pod:564
23735 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23736 "NTFS partitions have been expanded. This is just a safety check and (unless "
23737 "it find errors) is nothing to worry about."
23741 #: ../resize/virt-resize.pod:568
23742 msgid "GUEST BOOT STUCK AT \"GRUB\""
23746 #: ../resize/virt-resize.pod:570
23748 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23749 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
23750 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
23751 "although we think is to do with partition alignment."
23755 #: ../resize/virt-resize.pod:575
23758 " guestfish -i -a newdisk\n"
23759 " ><fs> cat /boot/grub/device.map\n"
23760 " # check the contents of this file are sensible or\n"
23761 " # edit the file if necessary\n"
23762 " ><fs> grub-install / /dev/vda\n"
23768 #: ../resize/virt-resize.pod:582
23770 "For more flexible guest reconfiguration, including if you need to specify "
23771 "other parameters to grub-install, use L<virt-rescue(1)>."
23775 #: ../resize/virt-resize.pod:585
23776 msgid "ALTERNATIVE TOOLS"
23780 #: ../resize/virt-resize.pod:587
23782 "There are several proprietary tools for resizing partitions. We won't "
23783 "mention any here."
23787 #: ../resize/virt-resize.pod:590
23789 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23790 "operations on disk images. They can resize and move partitions, but I don't "
23791 "think they can do anything with the contents, and they certainly don't "
23796 #: ../resize/virt-resize.pod:595
23798 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23799 "but at a much lower level. You will probably end up hand-calculating sector "
23800 "offsets, which is something that virt-resize was designed to avoid. If you "
23801 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23806 #: ../resize/virt-resize.pod:615
23808 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
23809 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
23810 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
23811 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<virt-sparsify(1)>, "
23812 "L<http://libguestfs.org/>."
23816 #: ../ruby/examples/guestfs-ruby.pod:5
23817 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23821 #: ../ruby/examples/guestfs-ruby.pod:9
23824 " require 'guestfs'\n"
23825 " g = Guestfs::Guestfs.new()\n"
23826 " g.add_drive_opts(\"disk.img\",\n"
23827 " :readonly => 1, :format => \"raw\")\n"
23833 #: ../ruby/examples/guestfs-ruby.pod:17
23835 "This manual page documents how to call libguestfs from the Ruby programming "
23836 "language. This page just documents the differences from the C API and gives "
23837 "some examples. If you are not familiar with using libguestfs, you also need "
23838 "to read L<guestfs(3)>."
23842 #: ../ruby/examples/guestfs-ruby.pod:24
23844 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23845 "This has a single parameter which is the error message (a string)."
23849 #: ../ruby/examples/guestfs-ruby.pod:38
23851 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
23852 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
23853 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23857 #: ../sparsify/virt-sparsify.pod:5
23858 msgid "virt-sparsify - Make a virtual machine disk sparse"
23862 #: ../sparsify/virt-sparsify.pod:9
23865 " virt-sparsify [--options] indisk outdisk\n"
23870 #: ../sparsify/virt-sparsify.pod:13
23872 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23873 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23874 "the disk image can be converted back to free space on the host."
23878 #: ../sparsify/virt-sparsify.pod:18
23880 "Virt-sparsify can locate and sparsify free space in most filesystems (eg. "
23881 "ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23885 #: ../sparsify/virt-sparsify.pod:21
23887 "Virt-sparsify can also convert between some disk formats, for example "
23888 "converting a raw disk image to a thin-provisioned qcow2 image."
23892 #: ../sparsify/virt-sparsify.pod:24
23894 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23895 "machines. If a virtual machine has more than one attached disk, you must "
23896 "sparsify each one separately."
23900 #: ../sparsify/virt-sparsify.pod:28
23901 msgid "IMPORTANT LIMITATIONS"
23905 #: ../sparsify/virt-sparsify.pod:34
23907 "Virt-sparsify does not do in-place modifications. It copies from a source "
23908 "image to a destination image, leaving the source unchanged. I<Check that "
23909 "the sparsification was successful before deleting the source image>."
23913 #: ../sparsify/virt-sparsify.pod:41
23914 msgid "The virtual machine I<must be shut down> before using this tool."
23918 #: ../sparsify/virt-sparsify.pod:45
23920 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23921 "(1 temporary copy + 1 destination image). This is in the worst case and "
23922 "usually much less space is required."
23926 #: ../sparsify/virt-sparsify.pod:51
23928 "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23932 #: ../sparsify/virt-sparsify.pod:56
23933 msgid "Virt-sparsify cannot handle encrypted disks."
23937 #: ../sparsify/virt-sparsify.pod:60
23939 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23940 "this space is often used for critical items like bootloaders so it's not "
23945 #: ../sparsify/virt-sparsify.pod:66
23947 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23948 "to do this unless we can be sure there is no hibernation data, so at the "
23949 "moment swap partitions are ignored."
23953 #: ../sparsify/virt-sparsify.pod:72
23955 "You may also want to read the manual pages for the associated tools L<virt-"
23956 "filesystems(1)> and L<virt-df(1)> before starting."
23960 #: ../sparsify/virt-sparsify.pod:77
23961 msgid "Typical usage is:"
23965 #: ../sparsify/virt-sparsify.pod:79
23968 " virt-sparsify indisk outdisk\n"
23973 #: ../sparsify/virt-sparsify.pod:81
23975 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23976 "is created, or overwritten if it already exists. The format of the input "
23977 "disk is detected (eg. qcow2) and the same format is used for the output disk."
23981 #: ../sparsify/virt-sparsify.pod:86
23982 msgid "To convert between formats, use the I<--convert> option:"
23986 #: ../sparsify/virt-sparsify.pod:88
23989 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23994 #: ../sparsify/virt-sparsify.pod:90
23996 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23997 "can find within the source disk image. You can get it to ignore (don't zero "
23998 "free space on) certain filesystems by doing:"
24002 #: ../sparsify/virt-sparsify.pod:94
24005 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
24010 #: ../sparsify/virt-sparsify.pod:96
24012 "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
24016 #: ../sparsify/virt-sparsify.pod:107
24017 msgid "B<--convert> raw"
24021 #: ../sparsify/virt-sparsify.pod:109
24022 msgid "B<--convert> qcow2"
24026 #: ../sparsify/virt-sparsify.pod:111
24027 msgid "B<--convert> [other formats]"
24031 #: ../sparsify/virt-sparsify.pod:113
24033 "Use C<output-format> as the format for the destination image. If this is "
24034 "not specified, then the input format is used."
24038 #: ../sparsify/virt-sparsify.pod:116
24039 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
24043 #: ../sparsify/virt-sparsify.pod:118
24045 "You can also use any format supported by the L<qemu-img(1)> program, eg. "
24046 "C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
24050 #: ../sparsify/virt-sparsify.pod:122
24052 "Specifying the I<--convert> option is usually a good idea, because then virt-"
24053 "sparsify doesn't need to try to guess the input format."
24057 #: ../sparsify/virt-sparsify.pod:127
24058 msgid "B<--format> qcow2"
24062 #: ../sparsify/virt-sparsify.pod:135
24063 msgid "B<--ignore> filesystem"
24067 #: ../sparsify/virt-sparsify.pod:137
24068 msgid "B<--ignore> volgroup"
24072 #: ../sparsify/virt-sparsify.pod:139
24074 "Ignore the named filesystem. Free space on the filesystem will not be "
24075 "zeroed, but existing blocks of zeroes will still be sparsified."
24079 #: ../sparsify/virt-sparsify.pod:142
24081 "In the second form, this ignores the named volume group. Use the volume "
24082 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
24086 #: ../sparsify/virt-sparsify.pod:157
24087 msgid "This disables progress bars and other unnecessary output."
24091 #: ../sparsify/virt-sparsify.pod:179
24093 "The I<--machine-readable> option can be used to make the output more machine "
24094 "friendly, which is useful when calling virt-sparsify from other programs, "
24099 #: ../sparsify/virt-sparsify.pod:185
24101 "Firstly use the option on its own to query the capabilities of the virt-"
24102 "sparsify binary. Typical output looks like this:"
24106 #: ../sparsify/virt-sparsify.pod:188
24109 " $ virt-sparsify --machine-readable\n"
24117 #: ../sparsify/virt-sparsify.pod:218
24119 "The calling program should treat messages sent to stderr as error messages. "
24120 "In addition, virt-sparsify exits with a non-zero status code if there was a "
24125 #: ../sparsify/virt-sparsify.pod:224
24127 "All versions of virt-sparsify have supported the I<--machine-readable> "
24132 #: ../sparsify/virt-sparsify.pod:238
24134 "Location of the temporary directory used for the potentially large temporary "
24139 #: ../sparsify/virt-sparsify.pod:241
24141 "You should ensure there is enough free space in the worst case for a full "
24142 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
24143 "to another directory that has enough space."
24147 #: ../sparsify/virt-sparsify.pod:245
24148 msgid "This defaults to C</tmp>."
24152 #: ../sparsify/virt-sparsify.pod:249
24154 "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
24158 #: ../sparsify/virt-sparsify.pod:253
24160 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
24161 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, L<qemu-img"
24162 "(1)>, L<http://libguestfs.org/>."
24166 #: ../src/guestfs-actions.pod:1
24167 msgid "guestfs_add_cdrom"
24171 #: ../src/guestfs-actions.pod:3
24175 " guestfs_add_cdrom (guestfs_h *g,\n"
24176 " const char *filename);\n"
24181 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:255
24182 #: ../src/guestfs-actions.pod:276
24184 "I<This function is deprecated.> In new code, use the L</"
24185 "guestfs_add_drive_opts> call instead."
24189 #: ../src/guestfs-actions.pod:24
24191 "This call checks for the existence of C<filename>. This stops you from "
24192 "specifying other types of drive which are supported by qemu such as C<nbd:> "
24193 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
24198 #: ../src/guestfs-actions.pod:31
24200 "If you just want to add an ISO file (often you use this as an efficient way "
24201 "to transfer large files into the guest), then you should probably use "
24202 "C<guestfs_add_drive_ro> instead."
24206 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
24207 #: ../src/guestfs-actions.pod:207 ../src/guestfs-actions.pod:244
24208 #: ../src/guestfs-actions.pod:265 ../src/guestfs-actions.pod:286
24209 #: ../src/guestfs-actions.pod:299 ../src/guestfs-actions.pod:313
24210 #: ../src/guestfs-actions.pod:433 ../src/guestfs-actions.pod:453
24211 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:512
24212 #: ../src/guestfs-actions.pod:540 ../src/guestfs-actions.pod:558
24213 #: ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:658
24214 #: ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:687
24215 #: ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:804
24216 #: ../src/guestfs-actions.pod:818 ../src/guestfs-actions.pod:832
24217 #: ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:1052
24218 #: ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1090
24219 #: ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1239
24220 #: ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1303
24221 #: ../src/guestfs-actions.pod:1322 ../src/guestfs-actions.pod:1336
24222 #: ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1426
24223 #: ../src/guestfs-actions.pod:1457 ../src/guestfs-actions.pod:1482
24224 #: ../src/guestfs-actions.pod:1524 ../src/guestfs-actions.pod:1637
24225 #: ../src/guestfs-actions.pod:1664 ../src/guestfs-actions.pod:1879
24226 #: ../src/guestfs-actions.pod:1901 ../src/guestfs-actions.pod:1988
24227 #: ../src/guestfs-actions.pod:2496 ../src/guestfs-actions.pod:2640
24228 #: ../src/guestfs-actions.pod:2701 ../src/guestfs-actions.pod:2736
24229 #: ../src/guestfs-actions.pod:3793 ../src/guestfs-actions.pod:3808
24230 #: ../src/guestfs-actions.pod:3833 ../src/guestfs-actions.pod:4022
24231 #: ../src/guestfs-actions.pod:4036 ../src/guestfs-actions.pod:4049
24232 #: ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4078
24233 #: ../src/guestfs-actions.pod:4114 ../src/guestfs-actions.pod:4186
24234 #: ../src/guestfs-actions.pod:4206 ../src/guestfs-actions.pod:4223
24235 #: ../src/guestfs-actions.pod:4246 ../src/guestfs-actions.pod:4269
24236 #: ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:4323
24237 #: ../src/guestfs-actions.pod:4342 ../src/guestfs-actions.pod:4377
24238 #: ../src/guestfs-actions.pod:4389 ../src/guestfs-actions.pod:4425
24239 #: ../src/guestfs-actions.pod:4441 ../src/guestfs-actions.pod:4454
24240 #: ../src/guestfs-actions.pod:4469 ../src/guestfs-actions.pod:4486
24241 #: ../src/guestfs-actions.pod:4579 ../src/guestfs-actions.pod:4599
24242 #: ../src/guestfs-actions.pod:4612 ../src/guestfs-actions.pod:4663
24243 #: ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4699
24244 #: ../src/guestfs-actions.pod:4715 ../src/guestfs-actions.pod:4729
24245 #: ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:4760
24246 #: ../src/guestfs-actions.pod:4775 ../src/guestfs-actions.pod:4802
24247 #: ../src/guestfs-actions.pod:4865 ../src/guestfs-actions.pod:4938
24248 #: ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:4988
24249 #: ../src/guestfs-actions.pod:5007 ../src/guestfs-actions.pod:5019
24250 #: ../src/guestfs-actions.pod:5036 ../src/guestfs-actions.pod:5049
24251 #: ../src/guestfs-actions.pod:5064 ../src/guestfs-actions.pod:5079
24252 #: ../src/guestfs-actions.pod:5111 ../src/guestfs-actions.pod:5137
24253 #: ../src/guestfs-actions.pod:5176 ../src/guestfs-actions.pod:5196
24254 #: ../src/guestfs-actions.pod:5210 ../src/guestfs-actions.pod:5227
24255 #: ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5329
24256 #: ../src/guestfs-actions.pod:5376 ../src/guestfs-actions.pod:5419
24257 #: ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5464
24258 #: ../src/guestfs-actions.pod:5482 ../src/guestfs-actions.pod:5622
24259 #: ../src/guestfs-actions.pod:5679 ../src/guestfs-actions.pod:5701
24260 #: ../src/guestfs-actions.pod:5719 ../src/guestfs-actions.pod:5751
24261 #: ../src/guestfs-actions.pod:5817 ../src/guestfs-actions.pod:5834
24262 #: ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:5861
24263 #: ../src/guestfs-actions.pod:6150 ../src/guestfs-actions.pod:6169
24264 #: ../src/guestfs-actions.pod:6188 ../src/guestfs-actions.pod:6202
24265 #: ../src/guestfs-actions.pod:6214 ../src/guestfs-actions.pod:6228
24266 #: ../src/guestfs-actions.pod:6240 ../src/guestfs-actions.pod:6254
24267 #: ../src/guestfs-actions.pod:6270 ../src/guestfs-actions.pod:6291
24268 #: ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6329
24269 #: ../src/guestfs-actions.pod:6359 ../src/guestfs-actions.pod:6377
24270 #: ../src/guestfs-actions.pod:6400 ../src/guestfs-actions.pod:6418
24271 #: ../src/guestfs-actions.pod:6437 ../src/guestfs-actions.pod:6458
24272 #: ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6494
24273 #: ../src/guestfs-actions.pod:6513 ../src/guestfs-actions.pod:6541
24274 #: ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6584
24275 #: ../src/guestfs-actions.pod:6600 ../src/guestfs-actions.pod:6624
24276 #: ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6658
24277 #: ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6721
24278 #: ../src/guestfs-actions.pod:6751 ../src/guestfs-actions.pod:6784
24279 #: ../src/guestfs-actions.pod:6899 ../src/guestfs-actions.pod:7020
24280 #: ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7045
24281 #: ../src/guestfs-actions.pod:7058 ../src/guestfs-actions.pod:7080
24282 #: ../src/guestfs-actions.pod:7093 ../src/guestfs-actions.pod:7106
24283 #: ../src/guestfs-actions.pod:7119 ../src/guestfs-actions.pod:7134
24284 #: ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7210
24285 #: ../src/guestfs-actions.pod:7226 ../src/guestfs-actions.pod:7242
24286 #: ../src/guestfs-actions.pod:7259 ../src/guestfs-actions.pod:7272
24287 #: ../src/guestfs-actions.pod:7292 ../src/guestfs-actions.pod:7328
24288 #: ../src/guestfs-actions.pod:7342 ../src/guestfs-actions.pod:7383
24289 #: ../src/guestfs-actions.pod:7396 ../src/guestfs-actions.pod:7414
24290 #: ../src/guestfs-actions.pod:7448 ../src/guestfs-actions.pod:7484
24291 #: ../src/guestfs-actions.pod:7600 ../src/guestfs-actions.pod:7615
24292 #: ../src/guestfs-actions.pod:7629 ../src/guestfs-actions.pod:7684
24293 #: ../src/guestfs-actions.pod:7697 ../src/guestfs-actions.pod:7742
24294 #: ../src/guestfs-actions.pod:7782 ../src/guestfs-actions.pod:7838
24295 #: ../src/guestfs-actions.pod:7858 ../src/guestfs-actions.pod:7891
24296 #: ../src/guestfs-actions.pod:7955 ../src/guestfs-actions.pod:7978
24297 #: ../src/guestfs-actions.pod:8007
24298 msgid "This function returns 0 on success or -1 on error."
24302 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
24303 #: ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:2102
24304 #: ../src/guestfs-actions.pod:2200 ../src/guestfs-actions.pod:2325
24305 #: ../src/guestfs-actions.pod:3795 ../src/guestfs-actions.pod:3815
24306 #: ../src/guestfs-actions.pod:5113 ../src/guestfs-actions.pod:6379
24307 #: ../src/guestfs-actions.pod:6496 ../src/guestfs-actions.pod:6645
24308 #: ../src/guestfs-actions.pod:7136 ../src/guestfs-actions.pod:7261
24309 #: ../src/guestfs-actions.pod:7784
24310 msgid "(Added in 0.3)"
24314 #: ../src/guestfs-actions.pod:41
24315 msgid "guestfs_add_domain"
24319 #: ../src/guestfs-actions.pod:43
24323 " guestfs_add_domain (guestfs_h *g,\n"
24324 " const char *dom,\n"
24330 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
24331 #: ../src/guestfs-actions.pod:843 ../src/guestfs-actions.pod:1167
24332 #: ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:2993
24333 #: ../src/guestfs-actions.pod:4814 ../src/guestfs-actions.pod:5123
24334 #: ../src/guestfs-actions.pod:5340
24336 "You may supply a list of optional arguments to this call. Use zero or more "
24337 "of the following pairs of parameters, and terminate the list with C<-1> on "
24338 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
24342 #: ../src/guestfs-actions.pod:53
24345 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
24346 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
24347 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
24348 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
24349 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
24354 #: ../src/guestfs-actions.pod:59
24356 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
24357 "It works by connecting to libvirt, requesting the domain and domain XML from "
24358 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
24363 #: ../src/guestfs-actions.pod:94
24365 "The other optional parameters are passed directly through to "
24366 "C<guestfs_add_drive_opts>."
24370 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:356
24371 #: ../src/guestfs-actions.pod:526 ../src/guestfs-actions.pod:704
24372 #: ../src/guestfs-actions.pod:735 ../src/guestfs-actions.pod:753
24373 #: ../src/guestfs-actions.pod:772 ../src/guestfs-actions.pod:1502
24374 #: ../src/guestfs-actions.pod:1858 ../src/guestfs-actions.pod:2061
24375 #: ../src/guestfs-actions.pod:2172 ../src/guestfs-actions.pod:2223
24376 #: ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:2289
24377 #: ../src/guestfs-actions.pod:2312 ../src/guestfs-actions.pod:2627
24378 #: ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3129
24379 #: ../src/guestfs-actions.pod:5299 ../src/guestfs-actions.pod:5519
24380 #: ../src/guestfs-actions.pod:5931 ../src/guestfs-actions.pod:5957
24381 #: ../src/guestfs-actions.pod:7369 ../src/guestfs-actions.pod:7795
24382 #: ../src/guestfs-actions.pod:7808 ../src/guestfs-actions.pod:7821
24383 msgid "On error this function returns -1."
24387 #: ../src/guestfs-actions.pod:99
24388 msgid "(Added in 1.7.4)"
24392 #: ../src/guestfs-actions.pod:101
24393 msgid "guestfs_add_domain_va"
24397 #: ../src/guestfs-actions.pod:103
24401 " guestfs_add_domain_va (guestfs_h *g,\n"
24402 " const char *dom,\n"
24403 " va_list args);\n"
24408 #: ../src/guestfs-actions.pod:108
24409 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
24413 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
24414 #: ../src/guestfs-actions.pod:220 ../src/guestfs-actions.pod:231
24415 #: ../src/guestfs-actions.pod:882 ../src/guestfs-actions.pod:893
24416 #: ../src/guestfs-actions.pod:1195 ../src/guestfs-actions.pod:1208
24417 #: ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1267
24418 #: ../src/guestfs-actions.pod:3077 ../src/guestfs-actions.pod:3089
24419 #: ../src/guestfs-actions.pod:4879 ../src/guestfs-actions.pod:4891
24420 #: ../src/guestfs-actions.pod:5151 ../src/guestfs-actions.pod:5163
24421 #: ../src/guestfs-actions.pod:5389 ../src/guestfs-actions.pod:5400
24422 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
24426 #: ../src/guestfs-actions.pod:112
24427 msgid "guestfs_add_domain_argv"
24431 #: ../src/guestfs-actions.pod:114
24435 " guestfs_add_domain_argv (guestfs_h *g,\n"
24436 " const char *dom,\n"
24437 " const struct guestfs_add_domain_argv *optargs);\n"
24442 #: ../src/guestfs-actions.pod:119
24443 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
24447 #: ../src/guestfs-actions.pod:123
24448 msgid "guestfs_add_drive"
24452 #: ../src/guestfs-actions.pod:125
24456 " guestfs_add_drive (guestfs_h *g,\n"
24457 " const char *filename);\n"
24462 #: ../src/guestfs-actions.pod:129
24464 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
24465 "optional parameters, so the disk is added writable, with the format being "
24466 "detected automatically."
24470 #: ../src/guestfs-actions.pod:133
24472 "Automatic detection of the format opens you up to a potential security hole "
24473 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24474 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24475 "you should think about replacing calls to this function with calls to "
24476 "C<guestfs_add_drive_opts>, and specifying the format."
24480 #: ../src/guestfs-actions.pod:144
24481 msgid "guestfs_add_drive_opts"
24485 #: ../src/guestfs-actions.pod:146
24489 " guestfs_add_drive_opts (guestfs_h *g,\n"
24490 " const char *filename,\n"
24496 #: ../src/guestfs-actions.pod:156
24499 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
24500 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
24501 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
24502 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
24507 #: ../src/guestfs-actions.pod:186
24509 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
24510 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
24511 "Possible formats include C<raw> and C<qcow2>."
24515 #: ../src/guestfs-actions.pod:197
24517 "This rarely-used option lets you emulate the behaviour of the deprecated "
24518 "C<guestfs_add_drive_with_if> call (q.v.)"
24522 #: ../src/guestfs-actions.pod:209
24523 msgid "(Added in 1.5.23)"
24527 #: ../src/guestfs-actions.pod:211
24528 msgid "guestfs_add_drive_opts_va"
24532 #: ../src/guestfs-actions.pod:213
24536 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
24537 " const char *filename,\n"
24538 " va_list args);\n"
24543 #: ../src/guestfs-actions.pod:218
24544 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
24548 #: ../src/guestfs-actions.pod:222
24549 msgid "guestfs_add_drive_opts_argv"
24553 #: ../src/guestfs-actions.pod:224
24557 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
24558 " const char *filename,\n"
24559 " const struct guestfs_add_drive_opts_argv *optargs);\n"
24564 #: ../src/guestfs-actions.pod:229
24565 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
24569 #: ../src/guestfs-actions.pod:233
24570 msgid "guestfs_add_drive_ro"
24574 #: ../src/guestfs-actions.pod:235
24578 " guestfs_add_drive_ro (guestfs_h *g,\n"
24579 " const char *filename);\n"
24584 #: ../src/guestfs-actions.pod:239
24586 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
24587 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
24588 "disk is added read-only, with the format being detected automatically."
24592 #: ../src/guestfs-actions.pod:246
24593 msgid "(Added in 1.0.38)"
24597 #: ../src/guestfs-actions.pod:248
24598 msgid "guestfs_add_drive_ro_with_if"
24602 #: ../src/guestfs-actions.pod:250
24606 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
24607 " const char *filename,\n"
24608 " const char *iface);\n"
24613 #: ../src/guestfs-actions.pod:262
24615 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
24616 "QEMU interface emulation to use at run time."
24620 #: ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:288
24621 #: ../src/guestfs-actions.pod:2586
24622 msgid "(Added in 1.0.84)"
24626 #: ../src/guestfs-actions.pod:269
24627 msgid "guestfs_add_drive_with_if"
24631 #: ../src/guestfs-actions.pod:271
24635 " guestfs_add_drive_with_if (guestfs_h *g,\n"
24636 " const char *filename,\n"
24637 " const char *iface);\n"
24642 #: ../src/guestfs-actions.pod:283
24644 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
24645 "QEMU interface emulation to use at run time."
24649 #: ../src/guestfs-actions.pod:290
24650 msgid "guestfs_aug_clear"
24654 #: ../src/guestfs-actions.pod:292
24658 " guestfs_aug_clear (guestfs_h *g,\n"
24659 " const char *augpath);\n"
24664 #: ../src/guestfs-actions.pod:301 ../src/guestfs-actions.pod:2314
24665 msgid "(Added in 1.3.4)"
24669 #: ../src/guestfs-actions.pod:303
24670 msgid "guestfs_aug_close"
24674 #: ../src/guestfs-actions.pod:305
24678 " guestfs_aug_close (guestfs_h *g);\n"
24683 #: ../src/guestfs-actions.pod:308
24685 "Close the current Augeas handle and free up any resources used by it. After "
24686 "calling this, you have to call C<guestfs_aug_init> again before you can use "
24687 "any other Augeas functions."
24691 #: ../src/guestfs-actions.pod:315 ../src/guestfs-actions.pod:340
24692 #: ../src/guestfs-actions.pod:358 ../src/guestfs-actions.pod:372
24693 #: ../src/guestfs-actions.pod:435 ../src/guestfs-actions.pod:455
24694 #: ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:500
24695 #: ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:528
24696 #: ../src/guestfs-actions.pod:542 ../src/guestfs-actions.pod:560
24697 #: ../src/guestfs-actions.pod:6008
24698 msgid "(Added in 0.7)"
24702 #: ../src/guestfs-actions.pod:317
24703 msgid "guestfs_aug_defnode"
24707 #: ../src/guestfs-actions.pod:319
24710 " struct guestfs_int_bool *\n"
24711 " guestfs_aug_defnode (guestfs_h *g,\n"
24712 " const char *name,\n"
24713 " const char *expr,\n"
24714 " const char *val);\n"
24719 #: ../src/guestfs-actions.pod:328
24721 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24722 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
24723 "containing that single node."
24727 #: ../src/guestfs-actions.pod:336
24729 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
24730 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
24734 #: ../src/guestfs-actions.pod:342
24735 msgid "guestfs_aug_defvar"
24739 #: ../src/guestfs-actions.pod:344
24743 " guestfs_aug_defvar (guestfs_h *g,\n"
24744 " const char *name,\n"
24745 " const char *expr);\n"
24750 #: ../src/guestfs-actions.pod:360
24751 msgid "guestfs_aug_get"
24755 #: ../src/guestfs-actions.pod:362
24759 " guestfs_aug_get (guestfs_h *g,\n"
24760 " const char *augpath);\n"
24765 #: ../src/guestfs-actions.pod:369 ../src/guestfs-actions.pod:933
24766 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1011
24767 #: ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1130
24768 #: ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1388
24769 #: ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1541
24770 #: ../src/guestfs-actions.pod:1729 ../src/guestfs-actions.pod:1841
24771 #: ../src/guestfs-actions.pod:2004 ../src/guestfs-actions.pod:2021
24772 #: ../src/guestfs-actions.pod:2088 ../src/guestfs-actions.pod:2131
24773 #: ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:2337
24774 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2755
24775 #: ../src/guestfs-actions.pod:2857 ../src/guestfs-actions.pod:2961
24776 #: ../src/guestfs-actions.pod:2980 ../src/guestfs-actions.pod:3195
24777 #: ../src/guestfs-actions.pod:3223 ../src/guestfs-actions.pod:3244
24778 #: ../src/guestfs-actions.pod:3278 ../src/guestfs-actions.pod:3341
24779 #: ../src/guestfs-actions.pod:3361 ../src/guestfs-actions.pod:3381
24780 #: ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4361
24781 #: ../src/guestfs-actions.pod:4531 ../src/guestfs-actions.pod:4641
24782 #: ../src/guestfs-actions.pod:5537 ../src/guestfs-actions.pod:5736
24783 #: ../src/guestfs-actions.pod:5906 ../src/guestfs-actions.pod:6084
24784 #: ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6805
24785 #: ../src/guestfs-actions.pod:6821 ../src/guestfs-actions.pod:6845
24786 #: ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:7543
24787 #: ../src/guestfs-actions.pod:7562 ../src/guestfs-actions.pod:7580
24788 #: ../src/guestfs-actions.pod:7754 ../src/guestfs-actions.pod:8071
24790 "This function returns a string, or NULL on error. I<The caller must free "
24791 "the returned string after use>."
24795 #: ../src/guestfs-actions.pod:374
24796 msgid "guestfs_aug_init"
24800 #: ../src/guestfs-actions.pod:376
24804 " guestfs_aug_init (guestfs_h *g,\n"
24805 " const char *root,\n"
24811 #: ../src/guestfs-actions.pod:385
24812 msgid "You must call this before using any other C<guestfs_aug_*> commands."
24816 #: ../src/guestfs-actions.pod:410
24818 "This option is only useful when debugging Augeas lenses. Use of this option "
24819 "may require additional memory for the libguestfs appliance. You may need to "
24820 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
24821 "C<guestfs_set_memsize>."
24825 #: ../src/guestfs-actions.pod:425
24826 msgid "Do not load the tree in C<guestfs_aug_init>."
24830 #: ../src/guestfs-actions.pod:429
24831 msgid "To close the handle, you can call C<guestfs_aug_close>."
24835 #: ../src/guestfs-actions.pod:437
24836 msgid "guestfs_aug_insert"
24840 #: ../src/guestfs-actions.pod:439
24844 " guestfs_aug_insert (guestfs_h *g,\n"
24845 " const char *augpath,\n"
24846 " const char *label,\n"
24852 #: ../src/guestfs-actions.pod:457
24853 msgid "guestfs_aug_load"
24857 #: ../src/guestfs-actions.pod:459
24861 " guestfs_aug_load (guestfs_h *g);\n"
24866 #: ../src/guestfs-actions.pod:471
24867 msgid "guestfs_aug_ls"
24871 #: ../src/guestfs-actions.pod:473
24875 " guestfs_aug_ls (guestfs_h *g,\n"
24876 " const char *augpath);\n"
24881 #: ../src/guestfs-actions.pod:477
24883 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24884 "sorting the resulting nodes into alphabetical order."
24888 #: ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:496
24889 #: ../src/guestfs-actions.pod:642 ../src/guestfs-actions.pod:1149
24890 #: ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1575
24891 #: ../src/guestfs-actions.pod:1678 ../src/guestfs-actions.pod:1697
24892 #: ../src/guestfs-actions.pod:1943 ../src/guestfs-actions.pod:2409
24893 #: ../src/guestfs-actions.pod:2425 ../src/guestfs-actions.pod:2444
24894 #: ../src/guestfs-actions.pod:2509 ../src/guestfs-actions.pod:2533
24895 #: ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2653
24896 #: ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:3297
24897 #: ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3891
24898 #: ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3928
24899 #: ../src/guestfs-actions.pod:3990 ../src/guestfs-actions.pod:4095
24900 #: ../src/guestfs-actions.pod:4503 ../src/guestfs-actions.pod:5260
24901 #: ../src/guestfs-actions.pod:5878 ../src/guestfs-actions.pod:6004
24902 #: ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6885
24903 #: ../src/guestfs-actions.pod:6946 ../src/guestfs-actions.pod:7001
24904 #: ../src/guestfs-actions.pod:7147 ../src/guestfs-actions.pod:7171
24905 #: ../src/guestfs-actions.pod:7647 ../src/guestfs-actions.pod:7667
24906 #: ../src/guestfs-actions.pod:7714 ../src/guestfs-actions.pod:7908
24907 #: ../src/guestfs-actions.pod:7927 ../src/guestfs-actions.pod:8021
24908 #: ../src/guestfs-actions.pod:8040 ../src/guestfs-actions.pod:8086
24909 #: ../src/guestfs-actions.pod:8105
24911 "This function returns a NULL-terminated array of strings (like L<environ(3)"
24912 ">), or NULL if there was an error. I<The caller must free the strings and "
24913 "the array after use>."
24917 #: ../src/guestfs-actions.pod:484 ../src/guestfs-actions.pod:1074
24918 #: ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1613
24919 #: ../src/guestfs-actions.pod:3655 ../src/guestfs-actions.pod:3686
24920 #: ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4394
24921 #: ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4614
24922 #: ../src/guestfs-actions.pod:4777 ../src/guestfs-actions.pod:5264
24923 #: ../src/guestfs-actions.pod:5819 ../src/guestfs-actions.pod:6216
24924 #: ../src/guestfs-actions.pod:6230 ../src/guestfs-actions.pod:6242
24925 #: ../src/guestfs-actions.pod:6726 ../src/guestfs-actions.pod:7385
24926 #: ../src/guestfs-actions.pod:7398 ../src/guestfs-actions.pod:7631
24927 #: ../src/guestfs-actions.pod:7896
24928 msgid "(Added in 0.8)"
24932 #: ../src/guestfs-actions.pod:486
24933 msgid "guestfs_aug_match"
24937 #: ../src/guestfs-actions.pod:488
24941 " guestfs_aug_match (guestfs_h *g,\n"
24942 " const char *augpath);\n"
24947 #: ../src/guestfs-actions.pod:502
24948 msgid "guestfs_aug_mv"
24952 #: ../src/guestfs-actions.pod:504
24956 " guestfs_aug_mv (guestfs_h *g,\n"
24957 " const char *src,\n"
24958 " const char *dest);\n"
24963 #: ../src/guestfs-actions.pod:516
24964 msgid "guestfs_aug_rm"
24968 #: ../src/guestfs-actions.pod:518
24972 " guestfs_aug_rm (guestfs_h *g,\n"
24973 " const char *augpath);\n"
24978 #: ../src/guestfs-actions.pod:530
24979 msgid "guestfs_aug_save"
24983 #: ../src/guestfs-actions.pod:532
24987 " guestfs_aug_save (guestfs_h *g);\n"
24992 #: ../src/guestfs-actions.pod:537
24994 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24999 #: ../src/guestfs-actions.pod:544
25000 msgid "guestfs_aug_set"
25004 #: ../src/guestfs-actions.pod:546
25008 " guestfs_aug_set (guestfs_h *g,\n"
25009 " const char *augpath,\n"
25010 " const char *val);\n"
25015 #: ../src/guestfs-actions.pod:553
25017 "In the Augeas API, it is possible to clear a node by setting the value to "
25018 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
25019 "this call. Instead you must use the C<guestfs_aug_clear> call."
25023 #: ../src/guestfs-actions.pod:562
25024 msgid "guestfs_available"
25028 #: ../src/guestfs-actions.pod:564
25032 " guestfs_available (guestfs_h *g,\n"
25033 " char *const *groups);\n"
25038 #: ../src/guestfs-actions.pod:572
25040 "The libguestfs groups, and the functions that those groups correspond to, "
25041 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
25042 "runtime by calling C<guestfs_available_all_groups>."
25046 #: ../src/guestfs-actions.pod:596
25047 msgid "You must call C<guestfs_launch> before calling this function."
25051 #: ../src/guestfs-actions.pod:618
25053 "This call was added in version C<1.0.80>. In previous versions of "
25054 "libguestfs all you could do would be to speculatively execute a command to "
25055 "find out if the daemon implemented it. See also C<guestfs_version>."
25059 #: ../src/guestfs-actions.pod:627 ../src/guestfs-actions.pod:1358
25060 msgid "(Added in 1.0.80)"
25064 #: ../src/guestfs-actions.pod:629
25065 msgid "guestfs_available_all_groups"
25069 #: ../src/guestfs-actions.pod:631
25073 " guestfs_available_all_groups (guestfs_h *g);\n"
25078 #: ../src/guestfs-actions.pod:634
25080 "This command returns a list of all optional groups that this daemon knows "
25081 "about. Note this returns both supported and unsupported groups. To find "
25082 "out which ones the daemon can actually support you have to call "
25083 "C<guestfs_available> on each member of the returned list."
25087 #: ../src/guestfs-actions.pod:640
25088 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
25092 #: ../src/guestfs-actions.pod:646
25093 msgid "(Added in 1.3.15)"
25097 #: ../src/guestfs-actions.pod:648
25098 msgid "guestfs_base64_in"
25102 #: ../src/guestfs-actions.pod:650
25106 " guestfs_base64_in (guestfs_h *g,\n"
25107 " const char *base64file,\n"
25108 " const char *filename);\n"
25113 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:674
25114 msgid "(Added in 1.3.5)"
25118 #: ../src/guestfs-actions.pod:662
25119 msgid "guestfs_base64_out"
25123 #: ../src/guestfs-actions.pod:664
25127 " guestfs_base64_out (guestfs_h *g,\n"
25128 " const char *filename,\n"
25129 " const char *base64file);\n"
25134 #: ../src/guestfs-actions.pod:676
25135 msgid "guestfs_blockdev_flushbufs"
25139 #: ../src/guestfs-actions.pod:678
25143 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
25144 " const char *device);\n"
25149 #: ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:706
25150 #: ../src/guestfs-actions.pod:721 ../src/guestfs-actions.pod:737
25151 #: ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:774
25152 #: ../src/guestfs-actions.pod:788 ../src/guestfs-actions.pod:806
25153 #: ../src/guestfs-actions.pod:820 ../src/guestfs-actions.pod:834
25154 msgid "(Added in 0.9.3)"
25158 #: ../src/guestfs-actions.pod:691
25159 msgid "guestfs_blockdev_getbsz"
25163 #: ../src/guestfs-actions.pod:693
25167 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
25168 " const char *device);\n"
25173 #: ../src/guestfs-actions.pod:708
25174 msgid "guestfs_blockdev_getro"
25178 #: ../src/guestfs-actions.pod:710
25182 " guestfs_blockdev_getro (guestfs_h *g,\n"
25183 " const char *device);\n"
25188 #: ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:1596
25189 #: ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:2100
25190 #: ../src/guestfs-actions.pod:2111 ../src/guestfs-actions.pod:2183
25191 #: ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2249
25192 #: ../src/guestfs-actions.pod:2264 ../src/guestfs-actions.pod:2300
25193 #: ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:3398
25194 #: ../src/guestfs-actions.pod:3414 ../src/guestfs-actions.pod:3432
25195 #: ../src/guestfs-actions.pod:3594 ../src/guestfs-actions.pod:3608
25196 #: ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3637
25197 #: ../src/guestfs-actions.pod:3653 ../src/guestfs-actions.pod:3668
25198 #: ../src/guestfs-actions.pod:3684 ../src/guestfs-actions.pod:3698
25199 #: ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3725
25200 #: ../src/guestfs-actions.pod:3740 ../src/guestfs-actions.pod:3755
25201 #: ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:3782
25202 #: ../src/guestfs-actions.pod:5501
25203 msgid "This function returns a C truth value on success or -1 on error."
25207 #: ../src/guestfs-actions.pod:723
25208 msgid "guestfs_blockdev_getsize64"
25212 #: ../src/guestfs-actions.pod:725
25216 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
25217 " const char *device);\n"
25222 #: ../src/guestfs-actions.pod:731
25223 msgid "See also C<guestfs_blockdev_getsz>."
25227 #: ../src/guestfs-actions.pod:739
25228 msgid "guestfs_blockdev_getss"
25232 #: ../src/guestfs-actions.pod:741
25236 " guestfs_blockdev_getss (guestfs_h *g,\n"
25237 " const char *device);\n"
25242 #: ../src/guestfs-actions.pod:748
25244 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
25249 #: ../src/guestfs-actions.pod:757
25250 msgid "guestfs_blockdev_getsz"
25254 #: ../src/guestfs-actions.pod:759
25258 " guestfs_blockdev_getsz (guestfs_h *g,\n"
25259 " const char *device);\n"
25264 #: ../src/guestfs-actions.pod:766
25266 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
25267 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
25271 #: ../src/guestfs-actions.pod:776
25272 msgid "guestfs_blockdev_rereadpt"
25276 #: ../src/guestfs-actions.pod:778
25280 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
25281 " const char *device);\n"
25286 #: ../src/guestfs-actions.pod:790
25287 msgid "guestfs_blockdev_setbsz"
25291 #: ../src/guestfs-actions.pod:792
25295 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
25296 " const char *device,\n"
25297 " int blocksize);\n"
25302 #: ../src/guestfs-actions.pod:808
25303 msgid "guestfs_blockdev_setro"
25307 #: ../src/guestfs-actions.pod:810
25311 " guestfs_blockdev_setro (guestfs_h *g,\n"
25312 " const char *device);\n"
25317 #: ../src/guestfs-actions.pod:822
25318 msgid "guestfs_blockdev_setrw"
25322 #: ../src/guestfs-actions.pod:824
25326 " guestfs_blockdev_setrw (guestfs_h *g,\n"
25327 " const char *device);\n"
25332 #: ../src/guestfs-actions.pod:836
25333 msgid "guestfs_btrfs_filesystem_resize"
25337 #: ../src/guestfs-actions.pod:838
25341 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
25342 " const char *mountpoint,\n"
25348 #: ../src/guestfs-actions.pod:848
25351 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
25356 #: ../src/guestfs-actions.pod:871
25357 msgid "(Added in 1.11.17)"
25361 #: ../src/guestfs-actions.pod:873
25362 msgid "guestfs_btrfs_filesystem_resize_va"
25366 #: ../src/guestfs-actions.pod:875
25370 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
25371 " const char *mountpoint,\n"
25372 " va_list args);\n"
25377 #: ../src/guestfs-actions.pod:880
25378 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
25382 #: ../src/guestfs-actions.pod:884
25383 msgid "guestfs_btrfs_filesystem_resize_argv"
25387 #: ../src/guestfs-actions.pod:886
25391 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
25392 " const char *mountpoint,\n"
25393 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
25398 #: ../src/guestfs-actions.pod:891
25399 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
25403 #: ../src/guestfs-actions.pod:895
25404 msgid "guestfs_case_sensitive_path"
25408 #: ../src/guestfs-actions.pod:897
25412 " guestfs_case_sensitive_path (guestfs_h *g,\n"
25413 " const char *path);\n"
25418 #: ../src/guestfs-actions.pod:923
25420 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
25421 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
25422 "how the directories were originally created under Windows)."
25426 #: ../src/guestfs-actions.pod:931
25427 msgid "See also C<guestfs_realpath>."
25431 #: ../src/guestfs-actions.pod:936 ../src/guestfs-actions.pod:7565
25432 msgid "(Added in 1.0.75)"
25436 #: ../src/guestfs-actions.pod:938
25437 msgid "guestfs_cat"
25441 #: ../src/guestfs-actions.pod:940
25445 " guestfs_cat (guestfs_h *g,\n"
25446 " const char *path);\n"
25451 #: ../src/guestfs-actions.pod:946
25453 "Note that this function cannot correctly handle binary files (specifically, "
25454 "files containing C<\\0> character which is treated as end of string). For "
25455 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
25456 "functions which have a more complex interface."
25460 #: ../src/guestfs-actions.pod:957 ../src/guestfs-actions.pod:3912
25461 #: ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4011
25462 #: ../src/guestfs-actions.pod:4099 ../src/guestfs-actions.pod:4507
25463 #: ../src/guestfs-actions.pod:4521 ../src/guestfs-actions.pod:5882
25464 #: ../src/guestfs-actions.pod:5896 ../src/guestfs-actions.pod:7718
25465 #: ../src/guestfs-actions.pod:7732
25466 msgid "(Added in 0.4)"
25470 #: ../src/guestfs-actions.pod:959
25471 msgid "guestfs_checksum"
25475 #: ../src/guestfs-actions.pod:961
25479 " guestfs_checksum (guestfs_h *g,\n"
25480 " const char *csumtype,\n"
25481 " const char *path);\n"
25486 #: ../src/guestfs-actions.pod:1007
25487 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
25491 #: ../src/guestfs-actions.pod:1009
25492 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
25496 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1433
25497 #: ../src/guestfs-actions.pod:2291 ../src/guestfs-actions.pod:3610
25498 #: ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3700
25499 #: ../src/guestfs-actions.pod:3727 ../src/guestfs-actions.pod:7421
25500 msgid "(Added in 1.0.2)"
25504 #: ../src/guestfs-actions.pod:1016
25505 msgid "guestfs_checksum_device"
25509 #: ../src/guestfs-actions.pod:1018
25513 " guestfs_checksum_device (guestfs_h *g,\n"
25514 " const char *csumtype,\n"
25515 " const char *device);\n"
25520 #: ../src/guestfs-actions.pod:1023
25522 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
25523 "device named C<device>. For the types of checksums supported see the "
25524 "C<guestfs_checksum> command."
25528 #: ../src/guestfs-actions.pod:1030 ../src/guestfs-actions.pod:5331
25529 #: ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5503
25530 #: ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5703
25531 #: ../src/guestfs-actions.pod:7330 ../src/guestfs-actions.pod:7344
25532 #: ../src/guestfs-actions.pod:7744
25533 msgid "(Added in 1.3.2)"
25537 #: ../src/guestfs-actions.pod:1032
25538 msgid "guestfs_checksums_out"
25542 #: ../src/guestfs-actions.pod:1034
25546 " guestfs_checksums_out (guestfs_h *g,\n"
25547 " const char *csumtype,\n"
25548 " const char *directory,\n"
25549 " const char *sumsfile);\n"
25554 #: ../src/guestfs-actions.pod:1054
25555 msgid "(Added in 1.3.7)"
25559 #: ../src/guestfs-actions.pod:1056
25560 msgid "guestfs_chmod"
25564 #: ../src/guestfs-actions.pod:1058
25568 " guestfs_chmod (guestfs_h *g,\n"
25570 " const char *path);\n"
25575 #: ../src/guestfs-actions.pod:1076
25576 msgid "guestfs_chown"
25580 #: ../src/guestfs-actions.pod:1078
25584 " guestfs_chown (guestfs_h *g,\n"
25587 " const char *path);\n"
25592 #: ../src/guestfs-actions.pod:1094
25593 msgid "guestfs_command"
25597 #: ../src/guestfs-actions.pod:1096
25601 " guestfs_command (guestfs_h *g,\n"
25602 " char *const *arguments);\n"
25607 #: ../src/guestfs-actions.pod:1105
25609 "The single parameter is an argv-style list of arguments. The first element "
25610 "is the name of the program to run. Subsequent elements are parameters. The "
25611 "list must be non-empty (ie. must contain a program name). Note that the "
25612 "command runs directly, and is I<not> invoked via the shell (see "
25617 #: ../src/guestfs-actions.pod:1136 ../src/guestfs-actions.pod:1156
25618 #: ../src/guestfs-actions.pod:1732
25619 msgid "(Added in 0.9.1)"
25623 #: ../src/guestfs-actions.pod:1138
25624 msgid "guestfs_command_lines"
25628 #: ../src/guestfs-actions.pod:1140
25632 " guestfs_command_lines (guestfs_h *g,\n"
25633 " char *const *arguments);\n"
25638 #: ../src/guestfs-actions.pod:1144
25640 "This is the same as C<guestfs_command>, but splits the result into a list of "
25645 #: ../src/guestfs-actions.pod:1147
25646 msgid "See also: C<guestfs_sh_lines>"
25650 #: ../src/guestfs-actions.pod:1158
25651 msgid "guestfs_compress_device_out"
25655 #: ../src/guestfs-actions.pod:1160
25659 " guestfs_compress_device_out (guestfs_h *g,\n"
25660 " const char *ctype,\n"
25661 " const char *device,\n"
25662 " const char *zdevice,\n"
25668 #: ../src/guestfs-actions.pod:1172
25671 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
25676 #: ../src/guestfs-actions.pod:1177
25678 "The C<ctype> and optional C<level> parameters have the same meaning as in "
25679 "C<guestfs_compress_out>."
25683 #: ../src/guestfs-actions.pod:1182 ../src/guestfs-actions.pod:1241
25684 #: ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:6602
25685 msgid "(Added in 1.13.15)"
25689 #: ../src/guestfs-actions.pod:1184
25690 msgid "guestfs_compress_device_out_va"
25694 #: ../src/guestfs-actions.pod:1186
25698 " guestfs_compress_device_out_va (guestfs_h *g,\n"
25699 " const char *ctype,\n"
25700 " const char *device,\n"
25701 " const char *zdevice,\n"
25702 " va_list args);\n"
25707 #: ../src/guestfs-actions.pod:1193
25708 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
25712 #: ../src/guestfs-actions.pod:1197
25713 msgid "guestfs_compress_device_out_argv"
25717 #: ../src/guestfs-actions.pod:1199
25721 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
25722 " const char *ctype,\n"
25723 " const char *device,\n"
25724 " const char *zdevice,\n"
25725 " const struct guestfs_compress_device_out_argv *optargs);\n"
25730 #: ../src/guestfs-actions.pod:1206
25731 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
25735 #: ../src/guestfs-actions.pod:1210
25736 msgid "guestfs_compress_out"
25740 #: ../src/guestfs-actions.pod:1212
25744 " guestfs_compress_out (guestfs_h *g,\n"
25745 " const char *ctype,\n"
25746 " const char *file,\n"
25747 " const char *zfile,\n"
25753 #: ../src/guestfs-actions.pod:1224
25756 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
25761 #: ../src/guestfs-actions.pod:1243
25762 msgid "guestfs_compress_out_va"
25766 #: ../src/guestfs-actions.pod:1245
25770 " guestfs_compress_out_va (guestfs_h *g,\n"
25771 " const char *ctype,\n"
25772 " const char *file,\n"
25773 " const char *zfile,\n"
25774 " va_list args);\n"
25779 #: ../src/guestfs-actions.pod:1252
25780 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
25784 #: ../src/guestfs-actions.pod:1256
25785 msgid "guestfs_compress_out_argv"
25789 #: ../src/guestfs-actions.pod:1258
25793 " guestfs_compress_out_argv (guestfs_h *g,\n"
25794 " const char *ctype,\n"
25795 " const char *file,\n"
25796 " const char *zfile,\n"
25797 " const struct guestfs_compress_out_argv *optargs);\n"
25802 #: ../src/guestfs-actions.pod:1265
25803 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
25807 #: ../src/guestfs-actions.pod:1269
25808 msgid "guestfs_config"
25812 #: ../src/guestfs-actions.pod:1271
25816 " guestfs_config (guestfs_h *g,\n"
25817 " const char *qemuparam,\n"
25818 " const char *qemuvalue);\n"
25823 #: ../src/guestfs-actions.pod:1289
25824 msgid "guestfs_copy_size"
25828 #: ../src/guestfs-actions.pod:1291
25832 " guestfs_copy_size (guestfs_h *g,\n"
25833 " const char *src,\n"
25834 " const char *dest,\n"
25835 " int64_t size);\n"
25840 #: ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:1428
25841 #: ../src/guestfs-actions.pod:1459 ../src/guestfs-actions.pod:1504
25842 #: ../src/guestfs-actions.pod:1881 ../src/guestfs-actions.pod:1903
25843 #: ../src/guestfs-actions.pod:3810 ../src/guestfs-actions.pod:7416
25844 #: ../src/guestfs-actions.pod:7450 ../src/guestfs-actions.pod:7957
25845 #: ../src/guestfs-actions.pod:7980
25847 "This long-running command can generate progress notification messages so "
25848 "that the caller can display a progress bar or indicator. To receive these "
25849 "messages, the caller must register a progress event callback. See L<guestfs"
25850 "(3)/GUESTFS_EVENT_PROGRESS>."
25854 #: ../src/guestfs-actions.pod:1310 ../src/guestfs-actions.pod:4534
25855 #: ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:7651
25856 #: ../src/guestfs-actions.pod:7671 ../src/guestfs-actions.pod:7757
25857 msgid "(Added in 1.0.87)"
25861 #: ../src/guestfs-actions.pod:1312
25866 #: ../src/guestfs-actions.pod:1314
25870 " guestfs_cp (guestfs_h *g,\n"
25871 " const char *src,\n"
25872 " const char *dest);\n"
25877 #: ../src/guestfs-actions.pod:1324 ../src/guestfs-actions.pod:1338
25878 #: ../src/guestfs-actions.pod:1410 ../src/guestfs-actions.pod:1484
25879 #: ../src/guestfs-actions.pod:1598 ../src/guestfs-actions.pod:5278
25880 #: ../src/guestfs-actions.pod:5753
25881 msgid "(Added in 1.0.18)"
25885 #: ../src/guestfs-actions.pod:1326
25886 msgid "guestfs_cp_a"
25890 #: ../src/guestfs-actions.pod:1328
25894 " guestfs_cp_a (guestfs_h *g,\n"
25895 " const char *src,\n"
25896 " const char *dest);\n"
25901 #: ../src/guestfs-actions.pod:1340
25906 #: ../src/guestfs-actions.pod:1342
25910 " guestfs_dd (guestfs_h *g,\n"
25911 " const char *src,\n"
25912 " const char *dest);\n"
25917 #: ../src/guestfs-actions.pod:1352
25919 "If the destination is a device, it must be as large or larger than the "
25920 "source file or device, otherwise the copy will fail. This command cannot do "
25921 "partial copies (see C<guestfs_copy_size>)."
25925 #: ../src/guestfs-actions.pod:1360
25930 #: ../src/guestfs-actions.pod:1362
25934 " guestfs_df (guestfs_h *g);\n"
25939 #: ../src/guestfs-actions.pod:1367 ../src/guestfs-actions.pod:1384
25941 "This command is mostly useful for interactive sessions. It is I<not> "
25942 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
25947 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1391
25948 #: ../src/guestfs-actions.pod:1509 ../src/guestfs-actions.pod:2516
25949 #: ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2608
25950 #: ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:5178
25951 #: ../src/guestfs-actions.pod:7154 ../src/guestfs-actions.pod:7178
25952 #: ../src/guestfs-actions.pod:7797 ../src/guestfs-actions.pod:7810
25953 #: ../src/guestfs-actions.pod:7823
25954 msgid "(Added in 1.0.54)"
25958 #: ../src/guestfs-actions.pod:1376
25959 msgid "guestfs_df_h"
25963 #: ../src/guestfs-actions.pod:1378
25967 " guestfs_df_h (guestfs_h *g);\n"
25972 #: ../src/guestfs-actions.pod:1393
25973 msgid "guestfs_dmesg"
25977 #: ../src/guestfs-actions.pod:1395
25981 " guestfs_dmesg (guestfs_h *g);\n"
25986 #: ../src/guestfs-actions.pod:1402
25988 "Another way to get the same information is to enable verbose messages with "
25989 "C<guestfs_set_verbose> or by setting the environment variable "
25990 "C<LIBGUESTFS_DEBUG=1> before running the program."
25994 #: ../src/guestfs-actions.pod:1412
25995 msgid "guestfs_download"
25999 #: ../src/guestfs-actions.pod:1414
26003 " guestfs_download (guestfs_h *g,\n"
26004 " const char *remotefilename,\n"
26005 " const char *filename);\n"
26010 #: ../src/guestfs-actions.pod:1424
26011 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
26015 #: ../src/guestfs-actions.pod:1435
26016 msgid "guestfs_download_offset"
26020 #: ../src/guestfs-actions.pod:1437
26024 " guestfs_download_offset (guestfs_h *g,\n"
26025 " const char *remotefilename,\n"
26026 " const char *filename,\n"
26027 " int64_t offset,\n"
26028 " int64_t size);\n"
26033 #: ../src/guestfs-actions.pod:1450
26035 "Note that there is no limit on the amount of data that can be downloaded "
26036 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
26037 "full amount unless an error occurs."
26041 #: ../src/guestfs-actions.pod:1455
26042 msgid "See also C<guestfs_download>, C<guestfs_pread>."
26046 #: ../src/guestfs-actions.pod:1464 ../src/guestfs-actions.pod:7455
26047 msgid "(Added in 1.5.17)"
26051 #: ../src/guestfs-actions.pod:1466
26052 msgid "guestfs_drop_caches"
26056 #: ../src/guestfs-actions.pod:1468
26060 " guestfs_drop_caches (guestfs_h *g,\n"
26061 " int whattodrop);\n"
26066 #: ../src/guestfs-actions.pod:1486
26071 #: ../src/guestfs-actions.pod:1488
26075 " guestfs_du (guestfs_h *g,\n"
26076 " const char *path);\n"
26081 #: ../src/guestfs-actions.pod:1511
26082 msgid "guestfs_e2fsck_f"
26086 #: ../src/guestfs-actions.pod:1513
26090 " guestfs_e2fsck_f (guestfs_h *g,\n"
26091 " const char *device);\n"
26096 #: ../src/guestfs-actions.pod:1521
26098 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
26099 "Normally you should use C<guestfs_fsck>."
26103 #: ../src/guestfs-actions.pod:1526
26104 msgid "(Added in 1.0.29)"
26108 #: ../src/guestfs-actions.pod:1528
26109 msgid "guestfs_echo_daemon"
26113 #: ../src/guestfs-actions.pod:1530
26117 " guestfs_echo_daemon (guestfs_h *g,\n"
26118 " char *const *words);\n"
26123 #: ../src/guestfs-actions.pod:1539
26124 msgid "See also C<guestfs_ping_daemon>."
26128 #: ../src/guestfs-actions.pod:1544 ../src/guestfs-actions.pod:2302
26129 #: ../src/guestfs-actions.pod:6626
26130 msgid "(Added in 1.0.69)"
26134 #: ../src/guestfs-actions.pod:1546
26135 msgid "guestfs_egrep"
26139 #: ../src/guestfs-actions.pod:1548
26143 " guestfs_egrep (guestfs_h *g,\n"
26144 " const char *regex,\n"
26145 " const char *path);\n"
26150 #: ../src/guestfs-actions.pod:1563 ../src/guestfs-actions.pod:1582
26151 #: ../src/guestfs-actions.pod:1639 ../src/guestfs-actions.pod:1685
26152 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:2432
26153 #: ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:2629
26154 #: ../src/guestfs-actions.pod:2642 ../src/guestfs-actions.pod:2657
26155 #: ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2725
26156 #: ../src/guestfs-actions.pod:2738 ../src/guestfs-actions.pod:4024
26157 #: ../src/guestfs-actions.pod:4038 ../src/guestfs-actions.pod:4051
26158 #: ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:5066
26159 #: ../src/guestfs-actions.pod:6087 ../src/guestfs-actions.pod:6136
26160 #: ../src/guestfs-actions.pod:7022 ../src/guestfs-actions.pod:7034
26161 #: ../src/guestfs-actions.pod:7047 ../src/guestfs-actions.pod:7060
26162 #: ../src/guestfs-actions.pod:7082 ../src/guestfs-actions.pod:7095
26163 #: ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7121
26164 #: ../src/guestfs-actions.pod:7915 ../src/guestfs-actions.pod:7934
26165 #: ../src/guestfs-actions.pod:8028 ../src/guestfs-actions.pod:8047
26166 #: ../src/guestfs-actions.pod:8093 ../src/guestfs-actions.pod:8112
26167 msgid "(Added in 1.0.66)"
26171 #: ../src/guestfs-actions.pod:1565
26172 msgid "guestfs_egrepi"
26176 #: ../src/guestfs-actions.pod:1567
26180 " guestfs_egrepi (guestfs_h *g,\n"
26181 " const char *regex,\n"
26182 " const char *path);\n"
26187 #: ../src/guestfs-actions.pod:1584
26188 msgid "guestfs_equal"
26192 #: ../src/guestfs-actions.pod:1586
26196 " guestfs_equal (guestfs_h *g,\n"
26197 " const char *file1,\n"
26198 " const char *file2);\n"
26203 #: ../src/guestfs-actions.pod:1600
26204 msgid "guestfs_exists"
26208 #: ../src/guestfs-actions.pod:1602
26212 " guestfs_exists (guestfs_h *g,\n"
26213 " const char *path);\n"
26218 #: ../src/guestfs-actions.pod:1609
26219 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
26223 #: ../src/guestfs-actions.pod:1615
26224 msgid "guestfs_fallocate"
26228 #: ../src/guestfs-actions.pod:1617
26232 " guestfs_fallocate (guestfs_h *g,\n"
26233 " const char *path,\n"
26239 #: ../src/guestfs-actions.pod:1622
26241 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
26246 #: ../src/guestfs-actions.pod:1641
26247 msgid "guestfs_fallocate64"
26251 #: ../src/guestfs-actions.pod:1643
26255 " guestfs_fallocate64 (guestfs_h *g,\n"
26256 " const char *path,\n"
26262 #: ../src/guestfs-actions.pod:1652
26264 "Note that this call allocates disk blocks for the file. To create a sparse "
26265 "file use C<guestfs_truncate_size> instead."
26269 #: ../src/guestfs-actions.pod:1655
26271 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
26272 "oversight it only allowed 30 bit lengths to be specified, effectively "
26273 "limiting the maximum size of files created through that call to 1GB."
26277 #: ../src/guestfs-actions.pod:1666
26278 msgid "(Added in 1.3.17)"
26282 #: ../src/guestfs-actions.pod:1668
26283 msgid "guestfs_fgrep"
26287 #: ../src/guestfs-actions.pod:1670
26291 " guestfs_fgrep (guestfs_h *g,\n"
26292 " const char *pattern,\n"
26293 " const char *path);\n"
26298 #: ../src/guestfs-actions.pod:1687
26299 msgid "guestfs_fgrepi"
26303 #: ../src/guestfs-actions.pod:1689
26307 " guestfs_fgrepi (guestfs_h *g,\n"
26308 " const char *pattern,\n"
26309 " const char *path);\n"
26314 #: ../src/guestfs-actions.pod:1706
26315 msgid "guestfs_file"
26319 #: ../src/guestfs-actions.pod:1708
26323 " guestfs_file (guestfs_h *g,\n"
26324 " const char *path);\n"
26329 #: ../src/guestfs-actions.pod:1726
26331 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
26332 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
26336 #: ../src/guestfs-actions.pod:1734
26337 msgid "guestfs_file_architecture"
26341 #: ../src/guestfs-actions.pod:1736
26345 " guestfs_file_architecture (guestfs_h *g,\n"
26346 " const char *filename);\n"
26351 #: ../src/guestfs-actions.pod:1844 ../src/guestfs-actions.pod:2007
26352 #: ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2758
26353 #: ../src/guestfs-actions.pod:2860 ../src/guestfs-actions.pod:2926
26354 #: ../src/guestfs-actions.pod:3113 ../src/guestfs-actions.pod:3131
26355 #: ../src/guestfs-actions.pod:3171 ../src/guestfs-actions.pod:3247
26356 #: ../src/guestfs-actions.pod:3344 ../src/guestfs-actions.pod:3581
26357 #: ../src/guestfs-actions.pod:3713
26358 msgid "(Added in 1.5.3)"
26362 #: ../src/guestfs-actions.pod:1846
26363 msgid "guestfs_filesize"
26367 #: ../src/guestfs-actions.pod:1848
26371 " guestfs_filesize (guestfs_h *g,\n"
26372 " const char *file);\n"
26377 #: ../src/guestfs-actions.pod:1854
26379 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
26380 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
26381 "devices, use C<guestfs_blockdev_getsize64>."
26385 #: ../src/guestfs-actions.pod:1860
26386 msgid "(Added in 1.0.82)"
26390 #: ../src/guestfs-actions.pod:1862
26391 msgid "guestfs_fill"
26395 #: ../src/guestfs-actions.pod:1864
26399 " guestfs_fill (guestfs_h *g,\n"
26402 " const char *path);\n"
26407 #: ../src/guestfs-actions.pod:1874
26409 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
26410 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
26411 "bytes use C<guestfs_fill_pattern>."
26415 #: ../src/guestfs-actions.pod:1886
26416 msgid "(Added in 1.0.79)"
26420 #: ../src/guestfs-actions.pod:1888
26421 msgid "guestfs_fill_pattern"
26425 #: ../src/guestfs-actions.pod:1890
26429 " guestfs_fill_pattern (guestfs_h *g,\n"
26430 " const char *pattern,\n"
26432 " const char *path);\n"
26437 #: ../src/guestfs-actions.pod:1896
26439 "This function is like C<guestfs_fill> except that it creates a new file of "
26440 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
26441 "pattern is truncated if necessary to ensure the length of the file is "
26442 "exactly C<len> bytes."
26446 #: ../src/guestfs-actions.pod:1908
26447 msgid "(Added in 1.3.12)"
26451 #: ../src/guestfs-actions.pod:1910
26452 msgid "guestfs_find"
26456 #: ../src/guestfs-actions.pod:1912
26460 " guestfs_find (guestfs_h *g,\n"
26461 " const char *directory);\n"
26466 #: ../src/guestfs-actions.pod:1928
26468 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
26472 #: ../src/guestfs-actions.pod:1941
26473 msgid "See also C<guestfs_find0>."
26477 #: ../src/guestfs-actions.pod:1950 ../src/guestfs-actions.pod:4471
26478 #: ../src/guestfs-actions.pod:6171
26479 msgid "(Added in 1.0.27)"
26483 #: ../src/guestfs-actions.pod:1952
26484 msgid "guestfs_find0"
26488 #: ../src/guestfs-actions.pod:1954
26492 " guestfs_find0 (guestfs_h *g,\n"
26493 " const char *directory,\n"
26494 " const char *files);\n"
26499 #: ../src/guestfs-actions.pod:1963
26501 "This command works the same way as C<guestfs_find> with the following "
26506 #: ../src/guestfs-actions.pod:1990
26507 msgid "(Added in 1.0.74)"
26511 #: ../src/guestfs-actions.pod:1992
26512 msgid "guestfs_findfs_label"
26516 #: ../src/guestfs-actions.pod:1994
26520 " guestfs_findfs_label (guestfs_h *g,\n"
26521 " const char *label);\n"
26526 #: ../src/guestfs-actions.pod:2002
26527 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
26531 #: ../src/guestfs-actions.pod:2009
26532 msgid "guestfs_findfs_uuid"
26536 #: ../src/guestfs-actions.pod:2011
26540 " guestfs_findfs_uuid (guestfs_h *g,\n"
26541 " const char *uuid);\n"
26546 #: ../src/guestfs-actions.pod:2019
26547 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
26551 #: ../src/guestfs-actions.pod:2026
26552 msgid "guestfs_fsck"
26556 #: ../src/guestfs-actions.pod:2028
26560 " guestfs_fsck (guestfs_h *g,\n"
26561 " const char *fstype,\n"
26562 " const char *device);\n"
26567 #: ../src/guestfs-actions.pod:2063 ../src/guestfs-actions.pod:7962
26568 msgid "(Added in 1.0.16)"
26572 #: ../src/guestfs-actions.pod:2065
26573 msgid "guestfs_get_append"
26577 #: ../src/guestfs-actions.pod:2067
26581 " guestfs_get_append (guestfs_h *g);\n"
26586 #: ../src/guestfs-actions.pod:2075
26588 "This function returns a string which may be NULL. There is no way to return "
26589 "an error from this function. The string is owned by the guest handle and "
26590 "must I<not> be freed."
26594 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:5849
26595 #: ../src/guestfs-actions.pod:6331 ../src/guestfs-actions.pod:6789
26596 #: ../src/guestfs-actions.pod:6808 ../src/guestfs-actions.pod:6824
26597 #: ../src/guestfs-actions.pod:6848 ../src/guestfs-actions.pod:7602
26598 #: ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:8009
26599 msgid "(Added in 1.0.26)"
26603 #: ../src/guestfs-actions.pod:2081
26604 msgid "guestfs_get_attach_method"
26608 #: ../src/guestfs-actions.pod:2083
26612 " guestfs_get_attach_method (guestfs_h *g);\n"
26617 #: ../src/guestfs-actions.pod:2086
26618 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
26622 #: ../src/guestfs-actions.pod:2091 ../src/guestfs-actions.pod:6361
26623 msgid "(Added in 1.9.8)"
26627 #: ../src/guestfs-actions.pod:2093
26628 msgid "guestfs_get_autosync"
26632 #: ../src/guestfs-actions.pod:2095
26636 " guestfs_get_autosync (guestfs_h *g);\n"
26641 #: ../src/guestfs-actions.pod:2104
26642 msgid "guestfs_get_direct"
26646 #: ../src/guestfs-actions.pod:2106
26650 " guestfs_get_direct (guestfs_h *g);\n"
26655 #: ../src/guestfs-actions.pod:2113 ../src/guestfs-actions.pod:6402
26656 msgid "(Added in 1.0.72)"
26660 #: ../src/guestfs-actions.pod:2115
26661 msgid "guestfs_get_e2label"
26665 #: ../src/guestfs-actions.pod:2117
26669 " guestfs_get_e2label (guestfs_h *g,\n"
26670 " const char *device);\n"
26675 #: ../src/guestfs-actions.pod:2121
26677 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
26682 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:2155
26683 #: ../src/guestfs-actions.pod:6420 ../src/guestfs-actions.pod:6439
26684 msgid "(Added in 1.0.15)"
26688 #: ../src/guestfs-actions.pod:2136
26689 msgid "guestfs_get_e2uuid"
26693 #: ../src/guestfs-actions.pod:2138
26697 " guestfs_get_e2uuid (guestfs_h *g,\n"
26698 " const char *device);\n"
26703 #: ../src/guestfs-actions.pod:2142
26705 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
26710 #: ../src/guestfs-actions.pod:2157
26711 msgid "guestfs_get_memsize"
26715 #: ../src/guestfs-actions.pod:2159
26719 " guestfs_get_memsize (guestfs_h *g);\n"
26724 #: ../src/guestfs-actions.pod:2165
26726 "If C<guestfs_set_memsize> was not called on this handle, and if "
26727 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
26728 "value for memsize."
26732 #: ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:4762
26733 #: ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:4990
26734 #: ../src/guestfs-actions.pod:5009 ../src/guestfs-actions.pod:5021
26735 #: ../src/guestfs-actions.pod:5038 ../src/guestfs-actions.pod:5051
26736 #: ../src/guestfs-actions.pod:6074 ../src/guestfs-actions.pod:6460
26737 #: ../src/guestfs-actions.pod:6756 ../src/guestfs-actions.pod:7371
26738 msgid "(Added in 1.0.55)"
26742 #: ../src/guestfs-actions.pod:2176
26743 msgid "guestfs_get_network"
26747 #: ../src/guestfs-actions.pod:2178
26751 " guestfs_get_network (guestfs_h *g);\n"
26756 #: ../src/guestfs-actions.pod:2185 ../src/guestfs-actions.pod:6479
26757 msgid "(Added in 1.5.4)"
26761 #: ../src/guestfs-actions.pod:2187
26762 msgid "guestfs_get_path"
26766 #: ../src/guestfs-actions.pod:2189
26770 " guestfs_get_path (guestfs_h *g);\n"
26775 #: ../src/guestfs-actions.pod:2197 ../src/guestfs-actions.pod:2237
26777 "This function returns a string, or NULL on error. The string is owned by "
26778 "the guest handle and must I<not> be freed."
26782 #: ../src/guestfs-actions.pod:2202
26783 msgid "guestfs_get_pgroup"
26787 #: ../src/guestfs-actions.pod:2204
26791 " guestfs_get_pgroup (guestfs_h *g);\n"
26796 #: ../src/guestfs-actions.pod:2211 ../src/guestfs-actions.pod:6515
26797 #: ../src/guestfs-actions.pod:7863
26798 msgid "(Added in 1.11.18)"
26802 #: ../src/guestfs-actions.pod:2213
26803 msgid "guestfs_get_pid"
26807 #: ../src/guestfs-actions.pod:2215
26811 " guestfs_get_pid (guestfs_h *g);\n"
26816 #: ../src/guestfs-actions.pod:2225
26817 msgid "(Added in 1.0.56)"
26821 #: ../src/guestfs-actions.pod:2227
26822 msgid "guestfs_get_qemu"
26826 #: ../src/guestfs-actions.pod:2229
26830 " guestfs_get_qemu (guestfs_h *g);\n"
26835 #: ../src/guestfs-actions.pod:2240 ../src/guestfs-actions.pod:6543
26836 msgid "(Added in 1.0.6)"
26840 #: ../src/guestfs-actions.pod:2242
26841 msgid "guestfs_get_recovery_proc"
26845 #: ../src/guestfs-actions.pod:2244
26849 " guestfs_get_recovery_proc (guestfs_h *g);\n"
26854 #: ../src/guestfs-actions.pod:2251 ../src/guestfs-actions.pod:3835
26855 #: ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4569
26856 #: ../src/guestfs-actions.pod:4601 ../src/guestfs-actions.pod:5779
26857 #: ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6567
26858 #: ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7294
26859 #: ../src/guestfs-actions.pod:7486
26860 msgid "(Added in 1.0.77)"
26864 #: ../src/guestfs-actions.pod:2253
26865 msgid "guestfs_get_selinux"
26869 #: ../src/guestfs-actions.pod:2255
26873 " guestfs_get_selinux (guestfs_h *g);\n"
26878 #: ../src/guestfs-actions.pod:2258
26880 "This returns the current setting of the selinux flag which is passed to the "
26881 "appliance at boot time. See C<guestfs_set_selinux>."
26885 #: ../src/guestfs-actions.pod:2266 ../src/guestfs-actions.pod:2340
26886 #: ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:6660
26887 msgid "(Added in 1.0.67)"
26891 #: ../src/guestfs-actions.pod:2268
26892 msgid "guestfs_get_smp"
26896 #: ../src/guestfs-actions.pod:2270
26900 " guestfs_get_smp (guestfs_h *g);\n"
26905 #: ../src/guestfs-actions.pod:2279
26906 msgid "guestfs_get_state"
26910 #: ../src/guestfs-actions.pod:2281
26914 " guestfs_get_state (guestfs_h *g);\n"
26919 #: ../src/guestfs-actions.pod:2293
26920 msgid "guestfs_get_trace"
26924 #: ../src/guestfs-actions.pod:2295
26928 " guestfs_get_trace (guestfs_h *g);\n"
26933 #: ../src/guestfs-actions.pod:2304
26934 msgid "guestfs_get_umask"
26938 #: ../src/guestfs-actions.pod:2306
26942 " guestfs_get_umask (guestfs_h *g);\n"
26947 #: ../src/guestfs-actions.pod:2309
26949 "Return the current umask. By default the umask is C<022> unless it has been "
26950 "set by calling C<guestfs_umask>."
26954 #: ../src/guestfs-actions.pod:2316
26955 msgid "guestfs_get_verbose"
26959 #: ../src/guestfs-actions.pod:2318
26963 " guestfs_get_verbose (guestfs_h *g);\n"
26968 #: ../src/guestfs-actions.pod:2327
26969 msgid "guestfs_getcon"
26973 #: ../src/guestfs-actions.pod:2329
26977 " guestfs_getcon (guestfs_h *g);\n"
26982 #: ../src/guestfs-actions.pod:2334
26984 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
26988 #: ../src/guestfs-actions.pod:2342
26989 msgid "guestfs_getxattr"
26993 #: ../src/guestfs-actions.pod:2344
26997 " guestfs_getxattr (guestfs_h *g,\n"
26998 " const char *path,\n"
26999 " const char *name,\n"
27000 " size_t *size_r);\n"
27005 #: ../src/guestfs-actions.pod:2350
27007 "Get a single extended attribute from file C<path> named C<name>. This call "
27008 "follows symlinks. If you want to lookup an extended attribute for the "
27009 "symlink itself, use C<guestfs_lgetxattr>."
27013 #: ../src/guestfs-actions.pod:2354 ../src/guestfs-actions.pod:3849
27015 "Normally it is better to get all extended attributes from a file in one go "
27016 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
27017 "implementations are buggy and do not provide a way to list out attributes. "
27018 "For these filesystems (notably ntfs-3g) you have to know the names of the "
27019 "extended attributes you want in advance and call this function."
27023 #: ../src/guestfs-actions.pod:2364
27024 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
27028 #: ../src/guestfs-actions.pod:2366 ../src/guestfs-actions.pod:2579
27029 #: ../src/guestfs-actions.pod:3061 ../src/guestfs-actions.pod:3861
27030 #: ../src/guestfs-actions.pod:5772 ../src/guestfs-actions.pod:5798
27031 #: ../src/guestfs-actions.pod:5979
27033 "This function returns a buffer, or NULL on error. The size of the returned "
27034 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
27039 #: ../src/guestfs-actions.pod:2370 ../src/guestfs-actions.pod:3865
27040 msgid "(Added in 1.7.24)"
27044 #: ../src/guestfs-actions.pod:2372
27045 msgid "guestfs_getxattrs"
27049 #: ../src/guestfs-actions.pod:2374
27052 " struct guestfs_xattr_list *\n"
27053 " guestfs_getxattrs (guestfs_h *g,\n"
27054 " const char *path);\n"
27059 #: ../src/guestfs-actions.pod:2384
27060 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
27064 #: ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:3877
27065 #: ../src/guestfs-actions.pod:4565
27067 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
27068 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
27072 #: ../src/guestfs-actions.pod:2390 ../src/guestfs-actions.pod:3881
27073 #: ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4116
27074 #: ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6679
27075 #: ../src/guestfs-actions.pod:8074
27076 msgid "(Added in 1.0.59)"
27080 #: ../src/guestfs-actions.pod:2392
27081 msgid "guestfs_glob_expand"
27085 #: ../src/guestfs-actions.pod:2394
27089 " guestfs_glob_expand (guestfs_h *g,\n"
27090 " const char *pattern);\n"
27095 #: ../src/guestfs-actions.pod:2413 ../src/guestfs-actions.pod:6872
27096 #: ../src/guestfs-actions.pod:6889
27097 msgid "(Added in 1.0.50)"
27101 #: ../src/guestfs-actions.pod:2415
27102 msgid "guestfs_grep"
27106 #: ../src/guestfs-actions.pod:2417
27110 " guestfs_grep (guestfs_h *g,\n"
27111 " const char *regex,\n"
27112 " const char *path);\n"
27117 #: ../src/guestfs-actions.pod:2434
27118 msgid "guestfs_grepi"
27122 #: ../src/guestfs-actions.pod:2436
27126 " guestfs_grepi (guestfs_h *g,\n"
27127 " const char *regex,\n"
27128 " const char *path);\n"
27133 #: ../src/guestfs-actions.pod:2453
27134 msgid "guestfs_grub_install"
27138 #: ../src/guestfs-actions.pod:2455
27142 " guestfs_grub_install (guestfs_h *g,\n"
27143 " const char *root,\n"
27144 " const char *device);\n"
27149 #: ../src/guestfs-actions.pod:2498
27150 msgid "(Added in 1.0.17)"
27154 #: ../src/guestfs-actions.pod:2500
27155 msgid "guestfs_head"
27159 #: ../src/guestfs-actions.pod:2502
27163 " guestfs_head (guestfs_h *g,\n"
27164 " const char *path);\n"
27169 #: ../src/guestfs-actions.pod:2518
27170 msgid "guestfs_head_n"
27174 #: ../src/guestfs-actions.pod:2520
27178 " guestfs_head_n (guestfs_h *g,\n"
27180 " const char *path);\n"
27185 #: ../src/guestfs-actions.pod:2542
27186 msgid "guestfs_hexdump"
27190 #: ../src/guestfs-actions.pod:2544
27194 " guestfs_hexdump (guestfs_h *g,\n"
27195 " const char *path);\n"
27200 #: ../src/guestfs-actions.pod:2557 ../src/guestfs-actions.pod:6953
27201 #: ../src/guestfs-actions.pod:7008
27202 msgid "(Added in 1.0.22)"
27206 #: ../src/guestfs-actions.pod:2559
27207 msgid "guestfs_initrd_cat"
27211 #: ../src/guestfs-actions.pod:2561
27215 " guestfs_initrd_cat (guestfs_h *g,\n"
27216 " const char *initrdpath,\n"
27217 " const char *filename,\n"
27218 " size_t *size_r);\n"
27223 #: ../src/guestfs-actions.pod:2577
27224 msgid "See also C<guestfs_initrd_list>."
27228 #: ../src/guestfs-actions.pod:2588
27229 msgid "guestfs_initrd_list"
27233 #: ../src/guestfs-actions.pod:2590
27237 " guestfs_initrd_list (guestfs_h *g,\n"
27238 " const char *path);\n"
27243 #: ../src/guestfs-actions.pod:2610
27244 msgid "guestfs_inotify_add_watch"
27248 #: ../src/guestfs-actions.pod:2612
27252 " guestfs_inotify_add_watch (guestfs_h *g,\n"
27253 " const char *path,\n"
27259 #: ../src/guestfs-actions.pod:2631
27260 msgid "guestfs_inotify_close"
27264 #: ../src/guestfs-actions.pod:2633
27268 " guestfs_inotify_close (guestfs_h *g);\n"
27273 #: ../src/guestfs-actions.pod:2644
27274 msgid "guestfs_inotify_files"
27278 #: ../src/guestfs-actions.pod:2646
27282 " guestfs_inotify_files (guestfs_h *g);\n"
27287 #: ../src/guestfs-actions.pod:2649
27289 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
27290 "returns a list of pathnames of objects that were touched. The returned "
27291 "pathnames are sorted and deduplicated."
27295 #: ../src/guestfs-actions.pod:2659
27296 msgid "guestfs_inotify_init"
27300 #: ../src/guestfs-actions.pod:2661
27304 " guestfs_inotify_init (guestfs_h *g,\n"
27305 " int maxevents);\n"
27310 #: ../src/guestfs-actions.pod:2669
27312 "C<maxevents> is the maximum number of events which will be queued up between "
27313 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
27314 "passed as C<0>, then the kernel (or previously set) default is used. For "
27315 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
27316 "throws away events, but records the fact that it threw them away by setting "
27317 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
27318 "C<guestfs_inotify_read>)."
27322 #: ../src/guestfs-actions.pod:2679
27324 "Before any events are generated, you have to add some watches to the "
27325 "internal watch list. See: C<guestfs_inotify_add_watch>, "
27326 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
27330 #: ../src/guestfs-actions.pod:2685
27332 "Queued up events should be read periodically by calling "
27333 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
27334 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
27335 "often enough then you risk the internal queue overflowing."
27339 #: ../src/guestfs-actions.pod:2692
27341 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
27342 "This also removes any watches automatically."
27346 #: ../src/guestfs-actions.pod:2705
27347 msgid "guestfs_inotify_read"
27351 #: ../src/guestfs-actions.pod:2707
27354 " struct guestfs_inotify_event_list *\n"
27355 " guestfs_inotify_read (guestfs_h *g);\n"
27360 #: ../src/guestfs-actions.pod:2721
27362 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
27363 "there was an error. I<The caller must call "
27364 "C<guestfs_free_inotify_event_list> after use>."
27368 #: ../src/guestfs-actions.pod:2727
27369 msgid "guestfs_inotify_rm_watch"
27373 #: ../src/guestfs-actions.pod:2729
27377 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
27383 #: ../src/guestfs-actions.pod:2733
27385 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
27389 #: ../src/guestfs-actions.pod:2740
27390 msgid "guestfs_inspect_get_arch"
27394 #: ../src/guestfs-actions.pod:2742
27398 " guestfs_inspect_get_arch (guestfs_h *g,\n"
27399 " const char *root);\n"
27404 #: ../src/guestfs-actions.pod:2746
27406 "This returns the architecture of the inspected operating system. The "
27407 "possible return values are listed under C<guestfs_file_architecture>."
27411 #: ../src/guestfs-actions.pod:2760
27412 msgid "guestfs_inspect_get_distro"
27416 #: ../src/guestfs-actions.pod:2762
27420 " guestfs_inspect_get_distro (guestfs_h *g,\n"
27421 " const char *root);\n"
27426 #: ../src/guestfs-actions.pod:2862
27427 msgid "guestfs_inspect_get_drive_mappings"
27431 #: ../src/guestfs-actions.pod:2864
27435 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
27436 " const char *root);\n"
27441 #: ../src/guestfs-actions.pod:2893
27443 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27444 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
27448 #: ../src/guestfs-actions.pod:2897 ../src/guestfs-actions.pod:3165
27449 #: ../src/guestfs-actions.pod:3968 ../src/guestfs-actions.pod:5240
27450 #: ../src/guestfs-actions.pod:7310
27452 "This function returns a NULL-terminated array of strings, or NULL if there "
27453 "was an error. The array of strings will always have length C<2n+1>, where "
27454 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
27455 "caller must free the strings and the array after use>."
27459 #: ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:3364
27460 msgid "(Added in 1.9.17)"
27464 #: ../src/guestfs-actions.pod:2905
27465 msgid "guestfs_inspect_get_filesystems"
27469 #: ../src/guestfs-actions.pod:2907
27473 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
27474 " const char *root);\n"
27479 #: ../src/guestfs-actions.pod:2919
27481 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27482 "C<guestfs_inspect_get_mountpoints>."
27486 #: ../src/guestfs-actions.pod:2928
27487 msgid "guestfs_inspect_get_format"
27491 #: ../src/guestfs-actions.pod:2930
27495 " guestfs_inspect_get_format (guestfs_h *g,\n"
27496 " const char *root);\n"
27501 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3400
27502 #: ../src/guestfs-actions.pod:3416 ../src/guestfs-actions.pod:3434
27503 #: ../src/guestfs-actions.pod:6190
27504 msgid "(Added in 1.9.4)"
27508 #: ../src/guestfs-actions.pod:2966
27509 msgid "guestfs_inspect_get_hostname"
27513 #: ../src/guestfs-actions.pod:2968
27517 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
27518 " const char *root);\n"
27523 #: ../src/guestfs-actions.pod:2983
27524 msgid "(Added in 1.7.9)"
27528 #: ../src/guestfs-actions.pod:2985
27529 msgid "guestfs_inspect_get_icon"
27533 #: ../src/guestfs-actions.pod:2987
27537 " guestfs_inspect_get_icon (guestfs_h *g,\n"
27538 " const char *root,\n"
27539 " size_t *size_r,\n"
27545 #: ../src/guestfs-actions.pod:2998
27548 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
27549 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
27554 #: ../src/guestfs-actions.pod:3065 ../src/guestfs-actions.pod:3895
27555 #: ../src/guestfs-actions.pod:5139
27556 msgid "(Added in 1.11.12)"
27560 #: ../src/guestfs-actions.pod:3067
27561 msgid "guestfs_inspect_get_icon_va"
27565 #: ../src/guestfs-actions.pod:3069
27569 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
27570 " const char *root,\n"
27571 " size_t *size_r,\n"
27572 " va_list args);\n"
27577 #: ../src/guestfs-actions.pod:3075
27578 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
27582 #: ../src/guestfs-actions.pod:3079
27583 msgid "guestfs_inspect_get_icon_argv"
27587 #: ../src/guestfs-actions.pod:3081
27591 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
27592 " const char *root,\n"
27593 " size_t *size_r,\n"
27594 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
27599 #: ../src/guestfs-actions.pod:3087
27600 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
27604 #: ../src/guestfs-actions.pod:3091
27605 msgid "guestfs_inspect_get_major_version"
27609 #: ../src/guestfs-actions.pod:3093
27613 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
27614 " const char *root);\n"
27619 #: ../src/guestfs-actions.pod:3115
27620 msgid "guestfs_inspect_get_minor_version"
27624 #: ../src/guestfs-actions.pod:3117
27628 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
27629 " const char *root);\n"
27634 #: ../src/guestfs-actions.pod:3126
27636 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27637 "C<guestfs_inspect_get_major_version>."
27641 #: ../src/guestfs-actions.pod:3133
27642 msgid "guestfs_inspect_get_mountpoints"
27646 #: ../src/guestfs-actions.pod:3135
27650 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
27651 " const char *root);\n"
27656 #: ../src/guestfs-actions.pod:3156
27658 "For operating systems like Windows which still use drive letters, this call "
27659 "will only return an entry for the first drive \"mounted on\" C</>. For "
27660 "information about the mapping of drive letters to partitions, see "
27661 "C<guestfs_inspect_get_drive_mappings>."
27665 #: ../src/guestfs-actions.pod:3162
27667 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27668 "C<guestfs_inspect_get_filesystems>."
27672 #: ../src/guestfs-actions.pod:3173
27673 msgid "guestfs_inspect_get_package_format"
27677 #: ../src/guestfs-actions.pod:3175
27681 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
27682 " const char *root);\n"
27687 #: ../src/guestfs-actions.pod:3179
27689 "This function and C<guestfs_inspect_get_package_management> return the "
27690 "package format and package management tool used by the inspected operating "
27691 "system. For example for Fedora these functions would return C<rpm> (package "
27692 "format) and C<yum> (package management)."
27696 #: ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3226
27697 msgid "(Added in 1.7.5)"
27701 #: ../src/guestfs-actions.pod:3200
27702 msgid "guestfs_inspect_get_package_management"
27706 #: ../src/guestfs-actions.pod:3202
27710 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
27711 " const char *root);\n"
27716 #: ../src/guestfs-actions.pod:3206
27718 "C<guestfs_inspect_get_package_format> and this function return the package "
27719 "format and package management tool used by the inspected operating system. "
27720 "For example for Fedora these functions would return C<rpm> (package format) "
27721 "and C<yum> (package management)."
27725 #: ../src/guestfs-actions.pod:3228
27726 msgid "guestfs_inspect_get_product_name"
27730 #: ../src/guestfs-actions.pod:3230
27734 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
27735 " const char *root);\n"
27740 #: ../src/guestfs-actions.pod:3249
27741 msgid "guestfs_inspect_get_product_variant"
27745 #: ../src/guestfs-actions.pod:3251
27749 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
27750 " const char *root);\n"
27755 #: ../src/guestfs-actions.pod:3274
27757 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27758 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
27762 #: ../src/guestfs-actions.pod:3281
27763 msgid "(Added in 1.9.13)"
27767 #: ../src/guestfs-actions.pod:3283
27768 msgid "guestfs_inspect_get_roots"
27772 #: ../src/guestfs-actions.pod:3285
27776 " guestfs_inspect_get_roots (guestfs_h *g);\n"
27781 #: ../src/guestfs-actions.pod:3288
27783 "This function is a convenient way to get the list of root devices, as "
27784 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
27785 "the whole inspection process."
27789 #: ../src/guestfs-actions.pod:3292
27791 "This returns an empty list if either no root devices were found or the "
27792 "caller has not called C<guestfs_inspect_os>."
27796 #: ../src/guestfs-actions.pod:3301
27797 msgid "(Added in 1.7.3)"
27801 #: ../src/guestfs-actions.pod:3303
27802 msgid "guestfs_inspect_get_type"
27806 #: ../src/guestfs-actions.pod:3305
27810 " guestfs_inspect_get_type (guestfs_h *g,\n"
27811 " const char *root);\n"
27816 #: ../src/guestfs-actions.pod:3346
27817 msgid "guestfs_inspect_get_windows_current_control_set"
27821 #: ../src/guestfs-actions.pod:3348
27825 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
27826 " const char *root);\n"
27831 #: ../src/guestfs-actions.pod:3366
27832 msgid "guestfs_inspect_get_windows_systemroot"
27836 #: ../src/guestfs-actions.pod:3368
27840 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
27841 " const char *root);\n"
27846 #: ../src/guestfs-actions.pod:3384
27847 msgid "(Added in 1.5.25)"
27851 #: ../src/guestfs-actions.pod:3386
27852 msgid "guestfs_inspect_is_live"
27856 #: ../src/guestfs-actions.pod:3388
27860 " guestfs_inspect_is_live (guestfs_h *g,\n"
27861 " const char *root);\n"
27866 #: ../src/guestfs-actions.pod:3392
27868 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27869 "disk), then this returns true if a live image was detected on the disk."
27873 #: ../src/guestfs-actions.pod:3402
27874 msgid "guestfs_inspect_is_multipart"
27878 #: ../src/guestfs-actions.pod:3404
27882 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
27883 " const char *root);\n"
27888 #: ../src/guestfs-actions.pod:3408
27890 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27891 "disk), then this returns true if the disk is part of a set."
27895 #: ../src/guestfs-actions.pod:3418
27896 msgid "guestfs_inspect_is_netinst"
27900 #: ../src/guestfs-actions.pod:3420
27904 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
27905 " const char *root);\n"
27910 #: ../src/guestfs-actions.pod:3424
27912 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27913 "disk), then this returns true if the disk is a network installer, ie. not a "
27914 "self-contained install CD but one which is likely to require network access "
27915 "to complete the install."
27919 #: ../src/guestfs-actions.pod:3436
27920 msgid "guestfs_inspect_list_applications"
27924 #: ../src/guestfs-actions.pod:3438
27927 " struct guestfs_application_list *\n"
27928 " guestfs_inspect_list_applications (guestfs_h *g,\n"
27929 " const char *root);\n"
27934 #: ../src/guestfs-actions.pod:3444
27936 "I<Note:> This call works differently from other parts of the inspection "
27937 "API. You have to call C<guestfs_inspect_os>, then "
27938 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
27939 "this. Listing applications is a significantly more difficult operation "
27940 "which requires access to the full filesystem. Also note that unlike the "
27941 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
27942 "the libguestfs handle, this call actually reads parts of the mounted "
27943 "filesystems during the call."
27947 #: ../src/guestfs-actions.pod:3534
27949 "This function returns a C<struct guestfs_application_list *>, or NULL if "
27950 "there was an error. I<The caller must call C<guestfs_free_application_list> "
27955 #: ../src/guestfs-actions.pod:3538
27956 msgid "(Added in 1.7.8)"
27960 #: ../src/guestfs-actions.pod:3540
27961 msgid "guestfs_inspect_os"
27965 #: ../src/guestfs-actions.pod:3542
27969 " guestfs_inspect_os (guestfs_h *g);\n"
27974 #: ../src/guestfs-actions.pod:3558
27976 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
27977 "functions in order to query further information about each operating system, "
27978 "such as the name and version."
27982 #: ../src/guestfs-actions.pod:3563
27984 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
27985 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
27986 "the contents. This should be called with no disks currently mounted. The "
27987 "function may also use Augeas, so any existing Augeas handle will be closed."
27991 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3906
27992 #: ../src/guestfs-actions.pod:3988
27993 msgid "See also C<guestfs_list_filesystems>."
27997 #: ../src/guestfs-actions.pod:3583
27998 msgid "guestfs_is_blockdev"
28002 #: ../src/guestfs-actions.pod:3585
28006 " guestfs_is_blockdev (guestfs_h *g,\n"
28007 " const char *path);\n"
28012 #: ../src/guestfs-actions.pod:3592 ../src/guestfs-actions.pod:3621
28013 #: ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3666
28014 #: ../src/guestfs-actions.pod:3682 ../src/guestfs-actions.pod:3738
28015 #: ../src/guestfs-actions.pod:3753
28016 msgid "See also C<guestfs_stat>."
28020 #: ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3625
28021 #: ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:3742
28022 #: ../src/guestfs-actions.pod:3757
28023 msgid "(Added in 1.5.10)"
28027 #: ../src/guestfs-actions.pod:3598
28028 msgid "guestfs_is_busy"
28032 #: ../src/guestfs-actions.pod:3600
28036 " guestfs_is_busy (guestfs_h *g);\n"
28041 #: ../src/guestfs-actions.pod:3612
28042 msgid "guestfs_is_chardev"
28046 #: ../src/guestfs-actions.pod:3614
28050 " guestfs_is_chardev (guestfs_h *g,\n"
28051 " const char *path);\n"
28056 #: ../src/guestfs-actions.pod:3627
28057 msgid "guestfs_is_config"
28061 #: ../src/guestfs-actions.pod:3629
28065 " guestfs_is_config (guestfs_h *g);\n"
28070 #: ../src/guestfs-actions.pod:3641
28071 msgid "guestfs_is_dir"
28075 #: ../src/guestfs-actions.pod:3643
28079 " guestfs_is_dir (guestfs_h *g,\n"
28080 " const char *path);\n"
28085 #: ../src/guestfs-actions.pod:3657
28086 msgid "guestfs_is_fifo"
28090 #: ../src/guestfs-actions.pod:3659
28094 " guestfs_is_fifo (guestfs_h *g,\n"
28095 " const char *path);\n"
28100 #: ../src/guestfs-actions.pod:3672
28101 msgid "guestfs_is_file"
28105 #: ../src/guestfs-actions.pod:3674
28109 " guestfs_is_file (guestfs_h *g,\n"
28110 " const char *path);\n"
28115 #: ../src/guestfs-actions.pod:3688
28116 msgid "guestfs_is_launching"
28120 #: ../src/guestfs-actions.pod:3690
28124 " guestfs_is_launching (guestfs_h *g);\n"
28129 #: ../src/guestfs-actions.pod:3702
28130 msgid "guestfs_is_lv"
28134 #: ../src/guestfs-actions.pod:3704
28138 " guestfs_is_lv (guestfs_h *g,\n"
28139 " const char *device);\n"
28144 #: ../src/guestfs-actions.pod:3715
28145 msgid "guestfs_is_ready"
28149 #: ../src/guestfs-actions.pod:3717
28153 " guestfs_is_ready (guestfs_h *g);\n"
28158 #: ../src/guestfs-actions.pod:3729
28159 msgid "guestfs_is_socket"
28163 #: ../src/guestfs-actions.pod:3731
28167 " guestfs_is_socket (guestfs_h *g,\n"
28168 " const char *path);\n"
28173 #: ../src/guestfs-actions.pod:3744
28174 msgid "guestfs_is_symlink"
28178 #: ../src/guestfs-actions.pod:3746
28182 " guestfs_is_symlink (guestfs_h *g,\n"
28183 " const char *path);\n"
28188 #: ../src/guestfs-actions.pod:3759
28189 msgid "guestfs_is_zero"
28193 #: ../src/guestfs-actions.pod:3761
28197 " guestfs_is_zero (guestfs_h *g,\n"
28198 " const char *path);\n"
28203 #: ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:3784
28204 msgid "(Added in 1.11.8)"
28208 #: ../src/guestfs-actions.pod:3772
28209 msgid "guestfs_is_zero_device"
28213 #: ../src/guestfs-actions.pod:3774
28217 " guestfs_is_zero_device (guestfs_h *g,\n"
28218 " const char *device);\n"
28223 #: ../src/guestfs-actions.pod:3786
28224 msgid "guestfs_kill_subprocess"
28228 #: ../src/guestfs-actions.pod:3788
28232 " guestfs_kill_subprocess (guestfs_h *g);\n"
28237 #: ../src/guestfs-actions.pod:3797
28238 msgid "guestfs_launch"
28242 #: ../src/guestfs-actions.pod:3799
28246 " guestfs_launch (guestfs_h *g);\n"
28251 #: ../src/guestfs-actions.pod:3817
28252 msgid "guestfs_lchown"
28256 #: ../src/guestfs-actions.pod:3819
28260 " guestfs_lchown (guestfs_h *g,\n"
28263 " const char *path);\n"
28268 #: ../src/guestfs-actions.pod:3825
28270 "Change the file owner to C<owner> and group to C<group>. This is like "
28271 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
28272 "changed, not the target."
28276 #: ../src/guestfs-actions.pod:3837
28277 msgid "guestfs_lgetxattr"
28281 #: ../src/guestfs-actions.pod:3839
28285 " guestfs_lgetxattr (guestfs_h *g,\n"
28286 " const char *path,\n"
28287 " const char *name,\n"
28288 " size_t *size_r);\n"
28293 #: ../src/guestfs-actions.pod:3859
28294 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
28298 #: ../src/guestfs-actions.pod:3867
28299 msgid "guestfs_lgetxattrs"
28303 #: ../src/guestfs-actions.pod:3869
28306 " struct guestfs_xattr_list *\n"
28307 " guestfs_lgetxattrs (guestfs_h *g,\n"
28308 " const char *path);\n"
28313 #: ../src/guestfs-actions.pod:3873
28315 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
28316 "then it returns the extended attributes of the link itself."
28320 #: ../src/guestfs-actions.pod:3883
28321 msgid "guestfs_list_9p"
28325 #: ../src/guestfs-actions.pod:3885
28329 " guestfs_list_9p (guestfs_h *g);\n"
28334 #: ../src/guestfs-actions.pod:3897
28335 msgid "guestfs_list_devices"
28339 #: ../src/guestfs-actions.pod:3899
28343 " guestfs_list_devices (guestfs_h *g);\n"
28348 #: ../src/guestfs-actions.pod:3914
28349 msgid "guestfs_list_dm_devices"
28353 #: ../src/guestfs-actions.pod:3916
28357 " guestfs_list_dm_devices (guestfs_h *g);\n"
28362 #: ../src/guestfs-actions.pod:3921
28364 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
28365 "previous call to C<guestfs_luks_open>."
28369 #: ../src/guestfs-actions.pod:3924
28371 "Device mapper devices which correspond to logical volumes are I<not> "
28372 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
28377 #: ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:5378
28378 msgid "(Added in 1.11.15)"
28382 #: ../src/guestfs-actions.pod:3934
28383 msgid "guestfs_list_filesystems"
28387 #: ../src/guestfs-actions.pod:3936
28391 " guestfs_list_filesystems (guestfs_h *g);\n"
28396 #: ../src/guestfs-actions.pod:3956
28398 "This command runs other libguestfs commands, which might include "
28399 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
28400 "soon after launch and only when nothing is mounted."
28404 #: ../src/guestfs-actions.pod:3960
28406 "Not all of the filesystems returned will be mountable. In particular, swap "
28407 "partitions are returned in the list. Also this command does not check that "
28408 "each filesystem found is valid and mountable, and some filesystems might be "
28409 "mountable but require special options. Filesystems may not all belong to a "
28410 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
28414 #: ../src/guestfs-actions.pod:3974 ../src/guestfs-actions.pod:5739
28415 msgid "(Added in 1.5.15)"
28419 #: ../src/guestfs-actions.pod:3976
28420 msgid "guestfs_list_partitions"
28424 #: ../src/guestfs-actions.pod:3978
28428 " guestfs_list_partitions (guestfs_h *g);\n"
28433 #: ../src/guestfs-actions.pod:3985
28435 "This does not return logical volumes. For that you will need to call "
28440 #: ../src/guestfs-actions.pod:3996
28445 #: ../src/guestfs-actions.pod:3998
28449 " guestfs_ll (guestfs_h *g,\n"
28450 " const char *directory);\n"
28455 #: ../src/guestfs-actions.pod:4013
28460 #: ../src/guestfs-actions.pod:4015
28464 " guestfs_ln (guestfs_h *g,\n"
28465 " const char *target,\n"
28466 " const char *linkname);\n"
28471 #: ../src/guestfs-actions.pod:4026
28472 msgid "guestfs_ln_f"
28476 #: ../src/guestfs-actions.pod:4028
28480 " guestfs_ln_f (guestfs_h *g,\n"
28481 " const char *target,\n"
28482 " const char *linkname);\n"
28487 #: ../src/guestfs-actions.pod:4040
28488 msgid "guestfs_ln_s"
28492 #: ../src/guestfs-actions.pod:4042
28496 " guestfs_ln_s (guestfs_h *g,\n"
28497 " const char *target,\n"
28498 " const char *linkname);\n"
28503 #: ../src/guestfs-actions.pod:4053
28504 msgid "guestfs_ln_sf"
28508 #: ../src/guestfs-actions.pod:4055
28512 " guestfs_ln_sf (guestfs_h *g,\n"
28513 " const char *target,\n"
28514 " const char *linkname);\n"
28519 #: ../src/guestfs-actions.pod:4067
28520 msgid "guestfs_lremovexattr"
28524 #: ../src/guestfs-actions.pod:4069
28528 " guestfs_lremovexattr (guestfs_h *g,\n"
28529 " const char *xattr,\n"
28530 " const char *path);\n"
28535 #: ../src/guestfs-actions.pod:4074
28537 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
28538 "link, then it removes an extended attribute of the link itself."
28542 #: ../src/guestfs-actions.pod:4082
28547 #: ../src/guestfs-actions.pod:4084
28551 " guestfs_ls (guestfs_h *g,\n"
28552 " const char *directory);\n"
28557 #: ../src/guestfs-actions.pod:4092
28559 "This command is mostly useful for interactive sessions. Programs should "
28560 "probably use C<guestfs_readdir> instead."
28564 #: ../src/guestfs-actions.pod:4101
28565 msgid "guestfs_lsetxattr"
28569 #: ../src/guestfs-actions.pod:4103
28573 " guestfs_lsetxattr (guestfs_h *g,\n"
28574 " const char *xattr,\n"
28575 " const char *val,\n"
28577 " const char *path);\n"
28582 #: ../src/guestfs-actions.pod:4110
28584 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
28585 "then it sets an extended attribute of the link itself."
28589 #: ../src/guestfs-actions.pod:4118
28590 msgid "guestfs_lstat"
28594 #: ../src/guestfs-actions.pod:4120
28597 " struct guestfs_stat *\n"
28598 " guestfs_lstat (guestfs_h *g,\n"
28599 " const char *path);\n"
28604 #: ../src/guestfs-actions.pod:4126
28606 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
28607 "link, then the link is stat-ed, not the file it refers to."
28611 #: ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:6913
28613 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
28614 "error. I<The caller must call C<guestfs_free_stat> after use>."
28618 #: ../src/guestfs-actions.pod:4136 ../src/guestfs-actions.pod:6917
28619 #: ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:7316
28620 msgid "(Added in 0.9.2)"
28624 #: ../src/guestfs-actions.pod:4138
28625 msgid "guestfs_lstatlist"
28629 #: ../src/guestfs-actions.pod:4140
28632 " struct guestfs_stat_list *\n"
28633 " guestfs_lstatlist (guestfs_h *g,\n"
28634 " const char *path,\n"
28635 " char *const *names);\n"
28640 #: ../src/guestfs-actions.pod:4145
28642 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
28643 "files, where all files are in the directory C<path>. C<names> is the list "
28644 "of files from this directory."
28648 #: ../src/guestfs-actions.pod:4154
28650 "This call is intended for programs that want to efficiently list a directory "
28651 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
28652 "for a similarly efficient call for getting extended attributes. Very long "
28653 "directory listings might cause the protocol message size to be exceeded, "
28654 "causing this call to fail. The caller must split up such requests into "
28655 "smaller groups of names."
28659 #: ../src/guestfs-actions.pod:4162
28661 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
28662 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
28666 #: ../src/guestfs-actions.pod:4168
28667 msgid "guestfs_luks_add_key"
28671 #: ../src/guestfs-actions.pod:4170
28675 " guestfs_luks_add_key (guestfs_h *g,\n"
28676 " const char *device,\n"
28677 " const char *key,\n"
28678 " const char *newkey,\n"
28684 #: ../src/guestfs-actions.pod:4182
28686 "Note that if C<keyslot> already contains a key, then this command will "
28687 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
28691 #: ../src/guestfs-actions.pod:4188 ../src/guestfs-actions.pod:4228
28692 #: ../src/guestfs-actions.pod:4251 ../src/guestfs-actions.pod:4271
28693 #: ../src/guestfs-actions.pod:4306 ../src/guestfs-actions.pod:4325
28695 "This function takes a key or passphrase parameter which could contain "
28696 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
28701 #: ../src/guestfs-actions.pod:4192 ../src/guestfs-actions.pod:4232
28702 #: ../src/guestfs-actions.pod:4255 ../src/guestfs-actions.pod:4275
28703 msgid "(Added in 1.5.2)"
28707 #: ../src/guestfs-actions.pod:4194
28708 msgid "guestfs_luks_close"
28712 #: ../src/guestfs-actions.pod:4196
28716 " guestfs_luks_close (guestfs_h *g,\n"
28717 " const char *device);\n"
28722 #: ../src/guestfs-actions.pod:4200
28724 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
28725 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
28726 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
28727 "underlying block device."
28731 #: ../src/guestfs-actions.pod:4208 ../src/guestfs-actions.pod:4310
28732 #: ../src/guestfs-actions.pod:4329 ../src/guestfs-actions.pod:4379
28733 #: ../src/guestfs-actions.pod:4427
28734 msgid "(Added in 1.5.1)"
28738 #: ../src/guestfs-actions.pod:4210
28739 msgid "guestfs_luks_format"
28743 #: ../src/guestfs-actions.pod:4212
28747 " guestfs_luks_format (guestfs_h *g,\n"
28748 " const char *device,\n"
28749 " const char *key,\n"
28755 #: ../src/guestfs-actions.pod:4234
28756 msgid "guestfs_luks_format_cipher"
28760 #: ../src/guestfs-actions.pod:4236
28764 " guestfs_luks_format_cipher (guestfs_h *g,\n"
28765 " const char *device,\n"
28766 " const char *key,\n"
28768 " const char *cipher);\n"
28773 #: ../src/guestfs-actions.pod:4243
28775 "This command is the same as C<guestfs_luks_format> but it also allows you to "
28776 "set the C<cipher> used."
28780 #: ../src/guestfs-actions.pod:4257
28781 msgid "guestfs_luks_kill_slot"
28785 #: ../src/guestfs-actions.pod:4259
28789 " guestfs_luks_kill_slot (guestfs_h *g,\n"
28790 " const char *device,\n"
28791 " const char *key,\n"
28797 #: ../src/guestfs-actions.pod:4277
28798 msgid "guestfs_luks_open"
28802 #: ../src/guestfs-actions.pod:4279
28806 " guestfs_luks_open (guestfs_h *g,\n"
28807 " const char *device,\n"
28808 " const char *key,\n"
28809 " const char *mapname);\n"
28814 #: ../src/guestfs-actions.pod:4297
28816 "If this block device contains LVM volume groups, then calling "
28817 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
28822 #: ../src/guestfs-actions.pod:4301
28823 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
28827 #: ../src/guestfs-actions.pod:4312
28828 msgid "guestfs_luks_open_ro"
28832 #: ../src/guestfs-actions.pod:4314
28836 " guestfs_luks_open_ro (guestfs_h *g,\n"
28837 " const char *device,\n"
28838 " const char *key,\n"
28839 " const char *mapname);\n"
28844 #: ../src/guestfs-actions.pod:4320
28846 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
28851 #: ../src/guestfs-actions.pod:4331
28852 msgid "guestfs_lvcreate"
28856 #: ../src/guestfs-actions.pod:4333
28860 " guestfs_lvcreate (guestfs_h *g,\n"
28861 " const char *logvol,\n"
28862 " const char *volgroup,\n"
28868 #: ../src/guestfs-actions.pod:4346
28869 msgid "guestfs_lvm_canonical_lv_name"
28873 #: ../src/guestfs-actions.pod:4348
28877 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
28878 " const char *lvname);\n"
28883 #: ../src/guestfs-actions.pod:4359
28884 msgid "See also C<guestfs_is_lv>."
28888 #: ../src/guestfs-actions.pod:4364
28889 msgid "(Added in 1.5.24)"
28893 #: ../src/guestfs-actions.pod:4366
28894 msgid "guestfs_lvm_clear_filter"
28898 #: ../src/guestfs-actions.pod:4368
28902 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
28907 #: ../src/guestfs-actions.pod:4371
28909 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
28910 "see every block device."
28914 #: ../src/guestfs-actions.pod:4381
28915 msgid "guestfs_lvm_remove_all"
28919 #: ../src/guestfs-actions.pod:4383
28923 " guestfs_lvm_remove_all (guestfs_h *g);\n"
28928 #: ../src/guestfs-actions.pod:4396
28929 msgid "guestfs_lvm_set_filter"
28933 #: ../src/guestfs-actions.pod:4398
28937 " guestfs_lvm_set_filter (guestfs_h *g,\n"
28938 " char *const *devices);\n"
28943 #: ../src/guestfs-actions.pod:4429
28944 msgid "guestfs_lvremove"
28948 #: ../src/guestfs-actions.pod:4431
28952 " guestfs_lvremove (guestfs_h *g,\n"
28953 " const char *device);\n"
28958 #: ../src/guestfs-actions.pod:4443 ../src/guestfs-actions.pod:5836
28959 #: ../src/guestfs-actions.pod:7686
28960 msgid "(Added in 1.0.13)"
28964 #: ../src/guestfs-actions.pod:4445
28965 msgid "guestfs_lvrename"
28969 #: ../src/guestfs-actions.pod:4447
28973 " guestfs_lvrename (guestfs_h *g,\n"
28974 " const char *logvol,\n"
28975 " const char *newlogvol);\n"
28980 #: ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:7699
28981 msgid "(Added in 1.0.83)"
28985 #: ../src/guestfs-actions.pod:4458
28986 msgid "guestfs_lvresize"
28990 #: ../src/guestfs-actions.pod:4460
28994 " guestfs_lvresize (guestfs_h *g,\n"
28995 " const char *device,\n"
29001 #: ../src/guestfs-actions.pod:4473
29002 msgid "guestfs_lvresize_free"
29006 #: ../src/guestfs-actions.pod:4475
29010 " guestfs_lvresize_free (guestfs_h *g,\n"
29011 " const char *lv,\n"
29017 #: ../src/guestfs-actions.pod:4488
29018 msgid "(Added in 1.3.3)"
29022 #: ../src/guestfs-actions.pod:4490
29023 msgid "guestfs_lvs"
29027 #: ../src/guestfs-actions.pod:4492
29031 " guestfs_lvs (guestfs_h *g);\n"
29036 #: ../src/guestfs-actions.pod:4501
29037 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
29041 #: ../src/guestfs-actions.pod:4509
29042 msgid "guestfs_lvs_full"
29046 #: ../src/guestfs-actions.pod:4511
29049 " struct guestfs_lvm_lv_list *\n"
29050 " guestfs_lvs_full (guestfs_h *g);\n"
29055 #: ../src/guestfs-actions.pod:4517
29057 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
29058 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
29062 #: ../src/guestfs-actions.pod:4523
29063 msgid "guestfs_lvuuid"
29067 #: ../src/guestfs-actions.pod:4525
29071 " guestfs_lvuuid (guestfs_h *g,\n"
29072 " const char *device);\n"
29077 #: ../src/guestfs-actions.pod:4536
29078 msgid "guestfs_lxattrlist"
29082 #: ../src/guestfs-actions.pod:4538
29085 " struct guestfs_xattr_list *\n"
29086 " guestfs_lxattrlist (guestfs_h *g,\n"
29087 " const char *path,\n"
29088 " char *const *names);\n"
29093 #: ../src/guestfs-actions.pod:4557
29095 "This call is intended for programs that want to efficiently list a directory "
29096 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
29097 "a similarly efficient call for getting standard stats. Very long directory "
29098 "listings might cause the protocol message size to be exceeded, causing this "
29099 "call to fail. The caller must split up such requests into smaller groups of "
29104 #: ../src/guestfs-actions.pod:4571
29105 msgid "guestfs_mkdir"
29109 #: ../src/guestfs-actions.pod:4573
29113 " guestfs_mkdir (guestfs_h *g,\n"
29114 " const char *path);\n"
29119 #: ../src/guestfs-actions.pod:4583
29120 msgid "guestfs_mkdir_mode"
29124 #: ../src/guestfs-actions.pod:4585
29128 " guestfs_mkdir_mode (guestfs_h *g,\n"
29129 " const char *path,\n"
29135 #: ../src/guestfs-actions.pod:4597
29136 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
29140 #: ../src/guestfs-actions.pod:4603
29141 msgid "guestfs_mkdir_p"
29145 #: ../src/guestfs-actions.pod:4605
29149 " guestfs_mkdir_p (guestfs_h *g,\n"
29150 " const char *path);\n"
29155 #: ../src/guestfs-actions.pod:4616
29156 msgid "guestfs_mkdtemp"
29160 #: ../src/guestfs-actions.pod:4618
29164 " guestfs_mkdtemp (guestfs_h *g,\n"
29165 " const char *template);\n"
29170 #: ../src/guestfs-actions.pod:4646
29171 msgid "guestfs_mke2fs_J"
29175 #: ../src/guestfs-actions.pod:4648
29179 " guestfs_mke2fs_J (guestfs_h *g,\n"
29180 " const char *fstype,\n"
29181 " int blocksize,\n"
29182 " const char *device,\n"
29183 " const char *journal);\n"
29188 #: ../src/guestfs-actions.pod:4661
29189 msgid "See also C<guestfs_mke2journal>."
29193 #: ../src/guestfs-actions.pod:4665 ../src/guestfs-actions.pod:4683
29194 #: ../src/guestfs-actions.pod:4701 ../src/guestfs-actions.pod:4717
29195 #: ../src/guestfs-actions.pod:4731 ../src/guestfs-actions.pod:4745
29196 #: ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:5081
29197 msgid "(Added in 1.0.68)"
29201 #: ../src/guestfs-actions.pod:4667
29202 msgid "guestfs_mke2fs_JL"
29206 #: ../src/guestfs-actions.pod:4669
29210 " guestfs_mke2fs_JL (guestfs_h *g,\n"
29211 " const char *fstype,\n"
29212 " int blocksize,\n"
29213 " const char *device,\n"
29214 " const char *label);\n"
29219 #: ../src/guestfs-actions.pod:4679
29220 msgid "See also C<guestfs_mke2journal_L>."
29224 #: ../src/guestfs-actions.pod:4685
29225 msgid "guestfs_mke2fs_JU"
29229 #: ../src/guestfs-actions.pod:4687
29233 " guestfs_mke2fs_JU (guestfs_h *g,\n"
29234 " const char *fstype,\n"
29235 " int blocksize,\n"
29236 " const char *device,\n"
29237 " const char *uuid);\n"
29242 #: ../src/guestfs-actions.pod:4697
29243 msgid "See also C<guestfs_mke2journal_U>."
29247 #: ../src/guestfs-actions.pod:4703
29248 msgid "guestfs_mke2journal"
29252 #: ../src/guestfs-actions.pod:4705
29256 " guestfs_mke2journal (guestfs_h *g,\n"
29257 " int blocksize,\n"
29258 " const char *device);\n"
29263 #: ../src/guestfs-actions.pod:4719
29264 msgid "guestfs_mke2journal_L"
29268 #: ../src/guestfs-actions.pod:4721
29272 " guestfs_mke2journal_L (guestfs_h *g,\n"
29273 " int blocksize,\n"
29274 " const char *label,\n"
29275 " const char *device);\n"
29280 #: ../src/guestfs-actions.pod:4733
29281 msgid "guestfs_mke2journal_U"
29285 #: ../src/guestfs-actions.pod:4735
29289 " guestfs_mke2journal_U (guestfs_h *g,\n"
29290 " int blocksize,\n"
29291 " const char *uuid,\n"
29292 " const char *device);\n"
29297 #: ../src/guestfs-actions.pod:4747
29298 msgid "guestfs_mkfifo"
29302 #: ../src/guestfs-actions.pod:4749
29306 " guestfs_mkfifo (guestfs_h *g,\n"
29308 " const char *path);\n"
29313 #: ../src/guestfs-actions.pod:4754
29315 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
29316 "is just a convenient wrapper around C<guestfs_mknod>."
29320 #: ../src/guestfs-actions.pod:4764
29321 msgid "guestfs_mkfs"
29325 #: ../src/guestfs-actions.pod:4766
29329 " guestfs_mkfs (guestfs_h *g,\n"
29330 " const char *fstype,\n"
29331 " const char *device);\n"
29336 #: ../src/guestfs-actions.pod:4779
29337 msgid "guestfs_mkfs_b"
29341 #: ../src/guestfs-actions.pod:4781
29345 " guestfs_mkfs_b (guestfs_h *g,\n"
29346 " const char *fstype,\n"
29347 " int blocksize,\n"
29348 " const char *device);\n"
29353 #: ../src/guestfs-actions.pod:4787
29355 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
29360 #: ../src/guestfs-actions.pod:4794
29362 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
29363 "block size of the resulting filesystem. Supported block sizes depend on the "
29364 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
29368 #: ../src/guestfs-actions.pod:4806
29369 msgid "guestfs_mkfs_opts"
29373 #: ../src/guestfs-actions.pod:4808
29377 " guestfs_mkfs_opts (guestfs_h *g,\n"
29378 " const char *fstype,\n"
29379 " const char *device,\n"
29385 #: ../src/guestfs-actions.pod:4819
29388 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
29389 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
29390 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
29391 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
29396 #: ../src/guestfs-actions.pod:4867
29397 msgid "(Added in 1.7.19)"
29401 #: ../src/guestfs-actions.pod:4869
29402 msgid "guestfs_mkfs_opts_va"
29406 #: ../src/guestfs-actions.pod:4871
29410 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
29411 " const char *fstype,\n"
29412 " const char *device,\n"
29413 " va_list args);\n"
29418 #: ../src/guestfs-actions.pod:4877
29419 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
29423 #: ../src/guestfs-actions.pod:4881
29424 msgid "guestfs_mkfs_opts_argv"
29428 #: ../src/guestfs-actions.pod:4883
29432 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
29433 " const char *fstype,\n"
29434 " const char *device,\n"
29435 " const struct guestfs_mkfs_opts_argv *optargs);\n"
29440 #: ../src/guestfs-actions.pod:4889
29441 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
29445 #: ../src/guestfs-actions.pod:4893
29446 msgid "guestfs_mkmountpoint"
29450 #: ../src/guestfs-actions.pod:4895
29454 " guestfs_mkmountpoint (guestfs_h *g,\n"
29455 " const char *exemptpath);\n"
29460 #: ../src/guestfs-actions.pod:4899
29462 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
29463 "that can be used to create extra mountpoints before mounting the first "
29468 #: ../src/guestfs-actions.pod:4923
29470 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
29471 "may get unexpected errors if you try to mix these calls. It is safest to "
29472 "manually unmount filesystems and remove mountpoints after use."
29476 #: ../src/guestfs-actions.pod:4927
29478 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
29479 "first, so for this to work for manual mountpoints, you must ensure that the "
29480 "innermost mountpoints have the longest pathnames, as in the example code "
29485 #: ../src/guestfs-actions.pod:4934
29487 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
29488 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
29489 "can also trigger these issues."
29493 #: ../src/guestfs-actions.pod:4940 ../src/guestfs-actions.pod:5246
29494 #: ../src/guestfs-actions.pod:6256
29495 msgid "(Added in 1.0.62)"
29499 #: ../src/guestfs-actions.pod:4942
29500 msgid "guestfs_mknod"
29504 #: ../src/guestfs-actions.pod:4944
29508 " guestfs_mknod (guestfs_h *g,\n"
29512 " const char *path);\n"
29517 #: ../src/guestfs-actions.pod:4959
29519 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
29520 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
29521 "regular file). These constants are available in the standard Linux header "
29522 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
29523 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
29524 "the appropriate constant for you."
29528 #: ../src/guestfs-actions.pod:4973
29529 msgid "guestfs_mknod_b"
29533 #: ../src/guestfs-actions.pod:4975
29537 " guestfs_mknod_b (guestfs_h *g,\n"
29541 " const char *path);\n"
29546 #: ../src/guestfs-actions.pod:4982
29548 "This call creates a block device node called C<path> with mode C<mode> and "
29549 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29550 "wrapper around C<guestfs_mknod>."
29554 #: ../src/guestfs-actions.pod:4992
29555 msgid "guestfs_mknod_c"
29559 #: ../src/guestfs-actions.pod:4994
29563 " guestfs_mknod_c (guestfs_h *g,\n"
29567 " const char *path);\n"
29572 #: ../src/guestfs-actions.pod:5001
29574 "This call creates a char device node called C<path> with mode C<mode> and "
29575 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29576 "wrapper around C<guestfs_mknod>."
29580 #: ../src/guestfs-actions.pod:5011
29581 msgid "guestfs_mkswap"
29585 #: ../src/guestfs-actions.pod:5013
29589 " guestfs_mkswap (guestfs_h *g,\n"
29590 " const char *device);\n"
29595 #: ../src/guestfs-actions.pod:5023
29596 msgid "guestfs_mkswap_L"
29600 #: ../src/guestfs-actions.pod:5025
29604 " guestfs_mkswap_L (guestfs_h *g,\n"
29605 " const char *label,\n"
29606 " const char *device);\n"
29611 #: ../src/guestfs-actions.pod:5040
29612 msgid "guestfs_mkswap_U"
29616 #: ../src/guestfs-actions.pod:5042
29620 " guestfs_mkswap_U (guestfs_h *g,\n"
29621 " const char *uuid,\n"
29622 " const char *device);\n"
29627 #: ../src/guestfs-actions.pod:5053
29628 msgid "guestfs_mkswap_file"
29632 #: ../src/guestfs-actions.pod:5055
29636 " guestfs_mkswap_file (guestfs_h *g,\n"
29637 " const char *path);\n"
29642 #: ../src/guestfs-actions.pod:5061
29644 "This command just writes a swap file signature to an existing file. To "
29645 "create the file itself, use something like C<guestfs_fallocate>."
29649 #: ../src/guestfs-actions.pod:5068
29650 msgid "guestfs_modprobe"
29654 #: ../src/guestfs-actions.pod:5070
29658 " guestfs_modprobe (guestfs_h *g,\n"
29659 " const char *modulename);\n"
29664 #: ../src/guestfs-actions.pod:5083
29665 msgid "guestfs_mount"
29669 #: ../src/guestfs-actions.pod:5085
29673 " guestfs_mount (guestfs_h *g,\n"
29674 " const char *device,\n"
29675 " const char *mountpoint);\n"
29680 #: ../src/guestfs-actions.pod:5104
29682 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
29683 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
29684 "problems for users. If your program might need to work with older versions "
29685 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
29686 "for the first parameter if you don't want any options)."
29690 #: ../src/guestfs-actions.pod:5115
29691 msgid "guestfs_mount_9p"
29695 #: ../src/guestfs-actions.pod:5117
29699 " guestfs_mount_9p (guestfs_h *g,\n"
29700 " const char *mounttag,\n"
29701 " const char *mountpoint,\n"
29707 #: ../src/guestfs-actions.pod:5128
29710 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
29715 #: ../src/guestfs-actions.pod:5141
29716 msgid "guestfs_mount_9p_va"
29720 #: ../src/guestfs-actions.pod:5143
29724 " guestfs_mount_9p_va (guestfs_h *g,\n"
29725 " const char *mounttag,\n"
29726 " const char *mountpoint,\n"
29727 " va_list args);\n"
29732 #: ../src/guestfs-actions.pod:5149
29733 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
29737 #: ../src/guestfs-actions.pod:5153
29738 msgid "guestfs_mount_9p_argv"
29742 #: ../src/guestfs-actions.pod:5155
29746 " guestfs_mount_9p_argv (guestfs_h *g,\n"
29747 " const char *mounttag,\n"
29748 " const char *mountpoint,\n"
29749 " const struct guestfs_mount_9p_argv *optargs);\n"
29754 #: ../src/guestfs-actions.pod:5161
29755 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
29759 #: ../src/guestfs-actions.pod:5165
29760 msgid "guestfs_mount_loop"
29764 #: ../src/guestfs-actions.pod:5167
29768 " guestfs_mount_loop (guestfs_h *g,\n"
29769 " const char *file,\n"
29770 " const char *mountpoint);\n"
29775 #: ../src/guestfs-actions.pod:5180
29776 msgid "guestfs_mount_options"
29780 #: ../src/guestfs-actions.pod:5182
29784 " guestfs_mount_options (guestfs_h *g,\n"
29785 " const char *options,\n"
29786 " const char *device,\n"
29787 " const char *mountpoint);\n"
29792 #: ../src/guestfs-actions.pod:5188
29794 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29795 "the mount options as for the L<mount(8)> I<-o> flag."
29799 #: ../src/guestfs-actions.pod:5198 ../src/guestfs-actions.pod:5212
29800 #: ../src/guestfs-actions.pod:5229
29801 msgid "(Added in 1.0.10)"
29805 #: ../src/guestfs-actions.pod:5200
29806 msgid "guestfs_mount_ro"
29810 #: ../src/guestfs-actions.pod:5202
29814 " guestfs_mount_ro (guestfs_h *g,\n"
29815 " const char *device,\n"
29816 " const char *mountpoint);\n"
29821 #: ../src/guestfs-actions.pod:5207
29823 "This is the same as the C<guestfs_mount> command, but it mounts the "
29824 "filesystem with the read-only (I<-o ro>) flag."
29828 #: ../src/guestfs-actions.pod:5214
29829 msgid "guestfs_mount_vfs"
29833 #: ../src/guestfs-actions.pod:5216
29837 " guestfs_mount_vfs (guestfs_h *g,\n"
29838 " const char *options,\n"
29839 " const char *vfstype,\n"
29840 " const char *device,\n"
29841 " const char *mountpoint);\n"
29846 #: ../src/guestfs-actions.pod:5223
29848 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29849 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
29854 #: ../src/guestfs-actions.pod:5231
29855 msgid "guestfs_mountpoints"
29859 #: ../src/guestfs-actions.pod:5233
29863 " guestfs_mountpoints (guestfs_h *g);\n"
29868 #: ../src/guestfs-actions.pod:5236
29870 "This call is similar to C<guestfs_mounts>. That call returns a list of "
29871 "devices. This one returns a hash table (map) of device name to directory "
29872 "where the device is mounted."
29876 #: ../src/guestfs-actions.pod:5248
29877 msgid "guestfs_mounts"
29881 #: ../src/guestfs-actions.pod:5250
29885 " guestfs_mounts (guestfs_h *g);\n"
29890 #: ../src/guestfs-actions.pod:5258
29891 msgid "See also: C<guestfs_mountpoints>"
29895 #: ../src/guestfs-actions.pod:5266
29900 #: ../src/guestfs-actions.pod:5268
29904 " guestfs_mv (guestfs_h *g,\n"
29905 " const char *src,\n"
29906 " const char *dest);\n"
29911 #: ../src/guestfs-actions.pod:5280
29912 msgid "guestfs_ntfs_3g_probe"
29916 #: ../src/guestfs-actions.pod:5282
29920 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
29922 " const char *device);\n"
29927 #: ../src/guestfs-actions.pod:5301
29928 msgid "(Added in 1.0.43)"
29932 #: ../src/guestfs-actions.pod:5303
29933 msgid "guestfs_ntfsresize"
29937 #: ../src/guestfs-actions.pod:5305
29941 " guestfs_ntfsresize (guestfs_h *g,\n"
29942 " const char *device);\n"
29947 #: ../src/guestfs-actions.pod:5309 ../src/guestfs-actions.pod:5409
29949 "I<This function is deprecated.> In new code, use the L</"
29950 "guestfs_ntfsresize_opts> call instead."
29954 #: ../src/guestfs-actions.pod:5333
29955 msgid "guestfs_ntfsresize_opts"
29959 #: ../src/guestfs-actions.pod:5335
29963 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
29964 " const char *device,\n"
29970 #: ../src/guestfs-actions.pod:5345
29973 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
29974 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
29979 #: ../src/guestfs-actions.pod:5365
29981 "After the resize operation, the filesystem is always marked as requiring a "
29982 "consistency check (for safety). You have to boot into Windows to perform "
29983 "this check and clear this condition. If you I<don't> set the C<force> "
29984 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
29985 "times on a single filesystem without booting into Windows between each "
29990 #: ../src/guestfs-actions.pod:5380
29991 msgid "guestfs_ntfsresize_opts_va"
29995 #: ../src/guestfs-actions.pod:5382
29999 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
30000 " const char *device,\n"
30001 " va_list args);\n"
30006 #: ../src/guestfs-actions.pod:5387
30007 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
30011 #: ../src/guestfs-actions.pod:5391
30012 msgid "guestfs_ntfsresize_opts_argv"
30016 #: ../src/guestfs-actions.pod:5393
30020 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
30021 " const char *device,\n"
30022 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
30027 #: ../src/guestfs-actions.pod:5398
30028 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
30032 #: ../src/guestfs-actions.pod:5402
30033 msgid "guestfs_ntfsresize_size"
30037 #: ../src/guestfs-actions.pod:5404
30041 " guestfs_ntfsresize_size (guestfs_h *g,\n"
30042 " const char *device,\n"
30043 " int64_t size);\n"
30048 #: ../src/guestfs-actions.pod:5416
30050 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
30051 "to specify the new size (in bytes) explicitly."
30055 #: ../src/guestfs-actions.pod:5421 ../src/guestfs-actions.pod:5863
30056 #: ../src/guestfs-actions.pod:5936 ../src/guestfs-actions.pod:6204
30057 #: ../src/guestfs-actions.pod:7843
30058 msgid "(Added in 1.3.14)"
30062 #: ../src/guestfs-actions.pod:5423
30063 msgid "guestfs_part_add"
30067 #: ../src/guestfs-actions.pod:5425
30071 " guestfs_part_add (guestfs_h *g,\n"
30072 " const char *device,\n"
30073 " const char *prlogex,\n"
30074 " int64_t startsect,\n"
30075 " int64_t endsect);\n"
30080 #: ../src/guestfs-actions.pod:5432
30082 "This command adds a partition to C<device>. If there is no partition table "
30083 "on the device, call C<guestfs_part_init> first."
30087 #: ../src/guestfs-actions.pod:5444
30089 "Creating a partition which covers the whole disk is not so easy. Use "
30090 "C<guestfs_part_disk> to do that."
30094 #: ../src/guestfs-actions.pod:5449 ../src/guestfs-actions.pod:5487
30095 #: ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5624
30096 #: ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:5681
30097 #: ../src/guestfs-actions.pod:5721
30098 msgid "(Added in 1.0.78)"
30102 #: ../src/guestfs-actions.pod:5451
30103 msgid "guestfs_part_del"
30107 #: ../src/guestfs-actions.pod:5453
30111 " guestfs_part_del (guestfs_h *g,\n"
30112 " const char *device,\n"
30118 #: ../src/guestfs-actions.pod:5468
30119 msgid "guestfs_part_disk"
30123 #: ../src/guestfs-actions.pod:5470
30127 " guestfs_part_disk (guestfs_h *g,\n"
30128 " const char *device,\n"
30129 " const char *parttype);\n"
30134 #: ../src/guestfs-actions.pod:5475
30136 "This command is simply a combination of C<guestfs_part_init> followed by "
30137 "C<guestfs_part_add> to create a single primary partition covering the whole "
30142 #: ../src/guestfs-actions.pod:5479
30144 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
30145 "possible values are described in C<guestfs_part_init>."
30149 #: ../src/guestfs-actions.pod:5489
30150 msgid "guestfs_part_get_bootable"
30154 #: ../src/guestfs-actions.pod:5491
30158 " guestfs_part_get_bootable (guestfs_h *g,\n"
30159 " const char *device,\n"
30165 #: ../src/guestfs-actions.pod:5499
30166 msgid "See also C<guestfs_part_set_bootable>."
30170 #: ../src/guestfs-actions.pod:5505
30171 msgid "guestfs_part_get_mbr_id"
30175 #: ../src/guestfs-actions.pod:5507
30179 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
30180 " const char *device,\n"
30186 #: ../src/guestfs-actions.pod:5515 ../src/guestfs-actions.pod:5697
30188 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
30189 "undefined results for other partition table types (see "
30190 "C<guestfs_part_get_parttype>)."
30194 #: ../src/guestfs-actions.pod:5523
30195 msgid "guestfs_part_get_parttype"
30199 #: ../src/guestfs-actions.pod:5525
30203 " guestfs_part_get_parttype (guestfs_h *g,\n"
30204 " const char *device);\n"
30209 #: ../src/guestfs-actions.pod:5532
30211 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
30212 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
30213 "possible, although unusual. See C<guestfs_part_init> for a full list."
30217 #: ../src/guestfs-actions.pod:5542
30218 msgid "guestfs_part_init"
30222 #: ../src/guestfs-actions.pod:5544
30226 " guestfs_part_init (guestfs_h *g,\n"
30227 " const char *device,\n"
30228 " const char *parttype);\n"
30233 #: ../src/guestfs-actions.pod:5553
30235 "Initially there are no partitions. Following this, you should call "
30236 "C<guestfs_part_add> for each partition required."
30240 #: ../src/guestfs-actions.pod:5626
30241 msgid "guestfs_part_list"
30245 #: ../src/guestfs-actions.pod:5628
30248 " struct guestfs_partition_list *\n"
30249 " guestfs_part_list (guestfs_h *g,\n"
30250 " const char *device);\n"
30255 #: ../src/guestfs-actions.pod:5645
30257 "Start of the partition I<in bytes>. To get sectors you have to divide by "
30258 "the device's sector size, see C<guestfs_blockdev_getss>."
30262 #: ../src/guestfs-actions.pod:5658
30264 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
30265 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
30270 #: ../src/guestfs-actions.pod:5664
30271 msgid "guestfs_part_set_bootable"
30275 #: ../src/guestfs-actions.pod:5666
30279 " guestfs_part_set_bootable (guestfs_h *g,\n"
30280 " const char *device,\n"
30282 " int bootable);\n"
30287 #: ../src/guestfs-actions.pod:5683
30288 msgid "guestfs_part_set_mbr_id"
30292 #: ../src/guestfs-actions.pod:5685
30296 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
30297 " const char *device,\n"
30304 #: ../src/guestfs-actions.pod:5705
30305 msgid "guestfs_part_set_name"
30309 #: ../src/guestfs-actions.pod:5707
30313 " guestfs_part_set_name (guestfs_h *g,\n"
30314 " const char *device,\n"
30316 " const char *name);\n"
30321 #: ../src/guestfs-actions.pod:5723
30322 msgid "guestfs_part_to_dev"
30326 #: ../src/guestfs-actions.pod:5725
30330 " guestfs_part_to_dev (guestfs_h *g,\n"
30331 " const char *partition);\n"
30336 #: ../src/guestfs-actions.pod:5733
30338 "The named partition must exist, for example as a string returned from "
30339 "C<guestfs_list_partitions>."
30343 #: ../src/guestfs-actions.pod:5741
30344 msgid "guestfs_ping_daemon"
30348 #: ../src/guestfs-actions.pod:5743
30352 " guestfs_ping_daemon (guestfs_h *g);\n"
30357 #: ../src/guestfs-actions.pod:5755
30358 msgid "guestfs_pread"
30362 #: ../src/guestfs-actions.pod:5757
30366 " guestfs_pread (guestfs_h *g,\n"
30367 " const char *path,\n"
30369 " int64_t offset,\n"
30370 " size_t *size_r);\n"
30375 #: ../src/guestfs-actions.pod:5770
30376 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
30380 #: ../src/guestfs-actions.pod:5781
30381 msgid "guestfs_pread_device"
30385 #: ../src/guestfs-actions.pod:5783
30389 " guestfs_pread_device (guestfs_h *g,\n"
30390 " const char *device,\n"
30392 " int64_t offset,\n"
30393 " size_t *size_r);\n"
30398 #: ../src/guestfs-actions.pod:5796
30399 msgid "See also C<guestfs_pread>."
30403 #: ../src/guestfs-actions.pod:5805
30404 msgid "(Added in 1.5.21)"
30408 #: ../src/guestfs-actions.pod:5807
30409 msgid "guestfs_pvcreate"
30413 #: ../src/guestfs-actions.pod:5809
30417 " guestfs_pvcreate (guestfs_h *g,\n"
30418 " const char *device);\n"
30423 #: ../src/guestfs-actions.pod:5821
30424 msgid "guestfs_pvremove"
30428 #: ../src/guestfs-actions.pod:5823
30432 " guestfs_pvremove (guestfs_h *g,\n"
30433 " const char *device);\n"
30438 #: ../src/guestfs-actions.pod:5838
30439 msgid "guestfs_pvresize"
30443 #: ../src/guestfs-actions.pod:5840
30447 " guestfs_pvresize (guestfs_h *g,\n"
30448 " const char *device);\n"
30453 #: ../src/guestfs-actions.pod:5851
30454 msgid "guestfs_pvresize_size"
30458 #: ../src/guestfs-actions.pod:5853
30462 " guestfs_pvresize_size (guestfs_h *g,\n"
30463 " const char *device,\n"
30464 " int64_t size);\n"
30469 #: ../src/guestfs-actions.pod:5858
30471 "This command is the same as C<guestfs_pvresize> except that it allows you to "
30472 "specify the new size (in bytes) explicitly."
30476 #: ../src/guestfs-actions.pod:5865
30477 msgid "guestfs_pvs"
30481 #: ../src/guestfs-actions.pod:5867
30485 " guestfs_pvs (guestfs_h *g);\n"
30490 #: ../src/guestfs-actions.pod:5876
30491 msgid "See also C<guestfs_pvs_full>."
30495 #: ../src/guestfs-actions.pod:5884
30496 msgid "guestfs_pvs_full"
30500 #: ../src/guestfs-actions.pod:5886
30503 " struct guestfs_lvm_pv_list *\n"
30504 " guestfs_pvs_full (guestfs_h *g);\n"
30509 #: ../src/guestfs-actions.pod:5892
30511 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
30512 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
30516 #: ../src/guestfs-actions.pod:5898
30517 msgid "guestfs_pvuuid"
30521 #: ../src/guestfs-actions.pod:5900
30525 " guestfs_pvuuid (guestfs_h *g,\n"
30526 " const char *device);\n"
30531 #: ../src/guestfs-actions.pod:5911
30532 msgid "guestfs_pwrite"
30536 #: ../src/guestfs-actions.pod:5913
30540 " guestfs_pwrite (guestfs_h *g,\n"
30541 " const char *path,\n"
30542 " const char *content,\n"
30543 " size_t content_size,\n"
30544 " int64_t offset);\n"
30549 #: ../src/guestfs-actions.pod:5929
30550 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
30554 #: ../src/guestfs-actions.pod:5938
30555 msgid "guestfs_pwrite_device"
30559 #: ../src/guestfs-actions.pod:5940
30563 " guestfs_pwrite_device (guestfs_h *g,\n"
30564 " const char *device,\n"
30565 " const char *content,\n"
30566 " size_t content_size,\n"
30567 " int64_t offset);\n"
30572 #: ../src/guestfs-actions.pod:5955
30573 msgid "See also C<guestfs_pwrite>."
30577 #: ../src/guestfs-actions.pod:5962
30578 msgid "(Added in 1.5.20)"
30582 #: ../src/guestfs-actions.pod:5964
30583 msgid "guestfs_read_file"
30587 #: ../src/guestfs-actions.pod:5966
30591 " guestfs_read_file (guestfs_h *g,\n"
30592 " const char *path,\n"
30593 " size_t *size_r);\n"
30598 #: ../src/guestfs-actions.pod:5974
30600 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
30601 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
30602 "function is limited in the total size of file that can be handled."
30606 #: ../src/guestfs-actions.pod:5986
30607 msgid "(Added in 1.0.63)"
30611 #: ../src/guestfs-actions.pod:5988
30612 msgid "guestfs_read_lines"
30616 #: ../src/guestfs-actions.pod:5990
30620 " guestfs_read_lines (guestfs_h *g,\n"
30621 " const char *path);\n"
30626 #: ../src/guestfs-actions.pod:5999
30628 "Note that this function cannot correctly handle binary files (specifically, "
30629 "files containing C<\\0> character which is treated as end of line). For "
30630 "those you need to use the C<guestfs_read_file> function which has a more "
30631 "complex interface."
30635 #: ../src/guestfs-actions.pod:6010
30636 msgid "guestfs_readdir"
30640 #: ../src/guestfs-actions.pod:6012
30643 " struct guestfs_dirent_list *\n"
30644 " guestfs_readdir (guestfs_h *g,\n"
30645 " const char *dir);\n"
30650 #: ../src/guestfs-actions.pod:6066
30652 "This function is primarily intended for use by programs. To get a simple "
30653 "list of names, use C<guestfs_ls>. To get a printable directory for human "
30654 "consumption, use C<guestfs_ll>."
30658 #: ../src/guestfs-actions.pod:6070
30660 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
30661 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
30665 #: ../src/guestfs-actions.pod:6076
30666 msgid "guestfs_readlink"
30670 #: ../src/guestfs-actions.pod:6078
30674 " guestfs_readlink (guestfs_h *g,\n"
30675 " const char *path);\n"
30680 #: ../src/guestfs-actions.pod:6089
30681 msgid "guestfs_readlinklist"
30685 #: ../src/guestfs-actions.pod:6091
30689 " guestfs_readlinklist (guestfs_h *g,\n"
30690 " const char *path,\n"
30691 " char *const *names);\n"
30696 #: ../src/guestfs-actions.pod:6124
30697 msgid "guestfs_realpath"
30701 #: ../src/guestfs-actions.pod:6126
30705 " guestfs_realpath (guestfs_h *g,\n"
30706 " const char *path);\n"
30711 #: ../src/guestfs-actions.pod:6138
30712 msgid "guestfs_removexattr"
30716 #: ../src/guestfs-actions.pod:6140
30720 " guestfs_removexattr (guestfs_h *g,\n"
30721 " const char *xattr,\n"
30722 " const char *path);\n"
30727 #: ../src/guestfs-actions.pod:6148
30728 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
30732 #: ../src/guestfs-actions.pod:6154
30733 msgid "guestfs_resize2fs"
30737 #: ../src/guestfs-actions.pod:6156
30741 " guestfs_resize2fs (guestfs_h *g,\n"
30742 " const char *device);\n"
30747 #: ../src/guestfs-actions.pod:6163
30749 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
30750 "C<device> before calling this command. For unknown reasons C<resize2fs> "
30751 "sometimes gives an error about this and sometimes not. In any case, it is "
30752 "always safe to call C<guestfs_e2fsck_f> before calling this function."
30756 #: ../src/guestfs-actions.pod:6173
30757 msgid "guestfs_resize2fs_M"
30761 #: ../src/guestfs-actions.pod:6175
30765 " guestfs_resize2fs_M (guestfs_h *g,\n"
30766 " const char *device);\n"
30771 #: ../src/guestfs-actions.pod:6179
30773 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
30774 "resized to its minimum size. This works like the I<-M> option to the "
30775 "C<resize2fs> command."
30779 #: ../src/guestfs-actions.pod:6183
30781 "To get the resulting size of the filesystem you should call "
30782 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
30783 "These two numbers, multiplied together, give the resulting size of the "
30784 "minimal filesystem in bytes."
30788 #: ../src/guestfs-actions.pod:6192
30789 msgid "guestfs_resize2fs_size"
30793 #: ../src/guestfs-actions.pod:6194
30797 " guestfs_resize2fs_size (guestfs_h *g,\n"
30798 " const char *device,\n"
30799 " int64_t size);\n"
30804 #: ../src/guestfs-actions.pod:6199
30806 "This command is the same as C<guestfs_resize2fs> except that it allows you "
30807 "to specify the new size (in bytes) explicitly."
30811 #: ../src/guestfs-actions.pod:6206
30816 #: ../src/guestfs-actions.pod:6208
30820 " guestfs_rm (guestfs_h *g,\n"
30821 " const char *path);\n"
30826 #: ../src/guestfs-actions.pod:6218
30827 msgid "guestfs_rm_rf"
30831 #: ../src/guestfs-actions.pod:6220
30835 " guestfs_rm_rf (guestfs_h *g,\n"
30836 " const char *path);\n"
30841 #: ../src/guestfs-actions.pod:6232
30842 msgid "guestfs_rmdir"
30846 #: ../src/guestfs-actions.pod:6234
30850 " guestfs_rmdir (guestfs_h *g,\n"
30851 " const char *path);\n"
30856 #: ../src/guestfs-actions.pod:6244
30857 msgid "guestfs_rmmountpoint"
30861 #: ../src/guestfs-actions.pod:6246
30865 " guestfs_rmmountpoint (guestfs_h *g,\n"
30866 " const char *exemptpath);\n"
30871 #: ../src/guestfs-actions.pod:6250
30873 "This calls removes a mountpoint that was previously created with "
30874 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
30878 #: ../src/guestfs-actions.pod:6258
30879 msgid "guestfs_scrub_device"
30883 #: ../src/guestfs-actions.pod:6260
30887 " guestfs_scrub_device (guestfs_h *g,\n"
30888 " const char *device);\n"
30893 #: ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6293
30894 #: ../src/guestfs-actions.pod:6312
30895 msgid "(Added in 1.0.52)"
30899 #: ../src/guestfs-actions.pod:6277
30900 msgid "guestfs_scrub_file"
30904 #: ../src/guestfs-actions.pod:6279
30908 " guestfs_scrub_file (guestfs_h *g,\n"
30909 " const char *file);\n"
30914 #: ../src/guestfs-actions.pod:6295
30915 msgid "guestfs_scrub_freespace"
30919 #: ../src/guestfs-actions.pod:6297
30923 " guestfs_scrub_freespace (guestfs_h *g,\n"
30924 " const char *dir);\n"
30929 #: ../src/guestfs-actions.pod:6301
30931 "This command creates the directory C<dir> and then fills it with files until "
30932 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
30933 "and deletes them. The intention is to scrub any free space on the partition "
30934 "containing C<dir>."
30938 #: ../src/guestfs-actions.pod:6314
30939 msgid "guestfs_set_append"
30943 #: ../src/guestfs-actions.pod:6316
30947 " guestfs_set_append (guestfs_h *g,\n"
30948 " const char *append);\n"
30953 #: ../src/guestfs-actions.pod:6333
30954 msgid "guestfs_set_attach_method"
30958 #: ../src/guestfs-actions.pod:6335
30962 " guestfs_set_attach_method (guestfs_h *g,\n"
30963 " const char *attachmethod);\n"
30968 #: ../src/guestfs-actions.pod:6363
30969 msgid "guestfs_set_autosync"
30973 #: ../src/guestfs-actions.pod:6365
30977 " guestfs_set_autosync (guestfs_h *g,\n"
30978 " int autosync);\n"
30983 #: ../src/guestfs-actions.pod:6381
30984 msgid "guestfs_set_direct"
30988 #: ../src/guestfs-actions.pod:6383
30992 " guestfs_set_direct (guestfs_h *g,\n"
30998 #: ../src/guestfs-actions.pod:6391
31000 "One consequence of this is that log messages aren't caught by the library "
31001 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
31006 #: ../src/guestfs-actions.pod:6404
31007 msgid "guestfs_set_e2label"
31011 #: ../src/guestfs-actions.pod:6406
31015 " guestfs_set_e2label (guestfs_h *g,\n"
31016 " const char *device,\n"
31017 " const char *label);\n"
31022 #: ../src/guestfs-actions.pod:6415
31024 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
31025 "the existing label on a filesystem."
31029 #: ../src/guestfs-actions.pod:6422
31030 msgid "guestfs_set_e2uuid"
31034 #: ../src/guestfs-actions.pod:6424
31038 " guestfs_set_e2uuid (guestfs_h *g,\n"
31039 " const char *device,\n"
31040 " const char *uuid);\n"
31045 #: ../src/guestfs-actions.pod:6434
31047 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
31048 "the existing UUID of a filesystem."
31052 #: ../src/guestfs-actions.pod:6441
31053 msgid "guestfs_set_memsize"
31057 #: ../src/guestfs-actions.pod:6443
31061 " guestfs_set_memsize (guestfs_h *g,\n"
31067 #: ../src/guestfs-actions.pod:6447
31069 "This sets the memory size in megabytes allocated to the qemu subprocess. "
31070 "This only has any effect if called before C<guestfs_launch>."
31074 #: ../src/guestfs-actions.pod:6462
31075 msgid "guestfs_set_network"
31079 #: ../src/guestfs-actions.pod:6464
31083 " guestfs_set_network (guestfs_h *g,\n"
31089 #: ../src/guestfs-actions.pod:6474
31091 "You must call this before calling C<guestfs_launch>, otherwise it has no "
31096 #: ../src/guestfs-actions.pod:6481
31097 msgid "guestfs_set_path"
31101 #: ../src/guestfs-actions.pod:6483
31105 " guestfs_set_path (guestfs_h *g,\n"
31106 " const char *searchpath);\n"
31111 #: ../src/guestfs-actions.pod:6498
31112 msgid "guestfs_set_pgroup"
31116 #: ../src/guestfs-actions.pod:6500
31120 " guestfs_set_pgroup (guestfs_h *g,\n"
31126 #: ../src/guestfs-actions.pod:6517
31127 msgid "guestfs_set_qemu"
31131 #: ../src/guestfs-actions.pod:6519
31135 " guestfs_set_qemu (guestfs_h *g,\n"
31136 " const char *qemu);\n"
31141 #: ../src/guestfs-actions.pod:6545
31142 msgid "guestfs_set_recovery_proc"
31146 #: ../src/guestfs-actions.pod:6547
31150 " guestfs_set_recovery_proc (guestfs_h *g,\n"
31151 " int recoveryproc);\n"
31156 #: ../src/guestfs-actions.pod:6551
31158 "If this is called with the parameter C<false> then C<guestfs_launch> does "
31159 "not create a recovery process. The purpose of the recovery process is to "
31160 "stop runaway qemu processes in the case where the main program aborts "
31165 #: ../src/guestfs-actions.pod:6556
31167 "This only has any effect if called before C<guestfs_launch>, and the default "
31172 #: ../src/guestfs-actions.pod:6569
31173 msgid "guestfs_set_selinux"
31177 #: ../src/guestfs-actions.pod:6571
31181 " guestfs_set_selinux (guestfs_h *g,\n"
31187 #: ../src/guestfs-actions.pod:6588
31188 msgid "guestfs_set_smp"
31192 #: ../src/guestfs-actions.pod:6590
31196 " guestfs_set_smp (guestfs_h *g,\n"
31202 #: ../src/guestfs-actions.pod:6598
31203 msgid "This function must be called before C<guestfs_launch>."
31207 #: ../src/guestfs-actions.pod:6604
31208 msgid "guestfs_set_trace"
31212 #: ../src/guestfs-actions.pod:6606
31216 " guestfs_set_trace (guestfs_h *g,\n"
31222 #: ../src/guestfs-actions.pod:6620
31224 "Trace messages are normally sent to C<stderr>, unless you register a "
31225 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
31229 #: ../src/guestfs-actions.pod:6628
31230 msgid "guestfs_set_verbose"
31234 #: ../src/guestfs-actions.pod:6630
31238 " guestfs_set_verbose (guestfs_h *g,\n"
31244 #: ../src/guestfs-actions.pod:6639
31246 "Verbose messages are normally sent to C<stderr>, unless you register a "
31247 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
31251 #: ../src/guestfs-actions.pod:6647
31252 msgid "guestfs_setcon"
31256 #: ../src/guestfs-actions.pod:6649
31260 " guestfs_setcon (guestfs_h *g,\n"
31261 " const char *context);\n"
31266 #: ../src/guestfs-actions.pod:6662
31267 msgid "guestfs_setxattr"
31271 #: ../src/guestfs-actions.pod:6664
31275 " guestfs_setxattr (guestfs_h *g,\n"
31276 " const char *xattr,\n"
31277 " const char *val,\n"
31279 " const char *path);\n"
31284 #: ../src/guestfs-actions.pod:6675
31285 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
31289 #: ../src/guestfs-actions.pod:6681
31290 msgid "guestfs_sfdisk"
31294 #: ../src/guestfs-actions.pod:6683
31298 " guestfs_sfdisk (guestfs_h *g,\n"
31299 " const char *device,\n"
31303 " char *const *lines);\n"
31308 #: ../src/guestfs-actions.pod:6691 ../src/guestfs-actions.pod:6735
31309 #: ../src/guestfs-actions.pod:6769
31311 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
31316 #: ../src/guestfs-actions.pod:6718
31318 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
31322 #: ../src/guestfs-actions.pod:6728
31323 msgid "guestfs_sfdiskM"
31327 #: ../src/guestfs-actions.pod:6730
31331 " guestfs_sfdiskM (guestfs_h *g,\n"
31332 " const char *device,\n"
31333 " char *const *lines);\n"
31338 #: ../src/guestfs-actions.pod:6742
31340 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
31341 "partition sizes are specified in megabytes only (rounded to the nearest "
31342 "cylinder) and you don't need to specify the cyls, heads and sectors "
31343 "parameters which were rarely if ever used anyway."
31347 #: ../src/guestfs-actions.pod:6748
31349 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
31350 "C<guestfs_part_disk>"
31354 #: ../src/guestfs-actions.pod:6758
31355 msgid "guestfs_sfdisk_N"
31359 #: ../src/guestfs-actions.pod:6760
31363 " guestfs_sfdisk_N (guestfs_h *g,\n"
31364 " const char *device,\n"
31369 " const char *line);\n"
31374 #: ../src/guestfs-actions.pod:6779
31376 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
31377 "for the cyls/heads/sectors parameters."
31381 #: ../src/guestfs-actions.pod:6782
31382 msgid "See also: C<guestfs_part_add>"
31386 #: ../src/guestfs-actions.pod:6791
31387 msgid "guestfs_sfdisk_disk_geometry"
31391 #: ../src/guestfs-actions.pod:6793
31395 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
31396 " const char *device);\n"
31401 #: ../src/guestfs-actions.pod:6797
31403 "This displays the disk geometry of C<device> read from the partition table. "
31404 "Especially in the case where the underlying block device has been resized, "
31405 "this can be different from the kernel's idea of the geometry (see "
31406 "C<guestfs_sfdisk_kernel_geometry>)."
31410 #: ../src/guestfs-actions.pod:6810
31411 msgid "guestfs_sfdisk_kernel_geometry"
31415 #: ../src/guestfs-actions.pod:6812
31419 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
31420 " const char *device);\n"
31425 #: ../src/guestfs-actions.pod:6826
31426 msgid "guestfs_sfdisk_l"
31430 #: ../src/guestfs-actions.pod:6828
31434 " guestfs_sfdisk_l (guestfs_h *g,\n"
31435 " const char *device);\n"
31440 #: ../src/guestfs-actions.pod:6832
31442 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
31447 #: ../src/guestfs-actions.pod:6843
31448 msgid "See also: C<guestfs_part_list>"
31452 #: ../src/guestfs-actions.pod:6850
31457 #: ../src/guestfs-actions.pod:6852
31461 " guestfs_sh (guestfs_h *g,\n"
31462 " const char *command);\n"
31467 #: ../src/guestfs-actions.pod:6859
31468 msgid "This is like C<guestfs_command>, but passes the command to:"
31472 #: ../src/guestfs-actions.pod:6867
31473 msgid "All the provisos about C<guestfs_command> apply to this call."
31477 #: ../src/guestfs-actions.pod:6874
31478 msgid "guestfs_sh_lines"
31482 #: ../src/guestfs-actions.pod:6876
31486 " guestfs_sh_lines (guestfs_h *g,\n"
31487 " const char *command);\n"
31492 #: ../src/guestfs-actions.pod:6880
31494 "This is the same as C<guestfs_sh>, but splits the result into a list of "
31499 #: ../src/guestfs-actions.pod:6883
31500 msgid "See also: C<guestfs_command_lines>"
31504 #: ../src/guestfs-actions.pod:6891
31505 msgid "guestfs_sleep"
31509 #: ../src/guestfs-actions.pod:6893
31513 " guestfs_sleep (guestfs_h *g,\n"
31519 #: ../src/guestfs-actions.pod:6901
31520 msgid "(Added in 1.0.41)"
31524 #: ../src/guestfs-actions.pod:6903 ../src/guestfs-structs.pod:109
31525 msgid "guestfs_stat"
31529 #: ../src/guestfs-actions.pod:6905
31532 " struct guestfs_stat *\n"
31533 " guestfs_stat (guestfs_h *g,\n"
31534 " const char *path);\n"
31539 #: ../src/guestfs-actions.pod:6919 ../src/guestfs-structs.pod:135
31540 msgid "guestfs_statvfs"
31544 #: ../src/guestfs-actions.pod:6921
31547 " struct guestfs_statvfs *\n"
31548 " guestfs_statvfs (guestfs_h *g,\n"
31549 " const char *path);\n"
31554 #: ../src/guestfs-actions.pod:6931
31556 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
31557 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
31561 #: ../src/guestfs-actions.pod:6937
31562 msgid "guestfs_strings"
31566 #: ../src/guestfs-actions.pod:6939
31570 " guestfs_strings (guestfs_h *g,\n"
31571 " const char *path);\n"
31576 #: ../src/guestfs-actions.pod:6955
31577 msgid "guestfs_strings_e"
31581 #: ../src/guestfs-actions.pod:6957
31585 " guestfs_strings_e (guestfs_h *g,\n"
31586 " const char *encoding,\n"
31587 " const char *path);\n"
31592 #: ../src/guestfs-actions.pod:6962
31594 "This is like the C<guestfs_strings> command, but allows you to specify the "
31595 "encoding of strings that are looked for in the source file C<path>."
31599 #: ../src/guestfs-actions.pod:6972
31601 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
31602 "ISO-8859-X (this is what C<guestfs_strings> uses)."
31606 #: ../src/guestfs-actions.pod:7010
31607 msgid "guestfs_swapoff_device"
31611 #: ../src/guestfs-actions.pod:7012
31615 " guestfs_swapoff_device (guestfs_h *g,\n"
31616 " const char *device);\n"
31621 #: ../src/guestfs-actions.pod:7016
31623 "This command disables the libguestfs appliance swap device or partition "
31624 "named C<device>. See C<guestfs_swapon_device>."
31628 #: ../src/guestfs-actions.pod:7024
31629 msgid "guestfs_swapoff_file"
31633 #: ../src/guestfs-actions.pod:7026
31637 " guestfs_swapoff_file (guestfs_h *g,\n"
31638 " const char *file);\n"
31643 #: ../src/guestfs-actions.pod:7036
31644 msgid "guestfs_swapoff_label"
31648 #: ../src/guestfs-actions.pod:7038
31652 " guestfs_swapoff_label (guestfs_h *g,\n"
31653 " const char *label);\n"
31658 #: ../src/guestfs-actions.pod:7049
31659 msgid "guestfs_swapoff_uuid"
31663 #: ../src/guestfs-actions.pod:7051
31667 " guestfs_swapoff_uuid (guestfs_h *g,\n"
31668 " const char *uuid);\n"
31673 #: ../src/guestfs-actions.pod:7062
31674 msgid "guestfs_swapon_device"
31678 #: ../src/guestfs-actions.pod:7064
31682 " guestfs_swapon_device (guestfs_h *g,\n"
31683 " const char *device);\n"
31688 #: ../src/guestfs-actions.pod:7068
31690 "This command enables the libguestfs appliance to use the swap device or "
31691 "partition named C<device>. The increased memory is made available for all "
31692 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
31696 #: ../src/guestfs-actions.pod:7084
31697 msgid "guestfs_swapon_file"
31701 #: ../src/guestfs-actions.pod:7086
31705 " guestfs_swapon_file (guestfs_h *g,\n"
31706 " const char *file);\n"
31711 #: ../src/guestfs-actions.pod:7090
31713 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
31718 #: ../src/guestfs-actions.pod:7097
31719 msgid "guestfs_swapon_label"
31723 #: ../src/guestfs-actions.pod:7099
31727 " guestfs_swapon_label (guestfs_h *g,\n"
31728 " const char *label);\n"
31733 #: ../src/guestfs-actions.pod:7103
31735 "This command enables swap to a labeled swap partition. See "
31736 "C<guestfs_swapon_device> for other notes."
31740 #: ../src/guestfs-actions.pod:7110
31741 msgid "guestfs_swapon_uuid"
31745 #: ../src/guestfs-actions.pod:7112
31749 " guestfs_swapon_uuid (guestfs_h *g,\n"
31750 " const char *uuid);\n"
31755 #: ../src/guestfs-actions.pod:7116
31757 "This command enables swap to a swap partition with the given UUID. See "
31758 "C<guestfs_swapon_device> for other notes."
31762 #: ../src/guestfs-actions.pod:7123
31763 msgid "guestfs_sync"
31767 #: ../src/guestfs-actions.pod:7125
31771 " guestfs_sync (guestfs_h *g);\n"
31776 #: ../src/guestfs-actions.pod:7138
31777 msgid "guestfs_tail"
31781 #: ../src/guestfs-actions.pod:7140
31785 " guestfs_tail (guestfs_h *g,\n"
31786 " const char *path);\n"
31791 #: ../src/guestfs-actions.pod:7156
31792 msgid "guestfs_tail_n"
31796 #: ../src/guestfs-actions.pod:7158
31800 " guestfs_tail_n (guestfs_h *g,\n"
31802 " const char *path);\n"
31807 #: ../src/guestfs-actions.pod:7180
31808 msgid "guestfs_tar_in"
31812 #: ../src/guestfs-actions.pod:7182
31816 " guestfs_tar_in (guestfs_h *g,\n"
31817 " const char *tarfile,\n"
31818 " const char *directory);\n"
31823 #: ../src/guestfs-actions.pod:7190
31825 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
31829 #: ../src/guestfs-actions.pod:7195 ../src/guestfs-actions.pod:7212
31830 #: ../src/guestfs-actions.pod:7228 ../src/guestfs-actions.pod:7244
31831 msgid "(Added in 1.0.3)"
31835 #: ../src/guestfs-actions.pod:7197
31836 msgid "guestfs_tar_out"
31840 #: ../src/guestfs-actions.pod:7199
31844 " guestfs_tar_out (guestfs_h *g,\n"
31845 " const char *directory,\n"
31846 " const char *tarfile);\n"
31851 #: ../src/guestfs-actions.pod:7207
31853 "To download a compressed tarball, use C<guestfs_tgz_out> or "
31854 "C<guestfs_txz_out>."
31858 #: ../src/guestfs-actions.pod:7214
31859 msgid "guestfs_tgz_in"
31863 #: ../src/guestfs-actions.pod:7216
31867 " guestfs_tgz_in (guestfs_h *g,\n"
31868 " const char *tarball,\n"
31869 " const char *directory);\n"
31874 #: ../src/guestfs-actions.pod:7224
31875 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
31879 #: ../src/guestfs-actions.pod:7230
31880 msgid "guestfs_tgz_out"
31884 #: ../src/guestfs-actions.pod:7232
31888 " guestfs_tgz_out (guestfs_h *g,\n"
31889 " const char *directory,\n"
31890 " const char *tarball);\n"
31895 #: ../src/guestfs-actions.pod:7240
31896 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
31900 #: ../src/guestfs-actions.pod:7246
31901 msgid "guestfs_touch"
31905 #: ../src/guestfs-actions.pod:7248
31909 " guestfs_touch (guestfs_h *g,\n"
31910 " const char *path);\n"
31915 #: ../src/guestfs-actions.pod:7263
31916 msgid "guestfs_truncate"
31920 #: ../src/guestfs-actions.pod:7265
31924 " guestfs_truncate (guestfs_h *g,\n"
31925 " const char *path);\n"
31930 #: ../src/guestfs-actions.pod:7276
31931 msgid "guestfs_truncate_size"
31935 #: ../src/guestfs-actions.pod:7278
31939 " guestfs_truncate_size (guestfs_h *g,\n"
31940 " const char *path,\n"
31941 " int64_t size);\n"
31946 #: ../src/guestfs-actions.pod:7286
31948 "If the current file size is less than C<size> then the file is extended to "
31949 "the required size with zero bytes. This creates a sparse file (ie. disk "
31950 "blocks are not allocated for the file until you write to it). To create a "
31951 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
31955 #: ../src/guestfs-actions.pod:7296
31956 msgid "guestfs_tune2fs_l"
31960 #: ../src/guestfs-actions.pod:7298
31964 " guestfs_tune2fs_l (guestfs_h *g,\n"
31965 " const char *device);\n"
31970 #: ../src/guestfs-actions.pod:7318
31971 msgid "guestfs_txz_in"
31975 #: ../src/guestfs-actions.pod:7320
31979 " guestfs_txz_in (guestfs_h *g,\n"
31980 " const char *tarball,\n"
31981 " const char *directory);\n"
31986 #: ../src/guestfs-actions.pod:7332
31987 msgid "guestfs_txz_out"
31991 #: ../src/guestfs-actions.pod:7334
31995 " guestfs_txz_out (guestfs_h *g,\n"
31996 " const char *directory,\n"
31997 " const char *tarball);\n"
32002 #: ../src/guestfs-actions.pod:7346
32003 msgid "guestfs_umask"
32007 #: ../src/guestfs-actions.pod:7348
32011 " guestfs_umask (guestfs_h *g,\n"
32017 #: ../src/guestfs-actions.pod:7364
32019 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
32020 "C<guestfs_mkdir>."
32024 #: ../src/guestfs-actions.pod:7373
32025 msgid "guestfs_umount"
32029 #: ../src/guestfs-actions.pod:7375
32033 " guestfs_umount (guestfs_h *g,\n"
32034 " const char *pathordevice);\n"
32039 #: ../src/guestfs-actions.pod:7387
32040 msgid "guestfs_umount_all"
32044 #: ../src/guestfs-actions.pod:7389
32048 " guestfs_umount_all (guestfs_h *g);\n"
32053 #: ../src/guestfs-actions.pod:7400
32054 msgid "guestfs_upload"
32058 #: ../src/guestfs-actions.pod:7402
32062 " guestfs_upload (guestfs_h *g,\n"
32063 " const char *filename,\n"
32064 " const char *remotefilename);\n"
32069 #: ../src/guestfs-actions.pod:7412
32070 msgid "See also C<guestfs_download>."
32074 #: ../src/guestfs-actions.pod:7423
32075 msgid "guestfs_upload_offset"
32079 #: ../src/guestfs-actions.pod:7425
32083 " guestfs_upload_offset (guestfs_h *g,\n"
32084 " const char *filename,\n"
32085 " const char *remotefilename,\n"
32086 " int64_t offset);\n"
32091 #: ../src/guestfs-actions.pod:7441
32093 "Note that there is no limit on the amount of data that can be uploaded with "
32094 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
32095 "full amount unless an error occurs."
32099 #: ../src/guestfs-actions.pod:7446
32100 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
32104 #: ../src/guestfs-actions.pod:7457
32105 msgid "guestfs_utimens"
32109 #: ../src/guestfs-actions.pod:7459
32113 " guestfs_utimens (guestfs_h *g,\n"
32114 " const char *path,\n"
32115 " int64_t atsecs,\n"
32116 " int64_t atnsecs,\n"
32117 " int64_t mtsecs,\n"
32118 " int64_t mtnsecs);\n"
32123 #: ../src/guestfs-actions.pod:7488 ../src/guestfs-structs.pod:175
32124 msgid "guestfs_version"
32128 #: ../src/guestfs-actions.pod:7490
32131 " struct guestfs_version *\n"
32132 " guestfs_version (guestfs_h *g);\n"
32137 #: ../src/guestfs-actions.pod:7518
32139 "I<Note:> Don't use this call to test for availability of features. In "
32140 "enterprise distributions we backport features from later versions into "
32141 "earlier versions, making this an unreliable way to test for features. Use "
32142 "C<guestfs_available> instead."
32146 #: ../src/guestfs-actions.pod:7524
32148 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
32149 "error. I<The caller must call C<guestfs_free_version> after use>."
32153 #: ../src/guestfs-actions.pod:7528
32154 msgid "(Added in 1.0.58)"
32158 #: ../src/guestfs-actions.pod:7530
32159 msgid "guestfs_vfs_label"
32163 #: ../src/guestfs-actions.pod:7532
32167 " guestfs_vfs_label (guestfs_h *g,\n"
32168 " const char *device);\n"
32173 #: ../src/guestfs-actions.pod:7541
32174 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
32178 #: ../src/guestfs-actions.pod:7546 ../src/guestfs-actions.pod:7583
32179 msgid "(Added in 1.3.18)"
32183 #: ../src/guestfs-actions.pod:7548
32184 msgid "guestfs_vfs_type"
32188 #: ../src/guestfs-actions.pod:7550
32192 " guestfs_vfs_type (guestfs_h *g,\n"
32193 " const char *device);\n"
32198 #: ../src/guestfs-actions.pod:7567
32199 msgid "guestfs_vfs_uuid"
32203 #: ../src/guestfs-actions.pod:7569
32207 " guestfs_vfs_uuid (guestfs_h *g,\n"
32208 " const char *device);\n"
32213 #: ../src/guestfs-actions.pod:7578
32214 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
32218 #: ../src/guestfs-actions.pod:7585
32219 msgid "guestfs_vg_activate"
32223 #: ../src/guestfs-actions.pod:7587
32227 " guestfs_vg_activate (guestfs_h *g,\n"
32229 " char *const *volgroups);\n"
32234 #: ../src/guestfs-actions.pod:7604
32235 msgid "guestfs_vg_activate_all"
32239 #: ../src/guestfs-actions.pod:7606
32243 " guestfs_vg_activate_all (guestfs_h *g,\n"
32244 " int activate);\n"
32249 #: ../src/guestfs-actions.pod:7619
32250 msgid "guestfs_vgcreate"
32254 #: ../src/guestfs-actions.pod:7621
32258 " guestfs_vgcreate (guestfs_h *g,\n"
32259 " const char *volgroup,\n"
32260 " char *const *physvols);\n"
32265 #: ../src/guestfs-actions.pod:7633
32266 msgid "guestfs_vglvuuids"
32270 #: ../src/guestfs-actions.pod:7635
32274 " guestfs_vglvuuids (guestfs_h *g,\n"
32275 " const char *vgname);\n"
32280 #: ../src/guestfs-actions.pod:7642
32282 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
32283 "associate logical volumes and volume groups."
32287 #: ../src/guestfs-actions.pod:7645
32288 msgid "See also C<guestfs_vgpvuuids>."
32292 #: ../src/guestfs-actions.pod:7653
32293 msgid "guestfs_vgpvuuids"
32297 #: ../src/guestfs-actions.pod:7655
32301 " guestfs_vgpvuuids (guestfs_h *g,\n"
32302 " const char *vgname);\n"
32307 #: ../src/guestfs-actions.pod:7662
32309 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
32310 "associate physical volumes and volume groups."
32314 #: ../src/guestfs-actions.pod:7665
32315 msgid "See also C<guestfs_vglvuuids>."
32319 #: ../src/guestfs-actions.pod:7673
32320 msgid "guestfs_vgremove"
32324 #: ../src/guestfs-actions.pod:7675
32328 " guestfs_vgremove (guestfs_h *g,\n"
32329 " const char *vgname);\n"
32334 #: ../src/guestfs-actions.pod:7688
32335 msgid "guestfs_vgrename"
32339 #: ../src/guestfs-actions.pod:7690
32343 " guestfs_vgrename (guestfs_h *g,\n"
32344 " const char *volgroup,\n"
32345 " const char *newvolgroup);\n"
32350 #: ../src/guestfs-actions.pod:7701
32351 msgid "guestfs_vgs"
32355 #: ../src/guestfs-actions.pod:7703
32359 " guestfs_vgs (guestfs_h *g);\n"
32364 #: ../src/guestfs-actions.pod:7712
32365 msgid "See also C<guestfs_vgs_full>."
32369 #: ../src/guestfs-actions.pod:7720
32370 msgid "guestfs_vgs_full"
32374 #: ../src/guestfs-actions.pod:7722
32377 " struct guestfs_lvm_vg_list *\n"
32378 " guestfs_vgs_full (guestfs_h *g);\n"
32383 #: ../src/guestfs-actions.pod:7728
32385 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
32386 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
32390 #: ../src/guestfs-actions.pod:7734
32391 msgid "guestfs_vgscan"
32395 #: ../src/guestfs-actions.pod:7736
32399 " guestfs_vgscan (guestfs_h *g);\n"
32404 #: ../src/guestfs-actions.pod:7746
32405 msgid "guestfs_vguuid"
32409 #: ../src/guestfs-actions.pod:7748
32413 " guestfs_vguuid (guestfs_h *g,\n"
32414 " const char *vgname);\n"
32419 #: ../src/guestfs-actions.pod:7759
32420 msgid "guestfs_wait_ready"
32424 #: ../src/guestfs-actions.pod:7761
32428 " guestfs_wait_ready (guestfs_h *g);\n"
32433 #: ../src/guestfs-actions.pod:7764
32435 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
32440 #: ../src/guestfs-actions.pod:7771
32441 msgid "This function is a no op."
32445 #: ../src/guestfs-actions.pod:7773
32447 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
32448 "calling C<guestfs_launch> to wait for the launch to complete. However this "
32449 "is no longer necessary because C<guestfs_launch> now does the waiting."
32453 #: ../src/guestfs-actions.pod:7778
32455 "If you see any calls to this function in code then you can just remove them, "
32456 "unless you want to retain compatibility with older versions of the API."
32460 #: ../src/guestfs-actions.pod:7786
32461 msgid "guestfs_wc_c"
32465 #: ../src/guestfs-actions.pod:7788
32469 " guestfs_wc_c (guestfs_h *g,\n"
32470 " const char *path);\n"
32475 #: ../src/guestfs-actions.pod:7799
32476 msgid "guestfs_wc_l"
32480 #: ../src/guestfs-actions.pod:7801
32484 " guestfs_wc_l (guestfs_h *g,\n"
32485 " const char *path);\n"
32490 #: ../src/guestfs-actions.pod:7812
32491 msgid "guestfs_wc_w"
32495 #: ../src/guestfs-actions.pod:7814
32499 " guestfs_wc_w (guestfs_h *g,\n"
32500 " const char *path);\n"
32505 #: ../src/guestfs-actions.pod:7825
32506 msgid "guestfs_write"
32510 #: ../src/guestfs-actions.pod:7827
32514 " guestfs_write (guestfs_h *g,\n"
32515 " const char *path,\n"
32516 " const char *content,\n"
32517 " size_t content_size);\n"
32522 #: ../src/guestfs-actions.pod:7836
32523 msgid "See also C<guestfs_write_append>."
32527 #: ../src/guestfs-actions.pod:7845
32528 msgid "guestfs_write_append"
32532 #: ../src/guestfs-actions.pod:7847
32536 " guestfs_write_append (guestfs_h *g,\n"
32537 " const char *path,\n"
32538 " const char *content,\n"
32539 " size_t content_size);\n"
32544 #: ../src/guestfs-actions.pod:7856
32545 msgid "See also C<guestfs_write>."
32549 #: ../src/guestfs-actions.pod:7865
32550 msgid "guestfs_write_file"
32554 #: ../src/guestfs-actions.pod:7867
32558 " guestfs_write_file (guestfs_h *g,\n"
32559 " const char *path,\n"
32560 " const char *content,\n"
32566 #: ../src/guestfs-actions.pod:7873
32568 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
32573 #: ../src/guestfs-actions.pod:7898
32574 msgid "guestfs_zegrep"
32578 #: ../src/guestfs-actions.pod:7900
32582 " guestfs_zegrep (guestfs_h *g,\n"
32583 " const char *regex,\n"
32584 " const char *path);\n"
32589 #: ../src/guestfs-actions.pod:7917
32590 msgid "guestfs_zegrepi"
32594 #: ../src/guestfs-actions.pod:7919
32598 " guestfs_zegrepi (guestfs_h *g,\n"
32599 " const char *regex,\n"
32600 " const char *path);\n"
32605 #: ../src/guestfs-actions.pod:7936
32606 msgid "guestfs_zero"
32610 #: ../src/guestfs-actions.pod:7938
32614 " guestfs_zero (guestfs_h *g,\n"
32615 " const char *device);\n"
32620 #: ../src/guestfs-actions.pod:7952
32622 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
32623 "C<guestfs_is_zero_device>"
32627 #: ../src/guestfs-actions.pod:7964
32628 msgid "guestfs_zero_device"
32632 #: ../src/guestfs-actions.pod:7966
32636 " guestfs_zero_device (guestfs_h *g,\n"
32637 " const char *device);\n"
32642 #: ../src/guestfs-actions.pod:7970
32644 "This command writes zeroes over the entire C<device>. Compare with "
32645 "C<guestfs_zero> which just zeroes the first few blocks of a device."
32649 #: ../src/guestfs-actions.pod:7988
32650 msgid "(Added in 1.3.1)"
32654 #: ../src/guestfs-actions.pod:7990
32655 msgid "guestfs_zerofree"
32659 #: ../src/guestfs-actions.pod:7992
32663 " guestfs_zerofree (guestfs_h *g,\n"
32664 " const char *device);\n"
32669 #: ../src/guestfs-actions.pod:8011
32670 msgid "guestfs_zfgrep"
32674 #: ../src/guestfs-actions.pod:8013
32678 " guestfs_zfgrep (guestfs_h *g,\n"
32679 " const char *pattern,\n"
32680 " const char *path);\n"
32685 #: ../src/guestfs-actions.pod:8030
32686 msgid "guestfs_zfgrepi"
32690 #: ../src/guestfs-actions.pod:8032
32694 " guestfs_zfgrepi (guestfs_h *g,\n"
32695 " const char *pattern,\n"
32696 " const char *path);\n"
32701 #: ../src/guestfs-actions.pod:8049
32702 msgid "guestfs_zfile"
32706 #: ../src/guestfs-actions.pod:8051
32710 " guestfs_zfile (guestfs_h *g,\n"
32711 " const char *meth,\n"
32712 " const char *path);\n"
32717 #: ../src/guestfs-actions.pod:8056
32719 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
32724 #: ../src/guestfs-actions.pod:8068
32726 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
32731 #: ../src/guestfs-actions.pod:8076
32732 msgid "guestfs_zgrep"
32736 #: ../src/guestfs-actions.pod:8078
32740 " guestfs_zgrep (guestfs_h *g,\n"
32741 " const char *regex,\n"
32742 " const char *path);\n"
32747 #: ../src/guestfs-actions.pod:8095
32748 msgid "guestfs_zgrepi"
32752 #: ../src/guestfs-actions.pod:8097
32756 " guestfs_zgrepi (guestfs_h *g,\n"
32757 " const char *regex,\n"
32758 " const char *path);\n"
32763 #: ../src/guestfs-availability.pod:3
32768 #: ../src/guestfs-availability.pod:5
32770 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
32771 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
32772 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
32773 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
32774 "L</guestfs_aug_save> L</guestfs_aug_set>"
32778 #: ../src/guestfs-availability.pod:21
32783 #: ../src/guestfs-availability.pod:23
32784 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
32788 #: ../src/guestfs-availability.pod:26
32793 #: ../src/guestfs-availability.pod:28
32794 msgid "The following functions: L</guestfs_grub_install>"
32798 #: ../src/guestfs-availability.pod:31
32803 #: ../src/guestfs-availability.pod:33
32805 "The following functions: L</guestfs_inotify_add_watch> L</"
32806 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
32807 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
32811 #: ../src/guestfs-availability.pod:41
32812 msgid "B<linuxfsuuid>"
32816 #: ../src/guestfs-availability.pod:43
32818 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
32819 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
32823 #: ../src/guestfs-availability.pod:50
32824 msgid "B<linuxmodules>"
32828 #: ../src/guestfs-availability.pod:52
32829 msgid "The following functions: L</guestfs_modprobe>"
32833 #: ../src/guestfs-availability.pod:55
32834 msgid "B<linuxxattrs>"
32838 #: ../src/guestfs-availability.pod:57
32840 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
32841 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
32842 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
32843 "guestfs_setxattr>"
32847 #: ../src/guestfs-availability.pod:68
32852 #: ../src/guestfs-availability.pod:70
32854 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
32855 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
32856 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
32860 #: ../src/guestfs-availability.pod:79
32865 #: ../src/guestfs-availability.pod:81
32867 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
32868 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
32869 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
32870 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
32871 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
32872 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
32873 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
32877 #: ../src/guestfs-availability.pod:104
32882 #: ../src/guestfs-availability.pod:106
32884 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
32885 "guestfs_mknod_b> L</guestfs_mknod_c>"
32889 #: ../src/guestfs-availability.pod:112
32894 #: ../src/guestfs-availability.pod:114
32895 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
32899 #: ../src/guestfs-availability.pod:117
32900 msgid "B<ntfsprogs>"
32904 #: ../src/guestfs-availability.pod:119
32906 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
32907 "L</guestfs_ntfsresize_size>"
32911 #: ../src/guestfs-availability.pod:124
32912 msgid "B<realpath>"
32916 #: ../src/guestfs-availability.pod:126
32917 msgid "The following functions: L</guestfs_realpath>"
32921 #: ../src/guestfs-availability.pod:129
32926 #: ../src/guestfs-availability.pod:131
32928 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
32929 "guestfs_scrub_freespace>"
32933 #: ../src/guestfs-availability.pod:136
32938 #: ../src/guestfs-availability.pod:138
32939 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
32943 #: ../src/guestfs-availability.pod:142
32948 #: ../src/guestfs-availability.pod:144
32949 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
32953 #: ../src/guestfs-availability.pod:148
32954 msgid "B<zerofree>"
32958 #: ../src/guestfs-availability.pod:150
32959 msgid "The following functions: L</guestfs_zerofree>"
32963 #: ../src/guestfs-structs.pod:1
32964 msgid "guestfs_int_bool"
32968 #: ../src/guestfs-structs.pod:3
32971 " struct guestfs_int_bool {\n"
32979 #: ../src/guestfs-structs.pod:8
32982 " struct guestfs_int_bool_list {\n"
32983 " uint32_t len; /* Number of elements in list. */\n"
32984 " struct guestfs_int_bool *val; /* Elements. */\n"
32990 #: ../src/guestfs-structs.pod:13
32993 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
32994 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
32999 #: ../src/guestfs-structs.pod:16
33000 msgid "guestfs_lvm_pv"
33004 #: ../src/guestfs-structs.pod:18
33007 " struct guestfs_lvm_pv {\n"
33008 " char *pv_name;\n"
33009 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33010 " char pv_uuid[32];\n"
33012 " uint64_t pv_size;\n"
33013 " uint64_t dev_size;\n"
33014 " uint64_t pv_free;\n"
33015 " uint64_t pv_used;\n"
33016 " char *pv_attr;\n"
33017 " int64_t pv_pe_count;\n"
33018 " int64_t pv_pe_alloc_count;\n"
33019 " char *pv_tags;\n"
33020 " uint64_t pe_start;\n"
33021 " int64_t pv_mda_count;\n"
33022 " uint64_t pv_mda_free;\n"
33028 #: ../src/guestfs-structs.pod:36
33031 " struct guestfs_lvm_pv_list {\n"
33032 " uint32_t len; /* Number of elements in list. */\n"
33033 " struct guestfs_lvm_pv *val; /* Elements. */\n"
33039 #: ../src/guestfs-structs.pod:41
33042 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
33043 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
33048 #: ../src/guestfs-structs.pod:44
33049 msgid "guestfs_lvm_vg"
33053 #: ../src/guestfs-structs.pod:46
33056 " struct guestfs_lvm_vg {\n"
33057 " char *vg_name;\n"
33058 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33059 " char vg_uuid[32];\n"
33061 " char *vg_attr;\n"
33062 " uint64_t vg_size;\n"
33063 " uint64_t vg_free;\n"
33064 " char *vg_sysid;\n"
33065 " uint64_t vg_extent_size;\n"
33066 " int64_t vg_extent_count;\n"
33067 " int64_t vg_free_count;\n"
33068 " int64_t max_lv;\n"
33069 " int64_t max_pv;\n"
33070 " int64_t pv_count;\n"
33071 " int64_t lv_count;\n"
33072 " int64_t snap_count;\n"
33073 " int64_t vg_seqno;\n"
33074 " char *vg_tags;\n"
33075 " int64_t vg_mda_count;\n"
33076 " uint64_t vg_mda_free;\n"
33082 #: ../src/guestfs-structs.pod:69
33085 " struct guestfs_lvm_vg_list {\n"
33086 " uint32_t len; /* Number of elements in list. */\n"
33087 " struct guestfs_lvm_vg *val; /* Elements. */\n"
33093 #: ../src/guestfs-structs.pod:74
33096 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
33097 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
33102 #: ../src/guestfs-structs.pod:77
33103 msgid "guestfs_lvm_lv"
33107 #: ../src/guestfs-structs.pod:79
33110 " struct guestfs_lvm_lv {\n"
33111 " char *lv_name;\n"
33112 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33113 " char lv_uuid[32];\n"
33114 " char *lv_attr;\n"
33115 " int64_t lv_major;\n"
33116 " int64_t lv_minor;\n"
33117 " int64_t lv_kernel_major;\n"
33118 " int64_t lv_kernel_minor;\n"
33119 " uint64_t lv_size;\n"
33120 " int64_t seg_count;\n"
33122 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
33123 " float snap_percent;\n"
33124 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
33125 " float copy_percent;\n"
33126 " char *move_pv;\n"
33127 " char *lv_tags;\n"
33128 " char *mirror_log;\n"
33129 " char *modules;\n"
33135 #: ../src/guestfs-structs.pod:101
33138 " struct guestfs_lvm_lv_list {\n"
33139 " uint32_t len; /* Number of elements in list. */\n"
33140 " struct guestfs_lvm_lv *val; /* Elements. */\n"
33146 #: ../src/guestfs-structs.pod:106
33149 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
33150 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
33155 #: ../src/guestfs-structs.pod:111
33158 " struct guestfs_stat {\n"
33162 " int64_t nlink;\n"
33167 " int64_t blksize;\n"
33168 " int64_t blocks;\n"
33169 " int64_t atime;\n"
33170 " int64_t mtime;\n"
33171 " int64_t ctime;\n"
33177 #: ../src/guestfs-structs.pod:127
33180 " struct guestfs_stat_list {\n"
33181 " uint32_t len; /* Number of elements in list. */\n"
33182 " struct guestfs_stat *val; /* Elements. */\n"
33188 #: ../src/guestfs-structs.pod:132
33191 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
33192 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
33197 #: ../src/guestfs-structs.pod:137
33200 " struct guestfs_statvfs {\n"
33201 " int64_t bsize;\n"
33202 " int64_t frsize;\n"
33203 " int64_t blocks;\n"
33204 " int64_t bfree;\n"
33205 " int64_t bavail;\n"
33206 " int64_t files;\n"
33207 " int64_t ffree;\n"
33208 " int64_t favail;\n"
33211 " int64_t namemax;\n"
33217 #: ../src/guestfs-structs.pod:151
33220 " struct guestfs_statvfs_list {\n"
33221 " uint32_t len; /* Number of elements in list. */\n"
33222 " struct guestfs_statvfs *val; /* Elements. */\n"
33228 #: ../src/guestfs-structs.pod:156
33231 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
33232 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
33237 #: ../src/guestfs-structs.pod:159
33238 msgid "guestfs_dirent"
33242 #: ../src/guestfs-structs.pod:161
33245 " struct guestfs_dirent {\n"
33254 #: ../src/guestfs-structs.pod:167
33257 " struct guestfs_dirent_list {\n"
33258 " uint32_t len; /* Number of elements in list. */\n"
33259 " struct guestfs_dirent *val; /* Elements. */\n"
33265 #: ../src/guestfs-structs.pod:172
33268 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
33269 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
33274 #: ../src/guestfs-structs.pod:177
33277 " struct guestfs_version {\n"
33278 " int64_t major;\n"
33279 " int64_t minor;\n"
33280 " int64_t release;\n"
33287 #: ../src/guestfs-structs.pod:184
33290 " struct guestfs_version_list {\n"
33291 " uint32_t len; /* Number of elements in list. */\n"
33292 " struct guestfs_version *val; /* Elements. */\n"
33298 #: ../src/guestfs-structs.pod:189
33301 " void guestfs_free_version (struct guestfs_free_version *);\n"
33302 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
33307 #: ../src/guestfs-structs.pod:192
33308 msgid "guestfs_xattr"
33312 #: ../src/guestfs-structs.pod:194
33315 " struct guestfs_xattr {\n"
33316 " char *attrname;\n"
33317 " /* The next two fields describe a byte array. */\n"
33318 " uint32_t attrval_len;\n"
33319 " char *attrval;\n"
33325 #: ../src/guestfs-structs.pod:201
33328 " struct guestfs_xattr_list {\n"
33329 " uint32_t len; /* Number of elements in list. */\n"
33330 " struct guestfs_xattr *val; /* Elements. */\n"
33336 #: ../src/guestfs-structs.pod:206
33339 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
33340 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
33345 #: ../src/guestfs-structs.pod:209
33346 msgid "guestfs_inotify_event"
33350 #: ../src/guestfs-structs.pod:211
33353 " struct guestfs_inotify_event {\n"
33354 " int64_t in_wd;\n"
33355 " uint32_t in_mask;\n"
33356 " uint32_t in_cookie;\n"
33357 " char *in_name;\n"
33363 #: ../src/guestfs-structs.pod:218
33366 " struct guestfs_inotify_event_list {\n"
33367 " uint32_t len; /* Number of elements in list. */\n"
33368 " struct guestfs_inotify_event *val; /* Elements. */\n"
33374 #: ../src/guestfs-structs.pod:223
33377 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
33378 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
33383 #: ../src/guestfs-structs.pod:226
33384 msgid "guestfs_partition"
33388 #: ../src/guestfs-structs.pod:228
33391 " struct guestfs_partition {\n"
33392 " int32_t part_num;\n"
33393 " uint64_t part_start;\n"
33394 " uint64_t part_end;\n"
33395 " uint64_t part_size;\n"
33401 #: ../src/guestfs-structs.pod:235
33404 " struct guestfs_partition_list {\n"
33405 " uint32_t len; /* Number of elements in list. */\n"
33406 " struct guestfs_partition *val; /* Elements. */\n"
33412 #: ../src/guestfs-structs.pod:240
33415 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
33416 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
33421 #: ../src/guestfs-structs.pod:243
33422 msgid "guestfs_application"
33426 #: ../src/guestfs-structs.pod:245
33429 " struct guestfs_application {\n"
33430 " char *app_name;\n"
33431 " char *app_display_name;\n"
33432 " int32_t app_epoch;\n"
33433 " char *app_version;\n"
33434 " char *app_release;\n"
33435 " char *app_install_path;\n"
33436 " char *app_trans_path;\n"
33437 " char *app_publisher;\n"
33438 " char *app_url;\n"
33439 " char *app_source_package;\n"
33440 " char *app_summary;\n"
33441 " char *app_description;\n"
33447 #: ../src/guestfs-structs.pod:260
33450 " struct guestfs_application_list {\n"
33451 " uint32_t len; /* Number of elements in list. */\n"
33452 " struct guestfs_application *val; /* Elements. */\n"
33458 #: ../src/guestfs-structs.pod:265
33461 " void guestfs_free_application (struct guestfs_free_application *);\n"
33462 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
33467 #: ../src/guestfs.pod:5
33468 msgid "guestfs - Library for accessing and modifying virtual machine images"
33472 #: ../src/guestfs.pod:11
33475 " guestfs_h *g = guestfs_create ();\n"
33476 " guestfs_add_drive (g, \"guest.img\");\n"
33477 " guestfs_launch (g);\n"
33478 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33479 " guestfs_touch (g, \"/hello\");\n"
33480 " guestfs_umount (g, \"/\");\n"
33481 " guestfs_close (g);\n"
33484 " guestfs_h *g = guestfs_create ();\n"
33485 " guestfs_add_drive (g, \"guest.img\");\n"
33486 " guestfs_launch (g);\n"
33487 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33488 " guestfs_touch (g, \"/hello\");\n"
33489 " guestfs_umount (g, \"/\");\n"
33490 " guestfs_close (g);\n"
33494 #: ../src/guestfs.pod:25
33496 "Libguestfs is a library for accessing and modifying guest disk images. "
33497 "Amongst the things this is good for: making batch configuration changes to "
33498 "guests, getting disk used/free statistics (see also: virt-df), migrating "
33499 "between virtualization systems (see also: virt-p2v), performing partial "
33500 "backups, performing partial guest clones, cloning guests and changing "
33501 "registry/UUID/hostname info, and much else besides."
33505 #: ../src/guestfs.pod:33
33507 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
33508 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
33509 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
33514 #: ../src/guestfs.pod:38
33516 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
33517 "what filesystem is in each LV, etc.). It can also run commands in the "
33518 "context of the guest. Also you can access filesystems over FUSE."
33522 #: ../src/guestfs.pod:43
33524 "Libguestfs is a library that can be linked with C and C++ management "
33525 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
33526 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
33531 #: ../src/guestfs.pod:48
33533 "You don't need to be root to use libguestfs, although obviously you do need "
33534 "enough permissions to access the disk images."
33538 #: ../src/guestfs.pod:51
33540 "Libguestfs is a large API because it can do many things. For a gentle "
33541 "introduction, please read the L</API OVERVIEW> section next."
33545 #: ../src/guestfs.pod:54
33547 "There are also some example programs in the L<guestfs-examples(3)> manual "
33552 #: ../src/guestfs.pod:57
33553 msgid "API OVERVIEW"
33557 #: ../src/guestfs.pod:59
33559 "This section provides a gentler overview of the libguestfs API. We also try "
33560 "to group API calls together, where that may not be obvious from reading "
33561 "about the individual calls in the main section of this manual."
33565 #: ../src/guestfs.pod:64
33570 #: ../src/guestfs.pod:66
33572 "Before you can use libguestfs calls, you have to create a handle. Then you "
33573 "must add at least one disk image to the handle, followed by launching the "
33574 "handle, then performing whatever operations you want, and finally closing "
33575 "the handle. By convention we use the single letter C<g> for the name of the "
33576 "handle variable, although of course you can use any name you want."
33580 #: ../src/guestfs.pod:73
33581 msgid "The general structure of all libguestfs-using programs looks like this:"
33585 #: ../src/guestfs.pod:76
33588 " guestfs_h *g = guestfs_create ();\n"
33593 #: ../src/guestfs.pod:78
33596 " /* Call guestfs_add_drive additional times if there are\n"
33597 " * multiple disk images.\n"
33599 " guestfs_add_drive (g, \"guest.img\");\n"
33604 #: ../src/guestfs.pod:83
33607 " /* Most manipulation calls won't work until you've launched\n"
33608 " * the handle 'g'. You have to do this _after_ adding drives\n"
33609 " * and _before_ other commands.\n"
33611 " guestfs_launch (g);\n"
33616 #: ../src/guestfs.pod:89
33619 " /* Now you can examine what partitions, LVs etc are available.\n"
33621 " char **partitions = guestfs_list_partitions (g);\n"
33622 " char **logvols = guestfs_lvs (g);\n"
33627 #: ../src/guestfs.pod:94
33630 " /* To access a filesystem in the image, you must mount it.\n"
33632 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33637 #: ../src/guestfs.pod:98
33640 " /* Now you can perform filesystem actions on the guest\n"
33643 " guestfs_touch (g, \"/hello\");\n"
33648 #: ../src/guestfs.pod:103
33651 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
33652 " * it is done automatically when you close the handle. See\n"
33653 " * discussion of autosync in this page.\n"
33655 " guestfs_sync (g);\n"
33660 #: ../src/guestfs.pod:109
33663 " /* Close the handle 'g'. */\n"
33664 " guestfs_close (g);\n"
33669 #: ../src/guestfs.pod:112
33671 "The code above doesn't include any error checking. In real code you should "
33672 "check return values carefully for errors. In general all functions that "
33673 "return integers return C<-1> on error, and all functions that return "
33674 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
33675 "how to handle errors, and consult the documentation for each function call "
33676 "below to see precisely how they return error indications. See L<guestfs-"
33677 "examples(3)> for fully worked examples."
33681 #: ../src/guestfs.pod:121
33682 msgid "DISK IMAGES"
33686 #: ../src/guestfs.pod:123
33688 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
33689 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
33690 "actual block device, or simply an empty file of zeroes that you have created "
33691 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
33696 #: ../src/guestfs.pod:129
33698 "The call you should use in modern code for adding drives is L</"
33699 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
33700 "specifying that the format is raw, do:"
33704 #: ../src/guestfs.pod:133
33707 " guestfs_add_drive_opts (g, filename,\n"
33708 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33714 #: ../src/guestfs.pod:137
33715 msgid "You can add a disk read-only using:"
33719 #: ../src/guestfs.pod:139
33722 " guestfs_add_drive_opts (g, filename,\n"
33723 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33724 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33730 #: ../src/guestfs.pod:144
33732 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
33733 "libguestfs won't modify the file."
33737 #: ../src/guestfs.pod:147
33739 "Be extremely cautious if the disk image is in use, eg. if it is being used "
33740 "by a virtual machine. Adding it read-write will almost certainly cause disk "
33741 "corruption, but adding it read-only is safe."
33745 #: ../src/guestfs.pod:151
33747 "You must add at least one disk image, and you may add multiple disk images. "
33748 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
33749 "first one you added), C</dev/sdb> (for the second one you added), etc."
33753 #: ../src/guestfs.pod:156
33755 "Once L</guestfs_launch> has been called you cannot add any more images. You "
33756 "can call L</guestfs_list_devices> to get a list of the device names, in the "
33757 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
33761 #: ../src/guestfs.pod:161
33766 #: ../src/guestfs.pod:163
33768 "Before you can read or write files, create directories and so on in a disk "
33769 "image that contains filesystems, you have to mount those filesystems using "
33770 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
33771 "a disk image contains (for example) one partition with a filesystem on that "
33772 "partition, then you can mount it directly:"
33776 #: ../src/guestfs.pod:170
33779 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
33784 #: ../src/guestfs.pod:172
33786 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
33787 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
33788 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
33789 "that these are libguestfs virtual devices, and are nothing to do with host "
33794 #: ../src/guestfs.pod:178
33796 "If you are given a disk image and you don't know what it contains then you "
33797 "have to find out. Libguestfs can do that too: use L</"
33798 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
33799 "LVs, and either try mounting each to see what is mountable, or else examine "
33800 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
33801 "filesystems, use L</guestfs_list_filesystems>."
33805 #: ../src/guestfs.pod:186
33807 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
33808 "L</INSPECTION> below). But you might find it easier to look at higher level "
33809 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
33813 #: ../src/guestfs.pod:191
33815 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
33816 "several other variations of the C<guestfs_mount_*> call."
33820 #: ../src/guestfs.pod:194
33821 msgid "FILESYSTEM ACCESS AND MODIFICATION"
33825 #: ../src/guestfs.pod:196
33827 "The majority of the libguestfs API consists of fairly low-level calls for "
33828 "accessing and modifying the files, directories, symlinks etc on mounted "
33829 "filesystems. There are over a hundred such calls which you can find listed "
33830 "in detail below in this man page, and we don't even pretend to cover them "
33831 "all in this overview."
33835 #: ../src/guestfs.pod:202
33837 "Specify filenames as full paths, starting with C<\"/\"> and including the "
33842 #: ../src/guestfs.pod:205
33844 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
33845 "the file called C<\"etc/passwd\"> then you could do:"
33849 #: ../src/guestfs.pod:208
33852 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
33857 #: ../src/guestfs.pod:210
33859 "This would return C<data> as a newly allocated buffer containing the full "
33860 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
33861 "or C<NULL> if there was an error."
33865 #: ../src/guestfs.pod:214
33867 "As another example, to create a top-level directory on that filesystem "
33868 "called C<\"var\"> you would do:"
33872 #: ../src/guestfs.pod:217
33875 " guestfs_mkdir (g, \"/var\");\n"
33880 #: ../src/guestfs.pod:219
33881 msgid "To create a symlink you could do:"
33885 #: ../src/guestfs.pod:221
33888 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
33889 " \"/etc/rc3.d/S30portmap\");\n"
33894 #: ../src/guestfs.pod:224
33896 "Libguestfs will reject attempts to use relative paths and there is no "
33897 "concept of a current working directory."
33901 #: ../src/guestfs.pod:227
33903 "Libguestfs can return errors in many situations: for example if the "
33904 "filesystem isn't writable, or if a file or directory that you requested "
33905 "doesn't exist. If you are using the C API (documented here) you have to "
33906 "check for those error conditions after each call. (Other language bindings "
33907 "turn these errors into exceptions)."
33911 #: ../src/guestfs.pod:233
33913 "File writes are affected by the per-handle umask, set by calling L</"
33914 "guestfs_umask> and defaulting to 022. See L</UMASK>."
33918 #: ../src/guestfs.pod:236
33919 msgid "PARTITIONING"
33923 #: ../src/guestfs.pod:238
33925 "Libguestfs contains API calls to read, create and modify partition tables on "
33930 #: ../src/guestfs.pod:241
33932 "In the common case where you want to create a single partition covering the "
33933 "whole disk, you should use the L</guestfs_part_disk> call:"
33937 #: ../src/guestfs.pod:245
33940 " const char *parttype = \"mbr\";\n"
33941 " if (disk_is_larger_than_2TB)\n"
33942 " parttype = \"gpt\";\n"
33943 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
33948 #: ../src/guestfs.pod:250
33950 "Obviously this effectively wipes anything that was on that disk image before."
33954 #: ../src/guestfs.pod:253
33959 #: ../src/guestfs.pod:255
33961 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
33962 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
33963 "you familiarize yourself with the concepts of physical volumes, volume "
33964 "groups and logical volumes."
33968 #: ../src/guestfs.pod:260
33970 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
33971 "tldp.org/HOWTO/LVM-HOWTO/>."
33975 #: ../src/guestfs.pod:263
33976 msgid "DOWNLOADING"
33980 #: ../src/guestfs.pod:265
33982 "Use L</guestfs_cat> to download small, text only files. This call is "
33983 "limited to files which are less than 2 MB and which cannot contain any ASCII "
33984 "NUL (C<\\0>) characters. However the API is very simple to use."
33988 #: ../src/guestfs.pod:269
33990 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
33991 "bit data, since it returns a (pointer, size) pair. However it is still "
33992 "limited to \"small\" files, less than 2 MB."
33996 #: ../src/guestfs.pod:273
33998 "L</guestfs_download> can be used to download any file, with no limits on "
33999 "content or size (even files larger than 4 GB)."
34003 #: ../src/guestfs.pod:276
34005 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
34009 #: ../src/guestfs.pod:279
34014 #: ../src/guestfs.pod:281
34016 "It's often the case that you want to write a file or files to the disk image."
34020 #: ../src/guestfs.pod:284
34022 "To write a small file with fixed content, use L</guestfs_write>. To create "
34023 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
34024 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
34025 "of other functions for creating test files, for example L</guestfs_fill> and "
34026 "L</guestfs_fill_pattern>."
34030 #: ../src/guestfs.pod:290
34032 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
34033 "file content or size (even files larger than 4 GB)."
34037 #: ../src/guestfs.pod:293
34039 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
34043 #: ../src/guestfs.pod:295
34045 "However the fastest way to upload I<large numbers of arbitrary files> is to "
34046 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
34047 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
34048 "in a predictable way (eg. adding it last after all other drives) then you "
34049 "can get the device name from L</guestfs_list_devices> and mount it directly "
34050 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
34051 "portable between kernel versions, and they don't support labels or UUIDs. "
34052 "If you want to pre-build an image or you need to mount it using a label or "
34053 "UUID, use an ISO image instead."
34057 #: ../src/guestfs.pod:306
34062 #: ../src/guestfs.pod:308
34064 "There are various different commands for copying between files and devices "
34065 "and in and out of the guest filesystem. These are summarised in the table "
34070 #: ../src/guestfs.pod:314
34071 msgid "B<file> to B<file>"
34075 #: ../src/guestfs.pod:316
34077 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
34078 "directories recursively."
34082 #: ../src/guestfs.pod:319
34083 msgid "B<file or device> to B<file or device>"
34087 #: ../src/guestfs.pod:321
34089 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
34090 "devices in the guest."
34094 #: ../src/guestfs.pod:324
34095 msgid "Example: duplicate the contents of an LV:"
34099 #: ../src/guestfs.pod:326
34102 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
34107 #: ../src/guestfs.pod:328
34109 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
34110 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
34111 "guestfs_copy_size>."
34115 #: ../src/guestfs.pod:332
34116 msgid "B<file on the host> to B<file or device>"
34120 #: ../src/guestfs.pod:334
34121 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
34125 #: ../src/guestfs.pod:336
34126 msgid "B<file or device> to B<file on the host>"
34130 #: ../src/guestfs.pod:338
34131 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
34135 #: ../src/guestfs.pod:342
34136 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
34140 #: ../src/guestfs.pod:344
34142 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
34143 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
34144 "appears you can only upload and download to files. However many Un*x-like "
34145 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
34146 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
34147 "and arbitrary file descriptor N."
34151 #: ../src/guestfs.pod:352
34152 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
34156 #: ../src/guestfs.pod:355
34159 " guestfs_download (g, filename, \"/dev/stdout\");\n"
34164 #: ../src/guestfs.pod:357
34165 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
34169 #: ../src/guestfs.pod:359
34172 " char devfd[64];\n"
34173 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
34174 " guestfs_tar_out (g, \"/\", devfd);\n"
34179 #: ../src/guestfs.pod:363
34180 msgid "LISTING FILES"
34184 #: ../src/guestfs.pod:365
34186 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
34187 "L<guestfish(1)>-equivalent command C<ll>)."
34191 #: ../src/guestfs.pod:368
34193 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
34194 "programs, as a flat list of strings."
34198 #: ../src/guestfs.pod:371
34200 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
34201 "directory, plus additional information about each one. It is more "
34202 "equivalent to using the L<readdir(3)> call on a local filesystem."
34206 #: ../src/guestfs.pod:375
34208 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
34212 #: ../src/guestfs.pod:378
34213 msgid "RUNNING COMMANDS"
34217 #: ../src/guestfs.pod:380
34219 "Although libguestfs is primarily an API for manipulating files inside guest "
34220 "images, we also provide some limited facilities for running commands inside "
34225 #: ../src/guestfs.pod:384
34226 msgid "There are many limitations to this:"
34230 #: ../src/guestfs.pod:390
34232 "The kernel version that the command runs under will be different from what "
34237 #: ../src/guestfs.pod:395
34239 "If the command needs to communicate with daemons, then most likely they "
34240 "won't be running."
34244 #: ../src/guestfs.pod:400
34245 msgid "The command will be running in limited memory."
34249 #: ../src/guestfs.pod:404
34251 "The network may not be available unless you enable it (see L</"
34252 "guestfs_set_network>)."
34256 #: ../src/guestfs.pod:409
34257 msgid "Only supports Linux guests (not Windows, BSD, etc)."
34261 #: ../src/guestfs.pod:413
34263 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
34267 #: ../src/guestfs.pod:418
34269 "For SELinux guests, you may need to enable SELinux and load policy first. "
34270 "See L</SELINUX> in this manpage."
34274 #: ../src/guestfs.pod:423
34276 "I<Security:> It is not safe to run commands from untrusted, possibly "
34277 "malicious guests. These commands may attempt to exploit your program by "
34278 "sending unexpected output. They could also try to exploit the Linux kernel "
34279 "or qemu provided by the libguestfs appliance. They could use the network "
34280 "provided by the libguestfs appliance to bypass ordinary network partitions "
34281 "and firewalls. They could use the elevated privileges or different SELinux "
34282 "context of your program to their advantage."
34286 #: ../src/guestfs.pod:432
34288 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
34289 "(a script which runs when the guest next boots normally), and to have this "
34290 "script run the commands you want in the normal context of the running guest, "
34291 "network security and so on. For information about other security issues, "
34292 "see L</SECURITY>."
34296 #: ../src/guestfs.pod:440
34298 "The two main API calls to run commands are L</guestfs_command> and L</"
34299 "guestfs_sh> (there are also variations)."
34303 #: ../src/guestfs.pod:443
34305 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
34306 "shell globs, redirections, etc will work."
34310 #: ../src/guestfs.pod:446
34311 msgid "CONFIGURATION FILES"
34315 #: ../src/guestfs.pod:448
34317 "To read and write configuration files in Linux guest filesystems, we "
34318 "strongly recommend using Augeas. For example, Augeas understands how to "
34319 "read and write, say, a Linux shadow password file or X.org configuration "
34320 "file, and so avoids you having to write that code."
34324 #: ../src/guestfs.pod:453
34326 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
34327 "document Augeas itself here because there is excellent documentation on the "
34328 "L<http://augeas.net/> website."
34332 #: ../src/guestfs.pod:457
34334 "If you don't want to use Augeas (you fool!) then try calling L</"
34335 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
34340 #: ../src/guestfs.pod:461
34345 #: ../src/guestfs.pod:463
34347 "We support SELinux guests. To ensure that labeling happens correctly in "
34348 "SELinux guests, you need to enable SELinux and load the guest's policy:"
34352 #: ../src/guestfs.pod:471
34353 msgid "Before launching, do:"
34357 #: ../src/guestfs.pod:473
34360 " guestfs_set_selinux (g, 1);\n"
34365 #: ../src/guestfs.pod:477
34367 "After mounting the guest's filesystem(s), load the policy. This is best "
34368 "done by running the L<load_policy(8)> command in the guest itself:"
34372 #: ../src/guestfs.pod:481
34375 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
34380 #: ../src/guestfs.pod:483
34382 "(Older versions of C<load_policy> require you to specify the name of the "
34387 #: ../src/guestfs.pod:488
34389 "Optionally, set the security context for the API. The correct security "
34390 "context to use can only be known by inspecting the guest. As an example:"
34394 #: ../src/guestfs.pod:492
34397 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
34402 #: ../src/guestfs.pod:496
34403 msgid "This will work for running commands and editing existing files."
34407 #: ../src/guestfs.pod:498
34409 "When new files are created, you may need to label them explicitly, for "
34410 "example by running the external command C<restorecon pathname>."
34414 #: ../src/guestfs.pod:502
34419 #: ../src/guestfs.pod:504
34421 "Certain calls are affected by the current file mode creation mask (the "
34422 "\"umask\"). In particular ones which create files or directories, such as "
34423 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
34424 "either the default mode that the file is created with or modifies the mode "
34429 #: ../src/guestfs.pod:510
34431 "The default umask is C<022>, so files are created with modes such as C<0644> "
34432 "and directories with C<0755>."
34436 #: ../src/guestfs.pod:513
34438 "There are two ways to avoid being affected by umask. Either set umask to 0 "
34439 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
34440 "guestfs_chmod> after creating each file or directory."
34444 #: ../src/guestfs.pod:517
34445 msgid "For more information about umask, see L<umask(2)>."
34449 #: ../src/guestfs.pod:521
34451 "Libguestfs allows you to access Linux guests which have been encrypted using "
34452 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
34453 "standard. This includes nearly all whole disk encryption systems used by "
34454 "modern Linux guests."
34458 #: ../src/guestfs.pod:527
34460 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
34461 "returns the string C<crypto_LUKS>)."
34465 #: ../src/guestfs.pod:530
34467 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
34468 "will require the passphrase!"
34472 #: ../src/guestfs.pod:533
34474 "Opening a LUKS device creates a new device mapper device called C</dev/"
34475 "mapper/mapname> (where C<mapname> is the string you supply to L</"
34476 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
34477 "from and encrypted to the underlying block device respectively."
34481 #: ../src/guestfs.pod:539
34483 "LVM volume groups on the device can be made visible by calling L</"
34484 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
34485 "(s) can now be mounted in the usual way."
34489 #: ../src/guestfs.pod:543
34491 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
34492 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
34493 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
34494 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
34495 "underlying encrypted block device)."
34499 #: ../src/guestfs.pod:550
34504 #: ../src/guestfs.pod:552
34506 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
34507 "contains operating systems, an install CD or a live CD. (These APIs used to "
34508 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
34509 "version 1.5.3 the most frequently used part of this library has been "
34510 "rewritten in C and moved into the core code)."
34514 #: ../src/guestfs.pod:559
34516 "Add all disks belonging to the unknown virtual machine and call L</"
34517 "guestfs_launch> in the usual way."
34521 #: ../src/guestfs.pod:562
34523 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
34524 "and certain heuristics, and returns a list of operating systems that were "
34525 "found. An empty list means none were found. A single element is the root "
34526 "filesystem of the operating system. For dual- or multi-boot guests, "
34527 "multiple roots can be returned, each one corresponding to a separate "
34528 "operating system. (Multi-boot virtual machines are extremely rare in the "
34529 "world of virtualization, but since this scenario can happen, we have built "
34530 "libguestfs to deal with it.)"
34534 #: ../src/guestfs.pod:571
34536 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
34537 "to get additional details about that operating system. For example, call L</"
34538 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
34539 "Windows and Linux-based operating systems respectively."
34543 #: ../src/guestfs.pod:577
34545 "Un*x-like and Linux-based operating systems usually consist of several "
34546 "filesystems which are mounted at boot time (for example, a separate boot "
34547 "partition mounted on C</boot>). The inspection rules are able to detect how "
34548 "filesystems correspond to mount points. Call "
34549 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
34550 "hash table like this example:"
34554 #: ../src/guestfs.pod:584
34557 " /boot => /dev/sda1\n"
34558 " / => /dev/vg_guest/lv_root\n"
34559 " /usr => /dev/vg_guest/lv_usr\n"
34564 #: ../src/guestfs.pod:588
34566 "The caller can then make calls to L</guestfs_mount_options> to mount the "
34567 "filesystems as suggested."
34571 #: ../src/guestfs.pod:591
34573 "Be careful to mount filesystems in the right order (eg. C</> before C</"
34574 "usr>). Sorting the keys of the hash by length, shortest first, should work."
34578 #: ../src/guestfs.pod:595
34580 "Inspection currently only works for some common operating systems. "
34581 "Contributors are welcome to send patches for other operating systems that we "
34582 "currently cannot detect."
34586 #: ../src/guestfs.pod:599
34588 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
34589 "for more details. The L</guestfs_inspect_os> function just ignores any "
34590 "encrypted devices."
34594 #: ../src/guestfs.pod:603
34596 "A note on the implementation: The call L</guestfs_inspect_os> performs "
34597 "inspection and caches the results in the guest handle. Subsequent calls to "
34598 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
34599 "read the disks. If you change the content of the guest disks, you can redo "
34600 "inspection by calling L</guestfs_inspect_os> again. (L</"
34601 "guestfs_inspect_list_applications> works a little differently from the other "
34602 "calls and does read the disks. See documentation for that function for "
34607 #: ../src/guestfs.pod:612
34608 msgid "INSPECTING INSTALL DISKS"
34612 #: ../src/guestfs.pod:614
34614 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
34619 #: ../src/guestfs.pod:617
34621 "Call L</guestfs_inspect_get_format> to return the format of the operating "
34622 "system, which currently can be C<installed> (a regular operating system) or "
34623 "C<installer> (some sort of install disk)."
34627 #: ../src/guestfs.pod:621
34629 "Further information is available about the operating system that can be "
34630 "installed using the regular inspection APIs like L</"
34631 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
34635 #: ../src/guestfs.pod:626
34637 "Some additional information specific to installer disks is also available "
34638 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
34639 "guestfs_inspect_is_multipart> calls."
34643 #: ../src/guestfs.pod:631
34644 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
34648 #: ../src/guestfs.pod:633
34650 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
34651 "ntfs-3g.org/> driver."
34655 #: ../src/guestfs.pod:636
34656 msgid "DRIVE LETTERS AND PATHS"
34660 #: ../src/guestfs.pod:638
34662 "DOS and Windows still use drive letters, and the filesystems are always "
34663 "treated as case insensitive by Windows itself, and therefore you might find "
34664 "a Windows configuration file referring to a path like C<c:\\windows"
34665 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
34666 "might be referred to as C</WINDOWS/System32>."
34670 #: ../src/guestfs.pod:644
34672 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
34673 "L</guestfs_inspect_get_drive_mappings>)"
34677 #: ../src/guestfs.pod:647
34679 "Dealing with separator characters (backslash vs forward slash) is outside "
34680 "the scope of libguestfs, but usually a simple character replacement will "
34685 #: ../src/guestfs.pod:651
34687 "To resolve the case insensitivity of paths, call L</"
34688 "guestfs_case_sensitive_path>."
34692 #: ../src/guestfs.pod:654
34693 msgid "ACCESSING THE WINDOWS REGISTRY"
34697 #: ../src/guestfs.pod:656
34699 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
34700 "files, through the library C<hivex> which is part of the libguestfs project "
34701 "although ships as a separate tarball. You have to locate and download the "
34702 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
34703 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
34704 "reg(1)> for more help on this issue."
34708 #: ../src/guestfs.pod:664
34709 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
34713 #: ../src/guestfs.pod:666
34715 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
34716 "provide something which looks like a Linux symlink. The way it tries to do "
34717 "the rewriting is described here:"
34721 #: ../src/guestfs.pod:670
34723 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
34728 #: ../src/guestfs.pod:672
34730 "The essential problem is that ntfs-3g simply does not have enough "
34731 "information to do a correct job. NTFS links can contain drive letters and "
34732 "references to external device GUIDs that ntfs-3g has no way of resolving. "
34733 "It is almost certainly the case that libguestfs callers should ignore what "
34734 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
34738 #: ../src/guestfs.pod:679
34740 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
34741 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
34742 "attribute, and read the raw reparse data from that (you can find the format "
34743 "documented in various places around the web)."
34747 #: ../src/guestfs.pod:684
34748 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
34752 #: ../src/guestfs.pod:686
34754 "There are other useful extended attributes that can be read from ntfs-3g "
34755 "filesystems (using L</guestfs_getxattr>). See:"
34759 #: ../src/guestfs.pod:689
34761 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
34765 #: ../src/guestfs.pod:691
34766 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
34770 #: ../src/guestfs.pod:693
34772 "Although we don't want to discourage you from using the C API, we will "
34773 "mention here that the same API is also available in other languages."
34777 #: ../src/guestfs.pod:696
34779 "The API is broadly identical in all supported languages. This means that "
34780 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
34781 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
34782 "OCaml. In other words, a straightforward, predictable isomorphism between "
34787 #: ../src/guestfs.pod:702
34789 "Error messages are automatically transformed into exceptions if the language "
34794 #: ../src/guestfs.pod:705
34796 "We don't try to \"object orientify\" parts of the API in OO languages, "
34797 "although contributors are welcome to write higher level APIs above what we "
34798 "provide in their favourite languages if they wish."
34802 #: ../src/guestfs.pod:711
34807 #: ../src/guestfs.pod:713
34809 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
34810 "identical to the C API. C++ classes and exceptions are not used."
34814 #: ../src/guestfs.pod:717
34819 #: ../src/guestfs.pod:719
34821 "The C# bindings are highly experimental. Please read the warnings at the "
34822 "top of C<csharp/Libguestfs.cs>."
34826 #: ../src/guestfs.pod:722
34831 #: ../src/guestfs.pod:724
34832 msgid "See L<guestfs-erlang(3)>."
34836 #: ../src/guestfs.pod:726
34841 #: ../src/guestfs.pod:728
34843 "This is the only language binding that is working but incomplete. Only "
34844 "calls which return simple integers have been bound in Haskell, and we are "
34845 "looking for help to complete this binding."
34849 #: ../src/guestfs.pod:732
34854 #: ../src/guestfs.pod:734
34856 "Full documentation is contained in the Javadoc which is distributed with "
34857 "libguestfs. For examples, see L<guestfs-java(3)>."
34861 #: ../src/guestfs.pod:737
34866 #: ../src/guestfs.pod:739
34867 msgid "See L<guestfs-ocaml(3)>."
34871 #: ../src/guestfs.pod:741
34876 #: ../src/guestfs.pod:743
34877 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
34881 #: ../src/guestfs.pod:745
34886 #: ../src/guestfs.pod:747
34888 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
34889 "the php-libguestfs package for your distribution."
34893 #: ../src/guestfs.pod:750
34894 msgid "The PHP binding only works correctly on 64 bit machines."
34898 #: ../src/guestfs.pod:752
34903 #: ../src/guestfs.pod:754
34904 msgid "See L<guestfs-python(3)>."
34908 #: ../src/guestfs.pod:756
34913 #: ../src/guestfs.pod:758
34914 msgid "See L<guestfs-ruby(3)>."
34918 #: ../src/guestfs.pod:760
34919 msgid "B<shell scripts>"
34923 #: ../src/guestfs.pod:762
34924 msgid "See L<guestfish(1)>."
34928 #: ../src/guestfs.pod:766
34929 msgid "LIBGUESTFS GOTCHAS"
34933 #: ../src/guestfs.pod:768
34935 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
34936 "system [...] that works in the way it is documented but is counterintuitive "
34937 "and almost invites mistakes.\""
34941 #: ../src/guestfs.pod:772
34943 "Since we developed libguestfs and the associated tools, there are several "
34944 "things we would have designed differently, but are now stuck with for "
34945 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
34946 "release, you can expect these to change. Beware of them."
34950 #: ../src/guestfs.pod:780
34951 msgid "Autosync / forgetting to sync."
34955 #: ../src/guestfs.pod:782
34957 "I<Update:> Autosync is enabled by default for all API users starting from "
34958 "libguestfs 1.5.24. This section only applies to older versions."
34962 #: ../src/guestfs.pod:785
34964 "When modifying a filesystem from C or another language, you B<must> unmount "
34965 "all filesystems and call L</guestfs_sync> explicitly before you close the "
34966 "libguestfs handle. You can also call:"
34970 #: ../src/guestfs.pod:789
34973 " guestfs_set_autosync (g, 1);\n"
34978 #: ../src/guestfs.pod:791
34980 "to have the unmount/sync done automatically for you when the handle 'g' is "
34981 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
34985 #: ../src/guestfs.pod:795
34987 "If you forget to do this, then it is entirely possible that your changes "
34988 "won't be written out, or will be partially written, or (very rarely) that "
34989 "you'll get disk corruption."
34993 #: ../src/guestfs.pod:799
34995 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
34996 "guestfish scripts that forget to sync will work just fine, which can make "
34997 "this very puzzling if you are trying to debug a problem."
35001 #: ../src/guestfs.pod:803
35002 msgid "Mount option C<-o sync> should not be the default."
35006 #: ../src/guestfs.pod:805
35008 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
35009 "libguestfs 1.13.16. This section only applies to older versions."
35013 #: ../src/guestfs.pod:808
35015 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
35016 "However C<-o sync> does not add any reliability benefit, but does have a "
35017 "very large performance impact."
35021 #: ../src/guestfs.pod:812
35023 "The work around is to use L</guestfs_mount_options> and set the mount "
35024 "options that you actually want to use."
35028 #: ../src/guestfs.pod:815
35029 msgid "Read-only should be the default."
35033 #: ../src/guestfs.pod:817
35035 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
35036 "specify I<--rw> if you want to make changes to the image."
35040 #: ../src/guestfs.pod:820
35041 msgid "This would reduce the potential to corrupt live VM images."
35045 #: ../src/guestfs.pod:822
35047 "Note that many filesystems change the disk when you just mount and unmount, "
35048 "even if you didn't perform any writes. You need to use L</"
35049 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
35053 #: ../src/guestfs.pod:826
35054 msgid "guestfish command line is hard to use."
35058 #: ../src/guestfs.pod:828
35060 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
35061 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
35062 "exist, so it fails. In earlier versions of guestfish the error message was "
35063 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
35064 "we should have used C<guestfish -c command> to run commands."
35068 #: ../src/guestfs.pod:835
35069 msgid "guestfish megabyte modifiers don't work right on all commands"
35073 #: ../src/guestfs.pod:837
35075 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
35076 "other modifiers). What guestfish actually does is to multiply the number "
35077 "part by the modifier part and pass the result to the C API. However this "
35078 "doesn't work for a few APIs which aren't expecting bytes, but are already "
35079 "expecting some other unit (eg. megabytes)."
35083 #: ../src/guestfs.pod:844
35084 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
35088 #: ../src/guestfs.pod:846
35091 " lvcreate LV VG 100M\n"
35096 #: ../src/guestfs.pod:848
35098 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
35099 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
35100 "megabytes * megabytes) logical volume. The error message you get from this "
35101 "is also a little obscure."
35105 #: ../src/guestfs.pod:853
35107 "This could be fixed in the generator by specially marking parameters and "
35108 "return values which take bytes or other units."
35112 #: ../src/guestfs.pod:856
35113 msgid "Ambiguity between devices and paths"
35117 #: ../src/guestfs.pod:858
35119 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
35120 "sdb2>) and a similar pathname. A file might just happen to be called "
35121 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
35125 #: ../src/guestfs.pod:863
35127 "In the current API we usually resolve this ambiguity by having two separate "
35128 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
35129 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
35130 "detecting if the path supplied begins with C</dev/>."
35134 #: ../src/guestfs.pod:869
35136 "To avoid both the ambiguity and the need to duplicate some calls, we could "
35137 "make paths/devices into structured names. One way to do this would be to "
35138 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
35139 "aspect of grub. Another way would be to use a structured type, equivalent "
35140 "to this OCaml type:"
35144 #: ../src/guestfs.pod:875
35147 " type path = Path of string | Device of int | Partition of int * int\n"
35152 #: ../src/guestfs.pod:877
35153 msgid "which would allow you to pass arguments like:"
35157 #: ../src/guestfs.pod:879
35160 " Path \"/foo/bar\"\n"
35161 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
35162 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
35163 " Path \"/dev/sdb2\" (* not a device *)\n"
35168 #: ../src/guestfs.pod:884
35170 "As you can see there are still problems to resolve even with this "
35171 "representation. Also consider how it might work in guestfish."
35175 #: ../src/guestfs.pod:889
35176 msgid "KEYS AND PASSPHRASES"
35180 #: ../src/guestfs.pod:891
35182 "Certain libguestfs calls take a parameter that contains sensitive key "
35183 "material, passed in as a C string."
35187 #: ../src/guestfs.pod:894
35189 "In the future we would hope to change the libguestfs implementation so that "
35190 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
35191 "swap. However this is I<not> done at the moment, because of the complexity "
35192 "of such an implementation."
35196 #: ../src/guestfs.pod:899
35198 "Therefore you should be aware that any key parameter you pass to libguestfs "
35199 "might end up being written out to the swap partition. If this is a concern, "
35200 "scrub the swap partition or don't use libguestfs on encrypted devices."
35204 #: ../src/guestfs.pod:904
35205 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
35209 #: ../src/guestfs.pod:906
35211 "All high-level libguestfs actions are synchronous. If you want to use "
35212 "libguestfs asynchronously then you must create a thread."
35216 #: ../src/guestfs.pod:909
35218 "Only use the handle from a single thread. Either use the handle exclusively "
35219 "from one thread, or provide your own mutex so that two threads cannot issue "
35220 "calls on the same handle at the same time."
35224 #: ../src/guestfs.pod:913
35226 "See the graphical program guestfs-browser for one possible architecture for "
35227 "multithreaded programs using libvirt and libguestfs."
35231 #: ../src/guestfs.pod:916
35236 #: ../src/guestfs.pod:918
35238 "Libguestfs needs a supermin appliance, which it finds by looking along an "
35243 #: ../src/guestfs.pod:921
35245 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
35246 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
35250 #: ../src/guestfs.pod:924
35252 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
35253 "to change the directories that libguestfs will search in. The value is a "
35254 "colon-separated list of paths. The current directory is I<not> searched "
35255 "unless the path contains an empty element or C<.>. For example "
35256 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
35257 "then C</usr/lib/guestfs>."
35261 #: ../src/guestfs.pod:931
35262 msgid "QEMU WRAPPERS"
35266 #: ../src/guestfs.pod:933
35268 "If you want to compile your own qemu, run qemu from a non-standard location, "
35269 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
35274 #: ../src/guestfs.pod:937
35276 "There is one important rule to remember: you I<must C<exec qemu>> as the "
35277 "last command in the shell script (so that qemu replaces the shell and "
35278 "becomes the direct child of the libguestfs-using program). If you don't do "
35279 "this, then the qemu process won't be cleaned up correctly."
35283 #: ../src/guestfs.pod:942
35285 "Here is an example of a wrapper, where I have built my own copy of qemu from "
35290 #: ../src/guestfs.pod:945
35294 " qemudir=/home/rjones/d/qemu\n"
35295 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
35300 #: ../src/guestfs.pod:949
35302 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
35303 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
35308 #: ../src/guestfs.pod:953
35311 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
35316 #: ../src/guestfs.pod:955
35318 "Note that libguestfs also calls qemu with the -help and -version options in "
35319 "order to determine features."
35323 #: ../src/guestfs.pod:958
35325 "Wrappers can also be used to edit the options passed to qemu. In the "
35326 "following example, the C<-machine ...> option (C<-machine> and the following "
35327 "argument) are removed from the command line and replaced with C<-machine pc,"
35328 "accel=tcg>. The while loop iterates over the options until it finds the "
35329 "right one to remove, putting the remaining options into the C<args> array."
35333 #: ../src/guestfs.pod:967
35337 " while [ $# -gt 0 ]; do\n"
35338 " case \"$1\" in\n"
35342 " args[i]=\"$1\"\n"
35351 #: ../src/guestfs.pod:979
35354 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
35359 #: ../src/guestfs.pod:981
35360 msgid "ATTACHING TO RUNNING DAEMONS"
35364 #: ../src/guestfs.pod:983
35366 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
35367 "babies. Use with caution."
35371 #: ../src/guestfs.pod:986
35373 "I<Note (2):> This section explains how to attach to a running daemon from a "
35374 "low level perspective. For most users, simply using virt tools such as "
35375 "L<guestfish(1)> with the I<--live> option will \"just work\"."
35379 #: ../src/guestfs.pod:990
35380 msgid "Using guestfs_set_attach_method"
35384 #: ../src/guestfs.pod:992
35386 "By calling L</guestfs_set_attach_method> you can change how the library "
35387 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
35388 "ARCHITECTURE> for some background)."
35392 #: ../src/guestfs.pod:996
35394 "The normal attach method is C<appliance>, where a small appliance is created "
35395 "containing the daemon, and then the library connects to this."
35399 #: ../src/guestfs.pod:999
35401 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
35402 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
35403 "daemon over the Unix domain socket."
35407 #: ../src/guestfs.pod:1003
35409 "The normal use for this is to connect to a running virtual machine that "
35410 "contains a C<guestfsd> daemon, and send commands so you can read and write "
35411 "files inside the live virtual machine."
35415 #: ../src/guestfs.pod:1007
35416 msgid "Using guestfs_add_domain with live flag"
35420 #: ../src/guestfs.pod:1009
35422 "L</guestfs_add_domain> provides some help for getting the correct attach "
35423 "method. If you pass the C<live> option to this function, then (if the "
35424 "virtual machine is running) it will examine the libvirt XML looking for a "
35425 "virtio-serial channel to connect to:"
35429 #: ../src/guestfs.pod:1015
35436 " <channel type='unix'>\n"
35437 " <source mode='bind' path='/path/to/socket'/>\n"
35438 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
35447 #: ../src/guestfs.pod:1027
35449 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
35450 "method to C<unix:/path/to/socket>."
35454 #: ../src/guestfs.pod:1030
35456 "Some of the libguestfs tools (including guestfish) support a I<--live> "
35457 "option which is passed through to L</guestfs_add_domain> thus allowing you "
35458 "to attach to and modify live virtual machines."
35462 #: ../src/guestfs.pod:1034
35464 "The virtual machine needs to have been set up beforehand so that it has the "
35465 "virtio-serial channel and so that guestfsd is running inside it."
35469 #: ../src/guestfs.pod:1038
35470 msgid "ABI GUARANTEE"
35474 #: ../src/guestfs.pod:1040
35476 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
35477 "actions as outlined in this section. Although we will deprecate some "
35478 "actions, for example if they get replaced by newer calls, we will keep the "
35479 "old actions forever. This allows you the developer to program in confidence "
35480 "against the libguestfs API."
35484 #: ../src/guestfs.pod:1046
35485 msgid "BLOCK DEVICE NAMING"
35489 #: ../src/guestfs.pod:1048
35491 "In the kernel there is now quite a profusion of schemata for naming block "
35492 "devices (in this context, by I<block device> I mean a physical or virtual "
35493 "hard drive). The original Linux IDE driver used names starting with C</dev/"
35494 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
35495 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
35496 "for the old IDE driver (particularly for SATA devices) those devices also "
35497 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
35498 "paravirtualized drivers. This has created several different naming systems, "
35499 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
35503 #: ../src/guestfs.pod:1060
35505 "As discussed above, libguestfs uses a qemu appliance running an embedded "
35506 "Linux kernel to access block devices. We can run a variety of appliances "
35507 "based on a variety of Linux kernels."
35511 #: ../src/guestfs.pod:1064
35513 "This causes a problem for libguestfs because many API calls use device or "
35514 "partition names. Working scripts and the recipe (example) scripts that we "
35515 "make available over the internet could fail if the naming scheme changes."
35519 #: ../src/guestfs.pod:1069
35521 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
35522 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
35523 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
35524 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
35528 #: ../src/guestfs.pod:1075
35530 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
35531 "L</guestfs_list_partitions> and similar calls return the true names of the "
35532 "devices and partitions as known to the appliance."
35536 #: ../src/guestfs.pod:1080
35537 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
35541 #: ../src/guestfs.pod:1082
35543 "Usually this translation is transparent. However in some (very rare) cases "
35544 "you may need to know the exact algorithm. Such cases include where you use "
35545 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
35546 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
35550 #: ../src/guestfs.pod:1088
35552 "The algorithm is applied only to I<parameters> which are known to be either "
35553 "device or partition names. Return values from functions such as L</"
35554 "guestfs_list_devices> are never changed."
35558 #: ../src/guestfs.pod:1096
35559 msgid "Is the string a parameter which is a device or partition name?"
35563 #: ../src/guestfs.pod:1100
35564 msgid "Does the string begin with C</dev/sd>?"
35568 #: ../src/guestfs.pod:1104
35570 "Does the named device exist? If so, we use that device. However if I<not> "
35571 "then we continue with this algorithm."
35575 #: ../src/guestfs.pod:1109
35576 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
35580 #: ../src/guestfs.pod:1111
35581 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
35585 #: ../src/guestfs.pod:1113
35586 msgid "If that named device exists, use it. If not, continue."
35590 #: ../src/guestfs.pod:1117
35591 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
35595 #: ../src/guestfs.pod:1119
35596 msgid "If that named device exists, use it. If not, return an error."
35600 #: ../src/guestfs.pod:1123
35601 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
35605 #: ../src/guestfs.pod:1125
35607 "Although the standard naming scheme and automatic translation is useful for "
35608 "simple programs and guestfish scripts, for larger programs it is best not to "
35609 "rely on this mechanism."
35613 #: ../src/guestfs.pod:1129
35615 "Where possible for maximum future portability programs using libguestfs "
35616 "should use these future-proof techniques:"
35620 #: ../src/guestfs.pod:1136
35622 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
35623 "device names, and then use those names directly."
35627 #: ../src/guestfs.pod:1139
35629 "Since those device names exist by definition, they will never be translated."
35633 #: ../src/guestfs.pod:1144
35635 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
35636 "filesystem labels."
35640 #: ../src/guestfs.pod:1151
35642 "This section discusses security implications of using libguestfs, "
35643 "particularly with untrusted or malicious guests or disk images."
35647 #: ../src/guestfs.pod:1154
35648 msgid "GENERAL SECURITY CONSIDERATIONS"
35652 #: ../src/guestfs.pod:1156
35654 "Be careful with any files or data that you download from a guest (by "
35655 "\"download\" we mean not just the L</guestfs_download> command but any "
35656 "command that reads files, filenames, directories or anything else from a "
35657 "disk image). An attacker could manipulate the data to fool your program "
35658 "into doing the wrong thing. Consider cases such as:"
35662 #: ../src/guestfs.pod:1166
35663 msgid "the data (file etc) not being present"
35667 #: ../src/guestfs.pod:1170
35668 msgid "being present but empty"
35672 #: ../src/guestfs.pod:1174
35673 msgid "being much larger than normal"
35677 #: ../src/guestfs.pod:1178
35678 msgid "containing arbitrary 8 bit data"
35682 #: ../src/guestfs.pod:1182
35683 msgid "being in an unexpected character encoding"
35687 #: ../src/guestfs.pod:1186
35688 msgid "containing homoglyphs."
35692 #: ../src/guestfs.pod:1190
35693 msgid "SECURITY OF MOUNTING FILESYSTEMS"
35697 #: ../src/guestfs.pod:1192
35699 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
35700 "(VFS) module can sometimes be escalated into exploits by deliberately "
35701 "creating a malicious, malformed filesystem. These exploits are very severe "
35702 "for two reasons. Firstly there are very many filesystem drivers in the "
35703 "kernel, and many of them are infrequently used and not much developer "
35704 "attention has been paid to the code. Linux userspace helps potential "
35705 "crackers by detecting the filesystem type and automatically choosing the "
35706 "right VFS driver, even if that filesystem type is obscure or unexpected for "
35707 "the administrator. Secondly, a kernel-level exploit is like a local root "
35708 "exploit (worse in some ways), giving immediate and total access to the "
35709 "system right down to the hardware level."
35713 #: ../src/guestfs.pod:1205
35715 "That explains why you should never mount a filesystem from an untrusted "
35716 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
35717 "inside a qemu virtual machine, usually running as a non-root user. The "
35718 "attacker would need to write a filesystem which first exploited the kernel, "
35719 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
35720 "the libguestfs protocol, and finally to be as serious as the host kernel "
35721 "exploit it would need to escalate its privileges to root. This multi-step "
35722 "escalation, performed by a static piece of data, is thought to be extremely "
35723 "hard to do, although we never say 'never' about security issues."
35727 #: ../src/guestfs.pod:1216
35729 "In any case callers can reduce the attack surface by forcing the filesystem "
35730 "type when mounting (use L</guestfs_mount_vfs>)."
35734 #: ../src/guestfs.pod:1219
35735 msgid "PROTOCOL SECURITY"
35739 #: ../src/guestfs.pod:1221
35741 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
35742 "defined upper message size. However a program that uses libguestfs must "
35743 "also take care - for example you can write a program that downloads a binary "
35744 "from a disk image and executes it locally, and no amount of protocol "
35745 "security will save you from the consequences."
35749 #: ../src/guestfs.pod:1227
35750 msgid "INSPECTION SECURITY"
35754 #: ../src/guestfs.pod:1229
35756 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
35757 "directly from the guest, and these could contain any 8 bit data. Callers "
35758 "should be careful to escape these before printing them to a structured file "
35759 "(for example, use HTML escaping if creating a web page)."
35763 #: ../src/guestfs.pod:1235
35765 "Guest configuration may be altered in unusual ways by the administrator of "
35766 "the virtual machine, and may not reflect reality (particularly for untrusted "
35767 "or actively malicious guests). For example we parse the hostname from "
35768 "configuration files like C</etc/sysconfig/network> that we find in the "
35769 "guest, but the guest administrator can easily manipulate these files to "
35770 "provide the wrong hostname."
35774 #: ../src/guestfs.pod:1243
35776 "The inspection API parses guest configuration using two external libraries: "
35777 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
35778 "designed to be robust in the face of malicious data, although denial of "
35779 "service attacks are still possible, for example with oversized configuration "
35784 #: ../src/guestfs.pod:1249
35785 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
35789 #: ../src/guestfs.pod:1251
35791 "Be very cautious about running commands from the guest. By running a "
35792 "command in the guest, you are giving CPU time to a binary that you do not "
35793 "control, under the same user account as the library, albeit wrapped in qemu "
35794 "virtualization. More information and alternatives can be found in the "
35795 "section L</RUNNING COMMANDS>."
35799 #: ../src/guestfs.pod:1257
35800 msgid "CVE-2010-3851"
35804 #: ../src/guestfs.pod:1259
35805 msgid "https://bugzilla.redhat.com/642934"
35809 #: ../src/guestfs.pod:1261
35811 "This security bug concerns the automatic disk format detection that qemu "
35812 "does on disk images."
35816 #: ../src/guestfs.pod:1264
35818 "A raw disk image is just the raw bytes, there is no header. Other disk "
35819 "images like qcow2 contain a special header. Qemu deals with this by looking "
35820 "for one of the known headers, and if none is found then assuming the disk "
35821 "image must be raw."
35825 #: ../src/guestfs.pod:1269
35827 "This allows a guest which has been given a raw disk image to write some "
35828 "other header. At next boot (or when the disk image is accessed by "
35829 "libguestfs) qemu would do autodetection and think the disk image format was, "
35830 "say, qcow2 based on the header written by the guest."
35834 #: ../src/guestfs.pod:1274
35836 "This in itself would not be a problem, but qcow2 offers many features, one "
35837 "of which is to allow a disk image to refer to another image (called the "
35838 "\"backing disk\"). It does this by placing the path to the backing disk "
35839 "into the qcow2 header. This path is not validated and could point to any "
35840 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
35841 "\"holes\" in the qcow2 disk image, which of course is completely under the "
35842 "control of the attacker."
35846 #: ../src/guestfs.pod:1282
35848 "In libguestfs this is rather hard to exploit except under two circumstances:"
35852 #: ../src/guestfs.pod:1289
35853 msgid "You have enabled the network or have opened the disk in write mode."
35857 #: ../src/guestfs.pod:1293
35859 "You are also running untrusted code from the guest (see L</RUNNING "
35864 #: ../src/guestfs.pod:1298
35866 "The way to avoid this is to specify the expected disk format when adding "
35867 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
35868 "should always do this if the disk is raw format, and it's a good idea for "
35873 #: ../src/guestfs.pod:1303
35875 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
35876 "format is fetched from libvirt and passed through."
35880 #: ../src/guestfs.pod:1306
35882 "For libguestfs tools, use the I<--format> command line parameter as "
35887 #: ../src/guestfs.pod:1309
35888 msgid "CONNECTION MANAGEMENT"
35892 #: ../src/guestfs.pod:1311
35893 msgid "guestfs_h *"
35897 #: ../src/guestfs.pod:1313
35899 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
35900 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
35901 "handle and release all resources used."
35905 #: ../src/guestfs.pod:1317
35907 "For information on using multiple handles and threads, see the section L</"
35908 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
35912 #: ../src/guestfs.pod:1320
35913 msgid "guestfs_create"
35917 #: ../src/guestfs.pod:1322
35920 " guestfs_h *guestfs_create (void);\n"
35925 #: ../src/guestfs.pod:1324
35926 msgid "Create a connection handle."
35930 #: ../src/guestfs.pod:1326
35932 "On success this returns a non-NULL pointer to a handle. On error it returns "
35937 #: ../src/guestfs.pod:1329
35939 "You have to \"configure\" the handle after creating it. This includes "
35940 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
35941 "handle at least once."
35945 #: ../src/guestfs.pod:1333
35946 msgid "After configuring the handle, you have to call L</guestfs_launch>."
35950 #: ../src/guestfs.pod:1335
35952 "You may also want to configure error handling for the handle. See the L</"
35953 "ERROR HANDLING> section below."
35957 #: ../src/guestfs.pod:1338
35958 msgid "guestfs_close"
35962 #: ../src/guestfs.pod:1340
35965 " void guestfs_close (guestfs_h *g);\n"
35970 #: ../src/guestfs.pod:1342
35971 msgid "This closes the connection handle and frees up all resources used."
35975 #: ../src/guestfs.pod:1344
35977 "If autosync was set on the handle and the handle was launched, then this "
35978 "implicitly calls various functions to unmount filesystems and sync the "
35979 "disk. See L</guestfs_set_autosync> for more details."
35983 #: ../src/guestfs.pod:1348
35984 msgid "If a close callback was set on the handle, then it is called."
35988 #: ../src/guestfs.pod:1350
35989 msgid "ERROR HANDLING"
35993 #: ../src/guestfs.pod:1352
35995 "API functions can return errors. For example, almost all functions that "
35996 "return C<int> will return C<-1> to indicate an error."
36000 #: ../src/guestfs.pod:1355
36002 "Additional information is available for errors: an error message string and "
36003 "optionally an error number (errno) if the thing that failed was a system "
36008 #: ../src/guestfs.pod:1359
36010 "You can get at the additional information about the last error on the handle "
36011 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
36012 "up an error handler with L</guestfs_set_error_handler>."
36016 #: ../src/guestfs.pod:1364
36018 "When the handle is created, a default error handler is installed which "
36019 "prints the error message string to C<stderr>. For small short-running "
36020 "command line programs it is sufficient to do:"
36024 #: ../src/guestfs.pod:1368
36027 " if (guestfs_launch (g) == -1)\n"
36028 " exit (EXIT_FAILURE);\n"
36033 #: ../src/guestfs.pod:1371
36035 "since the default error handler will ensure that an error message has been "
36036 "printed to C<stderr> before the program exits."
36040 #: ../src/guestfs.pod:1374
36042 "For other programs the caller will almost certainly want to install an "
36043 "alternate error handler or do error handling in-line like this:"
36047 #: ../src/guestfs.pod:1377
36050 " /* This disables the default behaviour of printing errors\n"
36052 " guestfs_set_error_handler (g, NULL, NULL);\n"
36057 #: ../src/guestfs.pod:1381
36060 " if (guestfs_launch (g) == -1) {\n"
36061 " /* Examine the error message and print it etc. */\n"
36062 " char *msg = guestfs_last_error (g);\n"
36063 " int errnum = guestfs_last_errno (g);\n"
36064 " fprintf (stderr, \"%s\", msg);\n"
36065 " if (errnum != 0)\n"
36066 " fprintf (stderr, \": %s\", strerror (errnum));\n"
36067 " fprintf (stderr, \"\\n\");\n"
36074 #: ../src/guestfs.pod:1392
36076 "Out of memory errors are handled differently. The default action is to call "
36077 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
36078 "guestfs_set_out_of_memory_handler>."
36082 #: ../src/guestfs.pod:1396
36084 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
36085 "because there is no handle if this happens there is no way to get additional "
36086 "error information. However L</guestfs_create> is supposed to be a "
36087 "lightweight operation which can only fail because of insufficient memory (it "
36088 "returns NULL in this case)."
36092 #: ../src/guestfs.pod:1402
36093 msgid "guestfs_last_error"
36097 #: ../src/guestfs.pod:1404
36100 " const char *guestfs_last_error (guestfs_h *g);\n"
36105 #: ../src/guestfs.pod:1406
36107 "This returns the last error message that happened on C<g>. If there has not "
36108 "been an error since the handle was created, then this returns C<NULL>."
36112 #: ../src/guestfs.pod:1410
36114 "The lifetime of the returned string is until the next error occurs, or L</"
36115 "guestfs_close> is called."
36119 #: ../src/guestfs.pod:1413
36120 msgid "guestfs_last_errno"
36124 #: ../src/guestfs.pod:1415
36127 " int guestfs_last_errno (guestfs_h *g);\n"
36132 #: ../src/guestfs.pod:1417
36133 msgid "This returns the last error number (errno) that happened on C<g>."
36137 #: ../src/guestfs.pod:1419
36138 msgid "If successful, an errno integer not equal to zero is returned."
36142 #: ../src/guestfs.pod:1421
36144 "If no error, this returns 0. This call can return 0 in three situations:"
36148 #: ../src/guestfs.pod:1428
36149 msgid "There has not been any error on the handle."
36153 #: ../src/guestfs.pod:1432
36155 "There has been an error but the errno was meaningless. This corresponds to "
36156 "the case where the error did not come from a failed system call, but for "
36157 "some other reason."
36161 #: ../src/guestfs.pod:1438
36163 "There was an error from a failed system call, but for some reason the errno "
36164 "was not captured and returned. This usually indicates a bug in libguestfs."
36168 #: ../src/guestfs.pod:1444
36170 "Libguestfs tries to convert the errno from inside the applicance into a "
36171 "corresponding errno for the caller (not entirely trivial: the appliance "
36172 "might be running a completely different operating system from the library "
36173 "and error numbers are not standardized across Un*xen). If this could not be "
36174 "done, then the error is translated to C<EINVAL>. In practice this should "
36175 "only happen in very rare circumstances."
36179 #: ../src/guestfs.pod:1452
36180 msgid "guestfs_set_error_handler"
36184 #: ../src/guestfs.pod:1454
36187 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
36189 " const char *msg);\n"
36190 " void guestfs_set_error_handler (guestfs_h *g,\n"
36191 " guestfs_error_handler_cb cb,\n"
36192 " void *opaque);\n"
36197 #: ../src/guestfs.pod:1461
36199 "The callback C<cb> will be called if there is an error. The parameters "
36200 "passed to the callback are an opaque data pointer and the error message "
36205 #: ../src/guestfs.pod:1465
36207 "C<errno> is not passed to the callback. To get that the callback must call "
36208 "L</guestfs_last_errno>."
36212 #: ../src/guestfs.pod:1468
36214 "Note that the message string C<msg> is freed as soon as the callback "
36215 "function returns, so if you want to stash it somewhere you must make your "
36220 #: ../src/guestfs.pod:1472
36221 msgid "The default handler prints messages on C<stderr>."
36225 #: ../src/guestfs.pod:1474
36226 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
36230 #: ../src/guestfs.pod:1476
36231 msgid "guestfs_get_error_handler"
36235 #: ../src/guestfs.pod:1478
36238 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
36239 " void **opaque_rtn);\n"
36244 #: ../src/guestfs.pod:1481
36245 msgid "Returns the current error handler callback."
36249 #: ../src/guestfs.pod:1483
36250 msgid "guestfs_set_out_of_memory_handler"
36254 #: ../src/guestfs.pod:1485
36257 " typedef void (*guestfs_abort_cb) (void);\n"
36258 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
36259 " guestfs_abort_cb);\n"
36264 #: ../src/guestfs.pod:1489
36266 "The callback C<cb> will be called if there is an out of memory situation. "
36267 "I<Note this callback must not return>."
36271 #: ../src/guestfs.pod:1492
36272 msgid "The default is to call L<abort(3)>."
36276 #: ../src/guestfs.pod:1494
36278 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
36282 #: ../src/guestfs.pod:1497
36283 msgid "guestfs_get_out_of_memory_handler"
36287 #: ../src/guestfs.pod:1499
36290 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
36295 #: ../src/guestfs.pod:1501
36296 msgid "This returns the current out of memory handler."
36300 #: ../src/guestfs.pod:1503
36305 #: ../src/guestfs.pod:1507
36310 #: ../src/guestfs.pod:1509
36315 #: ../src/guestfs.pod:1511
36316 msgid "AVAILABILITY"
36320 #: ../src/guestfs.pod:1513
36321 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
36325 #: ../src/guestfs.pod:1515
36327 "Using L</guestfs_available> you can test availability of the following "
36328 "groups of functions. This test queries the appliance to see if the "
36329 "appliance you are currently using supports the functionality."
36333 #: ../src/guestfs.pod:1520
36334 msgid "@AVAILABILITY@"
36338 #: ../src/guestfs.pod:1522
36339 msgid "GUESTFISH supported COMMAND"
36343 #: ../src/guestfs.pod:1524
36345 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
36346 "prints out the available groups and whether they are supported by this build "
36347 "of libguestfs. Note however that you have to do C<run> first."
36351 #: ../src/guestfs.pod:1529
36352 msgid "SINGLE CALLS AT COMPILE TIME"
36356 #: ../src/guestfs.pod:1531
36358 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
36359 "function, such as:"
36363 #: ../src/guestfs.pod:1534
36366 " #define LIBGUESTFS_HAVE_DD 1\n"
36371 #: ../src/guestfs.pod:1536
36372 msgid "if L</guestfs_dd> is available."
36376 #: ../src/guestfs.pod:1538
36378 "Before version 1.5.8, if you needed to test whether a single libguestfs "
36379 "function is available at compile time, we recommended using build tools such "
36380 "as autoconf or cmake. For example in autotools you could use:"
36384 #: ../src/guestfs.pod:1543
36387 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
36388 " AC_CHECK_FUNCS([guestfs_dd])\n"
36393 #: ../src/guestfs.pod:1546
36395 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
36400 #: ../src/guestfs.pod:1549
36401 msgid "SINGLE CALLS AT RUN TIME"
36405 #: ../src/guestfs.pod:1551
36407 "Testing at compile time doesn't guarantee that a function really exists in "
36408 "the library. The reason is that you might be dynamically linked against a "
36409 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
36410 "This situation unfortunately results in a segmentation fault, which is a "
36411 "shortcoming of the C dynamic linking system itself."
36415 #: ../src/guestfs.pod:1558
36417 "You can use L<dlopen(3)> to test if a function is available at run time, as "
36418 "in this example program (note that you still need the compile time check as "
36423 #: ../src/guestfs.pod:1562
36426 " #include <stdio.h>\n"
36427 " #include <stdlib.h>\n"
36428 " #include <unistd.h>\n"
36429 " #include <dlfcn.h>\n"
36430 " #include <guestfs.h>\n"
36435 #: ../src/guestfs.pod:1568
36440 " #ifdef LIBGUESTFS_HAVE_DD\n"
36442 " int has_function;\n"
36447 #: ../src/guestfs.pod:1574
36450 " /* Test if the function guestfs_dd is really available. */\n"
36451 " dl = dlopen (NULL, RTLD_LAZY);\n"
36453 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
36454 " exit (EXIT_FAILURE);\n"
36456 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
36462 #: ../src/guestfs.pod:1583
36465 " if (!has_function)\n"
36466 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
36468 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
36469 " /* Now it's safe to call\n"
36470 " guestfs_dd (g, \"foo\", \"bar\");\n"
36474 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
36481 #: ../src/guestfs.pod:1596
36483 "You may think the above is an awful lot of hassle, and it is. There are "
36484 "other ways outside of the C linking system to ensure that this kind of "
36485 "incompatibility never arises, such as using package versioning:"
36489 #: ../src/guestfs.pod:1601
36492 " Requires: libguestfs >= 1.0.80\n"
36497 #: ../src/guestfs.pod:1603
36498 msgid "CALLS WITH OPTIONAL ARGUMENTS"
36502 #: ../src/guestfs.pod:1605
36504 "A recent feature of the API is the introduction of calls which take optional "
36505 "arguments. In C these are declared 3 ways. The main way is as a call which "
36506 "takes variable arguments (ie. C<...>), as in this example:"
36510 #: ../src/guestfs.pod:1610
36513 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
36518 #: ../src/guestfs.pod:1612
36520 "Call this with a list of optional arguments, terminated by C<-1>. So to "
36521 "call with no optional arguments specified:"
36525 #: ../src/guestfs.pod:1615
36528 " guestfs_add_drive_opts (g, filename, -1);\n"
36533 #: ../src/guestfs.pod:1617
36534 msgid "With a single optional argument:"
36538 #: ../src/guestfs.pod:1619
36541 " guestfs_add_drive_opts (g, filename,\n"
36542 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36548 #: ../src/guestfs.pod:1623
36553 #: ../src/guestfs.pod:1625
36556 " guestfs_add_drive_opts (g, filename,\n"
36557 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36558 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
36564 #: ../src/guestfs.pod:1630
36566 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
36571 #: ../src/guestfs.pod:1633
36572 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
36576 #: ../src/guestfs.pod:1635
36578 "The second variant has the same name with the suffix C<_va>, which works the "
36579 "same way but takes a C<va_list>. See the C manual for details. For the "
36580 "example function, this is declared:"
36584 #: ../src/guestfs.pod:1639
36587 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
36588 " va_list args);\n"
36593 #: ../src/guestfs.pod:1642
36594 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
36598 #: ../src/guestfs.pod:1644
36600 "The third variant is useful where you need to construct these calls. You "
36601 "pass in a structure where you fill in the optional fields. The structure "
36602 "has a bitmask as the first element which you must set to indicate which "
36603 "fields you have filled in. For our example function the structure and call "
36608 #: ../src/guestfs.pod:1650
36611 " struct guestfs_add_drive_opts_argv {\n"
36612 " uint64_t bitmask;\n"
36614 " const char *format;\n"
36617 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
36618 " const struct guestfs_add_drive_opts_argv *optargs);\n"
36623 #: ../src/guestfs.pod:1659
36624 msgid "You could call it like this:"
36628 #: ../src/guestfs.pod:1661
36631 " struct guestfs_add_drive_opts_argv optargs = {\n"
36632 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
36633 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
36634 " .readonly = 1,\n"
36635 " .format = \"qcow2\"\n"
36641 #: ../src/guestfs.pod:1668
36644 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
36649 #: ../src/guestfs.pod:1676
36650 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
36654 #: ../src/guestfs.pod:1681
36655 msgid "You do not need to fill in all fields of the structure."
36659 #: ../src/guestfs.pod:1685
36661 "There must be a one-to-one correspondence between fields of the structure "
36662 "that are filled in, and bits set in the bitmask."
36666 #: ../src/guestfs.pod:1690
36667 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
36671 #: ../src/guestfs.pod:1692
36673 "In other languages, optional arguments are expressed in the way that is "
36674 "natural for that language. We refer you to the language-specific "
36675 "documentation for more details on that."
36679 #: ../src/guestfs.pod:1696
36680 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
36684 #: ../src/guestfs.pod:1698
36685 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
36689 #: ../src/guestfs.pod:1700
36691 "B<Note:> This section documents the generic event mechanism introduced in "
36692 "libguestfs 1.10, which you should use in new code if possible. The old "
36693 "functions C<guestfs_set_log_message_callback>, "
36694 "C<guestfs_set_subprocess_quit_callback>, "
36695 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
36696 "C<guestfs_set_progress_callback> are no longer documented in this manual "
36697 "page. Because of the ABI guarantee, the old functions continue to work."
36701 #: ../src/guestfs.pod:1709
36703 "Handles generate events when certain things happen, such as log messages "
36704 "being generated, progress messages during long-running operations, or the "
36705 "handle being closed. The API calls described below let you register a "
36706 "callback to be called when events happen. You can register multiple "
36707 "callbacks (for the same, different or overlapping sets of events), and "
36708 "individually remove callbacks. If callbacks are not removed, then they "
36709 "remain in force until the handle is closed."
36713 #: ../src/guestfs.pod:1717
36715 "In the current implementation, events are only generated synchronously: that "
36716 "means that events (and hence callbacks) can only happen while you are in the "
36717 "middle of making another libguestfs call. The callback is called in the "
36722 #: ../src/guestfs.pod:1722
36724 "Events may contain a payload, usually nothing (void), an array of 64 bit "
36725 "unsigned integers, or a message buffer. Payloads are discussed later on."
36729 #: ../src/guestfs.pod:1726
36730 msgid "CLASSES OF EVENTS"
36734 #: ../src/guestfs.pod:1730
36735 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
36739 #: ../src/guestfs.pod:1733
36741 "The callback function will be called while the handle is being closed "
36742 "(synchronously from L</guestfs_close>)."
36746 #: ../src/guestfs.pod:1736
36748 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
36749 "handles that are open when the program exits. This means that this callback "
36750 "might be called indirectly from L<exit(3)>, which can cause unexpected "
36751 "problems in higher-level languages (eg. if your HLL interpreter has already "
36752 "been cleaned up by the time this is called, and if your callback then jumps "
36753 "into some HLL function)."
36757 #: ../src/guestfs.pod:1743
36759 "If no callback is registered: the handle is closed without any callback "
36764 #: ../src/guestfs.pod:1746
36765 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
36769 #: ../src/guestfs.pod:1749
36771 "The callback function will be called when the child process quits, either "
36772 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
36773 "corresponds to a transition from any state to the CONFIG state)."
36777 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
36778 msgid "If no callback is registered: the event is ignored."
36782 #: ../src/guestfs.pod:1755
36783 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
36787 #: ../src/guestfs.pod:1758
36789 "The callback function will be called when the child process becomes ready "
36790 "first time after it has been launched. (This corresponds to a transition "
36791 "from LAUNCHING to the READY state)."
36795 #: ../src/guestfs.pod:1764
36796 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
36800 #: ../src/guestfs.pod:1767
36802 "Some long-running operations can generate progress messages. If this "
36803 "callback is registered, then it will be called each time a progress message "
36804 "is generated (usually two seconds after the operation started, and three "
36805 "times per second thereafter until it completes, although the frequency may "
36806 "change in future versions)."
36810 #: ../src/guestfs.pod:1773
36812 "The callback receives in the payload four unsigned 64 bit numbers which are "
36813 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
36817 #: ../src/guestfs.pod:1776
36819 "The units of C<total> are not defined, although for some operations C<total> "
36820 "may relate in some way to the amount of data to be transferred (eg. in bytes "
36821 "or megabytes), and C<position> may be the portion which has been transferred."
36825 #: ../src/guestfs.pod:1781
36826 msgid "The only defined and stable parts of the API are:"
36830 #: ../src/guestfs.pod:1787
36832 "The callback can display to the user some type of progress bar or indicator "
36833 "which shows the ratio of C<position>:C<total>."
36837 #: ../src/guestfs.pod:1792
36838 msgid "0 E<lt>= C<position> E<lt>= C<total>"
36842 #: ../src/guestfs.pod:1796
36844 "If any progress notification is sent during a call, then a final progress "
36845 "notification is always sent when C<position> = C<total> (I<unless> the call "
36846 "fails with an error)."
36850 #: ../src/guestfs.pod:1800
36852 "This is to simplify caller code, so callers can easily set the progress "
36853 "indicator to \"100%\" at the end of the operation, without requiring special "
36854 "code to detect this case."
36858 #: ../src/guestfs.pod:1806
36860 "For some calls we are unable to estimate the progress of the call, but we "
36861 "can still generate progress messages to indicate activity. This is known as "
36862 "\"pulse mode\", and is directly supported by certain progress bar "
36863 "implementations (eg. GtkProgressBar)."
36867 #: ../src/guestfs.pod:1811
36869 "For these calls, zero or more progress messages are generated with "
36870 "C<position = 0> and C<total = 1>, followed by a final message with "
36871 "C<position = total = 1>."
36875 #: ../src/guestfs.pod:1815
36877 "As noted above, if the call fails with an error then the final message may "
36878 "not be generated."
36882 #: ../src/guestfs.pod:1820
36884 "The callback also receives the procedure number (C<proc_nr>) and serial "
36885 "number (C<serial>) of the call. These are only useful for debugging "
36886 "protocol issues, and the callback can normally ignore them. The callback "
36887 "may want to print these numbers in error messages or debugging messages."
36891 #: ../src/guestfs.pod:1826
36892 msgid "If no callback is registered: progress messages are discarded."
36896 #: ../src/guestfs.pod:1828
36897 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
36901 #: ../src/guestfs.pod:1831
36903 "The callback function is called whenever a log message is generated by qemu, "
36904 "the appliance kernel, guestfsd (daemon), or utility programs."
36908 #: ../src/guestfs.pod:1834
36910 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
36911 "guestfs_launch>) then additional debug messages are generated."
36915 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
36917 "If no callback is registered: the messages are discarded unless the verbose "
36918 "flag is set in which case they are sent to stderr. You can override the "
36919 "printing of verbose messages to stderr by setting up a callback."
36923 #: ../src/guestfs.pod:1842
36924 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
36928 #: ../src/guestfs.pod:1845
36930 "The callback function is called whenever a log message is generated by the "
36931 "library part of libguestfs."
36935 #: ../src/guestfs.pod:1848
36937 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
36938 "messages are generated."
36942 #: ../src/guestfs.pod:1856
36943 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
36947 #: ../src/guestfs.pod:1859
36949 "The callback function is called whenever a trace message is generated. This "
36950 "only applies if the trace flag (L</guestfs_set_trace>) is set."
36954 #: ../src/guestfs.pod:1862
36956 "If no callback is registered: the messages are sent to stderr. You can "
36957 "override the printing of trace messages to stderr by setting up a callback."
36961 #: ../src/guestfs.pod:1866
36962 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
36966 #: ../src/guestfs.pod:1869
36968 "The callback function is called whenever a libguestfs function is entered."
36972 #: ../src/guestfs.pod:1872
36974 "The payload is a string which contains the name of the function that we are "
36975 "entering (not including C<guestfs_> prefix)."
36979 #: ../src/guestfs.pod:1875
36981 "Note that libguestfs functions can call themselves, so you may see many "
36982 "events from a single call. A few libguestfs functions do not generate this "
36987 #: ../src/guestfs.pod:1883
36988 msgid "guestfs_set_event_callback"
36992 #: ../src/guestfs.pod:1885
36995 " int guestfs_set_event_callback (guestfs_h *g,\n"
36996 " guestfs_event_callback cb,\n"
36997 " uint64_t event_bitmask,\n"
36999 " void *opaque);\n"
37004 #: ../src/guestfs.pod:1891
37006 "This function registers a callback (C<cb>) for all event classes in the "
37007 "C<event_bitmask>."
37011 #: ../src/guestfs.pod:1894
37013 "For example, to register for all log message events, you could call this "
37014 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
37015 "To register a single callback for all possible classes of events, use "
37016 "C<GUESTFS_EVENT_ALL>."
37020 #: ../src/guestfs.pod:1900
37021 msgid "C<flags> should always be passed as 0."
37025 #: ../src/guestfs.pod:1902
37027 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
37028 "it for any purpose."
37032 #: ../src/guestfs.pod:1905
37034 "The return value is the event handle (an integer) which you can use to "
37035 "delete the callback (see below)."
37039 #: ../src/guestfs.pod:1908
37041 "If there is an error, this function returns C<-1>, and sets the error in the "
37042 "handle in the usual way (see L</guestfs_last_error> etc.)"
37046 #: ../src/guestfs.pod:1911
37048 "Callbacks remain in effect until they are deleted, or until the handle is "
37053 #: ../src/guestfs.pod:1914
37055 "In the case where multiple callbacks are registered for a particular event "
37056 "class, all of the callbacks are called. The order in which multiple "
37057 "callbacks are called is not defined."
37061 #: ../src/guestfs.pod:1918
37062 msgid "guestfs_delete_event_callback"
37066 #: ../src/guestfs.pod:1920
37069 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
37074 #: ../src/guestfs.pod:1922
37076 "Delete a callback that was previously registered. C<event_handle> should be "
37077 "the integer that was returned by a previous call to "
37078 "C<guestfs_set_event_callback> on the same handle."
37082 #: ../src/guestfs.pod:1926
37083 msgid "guestfs_event_callback"
37087 #: ../src/guestfs.pod:1928
37090 " typedef void (*guestfs_event_callback) (\n"
37093 " uint64_t event,\n"
37094 " int event_handle,\n"
37096 " const char *buf, size_t buf_len,\n"
37097 " const uint64_t *array, size_t array_len);\n"
37102 #: ../src/guestfs.pod:1937
37104 "This is the type of the event callback function that you have to provide."
37108 #: ../src/guestfs.pod:1940
37110 "The basic parameters are: the handle (C<g>), the opaque user pointer "
37111 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
37112 "handle, and C<flags> which in the current API you should ignore."
37116 #: ../src/guestfs.pod:1944
37118 "The remaining parameters contain the event payload (if any). Each event may "
37119 "contain a payload, which usually relates to the event class, but for future "
37120 "proofing your code should be written to handle any payload for any event "
37125 #: ../src/guestfs.pod:1949
37127 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
37128 "there is no message buffer). Note that this message buffer can contain "
37129 "arbitrary 8 bit data, including NUL bytes."
37133 #: ../src/guestfs.pod:1953
37135 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
37136 "moment this is only used for progress messages."
37140 #: ../src/guestfs.pod:1956
37141 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
37145 #: ../src/guestfs.pod:1958
37147 "One motivation for the generic event API was to allow GUI programs to "
37148 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
37149 "unconditionally to C<stderr>."
37153 #: ../src/guestfs.pod:1962
37155 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
37156 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
37157 "messages are not events; you must capture error messages separately)."
37161 #: ../src/guestfs.pod:1967
37163 "Programs have to set up a callback to capture the classes of events of "
37168 #: ../src/guestfs.pod:1970
37172 " guestfs_set_event_callback\n"
37173 " (g, message_callback,\n"
37174 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
37175 " GUESTFS_EVENT_TRACE,\n"
37176 " 0, NULL) == -1)\n"
37177 " if (eh == -1) {\n"
37178 " // handle error in the usual way\n"
37184 #: ../src/guestfs.pod:1980
37186 "The callback can then direct messages to the appropriate place. In this "
37187 "example, messages are directed to syslog:"
37191 #: ../src/guestfs.pod:1983
37195 " message_callback (\n"
37198 " uint64_t event,\n"
37199 " int event_handle,\n"
37201 " const char *buf, size_t buf_len,\n"
37202 " const uint64_t *array, size_t array_len)\n"
37204 " const int priority = LOG_USER|LOG_INFO;\n"
37205 " if (buf_len > 0)\n"
37206 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
37212 #: ../src/guestfs.pod:1998
37213 msgid "CANCELLING LONG TRANSFERS"
37217 #: ../src/guestfs.pod:2000
37219 "Some operations can be cancelled by the caller while they are in progress. "
37220 "Currently only operations that involve uploading or downloading data can be "
37221 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
37222 "parameters in the generator)."
37226 #: ../src/guestfs.pod:2005
37227 msgid "guestfs_user_cancel"
37231 #: ../src/guestfs.pod:2007
37234 " void guestfs_user_cancel (guestfs_h *g);\n"
37239 #: ../src/guestfs.pod:2009
37241 "C<guestfs_user_cancel> cancels the current upload or download operation."
37245 #: ../src/guestfs.pod:2012
37247 "Unlike most other libguestfs calls, this function is signal safe and thread "
37248 "safe. You can call it from a signal handler or from another thread, without "
37249 "needing to do any locking."
37253 #: ../src/guestfs.pod:2016
37255 "The transfer that was in progress (if there is one) will stop shortly "
37256 "afterwards, and will return an error. The errno (see L</"
37257 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
37258 "out if the operation was cancelled or failed because of another error."
37262 #: ../src/guestfs.pod:2022
37264 "No cleanup is performed: for example, if a file was being uploaded then "
37265 "after cancellation there may be a partially uploaded file. It is the "
37266 "caller's responsibility to clean up if necessary."
37270 #: ../src/guestfs.pod:2026
37271 msgid "There are two common places that you might call C<guestfs_user_cancel>."
37275 #: ../src/guestfs.pod:2028
37277 "In an interactive text-based program, you might call it from a C<SIGINT> "
37278 "signal handler so that pressing C<^C> cancels the current operation. (You "
37279 "also need to call L</guestfs_set_pgroup> so that child processes don't "
37280 "receive the C<^C> signal)."
37284 #: ../src/guestfs.pod:2033
37286 "In a graphical program, when the main thread is displaying a progress bar "
37287 "with a cancel button, wire up the cancel button to call this function."
37291 #: ../src/guestfs.pod:2037
37292 msgid "PRIVATE DATA AREA"
37296 #: ../src/guestfs.pod:2039
37298 "You can attach named pieces of private data to the libguestfs handle, fetch "
37299 "them by name, and walk over them, for the lifetime of the handle. This is "
37300 "called the private data area and is only available from the C API."
37304 #: ../src/guestfs.pod:2044
37305 msgid "To attach a named piece of data, use the following call:"
37309 #: ../src/guestfs.pod:2046
37312 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
37317 #: ../src/guestfs.pod:2048
37319 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
37320 "pointer (which can be C<NULL>). Any previous item with the same key is "
37325 #: ../src/guestfs.pod:2052
37327 "You can use any C<key> you want, but your key should I<not> start with an "
37328 "underscore character. Keys beginning with an underscore character are "
37329 "reserved for internal libguestfs purposes (eg. for implementing language "
37330 "bindings). It is recommended that you prefix the key with some unique "
37331 "string to avoid collisions with other users."
37335 #: ../src/guestfs.pod:2058
37336 msgid "To retrieve the pointer, use:"
37340 #: ../src/guestfs.pod:2060
37343 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
37348 #: ../src/guestfs.pod:2062
37350 "This function returns C<NULL> if either no data is found associated with "
37351 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
37356 #: ../src/guestfs.pod:2066
37358 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
37359 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
37360 "all. In particular, libguestfs does I<not> try to free the data when the "
37361 "handle is closed. If the data must be freed, then the caller must either "
37362 "free it before calling L</guestfs_close> or must set up a close callback to "
37363 "do it (see L</GUESTFS_EVENT_CLOSE>)."
37367 #: ../src/guestfs.pod:2073
37368 msgid "To walk over all entries, use these two functions:"
37372 #: ../src/guestfs.pod:2075
37375 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
37380 #: ../src/guestfs.pod:2077
37383 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
37388 #: ../src/guestfs.pod:2079
37390 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
37391 "not have any particular meaning -- keys are not returned in any defined "
37392 "order). A pointer to the key is returned in C<*key_rtn> and the "
37393 "corresponding data pointer is returned from the function. C<NULL> is "
37394 "returned if there are no keys stored in the handle."
37398 #: ../src/guestfs.pod:2085
37400 "C<guestfs_next_private> returns the next key, pointer pair. The return "
37401 "value of this function is also C<NULL> is there are no further entries to "
37406 #: ../src/guestfs.pod:2089
37407 msgid "Notes about walking over entries:"
37411 #: ../src/guestfs.pod:2095
37413 "You must not call C<guestfs_set_private> while walking over the entries."
37417 #: ../src/guestfs.pod:2100
37419 "The handle maintains an internal iterator which is reset when you call "
37420 "C<guestfs_first_private>. This internal iterator is invalidated when you "
37421 "call C<guestfs_set_private>."
37425 #: ../src/guestfs.pod:2106
37426 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
37430 #: ../src/guestfs.pod:2108
37433 " guestfs_set_private (g, key, NULL);\n"
37438 #: ../src/guestfs.pod:2110
37439 msgid "then that C<key> is not returned when walking."
37443 #: ../src/guestfs.pod:2114
37445 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
37446 "C<guestfs_next_private> or C<guestfs_set_private>."
37450 #: ../src/guestfs.pod:2120
37452 "The following example code shows how to print all keys and data pointers "
37453 "that are associated with the handle C<g>:"
37457 #: ../src/guestfs.pod:2123
37460 " const char *key;\n"
37461 " void *data = guestfs_first_private (g, &key);\n"
37462 " while (data != NULL)\n"
37464 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37465 " data = guestfs_next_private (g, &key);\n"
37471 #: ../src/guestfs.pod:2131
37473 "More commonly you are only interested in keys that begin with an application-"
37474 "specific prefix C<foo_>. Modify the loop like so:"
37478 #: ../src/guestfs.pod:2134
37481 " const char *key;\n"
37482 " void *data = guestfs_first_private (g, &key);\n"
37483 " while (data != NULL)\n"
37485 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37486 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37487 " data = guestfs_next_private (g, &key);\n"
37493 #: ../src/guestfs.pod:2143
37495 "If you need to modify keys while walking, then you have to jump back to the "
37496 "beginning of the loop. For example, to delete all keys prefixed with "
37501 #: ../src/guestfs.pod:2147
37504 " const char *key;\n"
37507 " data = guestfs_first_private (g, &key);\n"
37508 " while (data != NULL)\n"
37510 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37512 " guestfs_set_private (g, key, NULL);\n"
37513 " /* note that 'key' pointer is now invalid, and so is\n"
37514 " the internal iterator */\n"
37517 " data = guestfs_next_private (g, &key);\n"
37523 #: ../src/guestfs.pod:2163
37525 "Note that the above loop is guaranteed to terminate because the keys are "
37526 "being deleted, but other manipulations of keys within the loop might not "
37527 "terminate unless you also maintain an indication of which keys have been "
37532 #: ../src/guestfs.pod:2168
37537 #: ../src/guestfs.pod:2170
37539 "The libguestfs C library can be probed using systemtap or DTrace. This is "
37540 "true of any library, not just libguestfs. However libguestfs also contains "
37541 "static markers to help in probing internal operations."
37545 #: ../src/guestfs.pod:2174
37546 msgid "You can list all the static markers by doing:"
37550 #: ../src/guestfs.pod:2176
37553 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
37554 " .provider(\"guestfs\").mark(\"*\")'\n"
37559 #: ../src/guestfs.pod:2179
37561 "B<Note:> These static markers are I<not> part of the stable API and may "
37562 "change in future versions."
37566 #: ../src/guestfs.pod:2182
37567 msgid "SYSTEMTAP SCRIPT EXAMPLE"
37571 #: ../src/guestfs.pod:2184
37573 "This script contains examples of displaying both the static markers and some "
37574 "ordinary C entry points:"
37578 #: ../src/guestfs.pod:2187
37586 #: ../src/guestfs.pod:2189
37589 " function display_time () {\n"
37590 " now = gettimeofday_us ();\n"
37593 " delta = now - last;\n"
37599 #: ../src/guestfs.pod:2196
37602 " printf (\"%d (+%d):\", now, delta);\n"
37608 #: ../src/guestfs.pod:2199
37613 " printf (\"ready\\n\");\n"
37619 #: ../src/guestfs.pod:2204
37622 " /* Display all calls to static markers. */\n"
37623 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37624 " .provider(\"guestfs\").mark(\"*\") ? {\n"
37625 " display_time();\n"
37626 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
37632 #: ../src/guestfs.pod:2211
37635 " /* Display all calls to guestfs_mkfs* functions. */\n"
37636 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37637 " .function(\"guestfs_mkfs*\") ? {\n"
37638 " display_time();\n"
37639 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
37645 #: ../src/guestfs.pod:2218
37647 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
37648 "program. Note that you either have to be root, or you have to add yourself "
37649 "to several special stap groups. Consult the systemtap documentation for "
37650 "more information."
37654 #: ../src/guestfs.pod:2223
37657 " # stap /tmp/test.stap\n"
37663 #: ../src/guestfs.pod:2226
37664 msgid "In another terminal, run a guestfish command such as this:"
37668 #: ../src/guestfs.pod:2230
37669 msgid "In the first terminal, stap trace output similar to this is shown:"
37673 #: ../src/guestfs.pod:2232
37676 " 1318248056692655 (+0):\tlaunch_start\n"
37677 " 1318248056692850 (+195): launch_build_appliance_start\n"
37678 " 1318248056818285 (+125435): launch_build_appliance_end\n"
37679 " 1318248056838059 (+19774): launch_run_qemu\n"
37680 " 1318248061071167 (+4233108): launch_end\n"
37681 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f device=0x1024e60\n"
37686 #: ../src/guestfs.pod:2239 ../src/guestfs.pod:2244
37691 #: ../src/guestfs.pod:2241
37693 "<!-- old anchor for the next section --> <a name="
37694 "\"state_machine_and_low_level_event_api\"/>"
37698 #: ../src/guestfs.pod:2246
37699 msgid "ARCHITECTURE"
37703 #: ../src/guestfs.pod:2248
37705 "Internally, libguestfs is implemented by running an appliance (a special "
37706 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
37707 "process of the main program."
37711 #: ../src/guestfs.pod:2252
37714 " ___________________\n"
37716 " | main program |\n"
37718 " | | child process / appliance\n"
37719 " | | __________________________\n"
37721 " +-------------------+ RPC | +-----------------+ |\n"
37722 " | libguestfs <--------------------> guestfsd | |\n"
37723 " | | | +-----------------+ |\n"
37724 " \\___________________/ | | Linux kernel | |\n"
37725 " | +--^--------------+ |\n"
37726 " \\_________|________________/\n"
37728 " _______v______\n"
37731 " | disk image |\n"
37732 " \\______________/\n"
37737 #: ../src/guestfs.pod:2272
37739 "The library, linked to the main program, creates the child process and hence "
37740 "the appliance in the L</guestfs_launch> function."
37744 #: ../src/guestfs.pod:2275
37746 "Inside the appliance is a Linux kernel and a complete stack of userspace "
37747 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
37748 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
37749 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
37750 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
37751 "attached to the qemu process which translates device access by the "
37752 "appliance's Linux kernel into accesses to the image."
37756 #: ../src/guestfs.pod:2284
37758 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
37759 "Although the disk image you are attached to might also be used by some "
37760 "virtual machine, libguestfs doesn't know or care about this. (But you will "
37761 "care if both libguestfs's qemu process and your virtual machine are trying "
37762 "to update the disk image at the same time, since these usually results in "
37763 "massive disk corruption)."
37767 #: ../src/guestfs.pod:2291
37768 msgid "STATE MACHINE"
37772 #: ../src/guestfs.pod:2293
37773 msgid "libguestfs uses a state machine to model the child process:"
37777 #: ../src/guestfs.pod:2295
37781 " guestfs_create\n"
37789 " / | \\ \\ guestfs_launch\n"
37790 " / | _\\__V______\n"
37792 " / | | LAUNCHING |\n"
37793 " / | \\___________/\n"
37795 " / | guestfs_launch\n"
37797 " ______ / __|____V\n"
37798 " / \\ ------> / \\\n"
37799 " | BUSY | | READY |\n"
37800 " \\______/ <------ \\________/\n"
37805 #: ../src/guestfs.pod:2317
37807 "The normal transitions are (1) CONFIG (when the handle is created, but there "
37808 "is no child process), (2) LAUNCHING (when the child process is booting up), "
37809 "(3) alternating between READY and BUSY as commands are issued to, and "
37810 "carried out by, the child process."
37814 #: ../src/guestfs.pod:2322
37816 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
37817 "asynchronously at any time (eg. due to some internal error), and that causes "
37818 "the state to transition back to CONFIG."
37822 #: ../src/guestfs.pod:2326
37824 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
37825 "issued when in the CONFIG state."
37829 #: ../src/guestfs.pod:2329
37831 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
37832 "L</guestfs_launch> blocks until the child process is READY to accept "
37833 "commands (or until some failure or timeout). L</guestfs_launch> internally "
37834 "moves the state from CONFIG to LAUNCHING while it is running."
37838 #: ../src/guestfs.pod:2335
37840 "API actions such as L</guestfs_mount> can only be issued when in the READY "
37841 "state. These API calls block waiting for the command to be carried out (ie. "
37842 "the state to transition to BUSY and then back to READY). There are no non-"
37843 "blocking versions, and no way to issue more than one command per handle at "
37848 #: ../src/guestfs.pod:2341
37850 "Finally, the child process sends asynchronous messages back to the main "
37851 "program, such as kernel log messages. You can register a callback to "
37852 "receive these messages."
37856 #: ../src/guestfs.pod:2345
37861 #: ../src/guestfs.pod:2347
37862 msgid "APPLIANCE BOOT PROCESS"
37866 #: ../src/guestfs.pod:2349
37868 "This process has evolved and continues to evolve. The description here "
37869 "corresponds only to the current version of libguestfs and is provided for "
37870 "information only."
37874 #: ../src/guestfs.pod:2353
37876 "In order to follow the stages involved below, enable libguestfs debugging "
37877 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
37881 #: ../src/guestfs.pod:2358
37882 msgid "Create the appliance"
37886 #: ../src/guestfs.pod:2360
37888 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
37889 "initrd and the appliance."
37893 #: ../src/guestfs.pod:2363
37895 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
37896 "directory if C<TMPDIR> is set)."
37900 #: ../src/guestfs.pod:2366
37902 "For a complete description of how the appliance is created and cached, read "
37903 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
37907 #: ../src/guestfs.pod:2370
37908 msgid "Start qemu and boot the kernel"
37912 #: ../src/guestfs.pod:2372
37913 msgid "qemu is invoked to boot the kernel."
37917 #: ../src/guestfs.pod:2374
37918 msgid "Run the initrd"
37922 #: ../src/guestfs.pod:2376
37924 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
37925 "appliance. The purpose of the initrd is to load enough kernel modules in "
37926 "order that the appliance itself can be mounted and started."
37930 #: ../src/guestfs.pod:2380
37932 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
37937 #: ../src/guestfs.pod:2383
37939 "When the initrd has started you will see messages showing that kernel "
37940 "modules are being loaded, similar to this:"
37944 #: ../src/guestfs.pod:2386
37947 " febootstrap: ext2 mini initrd starting up\n"
37948 " febootstrap: mounting /sys\n"
37949 " febootstrap: internal insmod libcrc32c.ko\n"
37950 " febootstrap: internal insmod crc32c-intel.ko\n"
37955 #: ../src/guestfs.pod:2391
37956 msgid "Find and mount the appliance device"
37960 #: ../src/guestfs.pod:2393
37962 "The appliance is a sparse file containing an ext2 filesystem which contains "
37963 "a familiar (although reduced in size) Linux operating system. It would "
37964 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
37968 #: ../src/guestfs.pod:2397
37970 "The regular disks being inspected by libguestfs are the first devices "
37971 "exposed by qemu (eg. as C</dev/vda>)."
37975 #: ../src/guestfs.pod:2400
37977 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
37978 "there was only one regular disk)."
37982 #: ../src/guestfs.pod:2403
37984 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
37985 "and switch root into the appliance, and run C</init> from the appliance."
37989 #: ../src/guestfs.pod:2407
37990 msgid "If this works successfully you will see messages such as:"
37994 #: ../src/guestfs.pod:2409
37997 " febootstrap: picked /sys/block/vdb/dev as root device\n"
37998 " febootstrap: creating /dev/root as block special 252:16\n"
37999 " febootstrap: mounting new root on /root\n"
38000 " febootstrap: chroot\n"
38001 " Starting /init script ...\n"
38006 #: ../src/guestfs.pod:2415
38008 "Note that C<Starting /init script ...> indicates that the appliance's init "
38009 "script is now running."
38013 #: ../src/guestfs.pod:2418
38014 msgid "Initialize the appliance"
38018 #: ../src/guestfs.pod:2420
38020 "The appliance itself now initializes itself. This involves starting certain "
38021 "processes like C<udev>, possibly printing some debug information, and "
38022 "finally running the daemon (C<guestfsd>)."
38026 #: ../src/guestfs.pod:2424
38031 #: ../src/guestfs.pod:2426
38033 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
38038 #: ../src/guestfs.pod:2429
38041 " verbose daemon enabled\n"
38046 #: ../src/guestfs.pod:2431
38048 "The daemon expects to see a named virtio-serial port exposed by qemu and "
38049 "connected on the other end to the library."
38053 #: ../src/guestfs.pod:2434
38055 "The daemon connects to this port (and hence to the library) and sends a four "
38056 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
38057 "protocol (see below)."
38061 #: ../src/guestfs.pod:2440
38062 msgid "COMMUNICATION PROTOCOL"
38066 #: ../src/guestfs.pod:2442
38068 "Don't rely on using this protocol directly. This section documents how it "
38069 "currently works, but it may change at any time."
38073 #: ../src/guestfs.pod:2445
38075 "The protocol used to talk between the library and the daemon running inside "
38076 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
38077 "1014, RFC 1832, RFC 4506)."
38081 #: ../src/guestfs.pod:2449
38083 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
38084 "this file is automatically generated)."
38088 #: ../src/guestfs.pod:2452
38090 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
38091 "and C<FileOut> parameters, which are handled with very simple request/reply "
38092 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
38093 "parameters, which use the same request and reply messages, but they may also "
38094 "be followed by files sent using a chunked encoding."
38098 #: ../src/guestfs.pod:2459
38099 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
38103 #: ../src/guestfs.pod:2461
38104 msgid "For ordinary functions, the request message is:"
38108 #: ../src/guestfs.pod:2463
38111 " total length (header + arguments,\n"
38112 " but not including the length word itself)\n"
38113 " struct guestfs_message_header (encoded as XDR)\n"
38114 " struct guestfs_<foo>_args (encoded as XDR)\n"
38119 #: ../src/guestfs.pod:2468
38121 "The total length field allows the daemon to allocate a fixed size buffer "
38122 "into which it slurps the rest of the message. As a result, the total length "
38123 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
38124 "effective size of any request is limited to somewhere under this size."
38128 #: ../src/guestfs.pod:2474
38130 "Note also that many functions don't take any arguments, in which case the "
38131 "C<guestfs_I<foo>_args> is completely omitted."
38135 #: ../src/guestfs.pod:2477
38137 "The header contains the procedure number (C<guestfs_proc>) which is how the "
38138 "receiver knows what type of args structure to expect, or none at all."
38142 #: ../src/guestfs.pod:2481
38144 "For functions that take optional arguments, the optional arguments are "
38145 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
38146 "arguments. A bitmask in the header indicates which optional arguments are "
38147 "meaningful. The bitmask is also checked to see if it contains bits set "
38148 "which the daemon does not know about (eg. if more optional arguments were "
38149 "added in a later version of the library), and this causes the call to be "
38154 #: ../src/guestfs.pod:2489
38155 msgid "The reply message for ordinary functions is:"
38159 #: ../src/guestfs.pod:2491
38162 " total length (header + ret,\n"
38163 " but not including the length word itself)\n"
38164 " struct guestfs_message_header (encoded as XDR)\n"
38165 " struct guestfs_<foo>_ret (encoded as XDR)\n"
38170 #: ../src/guestfs.pod:2496
38172 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
38173 "functions that return no formal return values."
38177 #: ../src/guestfs.pod:2499
38179 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
38183 #: ../src/guestfs.pod:2502
38185 "In the case of an error, a flag is set in the header, and the reply message "
38186 "is slightly changed:"
38190 #: ../src/guestfs.pod:2505
38193 " total length (header + error,\n"
38194 " but not including the length word itself)\n"
38195 " struct guestfs_message_header (encoded as XDR)\n"
38196 " struct guestfs_message_error (encoded as XDR)\n"
38201 #: ../src/guestfs.pod:2510
38203 "The C<guestfs_message_error> structure contains the error message as a "
38208 #: ../src/guestfs.pod:2513
38209 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
38213 #: ../src/guestfs.pod:2515
38215 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
38216 "The normal request message is sent (see above). However this is followed by "
38217 "a sequence of file chunks."
38221 #: ../src/guestfs.pod:2519
38224 " total length (header + arguments,\n"
38225 " but not including the length word itself,\n"
38226 " and not including the chunks)\n"
38227 " struct guestfs_message_header (encoded as XDR)\n"
38228 " struct guestfs_<foo>_args (encoded as XDR)\n"
38229 " sequence of chunks for FileIn param #0\n"
38230 " sequence of chunks for FileIn param #1 etc.\n"
38235 #: ../src/guestfs.pod:2527
38236 msgid "The \"sequence of chunks\" is:"
38240 #: ../src/guestfs.pod:2529
38243 " length of chunk (not including length word itself)\n"
38244 " struct guestfs_chunk (encoded as XDR)\n"
38245 " length of chunk\n"
38246 " struct guestfs_chunk (encoded as XDR)\n"
38248 " length of chunk\n"
38249 " struct guestfs_chunk (with data.data_len == 0)\n"
38254 #: ../src/guestfs.pod:2537
38256 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
38257 "is set in the final chunk to indicate either successful completion or early "
38262 #: ../src/guestfs.pod:2541
38264 "At time of writing there are no functions that have more than one FileIn "
38265 "parameter. However this is (theoretically) supported, by sending the "
38266 "sequence of chunks for each FileIn parameter one after another (from left to "
38271 #: ../src/guestfs.pod:2546
38273 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
38274 "transfer. The library does this by sending a chunk with a special flag set "
38275 "to indicate cancellation. When the daemon sees this, it cancels the whole "
38276 "RPC, does I<not> send any reply, and goes back to reading the next request."
38280 #: ../src/guestfs.pod:2552
38282 "The daemon may also cancel. It does this by writing a special word "
38283 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
38284 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
38285 "cancel chunk). The special word is chosen so that even if cancellation "
38286 "happens right at the end of the transfer (after the library has finished "
38287 "writing and has started listening for the reply), the \"spurious\" cancel "
38288 "flag will not be confused with the reply message."
38292 #: ../src/guestfs.pod:2561
38294 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
38295 "limit), and also files where the size is not known in advance (eg. from "
38296 "pipes or sockets). However the chunks are rather small "
38297 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
38298 "to keep much in memory."
38302 #: ../src/guestfs.pod:2567
38303 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
38307 #: ../src/guestfs.pod:2569
38309 "The protocol for FileOut parameters is exactly the same as for FileIn "
38310 "parameters, but with the roles of daemon and library reversed."
38314 #: ../src/guestfs.pod:2572
38317 " total length (header + ret,\n"
38318 " but not including the length word itself,\n"
38319 " and not including the chunks)\n"
38320 " struct guestfs_message_header (encoded as XDR)\n"
38321 " struct guestfs_<foo>_ret (encoded as XDR)\n"
38322 " sequence of chunks for FileOut param #0\n"
38323 " sequence of chunks for FileOut param #1 etc.\n"
38328 #: ../src/guestfs.pod:2580
38329 msgid "INITIAL MESSAGE"
38333 #: ../src/guestfs.pod:2582
38335 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
38336 "which indicates that the guest and daemon is alive. This is what L</"
38337 "guestfs_launch> waits for."
38341 #: ../src/guestfs.pod:2586
38342 msgid "PROGRESS NOTIFICATION MESSAGES"
38346 #: ../src/guestfs.pod:2588
38348 "The daemon may send progress notification messages at any time. These are "
38349 "distinguished by the normal length word being replaced by "
38350 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
38354 #: ../src/guestfs.pod:2592
38356 "The library turns them into progress callbacks (see L</"
38357 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
38362 #: ../src/guestfs.pod:2596
38364 "The daemon self-limits the frequency of progress messages it sends (see "
38365 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
38370 #: ../src/guestfs.pod:2600
38371 msgid "LIBGUESTFS VERSION NUMBERS"
38375 #: ../src/guestfs.pod:2602
38377 "Since April 2010, libguestfs has started to make separate development and "
38378 "stable releases, along with corresponding branches in our git repository. "
38379 "These separate releases can be identified by version number:"
38383 #: ../src/guestfs.pod:2607
38386 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
38387 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
38393 " | `-------- sub-version\n"
38395 " `------ always '1' because we don't change the ABI\n"
38400 #: ../src/guestfs.pod:2618
38401 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
38405 #: ../src/guestfs.pod:2620
38407 "As time passes we cherry pick fixes from the development branch and backport "
38408 "those into the stable branch, the effect being that the stable branch should "
38409 "get more stable and less buggy over time. So the stable releases are ideal "
38410 "for people who don't need new features but would just like the software to "
38415 #: ../src/guestfs.pod:2626
38416 msgid "Our criteria for backporting changes are:"
38420 #: ../src/guestfs.pod:2632
38422 "Documentation changes which don't affect any code are backported unless the "
38423 "documentation refers to a future feature which is not in stable."
38427 #: ../src/guestfs.pod:2638
38429 "Bug fixes which are not controversial, fix obvious problems, and have been "
38430 "well tested are backported."
38434 #: ../src/guestfs.pod:2643
38436 "Simple rearrangements of code which shouldn't affect how it works get "
38437 "backported. This is so that the code in the two branches doesn't get too "
38438 "far out of step, allowing us to backport future fixes more easily."
38442 #: ../src/guestfs.pod:2649
38444 "We I<don't> backport new features, new APIs, new tools etc, except in one "
38445 "exceptional case: the new feature is required in order to implement an "
38446 "important bug fix."
38450 #: ../src/guestfs.pod:2655
38452 "A new stable branch starts when we think the new features in development are "
38453 "substantial and compelling enough over the current stable branch to warrant "
38454 "it. When that happens we create new stable and development versions 1.N.0 "
38455 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
38456 "stable at this point, but by backporting fixes from development, that branch "
38457 "will stabilize over time."
38461 #: ../src/guestfs.pod:2663
38462 msgid "EXTENDING LIBGUESTFS"
38466 #: ../src/guestfs.pod:2665
38467 msgid "ADDING A NEW API ACTION"
38471 #: ../src/guestfs.pod:2667
38473 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
38474 "documentation) are generated, and this makes it easy to extend the "
38479 #: ../src/guestfs.pod:2671
38480 msgid "To add a new API action there are two changes:"
38484 #: ../src/guestfs.pod:2677
38486 "You need to add a description of the call (name, parameters, return type, "
38487 "tests, documentation) to C<generator/generator_actions.ml>."
38491 #: ../src/guestfs.pod:2680
38493 "There are two sorts of API action, depending on whether the call goes "
38494 "through to the daemon in the appliance, or is serviced entirely by the "
38495 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
38496 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
38497 "an example of the latter, since a trace flag is maintained in the handle and "
38498 "all tracing is done on the library side."
38502 #: ../src/guestfs.pod:2688
38504 "Most new actions are of the first type, and get added to the "
38505 "C<daemon_functions> list. Each function has a unique procedure number used "
38506 "in the RPC protocol which is assigned to that action when we publish "
38507 "libguestfs and cannot be reused. Take the latest procedure number and "
38512 #: ../src/guestfs.pod:2694
38514 "For library-only actions of the second type, add to the "
38515 "C<non_daemon_functions> list. Since these functions are serviced by the "
38516 "library and do not travel over the RPC mechanism to the daemon, these "
38517 "functions do not need a procedure number, and so the procedure number is set "
38522 #: ../src/guestfs.pod:2702
38523 msgid "Implement the action (in C):"
38527 #: ../src/guestfs.pod:2704
38529 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
38530 "C<daemon/> directory."
38534 #: ../src/guestfs.pod:2707
38536 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
38537 "(note: double underscore) in the C<src/> directory."
38541 #: ../src/guestfs.pod:2710
38542 msgid "In either case, use another function as an example of what to do."
38546 #: ../src/guestfs.pod:2714
38547 msgid "After making these changes, use C<make> to compile."
38551 #: ../src/guestfs.pod:2716
38553 "Note that you don't need to implement the RPC, language bindings, manual "
38554 "pages or anything else. It's all automatically generated from the OCaml "
38559 #: ../src/guestfs.pod:2720
38560 msgid "ADDING TESTS FOR AN API ACTION"
38564 #: ../src/guestfs.pod:2722
38566 "You can supply zero or as many tests as you want per API call. The tests "
38567 "can either be added as part of the API description (C<generator/"
38568 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
38569 "into C<regressions/>. Note that adding a script to C<regressions/> is "
38570 "slower, so if possible use the first method."
38574 #: ../src/guestfs.pod:2728
38576 "The following describes the test environment used when you add an API test "
38577 "in C<generator_actions.ml>."
38581 #: ../src/guestfs.pod:2731
38582 msgid "The test environment has 4 block devices:"
38586 #: ../src/guestfs.pod:2735
38587 msgid "C</dev/sda> 500MB"
38591 #: ../src/guestfs.pod:2737
38592 msgid "General block device for testing."
38596 #: ../src/guestfs.pod:2739
38597 msgid "C</dev/sdb> 50MB"
38601 #: ../src/guestfs.pod:2741
38603 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
38608 #: ../src/guestfs.pod:2744
38609 msgid "C</dev/sdc> 10MB"
38613 #: ../src/guestfs.pod:2746
38614 msgid "Used in a few tests where two block devices are needed."
38618 #: ../src/guestfs.pod:2748
38619 msgid "C</dev/sdd>"
38623 #: ../src/guestfs.pod:2750
38624 msgid "ISO with fixed content (see C<images/test.iso>)."
38628 #: ../src/guestfs.pod:2754
38630 "To be able to run the tests in a reasonable amount of time, the libguestfs "
38631 "appliance and block devices are reused between tests. So don't try testing "
38632 "L</guestfs_kill_subprocess> :-x"
38636 #: ../src/guestfs.pod:2758
38638 "Each test starts with an initial scenario, selected using one of the "
38639 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
38640 "initialize the disks mentioned above in a particular way as documented in "
38641 "C<generator_types.ml>. You should not assume anything about the previous "
38642 "contents of other disks that are not initialized."
38646 #: ../src/guestfs.pod:2764
38648 "You can add a prerequisite clause to any individual test. This is a run-"
38649 "time check, which, if it fails, causes the test to be skipped. Useful if "
38650 "testing a command which might not work on all variations of libguestfs "
38651 "builds. A test that has prerequisite of C<Always> means to run "
38656 #: ../src/guestfs.pod:2770
38658 "In addition, packagers can skip individual tests by setting environment "
38659 "variables before running C<make check>."
38663 #: ../src/guestfs.pod:2773
38666 " SKIP_TEST_<CMD>_<NUM>=1\n"
38671 #: ../src/guestfs.pod:2775
38672 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
38676 #: ../src/guestfs.pod:2777
38681 #: ../src/guestfs.pod:2779
38684 " SKIP_TEST_<CMD>=1\n"
38689 #: ../src/guestfs.pod:2781
38690 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
38694 #: ../src/guestfs.pod:2783
38695 msgid "Packagers can run only certain tests by setting for example:"
38699 #: ../src/guestfs.pod:2785
38702 " TEST_ONLY=\"vfs_type zerofree\"\n"
38707 #: ../src/guestfs.pod:2787
38709 "See C<capitests/tests.c> for more details of how these environment variables "
38714 #: ../src/guestfs.pod:2790
38715 msgid "DEBUGGING NEW API ACTIONS"
38719 #: ../src/guestfs.pod:2792
38720 msgid "Test new actions work before submitting them."
38724 #: ../src/guestfs.pod:2794
38725 msgid "You can use guestfish to try out new commands."
38729 #: ../src/guestfs.pod:2796
38731 "Debugging the daemon is a problem because it runs inside a minimal "
38732 "environment. However you can fprintf messages in the daemon to stderr, and "
38733 "they will show up if you use C<guestfish -v>."
38737 #: ../src/guestfs.pod:2800
38738 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
38742 #: ../src/guestfs.pod:2802
38744 "Our C source code generally adheres to some basic code-formatting "
38745 "conventions. The existing code base is not totally consistent on this "
38746 "front, but we do prefer that contributed code be formatted similarly. In "
38747 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
38748 "indentation level, and other than that, follow the K&R style."
38752 #: ../src/guestfs.pod:2808
38754 "If you use Emacs, add the following to one of one of your start-up files (e."
38755 "g., ~/.emacs), to help ensure that you get indentation right:"
38759 #: ../src/guestfs.pod:2811
38762 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
38763 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
38764 " (add-hook 'find-file-hook\n"
38765 " '(lambda () (if (and buffer-file-name\n"
38766 " (string-match \"/libguestfs\\\\>\"\n"
38767 " (buffer-file-name))\n"
38768 " (not (string-equal mode-name \"Change Log\"))\n"
38769 " (not (string-equal mode-name \"Makefile\")))\n"
38770 " (setq indent-tabs-mode nil))))\n"
38775 #: ../src/guestfs.pod:2821
38778 " ;;; When editing C sources in libguestfs, use this style.\n"
38779 " (defun libguestfs-c-mode ()\n"
38780 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
38782 " (c-set-style \"K&R\")\n"
38783 " (setq c-indent-level 2)\n"
38784 " (setq c-basic-offset 2))\n"
38785 " (add-hook 'c-mode-hook\n"
38786 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
38787 " (buffer-file-name))\n"
38788 " (libguestfs-c-mode))))\n"
38793 #: ../src/guestfs.pod:2833
38794 msgid "Enable warnings when compiling (and fix any problems this finds):"
38798 #: ../src/guestfs.pod:2836
38801 " ./configure --enable-gcc-warnings\n"
38806 #: ../src/guestfs.pod:2838
38807 msgid "Useful targets are:"
38811 #: ../src/guestfs.pod:2840
38814 " make syntax-check # checks the syntax of the C code\n"
38815 " make check # runs the test suite\n"
38820 #: ../src/guestfs.pod:2843
38821 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
38825 #: ../src/guestfs.pod:2845
38827 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
38828 "which are used to do shell quoting."
38832 #: ../src/guestfs.pod:2850
38837 #: ../src/guestfs.pod:2852
38839 "Simple shell quoted string. Any spaces or other shell characters are "
38844 #: ../src/guestfs.pod:2855
38849 #: ../src/guestfs.pod:2857
38851 "Same as C<%Q> except the string is treated as a path which is prefixed by "
38856 #: ../src/guestfs.pod:2864
38859 " asprintf (&cmd, \"cat %R\", path);\n"
38864 #: ../src/guestfs.pod:2866
38865 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
38869 #: ../src/guestfs.pod:2868
38871 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
38872 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
38873 "they are not passed via the shell (instead, straight to exec). You probably "
38874 "want to use the C<sysroot_path()> function however."
38878 #: ../src/guestfs.pod:2874
38879 msgid "SUBMITTING YOUR NEW API ACTIONS"
38883 #: ../src/guestfs.pod:2876
38885 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
38886 "libguestfs> and CC to L<rjones@redhat.com>."
38890 #: ../src/guestfs.pod:2880
38891 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
38895 #: ../src/guestfs.pod:2882
38896 msgid "We support i18n (gettext anyhow) in the library."
38900 #: ../src/guestfs.pod:2884
38902 "However many messages come from the daemon, and we don't translate those at "
38903 "the moment. One reason is that the appliance generally has all locale files "
38904 "removed from it, because they take up a lot of space. So we'd have to readd "
38905 "some of those, as well as copying our PO files into the appliance."
38909 #: ../src/guestfs.pod:2890
38911 "Debugging messages are never translated, since they are intended for the "
38916 #: ../src/guestfs.pod:2893
38917 msgid "SOURCE CODE SUBDIRECTORIES"
38921 #: ../src/guestfs.pod:2897
38926 #: ../src/guestfs.pod:2899
38927 msgid "L<virt-alignment-scan(1)> command and documentation."
38931 #: ../src/guestfs.pod:2903
38932 msgid "The libguestfs appliance, build scripts and so on."
38936 #: ../src/guestfs.pod:2905
38937 msgid "C<capitests>"
38941 #: ../src/guestfs.pod:2907
38942 msgid "Automated tests of the C API."
38946 #: ../src/guestfs.pod:2909
38951 #: ../src/guestfs.pod:2911
38953 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
38958 #: ../src/guestfs.pod:2914
38963 #: ../src/guestfs.pod:2916
38965 "Safety and liveness tests of components that libguestfs depends upon (not of "
38966 "libguestfs itself). Mainly this is for qemu and the kernel."
38970 #: ../src/guestfs.pod:2919
38975 #: ../src/guestfs.pod:2921
38977 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
38978 "command and documentation."
38982 #: ../src/guestfs.pod:2924
38987 #: ../src/guestfs.pod:2926
38988 msgid "Outside contributions, experimental parts."
38992 #: ../src/guestfs.pod:2928
38997 #: ../src/guestfs.pod:2930
38999 "The daemon that runs inside the libguestfs appliance and carries out actions."
39003 #: ../src/guestfs.pod:2933
39008 #: ../src/guestfs.pod:2935
39009 msgid "L<virt-df(1)> command and documentation."
39013 #: ../src/guestfs.pod:2937
39018 #: ../src/guestfs.pod:2939
39019 msgid "L<virt-edit(1)> command and documentation."
39023 #: ../src/guestfs.pod:2941
39024 msgid "C<examples>"
39028 #: ../src/guestfs.pod:2943
39029 msgid "C API example code."
39033 #: ../src/guestfs.pod:2945
39038 #: ../src/guestfs.pod:2947
39040 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
39041 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
39042 "L<virt-tar-out(1)>."
39046 #: ../src/guestfs.pod:2951
39051 #: ../src/guestfs.pod:2953
39053 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
39057 #: ../src/guestfs.pod:2955
39058 msgid "C<generator>"
39062 #: ../src/guestfs.pod:2957
39064 "The crucially important generator, used to automatically generate large "
39065 "amounts of boilerplate C code for things like RPC and bindings."
39069 #: ../src/guestfs.pod:2960
39074 #: ../src/guestfs.pod:2962
39075 msgid "Files used by the test suite."
39079 #: ../src/guestfs.pod:2964
39080 msgid "Some \"phony\" guest images which we test against."
39084 #: ../src/guestfs.pod:2966
39085 msgid "C<inspector>"
39089 #: ../src/guestfs.pod:2968
39090 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
39094 #: ../src/guestfs.pod:2970
39099 #: ../src/guestfs.pod:2972
39100 msgid "Logo used on the website. The fish is called Arthur by the way."
39104 #: ../src/guestfs.pod:2974
39109 #: ../src/guestfs.pod:2976
39110 msgid "M4 macros used by autoconf."
39114 #: ../src/guestfs.pod:2978
39119 #: ../src/guestfs.pod:2980
39120 msgid "Translations of simple gettext strings."
39124 #: ../src/guestfs.pod:2982
39129 #: ../src/guestfs.pod:2984
39131 "The build infrastructure and PO files for translations of manpages and POD "
39132 "files. Eventually this will be combined with the C<po> directory, but that "
39133 "is rather complicated."
39137 #: ../src/guestfs.pod:2988
39138 msgid "C<regressions>"
39142 #: ../src/guestfs.pod:2990
39143 msgid "Regression tests."
39147 #: ../src/guestfs.pod:2992
39152 #: ../src/guestfs.pod:2994
39153 msgid "L<virt-rescue(1)> command and documentation."
39157 #: ../src/guestfs.pod:2996
39162 #: ../src/guestfs.pod:2998
39163 msgid "L<virt-resize(1)> command and documentation."
39167 #: ../src/guestfs.pod:3000
39168 msgid "C<sparsify>"
39172 #: ../src/guestfs.pod:3002
39173 msgid "L<virt-sparsify(1)> command and documentation."
39177 #: ../src/guestfs.pod:3004
39182 #: ../src/guestfs.pod:3006
39183 msgid "Source code to the C library."
39187 #: ../src/guestfs.pod:3008
39192 #: ../src/guestfs.pod:3010
39194 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
39198 #: ../src/guestfs.pod:3012
39199 msgid "C<test-tool>"
39203 #: ../src/guestfs.pod:3014
39205 "Test tool for end users to test if their qemu/kernel combination will work "
39210 #: ../src/guestfs.pod:3017
39215 #: ../src/guestfs.pod:3019
39220 #: ../src/guestfs.pod:3021
39225 #: ../src/guestfs.pod:3023
39230 #: ../src/guestfs.pod:3025
39235 #: ../src/guestfs.pod:3027
39240 #: ../src/guestfs.pod:3029
39245 #: ../src/guestfs.pod:3031
39250 #: ../src/guestfs.pod:3033
39255 #: ../src/guestfs.pod:3035
39256 msgid "Language bindings."
39260 #: ../src/guestfs.pod:3039
39261 msgid "MAKING A STABLE RELEASE"
39265 #: ../src/guestfs.pod:3041
39267 "When we make a stable release, there are several steps documented here. See "
39268 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
39273 #: ../src/guestfs.pod:3049
39275 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
39279 #: ../src/guestfs.pod:3054
39280 msgid "Finalize RELEASE-NOTES."
39284 #: ../src/guestfs.pod:3058
39285 msgid "Update ROADMAP."
39289 #: ../src/guestfs.pod:3062
39290 msgid "Run C<src/api-support/update-from-tarballs.sh>."
39294 #: ../src/guestfs.pod:3066
39295 msgid "Push and pull from Transifex."
39299 #: ../src/guestfs.pod:3068
39304 #: ../src/guestfs.pod:3070
39312 #: ../src/guestfs.pod:3072
39313 msgid "to push the latest POT files to Transifex. Then run:"
39317 #: ../src/guestfs.pod:3074
39325 #: ../src/guestfs.pod:3076
39326 msgid "which is a wrapper to pull the latest translated C<*.po> files."
39330 #: ../src/guestfs.pod:3080
39332 "Create new stable and development directories under L<http://libguestfs.org/"
39337 #: ../src/guestfs.pod:3085
39338 msgid "Create the branch in git:"
39342 #: ../src/guestfs.pod:3087
39345 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
39346 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
39347 " git branch stable-1.XX\n"
39348 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
39353 #: ../src/guestfs.pod:3094
39358 #: ../src/guestfs.pod:3096
39359 msgid "PROTOCOL LIMITS"
39363 #: ../src/guestfs.pod:3098
39365 "Internally libguestfs uses a message-based protocol to pass API calls and "
39366 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
39367 "plenty more detail about this). The maximum message size used by the "
39368 "protocol is slightly less than 4 MB. For some API calls you may need to be "
39369 "aware of this limit. The API calls which may be affected are individually "
39370 "documented, with a link back to this section of the documentation."
39374 #: ../src/guestfs.pod:3106
39376 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
39377 "a simple string. Because this string is at some point internally encoded as "
39378 "a message, the maximum size that it can return is slightly under 4 MB. If "
39379 "the requested file is larger than this then you will get an error."
39383 #: ../src/guestfs.pod:3112
39385 "In order to transfer large files into and out of the guest filesystem, you "
39386 "need to use particular calls that support this. The sections L</UPLOADING> "
39387 "and L</DOWNLOADING> document how to do this."
39391 #: ../src/guestfs.pod:3116
39393 "You might also consider mounting the disk image using our FUSE filesystem "
39394 "support (L<guestmount(1)>)."
39398 #: ../src/guestfs.pod:3119
39399 msgid "MAXIMUM NUMBER OF DISKS"
39403 #: ../src/guestfs.pod:3121
39404 msgid "When using virtio disks (the default) the current limit is B<25> disks."
39408 #: ../src/guestfs.pod:3124
39410 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
39411 "slots. However febootstrap only understands disks with names C</dev/vda> "
39412 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
39417 #: ../src/guestfs.pod:3129
39419 "We are working to substantially raise this limit in future versions but it "
39420 "requires complex changes to qemu."
39424 #: ../src/guestfs.pod:3132
39426 "In future versions of libguestfs it should also be possible to \"hot plug\" "
39427 "disks (add and remove disks after calling L</guestfs_launch>). This also "
39428 "requires changes to qemu."
39432 #: ../src/guestfs.pod:3136
39433 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
39437 #: ../src/guestfs.pod:3138
39438 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
39442 #: ../src/guestfs.pod:3140
39444 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
39445 "vda>, and C</dev/vda1> through C</dev/vda15>)."
39449 #: ../src/guestfs.pod:3143
39451 "If you attach a disk with more than 15 partitions, the extra partitions are "
39452 "ignored by libguestfs."
39456 #: ../src/guestfs.pod:3146
39457 msgid "MAXIMUM SIZE OF A DISK"
39461 #: ../src/guestfs.pod:3148
39462 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
39466 #: ../src/guestfs.pod:3150
39468 "We have tested block devices up to 1 exabyte (2**60 or "
39469 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
39474 #: ../src/guestfs.pod:3154
39476 "Although libguestfs probably does not impose any limit, the underlying host "
39477 "storage will. If you store disk images on a host ext4 filesystem, then the "
39478 "maximum size will be limited by the maximum ext4 file size (currently 16 "
39479 "TB). If you store disk images as host logical volumes then you are limited "
39480 "by the maximum size of an LV."
39484 #: ../src/guestfs.pod:3160
39486 "For the hugest disk image files, we recommend using XFS on the host for "
39491 #: ../src/guestfs.pod:3163
39492 msgid "MAXIMUM SIZE OF A PARTITION"
39496 #: ../src/guestfs.pod:3165
39498 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
39499 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
39500 "address a partition located beyond 2 TB on the disk."
39504 #: ../src/guestfs.pod:3169
39506 "It is recommended that you use GPT partitions on disks which are larger than "
39507 "this size. GPT uses 64 bit sector numbers and so can address partitions "
39508 "which are theoretically larger than the largest disk we could support."
39512 #: ../src/guestfs.pod:3174
39513 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
39517 #: ../src/guestfs.pod:3176
39519 "This depends on the filesystem type. libguestfs itself does not impose any "
39520 "known limit. Consult Wikipedia or the filesystem documentation to find out "
39521 "what these limits are."
39525 #: ../src/guestfs.pod:3180
39526 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
39530 #: ../src/guestfs.pod:3182
39532 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
39533 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
39534 "uploads and downloads."
39538 #: ../src/guestfs.pod:3186
39539 msgid "INSPECTION LIMITS"
39543 #: ../src/guestfs.pod:3188
39545 "The inspection code has several arbitrary limits on things like the size of "
39546 "Windows Registry hive it will read, and the length of product name. These "
39547 "are intended to stop a malicious guest from consuming arbitrary amounts of "
39548 "memory and disk space on the host, and should not be reached in practice. "
39549 "See the source code for more information."
39553 #: ../src/guestfs.pod:3214
39555 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
39556 "effect as calling C<guestfs_set_verbose (g, 1)>."
39560 #: ../src/guestfs.pod:3226
39562 "Set the path that libguestfs uses to search for a supermin appliance. See "
39563 "the discussion of paths in section L</PATH> above."
39567 #: ../src/guestfs.pod:3235
39568 msgid "See also L</QEMU WRAPPERS> above."
39572 #: ../src/guestfs.pod:3239
39574 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
39575 "effect as calling C<guestfs_set_trace (g, 1)>."
39579 #: ../src/guestfs.pod:3257
39581 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-"
39582 "ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
39583 "L<guestfish(1)>, L<guestmount(1)>, L<virt-alignment-scan(1)>, L<virt-cat(1)"
39584 ">, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
39585 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
39586 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue"
39587 "(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar"
39588 "(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
39589 "L<febootstrap(1)>, L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)"
39590 ">, L<http://libguestfs.org/>."
39594 #: ../src/guestfs.pod:3293
39596 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
39597 "(8)>, L<disktype(1)>."
39601 #: ../src/guestfs.pod:3300 ../tools/virt-make-fs.pl:553
39602 #: ../tools/virt-win-reg.pl:761
39607 #: ../src/guestfs.pod:3302
39608 msgid "To get a list of bugs against libguestfs use this link:"
39612 #: ../src/guestfs.pod:3304
39614 "L<https://bugzilla.redhat.com/buglist.cgi?"
39615 "component=libguestfs&product=Virtualization+Tools>"
39619 #: ../src/guestfs.pod:3306
39620 msgid "To report a new bug against libguestfs use this link:"
39624 #: ../src/guestfs.pod:3308
39626 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
39627 "component=libguestfs&product=Virtualization+Tools>"
39631 #: ../src/guestfs.pod:3310
39632 msgid "When reporting a bug, please check:"
39636 #: ../src/guestfs.pod:3316
39637 msgid "That the bug hasn't been reported already."
39641 #: ../src/guestfs.pod:3320
39642 msgid "That you are testing a recent version."
39646 #: ../src/guestfs.pod:3324
39647 msgid "Describe the bug accurately, and give a way to reproduce it."
39651 #: ../src/guestfs.pod:3328
39653 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
39658 #: ../test-tool/libguestfs-test-tool.pod:5
39659 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
39663 #: ../test-tool/libguestfs-test-tool.pod:9
39666 " libguestfs-test-tool [--options]\n"
39671 #: ../test-tool/libguestfs-test-tool.pod:13
39673 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
39674 "to check basic libguestfs functionality is working. This is needed because "
39675 "libguestfs occasionally breaks for reasons beyond our control: usually "
39676 "because of changes in the underlying qemu or kernel packages, or the host "
39681 #: ../test-tool/libguestfs-test-tool.pod:19
39682 msgid "If you suspect a problem in libguestfs, then just run:"
39686 #: ../test-tool/libguestfs-test-tool.pod:21
39689 " libguestfs-test-tool\n"
39694 #: ../test-tool/libguestfs-test-tool.pod:23
39695 msgid "It will print lots of diagnostic messages."
39699 #: ../test-tool/libguestfs-test-tool.pod:25
39700 msgid "If it runs to completion successfully, you will see this near the end:"
39704 #: ../test-tool/libguestfs-test-tool.pod:27
39707 " ===== TEST FINISHED OK =====\n"
39712 #: ../test-tool/libguestfs-test-tool.pod:29
39713 msgid "and the test tool will exit with code 0."
39717 #: ../test-tool/libguestfs-test-tool.pod:31
39719 "If it fails (and/or exits with non-zero error code), please paste the "
39720 "I<complete, unedited> output of the test tool into a bug report. More "
39721 "information about reporting bugs can be found on the L<http://libguestfs.org/"
39726 #: ../test-tool/libguestfs-test-tool.pod:42
39727 msgid "Display short usage information and exit."
39731 #: ../test-tool/libguestfs-test-tool.pod:44
39732 msgid "B<--qemu qemu_binary>"
39736 #: ../test-tool/libguestfs-test-tool.pod:46
39738 "If you have downloaded another qemu binary, point this option at the full "
39739 "path of the binary to try it."
39743 #: ../test-tool/libguestfs-test-tool.pod:49
39744 msgid "B<--qemudir qemu_source_dir>"
39748 #: ../test-tool/libguestfs-test-tool.pod:51
39750 "If you have compiled qemu from source, point this option at the source "
39751 "directory to try it."
39755 #: ../test-tool/libguestfs-test-tool.pod:54
39760 #: ../test-tool/libguestfs-test-tool.pod:56
39761 msgid "B<--timeout N>"
39765 #: ../test-tool/libguestfs-test-tool.pod:58
39767 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
39768 "minutes) which does not usually need to be adjusted."
39772 #: ../test-tool/libguestfs-test-tool.pod:63
39773 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
39777 #: ../test-tool/libguestfs-test-tool.pod:65
39779 "If you have compiled another version of qemu from source and would like to "
39780 "try that, then you can use the I<--qemudir> option to point to the qemu "
39781 "source directory."
39785 #: ../test-tool/libguestfs-test-tool.pod:69
39787 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
39788 "option to point to the binary."
39792 #: ../test-tool/libguestfs-test-tool.pod:72
39794 "Note when using these options, you can ignore the business of qemu wrapper "
39795 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
39796 "wrapper script for you if one is needed."
39800 #: ../test-tool/libguestfs-test-tool.pod:76
39801 msgid "TRYING OUT A DIFFERENT KERNEL"
39805 #: ../test-tool/libguestfs-test-tool.pod:78
39807 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
39808 "libguestfs tries. You do this by setting the environment variables "
39809 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
39813 #: ../test-tool/libguestfs-test-tool.pod:82
39815 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
39820 #: ../test-tool/libguestfs-test-tool.pod:85
39821 msgid "SELF-DIAGNOSIS"
39825 #: ../test-tool/libguestfs-test-tool.pod:87
39827 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
39828 "produced by libguestfs-test-tool and/or possible errors."
39832 #: ../test-tool/libguestfs-test-tool.pod:92
39834 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
39835 "I<1> if there was an error."
39839 #: ../test-tool/libguestfs-test-tool.pod:97
39841 "For the full list of environment variables which may affect libguestfs, "
39842 "please see the L<guestfs(3)> manual page."
39846 #: ../test-tool/libguestfs-test-tool.pod:102
39847 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
39851 #: ../tools/virt-list-filesystems.pl:32
39853 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
39857 #: ../tools/virt-list-filesystems.pl:36
39860 " virt-list-filesystems [--options] domname\n"
39865 #: ../tools/virt-list-filesystems.pl:38
39868 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
39873 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
39875 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
39880 #: ../tools/virt-list-filesystems.pl:45
39882 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
39883 "are contained in a virtual machine or disk image."
39887 #: ../tools/virt-list-filesystems.pl:49
39889 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
39890 "functionality. For more complex cases you should look at the L<guestfish(1)"
39895 #: ../tools/virt-list-filesystems.pl:112
39897 "With this option, C<virt-list-filesystems> displays the type of each "
39898 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
39902 #: ../tools/virt-list-filesystems.pl:119
39907 #: ../tools/virt-list-filesystems.pl:123
39909 "Normally we only show mountable filesystems. If this option is given then "
39910 "swap devices are shown too."
39914 #: ../tools/virt-list-filesystems.pl:197
39916 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
39917 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
39918 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39922 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
39923 msgid "Copyright (C) 2009 Red Hat Inc."
39927 #: ../tools/virt-list-partitions.pl:32
39929 "virt-list-partitions - List partitions in a virtual machine or disk image"
39933 #: ../tools/virt-list-partitions.pl:36
39936 " virt-list-partitions [--options] domname\n"
39941 #: ../tools/virt-list-partitions.pl:38
39944 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
39949 #: ../tools/virt-list-partitions.pl:45
39951 "C<virt-list-partitions> is a command line tool to list the partitions that "
39952 "are contained in a virtual machine or disk image. It is mainly useful as a "
39953 "first step to using L<virt-resize(1)>."
39957 #: ../tools/virt-list-partitions.pl:50
39959 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
39960 "functionality. For more complex cases you should look at the L<guestfish(1)"
39965 #: ../tools/virt-list-partitions.pl:113
39966 msgid "Show sizes in human-readable form (eg. \"1G\")."
39970 #: ../tools/virt-list-partitions.pl:123
39972 "With this option, C<virt-list-partitions> displays the type and size of each "
39973 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
39977 #: ../tools/virt-list-partitions.pl:130
39982 #: ../tools/virt-list-partitions.pl:132
39987 #: ../tools/virt-list-partitions.pl:134
39989 "Display the total size of each block device (as a separate row or rows)."
39993 #: ../tools/virt-list-partitions.pl:267
39995 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
39996 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
39997 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40001 #: ../tools/virt-list-partitions.pl:283
40002 msgid "Copyright (C) 2009-2010 Red Hat Inc."
40006 #: ../tools/virt-make-fs.pl:37
40007 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
40011 #: ../tools/virt-make-fs.pl:41
40014 " virt-make-fs [--options] input.tar output.img\n"
40019 #: ../tools/virt-make-fs.pl:43
40022 " virt-make-fs [--options] input.tar.gz output.img\n"
40027 #: ../tools/virt-make-fs.pl:45
40030 " virt-make-fs [--options] directory output.img\n"
40035 #: ../tools/virt-make-fs.pl:49
40037 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
40038 "archive or some files in a directory. It is similar to tools like L<mkisofs"
40039 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
40040 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
40041 "you want to attach these filesystems to existing virtual machines (eg. to "
40042 "import large amounts of read-only data to a VM)."
40046 #: ../tools/virt-make-fs.pl:57
40047 msgid "Basic usage is:"
40051 #: ../tools/virt-make-fs.pl:59
40054 " virt-make-fs input output\n"
40059 #: ../tools/virt-make-fs.pl:61
40061 "where C<input> is either a directory containing files that you want to add, "
40062 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
40063 "C<output> is a disk image. The input type is detected automatically. The "
40064 "output disk image defaults to a raw ext2 image unless you specify extra "
40065 "flags (see L</OPTIONS> below)."
40069 #: ../tools/virt-make-fs.pl:67
40070 msgid "EXTRA SPACE"
40074 #: ../tools/virt-make-fs.pl:69
40076 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
40077 "the files that it contains, but might have extra space. Depending on how "
40078 "you are going to use the output, you might think this extra space is wasted "
40079 "and want to minimize it, or you might want to leave space so that more files "
40080 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
40081 "but you can use the I<--size> flag to leave space in the filesystem if you "
40086 #: ../tools/virt-make-fs.pl:77
40088 "An alternative way to leave extra space but not make the output image any "
40089 "bigger is to use an alternative disk image format (instead of the default "
40090 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
40091 "image format (check your hypervisor supports this before using it). This "
40092 "allows you to choose a large I<--size> but the extra space won't actually be "
40093 "allocated in the image until you try to store something in it."
40097 #: ../tools/virt-make-fs.pl:85
40099 "Don't forget that you can also use local commands including L<resize2fs(8)> "
40100 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
40101 "to build another image from scratch."
40105 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
40106 #: ../tools/virt-make-fs.pl:142
40111 #: ../tools/virt-make-fs.pl:91
40114 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
40119 #: ../tools/virt-make-fs.pl:93
40120 msgid "FILESYSTEM TYPE"
40124 #: ../tools/virt-make-fs.pl:95
40126 "The default filesystem type is C<ext2>. Just about any filesystem type that "
40127 "libguestfs supports can be used (but I<not> read-only formats like "
40128 "ISO9660). Here are some of the more common choices:"
40132 #: ../tools/virt-make-fs.pl:101
40137 #: ../tools/virt-make-fs.pl:103
40139 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
40140 "you are not going to use the filesystem in a way that requires the journal, "
40141 "then this is just wasted overhead."
40145 #: ../tools/virt-make-fs.pl:107
40146 msgid "I<ntfs> or I<vfat>"
40150 #: ../tools/virt-make-fs.pl:109
40151 msgid "Useful if exporting data to a Windows guest."
40155 #: ../tools/virt-make-fs.pl:111
40157 "I<Note for vfat>: The tar archive or local directory must only contain files "
40158 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
40159 "program running within libguestfs is unable to change the ownership of non-"
40160 "root files, since vfat itself does not support this."
40164 #: ../tools/virt-make-fs.pl:116
40169 #: ../tools/virt-make-fs.pl:118
40171 "Lower overhead than C<ext2>, but certain limitations on filename length and "
40172 "total filesystem size."
40176 #: ../tools/virt-make-fs.pl:125
40179 " virt-make-fs --type=minix input minixfs.img\n"
40184 #: ../tools/virt-make-fs.pl:127
40185 msgid "TO PARTITION OR NOT TO PARTITION"
40189 #: ../tools/virt-make-fs.pl:129
40190 msgid "Optionally virt-make-fs can add a partition table to the output disk."
40194 #: ../tools/virt-make-fs.pl:131
40196 "Adding a partition can make the disk image more compatible with certain "
40197 "virtualized operating systems which don't expect to see a filesystem "
40198 "directly located on a block device (Linux doesn't care and will happily "
40199 "handle both types)."
40203 #: ../tools/virt-make-fs.pl:136
40205 "On the other hand, if you have a partition table then the output image is no "
40206 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
40207 "directly on a partitioned disk image. (However libguestfs tools such as "
40208 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
40212 #: ../tools/virt-make-fs.pl:144
40213 msgid "Add an MBR partition:"
40217 #: ../tools/virt-make-fs.pl:146
40220 " virt-make-fs --partition -- input disk.img\n"
40225 #: ../tools/virt-make-fs.pl:148
40227 "If the output disk image could be terabyte-sized or larger, it's better to "
40228 "use an EFI/GPT-compatible partition table:"
40232 #: ../tools/virt-make-fs.pl:151
40235 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
40240 #: ../tools/virt-make-fs.pl:179
40241 msgid "Enable debugging information."
40245 #: ../tools/virt-make-fs.pl:185
40246 msgid "B<--size=E<lt>NE<gt>>"
40250 #: ../tools/virt-make-fs.pl:187
40251 msgid "B<--size=+E<lt>NE<gt>>"
40255 #: ../tools/virt-make-fs.pl:189
40256 msgid "B<-s E<lt>NE<gt>>"
40260 #: ../tools/virt-make-fs.pl:191
40261 msgid "B<-s +E<lt>NE<gt>>"
40265 #: ../tools/virt-make-fs.pl:193
40267 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
40271 #: ../tools/virt-make-fs.pl:196
40273 "If this option is I<not> given, then the output image will be just large "
40274 "enough to contain all the files, with not much wasted space."
40278 #: ../tools/virt-make-fs.pl:199
40280 "To choose a fixed size output disk, specify an absolute number followed by b/"
40281 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40282 "Petabytes or Exabytes. This must be large enough to contain all the input "
40283 "files, else you will get an error."
40287 #: ../tools/virt-make-fs.pl:204
40289 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
40290 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40291 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
40292 "the input files, and (approximately) an extra 200 MB free space."
40296 #: ../tools/virt-make-fs.pl:210
40298 "Note that virt-make-fs estimates free space, and therefore will not produce "
40299 "filesystems containing precisely the free space requested. (It is much more "
40300 "expensive and time-consuming to produce a filesystem which has precisely the "
40301 "desired free space)."
40305 #: ../tools/virt-make-fs.pl:219
40306 msgid "B<--format=E<lt>fmtE<gt>>"
40310 #: ../tools/virt-make-fs.pl:221
40311 msgid "B<-F E<lt>fmtE<gt>>"
40315 #: ../tools/virt-make-fs.pl:223
40316 msgid "Choose the output disk image format."
40320 #: ../tools/virt-make-fs.pl:225
40321 msgid "The default is C<raw> (raw disk image)."
40325 #: ../tools/virt-make-fs.pl:227
40327 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
40328 "that would really make sense here is C<qcow2>."
40332 #: ../tools/virt-make-fs.pl:234
40333 msgid "B<--type=E<lt>fsE<gt>>"
40337 #: ../tools/virt-make-fs.pl:236
40338 msgid "B<-t E<lt>fsE<gt>>"
40342 #: ../tools/virt-make-fs.pl:238
40343 msgid "Choose the output filesystem type."
40347 #: ../tools/virt-make-fs.pl:240
40348 msgid "The default is C<ext2>."
40352 #: ../tools/virt-make-fs.pl:242
40354 "Any filesystem which is supported read-write by libguestfs can be used here."
40358 #: ../tools/virt-make-fs.pl:249
40359 msgid "B<--partition>"
40363 #: ../tools/virt-make-fs.pl:251
40364 msgid "B<--partition=E<lt>parttypeE<gt>>"
40368 #: ../tools/virt-make-fs.pl:253
40370 "If specified, this flag adds an MBR partition table to the output disk image."
40374 #: ../tools/virt-make-fs.pl:256
40376 "You can change the partition table type, eg. I<--partition=gpt> for large "
40381 #: ../tools/virt-make-fs.pl:259
40383 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
40384 "might consider the next parameter to be the partition type. For example:"
40388 #: ../tools/virt-make-fs.pl:263
40391 " virt-make-fs --partition input.tar ...\n"
40396 #: ../tools/virt-make-fs.pl:265
40398 "would cause virt-make-fs to think you wanted to use a partition type of "
40399 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
40400 "dash) between options and the input file argument:"
40404 #: ../tools/virt-make-fs.pl:269
40407 " virt-make-fs --partition -- input.tar ...\n"
40412 #: ../tools/virt-make-fs.pl:541
40414 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
40415 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
40416 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
40420 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
40422 "When reporting bugs, please enable debugging and capture the I<complete> "
40427 #: ../tools/virt-make-fs.pl:558
40430 " export LIBGUESTFS_DEBUG=1\n"
40431 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
40436 #: ../tools/virt-make-fs.pl:561
40438 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
40443 #: ../tools/virt-tar.pl:33
40444 msgid "virt-tar - Extract or upload files to a virtual machine"
40448 #: ../tools/virt-tar.pl:37
40451 " virt-tar [--options] -x domname directory tarball\n"
40456 #: ../tools/virt-tar.pl:39
40459 " virt-tar [--options] -u domname tarball directory\n"
40464 #: ../tools/virt-tar.pl:41
40467 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
40472 #: ../tools/virt-tar.pl:43
40475 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
40480 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
40485 #: ../tools/virt-tar.pl:47
40487 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
40488 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
40492 #: ../tools/virt-tar.pl:52
40493 msgid "Download C</home> from the VM into a local tarball:"
40497 #: ../tools/virt-tar.pl:54
40500 " virt-tar -x domname /home home.tar\n"
40505 #: ../tools/virt-tar.pl:56
40508 " virt-tar -zx domname /home home.tar.gz\n"
40513 #: ../tools/virt-tar.pl:58
40514 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
40518 #: ../tools/virt-tar.pl:60
40521 " virt-tar -u domname uploadstuff.tar /tmp\n"
40526 #: ../tools/virt-tar.pl:62
40529 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
40534 #: ../tools/virt-tar.pl:66
40536 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
40537 "virtual machines. If you do this, you risk disk corruption in the VM. "
40538 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
40542 #: ../tools/virt-tar.pl:71
40544 "You can use I<-x> (extract) on live virtual machines, but you might get "
40545 "inconsistent results or errors if there is filesystem activity inside the "
40546 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
40547 "work, but the only way to guarantee consistent results is if the virtual "
40548 "machine is shut down."
40552 #: ../tools/virt-tar.pl:79
40554 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
40555 "parts of a guest filesystem. There are many possibilities: making backups, "
40556 "uploading data files, snooping on guest activity, fixing or customizing "
40561 #: ../tools/virt-tar.pl:84
40563 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
40564 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
40565 "should look at the L<guestfish(1)> tool."
40569 #: ../tools/virt-tar.pl:88
40571 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
40572 "its contents (recursively) from the virtual machine into a local tarball. "
40573 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
40574 "virtual machine. You cannot use these two options together."
40578 #: ../tools/virt-tar.pl:94
40580 "In addition, you may need to use the I<-z> (gZip) option to enable "
40581 "compression. When uploading, you have to specify I<-z> if the upload file "
40582 "is compressed because virt-tar won't detect this on its own."
40586 #: ../tools/virt-tar.pl:98
40588 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
40589 "example it cannot do PKZip files or bzip2 compression. If you want that "
40590 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
40591 "the L<libguestfs(3)> API)."
40595 #: ../tools/virt-tar.pl:160
40596 msgid "B<--extract>"
40600 #: ../tools/virt-tar.pl:162
40601 msgid "B<--download>"
40605 #: ../tools/virt-tar.pl:164
40610 #: ../tools/virt-tar.pl:166
40611 msgid "B<--upload>"
40615 #: ../tools/virt-tar.pl:168
40617 "Use I<-x> to extract (download) a directory from a virtual machine to a "
40622 #: ../tools/virt-tar.pl:171
40624 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
40625 "Please read the L</WARNING> section above before using this option."
40629 #: ../tools/virt-tar.pl:175
40630 msgid "You must specify exactly one of these options."
40634 #: ../tools/virt-tar.pl:181
40639 #: ../tools/virt-tar.pl:183
40644 #: ../tools/virt-tar.pl:185
40645 msgid "Specify that the input or output tarball is gzip-compressed."
40649 #: ../tools/virt-tar.pl:298
40651 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
40652 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
40653 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
40658 #: ../tools/virt-win-reg.pl:37
40660 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
40664 #: ../tools/virt-win-reg.pl:41
40667 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
40672 #: ../tools/virt-win-reg.pl:43
40675 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
40680 #: ../tools/virt-win-reg.pl:45
40683 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
40688 #: ../tools/virt-win-reg.pl:47
40691 " virt-win-reg --merge domname [input.reg ...]\n"
40696 #: ../tools/virt-win-reg.pl:49
40699 " virt-win-reg [--options] disk.img ... # instead of domname\n"
40704 #: ../tools/virt-win-reg.pl:53
40706 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
40707 "virtual machines. If you do this, you I<will> get irreversible disk "
40708 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
40709 "but doesn't catch all cases."
40713 #: ../tools/virt-win-reg.pl:58
40715 "Modifying the Windows Registry is an inherently risky operation. The format "
40716 "is deliberately obscure and undocumented, and Registry changes can leave the "
40717 "system unbootable. Therefore when using the I<--merge> option, make sure "
40718 "you have a reliable backup first."
40722 #: ../tools/virt-win-reg.pl:65
40724 "This program can export and merge Windows Registry entries from a Windows "
40729 #: ../tools/virt-win-reg.pl:68
40731 "The first parameter is the libvirt guest name or the raw disk image of a "
40736 #: ../tools/virt-win-reg.pl:71
40738 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
40739 "exported (recursively). For example:"
40743 #: ../tools/virt-win-reg.pl:74
40746 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
40751 #: ../tools/virt-win-reg.pl:76
40753 "You can also display single values from within registry keys, for example:"
40757 #: ../tools/virt-win-reg.pl:79
40760 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
40761 " $ virt-win-reg Windows7 $cvkey ProductName\n"
40762 " Windows 7 Enterprise\n"
40767 #: ../tools/virt-win-reg.pl:83
40769 "With I<--merge>, you can merge a textual regedit file into the Windows "
40774 #: ../tools/virt-win-reg.pl:86
40777 " $ virt-win-reg --merge Windows7 changes.reg\n"
40782 #: ../tools/virt-win-reg.pl:90
40784 "This program is only meant for simple access to the registry. If you want "
40785 "to do complicated things with the registry, we suggest you download the "
40786 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
40787 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
40788 "L<hivexregedit(1)>."
40792 #: ../tools/virt-win-reg.pl:159
40797 #: ../tools/virt-win-reg.pl:161
40799 "In merge mode, this merges a textual regedit file into the Windows Registry "
40800 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
40801 "displays or exports Registry entries instead."
40805 #: ../tools/virt-win-reg.pl:165
40807 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
40808 "result in disk corruption. However exporting (without this flag) is always "
40813 #: ../tools/virt-win-reg.pl:173
40814 msgid "B<--encoding> UTF-16LE|ASCII"
40818 #: ../tools/virt-win-reg.pl:175
40820 "When merging (only), you may need to specify the encoding for strings to be "
40821 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
40822 "(3)/ENCODING STRINGS>."
40826 #: ../tools/virt-win-reg.pl:179
40828 "The default is to use UTF-16LE, which should work with recent versions of "
40833 #: ../tools/virt-win-reg.pl:186
40834 msgid "B<--unsafe-printable-strings>"
40838 #: ../tools/virt-win-reg.pl:188
40840 "When exporting (only), assume strings are UTF-16LE and print them as strings "
40841 "instead of hex sequences. Remove the final zero codepoint from strings if "
40846 #: ../tools/virt-win-reg.pl:192
40848 "This is unsafe and does not preserve the fidelity of strings in the original "
40849 "Registry for various reasons:"
40853 #: ../tools/virt-win-reg.pl:199
40855 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
40856 "other encodings will be corrupted by this transformation."
40860 #: ../tools/virt-win-reg.pl:204
40862 "Assumes that everything which has type 1 or 2 is really a string and that "
40863 "everything else is not a string, but the type field in real Registries is "
40868 #: ../tools/virt-win-reg.pl:210
40870 "Loses information about whether a zero codepoint followed the string in the "
40875 #: ../tools/virt-win-reg.pl:215
40877 "This all happens because the Registry itself contains no information about "
40878 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
40882 #: ../tools/virt-win-reg.pl:219
40884 "You should only use this option for quick hacking and debugging of the "
40885 "Registry contents, and I<never> use it if the output is going to be passed "
40886 "into another program or stored in another Registry."
40890 #: ../tools/virt-win-reg.pl:556
40891 msgid "SUPPORTED SYSTEMS"
40895 #: ../tools/virt-win-reg.pl:558
40897 "The program currently supports Windows NT-derived guests starting with "
40898 "Windows XP through to at least Windows 7."
40902 #: ../tools/virt-win-reg.pl:561
40903 msgid "The following Registry keys are supported:"
40907 #: ../tools/virt-win-reg.pl:565
40908 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
40912 #: ../tools/virt-win-reg.pl:567
40913 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
40917 #: ../tools/virt-win-reg.pl:569
40918 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
40922 #: ../tools/virt-win-reg.pl:571
40923 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
40927 #: ../tools/virt-win-reg.pl:573
40928 msgid "C<HKEY_USERS\\.DEFAULT>"
40932 #: ../tools/virt-win-reg.pl:575
40933 msgid "C<HKEY_USERS\\I<SID>>"
40937 #: ../tools/virt-win-reg.pl:577
40938 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
40942 #: ../tools/virt-win-reg.pl:579
40943 msgid "C<HKEY_USERS\\I<username>>"
40947 #: ../tools/virt-win-reg.pl:581
40949 "where I<username> is a local user name (this is a libguestfs extension)."
40953 #: ../tools/virt-win-reg.pl:585
40955 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
40960 #: ../tools/virt-win-reg.pl:588
40962 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
40963 "supported (there is no \"current user\")."
40967 #: ../tools/virt-win-reg.pl:591
40972 #: ../tools/virt-win-reg.pl:593
40974 "C<virt-win-reg> expects that regedit files have already been reencoded in "
40975 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
40976 "style line endings. Since Windows regedit files are often in UTF-16LE with "
40977 "Windows-style line endings, you may need to reencode the whole file before "
40978 "or after processing."
40982 #: ../tools/virt-win-reg.pl:599
40984 "To reencode a file from Windows format to Linux (before processing it with "
40985 "the I<--merge> option), you would do something like this:"
40989 #: ../tools/virt-win-reg.pl:602
40992 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
40997 #: ../tools/virt-win-reg.pl:604
40999 "To go in the opposite direction, after exporting and before sending the file "
41000 "to a Windows user, do something like this:"
41004 #: ../tools/virt-win-reg.pl:607
41007 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
41012 #: ../tools/virt-win-reg.pl:609
41013 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
41017 #: ../tools/virt-win-reg.pl:611
41019 "If you are unsure about the current encoding, use the L<file(1)> command. "
41020 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
41021 "style (CRLF) line endings, like this:"
41025 #: ../tools/virt-win-reg.pl:615
41028 " $ file software.reg\n"
41029 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
41030 " with CRLF line terminators\n"
41035 #: ../tools/virt-win-reg.pl:619
41036 msgid "This file would need conversion before you could I<--merge> it."
41040 #: ../tools/virt-win-reg.pl:621
41041 msgid "CurrentControlSet etc."
41045 #: ../tools/virt-win-reg.pl:623
41047 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
41048 "Registry at the level of the hive file, and therefore you cannot modify "
41053 #: ../tools/virt-win-reg.pl:627
41055 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
41056 "circumstances it might refer to another control set. The way to find out is "
41057 "to look at the C<HKLM\\SYSTEM\\Select> key:"
41061 #: ../tools/virt-win-reg.pl:631
41064 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
41065 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
41066 " \"Current\"=dword:00000001\n"
41067 " \"Default\"=dword:00000001\n"
41068 " \"Failed\"=dword:00000000\n"
41069 " \"LastKnownGood\"=dword:00000002\n"
41074 #: ../tools/virt-win-reg.pl:638
41075 msgid "\"Current\" is the one which Windows will choose when it boots."
41079 #: ../tools/virt-win-reg.pl:640
41081 "Similarly, other C<Current...> keys in the path may need to be replaced."
41085 #: ../tools/virt-win-reg.pl:643
41086 msgid "WINDOWS TIPS"
41090 #: ../tools/virt-win-reg.pl:645
41092 "Note that some of these tips modify the guest disk image. The guest I<must> "
41093 "be shut off, else you will get disk corruption."
41097 #: ../tools/virt-win-reg.pl:648
41098 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
41102 #: ../tools/virt-win-reg.pl:650
41104 "Prepare a DOS batch script, VBScript or executable. Upload this using "
41105 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
41106 "is uploaded into C<C:\\>:"
41110 #: ../tools/virt-win-reg.pl:654
41113 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
41118 #: ../tools/virt-win-reg.pl:656
41119 msgid "Prepare a regedit file containing the registry change:"
41123 #: ../tools/virt-win-reg.pl:658
41126 " cat > test.reg <<'EOF'\n"
41127 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
41128 " \"Test\"=\"c:\\\\test.bat\"\n"
41134 #: ../tools/virt-win-reg.pl:663
41136 "In this example we use the key C<RunOnce> which means that the script will "
41137 "run precisely once when the first user logs in. If you want it to run every "
41138 "time a user logs in, replace C<RunOnce> with C<Run>."
41142 #: ../tools/virt-win-reg.pl:667
41143 msgid "Now update the registry:"
41147 #: ../tools/virt-win-reg.pl:669
41150 " virt-win-reg --merge WindowsGuest test.reg\n"
41155 #: ../tools/virt-win-reg.pl:671
41156 msgid "INSTALLING A SERVICE"
41160 #: ../tools/virt-win-reg.pl:673
41162 "This section assumes you are familiar with Windows services, and you either "
41163 "have a program which handles the Windows Service Control Protocol directly "
41164 "or you want to run any program using a service wrapper like SrvAny or the "
41169 #: ../tools/virt-win-reg.pl:678
41171 "First upload the program and optionally the service wrapper. In this case "
41172 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
41176 #: ../tools/virt-win-reg.pl:682
41179 " guestfish -i -d WindowsGuest <<EOF\n"
41180 " upload rhsrvany.exe /rhsrvany.exe\n"
41181 " upload test.exe /test.exe\n"
41187 #: ../tools/virt-win-reg.pl:687
41189 "Prepare a regedit file containing the registry changes. In this example, "
41190 "the first registry change is needed for the service itself or the service "
41191 "wrapper (if used). The second registry change is only needed because I am "
41192 "using the RHSrvAny service wrapper."
41196 #: ../tools/virt-win-reg.pl:692
41199 " cat > service.reg <<'EOF'\n"
41200 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
41201 " \"Type\"=dword:00000010\n"
41202 " \"Start\"=dword:00000002\n"
41203 " \"ErrorControl\"=dword:00000001\n"
41204 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
41205 " \"DisplayName\"=\"RHSrvAny\"\n"
41206 " \"ObjectName\"=\"NetworkService\"\n"
41211 #: ../tools/virt-win-reg.pl:701
41214 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
41215 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
41216 " \"PWD\"=\"c:\\\\Temp\"\n"
41222 #: ../tools/virt-win-reg.pl:712
41224 "For use of C<ControlSet001> see the section above in this manual page. You "
41225 "may need to adjust this according to the control set that is in use by the "
41230 #: ../tools/virt-win-reg.pl:718
41232 "C<\"ObjectName\"> controls the privileges that the service will have. An "
41233 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
41234 "privileged account."
41238 #: ../tools/virt-win-reg.pl:724
41240 "For the meaning of the magic numbers, see this Microsoft KB article: "
41241 "L<http://support.microsoft.com/kb/103000>."
41245 #: ../tools/virt-win-reg.pl:729
41246 msgid "Update the registry:"
41250 #: ../tools/virt-win-reg.pl:731
41253 " virt-win-reg --merge WindowsGuest service.reg\n"
41258 #: ../tools/virt-win-reg.pl:735
41260 "Be careful when passing parameters containing C<\\> (backslash) in the "
41261 "shell. Usually you will have to use 'single quotes' or double backslashes "
41262 "(but not both) to protect them from the shell."
41266 #: ../tools/virt-win-reg.pl:739
41267 msgid "Paths and value names are case-insensitive."
41271 #: ../tools/virt-win-reg.pl:748
41273 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
41274 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
41275 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41279 #: ../tools/virt-win-reg.pl:766
41282 " export LIBGUESTFS_DEBUG=1\n"
41283 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
41288 #: ../tools/virt-win-reg.pl:769
41290 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."