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-26 14:08+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:262 ../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:266 ../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:2877
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:491
490 #: ../sparsify/virt-sparsify.pod:153
495 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:493
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:561
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:563
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:565
566 #: ../sparsify/virt-sparsify.pod:169 ../tools/virt-list-filesystems.pl:71
567 #: ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171
568 #: ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
569 msgid "Display version number and exit."
573 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146
574 #: ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437
575 #: ../clone/virt-sysprep.pod:150 ../df/virt-df.pod:185
576 #: ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412
577 #: ../fuse/guestmount.pod:287 ../inspector/virt-inspector.pod:131
578 #: ../rescue/virt-rescue.pod:203 ../sparsify/virt-sparsify.pod:171
579 #: ../tools/virt-tar.pl:158
584 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148
585 #: ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439
586 #: ../clone/virt-sysprep.pod:152 ../df/virt-df.pod:187
587 #: ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133
588 #: ../rescue/virt-rescue.pod:205 ../sparsify/virt-sparsify.pod:173
589 msgid "Enable tracing of libguestfs API calls."
593 #: ../align/virt-alignment-scan.pod:172
594 msgid "RECOMMENDED ALIGNMENT"
598 #: ../align/virt-alignment-scan.pod:174
600 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
601 "first sector of the first partition at sector 63, with a 512 byte sector "
602 "size. This happens because of a historical accident. Drives have to report "
603 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
604 "completely meaningless on modern drives, but it happens that the geometry "
605 "reported always has 63 sectors per track. The operating system therefore "
606 "places the first partition at the start of the second \"track\", at sector "
611 #: ../align/virt-alignment-scan.pod:183
613 "When the guest OS is virtualized, the host operating system and hypervisor "
614 "may prefer accesses aligned to one of:"
618 #: ../align/virt-alignment-scan.pod:188
623 #: ../align/virt-alignment-scan.pod:190
625 "if the host OS uses local storage directly on hard drive partitions, and the "
626 "hard drive has 512 byte physical sectors."
630 #: ../align/virt-alignment-scan.pod:193
635 #: ../align/virt-alignment-scan.pod:195
637 "for local storage on new hard drives with 4Kbyte physical sectors; for file-"
638 "backed storage on filesystems with 4Kbyte block size; or for some types of "
639 "network-attached storage."
643 #: ../align/virt-alignment-scan.pod:199
648 #: ../align/virt-alignment-scan.pod:201
650 "for high-end network-attached storage. This is the optimal block size for "
651 "some NetApp hardware."
655 #: ../align/virt-alignment-scan.pod:204
660 #: ../align/virt-alignment-scan.pod:206
661 msgid "see L</1 MB PARTITION ALIGNMENT> below."
665 #: ../align/virt-alignment-scan.pod:210
667 "Partitions which are not aligned correctly to the underlying storage cause "
668 "extra I/O. For example:"
672 #: ../align/virt-alignment-scan.pod:213
676 " +--------------------------+------\n"
678 " | filesystem block |\n"
679 " ---+------------------+------+-------------------+-----+---\n"
680 " | host block | host block |\n"
682 " ---+-------------------------+-------------------------+---\n"
687 #: ../align/virt-alignment-scan.pod:222
689 "In this example, each time a 4K guest block is read, two blocks on the host "
690 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
691 "written, two host blocks must first be read, the old and new data combined, "
692 "and the two blocks written back (4x I/O)."
696 #: ../align/virt-alignment-scan.pod:227
697 msgid "LINUX HOST BLOCK AND I/O SIZE"
701 #: ../align/virt-alignment-scan.pod:229
703 "New versions of the Linux kernel expose the physical and logical block size, "
704 "and minimum and recommended I/O size."
708 #: ../align/virt-alignment-scan.pod:232
709 msgid "For a typical hard drive with 512 byte sectors:"
713 #: ../align/virt-alignment-scan.pod:234
716 " $ cat /sys/block/sda/queue/physical_block_size\n"
718 " $ cat /sys/block/sda/queue/logical_block_size\n"
720 " $ cat /sys/block/sda/queue/minimum_io_size\n"
722 " $ cat /sys/block/sda/queue/optimal_io_size\n"
728 #: ../align/virt-alignment-scan.pod:243
729 msgid "For a NetApp LUN:"
733 #: ../align/virt-alignment-scan.pod:245
736 " $ cat /sys/block/sdc/queue/logical_block_size\n"
738 " $ cat /sys/block/sdc/queue/physical_block_size\n"
740 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
742 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
748 #: ../align/virt-alignment-scan.pod:254
750 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
751 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
755 #: ../align/virt-alignment-scan.pod:258
757 "For detailed information about what these numbers mean, see L<http://docs."
758 "redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/"
759 "Storage_Administration_Guide/newstorage-iolimits.html>"
763 #: ../align/virt-alignment-scan.pod:261
765 "[Thanks to Mike Snitzer for providing NetApp data and additional "
770 #: ../align/virt-alignment-scan.pod:264
771 msgid "1 MB PARTITION ALIGNMENT"
775 #: ../align/virt-alignment-scan.pod:266
777 "Microsoft picked 1 MB as the default alignment for all partitions starting "
778 "with Windows 2008 Server, and Linux has followed this."
782 #: ../align/virt-alignment-scan.pod:269
784 "Assuming 512 byte sectors in the guest, you will now see the first partition "
785 "starting at sector 2048, and subsequent partitions (if any) will start at a "
786 "multiple of 2048 sectors."
790 #: ../align/virt-alignment-scan.pod:273
792 "1 MB alignment is compatible with all current alignment requirements (4K, "
793 "64K) and provides room for future growth in physical block sizes."
797 #: ../align/virt-alignment-scan.pod:276
798 msgid "SETTING ALIGNMENT"
802 #: ../align/virt-alignment-scan.pod:278
804 "L<virt-resize(1)> can change the alignment of the partitions of some "
805 "guests. Currently it can fully align all the partitions of all Windows "
806 "guests, and it will fix the bootloader where necessary. For Linux guests, "
807 "it can align the second and subsequent partitions, so the majority of OS "
808 "accesses except at boot will be aligned."
812 #: ../align/virt-alignment-scan.pod:284
814 "Another way to correct partition alignment problems is to reinstall your "
815 "guest operating systems. If you install operating systems from templates, "
816 "ensure these have correct partition alignment too."
820 #: ../align/virt-alignment-scan.pod:288
822 "For older versions of Windows, the following NetApp document contains useful "
823 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
827 #: ../align/virt-alignment-scan.pod:291
829 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
830 "an explicit C<%pre> section that creates aligned partitions using L<parted(8)"
831 ">. Do not use the Kickstart C<part> command. The NetApp document above "
832 "contains an example."
836 #: ../align/virt-alignment-scan.pod:296 ../cat/virt-cat.pod:231
837 #: ../cat/virt-filesystems.pod:373 ../cat/virt-ls.pod:483
838 #: ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:215
839 #: ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352
840 #: ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:676
841 #: ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258
842 #: ../tools/virt-make-fs.pl:550 ../tools/virt-tar.pl:289
843 #: ../tools/virt-win-reg.pl:744
844 msgid "SHELL QUOTING"
848 #: ../align/virt-alignment-scan.pod:298 ../cat/virt-cat.pod:233
849 #: ../cat/virt-filesystems.pod:375 ../cat/virt-ls.pod:485
850 #: ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:217
851 #: ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354
852 #: ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:678
853 #: ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260
854 #: ../tools/virt-make-fs.pl:552 ../tools/virt-tar.pl:291
855 #: ../tools/virt-win-reg.pl:752
857 "Libvirt guest names can contain arbitrary characters, some of which have "
858 "meaning to the shell such as C<#> and space. You may need to quote or "
859 "escape these characters on the command line. See the shell manual page L<sh"
864 #: ../align/virt-alignment-scan.pod:303 ../cat/virt-cat.pod:238
865 #: ../cat/virt-filesystems.pod:380 ../cat/virt-ls.pod:490
866 #: ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:222
867 #: ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114
868 #: ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:375
869 #: ../resize/virt-resize.pod:683 ../sparsify/virt-sparsify.pod:227
870 #: ../test-tool/libguestfs-test-tool.pod:90
875 #: ../align/virt-alignment-scan.pod:305
876 msgid "This program returns:"
880 #: ../align/virt-alignment-scan.pod:309 ../align/virt-alignment-scan.pod:315
881 #: ../align/virt-alignment-scan.pod:321 ../align/virt-alignment-scan.pod:328
882 #: ../cat/virt-cat.pod:177 ../cat/virt-cat.pod:182 ../cat/virt-cat.pod:187
883 #: ../cat/virt-cat.pod:198 ../cat/virt-cat.pod:202
884 #: ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287
885 #: ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295
886 #: ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314
887 #: ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322
888 #: ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362
889 #: ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388
890 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
891 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
892 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
893 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
894 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
895 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
896 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
897 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
898 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
899 #: ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:403
900 #: ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:417
901 #: ../fish/guestfish-actions.pod:1216 ../fish/guestfish-actions.pod:1220
902 #: ../fish/guestfish-actions.pod:1224 ../fish/guestfish-actions.pod:1228
903 #: ../fish/guestfish-actions.pod:1236 ../fish/guestfish-actions.pod:1240
904 #: ../fish/guestfish-actions.pod:1244 ../fish/guestfish-actions.pod:1254
905 #: ../fish/guestfish-actions.pod:1258 ../fish/guestfish-actions.pod:1262
906 #: ../fish/guestfish-actions.pod:1352 ../fish/guestfish-actions.pod:1356
907 #: ../fish/guestfish-actions.pod:1361 ../fish/guestfish-actions.pod:1366
908 #: ../fish/guestfish-actions.pod:1408 ../fish/guestfish-actions.pod:1412
909 #: ../fish/guestfish-actions.pod:1417 ../fish/guestfish-actions.pod:1673
910 #: ../fish/guestfish-actions.pod:1680 ../fish/guestfish-actions.pod:1687
911 #: ../fish/guestfish-actions.pod:2090 ../fish/guestfish-actions.pod:2096
912 #: ../fish/guestfish-actions.pod:2104 ../fish/guestfish-actions.pod:2111
913 #: ../fish/guestfish-actions.pod:2118 ../fish/guestfish.pod:445
914 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
915 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393
916 #: ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:359
917 #: ../resize/virt-resize.pod:363 ../resize/virt-resize.pod:372
918 #: ../resize/virt-resize.pod:378 ../sparsify/virt-sparsify.pod:32
919 #: ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43
920 #: ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54
921 #: ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64
922 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
923 #: ../src/guestfs-actions.pod:594 ../src/guestfs-actions.pod:602
924 #: ../src/guestfs-actions.pod:609 ../src/guestfs-actions.pod:616
925 #: ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2028
926 #: ../src/guestfs-actions.pod:2032 ../src/guestfs-actions.pod:2036
927 #: ../src/guestfs-actions.pod:2044 ../src/guestfs-actions.pod:2048
928 #: ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2062
929 #: ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2070
930 #: ../src/guestfs-actions.pod:2208 ../src/guestfs-actions.pod:2212
931 #: ../src/guestfs-actions.pod:2217 ../src/guestfs-actions.pod:2222
932 #: ../src/guestfs-actions.pod:2283 ../src/guestfs-actions.pod:2287
933 #: ../src/guestfs-actions.pod:2292 ../src/guestfs-actions.pod:2707
934 #: ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:2721
935 #: ../src/guestfs-actions.pod:3266 ../src/guestfs-actions.pod:3272
936 #: ../src/guestfs-actions.pod:3280 ../src/guestfs-actions.pod:3287
937 #: ../src/guestfs-actions.pod:3294 ../src/guestfs.pod:403
938 #: ../src/guestfs.pod:408 ../src/guestfs.pod:413 ../src/guestfs.pod:417
939 #: ../src/guestfs.pod:422 ../src/guestfs.pod:426 ../src/guestfs.pod:431
940 #: ../src/guestfs.pod:436 ../src/guestfs.pod:1109 ../src/guestfs.pod:1113
941 #: ../src/guestfs.pod:1117 ../src/guestfs.pod:1122 ../src/guestfs.pod:1130
942 #: ../src/guestfs.pod:1149 ../src/guestfs.pod:1157 ../src/guestfs.pod:1179
943 #: ../src/guestfs.pod:1183 ../src/guestfs.pod:1187 ../src/guestfs.pod:1191
944 #: ../src/guestfs.pod:1195 ../src/guestfs.pod:1199 ../src/guestfs.pod:1689
945 #: ../src/guestfs.pod:1694 ../src/guestfs.pod:1698 ../src/guestfs.pod:1800
946 #: ../src/guestfs.pod:1805 ../src/guestfs.pod:1809 ../src/guestfs.pod:1819
947 #: ../src/guestfs.pod:2108 ../src/guestfs.pod:2113 ../src/guestfs.pod:2119
948 #: ../src/guestfs.pod:2127 ../src/guestfs.pod:2645 ../src/guestfs.pod:2651
949 #: ../src/guestfs.pod:2656 ../src/guestfs.pod:2662 ../src/guestfs.pod:3062
950 #: ../src/guestfs.pod:3067 ../src/guestfs.pod:3071 ../src/guestfs.pod:3075
951 #: ../src/guestfs.pod:3079 ../src/guestfs.pod:3093 ../src/guestfs.pod:3098
952 #: ../src/guestfs.pod:3329 ../src/guestfs.pod:3333 ../src/guestfs.pod:3337
953 #: ../src/guestfs.pod:3341 ../tools/virt-win-reg.pl:197
954 #: ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208
955 #: ../tools/virt-win-reg.pl:721 ../tools/virt-win-reg.pl:727
956 #: ../tools/virt-win-reg.pl:733
961 #: ../align/virt-alignment-scan.pod:311
966 #: ../align/virt-alignment-scan.pod:313
968 "successful exit, all partitions are aligned E<ge> 64K for best performance"
972 #: ../align/virt-alignment-scan.pod:317
977 #: ../align/virt-alignment-scan.pod:319
978 msgid "an error scanning the disk image or guest"
982 #: ../align/virt-alignment-scan.pod:323
987 #: ../align/virt-alignment-scan.pod:325
989 "successful exit, some partitions have alignment E<lt> 64K which can result "
990 "in poor performance on high end network storage"
994 #: ../align/virt-alignment-scan.pod:330
999 #: ../align/virt-alignment-scan.pod:332
1001 "successful exit, some partitions have alignment E<lt> 4K which can result in "
1002 "poor performance on most hypervisors"
1006 #: ../align/virt-alignment-scan.pod:337 ../cat/virt-cat.pod:243
1007 #: ../cat/virt-filesystems.pod:385 ../cat/virt-ls.pod:495
1008 #: ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:227
1009 #: ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97
1010 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
1011 #: ../fish/guestfish.pod:1268 ../fish/virt-copy-in.pod:50
1012 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
1013 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:317
1014 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
1015 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
1016 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288
1017 #: ../resize/virt-resize.pod:688 ../ruby/examples/guestfs-ruby.pod:36
1018 #: ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3270
1019 #: ../test-tool/libguestfs-test-tool.pod:100
1020 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
1021 #: ../tools/virt-make-fs.pl:557 ../tools/virt-tar.pl:296
1022 #: ../tools/virt-win-reg.pl:757
1027 #: ../align/virt-alignment-scan.pod:339
1029 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
1030 "L<virt-resize(1)>, L<http://libguestfs.org/>."
1034 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:252
1035 #: ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:507
1036 #: ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:235
1037 #: ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296
1038 #: ../resize/virt-resize.pod:711 ../sparsify/virt-sparsify.pod:264
1039 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277
1040 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:311
1041 #: ../tools/virt-win-reg.pl:783
1046 #: ../align/virt-alignment-scan.pod:348 ../cat/virt-cat.pod:254
1047 #: ../cat/virt-filesystems.pod:398 ../cat/virt-ls.pod:509
1048 #: ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:237
1049 #: ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395
1050 #: ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:713
1051 #: ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210
1052 #: ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:584
1053 #: ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:785
1054 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
1058 #: ../align/virt-alignment-scan.pod:350 ../cat/virt-cat.pod:256
1059 #: ../cat/virt-filesystems.pod:400 ../cat/virt-ls.pod:511
1060 #: ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:239
1061 #: ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114
1062 #: ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401
1063 #: ../fish/guestfish.pod:1300 ../fish/virt-copy-in.pod:64
1064 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
1065 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:332
1066 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62
1067 #: ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56
1068 #: ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300
1069 #: ../resize/virt-resize.pod:715 ../ruby/examples/guestfs-ruby.pod:52
1070 #: ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3352
1071 #: ../test-tool/libguestfs-test-tool.pod:110
1072 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
1073 #: ../tools/virt-make-fs.pl:586 ../tools/virt-tar.pl:315
1074 #: ../tools/virt-win-reg.pl:787
1079 #: ../align/virt-alignment-scan.pod:352 ../clone/virt-sysprep.pod:507
1080 #: ../sparsify/virt-sparsify.pod:270
1081 msgid "Copyright (C) 2011 Red Hat Inc."
1085 #: ../align/virt-alignment-scan.pod:354 ../cat/virt-cat.pod:260
1086 #: ../cat/virt-filesystems.pod:404 ../cat/virt-ls.pod:515
1087 #: ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:243
1088 #: ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305
1089 #: ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58
1090 #: ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60
1091 #: ../fuse/guestmount.pod:337 ../inspector/virt-inspector.pod:407
1092 #: ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:719
1093 #: ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115
1094 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
1095 #: ../tools/virt-make-fs.pl:590 ../tools/virt-tar.pl:319
1096 #: ../tools/virt-win-reg.pl:791
1098 "This program is free software; you can redistribute it and/or modify it "
1099 "under the terms of the GNU General Public License as published by the Free "
1100 "Software Foundation; either version 2 of the License, or (at your option) "
1101 "any later version."
1105 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:265
1106 #: ../cat/virt-filesystems.pod:409 ../cat/virt-ls.pod:520
1107 #: ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:248
1108 #: ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310
1109 #: ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63
1110 #: ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65
1111 #: ../fuse/guestmount.pod:342 ../inspector/virt-inspector.pod:412
1112 #: ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:724
1113 #: ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120
1114 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
1115 #: ../tools/virt-make-fs.pl:595 ../tools/virt-tar.pl:324
1116 #: ../tools/virt-win-reg.pl:796
1118 "This program is distributed in the hope that it will be useful, but WITHOUT "
1119 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
1120 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
1125 #: ../align/virt-alignment-scan.pod:364 ../cat/virt-cat.pod:270
1126 #: ../cat/virt-filesystems.pod:414 ../cat/virt-ls.pod:525
1127 #: ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:253
1128 #: ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315
1129 #: ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68
1130 #: ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70
1131 #: ../fuse/guestmount.pod:347 ../inspector/virt-inspector.pod:417
1132 #: ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:729
1133 #: ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125
1134 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
1135 #: ../tools/virt-make-fs.pl:600 ../tools/virt-tar.pl:329
1136 #: ../tools/virt-win-reg.pl:801
1138 "You should have received a copy of the GNU General Public License along with "
1139 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
1140 "Ave, Cambridge, MA 02139, USA."
1144 #: ../cat/virt-cat.pod:5
1145 msgid "virt-cat - Display files in a virtual machine"
1149 #: ../cat/virt-cat.pod:9
1152 " virt-cat [--options] -d domname file [file ...]\n"
1157 #: ../cat/virt-cat.pod:11
1160 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
1165 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
1166 #: ../inspector/virt-inspector.pod:13
1171 #: ../cat/virt-cat.pod:15
1174 " virt-cat domname file\n"
1179 #: ../cat/virt-cat.pod:17
1182 " virt-cat disk.img file\n"
1187 #: ../cat/virt-cat.pod:21
1189 "C<virt-cat> is a command line tool to display the contents of C<file> where "
1190 "C<file> exists in the named virtual machine (or disk image)."
1194 #: ../cat/virt-cat.pod:24
1196 "Multiple filenames can be given, in which case they are concatenated "
1197 "together. Each filename must be a full path, starting at the root directory "
1198 "(starting with '/')."
1202 #: ../cat/virt-cat.pod:28
1204 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
1205 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
1206 "(see L</USING GUESTFISH> below)."
1210 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
1211 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
1212 #: ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29
1213 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
1214 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
1215 #: ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75
1216 #: ../tools/virt-tar.pl:50
1221 #: ../cat/virt-cat.pod:34
1223 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
1227 #: ../cat/virt-cat.pod:37
1230 " virt-cat -d mydomain /etc/fstab\n"
1235 #: ../cat/virt-cat.pod:39
1236 msgid "List syslog messages from a VM disk image file:"
1240 #: ../cat/virt-cat.pod:41
1243 " virt-cat -a disk.img /var/log/messages | tail\n"
1248 #: ../cat/virt-cat.pod:43
1249 msgid "Find out what DHCP IP address a VM acquired:"
1253 #: ../cat/virt-cat.pod:45
1256 " virt-cat -d mydomain /var/log/messages | \\\n"
1257 " grep 'dhclient: bound to' | tail\n"
1262 #: ../cat/virt-cat.pod:48
1263 msgid "Find out what packages were recently installed:"
1267 #: ../cat/virt-cat.pod:50
1270 " virt-cat -d mydomain /var/log/yum.log | tail\n"
1275 #: ../cat/virt-cat.pod:52
1276 msgid "Find out who is logged on inside a virtual machine:"
1280 #: ../cat/virt-cat.pod:54
1283 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
1289 #: ../cat/virt-cat.pod:57
1290 msgid "or who was logged on:"
1294 #: ../cat/virt-cat.pod:59
1297 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
1298 " last -f /tmp/wtmp\n"
1303 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
1304 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
1305 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
1307 "Add I<file> which should be a disk image from a virtual machine. If the "
1308 "virtual machine has multiple block devices, you must supply all of them with "
1309 "separate I<-a> options."
1313 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
1314 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
1315 #: ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
1316 msgid "B<--echo-keys>"
1320 #: ../cat/virt-cat.pod:100
1322 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
1323 "so you cannot see what you are typing. If you are not worried about Tempest "
1324 "attacks and there is no one else in the room you can specify this flag to "
1325 "see what you are typing."
1329 #: ../cat/virt-cat.pod:116
1332 " virt-cat --format=raw -a disk.img file\n"
1337 #: ../cat/virt-cat.pod:120
1340 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
1345 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
1346 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
1347 #: ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
1348 msgid "B<--keys-from-stdin>"
1352 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
1353 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
1354 #: ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
1356 "Read key or passphrase parameters from stdin. The default is to try to read "
1357 "passphrases from the user by opening C</dev/tty>."
1361 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
1362 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
1363 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1367 #: ../cat/virt-cat.pod:154
1368 msgid "Previous versions of virt-cat allowed you to write either:"
1372 #: ../cat/virt-cat.pod:156
1375 " virt-cat disk.img [disk.img ...] file\n"
1380 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
1381 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1386 #: ../cat/virt-cat.pod:160
1389 " virt-cat guestname file\n"
1394 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
1395 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1397 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1398 "the confusing case where a disk image might have the same name as a guest."
1402 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
1403 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1404 msgid "For compatibility the old style is still supported."
1408 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
1409 msgid "WINDOWS PATHS"
1413 #: ../cat/virt-cat.pod:170
1415 "C<virt-cat> has a limited ability to understand Windows drive letters and "
1416 "paths (eg. C<E:\\foo\\bar.txt>)."
1420 #: ../cat/virt-cat.pod:173 ../edit/virt-edit.pod:262
1421 msgid "If and only if the guest is running Windows then:"
1425 #: ../cat/virt-cat.pod:179 ../edit/virt-edit.pod:268
1427 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
1428 "to the correct filesystem."
1432 #: ../cat/virt-cat.pod:184 ../edit/virt-edit.pod:273
1434 "Any backslash (C<\\>) characters in the path are replaced with forward "
1435 "slashes so that libguestfs can process it."
1439 #: ../cat/virt-cat.pod:189
1441 "The path is resolved case insensitively to locate the file that should be "
1446 #: ../cat/virt-cat.pod:194 ../edit/virt-edit.pod:283
1447 msgid "There are some known shortcomings:"
1451 #: ../cat/virt-cat.pod:200 ../edit/virt-edit.pod:289
1452 msgid "Some NTFS symbolic links may not be followed correctly."
1456 #: ../cat/virt-cat.pod:204 ../edit/virt-edit.pod:293
1457 msgid "NTFS junction points that cross filesystems are not followed."
1461 #: ../cat/virt-cat.pod:208 ../edit/virt-edit.pod:297
1462 msgid "USING GUESTFISH"
1466 #: ../cat/virt-cat.pod:210
1468 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1469 "C<virt-cat> doesn't work."
1473 #: ../cat/virt-cat.pod:213
1474 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1478 #: ../cat/virt-cat.pod:215
1481 " guestfish --ro -i -d domname download file -\n"
1486 #: ../cat/virt-cat.pod:217
1488 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1489 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1493 #: ../cat/virt-cat.pod:221
1495 "The command above uses libguestfs's guest inspection feature and so does not "
1496 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1497 "disk images that don't contain guests. To display a file from a disk image "
1502 #: ../cat/virt-cat.pod:226
1505 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1510 #: ../cat/virt-cat.pod:228
1512 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1513 "the disk image, and C<file> is the full path to the file."
1517 #: ../cat/virt-cat.pod:240 ../cat/virt-filesystems.pod:382
1518 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
1519 #: ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:377
1520 #: ../resize/virt-resize.pod:685 ../sparsify/virt-sparsify.pod:229
1522 "This program returns 0 if successful, or non-zero if there was an error."
1526 #: ../cat/virt-cat.pod:245
1528 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
1529 "tar-out(1)>, L<http://libguestfs.org/>."
1533 #: ../cat/virt-cat.pod:258 ../inspector/virt-inspector.pod:405
1534 #: ../resize/virt-resize.pod:717 ../tools/virt-make-fs.pl:588
1535 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1539 #: ../cat/virt-filesystems.pod:5
1541 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1542 "virtual machine or disk image"
1546 #: ../cat/virt-filesystems.pod:9
1549 " virt-filesystems [--options] -d domname\n"
1554 #: ../cat/virt-filesystems.pod:11
1557 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1562 #: ../cat/virt-filesystems.pod:15
1564 "This tool allows you to discover filesystems, partitions, logical volumes, "
1565 "and their sizes in a disk image or virtual machine. It is a replacement for "
1566 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1570 #: ../cat/virt-filesystems.pod:20
1572 "One use for this tool is from shell scripts to iterate over all filesystems "
1573 "from a disk image:"
1577 #: ../cat/virt-filesystems.pod:23
1580 " for fs in $(virt-filesystems -a disk.img); do\n"
1587 #: ../cat/virt-filesystems.pod:27
1589 "Another use is to list partitions before using another tool to modify those "
1590 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1591 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1595 #: ../cat/virt-filesystems.pod:32
1597 "Various command line options control what this program displays. You need "
1598 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1599 "guest respectively. If you just specify that then the program shows "
1600 "filesystems found, one per line, like this:"
1604 #: ../cat/virt-filesystems.pod:37
1607 " $ virt-filesystems -a disk.img\n"
1609 " /dev/vg_guest/lv_root\n"
1614 #: ../cat/virt-filesystems.pod:41
1616 "If you add I<-l> or I<--long> then the output includes extra information:"
1620 #: ../cat/virt-filesystems.pod:44
1623 " $ virt-filesystems -a disk.img -l\n"
1624 " Name Type VFS Label Size\n"
1625 " /dev/sda1 filesystem ext4 boot 524288000\n"
1626 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1631 #: ../cat/virt-filesystems.pod:49
1633 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1638 #: ../cat/virt-filesystems.pod:52
1641 " $ virt-filesystems -a disk.img --extra\n"
1643 " /dev/vg_guest/lv_root\n"
1644 " /dev/vg_guest/lv_swap\n"
1645 " /dev/vg_guest/lv_data\n"
1650 #: ../cat/virt-filesystems.pod:58
1652 "If you add I<--partitions> then partitions are shown instead of filesystems:"
1656 #: ../cat/virt-filesystems.pod:60
1659 " $ virt-filesystems -a disk.img --partitions\n"
1666 #: ../cat/virt-filesystems.pod:64
1668 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
1669 "volumes>, I<--block-devices> to list those items."
1673 #: ../cat/virt-filesystems.pod:67
1675 "You can use these options in combination as well (if you want a combination "
1676 "including filesystems, you have to add I<--filesystems>). Notice that some "
1677 "items fall into several categories (eg. C</dev/sda1> might be both a "
1678 "partition and a filesystem). These items are listed several times. To get "
1679 "a list which includes absolutely everything that virt-filesystems knows "
1680 "about, use the I<--all> option."
1684 #: ../cat/virt-filesystems.pod:74
1686 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
1687 "uuid> option to display device and filesystem UUIDs in the long output."
1691 #: ../cat/virt-filesystems.pod:78
1693 "I<--all --long --uuid> is a useful combination to display all possible "
1694 "information about everything."
1698 #: ../cat/virt-filesystems.pod:81
1701 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1702 " Name Type VFS Label Size Parent UUID\n"
1703 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1704 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1705 " /dev/sda1 partition - - 100M /dev/sda -\n"
1706 " /dev/sda2 partition - - 20G /dev/sda -\n"
1707 " /dev/sda device - - 20G - -\n"
1712 #: ../cat/virt-filesystems.pod:89
1714 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1718 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1723 #: ../cat/virt-filesystems.pod:112
1725 "Display everything. This is currently the same as specifying these options: "
1726 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
1727 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
1728 "added to this list in future)."
1732 #: ../cat/virt-filesystems.pod:117
1733 msgid "See also I<--long>."
1737 #: ../cat/virt-filesystems.pod:119
1738 msgid "B<--blkdevs>"
1742 #: ../cat/virt-filesystems.pod:121
1743 msgid "B<--block-devices>"
1747 #: ../cat/virt-filesystems.pod:123
1748 msgid "Display block devices."
1752 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1757 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1759 "Write out the results in CSV format (comma-separated values). This format "
1760 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1761 "ABOUT CSV FORMAT> below."
1765 #: ../cat/virt-filesystems.pod:150
1767 "When prompting for keys and passphrases, virt-filesystems normally turns "
1768 "echoing off so you cannot see what you are typing. If you are not worried "
1769 "about Tempest attacks and there is no one else in the room you can specify "
1770 "this flag to see what you are typing."
1774 #: ../cat/virt-filesystems.pod:155
1779 #: ../cat/virt-filesystems.pod:157
1781 "This causes filesystems that are not ordinary, mountable filesystems to be "
1782 "displayed. This category includes swapspace, and filesystems that are empty "
1783 "or contain unknown data."
1787 #: ../cat/virt-filesystems.pod:161
1788 msgid "This option implies I<--filesystems>."
1792 #: ../cat/virt-filesystems.pod:163
1793 msgid "B<--filesystems>"
1797 #: ../cat/virt-filesystems.pod:165
1799 "Display mountable filesystems. If no display option was selected then this "
1800 "option is implied."
1804 #: ../cat/virt-filesystems.pod:168
1805 msgid "With I<--extra>, non-mountable filesystems are shown too."
1809 #: ../cat/virt-filesystems.pod:181
1812 " virt-filesystems --format=raw -a disk.img\n"
1817 #: ../cat/virt-filesystems.pod:185
1820 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1825 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1826 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1827 #: ../tools/virt-list-partitions.pl:109
1832 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1833 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1834 msgid "B<--human-readable>"
1838 #: ../cat/virt-filesystems.pod:198
1839 msgid "In I<--long> mode, display sizes in human-readable format."
1843 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1844 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1849 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1850 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1855 #: ../cat/virt-filesystems.pod:209
1856 msgid "Display extra columns of data (\"long format\")."
1860 #: ../cat/virt-filesystems.pod:211
1861 msgid "A title row is added unless you also specify I<--no-title>."
1865 #: ../cat/virt-filesystems.pod:213
1867 "The extra columns displayed depend on what output you select, and the "
1868 "ordering of columns may change in future versions. Use the title row, I<--"
1869 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1874 #: ../cat/virt-filesystems.pod:218
1876 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1877 "default is to show raw numbers of I<bytes>."
1881 #: ../cat/virt-filesystems.pod:221
1882 msgid "Use I<--uuid> to display UUIDs too."
1886 #: ../cat/virt-filesystems.pod:223
1891 #: ../cat/virt-filesystems.pod:225
1892 msgid "B<--logvols>"
1896 #: ../cat/virt-filesystems.pod:227
1897 msgid "B<--logical-volumes>"
1901 #: ../cat/virt-filesystems.pod:229
1903 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1904 "of whether the LVs contain filesystems."
1908 #: ../cat/virt-filesystems.pod:232
1909 msgid "B<--no-title>"
1913 #: ../cat/virt-filesystems.pod:234
1914 msgid "In I<--long> mode, don't add a title row."
1918 #: ../cat/virt-filesystems.pod:236
1920 "Note that the order of the columns is not fixed, and may change in future "
1921 "versions of virt-filesystems, so using this option may give you unexpected "
1926 #: ../cat/virt-filesystems.pod:240
1931 #: ../cat/virt-filesystems.pod:242
1932 msgid "B<--partitions>"
1936 #: ../cat/virt-filesystems.pod:244
1938 "Display partitions. In this mode, these are displayed irrespective of "
1939 "whether the partitions contain filesystems."
1943 #: ../cat/virt-filesystems.pod:247
1948 #: ../cat/virt-filesystems.pod:249
1949 msgid "B<--physvols>"
1953 #: ../cat/virt-filesystems.pod:251
1954 msgid "B<--physical-volumes>"
1958 #: ../cat/virt-filesystems.pod:253
1959 msgid "Display LVM physical volumes."
1963 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1968 #: ../cat/virt-filesystems.pod:257
1973 #: ../cat/virt-filesystems.pod:259
1974 msgid "In I<--long> mode, display UUIDs as well."
1978 #: ../cat/virt-filesystems.pod:273
1983 #: ../cat/virt-filesystems.pod:275
1984 msgid "B<--volgroups>"
1988 #: ../cat/virt-filesystems.pod:277
1989 msgid "B<--volume-groups>"
1993 #: ../cat/virt-filesystems.pod:279
1994 msgid "Display LVM volume groups."
1998 #: ../cat/virt-filesystems.pod:287
2003 #: ../cat/virt-filesystems.pod:289
2005 "Note that columns in the output are subject to reordering and change in "
2006 "future versions of this tool."
2010 #: ../cat/virt-filesystems.pod:294
2015 #: ../cat/virt-filesystems.pod:296
2016 msgid "The filesystem, partition, block device or LVM name."
2020 #: ../cat/virt-filesystems.pod:298
2022 "For device and partition names these are displayed as canonical libguestfs "
2023 "names, so that for example C</dev/sda2> is the second partition on the first "
2028 #: ../cat/virt-filesystems.pod:302
2030 "If the I<--long> option is B<not> specified, then only the name column is "
2031 "shown in the output."
2035 #: ../cat/virt-filesystems.pod:305
2040 #: ../cat/virt-filesystems.pod:307
2041 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
2045 #: ../cat/virt-filesystems.pod:309
2050 #: ../cat/virt-filesystems.pod:311
2052 "If there is a filesystem, then this column displays the filesystem type if "
2053 "one could be detected, eg. C<ext4>."
2057 #: ../cat/virt-filesystems.pod:314
2062 #: ../cat/virt-filesystems.pod:316
2064 "If the object has a label (used for identifying and mounting filesystems) "
2065 "then this column contains the label."
2069 #: ../cat/virt-filesystems.pod:319
2074 #: ../cat/virt-filesystems.pod:321
2076 "The partition type byte, displayed as a two digit hexadecimal number. A "
2077 "comprehensive list of partition types can be found here: L<http://www.win."
2078 "tue.nl/~aeb/partitions/partition_types-1.html>"
2082 #: ../cat/virt-filesystems.pod:325
2083 msgid "This is only applicable for DOS (MBR) partitions."
2087 #: ../cat/virt-filesystems.pod:327
2092 #: ../cat/virt-filesystems.pod:329
2094 "The size of the object in bytes. If the I<--human> option is used then the "
2095 "size is displayed in a human-readable form."
2099 #: ../cat/virt-filesystems.pod:332
2104 #: ../cat/virt-filesystems.pod:334
2106 "The parent column records the parent relationship between objects. For "
2107 "example, if the object is a partition, then this column contains the name of "
2108 "the containing device. If the object is a logical volume, then this column "
2109 "is the name of the volume group."
2113 #: ../cat/virt-filesystems.pod:339
2118 #: ../cat/virt-filesystems.pod:341
2120 "If the object has a UUID (used for identifying and mounting filesystems and "
2121 "block devices) then this column contains the UUID as a string."
2125 #: ../cat/virt-filesystems.pod:345
2126 msgid "The UUID is only displayed if the I<--uuid> option is given."
2130 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:459
2131 #: ../df/virt-df.pod:191
2132 msgid "NOTE ABOUT CSV FORMAT"
2136 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:461
2137 #: ../df/virt-df.pod:193
2139 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
2140 "should be easy to parse, but it is definitely not easy to parse."
2144 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:464
2145 #: ../df/virt-df.pod:196
2147 "Myth: Just split fields at commas. Reality: This does I<not> work "
2148 "reliably. This example has two columns:"
2152 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:467
2153 #: ../df/virt-df.pod:199
2156 " \"foo,bar\",baz\n"
2161 #: ../cat/virt-filesystems.pod:359 ../cat/virt-ls.pod:469
2162 #: ../df/virt-df.pod:201
2164 "Myth: Read the file one line at a time. Reality: This does I<not> work "
2165 "reliably. This example has one row:"
2169 #: ../cat/virt-filesystems.pod:362 ../cat/virt-ls.pod:472
2170 #: ../df/virt-df.pod:204
2179 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:475
2180 #: ../df/virt-df.pod:207
2182 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
2183 "packaged in major Linux distributions)."
2187 #: ../cat/virt-filesystems.pod:368 ../cat/virt-ls.pod:478
2188 #: ../df/virt-df.pod:210
2190 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
2191 "or Python's built-in csv library)."
2195 #: ../cat/virt-filesystems.pod:371 ../cat/virt-ls.pod:481
2196 #: ../df/virt-df.pod:213
2197 msgid "Most spreadsheets and databases can import CSV directly."
2201 #: ../cat/virt-filesystems.pod:387
2203 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
2204 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
2209 #: ../cat/virt-filesystems.pod:402 ../tools/virt-win-reg.pl:789
2210 msgid "Copyright (C) 2010 Red Hat Inc."
2214 #: ../cat/virt-ls.pod:5
2215 msgid "virt-ls - List files in a virtual machine"
2219 #: ../cat/virt-ls.pod:9
2222 " virt-ls [--options] -d domname directory [directory ...]\n"
2227 #: ../cat/virt-ls.pod:11
2230 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
2235 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
2240 #: ../cat/virt-ls.pod:15
2243 " virt-ls [--options] domname directory\n"
2248 #: ../cat/virt-ls.pod:17
2251 " virt-ls [--options] disk.img [disk.img ...] directory\n"
2256 #: ../cat/virt-ls.pod:21
2258 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
2259 "more from a virtual machine or disk image."
2263 #: ../cat/virt-ls.pod:24
2265 "Multiple directory names can be given, in which case the output from each is "
2270 #: ../cat/virt-ls.pod:27
2272 "To list directories from a libvirt guest use the I<-d> option to specify the "
2273 "name of the guest. For a disk image, use the I<-a> option."
2277 #: ../cat/virt-ls.pod:31
2279 "C<virt-ls> can do many simple file listings. For more complicated cases you "
2280 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
2285 #: ../cat/virt-ls.pod:37
2286 msgid "Get a list of all files and directories in a virtual machine:"
2290 #: ../cat/virt-ls.pod:39
2293 " virt-ls -R -d guest /\n"
2298 #: ../cat/virt-ls.pod:41
2299 msgid "List all setuid or setgid programs in a Linux virtual machine:"
2303 #: ../cat/virt-ls.pod:43
2306 " virt-ls -lR -d guest / | grep '^- [42]'\n"
2311 #: ../cat/virt-ls.pod:45
2312 msgid "List all public-writable directories in a Linux virtual machine:"
2316 #: ../cat/virt-ls.pod:47
2319 " virt-ls -lR -d guest / | grep '^d ...7'\n"
2324 #: ../cat/virt-ls.pod:49
2325 msgid "List all Unix domain sockets in a Linux virtual machine:"
2329 #: ../cat/virt-ls.pod:51
2332 " virt-ls -lR -d guest / | grep '^s'\n"
2337 #: ../cat/virt-ls.pod:53
2338 msgid "List all regular files with filenames ending in '.png':"
2342 #: ../cat/virt-ls.pod:55
2345 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
2350 #: ../cat/virt-ls.pod:57
2351 msgid "To display files larger than 10MB in home directories:"
2355 #: ../cat/virt-ls.pod:59
2358 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
2363 #: ../cat/virt-ls.pod:61
2364 msgid "Find everything modified in the last 7 days:"
2368 #: ../cat/virt-ls.pod:63
2371 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
2376 #: ../cat/virt-ls.pod:65
2377 msgid "Find regular files modified in the last 24 hours:"
2381 #: ../cat/virt-ls.pod:67
2384 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2389 #: ../cat/virt-ls.pod:69
2390 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2394 #: ../cat/virt-ls.pod:71
2396 "Find the differences between files in a guest and an earlier snapshot of the "
2401 #: ../cat/virt-ls.pod:74
2404 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2405 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2406 " diff -u old new | less\n"
2411 #: ../cat/virt-ls.pod:78
2413 "The commands above won't find files where the content has changed but the "
2414 "metadata (eg. file size and modification date) is the same. To do that, you "
2415 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
2416 "checksum> can be quite slow since it has to read and compute a checksum of "
2417 "every regular file in the virtual machine."
2421 #: ../cat/virt-ls.pod:84
2422 msgid "OUTPUT MODES"
2426 #: ../cat/virt-ls.pod:86
2428 "C<virt-ls> has four output modes, controlled by different combinations of "
2429 "the I<-l> and I<-R> options."
2433 #: ../cat/virt-ls.pod:89
2434 msgid "SIMPLE LISTING"
2438 #: ../cat/virt-ls.pod:91
2439 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2443 #: ../cat/virt-ls.pod:93
2446 " $ virt-ls -d guest /\n"
2454 #: ../cat/virt-ls.pod:98
2455 msgid "LONG LISTING"
2459 #: ../cat/virt-ls.pod:100
2461 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2462 "(more specifically, like the C<guestfs_ll> function)."
2466 #: ../cat/virt-ls.pod:103
2469 " $ virt-ls -l -d guest /\n"
2471 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2472 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2478 #: ../cat/virt-ls.pod:109
2480 "Note that while this is useful for displaying a directory, do not try "
2481 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2486 #: ../cat/virt-ls.pod:113
2487 msgid "RECURSIVE LISTING"
2491 #: ../cat/virt-ls.pod:115
2493 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2494 "and directories recursively:"
2498 #: ../cat/virt-ls.pod:118
2501 " $ virt-ls -R -d guest /tmp\n"
2509 #: ../cat/virt-ls.pod:123
2511 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2512 "converts C<\\0> characters to C<\\n>."
2516 #: ../cat/virt-ls.pod:126
2517 msgid "RECURSIVE LONG LISTING"
2521 #: ../cat/virt-ls.pod:128
2523 "Using I<-lR> options together changes the output to display directories "
2524 "recursively, with file stats, and optionally other features such as "
2525 "checksums and extended attributes."
2529 #: ../cat/virt-ls.pod:132
2531 "Most of the interesting features of C<virt-ls> are only available when using "
2536 #: ../cat/virt-ls.pod:135
2538 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2539 "you cannot use the output in another program (because filenames can contain "
2540 "spaces and other unsafe characters). If the guest was untrusted and someone "
2541 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2542 "on you by creating filenames with embedded newline characters. To B<safely> "
2543 "parse the output in another program, use the I<--csv> (Comma-Separated "
2548 #: ../cat/virt-ls.pod:143
2550 "Note that this output format is completely unrelated to the C<ls -lR> "
2555 #: ../cat/virt-ls.pod:146
2558 " $ virt-ls -lR -d guest /bin\n"
2559 " d 0555 4096 /bin\n"
2560 " - 0755 123 /bin/alsaunmute\n"
2561 " - 0755 28328 /bin/arch\n"
2562 " l 0777 4 /bin/awk -> gawk\n"
2563 " - 0755 27216 /bin/basename\n"
2564 " - 0755 943360 /bin/bash\n"
2570 #: ../cat/virt-ls.pod:155
2571 msgid "These basic fields are always shown:"
2575 #: ../cat/virt-ls.pod:159
2580 #: ../cat/virt-ls.pod:161
2582 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2583 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2584 "link), C<s> (socket) or C<u> (unknown)."
2588 #: ../cat/virt-ls.pod:171
2593 #: ../cat/virt-ls.pod:173
2594 msgid "The Unix permissions, displayed as a 4 digit octal number."
2598 #: ../cat/virt-ls.pod:175
2603 #: ../cat/virt-ls.pod:177
2605 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
2606 "readable> option is given, in which case this is shown as a human-readable "
2611 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4349
2616 #: ../cat/virt-ls.pod:183
2617 msgid "The full path of the file or directory."
2621 #: ../cat/virt-ls.pod:185
2626 #: ../cat/virt-ls.pod:187
2627 msgid "For symbolic links only, the link target."
2631 #: ../cat/virt-ls.pod:191
2633 "In I<-lR> mode, additional command line options enable the display of more "
2638 #: ../cat/virt-ls.pod:194
2640 "With the I<--uids> flag, these additional fields are displayed before the "
2645 #: ../cat/virt-ls.pod:199
2650 #: ../cat/virt-ls.pod:201
2655 #: ../cat/virt-ls.pod:203
2657 "The UID and GID of the owner of the file (displayed numerically). Note "
2658 "these only make sense in the context of a Unix-like guest."
2662 #: ../cat/virt-ls.pod:208
2663 msgid "With the I<--times> flag, these additional fields are displayed:"
2667 #: ../cat/virt-ls.pod:212
2672 #: ../cat/virt-ls.pod:214
2673 msgid "The time of last access."
2677 #: ../cat/virt-ls.pod:216
2682 #: ../cat/virt-ls.pod:218
2683 msgid "The time of last modification."
2687 #: ../cat/virt-ls.pod:220
2692 #: ../cat/virt-ls.pod:222
2693 msgid "The time of last status change."
2697 #: ../cat/virt-ls.pod:226
2699 "The time fields are displayed as string dates and times, unless one of the "
2700 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2704 #: ../cat/virt-ls.pod:229
2705 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2709 #: ../cat/virt-ls.pod:233
2714 #: ../cat/virt-ls.pod:235
2716 "The device containing the file (displayed as major:minor). This may not "
2717 "match devices as known to the guest."
2721 #: ../cat/virt-ls.pod:238
2726 #: ../cat/virt-ls.pod:240
2727 msgid "The inode number."
2731 #: ../cat/virt-ls.pod:242
2736 #: ../cat/virt-ls.pod:244
2737 msgid "The number of hard links."
2741 #: ../cat/virt-ls.pod:246
2746 #: ../cat/virt-ls.pod:248
2748 "For block and char special files, the device (displayed as major:minor)."
2752 #: ../cat/virt-ls.pod:251
2757 #: ../cat/virt-ls.pod:253
2758 msgid "The number of 512 byte blocks allocated to the file."
2762 #: ../cat/virt-ls.pod:257
2764 "With the I<--checksum> flag, the checksum of the file contents is shown "
2765 "(only for regular files). Computing file checksums can take a considerable "
2770 #: ../cat/virt-ls.pod:280
2771 msgid "B<--checksum>"
2775 #: ../cat/virt-ls.pod:282
2776 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2780 #: ../cat/virt-ls.pod:284
2782 "Display checksum over file contents for regular files. With no argument, "
2783 "this defaults to using I<md5>. Using an argument, you can select the "
2784 "checksum type to use."
2788 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2789 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2790 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2792 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2797 #: ../cat/virt-ls.pod:316
2799 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2800 "so you cannot see what you are typing. If you are not worried about Tempest "
2801 "attacks and there is no one else in the room you can specify this flag to "
2802 "see what you are typing."
2806 #: ../cat/virt-ls.pod:321
2807 msgid "B<--extra-stats>"
2811 #: ../cat/virt-ls.pod:323
2812 msgid "Display extra stats."
2816 #: ../cat/virt-ls.pod:339
2819 " virt-ls --format=raw -a disk.img /dir\n"
2824 #: ../cat/virt-ls.pod:343
2827 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2832 #: ../cat/virt-ls.pod:356
2833 msgid "Display file sizes in human-readable format."
2837 #: ../cat/virt-ls.pod:370
2842 #: ../cat/virt-ls.pod:372
2843 msgid "B<--recursive>"
2847 #: ../cat/virt-ls.pod:374
2849 "Select the mode. With neither of these options, C<virt-ls> produces a "
2850 "simple, flat list of the files in the named directory. See L</SIMPLE "
2855 #: ../cat/virt-ls.pod:378
2857 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2862 #: ../cat/virt-ls.pod:381
2864 "C<virt-ls -R> produces a recursive list of files starting at the named "
2865 "directory. See L</RECURSIVE LISTING>."
2869 #: ../cat/virt-ls.pod:384
2871 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2872 "parsed. See L</RECURSIVE LONG LISTING>."
2876 #: ../cat/virt-ls.pod:387
2881 #: ../cat/virt-ls.pod:389
2882 msgid "Display time fields."
2886 #: ../cat/virt-ls.pod:394
2887 msgid "B<--time-days>"
2891 #: ../cat/virt-ls.pod:396
2892 msgid "Display time fields as days before now (negative if in the future)."
2896 #: ../cat/virt-ls.pod:398
2898 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2899 "of the file is between 0 and 86399 seconds."
2903 #: ../cat/virt-ls.pod:404
2904 msgid "B<--time-relative>"
2908 #: ../cat/virt-ls.pod:406
2909 msgid "Display time fields as seconds before now (negative if in the future)."
2913 #: ../cat/virt-ls.pod:411
2918 #: ../cat/virt-ls.pod:413
2919 msgid "Display time fields as seconds since the Unix epoch."
2923 #: ../cat/virt-ls.pod:418
2928 #: ../cat/virt-ls.pod:420
2929 msgid "Display UID and GID fields."
2933 #: ../cat/virt-ls.pod:445
2934 msgid "Previous versions of virt-ls allowed you to write either:"
2938 #: ../cat/virt-ls.pod:447
2941 " virt-ls disk.img [disk.img ...] /dir\n"
2946 #: ../cat/virt-ls.pod:451
2949 " virt-ls guestname /dir\n"
2954 #: ../cat/virt-ls.pod:497
2956 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2957 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2958 "L<http://libguestfs.org/>."
2962 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2963 #: ../rescue/virt-rescue.pod:302
2964 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2968 #: ../clone/virt-sysprep.pod:5
2970 "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2974 #: ../clone/virt-sysprep.pod:9
2977 " virt-sysprep [--options] -d domname\n"
2982 #: ../clone/virt-sysprep.pod:11
2985 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2990 #: ../clone/virt-sysprep.pod:15
2992 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2993 "can be made from it. Steps in this process include removing SSH host keys, "
2994 "removing persistent network MAC configuration, and removing user accounts. "
2995 "Each step can be enabled or disabled as required."
2999 #: ../clone/virt-sysprep.pod:21
3001 "Virt-sysprep is a simple shell script, allowing easy inspection or "
3002 "customization by the system administrator."
3006 #: ../clone/virt-sysprep.pod:24
3008 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
3009 "be shut down. If you want to preserve the existing contents of the guest, "
3010 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> below."
3014 #: ../clone/virt-sysprep.pod:29
3016 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
3017 "recommend that you don't. The time you might want to run it as root is when "
3018 "you need root in order to access the disk image, but even in this case it "
3019 "would be better to change the permissions on the disk image to be writable "
3020 "as the non-root user running virt-sysprep."
3024 #: ../clone/virt-sysprep.pod:35
3026 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
3027 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
3028 "machines in preparation for cloning them. Having said that, virt-sysprep "
3029 "does I<not> currently work on Microsoft Windows guests. We plan to support "
3030 "Windows sysprepping in a future version, and we already have code to do it."
3034 #: ../clone/virt-sysprep.pod:76
3035 msgid "B<--enable=...>"
3039 #: ../clone/virt-sysprep.pod:78
3041 "Choose which sysprep operations to perform. Give a comma-separated list of "
3042 "operations, for example:"
3046 #: ../clone/virt-sysprep.pod:81
3049 " --enable=ssh-hostkeys,udev-persistent-net\n"
3054 #: ../clone/virt-sysprep.pod:83
3056 "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
3060 #: ../clone/virt-sysprep.pod:85
3062 "If the I<--enable> option is not given, then we default to trying all "
3063 "possible sysprep operations. But some sysprep operations are skipped for "
3068 #: ../clone/virt-sysprep.pod:89
3070 "Use I<--list-operations> to list operations supported by a particular "
3071 "version of virt-sysprep."
3075 #: ../clone/virt-sysprep.pod:92
3077 "See L</OPERATIONS> below for a list and an explanation of each operation."
3081 #: ../clone/virt-sysprep.pod:106
3084 " virt-sysprep --format=raw -a disk.img\n"
3089 #: ../clone/virt-sysprep.pod:110
3092 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
3097 #: ../clone/virt-sysprep.pod:119
3098 msgid "B<--hostname> newhostname"
3102 #: ../clone/virt-sysprep.pod:121
3104 "Change the hostname. See the L</hostname> operation below. If not given, "
3105 "defaults to C<localhost.localdomain>."
3109 #: ../clone/virt-sysprep.pod:124
3110 msgid "B<--list-operations>"
3114 #: ../clone/virt-sysprep.pod:126
3115 msgid "List the operations supported by the virt-sysprep program."
3119 #: ../clone/virt-sysprep.pod:128
3120 msgid "B<--selinux-relabel>"
3124 #: ../clone/virt-sysprep.pod:130
3125 msgid "B<--no-selinux-relabel>"
3129 #: ../clone/virt-sysprep.pod:132
3131 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
3132 "I<--no-selinux-relabel> disables relabelling."
3136 #: ../clone/virt-sysprep.pod:135
3138 "The default is to try to detect if SELinux relabelling is required. See L</"
3139 "SELINUX RELABELLING> below for more details."
3143 #: ../clone/virt-sysprep.pod:156
3148 #: ../clone/virt-sysprep.pod:158
3150 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
3151 "enabled>, although some are skipped depending on the type of guest."
3155 #: ../clone/virt-sysprep.pod:162
3157 "Operations can be individually enabled using the I<--enable> option. Use a "
3158 "comma-separated list, for example:"
3162 #: ../clone/virt-sysprep.pod:165
3165 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
3170 #: ../clone/virt-sysprep.pod:167
3172 "To list the operations supported by the current version of virt-sysprep, use "
3173 "I<--list-operations>."
3177 #: ../clone/virt-sysprep.pod:170
3179 "Future versions of virt-sysprep may add more operations. If you are using "
3180 "virt-sysprep and want predictable behaviour, specify only the operations "
3181 "that you want to have enabled."
3185 #: ../clone/virt-sysprep.pod:174
3190 #: ../clone/virt-sysprep.pod:176
3191 msgid "Remove user at-jobs and cron-jobs."
3195 #: ../clone/virt-sysprep.pod:178
3196 msgid "dhcp-client-state"
3200 #: ../clone/virt-sysprep.pod:180
3201 msgid "Remove DHCP client leases."
3205 #: ../clone/virt-sysprep.pod:182
3206 msgid "dhcp-server-state"
3210 #: ../clone/virt-sysprep.pod:184
3211 msgid "Remove DHCP server leases."
3215 #: ../clone/virt-sysprep.pod:186
3220 #: ../clone/virt-sysprep.pod:188
3222 "Changes the hostname of the guest to the value given in the I<--hostname> "
3227 #: ../clone/virt-sysprep.pod:191
3229 "If the I<--hostname> parameter is not given, then the hostname is changed to "
3230 "C<localhost.localdomain>."
3234 #: ../clone/virt-sysprep.pod:194
3239 #: ../clone/virt-sysprep.pod:196
3240 msgid "Remove many log files."
3244 #: ../clone/virt-sysprep.pod:198
3249 #: ../clone/virt-sysprep.pod:200
3250 msgid "Remove email from the local mail spool directory."
3254 #: ../clone/virt-sysprep.pod:202
3259 #: ../clone/virt-sysprep.pod:204
3261 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
3262 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
3266 #: ../clone/virt-sysprep.pod:207
3271 #: ../clone/virt-sysprep.pod:209
3273 "Write some random bytes from the host into the random seed file of the guest."
3277 #: ../clone/virt-sysprep.pod:212
3278 msgid "See L</RANDOM SEED> below."
3282 #: ../clone/virt-sysprep.pod:214
3283 msgid "rhn-systemid"
3287 #: ../clone/virt-sysprep.pod:216
3288 msgid "Remove the RHN system ID."
3292 #: ../clone/virt-sysprep.pod:218
3297 #: ../clone/virt-sysprep.pod:220
3298 msgid "Remove the Smolt hardware UUID."
3302 #: ../clone/virt-sysprep.pod:222
3303 msgid "ssh-hostkeys"
3307 #: ../clone/virt-sysprep.pod:224
3308 msgid "Remove the SSH host keys in the guest."
3312 #: ../clone/virt-sysprep.pod:226
3314 "The SSH host keys are regenerated (differently) next time the guest is "
3319 #: ../clone/virt-sysprep.pod:229
3321 "If, after cloning, the guest gets the same IP address, ssh will give you a "
3322 "stark warning about the host key changing:"
3326 #: ../clone/virt-sysprep.pod:232
3329 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3330 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
3331 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3332 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
3337 #: ../clone/virt-sysprep.pod:237
3338 msgid "udev-persistent-net"
3342 #: ../clone/virt-sysprep.pod:239
3344 "Remove udev persistent net rules which map the guest's existing MAC address "
3345 "to a fixed ethernet device (eg. eth0)."
3349 #: ../clone/virt-sysprep.pod:242
3351 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
3352 "address occupies the old name (eg. eth0), this means the fresh MAC address "
3353 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
3354 "Erasing the udev persistent net rules avoids this."
3358 #: ../clone/virt-sysprep.pod:247
3363 #: ../clone/virt-sysprep.pod:249
3364 msgid "Remove the utmp file."
3368 #: ../clone/virt-sysprep.pod:251
3370 "This records who is currently logged in on a machine. In modern Linux "
3371 "distros it is stored in a ramdisk and hence not part of the virtual "
3372 "machine's disk, but it was stored on disk in older distros."
3376 #: ../clone/virt-sysprep.pod:255
3381 #: ../clone/virt-sysprep.pod:257
3382 msgid "Remove the yum UUID."
3386 #: ../clone/virt-sysprep.pod:259
3388 "Yum creates a fresh UUID the next time it runs when it notices that the "
3389 "original UUID has been erased."
3393 #: ../clone/virt-sysprep.pod:262
3394 msgid "COPYING AND CLONING"
3398 #: ../clone/virt-sysprep.pod:264
3400 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3401 "prepare a template from which guests can be cloned. There are many "
3402 "different ways to achieve this using the virt tools, and this section is "
3403 "just an introduction."
3407 #: ../clone/virt-sysprep.pod:269
3408 msgid "A virtual machine (when switched off) consists of two parts:"
3412 #: ../clone/virt-sysprep.pod:273
3413 msgid "I<configuration>"
3417 #: ../clone/virt-sysprep.pod:275
3419 "The configuration or description of the guest. eg. The libvirt XML (see "
3420 "C<virsh dumpxml>), the running configuration of the guest, or another "
3421 "external format like OVF."
3425 #: ../clone/virt-sysprep.pod:279
3426 msgid "Some configuration items that might need to be changed:"
3430 #: ../clone/virt-sysprep.pod:285
3435 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3440 #: ../clone/virt-sysprep.pod:293
3441 msgid "path to block device(s)"
3445 #: ../clone/virt-sysprep.pod:297
3446 msgid "network card MAC address"
3450 #: ../clone/virt-sysprep.pod:301
3451 msgid "I<block device(s)>"
3455 #: ../clone/virt-sysprep.pod:303
3457 "One or more hard disk images, themselves containing files, directories, "
3458 "applications, kernels, configuration, etc."
3462 #: ../clone/virt-sysprep.pod:306
3463 msgid "Some things inside the block devices that might need to be changed:"
3467 #: ../clone/virt-sysprep.pod:312
3468 msgid "hostname and other net configuration"
3472 #: ../clone/virt-sysprep.pod:320
3473 msgid "SSH host keys"
3477 #: ../clone/virt-sysprep.pod:324
3478 msgid "Windows unique security ID (SID)"
3482 #: ../clone/virt-sysprep.pod:328
3483 msgid "Puppet registration"
3487 #: ../clone/virt-sysprep.pod:334
3488 msgid "COPYING THE BLOCK DEVICE"
3492 #: ../clone/virt-sysprep.pod:336
3494 "Starting with an original guest, you probably wish to copy the guest block "
3495 "device and its configuration to make a template. Then once you are happy "
3496 "with the template, you will want to make many clones from it."
3500 #: ../clone/virt-sysprep.pod:341
3506 " original guest --------> template ---------->\n"
3507 " \\------> cloned\n"
3508 " \\-----> guests\n"
3514 #: ../clone/virt-sysprep.pod:349
3516 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3521 #: ../clone/virt-sysprep.pod:352
3525 " original guest --------> template ---------->\n"
3526 " \\------> cloned\n"
3527 " \\-----> guests\n"
3533 #: ../clone/virt-sysprep.pod:358
3534 msgid "There are some smarter (and faster) ways too:"
3538 #: ../clone/virt-sysprep.pod:364
3542 " template ---------->\n"
3543 " \\------> cloned\n"
3544 " \\-----> guests\n"
3550 #: ../clone/virt-sysprep.pod:370
3552 "Use the block device as a backing file and create a snapshot on top for each "
3553 "guest. The advantage is that you don't need to copy the block device (very "
3554 "fast) and only changes are stored (less storage required)."
3558 #: ../clone/virt-sysprep.pod:375
3560 "Note that writing to the backing file once you have created guests on top of "
3561 "it is not possible: you will corrupt the guests."
3565 #: ../clone/virt-sysprep.pod:378
3567 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 -"
3568 "o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3569 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3570 "also create cheap snapshots from files or LUNs."
3574 #: ../clone/virt-sysprep.pod:386
3575 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3579 #: ../clone/virt-sysprep.pod:390
3580 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3584 #: ../clone/virt-sysprep.pod:394
3589 #: ../clone/virt-sysprep.pod:396
3591 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3592 "and/or modify the external libvirt configuration of a guest. It will reset "
3593 "the name, UUID and MAC address of the guest in the libvirt XML."
3597 #: ../clone/virt-sysprep.pod:401
3599 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3600 "image. This was the original motivation to write virt-sysprep."
3604 #: ../clone/virt-sysprep.pod:404
3609 #: ../clone/virt-sysprep.pod:406
3613 " original guest --------> template\n"
3618 #: ../clone/virt-sysprep.pod:409
3620 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3621 "it easier to compress and/or faster to copy."
3625 #: ../clone/virt-sysprep.pod:412
3627 "Notice that since virt-sparsify also copies the image, you can use it to "
3628 "make the initial copy (instead of C<dd>)."
3632 #: ../clone/virt-sysprep.pod:415
3637 #: ../clone/virt-sysprep.pod:417
3641 " template ---------->\n"
3642 " \\------> cloned\n"
3643 " \\-----> guests\n"
3649 #: ../clone/virt-sysprep.pod:423
3651 "If you want to give people cloned guests, but let them pick the size of the "
3652 "guest themselves (eg. depending on how much they are prepared to pay for "
3653 "disk space), then instead of copying the template, you can run L<virt-resize"
3654 "(1)>. Virt-resize performs a copy and resize, and thus is ideal for cloning "
3655 "guests from a template."
3659 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1164
3664 #: ../clone/virt-sysprep.pod:431
3666 "Although virt-sysprep removes some sensitive information from the guest, it "
3667 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3668 "above, and the implementation of the operations in the shell script. You "
3669 "should also examine the guest afterwards."
3673 #: ../clone/virt-sysprep.pod:436
3675 "Sensitive files are simply removed. The data they contained may still exist "
3676 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3677 "L<virt-sparsify(1)> as one way to remove this content. See also the L<scrub"
3678 "(1)> command to get rid of deleted content in directory entries and inodes."
3682 #: ../clone/virt-sysprep.pod:442
3687 #: ../clone/virt-sysprep.pod:444
3688 msgid "I<(This section applies to Linux guests only)>"
3692 #: ../clone/virt-sysprep.pod:446
3694 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3695 "from the host into the guest's random seed file."
3699 #: ../clone/virt-sysprep.pod:449
3701 "If this is just done once and the guest is cloned from the same template, "
3702 "then each guest will start with the same entropy, and things like SSH host "
3703 "keys and TCP sequence numbers may be predictable."
3707 #: ../clone/virt-sysprep.pod:453
3709 "Therefore you should arrange to add more randomness I<after> cloning from a "
3710 "template too, which can be done by just enabling the C<random-seed> "
3715 #: ../clone/virt-sysprep.pod:457
3718 " cp template.img newguest.img\n"
3719 " virt-sysprep --enable=random-seed -a newguest.img\n"
3724 #: ../clone/virt-sysprep.pod:460
3725 msgid "SELINUX RELABELLING"
3729 #: ../clone/virt-sysprep.pod:462
3730 msgid "I<(This section applies to Linux guests using SELinux only)>"
3734 #: ../clone/virt-sysprep.pod:464
3736 "If any new files are created by virt-sysprep, then virt-sysprep touches C</."
3737 "autorelabel> so that these will be correctly labelled by SELinux the next "
3738 "time the guest is booted. This process interrupts boot and can take some "
3743 #: ../clone/virt-sysprep.pod:469
3745 "You can force relabelling for all guests by supplying the I<--selinux-"
3750 #: ../clone/virt-sysprep.pod:472
3752 "You can disable relabelling entirely by supplying the I<--no-selinux-"
3757 #: ../clone/virt-sysprep.pod:484
3758 msgid "This program returns 0 on success, or 1 if there was an error."
3762 #: ../clone/virt-sysprep.pod:488
3764 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, L<virt-"
3765 "resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, L<qemu-img(1)"
3766 ">, L<scrub(1)>, L<http://libguestfs.org/>, L<http://libvirt.org/>."
3770 #: ../df/virt-df.pod:5
3771 msgid "virt-df - Display free space on virtual filesystems"
3775 #: ../df/virt-df.pod:9
3778 " virt-df [--options]\n"
3783 #: ../df/virt-df.pod:11
3786 " virt-df [--options] -d domname\n"
3791 #: ../df/virt-df.pod:13
3794 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3799 #: ../df/virt-df.pod:17
3802 " virt-df [--options] domname\n"
3807 #: ../df/virt-df.pod:19
3810 " virt-df [--options] disk.img [disk.img ...]\n"
3815 #: ../df/virt-df.pod:23
3817 "C<virt-df> is a command line tool to display free space on virtual machine "
3818 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3819 "allocated to a virtual machine, but can look inside disk images to see how "
3820 "much space is really being used."
3824 #: ../df/virt-df.pod:28
3826 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3827 "to get a list of all active and inactive guests, and performs a C<df>-type "
3828 "operation on each one in turn, printing out the results."
3832 #: ../df/virt-df.pod:32
3834 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
3835 "type operation on either the single named libvirt domain, or on the disk "
3836 "image(s) listed on the command line (which must all belong to a single VM). "
3837 "In this mode (with arguments), C<virt-df> will I<only work for a single "
3838 "guest>. If you want to run on multiple guests, then you have to invoke "
3839 "C<virt-df> multiple times."
3843 #: ../df/virt-df.pod:39
3845 "Use the I<--csv> option to get a format which can be easily parsed by other "
3846 "programs. Other options are similar to the standard L<df(1)> command."
3850 #: ../df/virt-df.pod:45
3852 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3853 "output human-readable:"
3857 #: ../df/virt-df.pod:48
3860 " # virt-df -d F14x64 -h\n"
3861 " Filesystem Size Used Available Use%\n"
3862 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3863 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3868 #: ../df/virt-df.pod:53
3869 msgid "Show disk usage for a disk image file called C<test.img>:"
3873 #: ../df/virt-df.pod:55
3876 " $ virt-df -a test1.img\n"
3877 " Filesystem 1K-blocks Used Available Use%\n"
3878 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3883 #: ../df/virt-df.pod:112
3886 " virt-df --format=raw -a disk.img\n"
3891 #: ../df/virt-df.pod:116
3894 " virt-df --format=raw -a disk.img --format -a another.img\n"
3899 #: ../df/virt-df.pod:129
3900 msgid "Print sizes in human-readable format."
3904 #: ../df/virt-df.pod:131
3905 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3909 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3914 #: ../df/virt-df.pod:135
3919 #: ../df/virt-df.pod:137
3920 msgid "Print inodes instead of blocks."
3924 #: ../df/virt-df.pod:139
3925 msgid "B<--one-per-guest>"
3929 #: ../df/virt-df.pod:141
3931 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3932 "disks from several guests to a single libguestfs appliance."
3936 #: ../df/virt-df.pod:144
3937 msgid "You might use this option in the following circumstances:"
3941 #: ../df/virt-df.pod:150
3943 "If you think an untrusted guest might actively try to exploit the libguestfs "
3944 "appliance kernel, then this prevents one guest from interfering with the "
3945 "stats printed for another guest."
3949 #: ../df/virt-df.pod:156
3951 "If the kernel has a bug which stops it from accessing a filesystem in one "
3952 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3953 "and report stats for further guests."
3957 #: ../df/virt-df.pod:165
3959 "Print UUIDs instead of names. This is useful for following a guest even "
3960 "when the guest is migrated or renamed, or when two guests happen to have the "
3965 #: ../df/virt-df.pod:169
3967 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3968 "images, we still print the disk image name even when this option is "
3973 #: ../df/virt-df.pod:229
3975 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
3980 #: ../edit/virt-edit.pod:5
3981 msgid "virt-edit - Edit a file in a virtual machine"
3985 #: ../edit/virt-edit.pod:9
3988 " virt-edit [--options] -d domname file [file ...]\n"
3993 #: ../edit/virt-edit.pod:11
3996 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
4001 #: ../edit/virt-edit.pod:13
4004 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
4009 #: ../edit/virt-edit.pod:17
4012 " virt-edit domname file\n"
4017 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
4020 " virt-edit disk.img [disk.img ...] file\n"
4025 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
4026 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
4027 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
4028 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
4033 #: ../edit/virt-edit.pod:23
4035 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
4036 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
4037 "doing this, but doesn't catch all cases."
4041 #: ../edit/virt-edit.pod:29
4043 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
4044 "exists in the named virtual machine (or disk image)."
4048 #: ../edit/virt-edit.pod:32
4050 "Multiple filenames can be given, in which case they are each edited in "
4051 "turn. Each filename must be a full path, starting at the root directory "
4052 "(starting with '/')."
4056 #: ../edit/virt-edit.pod:36
4057 msgid "If you want to just view a file, use L<virt-cat(1)>."
4061 #: ../edit/virt-edit.pod:38
4063 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
4064 "USING GUESTFISH> below)."
4068 #: ../edit/virt-edit.pod:41
4070 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
4071 "that and much more."
4075 #: ../edit/virt-edit.pod:46
4076 msgid "Edit the named files interactively:"
4080 #: ../edit/virt-edit.pod:48
4083 " virt-edit -d mydomain /boot/grub/grub.conf\n"
4088 #: ../edit/virt-edit.pod:50
4091 " virt-edit -d mydomain /etc/passwd\n"
4096 #: ../edit/virt-edit.pod:52
4097 msgid "For Windows guests, some Windows paths are understood:"
4101 #: ../edit/virt-edit.pod:54
4104 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
4109 #: ../edit/virt-edit.pod:56
4111 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
4112 "INTERACTIVE EDITING> below). To change the init default level to 5:"
4116 #: ../edit/virt-edit.pod:60
4119 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
4124 #: ../edit/virt-edit.pod:81
4125 msgid "B<-b> extension"
4129 #: ../edit/virt-edit.pod:83
4130 msgid "B<--backup> extension"
4134 #: ../edit/virt-edit.pod:85
4136 "Create a backup of the original file I<in the guest disk image>. The backup "
4137 "has the original filename with C<extension> added."
4141 #: ../edit/virt-edit.pod:88
4143 "Usually the first character of C<extension> would be a dot C<.> so you would "
4148 #: ../edit/virt-edit.pod:91
4151 " virt-edit -b .orig [etc]\n"
4156 #: ../edit/virt-edit.pod:93
4157 msgid "By default, no backup file is made."
4161 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
4162 #: ../fuse/guestmount.pod:105 ../inspector/virt-inspector.pod:74
4163 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
4164 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
4169 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
4170 #: ../fuse/guestmount.pod:107 ../inspector/virt-inspector.pod:76
4171 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
4172 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
4173 msgid "B<--connect URI>"
4177 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
4178 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
4179 #: ../tools/virt-win-reg.pl:135
4181 "If you specify guest block devices directly, then libvirt is not used at all."
4185 #: ../edit/virt-edit.pod:114
4187 "When prompting for keys and passphrases, virt-edit normally turns echoing "
4188 "off so you cannot see what you are typing. If you are not worried about "
4189 "Tempest attacks and there is no one else in the room you can specify this "
4190 "flag to see what you are typing."
4194 #: ../edit/virt-edit.pod:119
4199 #: ../edit/virt-edit.pod:121
4200 msgid "B<--expr> EXPR"
4204 #: ../edit/virt-edit.pod:123
4206 "Instead of launching the external editor, non-interactively apply the Perl "
4207 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
4212 #: ../edit/virt-edit.pod:127
4214 "Be careful to properly quote the expression to prevent it from being altered "
4219 #: ../edit/virt-edit.pod:130
4220 msgid "Note that this option is only available when Perl 5 is installed."
4224 #: ../edit/virt-edit.pod:132
4225 msgid "B<--format> raw|qcow2|..."
4229 #: ../edit/virt-edit.pod:143
4232 " virt-edit --format=raw -a disk.img file\n"
4237 #: ../edit/virt-edit.pod:147
4240 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
4245 #: ../edit/virt-edit.pod:181
4246 msgid "Previous versions of virt-edit allowed you to write either:"
4250 #: ../edit/virt-edit.pod:187
4253 " virt-edit guestname file\n"
4258 #: ../edit/virt-edit.pod:195
4259 msgid "NON-INTERACTIVE EDITING"
4263 #: ../edit/virt-edit.pod:197
4265 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
4266 "administrator can interactively edit the file."
4270 #: ../edit/virt-edit.pod:200
4272 "There are two ways also to use C<virt-edit> from scripts in order to make "
4273 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
4274 "like this, it's less error-prone to write scripts directly using the "
4275 "libguestfs API and Augeas for configuration file editing.)"
4279 #: ../edit/virt-edit.pod:206
4281 "The first method is to temporarily set C<$EDITOR> to any script or program "
4282 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
4283 "update C<tmpfile> in place however it likes."
4287 #: ../edit/virt-edit.pod:210
4289 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
4290 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
4291 "instances of C<foo> with C<bar> in a file:"
4295 #: ../edit/virt-edit.pod:214
4298 " virt-edit -d domname filename -e 's/foo/bar/'\n"
4303 #: ../edit/virt-edit.pod:216
4305 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
4306 "For example to delete root's password you could do:"
4310 #: ../edit/virt-edit.pod:219
4313 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
4318 #: ../edit/virt-edit.pod:221
4320 "What really happens is that the snippet is evaluated as a Perl expression "
4321 "for each line of the file. The line, including the final C<\\n>, is passed "
4322 "in C<$_> and the expression should update C<$_> or leave it unchanged."
4326 #: ../edit/virt-edit.pod:226
4328 "To delete a line, set C<$_> to the empty string. For example, to delete the "
4329 "C<apache> user account from the password file you can do:"
4333 #: ../edit/virt-edit.pod:229
4336 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
4341 #: ../edit/virt-edit.pod:231
4343 "To insert a line, prepend or append it to C<$_>. However appending lines to "
4344 "the end of the file is rather difficult this way since there is no concept "
4345 "of \"last line of the file\" - your expression just doesn't get called "
4346 "again. You might want to use the first method (setting C<$EDITOR>) if you "
4351 #: ../edit/virt-edit.pod:237
4353 "The variable C<$lineno> contains the current line number. As is "
4354 "traditional, the first line in the file is number C<1>."
4358 #: ../edit/virt-edit.pod:240
4360 "The return value from the expression is ignored, but the expression may call "
4361 "C<die> in order to abort the whole program, leaving the original file "
4366 #: ../edit/virt-edit.pod:244
4368 "Remember when matching the end of a line that C<$_> may contain the final C<"
4369 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
4370 "newline then neither of these. Thus to match or substitute some text at the "
4371 "end of a line, use this regular expression:"
4375 #: ../edit/virt-edit.pod:249
4378 " /some text(\\r?\\n)?$/\n"
4383 #: ../edit/virt-edit.pod:251
4385 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
4386 "$_> itself (since that would remove all newlines from the file):"
4390 #: ../edit/virt-edit.pod:255
4393 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4398 #: ../edit/virt-edit.pod:259
4400 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4401 "paths (eg. C<E:\\foo\\bar.txt>)."
4405 #: ../edit/virt-edit.pod:278
4407 "The path is resolved case insensitively to locate the file that should be "
4412 #: ../edit/virt-edit.pod:299
4414 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4415 "C<virt-edit> doesn't work."
4419 #: ../edit/virt-edit.pod:302
4420 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4424 #: ../edit/virt-edit.pod:304
4427 " guestfish --rw -i -d domname edit /file\n"
4432 #: ../edit/virt-edit.pod:306
4434 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4439 #: ../edit/virt-edit.pod:309
4441 "The command above uses libguestfs's guest inspection feature and so does not "
4442 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4443 "disk images that don't contain guests. To edit a file on a disk image "
4448 #: ../edit/virt-edit.pod:314
4451 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4456 #: ../edit/virt-edit.pod:316
4458 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4459 "the disk image to edit, and C</file> is the full path to the file."
4463 #: ../edit/virt-edit.pod:320
4465 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4466 "C<write> or C<upload> instead:"
4470 #: ../edit/virt-edit.pod:323
4473 " guestfish --rw -i -d domname touch /newfile\n"
4478 #: ../edit/virt-edit.pod:325
4481 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4486 #: ../edit/virt-edit.pod:327
4489 " guestfish --rw -i -d domname upload localfile /newfile\n"
4494 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119
4495 #: ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232
4496 #: ../src/guestfs.pod:3209 ../test-tool/libguestfs-test-tool.pod:95
4497 msgid "ENVIRONMENT VARIABLES"
4501 #: ../edit/virt-edit.pod:333
4506 #: ../edit/virt-edit.pod:335
4508 "If set, this string is used as the editor. It may contain arguments, eg. C<"
4513 #: ../edit/virt-edit.pod:338
4514 msgid "If not set, C<vi> is used."
4518 #: ../edit/virt-edit.pod:356
4520 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
4521 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
4522 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4526 #: ../erlang/examples/guestfs-erlang.pod:5
4527 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4531 #: ../erlang/examples/guestfs-erlang.pod:9
4534 " {ok, G} = guestfs:create(),\n"
4535 " ok = guestfs:add_drive_opts(G, Disk,\n"
4536 " [{format, \"raw\"}, {readonly, true}]),\n"
4537 " ok = guestfs:launch(G),\n"
4538 " [Device] = guestfs:list_devices(G),\n"
4539 " ok = guestfs:close(G).\n"
4544 #: ../erlang/examples/guestfs-erlang.pod:18
4546 "This manual page documents how to call libguestfs from the Erlang "
4547 "programming language. This page just documents the differences from the C "
4548 "API and gives some examples. If you are not familiar with using libguestfs, "
4549 "you also need to read L<guestfs(3)>."
4553 #: ../erlang/examples/guestfs-erlang.pod:23
4554 msgid "OPENING AND CLOSING THE HANDLE"
4558 #: ../erlang/examples/guestfs-erlang.pod:25
4560 "The Erlang bindings are implemented using an external program called C<erl-"
4561 "guestfs>. This program must be on the current PATH, or else you should "
4562 "specify the full path to the program:"
4566 #: ../erlang/examples/guestfs-erlang.pod:29
4569 " {ok, G} = guestfs:create().\n"
4574 #: ../erlang/examples/guestfs-erlang.pod:31
4577 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4582 #: ../erlang/examples/guestfs-erlang.pod:33
4583 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4587 #: ../erlang/examples/guestfs-erlang.pod:36
4588 msgid "To close the handle:"
4592 #: ../erlang/examples/guestfs-erlang.pod:38
4595 " ok = guestfs:close(G).\n"
4600 #: ../erlang/examples/guestfs-erlang.pod:40
4601 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4605 #: ../erlang/examples/guestfs-erlang.pod:42
4607 "For functions that take optional arguments, the first arguments are the non-"
4608 "optional ones. The last argument is a list of tuples supplying the "
4609 "remaining optional arguments."
4613 #: ../erlang/examples/guestfs-erlang.pod:46
4616 " ok = guestfs:add_drive_opts(G, Disk,\n"
4617 " [{format, \"raw\"}, {readonly, true}]).\n"
4622 #: ../erlang/examples/guestfs-erlang.pod:49
4623 msgid "If the last argument would be an empty list, you can also omit it:"
4627 #: ../erlang/examples/guestfs-erlang.pod:51
4630 " ok = guestfs:add_drive_opts(G, Disk).\n"
4635 #: ../erlang/examples/guestfs-erlang.pod:53
4636 msgid "RETURN VALUES AND ERRORS"
4640 #: ../erlang/examples/guestfs-erlang.pod:55
4642 "On success, most functions return a C<Result> term (which could be a list, "
4643 "string, tuple etc.). If there is nothing for the function to return, then "
4644 "the atom C<ok> is returned."
4648 #: ../erlang/examples/guestfs-erlang.pod:59
4649 msgid "On error, you would see one of the following tuples:"
4653 #: ../erlang/examples/guestfs-erlang.pod:63
4654 msgid "C<{error, Msg, Errno}>"
4658 #: ../erlang/examples/guestfs-erlang.pod:65
4659 msgid "This indicates an ordinary error from the function."
4663 #: ../erlang/examples/guestfs-erlang.pod:67
4665 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4670 #: ../erlang/examples/guestfs-erlang.pod:70
4671 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4675 #: ../erlang/examples/guestfs-erlang.pod:72
4676 msgid "C<{unknown, Function}>"
4680 #: ../erlang/examples/guestfs-erlang.pod:74
4682 "This indicates that the function you called is not known. Generally this "
4683 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4684 "which you should not do."
4688 #: ../erlang/examples/guestfs-erlang.pod:78
4689 msgid "C<Function> is the name of the unknown function."
4693 #: ../erlang/examples/guestfs-erlang.pod:80
4694 msgid "C<{unknownarg, Arg}>"
4698 #: ../erlang/examples/guestfs-erlang.pod:82
4700 "This indicates that you called a function with optional arguments, with an "
4701 "unknown argument name."
4705 #: ../erlang/examples/guestfs-erlang.pod:85
4706 msgid "C<Arg> is the name of the unknown argument."
4710 #: ../erlang/examples/guestfs-erlang.pod:89
4711 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
4712 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
4713 #: ../python/examples/guestfs-python.pod:34
4714 #: ../ruby/examples/guestfs-ruby.pod:28
4715 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4719 #: ../erlang/examples/guestfs-erlang.pod:91
4720 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
4721 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
4722 #: ../python/examples/guestfs-python.pod:36
4723 #: ../ruby/examples/guestfs-ruby.pod:30
4728 #: ../erlang/examples/guestfs-erlang.pod:93
4729 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
4730 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
4731 #: ../python/examples/guestfs-python.pod:38
4732 #: ../ruby/examples/guestfs-ruby.pod:32
4733 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4737 #: ../erlang/examples/guestfs-erlang.pod:95
4738 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
4739 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
4740 #: ../python/examples/guestfs-python.pod:40
4741 #: ../ruby/examples/guestfs-ruby.pod:34
4746 #: ../erlang/examples/guestfs-erlang.pod:99
4748 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4749 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4750 "L<guestfs-ruby(3)>, L<http://www.erlang.org/>. L<http://libguestfs.org/>."
4754 #: ../erlang/examples/guestfs-erlang.pod:110
4755 #: ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397
4756 #: ../fish/guestfish.pod:1296 ../fish/virt-copy-in.pod:60
4757 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
4758 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:328
4759 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58
4760 #: ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52
4761 #: ../python/examples/guestfs-python.pod:54
4762 #: ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3348
4763 #: ../test-tool/libguestfs-test-tool.pod:106
4768 #: ../erlang/examples/guestfs-erlang.pod:112
4769 #: ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399
4770 #: ../fish/guestfish.pod:1298 ../fish/virt-copy-in.pod:62
4771 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
4772 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:330
4773 #: ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93
4774 #: ../perl/examples/guestfs-perl.pod:54
4775 #: ../python/examples/guestfs-python.pod:56
4776 #: ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3350
4777 #: ../test-tool/libguestfs-test-tool.pod:108
4778 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4782 #: ../erlang/examples/guestfs-erlang.pod:116
4783 #: ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4784 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4788 #: ../erlang/examples/guestfs-erlang.pod:118
4789 #: ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405
4790 #: ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99
4791 #: ../perl/examples/guestfs-perl.pod:60
4792 #: ../python/examples/guestfs-python.pod:62
4793 #: ../ruby/examples/guestfs-ruby.pod:56
4795 "The examples in this manual page may be freely copied, modified and "
4796 "distributed without any restrictions."
4800 #: ../erlang/examples/guestfs-erlang.pod:121
4801 #: ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408
4802 #: ../java/examples/guestfs-java.pod:69
4803 #: ../ocaml/examples/guestfs-ocaml.pod:102
4804 #: ../perl/examples/guestfs-perl.pod:63
4805 #: ../python/examples/guestfs-python.pod:65
4806 #: ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3357
4808 "This library is free software; you can redistribute it and/or modify it "
4809 "under the terms of the GNU Lesser General Public License as published by the "
4810 "Free Software Foundation; either version 2 of the License, or (at your "
4811 "option) any later version."
4815 #: ../erlang/examples/guestfs-erlang.pod:126
4816 #: ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413
4817 #: ../java/examples/guestfs-java.pod:74
4818 #: ../ocaml/examples/guestfs-ocaml.pod:107
4819 #: ../perl/examples/guestfs-perl.pod:68
4820 #: ../python/examples/guestfs-python.pod:70
4821 #: ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3362
4823 "This library is distributed in the hope that it will be useful, but WITHOUT "
4824 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4825 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4830 #: ../erlang/examples/guestfs-erlang.pod:131
4831 #: ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418
4832 #: ../java/examples/guestfs-java.pod:79
4833 #: ../ocaml/examples/guestfs-ocaml.pod:112
4834 #: ../perl/examples/guestfs-perl.pod:73
4835 #: ../python/examples/guestfs-python.pod:75
4836 #: ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3367
4838 "You should have received a copy of the GNU Lesser General Public License "
4839 "along with this library; if not, write to the Free Software Foundation, "
4840 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4844 #: ../examples/guestfs-examples.pod:5
4845 msgid "guestfs-examples - Examples of using libguestfs from C"
4849 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4852 " #include <guestfs.h>\n"
4854 msgstr "#include <guestfs.h>\n"
4857 #: ../examples/guestfs-examples.pod:11
4860 " guestfs_h *g = guestfs_create ();\n"
4861 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4862 " guestfs_launch (g);\n"
4867 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4870 " cc prog.c -o prog -lguestfs\n"
4872 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4875 " cc prog.c -o prog -lguestfs\n"
4877 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4881 #: ../examples/guestfs-examples.pod:21
4883 "This manual page contains examples of calling libguestfs from the C "
4884 "programming language. If you are not familiar with using libguestfs, you "
4885 "also need to read L<guestfs(3)>."
4889 #: ../examples/guestfs-examples.pod:35
4891 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4892 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4893 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4897 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97
4898 #: ../python/examples/guestfs-python.pod:60
4899 #: ../ruby/examples/guestfs-ruby.pod:54
4900 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4904 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4909 #: ../examples/guestfs-recipes.pod:5
4911 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4912 "here. The only way which works for both sorts of output is to just write "
4913 "the URL directly. Do NOT use L<...> for URLs."
4917 #: ../examples/guestfs-recipes.pod:9
4919 "We break with tradition here and don't use ALL CAPS for the section "
4920 "headings, as this makes them much easier to read."
4924 #: ../examples/guestfs-recipes.pod:16
4925 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4929 #: ../examples/guestfs-recipes.pod:20
4931 "This page contains recipes for and links to things you can do using "
4932 "libguestfs, L<guestfish(1)> and the virt tools."
4936 #: ../examples/guestfs-recipes.pod:23
4937 msgid "Audit a virtual machine for setuid files"
4941 #: ../examples/guestfs-recipes.pod:25
4943 "The link below contains a small program which can be used to audit a Linux "
4944 "virtual machine to see what setuid and setgid files it contains."
4948 #: ../examples/guestfs-recipes.pod:28
4950 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
4955 #: ../examples/guestfs-recipes.pod:30
4956 msgid "Change the background image in a Windows XP VM"
4960 #: ../examples/guestfs-recipes.pod:32
4962 "The links below explain how to use L<guestfish(1)> to change the background "
4963 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4964 "be substantially different for each version of Windows."
4968 #: ../examples/guestfs-recipes.pod:37
4970 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
4971 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4975 #: ../examples/guestfs-recipes.pod:40
4976 msgid "Cloning a virtual machine (Linux)"
4980 #: ../examples/guestfs-recipes.pod:42
4982 "The guestfish technique described in the link below works well for most "
4983 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4988 #: ../examples/guestfs-recipes.pod:46
4990 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
4995 #: ../examples/guestfs-recipes.pod:48
4997 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
5002 #: ../examples/guestfs-recipes.pod:51
5003 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
5007 #: ../examples/guestfs-recipes.pod:53
5008 msgid "Cloning a virtual machine (Windows)"
5012 #: ../examples/guestfs-recipes.pod:55
5014 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
5015 "straightforward. Currently there is code in the Aeolus Oz project which "
5016 "does this (using libguestfs). As part of our review of the virt-clone tool, "
5017 "we may add sysprepping ability."
5021 #: ../examples/guestfs-recipes.pod:60
5023 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
5024 "list/2011-May/msg00019.html"
5028 #: ../examples/guestfs-recipes.pod:63
5029 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
5033 #: ../examples/guestfs-recipes.pod:65
5034 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
5038 #: ../examples/guestfs-recipes.pod:67
5041 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
5046 #: ../examples/guestfs-recipes.pod:69
5047 msgid "To export just a subdirectory, eg. C</files>, do:"
5051 #: ../examples/guestfs-recipes.pod:71
5054 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
5059 #: ../examples/guestfs-recipes.pod:73
5060 msgid "Create empty disk images"
5064 #: ../examples/guestfs-recipes.pod:75
5066 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
5067 "The useful guide below explains the options available."
5071 #: ../examples/guestfs-recipes.pod:78
5073 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
5078 #: ../examples/guestfs-recipes.pod:80
5079 msgid "Dump raw filesystem content from inside a disk image or VM"
5083 #: ../examples/guestfs-recipes.pod:82
5085 "You can use the L<guestfish(1)> C<download> command to extract the raw "
5086 "filesystem content from any filesystem in a disk image or a VM (even one "
5087 "which is encrypted or buried inside an LV):"
5091 #: ../examples/guestfs-recipes.pod:86
5094 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
5099 #: ../examples/guestfs-recipes.pod:88
5102 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
5107 #: ../examples/guestfs-recipes.pod:90
5108 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
5112 #: ../examples/guestfs-recipes.pod:92
5113 msgid "Edit grub configuration in a VM"
5117 #: ../examples/guestfs-recipes.pod:94
5118 msgid "You can use this to:"
5122 #: ../examples/guestfs-recipes.pod:100
5123 msgid "Fix a virtual machine that does not boot."
5127 #: ../examples/guestfs-recipes.pod:104
5128 msgid "Change which kernel is used to boot the VM."
5132 #: ../examples/guestfs-recipes.pod:108
5133 msgid "Change kernel command line options."
5137 #: ../examples/guestfs-recipes.pod:112
5138 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
5142 #: ../examples/guestfs-recipes.pod:114
5145 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
5150 #: ../examples/guestfs-recipes.pod:116
5152 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
5157 #: ../examples/guestfs-recipes.pod:119
5160 " virt-rescue -d BrokenGuest\n"
5165 #: ../examples/guestfs-recipes.pod:121
5166 msgid "Export any directory from a VM"
5170 #: ../examples/guestfs-recipes.pod:123
5172 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
5176 #: ../examples/guestfs-recipes.pod:126
5179 " virt-copy-out -d Guest /home .\n"
5184 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
5185 #: ../fish/guestfish-actions.pod:1404 ../fish/guestfish-actions.pod:1669
5186 #: ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:18
5187 #: ../src/guestfs-actions.pod:2279 ../src/guestfs-actions.pod:2703
5188 #: ../src/guestfs-actions.pod:3262 ../src/guestfs.pod:1685
5189 #: ../tools/virt-win-reg.pl:717
5194 #: ../examples/guestfs-recipes.pod:134
5196 "The final dot of the command is not a printing error. It means we want to "
5197 "copy out to the current directory."
5201 #: ../examples/guestfs-recipes.pod:139
5202 msgid "This creates a directory called C<home> under the current directory."
5206 #: ../examples/guestfs-recipes.pod:143
5208 "If the guest is a Windows guest then you can use drive letters and "
5209 "backslashes, but you must prefix the path with C<win:> and quote it to "
5210 "protect it from the shell, like this:"
5214 #: ../examples/guestfs-recipes.pod:147
5217 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
5222 #: ../examples/guestfs-recipes.pod:149
5223 msgid "To get the output as a compressed tarball, do:"
5227 #: ../examples/guestfs-recipes.pod:151
5230 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
5235 #: ../examples/guestfs-recipes.pod:153
5237 "Although it sounds tempting, this is usually not a reliable way to get a "
5238 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
5239 "org/FAQ.html#backup"
5243 #: ../examples/guestfs-recipes.pod:157
5244 msgid "Find out which user is using the most space"
5248 #: ../examples/guestfs-recipes.pod:159
5250 "This simple script examines a Linux guest to find out which user is using "
5251 "the most space in their home directory:"
5255 #: ../examples/guestfs-recipes.pod:162
5263 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
5271 #: ../examples/guestfs-recipes.pod:166
5280 #: ../examples/guestfs-recipes.pod:169
5283 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
5288 #: ../examples/guestfs-recipes.pod:171
5291 " for d in $(guestfish --remote ls \"$dir\"); do\n"
5292 " echo -n \"$dir/$d\"\n"
5294 " guestfish --remote du \"$dir/$d\";\n"
5295 " done | sort -nr -k 2\n"
5300 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
5303 " guestfish --remote exit\n"
5308 #: ../examples/guestfs-recipes.pod:179
5309 msgid "Get DHCP address from a VM"
5313 #: ../examples/guestfs-recipes.pod:181
5315 "The link below explains the many different possible techniques for getting "
5316 "the last assigned DHCP address of a virtual machine."
5320 #: ../examples/guestfs-recipes.pod:184
5322 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
5323 "a-virtual-machine-disk-image/#content"
5327 #: ../examples/guestfs-recipes.pod:186
5329 "In the libguestfs source examples directory you will find the latest version "
5330 "of the C<virt-dhcp-address.c> program."
5334 #: ../examples/guestfs-recipes.pod:189
5335 msgid "Get the operating system product name string"
5339 #: ../examples/guestfs-recipes.pod:191
5340 msgid "Save the following script into a file called C<product-name.sh>:"
5344 #: ../examples/guestfs-recipes.pod:193
5349 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5350 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5351 " guestfish --remote inspect-get-product-name \"$root\"\n"
5352 " guestfish --remote exit\n"
5357 #: ../examples/guestfs-recipes.pod:200
5358 msgid "Make the script executable and run it on a named guest:"
5362 #: ../examples/guestfs-recipes.pod:202
5365 " # product-name.sh RHEL60x64\n"
5366 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
5371 #: ../examples/guestfs-recipes.pod:205
5373 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
5374 "C<xpath> command line tool or from your favourite programming language:"
5378 #: ../examples/guestfs-recipes.pod:209
5381 " # virt-inspector RHEL60x64 > xml\n"
5382 " # xpath '//product_name' < xml\n"
5385 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
5390 #: ../examples/guestfs-recipes.pod:215
5391 msgid "Get the default boot kernel for a Linux VM"
5395 #: ../examples/guestfs-recipes.pod:217
5397 "The link below contains a program to print the default boot kernel for a "
5402 #: ../examples/guestfs-recipes.pod:220
5404 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
5405 "kernel-for-a-vm/#content"
5409 #: ../examples/guestfs-recipes.pod:222
5411 "It uses Augeas, and the technique is generally applicable for many different "
5416 #: ../examples/guestfs-recipes.pod:229
5417 msgid "listing the user accounts in the guest"
5421 #: ../examples/guestfs-recipes.pod:233
5422 msgid "what repositories is it configured to use"
5426 #: ../examples/guestfs-recipes.pod:237
5427 msgid "what NTP servers does it connect to"
5431 #: ../examples/guestfs-recipes.pod:241
5432 msgid "what were the boot messages last time it booted"
5436 #: ../examples/guestfs-recipes.pod:245
5437 msgid "listing who was logged in recently"
5441 #: ../examples/guestfs-recipes.pod:249
5442 msgid "http://augeas.net/"
5446 #: ../examples/guestfs-recipes.pod:251
5447 msgid "Install RPMs in a guest"
5451 #: ../examples/guestfs-recipes.pod:253
5453 "The link below contains a method to install RPMs in a guest. In fact the "
5454 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
5455 "installs them next time the guest is booted. You could use this technique "
5456 "to install vital security updates in an offline guest."
5460 #: ../examples/guestfs-recipes.pod:259
5462 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
5466 #: ../examples/guestfs-recipes.pod:261
5467 msgid "List applications installed in a VM"
5471 #: ../examples/guestfs-recipes.pod:263
5472 msgid "Save the following to a file C<list-apps.sh>:"
5476 #: ../examples/guestfs-recipes.pod:265
5481 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5482 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5483 " guestfish --remote inspect-list-applications \"$root\"\n"
5484 " guestfish --remote exit\n"
5489 #: ../examples/guestfs-recipes.pod:272
5491 "Make the file executable and then you can run it on any named virtual "
5496 #: ../examples/guestfs-recipes.pod:275
5499 " # list-apps.sh WinGuest\n"
5501 " app_name: Mozilla Firefox (3.6.12)\n"
5502 " app_display_name: Mozilla Firefox (3.6.12)\n"
5504 " app_version: 3.6.12 (en-GB)\n"
5506 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5507 " app_trans_path:\n"
5508 " app_publisher: Mozilla\n"
5509 " app_url: http://www.mozilla.com/en-GB/\n"
5510 " app_source_package:\n"
5512 " app_description: Mozilla Firefox\n"
5515 " app_name: VLC media player\n"
5516 " app_display_name: VLC media player 1.1.5\n"
5518 " app_version: 1.1.5\n"
5520 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5521 " app_trans_path:\n"
5522 " app_publisher: VideoLAN\n"
5523 " app_url: http://www.videolan.org/\n"
5524 " app_source_package:\n"
5526 " app_description:\n"
5532 #: ../examples/guestfs-recipes.pod:305
5534 "If you want to run the script on disk images (instead of libvirt virtual "
5535 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
5540 #: ../examples/guestfs-recipes.pod:309
5541 msgid "List files and directories in a VM"
5545 #: ../examples/guestfs-recipes.pod:311
5546 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5550 #: ../examples/guestfs-recipes.pod:313
5553 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5558 #: ../examples/guestfs-recipes.pod:315
5559 msgid "List services in a Windows VM"
5563 #: ../examples/guestfs-recipes.pod:317
5565 "The link below contains a script that can be used to list out the services "
5566 "from a Windows VM, and whether those services run at boot time or are loaded "
5571 #: ../examples/guestfs-recipes.pod:321
5573 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
5578 #: ../examples/guestfs-recipes.pod:323
5579 msgid "Make a disk image sparse"
5583 #: ../examples/guestfs-recipes.pod:325
5585 "The link below contains some guides for making a disk image sparse (or "
5586 "reintroducing sparseness)."
5590 #: ../examples/guestfs-recipes.pod:328
5592 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5596 #: ../examples/guestfs-recipes.pod:330
5597 msgid "Monitor disk usage over time"
5601 #: ../examples/guestfs-recipes.pod:332
5603 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5604 "The link below contains a guide."
5608 #: ../examples/guestfs-recipes.pod:335
5609 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5613 #: ../examples/guestfs-recipes.pod:337
5614 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5618 #: ../examples/guestfs-recipes.pod:339
5620 "L<guestfish(1)> plus the tools described in the link below can be used to "
5621 "read out the Windows Event Log from any virtual machine running Windows "
5622 "Vista or a later version."
5626 #: ../examples/guestfs-recipes.pod:343
5628 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
5629 "guestfish/#content"
5633 #: ../examples/guestfs-recipes.pod:345
5634 msgid "Remove root password (Linux)"
5638 #: ../examples/guestfs-recipes.pod:347
5640 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5641 "files. One use is to remove the root password from a Linux guest:"
5645 #: ../examples/guestfs-recipes.pod:350
5648 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5653 #: ../examples/guestfs-recipes.pod:352
5654 msgid "Remove Administrator password (Windows)"
5658 #: ../examples/guestfs-recipes.pod:354
5660 "The link below contains one technique for removing the Administrator "
5661 "password from a Windows VM, or to be more precise, it gives you a command "
5662 "prompt the next time you log in which you can use to bypass any security:"
5666 #: ../examples/guestfs-recipes.pod:359
5668 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
5669 "administrator-password-with-guestfish/"
5673 #: ../examples/guestfs-recipes.pod:361
5674 msgid "Unpack a live CD"
5678 #: ../examples/guestfs-recipes.pod:363
5680 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5681 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5682 "layers, as outlined in the guide below."
5686 #: ../examples/guestfs-recipes.pod:367
5688 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
5693 #: ../examples/guestfs-recipes.pod:369
5694 msgid "Uploading and downloading files"
5698 #: ../examples/guestfs-recipes.pod:371
5700 "The link below contains general tips on uploading (copying in) and "
5701 "downloading (copying out) files from VMs."
5705 #: ../examples/guestfs-recipes.pod:374
5707 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5711 #: ../examples/guestfs-recipes.pod:376
5712 msgid "Use libguestfs tools on VMware ESX guests"
5716 #: ../examples/guestfs-recipes.pod:378
5718 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5719 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5723 #: ../examples/guestfs-recipes.pod:382
5725 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
5730 #: ../examples/guestfs-recipes.pod:386
5732 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)"
5733 ">, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
5734 "python(3)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
5738 #: ../examples/guestfs-recipes.pod:403
5739 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5743 #: ../fish/guestfish-actions.pod:1
5748 #: ../fish/guestfish-actions.pod:3
5751 " add-cdrom filename\n"
5756 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5757 msgid "This function adds a virtual CD-ROM disk image to the guest."
5761 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5762 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5766 #: ../fish/guestfish-actions.pod:15
5768 "This call checks for the existence of C<filename>. This stops you from "
5769 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5770 "and C<http:> URLs. To specify those, use the general L</config> call "
5775 #: ../fish/guestfish-actions.pod:22
5777 "If you just want to add an ISO file (often you use this as an efficient way "
5778 "to transfer large files into the guest), then you should probably use L</add-"
5779 "drive-ro> instead."
5783 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:168
5784 #: ../fish/guestfish-actions.pod:182
5786 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5791 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:171
5792 #: ../fish/guestfish-actions.pod:185 ../fish/guestfish-actions.pod:895
5793 #: ../fish/guestfish-actions.pod:930 ../fish/guestfish-actions.pod:1103
5794 #: ../fish/guestfish-actions.pod:1463 ../fish/guestfish-actions.pod:1477
5795 #: ../fish/guestfish-actions.pod:3247 ../fish/guestfish-actions.pod:3558
5796 #: ../fish/guestfish-actions.pod:3606 ../fish/guestfish-actions.pod:4533
5797 #: ../fish/guestfish-actions.pod:4556 ../fish/guestfish-actions.pod:4578
5798 #: ../fish/guestfish-actions.pod:4616 ../fish/guestfish-actions.pod:5265
5799 #: ../fish/guestfish-actions.pod:5371 ../src/guestfs-actions.pod:10
5800 #: ../src/guestfs-actions.pod:258 ../src/guestfs-actions.pod:279
5801 #: ../src/guestfs-actions.pod:1525 ../src/guestfs-actions.pod:1582
5802 #: ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:2364
5803 #: ../src/guestfs-actions.pod:2385 ../src/guestfs-actions.pod:5030
5804 #: ../src/guestfs-actions.pod:5552 ../src/guestfs-actions.pod:5652
5805 #: ../src/guestfs-actions.pod:6952 ../src/guestfs-actions.pod:6996
5806 #: ../src/guestfs-actions.pod:7030 ../src/guestfs-actions.pod:7093
5807 #: ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8134
5808 #: ../src/guestfs-actions.pod:8317
5810 "Deprecated functions will not be removed from the API, but the fact that "
5811 "they are deprecated indicates that there are problems with correct use of "
5816 #: ../fish/guestfish-actions.pod:35
5821 #: ../fish/guestfish-actions.pod:37
5826 #: ../fish/guestfish-actions.pod:39
5829 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
5834 #: ../fish/guestfish-actions.pod:41
5836 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5837 "It works by connecting to libvirt, requesting the domain and domain XML from "
5838 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5842 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5844 "The number of disks added is returned. This operation is atomic: if an "
5845 "error is returned, then no disks are added."
5849 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5851 "This function does some minimal checks to make sure the libvirt domain is "
5852 "not running (unless C<readonly> is true). In a future version we will try "
5853 "to acquire the libvirt lock on each disk."
5857 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5859 "Disks must be accessible locally. This often means that adding disks from a "
5860 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5861 "unless those disks are accessible via the same device path locally too."
5865 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5867 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
5868 "libvirt.org/uri.html>). If this is not set then we connect to the default "
5869 "libvirt URI (or one set through an environment variable, see the libvirt "
5870 "documentation for full details)."
5874 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5876 "The optional C<live> flag controls whether this call will try to connect to "
5877 "a running virtual machine C<guestfsd> process if it sees a suitable "
5878 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5879 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5880 "DAEMONS> for more information."
5884 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5886 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5887 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5888 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5893 #: ../fish/guestfish-actions.pod:76
5895 "The other optional parameters are passed directly through to L</add-drive-"
5900 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:148
5901 #: ../fish/guestfish-actions.pod:578 ../fish/guestfish-actions.pod:789
5902 #: ../fish/guestfish-actions.pod:810 ../fish/guestfish-actions.pod:848
5903 #: ../fish/guestfish-actions.pod:857 ../fish/guestfish-actions.pod:866
5904 #: ../fish/guestfish-actions.pod:880 ../fish/guestfish-actions.pod:2125
5905 #: ../fish/guestfish-actions.pod:3296 ../fish/guestfish-actions.pod:3459
5906 #: ../fish/guestfish-actions.pod:3594
5908 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
5912 #: ../fish/guestfish-actions.pod:81
5917 #: ../fish/guestfish-actions.pod:83
5920 " add-drive filename\n"
5925 #: ../fish/guestfish-actions.pod:85
5927 "This function is the equivalent of calling L</add-drive-opts> with no "
5928 "optional parameters, so the disk is added writable, with the format being "
5929 "detected automatically."
5933 #: ../fish/guestfish-actions.pod:89
5935 "Automatic detection of the format opens you up to a potential security hole "
5936 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5937 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5938 "you should think about replacing calls to this function with calls to L</add-"
5939 "drive-opts>, and specifying the format."
5943 #: ../fish/guestfish-actions.pod:96
5944 msgid "add-drive-opts"
5948 #: ../fish/guestfish-actions.pod:98
5953 #: ../fish/guestfish-actions.pod:100
5956 " add-drive-opts filename [readonly:..] [format:..] [iface:..] [name:..]\n"
5961 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:161
5963 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5964 "The first time you call this function, the disk appears as C</dev/sda>, the "
5965 "second time as C</dev/sdb>, and so on."
5969 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:166
5971 "You don't necessarily need to be root when using libguestfs. However you "
5972 "obviously do need sufficient permissions to access the filename for whatever "
5973 "operations you want to perform (ie. read access if you just want to read the "
5974 "image or write access if you want to modify the image)."
5978 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:172
5979 msgid "This call checks that C<filename> exists."
5983 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3258
5984 #: ../src/guestfs-actions.pod:174 ../src/guestfs-actions.pod:5067
5985 msgid "The optional arguments are:"
5989 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:178
5994 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:180
5996 "If true then the image is treated as read-only. Writes are still allowed, "
5997 "but they are stored in a temporary snapshot overlay which is discarded at "
5998 "the end. The disk that you add is not modified."
6002 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:184
6007 #: ../fish/guestfish-actions.pod:127
6009 "This forces the image format. If you omit this (or use L</add-drive> or L</"
6010 "add-drive-ro>) then the format is automatically detected. Possible formats "
6011 "include C<raw> and C<qcow2>."
6015 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:190
6017 "Automatic detection of the format opens you up to a potential security hole "
6018 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6019 "RHBZ#642934. Specifying the format closes this security hole."
6023 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:195
6028 #: ../fish/guestfish-actions.pod:138
6030 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
6031 "add-drive-with-if> call (q.v.)"
6035 #: ../fish/guestfish-actions.pod:141 ../src/guestfs-actions.pod:200
6040 #: ../fish/guestfish-actions.pod:143 ../src/guestfs-actions.pod:202
6042 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
6043 "a hint to the guest inspection process if it is available."
6047 #: ../fish/guestfish-actions.pod:150
6048 msgid "add-drive-ro"
6052 #: ../fish/guestfish-actions.pod:152
6057 #: ../fish/guestfish-actions.pod:154
6060 " add-drive-ro filename\n"
6065 #: ../fish/guestfish-actions.pod:156
6067 "This function is the equivalent of calling L</add-drive-opts> with the "
6068 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
6069 "is added read-only, with the format being detected automatically."
6073 #: ../fish/guestfish-actions.pod:161
6074 msgid "add-drive-ro-with-if"
6078 #: ../fish/guestfish-actions.pod:163
6081 " add-drive-ro-with-if filename iface\n"
6086 #: ../fish/guestfish-actions.pod:165
6088 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
6089 "interface emulation to use at run time."
6093 #: ../fish/guestfish-actions.pod:175
6094 msgid "add-drive-with-if"
6098 #: ../fish/guestfish-actions.pod:177
6101 " add-drive-with-if filename iface\n"
6106 #: ../fish/guestfish-actions.pod:179
6108 "This is the same as L</add-drive> but it allows you to specify the QEMU "
6109 "interface emulation to use at run time."
6113 #: ../fish/guestfish-actions.pod:189
6118 #: ../fish/guestfish-actions.pod:191
6121 " aug-clear augpath\n"
6126 #: ../fish/guestfish-actions.pod:193 ../src/guestfs-actions.pod:296
6128 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6129 "L<augtool(1)> C<clear> command."
6133 #: ../fish/guestfish-actions.pod:196
6138 #: ../fish/guestfish-actions.pod:198
6146 #: ../fish/guestfish-actions.pod:200
6148 "Close the current Augeas handle and free up any resources used by it. After "
6149 "calling this, you have to call L</aug-init> again before you can use any "
6150 "other Augeas functions."
6154 #: ../fish/guestfish-actions.pod:205
6159 #: ../fish/guestfish-actions.pod:207
6162 " aug-defnode name expr val\n"
6167 #: ../fish/guestfish-actions.pod:209 ../src/guestfs-actions.pod:325
6169 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6173 #: ../fish/guestfish-actions.pod:212
6175 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6176 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
6177 "containing that single node."
6181 #: ../fish/guestfish-actions.pod:216 ../src/guestfs-actions.pod:332
6183 "On success this returns a pair containing the number of nodes in the "
6184 "nodeset, and a boolean flag if a node was created."
6188 #: ../fish/guestfish-actions.pod:220
6193 #: ../fish/guestfish-actions.pod:222
6196 " aug-defvar name expr\n"
6201 #: ../fish/guestfish-actions.pod:224 ../src/guestfs-actions.pod:349
6203 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6204 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6208 #: ../fish/guestfish-actions.pod:228 ../src/guestfs-actions.pod:353
6210 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6211 "evaluates to something which is not a nodeset."
6215 #: ../fish/guestfish-actions.pod:231
6220 #: ../fish/guestfish-actions.pod:233
6223 " aug-get augpath\n"
6228 #: ../fish/guestfish-actions.pod:235 ../src/guestfs-actions.pod:366
6230 "Look up the value associated with C<path>. If C<path> matches exactly one "
6231 "node, the C<value> is returned."
6235 #: ../fish/guestfish-actions.pod:238
6240 #: ../fish/guestfish-actions.pod:240
6243 " aug-init root flags\n"
6248 #: ../fish/guestfish-actions.pod:242 ../src/guestfs-actions.pod:381
6250 "Create a new Augeas handle for editing configuration files. If there was "
6251 "any previous Augeas handle associated with this guestfs session, then it is "
6256 #: ../fish/guestfish-actions.pod:246
6257 msgid "You must call this before using any other L</aug-*> commands."
6261 #: ../fish/guestfish-actions.pod:249 ../src/guestfs-actions.pod:388
6263 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6267 #: ../fish/guestfish-actions.pod:252 ../src/guestfs-actions.pod:391
6269 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6270 "logical I<or> of the following integers:"
6274 #: ../fish/guestfish-actions.pod:258 ../src/guestfs-actions.pod:397
6275 msgid "C<AUG_SAVE_BACKUP> = 1"
6279 #: ../fish/guestfish-actions.pod:260 ../src/guestfs-actions.pod:399
6280 msgid "Keep the original file with a C<.augsave> extension."
6284 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:401
6285 msgid "C<AUG_SAVE_NEWFILE> = 2"
6289 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:403
6291 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6292 "original. Overrides C<AUG_SAVE_BACKUP>."
6296 #: ../fish/guestfish-actions.pod:267 ../src/guestfs-actions.pod:406
6297 msgid "C<AUG_TYPE_CHECK> = 4"
6301 #: ../fish/guestfish-actions.pod:269 ../src/guestfs-actions.pod:408
6302 msgid "Typecheck lenses."
6306 #: ../fish/guestfish-actions.pod:271
6308 "This option is only useful when debugging Augeas lenses. Use of this option "
6309 "may require additional memory for the libguestfs appliance. You may need to "
6310 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
6314 #: ../fish/guestfish-actions.pod:276 ../src/guestfs-actions.pod:415
6315 msgid "C<AUG_NO_STDINC> = 8"
6319 #: ../fish/guestfish-actions.pod:278 ../src/guestfs-actions.pod:417
6320 msgid "Do not use standard load path for modules."
6324 #: ../fish/guestfish-actions.pod:280 ../src/guestfs-actions.pod:419
6325 msgid "C<AUG_SAVE_NOOP> = 16"
6329 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:421
6330 msgid "Make save a no-op, just record what would have been changed."
6334 #: ../fish/guestfish-actions.pod:284 ../src/guestfs-actions.pod:423
6335 msgid "C<AUG_NO_LOAD> = 32"
6339 #: ../fish/guestfish-actions.pod:286
6340 msgid "Do not load the tree in L</aug-init>."
6344 #: ../fish/guestfish-actions.pod:290
6345 msgid "To close the handle, you can call L</aug-close>."
6349 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:431
6350 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6354 #: ../fish/guestfish-actions.pod:294
6359 #: ../fish/guestfish-actions.pod:296
6362 " aug-insert augpath label true|false\n"
6367 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:445
6369 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6370 "or after C<path> (depending on the boolean flag C<before>)."
6374 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:449
6376 "C<path> must match exactly one existing node in the tree, and C<label> must "
6377 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6381 #: ../fish/guestfish-actions.pod:306
6386 #: ../fish/guestfish-actions.pod:308
6394 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:462
6395 msgid "Load files into the tree."
6399 #: ../fish/guestfish-actions.pod:312 ../src/guestfs-actions.pod:464
6400 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6404 #: ../fish/guestfish-actions.pod:315
6409 #: ../fish/guestfish-actions.pod:317
6417 #: ../fish/guestfish-actions.pod:319
6419 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
6420 "resulting nodes into alphabetical order."
6424 #: ../fish/guestfish-actions.pod:322
6429 #: ../fish/guestfish-actions.pod:324
6432 " aug-match augpath\n"
6437 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:492
6439 "Returns a list of paths which match the path expression C<path>. The "
6440 "returned paths are sufficiently qualified so that they match exactly one "
6441 "node in the current tree."
6445 #: ../fish/guestfish-actions.pod:330
6450 #: ../fish/guestfish-actions.pod:332
6453 " aug-mv src dest\n"
6458 #: ../fish/guestfish-actions.pod:334 ../src/guestfs-actions.pod:509
6460 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6461 "C<dest> is overwritten if it exists."
6465 #: ../fish/guestfish-actions.pod:337
6470 #: ../fish/guestfish-actions.pod:339
6478 #: ../fish/guestfish-actions.pod:341 ../src/guestfs-actions.pod:522
6479 msgid "Remove C<path> and all of its children."
6483 #: ../fish/guestfish-actions.pod:343 ../src/guestfs-actions.pod:524
6484 msgid "On success this returns the number of entries which were removed."
6488 #: ../fish/guestfish-actions.pod:345
6493 #: ../fish/guestfish-actions.pod:347
6501 #: ../fish/guestfish-actions.pod:349 ../src/guestfs-actions.pod:535
6502 msgid "This writes all pending changes to disk."
6506 #: ../fish/guestfish-actions.pod:351
6508 "The flags which were passed to L</aug-init> affect exactly how files are "
6513 #: ../fish/guestfish-actions.pod:354
6518 #: ../fish/guestfish-actions.pod:356
6521 " aug-set augpath val\n"
6526 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:551
6527 msgid "Set the value associated with C<path> to C<val>."
6531 #: ../fish/guestfish-actions.pod:360
6533 "In the Augeas API, it is possible to clear a node by setting the value to "
6534 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6535 "this call. Instead you must use the L</aug-clear> call."
6539 #: ../fish/guestfish-actions.pod:365
6544 #: ../fish/guestfish-actions.pod:367
6547 " available 'groups ...'\n"
6552 #: ../fish/guestfish-actions.pod:369 ../src/guestfs-actions.pod:568
6554 "This command is used to check the availability of some groups of "
6555 "functionality in the appliance, which not all builds of the libguestfs "
6556 "appliance will be able to provide."
6560 #: ../fish/guestfish-actions.pod:373
6562 "The libguestfs groups, and the functions that those groups correspond to, "
6563 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6564 "runtime by calling L</available-all-groups>."
6568 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:577
6570 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
6571 "\"]> would check for the availability of the Linux inotify functions and "
6572 "Augeas (configuration file editing) functions."
6576 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:582
6577 msgid "The command returns no error if I<all> requested groups are available."
6581 #: ../fish/guestfish-actions.pod:385 ../src/guestfs-actions.pod:584
6583 "It fails with an error if one or more of the requested groups is unavailable "
6588 #: ../fish/guestfish-actions.pod:388 ../src/guestfs-actions.pod:587
6590 "If an unknown group name is included in the list of groups then an error is "
6595 #: ../fish/guestfish-actions.pod:391 ../src/guestfs-actions.pod:590
6600 #: ../fish/guestfish-actions.pod:397
6601 msgid "You must call L</launch> before calling this function."
6605 #: ../fish/guestfish-actions.pod:399 ../src/guestfs-actions.pod:598
6607 "The reason is because we don't know what groups are supported by the "
6608 "appliance/daemon until it is running and can be queried."
6612 #: ../fish/guestfish-actions.pod:405 ../src/guestfs-actions.pod:604
6614 "If a group of functions is available, this does not necessarily mean that "
6615 "they will work. You still have to check for errors when calling individual "
6616 "API functions even if they are available."
6620 #: ../fish/guestfish-actions.pod:412 ../src/guestfs-actions.pod:611
6622 "It is usually the job of distro packagers to build complete functionality "
6623 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6624 "with all requirements satisfied, will support everything."
6628 #: ../fish/guestfish-actions.pod:419
6630 "This call was added in version C<1.0.80>. In previous versions of "
6631 "libguestfs all you could do would be to speculatively execute a command to "
6632 "find out if the daemon implemented it. See also L</version>."
6636 #: ../fish/guestfish-actions.pod:426
6637 msgid "available-all-groups"
6641 #: ../fish/guestfish-actions.pod:428
6644 " available-all-groups\n"
6649 #: ../fish/guestfish-actions.pod:430
6651 "This command returns a list of all optional groups that this daemon knows "
6652 "about. Note this returns both supported and unsupported groups. To find "
6653 "out which ones the daemon can actually support you have to call L</"
6654 "available> on each member of the returned list."
6658 #: ../fish/guestfish-actions.pod:436
6659 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6663 #: ../fish/guestfish-actions.pod:438
6668 #: ../fish/guestfish-actions.pod:440
6671 " base64-in (base64file|-) filename\n"
6676 #: ../fish/guestfish-actions.pod:442 ../src/guestfs-actions.pod:655
6678 "This command uploads base64-encoded data from C<base64file> to C<filename>."
6682 #: ../fish/guestfish-actions.pod:445 ../fish/guestfish-actions.pod:454
6683 #: ../fish/guestfish-actions.pod:703 ../fish/guestfish-actions.pod:787
6684 #: ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:979
6685 #: ../fish/guestfish-actions.pod:998 ../fish/guestfish-actions.pod:1372
6686 #: ../fish/guestfish-actions.pod:4836 ../fish/guestfish-actions.pod:4848
6687 #: ../fish/guestfish-actions.pod:4859 ../fish/guestfish-actions.pod:4870
6688 #: ../fish/guestfish-actions.pod:4922 ../fish/guestfish-actions.pod:4931
6689 #: ../fish/guestfish-actions.pod:4985 ../fish/guestfish-actions.pod:5008
6690 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6694 #: ../fish/guestfish-actions.pod:447
6699 #: ../fish/guestfish-actions.pod:449
6702 " base64-out filename (base64file|-)\n"
6707 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:669
6709 "This command downloads the contents of C<filename>, writing it out to local "
6710 "file C<base64file> encoded as base64."
6714 #: ../fish/guestfish-actions.pod:456
6715 msgid "blockdev-flushbufs"
6719 #: ../fish/guestfish-actions.pod:458
6722 " blockdev-flushbufs device\n"
6727 #: ../fish/guestfish-actions.pod:460 ../src/guestfs-actions.pod:682
6729 "This tells the kernel to flush internal buffers associated with C<device>."
6733 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:474
6734 #: ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:493
6735 #: ../fish/guestfish-actions.pod:505 ../fish/guestfish-actions.pod:518
6736 #: ../fish/guestfish-actions.pod:526 ../fish/guestfish-actions.pod:537
6737 #: ../fish/guestfish-actions.pod:545 ../fish/guestfish-actions.pod:553
6738 #: ../src/guestfs-actions.pod:685 ../src/guestfs-actions.pod:702
6739 #: ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:733
6740 #: ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:770
6741 #: ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802
6742 #: ../src/guestfs-actions.pod:816 ../src/guestfs-actions.pod:830
6743 msgid "This uses the L<blockdev(8)> command."
6747 #: ../fish/guestfish-actions.pod:465
6748 msgid "blockdev-getbsz"
6752 #: ../fish/guestfish-actions.pod:467
6755 " blockdev-getbsz device\n"
6760 #: ../fish/guestfish-actions.pod:469 ../src/guestfs-actions.pod:697
6761 msgid "This returns the block size of a device."
6765 #: ../fish/guestfish-actions.pod:471 ../fish/guestfish-actions.pod:534
6766 #: ../src/guestfs-actions.pod:699 ../src/guestfs-actions.pod:799
6768 "(Note this is different from both I<size in blocks> and I<filesystem block "
6773 #: ../fish/guestfish-actions.pod:476
6774 msgid "blockdev-getro"
6778 #: ../fish/guestfish-actions.pod:478
6781 " blockdev-getro device\n"
6786 #: ../fish/guestfish-actions.pod:480 ../src/guestfs-actions.pod:714
6788 "Returns a boolean indicating if the block device is read-only (true if read-"
6789 "only, false if not)."
6793 #: ../fish/guestfish-actions.pod:485
6794 msgid "blockdev-getsize64"
6798 #: ../fish/guestfish-actions.pod:487
6801 " blockdev-getsize64 device\n"
6806 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:729
6807 msgid "This returns the size of the device in bytes."
6811 #: ../fish/guestfish-actions.pod:491
6812 msgid "See also L</blockdev-getsz>."
6816 #: ../fish/guestfish-actions.pod:495
6817 msgid "blockdev-getss"
6821 #: ../fish/guestfish-actions.pod:497
6824 " blockdev-getss device\n"
6829 #: ../fish/guestfish-actions.pod:499 ../src/guestfs-actions.pod:745
6831 "This returns the size of sectors on a block device. Usually 512, but can be "
6832 "larger for modern devices."
6836 #: ../fish/guestfish-actions.pod:502
6838 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6842 #: ../fish/guestfish-actions.pod:507
6843 msgid "blockdev-getsz"
6847 #: ../fish/guestfish-actions.pod:509
6850 " blockdev-getsz device\n"
6855 #: ../fish/guestfish-actions.pod:511 ../src/guestfs-actions.pod:763
6857 "This returns the size of the device in units of 512-byte sectors (even if "
6858 "the sectorsize isn't 512 bytes ... weird)."
6862 #: ../fish/guestfish-actions.pod:514
6864 "See also L</blockdev-getss> for the real sector size of the device, and L</"
6865 "blockdev-getsize64> for the more useful I<size in bytes>."
6869 #: ../fish/guestfish-actions.pod:520
6870 msgid "blockdev-rereadpt"
6874 #: ../fish/guestfish-actions.pod:522
6877 " blockdev-rereadpt device\n"
6882 #: ../fish/guestfish-actions.pod:524 ../src/guestfs-actions.pod:782
6883 msgid "Reread the partition table on C<device>."
6887 #: ../fish/guestfish-actions.pod:528
6888 msgid "blockdev-setbsz"
6892 #: ../fish/guestfish-actions.pod:530
6895 " blockdev-setbsz device blocksize\n"
6900 #: ../fish/guestfish-actions.pod:532 ../src/guestfs-actions.pod:797
6901 msgid "This sets the block size of a device."
6905 #: ../fish/guestfish-actions.pod:539
6906 msgid "blockdev-setro"
6910 #: ../fish/guestfish-actions.pod:541
6913 " blockdev-setro device\n"
6918 #: ../fish/guestfish-actions.pod:543 ../src/guestfs-actions.pod:814
6919 msgid "Sets the block device named C<device> to read-only."
6923 #: ../fish/guestfish-actions.pod:547
6924 msgid "blockdev-setrw"
6928 #: ../fish/guestfish-actions.pod:549
6931 " blockdev-setrw device\n"
6936 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:828
6937 msgid "Sets the block device named C<device> to read-write."
6941 #: ../fish/guestfish-actions.pod:555
6942 msgid "btrfs-filesystem-resize"
6946 #: ../fish/guestfish-actions.pod:557
6949 " btrfs-filesystem-resize mountpoint [size:..]\n"
6954 #: ../fish/guestfish-actions.pod:559 ../src/guestfs-actions.pod:850
6955 msgid "This command resizes a btrfs filesystem."
6959 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:852
6961 "Note that unlike other resize calls, the filesystem has to be mounted and "
6962 "the parameter is the mountpoint not the device (this is a requirement of "
6967 #: ../fish/guestfish-actions.pod:565 ../fish/guestfish-actions.pod:3569
6968 #: ../src/guestfs-actions.pod:856 ../src/guestfs-actions.pod:5591
6969 msgid "The optional parameters are:"
6973 #: ../fish/guestfish-actions.pod:569 ../fish/guestfish-actions.pod:3573
6974 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5595
6979 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:862
6981 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6982 "resized to the maximum size."
6986 #: ../fish/guestfish-actions.pod:576 ../src/guestfs-actions.pod:867
6987 msgid "See also L<btrfs(8)>."
6991 #: ../fish/guestfish-actions.pod:580
6992 msgid "case-sensitive-path"
6996 #: ../fish/guestfish-actions.pod:582
6999 " case-sensitive-path path\n"
7004 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:901
7006 "This can be used to resolve case insensitive paths on a filesystem which is "
7007 "case sensitive. The use case is to resolve paths which you have read from "
7008 "Windows configuration files or the Windows Registry, to the true path."
7012 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:906
7014 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7015 "(and probably others), which is that although the underlying filesystem is "
7016 "case-insensitive, the driver exports the filesystem to Linux as case-"
7021 #: ../fish/guestfish-actions.pod:594 ../src/guestfs-actions.pod:911
7023 "One consequence of this is that special directories such as C<c:\\windows> "
7024 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7025 "precise details of how they were created. In Windows itself this would not "
7030 #: ../fish/guestfish-actions.pod:600 ../src/guestfs-actions.pod:917
7032 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
7037 #: ../fish/guestfish-actions.pod:603 ../src/guestfs-actions.pod:920
7039 "This function resolves the true case of each element in the path and returns "
7040 "the case-sensitive path."
7044 #: ../fish/guestfish-actions.pod:606
7046 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
7047 "WINDOWS/system32\"> (the exact return value would depend on details of how "
7048 "the directories were originally created under Windows)."
7052 #: ../fish/guestfish-actions.pod:611 ../src/guestfs-actions.pod:928
7053 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7057 #: ../fish/guestfish-actions.pod:614
7058 msgid "See also L</realpath>."
7062 #: ../fish/guestfish-actions.pod:616
7067 #: ../fish/guestfish-actions.pod:618
7075 #: ../fish/guestfish-actions.pod:620 ../fish/guestfish-actions.pod:4003
7076 #: ../src/guestfs-actions.pod:944 ../src/guestfs-actions.pod:6252
7077 msgid "Return the contents of the file named C<path>."
7081 #: ../fish/guestfish-actions.pod:622
7083 "Note that this function cannot correctly handle binary files (specifically, "
7084 "files containing C<\\0> character which is treated as end of string). For "
7085 "those you need to use the L</read-file> or L</download> functions which have "
7086 "a more complex interface."
7090 #: ../fish/guestfish-actions.pod:627 ../fish/guestfish-actions.pod:762
7091 #: ../fish/guestfish-actions.pod:774 ../fish/guestfish-actions.pod:1057
7092 #: ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1134
7093 #: ../fish/guestfish-actions.pod:1144 ../fish/guestfish-actions.pod:1336
7094 #: ../fish/guestfish-actions.pod:1649 ../fish/guestfish-actions.pod:1659
7095 #: ../fish/guestfish-actions.pod:1709 ../fish/guestfish-actions.pod:1724
7096 #: ../fish/guestfish-actions.pod:1734 ../fish/guestfish-actions.pod:1753
7097 #: ../fish/guestfish-actions.pod:3873 ../fish/guestfish-actions.pod:3888
7098 #: ../fish/guestfish-actions.pod:3964 ../fish/guestfish-actions.pod:3981
7099 #: ../fish/guestfish-actions.pod:3996 ../fish/guestfish-actions.pod:4677
7100 #: ../fish/guestfish-actions.pod:4723 ../fish/guestfish-actions.pod:4808
7101 #: ../fish/guestfish-actions.pod:4823 ../fish/guestfish-actions.pod:5229
7102 #: ../fish/guestfish-actions.pod:5241 ../fish/guestfish-actions.pod:5259
7103 #: ../fish/guestfish-actions.pod:5276 ../fish/guestfish-actions.pod:5286
7104 #: ../fish/guestfish-actions.pod:5343 ../fish/guestfish-actions.pod:5353
7105 #: ../fish/guestfish-actions.pod:5382 ../fish/guestfish-actions.pod:5392
7106 #: ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:1133
7107 #: ../src/guestfs-actions.pod:1153 ../src/guestfs-actions.pod:1800
7108 #: ../src/guestfs-actions.pod:1819 ../src/guestfs-actions.pod:1922
7109 #: ../src/guestfs-actions.pod:1941 ../src/guestfs-actions.pod:2187
7110 #: ../src/guestfs-actions.pod:2669 ../src/guestfs-actions.pod:2688
7111 #: ../src/guestfs-actions.pod:2753 ../src/guestfs-actions.pod:2777
7112 #: ../src/guestfs-actions.pod:2794 ../src/guestfs-actions.pod:2823
7113 #: ../src/guestfs-actions.pod:6034 ../src/guestfs-actions.pod:6060
7114 #: ../src/guestfs-actions.pod:6191 ../src/guestfs-actions.pod:6217
7115 #: ../src/guestfs-actions.pod:6241 ../src/guestfs-actions.pod:7208
7116 #: ../src/guestfs-actions.pod:7263 ../src/guestfs-actions.pod:7409
7117 #: ../src/guestfs-actions.pod:7433 ../src/guestfs-actions.pod:8098
7118 #: ../src/guestfs-actions.pod:8118 ../src/guestfs-actions.pod:8151
7119 #: ../src/guestfs-actions.pod:8170 ../src/guestfs-actions.pod:8189
7120 #: ../src/guestfs-actions.pod:8283 ../src/guestfs-actions.pod:8302
7121 #: ../src/guestfs-actions.pod:8348 ../src/guestfs-actions.pod:8367
7123 "Because of the message protocol, there is a transfer limit of somewhere "
7124 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7128 #: ../fish/guestfish-actions.pod:630
7133 #: ../fish/guestfish-actions.pod:632
7136 " checksum csumtype path\n"
7141 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:966
7143 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7147 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:969
7149 "The type of checksum to compute is given by the C<csumtype> parameter which "
7150 "must have one of the following values:"
7154 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:974
7159 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:976
7161 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7166 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:979
7171 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:981
7172 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7176 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:983
7181 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:985
7182 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7186 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:987
7191 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:989
7192 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7196 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:991
7201 #: ../fish/guestfish-actions.pod:661 ../src/guestfs-actions.pod:993
7202 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7206 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:995
7211 #: ../fish/guestfish-actions.pod:665 ../src/guestfs-actions.pod:997
7212 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7216 #: ../fish/guestfish-actions.pod:667 ../src/guestfs-actions.pod:999
7221 #: ../fish/guestfish-actions.pod:669 ../src/guestfs-actions.pod:1001
7222 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7226 #: ../fish/guestfish-actions.pod:673 ../src/guestfs-actions.pod:1005
7227 msgid "The checksum is returned as a printable string."
7231 #: ../fish/guestfish-actions.pod:675
7232 msgid "To get the checksum for a device, use L</checksum-device>."
7236 #: ../fish/guestfish-actions.pod:677
7237 msgid "To get the checksums for many files, use L</checksums-out>."
7241 #: ../fish/guestfish-actions.pod:679
7242 msgid "checksum-device"
7246 #: ../fish/guestfish-actions.pod:681
7249 " checksum-device csumtype device\n"
7254 #: ../fish/guestfish-actions.pod:683
7256 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7257 "device named C<device>. For the types of checksums supported see the L</"
7258 "checksum> command."
7262 #: ../fish/guestfish-actions.pod:687
7263 msgid "checksums-out"
7267 #: ../fish/guestfish-actions.pod:689
7270 " checksums-out csumtype directory (sumsfile|-)\n"
7275 #: ../fish/guestfish-actions.pod:691 ../src/guestfs-actions.pod:1040
7277 "This command computes the checksums of all regular files in C<directory> and "
7278 "then emits a list of those checksums to the local output file C<sumsfile>."
7282 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1044
7284 "This can be used for verifying the integrity of a virtual machine. However "
7285 "to be properly secure you should pay attention to the output of the checksum "
7286 "command (it uses the ones from GNU coreutils). In particular when the "
7287 "filename is not printable, coreutils uses a special backslash syntax. For "
7288 "more information, see the GNU coreutils info file."
7292 #: ../fish/guestfish-actions.pod:705
7297 #: ../fish/guestfish-actions.pod:707
7300 " chmod mode path\n"
7305 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1063
7307 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7312 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1066
7314 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7315 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7320 #: ../fish/guestfish-actions.pod:716 ../fish/guestfish-actions.pod:3222
7321 #: ../fish/guestfish-actions.pod:3361 ../fish/guestfish-actions.pod:3371
7322 #: ../fish/guestfish-actions.pod:3381 ../src/guestfs-actions.pod:1070
7323 #: ../src/guestfs-actions.pod:4998 ../src/guestfs-actions.pod:5207
7324 #: ../src/guestfs-actions.pod:5226 ../src/guestfs-actions.pod:5245
7325 msgid "The mode actually set is affected by the umask."
7329 #: ../fish/guestfish-actions.pod:718
7334 #: ../fish/guestfish-actions.pod:720
7337 " chown owner group path\n"
7342 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1084
7343 msgid "Change the file owner to C<owner> and group to C<group>."
7347 #: ../fish/guestfish-actions.pod:724 ../fish/guestfish-actions.pod:2657
7348 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:4069
7350 "Only numeric uid and gid are supported. If you want to use names, you will "
7351 "need to locate and parse the password file yourself (Augeas support makes "
7352 "this relatively easy)."
7356 #: ../fish/guestfish-actions.pod:728
7361 #: ../fish/guestfish-actions.pod:730
7364 " command 'arguments ...'\n"
7369 #: ../fish/guestfish-actions.pod:732 ../src/guestfs-actions.pod:1100
7371 "This call runs a command from the guest filesystem. The filesystem must be "
7372 "mounted, and must contain a compatible operating system (ie. something "
7373 "Linux, with the same or compatible processor architecture)."
7377 #: ../fish/guestfish-actions.pod:737
7379 "The single parameter is an argv-style list of arguments. The first element "
7380 "is the name of the program to run. Subsequent elements are parameters. The "
7381 "list must be non-empty (ie. must contain a program name). Note that the "
7382 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
7386 #: ../fish/guestfish-actions.pod:744 ../src/guestfs-actions.pod:1112
7387 msgid "The return value is anything printed to I<stdout> by the command."
7391 #: ../fish/guestfish-actions.pod:747 ../src/guestfs-actions.pod:1115
7393 "If the command returns a non-zero exit status, then this function returns an "
7394 "error message. The error message string is the content of I<stderr> from "
7399 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1119
7401 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
7402 "bin>. If you require a program from another location, you should provide "
7403 "the full path in the first parameter."
7407 #: ../fish/guestfish-actions.pod:756 ../src/guestfs-actions.pod:1124
7409 "Shared libraries and data files required by the program must be available on "
7410 "filesystems which are mounted in the correct places. It is the caller's "
7411 "responsibility to ensure all filesystems that are needed are mounted at the "
7416 #: ../fish/guestfish-actions.pod:765
7417 msgid "command-lines"
7421 #: ../fish/guestfish-actions.pod:767
7424 " command-lines 'arguments ...'\n"
7429 #: ../fish/guestfish-actions.pod:769
7431 "This is the same as L</command>, but splits the result into a list of lines."
7435 #: ../fish/guestfish-actions.pod:772
7436 msgid "See also: L</sh-lines>"
7440 #: ../fish/guestfish-actions.pod:777
7441 msgid "compress-device-out"
7445 #: ../fish/guestfish-actions.pod:779
7448 " compress-device-out ctype device (zdevice|-) [level:..]\n"
7453 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1174
7455 "This command compresses C<device> and writes it out to the local file "
7460 #: ../fish/guestfish-actions.pod:784
7462 "The C<ctype> and optional C<level> parameters have the same meaning as in L</"
7467 #: ../fish/guestfish-actions.pod:791
7468 msgid "compress-out"
7472 #: ../fish/guestfish-actions.pod:793
7475 " compress-out ctype file (zfile|-) [level:..]\n"
7480 #: ../fish/guestfish-actions.pod:795 ../src/guestfs-actions.pod:1226
7482 "This command compresses C<file> and writes it out to the local file C<zfile>."
7486 #: ../fish/guestfish-actions.pod:798 ../src/guestfs-actions.pod:1229
7488 "The compression program used is controlled by the C<ctype> parameter. "
7489 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
7490 "Some compression types may not be supported by particular builds of "
7491 "libguestfs, in which case you will get an error containing the substring "
7492 "\"not supported\"."
7496 #: ../fish/guestfish-actions.pod:804 ../src/guestfs-actions.pod:1235
7498 "The optional C<level> parameter controls compression level. The meaning and "
7499 "default for this parameter depends on the compression program being used."
7503 #: ../fish/guestfish-actions.pod:812
7508 #: ../fish/guestfish-actions.pod:814
7511 " config qemuparam qemuvalue\n"
7516 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1276
7518 "This can be used to add arbitrary qemu command line parameters of the form "
7519 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7520 "setting some parameters which would interfere with parameters that we use."
7524 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1281
7525 msgid "The first character of C<param> string must be a C<-> (dash)."
7529 #: ../fish/guestfish-actions.pod:823 ../src/guestfs-actions.pod:1283
7530 msgid "C<value> can be NULL."
7534 #: ../fish/guestfish-actions.pod:825
7535 msgid "copy-device-to-device"
7539 #: ../fish/guestfish-actions.pod:827
7542 " copy-device-to-device src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7547 #: ../fish/guestfish-actions.pod:829
7549 "The four calls L</copy-device-to-device>, L</copy-device-to-file>, L</copy-"
7550 "file-to-device>, and L</copy-file-to-file> let you copy from a source "
7551 "(device|file) to a destination (device|file)."
7555 #: ../fish/guestfish-actions.pod:836 ../src/guestfs-actions.pod:1313
7557 "Partial copies can be made since you can specify optionally the source "
7558 "offset, destination offset and size to copy. These values are all specified "
7559 "in bytes. If not given, the offsets both default to zero, and the size "
7560 "defaults to copying as much as possible until we hit the end of the source."
7564 #: ../fish/guestfish-actions.pod:842 ../src/guestfs-actions.pod:1319
7566 "The source and destination may be the same object. However overlapping "
7567 "regions may not be copied correctly."
7571 #: ../fish/guestfish-actions.pod:845 ../src/guestfs-actions.pod:1322
7573 "If the destination is a file, it is created if required. If the destination "
7574 "file is not large enough, it is extended."
7578 #: ../fish/guestfish-actions.pod:850
7579 msgid "copy-device-to-file"
7583 #: ../fish/guestfish-actions.pod:852
7586 " copy-device-to-file src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7591 #: ../fish/guestfish-actions.pod:854 ../fish/guestfish-actions.pod:863
7592 #: ../fish/guestfish-actions.pod:872
7593 msgid "See L</copy-device-to-device> for a general overview of this call."
7597 #: ../fish/guestfish-actions.pod:859
7598 msgid "copy-file-to-device"
7602 #: ../fish/guestfish-actions.pod:861
7605 " copy-file-to-device src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7610 #: ../fish/guestfish-actions.pod:868
7611 msgid "copy-file-to-file"
7615 #: ../fish/guestfish-actions.pod:870
7618 " copy-file-to-file src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7623 #: ../fish/guestfish-actions.pod:875
7625 "This is B<not> the function you want for copying files. This is for copying "
7626 "blocks within existing files. See L</cp>, L</cp-a> and L</mv> for general "
7627 "file copying and moving functions."
7631 #: ../fish/guestfish-actions.pod:882
7636 #: ../fish/guestfish-actions.pod:884
7639 " copy-size src dest size\n"
7644 #: ../fish/guestfish-actions.pod:886 ../src/guestfs-actions.pod:1529
7646 "This command copies exactly C<size> bytes from one source device or file "
7647 "C<src> to another destination device or file C<dest>."
7651 #: ../fish/guestfish-actions.pod:889 ../src/guestfs-actions.pod:1532
7653 "Note this will fail if the source is too short or if the destination is not "
7658 #: ../fish/guestfish-actions.pod:892 ../fish/guestfish-actions.pod:927
7660 "I<This function is deprecated.> In new code, use the L</"
7661 "copy_device_to_device> call instead."
7665 #: ../fish/guestfish-actions.pod:899
7670 #: ../fish/guestfish-actions.pod:901
7678 #: ../fish/guestfish-actions.pod:903 ../src/guestfs-actions.pod:1551
7680 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7681 "destination filename or destination directory."
7685 #: ../fish/guestfish-actions.pod:906
7690 #: ../fish/guestfish-actions.pod:908
7698 #: ../fish/guestfish-actions.pod:910 ../src/guestfs-actions.pod:1565
7700 "This copies a file or directory from C<src> to C<dest> recursively using the "
7705 #: ../fish/guestfish-actions.pod:913
7710 #: ../fish/guestfish-actions.pod:915
7718 #: ../fish/guestfish-actions.pod:917 ../src/guestfs-actions.pod:1586
7720 "This command copies from one source device or file C<src> to another "
7721 "destination device or file C<dest>. Normally you would use this to copy to "
7722 "or from a device or partition, for example to duplicate a filesystem."
7726 #: ../fish/guestfish-actions.pod:922
7728 "If the destination is a device, it must be as large or larger than the "
7729 "source file or device, otherwise the copy will fail. This command cannot do "
7730 "partial copies (see L</copy-device-to-device>)."
7734 #: ../fish/guestfish-actions.pod:934
7739 #: ../fish/guestfish-actions.pod:936
7747 #: ../fish/guestfish-actions.pod:938 ../src/guestfs-actions.pod:1605
7748 msgid "This command runs the C<df> command to report disk space used."
7752 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:951
7754 "This command is mostly useful for interactive sessions. It is I<not> "
7755 "intended that you try to parse the output string. Use L</statvfs> from "
7760 #: ../fish/guestfish-actions.pod:944
7765 #: ../fish/guestfish-actions.pod:946
7773 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1621
7775 "This command runs the C<df -h> command to report disk space used in human-"
7780 #: ../fish/guestfish-actions.pod:955
7785 #: ../fish/guestfish-actions.pod:957
7793 #: ../fish/guestfish-actions.pod:959 ../src/guestfs-actions.pod:1638
7795 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7796 "This is sometimes useful for extended debugging of problems."
7800 #: ../fish/guestfish-actions.pod:963
7802 "Another way to get the same information is to enable verbose messages with "
7803 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7804 "before running the program."
7808 #: ../fish/guestfish-actions.pod:968
7813 #: ../fish/guestfish-actions.pod:970
7816 " download remotefilename (filename|-)\n"
7821 #: ../fish/guestfish-actions.pod:972 ../fish/guestfish-actions.pod:985
7822 #: ../src/guestfs-actions.pod:1659 ../src/guestfs-actions.pod:1684
7824 "Download file C<remotefilename> and save it as C<filename> on the local "
7829 #: ../fish/guestfish-actions.pod:975 ../fish/guestfish-actions.pod:4981
7830 #: ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:7668
7831 msgid "C<filename> can also be a named pipe."
7835 #: ../fish/guestfish-actions.pod:977
7836 msgid "See also L</upload>, L</cat>."
7840 #: ../fish/guestfish-actions.pod:981
7841 msgid "download-offset"
7845 #: ../fish/guestfish-actions.pod:983
7848 " download-offset remotefilename (filename|-) offset size\n"
7853 #: ../fish/guestfish-actions.pod:988 ../src/guestfs-actions.pod:1687
7855 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7856 "region must be within the file or device)."
7860 #: ../fish/guestfish-actions.pod:991
7862 "Note that there is no limit on the amount of data that can be downloaded "
7863 "with this call, unlike with L</pread>, and this call always reads the full "
7864 "amount unless an error occurs."
7868 #: ../fish/guestfish-actions.pod:996
7869 msgid "See also L</download>, L</pread>."
7873 #: ../fish/guestfish-actions.pod:1000
7878 #: ../fish/guestfish-actions.pod:1002
7881 " drop-caches whattodrop\n"
7886 #: ../fish/guestfish-actions.pod:1004 ../src/guestfs-actions.pod:1712
7888 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7889 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7890 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7894 #: ../fish/guestfish-actions.pod:1009 ../src/guestfs-actions.pod:1717
7895 msgid "Setting C<whattodrop> to 3 should drop everything."
7899 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1719
7901 "This automatically calls L<sync(2)> before the operation, so that the "
7902 "maximum guest memory is freed."
7906 #: ../fish/guestfish-actions.pod:1014
7911 #: ../fish/guestfish-actions.pod:1016
7919 #: ../fish/guestfish-actions.pod:1018 ../src/guestfs-actions.pod:1732
7921 "This command runs the C<du -s> command to estimate file space usage for "
7926 #: ../fish/guestfish-actions.pod:1021 ../src/guestfs-actions.pod:1735
7928 "C<path> can be a file or a directory. If C<path> is a directory then the "
7929 "estimate includes the contents of the directory and all subdirectories "
7934 #: ../fish/guestfish-actions.pod:1025 ../src/guestfs-actions.pod:1739
7936 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7940 #: ../fish/guestfish-actions.pod:1028
7945 #: ../fish/guestfish-actions.pod:1030
7948 " e2fsck-f device\n"
7953 #: ../fish/guestfish-actions.pod:1032 ../src/guestfs-actions.pod:1757
7955 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7956 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7961 #: ../fish/guestfish-actions.pod:1036
7963 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7964 "should use L</fsck>."
7968 #: ../fish/guestfish-actions.pod:1039
7973 #: ../fish/guestfish-actions.pod:1041
7976 " echo-daemon 'words ...'\n"
7981 #: ../fish/guestfish-actions.pod:1043 ../src/guestfs-actions.pod:1774
7983 "This command concatenates the list of C<words> passed with single spaces "
7984 "between them and returns the resulting string."
7988 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1777
7989 msgid "You can use this command to test the connection through to the daemon."
7993 #: ../fish/guestfish-actions.pod:1048
7994 msgid "See also L</ping-daemon>."
7998 #: ../fish/guestfish-actions.pod:1050
8003 #: ../fish/guestfish-actions.pod:1052
8006 " egrep regex path\n"
8011 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1793
8013 "This calls the external C<egrep> program and returns the matching lines."
8017 #: ../fish/guestfish-actions.pod:1060
8022 #: ../fish/guestfish-actions.pod:1062
8025 " egrepi regex path\n"
8030 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1812
8032 "This calls the external C<egrep -i> program and returns the matching lines."
8036 #: ../fish/guestfish-actions.pod:1070
8041 #: ../fish/guestfish-actions.pod:1072
8044 " equal file1 file2\n"
8049 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1831
8051 "This compares the two files C<file1> and C<file2> and returns true if their "
8052 "content is exactly equal, or false otherwise."
8056 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1834
8057 msgid "The external L<cmp(1)> program is used for the comparison."
8061 #: ../fish/guestfish-actions.pod:1079
8066 #: ../fish/guestfish-actions.pod:1081
8074 #: ../fish/guestfish-actions.pod:1083 ../src/guestfs-actions.pod:1846
8076 "This returns C<true> if and only if there is a file, directory (or anything) "
8077 "with the given C<path> name."
8081 #: ../fish/guestfish-actions.pod:1086
8082 msgid "See also L</is-file>, L</is-dir>, L</stat>."
8086 #: ../fish/guestfish-actions.pod:1088
8091 #: ../fish/guestfish-actions.pod:1090
8094 " fallocate path len\n"
8099 #: ../fish/guestfish-actions.pod:1092 ../fish/guestfish-actions.pod:1111
8100 #: ../src/guestfs-actions.pod:1869 ../src/guestfs-actions.pod:1888
8102 "This command preallocates a file (containing zero bytes) named C<path> of "
8103 "size C<len> bytes. If the file exists already, it is overwritten."
8107 #: ../fish/guestfish-actions.pod:1096 ../src/guestfs-actions.pod:1873
8109 "Do not confuse this with the guestfish-specific C<alloc> command which "
8110 "allocates a file in the host and attaches it as a device."
8114 #: ../fish/guestfish-actions.pod:1100
8116 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
8121 #: ../fish/guestfish-actions.pod:1107
8126 #: ../fish/guestfish-actions.pod:1109
8129 " fallocate64 path len\n"
8134 #: ../fish/guestfish-actions.pod:1115
8136 "Note that this call allocates disk blocks for the file. To create a sparse "
8137 "file use L</truncate-size> instead."
8141 #: ../fish/guestfish-actions.pod:1118
8143 "The deprecated call L</fallocate> does the same, but owing to an oversight "
8144 "it only allowed 30 bit lengths to be specified, effectively limiting the "
8145 "maximum size of files created through that call to 1GB."
8149 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1900
8151 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8152 "commands which create a file in the host and attach it as a device."
8156 #: ../fish/guestfish-actions.pod:1127
8161 #: ../fish/guestfish-actions.pod:1129
8164 " fgrep pattern path\n"
8169 #: ../fish/guestfish-actions.pod:1131 ../src/guestfs-actions.pod:1915
8171 "This calls the external C<fgrep> program and returns the matching lines."
8175 #: ../fish/guestfish-actions.pod:1137
8180 #: ../fish/guestfish-actions.pod:1139
8183 " fgrepi pattern path\n"
8188 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1934
8190 "This calls the external C<fgrep -i> program and returns the matching lines."
8194 #: ../fish/guestfish-actions.pod:1147
8199 #: ../fish/guestfish-actions.pod:1149
8207 #: ../fish/guestfish-actions.pod:1151 ../src/guestfs-actions.pod:1952
8209 "This call uses the standard L<file(1)> command to determine the type or "
8210 "contents of the file."
8214 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1955
8216 "This call will also transparently look inside various types of compressed "
8221 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1958
8223 "The exact command which runs is C<file -zb path>. Note in particular that "
8224 "the filename is not prepended to the output (the I<-b> option)."
8228 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1962
8230 "The output depends on the output of the underlying L<file(1)> command and it "
8231 "can change in future in ways beyond our control. In other words, the output "
8232 "is not guaranteed by the ABI."
8236 #: ../fish/guestfish-actions.pod:1165
8238 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
8239 "(etc), L</is-zero>."
8243 #: ../fish/guestfish-actions.pod:1168
8244 msgid "file-architecture"
8248 #: ../fish/guestfish-actions.pod:1170
8251 " file-architecture filename\n"
8256 #: ../fish/guestfish-actions.pod:1172 ../src/guestfs-actions.pod:1980
8258 "This detects the architecture of the binary C<filename>, and returns it if "
8263 #: ../fish/guestfish-actions.pod:1175 ../src/guestfs-actions.pod:1983
8264 msgid "Currently defined architectures are:"
8268 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1987
8273 #: ../fish/guestfish-actions.pod:1181 ../src/guestfs-actions.pod:1989
8275 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8276 "irrespective of the precise processor requirements of the binary."
8280 #: ../fish/guestfish-actions.pod:1184 ../src/guestfs-actions.pod:1992
8285 #: ../fish/guestfish-actions.pod:1186 ../src/guestfs-actions.pod:1994
8286 msgid "64 bit x86-64."
8290 #: ../fish/guestfish-actions.pod:1188 ../src/guestfs-actions.pod:1996
8295 #: ../fish/guestfish-actions.pod:1190 ../src/guestfs-actions.pod:1998
8296 msgid "32 bit SPARC."
8300 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:2000
8305 #: ../fish/guestfish-actions.pod:1194 ../src/guestfs-actions.pod:2002
8306 msgid "64 bit SPARC V9 and above."
8310 #: ../fish/guestfish-actions.pod:1196 ../src/guestfs-actions.pod:2004
8315 #: ../fish/guestfish-actions.pod:1198 ../src/guestfs-actions.pod:2006
8316 msgid "Intel Itanium."
8320 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:2008
8325 #: ../fish/guestfish-actions.pod:1202 ../src/guestfs-actions.pod:2010
8326 msgid "32 bit Power PC."
8330 #: ../fish/guestfish-actions.pod:1204 ../src/guestfs-actions.pod:2012
8335 #: ../fish/guestfish-actions.pod:1206 ../src/guestfs-actions.pod:2014
8336 msgid "64 bit Power PC."
8340 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:2018
8341 msgid "Libguestfs may return other architecture strings in future."
8345 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:2020
8346 msgid "The function works on at least the following types of files:"
8350 #: ../fish/guestfish-actions.pod:1218 ../src/guestfs-actions.pod:2026
8351 msgid "many types of Un*x and Linux binary"
8355 #: ../fish/guestfish-actions.pod:1222 ../src/guestfs-actions.pod:2030
8356 msgid "many types of Un*x and Linux shared library"
8360 #: ../fish/guestfish-actions.pod:1226 ../src/guestfs-actions.pod:2034
8361 msgid "Windows Win32 and Win64 binaries"
8365 #: ../fish/guestfish-actions.pod:1230 ../src/guestfs-actions.pod:2038
8366 msgid "Windows Win32 and Win64 DLLs"
8370 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:2040
8371 msgid "Win32 binaries and DLLs return C<i386>."
8375 #: ../fish/guestfish-actions.pod:1234 ../src/guestfs-actions.pod:2042
8376 msgid "Win64 binaries and DLLs return C<x86_64>."
8380 #: ../fish/guestfish-actions.pod:1238 ../src/guestfs-actions.pod:2046
8381 msgid "Linux kernel modules"
8385 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:2050
8386 msgid "Linux new-style initrd images"
8390 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:2054
8391 msgid "some non-x86 Linux vmlinuz kernels"
8395 #: ../fish/guestfish-actions.pod:1250 ../src/guestfs-actions.pod:2058
8396 msgid "What it can't do currently:"
8400 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:2064
8401 msgid "static libraries (libfoo.a)"
8405 #: ../fish/guestfish-actions.pod:1260 ../src/guestfs-actions.pod:2068
8406 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8410 #: ../fish/guestfish-actions.pod:1264 ../src/guestfs-actions.pod:2072
8411 msgid "x86 Linux vmlinuz kernels"
8415 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:2074
8417 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8418 "compressed code, and are horribly hard to unpack. If you want to find the "
8419 "architecture of a kernel, use the architecture of the associated initrd or "
8420 "kernel module(s) instead."
8424 #: ../fish/guestfish-actions.pod:1273
8429 #: ../fish/guestfish-actions.pod:1275
8437 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:2092
8438 msgid "This command returns the size of C<file> in bytes."
8442 #: ../fish/guestfish-actions.pod:1279
8444 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
8445 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
8449 #: ../fish/guestfish-actions.pod:1283
8454 #: ../fish/guestfish-actions.pod:1285
8457 " fill c len path\n"
8462 #: ../fish/guestfish-actions.pod:1287 ../src/guestfs-actions.pod:2110
8464 "This command creates a new file called C<path>. The initial content of the "
8465 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
8470 #: ../fish/guestfish-actions.pod:1291
8472 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8473 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
8478 #: ../fish/guestfish-actions.pod:1296
8479 msgid "fill-pattern"
8483 #: ../fish/guestfish-actions.pod:1298
8486 " fill-pattern pattern len path\n"
8491 #: ../fish/guestfish-actions.pod:1300
8493 "This function is like L</fill> except that it creates a new file of length "
8494 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
8495 "is truncated if necessary to ensure the length of the file is exactly C<len> "
8500 #: ../fish/guestfish-actions.pod:1305
8505 #: ../fish/guestfish-actions.pod:1307
8513 #: ../fish/guestfish-actions.pod:1309 ../src/guestfs-actions.pod:2156
8515 "This command lists out all files and directories, recursively, starting at "
8516 "C<directory>. It is essentially equivalent to running the shell command "
8517 "C<find directory -print> but some post-processing happens on the output, "
8522 #: ../fish/guestfish-actions.pod:1314 ../src/guestfs-actions.pod:2161
8524 "This returns a list of strings I<without any prefix>. Thus if the directory "
8529 #: ../fish/guestfish-actions.pod:1317 ../src/guestfs-actions.pod:2164
8539 #: ../fish/guestfish-actions.pod:1321
8540 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8544 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2171
8555 #: ../fish/guestfish-actions.pod:1329 ../src/guestfs-actions.pod:2176
8556 msgid "If C<directory> is not a directory, then this command returns an error."
8560 #: ../fish/guestfish-actions.pod:1332 ../src/guestfs-actions.pod:2179
8561 msgid "The returned list is sorted."
8565 #: ../fish/guestfish-actions.pod:1334
8566 msgid "See also L</find0>."
8570 #: ../fish/guestfish-actions.pod:1339
8575 #: ../fish/guestfish-actions.pod:1341
8578 " find0 directory (files|-)\n"
8583 #: ../fish/guestfish-actions.pod:1343 ../src/guestfs-actions.pod:2199
8585 "This command lists out all files and directories, recursively, starting at "
8586 "C<directory>, placing the resulting list in the external file called "
8591 #: ../fish/guestfish-actions.pod:1347
8593 "This command works the same way as L</find> with the following exceptions:"
8597 #: ../fish/guestfish-actions.pod:1354 ../src/guestfs-actions.pod:2210
8598 msgid "The resulting list is written to an external file."
8602 #: ../fish/guestfish-actions.pod:1358 ../src/guestfs-actions.pod:2214
8604 "Items (filenames) in the result are separated by C<\\0> characters. See "
8605 "L<find(1)> option I<-print0>."
8609 #: ../fish/guestfish-actions.pod:1363 ../src/guestfs-actions.pod:2219
8610 msgid "This command is not limited in the number of names that it can return."
8614 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2224
8615 msgid "The result list is not sorted."
8619 #: ../fish/guestfish-actions.pod:1374
8620 msgid "findfs-label"
8624 #: ../fish/guestfish-actions.pod:1376
8627 " findfs-label label\n"
8632 #: ../fish/guestfish-actions.pod:1378 ../src/guestfs-actions.pod:2238
8634 "This command searches the filesystems and returns the one which has the "
8635 "given label. An error is returned if no such filesystem can be found."
8639 #: ../fish/guestfish-actions.pod:1382
8640 msgid "To find the label of a filesystem, use L</vfs-label>."
8644 #: ../fish/guestfish-actions.pod:1384
8649 #: ../fish/guestfish-actions.pod:1386
8652 " findfs-uuid uuid\n"
8657 #: ../fish/guestfish-actions.pod:1388 ../src/guestfs-actions.pod:2255
8659 "This command searches the filesystems and returns the one which has the "
8660 "given UUID. An error is returned if no such filesystem can be found."
8664 #: ../fish/guestfish-actions.pod:1392
8665 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8669 #: ../fish/guestfish-actions.pod:1394
8674 #: ../fish/guestfish-actions.pod:1396
8677 " fsck fstype device\n"
8682 #: ../fish/guestfish-actions.pod:1398 ../src/guestfs-actions.pod:2273
8684 "This runs the filesystem checker (fsck) on C<device> which should have "
8685 "filesystem type C<fstype>."
8689 #: ../fish/guestfish-actions.pod:1401 ../src/guestfs-actions.pod:2276
8691 "The returned integer is the status. See L<fsck(8)> for the list of status "
8692 "codes from C<fsck>."
8696 #: ../fish/guestfish-actions.pod:1410 ../src/guestfs-actions.pod:2285
8697 msgid "Multiple status codes can be summed together."
8701 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2289
8703 "A non-zero return code can mean \"success\", for example if errors have been "
8704 "corrected on the filesystem."
8708 #: ../fish/guestfish-actions.pod:1419 ../src/guestfs-actions.pod:2294
8709 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8713 #: ../fish/guestfish-actions.pod:1424 ../src/guestfs-actions.pod:2299
8715 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8719 #: ../fish/guestfish-actions.pod:1426
8724 #: ../fish/guestfish-actions.pod:1428
8732 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2310
8734 "Return the additional kernel options which are added to the guest kernel "
8739 #: ../fish/guestfish-actions.pod:1433 ../src/guestfs-actions.pod:2313
8740 msgid "If C<NULL> then no options are added."
8744 #: ../fish/guestfish-actions.pod:1435
8745 msgid "get-attach-method"
8749 #: ../fish/guestfish-actions.pod:1437
8752 " get-attach-method\n"
8757 #: ../fish/guestfish-actions.pod:1439
8758 msgid "Return the current attach method. See L</set-attach-method>."
8762 #: ../fish/guestfish-actions.pod:1441
8763 msgid "get-autosync"
8767 #: ../fish/guestfish-actions.pod:1443
8775 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2338
8776 msgid "Get the autosync flag."
8780 #: ../fish/guestfish-actions.pod:1447
8785 #: ../fish/guestfish-actions.pod:1449
8793 #: ../fish/guestfish-actions.pod:1451 ../src/guestfs-actions.pod:2349
8794 msgid "Return the direct appliance mode flag."
8798 #: ../fish/guestfish-actions.pod:1453
8803 #: ../fish/guestfish-actions.pod:1455
8806 " get-e2label device\n"
8811 #: ../fish/guestfish-actions.pod:1457 ../src/guestfs-actions.pod:2368
8813 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8817 #: ../fish/guestfish-actions.pod:1460
8819 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8824 #: ../fish/guestfish-actions.pod:1467
8829 #: ../fish/guestfish-actions.pod:1469
8832 " get-e2uuid device\n"
8837 #: ../fish/guestfish-actions.pod:1471 ../src/guestfs-actions.pod:2389
8839 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8843 #: ../fish/guestfish-actions.pod:1474
8845 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8850 #: ../fish/guestfish-actions.pod:1481
8855 #: ../fish/guestfish-actions.pod:1483
8863 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2402
8865 "This gets the memory size in megabytes allocated to the qemu subprocess."
8869 #: ../fish/guestfish-actions.pod:1488
8871 "If L</set-memsize> was not called on this handle, and if "
8872 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8873 "value for memsize."
8877 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:1549
8878 #: ../fish/guestfish-actions.pod:4329 ../fish/guestfish-actions.pod:4431
8879 #: ../src/guestfs-actions.pod:2409 ../src/guestfs-actions.pod:2501
8880 #: ../src/guestfs-actions.pod:6713 ../src/guestfs-actions.pod:6839
8882 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8886 #: ../fish/guestfish-actions.pod:1495
8891 #: ../fish/guestfish-actions.pod:1497
8899 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2421
8900 msgid "This returns the enable network flag."
8904 #: ../fish/guestfish-actions.pod:1501
8909 #: ../fish/guestfish-actions.pod:1503
8917 #: ../fish/guestfish-actions.pod:1505 ../src/guestfs-actions.pod:2432
8918 msgid "Return the current search path."
8922 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2434
8924 "This is always non-NULL. If it wasn't set already, then this will return "
8929 #: ../fish/guestfish-actions.pod:1510
8934 #: ../fish/guestfish-actions.pod:1512
8942 #: ../fish/guestfish-actions.pod:1514 ../src/guestfs-actions.pod:2447
8943 msgid "This returns the process group flag."
8947 #: ../fish/guestfish-actions.pod:1516
8952 #: ../fish/guestfish-actions.pod:1518
8957 #: ../fish/guestfish-actions.pod:1520
8965 #: ../fish/guestfish-actions.pod:1522 ../src/guestfs-actions.pod:2458
8967 "Return the process ID of the qemu subprocess. If there is no qemu "
8968 "subprocess, then this will return an error."
8972 #: ../fish/guestfish-actions.pod:1525 ../src/guestfs-actions.pod:2461
8973 msgid "This is an internal call used for debugging and testing."
8977 #: ../fish/guestfish-actions.pod:1527
8982 #: ../fish/guestfish-actions.pod:1529
8990 #: ../fish/guestfish-actions.pod:1531 ../src/guestfs-actions.pod:2472
8991 msgid "Return the current qemu binary."
8995 #: ../fish/guestfish-actions.pod:1533 ../src/guestfs-actions.pod:2474
8997 "This is always non-NULL. If it wasn't set already, then this will return "
8998 "the default qemu binary name."
9002 #: ../fish/guestfish-actions.pod:1536
9003 msgid "get-recovery-proc"
9007 #: ../fish/guestfish-actions.pod:1538
9010 " get-recovery-proc\n"
9015 #: ../fish/guestfish-actions.pod:1540 ../src/guestfs-actions.pod:2487
9016 msgid "Return the recovery process enabled flag."
9020 #: ../fish/guestfish-actions.pod:1542
9025 #: ../fish/guestfish-actions.pod:1544
9033 #: ../fish/guestfish-actions.pod:1546
9035 "This returns the current setting of the selinux flag which is passed to the "
9036 "appliance at boot time. See L</set-selinux>."
9040 #: ../fish/guestfish-actions.pod:1552
9045 #: ../fish/guestfish-actions.pod:1554
9053 #: ../fish/guestfish-actions.pod:1556 ../src/guestfs-actions.pod:2513
9054 msgid "This returns the number of virtual CPUs assigned to the appliance."
9058 #: ../fish/guestfish-actions.pod:1558
9063 #: ../fish/guestfish-actions.pod:1560
9071 #: ../fish/guestfish-actions.pod:1562 ../src/guestfs-actions.pod:2524
9073 "This returns the current state as an opaque integer. This is only useful "
9074 "for printing debug and internal error messages."
9078 #: ../fish/guestfish-actions.pod:1565 ../fish/guestfish-actions.pod:2524
9079 #: ../fish/guestfish-actions.pod:2542 ../fish/guestfish-actions.pod:2580
9080 #: ../fish/guestfish-actions.pod:2596 ../src/guestfs-actions.pod:2527
9081 #: ../src/guestfs-actions.pod:3846 ../src/guestfs-actions.pod:3875
9082 #: ../src/guestfs-actions.pod:3936 ../src/guestfs-actions.pod:3963
9083 msgid "For more information on states, see L<guestfs(3)>."
9087 #: ../fish/guestfish-actions.pod:1567
9092 #: ../fish/guestfish-actions.pod:1569
9100 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2538
9101 msgid "Return the command trace flag."
9105 #: ../fish/guestfish-actions.pod:1573
9110 #: ../fish/guestfish-actions.pod:1575
9118 #: ../fish/guestfish-actions.pod:1577
9120 "Return the current umask. By default the umask is C<022> unless it has been "
9121 "set by calling L</umask>."
9125 #: ../fish/guestfish-actions.pod:1580
9130 #: ../fish/guestfish-actions.pod:1582
9138 #: ../fish/guestfish-actions.pod:1584 ../src/guestfs-actions.pod:2561
9139 msgid "This returns the verbose messages flag."
9143 #: ../fish/guestfish-actions.pod:1586
9148 #: ../fish/guestfish-actions.pod:1588
9156 #: ../fish/guestfish-actions.pod:1590 ../src/guestfs-actions.pod:2572
9157 msgid "This gets the SELinux security context of the daemon."
9161 #: ../fish/guestfish-actions.pod:1592
9162 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
9166 #: ../fish/guestfish-actions.pod:1595
9171 #: ../fish/guestfish-actions.pod:1597
9174 " getxattr path name\n"
9179 #: ../fish/guestfish-actions.pod:1599
9181 "Get a single extended attribute from file C<path> named C<name>. This call "
9182 "follows symlinks. If you want to lookup an extended attribute for the "
9183 "symlink itself, use L</lgetxattr>."
9187 #: ../fish/guestfish-actions.pod:1603 ../fish/guestfish-actions.pod:2669
9189 "Normally it is better to get all extended attributes from a file in one go "
9190 "by calling L</getxattrs>. However some Linux filesystem implementations are "
9191 "buggy and do not provide a way to list out attributes. For these "
9192 "filesystems (notably ntfs-3g) you have to know the names of the extended "
9193 "attributes you want in advance and call this function."
9197 #: ../fish/guestfish-actions.pod:1610 ../fish/guestfish-actions.pod:2676
9198 #: ../src/guestfs-actions.pod:2601 ../src/guestfs-actions.pod:4096
9200 "Extended attribute values are blobs of binary data. If there is no extended "
9201 "attribute named C<name>, this returns an error."
9205 #: ../fish/guestfish-actions.pod:1613
9206 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
9210 #: ../fish/guestfish-actions.pod:1615
9215 #: ../fish/guestfish-actions.pod:1617
9223 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2618
9225 "This call lists the extended attributes of the file or directory C<path>."
9229 #: ../fish/guestfish-actions.pod:1622 ../src/guestfs-actions.pod:2621
9231 "At the system call level, this is a combination of the L<listxattr(2)> and "
9232 "L<getxattr(2)> calls."
9236 #: ../fish/guestfish-actions.pod:1625
9237 msgid "See also: L</lgetxattrs>, L<attr(5)>."
9241 #: ../fish/guestfish-actions.pod:1627
9246 #: ../fish/guestfish-actions.pod:1629
9249 " glob-expand pattern\n"
9254 #: ../fish/guestfish-actions.pod:1631 ../src/guestfs-actions.pod:2638
9256 "This command searches for all the pathnames matching C<pattern> according to "
9257 "the wildcard expansion rules used by the shell."
9261 #: ../fish/guestfish-actions.pod:1635 ../src/guestfs-actions.pod:2642
9263 "If no paths match, then this returns an empty list (note: not an error)."
9267 #: ../fish/guestfish-actions.pod:1638 ../src/guestfs-actions.pod:2645
9269 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
9270 "GLOB_BRACE>. See that manual page for more details."
9274 #: ../fish/guestfish-actions.pod:1642
9279 #: ../fish/guestfish-actions.pod:1644
9282 " grep regex path\n"
9287 #: ../fish/guestfish-actions.pod:1646 ../src/guestfs-actions.pod:2662
9288 msgid "This calls the external C<grep> program and returns the matching lines."
9292 #: ../fish/guestfish-actions.pod:1652
9297 #: ../fish/guestfish-actions.pod:1654
9300 " grepi regex path\n"
9305 #: ../fish/guestfish-actions.pod:1656 ../src/guestfs-actions.pod:2681
9307 "This calls the external C<grep -i> program and returns the matching lines."
9311 #: ../fish/guestfish-actions.pod:1662
9312 msgid "grub-install"
9316 #: ../fish/guestfish-actions.pod:1664
9319 " grub-install root device\n"
9324 #: ../fish/guestfish-actions.pod:1666 ../src/guestfs-actions.pod:2700
9326 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
9327 "with the root directory being C<root>."
9331 #: ../fish/guestfish-actions.pod:1675 ../src/guestfs-actions.pod:2709
9333 "There is currently no way in the API to install grub2, which is used by most "
9334 "modern Linux guests. It is possible to run the grub2 command from the "
9335 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
9339 #: ../fish/guestfish-actions.pod:1682 ../src/guestfs-actions.pod:2716
9341 "This uses C<grub-install> from the host. Unfortunately grub is not always "
9342 "compatible with itself, so this only works in rather narrow circumstances. "
9343 "Careful testing with each guest version is advisable."
9347 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2723
9349 "If grub-install reports the error \"No suitable drive was found in the "
9350 "generated device map.\" it may be that you need to create a C</boot/grub/"
9351 "device.map> file first that contains the mapping between grub device names "
9352 "and Linux device names. It is usually sufficient to create a file "
9357 #: ../fish/guestfish-actions.pod:1696 ../src/guestfs-actions.pod:2730
9365 #: ../fish/guestfish-actions.pod:1698 ../src/guestfs-actions.pod:2732
9366 msgid "replacing C</dev/vda> with the name of the installation device."
9370 #: ../fish/guestfish-actions.pod:1702
9375 #: ../fish/guestfish-actions.pod:1704
9383 #: ../fish/guestfish-actions.pod:1706 ../src/guestfs-actions.pod:2746
9385 "This command returns up to the first 10 lines of a file as a list of strings."
9389 #: ../fish/guestfish-actions.pod:1712
9394 #: ../fish/guestfish-actions.pod:1714
9397 " head-n nrlines path\n"
9402 #: ../fish/guestfish-actions.pod:1716 ../src/guestfs-actions.pod:2765
9404 "If the parameter C<nrlines> is a positive number, this returns the first "
9405 "C<nrlines> lines of the file C<path>."
9409 #: ../fish/guestfish-actions.pod:1719 ../src/guestfs-actions.pod:2768
9411 "If the parameter C<nrlines> is a negative number, this returns lines from "
9412 "the file C<path>, excluding the last C<nrlines> lines."
9416 #: ../fish/guestfish-actions.pod:1722 ../fish/guestfish-actions.pod:4821
9417 #: ../src/guestfs-actions.pod:2771 ../src/guestfs-actions.pod:7427
9418 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9422 #: ../fish/guestfish-actions.pod:1727
9427 #: ../fish/guestfish-actions.pod:1729
9435 #: ../fish/guestfish-actions.pod:1731 ../src/guestfs-actions.pod:2788
9437 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
9438 "readable, canonical hex dump of the file."
9442 #: ../fish/guestfish-actions.pod:1737
9447 #: ../fish/guestfish-actions.pod:1739
9450 " initrd-cat initrdpath filename\n"
9455 #: ../fish/guestfish-actions.pod:1741 ../src/guestfs-actions.pod:2807
9457 "This command unpacks the file C<filename> from the initrd file called "
9458 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9463 #: ../fish/guestfish-actions.pod:1745 ../src/guestfs-actions.pod:2811
9465 "For example, in guestfish you could use the following command to examine the "
9466 "boot script (usually called C</init>) contained in a Linux initrd or "
9471 #: ../fish/guestfish-actions.pod:1749 ../src/guestfs-actions.pod:2815
9474 " initrd-cat /boot/initrd-<version>.img init\n"
9479 #: ../fish/guestfish-actions.pod:1751
9480 msgid "See also L</initrd-list>."
9484 #: ../fish/guestfish-actions.pod:1756
9489 #: ../fish/guestfish-actions.pod:1758
9492 " initrd-list path\n"
9497 #: ../fish/guestfish-actions.pod:1760 ../src/guestfs-actions.pod:2834
9498 msgid "This command lists out files contained in an initrd."
9502 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2836
9504 "The files are listed without any initial C</> character. The files are "
9505 "listed in the order they appear (not necessarily alphabetical). Directory "
9506 "names are listed as separate items."
9510 #: ../fish/guestfish-actions.pod:1766 ../src/guestfs-actions.pod:2840
9512 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9513 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9518 #: ../fish/guestfish-actions.pod:1770
9519 msgid "inotify-add-watch"
9523 #: ../fish/guestfish-actions.pod:1772
9526 " inotify-add-watch path mask\n"
9531 #: ../fish/guestfish-actions.pod:1774 ../src/guestfs-actions.pod:2857
9532 msgid "Watch C<path> for the events listed in C<mask>."
9536 #: ../fish/guestfish-actions.pod:1776 ../src/guestfs-actions.pod:2859
9538 "Note that if C<path> is a directory then events within that directory are "
9539 "watched, but this does I<not> happen recursively (in subdirectories)."
9543 #: ../fish/guestfish-actions.pod:1780 ../src/guestfs-actions.pod:2863
9545 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9546 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9550 #: ../fish/guestfish-actions.pod:1784
9551 msgid "inotify-close"
9555 #: ../fish/guestfish-actions.pod:1786
9563 #: ../fish/guestfish-actions.pod:1788 ../src/guestfs-actions.pod:2876
9565 "This closes the inotify handle which was previously opened by inotify_init. "
9566 "It removes all watches, throws away any pending events, and deallocates all "
9571 #: ../fish/guestfish-actions.pod:1792
9572 msgid "inotify-files"
9576 #: ../fish/guestfish-actions.pod:1794
9584 #: ../fish/guestfish-actions.pod:1796
9586 "This function is a helpful wrapper around L</inotify-read> which just "
9587 "returns a list of pathnames of objects that were touched. The returned "
9588 "pathnames are sorted and deduplicated."
9592 #: ../fish/guestfish-actions.pod:1800
9593 msgid "inotify-init"
9597 #: ../fish/guestfish-actions.pod:1802
9600 " inotify-init maxevents\n"
9605 #: ../fish/guestfish-actions.pod:1804 ../src/guestfs-actions.pod:2905
9607 "This command creates a new inotify handle. The inotify subsystem can be "
9608 "used to notify events which happen to objects in the guest filesystem."
9612 #: ../fish/guestfish-actions.pod:1808
9614 "C<maxevents> is the maximum number of events which will be queued up between "
9615 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9616 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9617 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9618 "but records the fact that it threw them away by setting a flag "
9619 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9623 #: ../fish/guestfish-actions.pod:1818
9625 "Before any events are generated, you have to add some watches to the "
9626 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9627 "L</inotify-watch-all>."
9631 #: ../fish/guestfish-actions.pod:1824
9633 "Queued up events should be read periodically by calling L</inotify-read> (or "
9634 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9635 "If you don't read the events out often enough then you risk the internal "
9636 "queue overflowing."
9640 #: ../fish/guestfish-actions.pod:1831
9642 "The handle should be closed after use by calling L</inotify-close>. This "
9643 "also removes any watches automatically."
9647 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2936
9649 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9650 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9651 "that there is one global inotify handle per libguestfs instance."
9655 #: ../fish/guestfish-actions.pod:1840
9656 msgid "inotify-read"
9660 #: ../fish/guestfish-actions.pod:1842
9668 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2950
9670 "Return the complete queue of events that have happened since the previous "
9675 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2953
9676 msgid "If no events have happened, this returns an empty list."
9680 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2955
9682 "I<Note>: In order to make sure that all events have been read, you must call "
9683 "this function repeatedly until it returns an empty list. The reason is that "
9684 "the call will read events up to the maximum appliance-to-host message size "
9685 "and leave remaining events in the queue."
9689 #: ../fish/guestfish-actions.pod:1855
9690 msgid "inotify-rm-watch"
9694 #: ../fish/guestfish-actions.pod:1857
9697 " inotify-rm-watch wd\n"
9702 #: ../fish/guestfish-actions.pod:1859
9703 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9707 #: ../fish/guestfish-actions.pod:1862
9708 msgid "inspect-get-arch"
9712 #: ../fish/guestfish-actions.pod:1864
9715 " inspect-get-arch root\n"
9720 #: ../fish/guestfish-actions.pod:1866
9722 "This returns the architecture of the inspected operating system. The "
9723 "possible return values are listed under L</file-architecture>."
9727 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2990
9729 "If the architecture could not be determined, then the string C<unknown> is "
9734 #: ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:1968
9735 #: ../fish/guestfish-actions.pod:2047 ../fish/guestfish-actions.pod:2059
9736 #: ../fish/guestfish-actions.pod:2143 ../fish/guestfish-actions.pod:2205
9737 #: ../fish/guestfish-actions.pod:2226 ../fish/guestfish-actions.pod:2240
9738 #: ../fish/guestfish-actions.pod:2280 ../fish/guestfish-actions.pod:2316
9739 #: ../fish/guestfish-actions.pod:2329 ../fish/guestfish-actions.pod:2342
9740 #: ../fish/guestfish-actions.pod:2352 ../fish/guestfish-actions.pod:2362
9741 #: ../fish/guestfish-actions.pod:2374 ../fish/guestfish-actions.pod:2470
9742 #: ../fish/guestfish-actions.pod:2504 ../src/guestfs-actions.pod:2993
9743 #: ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:3199
9744 #: ../src/guestfs-actions.pod:3218 ../src/guestfs-actions.pod:3349
9745 #: ../src/guestfs-actions.pod:3433 ../src/guestfs-actions.pod:3461
9746 #: ../src/guestfs-actions.pod:3482 ../src/guestfs-actions.pod:3535
9747 #: ../src/guestfs-actions.pod:3579 ../src/guestfs-actions.pod:3599
9748 #: ../src/guestfs-actions.pod:3619 ../src/guestfs-actions.pod:3636
9749 #: ../src/guestfs-actions.pod:3652 ../src/guestfs-actions.pod:3670
9750 #: ../src/guestfs-actions.pod:3772 ../src/guestfs-actions.pod:3813
9751 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9755 #: ../fish/guestfish-actions.pod:1875
9756 msgid "inspect-get-distro"
9760 #: ../fish/guestfish-actions.pod:1877
9763 " inspect-get-distro root\n"
9768 #: ../fish/guestfish-actions.pod:1879 ../src/guestfs-actions.pod:3006
9770 "This returns the distro (distribution) of the inspected operating system."
9774 #: ../fish/guestfish-actions.pod:1882 ../src/guestfs-actions.pod:3009
9775 msgid "Currently defined distros are:"
9779 #: ../fish/guestfish-actions.pod:1886 ../src/guestfs-actions.pod:3013
9780 msgid "\"archlinux\""
9784 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:3015
9789 #: ../fish/guestfish-actions.pod:1890 ../src/guestfs-actions.pod:3017
9794 #: ../fish/guestfish-actions.pod:1892 ../src/guestfs-actions.pod:3019
9799 #: ../fish/guestfish-actions.pod:1894 ../src/guestfs-actions.pod:3021
9804 #: ../fish/guestfish-actions.pod:1896 ../src/guestfs-actions.pod:3023
9809 #: ../fish/guestfish-actions.pod:1898 ../src/guestfs-actions.pod:3025
9814 #: ../fish/guestfish-actions.pod:1900 ../src/guestfs-actions.pod:3027
9819 #: ../fish/guestfish-actions.pod:1902 ../src/guestfs-actions.pod:3029
9824 #: ../fish/guestfish-actions.pod:1904 ../src/guestfs-actions.pod:3031
9829 #: ../fish/guestfish-actions.pod:1906 ../src/guestfs-actions.pod:3033
9830 msgid "\"linuxmint\""
9834 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:3035
9839 #: ../fish/guestfish-actions.pod:1910 ../src/guestfs-actions.pod:3037
9844 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:3039
9849 #: ../fish/guestfish-actions.pod:1914 ../src/guestfs-actions.pod:3041
9850 msgid "\"mandriva\""
9854 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:3043
9859 #: ../fish/guestfish-actions.pod:1918 ../src/guestfs-actions.pod:3045
9864 #: ../fish/guestfish-actions.pod:1920 ../src/guestfs-actions.pod:3047
9869 #: ../fish/guestfish-actions.pod:1922 ../src/guestfs-actions.pod:3049
9870 msgid "\"opensuse\""
9874 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:3051
9879 #: ../fish/guestfish-actions.pod:1926 ../src/guestfs-actions.pod:3053
9884 #: ../fish/guestfish-actions.pod:1928 ../src/guestfs-actions.pod:3055
9889 #: ../fish/guestfish-actions.pod:1930 ../src/guestfs-actions.pod:3057
9890 msgid "\"redhat-based\""
9894 #: ../fish/guestfish-actions.pod:1932 ../src/guestfs-actions.pod:3059
9895 msgid "Some Red Hat-derived distro."
9899 #: ../fish/guestfish-actions.pod:1934 ../src/guestfs-actions.pod:3061
9904 #: ../fish/guestfish-actions.pod:1936 ../src/guestfs-actions.pod:3063
9905 msgid "Red Hat Enterprise Linux."
9909 #: ../fish/guestfish-actions.pod:1938 ../src/guestfs-actions.pod:3065
9910 msgid "\"scientificlinux\""
9914 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:3067
9915 msgid "Scientific Linux."
9919 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:3069
9920 msgid "\"slackware\""
9924 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:3071
9929 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:3073
9930 msgid "\"ttylinux\""
9934 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:3075
9939 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:3077
9944 #: ../fish/guestfish-actions.pod:1952 ../src/guestfs-actions.pod:3079
9949 #: ../fish/guestfish-actions.pod:1954 ../fish/guestfish-actions.pod:2038
9950 #: ../fish/guestfish-actions.pod:2307 ../src/guestfs-actions.pod:3081
9951 #: ../src/guestfs-actions.pod:3190 ../src/guestfs-actions.pod:3570
9956 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:3083
9957 msgid "The distro could not be determined."
9961 #: ../fish/guestfish-actions.pod:1958 ../fish/guestfish-actions.pod:2295
9962 #: ../src/guestfs-actions.pod:3085 ../src/guestfs-actions.pod:3558
9967 #: ../fish/guestfish-actions.pod:1960 ../src/guestfs-actions.pod:3087
9969 "Windows does not have distributions. This string is returned if the OS type "
9974 #: ../fish/guestfish-actions.pod:1965 ../fish/guestfish-actions.pod:2044
9975 #: ../fish/guestfish-actions.pod:2313 ../src/guestfs-actions.pod:3092
9976 #: ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3576
9978 "Future versions of libguestfs may return other strings here. The caller "
9979 "should be prepared to handle any string."
9983 #: ../fish/guestfish-actions.pod:1970
9984 msgid "inspect-get-drive-mappings"
9988 #: ../fish/guestfish-actions.pod:1972
9991 " inspect-get-drive-mappings root\n"
9996 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:3108
9998 "This call is useful for Windows which uses a primitive system of assigning "
9999 "drive letters (like \"C:\") to partitions. This inspection API examines the "
10000 "Windows Registry to find out how disks/partitions are mapped to drive "
10001 "letters, and returns a hash table as in the example below:"
10005 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:3114
10008 " C => /dev/vda2\n"
10009 " E => /dev/vdb1\n"
10010 " F => /dev/vdc1\n"
10015 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:3118
10017 "Note that keys are drive letters. For Windows, the key is case insensitive "
10018 "and just contains the drive letter, without the customary colon separator "
10023 #: ../fish/guestfish-actions.pod:1988 ../src/guestfs-actions.pod:3122
10025 "In future we may support other operating systems that also used drive "
10026 "letters, but the keys for those might not be case insensitive and might be "
10027 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
10032 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3127
10034 "For Windows guests, currently only hard drive mappings are returned. "
10035 "Removable disks (eg. DVD-ROMs) are ignored."
10039 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3130
10041 "For guests that do not use drive mappings, or if the drive mappings could "
10042 "not be determined, this returns an empty hash table."
10046 #: ../fish/guestfish-actions.pod:1999
10048 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10049 "get-mountpoints>, L</inspect-get-filesystems>."
10053 #: ../fish/guestfish-actions.pod:2003
10054 msgid "inspect-get-filesystems"
10058 #: ../fish/guestfish-actions.pod:2005
10061 " inspect-get-filesystems root\n"
10066 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3151
10068 "This returns a list of all the filesystems that we think are associated with "
10069 "this operating system. This includes the root filesystem, other ordinary "
10070 "filesystems, and non-mounted devices like swap partitions."
10074 #: ../fish/guestfish-actions.pod:2012 ../src/guestfs-actions.pod:3156
10076 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
10077 "to be shared between operating systems."
10081 #: ../fish/guestfish-actions.pod:2015
10083 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10084 "get-mountpoints>."
10088 #: ../fish/guestfish-actions.pod:2018
10089 msgid "inspect-get-format"
10093 #: ../fish/guestfish-actions.pod:2020
10096 " inspect-get-format root\n"
10101 #: ../fish/guestfish-actions.pod:2022 ../src/guestfs-actions.pod:3174
10103 "This returns the format of the inspected operating system. You can use it "
10104 "to detect install images, live CDs and similar."
10108 #: ../fish/guestfish-actions.pod:2025 ../src/guestfs-actions.pod:3177
10109 msgid "Currently defined formats are:"
10113 #: ../fish/guestfish-actions.pod:2029 ../src/guestfs-actions.pod:3181
10114 msgid "\"installed\""
10118 #: ../fish/guestfish-actions.pod:2031 ../src/guestfs-actions.pod:3183
10119 msgid "This is an installed operating system."
10123 #: ../fish/guestfish-actions.pod:2033 ../src/guestfs-actions.pod:3185
10124 msgid "\"installer\""
10128 #: ../fish/guestfish-actions.pod:2035 ../src/guestfs-actions.pod:3187
10130 "The disk image being inspected is not an installed operating system, but a "
10131 "I<bootable> install disk, live CD, or similar."
10135 #: ../fish/guestfish-actions.pod:2040 ../src/guestfs-actions.pod:3192
10136 msgid "The format of this disk image is not known."
10140 #: ../fish/guestfish-actions.pod:2049
10141 msgid "inspect-get-hostname"
10145 #: ../fish/guestfish-actions.pod:2051
10148 " inspect-get-hostname root\n"
10153 #: ../fish/guestfish-actions.pod:2053 ../src/guestfs-actions.pod:3212
10155 "This function returns the hostname of the operating system as found by "
10156 "inspection of the guest's configuration files."
10160 #: ../fish/guestfish-actions.pod:2056 ../src/guestfs-actions.pod:3215
10162 "If the hostname could not be determined, then the string C<unknown> is "
10167 #: ../fish/guestfish-actions.pod:2061
10168 msgid "inspect-get-icon"
10172 #: ../fish/guestfish-actions.pod:2063
10175 " inspect-get-icon root [favicon:..] [highquality:..]\n"
10180 #: ../fish/guestfish-actions.pod:2065 ../src/guestfs-actions.pod:3241
10182 "This function returns an icon corresponding to the inspected operating "
10183 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
10184 "to PNG if necessary)."
10188 #: ../fish/guestfish-actions.pod:2069 ../src/guestfs-actions.pod:3245
10190 "If it was not possible to get an icon this function returns a zero-length "
10191 "(non-NULL) buffer. I<Callers must check for this case>."
10195 #: ../fish/guestfish-actions.pod:2072 ../src/guestfs-actions.pod:3248
10197 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
10198 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
10199 "this file will be returned. You can disable favicons by passing the "
10200 "optional C<favicon> boolean as false (default is true)."
10204 #: ../fish/guestfish-actions.pod:2078 ../src/guestfs-actions.pod:3254
10206 "If finding the favicon fails, then we look in other places in the guest for "
10211 #: ../fish/guestfish-actions.pod:2081 ../src/guestfs-actions.pod:3257
10213 "If the optional C<highquality> boolean is true then only high quality icons "
10214 "are returned, which means only icons of high resolution with an alpha "
10215 "channel. The default (false) is to return any icon we can, even if it is of "
10216 "substandard quality."
10220 #: ../fish/guestfish-actions.pod:2092 ../src/guestfs-actions.pod:3268
10222 "Unlike most other inspection API calls, the guest's disks must be mounted up "
10223 "before you call this, since it needs to read information from the guest "
10224 "filesystem during the call."
10228 #: ../fish/guestfish-actions.pod:2098 ../src/guestfs-actions.pod:3274
10230 "B<Security:> The icon data comes from the untrusted guest, and should be "
10231 "treated with caution. PNG files have been known to contain exploits. "
10232 "Ensure that libpng (or other relevant libraries) are fully up to date before "
10233 "trying to process or display the icon."
10237 #: ../fish/guestfish-actions.pod:2106 ../src/guestfs-actions.pod:3282
10239 "The PNG image returned can be any size. It might not be square. Libguestfs "
10240 "tries to return the largest, highest quality icon available. The "
10241 "application must scale the icon to the required size."
10245 #: ../fish/guestfish-actions.pod:2113 ../src/guestfs-actions.pod:3289
10247 "Extracting icons from Windows guests requires the external C<wrestool> "
10248 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
10249 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
10250 "installed separately."
10254 #: ../fish/guestfish-actions.pod:2120 ../src/guestfs-actions.pod:3296
10256 "Operating system icons are usually trademarks. Seek legal advice before "
10257 "using trademarks in applications."
10261 #: ../fish/guestfish-actions.pod:2127
10262 msgid "inspect-get-major-version"
10266 #: ../fish/guestfish-actions.pod:2129
10269 " inspect-get-major-version root\n"
10274 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3337
10276 "This returns the major version number of the inspected operating system."
10280 #: ../fish/guestfish-actions.pod:2134 ../src/guestfs-actions.pod:3340
10282 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
10283 "popular public names used by the operating system. Notably the operating "
10284 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
10285 "1). You can find out the real versions corresponding to releases of Windows "
10286 "by consulting Wikipedia or MSDN."
10290 #: ../fish/guestfish-actions.pod:2141 ../fish/guestfish-actions.pod:2152
10291 #: ../src/guestfs-actions.pod:3347 ../src/guestfs-actions.pod:3364
10292 msgid "If the version could not be determined, then C<0> is returned."
10296 #: ../fish/guestfish-actions.pod:2145
10297 msgid "inspect-get-minor-version"
10301 #: ../fish/guestfish-actions.pod:2147
10304 " inspect-get-minor-version root\n"
10309 #: ../fish/guestfish-actions.pod:2149 ../src/guestfs-actions.pod:3361
10311 "This returns the minor version number of the inspected operating system."
10315 #: ../fish/guestfish-actions.pod:2154
10317 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10318 "get-major-version>."
10322 #: ../fish/guestfish-actions.pod:2157
10323 msgid "inspect-get-mountpoints"
10327 #: ../fish/guestfish-actions.pod:2159
10330 " inspect-get-mountpoints root\n"
10335 #: ../fish/guestfish-actions.pod:2161 ../src/guestfs-actions.pod:3379
10337 "This returns a hash of where we think the filesystems associated with this "
10338 "operating system should be mounted. Callers should note that this is at "
10339 "best an educated guess made by reading configuration files such as C</etc/"
10340 "fstab>. I<In particular note> that this may return filesystems which are "
10341 "non-existent or not mountable and callers should be prepared to handle or "
10342 "ignore failures if they try to mount them."
10346 #: ../fish/guestfish-actions.pod:2170 ../src/guestfs-actions.pod:3388
10348 "Each element in the returned hashtable has a key which is the path of the "
10349 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
10350 "mounted there (eg. C</dev/sda1>)."
10354 #: ../fish/guestfish-actions.pod:2175 ../src/guestfs-actions.pod:3393
10356 "Non-mounted devices such as swap devices are I<not> returned in this list."
10360 #: ../fish/guestfish-actions.pod:2178
10362 "For operating systems like Windows which still use drive letters, this call "
10363 "will only return an entry for the first drive \"mounted on\" C</>. For "
10364 "information about the mapping of drive letters to partitions, see L</inspect-"
10365 "get-drive-mappings>."
10369 #: ../fish/guestfish-actions.pod:2184
10371 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10372 "get-filesystems>."
10376 #: ../fish/guestfish-actions.pod:2187
10377 msgid "inspect-get-package-format"
10381 #: ../fish/guestfish-actions.pod:2189
10384 " inspect-get-package-format root\n"
10389 #: ../fish/guestfish-actions.pod:2191
10391 "This function and L</inspect-get-package-management> return the package "
10392 "format and package management tool used by the inspected operating system. "
10393 "For example for Fedora these functions would return C<rpm> (package format) "
10394 "and C<yum> (package management)."
10398 #: ../fish/guestfish-actions.pod:2197 ../src/guestfs-actions.pod:3425
10400 "This returns the string C<unknown> if we could not determine the package "
10401 "format I<or> if the operating system does not have a real packaging system "
10406 #: ../fish/guestfish-actions.pod:2201 ../src/guestfs-actions.pod:3429
10408 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
10409 "C<pkgsrc>. Future versions of libguestfs may return other strings."
10413 #: ../fish/guestfish-actions.pod:2207
10414 msgid "inspect-get-package-management"
10418 #: ../fish/guestfish-actions.pod:2209
10421 " inspect-get-package-management root\n"
10426 #: ../fish/guestfish-actions.pod:2211
10428 "L</inspect-get-package-format> and this function return the package format "
10429 "and package management tool used by the inspected operating system. For "
10430 "example for Fedora these functions would return C<rpm> (package format) and "
10431 "C<yum> (package management)."
10435 #: ../fish/guestfish-actions.pod:2217 ../src/guestfs-actions.pod:3452
10437 "This returns the string C<unknown> if we could not determine the package "
10438 "management tool I<or> if the operating system does not have a real packaging "
10439 "system (eg. Windows)."
10443 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3456
10445 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10446 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
10447 "versions of libguestfs may return other strings."
10451 #: ../fish/guestfish-actions.pod:2228
10452 msgid "inspect-get-product-name"
10456 #: ../fish/guestfish-actions.pod:2230
10459 " inspect-get-product-name root\n"
10464 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3474
10466 "This returns the product name of the inspected operating system. The "
10467 "product name is generally some freeform string which can be displayed to the "
10468 "user, but should not be parsed by programs."
10472 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3479
10474 "If the product name could not be determined, then the string C<unknown> is "
10479 #: ../fish/guestfish-actions.pod:2242
10480 msgid "inspect-get-product-variant"
10484 #: ../fish/guestfish-actions.pod:2244
10487 " inspect-get-product-variant root\n"
10492 #: ../fish/guestfish-actions.pod:2246 ../src/guestfs-actions.pod:3495
10493 msgid "This returns the product variant of the inspected operating system."
10497 #: ../fish/guestfish-actions.pod:2249 ../src/guestfs-actions.pod:3498
10499 "For Windows guests, this returns the contents of the Registry key C<HKLM"
10500 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
10501 "is usually a string such as C<Client> or C<Server> (other values are "
10502 "possible). This can be used to distinguish consumer and enterprise versions "
10503 "of Windows that have the same version number (for example, Windows 7 and "
10504 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10505 "the latter is C<Server>)."
10509 #: ../fish/guestfish-actions.pod:2258 ../src/guestfs-actions.pod:3507
10511 "For enterprise Linux guests, in future we intend this to return the product "
10512 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10513 "implemented at present."
10517 #: ../fish/guestfish-actions.pod:2262 ../src/guestfs-actions.pod:3511
10519 "If the product variant could not be determined, then the string C<unknown> "
10524 #: ../fish/guestfish-actions.pod:2265
10526 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10527 "get-product-name>, L</inspect-get-major-version>."
10531 #: ../fish/guestfish-actions.pod:2269
10532 msgid "inspect-get-roots"
10536 #: ../fish/guestfish-actions.pod:2271
10539 " inspect-get-roots\n"
10544 #: ../fish/guestfish-actions.pod:2273
10546 "This function is a convenient way to get the list of root devices, as "
10547 "returned from a previous call to L</inspect-os>, but without redoing the "
10548 "whole inspection process."
10552 #: ../fish/guestfish-actions.pod:2277
10554 "This returns an empty list if either no root devices were found or the "
10555 "caller has not called L</inspect-os>."
10559 #: ../fish/guestfish-actions.pod:2282
10560 msgid "inspect-get-type"
10564 #: ../fish/guestfish-actions.pod:2284
10567 " inspect-get-type root\n"
10572 #: ../fish/guestfish-actions.pod:2286 ../src/guestfs-actions.pod:3549
10574 "This returns the type of the inspected operating system. Currently defined "
10579 #: ../fish/guestfish-actions.pod:2291 ../src/guestfs-actions.pod:3554
10584 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3556
10585 msgid "Any Linux-based operating system."
10589 #: ../fish/guestfish-actions.pod:2297 ../src/guestfs-actions.pod:3560
10590 msgid "Any Microsoft Windows operating system."
10594 #: ../fish/guestfish-actions.pod:2299 ../src/guestfs-actions.pod:3562
10595 msgid "\"freebsd\""
10599 #: ../fish/guestfish-actions.pod:2301 ../src/guestfs-actions.pod:3564
10604 #: ../fish/guestfish-actions.pod:2303 ../src/guestfs-actions.pod:3566
10609 #: ../fish/guestfish-actions.pod:2305 ../src/guestfs-actions.pod:3568
10614 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3572
10615 msgid "The operating system type could not be determined."
10619 #: ../fish/guestfish-actions.pod:2318
10620 msgid "inspect-get-windows-current-control-set"
10624 #: ../fish/guestfish-actions.pod:2320
10627 " inspect-get-windows-current-control-set root\n"
10632 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3592
10634 "This returns the Windows CurrentControlSet of the inspected guest. The "
10635 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10639 #: ../fish/guestfish-actions.pod:2325 ../src/guestfs-actions.pod:3595
10641 "This call assumes that the guest is Windows and that the Registry could be "
10642 "examined by inspection. If this is not the case then an error is returned."
10646 #: ../fish/guestfish-actions.pod:2331
10647 msgid "inspect-get-windows-systemroot"
10651 #: ../fish/guestfish-actions.pod:2333
10654 " inspect-get-windows-systemroot root\n"
10659 #: ../fish/guestfish-actions.pod:2335 ../src/guestfs-actions.pod:3612
10661 "This returns the Windows systemroot of the inspected guest. The systemroot "
10662 "is a directory path such as C</WINDOWS>."
10666 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3615
10668 "This call assumes that the guest is Windows and that the systemroot could be "
10669 "determined by inspection. If this is not the case then an error is returned."
10673 #: ../fish/guestfish-actions.pod:2344
10674 msgid "inspect-is-live"
10678 #: ../fish/guestfish-actions.pod:2346
10681 " inspect-is-live root\n"
10686 #: ../fish/guestfish-actions.pod:2348
10688 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10689 "then this returns true if a live image was detected on the disk."
10693 #: ../fish/guestfish-actions.pod:2354
10694 msgid "inspect-is-multipart"
10698 #: ../fish/guestfish-actions.pod:2356
10701 " inspect-is-multipart root\n"
10706 #: ../fish/guestfish-actions.pod:2358
10708 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10709 "then this returns true if the disk is part of a set."
10713 #: ../fish/guestfish-actions.pod:2364
10714 msgid "inspect-is-netinst"
10718 #: ../fish/guestfish-actions.pod:2366
10721 " inspect-is-netinst root\n"
10726 #: ../fish/guestfish-actions.pod:2368
10728 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10729 "then this returns true if the disk is a network installer, ie. not a self-"
10730 "contained install CD but one which is likely to require network access to "
10731 "complete the install."
10735 #: ../fish/guestfish-actions.pod:2376
10736 msgid "inspect-list-applications"
10740 #: ../fish/guestfish-actions.pod:2378
10743 " inspect-list-applications root\n"
10748 #: ../fish/guestfish-actions.pod:2380 ../src/guestfs-actions.pod:3682
10749 msgid "Return the list of applications installed in the operating system."
10753 #: ../fish/guestfish-actions.pod:2382
10755 "I<Note:> This call works differently from other parts of the inspection "
10756 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10757 "then mount up the disks, before calling this. Listing applications is a "
10758 "significantly more difficult operation which requires access to the full "
10759 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10760 "are just returning data cached in the libguestfs handle, this call actually "
10761 "reads parts of the mounted filesystems during the call."
10765 #: ../fish/guestfish-actions.pod:2392 ../src/guestfs-actions.pod:3694
10767 "This returns an empty list if the inspection code was not able to determine "
10768 "the list of applications."
10772 #: ../fish/guestfish-actions.pod:2395 ../src/guestfs-actions.pod:3697
10773 msgid "The application structure contains the following fields:"
10777 #: ../fish/guestfish-actions.pod:2399 ../src/guestfs-actions.pod:3701
10778 msgid "C<app_name>"
10782 #: ../fish/guestfish-actions.pod:2401 ../src/guestfs-actions.pod:3703
10784 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10785 "guests, this is the package name."
10789 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3706
10790 msgid "C<app_display_name>"
10794 #: ../fish/guestfish-actions.pod:2406 ../src/guestfs-actions.pod:3708
10796 "The display name of the application, sometimes localized to the install "
10797 "language of the guest operating system."
10801 #: ../fish/guestfish-actions.pod:2409 ../src/guestfs-actions.pod:3711
10803 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10804 "to display something can use C<app_name> instead."
10808 #: ../fish/guestfish-actions.pod:2412 ../src/guestfs-actions.pod:3714
10809 msgid "C<app_epoch>"
10813 #: ../fish/guestfish-actions.pod:2414 ../src/guestfs-actions.pod:3716
10815 "For package managers which use epochs, this contains the epoch of the "
10816 "package (an integer). If unavailable, this is returned as C<0>."
10820 #: ../fish/guestfish-actions.pod:2417 ../src/guestfs-actions.pod:3719
10821 msgid "C<app_version>"
10825 #: ../fish/guestfish-actions.pod:2419 ../src/guestfs-actions.pod:3721
10827 "The version string of the application or package. If unavailable this is "
10828 "returned as an empty string C<\"\">."
10832 #: ../fish/guestfish-actions.pod:2422 ../src/guestfs-actions.pod:3724
10833 msgid "C<app_release>"
10837 #: ../fish/guestfish-actions.pod:2424 ../src/guestfs-actions.pod:3726
10839 "The release string of the application or package, for package managers that "
10840 "use this. If unavailable this is returned as an empty string C<\"\">."
10844 #: ../fish/guestfish-actions.pod:2428 ../src/guestfs-actions.pod:3730
10845 msgid "C<app_install_path>"
10849 #: ../fish/guestfish-actions.pod:2430 ../src/guestfs-actions.pod:3732
10851 "The installation path of the application (on operating systems such as "
10852 "Windows which use installation paths). This path is in the format used by "
10853 "the guest operating system, it is not a libguestfs path."
10857 #: ../fish/guestfish-actions.pod:2435 ../src/guestfs-actions.pod:3737
10858 msgid "If unavailable this is returned as an empty string C<\"\">."
10862 #: ../fish/guestfish-actions.pod:2437 ../src/guestfs-actions.pod:3739
10863 msgid "C<app_trans_path>"
10867 #: ../fish/guestfish-actions.pod:2439 ../src/guestfs-actions.pod:3741
10869 "The install path translated into a libguestfs path. If unavailable this is "
10870 "returned as an empty string C<\"\">."
10874 #: ../fish/guestfish-actions.pod:2442 ../src/guestfs-actions.pod:3744
10875 msgid "C<app_publisher>"
10879 #: ../fish/guestfish-actions.pod:2444 ../src/guestfs-actions.pod:3746
10881 "The name of the publisher of the application, for package managers that use "
10882 "this. If unavailable this is returned as an empty string C<\"\">."
10886 #: ../fish/guestfish-actions.pod:2448 ../src/guestfs-actions.pod:3750
10891 #: ../fish/guestfish-actions.pod:2450 ../src/guestfs-actions.pod:3752
10893 "The URL (eg. upstream URL) of the application. If unavailable this is "
10894 "returned as an empty string C<\"\">."
10898 #: ../fish/guestfish-actions.pod:2453 ../src/guestfs-actions.pod:3755
10899 msgid "C<app_source_package>"
10903 #: ../fish/guestfish-actions.pod:2455 ../src/guestfs-actions.pod:3757
10905 "For packaging systems which support this, the name of the source package. "
10906 "If unavailable this is returned as an empty string C<\"\">."
10910 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3760
10911 msgid "C<app_summary>"
10915 #: ../fish/guestfish-actions.pod:2460 ../src/guestfs-actions.pod:3762
10917 "A short (usually one line) description of the application or package. If "
10918 "unavailable this is returned as an empty string C<\"\">."
10922 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3765
10923 msgid "C<app_description>"
10927 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3767
10929 "A longer description of the application or package. If unavailable this is "
10930 "returned as an empty string C<\"\">."
10934 #: ../fish/guestfish-actions.pod:2472
10939 #: ../fish/guestfish-actions.pod:2474
10947 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3785
10949 "This function uses other libguestfs functions and certain heuristics to "
10950 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10951 "for operating systems."
10955 #: ../fish/guestfish-actions.pod:2480 ../src/guestfs-actions.pod:3789
10956 msgid "The list returned is empty if no operating systems were found."
10960 #: ../fish/guestfish-actions.pod:2482 ../src/guestfs-actions.pod:3791
10962 "If one operating system was found, then this returns a list with a single "
10963 "element, which is the name of the root filesystem of this operating system. "
10964 "It is also possible for this function to return a list containing more than "
10965 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10966 "element being the root filesystem of one of the operating systems."
10970 #: ../fish/guestfish-actions.pod:2489
10972 "You can pass the root string(s) returned to other L</inspect-get-*> "
10973 "functions in order to query further information about each operating system, "
10974 "such as the name and version."
10978 #: ../fish/guestfish-actions.pod:2494
10980 "This function uses other libguestfs features such as L</mount-ro> and L</"
10981 "umount-all> in order to mount and unmount filesystems and look at the "
10982 "contents. This should be called with no disks currently mounted. The "
10983 "function may also use Augeas, so any existing Augeas handle will be closed."
10987 #: ../fish/guestfish-actions.pod:2500 ../src/guestfs-actions.pod:3809
10989 "This function cannot decrypt encrypted disks. The caller must do that first "
10990 "(supplying the necessary keys) if the disk is encrypted."
10994 #: ../fish/guestfish-actions.pod:2506 ../fish/guestfish-actions.pod:2704
10995 #: ../fish/guestfish-actions.pod:2763
10996 msgid "See also L</list-filesystems>."
11000 #: ../fish/guestfish-actions.pod:2508
11001 msgid "is-blockdev"
11005 #: ../fish/guestfish-actions.pod:2510
11008 " is-blockdev path\n"
11013 #: ../fish/guestfish-actions.pod:2512 ../src/guestfs-actions.pod:3829
11015 "This returns C<true> if and only if there is a block device with the given "
11020 #: ../fish/guestfish-actions.pod:2515 ../fish/guestfish-actions.pod:2533
11021 #: ../fish/guestfish-actions.pod:2552 ../fish/guestfish-actions.pod:2561
11022 #: ../fish/guestfish-actions.pod:2571 ../fish/guestfish-actions.pod:2605
11023 #: ../fish/guestfish-actions.pod:2614
11024 msgid "See also L</stat>."
11028 #: ../fish/guestfish-actions.pod:2517
11033 #: ../fish/guestfish-actions.pod:2519
11041 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3843
11043 "This returns true iff this handle is busy processing a command (in the "
11048 #: ../fish/guestfish-actions.pod:2526
11053 #: ../fish/guestfish-actions.pod:2528
11056 " is-chardev path\n"
11061 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3858
11063 "This returns C<true> if and only if there is a character device with the "
11064 "given C<path> name."
11068 #: ../fish/guestfish-actions.pod:2535
11073 #: ../fish/guestfish-actions.pod:2537
11081 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3872
11083 "This returns true iff this handle is being configured (in the C<CONFIG> "
11088 #: ../fish/guestfish-actions.pod:2544
11093 #: ../fish/guestfish-actions.pod:2546
11101 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3887
11103 "This returns C<true> if and only if there is a directory with the given "
11104 "C<path> name. Note that it returns false for other objects like files."
11108 #: ../fish/guestfish-actions.pod:2554
11113 #: ../fish/guestfish-actions.pod:2556
11121 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3903
11123 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
11124 "given C<path> name."
11128 #: ../fish/guestfish-actions.pod:2563
11133 #: ../fish/guestfish-actions.pod:2565
11141 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3918
11143 "This returns C<true> if and only if there is a regular file with the given "
11144 "C<path> name. Note that it returns false for other objects like directories."
11148 #: ../fish/guestfish-actions.pod:2573
11149 msgid "is-launching"
11153 #: ../fish/guestfish-actions.pod:2575
11161 #: ../fish/guestfish-actions.pod:2577 ../src/guestfs-actions.pod:3933
11163 "This returns true iff this handle is launching the subprocess (in the "
11164 "C<LAUNCHING> state)."
11168 #: ../fish/guestfish-actions.pod:2582
11173 #: ../fish/guestfish-actions.pod:2584
11181 #: ../fish/guestfish-actions.pod:2586 ../src/guestfs-actions.pod:3948
11183 "This command tests whether C<device> is a logical volume, and returns true "
11184 "iff this is the case."
11188 #: ../fish/guestfish-actions.pod:2589
11193 #: ../fish/guestfish-actions.pod:2591
11201 #: ../fish/guestfish-actions.pod:2593 ../src/guestfs-actions.pod:3960
11203 "This returns true iff this handle is ready to accept commands (in the "
11208 #: ../fish/guestfish-actions.pod:2598
11213 #: ../fish/guestfish-actions.pod:2600
11216 " is-socket path\n"
11221 #: ../fish/guestfish-actions.pod:2602 ../src/guestfs-actions.pod:3975
11223 "This returns C<true> if and only if there is a Unix domain socket with the "
11224 "given C<path> name."
11228 #: ../fish/guestfish-actions.pod:2607
11233 #: ../fish/guestfish-actions.pod:2609
11236 " is-symlink path\n"
11241 #: ../fish/guestfish-actions.pod:2611 ../src/guestfs-actions.pod:3990
11243 "This returns C<true> if and only if there is a symbolic link with the given "
11248 #: ../fish/guestfish-actions.pod:2616
11253 #: ../fish/guestfish-actions.pod:2618
11261 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:4005
11263 "This returns true iff the file exists and the file is empty or it contains "
11268 #: ../fish/guestfish-actions.pod:2623
11269 msgid "is-zero-device"
11273 #: ../fish/guestfish-actions.pod:2625
11276 " is-zero-device device\n"
11281 #: ../fish/guestfish-actions.pod:2627 ../src/guestfs-actions.pod:4018
11282 msgid "This returns true iff the device exists and contains all zero bytes."
11286 #: ../fish/guestfish-actions.pod:2629 ../src/guestfs-actions.pod:4020
11287 msgid "Note that for large devices this can take a long time to run."
11291 #: ../fish/guestfish-actions.pod:2631
11292 msgid "kill-subprocess"
11296 #: ../fish/guestfish-actions.pod:2633
11299 " kill-subprocess\n"
11304 #: ../fish/guestfish-actions.pod:2635 ../src/guestfs-actions.pod:4031
11305 msgid "This kills the qemu subprocess. You should never need to call this."
11309 #: ../fish/guestfish-actions.pod:2637
11314 #: ../fish/guestfish-actions.pod:2639
11319 #: ../fish/guestfish-actions.pod:2641
11327 #: ../fish/guestfish-actions.pod:2643 ../src/guestfs-actions.pod:4042
11329 "Internally libguestfs is implemented by running a virtual machine using "
11334 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:4045
11336 "You should call this after configuring the handle (eg. adding drives) but "
11337 "before performing any actions."
11341 #: ../fish/guestfish-actions.pod:2649
11346 #: ../fish/guestfish-actions.pod:2651
11349 " lchown owner group path\n"
11354 #: ../fish/guestfish-actions.pod:2653
11356 "Change the file owner to C<owner> and group to C<group>. This is like L</"
11357 "chown> but if C<path> is a symlink then the link itself is changed, not the "
11362 #: ../fish/guestfish-actions.pod:2661
11367 #: ../fish/guestfish-actions.pod:2663
11370 " lgetxattr path name\n"
11375 #: ../fish/guestfish-actions.pod:2665 ../src/guestfs-actions.pod:4085
11377 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
11378 "is a symlink, then this call returns an extended attribute from the symlink."
11382 #: ../fish/guestfish-actions.pod:2679
11383 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
11387 #: ../fish/guestfish-actions.pod:2681
11392 #: ../fish/guestfish-actions.pod:2683
11395 " lgetxattrs path\n"
11400 #: ../fish/guestfish-actions.pod:2685
11402 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
11403 "it returns the extended attributes of the link itself."
11407 #: ../fish/guestfish-actions.pod:2689
11412 #: ../fish/guestfish-actions.pod:2691
11420 #: ../fish/guestfish-actions.pod:2693 ../src/guestfs-actions.pod:4128
11422 "List all 9p filesystems attached to the guest. A list of mount tags is "
11427 #: ../fish/guestfish-actions.pod:2696
11428 msgid "list-devices"
11432 #: ../fish/guestfish-actions.pod:2698
11440 #: ../fish/guestfish-actions.pod:2700 ../src/guestfs-actions.pod:4142
11441 msgid "List all the block devices."
11445 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4144
11446 msgid "The full block device names are returned, eg. C</dev/sda>."
11450 #: ../fish/guestfish-actions.pod:2706
11451 msgid "list-dm-devices"
11455 #: ../fish/guestfish-actions.pod:2708
11458 " list-dm-devices\n"
11463 #: ../fish/guestfish-actions.pod:2710 ../src/guestfs-actions.pod:4159
11464 msgid "List all device mapper devices."
11468 #: ../fish/guestfish-actions.pod:2712
11470 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
11471 "previous call to L</luks-open>."
11475 #: ../fish/guestfish-actions.pod:2715
11477 "Device mapper devices which correspond to logical volumes are I<not> "
11478 "returned in this list. Call L</lvs> if you want to list logical volumes."
11482 #: ../fish/guestfish-actions.pod:2719
11483 msgid "list-filesystems"
11487 #: ../fish/guestfish-actions.pod:2721
11490 " list-filesystems\n"
11495 #: ../fish/guestfish-actions.pod:2723 ../src/guestfs-actions.pod:4179
11497 "This inspection command looks for filesystems on partitions, block devices "
11498 "and logical volumes, returning a list of devices containing filesystems and "
11503 #: ../fish/guestfish-actions.pod:2727 ../src/guestfs-actions.pod:4183
11505 "The return value is a hash, where the keys are the devices containing "
11506 "filesystems, and the values are the filesystem types. For example:"
11510 #: ../fish/guestfish-actions.pod:2731 ../src/guestfs-actions.pod:4187
11513 " \"/dev/sda1\" => \"ntfs\"\n"
11514 " \"/dev/sda2\" => \"ext2\"\n"
11515 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11516 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11521 #: ../fish/guestfish-actions.pod:2736 ../src/guestfs-actions.pod:4192
11523 "The value can have the special value \"unknown\", meaning the content of the "
11524 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11528 #: ../fish/guestfish-actions.pod:2740
11530 "This command runs other libguestfs commands, which might include L</mount> "
11531 "and L</umount>, and therefore you should use this soon after launch and only "
11532 "when nothing is mounted."
11536 #: ../fish/guestfish-actions.pod:2744
11538 "Not all of the filesystems returned will be mountable. In particular, swap "
11539 "partitions are returned in the list. Also this command does not check that "
11540 "each filesystem found is valid and mountable, and some filesystems might be "
11541 "mountable but require special options. Filesystems may not all belong to a "
11542 "single logical operating system (use L</inspect-os> to look for OSes)."
11546 #: ../fish/guestfish-actions.pod:2752
11547 msgid "list-partitions"
11551 #: ../fish/guestfish-actions.pod:2754
11554 " list-partitions\n"
11559 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4221
11560 msgid "List all the partitions detected on all block devices."
11564 #: ../fish/guestfish-actions.pod:2758 ../src/guestfs-actions.pod:4223
11565 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11569 #: ../fish/guestfish-actions.pod:2760
11571 "This does not return logical volumes. For that you will need to call L</"
11576 #: ../fish/guestfish-actions.pod:2765
11581 #: ../fish/guestfish-actions.pod:2767
11589 #: ../fish/guestfish-actions.pod:2769 ../src/guestfs-actions.pod:4242
11591 "List the files in C<directory> (relative to the root directory, there is no "
11592 "cwd) in the format of 'ls -la'."
11596 #: ../fish/guestfish-actions.pod:2772 ../src/guestfs-actions.pod:4245
11598 "This command is mostly useful for interactive sessions. It is I<not> "
11599 "intended that you try to parse the output string."
11603 #: ../fish/guestfish-actions.pod:2775
11608 #: ../fish/guestfish-actions.pod:2777
11611 " ln target linkname\n"
11616 #: ../fish/guestfish-actions.pod:2779 ../src/guestfs-actions.pod:4260
11617 msgid "This command creates a hard link using the C<ln> command."
11621 #: ../fish/guestfish-actions.pod:2781
11626 #: ../fish/guestfish-actions.pod:2783
11629 " ln-f target linkname\n"
11634 #: ../fish/guestfish-actions.pod:2785 ../src/guestfs-actions.pod:4273
11636 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11637 "option removes the link (C<linkname>) if it exists already."
11641 #: ../fish/guestfish-actions.pod:2788
11646 #: ../fish/guestfish-actions.pod:2790
11649 " ln-s target linkname\n"
11654 #: ../fish/guestfish-actions.pod:2792 ../src/guestfs-actions.pod:4287
11655 msgid "This command creates a symbolic link using the C<ln -s> command."
11659 #: ../fish/guestfish-actions.pod:2794
11664 #: ../fish/guestfish-actions.pod:2796
11667 " ln-sf target linkname\n"
11672 #: ../fish/guestfish-actions.pod:2798 ../src/guestfs-actions.pod:4300
11674 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11675 "option removes the link (C<linkname>) if it exists already."
11679 #: ../fish/guestfish-actions.pod:2801
11680 msgid "lremovexattr"
11684 #: ../fish/guestfish-actions.pod:2803
11687 " lremovexattr xattr path\n"
11692 #: ../fish/guestfish-actions.pod:2805
11694 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11695 "it removes an extended attribute of the link itself."
11699 #: ../fish/guestfish-actions.pod:2809
11704 #: ../fish/guestfish-actions.pod:2811
11712 #: ../fish/guestfish-actions.pod:2813 ../src/guestfs-actions.pod:4328
11714 "List the files in C<directory> (relative to the root directory, there is no "
11715 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
11719 #: ../fish/guestfish-actions.pod:2817
11721 "This command is mostly useful for interactive sessions. Programs should "
11722 "probably use L</readdir> instead."
11726 #: ../fish/guestfish-actions.pod:2820
11731 #: ../fish/guestfish-actions.pod:2822
11734 " lsetxattr xattr val vallen path\n"
11739 #: ../fish/guestfish-actions.pod:2824
11741 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11742 "sets an extended attribute of the link itself."
11746 #: ../fish/guestfish-actions.pod:2828
11751 #: ../fish/guestfish-actions.pod:2830
11759 #: ../fish/guestfish-actions.pod:2832 ../fish/guestfish-actions.pod:4656
11760 #: ../src/guestfs-actions.pod:4364 ../src/guestfs-actions.pod:7167
11761 msgid "Returns file information for the given C<path>."
11765 #: ../fish/guestfish-actions.pod:2834
11767 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11768 "the link is stat-ed, not the file it refers to."
11772 #: ../fish/guestfish-actions.pod:2838 ../src/guestfs-actions.pod:4370
11773 msgid "This is the same as the C<lstat(2)> system call."
11777 #: ../fish/guestfish-actions.pod:2840
11782 #: ../fish/guestfish-actions.pod:2842
11785 " lstatlist path 'names ...'\n"
11790 #: ../fish/guestfish-actions.pod:2844
11792 "This call allows you to perform the L</lstat> operation on multiple files, "
11793 "where all files are in the directory C<path>. C<names> is the list of files "
11794 "from this directory."
11798 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4389
11800 "On return you get a list of stat structs, with a one-to-one correspondence "
11801 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11802 "then the C<ino> field of that structure is set to C<-1>."
11806 #: ../fish/guestfish-actions.pod:2853
11808 "This call is intended for programs that want to efficiently list a directory "
11809 "contents without making many round-trips. See also L</lxattrlist> for a "
11810 "similarly efficient call for getting extended attributes. Very long "
11811 "directory listings might cause the protocol message size to be exceeded, "
11812 "causing this call to fail. The caller must split up such requests into "
11813 "smaller groups of names."
11817 #: ../fish/guestfish-actions.pod:2861
11818 msgid "luks-add-key"
11822 #: ../fish/guestfish-actions.pod:2863
11825 " luks-add-key device keyslot\n"
11830 #: ../fish/guestfish-actions.pod:2865 ../src/guestfs-actions.pod:4417
11832 "This command adds a new key on LUKS device C<device>. C<key> is any "
11833 "existing key, and is used to access the device. C<newkey> is the new key to "
11834 "add. C<keyslot> is the key slot that will be replaced."
11838 #: ../fish/guestfish-actions.pod:2870
11840 "Note that if C<keyslot> already contains a key, then this command will "
11841 "fail. You have to use L</luks-kill-slot> first to remove that key."
11845 #: ../fish/guestfish-actions.pod:2874 ../fish/guestfish-actions.pod:2896
11846 #: ../fish/guestfish-actions.pod:2909 ../fish/guestfish-actions.pod:2923
11847 #: ../fish/guestfish-actions.pod:2949 ../fish/guestfish-actions.pod:2959
11849 "This command has one or more key or passphrase parameters. Guestfish will "
11850 "prompt for these separately."
11854 #: ../fish/guestfish-actions.pod:2877
11859 #: ../fish/guestfish-actions.pod:2879
11862 " luks-close device\n"
11867 #: ../fish/guestfish-actions.pod:2881
11869 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
11870 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
11871 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
11876 #: ../fish/guestfish-actions.pod:2887
11877 msgid "luks-format"
11881 #: ../fish/guestfish-actions.pod:2889
11884 " luks-format device keyslot\n"
11889 #: ../fish/guestfish-actions.pod:2891 ../src/guestfs-actions.pod:4458
11891 "This command erases existing data on C<device> and formats the device as a "
11892 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11893 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11897 #: ../fish/guestfish-actions.pod:2899 ../fish/guestfish-actions.pod:2912
11898 #: ../fish/guestfish-actions.pod:2999 ../fish/guestfish-actions.pod:3650
11899 #: ../fish/guestfish-actions.pod:4190 ../fish/guestfish-actions.pod:4527
11900 #: ../fish/guestfish-actions.pod:4550 ../fish/guestfish-actions.pod:4572
11901 #: ../fish/guestfish-actions.pod:5318 ../src/guestfs-actions.pod:4465
11902 #: ../src/guestfs-actions.pod:4488 ../src/guestfs-actions.pod:4631
11903 #: ../src/guestfs-actions.pod:5724 ../src/guestfs-actions.pod:6530
11904 #: ../src/guestfs-actions.pod:6981 ../src/guestfs-actions.pod:7011
11905 #: ../src/guestfs-actions.pod:7044 ../src/guestfs-actions.pod:8243
11907 "B<This command is dangerous. Without careful use you can easily destroy all "
11912 #: ../fish/guestfish-actions.pod:2902
11913 msgid "luks-format-cipher"
11917 #: ../fish/guestfish-actions.pod:2904
11920 " luks-format-cipher device keyslot cipher\n"
11925 #: ../fish/guestfish-actions.pod:2906
11927 "This command is the same as L</luks-format> but it also allows you to set "
11928 "the C<cipher> used."
11932 #: ../fish/guestfish-actions.pod:2915
11933 msgid "luks-kill-slot"
11937 #: ../fish/guestfish-actions.pod:2917
11940 " luks-kill-slot device keyslot\n"
11945 #: ../fish/guestfish-actions.pod:2919 ../src/guestfs-actions.pod:4505
11947 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11948 "device C<device>. C<key> must be one of the I<other> keys."
11952 #: ../fish/guestfish-actions.pod:2926
11957 #: ../fish/guestfish-actions.pod:2928
11960 " luks-open device mapname\n"
11965 #: ../fish/guestfish-actions.pod:2930 ../src/guestfs-actions.pod:4525
11967 "This command opens a block device which has been encrypted according to the "
11968 "Linux Unified Key Setup (LUKS) standard."
11972 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4528
11973 msgid "C<device> is the encrypted block device or partition."
11977 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4530
11979 "The caller must supply one of the keys associated with the LUKS block "
11980 "device, in the C<key> parameter."
11984 #: ../fish/guestfish-actions.pod:2938 ../src/guestfs-actions.pod:4533
11986 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11987 "writes to this block device are decrypted from and encrypted to the "
11988 "underlying C<device> respectively."
11992 #: ../fish/guestfish-actions.pod:2942
11994 "If this block device contains LVM volume groups, then calling L</vgscan> "
11995 "followed by L</vg-activate-all> will make them visible."
11999 #: ../fish/guestfish-actions.pod:2946
12000 msgid "Use L</list-dm-devices> to list all device mapper devices."
12004 #: ../fish/guestfish-actions.pod:2952
12005 msgid "luks-open-ro"
12009 #: ../fish/guestfish-actions.pod:2954
12012 " luks-open-ro device mapname\n"
12017 #: ../fish/guestfish-actions.pod:2956
12019 "This is the same as L</luks-open> except that a read-only mapping is created."
12023 #: ../fish/guestfish-actions.pod:2962
12028 #: ../fish/guestfish-actions.pod:2964
12031 " lvcreate logvol volgroup mbytes\n"
12036 #: ../fish/guestfish-actions.pod:2966 ../src/guestfs-actions.pod:4579
12038 "This creates an LVM logical volume called C<logvol> on the volume group "
12039 "C<volgroup>, with C<size> megabytes."
12043 #: ../fish/guestfish-actions.pod:2969
12044 msgid "lvm-canonical-lv-name"
12048 #: ../fish/guestfish-actions.pod:2971
12051 " lvm-canonical-lv-name lvname\n"
12056 #: ../fish/guestfish-actions.pod:2973 ../src/guestfs-actions.pod:4592
12058 "This converts alternative naming schemes for LVs that you might find to the "
12059 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
12064 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4596
12066 "This command returns an error if the C<lvname> parameter does not refer to a "
12071 #: ../fish/guestfish-actions.pod:2980
12072 msgid "See also L</is-lv>."
12076 #: ../fish/guestfish-actions.pod:2982
12077 msgid "lvm-clear-filter"
12081 #: ../fish/guestfish-actions.pod:2984
12084 " lvm-clear-filter\n"
12089 #: ../fish/guestfish-actions.pod:2986
12091 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
12096 #: ../fish/guestfish-actions.pod:2989 ../fish/guestfish-actions.pod:3020
12097 #: ../src/guestfs-actions.pod:4614 ../src/guestfs-actions.pod:4656
12099 "This command also clears the LVM cache and performs a volume group scan."
12103 #: ../fish/guestfish-actions.pod:2992
12104 msgid "lvm-remove-all"
12108 #: ../fish/guestfish-actions.pod:2994
12111 " lvm-remove-all\n"
12116 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4626
12118 "This command removes all LVM logical volumes, volume groups and physical "
12123 #: ../fish/guestfish-actions.pod:3002
12124 msgid "lvm-set-filter"
12128 #: ../fish/guestfish-actions.pod:3004
12131 " lvm-set-filter 'devices ...'\n"
12136 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4642
12138 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
12139 "block devices in the list C<devices>, and will ignore all other attached "
12144 #: ../fish/guestfish-actions.pod:3010 ../src/guestfs-actions.pod:4646
12146 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12147 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12148 "there are two types of duplication possible: either cloned PVs/VGs which "
12149 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12150 "same name. In normal operation you cannot create this situation, but you "
12151 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12152 "inside the LVM metadata."
12156 #: ../fish/guestfish-actions.pod:3023 ../src/guestfs-actions.pod:4659
12157 msgid "You can filter whole block devices or individual partitions."
12161 #: ../fish/guestfish-actions.pod:3025 ../src/guestfs-actions.pod:4661
12163 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12164 "filesystem), even if you are not filtering out that VG."
12168 #: ../fish/guestfish-actions.pod:3029
12173 #: ../fish/guestfish-actions.pod:3031
12176 " lvremove device\n"
12181 #: ../fish/guestfish-actions.pod:3033 ../src/guestfs-actions.pod:4675
12183 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12184 "LV, such as C</dev/VG/LV>."
12188 #: ../fish/guestfish-actions.pod:3036 ../src/guestfs-actions.pod:4678
12190 "You can also remove all LVs in a volume group by specifying the VG name, C</"
12195 #: ../fish/guestfish-actions.pod:3039
12200 #: ../fish/guestfish-actions.pod:3041
12203 " lvrename logvol newlogvol\n"
12208 #: ../fish/guestfish-actions.pod:3043 ../src/guestfs-actions.pod:4692
12209 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
12213 #: ../fish/guestfish-actions.pod:3045
12218 #: ../fish/guestfish-actions.pod:3047
12221 " lvresize device mbytes\n"
12226 #: ../fish/guestfish-actions.pod:3049 ../src/guestfs-actions.pod:4705
12228 "This resizes (expands or shrinks) an existing LVM logical volume to "
12229 "C<mbytes>. When reducing, data in the reduced part is lost."
12233 #: ../fish/guestfish-actions.pod:3053
12234 msgid "lvresize-free"
12238 #: ../fish/guestfish-actions.pod:3055
12241 " lvresize-free lv percent\n"
12246 #: ../fish/guestfish-actions.pod:3057 ../src/guestfs-actions.pod:4720
12248 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
12249 "remaining free space in the volume group. Commonly you would call this with "
12250 "pc = 100 which expands the logical volume as much as possible, using all "
12251 "remaining free space in the volume group."
12255 #: ../fish/guestfish-actions.pod:3063
12260 #: ../fish/guestfish-actions.pod:3065
12268 #: ../fish/guestfish-actions.pod:3067 ../src/guestfs-actions.pod:4735
12270 "List all the logical volumes detected. This is the equivalent of the L<lvs"
12275 #: ../fish/guestfish-actions.pod:3070 ../src/guestfs-actions.pod:4738
12277 "This returns a list of the logical volume device names (eg. C</dev/"
12278 "VolGroup00/LogVol00>)."
12282 #: ../fish/guestfish-actions.pod:3073
12283 msgid "See also L</lvs-full>, L</list-filesystems>."
12287 #: ../fish/guestfish-actions.pod:3075
12292 #: ../fish/guestfish-actions.pod:3077
12300 #: ../fish/guestfish-actions.pod:3079 ../src/guestfs-actions.pod:4754
12302 "List all the logical volumes detected. This is the equivalent of the L<lvs"
12303 "(8)> command. The \"full\" version includes all fields."
12307 #: ../fish/guestfish-actions.pod:3082
12312 #: ../fish/guestfish-actions.pod:3084
12320 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4769
12321 msgid "This command returns the UUID of the LVM LV C<device>."
12325 #: ../fish/guestfish-actions.pod:3088
12330 #: ../fish/guestfish-actions.pod:3090
12333 " lxattrlist path 'names ...'\n"
12338 #: ../fish/guestfish-actions.pod:3092 ../src/guestfs-actions.pod:4783
12340 "This call allows you to get the extended attributes of multiple files, where "
12341 "all files are in the directory C<path>. C<names> is the list of files from "
12346 #: ../fish/guestfish-actions.pod:3096 ../src/guestfs-actions.pod:4787
12348 "On return you get a flat list of xattr structs which must be interpreted "
12349 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
12350 "C<attrval> in this struct is zero-length to indicate there was an error "
12351 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
12352 "number (the number of following attributes for this file, which could be C<"
12353 "\"0\">). Then after the first xattr struct are the zero or more attributes "
12354 "for the first named file. This repeats for the second and subsequent files."
12358 #: ../fish/guestfish-actions.pod:3106
12360 "This call is intended for programs that want to efficiently list a directory "
12361 "contents without making many round-trips. See also L</lstatlist> for a "
12362 "similarly efficient call for getting standard stats. Very long directory "
12363 "listings might cause the protocol message size to be exceeded, causing this "
12364 "call to fail. The caller must split up such requests into smaller groups of "
12369 #: ../fish/guestfish-actions.pod:3114
12374 #: ../fish/guestfish-actions.pod:3116
12382 #: ../fish/guestfish-actions.pod:3118 ../src/guestfs-actions.pod:4817
12383 msgid "Create a directory named C<path>."
12387 #: ../fish/guestfish-actions.pod:3120
12392 #: ../fish/guestfish-actions.pod:3122
12395 " mkdir-mode path mode\n"
12400 #: ../fish/guestfish-actions.pod:3124 ../src/guestfs-actions.pod:4830
12402 "This command creates a directory, setting the initial permissions of the "
12403 "directory to C<mode>."
12407 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4833
12409 "For common Linux filesystems, the actual mode which is set will be C<mode & "
12410 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
12415 #: ../fish/guestfish-actions.pod:3131
12416 msgid "See also L</mkdir>, L</umask>"
12420 #: ../fish/guestfish-actions.pod:3133
12425 #: ../fish/guestfish-actions.pod:3135
12433 #: ../fish/guestfish-actions.pod:3137 ../src/guestfs-actions.pod:4849
12435 "Create a directory named C<path>, creating any parent directories as "
12436 "necessary. This is like the C<mkdir -p> shell command."
12440 #: ../fish/guestfish-actions.pod:3140
12445 #: ../fish/guestfish-actions.pod:3142
12448 " mkdtemp template\n"
12453 #: ../fish/guestfish-actions.pod:3144 ../src/guestfs-actions.pod:4862
12455 "This command creates a temporary directory. The C<template> parameter "
12456 "should be a full pathname for the temporary directory name with the final "
12457 "six characters being \"XXXXXX\"."
12461 #: ../fish/guestfish-actions.pod:3149 ../src/guestfs-actions.pod:4867
12463 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12464 "being suitable for Windows filesystems."
12468 #: ../fish/guestfish-actions.pod:3152 ../src/guestfs-actions.pod:4870
12469 msgid "The name of the temporary directory that was created is returned."
12473 #: ../fish/guestfish-actions.pod:3155 ../src/guestfs-actions.pod:4873
12474 msgid "The temporary directory is created with mode 0700 and is owned by root."
12478 #: ../fish/guestfish-actions.pod:3158 ../src/guestfs-actions.pod:4876
12480 "The caller is responsible for deleting the temporary directory and its "
12481 "contents after use."
12485 #: ../fish/guestfish-actions.pod:3161 ../src/guestfs-actions.pod:4879
12486 msgid "See also: L<mkdtemp(3)>"
12490 #: ../fish/guestfish-actions.pod:3163
12495 #: ../fish/guestfish-actions.pod:3165
12498 " mke2fs-J fstype blocksize device journal\n"
12503 #: ../fish/guestfish-actions.pod:3167 ../src/guestfs-actions.pod:4895
12505 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12506 "C<journal>. It is equivalent to the command:"
12510 #: ../fish/guestfish-actions.pod:3171 ../src/guestfs-actions.pod:4899
12513 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
12518 #: ../fish/guestfish-actions.pod:3173
12519 msgid "See also L</mke2journal>."
12523 #: ../fish/guestfish-actions.pod:3175
12528 #: ../fish/guestfish-actions.pod:3177
12531 " mke2fs-JL fstype blocksize device label\n"
12536 #: ../fish/guestfish-actions.pod:3179 ../src/guestfs-actions.pod:4916
12538 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12539 "the journal labeled C<label>."
12543 #: ../fish/guestfish-actions.pod:3182
12544 msgid "See also L</mke2journal-L>."
12548 #: ../fish/guestfish-actions.pod:3184
12553 #: ../fish/guestfish-actions.pod:3186
12556 " mke2fs-JU fstype blocksize device uuid\n"
12561 #: ../fish/guestfish-actions.pod:3188 ../src/guestfs-actions.pod:4934
12563 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12564 "the journal with UUID C<uuid>."
12568 #: ../fish/guestfish-actions.pod:3191
12569 msgid "See also L</mke2journal-U>."
12573 #: ../fish/guestfish-actions.pod:3193
12574 msgid "mke2journal"
12578 #: ../fish/guestfish-actions.pod:3195
12581 " mke2journal blocksize device\n"
12586 #: ../fish/guestfish-actions.pod:3197 ../src/guestfs-actions.pod:4950
12588 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12593 #: ../fish/guestfish-actions.pod:3200 ../src/guestfs-actions.pod:4953
12596 " mke2fs -O journal_dev -b blocksize device\n"
12601 #: ../fish/guestfish-actions.pod:3202
12602 msgid "mke2journal-L"
12606 #: ../fish/guestfish-actions.pod:3204
12609 " mke2journal-L blocksize label device\n"
12614 #: ../fish/guestfish-actions.pod:3206 ../src/guestfs-actions.pod:4967
12615 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12619 #: ../fish/guestfish-actions.pod:3208
12620 msgid "mke2journal-U"
12624 #: ../fish/guestfish-actions.pod:3210
12627 " mke2journal-U blocksize uuid device\n"
12632 #: ../fish/guestfish-actions.pod:3212 ../src/guestfs-actions.pod:4981
12633 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12637 #: ../fish/guestfish-actions.pod:3214
12642 #: ../fish/guestfish-actions.pod:3216
12645 " mkfifo mode path\n"
12650 #: ../fish/guestfish-actions.pod:3218
12652 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12653 "is just a convenient wrapper around L</mknod>."
12657 #: ../fish/guestfish-actions.pod:3224
12662 #: ../fish/guestfish-actions.pod:3226
12665 " mkfs fstype device\n"
12670 #: ../fish/guestfish-actions.pod:3228 ../src/guestfs-actions.pod:5011
12672 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12673 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12677 #: ../fish/guestfish-actions.pod:3232
12682 #: ../fish/guestfish-actions.pod:3234
12685 " mkfs-b fstype blocksize device\n"
12690 #: ../fish/guestfish-actions.pod:3236
12692 "This call is similar to L</mkfs>, but it allows you to control the block "
12693 "size of the resulting filesystem. Supported block sizes depend on the "
12694 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12698 #: ../fish/guestfish-actions.pod:3241 ../fish/guestfish-actions.pod:3268
12699 #: ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5077
12701 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12706 #: ../fish/guestfish-actions.pod:3244
12708 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
12713 #: ../fish/guestfish-actions.pod:3251
12718 #: ../fish/guestfish-actions.pod:3253
12721 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
12726 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:5064
12728 "This function creates a filesystem on C<device>. The filesystem type is "
12729 "C<fstype>, for example C<ext3>."
12733 #: ../fish/guestfish-actions.pod:3262 ../src/guestfs-actions.pod:5071
12734 msgid "C<blocksize>"
12738 #: ../fish/guestfish-actions.pod:3264 ../src/guestfs-actions.pod:5073
12740 "The filesystem block size. Supported block sizes depend on the filesystem "
12741 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12746 #: ../fish/guestfish-actions.pod:3271 ../src/guestfs-actions.pod:5080
12747 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12751 #: ../fish/guestfish-actions.pod:3273 ../src/guestfs-actions.pod:5082
12752 msgid "C<features>"
12756 #: ../fish/guestfish-actions.pod:3275 ../src/guestfs-actions.pod:5084
12757 msgid "This passes the I<-O> parameter to the external mkfs program."
12761 #: ../fish/guestfish-actions.pod:3277 ../src/guestfs-actions.pod:5086
12763 "For certain filesystem types, this allows extra filesystem features to be "
12764 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12768 #: ../fish/guestfish-actions.pod:3281 ../src/guestfs-actions.pod:5090
12770 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12775 #: ../fish/guestfish-actions.pod:3284 ../src/guestfs-actions.pod:5093
12780 #: ../fish/guestfish-actions.pod:3286 ../src/guestfs-actions.pod:5095
12782 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12783 "sets the inode size (only for ext2/3/4 filesystems at present)."
12787 #: ../fish/guestfish-actions.pod:3289 ../src/guestfs-actions.pod:5098
12788 msgid "C<sectorsize>"
12792 #: ../fish/guestfish-actions.pod:3291 ../src/guestfs-actions.pod:5100
12794 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12795 "sets sector size for ufs filesystem."
12799 #: ../fish/guestfish-actions.pod:3298
12800 msgid "mkmountpoint"
12804 #: ../fish/guestfish-actions.pod:3300
12807 " mkmountpoint exemptpath\n"
12812 #: ../fish/guestfish-actions.pod:3302
12814 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12815 "to create extra mountpoints before mounting the first filesystem."
12819 #: ../fish/guestfish-actions.pod:3306 ../src/guestfs-actions.pod:5143
12821 "These calls are I<only> necessary in some very limited circumstances, mainly "
12822 "the case where you want to mount a mix of unrelated and/or read-only "
12823 "filesystems together."
12827 #: ../fish/guestfish-actions.pod:3310 ../src/guestfs-actions.pod:5147
12829 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12830 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12831 "inside that. You can unpack this as follows in guestfish:"
12835 #: ../fish/guestfish-actions.pod:3315 ../src/guestfs-actions.pod:5152
12838 " add-ro Fedora-11-i686-Live.iso\n"
12840 " mkmountpoint /cd\n"
12841 " mkmountpoint /sqsh\n"
12842 " mkmountpoint /ext3fs\n"
12843 " mount /dev/sda /cd\n"
12844 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12845 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12850 #: ../fish/guestfish-actions.pod:3324 ../src/guestfs-actions.pod:5161
12851 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12855 #: ../fish/guestfish-actions.pod:3326
12857 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12858 "unexpected errors if you try to mix these calls. It is safest to manually "
12859 "unmount filesystems and remove mountpoints after use."
12863 #: ../fish/guestfish-actions.pod:3330
12865 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12866 "for this to work for manual mountpoints, you must ensure that the innermost "
12867 "mountpoints have the longest pathnames, as in the example code above."
12871 #: ../fish/guestfish-actions.pod:3335 ../src/guestfs-actions.pod:5172
12873 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12877 #: ../fish/guestfish-actions.pod:3337
12879 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12880 "L</umount-all> to be called when the handle is closed which can also trigger "
12885 #: ../fish/guestfish-actions.pod:3341
12890 #: ../fish/guestfish-actions.pod:3343
12893 " mknod mode devmajor devminor path\n"
12898 #: ../fish/guestfish-actions.pod:3345 ../src/guestfs-actions.pod:5191
12900 "This call creates block or character special devices, or named pipes (FIFOs)."
12904 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5194
12906 "The C<mode> parameter should be the mode, using the standard constants. "
12907 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12908 "used when creating block and character special devices."
12912 #: ../fish/guestfish-actions.pod:3353
12914 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12915 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12916 "regular file). These constants are available in the standard Linux header "
12917 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12918 "wrappers around this command which bitwise OR in the appropriate constant "
12923 #: ../fish/guestfish-actions.pod:3363
12928 #: ../fish/guestfish-actions.pod:3365
12931 " mknod-b mode devmajor devminor path\n"
12936 #: ../fish/guestfish-actions.pod:3367
12938 "This call creates a block device node called C<path> with mode C<mode> and "
12939 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12940 "wrapper around L</mknod>."
12944 #: ../fish/guestfish-actions.pod:3373
12949 #: ../fish/guestfish-actions.pod:3375
12952 " mknod-c mode devmajor devminor path\n"
12957 #: ../fish/guestfish-actions.pod:3377
12959 "This call creates a char device node called C<path> with mode C<mode> and "
12960 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12961 "wrapper around L</mknod>."
12965 #: ../fish/guestfish-actions.pod:3383
12970 #: ../fish/guestfish-actions.pod:3385
12978 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5257
12979 msgid "Create a swap partition on C<device>."
12983 #: ../fish/guestfish-actions.pod:3389
12988 #: ../fish/guestfish-actions.pod:3391
12991 " mkswap-L label device\n"
12996 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5270
12997 msgid "Create a swap partition on C<device> with label C<label>."
13001 #: ../fish/guestfish-actions.pod:3395 ../src/guestfs-actions.pod:5272
13003 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
13004 "sda>), just to a partition. This appears to be a limitation of the kernel "
13009 #: ../fish/guestfish-actions.pod:3399
13014 #: ../fish/guestfish-actions.pod:3401
13017 " mkswap-U uuid device\n"
13022 #: ../fish/guestfish-actions.pod:3403 ../src/guestfs-actions.pod:5287
13023 msgid "Create a swap partition on C<device> with UUID C<uuid>."
13027 #: ../fish/guestfish-actions.pod:3405
13028 msgid "mkswap-file"
13032 #: ../fish/guestfish-actions.pod:3407
13035 " mkswap-file path\n"
13040 #: ../fish/guestfish-actions.pod:3409 ../src/guestfs-actions.pod:5299
13041 msgid "Create a swap file."
13045 #: ../fish/guestfish-actions.pod:3411
13047 "This command just writes a swap file signature to an existing file. To "
13048 "create the file itself, use something like L</fallocate>."
13052 #: ../fish/guestfish-actions.pod:3414
13057 #: ../fish/guestfish-actions.pod:3416
13060 " modprobe modulename\n"
13065 #: ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:5314
13066 msgid "This loads a kernel module in the appliance."
13070 #: ../fish/guestfish-actions.pod:3420 ../src/guestfs-actions.pod:5316
13072 "The kernel module must have been whitelisted when libguestfs was built (see "
13073 "C<appliance/kmod.whitelist.in> in the source)."
13077 #: ../fish/guestfish-actions.pod:3423
13082 #: ../fish/guestfish-actions.pod:3425
13085 " mount device mountpoint\n"
13090 #: ../fish/guestfish-actions.pod:3427 ../src/guestfs-actions.pod:5330
13092 "Mount a guest disk at a position in the filesystem. Block devices are named "
13093 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
13094 "those block devices contain partitions, they will have the usual names (eg. "
13095 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
13099 #: ../fish/guestfish-actions.pod:3433 ../src/guestfs-actions.pod:5336
13101 "The rules are the same as for L<mount(2)>: A filesystem must first be "
13102 "mounted on C</> before others can be mounted. Other filesystems can only be "
13103 "mounted on directories which already exist."
13107 #: ../fish/guestfish-actions.pod:3438 ../src/guestfs-actions.pod:5341
13109 "The mounted filesystem is writable, if we have sufficient permissions on the "
13110 "underlying device."
13114 #: ../fish/guestfish-actions.pod:3441
13116 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
13117 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
13118 "problems for users. If your program might need to work with older versions "
13119 "of libguestfs, use L</mount-options> instead (using an empty string for the "
13120 "first parameter if you don't want any options)."
13124 #: ../fish/guestfish-actions.pod:3448
13129 #: ../fish/guestfish-actions.pod:3450
13132 " mount-9p mounttag mountpoint [options:..]\n"
13137 #: ../fish/guestfish-actions.pod:3452 ../src/guestfs-actions.pod:5370
13139 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
13144 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5373
13146 "If required, C<trans=virtio> will be automatically added to the options. "
13147 "Any other options required can be passed in the optional C<options> "
13152 #: ../fish/guestfish-actions.pod:3461
13157 #: ../fish/guestfish-actions.pod:3463
13160 " mount-loop file mountpoint\n"
13165 #: ../fish/guestfish-actions.pod:3465 ../src/guestfs-actions.pod:5412
13167 "This command lets you mount C<file> (a filesystem image in a file) on a "
13168 "mount point. It is entirely equivalent to the command C<mount -o loop file "
13173 #: ../fish/guestfish-actions.pod:3469
13174 msgid "mount-options"
13178 #: ../fish/guestfish-actions.pod:3471
13181 " mount-options options device mountpoint\n"
13186 #: ../fish/guestfish-actions.pod:3473
13188 "This is the same as the L</mount> command, but it allows you to set the "
13189 "mount options as for the L<mount(8)> I<-o> flag."
13193 #: ../fish/guestfish-actions.pod:3477 ../src/guestfs-actions.pod:5432
13195 "If the C<options> parameter is an empty string, then no options are passed "
13196 "(all options default to whatever the filesystem uses)."
13200 #: ../fish/guestfish-actions.pod:3481
13205 #: ../fish/guestfish-actions.pod:3483
13208 " mount-ro device mountpoint\n"
13213 #: ../fish/guestfish-actions.pod:3485
13215 "This is the same as the L</mount> command, but it mounts the filesystem with "
13216 "the read-only (I<-o ro>) flag."
13220 #: ../fish/guestfish-actions.pod:3488
13225 #: ../fish/guestfish-actions.pod:3490
13228 " mount-vfs options vfstype device mountpoint\n"
13233 #: ../fish/guestfish-actions.pod:3492
13235 "This is the same as the L</mount> command, but it allows you to set both the "
13236 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
13240 #: ../fish/guestfish-actions.pod:3496
13241 msgid "mountpoints"
13245 #: ../fish/guestfish-actions.pod:3498
13253 #: ../fish/guestfish-actions.pod:3500
13255 "This call is similar to L</mounts>. That call returns a list of devices. "
13256 "This one returns a hash table (map) of device name to directory where the "
13257 "device is mounted."
13261 #: ../fish/guestfish-actions.pod:3504
13266 #: ../fish/guestfish-actions.pod:3506
13274 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5493
13276 "This returns the list of currently mounted filesystems. It returns the list "
13277 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
13281 #: ../fish/guestfish-actions.pod:3511 ../src/guestfs-actions.pod:5496
13282 msgid "Some internal mounts are not shown."
13286 #: ../fish/guestfish-actions.pod:3513
13287 msgid "See also: L</mountpoints>"
13291 #: ../fish/guestfish-actions.pod:3515
13296 #: ../fish/guestfish-actions.pod:3517
13304 #: ../fish/guestfish-actions.pod:3519 ../src/guestfs-actions.pod:5513
13306 "This moves a file from C<src> to C<dest> where C<dest> is either a "
13307 "destination filename or destination directory."
13311 #: ../fish/guestfish-actions.pod:3522
13312 msgid "ntfs-3g-probe"
13316 #: ../fish/guestfish-actions.pod:3524
13319 " ntfs-3g-probe true|false device\n"
13324 #: ../fish/guestfish-actions.pod:3526 ../src/guestfs-actions.pod:5527
13326 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
13327 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
13328 "write, and some cannot be mounted at all)."
13332 #: ../fish/guestfish-actions.pod:3530 ../src/guestfs-actions.pod:5531
13334 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
13335 "can be mounted read-write. Set it to false if you want to test if the "
13336 "volume can be mounted read-only."
13340 #: ../fish/guestfish-actions.pod:3534 ../src/guestfs-actions.pod:5535
13342 "The return value is an integer which C<0> if the operation would succeed, or "
13343 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
13347 #: ../fish/guestfish-actions.pod:3538
13352 #: ../fish/guestfish-actions.pod:3540
13355 " ntfsresize device\n"
13360 #: ../fish/guestfish-actions.pod:3542 ../fish/guestfish-actions.pod:3566
13361 #: ../src/guestfs-actions.pod:5556 ../src/guestfs-actions.pod:5588
13363 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
13364 "size of the underlying device."
13368 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5559
13370 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
13371 "consistency check (for safety). You have to boot into Windows to perform "
13372 "this check and clear this condition. Furthermore, ntfsresize refuses to "
13373 "resize filesystems which have been marked in this way. So in effect it is "
13374 "not possible to call ntfsresize multiple times on a single filesystem "
13375 "without booting into Windows between each resize."
13379 #: ../fish/guestfish-actions.pod:3553 ../fish/guestfish-actions.pod:3592
13380 #: ../src/guestfs-actions.pod:5567 ../src/guestfs-actions.pod:5614
13381 msgid "See also L<ntfsresize(8)>."
13385 #: ../fish/guestfish-actions.pod:3555 ../fish/guestfish-actions.pod:3603
13387 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
13392 #: ../fish/guestfish-actions.pod:3562
13393 msgid "ntfsresize-opts"
13397 #: ../fish/guestfish-actions.pod:3564
13400 " ntfsresize-opts device [size:..] [force:..]\n"
13405 #: ../fish/guestfish-actions.pod:3575 ../src/guestfs-actions.pod:5597
13407 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
13408 "resized to fit the container (eg. partition)."
13412 #: ../fish/guestfish-actions.pod:3578 ../src/guestfs-actions.pod:5600
13417 #: ../fish/guestfish-actions.pod:3580 ../src/guestfs-actions.pod:5602
13419 "If this option is true, then force the resize of the filesystem even if the "
13420 "filesystem is marked as requiring a consistency check."
13424 #: ../fish/guestfish-actions.pod:3583
13426 "After the resize operation, the filesystem is always marked as requiring a "
13427 "consistency check (for safety). You have to boot into Windows to perform "
13428 "this check and clear this condition. If you I<don't> set the C<force> "
13429 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
13430 "a single filesystem without booting into Windows between each resize."
13434 #: ../fish/guestfish-actions.pod:3596
13435 msgid "ntfsresize-size"
13439 #: ../fish/guestfish-actions.pod:3598
13442 " ntfsresize-size device size\n"
13447 #: ../fish/guestfish-actions.pod:3600
13449 "This command is the same as L</ntfsresize> except that it allows you to "
13450 "specify the new size (in bytes) explicitly."
13454 #: ../fish/guestfish-actions.pod:3610
13459 #: ../fish/guestfish-actions.pod:3612
13462 " part-add device prlogex startsect endsect\n"
13467 #: ../fish/guestfish-actions.pod:3614
13469 "This command adds a partition to C<device>. If there is no partition table "
13470 "on the device, call L</part-init> first."
13474 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5675
13476 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13477 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13478 "C<logical>) and C<e> (or C<extended>) partition types."
13482 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5680
13484 "C<startsect> and C<endsect> are the start and end of the partition in "
13485 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13486 "from the end of the disk (C<-1> is the last sector)."
13490 #: ../fish/guestfish-actions.pod:3626
13492 "Creating a partition which covers the whole disk is not so easy. Use L</"
13493 "part-disk> to do that."
13497 #: ../fish/guestfish-actions.pod:3629
13502 #: ../fish/guestfish-actions.pod:3631
13505 " part-del device partnum\n"
13510 #: ../fish/guestfish-actions.pod:3633 ../src/guestfs-actions.pod:5698
13511 msgid "This command deletes the partition numbered C<partnum> on C<device>."
13515 #: ../fish/guestfish-actions.pod:3635 ../src/guestfs-actions.pod:5700
13517 "Note that in the case of MBR partitioning, deleting an extended partition "
13518 "also deletes any logical partitions it contains."
13522 #: ../fish/guestfish-actions.pod:3639
13527 #: ../fish/guestfish-actions.pod:3641
13530 " part-disk device parttype\n"
13535 #: ../fish/guestfish-actions.pod:3643
13537 "This command is simply a combination of L</part-init> followed by L</part-"
13538 "add> to create a single primary partition covering the whole disk."
13542 #: ../fish/guestfish-actions.pod:3647
13544 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
13545 "possible values are described in L</part-init>."
13549 #: ../fish/guestfish-actions.pod:3653
13550 msgid "part-get-bootable"
13554 #: ../fish/guestfish-actions.pod:3655
13557 " part-get-bootable device partnum\n"
13562 #: ../fish/guestfish-actions.pod:3657 ../src/guestfs-actions.pod:5736
13564 "This command returns true if the partition C<partnum> on C<device> has the "
13565 "bootable flag set."
13569 #: ../fish/guestfish-actions.pod:3660
13570 msgid "See also L</part-set-bootable>."
13574 #: ../fish/guestfish-actions.pod:3662
13575 msgid "part-get-mbr-id"
13579 #: ../fish/guestfish-actions.pod:3664
13582 " part-get-mbr-id device partnum\n"
13587 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5752
13589 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13590 "partition C<partnum>."
13594 #: ../fish/guestfish-actions.pod:3669 ../fish/guestfish-actions.pod:3813
13596 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13597 "undefined results for other partition table types (see L</part-get-"
13602 #: ../fish/guestfish-actions.pod:3673
13603 msgid "part-get-parttype"
13607 #: ../fish/guestfish-actions.pod:3675
13610 " part-get-parttype device\n"
13615 #: ../fish/guestfish-actions.pod:3677 ../src/guestfs-actions.pod:5769
13617 "This command examines the partition table on C<device> and returns the "
13618 "partition table type (format) being used."
13622 #: ../fish/guestfish-actions.pod:3680
13624 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13625 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13626 "possible, although unusual. See L</part-init> for a full list."
13630 #: ../fish/guestfish-actions.pod:3685
13635 #: ../fish/guestfish-actions.pod:3687
13638 " part-init device parttype\n"
13643 #: ../fish/guestfish-actions.pod:3689 ../src/guestfs-actions.pod:5789
13645 "This creates an empty partition table on C<device> of one of the partition "
13646 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
13647 "(for large disks)."
13651 #: ../fish/guestfish-actions.pod:3693
13653 "Initially there are no partitions. Following this, you should call L</part-"
13654 "add> for each partition required."
13658 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5796
13659 msgid "Possible values for C<parttype> are:"
13663 #: ../fish/guestfish-actions.pod:3700 ../src/guestfs-actions.pod:5800
13668 #: ../fish/guestfish-actions.pod:3702 ../src/guestfs-actions.pod:5802
13673 #: ../fish/guestfish-actions.pod:3704 ../src/guestfs-actions.pod:5804
13674 msgid "Intel EFI / GPT partition table."
13678 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5806
13680 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13681 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13682 "the C<mbr> format."
13686 #: ../fish/guestfish-actions.pod:3710 ../src/guestfs-actions.pod:5810
13691 #: ../fish/guestfish-actions.pod:3712 ../src/guestfs-actions.pod:5812
13696 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5814
13698 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13699 "Windows. This partition type will B<only> work for device sizes up to 2 "
13700 "TB. For large disks we recommend using C<gpt>."
13704 #: ../fish/guestfish-actions.pod:3721 ../src/guestfs-actions.pod:5821
13706 "Other partition table types that may work but are not supported include:"
13710 #: ../fish/guestfish-actions.pod:3726 ../src/guestfs-actions.pod:5826
13715 #: ../fish/guestfish-actions.pod:3728 ../src/guestfs-actions.pod:5828
13716 msgid "AIX disk labels."
13720 #: ../fish/guestfish-actions.pod:3730 ../src/guestfs-actions.pod:5830
13725 #: ../fish/guestfish-actions.pod:3732 ../src/guestfs-actions.pod:5832
13730 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5834
13731 msgid "Amiga \"Rigid Disk Block\" format."
13735 #: ../fish/guestfish-actions.pod:3736 ../src/guestfs-actions.pod:5836
13740 #: ../fish/guestfish-actions.pod:3738 ../src/guestfs-actions.pod:5838
13741 msgid "BSD disk labels."
13745 #: ../fish/guestfish-actions.pod:3740 ../src/guestfs-actions.pod:5840
13750 #: ../fish/guestfish-actions.pod:3742 ../src/guestfs-actions.pod:5842
13751 msgid "DASD, used on IBM mainframes."
13755 #: ../fish/guestfish-actions.pod:3744 ../src/guestfs-actions.pod:5844
13760 #: ../fish/guestfish-actions.pod:3746 ../src/guestfs-actions.pod:5846
13761 msgid "MIPS/SGI volumes."
13765 #: ../fish/guestfish-actions.pod:3748 ../src/guestfs-actions.pod:5848
13770 #: ../fish/guestfish-actions.pod:3750 ../src/guestfs-actions.pod:5850
13771 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13775 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5852
13780 #: ../fish/guestfish-actions.pod:3754 ../src/guestfs-actions.pod:5854
13781 msgid "NEC PC-98 format, common in Japan apparently."
13785 #: ../fish/guestfish-actions.pod:3756 ../src/guestfs-actions.pod:5856
13790 #: ../fish/guestfish-actions.pod:3758 ../src/guestfs-actions.pod:5858
13791 msgid "Sun disk labels."
13795 #: ../fish/guestfish-actions.pod:3762
13800 #: ../fish/guestfish-actions.pod:3764
13803 " part-list device\n"
13808 #: ../fish/guestfish-actions.pod:3766 ../src/guestfs-actions.pod:5872
13810 "This command parses the partition table on C<device> and returns the list of "
13811 "partitions found."
13815 #: ../fish/guestfish-actions.pod:3769 ../src/guestfs-actions.pod:5875
13816 msgid "The fields in the returned structure are:"
13820 #: ../fish/guestfish-actions.pod:3773 ../src/guestfs-actions.pod:5879
13821 msgid "B<part_num>"
13825 #: ../fish/guestfish-actions.pod:3775 ../src/guestfs-actions.pod:5881
13826 msgid "Partition number, counting from 1."
13830 #: ../fish/guestfish-actions.pod:3777 ../src/guestfs-actions.pod:5883
13831 msgid "B<part_start>"
13835 #: ../fish/guestfish-actions.pod:3779
13837 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13838 "the device's sector size, see L</blockdev-getss>."
13842 #: ../fish/guestfish-actions.pod:3782 ../src/guestfs-actions.pod:5888
13843 msgid "B<part_end>"
13847 #: ../fish/guestfish-actions.pod:3784 ../src/guestfs-actions.pod:5890
13848 msgid "End of the partition in bytes."
13852 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5892
13853 msgid "B<part_size>"
13857 #: ../fish/guestfish-actions.pod:3788 ../src/guestfs-actions.pod:5894
13858 msgid "Size of the partition in bytes."
13862 #: ../fish/guestfish-actions.pod:3792
13863 msgid "part-set-bootable"
13867 #: ../fish/guestfish-actions.pod:3794
13870 " part-set-bootable device partnum true|false\n"
13875 #: ../fish/guestfish-actions.pod:3796 ../src/guestfs-actions.pod:5912
13877 "This sets the bootable flag on partition numbered C<partnum> on device "
13878 "C<device>. Note that partitions are numbered from 1."
13882 #: ../fish/guestfish-actions.pod:3799 ../src/guestfs-actions.pod:5915
13884 "The bootable flag is used by some operating systems (notably Windows) to "
13885 "determine which partition to boot from. It is by no means universally "
13890 #: ../fish/guestfish-actions.pod:3803
13891 msgid "part-set-mbr-id"
13895 #: ../fish/guestfish-actions.pod:3805
13898 " part-set-mbr-id device partnum idbyte\n"
13903 #: ../fish/guestfish-actions.pod:3807 ../src/guestfs-actions.pod:5931
13905 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13906 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13907 "documentation are in fact hexadecimal numbers, but usually documented "
13908 "without any leading \"0x\" which might be confusing."
13912 #: ../fish/guestfish-actions.pod:3817
13913 msgid "part-set-name"
13917 #: ../fish/guestfish-actions.pod:3819
13920 " part-set-name device partnum name\n"
13925 #: ../fish/guestfish-actions.pod:3821 ../src/guestfs-actions.pod:5953
13927 "This sets the partition name on partition numbered C<partnum> on device "
13928 "C<device>. Note that partitions are numbered from 1."
13932 #: ../fish/guestfish-actions.pod:3824 ../src/guestfs-actions.pod:5956
13934 "The partition name can only be set on certain types of partition table. "
13935 "This works on C<gpt> but not on C<mbr> partitions."
13939 #: ../fish/guestfish-actions.pod:3827
13940 msgid "part-to-dev"
13944 #: ../fish/guestfish-actions.pod:3829
13947 " part-to-dev partition\n"
13952 #: ../fish/guestfish-actions.pod:3831 ../src/guestfs-actions.pod:5969
13954 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13955 "partition number, returning the device name (eg. \"/dev/sdb\")."
13959 #: ../fish/guestfish-actions.pod:3835 ../fish/guestfish-actions.pod:3847
13961 "The named partition must exist, for example as a string returned from L</"
13962 "list-partitions>."
13966 #: ../fish/guestfish-actions.pod:3838
13967 msgid "See also L</part-to-partnum>."
13971 #: ../fish/guestfish-actions.pod:3840
13972 msgid "part-to-partnum"
13976 #: ../fish/guestfish-actions.pod:3842
13979 " part-to-partnum partition\n"
13984 #: ../fish/guestfish-actions.pod:3844 ../src/guestfs-actions.pod:5989
13986 "This function takes a partition name (eg. \"/dev/sdb1\") and returns the "
13987 "partition number (eg. C<1>)."
13991 #: ../fish/guestfish-actions.pod:3850
13992 msgid "See also L</part-to-dev>."
13996 #: ../fish/guestfish-actions.pod:3852
13997 msgid "ping-daemon"
14001 #: ../fish/guestfish-actions.pod:3854
14009 #: ../fish/guestfish-actions.pod:3856 ../src/guestfs-actions.pod:6004
14011 "This is a test probe into the guestfs daemon running inside the qemu "
14012 "subprocess. Calling this function checks that the daemon responds to the "
14013 "ping message, without affecting the daemon or attached block device(s) in "
14018 #: ../fish/guestfish-actions.pod:3861
14023 #: ../fish/guestfish-actions.pod:3863
14026 " pread path count offset\n"
14031 #: ../fish/guestfish-actions.pod:3865 ../src/guestfs-actions.pod:6022
14033 "This command lets you read part of a file. It reads C<count> bytes of the "
14034 "file, starting at C<offset>, from file C<path>."
14038 #: ../fish/guestfish-actions.pod:3868 ../fish/guestfish-actions.pod:3883
14039 #: ../src/guestfs-actions.pod:6025 ../src/guestfs-actions.pod:6051
14041 "This may read fewer bytes than requested. For further details see the "
14042 "L<pread(2)> system call."
14046 #: ../fish/guestfish-actions.pod:3871
14047 msgid "See also L</pwrite>, L</pread-device>."
14051 #: ../fish/guestfish-actions.pod:3876
14052 msgid "pread-device"
14056 #: ../fish/guestfish-actions.pod:3878
14059 " pread-device device count offset\n"
14064 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:6048
14066 "This command lets you read part of a file. It reads C<count> bytes of "
14067 "C<device>, starting at C<offset>."
14071 #: ../fish/guestfish-actions.pod:3886
14072 msgid "See also L</pread>."
14076 #: ../fish/guestfish-actions.pod:3891
14081 #: ../fish/guestfish-actions.pod:3893
14084 " pvcreate device\n"
14089 #: ../fish/guestfish-actions.pod:3895 ../src/guestfs-actions.pod:6071
14091 "This creates an LVM physical volume on the named C<device>, where C<device> "
14092 "should usually be a partition name such as C</dev/sda1>."
14096 #: ../fish/guestfish-actions.pod:3899
14101 #: ../fish/guestfish-actions.pod:3901
14104 " pvremove device\n"
14109 #: ../fish/guestfish-actions.pod:3903 ../src/guestfs-actions.pod:6085
14111 "This wipes a physical volume C<device> so that LVM will no longer recognise "
14116 #: ../fish/guestfish-actions.pod:3906 ../src/guestfs-actions.pod:6088
14118 "The implementation uses the C<pvremove> command which refuses to wipe "
14119 "physical volumes that contain any volume groups, so you have to remove those "
14124 #: ../fish/guestfish-actions.pod:3910
14129 #: ../fish/guestfish-actions.pod:3912
14132 " pvresize device\n"
14137 #: ../fish/guestfish-actions.pod:3914 ../src/guestfs-actions.pod:6102
14139 "This resizes (expands or shrinks) an existing LVM physical volume to match "
14140 "the new size of the underlying device."
14144 #: ../fish/guestfish-actions.pod:3917
14145 msgid "pvresize-size"
14149 #: ../fish/guestfish-actions.pod:3919
14152 " pvresize-size device size\n"
14157 #: ../fish/guestfish-actions.pod:3921
14159 "This command is the same as L</pvresize> except that it allows you to "
14160 "specify the new size (in bytes) explicitly."
14164 #: ../fish/guestfish-actions.pod:3924
14169 #: ../fish/guestfish-actions.pod:3926
14177 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:6128
14179 "List all the physical volumes detected. This is the equivalent of the L<pvs"
14184 #: ../fish/guestfish-actions.pod:3931 ../src/guestfs-actions.pod:6131
14186 "This returns a list of just the device names that contain PVs (eg. C</dev/"
14191 #: ../fish/guestfish-actions.pod:3934
14192 msgid "See also L</pvs-full>."
14196 #: ../fish/guestfish-actions.pod:3936
14201 #: ../fish/guestfish-actions.pod:3938
14209 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6147
14211 "List all the physical volumes detected. This is the equivalent of the L<pvs"
14212 "(8)> command. The \"full\" version includes all fields."
14216 #: ../fish/guestfish-actions.pod:3943
14221 #: ../fish/guestfish-actions.pod:3945
14229 #: ../fish/guestfish-actions.pod:3947 ../src/guestfs-actions.pod:6162
14230 msgid "This command returns the UUID of the LVM PV C<device>."
14234 #: ../fish/guestfish-actions.pod:3949
14239 #: ../fish/guestfish-actions.pod:3951
14242 " pwrite path content offset\n"
14247 #: ../fish/guestfish-actions.pod:3953 ../src/guestfs-actions.pod:6178
14249 "This command writes to part of a file. It writes the data buffer C<content> "
14250 "to the file C<path> starting at offset C<offset>."
14254 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6181
14256 "This command implements the L<pwrite(2)> system call, and like that system "
14257 "call it may not write the full data requested. The return value is the "
14258 "number of bytes that were actually written to the file. This could even be "
14259 "0, although short writes are unlikely for regular files in ordinary "
14264 #: ../fish/guestfish-actions.pod:3962
14265 msgid "See also L</pread>, L</pwrite-device>."
14269 #: ../fish/guestfish-actions.pod:3967
14270 msgid "pwrite-device"
14274 #: ../fish/guestfish-actions.pod:3969
14277 " pwrite-device device content offset\n"
14282 #: ../fish/guestfish-actions.pod:3971 ../src/guestfs-actions.pod:6205
14284 "This command writes to part of a device. It writes the data buffer "
14285 "C<content> to C<device> starting at offset C<offset>."
14289 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6208
14291 "This command implements the L<pwrite(2)> system call, and like that system "
14292 "call it may not write the full data requested (although short writes to disk "
14293 "devices and partitions are probably impossible with standard Linux kernels)."
14297 #: ../fish/guestfish-actions.pod:3979
14298 msgid "See also L</pwrite>."
14302 #: ../fish/guestfish-actions.pod:3984
14307 #: ../fish/guestfish-actions.pod:3986
14310 " read-file path\n"
14315 #: ../fish/guestfish-actions.pod:3988 ../src/guestfs-actions.pod:6229
14316 msgid "This calls returns the contents of the file C<path> as a buffer."
14320 #: ../fish/guestfish-actions.pod:3991
14322 "Unlike L</cat>, this function can correctly handle files that contain "
14323 "embedded ASCII NUL characters. However unlike L</download>, this function "
14324 "is limited in the total size of file that can be handled."
14328 #: ../fish/guestfish-actions.pod:3999
14333 #: ../fish/guestfish-actions.pod:4001
14336 " read-lines path\n"
14341 #: ../fish/guestfish-actions.pod:4005 ../src/guestfs-actions.pod:6254
14343 "The file contents are returned as a list of lines. Trailing C<LF> and "
14344 "C<CRLF> character sequences are I<not> returned."
14348 #: ../fish/guestfish-actions.pod:4008
14350 "Note that this function cannot correctly handle binary files (specifically, "
14351 "files containing C<\\0> character which is treated as end of line). For "
14352 "those you need to use the L</read-file> function which has a more complex "
14357 #: ../fish/guestfish-actions.pod:4013
14362 #: ../fish/guestfish-actions.pod:4015
14370 #: ../fish/guestfish-actions.pod:4017 ../src/guestfs-actions.pod:6274
14371 msgid "This returns the list of directory entries in directory C<dir>."
14375 #: ../fish/guestfish-actions.pod:4019 ../src/guestfs-actions.pod:6276
14377 "All entries in the directory are returned, including C<.> and C<..>. The "
14378 "entries are I<not> sorted, but returned in the same order as the underlying "
14383 #: ../fish/guestfish-actions.pod:4023 ../src/guestfs-actions.pod:6280
14385 "Also this call returns basic file type information about each file. The "
14386 "C<ftyp> field will contain one of the following characters:"
14390 #: ../fish/guestfish-actions.pod:4028 ../src/guestfs-actions.pod:6285
14395 #: ../fish/guestfish-actions.pod:4030 ../src/guestfs-actions.pod:6287
14396 msgid "Block special"
14400 #: ../fish/guestfish-actions.pod:4032 ../src/guestfs-actions.pod:6289
14405 #: ../fish/guestfish-actions.pod:4034 ../src/guestfs-actions.pod:6291
14406 msgid "Char special"
14410 #: ../fish/guestfish-actions.pod:4036 ../src/guestfs-actions.pod:6293
14415 #: ../fish/guestfish-actions.pod:4038 ../src/guestfs-actions.pod:6295
14420 #: ../fish/guestfish-actions.pod:4040 ../src/guestfs-actions.pod:6297
14425 #: ../fish/guestfish-actions.pod:4042 ../src/guestfs-actions.pod:6299
14426 msgid "FIFO (named pipe)"
14430 #: ../fish/guestfish-actions.pod:4044 ../src/guestfs-actions.pod:6301
14435 #: ../fish/guestfish-actions.pod:4046 ../src/guestfs-actions.pod:6303
14436 msgid "Symbolic link"
14440 #: ../fish/guestfish-actions.pod:4048 ../src/guestfs-actions.pod:6305
14445 #: ../fish/guestfish-actions.pod:4050 ../src/guestfs-actions.pod:6307
14446 msgid "Regular file"
14450 #: ../fish/guestfish-actions.pod:4052 ../src/guestfs-actions.pod:6309
14455 #: ../fish/guestfish-actions.pod:4054 ../src/guestfs-actions.pod:6311
14460 #: ../fish/guestfish-actions.pod:4056 ../src/guestfs-actions.pod:6313
14465 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6315
14466 msgid "Unknown file type"
14470 #: ../fish/guestfish-actions.pod:4060 ../src/guestfs-actions.pod:6317
14475 #: ../fish/guestfish-actions.pod:4062 ../src/guestfs-actions.pod:6319
14477 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14481 #: ../fish/guestfish-actions.pod:4067
14483 "This function is primarily intended for use by programs. To get a simple "
14484 "list of names, use L</ls>. To get a printable directory for human "
14485 "consumption, use L</ll>."
14489 #: ../fish/guestfish-actions.pod:4071
14494 #: ../fish/guestfish-actions.pod:4073
14502 #: ../fish/guestfish-actions.pod:4075 ../src/guestfs-actions.pod:6340
14503 msgid "This command reads the target of a symbolic link."
14507 #: ../fish/guestfish-actions.pod:4077
14508 msgid "readlinklist"
14512 #: ../fish/guestfish-actions.pod:4079
14515 " readlinklist path 'names ...'\n"
14520 #: ../fish/guestfish-actions.pod:4081 ../src/guestfs-actions.pod:6354
14522 "This call allows you to do a C<readlink> operation on multiple files, where "
14523 "all files are in the directory C<path>. C<names> is the list of files from "
14528 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6358
14530 "On return you get a list of strings, with a one-to-one correspondence to the "
14531 "C<names> list. Each string is the value of the symbolic link."
14535 #: ../fish/guestfish-actions.pod:4089 ../src/guestfs-actions.pod:6362
14537 "If the C<readlink(2)> operation fails on any name, then the corresponding "
14538 "result string is the empty string C<\"\">. However the whole operation is "
14539 "completed even if there were C<readlink(2)> errors, and so you can call this "
14540 "function with names where you don't know if they are symbolic links already "
14541 "(albeit slightly less efficient)."
14545 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6369
14547 "This call is intended for programs that want to efficiently list a directory "
14548 "contents without making many round-trips. Very long directory listings "
14549 "might cause the protocol message size to be exceeded, causing this call to "
14550 "fail. The caller must split up such requests into smaller groups of names."
14554 #: ../fish/guestfish-actions.pod:4103
14559 #: ../fish/guestfish-actions.pod:4105
14567 #: ../fish/guestfish-actions.pod:4107 ../src/guestfs-actions.pod:6388
14569 "Return the canonicalized absolute pathname of C<path>. The returned path "
14570 "has no C<.>, C<..> or symbolic link path elements."
14574 #: ../fish/guestfish-actions.pod:4110
14575 msgid "removexattr"
14579 #: ../fish/guestfish-actions.pod:4112
14582 " removexattr xattr path\n"
14587 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6403
14589 "This call removes the extended attribute named C<xattr> of the file C<path>."
14593 #: ../fish/guestfish-actions.pod:4117
14594 msgid "See also: L</lremovexattr>, L<attr(5)>."
14598 #: ../fish/guestfish-actions.pod:4119
14603 #: ../fish/guestfish-actions.pod:4121
14606 " resize2fs device\n"
14611 #: ../fish/guestfish-actions.pod:4123 ../src/guestfs-actions.pod:6418
14613 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
14614 "underlying device."
14618 #: ../fish/guestfish-actions.pod:4126
14620 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
14621 "before calling this command. For unknown reasons C<resize2fs> sometimes "
14622 "gives an error about this and sometimes not. In any case, it is always safe "
14623 "to call L</e2fsck-f> before calling this function."
14627 #: ../fish/guestfish-actions.pod:4132
14628 msgid "resize2fs-M"
14632 #: ../fish/guestfish-actions.pod:4134
14635 " resize2fs-M device\n"
14640 #: ../fish/guestfish-actions.pod:4136
14642 "This command is the same as L</resize2fs>, but the filesystem is resized to "
14643 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
14648 #: ../fish/guestfish-actions.pod:4140
14650 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
14651 "and read the C<Block size> and C<Block count> values. These two numbers, "
14652 "multiplied together, give the resulting size of the minimal filesystem in "
14657 #: ../fish/guestfish-actions.pod:4145
14658 msgid "resize2fs-size"
14662 #: ../fish/guestfish-actions.pod:4147
14665 " resize2fs-size device size\n"
14670 #: ../fish/guestfish-actions.pod:4149
14672 "This command is the same as L</resize2fs> except that it allows you to "
14673 "specify the new size (in bytes) explicitly."
14677 #: ../fish/guestfish-actions.pod:4152
14682 #: ../fish/guestfish-actions.pod:4154
14690 #: ../fish/guestfish-actions.pod:4156 ../src/guestfs-actions.pod:6470
14691 msgid "Remove the single file C<path>."
14695 #: ../fish/guestfish-actions.pod:4158
14700 #: ../fish/guestfish-actions.pod:4160
14708 #: ../fish/guestfish-actions.pod:4162 ../src/guestfs-actions.pod:6482
14710 "Remove the file or directory C<path>, recursively removing the contents if "
14711 "its a directory. This is like the C<rm -rf> shell command."
14715 #: ../fish/guestfish-actions.pod:4166
14720 #: ../fish/guestfish-actions.pod:4168
14728 #: ../fish/guestfish-actions.pod:4170 ../src/guestfs-actions.pod:6496
14729 msgid "Remove the single directory C<path>."
14733 #: ../fish/guestfish-actions.pod:4172
14734 msgid "rmmountpoint"
14738 #: ../fish/guestfish-actions.pod:4174
14741 " rmmountpoint exemptpath\n"
14746 #: ../fish/guestfish-actions.pod:4176
14748 "This calls removes a mountpoint that was previously created with L</"
14749 "mkmountpoint>. See L</mkmountpoint> for full details."
14753 #: ../fish/guestfish-actions.pod:4180
14754 msgid "scrub-device"
14758 #: ../fish/guestfish-actions.pod:4182
14761 " scrub-device device\n"
14766 #: ../fish/guestfish-actions.pod:4184 ../src/guestfs-actions.pod:6522
14768 "This command writes patterns over C<device> to make data retrieval more "
14773 #: ../fish/guestfish-actions.pod:4187 ../fish/guestfish-actions.pod:4202
14774 #: ../fish/guestfish-actions.pod:4215 ../src/guestfs-actions.pod:6525
14775 #: ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:6565
14777 "It is an interface to the L<scrub(1)> program. See that manual page for "
14782 #: ../fish/guestfish-actions.pod:4193
14787 #: ../fish/guestfish-actions.pod:4195
14790 " scrub-file file\n"
14795 #: ../fish/guestfish-actions.pod:4197 ../src/guestfs-actions.pod:6541
14797 "This command writes patterns over a file to make data retrieval more "
14802 #: ../fish/guestfish-actions.pod:4200 ../src/guestfs-actions.pod:6544
14803 msgid "The file is I<removed> after scrubbing."
14807 #: ../fish/guestfish-actions.pod:4205
14808 msgid "scrub-freespace"
14812 #: ../fish/guestfish-actions.pod:4207
14815 " scrub-freespace dir\n"
14820 #: ../fish/guestfish-actions.pod:4209
14822 "This command creates the directory C<dir> and then fills it with files until "
14823 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14824 "deletes them. The intention is to scrub any free space on the partition "
14825 "containing C<dir>."
14829 #: ../fish/guestfish-actions.pod:4218
14834 #: ../fish/guestfish-actions.pod:4220
14839 #: ../fish/guestfish-actions.pod:4222
14842 " set-append append\n"
14847 #: ../fish/guestfish-actions.pod:4224 ../src/guestfs-actions.pod:6578
14849 "This function is used to add additional options to the guest kernel command "
14854 #: ../fish/guestfish-actions.pod:4227 ../src/guestfs-actions.pod:6581
14856 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14857 "environment variable."
14861 #: ../fish/guestfish-actions.pod:4230 ../src/guestfs-actions.pod:6584
14863 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14864 "(libguestfs always adds a few of its own)."
14868 #: ../fish/guestfish-actions.pod:4233
14869 msgid "set-attach-method"
14873 #: ../fish/guestfish-actions.pod:4235
14874 msgid "attach-method"
14878 #: ../fish/guestfish-actions.pod:4237
14881 " set-attach-method attachmethod\n"
14886 #: ../fish/guestfish-actions.pod:4239 ../src/guestfs-actions.pod:6597
14888 "Set the method that libguestfs uses to connect to the back end guestfsd "
14889 "daemon. Possible methods are:"
14893 #: ../fish/guestfish-actions.pod:4244 ../src/guestfs-actions.pod:6602
14894 #: ../src/guestfs.pod:2916
14895 msgid "C<appliance>"
14899 #: ../fish/guestfish-actions.pod:4246 ../src/guestfs-actions.pod:6604
14901 "Launch an appliance and connect to it. This is the ordinary method and the "
14906 #: ../fish/guestfish-actions.pod:4249 ../src/guestfs-actions.pod:6607
14907 msgid "C<unix:I<path>>"
14911 #: ../fish/guestfish-actions.pod:4251 ../src/guestfs-actions.pod:6609
14912 msgid "Connect to the Unix domain socket I<path>."
14916 #: ../fish/guestfish-actions.pod:4253 ../src/guestfs-actions.pod:6611
14918 "This method lets you connect to an existing daemon or (using virtio-serial) "
14919 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14920 "RUNNING DAEMONS>."
14924 #: ../fish/guestfish-actions.pod:4259
14925 msgid "set-autosync"
14929 #: ../fish/guestfish-actions.pod:4261
14934 #: ../fish/guestfish-actions.pod:4263
14937 " set-autosync true|false\n"
14942 #: ../fish/guestfish-actions.pod:4265 ../src/guestfs-actions.pod:6627
14944 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14945 "effort attempt to make filesystems consistent and synchronized when the "
14946 "handle is closed (also if the program exits without closing handles)."
14950 #: ../fish/guestfish-actions.pod:4270 ../src/guestfs-actions.pod:6632
14952 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14953 "disabled by default)."
14957 #: ../fish/guestfish-actions.pod:4273
14962 #: ../fish/guestfish-actions.pod:4275
14967 #: ../fish/guestfish-actions.pod:4277
14970 " set-direct true|false\n"
14975 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6645
14977 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14978 "passed directly through to the appliance once it is launched."
14982 #: ../fish/guestfish-actions.pod:4283
14984 "One consequence of this is that log messages aren't caught by the library "
14985 "and handled by L</set-log-message-callback>, but go straight to stdout."
14989 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6653
14990 msgid "You probably don't want to use this unless you know what you are doing."
14994 #: ../fish/guestfish-actions.pod:4290 ../src/guestfs-actions.pod:6656
14995 msgid "The default is disabled."
14999 #: ../fish/guestfish-actions.pod:4292
15000 msgid "set-e2label"
15004 #: ../fish/guestfish-actions.pod:4294
15007 " set-e2label device label\n"
15012 #: ../fish/guestfish-actions.pod:4296 ../src/guestfs-actions.pod:6669
15014 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
15015 "C<label>. Filesystem labels are limited to 16 characters."
15019 #: ../fish/guestfish-actions.pod:4300
15021 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
15022 "label on a filesystem."
15026 #: ../fish/guestfish-actions.pod:4303
15031 #: ../fish/guestfish-actions.pod:4305
15034 " set-e2uuid device uuid\n"
15039 #: ../fish/guestfish-actions.pod:4307 ../src/guestfs-actions.pod:6687
15041 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
15042 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
15043 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
15047 #: ../fish/guestfish-actions.pod:4312
15049 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
15050 "UUID of a filesystem."
15054 #: ../fish/guestfish-actions.pod:4315
15055 msgid "set-memsize"
15059 #: ../fish/guestfish-actions.pod:4317
15064 #: ../fish/guestfish-actions.pod:4319
15067 " set-memsize memsize\n"
15072 #: ../fish/guestfish-actions.pod:4321
15074 "This sets the memory size in megabytes allocated to the qemu subprocess. "
15075 "This only has any effect if called before L</launch>."
15079 #: ../fish/guestfish-actions.pod:4325 ../src/guestfs-actions.pod:6709
15081 "You can also change this by setting the environment variable "
15082 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
15086 #: ../fish/guestfish-actions.pod:4332
15087 msgid "set-network"
15091 #: ../fish/guestfish-actions.pod:4334
15096 #: ../fish/guestfish-actions.pod:4336
15099 " set-network true|false\n"
15104 #: ../fish/guestfish-actions.pod:4338 ../src/guestfs-actions.pod:6726
15106 "If C<network> is true, then the network is enabled in the libguestfs "
15107 "appliance. The default is false."
15111 #: ../fish/guestfish-actions.pod:4341 ../src/guestfs-actions.pod:6729
15113 "This affects whether commands are able to access the network (see L<guestfs"
15114 "(3)/RUNNING COMMANDS>)."
15118 #: ../fish/guestfish-actions.pod:4344
15120 "You must call this before calling L</launch>, otherwise it has no effect."
15124 #: ../fish/guestfish-actions.pod:4347
15129 #: ../fish/guestfish-actions.pod:4351
15132 " set-path searchpath\n"
15137 #: ../fish/guestfish-actions.pod:4353 ../src/guestfs-actions.pod:6745
15138 msgid "Set the path that libguestfs searches for kernel and initrd.img."
15142 #: ../fish/guestfish-actions.pod:4355 ../src/guestfs-actions.pod:6747
15144 "The default is C<$libdir/guestfs> unless overridden by setting "
15145 "C<LIBGUESTFS_PATH> environment variable."
15149 #: ../fish/guestfish-actions.pod:4358 ../src/guestfs-actions.pod:6750
15150 msgid "Setting C<path> to C<NULL> restores the default path."
15154 #: ../fish/guestfish-actions.pod:4360
15159 #: ../fish/guestfish-actions.pod:4362
15164 #: ../fish/guestfish-actions.pod:4364
15167 " set-pgroup true|false\n"
15172 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6762
15174 "If C<pgroup> is true, child processes are placed into their own process "
15179 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6765
15181 "The practical upshot of this is that signals like C<SIGINT> (from users "
15182 "pressing C<^C>) won't be received by the child process."
15186 #: ../fish/guestfish-actions.pod:4372 ../src/guestfs-actions.pod:6768
15188 "The default for this flag is false, because usually you want C<^C> to kill "
15193 #: ../fish/guestfish-actions.pod:4375
15198 #: ../fish/guestfish-actions.pod:4377
15203 #: ../fish/guestfish-actions.pod:4379
15211 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6781
15212 msgid "Set the qemu binary that we will use."
15216 #: ../fish/guestfish-actions.pod:4383 ../src/guestfs-actions.pod:6783
15218 "The default is chosen when the library was compiled by the configure script."
15222 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6786
15224 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
15229 #: ../fish/guestfish-actions.pod:4389 ../src/guestfs-actions.pod:6789
15230 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
15234 #: ../fish/guestfish-actions.pod:4391 ../src/guestfs-actions.pod:6791
15236 "Note that you should call this function as early as possible after creating "
15237 "the handle. This is because some pre-launch operations depend on testing "
15238 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
15239 "don't retest features, and so you might see inconsistent results. Using the "
15240 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
15241 "the qemu binary at the same time as the handle is created."
15245 #: ../fish/guestfish-actions.pod:4399
15246 msgid "set-recovery-proc"
15250 #: ../fish/guestfish-actions.pod:4401
15251 msgid "recovery-proc"
15255 #: ../fish/guestfish-actions.pod:4403
15258 " set-recovery-proc true|false\n"
15263 #: ../fish/guestfish-actions.pod:4405
15265 "If this is called with the parameter C<false> then L</launch> does not "
15266 "create a recovery process. The purpose of the recovery process is to stop "
15267 "runaway qemu processes in the case where the main program aborts abruptly."
15271 #: ../fish/guestfish-actions.pod:4410
15273 "This only has any effect if called before L</launch>, and the default is "
15278 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6817
15280 "About the only time when you would want to disable this is if the main "
15281 "process will fork itself into the background (\"daemonize\" itself). In "
15282 "this case the recovery process thinks that the main program has disappeared "
15283 "and so kills qemu, which is not very helpful."
15287 #: ../fish/guestfish-actions.pod:4419
15288 msgid "set-selinux"
15292 #: ../fish/guestfish-actions.pod:4421
15297 #: ../fish/guestfish-actions.pod:4423
15300 " set-selinux true|false\n"
15305 #: ../fish/guestfish-actions.pod:4425 ../src/guestfs-actions.pod:6833
15307 "This sets the selinux flag that is passed to the appliance at boot time. "
15308 "The default is C<selinux=0> (disabled)."
15312 #: ../fish/guestfish-actions.pod:4428 ../src/guestfs-actions.pod:6836
15314 "Note that if SELinux is enabled, it is always in Permissive mode "
15315 "(C<enforcing=0>)."
15319 #: ../fish/guestfish-actions.pod:4434
15324 #: ../fish/guestfish-actions.pod:4436
15329 #: ../fish/guestfish-actions.pod:4438
15337 #: ../fish/guestfish-actions.pod:4440 ../src/guestfs-actions.pod:6852
15339 "Change the number of virtual CPUs assigned to the appliance. The default is "
15340 "C<1>. Increasing this may improve performance, though often it has no "
15345 #: ../fish/guestfish-actions.pod:4444
15346 msgid "This function must be called before L</launch>."
15350 #: ../fish/guestfish-actions.pod:4446
15355 #: ../fish/guestfish-actions.pod:4448
15360 #: ../fish/guestfish-actions.pod:4450
15363 " set-trace true|false\n"
15368 #: ../fish/guestfish-actions.pod:4452 ../src/guestfs-actions.pod:6868
15370 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
15371 "return values are traced."
15375 #: ../fish/guestfish-actions.pod:4455 ../src/guestfs-actions.pod:6871
15377 "If you want to trace C API calls into libguestfs (and other libraries) then "
15378 "possibly a better way is to use the external ltrace(1) command."
15382 #: ../fish/guestfish-actions.pod:4459 ../src/guestfs-actions.pod:6875
15384 "Command traces are disabled unless the environment variable "
15385 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
15389 #: ../fish/guestfish-actions.pod:4462
15391 "Trace messages are normally sent to C<stderr>, unless you register a "
15392 "callback to send them somewhere else (see L</set-event-callback>)."
15396 #: ../fish/guestfish-actions.pod:4466
15397 msgid "set-verbose"
15401 #: ../fish/guestfish-actions.pod:4468
15406 #: ../fish/guestfish-actions.pod:4470
15409 " set-verbose true|false\n"
15414 #: ../fish/guestfish-actions.pod:4472 ../src/guestfs-actions.pod:6892
15415 msgid "If C<verbose> is true, this turns on verbose messages."
15419 #: ../fish/guestfish-actions.pod:4474 ../src/guestfs-actions.pod:6894
15421 "Verbose messages are disabled unless the environment variable "
15422 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
15426 #: ../fish/guestfish-actions.pod:4477
15428 "Verbose messages are normally sent to C<stderr>, unless you register a "
15429 "callback to send them somewhere else (see L</set-event-callback>)."
15433 #: ../fish/guestfish-actions.pod:4481
15438 #: ../fish/guestfish-actions.pod:4483
15441 " setcon context\n"
15446 #: ../fish/guestfish-actions.pod:4485 ../src/guestfs-actions.pod:6911
15448 "This sets the SELinux security context of the daemon to the string "
15453 #: ../fish/guestfish-actions.pod:4488 ../src/guestfs-actions.pod:6914
15454 msgid "See the documentation about SELINUX in L<guestfs(3)>."
15458 #: ../fish/guestfish-actions.pod:4490
15463 #: ../fish/guestfish-actions.pod:4492
15466 " setxattr xattr val vallen path\n"
15471 #: ../fish/guestfish-actions.pod:4494 ../src/guestfs-actions.pod:6929
15473 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15474 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15478 #: ../fish/guestfish-actions.pod:4498
15479 msgid "See also: L</lsetxattr>, L<attr(5)>."
15483 #: ../fish/guestfish-actions.pod:4500
15488 #: ../fish/guestfish-actions.pod:4502
15491 " sfdisk device cyls heads sectors 'lines ...'\n"
15496 #: ../fish/guestfish-actions.pod:4504 ../src/guestfs-actions.pod:6956
15498 "This is a direct interface to the L<sfdisk(8)> program for creating "
15499 "partitions on block devices."
15503 #: ../fish/guestfish-actions.pod:4507 ../src/guestfs-actions.pod:6959
15504 msgid "C<device> should be a block device, for example C</dev/sda>."
15508 #: ../fish/guestfish-actions.pod:4509 ../src/guestfs-actions.pod:6961
15510 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15511 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
15512 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15513 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15514 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15515 "the kernel) cannot work out the right geometry and you will need to tell it."
15519 #: ../fish/guestfish-actions.pod:4517 ../src/guestfs-actions.pod:6969
15521 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15522 "refer to the L<sfdisk(8)> manpage."
15526 #: ../fish/guestfish-actions.pod:4520 ../src/guestfs-actions.pod:6972
15528 "To create a single partition occupying the whole disk, you would pass "
15529 "C<lines> as a single element list, when the single element being the string "
15534 #: ../fish/guestfish-actions.pod:4524
15535 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
15539 #: ../fish/guestfish-actions.pod:4530 ../fish/guestfish-actions.pod:4553
15540 #: ../fish/guestfish-actions.pod:4575
15542 "I<This function is deprecated.> In new code, use the L</part_add> call "
15547 #: ../fish/guestfish-actions.pod:4537
15552 #: ../fish/guestfish-actions.pod:4539
15555 " sfdiskM device 'lines ...'\n"
15560 #: ../fish/guestfish-actions.pod:4541
15562 "This is a simplified interface to the L</sfdisk> command, where partition "
15563 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
15564 "you don't need to specify the cyls, heads and sectors parameters which were "
15565 "rarely if ever used anyway."
15569 #: ../fish/guestfish-actions.pod:4547
15570 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
15574 #: ../fish/guestfish-actions.pod:4560
15579 #: ../fish/guestfish-actions.pod:4562
15582 " sfdisk-N device partnum cyls heads sectors line\n"
15587 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:7034
15589 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
15590 "(note: C<n> counts from 1)."
15594 #: ../fish/guestfish-actions.pod:4567
15596 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
15597 "cyls/heads/sectors parameters."
15601 #: ../fish/guestfish-actions.pod:4570
15602 msgid "See also: L</part-add>"
15606 #: ../fish/guestfish-actions.pod:4582
15607 msgid "sfdisk-disk-geometry"
15611 #: ../fish/guestfish-actions.pod:4584
15614 " sfdisk-disk-geometry device\n"
15619 #: ../fish/guestfish-actions.pod:4586
15621 "This displays the disk geometry of C<device> read from the partition table. "
15622 "Especially in the case where the underlying block device has been resized, "
15623 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
15624 "kernel-geometry>)."
15628 #: ../fish/guestfish-actions.pod:4591 ../fish/guestfish-actions.pod:4600
15629 #: ../src/guestfs-actions.pod:7060 ../src/guestfs-actions.pod:7076
15630 msgid "The result is in human-readable format, and not designed to be parsed."
15634 #: ../fish/guestfish-actions.pod:4594
15635 msgid "sfdisk-kernel-geometry"
15639 #: ../fish/guestfish-actions.pod:4596
15642 " sfdisk-kernel-geometry device\n"
15647 #: ../fish/guestfish-actions.pod:4598 ../src/guestfs-actions.pod:7074
15648 msgid "This displays the kernel's idea of the geometry of C<device>."
15652 #: ../fish/guestfish-actions.pod:4603
15657 #: ../fish/guestfish-actions.pod:4605
15660 " sfdisk-l device\n"
15665 #: ../fish/guestfish-actions.pod:4607 ../src/guestfs-actions.pod:7097
15667 "This displays the partition table on C<device>, in the human-readable output "
15668 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15672 #: ../fish/guestfish-actions.pod:4611
15673 msgid "See also: L</part-list>"
15677 #: ../fish/guestfish-actions.pod:4613
15679 "I<This function is deprecated.> In new code, use the L</part_list> call "
15684 #: ../fish/guestfish-actions.pod:4620
15689 #: ../fish/guestfish-actions.pod:4622
15697 #: ../fish/guestfish-actions.pod:4624 ../src/guestfs-actions.pod:7114
15699 "This call runs a command from the guest filesystem via the guest's C</bin/"
15704 #: ../fish/guestfish-actions.pod:4627
15705 msgid "This is like L</command>, but passes the command to:"
15709 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:7119
15712 " /bin/sh -c \"command\"\n"
15717 #: ../fish/guestfish-actions.pod:4631 ../src/guestfs-actions.pod:7121
15719 "Depending on the guest's shell, this usually results in wildcards being "
15720 "expanded, shell expressions being interpolated and so on."
15724 #: ../fish/guestfish-actions.pod:4635
15725 msgid "All the provisos about L</command> apply to this call."
15729 #: ../fish/guestfish-actions.pod:4637
15734 #: ../fish/guestfish-actions.pod:4639
15737 " sh-lines command\n"
15742 #: ../fish/guestfish-actions.pod:4641
15743 msgid "This is the same as L</sh>, but splits the result into a list of lines."
15747 #: ../fish/guestfish-actions.pod:4644
15748 msgid "See also: L</command-lines>"
15752 #: ../fish/guestfish-actions.pod:4646
15757 #: ../fish/guestfish-actions.pod:4648
15765 #: ../fish/guestfish-actions.pod:4650 ../src/guestfs-actions.pod:7155
15766 msgid "Sleep for C<secs> seconds."
15770 #: ../fish/guestfish-actions.pod:4652
15775 #: ../fish/guestfish-actions.pod:4654
15783 #: ../fish/guestfish-actions.pod:4658 ../src/guestfs-actions.pod:7169
15784 msgid "This is the same as the C<stat(2)> system call."
15788 #: ../fish/guestfish-actions.pod:4660
15793 #: ../fish/guestfish-actions.pod:4662
15801 #: ../fish/guestfish-actions.pod:4664 ../src/guestfs-actions.pod:7183
15803 "Returns file system statistics for any mounted file system. C<path> should "
15804 "be a file or directory in the mounted file system (typically it is the mount "
15805 "point itself, but it doesn't need to be)."
15809 #: ../fish/guestfish-actions.pod:4668 ../src/guestfs-actions.pod:7187
15810 msgid "This is the same as the C<statvfs(2)> system call."
15814 #: ../fish/guestfish-actions.pod:4670
15819 #: ../fish/guestfish-actions.pod:4672
15827 #: ../fish/guestfish-actions.pod:4674 ../src/guestfs-actions.pod:7201
15829 "This runs the L<strings(1)> command on a file and returns the list of "
15830 "printable strings found."
15834 #: ../fish/guestfish-actions.pod:4680
15839 #: ../fish/guestfish-actions.pod:4682
15842 " strings-e encoding path\n"
15847 #: ../fish/guestfish-actions.pod:4684
15849 "This is like the L</strings> command, but allows you to specify the encoding "
15850 "of strings that are looked for in the source file C<path>."
15854 #: ../fish/guestfish-actions.pod:4688 ../src/guestfs-actions.pod:7224
15855 msgid "Allowed encodings are:"
15859 #: ../fish/guestfish-actions.pod:4692 ../src/guestfs-actions.pod:7228
15864 #: ../fish/guestfish-actions.pod:4694
15866 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15867 "ISO-8859-X (this is what L</strings> uses)."
15871 #: ../fish/guestfish-actions.pod:4697 ../src/guestfs-actions.pod:7233
15876 #: ../fish/guestfish-actions.pod:4699 ../src/guestfs-actions.pod:7235
15877 msgid "Single 8-bit-byte characters."
15881 #: ../fish/guestfish-actions.pod:4701 ../src/guestfs-actions.pod:7237
15886 #: ../fish/guestfish-actions.pod:4703 ../src/guestfs-actions.pod:7239
15887 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15891 #: ../fish/guestfish-actions.pod:4706 ../src/guestfs-actions.pod:7242
15892 msgid "l (lower case letter L)"
15896 #: ../fish/guestfish-actions.pod:4708 ../src/guestfs-actions.pod:7244
15898 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15899 "examining binaries in Windows guests."
15903 #: ../fish/guestfish-actions.pod:4711 ../src/guestfs-actions.pod:7247
15908 #: ../fish/guestfish-actions.pod:4713 ../src/guestfs-actions.pod:7249
15909 msgid "32-bit big endian such as UCS-4BE."
15913 #: ../fish/guestfish-actions.pod:4715 ../src/guestfs-actions.pod:7251
15918 #: ../fish/guestfish-actions.pod:4717 ../src/guestfs-actions.pod:7253
15919 msgid "32-bit little endian such as UCS-4LE."
15923 #: ../fish/guestfish-actions.pod:4721 ../src/guestfs-actions.pod:7257
15924 msgid "The returned strings are transcoded to UTF-8."
15928 #: ../fish/guestfish-actions.pod:4726
15929 msgid "swapoff-device"
15933 #: ../fish/guestfish-actions.pod:4728
15936 " swapoff-device device\n"
15941 #: ../fish/guestfish-actions.pod:4730
15943 "This command disables the libguestfs appliance swap device or partition "
15944 "named C<device>. See L</swapon-device>."
15948 #: ../fish/guestfish-actions.pod:4734
15949 msgid "swapoff-file"
15953 #: ../fish/guestfish-actions.pod:4736
15956 " swapoff-file file\n"
15961 #: ../fish/guestfish-actions.pod:4738 ../src/guestfs-actions.pod:7288
15962 msgid "This command disables the libguestfs appliance swap on file."
15966 #: ../fish/guestfish-actions.pod:4740
15967 msgid "swapoff-label"
15971 #: ../fish/guestfish-actions.pod:4742
15974 " swapoff-label label\n"
15979 #: ../fish/guestfish-actions.pod:4744 ../src/guestfs-actions.pod:7300
15981 "This command disables the libguestfs appliance swap on labeled swap "
15986 #: ../fish/guestfish-actions.pod:4747
15987 msgid "swapoff-uuid"
15991 #: ../fish/guestfish-actions.pod:4749
15994 " swapoff-uuid uuid\n"
15999 #: ../fish/guestfish-actions.pod:4751 ../src/guestfs-actions.pod:7313
16001 "This command disables the libguestfs appliance swap partition with the given "
16006 #: ../fish/guestfish-actions.pod:4754
16007 msgid "swapon-device"
16011 #: ../fish/guestfish-actions.pod:4756
16014 " swapon-device device\n"
16019 #: ../fish/guestfish-actions.pod:4758
16021 "This command enables the libguestfs appliance to use the swap device or "
16022 "partition named C<device>. The increased memory is made available for all "
16023 "commands, for example those run using L</command> or L</sh>."
16027 #: ../fish/guestfish-actions.pod:4763 ../src/guestfs-actions.pod:7331
16029 "Note that you should not swap to existing guest swap partitions unless you "
16030 "know what you are doing. They may contain hibernation information, or other "
16031 "information that the guest doesn't want you to trash. You also risk leaking "
16032 "information about the host to the guest this way. Instead, attach a new "
16033 "host device to the guest and swap on that."
16037 #: ../fish/guestfish-actions.pod:4770
16038 msgid "swapon-file"
16042 #: ../fish/guestfish-actions.pod:4772
16045 " swapon-file file\n"
16050 #: ../fish/guestfish-actions.pod:4774
16052 "This command enables swap to a file. See L</swapon-device> for other notes."
16056 #: ../fish/guestfish-actions.pod:4777
16057 msgid "swapon-label"
16061 #: ../fish/guestfish-actions.pod:4779
16064 " swapon-label label\n"
16069 #: ../fish/guestfish-actions.pod:4781
16071 "This command enables swap to a labeled swap partition. See L</swapon-"
16072 "device> for other notes."
16076 #: ../fish/guestfish-actions.pod:4784
16077 msgid "swapon-uuid"
16081 #: ../fish/guestfish-actions.pod:4786
16084 " swapon-uuid uuid\n"
16089 #: ../fish/guestfish-actions.pod:4788
16091 "This command enables swap to a swap partition with the given UUID. See L</"
16092 "swapon-device> for other notes."
16096 #: ../fish/guestfish-actions.pod:4791
16101 #: ../fish/guestfish-actions.pod:4793
16109 #: ../fish/guestfish-actions.pod:4795 ../src/guestfs-actions.pod:7386
16111 "This syncs the disk, so that any writes are flushed through to the "
16112 "underlying disk image."
16116 #: ../fish/guestfish-actions.pod:4798 ../src/guestfs-actions.pod:7389
16118 "You should always call this if you have modified a disk image, before "
16119 "closing the handle."
16123 #: ../fish/guestfish-actions.pod:4801
16128 #: ../fish/guestfish-actions.pod:4803
16136 #: ../fish/guestfish-actions.pod:4805 ../src/guestfs-actions.pod:7402
16138 "This command returns up to the last 10 lines of a file as a list of strings."
16142 #: ../fish/guestfish-actions.pod:4811
16147 #: ../fish/guestfish-actions.pod:4813
16150 " tail-n nrlines path\n"
16155 #: ../fish/guestfish-actions.pod:4815 ../src/guestfs-actions.pod:7421
16157 "If the parameter C<nrlines> is a positive number, this returns the last "
16158 "C<nrlines> lines of the file C<path>."
16162 #: ../fish/guestfish-actions.pod:4818 ../src/guestfs-actions.pod:7424
16164 "If the parameter C<nrlines> is a negative number, this returns lines from "
16165 "the file C<path>, starting with the C<-nrlines>th line."
16169 #: ../fish/guestfish-actions.pod:4826
16174 #: ../fish/guestfish-actions.pod:4828
16177 " tar-in (tarfile|-) directory\n"
16182 #: ../fish/guestfish-actions.pod:4830 ../src/guestfs-actions.pod:7445
16184 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
16185 "tar file) into C<directory>."
16189 #: ../fish/guestfish-actions.pod:4833
16190 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
16194 #: ../fish/guestfish-actions.pod:4838
16199 #: ../fish/guestfish-actions.pod:4840
16202 " tar-out directory (tarfile|-)\n"
16207 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7462
16209 "This command packs the contents of C<directory> and downloads it to local "
16214 #: ../fish/guestfish-actions.pod:4845
16215 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
16219 #: ../fish/guestfish-actions.pod:4850
16224 #: ../fish/guestfish-actions.pod:4852
16227 " tgz-in (tarball|-) directory\n"
16232 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7479
16234 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
16235 "tar file) into C<directory>."
16239 #: ../fish/guestfish-actions.pod:4857
16240 msgid "To upload an uncompressed tarball, use L</tar-in>."
16244 #: ../fish/guestfish-actions.pod:4861
16249 #: ../fish/guestfish-actions.pod:4863
16252 " tgz-out directory (tarball|-)\n"
16257 #: ../fish/guestfish-actions.pod:4865 ../src/guestfs-actions.pod:7495
16259 "This command packs the contents of C<directory> and downloads it to local "
16264 #: ../fish/guestfish-actions.pod:4868
16265 msgid "To download an uncompressed tarball, use L</tar-out>."
16269 #: ../fish/guestfish-actions.pod:4872
16274 #: ../fish/guestfish-actions.pod:4874
16282 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7510
16284 "Touch acts like the L<touch(1)> command. It can be used to update the "
16285 "timestamps on a file, or, if the file does not exist, to create a new zero-"
16290 #: ../fish/guestfish-actions.pod:4880 ../src/guestfs-actions.pod:7514
16292 "This command only works on regular files, and will fail on other file types "
16293 "such as directories, symbolic links, block special etc."
16297 #: ../fish/guestfish-actions.pod:4883
16302 #: ../fish/guestfish-actions.pod:4885
16310 #: ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:7527
16312 "This command truncates C<path> to a zero-length file. The file must exist "
16317 #: ../fish/guestfish-actions.pod:4890
16318 msgid "truncate-size"
16322 #: ../fish/guestfish-actions.pod:4892
16325 " truncate-size path size\n"
16330 #: ../fish/guestfish-actions.pod:4894 ../src/guestfs-actions.pod:7541
16332 "This command truncates C<path> to size C<size> bytes. The file must exist "
16337 #: ../fish/guestfish-actions.pod:4897
16339 "If the current file size is less than C<size> then the file is extended to "
16340 "the required size with zero bytes. This creates a sparse file (ie. disk "
16341 "blocks are not allocated for the file until you write to it). To create a "
16342 "non-sparse file of zeroes, use L</fallocate64> instead."
16346 #: ../fish/guestfish-actions.pod:4903
16351 #: ../fish/guestfish-actions.pod:4905
16354 " tune2fs-l device\n"
16359 #: ../fish/guestfish-actions.pod:4907 ../src/guestfs-actions.pod:7560
16361 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
16366 #: ../fish/guestfish-actions.pod:4910 ../src/guestfs-actions.pod:7563
16368 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
16369 "for more details. The list of fields returned isn't clearly defined, and "
16370 "depends on both the version of C<tune2fs> that libguestfs was built against, "
16371 "and the filesystem itself."
16375 #: ../fish/guestfish-actions.pod:4915
16380 #: ../fish/guestfish-actions.pod:4917
16383 " txz-in (tarball|-) directory\n"
16388 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7583
16390 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
16391 "tar file) into C<directory>."
16395 #: ../fish/guestfish-actions.pod:4924
16400 #: ../fish/guestfish-actions.pod:4926
16403 " txz-out directory (tarball|-)\n"
16408 #: ../fish/guestfish-actions.pod:4928 ../src/guestfs-actions.pod:7597
16410 "This command packs the contents of C<directory> and downloads it to local "
16411 "file C<tarball> (as an xz compressed tar archive)."
16415 #: ../fish/guestfish-actions.pod:4933
16420 #: ../fish/guestfish-actions.pod:4935
16428 #: ../fish/guestfish-actions.pod:4937 ../src/guestfs-actions.pod:7610
16430 "This function sets the mask used for creating new files and device nodes to "
16435 #: ../fish/guestfish-actions.pod:4940 ../src/guestfs-actions.pod:7613
16437 "Typical umask values would be C<022> which creates new files with "
16438 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
16439 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
16443 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7618
16445 "The default umask is C<022>. This is important because it means that "
16446 "directories and device nodes will be created with C<0644> or C<0755> mode "
16447 "even if you specify C<0777>."
16451 #: ../fish/guestfish-actions.pod:4949
16452 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
16456 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7625
16457 msgid "This call returns the previous umask."
16461 #: ../fish/guestfish-actions.pod:4954
16466 #: ../fish/guestfish-actions.pod:4956
16471 #: ../fish/guestfish-actions.pod:4958
16474 " umount pathordevice\n"
16479 #: ../fish/guestfish-actions.pod:4960 ../src/guestfs-actions.pod:7637
16481 "This unmounts the given filesystem. The filesystem may be specified either "
16482 "by its mountpoint (path) or the device which contains the filesystem."
16486 #: ../fish/guestfish-actions.pod:4964
16491 #: ../fish/guestfish-actions.pod:4966
16492 msgid "unmount-all"
16496 #: ../fish/guestfish-actions.pod:4968
16504 #: ../fish/guestfish-actions.pod:4970 ../src/guestfs-actions.pod:7650
16505 msgid "This unmounts all mounted filesystems."
16509 #: ../fish/guestfish-actions.pod:4972 ../src/guestfs-actions.pod:7652
16510 msgid "Some internal mounts are not unmounted by this call."
16514 #: ../fish/guestfish-actions.pod:4974
16519 #: ../fish/guestfish-actions.pod:4976
16522 " upload (filename|-) remotefilename\n"
16527 #: ../fish/guestfish-actions.pod:4978 ../fish/guestfish-actions.pod:4991
16528 #: ../src/guestfs-actions.pod:7665 ../src/guestfs-actions.pod:7689
16529 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
16533 #: ../fish/guestfish-actions.pod:4983
16534 msgid "See also L</download>."
16538 #: ../fish/guestfish-actions.pod:4987
16539 msgid "upload-offset"
16543 #: ../fish/guestfish-actions.pod:4989
16546 " upload-offset (filename|-) remotefilename offset\n"
16551 #: ../fish/guestfish-actions.pod:4994 ../src/guestfs-actions.pod:7692
16553 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
16554 "The intention is to overwrite parts of existing files or devices, although "
16555 "if a non-existant file is specified then it is created with a \"hole\" "
16556 "before C<offset>. The size of the data written is implicit in the size of "
16557 "the source C<filename>."
16561 #: ../fish/guestfish-actions.pod:5001
16563 "Note that there is no limit on the amount of data that can be uploaded with "
16564 "this call, unlike with L</pwrite>, and this call always writes the full "
16565 "amount unless an error occurs."
16569 #: ../fish/guestfish-actions.pod:5006
16570 msgid "See also L</upload>, L</pwrite>."
16574 #: ../fish/guestfish-actions.pod:5010
16579 #: ../fish/guestfish-actions.pod:5012
16582 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
16587 #: ../fish/guestfish-actions.pod:5014 ../src/guestfs-actions.pod:7725
16588 msgid "This command sets the timestamps of a file with nanosecond precision."
16592 #: ../fish/guestfish-actions.pod:5017 ../src/guestfs-actions.pod:7728
16594 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
16599 #: ../fish/guestfish-actions.pod:5020 ../src/guestfs-actions.pod:7731
16601 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
16602 "nanoseconds from the epoch."
16606 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7734
16608 "If the C<*nsecs> field contains the special value C<-1> then the "
16609 "corresponding timestamp is set to the current time. (The C<*secs> field is "
16610 "ignored in this case)."
16614 #: ../fish/guestfish-actions.pod:5027 ../src/guestfs-actions.pod:7738
16616 "If the C<*nsecs> field contains the special value C<-2> then the "
16617 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
16622 #: ../fish/guestfish-actions.pod:5031
16627 #: ../fish/guestfish-actions.pod:5033
16635 #: ../fish/guestfish-actions.pod:5035 ../src/guestfs-actions.pod:7751
16637 "Return the libguestfs version number that the program is linked against."
16641 #: ../fish/guestfish-actions.pod:5038 ../src/guestfs-actions.pod:7754
16643 "Note that because of dynamic linking this is not necessarily the version of "
16644 "libguestfs that you compiled against. You can compile the program, and then "
16645 "at runtime dynamically link against a completely different C<libguestfs.so> "
16650 #: ../fish/guestfish-actions.pod:5043 ../src/guestfs-actions.pod:7759
16652 "This call was added in version C<1.0.58>. In previous versions of "
16653 "libguestfs there was no way to get the version number. From C code you can "
16654 "use dynamic linker functions to find out if this symbol exists (if it "
16655 "doesn't, then it's an earlier version)."
16659 #: ../fish/guestfish-actions.pod:5049 ../src/guestfs-actions.pod:7765
16661 "The call returns a structure with four elements. The first three (C<major>, "
16662 "C<minor> and C<release>) are numbers and correspond to the usual version "
16663 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
16664 "but may be used for distro-specific information."
16668 #: ../fish/guestfish-actions.pod:5055 ../src/guestfs-actions.pod:7771
16670 "To construct the original version string: C<$major.$minor.$release$extra>"
16674 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7774
16675 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16679 #: ../fish/guestfish-actions.pod:5060
16681 "I<Note:> Don't use this call to test for availability of features. In "
16682 "enterprise distributions we backport features from later versions into "
16683 "earlier versions, making this an unreliable way to test for features. Use "
16684 "L</available> instead."
16688 #: ../fish/guestfish-actions.pod:5066
16693 #: ../fish/guestfish-actions.pod:5068
16696 " vfs-label device\n"
16701 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7794
16702 msgid "This returns the filesystem label of the filesystem on C<device>."
16706 #: ../fish/guestfish-actions.pod:5073 ../src/guestfs-actions.pod:7797
16707 msgid "If the filesystem is unlabeled, this returns the empty string."
16711 #: ../fish/guestfish-actions.pod:5075
16712 msgid "To find a filesystem from the label, use L</findfs-label>."
16716 #: ../fish/guestfish-actions.pod:5077
16721 #: ../fish/guestfish-actions.pod:5079
16724 " vfs-type device\n"
16729 #: ../fish/guestfish-actions.pod:5081 ../src/guestfs-actions.pod:7812
16731 "This command gets the filesystem type corresponding to the filesystem on "
16736 #: ../fish/guestfish-actions.pod:5084 ../src/guestfs-actions.pod:7815
16738 "For most filesystems, the result is the name of the Linux VFS module which "
16739 "would be used to mount this filesystem if you mounted it without specifying "
16740 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
16744 #: ../fish/guestfish-actions.pod:5089
16749 #: ../fish/guestfish-actions.pod:5091
16752 " vfs-uuid device\n"
16757 #: ../fish/guestfish-actions.pod:5093 ../src/guestfs-actions.pod:7831
16758 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16762 #: ../fish/guestfish-actions.pod:5096 ../src/guestfs-actions.pod:7834
16763 msgid "If the filesystem does not have a UUID, this returns the empty string."
16767 #: ../fish/guestfish-actions.pod:5098
16768 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
16772 #: ../fish/guestfish-actions.pod:5100
16773 msgid "vg-activate"
16777 #: ../fish/guestfish-actions.pod:5102
16780 " vg-activate true|false 'volgroups ...'\n"
16785 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7850
16787 "This command activates or (if C<activate> is false) deactivates all logical "
16788 "volumes in the listed volume groups C<volgroups>."
16792 #: ../fish/guestfish-actions.pod:5107 ../src/guestfs-actions.pod:7853
16793 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16797 #: ../fish/guestfish-actions.pod:5109 ../src/guestfs-actions.pod:7855
16799 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16800 "activated or deactivated."
16804 #: ../fish/guestfish-actions.pod:5112
16805 msgid "vg-activate-all"
16809 #: ../fish/guestfish-actions.pod:5114
16812 " vg-activate-all true|false\n"
16817 #: ../fish/guestfish-actions.pod:5116 ../src/guestfs-actions.pod:7868
16819 "This command activates or (if C<activate> is false) deactivates all logical "
16820 "volumes in all volume groups."
16824 #: ../fish/guestfish-actions.pod:5119 ../src/guestfs-actions.pod:7871
16825 msgid "This command is the same as running C<vgchange -a y|n>"
16829 #: ../fish/guestfish-actions.pod:5121
16834 #: ../fish/guestfish-actions.pod:5123
16837 " vgcreate volgroup 'physvols ...'\n"
16842 #: ../fish/guestfish-actions.pod:5125 ../src/guestfs-actions.pod:7884
16844 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16845 "of physical volumes C<physvols>."
16849 #: ../fish/guestfish-actions.pod:5128
16854 #: ../fish/guestfish-actions.pod:5130
16857 " vglvuuids vgname\n"
16862 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7897
16864 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16865 "volumes created in this volume group."
16869 #: ../fish/guestfish-actions.pod:5135
16871 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16872 "logical volumes and volume groups."
16876 #: ../fish/guestfish-actions.pod:5138
16877 msgid "See also L</vgpvuuids>."
16881 #: ../fish/guestfish-actions.pod:5140
16886 #: ../fish/guestfish-actions.pod:5142
16889 " vgpvuuids vgname\n"
16894 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7917
16896 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16897 "volumes that this volume group resides on."
16901 #: ../fish/guestfish-actions.pod:5147
16903 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16904 "physical volumes and volume groups."
16908 #: ../fish/guestfish-actions.pod:5150
16909 msgid "See also L</vglvuuids>."
16913 #: ../fish/guestfish-actions.pod:5152
16918 #: ../fish/guestfish-actions.pod:5154
16921 " vgremove vgname\n"
16926 #: ../fish/guestfish-actions.pod:5156 ../src/guestfs-actions.pod:7937
16927 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16931 #: ../fish/guestfish-actions.pod:5158 ../src/guestfs-actions.pod:7939
16933 "This also forcibly removes all logical volumes in the volume group (if any)."
16937 #: ../fish/guestfish-actions.pod:5161
16942 #: ../fish/guestfish-actions.pod:5163
16945 " vgrename volgroup newvolgroup\n"
16950 #: ../fish/guestfish-actions.pod:5165 ../src/guestfs-actions.pod:7953
16951 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16955 #: ../fish/guestfish-actions.pod:5167
16960 #: ../fish/guestfish-actions.pod:5169
16968 #: ../fish/guestfish-actions.pod:5171 ../src/guestfs-actions.pod:7964
16970 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16975 #: ../fish/guestfish-actions.pod:5174 ../src/guestfs-actions.pod:7967
16977 "This returns a list of just the volume group names that were detected (eg. "
16982 #: ../fish/guestfish-actions.pod:5177
16983 msgid "See also L</vgs-full>."
16987 #: ../fish/guestfish-actions.pod:5179
16992 #: ../fish/guestfish-actions.pod:5181
17000 #: ../fish/guestfish-actions.pod:5183 ../src/guestfs-actions.pod:7983
17002 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
17003 "> command. The \"full\" version includes all fields."
17007 #: ../fish/guestfish-actions.pod:5186
17012 #: ../fish/guestfish-actions.pod:5188
17020 #: ../fish/guestfish-actions.pod:5190 ../src/guestfs-actions.pod:7997
17022 "This rescans all block devices and rebuilds the list of LVM physical "
17023 "volumes, volume groups and logical volumes."
17027 #: ../fish/guestfish-actions.pod:5193
17032 #: ../fish/guestfish-actions.pod:5195
17040 #: ../fish/guestfish-actions.pod:5197 ../src/guestfs-actions.pod:8010
17041 msgid "This command returns the UUID of the LVM VG named C<vgname>."
17045 #: ../fish/guestfish-actions.pod:5199
17050 #: ../fish/guestfish-actions.pod:5201
17058 #: ../fish/guestfish-actions.pod:5203 ../src/guestfs-actions.pod:8050
17060 "This command counts the characters in a file, using the C<wc -c> external "
17065 #: ../fish/guestfish-actions.pod:5206
17070 #: ../fish/guestfish-actions.pod:5208
17078 #: ../fish/guestfish-actions.pod:5210 ../src/guestfs-actions.pod:8063
17080 "This command counts the lines in a file, using the C<wc -l> external command."
17084 #: ../fish/guestfish-actions.pod:5213
17089 #: ../fish/guestfish-actions.pod:5215
17097 #: ../fish/guestfish-actions.pod:5217 ../src/guestfs-actions.pod:8076
17099 "This command counts the words in a file, using the C<wc -w> external command."
17103 #: ../fish/guestfish-actions.pod:5220
17108 #: ../fish/guestfish-actions.pod:5222
17111 " write path content\n"
17116 #: ../fish/guestfish-actions.pod:5224 ../src/guestfs-actions.pod:8091
17118 "This call creates a file called C<path>. The content of the file is the "
17119 "string C<content> (which can contain any 8 bit data)."
17123 #: ../fish/guestfish-actions.pod:5227
17124 msgid "See also L</write-append>."
17128 #: ../fish/guestfish-actions.pod:5232
17129 msgid "write-append"
17133 #: ../fish/guestfish-actions.pod:5234
17136 " write-append path content\n"
17141 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:8111
17143 "This call appends C<content> to the end of file C<path>. If C<path> does "
17144 "not exist, then a new file is created."
17148 #: ../fish/guestfish-actions.pod:5239
17149 msgid "See also L</write>."
17153 #: ../fish/guestfish-actions.pod:5244
17158 #: ../fish/guestfish-actions.pod:5246
17161 " write-file path content size\n"
17166 #: ../fish/guestfish-actions.pod:5248 ../src/guestfs-actions.pod:8138
17168 "This call creates a file called C<path>. The contents of the file is the "
17169 "string C<content> (which can contain any 8 bit data), with length C<size>."
17173 #: ../fish/guestfish-actions.pod:5252 ../src/guestfs-actions.pod:8142
17175 "As a special case, if C<size> is C<0> then the length is calculated using "
17176 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
17180 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8146
17182 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
17183 "I<not> work, even if the length is specified."
17187 #: ../fish/guestfish-actions.pod:5262
17189 "I<This function is deprecated.> In new code, use the L</write> call instead."
17193 #: ../fish/guestfish-actions.pod:5269
17198 #: ../fish/guestfish-actions.pod:5271
17201 " zegrep regex path\n"
17206 #: ../fish/guestfish-actions.pod:5273 ../src/guestfs-actions.pod:8163
17208 "This calls the external C<zegrep> program and returns the matching lines."
17212 #: ../fish/guestfish-actions.pod:5279
17217 #: ../fish/guestfish-actions.pod:5281
17220 " zegrepi regex path\n"
17225 #: ../fish/guestfish-actions.pod:5283 ../src/guestfs-actions.pod:8182
17227 "This calls the external C<zegrep -i> program and returns the matching lines."
17231 #: ../fish/guestfish-actions.pod:5289
17236 #: ../fish/guestfish-actions.pod:5291
17244 #: ../fish/guestfish-actions.pod:5293 ../src/guestfs-actions.pod:8200
17245 msgid "This command writes zeroes over the first few blocks of C<device>."
17249 #: ../fish/guestfish-actions.pod:5295 ../src/guestfs-actions.pod:8202
17251 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
17252 "securely wipe the device). It should be sufficient to remove any partition "
17253 "tables, filesystem superblocks and so on."
17257 #: ../fish/guestfish-actions.pod:5299 ../fish/guestfish-actions.pod:5314
17258 #: ../src/guestfs-actions.pod:8206 ../src/guestfs-actions.pod:8232
17260 "If blocks are already zero, then this command avoids writing zeroes. This "
17261 "prevents the underlying device from becoming non-sparse or growing "
17266 #: ../fish/guestfish-actions.pod:5303
17267 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
17271 #: ../fish/guestfish-actions.pod:5306
17272 msgid "zero-device"
17276 #: ../fish/guestfish-actions.pod:5308
17279 " zero-device device\n"
17284 #: ../fish/guestfish-actions.pod:5310
17286 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
17287 "which just zeroes the first few blocks of a device."
17291 #: ../fish/guestfish-actions.pod:5321
17296 #: ../fish/guestfish-actions.pod:5323
17299 " zerofree device\n"
17304 #: ../fish/guestfish-actions.pod:5325 ../src/guestfs-actions.pod:8254
17306 "This runs the I<zerofree> program on C<device>. This program claims to zero "
17307 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
17308 "possible to compress the filesystem more effectively."
17312 #: ../fish/guestfish-actions.pod:5330 ../src/guestfs-actions.pod:8259
17313 msgid "You should B<not> run this program if the filesystem is mounted."
17317 #: ../fish/guestfish-actions.pod:5333 ../src/guestfs-actions.pod:8262
17319 "It is possible that using this program can damage the filesystem or data on "
17324 #: ../fish/guestfish-actions.pod:5336
17329 #: ../fish/guestfish-actions.pod:5338
17332 " zfgrep pattern path\n"
17337 #: ../fish/guestfish-actions.pod:5340 ../src/guestfs-actions.pod:8276
17339 "This calls the external C<zfgrep> program and returns the matching lines."
17343 #: ../fish/guestfish-actions.pod:5346
17348 #: ../fish/guestfish-actions.pod:5348
17351 " zfgrepi pattern path\n"
17356 #: ../fish/guestfish-actions.pod:5350 ../src/guestfs-actions.pod:8295
17358 "This calls the external C<zfgrep -i> program and returns the matching lines."
17362 #: ../fish/guestfish-actions.pod:5356
17367 #: ../fish/guestfish-actions.pod:5358
17370 " zfile meth path\n"
17375 #: ../fish/guestfish-actions.pod:5360 ../src/guestfs-actions.pod:8321
17377 "This command runs C<file> after first decompressing C<path> using C<method>."
17381 #: ../fish/guestfish-actions.pod:5363 ../src/guestfs-actions.pod:8324
17382 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
17386 #: ../fish/guestfish-actions.pod:5365
17388 "Since 1.0.63, use L</file> instead which can now process compressed files."
17392 #: ../fish/guestfish-actions.pod:5368
17394 "I<This function is deprecated.> In new code, use the L</file> call instead."
17398 #: ../fish/guestfish-actions.pod:5375
17403 #: ../fish/guestfish-actions.pod:5377
17406 " zgrep regex path\n"
17411 #: ../fish/guestfish-actions.pod:5379 ../src/guestfs-actions.pod:8341
17413 "This calls the external C<zgrep> program and returns the matching lines."
17417 #: ../fish/guestfish-actions.pod:5385
17422 #: ../fish/guestfish-actions.pod:5387
17425 " zgrepi regex path\n"
17430 #: ../fish/guestfish-actions.pod:5389 ../src/guestfs-actions.pod:8360
17432 "This calls the external C<zgrep -i> program and returns the matching lines."
17436 #: ../fish/guestfish-commands.pod:1
17441 #: ../fish/guestfish-commands.pod:3
17446 #: ../fish/guestfish-commands.pod:5
17449 " alloc filename size\n"
17454 #: ../fish/guestfish-commands.pod:7
17456 "This creates an empty (zeroed) file of the given size, and then adds so it "
17457 "can be further examined."
17461 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
17462 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
17466 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
17467 msgid "Size can be specified using standard suffixes, eg. C<1M>."
17471 #: ../fish/guestfish-commands.pod:14
17473 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
17474 "image, see L</PREPARED DISK IMAGES>."
17478 #: ../fish/guestfish-commands.pod:17
17483 #: ../fish/guestfish-commands.pod:19
17486 " copy-in local [local ...] /remotedir\n"
17491 #: ../fish/guestfish-commands.pod:21
17493 "C<copy-in> copies local files or directories recursively into the disk "
17494 "image, placing them in the directory called C</remotedir> (which must "
17495 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
17496 "other commands as necessary."
17500 #: ../fish/guestfish-commands.pod:26
17502 "Multiple local files and directories can be specified, but the last "
17503 "parameter must always be a remote directory. Wildcards cannot be used."
17507 #: ../fish/guestfish-commands.pod:30
17512 #: ../fish/guestfish-commands.pod:32
17515 " copy-out remote [remote ...] localdir\n"
17520 #: ../fish/guestfish-commands.pod:34
17522 "C<copy-out> copies remote files or directories recursively out of the disk "
17523 "image, placing them on the host disk in a local directory called C<localdir> "
17524 "(which must exist). This guestfish meta-command turns into a sequence of L</"
17525 "download>, L</tar-out> and other commands as necessary."
17529 #: ../fish/guestfish-commands.pod:40
17531 "Multiple remote files and directories can be specified, but the last "
17532 "parameter must always be a local directory. To download to the current "
17533 "directory, use C<.> as in:"
17537 #: ../fish/guestfish-commands.pod:44
17540 " copy-out /home .\n"
17545 #: ../fish/guestfish-commands.pod:46
17547 "Wildcards cannot be used in the ordinary command, but you can use them with "
17548 "the help of L</glob> like this:"
17552 #: ../fish/guestfish-commands.pod:49
17555 " glob copy-out /home/* .\n"
17560 #: ../fish/guestfish-commands.pod:51
17565 #: ../fish/guestfish-commands.pod:53
17568 " display filename\n"
17573 #: ../fish/guestfish-commands.pod:55
17575 "Use C<display> (a graphical display program) to display an image file. It "
17576 "downloads the file, and runs C<display> on it."
17580 #: ../fish/guestfish-commands.pod:58
17582 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
17583 "environment variable. For example to use the GNOME display program:"
17587 #: ../fish/guestfish-commands.pod:61
17590 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
17595 #: ../fish/guestfish-commands.pod:63
17596 msgid "See also L<display(1)>."
17600 #: ../fish/guestfish-commands.pod:65
17605 #: ../fish/guestfish-commands.pod:67
17608 " echo [params ...]\n"
17613 #: ../fish/guestfish-commands.pod:69
17614 msgid "This echos the parameters to the terminal."
17618 #: ../fish/guestfish-commands.pod:71
17623 #: ../fish/guestfish-commands.pod:73
17628 #: ../fish/guestfish-commands.pod:75
17633 #: ../fish/guestfish-commands.pod:77
17641 #: ../fish/guestfish-commands.pod:79
17643 "This is used to edit a file. It downloads the file, edits it locally using "
17644 "your editor, then uploads the result."
17648 #: ../fish/guestfish-commands.pod:82
17650 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
17651 "or C<emacs> you will get those corresponding editors."
17655 #: ../fish/guestfish-commands.pod:86
17660 #: ../fish/guestfish-commands.pod:88
17663 " glob command args...\n"
17668 #: ../fish/guestfish-commands.pod:90
17670 "Expand wildcards in any paths in the args list, and run C<command> "
17671 "repeatedly on each matching path."
17675 #: ../fish/guestfish-commands.pod:93
17676 msgid "See L</WILDCARDS AND GLOBBING>."
17680 #: ../fish/guestfish-commands.pod:95
17685 #: ../fish/guestfish-commands.pod:97
17688 " hexedit <filename|device>\n"
17689 " hexedit <filename|device> <max>\n"
17690 " hexedit <filename|device> <start> <max>\n"
17695 #: ../fish/guestfish-commands.pod:101
17697 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
17702 #: ../fish/guestfish-commands.pod:104
17704 "This command works by downloading potentially the whole file or device, "
17705 "editing it locally, then uploading it. If the file or device is large, you "
17706 "have to specify which part you wish to edit by using C<max> and/or C<start> "
17707 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
17708 "usual modifiers allowed such as C<1M> (1 megabyte)."
17712 #: ../fish/guestfish-commands.pod:111
17713 msgid "For example to edit the first few sectors of a disk you might do:"
17717 #: ../fish/guestfish-commands.pod:114
17720 " hexedit /dev/sda 1M\n"
17725 #: ../fish/guestfish-commands.pod:116
17727 "which would allow you to edit anywhere within the first megabyte of the disk."
17731 #: ../fish/guestfish-commands.pod:119
17732 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
17736 #: ../fish/guestfish-commands.pod:121
17739 " hexedit /dev/sda1 0x400 0x400\n"
17744 #: ../fish/guestfish-commands.pod:123
17745 msgid "(assuming the superblock is in the standard location)."
17749 #: ../fish/guestfish-commands.pod:125
17751 "This command requires the external L<hexedit(1)> program. You can specify "
17752 "another program to use by setting the C<HEXEDITOR> environment variable."
17756 #: ../fish/guestfish-commands.pod:129
17757 msgid "See also L</hexdump>."
17761 #: ../fish/guestfish-commands.pod:131
17766 #: ../fish/guestfish-commands.pod:133
17774 #: ../fish/guestfish-commands.pod:135
17776 "Change the local directory, ie. the current directory of guestfish itself."
17780 #: ../fish/guestfish-commands.pod:138
17781 msgid "Note that C<!cd> won't do what you might expect."
17785 #: ../fish/guestfish-commands.pod:140
17790 #: ../fish/guestfish-commands.pod:142
17795 #: ../fish/guestfish-commands.pod:144
17803 #: ../fish/guestfish-commands.pod:146
17804 msgid "Opens the manual page for guestfish."
17808 #: ../fish/guestfish-commands.pod:148
17813 #: ../fish/guestfish-commands.pod:150
17818 #: ../fish/guestfish-commands.pod:152
17826 #: ../fish/guestfish-commands.pod:154
17834 #: ../fish/guestfish-commands.pod:156
17835 msgid "This is used to view a file."
17839 #: ../fish/guestfish-commands.pod:158
17841 "The default viewer is C<$PAGER>. However if you use the alternate command "
17842 "C<less> you will get the C<less> command specifically."
17846 #: ../fish/guestfish-commands.pod:161
17851 #: ../fish/guestfish-commands.pod:163
17859 #: ../fish/guestfish-commands.pod:165
17861 "Close and reopen the libguestfs handle. It is not necessary to use this "
17862 "normally, because the handle is closed properly when guestfish exits. "
17863 "However this is occasionally useful for testing."
17867 #: ../fish/guestfish-commands.pod:169
17872 #: ../fish/guestfish-commands.pod:171
17875 " setenv VAR value\n"
17880 #: ../fish/guestfish-commands.pod:173
17881 msgid "Set the environment variable C<VAR> to the string C<value>."
17885 #: ../fish/guestfish-commands.pod:175
17887 "To print the value of an environment variable use a shell command such as:"
17891 #: ../fish/guestfish-commands.pod:178
17899 #: ../fish/guestfish-commands.pod:180
17904 #: ../fish/guestfish-commands.pod:182
17907 " sparse filename size\n"
17912 #: ../fish/guestfish-commands.pod:184
17914 "This creates an empty sparse file of the given size, and then adds so it can "
17915 "be further examined."
17919 #: ../fish/guestfish-commands.pod:187
17921 "In all respects it works the same as the L</alloc> command, except that the "
17922 "image file is allocated sparsely, which means that disk blocks are not "
17923 "assigned to the file until they are needed. Sparse disk files only use "
17924 "space when written to, but they are slower and there is a danger you could "
17925 "run out of real disk space during a write operation."
17929 #: ../fish/guestfish-commands.pod:197
17934 #: ../fish/guestfish-commands.pod:199
17942 #: ../fish/guestfish-commands.pod:201
17944 "This command returns a list of the optional groups known to the daemon, and "
17945 "indicates which ones are supported by this build of the libguestfs appliance."
17949 #: ../fish/guestfish-commands.pod:205
17950 msgid "See also L<guestfs(3)/AVAILABILITY>."
17954 #: ../fish/guestfish-commands.pod:207
17959 #: ../fish/guestfish-commands.pod:209
17962 " time command args...\n"
17967 #: ../fish/guestfish-commands.pod:211
17969 "Run the command as usual, but print the elapsed time afterwards. This can "
17970 "be useful for benchmarking operations."
17974 #: ../fish/guestfish-commands.pod:214
17979 #: ../fish/guestfish-commands.pod:216
17987 #: ../fish/guestfish-commands.pod:218
17988 msgid "Remove C<VAR> from the environment."
17992 #: ../fish/guestfish.pod:5
17993 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17997 #: ../fish/guestfish.pod:9
18000 " guestfish [--options] [commands]\n"
18005 #: ../fish/guestfish.pod:11
18013 #: ../fish/guestfish.pod:13
18016 " guestfish [--ro|--rw] -a disk.img\n"
18021 #: ../fish/guestfish.pod:15
18024 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
18029 #: ../fish/guestfish.pod:17
18032 " guestfish -d libvirt-domain\n"
18037 #: ../fish/guestfish.pod:19
18040 " guestfish [--ro|--rw] -a disk.img -i\n"
18045 #: ../fish/guestfish.pod:21
18048 " guestfish -d libvirt-domain -i\n"
18053 #: ../fish/guestfish.pod:25
18055 "Using guestfish in read/write mode on live virtual machines can be "
18056 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
18057 "option to use guestfish safely if the disk image or virtual machine might be "
18062 #: ../fish/guestfish.pod:32
18064 "Guestfish is a shell and command-line tool for examining and modifying "
18065 "virtual machine filesystems. It uses libguestfs and exposes all of the "
18066 "functionality of the guestfs API, see L<guestfs(3)>."
18070 #: ../fish/guestfish.pod:36
18072 "Guestfish gives you structured access to the libguestfs API, from shell "
18073 "scripts or the command line or interactively. If you want to rescue a "
18074 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
18079 #: ../fish/guestfish.pod:43
18080 msgid "As an interactive shell"
18084 #: ../fish/guestfish.pod:45
18092 #: ../fish/guestfish.pod:47
18095 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
18096 " editing virtual machine filesystems.\n"
18101 #: ../fish/guestfish.pod:50
18104 " Type: 'help' for a list of commands\n"
18105 " 'man' to read the manual\n"
18106 " 'quit' to quit the shell\n"
18111 #: ../fish/guestfish.pod:54
18114 " ><fs> add-ro disk.img\n"
18116 " ><fs> list-filesystems\n"
18117 " /dev/sda1: ext4\n"
18118 " /dev/vg_guest/lv_root: ext4\n"
18119 " /dev/vg_guest/lv_swap: swap\n"
18120 " ><fs> mount /dev/vg_guest/lv_root /\n"
18121 " ><fs> cat /etc/fstab\n"
18123 " # Created by anaconda\n"
18130 #: ../fish/guestfish.pod:67
18131 msgid "From shell scripts"
18135 #: ../fish/guestfish.pod:69
18136 msgid "Create a new C</etc/motd> file in a guest or disk image:"
18140 #: ../fish/guestfish.pod:71
18143 " guestfish <<_EOF_\n"
18146 " mount /dev/vg_guest/lv_root /\n"
18147 " write /etc/motd \"Welcome, new users\"\n"
18153 #: ../fish/guestfish.pod:78
18154 msgid "List the LVM logical volumes in a disk image:"
18158 #: ../fish/guestfish.pod:80
18161 " guestfish -a disk.img --ro <<_EOF_\n"
18169 #: ../fish/guestfish.pod:85
18170 msgid "List all the filesystems in a disk image:"
18174 #: ../fish/guestfish.pod:87
18177 " guestfish -a disk.img --ro <<_EOF_\n"
18179 " list-filesystems\n"
18185 #: ../fish/guestfish.pod:92
18186 msgid "On one command line"
18190 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
18191 msgid "Update C</etc/resolv.conf> in a guest:"
18195 #: ../fish/guestfish.pod:96
18199 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
18200 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
18205 #: ../fish/guestfish.pod:100
18206 msgid "Edit C</boot/grub/grub.conf> interactively:"
18210 #: ../fish/guestfish.pod:102
18213 " guestfish --rw --add disk.img \\\n"
18214 " --mount /dev/vg_guest/lv_root \\\n"
18215 " --mount /dev/sda1:/boot \\\n"
18216 " edit /boot/grub/grub.conf\n"
18221 #: ../fish/guestfish.pod:107
18222 msgid "Mount disks automatically"
18226 #: ../fish/guestfish.pod:109
18228 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
18232 #: ../fish/guestfish.pod:112
18235 " guestfish --ro -a disk.img -i cat /etc/group\n"
18240 #: ../fish/guestfish.pod:114
18243 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
18248 #: ../fish/guestfish.pod:116
18249 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
18253 #: ../fish/guestfish.pod:118
18256 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
18261 #: ../fish/guestfish.pod:120
18262 msgid "As a script interpreter"
18266 #: ../fish/guestfish.pod:122
18267 msgid "Create a 100MB disk containing an ext2-formatted partition:"
18271 #: ../fish/guestfish.pod:124
18274 " #!/usr/bin/guestfish -f\n"
18275 " sparse test1.img 100M\n"
18277 " part-disk /dev/sda mbr\n"
18278 " mkfs ext2 /dev/sda1\n"
18283 #: ../fish/guestfish.pod:130
18284 msgid "Start with a prepared disk"
18288 #: ../fish/guestfish.pod:132
18290 "An alternate way to create a 100MB disk called C<test1.img> containing a "
18291 "single ext2-formatted partition:"
18295 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2243
18298 " guestfish -N fs\n"
18303 #: ../fish/guestfish.pod:137
18304 msgid "To list what is available do:"
18308 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
18311 " guestfish -N help | less\n"
18316 #: ../fish/guestfish.pod:141
18317 msgid "Remote control"
18321 #: ../fish/guestfish.pod:143
18324 " eval \"`guestfish --listen`\"\n"
18325 " guestfish --remote add-ro disk.img\n"
18326 " guestfish --remote run\n"
18327 " guestfish --remote lvs\n"
18332 #: ../fish/guestfish.pod:154
18333 msgid "Displays general help on options."
18337 #: ../fish/guestfish.pod:158
18338 msgid "B<--cmd-help>"
18342 #: ../fish/guestfish.pod:160
18343 msgid "Lists all available guestfish commands."
18347 #: ../fish/guestfish.pod:162
18352 #: ../fish/guestfish.pod:164
18353 msgid "B<--cmd-help cmd>"
18357 #: ../fish/guestfish.pod:166
18358 msgid "Displays detailed help on a single command C<cmd>."
18362 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
18363 msgid "B<-a image>"
18367 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
18368 msgid "B<--add image>"
18372 #: ../fish/guestfish.pod:172
18373 msgid "Add a block device or virtual machine image to the shell."
18377 #: ../fish/guestfish.pod:177
18379 "Using this flag is mostly equivalent to using the C<add> command, with "
18380 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
18381 "the I<--format=...> flag was given."
18385 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
18387 "When used in conjunction with the I<-d> option, this specifies the libvirt "
18388 "URI to use. The default is to use the default libvirt connection."
18392 #: ../fish/guestfish.pod:189
18397 #: ../fish/guestfish.pod:191
18399 "If using the I<--listen> option and a csh-like shell, use this option. See "
18400 "section L</REMOTE CONTROL AND CSH> below."
18404 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
18405 msgid "B<-d libvirt-domain>"
18409 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
18410 msgid "B<--domain libvirt-domain>"
18414 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
18416 "Add disks from the named libvirt domain. If the I<--ro> option is also "
18417 "used, then any libvirt domain can be used. However in write mode, only "
18418 "libvirt domains which are shut down can be named here."
18422 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
18423 msgid "Domain UUIDs can be used instead of names."
18427 #: ../fish/guestfish.pod:204
18429 "Using this flag is mostly equivalent to using the C<add-domain> command, "
18430 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
18431 "if the I<--format:...> flag was given."
18435 #: ../fish/guestfish.pod:208
18440 #: ../fish/guestfish.pod:210
18441 msgid "B<--no-dest-paths>"
18445 #: ../fish/guestfish.pod:212
18447 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
18448 "to hit the tab key to complete paths on the guest filesystem, but this "
18449 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
18450 "allow this feature to be disabled."
18454 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
18456 "When prompting for keys and passphrases, guestfish normally turns echoing "
18457 "off so you cannot see what you are typing. If you are not worried about "
18458 "Tempest attacks and there is no one else in the room you can specify this "
18459 "flag to see what you are typing."
18463 #: ../fish/guestfish.pod:224
18468 #: ../fish/guestfish.pod:226
18469 msgid "B<--file file>"
18473 #: ../fish/guestfish.pod:228
18474 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
18478 #: ../fish/guestfish.pod:231
18481 " #!/usr/bin/guestfish -f\n"
18486 #: ../fish/guestfish.pod:244
18489 " guestfish --format=raw -a disk.img\n"
18494 #: ../fish/guestfish.pod:248
18497 " guestfish --format=raw -a disk.img --format -a another.img\n"
18502 #: ../fish/guestfish.pod:253
18504 "If you have untrusted raw-format guest disk images, you should use this "
18505 "option to specify the disk format. This avoids a possible security problem "
18506 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
18510 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
18511 msgid "B<--inspector>"
18515 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
18517 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
18518 "system and mount filesystems as they would be mounted on the real virtual "
18523 #: ../fish/guestfish.pod:266
18524 msgid "Typical usage is either:"
18528 #: ../fish/guestfish.pod:268
18531 " guestfish -d myguest -i\n"
18536 #: ../fish/guestfish.pod:270
18537 msgid "(for an inactive libvirt domain called I<myguest>), or:"
18541 #: ../fish/guestfish.pod:272
18544 " guestfish --ro -d myguest -i\n"
18549 #: ../fish/guestfish.pod:274
18550 msgid "(for active domains, readonly), or specify the block device directly:"
18554 #: ../fish/guestfish.pod:276
18557 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
18562 #: ../fish/guestfish.pod:278
18564 "Note that the command line syntax changed slightly over older versions of "
18565 "guestfish. You can still use the old syntax:"
18569 #: ../fish/guestfish.pod:281
18572 " guestfish [--ro] -i disk.img\n"
18577 #: ../fish/guestfish.pod:283
18580 " guestfish [--ro] -i libvirt-domain\n"
18585 #: ../fish/guestfish.pod:285
18587 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
18588 "then using other commands to mount the filesystems that were found."
18592 #: ../fish/guestfish.pod:294
18593 msgid "B<--listen>"
18597 #: ../fish/guestfish.pod:296
18599 "Fork into the background and listen for remote commands. See section L</"
18600 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
18604 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
18609 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
18611 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
18612 "ATTACHING TO RUNNING DAEMONS>)."
18616 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
18617 msgid "B<-m dev[:mountpoint[:options]]>"
18621 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
18622 msgid "B<--mount dev[:mountpoint[:options]]>"
18626 #: ../fish/guestfish.pod:308
18627 msgid "Mount the named partition or logical volume on the given mountpoint."
18631 #: ../fish/guestfish.pod:310
18632 msgid "If the mountpoint is omitted, it defaults to C</>."
18636 #: ../fish/guestfish.pod:312
18637 msgid "You have to mount something on C</> before most commands will work."
18641 #: ../fish/guestfish.pod:314
18643 "If any I<-m> or I<--mount> options are given, the guest is automatically "
18648 #: ../fish/guestfish.pod:317
18650 "If you don't know what filesystems a disk image contains, you can either run "
18651 "guestfish without this option, then list the partitions, filesystems and LVs "
18652 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
18653 "commands), or you can use the L<virt-filesystems(1)> program."
18657 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
18659 "The third (and rarely used) part of the mount parameter is the list of mount "
18660 "options used to mount the underlying filesystem. If this is not given, then "
18661 "the mount options are either the empty string or C<ro> (the latter if the "
18662 "I<--ro> flag is used). By specifying the mount options, you override this "
18663 "default choice. Probably the only time you would use this is to enable ACLs "
18664 "and/or extended attributes if the filesystem can support them:"
18668 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
18671 " -m /dev/sda1:/:acl,user_xattr\n"
18676 #: ../fish/guestfish.pod:333
18677 msgid "Using this flag is equivalent to using the C<mount-options> command."
18681 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202
18682 #: ../resize/virt-resize.pod:435
18687 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
18688 msgid "B<--no-sync>"
18692 #: ../fish/guestfish.pod:339
18694 "Disable autosync. This is enabled by default. See the discussion of "
18695 "autosync in the L<guestfs(3)> manpage."
18699 #: ../fish/guestfish.pod:342
18704 #: ../fish/guestfish.pod:344
18705 msgid "B<--new type>"
18709 #: ../fish/guestfish.pod:346
18714 #: ../fish/guestfish.pod:348
18716 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18717 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18718 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18723 #: ../fish/guestfish.pod:353
18724 msgid "B<--progress-bars>"
18728 #: ../fish/guestfish.pod:355
18729 msgid "Enable progress bars, even when guestfish is used non-interactively."
18733 #: ../fish/guestfish.pod:357
18735 "Progress bars are enabled by default when guestfish is used as an "
18736 "interactive shell."
18740 #: ../fish/guestfish.pod:360
18741 msgid "B<--no-progress-bars>"
18745 #: ../fish/guestfish.pod:362
18746 msgid "Disable progress bars."
18750 #: ../fish/guestfish.pod:364
18751 msgid "B<--remote[=pid]>"
18755 #: ../fish/guestfish.pod:366
18757 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18758 "CONTROL GUESTFISH OVER A SOCKET> below."
18762 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248
18763 #: ../rescue/virt-rescue.pod:161
18768 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250
18769 #: ../rescue/virt-rescue.pod:163
18774 #: ../fish/guestfish.pod:373
18776 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18777 "mounts are done read-only."
18781 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
18783 "The option must always be used if the disk image or virtual machine might be "
18784 "running, and is generally recommended in cases where you don't need write "
18785 "access to the disk."
18789 #: ../fish/guestfish.pod:380
18791 "Note that prepared disk images created with I<-N> are not affected by this "
18792 "option. Also commands like C<add> are not affected - you have to specify "
18793 "the C<readonly:true> option explicitly if you need it."
18797 #: ../fish/guestfish.pod:384
18798 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18802 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262
18803 #: ../rescue/virt-rescue.pod:173
18804 msgid "B<--selinux>"
18808 #: ../fish/guestfish.pod:388
18809 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18813 #: ../fish/guestfish.pod:394
18815 "Enable very verbose messages. This is particularly useful if you find a bug."
18819 #: ../fish/guestfish.pod:401
18820 msgid "Display the guestfish / libguestfs version number and exit."
18824 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278
18825 #: ../rescue/virt-rescue.pod:194
18830 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280
18831 #: ../rescue/virt-rescue.pod:196
18836 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
18838 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18839 "mounts are done read-write."
18843 #: ../fish/guestfish.pod:410
18844 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18848 #: ../fish/guestfish.pod:414
18849 msgid "Echo each command before executing it."
18853 #: ../fish/guestfish.pod:418
18854 msgid "COMMANDS ON COMMAND LINE"
18858 #: ../fish/guestfish.pod:420
18860 "Any additional (non-option) arguments are treated as commands to execute."
18864 #: ../fish/guestfish.pod:423
18866 "Commands to execute should be separated by a colon (C<:>), where the colon "
18867 "is a separate parameter. Thus:"
18871 #: ../fish/guestfish.pod:426
18874 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18879 #: ../fish/guestfish.pod:428
18881 "If there are no additional arguments, then we enter a shell, either an "
18882 "interactive shell with a prompt (if the input is a terminal) or a non-"
18883 "interactive shell."
18887 #: ../fish/guestfish.pod:432
18889 "In either command line mode or non-interactive shell, the first command that "
18890 "gives an error causes the whole shell to exit. In interactive mode (with a "
18891 "prompt) if a command fails, you can continue to enter commands."
18895 #: ../fish/guestfish.pod:437
18896 msgid "USING launch (OR run)"
18900 #: ../fish/guestfish.pod:439
18902 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18903 "then launch it, then mount any disks you need, and finally issue actions/"
18904 "commands. So the general order of the day is:"
18908 #: ../fish/guestfish.pod:447
18909 msgid "add or -a/--add"
18913 #: ../fish/guestfish.pod:451
18914 msgid "launch (aka run)"
18918 #: ../fish/guestfish.pod:455
18919 msgid "mount or -m/--mount"
18923 #: ../fish/guestfish.pod:459
18924 msgid "any other commands"
18928 #: ../fish/guestfish.pod:463
18930 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18931 "guest before mounting or performing any other commands."
18935 #: ../fish/guestfish.pod:466
18937 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18938 "I<--new> options were given then C<run> is done automatically, simply "
18939 "because guestfish can't perform the action you asked for without doing this."
18943 #: ../fish/guestfish.pod:471
18944 msgid "OPENING DISKS FOR READ AND WRITE"
18948 #: ../fish/guestfish.pod:473
18950 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18951 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18952 "I<-i> and I<-m> open disk images read-only or for writing."
18956 #: ../fish/guestfish.pod:478
18958 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18959 "opening disk images supplied on the command line for write. To open a disk "
18960 "image read-only you have to do I<-a image --ro>."
18964 #: ../fish/guestfish.pod:482
18966 "This matters: If you accidentally open a live VM disk image writable then "
18967 "you will cause irreversible disk corruption."
18971 #: ../fish/guestfish.pod:485
18973 "In a future libguestfs we intend to change the default the other way. Disk "
18974 "images will be opened read-only. You will have to either specify "
18975 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18976 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18977 "access for disk images specified by those other command line options."
18981 #: ../fish/guestfish.pod:492
18983 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18984 "which does nothing (it is already the default). However it is highly "
18985 "recommended that you use this option to indicate that you need write access, "
18986 "and prepare your scripts for the day when this option will be required for "
18991 #: ../fish/guestfish.pod:498
18993 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18994 "other libguestfs program apart from guestfish and guestmount."
18998 #: ../fish/guestfish.pod:501
19003 #: ../fish/guestfish.pod:503
19005 "You can quote ordinary parameters using either single or double quotes. For "
19010 #: ../fish/guestfish.pod:506
19013 " add \"file with a space.img\"\n"
19018 #: ../fish/guestfish.pod:508
19021 " rm '/file name'\n"
19026 #: ../fish/guestfish.pod:510
19034 #: ../fish/guestfish.pod:512
19036 "A few commands require a list of strings to be passed. For these, use a "
19037 "whitespace-separated list, enclosed in quotes. Strings containing "
19038 "whitespace to be passed through must be enclosed in single quotes. A "
19039 "literal single quote must be escaped with a backslash."
19043 #: ../fish/guestfish.pod:517
19046 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
19047 " command \"/bin/echo 'foo bar'\"\n"
19048 " command \"/bin/echo \\'foo\\'\"\n"
19053 #: ../fish/guestfish.pod:521
19054 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
19058 #: ../fish/guestfish.pod:523
19060 "In double-quoted arguments (only) use backslash to insert special characters:"
19064 #: ../fish/guestfish.pod:528
19069 #: ../fish/guestfish.pod:530
19070 msgid "Alert (bell) character."
19074 #: ../fish/guestfish.pod:532
19079 #: ../fish/guestfish.pod:534
19080 msgid "Backspace character."
19084 #: ../fish/guestfish.pod:536
19089 #: ../fish/guestfish.pod:538
19090 msgid "Form feed character."
19094 #: ../fish/guestfish.pod:540
19099 #: ../fish/guestfish.pod:542
19100 msgid "Newline character."
19104 #: ../fish/guestfish.pod:544
19109 #: ../fish/guestfish.pod:546
19110 msgid "Carriage return character."
19114 #: ../fish/guestfish.pod:548
19119 #: ../fish/guestfish.pod:550
19120 msgid "Horizontal tab character."
19124 #: ../fish/guestfish.pod:552
19129 #: ../fish/guestfish.pod:554
19130 msgid "Vertical tab character."
19134 #: ../fish/guestfish.pod:556
19139 #: ../fish/guestfish.pod:558
19140 msgid "A literal double quote character."
19144 #: ../fish/guestfish.pod:560
19149 #: ../fish/guestfish.pod:562
19151 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
19156 #: ../fish/guestfish.pod:565
19161 #: ../fish/guestfish.pod:567
19163 "A character with hex value I<hh>. There must be precisely 2 hex digits."
19167 #: ../fish/guestfish.pod:570
19169 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
19174 #: ../fish/guestfish.pod:573
19179 #: ../fish/guestfish.pod:575
19180 msgid "A literal backslash character."
19184 #: ../fish/guestfish.pod:579
19185 msgid "OPTIONAL ARGUMENTS"
19189 #: ../fish/guestfish.pod:581
19191 "Some commands take optional arguments. These arguments appear in this "
19192 "documentation as C<[argname:..]>. You can use them as in these examples:"
19196 #: ../fish/guestfish.pod:585
19199 " add-drive-opts filename\n"
19204 #: ../fish/guestfish.pod:587
19207 " add-drive-opts filename readonly:true\n"
19212 #: ../fish/guestfish.pod:589
19215 " add-drive-opts filename format:qcow2 readonly:false\n"
19220 #: ../fish/guestfish.pod:591
19222 "Each optional argument can appear at most once. All optional arguments must "
19223 "appear after the required ones."
19227 #: ../fish/guestfish.pod:594
19232 #: ../fish/guestfish.pod:596
19234 "This section applies to all commands which can take integers as parameters."
19238 #: ../fish/guestfish.pod:599
19239 msgid "SIZE SUFFIX"
19243 #: ../fish/guestfish.pod:601
19245 "When the command takes a parameter measured in bytes, you can use one of the "
19246 "following suffixes to specify kilobytes, megabytes and larger sizes:"
19250 #: ../fish/guestfish.pod:607
19251 msgid "B<k> or B<K> or B<KiB>"
19255 #: ../fish/guestfish.pod:609
19256 msgid "The size in kilobytes (multiplied by 1024)."
19260 #: ../fish/guestfish.pod:611
19265 #: ../fish/guestfish.pod:613
19266 msgid "The size in SI 1000 byte units."
19270 #: ../fish/guestfish.pod:615
19271 msgid "B<M> or B<MiB>"
19275 #: ../fish/guestfish.pod:617
19276 msgid "The size in megabytes (multiplied by 1048576)."
19280 #: ../fish/guestfish.pod:619
19285 #: ../fish/guestfish.pod:621
19286 msgid "The size in SI 1000000 byte units."
19290 #: ../fish/guestfish.pod:623
19291 msgid "B<G> or B<GiB>"
19295 #: ../fish/guestfish.pod:625
19296 msgid "The size in gigabytes (multiplied by 2**30)."
19300 #: ../fish/guestfish.pod:627
19305 #: ../fish/guestfish.pod:629
19306 msgid "The size in SI 10**9 byte units."
19310 #: ../fish/guestfish.pod:631
19311 msgid "B<T> or B<TiB>"
19315 #: ../fish/guestfish.pod:633
19316 msgid "The size in terabytes (multiplied by 2**40)."
19320 #: ../fish/guestfish.pod:635
19325 #: ../fish/guestfish.pod:637
19326 msgid "The size in SI 10**12 byte units."
19330 #: ../fish/guestfish.pod:639
19331 msgid "B<P> or B<PiB>"
19335 #: ../fish/guestfish.pod:641
19336 msgid "The size in petabytes (multiplied by 2**50)."
19340 #: ../fish/guestfish.pod:643
19345 #: ../fish/guestfish.pod:645
19346 msgid "The size in SI 10**15 byte units."
19350 #: ../fish/guestfish.pod:647
19351 msgid "B<E> or B<EiB>"
19355 #: ../fish/guestfish.pod:649
19356 msgid "The size in exabytes (multiplied by 2**60)."
19360 #: ../fish/guestfish.pod:651
19365 #: ../fish/guestfish.pod:653
19366 msgid "The size in SI 10**18 byte units."
19370 #: ../fish/guestfish.pod:655
19371 msgid "B<Z> or B<ZiB>"
19375 #: ../fish/guestfish.pod:657
19376 msgid "The size in zettabytes (multiplied by 2**70)."
19380 #: ../fish/guestfish.pod:659
19385 #: ../fish/guestfish.pod:661
19386 msgid "The size in SI 10**21 byte units."
19390 #: ../fish/guestfish.pod:663
19391 msgid "B<Y> or B<YiB>"
19395 #: ../fish/guestfish.pod:665
19396 msgid "The size in yottabytes (multiplied by 2**80)."
19400 #: ../fish/guestfish.pod:667
19405 #: ../fish/guestfish.pod:669
19406 msgid "The size in SI 10**24 byte units."
19410 #: ../fish/guestfish.pod:675
19413 " truncate-size /file 1G\n"
19418 #: ../fish/guestfish.pod:677
19419 msgid "would truncate the file to 1 gigabyte."
19423 #: ../fish/guestfish.pod:679
19425 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
19426 "the parameter to L</memsize> is specified in megabytes already). Adding a "
19427 "suffix will probably not do what you expect."
19431 #: ../fish/guestfish.pod:683
19432 msgid "OCTAL AND HEXADECIMAL NUMBERS"
19436 #: ../fish/guestfish.pod:685
19438 "For specifying the radix (base) use the C convention: C<0> to prefix an "
19439 "octal number or C<0x> to prefix a hexadecimal number. For example:"
19443 #: ../fish/guestfish.pod:688
19446 " 1234 decimal number 1234\n"
19447 " 02322 octal number, equivalent to decimal 1234\n"
19448 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
19453 #: ../fish/guestfish.pod:692
19455 "When using the C<chmod> command, you almost always want to specify an octal "
19456 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
19457 "L<chmod(1)> program):"
19461 #: ../fish/guestfish.pod:696
19464 " chmod 0777 /public # OK\n"
19465 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
19470 #: ../fish/guestfish.pod:699
19472 "Commands that return numbers usually print them in decimal, but some "
19473 "commands print numbers in other radices (eg. C<umask> prints the mode in "
19474 "octal, preceeded by C<0>)."
19478 #: ../fish/guestfish.pod:703
19479 msgid "WILDCARDS AND GLOBBING"
19483 #: ../fish/guestfish.pod:705
19485 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
19486 "(globbing) by default. So for example the following will not do what you "
19491 #: ../fish/guestfish.pod:709
19499 #: ../fish/guestfish.pod:711
19501 "Assuming you don't have a directory called literally C</home/*> then the "
19502 "above command will return an error."
19506 #: ../fish/guestfish.pod:714
19507 msgid "To perform wildcard expansion, use the C<glob> command."
19511 #: ../fish/guestfish.pod:716
19514 " glob rm-rf /home/*\n"
19519 #: ../fish/guestfish.pod:718
19521 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
19522 "many times), equivalent to:"
19526 #: ../fish/guestfish.pod:721
19529 " rm-rf /home/jim\n"
19530 " rm-rf /home/joe\n"
19531 " rm-rf /home/mary\n"
19536 #: ../fish/guestfish.pod:725
19537 msgid "C<glob> only works on simple guest paths and not on device names."
19541 #: ../fish/guestfish.pod:727
19543 "If you have several parameters, each containing a wildcard, then glob will "
19544 "perform a Cartesian product."
19548 #: ../fish/guestfish.pod:730
19553 #: ../fish/guestfish.pod:732
19555 "Any line which starts with a I<#> character is treated as a comment and "
19556 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
19557 "a command. For example:"
19561 #: ../fish/guestfish.pod:736
19564 " # this is a comment\n"
19565 " # this is a comment\n"
19566 " foo # NOT a comment\n"
19571 #: ../fish/guestfish.pod:740
19572 msgid "Blank lines are also ignored."
19576 #: ../fish/guestfish.pod:742
19577 msgid "RUNNING COMMANDS LOCALLY"
19581 #: ../fish/guestfish.pod:744
19583 "Any line which starts with a I<!> character is treated as a command sent to "
19584 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
19588 #: ../fish/guestfish.pod:748
19592 " tgz-out /remote local/remote-data.tar.gz\n"
19597 #: ../fish/guestfish.pod:751
19599 "will create a directory C<local> on the host, and then export the contents "
19600 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
19601 "(See C<tgz-out>)."
19605 #: ../fish/guestfish.pod:755
19607 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
19608 "effect, due to the way that subprocesses work in Unix."
19612 #: ../fish/guestfish.pod:758
19613 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
19617 #: ../fish/guestfish.pod:760
19619 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
19620 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
19621 "and executed as guestfish commands."
19625 #: ../fish/guestfish.pod:764
19627 "Thus you can use shell script to construct arbitrary guestfish commands "
19628 "which are then parsed by guestfish."
19632 #: ../fish/guestfish.pod:767
19634 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
19635 "through C</foo.100>) using guestfish commands alone. However this is simple "
19636 "if we use a shell script to create the guestfish commands for us:"
19640 #: ../fish/guestfish.pod:772
19643 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
19648 #: ../fish/guestfish.pod:774
19649 msgid "or with names like C</foo.001>:"
19653 #: ../fish/guestfish.pod:776
19656 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
19661 #: ../fish/guestfish.pod:778
19663 "When using guestfish interactively it can be helpful to just run the shell "
19664 "script first (ie. remove the initial C<E<lt>> character so it is just an "
19665 "ordinary I<!> local command), see what guestfish commands it would run, and "
19666 "when you are happy with those prepend the C<E<lt>> character to run the "
19667 "guestfish commands for real."
19671 #: ../fish/guestfish.pod:784
19676 #: ../fish/guestfish.pod:786
19678 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
19679 "command (a guestfish command) to the second command (any host command). For "
19684 #: ../fish/guestfish.pod:790
19687 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19692 #: ../fish/guestfish.pod:792
19694 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19695 "program). The above command would list all accounts in the guest filesystem "
19696 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19700 #: ../fish/guestfish.pod:797
19703 " hexdump /bin/ls | head\n"
19704 " list-devices | tail -1\n"
19705 " tgz-out / - | tar ztf -\n"
19710 #: ../fish/guestfish.pod:801
19712 "The space before the pipe symbol is required, any space after the pipe "
19713 "symbol is optional. Everything after the pipe symbol is just passed "
19714 "straight to the host shell, so it can contain redirections, globs and "
19715 "anything else that makes sense on the host side."
19719 #: ../fish/guestfish.pod:806
19721 "To use a literal argument which begins with a pipe symbol, you have to quote "
19726 #: ../fish/guestfish.pod:809
19734 #: ../fish/guestfish.pod:811
19735 msgid "HOME DIRECTORIES"
19739 #: ../fish/guestfish.pod:813
19741 "If a parameter starts with the character C<~> then the tilde may be expanded "
19742 "as a home directory path (either C<~> for the current user's home directory, "
19743 "or C<~user> for another user)."
19747 #: ../fish/guestfish.pod:817
19749 "Note that home directory expansion happens for users known I<on the host>, "
19750 "not in the guest filesystem."
19754 #: ../fish/guestfish.pod:820
19756 "To use a literal argument which begins with a tilde, you have to quote it, "
19761 #: ../fish/guestfish.pod:823
19769 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:534
19770 msgid "ENCRYPTED DISKS"
19774 #: ../fish/guestfish.pod:827
19776 "Libguestfs has some support for Linux guests encrypted according to the "
19777 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19778 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
19779 "LUKS is supported."
19783 #: ../fish/guestfish.pod:832
19784 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19788 #: ../fish/guestfish.pod:834
19791 " ><fs> vfs-type /dev/sda2\n"
19797 #: ../fish/guestfish.pod:837
19799 "Then open those devices using L</luks-open>. This creates a device-mapper "
19800 "device called C</dev/mapper/luksdev>."
19804 #: ../fish/guestfish.pod:840
19807 " ><fs> luks-open /dev/sda2 luksdev\n"
19808 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19813 #: ../fish/guestfish.pod:843
19815 "Finally you have to tell LVM to scan for volume groups on the newly created "
19820 #: ../fish/guestfish.pod:846
19824 " vg-activate-all true\n"
19829 #: ../fish/guestfish.pod:849
19830 msgid "The logical volume(s) can now be mounted in the usual way."
19834 #: ../fish/guestfish.pod:851
19836 "Before closing a LUKS device you must unmount any logical volumes on it and "
19837 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19838 "one. Then you can close the mapper device:"
19842 #: ../fish/guestfish.pod:855
19845 " vg-activate false /dev/VG\n"
19846 " luks-close /dev/mapper/luksdev\n"
19851 #: ../fish/guestfish.pod:860
19853 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19854 "letters and paths (with some limitations). The following commands are "
19859 #: ../fish/guestfish.pod:864
19862 " file /WINDOWS/system32/config/system.LOG\n"
19867 #: ../fish/guestfish.pod:866
19870 " file win:\\windows\\system32\\config\\system.log\n"
19875 #: ../fish/guestfish.pod:868
19878 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19883 #: ../fish/guestfish.pod:870
19885 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19886 "where the drive is mounted, prepending that to the path, changing all "
19887 "backslash characters to forward slash, then resolving the result using L</"
19888 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
19889 "the parameter might be rewritten like this:"
19893 #: ../fish/guestfish.pod:876
19896 " win:e:\\foo\\bar => /e/FOO/bar\n"
19901 #: ../fish/guestfish.pod:878
19902 msgid "This only works in argument positions that expect a path."
19906 #: ../fish/guestfish.pod:880
19907 msgid "UPLOADING AND DOWNLOADING FILES"
19911 #: ../fish/guestfish.pod:882
19913 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19914 "others which upload from or download to a local file, you can use the "
19915 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19919 #: ../fish/guestfish.pod:886
19927 #: ../fish/guestfish.pod:888
19929 "reads stdin and creates from that a file C</foo> in the disk image, and:"
19933 #: ../fish/guestfish.pod:891
19936 " tar-out /etc - | tar tf -\n"
19941 #: ../fish/guestfish.pod:893
19943 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19944 "command (see L</PIPES>)."
19948 #: ../fish/guestfish.pod:896
19950 "When using C<-> to read from stdin, the input is read up to the end of "
19951 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19952 "some arbitrary end marker:"
19956 #: ../fish/guestfish.pod:900
19959 " upload -<<END /foo\n"
19968 #: ../fish/guestfish.pod:906
19970 "Any string of characters can be used instead of C<END>. The end marker must "
19971 "appear on a line of its own, without any preceeding or following characters "
19972 "(not even spaces)."
19976 #: ../fish/guestfish.pod:910
19978 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19979 "upload local files (so-called \"FileIn\" parameters in the generator)."
19983 #: ../fish/guestfish.pod:913
19984 msgid "EXIT ON ERROR BEHAVIOUR"
19988 #: ../fish/guestfish.pod:915
19990 "By default, guestfish will ignore any errors when in interactive mode (ie. "
19991 "taking commands from a human over a tty), and will exit on the first error "
19992 "in non-interactive mode (scripts, commands given on the command line)."
19996 #: ../fish/guestfish.pod:920
19998 "If you prefix a command with a I<-> character, then that command will not "
19999 "cause guestfish to exit, even if that (one) command returns an error."
20003 #: ../fish/guestfish.pod:924
20004 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
20008 #: ../fish/guestfish.pod:926
20010 "Guestfish can be remote-controlled over a socket. This is useful "
20011 "particularly in shell scripts where you want to make several different "
20012 "changes to a filesystem, but you don't want the overhead of starting up a "
20013 "guestfish process each time."
20017 #: ../fish/guestfish.pod:931
20018 msgid "Start a guestfish server process using:"
20022 #: ../fish/guestfish.pod:933
20025 " eval \"`guestfish --listen`\"\n"
20030 #: ../fish/guestfish.pod:935
20031 msgid "and then send it commands by doing:"
20035 #: ../fish/guestfish.pod:937
20038 " guestfish --remote cmd [...]\n"
20043 #: ../fish/guestfish.pod:939
20044 msgid "To cause the server to exit, send it the exit command:"
20048 #: ../fish/guestfish.pod:943
20050 "Note that the server will normally exit if there is an error in a command. "
20051 "You can change this in the usual way. See section L</EXIT ON ERROR "
20056 #: ../fish/guestfish.pod:947
20057 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
20061 #: ../fish/guestfish.pod:949
20063 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
20064 "is how the I<--remote> option knows where to send the commands. You can "
20065 "have several guestfish listener processes running using:"
20069 #: ../fish/guestfish.pod:953
20072 " eval \"`guestfish --listen`\"\n"
20073 " pid1=$GUESTFISH_PID\n"
20074 " eval \"`guestfish --listen`\"\n"
20075 " pid2=$GUESTFISH_PID\n"
20077 " guestfish --remote=$pid1 cmd\n"
20078 " guestfish --remote=$pid2 cmd\n"
20083 #: ../fish/guestfish.pod:961
20084 msgid "REMOTE CONTROL AND CSH"
20088 #: ../fish/guestfish.pod:963
20090 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
20095 #: ../fish/guestfish.pod:966
20098 " eval \"`guestfish --listen --csh`\"\n"
20103 #: ../fish/guestfish.pod:968
20104 msgid "REMOTE CONTROL DETAILS"
20108 #: ../fish/guestfish.pod:970
20110 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
20111 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
20112 "and C<$PID> is the process ID of the server."
20116 #: ../fish/guestfish.pod:974
20117 msgid "Guestfish client and server versions must match exactly."
20121 #: ../fish/guestfish.pod:976
20122 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
20126 #: ../fish/guestfish.pod:978
20128 "From Bash, you can use the following code which creates a guestfish "
20129 "instance, correctly quotes the command line, handles failure to start, and "
20130 "cleans up guestfish when the script exits:"
20134 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:980
20142 #: ../fish/guestfish.pod:986
20145 " guestfish[0]=\"guestfish\"\n"
20146 " guestfish[1]=\"--listen\"\n"
20147 " guestfish[2]=\"--ro\"\n"
20148 " guestfish[3]=\"-a\"\n"
20149 " guestfish[4]=\"disk.img\"\n"
20154 #: ../fish/guestfish.pod:992
20157 " GUESTFISH_PID=\n"
20158 " eval $(\"${guestfish[@]}\")\n"
20159 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
20160 " echo \"error: guestfish didn't start up, see error messages above\"\n"
20167 #: ../fish/guestfish.pod:999
20170 " cleanup_guestfish ()\n"
20172 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
20174 " trap cleanup_guestfish EXIT ERR\n"
20179 #: ../fish/guestfish.pod:1005
20182 " guestfish --remote -- run\n"
20187 #: ../fish/guestfish.pod:1007
20195 #: ../fish/guestfish.pod:1009
20196 msgid "REMOTE CONTROL RUN COMMAND HANGING"
20200 #: ../fish/guestfish.pod:1011
20202 "Using the C<run> (or C<launch>) command remotely in a command substitution "
20203 "context hangs, ie. don't do (note the backquotes):"
20207 #: ../fish/guestfish.pod:1014
20210 " a=`guestfish --remote run`\n"
20215 #: ../fish/guestfish.pod:1016
20217 "Since the C<run> command produces no output on stdout, this is not useful "
20218 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
20223 #: ../fish/guestfish.pod:1020
20224 msgid "PREPARED DISK IMAGES"
20228 #: ../fish/guestfish.pod:1022
20230 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
20231 "preformatted disk images that guestfish can make for you to save typing. "
20232 "This is particularly useful for testing purposes. This option is used "
20233 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
20234 "can be mixed with I<-a>)."
20238 #: ../fish/guestfish.pod:1028
20240 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
20241 "the second and so on. Existing files in the current directory are "
20246 #: ../fish/guestfish.pod:1032
20248 "The type briefly describes how the disk should be sized, partitioned, how "
20249 "filesystem(s) should be created, and how content should be added. "
20250 "Optionally the type can be followed by extra parameters, separated by C<:> "
20251 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
20252 "allocated disk, containing a single partition, with the partition formatted "
20253 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
20258 #: ../fish/guestfish.pod:1040
20259 msgid "To list the available types and any extra parameters they take, run:"
20263 #: ../fish/guestfish.pod:1044
20265 "Note that the prepared filesystem is not mounted. You would usually have to "
20266 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
20270 #: ../fish/guestfish.pod:1048
20272 "If any I<-N> or I<--new> options are given, the guest is automatically "
20277 #: ../fish/guestfish.pod:1053
20278 msgid "Create a 100MB disk with an ext4-formatted partition:"
20282 #: ../fish/guestfish.pod:1055
20285 " guestfish -N fs:ext4\n"
20290 #: ../fish/guestfish.pod:1057
20291 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
20295 #: ../fish/guestfish.pod:1059
20298 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
20303 #: ../fish/guestfish.pod:1061
20304 msgid "Create a blank 200MB disk:"
20308 #: ../fish/guestfish.pod:1063
20311 " guestfish -N disk:200M\n"
20316 #: ../fish/guestfish.pod:1065
20317 msgid "PROGRESS BARS"
20321 #: ../fish/guestfish.pod:1067
20323 "Some (not all) long-running commands send progress notification messages as "
20324 "they are running. Guestfish turns these messages into progress bars."
20328 #: ../fish/guestfish.pod:1071
20330 "When a command that supports progress bars takes longer than two seconds to "
20331 "run, and if progress bars are enabled, then you will see one appearing below "
20336 #: ../fish/guestfish.pod:1075
20339 " ><fs> copy-size /large-file /another-file 2048M\n"
20340 " / 10% [#####-----------------------------------------] 00:30\n"
20345 #: ../fish/guestfish.pod:1078
20347 "The spinner on the left hand side moves round once for every progress "
20348 "notification received from the backend. This is a (reasonably) golden "
20349 "assurance that the command is \"doing something\" even if the progress bar "
20350 "is not moving, because the command is able to send the progress "
20351 "notifications. When the bar reaches 100% and the command finishes, the "
20352 "spinner disappears."
20356 #: ../fish/guestfish.pod:1085
20358 "Progress bars are enabled by default when guestfish is used interactively. "
20359 "You can enable them even for non-interactive modes using I<--progress-bars>, "
20360 "and you can disable them completely using I<--no-progress-bars>."
20364 #: ../fish/guestfish.pod:1090
20365 msgid "GUESTFISH COMMANDS"
20369 #: ../fish/guestfish.pod:1092
20371 "The commands in this section are guestfish convenience commands, in other "
20372 "words, they are not part of the L<guestfs(3)> API."
20376 #: ../fish/guestfish.pod:1095
20381 #: ../fish/guestfish.pod:1097
20390 #: ../fish/guestfish.pod:1100
20391 msgid "Without any parameter, this provides general help."
20395 #: ../fish/guestfish.pod:1102
20396 msgid "With a C<cmd> parameter, this displays detailed help for that command."
20400 #: ../fish/guestfish.pod:1104
20401 msgid "quit | exit"
20405 #: ../fish/guestfish.pod:1106
20406 msgid "This exits guestfish. You can also use C<^D> key."
20410 #: ../fish/guestfish.pod:1108
20411 msgid "@FISH_COMMANDS@"
20415 #: ../fish/guestfish.pod:1110
20420 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1520
20425 #: ../fish/guestfish.pod:1116
20427 "guestfish returns 0 if the commands completed without error, or 1 if there "
20432 #: ../fish/guestfish.pod:1123
20437 #: ../fish/guestfish.pod:1125
20439 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
20444 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3213
20445 msgid "FEBOOTSTRAP_KERNEL"
20449 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3215
20450 msgid "FEBOOTSTRAP_MODULES"
20454 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3217
20456 "These two environment variables allow the kernel that libguestfs uses in the "
20457 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
20458 "most recent host kernel is chosen. For more information about kernel "
20459 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
20460 "available in febootstrap E<ge> 3.8."
20464 #: ../fish/guestfish.pod:1138
20465 msgid "GUESTFISH_DISPLAY_IMAGE"
20469 #: ../fish/guestfish.pod:1140
20471 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
20472 "If not set, it uses L<display(1)>."
20476 #: ../fish/guestfish.pod:1143
20477 msgid "GUESTFISH_PID"
20481 #: ../fish/guestfish.pod:1145
20483 "Used with the I<--remote> option to specify the remote guestfish process to "
20484 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
20488 #: ../fish/guestfish.pod:1149
20493 #: ../fish/guestfish.pod:1151
20495 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
20496 "not specified, the external L<hexedit(1)> program is used."
20500 #: ../fish/guestfish.pod:1155
20505 #: ../fish/guestfish.pod:1157
20507 "If compiled with GNU readline support, various files in the home directory "
20508 "can be used. See L</FILES>."
20512 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3223
20513 msgid "LIBGUESTFS_APPEND"
20517 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3225
20518 msgid "Pass additional options to the guest kernel."
20522 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3227
20523 msgid "LIBGUESTFS_DEBUG"
20527 #: ../fish/guestfish.pod:1166
20529 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
20530 "effect as using the B<-v> option."
20534 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3232
20535 msgid "LIBGUESTFS_MEMSIZE"
20539 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3234
20541 "Set the memory allocated to the qemu process, in megabytes. For example:"
20545 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3237
20548 " LIBGUESTFS_MEMSIZE=700\n"
20553 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3239
20554 msgid "LIBGUESTFS_PATH"
20558 #: ../fish/guestfish.pod:1178
20560 "Set the path that guestfish uses to search for kernel and initrd.img. See "
20561 "the discussion of paths in L<guestfs(3)>."
20565 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3244
20566 msgid "LIBGUESTFS_QEMU"
20570 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3246
20572 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
20573 "which was found at compile time by the configure script is used."
20577 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3252
20578 msgid "LIBGUESTFS_TRACE"
20582 #: ../fish/guestfish.pod:1189
20583 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
20587 #: ../fish/guestfish.pod:1191
20592 #: ../fish/guestfish.pod:1193
20594 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
20599 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236
20600 #: ../src/guestfs.pod:3257
20605 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3259
20607 "Location of temporary directory, defaults to C</tmp> except for the cached "
20608 "supermin appliance which defaults to C</var/tmp>."
20612 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3262
20614 "If libguestfs was compiled to use the supermin appliance then the real "
20615 "appliance is cached in this directory, shared between all handles belonging "
20616 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
20617 "use in case C</var/tmp> is not large enough."
20621 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297
20622 #: ../rescue/virt-rescue.pod:273
20627 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301
20628 #: ../rescue/virt-rescue.pod:277
20629 msgid "$HOME/.libguestfs-tools.rc"
20633 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303
20634 #: ../rescue/virt-rescue.pod:279
20635 msgid "/etc/libguestfs-tools.conf"
20639 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305
20640 #: ../rescue/virt-rescue.pod:281
20642 "This configuration file controls the default read-only or read-write mode "
20643 "(I<--ro> or I<--rw>)."
20647 #: ../fish/guestfish.pod:1220
20648 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
20652 #: ../fish/guestfish.pod:1222
20653 msgid "$HOME/.guestfish"
20657 #: ../fish/guestfish.pod:1224
20659 "If compiled with GNU readline support, then the command history is saved in "
20664 #: ../fish/guestfish.pod:1227
20665 msgid "$HOME/.inputrc"
20669 #: ../fish/guestfish.pod:1229
20670 msgid "/etc/inputrc"
20674 #: ../fish/guestfish.pod:1231
20676 "If compiled with GNU readline support, then these files can be used to "
20677 "configure readline. For further information, please see L<readline(3)/"
20678 "INITIALIZATION FILE>."
20682 #: ../fish/guestfish.pod:1235
20683 msgid "To write rules which only apply to guestfish, use:"
20687 #: ../fish/guestfish.pod:1237
20697 #: ../fish/guestfish.pod:1241
20699 "Variables that you can set in inputrc that change the behaviour of guestfish "
20700 "in useful ways include:"
20704 #: ../fish/guestfish.pod:1246
20705 msgid "completion-ignore-case (default: on)"
20709 #: ../fish/guestfish.pod:1248
20711 "By default, guestfish will ignore case when tab-completing paths on the "
20716 #: ../fish/guestfish.pod:1251
20719 " set completion-ignore-case off\n"
20724 #: ../fish/guestfish.pod:1253
20725 msgid "to make guestfish case sensitive."
20729 #: ../fish/guestfish.pod:1257
20734 #: ../fish/guestfish.pod:1259
20735 msgid "test2.img (etc)"
20739 #: ../fish/guestfish.pod:1261
20741 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
20742 "will be created in the file C<test1.img> in the current directory. The "
20743 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
20744 "the same name will be overwritten."
20748 #: ../fish/guestfish.pod:1270
20750 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, L<virt-"
20751 "cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit"
20752 "(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems"
20753 "(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-"
20754 "rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, "
20755 "L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, "
20756 "L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
20760 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3354
20761 #: ../test-tool/libguestfs-test-tool.pod:112
20762 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
20766 #: ../fish/virt-copy-in.pod:5
20768 "virt-copy-in - Copy files and directories into a virtual machine disk image."
20772 #: ../fish/virt-copy-in.pod:9
20775 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
20780 #: ../fish/virt-copy-in.pod:11
20783 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
20788 #: ../fish/virt-copy-in.pod:15
20790 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
20791 "causing disk corruption. The virtual machine must be shut down before you "
20792 "use this command."
20796 #: ../fish/virt-copy-in.pod:21
20798 "C<virt-copy-in> copies files and directories from the local disk into a "
20799 "virtual machine disk image or named libvirt domain."
20803 #: ../fish/virt-copy-in.pod:24
20805 "You can give one of more filenames and directories on the command line. "
20806 "Directories are copied in recursively. The final parameter must be the "
20807 "destination directory in the disk image which must be an absolute path "
20808 "starting with a C</> character."
20812 #: ../fish/virt-copy-in.pod:33
20815 " virt-copy-in -d MyGuest resolv.conf /etc\n"
20820 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
20821 msgid "Upload a home directory to a guest:"
20825 #: ../fish/virt-copy-in.pod:37
20828 " virt-copy-in -d MyGuest skel /home\n"
20833 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
20834 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
20835 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
20839 #: ../fish/virt-copy-in.pod:41
20841 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20842 "> C<copy-in> command. For anything more complex than a trivial copy, you "
20843 "are probably better off using guestfish directly."
20847 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
20848 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
20850 "Since the shell script just passes options straight to guestfish, read "
20851 "L<guestfish(1)> to see the full list of options."
20855 #: ../fish/virt-copy-in.pod:52
20857 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20858 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20862 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
20863 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20864 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20868 #: ../fish/virt-copy-out.pod:5
20870 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20875 #: ../fish/virt-copy-out.pod:9
20878 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20883 #: ../fish/virt-copy-out.pod:11
20886 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20891 #: ../fish/virt-copy-out.pod:15
20893 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20894 "image or named libvirt domain."
20898 #: ../fish/virt-copy-out.pod:18
20900 "You can give one of more filenames and directories on the command line. "
20901 "Directories are copied out recursively."
20905 #: ../fish/virt-copy-out.pod:23
20906 msgid "Download the home directories from a virtual machine:"
20910 #: ../fish/virt-copy-out.pod:25
20914 " virt-copy-out -d MyGuest /home homes\n"
20919 #: ../fish/virt-copy-out.pod:30
20921 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20922 "> C<copy-out> command. For anything more complex than a trivial copy, you "
20923 "are probably better off using guestfish directly."
20927 #: ../fish/virt-copy-out.pod:41
20929 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
20930 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20934 #: ../fish/virt-tar-in.pod:5
20935 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20939 #: ../fish/virt-tar-in.pod:9
20942 " virt-tar-in -a disk.img data.tar /destination\n"
20947 #: ../fish/virt-tar-in.pod:11
20950 " virt-tar-in -d domain data.tar /destination\n"
20955 #: ../fish/virt-tar-in.pod:13
20958 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20963 #: ../fish/virt-tar-in.pod:17
20965 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20966 "causing disk corruption. The virtual machine must be shut down before you "
20967 "use this command."
20971 #: ../fish/virt-tar-in.pod:23
20973 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20974 "image or named libvirt domain."
20978 #: ../fish/virt-tar-in.pod:26
20980 "The first parameter is the tar file. Use C<-> to read the tar file from "
20981 "standard input. The second parameter is the absolute target directory to "
20986 #: ../fish/virt-tar-in.pod:34
20989 " virt-tar-in -d MyGuest homes.tar /home\n"
20994 #: ../fish/virt-tar-in.pod:38
20996 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20997 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
20998 "probably better off using guestfish directly."
21002 #: ../fish/virt-tar-in.pod:49
21004 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
21005 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
21010 #: ../fish/virt-tar-out.pod:5
21012 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
21016 #: ../fish/virt-tar-out.pod:9
21019 " virt-tar-out -a disk.img /dir files.tar\n"
21024 #: ../fish/virt-tar-out.pod:11
21027 " virt-tar-out -d domain /dir files.tar\n"
21032 #: ../fish/virt-tar-out.pod:13
21035 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
21040 #: ../fish/virt-tar-out.pod:17
21042 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
21046 #: ../fish/virt-tar-out.pod:20
21048 "The first parameter is the absolute path of the virtual machine directory. "
21049 "The second parameter is the tar file to write. Use C<-> to write to "
21054 #: ../fish/virt-tar-out.pod:26
21055 msgid "Download the home directories from a guest:"
21059 #: ../fish/virt-tar-out.pod:28
21062 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
21067 #: ../fish/virt-tar-out.pod:32
21069 "This command is just a simple shell script wrapper around the L<guestfish(1)"
21070 "> C<tar-out> command. For anything more complex than a trivial copy, you "
21071 "are probably better off using guestfish directly."
21075 #: ../fish/virt-tar-out.pod:43
21077 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
21078 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
21082 #: ../fuse/guestmount.pod:5
21084 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
21088 #: ../fuse/guestmount.pod:9
21091 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
21096 #: ../fuse/guestmount.pod:11
21099 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
21104 #: ../fuse/guestmount.pod:13
21107 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
21112 #: ../fuse/guestmount.pod:17
21114 "You must I<not> use C<guestmount> in read-write mode on live virtual "
21115 "machines. If you do this, you risk disk corruption in the VM."
21119 #: ../fuse/guestmount.pod:22
21121 "The guestmount program can be used to mount virtual machine filesystems and "
21122 "other disk images on the host. It uses libguestfs for access to the guest "
21123 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
21124 "a mountable device."
21128 #: ../fuse/guestmount.pod:27
21130 "Along with other options, you have to give at least one device (I<-a> "
21131 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
21132 "option) or use the I<-i> inspection option. How this works is better "
21133 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
21138 #: ../fuse/guestmount.pod:33
21140 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
21141 "by you, and the filesystem will not be visible to any other users unless you "
21142 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
21143 "the filesystem, use the C<fusermount -u> command."
21147 #: ../fuse/guestmount.pod:41
21149 "For a typical Windows guest which has its main filesystem on the first "
21154 #: ../fuse/guestmount.pod:44
21157 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
21162 #: ../fuse/guestmount.pod:46
21164 "For a typical Linux guest which has a /boot filesystem on the first "
21165 "partition, and the root filesystem on a logical volume:"
21169 #: ../fuse/guestmount.pod:49
21172 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
21177 #: ../fuse/guestmount.pod:51
21178 msgid "To get libguestfs to detect guest mountpoints for you:"
21182 #: ../fuse/guestmount.pod:53
21185 " guestmount -a guest.img -i --ro /mnt\n"
21190 #: ../fuse/guestmount.pod:55
21191 msgid "For a libvirt guest called \"Guest\" you could do:"
21195 #: ../fuse/guestmount.pod:57
21198 " guestmount -d Guest -i --ro /mnt\n"
21203 #: ../fuse/guestmount.pod:59
21205 "If you don't know what filesystems are contained in a guest or disk image, "
21206 "use L<virt-filesystems(1)> first:"
21210 #: ../fuse/guestmount.pod:62
21213 " virt-filesystems MyGuest\n"
21218 #: ../fuse/guestmount.pod:64
21220 "If you want to trace the libguestfs calls but without excessive debugging "
21221 "information, we recommend:"
21225 #: ../fuse/guestmount.pod:67
21228 " guestmount [...] --trace /mnt\n"
21233 #: ../fuse/guestmount.pod:69
21234 msgid "If you want to debug the program, we recommend:"
21238 #: ../fuse/guestmount.pod:71
21241 " guestmount [...] --trace --verbose /mnt\n"
21246 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
21247 #: ../resize/virt-resize.pod:621
21252 #: ../fuse/guestmount.pod:75
21253 msgid "Other users cannot see the filesystem by default"
21257 #: ../fuse/guestmount.pod:77
21259 "If you mount a filesystem as one user (eg. root), then other users will not "
21260 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
21261 "option when mounting:"
21265 #: ../fuse/guestmount.pod:81
21268 " sudo guestmount [...] -o allow_other /mnt\n"
21273 #: ../fuse/guestmount.pod:83
21274 msgid "Enabling FUSE"
21278 #: ../fuse/guestmount.pod:85
21280 "On some distros, you may need to add yourself to a special group (eg. "
21281 "C<fuse>) before you can use any FUSE filesystem. This is necessary on "
21282 "Debian and derivatives."
21286 #: ../fuse/guestmount.pod:89
21288 "On other distros, no special group is required. It is not necessary on "
21289 "Fedora or Red Hat Enterprise Linux."
21293 #: ../fuse/guestmount.pod:100
21294 msgid "Add a block device or virtual machine image."
21298 #: ../fuse/guestmount.pod:123
21299 msgid "B<--dir-cache-timeout N>"
21303 #: ../fuse/guestmount.pod:125
21305 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
21306 "seconds. The readdir cache [actually, there are several semi-independent "
21307 "caches] is populated after a readdir(2) call with the stat and extended "
21308 "attributes of the files in the directory, in anticipation that they will be "
21309 "requested soon after."
21313 #: ../fuse/guestmount.pod:131
21315 "There is also a different attribute cache implemented by FUSE (see the FUSE "
21316 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
21317 "requests, only cache existing ones."
21321 #: ../fuse/guestmount.pod:151
21323 "If you have untrusted raw-format guest disk images, you should use this "
21324 "option to specify the disk format. This avoids a possible security problem "
21325 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
21326 "guestfs_add_drive_opts>."
21330 #: ../fuse/guestmount.pod:156
21331 msgid "B<--fuse-help>"
21335 #: ../fuse/guestmount.pod:158
21336 msgid "Display help on special FUSE options (see I<-o> below)."
21340 #: ../fuse/guestmount.pod:162
21341 msgid "Display brief help and exit."
21345 #: ../fuse/guestmount.pod:186
21347 "Mount the named partition or logical volume on the given mountpoint B<in the "
21348 "guest> (this has nothing to do with mountpoints in the host)."
21352 #: ../fuse/guestmount.pod:189
21354 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
21355 "something on C</>."
21359 #: ../fuse/guestmount.pod:206
21361 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
21362 "unmounted. If you specify this option, then we don't attempt to sync the "
21363 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
21367 #: ../fuse/guestmount.pod:211
21368 msgid "B<-o option>"
21372 #: ../fuse/guestmount.pod:213
21373 msgid "B<--option option>"
21377 #: ../fuse/guestmount.pod:215
21378 msgid "Pass extra options to FUSE."
21382 #: ../fuse/guestmount.pod:217
21384 "To get a list of all the extra options supported by FUSE, use the command "
21385 "below. Note that only the FUSE I<-o> options can be passed, and only some "
21386 "of them are a good idea."
21390 #: ../fuse/guestmount.pod:221
21393 " guestmount --fuse-help\n"
21398 #: ../fuse/guestmount.pod:223
21399 msgid "Some potentially useful FUSE options:"
21403 #: ../fuse/guestmount.pod:227
21404 msgid "B<-o allow_other>"
21408 #: ../fuse/guestmount.pod:229
21409 msgid "Allow other users to see the filesystem."
21413 #: ../fuse/guestmount.pod:231
21414 msgid "B<-o attr_timeout=N>"
21418 #: ../fuse/guestmount.pod:233
21419 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
21423 #: ../fuse/guestmount.pod:235
21424 msgid "B<-o kernel_cache>"
21428 #: ../fuse/guestmount.pod:237
21430 "Allow the kernel to cache files (reduces the number of reads that have to go "
21431 "through the L<guestfs(3)> API). This is generally a good idea if you can "
21432 "afford the extra memory usage."
21436 #: ../fuse/guestmount.pod:241
21437 msgid "B<-o uid=N> B<-o gid=N>"
21441 #: ../fuse/guestmount.pod:243
21443 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
21444 "the chosen values."
21448 #: ../fuse/guestmount.pod:252
21450 "Add devices and mount everything read-only. Also disallow writes and make "
21451 "the disk appear read-only to FUSE."
21455 #: ../fuse/guestmount.pod:255
21457 "This is highly recommended if you are not going to edit the guest disk. If "
21458 "the guest is running and this option is I<not> supplied, then there is a "
21459 "strong risk of disk corruption in the guest. We try to prevent this from "
21460 "happening, but it is not always possible."
21464 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
21465 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
21469 #: ../fuse/guestmount.pod:264
21470 msgid "Enable SELinux support for the guest."
21474 #: ../fuse/guestmount.pod:270
21475 msgid "Enable verbose messages from underlying libguestfs."
21479 #: ../fuse/guestmount.pod:276
21480 msgid "Display the program version and exit."
21484 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308
21485 #: ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
21486 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
21490 #: ../fuse/guestmount.pod:289
21495 #: ../fuse/guestmount.pod:291
21496 msgid "Trace libguestfs calls and entry into each FUSE function."
21500 #: ../fuse/guestmount.pod:293
21501 msgid "This also stops the daemon from forking into the background."
21505 #: ../fuse/guestmount.pod:319
21507 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21508 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
21513 #: ../fuse/guestmount.pod:334
21514 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
21518 #: ../inspector/virt-inspector.pod:5
21520 "virt-inspector - Display operating system version and other information "
21521 "about a virtual machine"
21525 #: ../inspector/virt-inspector.pod:9
21528 " virt-inspector [--options] -d domname\n"
21533 #: ../inspector/virt-inspector.pod:11
21536 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
21541 #: ../inspector/virt-inspector.pod:15
21544 " virt-inspector domname\n"
21549 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
21552 " virt-inspector disk.img [disk.img ...]\n"
21557 #: ../inspector/virt-inspector.pod:21
21559 "B<virt-inspector> examines a virtual machine or disk image and tries to "
21560 "determine the version of the operating system and other information about "
21561 "the virtual machine."
21565 #: ../inspector/virt-inspector.pod:25
21566 msgid "Virt-inspector produces XML output for feeding into other programs."
21570 #: ../inspector/virt-inspector.pod:27
21572 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
21573 "the libvirt domain (see: C<virsh list --all>)."
21577 #: ../inspector/virt-inspector.pod:30
21579 "You can also run virt-inspector directly on disk images from a single "
21580 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
21581 "has several block devices, in which case you should list several I<-a> "
21582 "options one after another, with the first corresponding to the guest's C</"
21583 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
21587 #: ../inspector/virt-inspector.pod:37
21589 "You can also run virt-inspector on install disks, live CDs, bootable USB "
21590 "keys and similar."
21594 #: ../inspector/virt-inspector.pod:40
21596 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
21597 "inspect several virtual machines, you have to run virt-inspector several "
21598 "times (for example, from a shell script for-loop)."
21602 #: ../inspector/virt-inspector.pod:45
21604 "Because virt-inspector needs direct access to guest images, it won't "
21605 "normally work over remote libvirt connections."
21609 #: ../inspector/virt-inspector.pod:48
21611 "All of the information available from virt-inspector is also available "
21612 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
21613 "The same information can also be fetched using guestfish or via libguestfs "
21614 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
21615 "WITH OTHER PROGRAMMING LANGUAGES>)."
21619 #: ../inspector/virt-inspector.pod:81
21621 "Libvirt is only used if you specify a C<domname> on the command line. If "
21622 "you specify guest block devices directly (I<-a>), then libvirt is not used "
21627 #: ../inspector/virt-inspector.pod:94
21629 "When prompting for keys and passphrases, virt-inspector normally turns "
21630 "echoing off so you cannot see what you are typing. If you are not worried "
21631 "about Tempest attacks and there is no one else in the room you can specify "
21632 "this flag to see what you are typing."
21636 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
21637 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
21638 #: ../tools/virt-win-reg.pl:144
21640 "Specify the format of disk images given on the command line. If this is "
21641 "omitted then the format is autodetected from the content of the disk image."
21645 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
21646 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
21647 #: ../tools/virt-win-reg.pl:148
21649 "If disk images are requested from libvirt, then this program asks libvirt "
21650 "for this information. In this case, the value of the format parameter is "
21655 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:391
21656 #: ../resize/virt-resize.pod:483 ../sparsify/virt-sparsify.pod:132
21657 #: ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102
21658 #: ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
21660 "If working with untrusted raw-format guest disk images, you should ensure "
21661 "the format is always specified."
21665 #: ../inspector/virt-inspector.pod:139
21666 msgid "Previous versions of virt-inspector allowed you to write either:"
21670 #: ../inspector/virt-inspector.pod:145
21673 " virt-inspector guestname\n"
21678 #: ../inspector/virt-inspector.pod:153
21683 #: ../inspector/virt-inspector.pod:155
21685 "The virt-inspector XML is described precisely in a RELAX NG schema file "
21686 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
21687 "just an overview."
21691 #: ../inspector/virt-inspector.pod:159
21693 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
21694 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
21695 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
21696 "which is vanishingly rare in real world VMs."
21700 #: ../inspector/virt-inspector.pod:164
21701 msgid "E<lt>operatingsystemE<gt>"
21705 #: ../inspector/virt-inspector.pod:166
21707 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
21708 "describe the operating system, its architecture, the descriptive \"product "
21709 "name\" string, the type of OS and so on, as in this example:"
21713 #: ../inspector/virt-inspector.pod:170
21716 " <operatingsystems>\n"
21717 " <operatingsystem>\n"
21718 " <root>/dev/sda2</root>\n"
21719 " <name>windows</name>\n"
21720 " <arch>i386</arch>\n"
21721 " <distro>windows</distro>\n"
21722 " <product_name>Windows 7 Enterprise</product_name>\n"
21723 " <product_variant>Client</product_variant>\n"
21724 " <major_version>6</major_version>\n"
21725 " <minor_version>1</minor_version>\n"
21726 " <windows_systemroot>/Windows</windows_systemroot>\n"
21727 " <format>installed</format>\n"
21732 #: ../inspector/virt-inspector.pod:183
21734 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
21735 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
21736 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
21737 "architecture. The other fields are fairly self-explanatory, but because "
21738 "these fields are taken directly from the libguestfs inspection API you can "
21739 "find precise information from L<guestfs(3)/INSPECTION>."
21743 #: ../inspector/virt-inspector.pod:191
21745 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
21746 "of view of libguestfs (block devices may have completely different names "
21747 "inside the VM itself)."
21751 #: ../inspector/virt-inspector.pod:195
21752 msgid "E<lt>mountpointsE<gt>"
21756 #: ../inspector/virt-inspector.pod:197
21758 "Un*x-like guests typically have multiple filesystems which are mounted at "
21759 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
21760 "element which looks like this:"
21764 #: ../inspector/virt-inspector.pod:201
21767 " <operatingsystems>\n"
21768 " <operatingsystem>\n"
21771 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
21772 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
21773 " </mountpoints>\n"
21778 #: ../inspector/virt-inspector.pod:209
21780 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
21781 "and may have completely different names inside the guest. Only mountable "
21782 "filesystems appear in this list, not things like swap devices."
21786 #: ../inspector/virt-inspector.pod:214
21787 msgid "E<lt>filesystemsE<gt>"
21791 #: ../inspector/virt-inspector.pod:216
21793 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
21794 "filesystems belonging to the guest, including swap and empty partitions. "
21795 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
21796 "this OS or shared with this OS and other OSes)."
21800 #: ../inspector/virt-inspector.pod:222
21801 msgid "You might see something like this:"
21805 #: ../inspector/virt-inspector.pod:224
21808 " <operatingsystems>\n"
21809 " <operatingsystem>\n"
21812 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21813 " <type>ext4</type>\n"
21814 " <label>Fedora-13-x86_64</label>\n"
21815 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
21821 #: ../inspector/virt-inspector.pod:234
21823 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
21824 "the label, and the UUID."
21828 #: ../inspector/virt-inspector.pod:237
21829 msgid "E<lt>applicationsE<gt>"
21833 #: ../inspector/virt-inspector.pod:239
21835 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
21836 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
21841 #: ../inspector/virt-inspector.pod:243
21843 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
21844 "Typical values would be C<rpm> and C<deb>."
21848 #: ../inspector/virt-inspector.pod:246
21850 "E<lt>package_managementE<gt>, if present, describes the package manager. "
21851 "Typical values include C<yum>, C<up2date> and C<apt>"
21855 #: ../inspector/virt-inspector.pod:249
21856 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
21860 #: ../inspector/virt-inspector.pod:252
21863 " <operatingsystems>\n"
21864 " <operatingsystem>\n"
21866 " <applications>\n"
21868 " <name>coreutils</name>\n"
21869 " <version>8.5</version>\n"
21870 " <release>1</release>\n"
21871 " </application>\n"
21876 #: ../inspector/virt-inspector.pod:262
21878 "The version and release fields may not be available for some types guests. "
21879 "Other fields are possible, see L<guestfs(3)/"
21880 "guestfs_inspect_list_applications>."
21884 #: ../inspector/virt-inspector.pod:266
21885 msgid "E<lt>drive_mappingsE<gt>"
21889 #: ../inspector/virt-inspector.pod:268
21891 "For operating systems like Windows which use drive letters, virt-inspector "
21892 "is able to find out how drive letters map to filesystems."
21896 #: ../inspector/virt-inspector.pod:272
21899 " <operatingsystems>\n"
21900 " <operatingsystem>\n"
21902 " <drive_mappings>\n"
21903 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21904 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21905 " </drive_mappings>\n"
21910 #: ../inspector/virt-inspector.pod:280
21912 "In the example above, drive C maps to the filesystem on the second partition "
21913 "on the first disk, and drive E maps to the filesystem on the first partition "
21914 "on the second disk."
21918 #: ../inspector/virt-inspector.pod:284
21920 "Note that this only covers permanent local filesystem mappings, not things "
21921 "like network shares. Furthermore NTFS volume mount points may not be listed "
21926 #: ../inspector/virt-inspector.pod:288
21927 msgid "E<lt>iconE<gt>"
21931 #: ../inspector/virt-inspector.pod:290
21933 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21934 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21935 "very large and high quality."
21939 #: ../inspector/virt-inspector.pod:294
21942 " <operatingsystems>\n"
21943 " <operatingsystem>\n"
21946 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21947 " [... many lines of base64 data ...]\n"
21953 #: ../inspector/virt-inspector.pod:302
21955 "To display the icon, you have to extract it and convert the base64 data back "
21956 "to a binary file. Use an XPath query or simply an editor to extract the "
21957 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21962 #: ../inspector/virt-inspector.pod:307
21965 " base64 -i -d < icon.data > icon.png\n"
21970 #: ../inspector/virt-inspector.pod:309
21971 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21975 #: ../inspector/virt-inspector.pod:311
21977 "Virt-inspector can detect some operating system installers on install disks, "
21978 "live CDs, bootable USB keys and more."
21982 #: ../inspector/virt-inspector.pod:314
21984 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21985 "fields may be present to indicate a live CD, network installer, or one part "
21986 "of a multipart CD. For example:"
21990 #: ../inspector/virt-inspector.pod:318
21993 " <operatingsystems>\n"
21994 " <operatingsystem>\n"
21995 " <root>/dev/sda</root>\n"
21996 " <name>linux</name>\n"
21997 " <arch>i386</arch>\n"
21998 " <distro>ubuntu</distro>\n"
21999 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
22000 " <major_version>10</major_version>\n"
22001 " <minor_version>10</minor_version>\n"
22002 " <format>installer</format>\n"
22008 #: ../inspector/virt-inspector.pod:330
22009 msgid "USING XPATH"
22013 #: ../inspector/virt-inspector.pod:332
22015 "You can use the XPath query language to select parts of the XML. We "
22016 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
22020 #: ../inspector/virt-inspector.pod:338
22023 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
22025 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
22026 " <type>ext4</type>\n"
22032 #: ../inspector/virt-inspector.pod:344
22035 " $ virt-inspector -d Guest | \\\n"
22036 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
22042 #: ../inspector/virt-inspector.pod:348
22045 " $ virt-inspector -d Guest | \\\n"
22046 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
22047 " [displays the guest icon, if there is one]\n"
22052 #: ../inspector/virt-inspector.pod:359
22053 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
22057 #: ../inspector/virt-inspector.pod:361
22059 "Early versions of libguestfs shipped with a different virt-inspector program "
22060 "written in Perl (the current version is written in C). The XML output of "
22061 "the Perl virt-inspector was different and it could also output in other "
22062 "formats like text."
22066 #: ../inspector/virt-inspector.pod:366
22068 "The old virt-inspector is no longer supported or shipped with libguestfs."
22072 #: ../inspector/virt-inspector.pod:369
22074 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
22075 "versions of virt-inspector with different names:"
22079 #: ../inspector/virt-inspector.pod:372
22082 " virt-inspector Old Perl version.\n"
22083 " virt-inspector2 New C version.\n"
22088 #: ../inspector/virt-inspector.pod:382
22090 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
22091 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
22095 #: ../inspector/virt-inspector.pod:399
22096 msgid "Matthew Booth L<mbooth@redhat.com>"
22100 #: ../java/examples/guestfs-java.pod:5
22101 msgid "guestfs-java - How to use libguestfs from Java"
22105 #: ../java/examples/guestfs-java.pod:9
22108 " import com.redhat.et.libguestfs.*;\n"
22113 #: ../java/examples/guestfs-java.pod:11
22116 " GuestFS g = new GuestFS ();\n"
22117 " g.add_drive_opts (\"disk.img\", null);\n"
22123 #: ../java/examples/guestfs-java.pod:17
22125 "This manual page documents how to call libguestfs from the Java programming "
22126 "language. This page just documents the differences from the C API and gives "
22127 "some examples. If you are not familiar with using libguestfs, you also need "
22128 "to read L<guestfs(3)>."
22132 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
22133 msgid "CLOSING THE HANDLE"
22137 #: ../java/examples/guestfs-java.pod:24
22139 "The handle is closed when it is reaped by the garbage collector. Because "
22140 "libguestfs handles include a lot of state, it is also possible to close (and "
22141 "hence free) them explicitly by calling the C<close> method."
22145 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
22146 #: ../python/examples/guestfs-python.pod:21
22147 #: ../ruby/examples/guestfs-ruby.pod:22
22152 #: ../java/examples/guestfs-java.pod:31
22154 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
22155 "exception. This has a single parameter which is the error message (a "
22160 #: ../java/examples/guestfs-java.pod:35
22161 msgid "Calling any method on a closed handle raises the same exception."
22165 #: ../java/examples/guestfs-java.pod:47
22167 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-ocaml"
22168 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
22169 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
22173 #: ../ocaml/examples/guestfs-ocaml.pod:5
22174 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
22178 #: ../ocaml/examples/guestfs-ocaml.pod:9
22179 msgid "Module style:"
22183 #: ../ocaml/examples/guestfs-ocaml.pod:11
22186 " let g = Guestfs.create () in\n"
22187 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22188 " Guestfs.launch g;\n"
22193 #: ../ocaml/examples/guestfs-ocaml.pod:15
22194 msgid "Object-oriented style:"
22198 #: ../ocaml/examples/guestfs-ocaml.pod:17
22201 " let g = new Guestfs.guestfs () in\n"
22202 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22208 #: ../ocaml/examples/guestfs-ocaml.pod:21
22211 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
22213 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
22218 #: ../ocaml/examples/guestfs-ocaml.pod:27
22220 "This manual page documents how to call libguestfs from the OCaml programming "
22221 "language. This page just documents the differences from the C API and gives "
22222 "some examples. If you are not familiar with using libguestfs, you also need "
22223 "to read L<guestfs(3)>."
22227 #: ../ocaml/examples/guestfs-ocaml.pod:32
22228 msgid "PROGRAMMING STYLES"
22232 #: ../ocaml/examples/guestfs-ocaml.pod:34
22234 "There are two different programming styles supported by the OCaml bindings. "
22235 "You can use a module style, with each C function mapped to an OCaml function:"
22239 #: ../ocaml/examples/guestfs-ocaml.pod:38
22242 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
22247 #: ../ocaml/examples/guestfs-ocaml.pod:40
22252 #: ../ocaml/examples/guestfs-ocaml.pod:42
22255 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
22260 #: ../ocaml/examples/guestfs-ocaml.pod:44
22262 "Alternately you can use an object-oriented style, calling methods on the "
22263 "class C<Guestfs.guestfs>:"
22267 #: ../ocaml/examples/guestfs-ocaml.pod:47
22270 " method set_verbose : bool -> unit\n"
22275 #: ../ocaml/examples/guestfs-ocaml.pod:49
22277 "The object-oriented style is usually briefer, and the minor performance "
22278 "penalty isn't noticable in the general overhead of performing libguestfs "
22283 #: ../ocaml/examples/guestfs-ocaml.pod:55
22285 "The handle is closed when it is reaped by the garbage collector. Because "
22286 "libguestfs handles include a lot of state, it is also possible to close (and "
22287 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
22292 #: ../ocaml/examples/guestfs-ocaml.pod:62
22294 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
22295 "exception. This has a single parameter which is the error message (a "
22300 #: ../ocaml/examples/guestfs-ocaml.pod:66
22302 "Calling any function/method on a closed handle raises C<Guestfs."
22303 "Handle_closed>. The single parameter is the name of the function that you "
22308 #: ../ocaml/examples/guestfs-ocaml.pod:80
22310 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22311 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
22312 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
22316 #: ../perl/examples/guestfs-perl.pod:5
22317 msgid "guestfs-perl - How to use libguestfs from Perl"
22321 #: ../perl/examples/guestfs-perl.pod:9
22324 " use Sys::Guestfs;\n"
22329 #: ../perl/examples/guestfs-perl.pod:11
22332 " my $h = Sys::Guestfs->new ();\n"
22333 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
22334 " $h->launch ();\n"
22335 " $h->mount_options ('', '/dev/sda1', '/');\n"
22336 " $h->touch ('/hello');\n"
22342 #: ../perl/examples/guestfs-perl.pod:20
22344 "This manual page documents how to call libguestfs from the Perl programming "
22345 "language. This page just documents the differences from the C API and gives "
22346 "some examples. If you are not familiar with using libguestfs, you also need "
22347 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
22351 #: ../perl/examples/guestfs-perl.pod:26
22356 #: ../perl/examples/guestfs-perl.pod:28
22358 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
22363 #: ../perl/examples/guestfs-perl.pod:41
22365 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang"
22366 "(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
22367 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
22371 #: ../python/examples/guestfs-python.pod:5
22372 msgid "guestfs-python - How to use libguestfs from Python"
22376 #: ../python/examples/guestfs-python.pod:9
22379 " import guestfs\n"
22380 " g = guestfs.GuestFS ()\n"
22381 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
22387 #: ../python/examples/guestfs-python.pod:16
22389 "This manual page documents how to call libguestfs from the Python "
22390 "programming language. This page just documents the differences from the C "
22391 "API and gives some examples. If you are not familiar with using libguestfs, "
22392 "you also need to read L<guestfs(3)>."
22396 #: ../python/examples/guestfs-python.pod:23
22398 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
22399 "single string argument which is the error message."
22403 #: ../python/examples/guestfs-python.pod:26
22404 msgid "MORE DOCUMENTATION"
22408 #: ../python/examples/guestfs-python.pod:28
22413 #: ../python/examples/guestfs-python.pod:30
22417 " >>> import guestfs\n"
22418 " >>> help (guestfs)\n"
22423 #: ../python/examples/guestfs-python.pod:44
22425 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22426 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
22427 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
22431 #: ../rescue/virt-rescue.pod:5
22432 msgid "virt-rescue - Run a rescue shell on a virtual machine"
22436 #: ../rescue/virt-rescue.pod:9
22439 " virt-rescue [--options] -d domname\n"
22444 #: ../rescue/virt-rescue.pod:11
22447 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
22452 #: ../rescue/virt-rescue.pod:15
22455 " virt-rescue [--options] domname\n"
22460 #: ../rescue/virt-rescue.pod:17
22463 " virt-rescue [--options] disk.img [disk.img ...]\n"
22468 #: ../rescue/virt-rescue.pod:21
22470 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
22471 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
22472 "you from doing this, but doesn't catch all cases."
22476 #: ../rescue/virt-rescue.pod:25
22478 "However if you use the I<--ro> (read only) option, then you can attach a "
22479 "shell to a live virtual machine. The results might be strange or "
22480 "inconsistent at times but you won't get disk corruption."
22484 #: ../rescue/virt-rescue.pod:31
22486 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
22487 "need for a CD. virt-rescue gives you a rescue shell and some simple "
22488 "recovery tools which you can use to examine or rescue a virtual machine or "
22493 #: ../rescue/virt-rescue.pod:36
22495 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
22496 "on disk image(s):"
22500 #: ../rescue/virt-rescue.pod:39
22503 " virt-rescue -d GuestName\n"
22508 #: ../rescue/virt-rescue.pod:41
22511 " virt-rescue --ro -a /path/to/disk.img\n"
22516 #: ../rescue/virt-rescue.pod:43
22519 " virt-rescue -a /dev/sdc\n"
22524 #: ../rescue/virt-rescue.pod:45
22525 msgid "For live VMs you I<must> use the --ro option."
22529 #: ../rescue/virt-rescue.pod:47
22531 "When you run virt-rescue on a virtual machine or disk image, you are placed "
22532 "in an interactive bash shell where you can use many ordinary Linux "
22533 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
22534 "appliance. You must mount the virtual machine's filesystems by hand. There "
22535 "is an empty directory called C</sysroot> where you can mount filesystems."
22539 #: ../rescue/virt-rescue.pod:54
22541 "In the example below, we list logical volumes, then choose one to mount "
22542 "under C</sysroot>:"
22546 #: ../rescue/virt-rescue.pod:57
22550 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
22551 " lv_root vg_f11x64 -wi-a- 8.83G\n"
22552 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
22553 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
22554 " ><rescue> ls /sysroot\n"
22559 #: ../rescue/virt-rescue.pod:64
22561 "If you don't know what filesystems are available on the virtual machine then "
22562 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
22566 #: ../rescue/virt-rescue.pod:70
22568 "Virt-rescue can be used on I<any> disk image file or device, not just a "
22569 "virtual machine. For example you can use it on a blank file if you want to "
22570 "partition that file (although we would recommend using L<guestfish(1)> "
22571 "instead as it is more suitable for this purpose). You can even use virt-"
22572 "rescue on things like SD cards."
22576 #: ../rescue/virt-rescue.pod:76
22578 "Virt-rescue does not require root. You only need to run it as root if you "
22579 "need root to open the disk image."
22583 #: ../rescue/virt-rescue.pod:79
22585 "This tool is just designed for quick interactive hacking on a virtual "
22586 "machine. For more structured access to a virtual machine disk image, you "
22587 "should use L<guestfs(3)>. To get a structured shell that you can use to "
22588 "make scripted changes to guests, use L<guestfish(1)>."
22592 #: ../rescue/virt-rescue.pod:103
22593 msgid "B<--append kernelopts>"
22597 #: ../rescue/virt-rescue.pod:105
22598 msgid "Pass additional options to the rescue kernel."
22602 #: ../rescue/virt-rescue.pod:135
22605 " virt-rescue --format=raw -a disk.img\n"
22610 #: ../rescue/virt-rescue.pod:139
22613 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
22618 #: ../rescue/virt-rescue.pod:148
22623 #: ../rescue/virt-rescue.pod:150
22624 msgid "B<--memsize MB>"
22628 #: ../rescue/virt-rescue.pod:152
22630 "Change the amount of memory allocated to the rescue system. The default is "
22631 "set by libguestfs and is small but adequate for running system tools. The "
22632 "occasional program might need more memory. The parameter is specified in "
22637 #: ../rescue/virt-rescue.pod:157
22638 msgid "B<--network>"
22642 #: ../rescue/virt-rescue.pod:159
22643 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
22647 #: ../rescue/virt-rescue.pod:165
22648 msgid "Open the image read-only."
22652 #: ../rescue/virt-rescue.pod:175
22654 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
22655 "SELINUX> before using this option."
22659 #: ../rescue/virt-rescue.pod:178
22664 #: ../rescue/virt-rescue.pod:180
22665 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
22669 #: ../rescue/virt-rescue.pod:198
22671 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
22672 "are done read-write."
22676 #: ../rescue/virt-rescue.pod:211
22677 msgid "Previous versions of virt-rescue allowed you to write either:"
22681 #: ../rescue/virt-rescue.pod:213
22684 " virt-rescue disk.img [disk.img ...]\n"
22689 #: ../rescue/virt-rescue.pod:217
22692 " virt-rescue guestname\n"
22697 #: ../rescue/virt-rescue.pod:225
22702 #: ../rescue/virt-rescue.pod:227
22704 "Adding the I<--network> option enables QEMU user networking in the rescue "
22705 "appliance. There are some differences between user networking and ordinary "
22710 #: ../rescue/virt-rescue.pod:233
22711 msgid "ping does not work"
22715 #: ../rescue/virt-rescue.pod:235
22717 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
22718 "send the ping packets, and because virt-rescue must be able to run as non-"
22719 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
22720 "The ping command will appear to resolve addresses but will not be able to "
22721 "send or receive any packets. This does not mean that the network is not "
22726 #: ../rescue/virt-rescue.pod:242
22727 msgid "cannot receive connections"
22731 #: ../rescue/virt-rescue.pod:244
22732 msgid "QEMU user networking cannot receive incoming connections."
22736 #: ../rescue/virt-rescue.pod:246
22737 msgid "making TCP connections"
22741 #: ../rescue/virt-rescue.pod:248
22743 "The virt-rescue appliance needs to be small and so does not include many "
22744 "network tools. In particular there is no L<telnet(1)> command. You can "
22745 "make TCP connections from the shell using the magical C</dev/tcp/"
22746 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
22750 #: ../rescue/virt-rescue.pod:253
22753 " exec 3<>/dev/tcp/redhat.com/80\n"
22754 " echo \"GET /\" >&3\n"
22760 #: ../rescue/virt-rescue.pod:257
22761 msgid "See L<bash(1)> for more details."
22765 #: ../rescue/virt-rescue.pod:263
22767 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
22768 "ENVIRONMENT VARIABLES> for the complete list."
22772 #: ../rescue/virt-rescue.pod:290
22774 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
22775 "libguestfs.org/>."
22779 #: ../resize/virt-resize.pod:5
22780 msgid "virt-resize - Resize a virtual machine disk"
22784 #: ../resize/virt-resize.pod:9
22787 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
22788 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
22789 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
22794 #: ../resize/virt-resize.pod:15
22796 "Virt-resize is a tool which can resize a virtual machine disk, making it "
22797 "larger or smaller overall, and resizing or deleting any partitions contained "
22802 #: ../resize/virt-resize.pod:19
22804 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
22805 "not> be used on live virtual machines - for consistent results, shut the "
22806 "virtual machine down before resizing it."
22810 #: ../resize/virt-resize.pod:23
22812 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
22813 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
22817 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:597
22818 #: ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:484
22819 #: ../src/guestfs.pod:1302 ../src/guestfs.pod:1441 ../src/guestfs.pod:2690
22824 #: ../resize/virt-resize.pod:33
22826 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
22827 "fill the extra 5GB of space."
22831 #: ../resize/virt-resize.pod:36
22834 " virt-filesystems --long -h --all -a olddisk\n"
22839 #: ../resize/virt-resize.pod:38
22842 " truncate -r olddisk newdisk\n"
22843 " truncate -s +5G newdisk\n"
22848 #: ../resize/virt-resize.pod:41
22851 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
22852 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
22857 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:604
22858 #: ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:490
22859 #: ../src/guestfs.pod:1306 ../src/guestfs.pod:1445 ../src/guestfs.pod:2715
22864 #: ../resize/virt-resize.pod:46
22866 "As above, but make the /boot partition 200MB bigger, while giving the "
22867 "remaining space to /dev/sda2:"
22871 #: ../resize/virt-resize.pod:49
22874 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22875 " olddisk newdisk\n"
22880 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:610
22881 #: ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:501
22882 #: ../src/guestfs.pod:1451
22887 #: ../resize/virt-resize.pod:54
22889 "As in the first example, but expand a logical volume as the final step. "
22890 "This is what you would typically use for Linux guests that use LVM:"
22894 #: ../resize/virt-resize.pod:58
22897 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22898 " olddisk newdisk\n"
22903 #: ../resize/virt-resize.pod:61
22908 #: ../resize/virt-resize.pod:63
22910 "As in the first example, but the output format will be qcow2 instead of a "
22915 #: ../resize/virt-resize.pod:66
22918 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22919 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22924 #: ../resize/virt-resize.pod:71
22925 msgid "DETAILED USAGE"
22929 #: ../resize/virt-resize.pod:73
22930 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22934 #: ../resize/virt-resize.pod:77
22935 msgid "1. Shut down the virtual machine"
22939 #: ../resize/virt-resize.pod:79
22940 msgid "2. Locate input disk image"
22944 #: ../resize/virt-resize.pod:81
22946 "Locate the input disk image (ie. the file or device on the host containing "
22947 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22948 "dumpxml> like this to find the disk image name:"
22952 #: ../resize/virt-resize.pod:85
22955 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22956 " Found 1 nodes:\n"
22958 " <source dev=\"/dev/vg/lv_guest\" />\n"
22963 #: ../resize/virt-resize.pod:90
22964 msgid "3. Look at current sizing"
22968 #: ../resize/virt-resize.pod:92
22969 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22973 #: ../resize/virt-resize.pod:95
22976 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22977 " Name Type Size Parent\n"
22978 " /dev/sda1 partition 101M /dev/sda\n"
22979 " /dev/sda2 partition 7.9G /dev/sda\n"
22980 " /dev/sda device 8.0G -\n"
22985 #: ../resize/virt-resize.pod:101
22987 "(This example is a virtual machine with an 8 GB disk which we would like to "
22988 "expand up to 10 GB)."
22992 #: ../resize/virt-resize.pod:104
22993 msgid "4. Create output disk"
22997 #: ../resize/virt-resize.pod:106
22999 "Virt-resize cannot do in-place disk modifications. You have to have space "
23000 "to store the resized output disk."
23004 #: ../resize/virt-resize.pod:109
23006 "To store the resized disk image in a file, create a file of a suitable size:"
23010 #: ../resize/virt-resize.pod:112
23013 " # rm -f outdisk\n"
23014 " # truncate -s 10G outdisk\n"
23019 #: ../resize/virt-resize.pod:115
23020 msgid "Or use L<lvcreate(1)> to create a logical volume:"
23024 #: ../resize/virt-resize.pod:117
23027 " # lvcreate -L 10G -n lv_name vg_name\n"
23032 #: ../resize/virt-resize.pod:119
23033 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
23037 #: ../resize/virt-resize.pod:121
23040 " # virsh pool-list\n"
23041 " # virsh vol-create-as poolname newvol 10G\n"
23046 #: ../resize/virt-resize.pod:124
23051 #: ../resize/virt-resize.pod:126
23053 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
23054 "file) and the output disk. The output disk is the one created in the "
23059 #: ../resize/virt-resize.pod:130
23062 " # virt-resize indisk outdisk\n"
23067 #: ../resize/virt-resize.pod:132
23069 "This command just copies disk image C<indisk> to disk image C<outdisk> "
23070 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
23071 "larger, then an extra, empty partition is created at the end of the disk "
23072 "covering the extra space. If C<outdisk> is smaller, then it will give an "
23077 #: ../resize/virt-resize.pod:138
23079 "More realistically you'd want to expand existing partitions in the disk "
23080 "image by passing extra options (for the full list see the L</OPTIONS> "
23085 #: ../resize/virt-resize.pod:142
23087 "L</--expand> is the most useful option. It expands the named partition "
23088 "within the disk to fill any extra space:"
23092 #: ../resize/virt-resize.pod:145
23095 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
23100 #: ../resize/virt-resize.pod:147
23102 "(In this case, an extra partition is I<not> created at the end of the disk, "
23103 "because there will be no unused space)."
23107 #: ../resize/virt-resize.pod:150
23109 "L</--resize> is the other commonly used option. The following would "
23110 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
23111 "rest of the available space:"
23115 #: ../resize/virt-resize.pod:154
23118 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
23119 " indisk outdisk\n"
23124 #: ../resize/virt-resize.pod:157
23126 "If the expanded partition in the image contains a filesystem or LVM PV, then "
23127 "if virt-resize knows how, it will resize the contents, the equivalent of "
23128 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
23129 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
23130 "filesystems, so you would have to online resize them after booting the guest."
23134 #: ../resize/virt-resize.pod:164
23135 msgid "Other options are covered below."
23139 #: ../resize/virt-resize.pod:166
23144 #: ../resize/virt-resize.pod:168
23145 msgid "Thoroughly test the new disk image I<before> discarding the old one."
23149 #: ../resize/virt-resize.pod:170
23150 msgid "If you are using libvirt, edit the XML to point at the new disk:"
23154 #: ../resize/virt-resize.pod:172
23157 " # virsh edit guestname\n"
23162 #: ../resize/virt-resize.pod:174
23164 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
23165 "html#elementsDisks>"
23169 #: ../resize/virt-resize.pod:177
23170 msgid "Then start up the domain with the new, resized disk:"
23174 #: ../resize/virt-resize.pod:179
23177 " # virsh start guestname\n"
23182 #: ../resize/virt-resize.pod:181
23184 "and check that it still works. See also the L</NOTES> section below for "
23185 "additional information."
23189 #: ../resize/virt-resize.pod:184
23190 msgid "7. Resize LVs etc inside the guest"
23194 #: ../resize/virt-resize.pod:186
23195 msgid "(This can also be done offline using L<guestfish(1)>)"
23199 #: ../resize/virt-resize.pod:188
23201 "Once the guest has booted you should see the new space available, at least "
23202 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
23203 "may need to resize LVs inside PVs, and also resize filesystem types that "
23204 "virt-resize does not know how to expand."
23208 #: ../resize/virt-resize.pod:195
23209 msgid "SHRINKING A VIRTUAL MACHINE DISK"
23213 #: ../resize/virt-resize.pod:197
23215 "Shrinking is somewhat more complex than expanding, and only an overview is "
23220 #: ../resize/virt-resize.pod:200
23222 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
23223 "filesystems). The user has to shrink content before passing the disk image "
23224 "to virt-resize, and virt-resize will check that the content has been shrunk "
23229 #: ../resize/virt-resize.pod:205
23230 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
23234 #: ../resize/virt-resize.pod:207
23236 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
23237 "steps 3 and 4 above to allocate a new disk image."
23241 #: ../resize/virt-resize.pod:210
23243 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
23247 #: ../resize/virt-resize.pod:213
23248 msgid "IGNORING OR DELETING PARTITIONS"
23252 #: ../resize/virt-resize.pod:215
23254 "virt-resize also gives a convenient way to ignore or delete partitions when "
23255 "copying from the input disk to the output disk. Ignoring a partition speeds "
23256 "up the copy where you don't care about the existing contents of a "
23257 "partition. Deleting a partition removes it completely, but note that it "
23258 "also renumbers any partitions after the one which is deleted, which can "
23259 "leave some guests unbootable."
23263 #: ../resize/virt-resize.pod:222
23264 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
23268 #: ../resize/virt-resize.pod:224
23270 "If the input disk is in qcow2 format, then you may prefer that the output is "
23271 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
23272 "the fly. The output format is simply determined by the format of the empty "
23273 "output container that you provide. Thus to create qcow2 output, use:"
23277 #: ../resize/virt-resize.pod:230
23280 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
23285 #: ../resize/virt-resize.pod:232
23286 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
23290 #: ../resize/virt-resize.pod:234
23291 msgid "Similarly, to get non-sparse raw output use:"
23295 #: ../resize/virt-resize.pod:236
23298 " fallocate -l size outdisk\n"
23303 #: ../resize/virt-resize.pod:238
23305 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
23306 "dev/zero of=outdisk bs=1M count=..>)"
23310 #: ../resize/virt-resize.pod:241
23311 msgid "LOGICAL PARTITIONS"
23315 #: ../resize/virt-resize.pod:243
23317 "Logical partitions (a.k.a. C</dev/sda5+> on disks using DOS partition "
23318 "tables) cannot be resized."
23322 #: ../resize/virt-resize.pod:246
23324 "To understand what is going on, firstly one of the four partitions C</dev/"
23325 "sda1-4> will have MBR partition type C<05> or C<0f>. This is called the "
23326 "B<extended partition>. Use L<virt-filesystems(1)> to see the MBR partition "
23331 #: ../resize/virt-resize.pod:251
23332 msgid "Logical partitions live inside the extended partition."
23336 #: ../resize/virt-resize.pod:253
23338 "The extended partition can be expanded, but not shrunk (unless you force it, "
23339 "which is not advisable). When the extended partition is copied across, all "
23340 "the logical partitions contained inside are copied over implicitly. Virt-"
23341 "resize does not look inside the extended partition, so it copies the logical "
23342 "partitions blindly."
23346 #: ../resize/virt-resize.pod:259
23348 "You cannot specify a logical partition (C</dev/sda5+>) at all on the command "
23349 "line. Doing so will give an error."
23353 #: ../resize/virt-resize.pod:268 ../sparsify/virt-sparsify.pod:105
23354 msgid "Display help."
23358 #: ../resize/virt-resize.pod:270
23359 msgid "B<--align-first auto>"
23363 #: ../resize/virt-resize.pod:272
23364 msgid "B<--align-first never>"
23368 #: ../resize/virt-resize.pod:274
23369 msgid "B<--align-first always>"
23373 #: ../resize/virt-resize.pod:276
23375 "Align the first partition for improved performance (see also the I<--"
23376 "alignment> option)."
23380 #: ../resize/virt-resize.pod:279
23382 "The default is I<--align-first auto> which only aligns the first partition "
23383 "if it is safe to do so. That is, only when we know how to fix the "
23384 "bootloader automatically, and at the moment that can only be done for "
23389 #: ../resize/virt-resize.pod:284
23391 "I<--align-first never> means we never move the first partition. This is the "
23392 "safest option. Try this if the guest does not boot after resizing."
23396 #: ../resize/virt-resize.pod:288
23398 "I<--align-first always> means we always align the first partition (if it "
23399 "needs to be aligned). For some guests this will break the bootloader, "
23400 "making the guest unbootable."
23404 #: ../resize/virt-resize.pod:292
23405 msgid "B<--alignment N>"
23409 #: ../resize/virt-resize.pod:294
23411 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
23412 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
23416 #: ../resize/virt-resize.pod:298
23418 "Assuming 512 byte sector size inside the guest, here are some suitable "
23423 #: ../resize/virt-resize.pod:303
23424 msgid "I<--alignment 1> (512 bytes)"
23428 #: ../resize/virt-resize.pod:305
23430 "The partitions would be packed together as closely as possible, but would be "
23431 "completely unaligned. In some cases this can cause very poor performance. "
23432 "See L<virt-alignment-scan(1)> for further details."
23436 #: ../resize/virt-resize.pod:309
23437 msgid "I<--alignment 8> (4K)"
23441 #: ../resize/virt-resize.pod:311
23443 "This would be the minimum acceptable alignment for reasonable performance on "
23448 #: ../resize/virt-resize.pod:314
23449 msgid "I<--alignment 128> (64K)"
23453 #: ../resize/virt-resize.pod:316
23455 "This alignment provides good performance when the host is using high end "
23460 #: ../resize/virt-resize.pod:319
23461 msgid "I<--alignment 2048> (1M)"
23465 #: ../resize/virt-resize.pod:321
23467 "This is the standard alignment used by all newly installed guests since "
23472 #: ../resize/virt-resize.pod:326
23477 #: ../resize/virt-resize.pod:328 ../tools/virt-make-fs.pl:177
23478 #: ../tools/virt-win-reg.pl:120
23483 #: ../resize/virt-resize.pod:330 ../tools/virt-win-reg.pl:122
23484 msgid "Enable debugging messages."
23488 #: ../resize/virt-resize.pod:332
23489 msgid "B<--delete part>"
23493 #: ../resize/virt-resize.pod:334
23495 "Delete the named partition. It would be more accurate to describe this as "
23496 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
23497 "the original disk image is left intact."
23501 #: ../resize/virt-resize.pod:338
23503 "Note that when you delete a partition, then anything contained in the "
23504 "partition is also deleted. Furthermore, this causes any partitions that "
23505 "come after to be I<renumbered>, which can easily make your guest unbootable."
23509 #: ../resize/virt-resize.pod:343 ../resize/virt-resize.pod:404
23510 #: ../resize/virt-resize.pod:531 ../sparsify/virt-sparsify.pod:145
23511 msgid "You can give this option multiple times."
23515 #: ../resize/virt-resize.pod:345
23516 msgid "B<--expand part>"
23520 #: ../resize/virt-resize.pod:347
23522 "Expand the named partition so it uses up all extra space (space left over "
23523 "after any other resize changes that you request have been done)."
23527 #: ../resize/virt-resize.pod:350
23529 "If virt-resize knows how, it will expand the direct content of the "
23530 "partition. For example, if the partition is an LVM PV, it will expand the "
23531 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
23532 "content it doesn't know about alone."
23536 #: ../resize/virt-resize.pod:355
23537 msgid "Currently virt-resize can resize:"
23541 #: ../resize/virt-resize.pod:361
23542 msgid "ext2, ext3 and ext4 filesystems."
23546 #: ../resize/virt-resize.pod:365
23547 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
23551 #: ../resize/virt-resize.pod:367
23553 "The filesystem must have been shut down consistently last time it was used. "
23554 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
23555 "consistency check, so at the first boot after resizing Windows will check "
23560 #: ../resize/virt-resize.pod:374
23562 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
23563 "inside the PV, but see the I<--LV-expand> option. The user could also "
23564 "resize LVs as desired after boot."
23568 #: ../resize/virt-resize.pod:380
23569 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
23573 #: ../resize/virt-resize.pod:384 ../resize/virt-resize.pod:559
23574 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
23578 #: ../resize/virt-resize.pod:386 ../sparsify/virt-sparsify.pod:125
23579 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92
23580 #: ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
23581 msgid "B<--format> raw"
23585 #: ../resize/virt-resize.pod:388 ../sparsify/virt-sparsify.pod:129
23587 "Specify the format of the input disk image. If this flag is not given then "
23588 "it is auto-detected from the image itself."
23592 #: ../resize/virt-resize.pod:394
23594 "Note that this option I<does not> affect the output format. See L</QCOW2 "
23595 "AND NON-SPARSE RAW FORMATS>."
23599 #: ../resize/virt-resize.pod:397
23600 msgid "B<--ignore part>"
23604 #: ../resize/virt-resize.pod:399
23606 "Ignore the named partition. Effectively this means the partition is "
23607 "allocated on the destination disk, but the content is not copied across from "
23608 "the source disk. The content of the partition will be blank (all zero "
23613 #: ../resize/virt-resize.pod:406
23614 msgid "B<--LV-expand logvol>"
23618 #: ../resize/virt-resize.pod:408
23620 "This takes the logical volume and, as a final step, expands it to fill all "
23621 "the space available in its volume group. A typical usage, assuming a Linux "
23622 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
23623 "lv_root> would be:"
23627 #: ../resize/virt-resize.pod:413
23630 " virt-resize indisk outdisk \\\n"
23631 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
23636 #: ../resize/virt-resize.pod:416
23638 "This would first expand the partition (and PV), and then expand the root "
23639 "device to fill the extra space in the PV."
23643 #: ../resize/virt-resize.pod:419
23645 "The contents of the LV are also resized if virt-resize knows how to do "
23646 "that. You can stop virt-resize from trying to expand the content by using "
23647 "the option I<--no-expand-content>."
23651 #: ../resize/virt-resize.pod:423
23652 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
23656 #: ../resize/virt-resize.pod:425
23658 "You can give this option multiple times, I<but> it doesn't make sense to do "
23659 "this unless the logical volumes you specify are all in different volume "
23664 #: ../resize/virt-resize.pod:429 ../sparsify/virt-sparsify.pod:147
23665 msgid "B<--machine-readable>"
23669 #: ../resize/virt-resize.pod:431 ../sparsify/virt-sparsify.pod:149
23671 "This option is used to make the output more machine friendly when being "
23672 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
23676 #: ../resize/virt-resize.pod:437
23677 msgid "B<--dryrun>"
23681 #: ../resize/virt-resize.pod:439
23682 msgid "Print a summary of what would be done, but don't do anything."
23686 #: ../resize/virt-resize.pod:441
23687 msgid "B<--no-copy-boot-loader>"
23691 #: ../resize/virt-resize.pod:443
23693 "By default, virt-resize copies over some sectors at the start of the disk "
23694 "(up to the beginning of the first partition). Commonly these sectors "
23695 "contain the Master Boot Record (MBR) and the boot loader, and are required "
23696 "in order for the guest to boot correctly."
23700 #: ../resize/virt-resize.pod:448
23702 "If you specify this flag, then this initial copy is not done. You may need "
23703 "to reinstall the boot loader in this case."
23707 #: ../resize/virt-resize.pod:451
23708 msgid "B<--no-extra-partition>"
23712 #: ../resize/virt-resize.pod:453
23714 "By default, virt-resize creates an extra partition if there is any extra, "
23715 "unused space after all resizing has happened. Use this option to prevent "
23716 "the extra partition from being created. If you do this then the extra space "
23717 "will be inaccessible until you run fdisk, parted, or some other partitioning "
23718 "tool in the guest."
23722 #: ../resize/virt-resize.pod:459
23724 "Note that if the surplus space is smaller than 10 MB, no extra partition "
23729 #: ../resize/virt-resize.pod:462
23730 msgid "B<--no-expand-content>"
23734 #: ../resize/virt-resize.pod:464
23736 "By default, virt-resize will try to expand the direct contents of "
23737 "partitions, if it knows how (see I<--expand> option above)."
23741 #: ../resize/virt-resize.pod:467
23743 "If you give the I<--no-expand-content> option then virt-resize will not "
23748 #: ../resize/virt-resize.pod:470
23749 msgid "B<--ntfsresize-force>"
23753 #: ../resize/virt-resize.pod:472
23755 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
23756 "the NTFS disk is marked as needing a consistency check. You have to use "
23757 "this option if you want to resize a Windows guest multiple times without "
23758 "booting into Windows between each resize."
23762 #: ../resize/virt-resize.pod:478
23763 msgid "B<--output-format> raw"
23767 #: ../resize/virt-resize.pod:480
23769 "Specify the format of the output disk image. If this flag is not given then "
23770 "it is auto-detected from the image itself."
23774 #: ../resize/virt-resize.pod:486
23776 "Note that this option I<does not create> the output format. This option "
23777 "just tells libguestfs what it is so it doesn't try to guess it. You still "
23778 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
23779 "SPARSE RAW FORMATS>."
23783 #: ../resize/virt-resize.pod:495
23784 msgid "Don't print the summary."
23788 #: ../resize/virt-resize.pod:497
23789 msgid "B<--resize part=size>"
23793 #: ../resize/virt-resize.pod:499
23795 "Resize the named partition (expanding or shrinking it) so that it has the "
23800 #: ../resize/virt-resize.pod:502
23802 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
23803 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
23804 "size; or as a relative number or percentage. For example:"
23808 #: ../resize/virt-resize.pod:508
23811 " --resize /dev/sda2=10G\n"
23816 #: ../resize/virt-resize.pod:510
23819 " --resize /dev/sda4=90%\n"
23824 #: ../resize/virt-resize.pod:512
23827 " --resize /dev/sda2=+1G\n"
23832 #: ../resize/virt-resize.pod:514
23835 " --resize /dev/sda2=-200M\n"
23840 #: ../resize/virt-resize.pod:516
23843 " --resize /dev/sda1=+128K\n"
23848 #: ../resize/virt-resize.pod:518
23851 " --resize /dev/sda1=+10%\n"
23856 #: ../resize/virt-resize.pod:520
23859 " --resize /dev/sda1=-10%\n"
23864 #: ../resize/virt-resize.pod:522
23866 "You can increase the size of any partition. Virt-resize will expand the "
23867 "direct content of the partition if it knows how (see I<--expand> below)."
23871 #: ../resize/virt-resize.pod:526
23873 "You can only I<decrease> the size of partitions that contain filesystems or "
23874 "PVs which have already been shrunk. Virt-resize will check this has been "
23875 "done before proceeding, or else will print an error (see also I<--resize-"
23880 #: ../resize/virt-resize.pod:533
23881 msgid "B<--resize-force part=size>"
23885 #: ../resize/virt-resize.pod:535
23887 "This is the same as I<--resize> except that it will let you decrease the "
23888 "size of any partition. Generally this means you will lose any data which "
23889 "was at the end of the partition you shrink, but you may not care about that "
23890 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
23891 "as a swap partition)."
23895 #: ../resize/virt-resize.pod:541
23896 msgid "See also the I<--ignore> option."
23900 #: ../resize/virt-resize.pod:543
23901 msgid "B<--shrink part>"
23905 #: ../resize/virt-resize.pod:545
23907 "Shrink the named partition until the overall disk image fits in the "
23908 "destination. The named partition B<must> contain a filesystem or PV which "
23909 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
23910 "online tools). Virt-resize will check this and give an error if it has not "
23915 #: ../resize/virt-resize.pod:551
23917 "The amount by which the overall disk must be shrunk (after carrying out all "
23918 "other operations requested by the user) is called the \"deficit\". For "
23919 "example, a straight copy (assume no other operations) from a 5GB disk image "
23920 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
23921 "would give an error unless the user specified a partition to shrink and that "
23922 "partition had more than a gigabyte of free space."
23926 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:177
23927 msgid "MACHINE READABLE OUTPUT"
23931 #: ../resize/virt-resize.pod:571
23933 "The I<--machine-readable> option can be used to make the output more machine "
23934 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23939 #: ../resize/virt-resize.pod:575 ../sparsify/virt-sparsify.pod:183
23940 msgid "There are two ways to use this option."
23944 #: ../resize/virt-resize.pod:577
23946 "Firstly use the option on its own to query the capabilities of the virt-"
23947 "resize binary. Typical output looks like this:"
23951 #: ../resize/virt-resize.pod:580
23954 " $ virt-resize --machine-readable\n"
23956 " ntfsresize-force\n"
23964 #: ../resize/virt-resize.pod:587 ../sparsify/virt-sparsify.pod:193
23966 "A list of features is printed, one per line, and the program exits with "
23971 #: ../resize/virt-resize.pod:590 ../sparsify/virt-sparsify.pod:196
23973 "Secondly use the option in conjunction with other options to make the "
23974 "regular program output more machine friendly."
23978 #: ../resize/virt-resize.pod:593 ../sparsify/virt-sparsify.pod:199
23979 msgid "At the moment this means:"
23983 #: ../resize/virt-resize.pod:599 ../sparsify/virt-sparsify.pod:205
23985 "Progress bar messages can be parsed from stdout by looking for this regular "
23990 #: ../resize/virt-resize.pod:602 ../sparsify/virt-sparsify.pod:208
23993 " ^[0-9]+/[0-9]+$\n"
23998 #: ../resize/virt-resize.pod:606 ../sparsify/virt-sparsify.pod:212
24000 "The calling program should treat messages sent to stdout (except for "
24001 "progress bar messages) as status messages. They can be logged and/or "
24002 "displayed to the user."
24006 #: ../resize/virt-resize.pod:612
24008 "The calling program should treat messages sent to stderr as error messages. "
24009 "In addition, virt-resize exits with a non-zero status code if there was a "
24014 #: ../resize/virt-resize.pod:618
24016 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
24017 "readable> option and will return an error."
24021 #: ../resize/virt-resize.pod:623
24022 msgid "\"Partition 1 does not end on cylinder boundary.\""
24026 #: ../resize/virt-resize.pod:625
24028 "Virt-resize aligns partitions to multiples of 128 sectors (see the I<--"
24029 "alignment> parameter). Usually this means the partitions will not be "
24030 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
24031 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
24032 "drives. Alignment of partitions to cylinders is not required by any modern "
24033 "operating system."
24037 #: ../resize/virt-resize.pod:632
24038 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
24042 #: ../resize/virt-resize.pod:634
24044 "In Windows Vista and later versions, Microsoft switched to using a separate "
24045 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
24046 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
24047 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
24048 "the second partition (ie. C: drive) should work."
24052 #: ../resize/virt-resize.pod:641
24054 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
24055 "NTFS partitions have been expanded. This is just a safety check and (unless "
24056 "it find errors) is nothing to worry about."
24060 #: ../resize/virt-resize.pod:645
24061 msgid "GUEST BOOT STUCK AT \"GRUB\""
24065 #: ../resize/virt-resize.pod:647
24067 "If a Linux guest does not boot after resizing, and the boot is stuck after "
24068 "printing C<GRUB> on the console, try reinstalling grub."
24072 #: ../resize/virt-resize.pod:650
24075 " guestfish -i -a newdisk\n"
24076 " ><fs> cat /boot/grub/device.map\n"
24077 " # check the contents of this file are sensible or\n"
24078 " # edit the file if necessary\n"
24079 " ><fs> grub-install / /dev/vda\n"
24085 #: ../resize/virt-resize.pod:657
24087 "For more flexible guest reconfiguration, including if you need to specify "
24088 "other parameters to grub-install, use L<virt-rescue(1)>."
24092 #: ../resize/virt-resize.pod:660
24093 msgid "ALTERNATIVE TOOLS"
24097 #: ../resize/virt-resize.pod:662
24099 "There are several proprietary tools for resizing partitions. We won't "
24100 "mention any here."
24104 #: ../resize/virt-resize.pod:665
24106 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
24107 "operations on disk images. They can resize and move partitions, but I don't "
24108 "think they can do anything with the contents, and they certainly don't "
24113 #: ../resize/virt-resize.pod:670
24115 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
24116 "but at a much lower level. You will probably end up hand-calculating sector "
24117 "offsets, which is something that virt-resize was designed to avoid. If you "
24118 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
24123 #: ../resize/virt-resize.pod:690
24125 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
24126 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
24127 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
24128 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<virt-sparsify(1)>, "
24129 "L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
24133 #: ../ruby/examples/guestfs-ruby.pod:5
24134 msgid "guestfs-ruby - How to use libguestfs from Ruby"
24138 #: ../ruby/examples/guestfs-ruby.pod:9
24141 " require 'guestfs'\n"
24142 " g = Guestfs::Guestfs.new()\n"
24143 " g.add_drive_opts(\"disk.img\",\n"
24144 " :readonly => 1, :format => \"raw\")\n"
24150 #: ../ruby/examples/guestfs-ruby.pod:17
24152 "This manual page documents how to call libguestfs from the Ruby programming "
24153 "language. This page just documents the differences from the C API and gives "
24154 "some examples. If you are not familiar with using libguestfs, you also need "
24155 "to read L<guestfs(3)>."
24159 #: ../ruby/examples/guestfs-ruby.pod:24
24161 "Errors from libguestfs functions are mapped into the C<Error> exception. "
24162 "This has a single parameter which is the error message (a string)."
24166 #: ../ruby/examples/guestfs-ruby.pod:38
24168 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
24169 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
24170 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
24174 #: ../sparsify/virt-sparsify.pod:5
24175 msgid "virt-sparsify - Make a virtual machine disk sparse"
24179 #: ../sparsify/virt-sparsify.pod:9
24182 " virt-sparsify [--options] indisk outdisk\n"
24187 #: ../sparsify/virt-sparsify.pod:13
24189 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
24190 "image) sparse a.k.a. thin-provisioned. This means that free space within "
24191 "the disk image can be converted back to free space on the host."
24195 #: ../sparsify/virt-sparsify.pod:18
24197 "Virt-sparsify can locate and sparsify free space in most filesystems (eg. "
24198 "ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
24202 #: ../sparsify/virt-sparsify.pod:21
24204 "Virt-sparsify can also convert between some disk formats, for example "
24205 "converting a raw disk image to a thin-provisioned qcow2 image."
24209 #: ../sparsify/virt-sparsify.pod:24
24211 "Virt-sparsify can operate on any disk image, not just ones from virtual "
24212 "machines. If a virtual machine has more than one attached disk, you must "
24213 "sparsify each one separately."
24217 #: ../sparsify/virt-sparsify.pod:28
24218 msgid "IMPORTANT LIMITATIONS"
24222 #: ../sparsify/virt-sparsify.pod:34
24224 "Virt-sparsify does not do in-place modifications. It copies from a source "
24225 "image to a destination image, leaving the source unchanged. I<Check that "
24226 "the sparsification was successful before deleting the source image>."
24230 #: ../sparsify/virt-sparsify.pod:41
24231 msgid "The virtual machine I<must be shut down> before using this tool."
24235 #: ../sparsify/virt-sparsify.pod:45
24237 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
24238 "(1 temporary copy + 1 destination image). This is in the worst case and "
24239 "usually much less space is required."
24243 #: ../sparsify/virt-sparsify.pod:51
24245 "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
24249 #: ../sparsify/virt-sparsify.pod:56
24250 msgid "Virt-sparsify cannot handle encrypted disks."
24254 #: ../sparsify/virt-sparsify.pod:60
24256 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
24257 "this space is often used for critical items like bootloaders so it's not "
24262 #: ../sparsify/virt-sparsify.pod:66
24264 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
24265 "to do this unless we can be sure there is no hibernation data, so at the "
24266 "moment swap partitions are ignored."
24270 #: ../sparsify/virt-sparsify.pod:72
24272 "You may also want to read the manual pages for the associated tools L<virt-"
24273 "filesystems(1)> and L<virt-df(1)> before starting."
24277 #: ../sparsify/virt-sparsify.pod:77
24278 msgid "Typical usage is:"
24282 #: ../sparsify/virt-sparsify.pod:79
24285 " virt-sparsify indisk outdisk\n"
24290 #: ../sparsify/virt-sparsify.pod:81
24292 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
24293 "is created, or overwritten if it already exists. The format of the input "
24294 "disk is detected (eg. qcow2) and the same format is used for the output disk."
24298 #: ../sparsify/virt-sparsify.pod:86
24299 msgid "To convert between formats, use the I<--convert> option:"
24303 #: ../sparsify/virt-sparsify.pod:88
24306 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
24311 #: ../sparsify/virt-sparsify.pod:90
24313 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
24314 "can find within the source disk image. You can get it to ignore (don't zero "
24315 "free space on) certain filesystems by doing:"
24319 #: ../sparsify/virt-sparsify.pod:94
24322 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
24327 #: ../sparsify/virt-sparsify.pod:96
24329 "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
24333 #: ../sparsify/virt-sparsify.pod:107
24334 msgid "B<--convert> raw"
24338 #: ../sparsify/virt-sparsify.pod:109
24339 msgid "B<--convert> qcow2"
24343 #: ../sparsify/virt-sparsify.pod:111
24344 msgid "B<--convert> [other formats]"
24348 #: ../sparsify/virt-sparsify.pod:113
24350 "Use C<output-format> as the format for the destination image. If this is "
24351 "not specified, then the input format is used."
24355 #: ../sparsify/virt-sparsify.pod:116
24356 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
24360 #: ../sparsify/virt-sparsify.pod:118
24362 "You can also use any format supported by the L<qemu-img(1)> program, eg. "
24363 "C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
24367 #: ../sparsify/virt-sparsify.pod:122
24369 "Specifying the I<--convert> option is usually a good idea, because then virt-"
24370 "sparsify doesn't need to try to guess the input format."
24374 #: ../sparsify/virt-sparsify.pod:127
24375 msgid "B<--format> qcow2"
24379 #: ../sparsify/virt-sparsify.pod:135
24380 msgid "B<--ignore> filesystem"
24384 #: ../sparsify/virt-sparsify.pod:137
24385 msgid "B<--ignore> volgroup"
24389 #: ../sparsify/virt-sparsify.pod:139
24391 "Ignore the named filesystem. Free space on the filesystem will not be "
24392 "zeroed, but existing blocks of zeroes will still be sparsified."
24396 #: ../sparsify/virt-sparsify.pod:142
24398 "In the second form, this ignores the named volume group. Use the volume "
24399 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
24403 #: ../sparsify/virt-sparsify.pod:157
24404 msgid "This disables progress bars and other unnecessary output."
24408 #: ../sparsify/virt-sparsify.pod:179
24410 "The I<--machine-readable> option can be used to make the output more machine "
24411 "friendly, which is useful when calling virt-sparsify from other programs, "
24416 #: ../sparsify/virt-sparsify.pod:185
24418 "Firstly use the option on its own to query the capabilities of the virt-"
24419 "sparsify binary. Typical output looks like this:"
24423 #: ../sparsify/virt-sparsify.pod:188
24426 " $ virt-sparsify --machine-readable\n"
24434 #: ../sparsify/virt-sparsify.pod:218
24436 "The calling program should treat messages sent to stderr as error messages. "
24437 "In addition, virt-sparsify exits with a non-zero status code if there was a "
24442 #: ../sparsify/virt-sparsify.pod:224
24444 "All versions of virt-sparsify have supported the I<--machine-readable> "
24449 #: ../sparsify/virt-sparsify.pod:238
24451 "Location of the temporary directory used for the potentially large temporary "
24456 #: ../sparsify/virt-sparsify.pod:241
24458 "You should ensure there is enough free space in the worst case for a full "
24459 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
24460 "to another directory that has enough space."
24464 #: ../sparsify/virt-sparsify.pod:245
24465 msgid "This defaults to C</tmp>."
24469 #: ../sparsify/virt-sparsify.pod:249
24471 "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
24475 #: ../sparsify/virt-sparsify.pod:253
24477 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
24478 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, L<qemu-img"
24479 "(1)>, L<http://libguestfs.org/>."
24483 #: ../src/guestfs-actions.pod:1
24484 msgid "guestfs_add_cdrom"
24488 #: ../src/guestfs-actions.pod:3
24492 " guestfs_add_cdrom (guestfs_h *g,\n"
24493 " const char *filename);\n"
24498 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:255
24499 #: ../src/guestfs-actions.pod:276
24501 "I<This function is deprecated.> In new code, use the L</"
24502 "guestfs_add_drive_opts> call instead."
24506 #: ../src/guestfs-actions.pod:24
24508 "This call checks for the existence of C<filename>. This stops you from "
24509 "specifying other types of drive which are supported by qemu such as C<nbd:> "
24510 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
24515 #: ../src/guestfs-actions.pod:31
24517 "If you just want to add an ISO file (often you use this as an efficient way "
24518 "to transfer large files into the guest), then you should probably use "
24519 "C<guestfs_add_drive_ro> instead."
24523 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
24524 #: ../src/guestfs-actions.pod:207 ../src/guestfs-actions.pod:244
24525 #: ../src/guestfs-actions.pod:265 ../src/guestfs-actions.pod:286
24526 #: ../src/guestfs-actions.pod:299 ../src/guestfs-actions.pod:313
24527 #: ../src/guestfs-actions.pod:433 ../src/guestfs-actions.pod:453
24528 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:512
24529 #: ../src/guestfs-actions.pod:540 ../src/guestfs-actions.pod:558
24530 #: ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:658
24531 #: ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:687
24532 #: ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:804
24533 #: ../src/guestfs-actions.pod:818 ../src/guestfs-actions.pod:832
24534 #: ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:1052
24535 #: ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1090
24536 #: ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1239
24537 #: ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1325
24538 #: ../src/guestfs-actions.pod:1376 ../src/guestfs-actions.pod:1427
24539 #: ../src/guestfs-actions.pod:1483 ../src/guestfs-actions.pod:1535
24540 #: ../src/guestfs-actions.pod:1554 ../src/guestfs-actions.pod:1568
24541 #: ../src/guestfs-actions.pod:1596 ../src/guestfs-actions.pod:1666
24542 #: ../src/guestfs-actions.pod:1697 ../src/guestfs-actions.pod:1722
24543 #: ../src/guestfs-actions.pod:1764 ../src/guestfs-actions.pod:1877
24544 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:2119
24545 #: ../src/guestfs-actions.pod:2141 ../src/guestfs-actions.pod:2228
24546 #: ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:2880
24547 #: ../src/guestfs-actions.pod:2941 ../src/guestfs-actions.pod:2976
24548 #: ../src/guestfs-actions.pod:4033 ../src/guestfs-actions.pod:4048
24549 #: ../src/guestfs-actions.pod:4073 ../src/guestfs-actions.pod:4262
24550 #: ../src/guestfs-actions.pod:4276 ../src/guestfs-actions.pod:4289
24551 #: ../src/guestfs-actions.pod:4303 ../src/guestfs-actions.pod:4318
24552 #: ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:4426
24553 #: ../src/guestfs-actions.pod:4446 ../src/guestfs-actions.pod:4463
24554 #: ../src/guestfs-actions.pod:4486 ../src/guestfs-actions.pod:4509
24555 #: ../src/guestfs-actions.pod:4544 ../src/guestfs-actions.pod:4563
24556 #: ../src/guestfs-actions.pod:4582 ../src/guestfs-actions.pod:4617
24557 #: ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4665
24558 #: ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4694
24559 #: ../src/guestfs-actions.pod:4709 ../src/guestfs-actions.pod:4726
24560 #: ../src/guestfs-actions.pod:4819 ../src/guestfs-actions.pod:4839
24561 #: ../src/guestfs-actions.pod:4852 ../src/guestfs-actions.pod:4903
24562 #: ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:4939
24563 #: ../src/guestfs-actions.pod:4955 ../src/guestfs-actions.pod:4969
24564 #: ../src/guestfs-actions.pod:4983 ../src/guestfs-actions.pod:5000
24565 #: ../src/guestfs-actions.pod:5015 ../src/guestfs-actions.pod:5042
24566 #: ../src/guestfs-actions.pod:5105 ../src/guestfs-actions.pod:5178
24567 #: ../src/guestfs-actions.pod:5209 ../src/guestfs-actions.pod:5228
24568 #: ../src/guestfs-actions.pod:5247 ../src/guestfs-actions.pod:5259
24569 #: ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5289
24570 #: ../src/guestfs-actions.pod:5304 ../src/guestfs-actions.pod:5319
24571 #: ../src/guestfs-actions.pod:5351 ../src/guestfs-actions.pod:5377
24572 #: ../src/guestfs-actions.pod:5416 ../src/guestfs-actions.pod:5436
24573 #: ../src/guestfs-actions.pod:5450 ../src/guestfs-actions.pod:5467
24574 #: ../src/guestfs-actions.pod:5516 ../src/guestfs-actions.pod:5569
24575 #: ../src/guestfs-actions.pod:5616 ../src/guestfs-actions.pod:5659
24576 #: ../src/guestfs-actions.pod:5687 ../src/guestfs-actions.pod:5704
24577 #: ../src/guestfs-actions.pod:5722 ../src/guestfs-actions.pod:5862
24578 #: ../src/guestfs-actions.pod:5919 ../src/guestfs-actions.pod:5941
24579 #: ../src/guestfs-actions.pod:5959 ../src/guestfs-actions.pod:6009
24580 #: ../src/guestfs-actions.pod:6075 ../src/guestfs-actions.pod:6092
24581 #: ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6119
24582 #: ../src/guestfs-actions.pod:6408 ../src/guestfs-actions.pod:6427
24583 #: ../src/guestfs-actions.pod:6446 ../src/guestfs-actions.pod:6460
24584 #: ../src/guestfs-actions.pod:6472 ../src/guestfs-actions.pod:6486
24585 #: ../src/guestfs-actions.pod:6498 ../src/guestfs-actions.pod:6512
24586 #: ../src/guestfs-actions.pod:6528 ../src/guestfs-actions.pod:6549
24587 #: ../src/guestfs-actions.pod:6568 ../src/guestfs-actions.pod:6587
24588 #: ../src/guestfs-actions.pod:6617 ../src/guestfs-actions.pod:6635
24589 #: ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6676
24590 #: ../src/guestfs-actions.pod:6695 ../src/guestfs-actions.pod:6716
24591 #: ../src/guestfs-actions.pod:6735 ../src/guestfs-actions.pod:6752
24592 #: ../src/guestfs-actions.pod:6771 ../src/guestfs-actions.pod:6799
24593 #: ../src/guestfs-actions.pod:6823 ../src/guestfs-actions.pod:6842
24594 #: ../src/guestfs-actions.pod:6858 ../src/guestfs-actions.pod:6882
24595 #: ../src/guestfs-actions.pod:6901 ../src/guestfs-actions.pod:6916
24596 #: ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:6979
24597 #: ../src/guestfs-actions.pod:7009 ../src/guestfs-actions.pod:7042
24598 #: ../src/guestfs-actions.pod:7157 ../src/guestfs-actions.pod:7278
24599 #: ../src/guestfs-actions.pod:7290 ../src/guestfs-actions.pod:7303
24600 #: ../src/guestfs-actions.pod:7316 ../src/guestfs-actions.pod:7338
24601 #: ../src/guestfs-actions.pod:7351 ../src/guestfs-actions.pod:7364
24602 #: ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7392
24603 #: ../src/guestfs-actions.pod:7451 ../src/guestfs-actions.pod:7468
24604 #: ../src/guestfs-actions.pod:7484 ../src/guestfs-actions.pod:7500
24605 #: ../src/guestfs-actions.pod:7517 ../src/guestfs-actions.pod:7530
24606 #: ../src/guestfs-actions.pod:7550 ../src/guestfs-actions.pod:7586
24607 #: ../src/guestfs-actions.pod:7600 ../src/guestfs-actions.pod:7641
24608 #: ../src/guestfs-actions.pod:7654 ../src/guestfs-actions.pod:7672
24609 #: ../src/guestfs-actions.pod:7706 ../src/guestfs-actions.pod:7742
24610 #: ../src/guestfs-actions.pod:7858 ../src/guestfs-actions.pod:7873
24611 #: ../src/guestfs-actions.pod:7887 ../src/guestfs-actions.pod:7942
24612 #: ../src/guestfs-actions.pod:7955 ../src/guestfs-actions.pod:8000
24613 #: ../src/guestfs-actions.pod:8040 ../src/guestfs-actions.pod:8096
24614 #: ../src/guestfs-actions.pod:8116 ../src/guestfs-actions.pod:8149
24615 #: ../src/guestfs-actions.pod:8213 ../src/guestfs-actions.pod:8236
24616 #: ../src/guestfs-actions.pod:8265
24617 msgid "This function returns 0 on success or -1 on error."
24621 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
24622 #: ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:2342
24623 #: ../src/guestfs-actions.pod:2440 ../src/guestfs-actions.pod:2565
24624 #: ../src/guestfs-actions.pod:4035 ../src/guestfs-actions.pod:4055
24625 #: ../src/guestfs-actions.pod:5353 ../src/guestfs-actions.pod:6637
24626 #: ../src/guestfs-actions.pod:6754 ../src/guestfs-actions.pod:6903
24627 #: ../src/guestfs-actions.pod:7394 ../src/guestfs-actions.pod:7519
24628 #: ../src/guestfs-actions.pod:8042
24629 msgid "(Added in 0.3)"
24633 #: ../src/guestfs-actions.pod:41
24634 msgid "guestfs_add_domain"
24638 #: ../src/guestfs-actions.pod:43
24642 " guestfs_add_domain (guestfs_h *g,\n"
24643 " const char *dom,\n"
24649 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
24650 #: ../src/guestfs-actions.pod:843 ../src/guestfs-actions.pod:1167
24651 #: ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:1297
24652 #: ../src/guestfs-actions.pod:1364 ../src/guestfs-actions.pod:1415
24653 #: ../src/guestfs-actions.pod:1466 ../src/guestfs-actions.pod:3233
24654 #: ../src/guestfs-actions.pod:5054 ../src/guestfs-actions.pod:5363
24655 #: ../src/guestfs-actions.pod:5580
24657 "You may supply a list of optional arguments to this call. Use zero or more "
24658 "of the following pairs of parameters, and terminate the list with C<-1> on "
24659 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
24663 #: ../src/guestfs-actions.pod:53
24666 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
24667 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
24668 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
24669 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
24670 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
24675 #: ../src/guestfs-actions.pod:59
24677 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
24678 "It works by connecting to libvirt, requesting the domain and domain XML from "
24679 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
24684 #: ../src/guestfs-actions.pod:94
24686 "The other optional parameters are passed directly through to "
24687 "C<guestfs_add_drive_opts>."
24691 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:356
24692 #: ../src/guestfs-actions.pod:526 ../src/guestfs-actions.pod:704
24693 #: ../src/guestfs-actions.pod:735 ../src/guestfs-actions.pod:753
24694 #: ../src/guestfs-actions.pod:772 ../src/guestfs-actions.pod:1742
24695 #: ../src/guestfs-actions.pod:2098 ../src/guestfs-actions.pod:2301
24696 #: ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2463
24697 #: ../src/guestfs-actions.pod:2515 ../src/guestfs-actions.pod:2529
24698 #: ../src/guestfs-actions.pod:2552 ../src/guestfs-actions.pod:2867
24699 #: ../src/guestfs-actions.pod:3351 ../src/guestfs-actions.pod:3369
24700 #: ../src/guestfs-actions.pod:5539 ../src/guestfs-actions.pod:5759
24701 #: ../src/guestfs-actions.pod:5997 ../src/guestfs-actions.pod:6189
24702 #: ../src/guestfs-actions.pod:6215 ../src/guestfs-actions.pod:7627
24703 #: ../src/guestfs-actions.pod:8053 ../src/guestfs-actions.pod:8066
24704 #: ../src/guestfs-actions.pod:8079
24705 msgid "On error this function returns -1."
24709 #: ../src/guestfs-actions.pod:99
24710 msgid "(Added in 1.7.4)"
24714 #: ../src/guestfs-actions.pod:101
24715 msgid "guestfs_add_domain_va"
24719 #: ../src/guestfs-actions.pod:103
24723 " guestfs_add_domain_va (guestfs_h *g,\n"
24724 " const char *dom,\n"
24725 " va_list args);\n"
24730 #: ../src/guestfs-actions.pod:108
24731 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
24735 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
24736 #: ../src/guestfs-actions.pod:220 ../src/guestfs-actions.pod:231
24737 #: ../src/guestfs-actions.pod:882 ../src/guestfs-actions.pod:893
24738 #: ../src/guestfs-actions.pod:1195 ../src/guestfs-actions.pod:1208
24739 #: ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1267
24740 #: ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:1354
24741 #: ../src/guestfs-actions.pod:1393 ../src/guestfs-actions.pod:1405
24742 #: ../src/guestfs-actions.pod:1444 ../src/guestfs-actions.pod:1456
24743 #: ../src/guestfs-actions.pod:1500 ../src/guestfs-actions.pod:1512
24744 #: ../src/guestfs-actions.pod:3317 ../src/guestfs-actions.pod:3329
24745 #: ../src/guestfs-actions.pod:5119 ../src/guestfs-actions.pod:5131
24746 #: ../src/guestfs-actions.pod:5391 ../src/guestfs-actions.pod:5403
24747 #: ../src/guestfs-actions.pod:5629 ../src/guestfs-actions.pod:5640
24748 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
24752 #: ../src/guestfs-actions.pod:112
24753 msgid "guestfs_add_domain_argv"
24757 #: ../src/guestfs-actions.pod:114
24761 " guestfs_add_domain_argv (guestfs_h *g,\n"
24762 " const char *dom,\n"
24763 " const struct guestfs_add_domain_argv *optargs);\n"
24768 #: ../src/guestfs-actions.pod:119
24769 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
24773 #: ../src/guestfs-actions.pod:123
24774 msgid "guestfs_add_drive"
24778 #: ../src/guestfs-actions.pod:125
24782 " guestfs_add_drive (guestfs_h *g,\n"
24783 " const char *filename);\n"
24788 #: ../src/guestfs-actions.pod:129
24790 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
24791 "optional parameters, so the disk is added writable, with the format being "
24792 "detected automatically."
24796 #: ../src/guestfs-actions.pod:133
24798 "Automatic detection of the format opens you up to a potential security hole "
24799 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24800 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24801 "you should think about replacing calls to this function with calls to "
24802 "C<guestfs_add_drive_opts>, and specifying the format."
24806 #: ../src/guestfs-actions.pod:144
24807 msgid "guestfs_add_drive_opts"
24811 #: ../src/guestfs-actions.pod:146
24815 " guestfs_add_drive_opts (guestfs_h *g,\n"
24816 " const char *filename,\n"
24822 #: ../src/guestfs-actions.pod:156
24825 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
24826 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
24827 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
24828 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
24833 #: ../src/guestfs-actions.pod:186
24835 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
24836 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
24837 "Possible formats include C<raw> and C<qcow2>."
24841 #: ../src/guestfs-actions.pod:197
24843 "This rarely-used option lets you emulate the behaviour of the deprecated "
24844 "C<guestfs_add_drive_with_if> call (q.v.)"
24848 #: ../src/guestfs-actions.pod:209
24849 msgid "(Added in 1.5.23)"
24853 #: ../src/guestfs-actions.pod:211
24854 msgid "guestfs_add_drive_opts_va"
24858 #: ../src/guestfs-actions.pod:213
24862 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
24863 " const char *filename,\n"
24864 " va_list args);\n"
24869 #: ../src/guestfs-actions.pod:218
24870 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
24874 #: ../src/guestfs-actions.pod:222
24875 msgid "guestfs_add_drive_opts_argv"
24879 #: ../src/guestfs-actions.pod:224
24883 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
24884 " const char *filename,\n"
24885 " const struct guestfs_add_drive_opts_argv *optargs);\n"
24890 #: ../src/guestfs-actions.pod:229
24891 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
24895 #: ../src/guestfs-actions.pod:233
24896 msgid "guestfs_add_drive_ro"
24900 #: ../src/guestfs-actions.pod:235
24904 " guestfs_add_drive_ro (guestfs_h *g,\n"
24905 " const char *filename);\n"
24910 #: ../src/guestfs-actions.pod:239
24912 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
24913 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
24914 "disk is added read-only, with the format being detected automatically."
24918 #: ../src/guestfs-actions.pod:246
24919 msgid "(Added in 1.0.38)"
24923 #: ../src/guestfs-actions.pod:248
24924 msgid "guestfs_add_drive_ro_with_if"
24928 #: ../src/guestfs-actions.pod:250
24932 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
24933 " const char *filename,\n"
24934 " const char *iface);\n"
24939 #: ../src/guestfs-actions.pod:262
24941 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
24942 "QEMU interface emulation to use at run time."
24946 #: ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:288
24947 #: ../src/guestfs-actions.pod:2826
24948 msgid "(Added in 1.0.84)"
24952 #: ../src/guestfs-actions.pod:269
24953 msgid "guestfs_add_drive_with_if"
24957 #: ../src/guestfs-actions.pod:271
24961 " guestfs_add_drive_with_if (guestfs_h *g,\n"
24962 " const char *filename,\n"
24963 " const char *iface);\n"
24968 #: ../src/guestfs-actions.pod:283
24970 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
24971 "QEMU interface emulation to use at run time."
24975 #: ../src/guestfs-actions.pod:290
24976 msgid "guestfs_aug_clear"
24980 #: ../src/guestfs-actions.pod:292
24984 " guestfs_aug_clear (guestfs_h *g,\n"
24985 " const char *augpath);\n"
24990 #: ../src/guestfs-actions.pod:301 ../src/guestfs-actions.pod:2554
24991 msgid "(Added in 1.3.4)"
24995 #: ../src/guestfs-actions.pod:303
24996 msgid "guestfs_aug_close"
25000 #: ../src/guestfs-actions.pod:305
25004 " guestfs_aug_close (guestfs_h *g);\n"
25009 #: ../src/guestfs-actions.pod:308
25011 "Close the current Augeas handle and free up any resources used by it. After "
25012 "calling this, you have to call C<guestfs_aug_init> again before you can use "
25013 "any other Augeas functions."
25017 #: ../src/guestfs-actions.pod:315 ../src/guestfs-actions.pod:340
25018 #: ../src/guestfs-actions.pod:358 ../src/guestfs-actions.pod:372
25019 #: ../src/guestfs-actions.pod:435 ../src/guestfs-actions.pod:455
25020 #: ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:500
25021 #: ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:528
25022 #: ../src/guestfs-actions.pod:542 ../src/guestfs-actions.pod:560
25023 #: ../src/guestfs-actions.pod:6266
25024 msgid "(Added in 0.7)"
25028 #: ../src/guestfs-actions.pod:317
25029 msgid "guestfs_aug_defnode"
25033 #: ../src/guestfs-actions.pod:319
25036 " struct guestfs_int_bool *\n"
25037 " guestfs_aug_defnode (guestfs_h *g,\n"
25038 " const char *name,\n"
25039 " const char *expr,\n"
25040 " const char *val);\n"
25045 #: ../src/guestfs-actions.pod:328
25047 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
25048 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
25049 "containing that single node."
25053 #: ../src/guestfs-actions.pod:336
25055 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
25056 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
25060 #: ../src/guestfs-actions.pod:342
25061 msgid "guestfs_aug_defvar"
25065 #: ../src/guestfs-actions.pod:344
25069 " guestfs_aug_defvar (guestfs_h *g,\n"
25070 " const char *name,\n"
25071 " const char *expr);\n"
25076 #: ../src/guestfs-actions.pod:360
25077 msgid "guestfs_aug_get"
25081 #: ../src/guestfs-actions.pod:362
25085 " guestfs_aug_get (guestfs_h *g,\n"
25086 " const char *augpath);\n"
25091 #: ../src/guestfs-actions.pod:369 ../src/guestfs-actions.pod:933
25092 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1011
25093 #: ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1130
25094 #: ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:1628
25095 #: ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1781
25096 #: ../src/guestfs-actions.pod:1969 ../src/guestfs-actions.pod:2081
25097 #: ../src/guestfs-actions.pod:2244 ../src/guestfs-actions.pod:2261
25098 #: ../src/guestfs-actions.pod:2328 ../src/guestfs-actions.pod:2371
25099 #: ../src/guestfs-actions.pod:2392 ../src/guestfs-actions.pod:2577
25100 #: ../src/guestfs-actions.pod:2791 ../src/guestfs-actions.pod:2995
25101 #: ../src/guestfs-actions.pod:3097 ../src/guestfs-actions.pod:3201
25102 #: ../src/guestfs-actions.pod:3220 ../src/guestfs-actions.pod:3435
25103 #: ../src/guestfs-actions.pod:3463 ../src/guestfs-actions.pod:3484
25104 #: ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3581
25105 #: ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3621
25106 #: ../src/guestfs-actions.pod:4248 ../src/guestfs-actions.pod:4601
25107 #: ../src/guestfs-actions.pod:4771 ../src/guestfs-actions.pod:4881
25108 #: ../src/guestfs-actions.pod:5777 ../src/guestfs-actions.pod:5978
25109 #: ../src/guestfs-actions.pod:6164 ../src/guestfs-actions.pod:6342
25110 #: ../src/guestfs-actions.pod:6391 ../src/guestfs-actions.pod:7063
25111 #: ../src/guestfs-actions.pod:7079 ../src/guestfs-actions.pod:7103
25112 #: ../src/guestfs-actions.pod:7127 ../src/guestfs-actions.pod:7801
25113 #: ../src/guestfs-actions.pod:7820 ../src/guestfs-actions.pod:7838
25114 #: ../src/guestfs-actions.pod:8012 ../src/guestfs-actions.pod:8329
25116 "This function returns a string, or NULL on error. I<The caller must free "
25117 "the returned string after use>."
25121 #: ../src/guestfs-actions.pod:374
25122 msgid "guestfs_aug_init"
25126 #: ../src/guestfs-actions.pod:376
25130 " guestfs_aug_init (guestfs_h *g,\n"
25131 " const char *root,\n"
25137 #: ../src/guestfs-actions.pod:385
25138 msgid "You must call this before using any other C<guestfs_aug_*> commands."
25142 #: ../src/guestfs-actions.pod:410
25144 "This option is only useful when debugging Augeas lenses. Use of this option "
25145 "may require additional memory for the libguestfs appliance. You may need to "
25146 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
25147 "C<guestfs_set_memsize>."
25151 #: ../src/guestfs-actions.pod:425
25152 msgid "Do not load the tree in C<guestfs_aug_init>."
25156 #: ../src/guestfs-actions.pod:429
25157 msgid "To close the handle, you can call C<guestfs_aug_close>."
25161 #: ../src/guestfs-actions.pod:437
25162 msgid "guestfs_aug_insert"
25166 #: ../src/guestfs-actions.pod:439
25170 " guestfs_aug_insert (guestfs_h *g,\n"
25171 " const char *augpath,\n"
25172 " const char *label,\n"
25178 #: ../src/guestfs-actions.pod:457
25179 msgid "guestfs_aug_load"
25183 #: ../src/guestfs-actions.pod:459
25187 " guestfs_aug_load (guestfs_h *g);\n"
25192 #: ../src/guestfs-actions.pod:471
25193 msgid "guestfs_aug_ls"
25197 #: ../src/guestfs-actions.pod:473
25201 " guestfs_aug_ls (guestfs_h *g,\n"
25202 " const char *augpath);\n"
25207 #: ../src/guestfs-actions.pod:477
25209 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
25210 "sorting the resulting nodes into alphabetical order."
25214 #: ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:496
25215 #: ../src/guestfs-actions.pod:642 ../src/guestfs-actions.pod:1149
25216 #: ../src/guestfs-actions.pod:1796 ../src/guestfs-actions.pod:1815
25217 #: ../src/guestfs-actions.pod:1918 ../src/guestfs-actions.pod:1937
25218 #: ../src/guestfs-actions.pod:2183 ../src/guestfs-actions.pod:2649
25219 #: ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:2684
25220 #: ../src/guestfs-actions.pod:2749 ../src/guestfs-actions.pod:2773
25221 #: ../src/guestfs-actions.pod:2844 ../src/guestfs-actions.pod:2893
25222 #: ../src/guestfs-actions.pod:3162 ../src/guestfs-actions.pod:3537
25223 #: ../src/guestfs-actions.pod:3817 ../src/guestfs-actions.pod:4131
25224 #: ../src/guestfs-actions.pod:4148 ../src/guestfs-actions.pod:4168
25225 #: ../src/guestfs-actions.pod:4230 ../src/guestfs-actions.pod:4335
25226 #: ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:5500
25227 #: ../src/guestfs-actions.pod:6136 ../src/guestfs-actions.pod:6262
25228 #: ../src/guestfs-actions.pod:6376 ../src/guestfs-actions.pod:7143
25229 #: ../src/guestfs-actions.pod:7204 ../src/guestfs-actions.pod:7259
25230 #: ../src/guestfs-actions.pod:7405 ../src/guestfs-actions.pod:7429
25231 #: ../src/guestfs-actions.pod:7905 ../src/guestfs-actions.pod:7925
25232 #: ../src/guestfs-actions.pod:7972 ../src/guestfs-actions.pod:8166
25233 #: ../src/guestfs-actions.pod:8185 ../src/guestfs-actions.pod:8279
25234 #: ../src/guestfs-actions.pod:8298 ../src/guestfs-actions.pod:8344
25235 #: ../src/guestfs-actions.pod:8363
25237 "This function returns a NULL-terminated array of strings (like L<environ(3)"
25238 ">), or NULL if there was an error. I<The caller must free the strings and "
25239 "the array after use>."
25243 #: ../src/guestfs-actions.pod:484 ../src/guestfs-actions.pod:1074
25244 #: ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1853
25245 #: ../src/guestfs-actions.pod:3895 ../src/guestfs-actions.pod:3926
25246 #: ../src/guestfs-actions.pod:4584 ../src/guestfs-actions.pod:4634
25247 #: ../src/guestfs-actions.pod:4821 ../src/guestfs-actions.pod:4854
25248 #: ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5504
25249 #: ../src/guestfs-actions.pod:6077 ../src/guestfs-actions.pod:6474
25250 #: ../src/guestfs-actions.pod:6488 ../src/guestfs-actions.pod:6500
25251 #: ../src/guestfs-actions.pod:6984 ../src/guestfs-actions.pod:7643
25252 #: ../src/guestfs-actions.pod:7656 ../src/guestfs-actions.pod:7889
25253 #: ../src/guestfs-actions.pod:8154
25254 msgid "(Added in 0.8)"
25258 #: ../src/guestfs-actions.pod:486
25259 msgid "guestfs_aug_match"
25263 #: ../src/guestfs-actions.pod:488
25267 " guestfs_aug_match (guestfs_h *g,\n"
25268 " const char *augpath);\n"
25273 #: ../src/guestfs-actions.pod:502
25274 msgid "guestfs_aug_mv"
25278 #: ../src/guestfs-actions.pod:504
25282 " guestfs_aug_mv (guestfs_h *g,\n"
25283 " const char *src,\n"
25284 " const char *dest);\n"
25289 #: ../src/guestfs-actions.pod:516
25290 msgid "guestfs_aug_rm"
25294 #: ../src/guestfs-actions.pod:518
25298 " guestfs_aug_rm (guestfs_h *g,\n"
25299 " const char *augpath);\n"
25304 #: ../src/guestfs-actions.pod:530
25305 msgid "guestfs_aug_save"
25309 #: ../src/guestfs-actions.pod:532
25313 " guestfs_aug_save (guestfs_h *g);\n"
25318 #: ../src/guestfs-actions.pod:537
25320 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
25325 #: ../src/guestfs-actions.pod:544
25326 msgid "guestfs_aug_set"
25330 #: ../src/guestfs-actions.pod:546
25334 " guestfs_aug_set (guestfs_h *g,\n"
25335 " const char *augpath,\n"
25336 " const char *val);\n"
25341 #: ../src/guestfs-actions.pod:553
25343 "In the Augeas API, it is possible to clear a node by setting the value to "
25344 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
25345 "this call. Instead you must use the C<guestfs_aug_clear> call."
25349 #: ../src/guestfs-actions.pod:562
25350 msgid "guestfs_available"
25354 #: ../src/guestfs-actions.pod:564
25358 " guestfs_available (guestfs_h *g,\n"
25359 " char *const *groups);\n"
25364 #: ../src/guestfs-actions.pod:572
25366 "The libguestfs groups, and the functions that those groups correspond to, "
25367 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
25368 "runtime by calling C<guestfs_available_all_groups>."
25372 #: ../src/guestfs-actions.pod:596
25373 msgid "You must call C<guestfs_launch> before calling this function."
25377 #: ../src/guestfs-actions.pod:618
25379 "This call was added in version C<1.0.80>. In previous versions of "
25380 "libguestfs all you could do would be to speculatively execute a command to "
25381 "find out if the daemon implemented it. See also C<guestfs_version>."
25385 #: ../src/guestfs-actions.pod:627 ../src/guestfs-actions.pod:1598
25386 msgid "(Added in 1.0.80)"
25390 #: ../src/guestfs-actions.pod:629
25391 msgid "guestfs_available_all_groups"
25395 #: ../src/guestfs-actions.pod:631
25399 " guestfs_available_all_groups (guestfs_h *g);\n"
25404 #: ../src/guestfs-actions.pod:634
25406 "This command returns a list of all optional groups that this daemon knows "
25407 "about. Note this returns both supported and unsupported groups. To find "
25408 "out which ones the daemon can actually support you have to call "
25409 "C<guestfs_available> on each member of the returned list."
25413 #: ../src/guestfs-actions.pod:640
25414 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
25418 #: ../src/guestfs-actions.pod:646
25419 msgid "(Added in 1.3.15)"
25423 #: ../src/guestfs-actions.pod:648
25424 msgid "guestfs_base64_in"
25428 #: ../src/guestfs-actions.pod:650
25432 " guestfs_base64_in (guestfs_h *g,\n"
25433 " const char *base64file,\n"
25434 " const char *filename);\n"
25439 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:674
25440 msgid "(Added in 1.3.5)"
25444 #: ../src/guestfs-actions.pod:662
25445 msgid "guestfs_base64_out"
25449 #: ../src/guestfs-actions.pod:664
25453 " guestfs_base64_out (guestfs_h *g,\n"
25454 " const char *filename,\n"
25455 " const char *base64file);\n"
25460 #: ../src/guestfs-actions.pod:676
25461 msgid "guestfs_blockdev_flushbufs"
25465 #: ../src/guestfs-actions.pod:678
25469 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
25470 " const char *device);\n"
25475 #: ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:706
25476 #: ../src/guestfs-actions.pod:721 ../src/guestfs-actions.pod:737
25477 #: ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:774
25478 #: ../src/guestfs-actions.pod:788 ../src/guestfs-actions.pod:806
25479 #: ../src/guestfs-actions.pod:820 ../src/guestfs-actions.pod:834
25480 msgid "(Added in 0.9.3)"
25484 #: ../src/guestfs-actions.pod:691
25485 msgid "guestfs_blockdev_getbsz"
25489 #: ../src/guestfs-actions.pod:693
25493 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
25494 " const char *device);\n"
25499 #: ../src/guestfs-actions.pod:708
25500 msgid "guestfs_blockdev_getro"
25504 #: ../src/guestfs-actions.pod:710
25508 " guestfs_blockdev_getro (guestfs_h *g,\n"
25509 " const char *device);\n"
25514 #: ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:1836
25515 #: ../src/guestfs-actions.pod:1851 ../src/guestfs-actions.pod:2340
25516 #: ../src/guestfs-actions.pod:2351 ../src/guestfs-actions.pod:2423
25517 #: ../src/guestfs-actions.pod:2449 ../src/guestfs-actions.pod:2489
25518 #: ../src/guestfs-actions.pod:2504 ../src/guestfs-actions.pod:2540
25519 #: ../src/guestfs-actions.pod:2563 ../src/guestfs-actions.pod:3638
25520 #: ../src/guestfs-actions.pod:3654 ../src/guestfs-actions.pod:3672
25521 #: ../src/guestfs-actions.pod:3834 ../src/guestfs-actions.pod:3848
25522 #: ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:3877
25523 #: ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3908
25524 #: ../src/guestfs-actions.pod:3924 ../src/guestfs-actions.pod:3938
25525 #: ../src/guestfs-actions.pod:3951 ../src/guestfs-actions.pod:3965
25526 #: ../src/guestfs-actions.pod:3980 ../src/guestfs-actions.pod:3995
25527 #: ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4022
25528 #: ../src/guestfs-actions.pod:5741
25529 msgid "This function returns a C truth value on success or -1 on error."
25533 #: ../src/guestfs-actions.pod:723
25534 msgid "guestfs_blockdev_getsize64"
25538 #: ../src/guestfs-actions.pod:725
25542 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
25543 " const char *device);\n"
25548 #: ../src/guestfs-actions.pod:731
25549 msgid "See also C<guestfs_blockdev_getsz>."
25553 #: ../src/guestfs-actions.pod:739
25554 msgid "guestfs_blockdev_getss"
25558 #: ../src/guestfs-actions.pod:741
25562 " guestfs_blockdev_getss (guestfs_h *g,\n"
25563 " const char *device);\n"
25568 #: ../src/guestfs-actions.pod:748
25570 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
25575 #: ../src/guestfs-actions.pod:757
25576 msgid "guestfs_blockdev_getsz"
25580 #: ../src/guestfs-actions.pod:759
25584 " guestfs_blockdev_getsz (guestfs_h *g,\n"
25585 " const char *device);\n"
25590 #: ../src/guestfs-actions.pod:766
25592 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
25593 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
25597 #: ../src/guestfs-actions.pod:776
25598 msgid "guestfs_blockdev_rereadpt"
25602 #: ../src/guestfs-actions.pod:778
25606 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
25607 " const char *device);\n"
25612 #: ../src/guestfs-actions.pod:790
25613 msgid "guestfs_blockdev_setbsz"
25617 #: ../src/guestfs-actions.pod:792
25621 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
25622 " const char *device,\n"
25623 " int blocksize);\n"
25628 #: ../src/guestfs-actions.pod:808
25629 msgid "guestfs_blockdev_setro"
25633 #: ../src/guestfs-actions.pod:810
25637 " guestfs_blockdev_setro (guestfs_h *g,\n"
25638 " const char *device);\n"
25643 #: ../src/guestfs-actions.pod:822
25644 msgid "guestfs_blockdev_setrw"
25648 #: ../src/guestfs-actions.pod:824
25652 " guestfs_blockdev_setrw (guestfs_h *g,\n"
25653 " const char *device);\n"
25658 #: ../src/guestfs-actions.pod:836
25659 msgid "guestfs_btrfs_filesystem_resize"
25663 #: ../src/guestfs-actions.pod:838
25667 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
25668 " const char *mountpoint,\n"
25674 #: ../src/guestfs-actions.pod:848
25677 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
25682 #: ../src/guestfs-actions.pod:871
25683 msgid "(Added in 1.11.17)"
25687 #: ../src/guestfs-actions.pod:873
25688 msgid "guestfs_btrfs_filesystem_resize_va"
25692 #: ../src/guestfs-actions.pod:875
25696 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
25697 " const char *mountpoint,\n"
25698 " va_list args);\n"
25703 #: ../src/guestfs-actions.pod:880
25704 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
25708 #: ../src/guestfs-actions.pod:884
25709 msgid "guestfs_btrfs_filesystem_resize_argv"
25713 #: ../src/guestfs-actions.pod:886
25717 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
25718 " const char *mountpoint,\n"
25719 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
25724 #: ../src/guestfs-actions.pod:891
25725 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
25729 #: ../src/guestfs-actions.pod:895
25730 msgid "guestfs_case_sensitive_path"
25734 #: ../src/guestfs-actions.pod:897
25738 " guestfs_case_sensitive_path (guestfs_h *g,\n"
25739 " const char *path);\n"
25744 #: ../src/guestfs-actions.pod:923
25746 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
25747 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
25748 "how the directories were originally created under Windows)."
25752 #: ../src/guestfs-actions.pod:931
25753 msgid "See also C<guestfs_realpath>."
25757 #: ../src/guestfs-actions.pod:936 ../src/guestfs-actions.pod:7823
25758 msgid "(Added in 1.0.75)"
25762 #: ../src/guestfs-actions.pod:938
25763 msgid "guestfs_cat"
25767 #: ../src/guestfs-actions.pod:940
25771 " guestfs_cat (guestfs_h *g,\n"
25772 " const char *path);\n"
25777 #: ../src/guestfs-actions.pod:946
25779 "Note that this function cannot correctly handle binary files (specifically, "
25780 "files containing C<\\0> character which is treated as end of string). For "
25781 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
25782 "functions which have a more complex interface."
25786 #: ../src/guestfs-actions.pod:957 ../src/guestfs-actions.pod:4152
25787 #: ../src/guestfs-actions.pod:4234 ../src/guestfs-actions.pod:4251
25788 #: ../src/guestfs-actions.pod:4339 ../src/guestfs-actions.pod:4747
25789 #: ../src/guestfs-actions.pod:4761 ../src/guestfs-actions.pod:6140
25790 #: ../src/guestfs-actions.pod:6154 ../src/guestfs-actions.pod:7976
25791 #: ../src/guestfs-actions.pod:7990
25792 msgid "(Added in 0.4)"
25796 #: ../src/guestfs-actions.pod:959
25797 msgid "guestfs_checksum"
25801 #: ../src/guestfs-actions.pod:961
25805 " guestfs_checksum (guestfs_h *g,\n"
25806 " const char *csumtype,\n"
25807 " const char *path);\n"
25812 #: ../src/guestfs-actions.pod:1007
25813 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
25817 #: ../src/guestfs-actions.pod:1009
25818 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
25822 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1673
25823 #: ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:3850
25824 #: ../src/guestfs-actions.pod:3879 ../src/guestfs-actions.pod:3940
25825 #: ../src/guestfs-actions.pod:3967 ../src/guestfs-actions.pod:7679
25826 msgid "(Added in 1.0.2)"
25830 #: ../src/guestfs-actions.pod:1016
25831 msgid "guestfs_checksum_device"
25835 #: ../src/guestfs-actions.pod:1018
25839 " guestfs_checksum_device (guestfs_h *g,\n"
25840 " const char *csumtype,\n"
25841 " const char *device);\n"
25846 #: ../src/guestfs-actions.pod:1023
25848 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
25849 "device named C<device>. For the types of checksums supported see the "
25850 "C<guestfs_checksum> command."
25854 #: ../src/guestfs-actions.pod:1030 ../src/guestfs-actions.pod:5571
25855 #: ../src/guestfs-actions.pod:5706 ../src/guestfs-actions.pod:5743
25856 #: ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:5943
25857 #: ../src/guestfs-actions.pod:7588 ../src/guestfs-actions.pod:7602
25858 #: ../src/guestfs-actions.pod:8002
25859 msgid "(Added in 1.3.2)"
25863 #: ../src/guestfs-actions.pod:1032
25864 msgid "guestfs_checksums_out"
25868 #: ../src/guestfs-actions.pod:1034
25872 " guestfs_checksums_out (guestfs_h *g,\n"
25873 " const char *csumtype,\n"
25874 " const char *directory,\n"
25875 " const char *sumsfile);\n"
25880 #: ../src/guestfs-actions.pod:1054
25881 msgid "(Added in 1.3.7)"
25885 #: ../src/guestfs-actions.pod:1056
25886 msgid "guestfs_chmod"
25890 #: ../src/guestfs-actions.pod:1058
25894 " guestfs_chmod (guestfs_h *g,\n"
25896 " const char *path);\n"
25901 #: ../src/guestfs-actions.pod:1076
25902 msgid "guestfs_chown"
25906 #: ../src/guestfs-actions.pod:1078
25910 " guestfs_chown (guestfs_h *g,\n"
25913 " const char *path);\n"
25918 #: ../src/guestfs-actions.pod:1094
25919 msgid "guestfs_command"
25923 #: ../src/guestfs-actions.pod:1096
25927 " guestfs_command (guestfs_h *g,\n"
25928 " char *const *arguments);\n"
25933 #: ../src/guestfs-actions.pod:1105
25935 "The single parameter is an argv-style list of arguments. The first element "
25936 "is the name of the program to run. Subsequent elements are parameters. The "
25937 "list must be non-empty (ie. must contain a program name). Note that the "
25938 "command runs directly, and is I<not> invoked via the shell (see "
25943 #: ../src/guestfs-actions.pod:1136 ../src/guestfs-actions.pod:1156
25944 #: ../src/guestfs-actions.pod:1972
25945 msgid "(Added in 0.9.1)"
25949 #: ../src/guestfs-actions.pod:1138
25950 msgid "guestfs_command_lines"
25954 #: ../src/guestfs-actions.pod:1140
25958 " guestfs_command_lines (guestfs_h *g,\n"
25959 " char *const *arguments);\n"
25964 #: ../src/guestfs-actions.pod:1144
25966 "This is the same as C<guestfs_command>, but splits the result into a list of "
25971 #: ../src/guestfs-actions.pod:1147
25972 msgid "See also: C<guestfs_sh_lines>"
25976 #: ../src/guestfs-actions.pod:1158
25977 msgid "guestfs_compress_device_out"
25981 #: ../src/guestfs-actions.pod:1160
25985 " guestfs_compress_device_out (guestfs_h *g,\n"
25986 " const char *ctype,\n"
25987 " const char *device,\n"
25988 " const char *zdevice,\n"
25994 #: ../src/guestfs-actions.pod:1172
25997 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
26002 #: ../src/guestfs-actions.pod:1177
26004 "The C<ctype> and optional C<level> parameters have the same meaning as in "
26005 "C<guestfs_compress_out>."
26009 #: ../src/guestfs-actions.pod:1182 ../src/guestfs-actions.pod:1241
26010 #: ../src/guestfs-actions.pod:2517 ../src/guestfs-actions.pod:6860
26011 msgid "(Added in 1.13.15)"
26015 #: ../src/guestfs-actions.pod:1184
26016 msgid "guestfs_compress_device_out_va"
26020 #: ../src/guestfs-actions.pod:1186
26024 " guestfs_compress_device_out_va (guestfs_h *g,\n"
26025 " const char *ctype,\n"
26026 " const char *device,\n"
26027 " const char *zdevice,\n"
26028 " va_list args);\n"
26033 #: ../src/guestfs-actions.pod:1193
26034 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
26038 #: ../src/guestfs-actions.pod:1197
26039 msgid "guestfs_compress_device_out_argv"
26043 #: ../src/guestfs-actions.pod:1199
26047 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
26048 " const char *ctype,\n"
26049 " const char *device,\n"
26050 " const char *zdevice,\n"
26051 " const struct guestfs_compress_device_out_argv *optargs);\n"
26056 #: ../src/guestfs-actions.pod:1206
26057 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
26061 #: ../src/guestfs-actions.pod:1210
26062 msgid "guestfs_compress_out"
26066 #: ../src/guestfs-actions.pod:1212
26070 " guestfs_compress_out (guestfs_h *g,\n"
26071 " const char *ctype,\n"
26072 " const char *file,\n"
26073 " const char *zfile,\n"
26079 #: ../src/guestfs-actions.pod:1224
26082 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
26087 #: ../src/guestfs-actions.pod:1243
26088 msgid "guestfs_compress_out_va"
26092 #: ../src/guestfs-actions.pod:1245
26096 " guestfs_compress_out_va (guestfs_h *g,\n"
26097 " const char *ctype,\n"
26098 " const char *file,\n"
26099 " const char *zfile,\n"
26100 " va_list args);\n"
26105 #: ../src/guestfs-actions.pod:1252
26106 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
26110 #: ../src/guestfs-actions.pod:1256
26111 msgid "guestfs_compress_out_argv"
26115 #: ../src/guestfs-actions.pod:1258
26119 " guestfs_compress_out_argv (guestfs_h *g,\n"
26120 " const char *ctype,\n"
26121 " const char *file,\n"
26122 " const char *zfile,\n"
26123 " const struct guestfs_compress_out_argv *optargs);\n"
26128 #: ../src/guestfs-actions.pod:1265
26129 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
26133 #: ../src/guestfs-actions.pod:1269
26134 msgid "guestfs_config"
26138 #: ../src/guestfs-actions.pod:1271
26142 " guestfs_config (guestfs_h *g,\n"
26143 " const char *qemuparam,\n"
26144 " const char *qemuvalue);\n"
26149 #: ../src/guestfs-actions.pod:1289
26150 msgid "guestfs_copy_device_to_device"
26154 #: ../src/guestfs-actions.pod:1291
26158 " guestfs_copy_device_to_device (guestfs_h *g,\n"
26159 " const char *src,\n"
26160 " const char *dest,\n"
26166 #: ../src/guestfs-actions.pod:1302
26169 " GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
26170 " GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
26171 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, int64_t size,\n"
26176 #: ../src/guestfs-actions.pod:1306
26178 "The four calls C<guestfs_copy_device_to_device>, "
26179 "C<guestfs_copy_device_to_file>, C<guestfs_copy_file_to_device>, and "
26180 "C<guestfs_copy_file_to_file> let you copy from a source (device|file) to a "
26181 "destination (device|file)."
26185 #: ../src/guestfs-actions.pod:1327 ../src/guestfs-actions.pod:1378
26186 #: ../src/guestfs-actions.pod:1429 ../src/guestfs-actions.pod:1485
26187 #: ../src/guestfs-actions.pod:1537 ../src/guestfs-actions.pod:1668
26188 #: ../src/guestfs-actions.pod:1699 ../src/guestfs-actions.pod:1744
26189 #: ../src/guestfs-actions.pod:2121 ../src/guestfs-actions.pod:2143
26190 #: ../src/guestfs-actions.pod:4050 ../src/guestfs-actions.pod:7674
26191 #: ../src/guestfs-actions.pod:7708 ../src/guestfs-actions.pod:8215
26192 #: ../src/guestfs-actions.pod:8238
26194 "This long-running command can generate progress notification messages so "
26195 "that the caller can display a progress bar or indicator. To receive these "
26196 "messages, the caller must register a progress event callback. See L<guestfs"
26197 "(3)/GUESTFS_EVENT_PROGRESS>."
26201 #: ../src/guestfs-actions.pod:1332
26202 msgid "guestfs_copy_device_to_device_va"
26206 #: ../src/guestfs-actions.pod:1334
26210 " guestfs_copy_device_to_device_va (guestfs_h *g,\n"
26211 " const char *src,\n"
26212 " const char *dest,\n"
26213 " va_list args);\n"
26218 #: ../src/guestfs-actions.pod:1340
26219 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_device>."
26223 #: ../src/guestfs-actions.pod:1344
26224 msgid "guestfs_copy_device_to_device_argv"
26228 #: ../src/guestfs-actions.pod:1346
26232 " guestfs_copy_device_to_device_argv (guestfs_h *g,\n"
26233 " const char *src,\n"
26234 " const char *dest,\n"
26235 " const struct guestfs_copy_device_to_device_argv *optargs);\n"
26240 #: ../src/guestfs-actions.pod:1352
26241 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_device>."
26245 #: ../src/guestfs-actions.pod:1356
26246 msgid "guestfs_copy_device_to_file"
26250 #: ../src/guestfs-actions.pod:1358
26254 " guestfs_copy_device_to_file (guestfs_h *g,\n"
26255 " const char *src,\n"
26256 " const char *dest,\n"
26262 #: ../src/guestfs-actions.pod:1369
26265 " GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
26266 " GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
26267 " GUESTFS_COPY_DEVICE_TO_FILE_SIZE, int64_t size,\n"
26272 #: ../src/guestfs-actions.pod:1373 ../src/guestfs-actions.pod:1424
26273 #: ../src/guestfs-actions.pod:1475
26275 "See C<guestfs_copy_device_to_device> for a general overview of this call."
26279 #: ../src/guestfs-actions.pod:1383
26280 msgid "guestfs_copy_device_to_file_va"
26284 #: ../src/guestfs-actions.pod:1385
26288 " guestfs_copy_device_to_file_va (guestfs_h *g,\n"
26289 " const char *src,\n"
26290 " const char *dest,\n"
26291 " va_list args);\n"
26296 #: ../src/guestfs-actions.pod:1391
26297 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_file>."
26301 #: ../src/guestfs-actions.pod:1395
26302 msgid "guestfs_copy_device_to_file_argv"
26306 #: ../src/guestfs-actions.pod:1397
26310 " guestfs_copy_device_to_file_argv (guestfs_h *g,\n"
26311 " const char *src,\n"
26312 " const char *dest,\n"
26313 " const struct guestfs_copy_device_to_file_argv *optargs);\n"
26318 #: ../src/guestfs-actions.pod:1403
26319 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_file>."
26323 #: ../src/guestfs-actions.pod:1407
26324 msgid "guestfs_copy_file_to_device"
26328 #: ../src/guestfs-actions.pod:1409
26332 " guestfs_copy_file_to_device (guestfs_h *g,\n"
26333 " const char *src,\n"
26334 " const char *dest,\n"
26340 #: ../src/guestfs-actions.pod:1420
26343 " GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
26344 " GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
26345 " GUESTFS_COPY_FILE_TO_DEVICE_SIZE, int64_t size,\n"
26350 #: ../src/guestfs-actions.pod:1434
26351 msgid "guestfs_copy_file_to_device_va"
26355 #: ../src/guestfs-actions.pod:1436
26359 " guestfs_copy_file_to_device_va (guestfs_h *g,\n"
26360 " const char *src,\n"
26361 " const char *dest,\n"
26362 " va_list args);\n"
26367 #: ../src/guestfs-actions.pod:1442
26368 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_device>."
26372 #: ../src/guestfs-actions.pod:1446
26373 msgid "guestfs_copy_file_to_device_argv"
26377 #: ../src/guestfs-actions.pod:1448
26381 " guestfs_copy_file_to_device_argv (guestfs_h *g,\n"
26382 " const char *src,\n"
26383 " const char *dest,\n"
26384 " const struct guestfs_copy_file_to_device_argv *optargs);\n"
26389 #: ../src/guestfs-actions.pod:1454
26390 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_device>."
26394 #: ../src/guestfs-actions.pod:1458
26395 msgid "guestfs_copy_file_to_file"
26399 #: ../src/guestfs-actions.pod:1460
26403 " guestfs_copy_file_to_file (guestfs_h *g,\n"
26404 " const char *src,\n"
26405 " const char *dest,\n"
26411 #: ../src/guestfs-actions.pod:1471
26414 " GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
26415 " GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
26416 " GUESTFS_COPY_FILE_TO_FILE_SIZE, int64_t size,\n"
26421 #: ../src/guestfs-actions.pod:1478
26423 "This is B<not> the function you want for copying files. This is for copying "
26424 "blocks within existing files. See C<guestfs_cp>, C<guestfs_cp_a> and "
26425 "C<guestfs_mv> for general file copying and moving functions."
26429 #: ../src/guestfs-actions.pod:1490
26430 msgid "guestfs_copy_file_to_file_va"
26434 #: ../src/guestfs-actions.pod:1492
26438 " guestfs_copy_file_to_file_va (guestfs_h *g,\n"
26439 " const char *src,\n"
26440 " const char *dest,\n"
26441 " va_list args);\n"
26446 #: ../src/guestfs-actions.pod:1498
26447 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_file>."
26451 #: ../src/guestfs-actions.pod:1502
26452 msgid "guestfs_copy_file_to_file_argv"
26456 #: ../src/guestfs-actions.pod:1504
26460 " guestfs_copy_file_to_file_argv (guestfs_h *g,\n"
26461 " const char *src,\n"
26462 " const char *dest,\n"
26463 " const struct guestfs_copy_file_to_file_argv *optargs);\n"
26468 #: ../src/guestfs-actions.pod:1510
26469 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_file>."
26473 #: ../src/guestfs-actions.pod:1514
26474 msgid "guestfs_copy_size"
26478 #: ../src/guestfs-actions.pod:1516
26482 " guestfs_copy_size (guestfs_h *g,\n"
26483 " const char *src,\n"
26484 " const char *dest,\n"
26485 " int64_t size);\n"
26490 #: ../src/guestfs-actions.pod:1522 ../src/guestfs-actions.pod:1579
26492 "I<This function is deprecated.> In new code, use the L</"
26493 "guestfs_copy_device_to_device> call instead."
26497 #: ../src/guestfs-actions.pod:1542 ../src/guestfs-actions.pod:4774
26498 #: ../src/guestfs-actions.pod:6167 ../src/guestfs-actions.pod:7909
26499 #: ../src/guestfs-actions.pod:7929 ../src/guestfs-actions.pod:8015
26500 msgid "(Added in 1.0.87)"
26504 #: ../src/guestfs-actions.pod:1544
26509 #: ../src/guestfs-actions.pod:1546
26513 " guestfs_cp (guestfs_h *g,\n"
26514 " const char *src,\n"
26515 " const char *dest);\n"
26520 #: ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1570
26521 #: ../src/guestfs-actions.pod:1650 ../src/guestfs-actions.pod:1724
26522 #: ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:5518
26523 #: ../src/guestfs-actions.pod:6011
26524 msgid "(Added in 1.0.18)"
26528 #: ../src/guestfs-actions.pod:1558
26529 msgid "guestfs_cp_a"
26533 #: ../src/guestfs-actions.pod:1560
26537 " guestfs_cp_a (guestfs_h *g,\n"
26538 " const char *src,\n"
26539 " const char *dest);\n"
26544 #: ../src/guestfs-actions.pod:1572
26549 #: ../src/guestfs-actions.pod:1574
26553 " guestfs_dd (guestfs_h *g,\n"
26554 " const char *src,\n"
26555 " const char *dest);\n"
26560 #: ../src/guestfs-actions.pod:1591
26562 "If the destination is a device, it must be as large or larger than the "
26563 "source file or device, otherwise the copy will fail. This command cannot do "
26564 "partial copies (see C<guestfs_copy_device_to_device>)."
26568 #: ../src/guestfs-actions.pod:1600
26573 #: ../src/guestfs-actions.pod:1602
26577 " guestfs_df (guestfs_h *g);\n"
26582 #: ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1624
26584 "This command is mostly useful for interactive sessions. It is I<not> "
26585 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
26590 #: ../src/guestfs-actions.pod:1614 ../src/guestfs-actions.pod:1631
26591 #: ../src/guestfs-actions.pod:1749 ../src/guestfs-actions.pod:2756
26592 #: ../src/guestfs-actions.pod:2780 ../src/guestfs-actions.pod:2848
26593 #: ../src/guestfs-actions.pod:4884 ../src/guestfs-actions.pod:5418
26594 #: ../src/guestfs-actions.pod:7412 ../src/guestfs-actions.pod:7436
26595 #: ../src/guestfs-actions.pod:8055 ../src/guestfs-actions.pod:8068
26596 #: ../src/guestfs-actions.pod:8081
26597 msgid "(Added in 1.0.54)"
26601 #: ../src/guestfs-actions.pod:1616
26602 msgid "guestfs_df_h"
26606 #: ../src/guestfs-actions.pod:1618
26610 " guestfs_df_h (guestfs_h *g);\n"
26615 #: ../src/guestfs-actions.pod:1633
26616 msgid "guestfs_dmesg"
26620 #: ../src/guestfs-actions.pod:1635
26624 " guestfs_dmesg (guestfs_h *g);\n"
26629 #: ../src/guestfs-actions.pod:1642
26631 "Another way to get the same information is to enable verbose messages with "
26632 "C<guestfs_set_verbose> or by setting the environment variable "
26633 "C<LIBGUESTFS_DEBUG=1> before running the program."
26637 #: ../src/guestfs-actions.pod:1652
26638 msgid "guestfs_download"
26642 #: ../src/guestfs-actions.pod:1654
26646 " guestfs_download (guestfs_h *g,\n"
26647 " const char *remotefilename,\n"
26648 " const char *filename);\n"
26653 #: ../src/guestfs-actions.pod:1664
26654 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
26658 #: ../src/guestfs-actions.pod:1675
26659 msgid "guestfs_download_offset"
26663 #: ../src/guestfs-actions.pod:1677
26667 " guestfs_download_offset (guestfs_h *g,\n"
26668 " const char *remotefilename,\n"
26669 " const char *filename,\n"
26670 " int64_t offset,\n"
26671 " int64_t size);\n"
26676 #: ../src/guestfs-actions.pod:1690
26678 "Note that there is no limit on the amount of data that can be downloaded "
26679 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
26680 "full amount unless an error occurs."
26684 #: ../src/guestfs-actions.pod:1695
26685 msgid "See also C<guestfs_download>, C<guestfs_pread>."
26689 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:7713
26690 msgid "(Added in 1.5.17)"
26694 #: ../src/guestfs-actions.pod:1706
26695 msgid "guestfs_drop_caches"
26699 #: ../src/guestfs-actions.pod:1708
26703 " guestfs_drop_caches (guestfs_h *g,\n"
26704 " int whattodrop);\n"
26709 #: ../src/guestfs-actions.pod:1726
26714 #: ../src/guestfs-actions.pod:1728
26718 " guestfs_du (guestfs_h *g,\n"
26719 " const char *path);\n"
26724 #: ../src/guestfs-actions.pod:1751
26725 msgid "guestfs_e2fsck_f"
26729 #: ../src/guestfs-actions.pod:1753
26733 " guestfs_e2fsck_f (guestfs_h *g,\n"
26734 " const char *device);\n"
26739 #: ../src/guestfs-actions.pod:1761
26741 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
26742 "Normally you should use C<guestfs_fsck>."
26746 #: ../src/guestfs-actions.pod:1766
26747 msgid "(Added in 1.0.29)"
26751 #: ../src/guestfs-actions.pod:1768
26752 msgid "guestfs_echo_daemon"
26756 #: ../src/guestfs-actions.pod:1770
26760 " guestfs_echo_daemon (guestfs_h *g,\n"
26761 " char *const *words);\n"
26766 #: ../src/guestfs-actions.pod:1779
26767 msgid "See also C<guestfs_ping_daemon>."
26771 #: ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:2542
26772 #: ../src/guestfs-actions.pod:6884
26773 msgid "(Added in 1.0.69)"
26777 #: ../src/guestfs-actions.pod:1786
26778 msgid "guestfs_egrep"
26782 #: ../src/guestfs-actions.pod:1788
26786 " guestfs_egrep (guestfs_h *g,\n"
26787 " const char *regex,\n"
26788 " const char *path);\n"
26793 #: ../src/guestfs-actions.pod:1803 ../src/guestfs-actions.pod:1822
26794 #: ../src/guestfs-actions.pod:1879 ../src/guestfs-actions.pod:1925
26795 #: ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:2672
26796 #: ../src/guestfs-actions.pod:2691 ../src/guestfs-actions.pod:2869
26797 #: ../src/guestfs-actions.pod:2882 ../src/guestfs-actions.pod:2897
26798 #: ../src/guestfs-actions.pod:2943 ../src/guestfs-actions.pod:2965
26799 #: ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:4264
26800 #: ../src/guestfs-actions.pod:4278 ../src/guestfs-actions.pod:4291
26801 #: ../src/guestfs-actions.pod:4305 ../src/guestfs-actions.pod:5306
26802 #: ../src/guestfs-actions.pod:6345 ../src/guestfs-actions.pod:6394
26803 #: ../src/guestfs-actions.pod:7280 ../src/guestfs-actions.pod:7292
26804 #: ../src/guestfs-actions.pod:7305 ../src/guestfs-actions.pod:7318
26805 #: ../src/guestfs-actions.pod:7340 ../src/guestfs-actions.pod:7353
26806 #: ../src/guestfs-actions.pod:7366 ../src/guestfs-actions.pod:7379
26807 #: ../src/guestfs-actions.pod:8173 ../src/guestfs-actions.pod:8192
26808 #: ../src/guestfs-actions.pod:8286 ../src/guestfs-actions.pod:8305
26809 #: ../src/guestfs-actions.pod:8351 ../src/guestfs-actions.pod:8370
26810 msgid "(Added in 1.0.66)"
26814 #: ../src/guestfs-actions.pod:1805
26815 msgid "guestfs_egrepi"
26819 #: ../src/guestfs-actions.pod:1807
26823 " guestfs_egrepi (guestfs_h *g,\n"
26824 " const char *regex,\n"
26825 " const char *path);\n"
26830 #: ../src/guestfs-actions.pod:1824
26831 msgid "guestfs_equal"
26835 #: ../src/guestfs-actions.pod:1826
26839 " guestfs_equal (guestfs_h *g,\n"
26840 " const char *file1,\n"
26841 " const char *file2);\n"
26846 #: ../src/guestfs-actions.pod:1840
26847 msgid "guestfs_exists"
26851 #: ../src/guestfs-actions.pod:1842
26855 " guestfs_exists (guestfs_h *g,\n"
26856 " const char *path);\n"
26861 #: ../src/guestfs-actions.pod:1849
26862 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
26866 #: ../src/guestfs-actions.pod:1855
26867 msgid "guestfs_fallocate"
26871 #: ../src/guestfs-actions.pod:1857
26875 " guestfs_fallocate (guestfs_h *g,\n"
26876 " const char *path,\n"
26882 #: ../src/guestfs-actions.pod:1862
26884 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
26889 #: ../src/guestfs-actions.pod:1881
26890 msgid "guestfs_fallocate64"
26894 #: ../src/guestfs-actions.pod:1883
26898 " guestfs_fallocate64 (guestfs_h *g,\n"
26899 " const char *path,\n"
26905 #: ../src/guestfs-actions.pod:1892
26907 "Note that this call allocates disk blocks for the file. To create a sparse "
26908 "file use C<guestfs_truncate_size> instead."
26912 #: ../src/guestfs-actions.pod:1895
26914 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
26915 "oversight it only allowed 30 bit lengths to be specified, effectively "
26916 "limiting the maximum size of files created through that call to 1GB."
26920 #: ../src/guestfs-actions.pod:1906
26921 msgid "(Added in 1.3.17)"
26925 #: ../src/guestfs-actions.pod:1908
26926 msgid "guestfs_fgrep"
26930 #: ../src/guestfs-actions.pod:1910
26934 " guestfs_fgrep (guestfs_h *g,\n"
26935 " const char *pattern,\n"
26936 " const char *path);\n"
26941 #: ../src/guestfs-actions.pod:1927
26942 msgid "guestfs_fgrepi"
26946 #: ../src/guestfs-actions.pod:1929
26950 " guestfs_fgrepi (guestfs_h *g,\n"
26951 " const char *pattern,\n"
26952 " const char *path);\n"
26957 #: ../src/guestfs-actions.pod:1946
26958 msgid "guestfs_file"
26962 #: ../src/guestfs-actions.pod:1948
26966 " guestfs_file (guestfs_h *g,\n"
26967 " const char *path);\n"
26972 #: ../src/guestfs-actions.pod:1966
26974 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
26975 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
26979 #: ../src/guestfs-actions.pod:1974
26980 msgid "guestfs_file_architecture"
26984 #: ../src/guestfs-actions.pod:1976
26988 " guestfs_file_architecture (guestfs_h *g,\n"
26989 " const char *filename);\n"
26994 #: ../src/guestfs-actions.pod:2084 ../src/guestfs-actions.pod:2247
26995 #: ../src/guestfs-actions.pod:2264 ../src/guestfs-actions.pod:2998
26996 #: ../src/guestfs-actions.pod:3100 ../src/guestfs-actions.pod:3166
26997 #: ../src/guestfs-actions.pod:3353 ../src/guestfs-actions.pod:3371
26998 #: ../src/guestfs-actions.pod:3411 ../src/guestfs-actions.pod:3487
26999 #: ../src/guestfs-actions.pod:3584 ../src/guestfs-actions.pod:3821
27000 #: ../src/guestfs-actions.pod:3953
27001 msgid "(Added in 1.5.3)"
27005 #: ../src/guestfs-actions.pod:2086
27006 msgid "guestfs_filesize"
27010 #: ../src/guestfs-actions.pod:2088
27014 " guestfs_filesize (guestfs_h *g,\n"
27015 " const char *file);\n"
27020 #: ../src/guestfs-actions.pod:2094
27022 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
27023 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
27024 "devices, use C<guestfs_blockdev_getsize64>."
27028 #: ../src/guestfs-actions.pod:2100
27029 msgid "(Added in 1.0.82)"
27033 #: ../src/guestfs-actions.pod:2102
27034 msgid "guestfs_fill"
27038 #: ../src/guestfs-actions.pod:2104
27042 " guestfs_fill (guestfs_h *g,\n"
27045 " const char *path);\n"
27050 #: ../src/guestfs-actions.pod:2114
27052 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
27053 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
27054 "bytes use C<guestfs_fill_pattern>."
27058 #: ../src/guestfs-actions.pod:2126
27059 msgid "(Added in 1.0.79)"
27063 #: ../src/guestfs-actions.pod:2128
27064 msgid "guestfs_fill_pattern"
27068 #: ../src/guestfs-actions.pod:2130
27072 " guestfs_fill_pattern (guestfs_h *g,\n"
27073 " const char *pattern,\n"
27075 " const char *path);\n"
27080 #: ../src/guestfs-actions.pod:2136
27082 "This function is like C<guestfs_fill> except that it creates a new file of "
27083 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
27084 "pattern is truncated if necessary to ensure the length of the file is "
27085 "exactly C<len> bytes."
27089 #: ../src/guestfs-actions.pod:2148
27090 msgid "(Added in 1.3.12)"
27094 #: ../src/guestfs-actions.pod:2150
27095 msgid "guestfs_find"
27099 #: ../src/guestfs-actions.pod:2152
27103 " guestfs_find (guestfs_h *g,\n"
27104 " const char *directory);\n"
27109 #: ../src/guestfs-actions.pod:2168
27111 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
27115 #: ../src/guestfs-actions.pod:2181
27116 msgid "See also C<guestfs_find0>."
27120 #: ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:4711
27121 #: ../src/guestfs-actions.pod:6429
27122 msgid "(Added in 1.0.27)"
27126 #: ../src/guestfs-actions.pod:2192
27127 msgid "guestfs_find0"
27131 #: ../src/guestfs-actions.pod:2194
27135 " guestfs_find0 (guestfs_h *g,\n"
27136 " const char *directory,\n"
27137 " const char *files);\n"
27142 #: ../src/guestfs-actions.pod:2203
27144 "This command works the same way as C<guestfs_find> with the following "
27149 #: ../src/guestfs-actions.pod:2230
27150 msgid "(Added in 1.0.74)"
27154 #: ../src/guestfs-actions.pod:2232
27155 msgid "guestfs_findfs_label"
27159 #: ../src/guestfs-actions.pod:2234
27163 " guestfs_findfs_label (guestfs_h *g,\n"
27164 " const char *label);\n"
27169 #: ../src/guestfs-actions.pod:2242
27170 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
27174 #: ../src/guestfs-actions.pod:2249
27175 msgid "guestfs_findfs_uuid"
27179 #: ../src/guestfs-actions.pod:2251
27183 " guestfs_findfs_uuid (guestfs_h *g,\n"
27184 " const char *uuid);\n"
27189 #: ../src/guestfs-actions.pod:2259
27190 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
27194 #: ../src/guestfs-actions.pod:2266
27195 msgid "guestfs_fsck"
27199 #: ../src/guestfs-actions.pod:2268
27203 " guestfs_fsck (guestfs_h *g,\n"
27204 " const char *fstype,\n"
27205 " const char *device);\n"
27210 #: ../src/guestfs-actions.pod:2303 ../src/guestfs-actions.pod:8220
27211 msgid "(Added in 1.0.16)"
27215 #: ../src/guestfs-actions.pod:2305
27216 msgid "guestfs_get_append"
27220 #: ../src/guestfs-actions.pod:2307
27224 " guestfs_get_append (guestfs_h *g);\n"
27229 #: ../src/guestfs-actions.pod:2315
27231 "This function returns a string which may be NULL. There is no way to return "
27232 "an error from this function. The string is owned by the guest handle and "
27233 "must I<not> be freed."
27237 #: ../src/guestfs-actions.pod:2319 ../src/guestfs-actions.pod:6107
27238 #: ../src/guestfs-actions.pod:6589 ../src/guestfs-actions.pod:7047
27239 #: ../src/guestfs-actions.pod:7066 ../src/guestfs-actions.pod:7082
27240 #: ../src/guestfs-actions.pod:7106 ../src/guestfs-actions.pod:7860
27241 #: ../src/guestfs-actions.pod:7875 ../src/guestfs-actions.pod:8267
27242 msgid "(Added in 1.0.26)"
27246 #: ../src/guestfs-actions.pod:2321
27247 msgid "guestfs_get_attach_method"
27251 #: ../src/guestfs-actions.pod:2323
27255 " guestfs_get_attach_method (guestfs_h *g);\n"
27260 #: ../src/guestfs-actions.pod:2326
27261 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
27265 #: ../src/guestfs-actions.pod:2331 ../src/guestfs-actions.pod:6619
27266 msgid "(Added in 1.9.8)"
27270 #: ../src/guestfs-actions.pod:2333
27271 msgid "guestfs_get_autosync"
27275 #: ../src/guestfs-actions.pod:2335
27279 " guestfs_get_autosync (guestfs_h *g);\n"
27284 #: ../src/guestfs-actions.pod:2344
27285 msgid "guestfs_get_direct"
27289 #: ../src/guestfs-actions.pod:2346
27293 " guestfs_get_direct (guestfs_h *g);\n"
27298 #: ../src/guestfs-actions.pod:2353 ../src/guestfs-actions.pod:6660
27299 msgid "(Added in 1.0.72)"
27303 #: ../src/guestfs-actions.pod:2355
27304 msgid "guestfs_get_e2label"
27308 #: ../src/guestfs-actions.pod:2357
27312 " guestfs_get_e2label (guestfs_h *g,\n"
27313 " const char *device);\n"
27318 #: ../src/guestfs-actions.pod:2361
27320 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
27325 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2395
27326 #: ../src/guestfs-actions.pod:6678 ../src/guestfs-actions.pod:6697
27327 msgid "(Added in 1.0.15)"
27331 #: ../src/guestfs-actions.pod:2376
27332 msgid "guestfs_get_e2uuid"
27336 #: ../src/guestfs-actions.pod:2378
27340 " guestfs_get_e2uuid (guestfs_h *g,\n"
27341 " const char *device);\n"
27346 #: ../src/guestfs-actions.pod:2382
27348 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
27353 #: ../src/guestfs-actions.pod:2397
27354 msgid "guestfs_get_memsize"
27358 #: ../src/guestfs-actions.pod:2399
27362 " guestfs_get_memsize (guestfs_h *g);\n"
27367 #: ../src/guestfs-actions.pod:2405
27369 "If C<guestfs_set_memsize> was not called on this handle, and if "
27370 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
27371 "value for memsize."
27375 #: ../src/guestfs-actions.pod:2414 ../src/guestfs-actions.pod:5002
27376 #: ../src/guestfs-actions.pod:5211 ../src/guestfs-actions.pod:5230
27377 #: ../src/guestfs-actions.pod:5249 ../src/guestfs-actions.pod:5261
27378 #: ../src/guestfs-actions.pod:5278 ../src/guestfs-actions.pod:5291
27379 #: ../src/guestfs-actions.pod:6332 ../src/guestfs-actions.pod:6718
27380 #: ../src/guestfs-actions.pod:7014 ../src/guestfs-actions.pod:7629
27381 msgid "(Added in 1.0.55)"
27385 #: ../src/guestfs-actions.pod:2416
27386 msgid "guestfs_get_network"
27390 #: ../src/guestfs-actions.pod:2418
27394 " guestfs_get_network (guestfs_h *g);\n"
27399 #: ../src/guestfs-actions.pod:2425 ../src/guestfs-actions.pod:6737
27400 msgid "(Added in 1.5.4)"
27404 #: ../src/guestfs-actions.pod:2427
27405 msgid "guestfs_get_path"
27409 #: ../src/guestfs-actions.pod:2429
27413 " guestfs_get_path (guestfs_h *g);\n"
27418 #: ../src/guestfs-actions.pod:2437 ../src/guestfs-actions.pod:2477
27420 "This function returns a string, or NULL on error. The string is owned by "
27421 "the guest handle and must I<not> be freed."
27425 #: ../src/guestfs-actions.pod:2442
27426 msgid "guestfs_get_pgroup"
27430 #: ../src/guestfs-actions.pod:2444
27434 " guestfs_get_pgroup (guestfs_h *g);\n"
27439 #: ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:6773
27440 #: ../src/guestfs-actions.pod:8121
27441 msgid "(Added in 1.11.18)"
27445 #: ../src/guestfs-actions.pod:2453
27446 msgid "guestfs_get_pid"
27450 #: ../src/guestfs-actions.pod:2455
27454 " guestfs_get_pid (guestfs_h *g);\n"
27459 #: ../src/guestfs-actions.pod:2465
27460 msgid "(Added in 1.0.56)"
27464 #: ../src/guestfs-actions.pod:2467
27465 msgid "guestfs_get_qemu"
27469 #: ../src/guestfs-actions.pod:2469
27473 " guestfs_get_qemu (guestfs_h *g);\n"
27478 #: ../src/guestfs-actions.pod:2480 ../src/guestfs-actions.pod:6801
27479 msgid "(Added in 1.0.6)"
27483 #: ../src/guestfs-actions.pod:2482
27484 msgid "guestfs_get_recovery_proc"
27488 #: ../src/guestfs-actions.pod:2484
27492 " guestfs_get_recovery_proc (guestfs_h *g);\n"
27497 #: ../src/guestfs-actions.pod:2491 ../src/guestfs-actions.pod:4075
27498 #: ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4809
27499 #: ../src/guestfs-actions.pod:4841 ../src/guestfs-actions.pod:6037
27500 #: ../src/guestfs-actions.pod:6380 ../src/guestfs-actions.pod:6825
27501 #: ../src/guestfs-actions.pod:7532 ../src/guestfs-actions.pod:7552
27502 #: ../src/guestfs-actions.pod:7744
27503 msgid "(Added in 1.0.77)"
27507 #: ../src/guestfs-actions.pod:2493
27508 msgid "guestfs_get_selinux"
27512 #: ../src/guestfs-actions.pod:2495
27516 " guestfs_get_selinux (guestfs_h *g);\n"
27521 #: ../src/guestfs-actions.pod:2498
27523 "This returns the current setting of the selinux flag which is passed to the "
27524 "appliance at boot time. See C<guestfs_set_selinux>."
27528 #: ../src/guestfs-actions.pod:2506 ../src/guestfs-actions.pod:2580
27529 #: ../src/guestfs-actions.pod:6844 ../src/guestfs-actions.pod:6918
27530 msgid "(Added in 1.0.67)"
27534 #: ../src/guestfs-actions.pod:2508
27535 msgid "guestfs_get_smp"
27539 #: ../src/guestfs-actions.pod:2510
27543 " guestfs_get_smp (guestfs_h *g);\n"
27548 #: ../src/guestfs-actions.pod:2519
27549 msgid "guestfs_get_state"
27553 #: ../src/guestfs-actions.pod:2521
27557 " guestfs_get_state (guestfs_h *g);\n"
27562 #: ../src/guestfs-actions.pod:2533
27563 msgid "guestfs_get_trace"
27567 #: ../src/guestfs-actions.pod:2535
27571 " guestfs_get_trace (guestfs_h *g);\n"
27576 #: ../src/guestfs-actions.pod:2544
27577 msgid "guestfs_get_umask"
27581 #: ../src/guestfs-actions.pod:2546
27585 " guestfs_get_umask (guestfs_h *g);\n"
27590 #: ../src/guestfs-actions.pod:2549
27592 "Return the current umask. By default the umask is C<022> unless it has been "
27593 "set by calling C<guestfs_umask>."
27597 #: ../src/guestfs-actions.pod:2556
27598 msgid "guestfs_get_verbose"
27602 #: ../src/guestfs-actions.pod:2558
27606 " guestfs_get_verbose (guestfs_h *g);\n"
27611 #: ../src/guestfs-actions.pod:2567
27612 msgid "guestfs_getcon"
27616 #: ../src/guestfs-actions.pod:2569
27620 " guestfs_getcon (guestfs_h *g);\n"
27625 #: ../src/guestfs-actions.pod:2574
27627 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
27631 #: ../src/guestfs-actions.pod:2582
27632 msgid "guestfs_getxattr"
27636 #: ../src/guestfs-actions.pod:2584
27640 " guestfs_getxattr (guestfs_h *g,\n"
27641 " const char *path,\n"
27642 " const char *name,\n"
27643 " size_t *size_r);\n"
27648 #: ../src/guestfs-actions.pod:2590
27650 "Get a single extended attribute from file C<path> named C<name>. This call "
27651 "follows symlinks. If you want to lookup an extended attribute for the "
27652 "symlink itself, use C<guestfs_lgetxattr>."
27656 #: ../src/guestfs-actions.pod:2594 ../src/guestfs-actions.pod:4089
27658 "Normally it is better to get all extended attributes from a file in one go "
27659 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
27660 "implementations are buggy and do not provide a way to list out attributes. "
27661 "For these filesystems (notably ntfs-3g) you have to know the names of the "
27662 "extended attributes you want in advance and call this function."
27666 #: ../src/guestfs-actions.pod:2604
27667 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
27671 #: ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2819
27672 #: ../src/guestfs-actions.pod:3301 ../src/guestfs-actions.pod:4101
27673 #: ../src/guestfs-actions.pod:6030 ../src/guestfs-actions.pod:6056
27674 #: ../src/guestfs-actions.pod:6237
27676 "This function returns a buffer, or NULL on error. The size of the returned "
27677 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
27682 #: ../src/guestfs-actions.pod:2610 ../src/guestfs-actions.pod:4105
27683 msgid "(Added in 1.7.24)"
27687 #: ../src/guestfs-actions.pod:2612
27688 msgid "guestfs_getxattrs"
27692 #: ../src/guestfs-actions.pod:2614
27695 " struct guestfs_xattr_list *\n"
27696 " guestfs_getxattrs (guestfs_h *g,\n"
27697 " const char *path);\n"
27702 #: ../src/guestfs-actions.pod:2624
27703 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
27707 #: ../src/guestfs-actions.pod:2626 ../src/guestfs-actions.pod:4117
27708 #: ../src/guestfs-actions.pod:4805
27710 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
27711 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
27715 #: ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:4121
27716 #: ../src/guestfs-actions.pod:4320 ../src/guestfs-actions.pod:4356
27717 #: ../src/guestfs-actions.pod:6410 ../src/guestfs-actions.pod:6937
27718 #: ../src/guestfs-actions.pod:8332
27719 msgid "(Added in 1.0.59)"
27723 #: ../src/guestfs-actions.pod:2632
27724 msgid "guestfs_glob_expand"
27728 #: ../src/guestfs-actions.pod:2634
27732 " guestfs_glob_expand (guestfs_h *g,\n"
27733 " const char *pattern);\n"
27738 #: ../src/guestfs-actions.pod:2653 ../src/guestfs-actions.pod:7130
27739 #: ../src/guestfs-actions.pod:7147
27740 msgid "(Added in 1.0.50)"
27744 #: ../src/guestfs-actions.pod:2655
27745 msgid "guestfs_grep"
27749 #: ../src/guestfs-actions.pod:2657
27753 " guestfs_grep (guestfs_h *g,\n"
27754 " const char *regex,\n"
27755 " const char *path);\n"
27760 #: ../src/guestfs-actions.pod:2674
27761 msgid "guestfs_grepi"
27765 #: ../src/guestfs-actions.pod:2676
27769 " guestfs_grepi (guestfs_h *g,\n"
27770 " const char *regex,\n"
27771 " const char *path);\n"
27776 #: ../src/guestfs-actions.pod:2693
27777 msgid "guestfs_grub_install"
27781 #: ../src/guestfs-actions.pod:2695
27785 " guestfs_grub_install (guestfs_h *g,\n"
27786 " const char *root,\n"
27787 " const char *device);\n"
27792 #: ../src/guestfs-actions.pod:2738
27793 msgid "(Added in 1.0.17)"
27797 #: ../src/guestfs-actions.pod:2740
27798 msgid "guestfs_head"
27802 #: ../src/guestfs-actions.pod:2742
27806 " guestfs_head (guestfs_h *g,\n"
27807 " const char *path);\n"
27812 #: ../src/guestfs-actions.pod:2758
27813 msgid "guestfs_head_n"
27817 #: ../src/guestfs-actions.pod:2760
27821 " guestfs_head_n (guestfs_h *g,\n"
27823 " const char *path);\n"
27828 #: ../src/guestfs-actions.pod:2782
27829 msgid "guestfs_hexdump"
27833 #: ../src/guestfs-actions.pod:2784
27837 " guestfs_hexdump (guestfs_h *g,\n"
27838 " const char *path);\n"
27843 #: ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:7211
27844 #: ../src/guestfs-actions.pod:7266
27845 msgid "(Added in 1.0.22)"
27849 #: ../src/guestfs-actions.pod:2799
27850 msgid "guestfs_initrd_cat"
27854 #: ../src/guestfs-actions.pod:2801
27858 " guestfs_initrd_cat (guestfs_h *g,\n"
27859 " const char *initrdpath,\n"
27860 " const char *filename,\n"
27861 " size_t *size_r);\n"
27866 #: ../src/guestfs-actions.pod:2817
27867 msgid "See also C<guestfs_initrd_list>."
27871 #: ../src/guestfs-actions.pod:2828
27872 msgid "guestfs_initrd_list"
27876 #: ../src/guestfs-actions.pod:2830
27880 " guestfs_initrd_list (guestfs_h *g,\n"
27881 " const char *path);\n"
27886 #: ../src/guestfs-actions.pod:2850
27887 msgid "guestfs_inotify_add_watch"
27891 #: ../src/guestfs-actions.pod:2852
27895 " guestfs_inotify_add_watch (guestfs_h *g,\n"
27896 " const char *path,\n"
27902 #: ../src/guestfs-actions.pod:2871
27903 msgid "guestfs_inotify_close"
27907 #: ../src/guestfs-actions.pod:2873
27911 " guestfs_inotify_close (guestfs_h *g);\n"
27916 #: ../src/guestfs-actions.pod:2884
27917 msgid "guestfs_inotify_files"
27921 #: ../src/guestfs-actions.pod:2886
27925 " guestfs_inotify_files (guestfs_h *g);\n"
27930 #: ../src/guestfs-actions.pod:2889
27932 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
27933 "returns a list of pathnames of objects that were touched. The returned "
27934 "pathnames are sorted and deduplicated."
27938 #: ../src/guestfs-actions.pod:2899
27939 msgid "guestfs_inotify_init"
27943 #: ../src/guestfs-actions.pod:2901
27947 " guestfs_inotify_init (guestfs_h *g,\n"
27948 " int maxevents);\n"
27953 #: ../src/guestfs-actions.pod:2909
27955 "C<maxevents> is the maximum number of events which will be queued up between "
27956 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
27957 "passed as C<0>, then the kernel (or previously set) default is used. For "
27958 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
27959 "throws away events, but records the fact that it threw them away by setting "
27960 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
27961 "C<guestfs_inotify_read>)."
27965 #: ../src/guestfs-actions.pod:2919
27967 "Before any events are generated, you have to add some watches to the "
27968 "internal watch list. See: C<guestfs_inotify_add_watch>, "
27969 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
27973 #: ../src/guestfs-actions.pod:2925
27975 "Queued up events should be read periodically by calling "
27976 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
27977 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
27978 "often enough then you risk the internal queue overflowing."
27982 #: ../src/guestfs-actions.pod:2932
27984 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
27985 "This also removes any watches automatically."
27989 #: ../src/guestfs-actions.pod:2945
27990 msgid "guestfs_inotify_read"
27994 #: ../src/guestfs-actions.pod:2947
27997 " struct guestfs_inotify_event_list *\n"
27998 " guestfs_inotify_read (guestfs_h *g);\n"
28003 #: ../src/guestfs-actions.pod:2961
28005 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
28006 "there was an error. I<The caller must call "
28007 "C<guestfs_free_inotify_event_list> after use>."
28011 #: ../src/guestfs-actions.pod:2967
28012 msgid "guestfs_inotify_rm_watch"
28016 #: ../src/guestfs-actions.pod:2969
28020 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
28026 #: ../src/guestfs-actions.pod:2973
28028 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
28032 #: ../src/guestfs-actions.pod:2980
28033 msgid "guestfs_inspect_get_arch"
28037 #: ../src/guestfs-actions.pod:2982
28041 " guestfs_inspect_get_arch (guestfs_h *g,\n"
28042 " const char *root);\n"
28047 #: ../src/guestfs-actions.pod:2986
28049 "This returns the architecture of the inspected operating system. The "
28050 "possible return values are listed under C<guestfs_file_architecture>."
28054 #: ../src/guestfs-actions.pod:3000
28055 msgid "guestfs_inspect_get_distro"
28059 #: ../src/guestfs-actions.pod:3002
28063 " guestfs_inspect_get_distro (guestfs_h *g,\n"
28064 " const char *root);\n"
28069 #: ../src/guestfs-actions.pod:3102
28070 msgid "guestfs_inspect_get_drive_mappings"
28074 #: ../src/guestfs-actions.pod:3104
28078 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
28079 " const char *root);\n"
28084 #: ../src/guestfs-actions.pod:3133
28086 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28087 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
28091 #: ../src/guestfs-actions.pod:3137 ../src/guestfs-actions.pod:3405
28092 #: ../src/guestfs-actions.pod:4208 ../src/guestfs-actions.pod:5480
28093 #: ../src/guestfs-actions.pod:7568
28095 "This function returns a NULL-terminated array of strings, or NULL if there "
28096 "was an error. The array of strings will always have length C<2n+1>, where "
28097 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
28098 "caller must free the strings and the array after use>."
28102 #: ../src/guestfs-actions.pod:3143 ../src/guestfs-actions.pod:3604
28103 msgid "(Added in 1.9.17)"
28107 #: ../src/guestfs-actions.pod:3145
28108 msgid "guestfs_inspect_get_filesystems"
28112 #: ../src/guestfs-actions.pod:3147
28116 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
28117 " const char *root);\n"
28122 #: ../src/guestfs-actions.pod:3159
28124 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28125 "C<guestfs_inspect_get_mountpoints>."
28129 #: ../src/guestfs-actions.pod:3168
28130 msgid "guestfs_inspect_get_format"
28134 #: ../src/guestfs-actions.pod:3170
28138 " guestfs_inspect_get_format (guestfs_h *g,\n"
28139 " const char *root);\n"
28144 #: ../src/guestfs-actions.pod:3204 ../src/guestfs-actions.pod:3640
28145 #: ../src/guestfs-actions.pod:3656 ../src/guestfs-actions.pod:3674
28146 #: ../src/guestfs-actions.pod:6448
28147 msgid "(Added in 1.9.4)"
28151 #: ../src/guestfs-actions.pod:3206
28152 msgid "guestfs_inspect_get_hostname"
28156 #: ../src/guestfs-actions.pod:3208
28160 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
28161 " const char *root);\n"
28166 #: ../src/guestfs-actions.pod:3223
28167 msgid "(Added in 1.7.9)"
28171 #: ../src/guestfs-actions.pod:3225
28172 msgid "guestfs_inspect_get_icon"
28176 #: ../src/guestfs-actions.pod:3227
28180 " guestfs_inspect_get_icon (guestfs_h *g,\n"
28181 " const char *root,\n"
28182 " size_t *size_r,\n"
28188 #: ../src/guestfs-actions.pod:3238
28191 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
28192 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
28197 #: ../src/guestfs-actions.pod:3305 ../src/guestfs-actions.pod:4135
28198 #: ../src/guestfs-actions.pod:5379
28199 msgid "(Added in 1.11.12)"
28203 #: ../src/guestfs-actions.pod:3307
28204 msgid "guestfs_inspect_get_icon_va"
28208 #: ../src/guestfs-actions.pod:3309
28212 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
28213 " const char *root,\n"
28214 " size_t *size_r,\n"
28215 " va_list args);\n"
28220 #: ../src/guestfs-actions.pod:3315
28221 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
28225 #: ../src/guestfs-actions.pod:3319
28226 msgid "guestfs_inspect_get_icon_argv"
28230 #: ../src/guestfs-actions.pod:3321
28234 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
28235 " const char *root,\n"
28236 " size_t *size_r,\n"
28237 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
28242 #: ../src/guestfs-actions.pod:3327
28243 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
28247 #: ../src/guestfs-actions.pod:3331
28248 msgid "guestfs_inspect_get_major_version"
28252 #: ../src/guestfs-actions.pod:3333
28256 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
28257 " const char *root);\n"
28262 #: ../src/guestfs-actions.pod:3355
28263 msgid "guestfs_inspect_get_minor_version"
28267 #: ../src/guestfs-actions.pod:3357
28271 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
28272 " const char *root);\n"
28277 #: ../src/guestfs-actions.pod:3366
28279 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28280 "C<guestfs_inspect_get_major_version>."
28284 #: ../src/guestfs-actions.pod:3373
28285 msgid "guestfs_inspect_get_mountpoints"
28289 #: ../src/guestfs-actions.pod:3375
28293 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
28294 " const char *root);\n"
28299 #: ../src/guestfs-actions.pod:3396
28301 "For operating systems like Windows which still use drive letters, this call "
28302 "will only return an entry for the first drive \"mounted on\" C</>. For "
28303 "information about the mapping of drive letters to partitions, see "
28304 "C<guestfs_inspect_get_drive_mappings>."
28308 #: ../src/guestfs-actions.pod:3402
28310 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28311 "C<guestfs_inspect_get_filesystems>."
28315 #: ../src/guestfs-actions.pod:3413
28316 msgid "guestfs_inspect_get_package_format"
28320 #: ../src/guestfs-actions.pod:3415
28324 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
28325 " const char *root);\n"
28330 #: ../src/guestfs-actions.pod:3419
28332 "This function and C<guestfs_inspect_get_package_management> return the "
28333 "package format and package management tool used by the inspected operating "
28334 "system. For example for Fedora these functions would return C<rpm> (package "
28335 "format) and C<yum> (package management)."
28339 #: ../src/guestfs-actions.pod:3438 ../src/guestfs-actions.pod:3466
28340 msgid "(Added in 1.7.5)"
28344 #: ../src/guestfs-actions.pod:3440
28345 msgid "guestfs_inspect_get_package_management"
28349 #: ../src/guestfs-actions.pod:3442
28353 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
28354 " const char *root);\n"
28359 #: ../src/guestfs-actions.pod:3446
28361 "C<guestfs_inspect_get_package_format> and this function return the package "
28362 "format and package management tool used by the inspected operating system. "
28363 "For example for Fedora these functions would return C<rpm> (package format) "
28364 "and C<yum> (package management)."
28368 #: ../src/guestfs-actions.pod:3468
28369 msgid "guestfs_inspect_get_product_name"
28373 #: ../src/guestfs-actions.pod:3470
28377 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
28378 " const char *root);\n"
28383 #: ../src/guestfs-actions.pod:3489
28384 msgid "guestfs_inspect_get_product_variant"
28388 #: ../src/guestfs-actions.pod:3491
28392 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
28393 " const char *root);\n"
28398 #: ../src/guestfs-actions.pod:3514
28400 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28401 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
28405 #: ../src/guestfs-actions.pod:3521
28406 msgid "(Added in 1.9.13)"
28410 #: ../src/guestfs-actions.pod:3523
28411 msgid "guestfs_inspect_get_roots"
28415 #: ../src/guestfs-actions.pod:3525
28419 " guestfs_inspect_get_roots (guestfs_h *g);\n"
28424 #: ../src/guestfs-actions.pod:3528
28426 "This function is a convenient way to get the list of root devices, as "
28427 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
28428 "the whole inspection process."
28432 #: ../src/guestfs-actions.pod:3532
28434 "This returns an empty list if either no root devices were found or the "
28435 "caller has not called C<guestfs_inspect_os>."
28439 #: ../src/guestfs-actions.pod:3541
28440 msgid "(Added in 1.7.3)"
28444 #: ../src/guestfs-actions.pod:3543
28445 msgid "guestfs_inspect_get_type"
28449 #: ../src/guestfs-actions.pod:3545
28453 " guestfs_inspect_get_type (guestfs_h *g,\n"
28454 " const char *root);\n"
28459 #: ../src/guestfs-actions.pod:3586
28460 msgid "guestfs_inspect_get_windows_current_control_set"
28464 #: ../src/guestfs-actions.pod:3588
28468 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
28469 " const char *root);\n"
28474 #: ../src/guestfs-actions.pod:3606
28475 msgid "guestfs_inspect_get_windows_systemroot"
28479 #: ../src/guestfs-actions.pod:3608
28483 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
28484 " const char *root);\n"
28489 #: ../src/guestfs-actions.pod:3624
28490 msgid "(Added in 1.5.25)"
28494 #: ../src/guestfs-actions.pod:3626
28495 msgid "guestfs_inspect_is_live"
28499 #: ../src/guestfs-actions.pod:3628
28503 " guestfs_inspect_is_live (guestfs_h *g,\n"
28504 " const char *root);\n"
28509 #: ../src/guestfs-actions.pod:3632
28511 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
28512 "disk), then this returns true if a live image was detected on the disk."
28516 #: ../src/guestfs-actions.pod:3642
28517 msgid "guestfs_inspect_is_multipart"
28521 #: ../src/guestfs-actions.pod:3644
28525 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
28526 " const char *root);\n"
28531 #: ../src/guestfs-actions.pod:3648
28533 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
28534 "disk), then this returns true if the disk is part of a set."
28538 #: ../src/guestfs-actions.pod:3658
28539 msgid "guestfs_inspect_is_netinst"
28543 #: ../src/guestfs-actions.pod:3660
28547 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
28548 " const char *root);\n"
28553 #: ../src/guestfs-actions.pod:3664
28555 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
28556 "disk), then this returns true if the disk is a network installer, ie. not a "
28557 "self-contained install CD but one which is likely to require network access "
28558 "to complete the install."
28562 #: ../src/guestfs-actions.pod:3676
28563 msgid "guestfs_inspect_list_applications"
28567 #: ../src/guestfs-actions.pod:3678
28570 " struct guestfs_application_list *\n"
28571 " guestfs_inspect_list_applications (guestfs_h *g,\n"
28572 " const char *root);\n"
28577 #: ../src/guestfs-actions.pod:3684
28579 "I<Note:> This call works differently from other parts of the inspection "
28580 "API. You have to call C<guestfs_inspect_os>, then "
28581 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
28582 "this. Listing applications is a significantly more difficult operation "
28583 "which requires access to the full filesystem. Also note that unlike the "
28584 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
28585 "the libguestfs handle, this call actually reads parts of the mounted "
28586 "filesystems during the call."
28590 #: ../src/guestfs-actions.pod:3774
28592 "This function returns a C<struct guestfs_application_list *>, or NULL if "
28593 "there was an error. I<The caller must call C<guestfs_free_application_list> "
28598 #: ../src/guestfs-actions.pod:3778
28599 msgid "(Added in 1.7.8)"
28603 #: ../src/guestfs-actions.pod:3780
28604 msgid "guestfs_inspect_os"
28608 #: ../src/guestfs-actions.pod:3782
28612 " guestfs_inspect_os (guestfs_h *g);\n"
28617 #: ../src/guestfs-actions.pod:3798
28619 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
28620 "functions in order to query further information about each operating system, "
28621 "such as the name and version."
28625 #: ../src/guestfs-actions.pod:3803
28627 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
28628 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
28629 "the contents. This should be called with no disks currently mounted. The "
28630 "function may also use Augeas, so any existing Augeas handle will be closed."
28634 #: ../src/guestfs-actions.pod:3815 ../src/guestfs-actions.pod:4146
28635 #: ../src/guestfs-actions.pod:4228
28636 msgid "See also C<guestfs_list_filesystems>."
28640 #: ../src/guestfs-actions.pod:3823
28641 msgid "guestfs_is_blockdev"
28645 #: ../src/guestfs-actions.pod:3825
28649 " guestfs_is_blockdev (guestfs_h *g,\n"
28650 " const char *path);\n"
28655 #: ../src/guestfs-actions.pod:3832 ../src/guestfs-actions.pod:3861
28656 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3906
28657 #: ../src/guestfs-actions.pod:3922 ../src/guestfs-actions.pod:3978
28658 #: ../src/guestfs-actions.pod:3993
28659 msgid "See also C<guestfs_stat>."
28663 #: ../src/guestfs-actions.pod:3836 ../src/guestfs-actions.pod:3865
28664 #: ../src/guestfs-actions.pod:3910 ../src/guestfs-actions.pod:3982
28665 #: ../src/guestfs-actions.pod:3997
28666 msgid "(Added in 1.5.10)"
28670 #: ../src/guestfs-actions.pod:3838
28671 msgid "guestfs_is_busy"
28675 #: ../src/guestfs-actions.pod:3840
28679 " guestfs_is_busy (guestfs_h *g);\n"
28684 #: ../src/guestfs-actions.pod:3852
28685 msgid "guestfs_is_chardev"
28689 #: ../src/guestfs-actions.pod:3854
28693 " guestfs_is_chardev (guestfs_h *g,\n"
28694 " const char *path);\n"
28699 #: ../src/guestfs-actions.pod:3867
28700 msgid "guestfs_is_config"
28704 #: ../src/guestfs-actions.pod:3869
28708 " guestfs_is_config (guestfs_h *g);\n"
28713 #: ../src/guestfs-actions.pod:3881
28714 msgid "guestfs_is_dir"
28718 #: ../src/guestfs-actions.pod:3883
28722 " guestfs_is_dir (guestfs_h *g,\n"
28723 " const char *path);\n"
28728 #: ../src/guestfs-actions.pod:3897
28729 msgid "guestfs_is_fifo"
28733 #: ../src/guestfs-actions.pod:3899
28737 " guestfs_is_fifo (guestfs_h *g,\n"
28738 " const char *path);\n"
28743 #: ../src/guestfs-actions.pod:3912
28744 msgid "guestfs_is_file"
28748 #: ../src/guestfs-actions.pod:3914
28752 " guestfs_is_file (guestfs_h *g,\n"
28753 " const char *path);\n"
28758 #: ../src/guestfs-actions.pod:3928
28759 msgid "guestfs_is_launching"
28763 #: ../src/guestfs-actions.pod:3930
28767 " guestfs_is_launching (guestfs_h *g);\n"
28772 #: ../src/guestfs-actions.pod:3942
28773 msgid "guestfs_is_lv"
28777 #: ../src/guestfs-actions.pod:3944
28781 " guestfs_is_lv (guestfs_h *g,\n"
28782 " const char *device);\n"
28787 #: ../src/guestfs-actions.pod:3955
28788 msgid "guestfs_is_ready"
28792 #: ../src/guestfs-actions.pod:3957
28796 " guestfs_is_ready (guestfs_h *g);\n"
28801 #: ../src/guestfs-actions.pod:3969
28802 msgid "guestfs_is_socket"
28806 #: ../src/guestfs-actions.pod:3971
28810 " guestfs_is_socket (guestfs_h *g,\n"
28811 " const char *path);\n"
28816 #: ../src/guestfs-actions.pod:3984
28817 msgid "guestfs_is_symlink"
28821 #: ../src/guestfs-actions.pod:3986
28825 " guestfs_is_symlink (guestfs_h *g,\n"
28826 " const char *path);\n"
28831 #: ../src/guestfs-actions.pod:3999
28832 msgid "guestfs_is_zero"
28836 #: ../src/guestfs-actions.pod:4001
28840 " guestfs_is_zero (guestfs_h *g,\n"
28841 " const char *path);\n"
28846 #: ../src/guestfs-actions.pod:4010 ../src/guestfs-actions.pod:4024
28847 msgid "(Added in 1.11.8)"
28851 #: ../src/guestfs-actions.pod:4012
28852 msgid "guestfs_is_zero_device"
28856 #: ../src/guestfs-actions.pod:4014
28860 " guestfs_is_zero_device (guestfs_h *g,\n"
28861 " const char *device);\n"
28866 #: ../src/guestfs-actions.pod:4026
28867 msgid "guestfs_kill_subprocess"
28871 #: ../src/guestfs-actions.pod:4028
28875 " guestfs_kill_subprocess (guestfs_h *g);\n"
28880 #: ../src/guestfs-actions.pod:4037
28881 msgid "guestfs_launch"
28885 #: ../src/guestfs-actions.pod:4039
28889 " guestfs_launch (guestfs_h *g);\n"
28894 #: ../src/guestfs-actions.pod:4057
28895 msgid "guestfs_lchown"
28899 #: ../src/guestfs-actions.pod:4059
28903 " guestfs_lchown (guestfs_h *g,\n"
28906 " const char *path);\n"
28911 #: ../src/guestfs-actions.pod:4065
28913 "Change the file owner to C<owner> and group to C<group>. This is like "
28914 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
28915 "changed, not the target."
28919 #: ../src/guestfs-actions.pod:4077
28920 msgid "guestfs_lgetxattr"
28924 #: ../src/guestfs-actions.pod:4079
28928 " guestfs_lgetxattr (guestfs_h *g,\n"
28929 " const char *path,\n"
28930 " const char *name,\n"
28931 " size_t *size_r);\n"
28936 #: ../src/guestfs-actions.pod:4099
28937 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
28941 #: ../src/guestfs-actions.pod:4107
28942 msgid "guestfs_lgetxattrs"
28946 #: ../src/guestfs-actions.pod:4109
28949 " struct guestfs_xattr_list *\n"
28950 " guestfs_lgetxattrs (guestfs_h *g,\n"
28951 " const char *path);\n"
28956 #: ../src/guestfs-actions.pod:4113
28958 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
28959 "then it returns the extended attributes of the link itself."
28963 #: ../src/guestfs-actions.pod:4123
28964 msgid "guestfs_list_9p"
28968 #: ../src/guestfs-actions.pod:4125
28972 " guestfs_list_9p (guestfs_h *g);\n"
28977 #: ../src/guestfs-actions.pod:4137
28978 msgid "guestfs_list_devices"
28982 #: ../src/guestfs-actions.pod:4139
28986 " guestfs_list_devices (guestfs_h *g);\n"
28991 #: ../src/guestfs-actions.pod:4154
28992 msgid "guestfs_list_dm_devices"
28996 #: ../src/guestfs-actions.pod:4156
29000 " guestfs_list_dm_devices (guestfs_h *g);\n"
29005 #: ../src/guestfs-actions.pod:4161
29007 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
29008 "previous call to C<guestfs_luks_open>."
29012 #: ../src/guestfs-actions.pod:4164
29014 "Device mapper devices which correspond to logical volumes are I<not> "
29015 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
29020 #: ../src/guestfs-actions.pod:4172 ../src/guestfs-actions.pod:5618
29021 msgid "(Added in 1.11.15)"
29025 #: ../src/guestfs-actions.pod:4174
29026 msgid "guestfs_list_filesystems"
29030 #: ../src/guestfs-actions.pod:4176
29034 " guestfs_list_filesystems (guestfs_h *g);\n"
29039 #: ../src/guestfs-actions.pod:4196
29041 "This command runs other libguestfs commands, which might include "
29042 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
29043 "soon after launch and only when nothing is mounted."
29047 #: ../src/guestfs-actions.pod:4200
29049 "Not all of the filesystems returned will be mountable. In particular, swap "
29050 "partitions are returned in the list. Also this command does not check that "
29051 "each filesystem found is valid and mountable, and some filesystems might be "
29052 "mountable but require special options. Filesystems may not all belong to a "
29053 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
29057 #: ../src/guestfs-actions.pod:4214 ../src/guestfs-actions.pod:5981
29058 msgid "(Added in 1.5.15)"
29062 #: ../src/guestfs-actions.pod:4216
29063 msgid "guestfs_list_partitions"
29067 #: ../src/guestfs-actions.pod:4218
29071 " guestfs_list_partitions (guestfs_h *g);\n"
29076 #: ../src/guestfs-actions.pod:4225
29078 "This does not return logical volumes. For that you will need to call "
29083 #: ../src/guestfs-actions.pod:4236
29088 #: ../src/guestfs-actions.pod:4238
29092 " guestfs_ll (guestfs_h *g,\n"
29093 " const char *directory);\n"
29098 #: ../src/guestfs-actions.pod:4253
29103 #: ../src/guestfs-actions.pod:4255
29107 " guestfs_ln (guestfs_h *g,\n"
29108 " const char *target,\n"
29109 " const char *linkname);\n"
29114 #: ../src/guestfs-actions.pod:4266
29115 msgid "guestfs_ln_f"
29119 #: ../src/guestfs-actions.pod:4268
29123 " guestfs_ln_f (guestfs_h *g,\n"
29124 " const char *target,\n"
29125 " const char *linkname);\n"
29130 #: ../src/guestfs-actions.pod:4280
29131 msgid "guestfs_ln_s"
29135 #: ../src/guestfs-actions.pod:4282
29139 " guestfs_ln_s (guestfs_h *g,\n"
29140 " const char *target,\n"
29141 " const char *linkname);\n"
29146 #: ../src/guestfs-actions.pod:4293
29147 msgid "guestfs_ln_sf"
29151 #: ../src/guestfs-actions.pod:4295
29155 " guestfs_ln_sf (guestfs_h *g,\n"
29156 " const char *target,\n"
29157 " const char *linkname);\n"
29162 #: ../src/guestfs-actions.pod:4307
29163 msgid "guestfs_lremovexattr"
29167 #: ../src/guestfs-actions.pod:4309
29171 " guestfs_lremovexattr (guestfs_h *g,\n"
29172 " const char *xattr,\n"
29173 " const char *path);\n"
29178 #: ../src/guestfs-actions.pod:4314
29180 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
29181 "link, then it removes an extended attribute of the link itself."
29185 #: ../src/guestfs-actions.pod:4322
29190 #: ../src/guestfs-actions.pod:4324
29194 " guestfs_ls (guestfs_h *g,\n"
29195 " const char *directory);\n"
29200 #: ../src/guestfs-actions.pod:4332
29202 "This command is mostly useful for interactive sessions. Programs should "
29203 "probably use C<guestfs_readdir> instead."
29207 #: ../src/guestfs-actions.pod:4341
29208 msgid "guestfs_lsetxattr"
29212 #: ../src/guestfs-actions.pod:4343
29216 " guestfs_lsetxattr (guestfs_h *g,\n"
29217 " const char *xattr,\n"
29218 " const char *val,\n"
29220 " const char *path);\n"
29225 #: ../src/guestfs-actions.pod:4350
29227 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
29228 "then it sets an extended attribute of the link itself."
29232 #: ../src/guestfs-actions.pod:4358
29233 msgid "guestfs_lstat"
29237 #: ../src/guestfs-actions.pod:4360
29240 " struct guestfs_stat *\n"
29241 " guestfs_lstat (guestfs_h *g,\n"
29242 " const char *path);\n"
29247 #: ../src/guestfs-actions.pod:4366
29249 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
29250 "link, then the link is stat-ed, not the file it refers to."
29254 #: ../src/guestfs-actions.pod:4372 ../src/guestfs-actions.pod:7171
29256 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
29257 "error. I<The caller must call C<guestfs_free_stat> after use>."
29261 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:7175
29262 #: ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7574
29263 msgid "(Added in 0.9.2)"
29267 #: ../src/guestfs-actions.pod:4378
29268 msgid "guestfs_lstatlist"
29272 #: ../src/guestfs-actions.pod:4380
29275 " struct guestfs_stat_list *\n"
29276 " guestfs_lstatlist (guestfs_h *g,\n"
29277 " const char *path,\n"
29278 " char *const *names);\n"
29283 #: ../src/guestfs-actions.pod:4385
29285 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
29286 "files, where all files are in the directory C<path>. C<names> is the list "
29287 "of files from this directory."
29291 #: ../src/guestfs-actions.pod:4394
29293 "This call is intended for programs that want to efficiently list a directory "
29294 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
29295 "for a similarly efficient call for getting extended attributes. Very long "
29296 "directory listings might cause the protocol message size to be exceeded, "
29297 "causing this call to fail. The caller must split up such requests into "
29298 "smaller groups of names."
29302 #: ../src/guestfs-actions.pod:4402
29304 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
29305 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
29309 #: ../src/guestfs-actions.pod:4408
29310 msgid "guestfs_luks_add_key"
29314 #: ../src/guestfs-actions.pod:4410
29318 " guestfs_luks_add_key (guestfs_h *g,\n"
29319 " const char *device,\n"
29320 " const char *key,\n"
29321 " const char *newkey,\n"
29327 #: ../src/guestfs-actions.pod:4422
29329 "Note that if C<keyslot> already contains a key, then this command will "
29330 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
29334 #: ../src/guestfs-actions.pod:4428 ../src/guestfs-actions.pod:4468
29335 #: ../src/guestfs-actions.pod:4491 ../src/guestfs-actions.pod:4511
29336 #: ../src/guestfs-actions.pod:4546 ../src/guestfs-actions.pod:4565
29338 "This function takes a key or passphrase parameter which could contain "
29339 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
29344 #: ../src/guestfs-actions.pod:4432 ../src/guestfs-actions.pod:4472
29345 #: ../src/guestfs-actions.pod:4495 ../src/guestfs-actions.pod:4515
29346 msgid "(Added in 1.5.2)"
29350 #: ../src/guestfs-actions.pod:4434
29351 msgid "guestfs_luks_close"
29355 #: ../src/guestfs-actions.pod:4436
29359 " guestfs_luks_close (guestfs_h *g,\n"
29360 " const char *device);\n"
29365 #: ../src/guestfs-actions.pod:4440
29367 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
29368 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
29369 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
29370 "underlying block device."
29374 #: ../src/guestfs-actions.pod:4448 ../src/guestfs-actions.pod:4550
29375 #: ../src/guestfs-actions.pod:4569 ../src/guestfs-actions.pod:4619
29376 #: ../src/guestfs-actions.pod:4667
29377 msgid "(Added in 1.5.1)"
29381 #: ../src/guestfs-actions.pod:4450
29382 msgid "guestfs_luks_format"
29386 #: ../src/guestfs-actions.pod:4452
29390 " guestfs_luks_format (guestfs_h *g,\n"
29391 " const char *device,\n"
29392 " const char *key,\n"
29398 #: ../src/guestfs-actions.pod:4474
29399 msgid "guestfs_luks_format_cipher"
29403 #: ../src/guestfs-actions.pod:4476
29407 " guestfs_luks_format_cipher (guestfs_h *g,\n"
29408 " const char *device,\n"
29409 " const char *key,\n"
29411 " const char *cipher);\n"
29416 #: ../src/guestfs-actions.pod:4483
29418 "This command is the same as C<guestfs_luks_format> but it also allows you to "
29419 "set the C<cipher> used."
29423 #: ../src/guestfs-actions.pod:4497
29424 msgid "guestfs_luks_kill_slot"
29428 #: ../src/guestfs-actions.pod:4499
29432 " guestfs_luks_kill_slot (guestfs_h *g,\n"
29433 " const char *device,\n"
29434 " const char *key,\n"
29440 #: ../src/guestfs-actions.pod:4517
29441 msgid "guestfs_luks_open"
29445 #: ../src/guestfs-actions.pod:4519
29449 " guestfs_luks_open (guestfs_h *g,\n"
29450 " const char *device,\n"
29451 " const char *key,\n"
29452 " const char *mapname);\n"
29457 #: ../src/guestfs-actions.pod:4537
29459 "If this block device contains LVM volume groups, then calling "
29460 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
29465 #: ../src/guestfs-actions.pod:4541
29466 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
29470 #: ../src/guestfs-actions.pod:4552
29471 msgid "guestfs_luks_open_ro"
29475 #: ../src/guestfs-actions.pod:4554
29479 " guestfs_luks_open_ro (guestfs_h *g,\n"
29480 " const char *device,\n"
29481 " const char *key,\n"
29482 " const char *mapname);\n"
29487 #: ../src/guestfs-actions.pod:4560
29489 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
29494 #: ../src/guestfs-actions.pod:4571
29495 msgid "guestfs_lvcreate"
29499 #: ../src/guestfs-actions.pod:4573
29503 " guestfs_lvcreate (guestfs_h *g,\n"
29504 " const char *logvol,\n"
29505 " const char *volgroup,\n"
29511 #: ../src/guestfs-actions.pod:4586
29512 msgid "guestfs_lvm_canonical_lv_name"
29516 #: ../src/guestfs-actions.pod:4588
29520 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
29521 " const char *lvname);\n"
29526 #: ../src/guestfs-actions.pod:4599
29527 msgid "See also C<guestfs_is_lv>."
29531 #: ../src/guestfs-actions.pod:4604
29532 msgid "(Added in 1.5.24)"
29536 #: ../src/guestfs-actions.pod:4606
29537 msgid "guestfs_lvm_clear_filter"
29541 #: ../src/guestfs-actions.pod:4608
29545 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
29550 #: ../src/guestfs-actions.pod:4611
29552 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
29553 "see every block device."
29557 #: ../src/guestfs-actions.pod:4621
29558 msgid "guestfs_lvm_remove_all"
29562 #: ../src/guestfs-actions.pod:4623
29566 " guestfs_lvm_remove_all (guestfs_h *g);\n"
29571 #: ../src/guestfs-actions.pod:4636
29572 msgid "guestfs_lvm_set_filter"
29576 #: ../src/guestfs-actions.pod:4638
29580 " guestfs_lvm_set_filter (guestfs_h *g,\n"
29581 " char *const *devices);\n"
29586 #: ../src/guestfs-actions.pod:4669
29587 msgid "guestfs_lvremove"
29591 #: ../src/guestfs-actions.pod:4671
29595 " guestfs_lvremove (guestfs_h *g,\n"
29596 " const char *device);\n"
29601 #: ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:6094
29602 #: ../src/guestfs-actions.pod:7944
29603 msgid "(Added in 1.0.13)"
29607 #: ../src/guestfs-actions.pod:4685
29608 msgid "guestfs_lvrename"
29612 #: ../src/guestfs-actions.pod:4687
29616 " guestfs_lvrename (guestfs_h *g,\n"
29617 " const char *logvol,\n"
29618 " const char *newlogvol);\n"
29623 #: ../src/guestfs-actions.pod:4696 ../src/guestfs-actions.pod:7957
29624 msgid "(Added in 1.0.83)"
29628 #: ../src/guestfs-actions.pod:4698
29629 msgid "guestfs_lvresize"
29633 #: ../src/guestfs-actions.pod:4700
29637 " guestfs_lvresize (guestfs_h *g,\n"
29638 " const char *device,\n"
29644 #: ../src/guestfs-actions.pod:4713
29645 msgid "guestfs_lvresize_free"
29649 #: ../src/guestfs-actions.pod:4715
29653 " guestfs_lvresize_free (guestfs_h *g,\n"
29654 " const char *lv,\n"
29660 #: ../src/guestfs-actions.pod:4728
29661 msgid "(Added in 1.3.3)"
29665 #: ../src/guestfs-actions.pod:4730
29666 msgid "guestfs_lvs"
29670 #: ../src/guestfs-actions.pod:4732
29674 " guestfs_lvs (guestfs_h *g);\n"
29679 #: ../src/guestfs-actions.pod:4741
29680 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
29684 #: ../src/guestfs-actions.pod:4749
29685 msgid "guestfs_lvs_full"
29689 #: ../src/guestfs-actions.pod:4751
29692 " struct guestfs_lvm_lv_list *\n"
29693 " guestfs_lvs_full (guestfs_h *g);\n"
29698 #: ../src/guestfs-actions.pod:4757
29700 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
29701 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
29705 #: ../src/guestfs-actions.pod:4763
29706 msgid "guestfs_lvuuid"
29710 #: ../src/guestfs-actions.pod:4765
29714 " guestfs_lvuuid (guestfs_h *g,\n"
29715 " const char *device);\n"
29720 #: ../src/guestfs-actions.pod:4776
29721 msgid "guestfs_lxattrlist"
29725 #: ../src/guestfs-actions.pod:4778
29728 " struct guestfs_xattr_list *\n"
29729 " guestfs_lxattrlist (guestfs_h *g,\n"
29730 " const char *path,\n"
29731 " char *const *names);\n"
29736 #: ../src/guestfs-actions.pod:4797
29738 "This call is intended for programs that want to efficiently list a directory "
29739 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
29740 "a similarly efficient call for getting standard stats. Very long directory "
29741 "listings might cause the protocol message size to be exceeded, causing this "
29742 "call to fail. The caller must split up such requests into smaller groups of "
29747 #: ../src/guestfs-actions.pod:4811
29748 msgid "guestfs_mkdir"
29752 #: ../src/guestfs-actions.pod:4813
29756 " guestfs_mkdir (guestfs_h *g,\n"
29757 " const char *path);\n"
29762 #: ../src/guestfs-actions.pod:4823
29763 msgid "guestfs_mkdir_mode"
29767 #: ../src/guestfs-actions.pod:4825
29771 " guestfs_mkdir_mode (guestfs_h *g,\n"
29772 " const char *path,\n"
29778 #: ../src/guestfs-actions.pod:4837
29779 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
29783 #: ../src/guestfs-actions.pod:4843
29784 msgid "guestfs_mkdir_p"
29788 #: ../src/guestfs-actions.pod:4845
29792 " guestfs_mkdir_p (guestfs_h *g,\n"
29793 " const char *path);\n"
29798 #: ../src/guestfs-actions.pod:4856
29799 msgid "guestfs_mkdtemp"
29803 #: ../src/guestfs-actions.pod:4858
29807 " guestfs_mkdtemp (guestfs_h *g,\n"
29808 " const char *template);\n"
29813 #: ../src/guestfs-actions.pod:4886
29814 msgid "guestfs_mke2fs_J"
29818 #: ../src/guestfs-actions.pod:4888
29822 " guestfs_mke2fs_J (guestfs_h *g,\n"
29823 " const char *fstype,\n"
29824 " int blocksize,\n"
29825 " const char *device,\n"
29826 " const char *journal);\n"
29831 #: ../src/guestfs-actions.pod:4901
29832 msgid "See also C<guestfs_mke2journal>."
29836 #: ../src/guestfs-actions.pod:4905 ../src/guestfs-actions.pod:4923
29837 #: ../src/guestfs-actions.pod:4941 ../src/guestfs-actions.pod:4957
29838 #: ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:4985
29839 #: ../src/guestfs-actions.pod:5044 ../src/guestfs-actions.pod:5321
29840 msgid "(Added in 1.0.68)"
29844 #: ../src/guestfs-actions.pod:4907
29845 msgid "guestfs_mke2fs_JL"
29849 #: ../src/guestfs-actions.pod:4909
29853 " guestfs_mke2fs_JL (guestfs_h *g,\n"
29854 " const char *fstype,\n"
29855 " int blocksize,\n"
29856 " const char *device,\n"
29857 " const char *label);\n"
29862 #: ../src/guestfs-actions.pod:4919
29863 msgid "See also C<guestfs_mke2journal_L>."
29867 #: ../src/guestfs-actions.pod:4925
29868 msgid "guestfs_mke2fs_JU"
29872 #: ../src/guestfs-actions.pod:4927
29876 " guestfs_mke2fs_JU (guestfs_h *g,\n"
29877 " const char *fstype,\n"
29878 " int blocksize,\n"
29879 " const char *device,\n"
29880 " const char *uuid);\n"
29885 #: ../src/guestfs-actions.pod:4937
29886 msgid "See also C<guestfs_mke2journal_U>."
29890 #: ../src/guestfs-actions.pod:4943
29891 msgid "guestfs_mke2journal"
29895 #: ../src/guestfs-actions.pod:4945
29899 " guestfs_mke2journal (guestfs_h *g,\n"
29900 " int blocksize,\n"
29901 " const char *device);\n"
29906 #: ../src/guestfs-actions.pod:4959
29907 msgid "guestfs_mke2journal_L"
29911 #: ../src/guestfs-actions.pod:4961
29915 " guestfs_mke2journal_L (guestfs_h *g,\n"
29916 " int blocksize,\n"
29917 " const char *label,\n"
29918 " const char *device);\n"
29923 #: ../src/guestfs-actions.pod:4973
29924 msgid "guestfs_mke2journal_U"
29928 #: ../src/guestfs-actions.pod:4975
29932 " guestfs_mke2journal_U (guestfs_h *g,\n"
29933 " int blocksize,\n"
29934 " const char *uuid,\n"
29935 " const char *device);\n"
29940 #: ../src/guestfs-actions.pod:4987
29941 msgid "guestfs_mkfifo"
29945 #: ../src/guestfs-actions.pod:4989
29949 " guestfs_mkfifo (guestfs_h *g,\n"
29951 " const char *path);\n"
29956 #: ../src/guestfs-actions.pod:4994
29958 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
29959 "is just a convenient wrapper around C<guestfs_mknod>."
29963 #: ../src/guestfs-actions.pod:5004
29964 msgid "guestfs_mkfs"
29968 #: ../src/guestfs-actions.pod:5006
29972 " guestfs_mkfs (guestfs_h *g,\n"
29973 " const char *fstype,\n"
29974 " const char *device);\n"
29979 #: ../src/guestfs-actions.pod:5019
29980 msgid "guestfs_mkfs_b"
29984 #: ../src/guestfs-actions.pod:5021
29988 " guestfs_mkfs_b (guestfs_h *g,\n"
29989 " const char *fstype,\n"
29990 " int blocksize,\n"
29991 " const char *device);\n"
29996 #: ../src/guestfs-actions.pod:5027
29998 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
30003 #: ../src/guestfs-actions.pod:5034
30005 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
30006 "block size of the resulting filesystem. Supported block sizes depend on the "
30007 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
30011 #: ../src/guestfs-actions.pod:5046
30012 msgid "guestfs_mkfs_opts"
30016 #: ../src/guestfs-actions.pod:5048
30020 " guestfs_mkfs_opts (guestfs_h *g,\n"
30021 " const char *fstype,\n"
30022 " const char *device,\n"
30028 #: ../src/guestfs-actions.pod:5059
30031 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
30032 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
30033 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
30034 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
30039 #: ../src/guestfs-actions.pod:5107
30040 msgid "(Added in 1.7.19)"
30044 #: ../src/guestfs-actions.pod:5109
30045 msgid "guestfs_mkfs_opts_va"
30049 #: ../src/guestfs-actions.pod:5111
30053 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
30054 " const char *fstype,\n"
30055 " const char *device,\n"
30056 " va_list args);\n"
30061 #: ../src/guestfs-actions.pod:5117
30062 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
30066 #: ../src/guestfs-actions.pod:5121
30067 msgid "guestfs_mkfs_opts_argv"
30071 #: ../src/guestfs-actions.pod:5123
30075 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
30076 " const char *fstype,\n"
30077 " const char *device,\n"
30078 " const struct guestfs_mkfs_opts_argv *optargs);\n"
30083 #: ../src/guestfs-actions.pod:5129
30084 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
30088 #: ../src/guestfs-actions.pod:5133
30089 msgid "guestfs_mkmountpoint"
30093 #: ../src/guestfs-actions.pod:5135
30097 " guestfs_mkmountpoint (guestfs_h *g,\n"
30098 " const char *exemptpath);\n"
30103 #: ../src/guestfs-actions.pod:5139
30105 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
30106 "that can be used to create extra mountpoints before mounting the first "
30111 #: ../src/guestfs-actions.pod:5163
30113 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
30114 "may get unexpected errors if you try to mix these calls. It is safest to "
30115 "manually unmount filesystems and remove mountpoints after use."
30119 #: ../src/guestfs-actions.pod:5167
30121 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
30122 "first, so for this to work for manual mountpoints, you must ensure that the "
30123 "innermost mountpoints have the longest pathnames, as in the example code "
30128 #: ../src/guestfs-actions.pod:5174
30130 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
30131 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
30132 "can also trigger these issues."
30136 #: ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5486
30137 #: ../src/guestfs-actions.pod:6514
30138 msgid "(Added in 1.0.62)"
30142 #: ../src/guestfs-actions.pod:5182
30143 msgid "guestfs_mknod"
30147 #: ../src/guestfs-actions.pod:5184
30151 " guestfs_mknod (guestfs_h *g,\n"
30155 " const char *path);\n"
30160 #: ../src/guestfs-actions.pod:5199
30162 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
30163 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
30164 "regular file). These constants are available in the standard Linux header "
30165 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
30166 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
30167 "the appropriate constant for you."
30171 #: ../src/guestfs-actions.pod:5213
30172 msgid "guestfs_mknod_b"
30176 #: ../src/guestfs-actions.pod:5215
30180 " guestfs_mknod_b (guestfs_h *g,\n"
30184 " const char *path);\n"
30189 #: ../src/guestfs-actions.pod:5222
30191 "This call creates a block device node called C<path> with mode C<mode> and "
30192 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
30193 "wrapper around C<guestfs_mknod>."
30197 #: ../src/guestfs-actions.pod:5232
30198 msgid "guestfs_mknod_c"
30202 #: ../src/guestfs-actions.pod:5234
30206 " guestfs_mknod_c (guestfs_h *g,\n"
30210 " const char *path);\n"
30215 #: ../src/guestfs-actions.pod:5241
30217 "This call creates a char device node called C<path> with mode C<mode> and "
30218 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
30219 "wrapper around C<guestfs_mknod>."
30223 #: ../src/guestfs-actions.pod:5251
30224 msgid "guestfs_mkswap"
30228 #: ../src/guestfs-actions.pod:5253
30232 " guestfs_mkswap (guestfs_h *g,\n"
30233 " const char *device);\n"
30238 #: ../src/guestfs-actions.pod:5263
30239 msgid "guestfs_mkswap_L"
30243 #: ../src/guestfs-actions.pod:5265
30247 " guestfs_mkswap_L (guestfs_h *g,\n"
30248 " const char *label,\n"
30249 " const char *device);\n"
30254 #: ../src/guestfs-actions.pod:5280
30255 msgid "guestfs_mkswap_U"
30259 #: ../src/guestfs-actions.pod:5282
30263 " guestfs_mkswap_U (guestfs_h *g,\n"
30264 " const char *uuid,\n"
30265 " const char *device);\n"
30270 #: ../src/guestfs-actions.pod:5293
30271 msgid "guestfs_mkswap_file"
30275 #: ../src/guestfs-actions.pod:5295
30279 " guestfs_mkswap_file (guestfs_h *g,\n"
30280 " const char *path);\n"
30285 #: ../src/guestfs-actions.pod:5301
30287 "This command just writes a swap file signature to an existing file. To "
30288 "create the file itself, use something like C<guestfs_fallocate>."
30292 #: ../src/guestfs-actions.pod:5308
30293 msgid "guestfs_modprobe"
30297 #: ../src/guestfs-actions.pod:5310
30301 " guestfs_modprobe (guestfs_h *g,\n"
30302 " const char *modulename);\n"
30307 #: ../src/guestfs-actions.pod:5323
30308 msgid "guestfs_mount"
30312 #: ../src/guestfs-actions.pod:5325
30316 " guestfs_mount (guestfs_h *g,\n"
30317 " const char *device,\n"
30318 " const char *mountpoint);\n"
30323 #: ../src/guestfs-actions.pod:5344
30325 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
30326 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
30327 "problems for users. If your program might need to work with older versions "
30328 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
30329 "for the first parameter if you don't want any options)."
30333 #: ../src/guestfs-actions.pod:5355
30334 msgid "guestfs_mount_9p"
30338 #: ../src/guestfs-actions.pod:5357
30342 " guestfs_mount_9p (guestfs_h *g,\n"
30343 " const char *mounttag,\n"
30344 " const char *mountpoint,\n"
30350 #: ../src/guestfs-actions.pod:5368
30353 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
30358 #: ../src/guestfs-actions.pod:5381
30359 msgid "guestfs_mount_9p_va"
30363 #: ../src/guestfs-actions.pod:5383
30367 " guestfs_mount_9p_va (guestfs_h *g,\n"
30368 " const char *mounttag,\n"
30369 " const char *mountpoint,\n"
30370 " va_list args);\n"
30375 #: ../src/guestfs-actions.pod:5389
30376 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
30380 #: ../src/guestfs-actions.pod:5393
30381 msgid "guestfs_mount_9p_argv"
30385 #: ../src/guestfs-actions.pod:5395
30389 " guestfs_mount_9p_argv (guestfs_h *g,\n"
30390 " const char *mounttag,\n"
30391 " const char *mountpoint,\n"
30392 " const struct guestfs_mount_9p_argv *optargs);\n"
30397 #: ../src/guestfs-actions.pod:5401
30398 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
30402 #: ../src/guestfs-actions.pod:5405
30403 msgid "guestfs_mount_loop"
30407 #: ../src/guestfs-actions.pod:5407
30411 " guestfs_mount_loop (guestfs_h *g,\n"
30412 " const char *file,\n"
30413 " const char *mountpoint);\n"
30418 #: ../src/guestfs-actions.pod:5420
30419 msgid "guestfs_mount_options"
30423 #: ../src/guestfs-actions.pod:5422
30427 " guestfs_mount_options (guestfs_h *g,\n"
30428 " const char *options,\n"
30429 " const char *device,\n"
30430 " const char *mountpoint);\n"
30435 #: ../src/guestfs-actions.pod:5428
30437 "This is the same as the C<guestfs_mount> command, but it allows you to set "
30438 "the mount options as for the L<mount(8)> I<-o> flag."
30442 #: ../src/guestfs-actions.pod:5438 ../src/guestfs-actions.pod:5452
30443 #: ../src/guestfs-actions.pod:5469
30444 msgid "(Added in 1.0.10)"
30448 #: ../src/guestfs-actions.pod:5440
30449 msgid "guestfs_mount_ro"
30453 #: ../src/guestfs-actions.pod:5442
30457 " guestfs_mount_ro (guestfs_h *g,\n"
30458 " const char *device,\n"
30459 " const char *mountpoint);\n"
30464 #: ../src/guestfs-actions.pod:5447
30466 "This is the same as the C<guestfs_mount> command, but it mounts the "
30467 "filesystem with the read-only (I<-o ro>) flag."
30471 #: ../src/guestfs-actions.pod:5454
30472 msgid "guestfs_mount_vfs"
30476 #: ../src/guestfs-actions.pod:5456
30480 " guestfs_mount_vfs (guestfs_h *g,\n"
30481 " const char *options,\n"
30482 " const char *vfstype,\n"
30483 " const char *device,\n"
30484 " const char *mountpoint);\n"
30489 #: ../src/guestfs-actions.pod:5463
30491 "This is the same as the C<guestfs_mount> command, but it allows you to set "
30492 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
30497 #: ../src/guestfs-actions.pod:5471
30498 msgid "guestfs_mountpoints"
30502 #: ../src/guestfs-actions.pod:5473
30506 " guestfs_mountpoints (guestfs_h *g);\n"
30511 #: ../src/guestfs-actions.pod:5476
30513 "This call is similar to C<guestfs_mounts>. That call returns a list of "
30514 "devices. This one returns a hash table (map) of device name to directory "
30515 "where the device is mounted."
30519 #: ../src/guestfs-actions.pod:5488
30520 msgid "guestfs_mounts"
30524 #: ../src/guestfs-actions.pod:5490
30528 " guestfs_mounts (guestfs_h *g);\n"
30533 #: ../src/guestfs-actions.pod:5498
30534 msgid "See also: C<guestfs_mountpoints>"
30538 #: ../src/guestfs-actions.pod:5506
30543 #: ../src/guestfs-actions.pod:5508
30547 " guestfs_mv (guestfs_h *g,\n"
30548 " const char *src,\n"
30549 " const char *dest);\n"
30554 #: ../src/guestfs-actions.pod:5520
30555 msgid "guestfs_ntfs_3g_probe"
30559 #: ../src/guestfs-actions.pod:5522
30563 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
30565 " const char *device);\n"
30570 #: ../src/guestfs-actions.pod:5541
30571 msgid "(Added in 1.0.43)"
30575 #: ../src/guestfs-actions.pod:5543
30576 msgid "guestfs_ntfsresize"
30580 #: ../src/guestfs-actions.pod:5545
30584 " guestfs_ntfsresize (guestfs_h *g,\n"
30585 " const char *device);\n"
30590 #: ../src/guestfs-actions.pod:5549 ../src/guestfs-actions.pod:5649
30592 "I<This function is deprecated.> In new code, use the L</"
30593 "guestfs_ntfsresize_opts> call instead."
30597 #: ../src/guestfs-actions.pod:5573
30598 msgid "guestfs_ntfsresize_opts"
30602 #: ../src/guestfs-actions.pod:5575
30606 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
30607 " const char *device,\n"
30613 #: ../src/guestfs-actions.pod:5585
30616 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
30617 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
30622 #: ../src/guestfs-actions.pod:5605
30624 "After the resize operation, the filesystem is always marked as requiring a "
30625 "consistency check (for safety). You have to boot into Windows to perform "
30626 "this check and clear this condition. If you I<don't> set the C<force> "
30627 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
30628 "times on a single filesystem without booting into Windows between each "
30633 #: ../src/guestfs-actions.pod:5620
30634 msgid "guestfs_ntfsresize_opts_va"
30638 #: ../src/guestfs-actions.pod:5622
30642 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
30643 " const char *device,\n"
30644 " va_list args);\n"
30649 #: ../src/guestfs-actions.pod:5627
30650 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
30654 #: ../src/guestfs-actions.pod:5631
30655 msgid "guestfs_ntfsresize_opts_argv"
30659 #: ../src/guestfs-actions.pod:5633
30663 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
30664 " const char *device,\n"
30665 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
30670 #: ../src/guestfs-actions.pod:5638
30671 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
30675 #: ../src/guestfs-actions.pod:5642
30676 msgid "guestfs_ntfsresize_size"
30680 #: ../src/guestfs-actions.pod:5644
30684 " guestfs_ntfsresize_size (guestfs_h *g,\n"
30685 " const char *device,\n"
30686 " int64_t size);\n"
30691 #: ../src/guestfs-actions.pod:5656
30693 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
30694 "to specify the new size (in bytes) explicitly."
30698 #: ../src/guestfs-actions.pod:5661 ../src/guestfs-actions.pod:6121
30699 #: ../src/guestfs-actions.pod:6194 ../src/guestfs-actions.pod:6462
30700 #: ../src/guestfs-actions.pod:8101
30701 msgid "(Added in 1.3.14)"
30705 #: ../src/guestfs-actions.pod:5663
30706 msgid "guestfs_part_add"
30710 #: ../src/guestfs-actions.pod:5665
30714 " guestfs_part_add (guestfs_h *g,\n"
30715 " const char *device,\n"
30716 " const char *prlogex,\n"
30717 " int64_t startsect,\n"
30718 " int64_t endsect);\n"
30723 #: ../src/guestfs-actions.pod:5672
30725 "This command adds a partition to C<device>. If there is no partition table "
30726 "on the device, call C<guestfs_part_init> first."
30730 #: ../src/guestfs-actions.pod:5684
30732 "Creating a partition which covers the whole disk is not so easy. Use "
30733 "C<guestfs_part_disk> to do that."
30737 #: ../src/guestfs-actions.pod:5689 ../src/guestfs-actions.pod:5727
30738 #: ../src/guestfs-actions.pod:5780 ../src/guestfs-actions.pod:5864
30739 #: ../src/guestfs-actions.pod:5902 ../src/guestfs-actions.pod:5921
30740 #: ../src/guestfs-actions.pod:5961
30741 msgid "(Added in 1.0.78)"
30745 #: ../src/guestfs-actions.pod:5691
30746 msgid "guestfs_part_del"
30750 #: ../src/guestfs-actions.pod:5693
30754 " guestfs_part_del (guestfs_h *g,\n"
30755 " const char *device,\n"
30761 #: ../src/guestfs-actions.pod:5708
30762 msgid "guestfs_part_disk"
30766 #: ../src/guestfs-actions.pod:5710
30770 " guestfs_part_disk (guestfs_h *g,\n"
30771 " const char *device,\n"
30772 " const char *parttype);\n"
30777 #: ../src/guestfs-actions.pod:5715
30779 "This command is simply a combination of C<guestfs_part_init> followed by "
30780 "C<guestfs_part_add> to create a single primary partition covering the whole "
30785 #: ../src/guestfs-actions.pod:5719
30787 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
30788 "possible values are described in C<guestfs_part_init>."
30792 #: ../src/guestfs-actions.pod:5729
30793 msgid "guestfs_part_get_bootable"
30797 #: ../src/guestfs-actions.pod:5731
30801 " guestfs_part_get_bootable (guestfs_h *g,\n"
30802 " const char *device,\n"
30808 #: ../src/guestfs-actions.pod:5739
30809 msgid "See also C<guestfs_part_set_bootable>."
30813 #: ../src/guestfs-actions.pod:5745
30814 msgid "guestfs_part_get_mbr_id"
30818 #: ../src/guestfs-actions.pod:5747
30822 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
30823 " const char *device,\n"
30829 #: ../src/guestfs-actions.pod:5755 ../src/guestfs-actions.pod:5937
30831 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
30832 "undefined results for other partition table types (see "
30833 "C<guestfs_part_get_parttype>)."
30837 #: ../src/guestfs-actions.pod:5763
30838 msgid "guestfs_part_get_parttype"
30842 #: ../src/guestfs-actions.pod:5765
30846 " guestfs_part_get_parttype (guestfs_h *g,\n"
30847 " const char *device);\n"
30852 #: ../src/guestfs-actions.pod:5772
30854 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
30855 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
30856 "possible, although unusual. See C<guestfs_part_init> for a full list."
30860 #: ../src/guestfs-actions.pod:5782
30861 msgid "guestfs_part_init"
30865 #: ../src/guestfs-actions.pod:5784
30869 " guestfs_part_init (guestfs_h *g,\n"
30870 " const char *device,\n"
30871 " const char *parttype);\n"
30876 #: ../src/guestfs-actions.pod:5793
30878 "Initially there are no partitions. Following this, you should call "
30879 "C<guestfs_part_add> for each partition required."
30883 #: ../src/guestfs-actions.pod:5866
30884 msgid "guestfs_part_list"
30888 #: ../src/guestfs-actions.pod:5868
30891 " struct guestfs_partition_list *\n"
30892 " guestfs_part_list (guestfs_h *g,\n"
30893 " const char *device);\n"
30898 #: ../src/guestfs-actions.pod:5885
30900 "Start of the partition I<in bytes>. To get sectors you have to divide by "
30901 "the device's sector size, see C<guestfs_blockdev_getss>."
30905 #: ../src/guestfs-actions.pod:5898
30907 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
30908 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
30913 #: ../src/guestfs-actions.pod:5904
30914 msgid "guestfs_part_set_bootable"
30918 #: ../src/guestfs-actions.pod:5906
30922 " guestfs_part_set_bootable (guestfs_h *g,\n"
30923 " const char *device,\n"
30925 " int bootable);\n"
30930 #: ../src/guestfs-actions.pod:5923
30931 msgid "guestfs_part_set_mbr_id"
30935 #: ../src/guestfs-actions.pod:5925
30939 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
30940 " const char *device,\n"
30947 #: ../src/guestfs-actions.pod:5945
30948 msgid "guestfs_part_set_name"
30952 #: ../src/guestfs-actions.pod:5947
30956 " guestfs_part_set_name (guestfs_h *g,\n"
30957 " const char *device,\n"
30959 " const char *name);\n"
30964 #: ../src/guestfs-actions.pod:5963
30965 msgid "guestfs_part_to_dev"
30969 #: ../src/guestfs-actions.pod:5965
30973 " guestfs_part_to_dev (guestfs_h *g,\n"
30974 " const char *partition);\n"
30979 #: ../src/guestfs-actions.pod:5973 ../src/guestfs-actions.pod:5992
30981 "The named partition must exist, for example as a string returned from "
30982 "C<guestfs_list_partitions>."
30986 #: ../src/guestfs-actions.pod:5976
30987 msgid "See also C<guestfs_part_to_partnum>."
30991 #: ../src/guestfs-actions.pod:5983
30992 msgid "guestfs_part_to_partnum"
30996 #: ../src/guestfs-actions.pod:5985
31000 " guestfs_part_to_partnum (guestfs_h *g,\n"
31001 " const char *partition);\n"
31006 #: ../src/guestfs-actions.pod:5995
31007 msgid "See also C<guestfs_part_to_dev>."
31011 #: ../src/guestfs-actions.pod:5999
31012 msgid "guestfs_ping_daemon"
31016 #: ../src/guestfs-actions.pod:6001
31020 " guestfs_ping_daemon (guestfs_h *g);\n"
31025 #: ../src/guestfs-actions.pod:6013
31026 msgid "guestfs_pread"
31030 #: ../src/guestfs-actions.pod:6015
31034 " guestfs_pread (guestfs_h *g,\n"
31035 " const char *path,\n"
31037 " int64_t offset,\n"
31038 " size_t *size_r);\n"
31043 #: ../src/guestfs-actions.pod:6028
31044 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
31048 #: ../src/guestfs-actions.pod:6039
31049 msgid "guestfs_pread_device"
31053 #: ../src/guestfs-actions.pod:6041
31057 " guestfs_pread_device (guestfs_h *g,\n"
31058 " const char *device,\n"
31060 " int64_t offset,\n"
31061 " size_t *size_r);\n"
31066 #: ../src/guestfs-actions.pod:6054
31067 msgid "See also C<guestfs_pread>."
31071 #: ../src/guestfs-actions.pod:6063
31072 msgid "(Added in 1.5.21)"
31076 #: ../src/guestfs-actions.pod:6065
31077 msgid "guestfs_pvcreate"
31081 #: ../src/guestfs-actions.pod:6067
31085 " guestfs_pvcreate (guestfs_h *g,\n"
31086 " const char *device);\n"
31091 #: ../src/guestfs-actions.pod:6079
31092 msgid "guestfs_pvremove"
31096 #: ../src/guestfs-actions.pod:6081
31100 " guestfs_pvremove (guestfs_h *g,\n"
31101 " const char *device);\n"
31106 #: ../src/guestfs-actions.pod:6096
31107 msgid "guestfs_pvresize"
31111 #: ../src/guestfs-actions.pod:6098
31115 " guestfs_pvresize (guestfs_h *g,\n"
31116 " const char *device);\n"
31121 #: ../src/guestfs-actions.pod:6109
31122 msgid "guestfs_pvresize_size"
31126 #: ../src/guestfs-actions.pod:6111
31130 " guestfs_pvresize_size (guestfs_h *g,\n"
31131 " const char *device,\n"
31132 " int64_t size);\n"
31137 #: ../src/guestfs-actions.pod:6116
31139 "This command is the same as C<guestfs_pvresize> except that it allows you to "
31140 "specify the new size (in bytes) explicitly."
31144 #: ../src/guestfs-actions.pod:6123
31145 msgid "guestfs_pvs"
31149 #: ../src/guestfs-actions.pod:6125
31153 " guestfs_pvs (guestfs_h *g);\n"
31158 #: ../src/guestfs-actions.pod:6134
31159 msgid "See also C<guestfs_pvs_full>."
31163 #: ../src/guestfs-actions.pod:6142
31164 msgid "guestfs_pvs_full"
31168 #: ../src/guestfs-actions.pod:6144
31171 " struct guestfs_lvm_pv_list *\n"
31172 " guestfs_pvs_full (guestfs_h *g);\n"
31177 #: ../src/guestfs-actions.pod:6150
31179 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
31180 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
31184 #: ../src/guestfs-actions.pod:6156
31185 msgid "guestfs_pvuuid"
31189 #: ../src/guestfs-actions.pod:6158
31193 " guestfs_pvuuid (guestfs_h *g,\n"
31194 " const char *device);\n"
31199 #: ../src/guestfs-actions.pod:6169
31200 msgid "guestfs_pwrite"
31204 #: ../src/guestfs-actions.pod:6171
31208 " guestfs_pwrite (guestfs_h *g,\n"
31209 " const char *path,\n"
31210 " const char *content,\n"
31211 " size_t content_size,\n"
31212 " int64_t offset);\n"
31217 #: ../src/guestfs-actions.pod:6187
31218 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
31222 #: ../src/guestfs-actions.pod:6196
31223 msgid "guestfs_pwrite_device"
31227 #: ../src/guestfs-actions.pod:6198
31231 " guestfs_pwrite_device (guestfs_h *g,\n"
31232 " const char *device,\n"
31233 " const char *content,\n"
31234 " size_t content_size,\n"
31235 " int64_t offset);\n"
31240 #: ../src/guestfs-actions.pod:6213
31241 msgid "See also C<guestfs_pwrite>."
31245 #: ../src/guestfs-actions.pod:6220
31246 msgid "(Added in 1.5.20)"
31250 #: ../src/guestfs-actions.pod:6222
31251 msgid "guestfs_read_file"
31255 #: ../src/guestfs-actions.pod:6224
31259 " guestfs_read_file (guestfs_h *g,\n"
31260 " const char *path,\n"
31261 " size_t *size_r);\n"
31266 #: ../src/guestfs-actions.pod:6232
31268 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
31269 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
31270 "function is limited in the total size of file that can be handled."
31274 #: ../src/guestfs-actions.pod:6244
31275 msgid "(Added in 1.0.63)"
31279 #: ../src/guestfs-actions.pod:6246
31280 msgid "guestfs_read_lines"
31284 #: ../src/guestfs-actions.pod:6248
31288 " guestfs_read_lines (guestfs_h *g,\n"
31289 " const char *path);\n"
31294 #: ../src/guestfs-actions.pod:6257
31296 "Note that this function cannot correctly handle binary files (specifically, "
31297 "files containing C<\\0> character which is treated as end of line). For "
31298 "those you need to use the C<guestfs_read_file> function which has a more "
31299 "complex interface."
31303 #: ../src/guestfs-actions.pod:6268
31304 msgid "guestfs_readdir"
31308 #: ../src/guestfs-actions.pod:6270
31311 " struct guestfs_dirent_list *\n"
31312 " guestfs_readdir (guestfs_h *g,\n"
31313 " const char *dir);\n"
31318 #: ../src/guestfs-actions.pod:6324
31320 "This function is primarily intended for use by programs. To get a simple "
31321 "list of names, use C<guestfs_ls>. To get a printable directory for human "
31322 "consumption, use C<guestfs_ll>."
31326 #: ../src/guestfs-actions.pod:6328
31328 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
31329 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
31333 #: ../src/guestfs-actions.pod:6334
31334 msgid "guestfs_readlink"
31338 #: ../src/guestfs-actions.pod:6336
31342 " guestfs_readlink (guestfs_h *g,\n"
31343 " const char *path);\n"
31348 #: ../src/guestfs-actions.pod:6347
31349 msgid "guestfs_readlinklist"
31353 #: ../src/guestfs-actions.pod:6349
31357 " guestfs_readlinklist (guestfs_h *g,\n"
31358 " const char *path,\n"
31359 " char *const *names);\n"
31364 #: ../src/guestfs-actions.pod:6382
31365 msgid "guestfs_realpath"
31369 #: ../src/guestfs-actions.pod:6384
31373 " guestfs_realpath (guestfs_h *g,\n"
31374 " const char *path);\n"
31379 #: ../src/guestfs-actions.pod:6396
31380 msgid "guestfs_removexattr"
31384 #: ../src/guestfs-actions.pod:6398
31388 " guestfs_removexattr (guestfs_h *g,\n"
31389 " const char *xattr,\n"
31390 " const char *path);\n"
31395 #: ../src/guestfs-actions.pod:6406
31396 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
31400 #: ../src/guestfs-actions.pod:6412
31401 msgid "guestfs_resize2fs"
31405 #: ../src/guestfs-actions.pod:6414
31409 " guestfs_resize2fs (guestfs_h *g,\n"
31410 " const char *device);\n"
31415 #: ../src/guestfs-actions.pod:6421
31417 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
31418 "C<device> before calling this command. For unknown reasons C<resize2fs> "
31419 "sometimes gives an error about this and sometimes not. In any case, it is "
31420 "always safe to call C<guestfs_e2fsck_f> before calling this function."
31424 #: ../src/guestfs-actions.pod:6431
31425 msgid "guestfs_resize2fs_M"
31429 #: ../src/guestfs-actions.pod:6433
31433 " guestfs_resize2fs_M (guestfs_h *g,\n"
31434 " const char *device);\n"
31439 #: ../src/guestfs-actions.pod:6437
31441 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
31442 "resized to its minimum size. This works like the I<-M> option to the "
31443 "C<resize2fs> command."
31447 #: ../src/guestfs-actions.pod:6441
31449 "To get the resulting size of the filesystem you should call "
31450 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
31451 "These two numbers, multiplied together, give the resulting size of the "
31452 "minimal filesystem in bytes."
31456 #: ../src/guestfs-actions.pod:6450
31457 msgid "guestfs_resize2fs_size"
31461 #: ../src/guestfs-actions.pod:6452
31465 " guestfs_resize2fs_size (guestfs_h *g,\n"
31466 " const char *device,\n"
31467 " int64_t size);\n"
31472 #: ../src/guestfs-actions.pod:6457
31474 "This command is the same as C<guestfs_resize2fs> except that it allows you "
31475 "to specify the new size (in bytes) explicitly."
31479 #: ../src/guestfs-actions.pod:6464
31484 #: ../src/guestfs-actions.pod:6466
31488 " guestfs_rm (guestfs_h *g,\n"
31489 " const char *path);\n"
31494 #: ../src/guestfs-actions.pod:6476
31495 msgid "guestfs_rm_rf"
31499 #: ../src/guestfs-actions.pod:6478
31503 " guestfs_rm_rf (guestfs_h *g,\n"
31504 " const char *path);\n"
31509 #: ../src/guestfs-actions.pod:6490
31510 msgid "guestfs_rmdir"
31514 #: ../src/guestfs-actions.pod:6492
31518 " guestfs_rmdir (guestfs_h *g,\n"
31519 " const char *path);\n"
31524 #: ../src/guestfs-actions.pod:6502
31525 msgid "guestfs_rmmountpoint"
31529 #: ../src/guestfs-actions.pod:6504
31533 " guestfs_rmmountpoint (guestfs_h *g,\n"
31534 " const char *exemptpath);\n"
31539 #: ../src/guestfs-actions.pod:6508
31541 "This calls removes a mountpoint that was previously created with "
31542 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
31546 #: ../src/guestfs-actions.pod:6516
31547 msgid "guestfs_scrub_device"
31551 #: ../src/guestfs-actions.pod:6518
31555 " guestfs_scrub_device (guestfs_h *g,\n"
31556 " const char *device);\n"
31561 #: ../src/guestfs-actions.pod:6533 ../src/guestfs-actions.pod:6551
31562 #: ../src/guestfs-actions.pod:6570
31563 msgid "(Added in 1.0.52)"
31567 #: ../src/guestfs-actions.pod:6535
31568 msgid "guestfs_scrub_file"
31572 #: ../src/guestfs-actions.pod:6537
31576 " guestfs_scrub_file (guestfs_h *g,\n"
31577 " const char *file);\n"
31582 #: ../src/guestfs-actions.pod:6553
31583 msgid "guestfs_scrub_freespace"
31587 #: ../src/guestfs-actions.pod:6555
31591 " guestfs_scrub_freespace (guestfs_h *g,\n"
31592 " const char *dir);\n"
31597 #: ../src/guestfs-actions.pod:6559
31599 "This command creates the directory C<dir> and then fills it with files until "
31600 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
31601 "and deletes them. The intention is to scrub any free space on the partition "
31602 "containing C<dir>."
31606 #: ../src/guestfs-actions.pod:6572
31607 msgid "guestfs_set_append"
31611 #: ../src/guestfs-actions.pod:6574
31615 " guestfs_set_append (guestfs_h *g,\n"
31616 " const char *append);\n"
31621 #: ../src/guestfs-actions.pod:6591
31622 msgid "guestfs_set_attach_method"
31626 #: ../src/guestfs-actions.pod:6593
31630 " guestfs_set_attach_method (guestfs_h *g,\n"
31631 " const char *attachmethod);\n"
31636 #: ../src/guestfs-actions.pod:6621
31637 msgid "guestfs_set_autosync"
31641 #: ../src/guestfs-actions.pod:6623
31645 " guestfs_set_autosync (guestfs_h *g,\n"
31646 " int autosync);\n"
31651 #: ../src/guestfs-actions.pod:6639
31652 msgid "guestfs_set_direct"
31656 #: ../src/guestfs-actions.pod:6641
31660 " guestfs_set_direct (guestfs_h *g,\n"
31666 #: ../src/guestfs-actions.pod:6649
31668 "One consequence of this is that log messages aren't caught by the library "
31669 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
31674 #: ../src/guestfs-actions.pod:6662
31675 msgid "guestfs_set_e2label"
31679 #: ../src/guestfs-actions.pod:6664
31683 " guestfs_set_e2label (guestfs_h *g,\n"
31684 " const char *device,\n"
31685 " const char *label);\n"
31690 #: ../src/guestfs-actions.pod:6673
31692 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
31693 "the existing label on a filesystem."
31697 #: ../src/guestfs-actions.pod:6680
31698 msgid "guestfs_set_e2uuid"
31702 #: ../src/guestfs-actions.pod:6682
31706 " guestfs_set_e2uuid (guestfs_h *g,\n"
31707 " const char *device,\n"
31708 " const char *uuid);\n"
31713 #: ../src/guestfs-actions.pod:6692
31715 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
31716 "the existing UUID of a filesystem."
31720 #: ../src/guestfs-actions.pod:6699
31721 msgid "guestfs_set_memsize"
31725 #: ../src/guestfs-actions.pod:6701
31729 " guestfs_set_memsize (guestfs_h *g,\n"
31735 #: ../src/guestfs-actions.pod:6705
31737 "This sets the memory size in megabytes allocated to the qemu subprocess. "
31738 "This only has any effect if called before C<guestfs_launch>."
31742 #: ../src/guestfs-actions.pod:6720
31743 msgid "guestfs_set_network"
31747 #: ../src/guestfs-actions.pod:6722
31751 " guestfs_set_network (guestfs_h *g,\n"
31757 #: ../src/guestfs-actions.pod:6732
31759 "You must call this before calling C<guestfs_launch>, otherwise it has no "
31764 #: ../src/guestfs-actions.pod:6739
31765 msgid "guestfs_set_path"
31769 #: ../src/guestfs-actions.pod:6741
31773 " guestfs_set_path (guestfs_h *g,\n"
31774 " const char *searchpath);\n"
31779 #: ../src/guestfs-actions.pod:6756
31780 msgid "guestfs_set_pgroup"
31784 #: ../src/guestfs-actions.pod:6758
31788 " guestfs_set_pgroup (guestfs_h *g,\n"
31794 #: ../src/guestfs-actions.pod:6775
31795 msgid "guestfs_set_qemu"
31799 #: ../src/guestfs-actions.pod:6777
31803 " guestfs_set_qemu (guestfs_h *g,\n"
31804 " const char *qemu);\n"
31809 #: ../src/guestfs-actions.pod:6803
31810 msgid "guestfs_set_recovery_proc"
31814 #: ../src/guestfs-actions.pod:6805
31818 " guestfs_set_recovery_proc (guestfs_h *g,\n"
31819 " int recoveryproc);\n"
31824 #: ../src/guestfs-actions.pod:6809
31826 "If this is called with the parameter C<false> then C<guestfs_launch> does "
31827 "not create a recovery process. The purpose of the recovery process is to "
31828 "stop runaway qemu processes in the case where the main program aborts "
31833 #: ../src/guestfs-actions.pod:6814
31835 "This only has any effect if called before C<guestfs_launch>, and the default "
31840 #: ../src/guestfs-actions.pod:6827
31841 msgid "guestfs_set_selinux"
31845 #: ../src/guestfs-actions.pod:6829
31849 " guestfs_set_selinux (guestfs_h *g,\n"
31855 #: ../src/guestfs-actions.pod:6846
31856 msgid "guestfs_set_smp"
31860 #: ../src/guestfs-actions.pod:6848
31864 " guestfs_set_smp (guestfs_h *g,\n"
31870 #: ../src/guestfs-actions.pod:6856
31871 msgid "This function must be called before C<guestfs_launch>."
31875 #: ../src/guestfs-actions.pod:6862
31876 msgid "guestfs_set_trace"
31880 #: ../src/guestfs-actions.pod:6864
31884 " guestfs_set_trace (guestfs_h *g,\n"
31890 #: ../src/guestfs-actions.pod:6878
31892 "Trace messages are normally sent to C<stderr>, unless you register a "
31893 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
31897 #: ../src/guestfs-actions.pod:6886
31898 msgid "guestfs_set_verbose"
31902 #: ../src/guestfs-actions.pod:6888
31906 " guestfs_set_verbose (guestfs_h *g,\n"
31912 #: ../src/guestfs-actions.pod:6897
31914 "Verbose messages are normally sent to C<stderr>, unless you register a "
31915 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
31919 #: ../src/guestfs-actions.pod:6905
31920 msgid "guestfs_setcon"
31924 #: ../src/guestfs-actions.pod:6907
31928 " guestfs_setcon (guestfs_h *g,\n"
31929 " const char *context);\n"
31934 #: ../src/guestfs-actions.pod:6920
31935 msgid "guestfs_setxattr"
31939 #: ../src/guestfs-actions.pod:6922
31943 " guestfs_setxattr (guestfs_h *g,\n"
31944 " const char *xattr,\n"
31945 " const char *val,\n"
31947 " const char *path);\n"
31952 #: ../src/guestfs-actions.pod:6933
31953 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
31957 #: ../src/guestfs-actions.pod:6939
31958 msgid "guestfs_sfdisk"
31962 #: ../src/guestfs-actions.pod:6941
31966 " guestfs_sfdisk (guestfs_h *g,\n"
31967 " const char *device,\n"
31971 " char *const *lines);\n"
31976 #: ../src/guestfs-actions.pod:6949 ../src/guestfs-actions.pod:6993
31977 #: ../src/guestfs-actions.pod:7027
31979 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
31984 #: ../src/guestfs-actions.pod:6976
31986 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
31990 #: ../src/guestfs-actions.pod:6986
31991 msgid "guestfs_sfdiskM"
31995 #: ../src/guestfs-actions.pod:6988
31999 " guestfs_sfdiskM (guestfs_h *g,\n"
32000 " const char *device,\n"
32001 " char *const *lines);\n"
32006 #: ../src/guestfs-actions.pod:7000
32008 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
32009 "partition sizes are specified in megabytes only (rounded to the nearest "
32010 "cylinder) and you don't need to specify the cyls, heads and sectors "
32011 "parameters which were rarely if ever used anyway."
32015 #: ../src/guestfs-actions.pod:7006
32017 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
32018 "C<guestfs_part_disk>"
32022 #: ../src/guestfs-actions.pod:7016
32023 msgid "guestfs_sfdisk_N"
32027 #: ../src/guestfs-actions.pod:7018
32031 " guestfs_sfdisk_N (guestfs_h *g,\n"
32032 " const char *device,\n"
32037 " const char *line);\n"
32042 #: ../src/guestfs-actions.pod:7037
32044 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
32045 "for the cyls/heads/sectors parameters."
32049 #: ../src/guestfs-actions.pod:7040
32050 msgid "See also: C<guestfs_part_add>"
32054 #: ../src/guestfs-actions.pod:7049
32055 msgid "guestfs_sfdisk_disk_geometry"
32059 #: ../src/guestfs-actions.pod:7051
32063 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
32064 " const char *device);\n"
32069 #: ../src/guestfs-actions.pod:7055
32071 "This displays the disk geometry of C<device> read from the partition table. "
32072 "Especially in the case where the underlying block device has been resized, "
32073 "this can be different from the kernel's idea of the geometry (see "
32074 "C<guestfs_sfdisk_kernel_geometry>)."
32078 #: ../src/guestfs-actions.pod:7068
32079 msgid "guestfs_sfdisk_kernel_geometry"
32083 #: ../src/guestfs-actions.pod:7070
32087 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
32088 " const char *device);\n"
32093 #: ../src/guestfs-actions.pod:7084
32094 msgid "guestfs_sfdisk_l"
32098 #: ../src/guestfs-actions.pod:7086
32102 " guestfs_sfdisk_l (guestfs_h *g,\n"
32103 " const char *device);\n"
32108 #: ../src/guestfs-actions.pod:7090
32110 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
32115 #: ../src/guestfs-actions.pod:7101
32116 msgid "See also: C<guestfs_part_list>"
32120 #: ../src/guestfs-actions.pod:7108
32125 #: ../src/guestfs-actions.pod:7110
32129 " guestfs_sh (guestfs_h *g,\n"
32130 " const char *command);\n"
32135 #: ../src/guestfs-actions.pod:7117
32136 msgid "This is like C<guestfs_command>, but passes the command to:"
32140 #: ../src/guestfs-actions.pod:7125
32141 msgid "All the provisos about C<guestfs_command> apply to this call."
32145 #: ../src/guestfs-actions.pod:7132
32146 msgid "guestfs_sh_lines"
32150 #: ../src/guestfs-actions.pod:7134
32154 " guestfs_sh_lines (guestfs_h *g,\n"
32155 " const char *command);\n"
32160 #: ../src/guestfs-actions.pod:7138
32162 "This is the same as C<guestfs_sh>, but splits the result into a list of "
32167 #: ../src/guestfs-actions.pod:7141
32168 msgid "See also: C<guestfs_command_lines>"
32172 #: ../src/guestfs-actions.pod:7149
32173 msgid "guestfs_sleep"
32177 #: ../src/guestfs-actions.pod:7151
32181 " guestfs_sleep (guestfs_h *g,\n"
32187 #: ../src/guestfs-actions.pod:7159
32188 msgid "(Added in 1.0.41)"
32192 #: ../src/guestfs-actions.pod:7161 ../src/guestfs-structs.pod:109
32193 msgid "guestfs_stat"
32197 #: ../src/guestfs-actions.pod:7163
32200 " struct guestfs_stat *\n"
32201 " guestfs_stat (guestfs_h *g,\n"
32202 " const char *path);\n"
32207 #: ../src/guestfs-actions.pod:7177 ../src/guestfs-structs.pod:135
32208 msgid "guestfs_statvfs"
32212 #: ../src/guestfs-actions.pod:7179
32215 " struct guestfs_statvfs *\n"
32216 " guestfs_statvfs (guestfs_h *g,\n"
32217 " const char *path);\n"
32222 #: ../src/guestfs-actions.pod:7189
32224 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
32225 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
32229 #: ../src/guestfs-actions.pod:7195
32230 msgid "guestfs_strings"
32234 #: ../src/guestfs-actions.pod:7197
32238 " guestfs_strings (guestfs_h *g,\n"
32239 " const char *path);\n"
32244 #: ../src/guestfs-actions.pod:7213
32245 msgid "guestfs_strings_e"
32249 #: ../src/guestfs-actions.pod:7215
32253 " guestfs_strings_e (guestfs_h *g,\n"
32254 " const char *encoding,\n"
32255 " const char *path);\n"
32260 #: ../src/guestfs-actions.pod:7220
32262 "This is like the C<guestfs_strings> command, but allows you to specify the "
32263 "encoding of strings that are looked for in the source file C<path>."
32267 #: ../src/guestfs-actions.pod:7230
32269 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
32270 "ISO-8859-X (this is what C<guestfs_strings> uses)."
32274 #: ../src/guestfs-actions.pod:7268
32275 msgid "guestfs_swapoff_device"
32279 #: ../src/guestfs-actions.pod:7270
32283 " guestfs_swapoff_device (guestfs_h *g,\n"
32284 " const char *device);\n"
32289 #: ../src/guestfs-actions.pod:7274
32291 "This command disables the libguestfs appliance swap device or partition "
32292 "named C<device>. See C<guestfs_swapon_device>."
32296 #: ../src/guestfs-actions.pod:7282
32297 msgid "guestfs_swapoff_file"
32301 #: ../src/guestfs-actions.pod:7284
32305 " guestfs_swapoff_file (guestfs_h *g,\n"
32306 " const char *file);\n"
32311 #: ../src/guestfs-actions.pod:7294
32312 msgid "guestfs_swapoff_label"
32316 #: ../src/guestfs-actions.pod:7296
32320 " guestfs_swapoff_label (guestfs_h *g,\n"
32321 " const char *label);\n"
32326 #: ../src/guestfs-actions.pod:7307
32327 msgid "guestfs_swapoff_uuid"
32331 #: ../src/guestfs-actions.pod:7309
32335 " guestfs_swapoff_uuid (guestfs_h *g,\n"
32336 " const char *uuid);\n"
32341 #: ../src/guestfs-actions.pod:7320
32342 msgid "guestfs_swapon_device"
32346 #: ../src/guestfs-actions.pod:7322
32350 " guestfs_swapon_device (guestfs_h *g,\n"
32351 " const char *device);\n"
32356 #: ../src/guestfs-actions.pod:7326
32358 "This command enables the libguestfs appliance to use the swap device or "
32359 "partition named C<device>. The increased memory is made available for all "
32360 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
32364 #: ../src/guestfs-actions.pod:7342
32365 msgid "guestfs_swapon_file"
32369 #: ../src/guestfs-actions.pod:7344
32373 " guestfs_swapon_file (guestfs_h *g,\n"
32374 " const char *file);\n"
32379 #: ../src/guestfs-actions.pod:7348
32381 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
32386 #: ../src/guestfs-actions.pod:7355
32387 msgid "guestfs_swapon_label"
32391 #: ../src/guestfs-actions.pod:7357
32395 " guestfs_swapon_label (guestfs_h *g,\n"
32396 " const char *label);\n"
32401 #: ../src/guestfs-actions.pod:7361
32403 "This command enables swap to a labeled swap partition. See "
32404 "C<guestfs_swapon_device> for other notes."
32408 #: ../src/guestfs-actions.pod:7368
32409 msgid "guestfs_swapon_uuid"
32413 #: ../src/guestfs-actions.pod:7370
32417 " guestfs_swapon_uuid (guestfs_h *g,\n"
32418 " const char *uuid);\n"
32423 #: ../src/guestfs-actions.pod:7374
32425 "This command enables swap to a swap partition with the given UUID. See "
32426 "C<guestfs_swapon_device> for other notes."
32430 #: ../src/guestfs-actions.pod:7381
32431 msgid "guestfs_sync"
32435 #: ../src/guestfs-actions.pod:7383
32439 " guestfs_sync (guestfs_h *g);\n"
32444 #: ../src/guestfs-actions.pod:7396
32445 msgid "guestfs_tail"
32449 #: ../src/guestfs-actions.pod:7398
32453 " guestfs_tail (guestfs_h *g,\n"
32454 " const char *path);\n"
32459 #: ../src/guestfs-actions.pod:7414
32460 msgid "guestfs_tail_n"
32464 #: ../src/guestfs-actions.pod:7416
32468 " guestfs_tail_n (guestfs_h *g,\n"
32470 " const char *path);\n"
32475 #: ../src/guestfs-actions.pod:7438
32476 msgid "guestfs_tar_in"
32480 #: ../src/guestfs-actions.pod:7440
32484 " guestfs_tar_in (guestfs_h *g,\n"
32485 " const char *tarfile,\n"
32486 " const char *directory);\n"
32491 #: ../src/guestfs-actions.pod:7448
32493 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
32497 #: ../src/guestfs-actions.pod:7453 ../src/guestfs-actions.pod:7470
32498 #: ../src/guestfs-actions.pod:7486 ../src/guestfs-actions.pod:7502
32499 msgid "(Added in 1.0.3)"
32503 #: ../src/guestfs-actions.pod:7455
32504 msgid "guestfs_tar_out"
32508 #: ../src/guestfs-actions.pod:7457
32512 " guestfs_tar_out (guestfs_h *g,\n"
32513 " const char *directory,\n"
32514 " const char *tarfile);\n"
32519 #: ../src/guestfs-actions.pod:7465
32521 "To download a compressed tarball, use C<guestfs_tgz_out> or "
32522 "C<guestfs_txz_out>."
32526 #: ../src/guestfs-actions.pod:7472
32527 msgid "guestfs_tgz_in"
32531 #: ../src/guestfs-actions.pod:7474
32535 " guestfs_tgz_in (guestfs_h *g,\n"
32536 " const char *tarball,\n"
32537 " const char *directory);\n"
32542 #: ../src/guestfs-actions.pod:7482
32543 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
32547 #: ../src/guestfs-actions.pod:7488
32548 msgid "guestfs_tgz_out"
32552 #: ../src/guestfs-actions.pod:7490
32556 " guestfs_tgz_out (guestfs_h *g,\n"
32557 " const char *directory,\n"
32558 " const char *tarball);\n"
32563 #: ../src/guestfs-actions.pod:7498
32564 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
32568 #: ../src/guestfs-actions.pod:7504
32569 msgid "guestfs_touch"
32573 #: ../src/guestfs-actions.pod:7506
32577 " guestfs_touch (guestfs_h *g,\n"
32578 " const char *path);\n"
32583 #: ../src/guestfs-actions.pod:7521
32584 msgid "guestfs_truncate"
32588 #: ../src/guestfs-actions.pod:7523
32592 " guestfs_truncate (guestfs_h *g,\n"
32593 " const char *path);\n"
32598 #: ../src/guestfs-actions.pod:7534
32599 msgid "guestfs_truncate_size"
32603 #: ../src/guestfs-actions.pod:7536
32607 " guestfs_truncate_size (guestfs_h *g,\n"
32608 " const char *path,\n"
32609 " int64_t size);\n"
32614 #: ../src/guestfs-actions.pod:7544
32616 "If the current file size is less than C<size> then the file is extended to "
32617 "the required size with zero bytes. This creates a sparse file (ie. disk "
32618 "blocks are not allocated for the file until you write to it). To create a "
32619 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
32623 #: ../src/guestfs-actions.pod:7554
32624 msgid "guestfs_tune2fs_l"
32628 #: ../src/guestfs-actions.pod:7556
32632 " guestfs_tune2fs_l (guestfs_h *g,\n"
32633 " const char *device);\n"
32638 #: ../src/guestfs-actions.pod:7576
32639 msgid "guestfs_txz_in"
32643 #: ../src/guestfs-actions.pod:7578
32647 " guestfs_txz_in (guestfs_h *g,\n"
32648 " const char *tarball,\n"
32649 " const char *directory);\n"
32654 #: ../src/guestfs-actions.pod:7590
32655 msgid "guestfs_txz_out"
32659 #: ../src/guestfs-actions.pod:7592
32663 " guestfs_txz_out (guestfs_h *g,\n"
32664 " const char *directory,\n"
32665 " const char *tarball);\n"
32670 #: ../src/guestfs-actions.pod:7604
32671 msgid "guestfs_umask"
32675 #: ../src/guestfs-actions.pod:7606
32679 " guestfs_umask (guestfs_h *g,\n"
32685 #: ../src/guestfs-actions.pod:7622
32687 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
32688 "C<guestfs_mkdir>."
32692 #: ../src/guestfs-actions.pod:7631
32693 msgid "guestfs_umount"
32697 #: ../src/guestfs-actions.pod:7633
32701 " guestfs_umount (guestfs_h *g,\n"
32702 " const char *pathordevice);\n"
32707 #: ../src/guestfs-actions.pod:7645
32708 msgid "guestfs_umount_all"
32712 #: ../src/guestfs-actions.pod:7647
32716 " guestfs_umount_all (guestfs_h *g);\n"
32721 #: ../src/guestfs-actions.pod:7658
32722 msgid "guestfs_upload"
32726 #: ../src/guestfs-actions.pod:7660
32730 " guestfs_upload (guestfs_h *g,\n"
32731 " const char *filename,\n"
32732 " const char *remotefilename);\n"
32737 #: ../src/guestfs-actions.pod:7670
32738 msgid "See also C<guestfs_download>."
32742 #: ../src/guestfs-actions.pod:7681
32743 msgid "guestfs_upload_offset"
32747 #: ../src/guestfs-actions.pod:7683
32751 " guestfs_upload_offset (guestfs_h *g,\n"
32752 " const char *filename,\n"
32753 " const char *remotefilename,\n"
32754 " int64_t offset);\n"
32759 #: ../src/guestfs-actions.pod:7699
32761 "Note that there is no limit on the amount of data that can be uploaded with "
32762 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
32763 "full amount unless an error occurs."
32767 #: ../src/guestfs-actions.pod:7704
32768 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
32772 #: ../src/guestfs-actions.pod:7715
32773 msgid "guestfs_utimens"
32777 #: ../src/guestfs-actions.pod:7717
32781 " guestfs_utimens (guestfs_h *g,\n"
32782 " const char *path,\n"
32783 " int64_t atsecs,\n"
32784 " int64_t atnsecs,\n"
32785 " int64_t mtsecs,\n"
32786 " int64_t mtnsecs);\n"
32791 #: ../src/guestfs-actions.pod:7746 ../src/guestfs-structs.pod:175
32792 msgid "guestfs_version"
32796 #: ../src/guestfs-actions.pod:7748
32799 " struct guestfs_version *\n"
32800 " guestfs_version (guestfs_h *g);\n"
32805 #: ../src/guestfs-actions.pod:7776
32807 "I<Note:> Don't use this call to test for availability of features. In "
32808 "enterprise distributions we backport features from later versions into "
32809 "earlier versions, making this an unreliable way to test for features. Use "
32810 "C<guestfs_available> instead."
32814 #: ../src/guestfs-actions.pod:7782
32816 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
32817 "error. I<The caller must call C<guestfs_free_version> after use>."
32821 #: ../src/guestfs-actions.pod:7786
32822 msgid "(Added in 1.0.58)"
32826 #: ../src/guestfs-actions.pod:7788
32827 msgid "guestfs_vfs_label"
32831 #: ../src/guestfs-actions.pod:7790
32835 " guestfs_vfs_label (guestfs_h *g,\n"
32836 " const char *device);\n"
32841 #: ../src/guestfs-actions.pod:7799
32842 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
32846 #: ../src/guestfs-actions.pod:7804 ../src/guestfs-actions.pod:7841
32847 msgid "(Added in 1.3.18)"
32851 #: ../src/guestfs-actions.pod:7806
32852 msgid "guestfs_vfs_type"
32856 #: ../src/guestfs-actions.pod:7808
32860 " guestfs_vfs_type (guestfs_h *g,\n"
32861 " const char *device);\n"
32866 #: ../src/guestfs-actions.pod:7825
32867 msgid "guestfs_vfs_uuid"
32871 #: ../src/guestfs-actions.pod:7827
32875 " guestfs_vfs_uuid (guestfs_h *g,\n"
32876 " const char *device);\n"
32881 #: ../src/guestfs-actions.pod:7836
32882 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
32886 #: ../src/guestfs-actions.pod:7843
32887 msgid "guestfs_vg_activate"
32891 #: ../src/guestfs-actions.pod:7845
32895 " guestfs_vg_activate (guestfs_h *g,\n"
32897 " char *const *volgroups);\n"
32902 #: ../src/guestfs-actions.pod:7862
32903 msgid "guestfs_vg_activate_all"
32907 #: ../src/guestfs-actions.pod:7864
32911 " guestfs_vg_activate_all (guestfs_h *g,\n"
32912 " int activate);\n"
32917 #: ../src/guestfs-actions.pod:7877
32918 msgid "guestfs_vgcreate"
32922 #: ../src/guestfs-actions.pod:7879
32926 " guestfs_vgcreate (guestfs_h *g,\n"
32927 " const char *volgroup,\n"
32928 " char *const *physvols);\n"
32933 #: ../src/guestfs-actions.pod:7891
32934 msgid "guestfs_vglvuuids"
32938 #: ../src/guestfs-actions.pod:7893
32942 " guestfs_vglvuuids (guestfs_h *g,\n"
32943 " const char *vgname);\n"
32948 #: ../src/guestfs-actions.pod:7900
32950 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
32951 "associate logical volumes and volume groups."
32955 #: ../src/guestfs-actions.pod:7903
32956 msgid "See also C<guestfs_vgpvuuids>."
32960 #: ../src/guestfs-actions.pod:7911
32961 msgid "guestfs_vgpvuuids"
32965 #: ../src/guestfs-actions.pod:7913
32969 " guestfs_vgpvuuids (guestfs_h *g,\n"
32970 " const char *vgname);\n"
32975 #: ../src/guestfs-actions.pod:7920
32977 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
32978 "associate physical volumes and volume groups."
32982 #: ../src/guestfs-actions.pod:7923
32983 msgid "See also C<guestfs_vglvuuids>."
32987 #: ../src/guestfs-actions.pod:7931
32988 msgid "guestfs_vgremove"
32992 #: ../src/guestfs-actions.pod:7933
32996 " guestfs_vgremove (guestfs_h *g,\n"
32997 " const char *vgname);\n"
33002 #: ../src/guestfs-actions.pod:7946
33003 msgid "guestfs_vgrename"
33007 #: ../src/guestfs-actions.pod:7948
33011 " guestfs_vgrename (guestfs_h *g,\n"
33012 " const char *volgroup,\n"
33013 " const char *newvolgroup);\n"
33018 #: ../src/guestfs-actions.pod:7959
33019 msgid "guestfs_vgs"
33023 #: ../src/guestfs-actions.pod:7961
33027 " guestfs_vgs (guestfs_h *g);\n"
33032 #: ../src/guestfs-actions.pod:7970
33033 msgid "See also C<guestfs_vgs_full>."
33037 #: ../src/guestfs-actions.pod:7978
33038 msgid "guestfs_vgs_full"
33042 #: ../src/guestfs-actions.pod:7980
33045 " struct guestfs_lvm_vg_list *\n"
33046 " guestfs_vgs_full (guestfs_h *g);\n"
33051 #: ../src/guestfs-actions.pod:7986
33053 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
33054 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
33058 #: ../src/guestfs-actions.pod:7992
33059 msgid "guestfs_vgscan"
33063 #: ../src/guestfs-actions.pod:7994
33067 " guestfs_vgscan (guestfs_h *g);\n"
33072 #: ../src/guestfs-actions.pod:8004
33073 msgid "guestfs_vguuid"
33077 #: ../src/guestfs-actions.pod:8006
33081 " guestfs_vguuid (guestfs_h *g,\n"
33082 " const char *vgname);\n"
33087 #: ../src/guestfs-actions.pod:8017
33088 msgid "guestfs_wait_ready"
33092 #: ../src/guestfs-actions.pod:8019
33096 " guestfs_wait_ready (guestfs_h *g);\n"
33101 #: ../src/guestfs-actions.pod:8022
33103 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
33108 #: ../src/guestfs-actions.pod:8029
33109 msgid "This function is a no op."
33113 #: ../src/guestfs-actions.pod:8031
33115 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
33116 "calling C<guestfs_launch> to wait for the launch to complete. However this "
33117 "is no longer necessary because C<guestfs_launch> now does the waiting."
33121 #: ../src/guestfs-actions.pod:8036
33123 "If you see any calls to this function in code then you can just remove them, "
33124 "unless you want to retain compatibility with older versions of the API."
33128 #: ../src/guestfs-actions.pod:8044
33129 msgid "guestfs_wc_c"
33133 #: ../src/guestfs-actions.pod:8046
33137 " guestfs_wc_c (guestfs_h *g,\n"
33138 " const char *path);\n"
33143 #: ../src/guestfs-actions.pod:8057
33144 msgid "guestfs_wc_l"
33148 #: ../src/guestfs-actions.pod:8059
33152 " guestfs_wc_l (guestfs_h *g,\n"
33153 " const char *path);\n"
33158 #: ../src/guestfs-actions.pod:8070
33159 msgid "guestfs_wc_w"
33163 #: ../src/guestfs-actions.pod:8072
33167 " guestfs_wc_w (guestfs_h *g,\n"
33168 " const char *path);\n"
33173 #: ../src/guestfs-actions.pod:8083
33174 msgid "guestfs_write"
33178 #: ../src/guestfs-actions.pod:8085
33182 " guestfs_write (guestfs_h *g,\n"
33183 " const char *path,\n"
33184 " const char *content,\n"
33185 " size_t content_size);\n"
33190 #: ../src/guestfs-actions.pod:8094
33191 msgid "See also C<guestfs_write_append>."
33195 #: ../src/guestfs-actions.pod:8103
33196 msgid "guestfs_write_append"
33200 #: ../src/guestfs-actions.pod:8105
33204 " guestfs_write_append (guestfs_h *g,\n"
33205 " const char *path,\n"
33206 " const char *content,\n"
33207 " size_t content_size);\n"
33212 #: ../src/guestfs-actions.pod:8114
33213 msgid "See also C<guestfs_write>."
33217 #: ../src/guestfs-actions.pod:8123
33218 msgid "guestfs_write_file"
33222 #: ../src/guestfs-actions.pod:8125
33226 " guestfs_write_file (guestfs_h *g,\n"
33227 " const char *path,\n"
33228 " const char *content,\n"
33234 #: ../src/guestfs-actions.pod:8131
33236 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
33241 #: ../src/guestfs-actions.pod:8156
33242 msgid "guestfs_zegrep"
33246 #: ../src/guestfs-actions.pod:8158
33250 " guestfs_zegrep (guestfs_h *g,\n"
33251 " const char *regex,\n"
33252 " const char *path);\n"
33257 #: ../src/guestfs-actions.pod:8175
33258 msgid "guestfs_zegrepi"
33262 #: ../src/guestfs-actions.pod:8177
33266 " guestfs_zegrepi (guestfs_h *g,\n"
33267 " const char *regex,\n"
33268 " const char *path);\n"
33273 #: ../src/guestfs-actions.pod:8194
33274 msgid "guestfs_zero"
33278 #: ../src/guestfs-actions.pod:8196
33282 " guestfs_zero (guestfs_h *g,\n"
33283 " const char *device);\n"
33288 #: ../src/guestfs-actions.pod:8210
33290 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
33291 "C<guestfs_is_zero_device>"
33295 #: ../src/guestfs-actions.pod:8222
33296 msgid "guestfs_zero_device"
33300 #: ../src/guestfs-actions.pod:8224
33304 " guestfs_zero_device (guestfs_h *g,\n"
33305 " const char *device);\n"
33310 #: ../src/guestfs-actions.pod:8228
33312 "This command writes zeroes over the entire C<device>. Compare with "
33313 "C<guestfs_zero> which just zeroes the first few blocks of a device."
33317 #: ../src/guestfs-actions.pod:8246
33318 msgid "(Added in 1.3.1)"
33322 #: ../src/guestfs-actions.pod:8248
33323 msgid "guestfs_zerofree"
33327 #: ../src/guestfs-actions.pod:8250
33331 " guestfs_zerofree (guestfs_h *g,\n"
33332 " const char *device);\n"
33337 #: ../src/guestfs-actions.pod:8269
33338 msgid "guestfs_zfgrep"
33342 #: ../src/guestfs-actions.pod:8271
33346 " guestfs_zfgrep (guestfs_h *g,\n"
33347 " const char *pattern,\n"
33348 " const char *path);\n"
33353 #: ../src/guestfs-actions.pod:8288
33354 msgid "guestfs_zfgrepi"
33358 #: ../src/guestfs-actions.pod:8290
33362 " guestfs_zfgrepi (guestfs_h *g,\n"
33363 " const char *pattern,\n"
33364 " const char *path);\n"
33369 #: ../src/guestfs-actions.pod:8307
33370 msgid "guestfs_zfile"
33374 #: ../src/guestfs-actions.pod:8309
33378 " guestfs_zfile (guestfs_h *g,\n"
33379 " const char *meth,\n"
33380 " const char *path);\n"
33385 #: ../src/guestfs-actions.pod:8314
33387 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
33392 #: ../src/guestfs-actions.pod:8326
33394 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
33399 #: ../src/guestfs-actions.pod:8334
33400 msgid "guestfs_zgrep"
33404 #: ../src/guestfs-actions.pod:8336
33408 " guestfs_zgrep (guestfs_h *g,\n"
33409 " const char *regex,\n"
33410 " const char *path);\n"
33415 #: ../src/guestfs-actions.pod:8353
33416 msgid "guestfs_zgrepi"
33420 #: ../src/guestfs-actions.pod:8355
33424 " guestfs_zgrepi (guestfs_h *g,\n"
33425 " const char *regex,\n"
33426 " const char *path);\n"
33431 #: ../src/guestfs-availability.pod:3
33436 #: ../src/guestfs-availability.pod:5
33438 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
33439 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
33440 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
33441 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
33442 "L</guestfs_aug_save> L</guestfs_aug_set>"
33446 #: ../src/guestfs-availability.pod:21
33451 #: ../src/guestfs-availability.pod:23
33452 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
33456 #: ../src/guestfs-availability.pod:26
33461 #: ../src/guestfs-availability.pod:28
33462 msgid "The following functions: L</guestfs_grub_install>"
33466 #: ../src/guestfs-availability.pod:31
33471 #: ../src/guestfs-availability.pod:33
33473 "The following functions: L</guestfs_inotify_add_watch> L</"
33474 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
33475 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
33479 #: ../src/guestfs-availability.pod:41
33480 msgid "B<linuxfsuuid>"
33484 #: ../src/guestfs-availability.pod:43
33486 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
33487 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
33491 #: ../src/guestfs-availability.pod:50
33492 msgid "B<linuxmodules>"
33496 #: ../src/guestfs-availability.pod:52
33497 msgid "The following functions: L</guestfs_modprobe>"
33501 #: ../src/guestfs-availability.pod:55
33502 msgid "B<linuxxattrs>"
33506 #: ../src/guestfs-availability.pod:57
33508 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
33509 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
33510 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
33511 "guestfs_setxattr>"
33515 #: ../src/guestfs-availability.pod:68
33520 #: ../src/guestfs-availability.pod:70
33522 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
33523 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
33524 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
33528 #: ../src/guestfs-availability.pod:79
33533 #: ../src/guestfs-availability.pod:81
33535 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
33536 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
33537 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
33538 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
33539 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
33540 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
33541 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
33545 #: ../src/guestfs-availability.pod:104
33550 #: ../src/guestfs-availability.pod:106
33552 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
33553 "guestfs_mknod_b> L</guestfs_mknod_c>"
33557 #: ../src/guestfs-availability.pod:112
33562 #: ../src/guestfs-availability.pod:114
33563 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
33567 #: ../src/guestfs-availability.pod:117
33568 msgid "B<ntfsprogs>"
33572 #: ../src/guestfs-availability.pod:119
33574 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
33575 "L</guestfs_ntfsresize_size>"
33579 #: ../src/guestfs-availability.pod:124
33580 msgid "B<realpath>"
33584 #: ../src/guestfs-availability.pod:126
33585 msgid "The following functions: L</guestfs_realpath>"
33589 #: ../src/guestfs-availability.pod:129
33594 #: ../src/guestfs-availability.pod:131
33596 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
33597 "guestfs_scrub_freespace>"
33601 #: ../src/guestfs-availability.pod:136
33606 #: ../src/guestfs-availability.pod:138
33607 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
33611 #: ../src/guestfs-availability.pod:142
33616 #: ../src/guestfs-availability.pod:144
33617 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
33621 #: ../src/guestfs-availability.pod:148
33622 msgid "B<zerofree>"
33626 #: ../src/guestfs-availability.pod:150
33627 msgid "The following functions: L</guestfs_zerofree>"
33631 #: ../src/guestfs-structs.pod:1
33632 msgid "guestfs_int_bool"
33636 #: ../src/guestfs-structs.pod:3
33639 " struct guestfs_int_bool {\n"
33647 #: ../src/guestfs-structs.pod:8
33650 " struct guestfs_int_bool_list {\n"
33651 " uint32_t len; /* Number of elements in list. */\n"
33652 " struct guestfs_int_bool *val; /* Elements. */\n"
33658 #: ../src/guestfs-structs.pod:13
33661 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
33662 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
33667 #: ../src/guestfs-structs.pod:16
33668 msgid "guestfs_lvm_pv"
33672 #: ../src/guestfs-structs.pod:18
33675 " struct guestfs_lvm_pv {\n"
33676 " char *pv_name;\n"
33677 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33678 " char pv_uuid[32];\n"
33680 " uint64_t pv_size;\n"
33681 " uint64_t dev_size;\n"
33682 " uint64_t pv_free;\n"
33683 " uint64_t pv_used;\n"
33684 " char *pv_attr;\n"
33685 " int64_t pv_pe_count;\n"
33686 " int64_t pv_pe_alloc_count;\n"
33687 " char *pv_tags;\n"
33688 " uint64_t pe_start;\n"
33689 " int64_t pv_mda_count;\n"
33690 " uint64_t pv_mda_free;\n"
33696 #: ../src/guestfs-structs.pod:36
33699 " struct guestfs_lvm_pv_list {\n"
33700 " uint32_t len; /* Number of elements in list. */\n"
33701 " struct guestfs_lvm_pv *val; /* Elements. */\n"
33707 #: ../src/guestfs-structs.pod:41
33710 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
33711 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
33716 #: ../src/guestfs-structs.pod:44
33717 msgid "guestfs_lvm_vg"
33721 #: ../src/guestfs-structs.pod:46
33724 " struct guestfs_lvm_vg {\n"
33725 " char *vg_name;\n"
33726 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33727 " char vg_uuid[32];\n"
33729 " char *vg_attr;\n"
33730 " uint64_t vg_size;\n"
33731 " uint64_t vg_free;\n"
33732 " char *vg_sysid;\n"
33733 " uint64_t vg_extent_size;\n"
33734 " int64_t vg_extent_count;\n"
33735 " int64_t vg_free_count;\n"
33736 " int64_t max_lv;\n"
33737 " int64_t max_pv;\n"
33738 " int64_t pv_count;\n"
33739 " int64_t lv_count;\n"
33740 " int64_t snap_count;\n"
33741 " int64_t vg_seqno;\n"
33742 " char *vg_tags;\n"
33743 " int64_t vg_mda_count;\n"
33744 " uint64_t vg_mda_free;\n"
33750 #: ../src/guestfs-structs.pod:69
33753 " struct guestfs_lvm_vg_list {\n"
33754 " uint32_t len; /* Number of elements in list. */\n"
33755 " struct guestfs_lvm_vg *val; /* Elements. */\n"
33761 #: ../src/guestfs-structs.pod:74
33764 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
33765 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
33770 #: ../src/guestfs-structs.pod:77
33771 msgid "guestfs_lvm_lv"
33775 #: ../src/guestfs-structs.pod:79
33778 " struct guestfs_lvm_lv {\n"
33779 " char *lv_name;\n"
33780 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
33781 " char lv_uuid[32];\n"
33782 " char *lv_attr;\n"
33783 " int64_t lv_major;\n"
33784 " int64_t lv_minor;\n"
33785 " int64_t lv_kernel_major;\n"
33786 " int64_t lv_kernel_minor;\n"
33787 " uint64_t lv_size;\n"
33788 " int64_t seg_count;\n"
33790 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
33791 " float snap_percent;\n"
33792 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
33793 " float copy_percent;\n"
33794 " char *move_pv;\n"
33795 " char *lv_tags;\n"
33796 " char *mirror_log;\n"
33797 " char *modules;\n"
33803 #: ../src/guestfs-structs.pod:101
33806 " struct guestfs_lvm_lv_list {\n"
33807 " uint32_t len; /* Number of elements in list. */\n"
33808 " struct guestfs_lvm_lv *val; /* Elements. */\n"
33814 #: ../src/guestfs-structs.pod:106
33817 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
33818 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
33823 #: ../src/guestfs-structs.pod:111
33826 " struct guestfs_stat {\n"
33830 " int64_t nlink;\n"
33835 " int64_t blksize;\n"
33836 " int64_t blocks;\n"
33837 " int64_t atime;\n"
33838 " int64_t mtime;\n"
33839 " int64_t ctime;\n"
33845 #: ../src/guestfs-structs.pod:127
33848 " struct guestfs_stat_list {\n"
33849 " uint32_t len; /* Number of elements in list. */\n"
33850 " struct guestfs_stat *val; /* Elements. */\n"
33856 #: ../src/guestfs-structs.pod:132
33859 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
33860 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
33865 #: ../src/guestfs-structs.pod:137
33868 " struct guestfs_statvfs {\n"
33869 " int64_t bsize;\n"
33870 " int64_t frsize;\n"
33871 " int64_t blocks;\n"
33872 " int64_t bfree;\n"
33873 " int64_t bavail;\n"
33874 " int64_t files;\n"
33875 " int64_t ffree;\n"
33876 " int64_t favail;\n"
33879 " int64_t namemax;\n"
33885 #: ../src/guestfs-structs.pod:151
33888 " struct guestfs_statvfs_list {\n"
33889 " uint32_t len; /* Number of elements in list. */\n"
33890 " struct guestfs_statvfs *val; /* Elements. */\n"
33896 #: ../src/guestfs-structs.pod:156
33899 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
33900 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
33905 #: ../src/guestfs-structs.pod:159
33906 msgid "guestfs_dirent"
33910 #: ../src/guestfs-structs.pod:161
33913 " struct guestfs_dirent {\n"
33922 #: ../src/guestfs-structs.pod:167
33925 " struct guestfs_dirent_list {\n"
33926 " uint32_t len; /* Number of elements in list. */\n"
33927 " struct guestfs_dirent *val; /* Elements. */\n"
33933 #: ../src/guestfs-structs.pod:172
33936 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
33937 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
33942 #: ../src/guestfs-structs.pod:177
33945 " struct guestfs_version {\n"
33946 " int64_t major;\n"
33947 " int64_t minor;\n"
33948 " int64_t release;\n"
33955 #: ../src/guestfs-structs.pod:184
33958 " struct guestfs_version_list {\n"
33959 " uint32_t len; /* Number of elements in list. */\n"
33960 " struct guestfs_version *val; /* Elements. */\n"
33966 #: ../src/guestfs-structs.pod:189
33969 " void guestfs_free_version (struct guestfs_free_version *);\n"
33970 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
33975 #: ../src/guestfs-structs.pod:192
33976 msgid "guestfs_xattr"
33980 #: ../src/guestfs-structs.pod:194
33983 " struct guestfs_xattr {\n"
33984 " char *attrname;\n"
33985 " /* The next two fields describe a byte array. */\n"
33986 " uint32_t attrval_len;\n"
33987 " char *attrval;\n"
33993 #: ../src/guestfs-structs.pod:201
33996 " struct guestfs_xattr_list {\n"
33997 " uint32_t len; /* Number of elements in list. */\n"
33998 " struct guestfs_xattr *val; /* Elements. */\n"
34004 #: ../src/guestfs-structs.pod:206
34007 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
34008 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
34013 #: ../src/guestfs-structs.pod:209
34014 msgid "guestfs_inotify_event"
34018 #: ../src/guestfs-structs.pod:211
34021 " struct guestfs_inotify_event {\n"
34022 " int64_t in_wd;\n"
34023 " uint32_t in_mask;\n"
34024 " uint32_t in_cookie;\n"
34025 " char *in_name;\n"
34031 #: ../src/guestfs-structs.pod:218
34034 " struct guestfs_inotify_event_list {\n"
34035 " uint32_t len; /* Number of elements in list. */\n"
34036 " struct guestfs_inotify_event *val; /* Elements. */\n"
34042 #: ../src/guestfs-structs.pod:223
34045 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
34046 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
34051 #: ../src/guestfs-structs.pod:226
34052 msgid "guestfs_partition"
34056 #: ../src/guestfs-structs.pod:228
34059 " struct guestfs_partition {\n"
34060 " int32_t part_num;\n"
34061 " uint64_t part_start;\n"
34062 " uint64_t part_end;\n"
34063 " uint64_t part_size;\n"
34069 #: ../src/guestfs-structs.pod:235
34072 " struct guestfs_partition_list {\n"
34073 " uint32_t len; /* Number of elements in list. */\n"
34074 " struct guestfs_partition *val; /* Elements. */\n"
34080 #: ../src/guestfs-structs.pod:240
34083 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
34084 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
34089 #: ../src/guestfs-structs.pod:243
34090 msgid "guestfs_application"
34094 #: ../src/guestfs-structs.pod:245
34097 " struct guestfs_application {\n"
34098 " char *app_name;\n"
34099 " char *app_display_name;\n"
34100 " int32_t app_epoch;\n"
34101 " char *app_version;\n"
34102 " char *app_release;\n"
34103 " char *app_install_path;\n"
34104 " char *app_trans_path;\n"
34105 " char *app_publisher;\n"
34106 " char *app_url;\n"
34107 " char *app_source_package;\n"
34108 " char *app_summary;\n"
34109 " char *app_description;\n"
34115 #: ../src/guestfs-structs.pod:260
34118 " struct guestfs_application_list {\n"
34119 " uint32_t len; /* Number of elements in list. */\n"
34120 " struct guestfs_application *val; /* Elements. */\n"
34126 #: ../src/guestfs-structs.pod:265
34129 " void guestfs_free_application (struct guestfs_free_application *);\n"
34130 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
34135 #: ../src/guestfs.pod:5
34136 msgid "guestfs - Library for accessing and modifying virtual machine images"
34140 #: ../src/guestfs.pod:11
34143 " guestfs_h *g = guestfs_create ();\n"
34144 " guestfs_add_drive (g, \"guest.img\");\n"
34145 " guestfs_launch (g);\n"
34146 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
34147 " guestfs_touch (g, \"/hello\");\n"
34148 " guestfs_umount (g, \"/\");\n"
34149 " guestfs_close (g);\n"
34152 " guestfs_h *g = guestfs_create ();\n"
34153 " guestfs_add_drive (g, \"guest.img\");\n"
34154 " guestfs_launch (g);\n"
34155 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
34156 " guestfs_touch (g, \"/hello\");\n"
34157 " guestfs_umount (g, \"/\");\n"
34158 " guestfs_close (g);\n"
34162 #: ../src/guestfs.pod:25
34164 "Libguestfs is a library for accessing and modifying guest disk images. "
34165 "Amongst the things this is good for: making batch configuration changes to "
34166 "guests, getting disk used/free statistics (see also: virt-df), migrating "
34167 "between virtualization systems (see also: virt-p2v), performing partial "
34168 "backups, performing partial guest clones, cloning guests and changing "
34169 "registry/UUID/hostname info, and much else besides."
34173 #: ../src/guestfs.pod:33
34175 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
34176 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
34177 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
34182 #: ../src/guestfs.pod:38
34184 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
34185 "what filesystem is in each LV, etc.). It can also run commands in the "
34186 "context of the guest. Also you can access filesystems over FUSE."
34190 #: ../src/guestfs.pod:43
34192 "Libguestfs is a library that can be linked with C and C++ management "
34193 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
34194 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
34199 #: ../src/guestfs.pod:48
34201 "You don't need to be root to use libguestfs, although obviously you do need "
34202 "enough permissions to access the disk images."
34206 #: ../src/guestfs.pod:51
34208 "Libguestfs is a large API because it can do many things. For a gentle "
34209 "introduction, please read the L</API OVERVIEW> section next."
34213 #: ../src/guestfs.pod:54
34215 "There are also some example programs in the L<guestfs-examples(3)> manual "
34220 #: ../src/guestfs.pod:57
34221 msgid "API OVERVIEW"
34225 #: ../src/guestfs.pod:59
34227 "This section provides a gentler overview of the libguestfs API. We also try "
34228 "to group API calls together, where that may not be obvious from reading "
34229 "about the individual calls in the main section of this manual."
34233 #: ../src/guestfs.pod:64
34238 #: ../src/guestfs.pod:66
34240 "Before you can use libguestfs calls, you have to create a handle. Then you "
34241 "must add at least one disk image to the handle, followed by launching the "
34242 "handle, then performing whatever operations you want, and finally closing "
34243 "the handle. By convention we use the single letter C<g> for the name of the "
34244 "handle variable, although of course you can use any name you want."
34248 #: ../src/guestfs.pod:73
34249 msgid "The general structure of all libguestfs-using programs looks like this:"
34253 #: ../src/guestfs.pod:76
34256 " guestfs_h *g = guestfs_create ();\n"
34261 #: ../src/guestfs.pod:78
34264 " /* Call guestfs_add_drive additional times if there are\n"
34265 " * multiple disk images.\n"
34267 " guestfs_add_drive (g, \"guest.img\");\n"
34272 #: ../src/guestfs.pod:83
34275 " /* Most manipulation calls won't work until you've launched\n"
34276 " * the handle 'g'. You have to do this _after_ adding drives\n"
34277 " * and _before_ other commands.\n"
34279 " guestfs_launch (g);\n"
34284 #: ../src/guestfs.pod:89
34287 " /* Now you can examine what partitions, LVs etc are available.\n"
34289 " char **partitions = guestfs_list_partitions (g);\n"
34290 " char **logvols = guestfs_lvs (g);\n"
34295 #: ../src/guestfs.pod:94
34298 " /* To access a filesystem in the image, you must mount it.\n"
34300 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
34305 #: ../src/guestfs.pod:98
34308 " /* Now you can perform filesystem actions on the guest\n"
34311 " guestfs_touch (g, \"/hello\");\n"
34316 #: ../src/guestfs.pod:103
34319 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
34320 " * it is done automatically when you close the handle. See\n"
34321 " * discussion of autosync in this page.\n"
34323 " guestfs_sync (g);\n"
34328 #: ../src/guestfs.pod:109
34331 " /* Close the handle 'g'. */\n"
34332 " guestfs_close (g);\n"
34337 #: ../src/guestfs.pod:112
34339 "The code above doesn't include any error checking. In real code you should "
34340 "check return values carefully for errors. In general all functions that "
34341 "return integers return C<-1> on error, and all functions that return "
34342 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
34343 "how to handle errors, and consult the documentation for each function call "
34344 "below to see precisely how they return error indications. See L<guestfs-"
34345 "examples(3)> for fully worked examples."
34349 #: ../src/guestfs.pod:121
34350 msgid "DISK IMAGES"
34354 #: ../src/guestfs.pod:123
34356 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
34357 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
34358 "actual block device, or simply an empty file of zeroes that you have created "
34359 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
34364 #: ../src/guestfs.pod:129
34366 "The call you should use in modern code for adding drives is L</"
34367 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
34368 "specifying that the format is raw, do:"
34372 #: ../src/guestfs.pod:133
34375 " guestfs_add_drive_opts (g, filename,\n"
34376 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
34382 #: ../src/guestfs.pod:137
34383 msgid "You can add a disk read-only using:"
34387 #: ../src/guestfs.pod:139
34390 " guestfs_add_drive_opts (g, filename,\n"
34391 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
34392 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
34398 #: ../src/guestfs.pod:144
34400 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
34401 "libguestfs won't modify the file."
34405 #: ../src/guestfs.pod:147
34407 "Be extremely cautious if the disk image is in use, eg. if it is being used "
34408 "by a virtual machine. Adding it read-write will almost certainly cause disk "
34409 "corruption, but adding it read-only is safe."
34413 #: ../src/guestfs.pod:151
34415 "You must add at least one disk image, and you may add multiple disk images. "
34416 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
34417 "first one you added), C</dev/sdb> (for the second one you added), etc."
34421 #: ../src/guestfs.pod:156
34423 "Once L</guestfs_launch> has been called you cannot add any more images. You "
34424 "can call L</guestfs_list_devices> to get a list of the device names, in the "
34425 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
34429 #: ../src/guestfs.pod:161
34434 #: ../src/guestfs.pod:163
34436 "Before you can read or write files, create directories and so on in a disk "
34437 "image that contains filesystems, you have to mount those filesystems using "
34438 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
34439 "a disk image contains (for example) one partition with a filesystem on that "
34440 "partition, then you can mount it directly:"
34444 #: ../src/guestfs.pod:170
34447 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
34452 #: ../src/guestfs.pod:172
34454 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
34455 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
34456 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
34457 "that these are libguestfs virtual devices, and are nothing to do with host "
34462 #: ../src/guestfs.pod:178
34464 "If you are given a disk image and you don't know what it contains then you "
34465 "have to find out. Libguestfs can do that too: use L</"
34466 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
34467 "LVs, and either try mounting each to see what is mountable, or else examine "
34468 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
34469 "filesystems, use L</guestfs_list_filesystems>."
34473 #: ../src/guestfs.pod:186
34475 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
34476 "L</INSPECTION> below). But you might find it easier to look at higher level "
34477 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
34481 #: ../src/guestfs.pod:191
34483 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
34484 "several other variations of the C<guestfs_mount_*> call."
34488 #: ../src/guestfs.pod:194
34489 msgid "FILESYSTEM ACCESS AND MODIFICATION"
34493 #: ../src/guestfs.pod:196
34495 "The majority of the libguestfs API consists of fairly low-level calls for "
34496 "accessing and modifying the files, directories, symlinks etc on mounted "
34497 "filesystems. There are over a hundred such calls which you can find listed "
34498 "in detail below in this man page, and we don't even pretend to cover them "
34499 "all in this overview."
34503 #: ../src/guestfs.pod:202
34505 "Specify filenames as full paths, starting with C<\"/\"> and including the "
34510 #: ../src/guestfs.pod:205
34512 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
34513 "the file called C<\"etc/passwd\"> then you could do:"
34517 #: ../src/guestfs.pod:208
34520 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
34525 #: ../src/guestfs.pod:210
34527 "This would return C<data> as a newly allocated buffer containing the full "
34528 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
34529 "or C<NULL> if there was an error."
34533 #: ../src/guestfs.pod:214
34535 "As another example, to create a top-level directory on that filesystem "
34536 "called C<\"var\"> you would do:"
34540 #: ../src/guestfs.pod:217
34543 " guestfs_mkdir (g, \"/var\");\n"
34548 #: ../src/guestfs.pod:219
34549 msgid "To create a symlink you could do:"
34553 #: ../src/guestfs.pod:221
34556 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
34557 " \"/etc/rc3.d/S30portmap\");\n"
34562 #: ../src/guestfs.pod:224
34564 "Libguestfs will reject attempts to use relative paths and there is no "
34565 "concept of a current working directory."
34569 #: ../src/guestfs.pod:227
34571 "Libguestfs can return errors in many situations: for example if the "
34572 "filesystem isn't writable, or if a file or directory that you requested "
34573 "doesn't exist. If you are using the C API (documented here) you have to "
34574 "check for those error conditions after each call. (Other language bindings "
34575 "turn these errors into exceptions)."
34579 #: ../src/guestfs.pod:233
34581 "File writes are affected by the per-handle umask, set by calling L</"
34582 "guestfs_umask> and defaulting to 022. See L</UMASK>."
34586 #: ../src/guestfs.pod:236
34587 msgid "PARTITIONING"
34591 #: ../src/guestfs.pod:238
34593 "Libguestfs contains API calls to read, create and modify partition tables on "
34598 #: ../src/guestfs.pod:241
34600 "In the common case where you want to create a single partition covering the "
34601 "whole disk, you should use the L</guestfs_part_disk> call:"
34605 #: ../src/guestfs.pod:245
34608 " const char *parttype = \"mbr\";\n"
34609 " if (disk_is_larger_than_2TB)\n"
34610 " parttype = \"gpt\";\n"
34611 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
34616 #: ../src/guestfs.pod:250
34618 "Obviously this effectively wipes anything that was on that disk image before."
34622 #: ../src/guestfs.pod:253
34627 #: ../src/guestfs.pod:255
34629 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
34630 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
34631 "you familiarize yourself with the concepts of physical volumes, volume "
34632 "groups and logical volumes."
34636 #: ../src/guestfs.pod:260
34638 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
34639 "tldp.org/HOWTO/LVM-HOWTO/>."
34643 #: ../src/guestfs.pod:263
34644 msgid "DOWNLOADING"
34648 #: ../src/guestfs.pod:265
34650 "Use L</guestfs_cat> to download small, text only files. This call is "
34651 "limited to files which are less than 2 MB and which cannot contain any ASCII "
34652 "NUL (C<\\0>) characters. However the API is very simple to use."
34656 #: ../src/guestfs.pod:269
34658 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
34659 "bit data, since it returns a (pointer, size) pair. However it is still "
34660 "limited to \"small\" files, less than 2 MB."
34664 #: ../src/guestfs.pod:273
34666 "L</guestfs_download> can be used to download any file, with no limits on "
34667 "content or size (even files larger than 4 GB)."
34671 #: ../src/guestfs.pod:276
34673 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
34677 #: ../src/guestfs.pod:279
34682 #: ../src/guestfs.pod:281
34684 "It's often the case that you want to write a file or files to the disk image."
34688 #: ../src/guestfs.pod:284
34690 "To write a small file with fixed content, use L</guestfs_write>. To create "
34691 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
34692 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
34693 "of other functions for creating test files, for example L</guestfs_fill> and "
34694 "L</guestfs_fill_pattern>."
34698 #: ../src/guestfs.pod:290
34700 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
34701 "file content or size (even files larger than 4 GB)."
34705 #: ../src/guestfs.pod:293
34707 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
34711 #: ../src/guestfs.pod:295
34713 "However the fastest way to upload I<large numbers of arbitrary files> is to "
34714 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
34715 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
34716 "in a predictable way (eg. adding it last after all other drives) then you "
34717 "can get the device name from L</guestfs_list_devices> and mount it directly "
34718 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
34719 "portable between kernel versions, and they don't support labels or UUIDs. "
34720 "If you want to pre-build an image or you need to mount it using a label or "
34721 "UUID, use an ISO image instead."
34725 #: ../src/guestfs.pod:306
34730 #: ../src/guestfs.pod:308
34732 "There are various different commands for copying between files and devices "
34733 "and in and out of the guest filesystem. These are summarised in the table "
34738 #: ../src/guestfs.pod:314
34739 msgid "B<file> to B<file>"
34743 #: ../src/guestfs.pod:316
34745 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
34746 "directories recursively."
34750 #: ../src/guestfs.pod:319
34752 "To copy part of a file (offset and size) use L</guestfs_copy_file_to_file>."
34756 #: ../src/guestfs.pod:322
34757 msgid "B<file> to B<device>"
34761 #: ../src/guestfs.pod:324
34762 msgid "B<device> to B<file>"
34766 #: ../src/guestfs.pod:326
34767 msgid "B<device> to B<device>"
34771 #: ../src/guestfs.pod:328
34773 "Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>, or L</"
34774 "guestfs_copy_device_to_device>."
34778 #: ../src/guestfs.pod:331
34779 msgid "Example: duplicate the contents of an LV:"
34783 #: ../src/guestfs.pod:333
34786 " guestfs_copy_device_to_device (g,\n"
34787 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
34788 " /* -1 marks the end of the list of optional parameters */\n"
34794 #: ../src/guestfs.pod:338
34796 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
34797 "(C</dev/VG/Original>). To copy less than the whole source device, use the "
34798 "optional C<size> parameter:"
34802 #: ../src/guestfs.pod:342
34805 " guestfs_copy_device_to_device (g,\n"
34806 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
34807 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,\n"
34813 #: ../src/guestfs.pod:347
34814 msgid "B<file on the host> to B<file or device>"
34818 #: ../src/guestfs.pod:349
34819 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
34823 #: ../src/guestfs.pod:351
34824 msgid "B<file or device> to B<file on the host>"
34828 #: ../src/guestfs.pod:353
34829 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
34833 #: ../src/guestfs.pod:357
34834 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
34838 #: ../src/guestfs.pod:359
34840 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
34841 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
34842 "appears you can only upload and download to files. However many Un*x-like "
34843 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
34844 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
34845 "and arbitrary file descriptor N."
34849 #: ../src/guestfs.pod:367
34850 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
34854 #: ../src/guestfs.pod:370
34857 " guestfs_download (g, filename, \"/dev/stdout\");\n"
34862 #: ../src/guestfs.pod:372
34863 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
34867 #: ../src/guestfs.pod:374
34870 " char devfd[64];\n"
34871 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
34872 " guestfs_tar_out (g, \"/\", devfd);\n"
34877 #: ../src/guestfs.pod:378
34878 msgid "LISTING FILES"
34882 #: ../src/guestfs.pod:380
34884 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
34885 "L<guestfish(1)>-equivalent command C<ll>)."
34889 #: ../src/guestfs.pod:383
34891 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
34892 "programs, as a flat list of strings."
34896 #: ../src/guestfs.pod:386
34898 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
34899 "directory, plus additional information about each one. It is more "
34900 "equivalent to using the L<readdir(3)> call on a local filesystem."
34904 #: ../src/guestfs.pod:390
34906 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
34910 #: ../src/guestfs.pod:393
34911 msgid "RUNNING COMMANDS"
34915 #: ../src/guestfs.pod:395
34917 "Although libguestfs is primarily an API for manipulating files inside guest "
34918 "images, we also provide some limited facilities for running commands inside "
34923 #: ../src/guestfs.pod:399
34924 msgid "There are many limitations to this:"
34928 #: ../src/guestfs.pod:405
34930 "The kernel version that the command runs under will be different from what "
34935 #: ../src/guestfs.pod:410
34937 "If the command needs to communicate with daemons, then most likely they "
34938 "won't be running."
34942 #: ../src/guestfs.pod:415
34943 msgid "The command will be running in limited memory."
34947 #: ../src/guestfs.pod:419
34949 "The network may not be available unless you enable it (see L</"
34950 "guestfs_set_network>)."
34954 #: ../src/guestfs.pod:424
34955 msgid "Only supports Linux guests (not Windows, BSD, etc)."
34959 #: ../src/guestfs.pod:428
34961 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
34965 #: ../src/guestfs.pod:433
34967 "For SELinux guests, you may need to enable SELinux and load policy first. "
34968 "See L</SELINUX> in this manpage."
34972 #: ../src/guestfs.pod:438
34974 "I<Security:> It is not safe to run commands from untrusted, possibly "
34975 "malicious guests. These commands may attempt to exploit your program by "
34976 "sending unexpected output. They could also try to exploit the Linux kernel "
34977 "or qemu provided by the libguestfs appliance. They could use the network "
34978 "provided by the libguestfs appliance to bypass ordinary network partitions "
34979 "and firewalls. They could use the elevated privileges or different SELinux "
34980 "context of your program to their advantage."
34984 #: ../src/guestfs.pod:447
34986 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
34987 "(a script which runs when the guest next boots normally), and to have this "
34988 "script run the commands you want in the normal context of the running guest, "
34989 "network security and so on. For information about other security issues, "
34990 "see L</SECURITY>."
34994 #: ../src/guestfs.pod:455
34996 "The two main API calls to run commands are L</guestfs_command> and L</"
34997 "guestfs_sh> (there are also variations)."
35001 #: ../src/guestfs.pod:458
35003 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
35004 "shell globs, redirections, etc will work."
35008 #: ../src/guestfs.pod:461
35009 msgid "CONFIGURATION FILES"
35013 #: ../src/guestfs.pod:463
35015 "To read and write configuration files in Linux guest filesystems, we "
35016 "strongly recommend using Augeas. For example, Augeas understands how to "
35017 "read and write, say, a Linux shadow password file or X.org configuration "
35018 "file, and so avoids you having to write that code."
35022 #: ../src/guestfs.pod:468
35024 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
35025 "document Augeas itself here because there is excellent documentation on the "
35026 "L<http://augeas.net/> website."
35030 #: ../src/guestfs.pod:472
35032 "If you don't want to use Augeas (you fool!) then try calling L</"
35033 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
35038 #: ../src/guestfs.pod:476
35043 #: ../src/guestfs.pod:478
35045 "We support SELinux guests. To ensure that labeling happens correctly in "
35046 "SELinux guests, you need to enable SELinux and load the guest's policy:"
35050 #: ../src/guestfs.pod:486
35051 msgid "Before launching, do:"
35055 #: ../src/guestfs.pod:488
35058 " guestfs_set_selinux (g, 1);\n"
35063 #: ../src/guestfs.pod:492
35065 "After mounting the guest's filesystem(s), load the policy. This is best "
35066 "done by running the L<load_policy(8)> command in the guest itself:"
35070 #: ../src/guestfs.pod:496
35073 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
35078 #: ../src/guestfs.pod:498
35080 "(Older versions of C<load_policy> require you to specify the name of the "
35085 #: ../src/guestfs.pod:503
35087 "Optionally, set the security context for the API. The correct security "
35088 "context to use can only be known by inspecting the guest. As an example:"
35092 #: ../src/guestfs.pod:507
35095 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
35100 #: ../src/guestfs.pod:511
35101 msgid "This will work for running commands and editing existing files."
35105 #: ../src/guestfs.pod:513
35107 "When new files are created, you may need to label them explicitly, for "
35108 "example by running the external command C<restorecon pathname>."
35112 #: ../src/guestfs.pod:517
35117 #: ../src/guestfs.pod:519
35119 "Certain calls are affected by the current file mode creation mask (the "
35120 "\"umask\"). In particular ones which create files or directories, such as "
35121 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
35122 "either the default mode that the file is created with or modifies the mode "
35127 #: ../src/guestfs.pod:525
35129 "The default umask is C<022>, so files are created with modes such as C<0644> "
35130 "and directories with C<0755>."
35134 #: ../src/guestfs.pod:528
35136 "There are two ways to avoid being affected by umask. Either set umask to 0 "
35137 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
35138 "guestfs_chmod> after creating each file or directory."
35142 #: ../src/guestfs.pod:532
35143 msgid "For more information about umask, see L<umask(2)>."
35147 #: ../src/guestfs.pod:536
35149 "Libguestfs allows you to access Linux guests which have been encrypted using "
35150 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
35151 "standard. This includes nearly all whole disk encryption systems used by "
35152 "modern Linux guests."
35156 #: ../src/guestfs.pod:542
35158 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
35159 "returns the string C<crypto_LUKS>)."
35163 #: ../src/guestfs.pod:545
35165 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
35166 "will require the passphrase!"
35170 #: ../src/guestfs.pod:548
35172 "Opening a LUKS device creates a new device mapper device called C</dev/"
35173 "mapper/mapname> (where C<mapname> is the string you supply to L</"
35174 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
35175 "from and encrypted to the underlying block device respectively."
35179 #: ../src/guestfs.pod:554
35181 "LVM volume groups on the device can be made visible by calling L</"
35182 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
35183 "(s) can now be mounted in the usual way."
35187 #: ../src/guestfs.pod:558
35189 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
35190 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
35191 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
35192 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
35193 "underlying encrypted block device)."
35197 #: ../src/guestfs.pod:565
35202 #: ../src/guestfs.pod:567
35204 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
35205 "contains operating systems, an install CD or a live CD. (These APIs used to "
35206 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
35207 "version 1.5.3 the most frequently used part of this library has been "
35208 "rewritten in C and moved into the core code)."
35212 #: ../src/guestfs.pod:574
35214 "Add all disks belonging to the unknown virtual machine and call L</"
35215 "guestfs_launch> in the usual way."
35219 #: ../src/guestfs.pod:577
35221 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
35222 "and certain heuristics, and returns a list of operating systems that were "
35223 "found. An empty list means none were found. A single element is the root "
35224 "filesystem of the operating system. For dual- or multi-boot guests, "
35225 "multiple roots can be returned, each one corresponding to a separate "
35226 "operating system. (Multi-boot virtual machines are extremely rare in the "
35227 "world of virtualization, but since this scenario can happen, we have built "
35228 "libguestfs to deal with it.)"
35232 #: ../src/guestfs.pod:586
35234 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
35235 "to get additional details about that operating system. For example, call L</"
35236 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
35237 "Windows and Linux-based operating systems respectively."
35241 #: ../src/guestfs.pod:592
35243 "Un*x-like and Linux-based operating systems usually consist of several "
35244 "filesystems which are mounted at boot time (for example, a separate boot "
35245 "partition mounted on C</boot>). The inspection rules are able to detect how "
35246 "filesystems correspond to mount points. Call "
35247 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
35248 "hash table like this example:"
35252 #: ../src/guestfs.pod:599
35255 " /boot => /dev/sda1\n"
35256 " / => /dev/vg_guest/lv_root\n"
35257 " /usr => /dev/vg_guest/lv_usr\n"
35262 #: ../src/guestfs.pod:603
35264 "The caller can then make calls to L</guestfs_mount_options> to mount the "
35265 "filesystems as suggested."
35269 #: ../src/guestfs.pod:606
35271 "Be careful to mount filesystems in the right order (eg. C</> before C</"
35272 "usr>). Sorting the keys of the hash by length, shortest first, should work."
35276 #: ../src/guestfs.pod:610
35278 "Inspection currently only works for some common operating systems. "
35279 "Contributors are welcome to send patches for other operating systems that we "
35280 "currently cannot detect."
35284 #: ../src/guestfs.pod:614
35286 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
35287 "for more details. The L</guestfs_inspect_os> function just ignores any "
35288 "encrypted devices."
35292 #: ../src/guestfs.pod:618
35294 "A note on the implementation: The call L</guestfs_inspect_os> performs "
35295 "inspection and caches the results in the guest handle. Subsequent calls to "
35296 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
35297 "read the disks. If you change the content of the guest disks, you can redo "
35298 "inspection by calling L</guestfs_inspect_os> again. (L</"
35299 "guestfs_inspect_list_applications> works a little differently from the other "
35300 "calls and does read the disks. See documentation for that function for "
35305 #: ../src/guestfs.pod:627
35306 msgid "INSPECTING INSTALL DISKS"
35310 #: ../src/guestfs.pod:629
35312 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
35317 #: ../src/guestfs.pod:632
35319 "Call L</guestfs_inspect_get_format> to return the format of the operating "
35320 "system, which currently can be C<installed> (a regular operating system) or "
35321 "C<installer> (some sort of install disk)."
35325 #: ../src/guestfs.pod:636
35327 "Further information is available about the operating system that can be "
35328 "installed using the regular inspection APIs like L</"
35329 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
35333 #: ../src/guestfs.pod:641
35335 "Some additional information specific to installer disks is also available "
35336 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
35337 "guestfs_inspect_is_multipart> calls."
35341 #: ../src/guestfs.pod:646
35342 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
35346 #: ../src/guestfs.pod:648
35348 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
35349 "ntfs-3g.org/> driver."
35353 #: ../src/guestfs.pod:651
35354 msgid "DRIVE LETTERS AND PATHS"
35358 #: ../src/guestfs.pod:653
35360 "DOS and Windows still use drive letters, and the filesystems are always "
35361 "treated as case insensitive by Windows itself, and therefore you might find "
35362 "a Windows configuration file referring to a path like C<c:\\windows"
35363 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
35364 "might be referred to as C</WINDOWS/System32>."
35368 #: ../src/guestfs.pod:659
35370 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
35371 "L</guestfs_inspect_get_drive_mappings>)"
35375 #: ../src/guestfs.pod:662
35377 "Dealing with separator characters (backslash vs forward slash) is outside "
35378 "the scope of libguestfs, but usually a simple character replacement will "
35383 #: ../src/guestfs.pod:666
35385 "To resolve the case insensitivity of paths, call L</"
35386 "guestfs_case_sensitive_path>."
35390 #: ../src/guestfs.pod:669
35391 msgid "ACCESSING THE WINDOWS REGISTRY"
35395 #: ../src/guestfs.pod:671
35397 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
35398 "files, through the library C<hivex> which is part of the libguestfs project "
35399 "although ships as a separate tarball. You have to locate and download the "
35400 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
35401 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
35402 "reg(1)> for more help on this issue."
35406 #: ../src/guestfs.pod:679
35407 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
35411 #: ../src/guestfs.pod:681
35413 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
35414 "provide something which looks like a Linux symlink. The way it tries to do "
35415 "the rewriting is described here:"
35419 #: ../src/guestfs.pod:685
35421 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
35426 #: ../src/guestfs.pod:687
35428 "The essential problem is that ntfs-3g simply does not have enough "
35429 "information to do a correct job. NTFS links can contain drive letters and "
35430 "references to external device GUIDs that ntfs-3g has no way of resolving. "
35431 "It is almost certainly the case that libguestfs callers should ignore what "
35432 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
35436 #: ../src/guestfs.pod:694
35438 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
35439 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
35440 "attribute, and read the raw reparse data from that (you can find the format "
35441 "documented in various places around the web)."
35445 #: ../src/guestfs.pod:699
35446 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
35450 #: ../src/guestfs.pod:701
35452 "There are other useful extended attributes that can be read from ntfs-3g "
35453 "filesystems (using L</guestfs_getxattr>). See:"
35457 #: ../src/guestfs.pod:704
35459 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
35463 #: ../src/guestfs.pod:706
35464 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
35468 #: ../src/guestfs.pod:708
35470 "Although we don't want to discourage you from using the C API, we will "
35471 "mention here that the same API is also available in other languages."
35475 #: ../src/guestfs.pod:711
35477 "The API is broadly identical in all supported languages. This means that "
35478 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
35479 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
35480 "OCaml. In other words, a straightforward, predictable isomorphism between "
35485 #: ../src/guestfs.pod:717
35487 "Error messages are automatically transformed into exceptions if the language "
35492 #: ../src/guestfs.pod:720
35494 "We don't try to \"object orientify\" parts of the API in OO languages, "
35495 "although contributors are welcome to write higher level APIs above what we "
35496 "provide in their favourite languages if they wish."
35500 #: ../src/guestfs.pod:726
35505 #: ../src/guestfs.pod:728
35507 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
35508 "identical to the C API. C++ classes and exceptions are not used."
35512 #: ../src/guestfs.pod:732
35517 #: ../src/guestfs.pod:734
35519 "The C# bindings are highly experimental. Please read the warnings at the "
35520 "top of C<csharp/Libguestfs.cs>."
35524 #: ../src/guestfs.pod:737
35529 #: ../src/guestfs.pod:739
35530 msgid "See L<guestfs-erlang(3)>."
35534 #: ../src/guestfs.pod:741
35539 #: ../src/guestfs.pod:743
35541 "This is the only language binding that is working but incomplete. Only "
35542 "calls which return simple integers have been bound in Haskell, and we are "
35543 "looking for help to complete this binding."
35547 #: ../src/guestfs.pod:747
35552 #: ../src/guestfs.pod:749
35554 "Full documentation is contained in the Javadoc which is distributed with "
35555 "libguestfs. For examples, see L<guestfs-java(3)>."
35559 #: ../src/guestfs.pod:752
35564 #: ../src/guestfs.pod:754
35565 msgid "See L<guestfs-ocaml(3)>."
35569 #: ../src/guestfs.pod:756
35574 #: ../src/guestfs.pod:758
35575 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
35579 #: ../src/guestfs.pod:760
35584 #: ../src/guestfs.pod:762
35586 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
35587 "the php-libguestfs package for your distribution."
35591 #: ../src/guestfs.pod:765
35592 msgid "The PHP binding only works correctly on 64 bit machines."
35596 #: ../src/guestfs.pod:767
35601 #: ../src/guestfs.pod:769
35602 msgid "See L<guestfs-python(3)>."
35606 #: ../src/guestfs.pod:771
35611 #: ../src/guestfs.pod:773
35612 msgid "See L<guestfs-ruby(3)>."
35616 #: ../src/guestfs.pod:775
35617 msgid "B<shell scripts>"
35621 #: ../src/guestfs.pod:777
35622 msgid "See L<guestfish(1)>."
35626 #: ../src/guestfs.pod:781
35627 msgid "LIBGUESTFS GOTCHAS"
35631 #: ../src/guestfs.pod:783
35633 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
35634 "system [...] that works in the way it is documented but is counterintuitive "
35635 "and almost invites mistakes.\""
35639 #: ../src/guestfs.pod:787
35641 "Since we developed libguestfs and the associated tools, there are several "
35642 "things we would have designed differently, but are now stuck with for "
35643 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
35644 "release, you can expect these to change. Beware of them."
35648 #: ../src/guestfs.pod:795
35649 msgid "Autosync / forgetting to sync."
35653 #: ../src/guestfs.pod:797
35655 "I<Update:> Autosync is enabled by default for all API users starting from "
35656 "libguestfs 1.5.24. This section only applies to older versions."
35660 #: ../src/guestfs.pod:800
35662 "When modifying a filesystem from C or another language, you B<must> unmount "
35663 "all filesystems and call L</guestfs_sync> explicitly before you close the "
35664 "libguestfs handle. You can also call:"
35668 #: ../src/guestfs.pod:804
35671 " guestfs_set_autosync (g, 1);\n"
35676 #: ../src/guestfs.pod:806
35678 "to have the unmount/sync done automatically for you when the handle 'g' is "
35679 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
35683 #: ../src/guestfs.pod:810
35685 "If you forget to do this, then it is entirely possible that your changes "
35686 "won't be written out, or will be partially written, or (very rarely) that "
35687 "you'll get disk corruption."
35691 #: ../src/guestfs.pod:814
35693 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
35694 "guestfish scripts that forget to sync will work just fine, which can make "
35695 "this very puzzling if you are trying to debug a problem."
35699 #: ../src/guestfs.pod:818
35700 msgid "Mount option C<-o sync> should not be the default."
35704 #: ../src/guestfs.pod:820
35706 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
35707 "libguestfs 1.13.16. This section only applies to older versions."
35711 #: ../src/guestfs.pod:823
35713 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
35714 "However C<-o sync> does not add any reliability benefit, but does have a "
35715 "very large performance impact."
35719 #: ../src/guestfs.pod:827
35721 "The work around is to use L</guestfs_mount_options> and set the mount "
35722 "options that you actually want to use."
35726 #: ../src/guestfs.pod:830
35727 msgid "Read-only should be the default."
35731 #: ../src/guestfs.pod:832
35733 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
35734 "specify I<--rw> if you want to make changes to the image."
35738 #: ../src/guestfs.pod:835
35739 msgid "This would reduce the potential to corrupt live VM images."
35743 #: ../src/guestfs.pod:837
35745 "Note that many filesystems change the disk when you just mount and unmount, "
35746 "even if you didn't perform any writes. You need to use L</"
35747 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
35751 #: ../src/guestfs.pod:841
35752 msgid "guestfish command line is hard to use."
35756 #: ../src/guestfs.pod:843
35758 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
35759 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
35760 "exist, so it fails. In earlier versions of guestfish the error message was "
35761 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
35762 "we should have used C<guestfish -c command> to run commands."
35766 #: ../src/guestfs.pod:850
35767 msgid "guestfish megabyte modifiers don't work right on all commands"
35771 #: ../src/guestfs.pod:852
35773 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
35774 "other modifiers). What guestfish actually does is to multiply the number "
35775 "part by the modifier part and pass the result to the C API. However this "
35776 "doesn't work for a few APIs which aren't expecting bytes, but are already "
35777 "expecting some other unit (eg. megabytes)."
35781 #: ../src/guestfs.pod:859
35782 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
35786 #: ../src/guestfs.pod:861
35789 " lvcreate LV VG 100M\n"
35794 #: ../src/guestfs.pod:863
35796 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
35797 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
35798 "megabytes * megabytes) logical volume. The error message you get from this "
35799 "is also a little obscure."
35803 #: ../src/guestfs.pod:868
35805 "This could be fixed in the generator by specially marking parameters and "
35806 "return values which take bytes or other units."
35810 #: ../src/guestfs.pod:871
35811 msgid "Ambiguity between devices and paths"
35815 #: ../src/guestfs.pod:873
35817 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
35818 "sdb2>) and a similar pathname. A file might just happen to be called "
35819 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
35823 #: ../src/guestfs.pod:878
35825 "In the current API we usually resolve this ambiguity by having two separate "
35826 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
35827 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
35828 "detecting if the path supplied begins with C</dev/>."
35832 #: ../src/guestfs.pod:884
35834 "To avoid both the ambiguity and the need to duplicate some calls, we could "
35835 "make paths/devices into structured names. One way to do this would be to "
35836 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
35837 "aspect of grub. Another way would be to use a structured type, equivalent "
35838 "to this OCaml type:"
35842 #: ../src/guestfs.pod:890
35845 " type path = Path of string | Device of int | Partition of int * int\n"
35850 #: ../src/guestfs.pod:892
35851 msgid "which would allow you to pass arguments like:"
35855 #: ../src/guestfs.pod:894
35858 " Path \"/foo/bar\"\n"
35859 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
35860 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
35861 " Path \"/dev/sdb2\" (* not a device *)\n"
35866 #: ../src/guestfs.pod:899
35868 "As you can see there are still problems to resolve even with this "
35869 "representation. Also consider how it might work in guestfish."
35873 #: ../src/guestfs.pod:904
35874 msgid "KEYS AND PASSPHRASES"
35878 #: ../src/guestfs.pod:906
35880 "Certain libguestfs calls take a parameter that contains sensitive key "
35881 "material, passed in as a C string."
35885 #: ../src/guestfs.pod:909
35887 "In the future we would hope to change the libguestfs implementation so that "
35888 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
35889 "swap. However this is I<not> done at the moment, because of the complexity "
35890 "of such an implementation."
35894 #: ../src/guestfs.pod:914
35896 "Therefore you should be aware that any key parameter you pass to libguestfs "
35897 "might end up being written out to the swap partition. If this is a concern, "
35898 "scrub the swap partition or don't use libguestfs on encrypted devices."
35902 #: ../src/guestfs.pod:919
35903 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
35907 #: ../src/guestfs.pod:921
35909 "All high-level libguestfs actions are synchronous. If you want to use "
35910 "libguestfs asynchronously then you must create a thread."
35914 #: ../src/guestfs.pod:924
35916 "Only use the handle from a single thread. Either use the handle exclusively "
35917 "from one thread, or provide your own mutex so that two threads cannot issue "
35918 "calls on the same handle at the same time."
35922 #: ../src/guestfs.pod:928
35924 "See the graphical program guestfs-browser for one possible architecture for "
35925 "multithreaded programs using libvirt and libguestfs."
35929 #: ../src/guestfs.pod:931
35934 #: ../src/guestfs.pod:933
35936 "Libguestfs needs a supermin appliance, which it finds by looking along an "
35941 #: ../src/guestfs.pod:936
35943 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
35944 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
35948 #: ../src/guestfs.pod:939
35950 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
35951 "to change the directories that libguestfs will search in. The value is a "
35952 "colon-separated list of paths. The current directory is I<not> searched "
35953 "unless the path contains an empty element or C<.>. For example "
35954 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
35955 "then C</usr/lib/guestfs>."
35959 #: ../src/guestfs.pod:946
35960 msgid "QEMU WRAPPERS"
35964 #: ../src/guestfs.pod:948
35966 "If you want to compile your own qemu, run qemu from a non-standard location, "
35967 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
35972 #: ../src/guestfs.pod:952
35974 "There is one important rule to remember: you I<must C<exec qemu>> as the "
35975 "last command in the shell script (so that qemu replaces the shell and "
35976 "becomes the direct child of the libguestfs-using program). If you don't do "
35977 "this, then the qemu process won't be cleaned up correctly."
35981 #: ../src/guestfs.pod:957
35983 "Here is an example of a wrapper, where I have built my own copy of qemu from "
35988 #: ../src/guestfs.pod:960
35992 " qemudir=/home/rjones/d/qemu\n"
35993 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
35998 #: ../src/guestfs.pod:964
36000 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
36001 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
36006 #: ../src/guestfs.pod:968
36009 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
36014 #: ../src/guestfs.pod:970
36016 "Note that libguestfs also calls qemu with the -help and -version options in "
36017 "order to determine features."
36021 #: ../src/guestfs.pod:973
36023 "Wrappers can also be used to edit the options passed to qemu. In the "
36024 "following example, the C<-machine ...> option (C<-machine> and the following "
36025 "argument) are removed from the command line and replaced with C<-machine pc,"
36026 "accel=tcg>. The while loop iterates over the options until it finds the "
36027 "right one to remove, putting the remaining options into the C<args> array."
36031 #: ../src/guestfs.pod:982
36035 " while [ $# -gt 0 ]; do\n"
36036 " case \"$1\" in\n"
36040 " args[i]=\"$1\"\n"
36049 #: ../src/guestfs.pod:994
36052 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
36057 #: ../src/guestfs.pod:996
36058 msgid "ATTACHING TO RUNNING DAEMONS"
36062 #: ../src/guestfs.pod:998
36064 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
36065 "babies. Use with caution."
36069 #: ../src/guestfs.pod:1001
36071 "I<Note (2):> This section explains how to attach to a running daemon from a "
36072 "low level perspective. For most users, simply using virt tools such as "
36073 "L<guestfish(1)> with the I<--live> option will \"just work\"."
36077 #: ../src/guestfs.pod:1005
36078 msgid "Using guestfs_set_attach_method"
36082 #: ../src/guestfs.pod:1007
36084 "By calling L</guestfs_set_attach_method> you can change how the library "
36085 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
36086 "ARCHITECTURE> for some background)."
36090 #: ../src/guestfs.pod:1011
36092 "The normal attach method is C<appliance>, where a small appliance is created "
36093 "containing the daemon, and then the library connects to this."
36097 #: ../src/guestfs.pod:1014
36099 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
36100 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
36101 "daemon over the Unix domain socket."
36105 #: ../src/guestfs.pod:1018
36107 "The normal use for this is to connect to a running virtual machine that "
36108 "contains a C<guestfsd> daemon, and send commands so you can read and write "
36109 "files inside the live virtual machine."
36113 #: ../src/guestfs.pod:1022
36114 msgid "Using guestfs_add_domain with live flag"
36118 #: ../src/guestfs.pod:1024
36120 "L</guestfs_add_domain> provides some help for getting the correct attach "
36121 "method. If you pass the C<live> option to this function, then (if the "
36122 "virtual machine is running) it will examine the libvirt XML looking for a "
36123 "virtio-serial channel to connect to:"
36127 #: ../src/guestfs.pod:1030
36134 " <channel type='unix'>\n"
36135 " <source mode='bind' path='/path/to/socket'/>\n"
36136 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
36145 #: ../src/guestfs.pod:1042
36147 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
36148 "method to C<unix:/path/to/socket>."
36152 #: ../src/guestfs.pod:1045
36154 "Some of the libguestfs tools (including guestfish) support a I<--live> "
36155 "option which is passed through to L</guestfs_add_domain> thus allowing you "
36156 "to attach to and modify live virtual machines."
36160 #: ../src/guestfs.pod:1049
36162 "The virtual machine needs to have been set up beforehand so that it has the "
36163 "virtio-serial channel and so that guestfsd is running inside it."
36167 #: ../src/guestfs.pod:1053
36168 msgid "ABI GUARANTEE"
36172 #: ../src/guestfs.pod:1055
36174 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
36175 "actions as outlined in this section. Although we will deprecate some "
36176 "actions, for example if they get replaced by newer calls, we will keep the "
36177 "old actions forever. This allows you the developer to program in confidence "
36178 "against the libguestfs API."
36182 #: ../src/guestfs.pod:1061
36183 msgid "BLOCK DEVICE NAMING"
36187 #: ../src/guestfs.pod:1063
36189 "In the kernel there is now quite a profusion of schemata for naming block "
36190 "devices (in this context, by I<block device> I mean a physical or virtual "
36191 "hard drive). The original Linux IDE driver used names starting with C</dev/"
36192 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
36193 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
36194 "for the old IDE driver (particularly for SATA devices) those devices also "
36195 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
36196 "paravirtualized drivers. This has created several different naming systems, "
36197 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
36201 #: ../src/guestfs.pod:1075
36203 "As discussed above, libguestfs uses a qemu appliance running an embedded "
36204 "Linux kernel to access block devices. We can run a variety of appliances "
36205 "based on a variety of Linux kernels."
36209 #: ../src/guestfs.pod:1079
36211 "This causes a problem for libguestfs because many API calls use device or "
36212 "partition names. Working scripts and the recipe (example) scripts that we "
36213 "make available over the internet could fail if the naming scheme changes."
36217 #: ../src/guestfs.pod:1084
36219 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
36220 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
36221 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
36222 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
36226 #: ../src/guestfs.pod:1090
36228 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
36229 "L</guestfs_list_partitions> and similar calls return the true names of the "
36230 "devices and partitions as known to the appliance."
36234 #: ../src/guestfs.pod:1095
36235 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
36239 #: ../src/guestfs.pod:1097
36241 "Usually this translation is transparent. However in some (very rare) cases "
36242 "you may need to know the exact algorithm. Such cases include where you use "
36243 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
36244 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
36248 #: ../src/guestfs.pod:1103
36250 "The algorithm is applied only to I<parameters> which are known to be either "
36251 "device or partition names. Return values from functions such as L</"
36252 "guestfs_list_devices> are never changed."
36256 #: ../src/guestfs.pod:1111
36257 msgid "Is the string a parameter which is a device or partition name?"
36261 #: ../src/guestfs.pod:1115
36262 msgid "Does the string begin with C</dev/sd>?"
36266 #: ../src/guestfs.pod:1119
36268 "Does the named device exist? If so, we use that device. However if I<not> "
36269 "then we continue with this algorithm."
36273 #: ../src/guestfs.pod:1124
36274 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
36278 #: ../src/guestfs.pod:1126
36279 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
36283 #: ../src/guestfs.pod:1128
36284 msgid "If that named device exists, use it. If not, continue."
36288 #: ../src/guestfs.pod:1132
36289 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
36293 #: ../src/guestfs.pod:1134
36294 msgid "If that named device exists, use it. If not, return an error."
36298 #: ../src/guestfs.pod:1138
36299 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
36303 #: ../src/guestfs.pod:1140
36305 "Although the standard naming scheme and automatic translation is useful for "
36306 "simple programs and guestfish scripts, for larger programs it is best not to "
36307 "rely on this mechanism."
36311 #: ../src/guestfs.pod:1144
36313 "Where possible for maximum future portability programs using libguestfs "
36314 "should use these future-proof techniques:"
36318 #: ../src/guestfs.pod:1151
36320 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
36321 "device names, and then use those names directly."
36325 #: ../src/guestfs.pod:1154
36327 "Since those device names exist by definition, they will never be translated."
36331 #: ../src/guestfs.pod:1159
36333 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
36334 "filesystem labels."
36338 #: ../src/guestfs.pod:1166
36340 "This section discusses security implications of using libguestfs, "
36341 "particularly with untrusted or malicious guests or disk images."
36345 #: ../src/guestfs.pod:1169
36346 msgid "GENERAL SECURITY CONSIDERATIONS"
36350 #: ../src/guestfs.pod:1171
36352 "Be careful with any files or data that you download from a guest (by "
36353 "\"download\" we mean not just the L</guestfs_download> command but any "
36354 "command that reads files, filenames, directories or anything else from a "
36355 "disk image). An attacker could manipulate the data to fool your program "
36356 "into doing the wrong thing. Consider cases such as:"
36360 #: ../src/guestfs.pod:1181
36361 msgid "the data (file etc) not being present"
36365 #: ../src/guestfs.pod:1185
36366 msgid "being present but empty"
36370 #: ../src/guestfs.pod:1189
36371 msgid "being much larger than normal"
36375 #: ../src/guestfs.pod:1193
36376 msgid "containing arbitrary 8 bit data"
36380 #: ../src/guestfs.pod:1197
36381 msgid "being in an unexpected character encoding"
36385 #: ../src/guestfs.pod:1201
36386 msgid "containing homoglyphs."
36390 #: ../src/guestfs.pod:1205
36391 msgid "SECURITY OF MOUNTING FILESYSTEMS"
36395 #: ../src/guestfs.pod:1207
36397 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
36398 "(VFS) module can sometimes be escalated into exploits by deliberately "
36399 "creating a malicious, malformed filesystem. These exploits are very severe "
36400 "for two reasons. Firstly there are very many filesystem drivers in the "
36401 "kernel, and many of them are infrequently used and not much developer "
36402 "attention has been paid to the code. Linux userspace helps potential "
36403 "crackers by detecting the filesystem type and automatically choosing the "
36404 "right VFS driver, even if that filesystem type is obscure or unexpected for "
36405 "the administrator. Secondly, a kernel-level exploit is like a local root "
36406 "exploit (worse in some ways), giving immediate and total access to the "
36407 "system right down to the hardware level."
36411 #: ../src/guestfs.pod:1220
36413 "That explains why you should never mount a filesystem from an untrusted "
36414 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
36415 "inside a qemu virtual machine, usually running as a non-root user. The "
36416 "attacker would need to write a filesystem which first exploited the kernel, "
36417 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
36418 "the libguestfs protocol, and finally to be as serious as the host kernel "
36419 "exploit it would need to escalate its privileges to root. This multi-step "
36420 "escalation, performed by a static piece of data, is thought to be extremely "
36421 "hard to do, although we never say 'never' about security issues."
36425 #: ../src/guestfs.pod:1231
36427 "In any case callers can reduce the attack surface by forcing the filesystem "
36428 "type when mounting (use L</guestfs_mount_vfs>)."
36432 #: ../src/guestfs.pod:1234
36433 msgid "PROTOCOL SECURITY"
36437 #: ../src/guestfs.pod:1236
36439 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
36440 "defined upper message size. However a program that uses libguestfs must "
36441 "also take care - for example you can write a program that downloads a binary "
36442 "from a disk image and executes it locally, and no amount of protocol "
36443 "security will save you from the consequences."
36447 #: ../src/guestfs.pod:1242
36448 msgid "INSPECTION SECURITY"
36452 #: ../src/guestfs.pod:1244
36454 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
36455 "directly from the guest, and these could contain any 8 bit data. Callers "
36456 "should be careful to escape these before printing them to a structured file "
36457 "(for example, use HTML escaping if creating a web page)."
36461 #: ../src/guestfs.pod:1250
36463 "Guest configuration may be altered in unusual ways by the administrator of "
36464 "the virtual machine, and may not reflect reality (particularly for untrusted "
36465 "or actively malicious guests). For example we parse the hostname from "
36466 "configuration files like C</etc/sysconfig/network> that we find in the "
36467 "guest, but the guest administrator can easily manipulate these files to "
36468 "provide the wrong hostname."
36472 #: ../src/guestfs.pod:1258
36474 "The inspection API parses guest configuration using two external libraries: "
36475 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
36476 "designed to be robust in the face of malicious data, although denial of "
36477 "service attacks are still possible, for example with oversized configuration "
36482 #: ../src/guestfs.pod:1264
36483 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
36487 #: ../src/guestfs.pod:1266
36489 "Be very cautious about running commands from the guest. By running a "
36490 "command in the guest, you are giving CPU time to a binary that you do not "
36491 "control, under the same user account as the library, albeit wrapped in qemu "
36492 "virtualization. More information and alternatives can be found in the "
36493 "section L</RUNNING COMMANDS>."
36497 #: ../src/guestfs.pod:1272
36498 msgid "CVE-2010-3851"
36502 #: ../src/guestfs.pod:1274
36503 msgid "https://bugzilla.redhat.com/642934"
36507 #: ../src/guestfs.pod:1276
36509 "This security bug concerns the automatic disk format detection that qemu "
36510 "does on disk images."
36514 #: ../src/guestfs.pod:1279
36516 "A raw disk image is just the raw bytes, there is no header. Other disk "
36517 "images like qcow2 contain a special header. Qemu deals with this by looking "
36518 "for one of the known headers, and if none is found then assuming the disk "
36519 "image must be raw."
36523 #: ../src/guestfs.pod:1284
36525 "This allows a guest which has been given a raw disk image to write some "
36526 "other header. At next boot (or when the disk image is accessed by "
36527 "libguestfs) qemu would do autodetection and think the disk image format was, "
36528 "say, qcow2 based on the header written by the guest."
36532 #: ../src/guestfs.pod:1289
36534 "This in itself would not be a problem, but qcow2 offers many features, one "
36535 "of which is to allow a disk image to refer to another image (called the "
36536 "\"backing disk\"). It does this by placing the path to the backing disk "
36537 "into the qcow2 header. This path is not validated and could point to any "
36538 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
36539 "\"holes\" in the qcow2 disk image, which of course is completely under the "
36540 "control of the attacker."
36544 #: ../src/guestfs.pod:1297
36546 "In libguestfs this is rather hard to exploit except under two circumstances:"
36550 #: ../src/guestfs.pod:1304
36551 msgid "You have enabled the network or have opened the disk in write mode."
36555 #: ../src/guestfs.pod:1308
36557 "You are also running untrusted code from the guest (see L</RUNNING "
36562 #: ../src/guestfs.pod:1313
36564 "The way to avoid this is to specify the expected disk format when adding "
36565 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
36566 "should always do this if the disk is raw format, and it's a good idea for "
36571 #: ../src/guestfs.pod:1318
36573 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
36574 "format is fetched from libvirt and passed through."
36578 #: ../src/guestfs.pod:1321
36580 "For libguestfs tools, use the I<--format> command line parameter as "
36585 #: ../src/guestfs.pod:1324
36586 msgid "CONNECTION MANAGEMENT"
36590 #: ../src/guestfs.pod:1326
36591 msgid "guestfs_h *"
36595 #: ../src/guestfs.pod:1328
36597 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
36598 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
36599 "handle and release all resources used."
36603 #: ../src/guestfs.pod:1332
36605 "For information on using multiple handles and threads, see the section L</"
36606 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
36610 #: ../src/guestfs.pod:1335
36611 msgid "guestfs_create"
36615 #: ../src/guestfs.pod:1337
36618 " guestfs_h *guestfs_create (void);\n"
36623 #: ../src/guestfs.pod:1339
36624 msgid "Create a connection handle."
36628 #: ../src/guestfs.pod:1341
36630 "On success this returns a non-NULL pointer to a handle. On error it returns "
36635 #: ../src/guestfs.pod:1344
36637 "You have to \"configure\" the handle after creating it. This includes "
36638 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
36639 "handle at least once."
36643 #: ../src/guestfs.pod:1348
36644 msgid "After configuring the handle, you have to call L</guestfs_launch>."
36648 #: ../src/guestfs.pod:1350
36650 "You may also want to configure error handling for the handle. See the L</"
36651 "ERROR HANDLING> section below."
36655 #: ../src/guestfs.pod:1353
36656 msgid "guestfs_close"
36660 #: ../src/guestfs.pod:1355
36663 " void guestfs_close (guestfs_h *g);\n"
36668 #: ../src/guestfs.pod:1357
36669 msgid "This closes the connection handle and frees up all resources used."
36673 #: ../src/guestfs.pod:1359
36675 "If autosync was set on the handle and the handle was launched, then this "
36676 "implicitly calls various functions to unmount filesystems and sync the "
36677 "disk. See L</guestfs_set_autosync> for more details."
36681 #: ../src/guestfs.pod:1363
36682 msgid "If a close callback was set on the handle, then it is called."
36686 #: ../src/guestfs.pod:1365
36687 msgid "ERROR HANDLING"
36691 #: ../src/guestfs.pod:1367
36693 "API functions can return errors. For example, almost all functions that "
36694 "return C<int> will return C<-1> to indicate an error."
36698 #: ../src/guestfs.pod:1370
36700 "Additional information is available for errors: an error message string and "
36701 "optionally an error number (errno) if the thing that failed was a system "
36706 #: ../src/guestfs.pod:1374
36708 "You can get at the additional information about the last error on the handle "
36709 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
36710 "up an error handler with L</guestfs_set_error_handler>."
36714 #: ../src/guestfs.pod:1379
36716 "When the handle is created, a default error handler is installed which "
36717 "prints the error message string to C<stderr>. For small short-running "
36718 "command line programs it is sufficient to do:"
36722 #: ../src/guestfs.pod:1383
36725 " if (guestfs_launch (g) == -1)\n"
36726 " exit (EXIT_FAILURE);\n"
36731 #: ../src/guestfs.pod:1386
36733 "since the default error handler will ensure that an error message has been "
36734 "printed to C<stderr> before the program exits."
36738 #: ../src/guestfs.pod:1389
36740 "For other programs the caller will almost certainly want to install an "
36741 "alternate error handler or do error handling in-line like this:"
36745 #: ../src/guestfs.pod:1392
36748 " /* This disables the default behaviour of printing errors\n"
36750 " guestfs_set_error_handler (g, NULL, NULL);\n"
36755 #: ../src/guestfs.pod:1396
36758 " if (guestfs_launch (g) == -1) {\n"
36759 " /* Examine the error message and print it etc. */\n"
36760 " char *msg = guestfs_last_error (g);\n"
36761 " int errnum = guestfs_last_errno (g);\n"
36762 " fprintf (stderr, \"%s\", msg);\n"
36763 " if (errnum != 0)\n"
36764 " fprintf (stderr, \": %s\", strerror (errnum));\n"
36765 " fprintf (stderr, \"\\n\");\n"
36772 #: ../src/guestfs.pod:1407
36774 "Out of memory errors are handled differently. The default action is to call "
36775 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
36776 "guestfs_set_out_of_memory_handler>."
36780 #: ../src/guestfs.pod:1411
36782 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
36783 "because there is no handle if this happens there is no way to get additional "
36784 "error information. However L</guestfs_create> is supposed to be a "
36785 "lightweight operation which can only fail because of insufficient memory (it "
36786 "returns NULL in this case)."
36790 #: ../src/guestfs.pod:1417
36791 msgid "guestfs_last_error"
36795 #: ../src/guestfs.pod:1419
36798 " const char *guestfs_last_error (guestfs_h *g);\n"
36803 #: ../src/guestfs.pod:1421
36805 "This returns the last error message that happened on C<g>. If there has not "
36806 "been an error since the handle was created, then this returns C<NULL>."
36810 #: ../src/guestfs.pod:1425
36812 "The lifetime of the returned string is until the next error occurs, or L</"
36813 "guestfs_close> is called."
36817 #: ../src/guestfs.pod:1428
36818 msgid "guestfs_last_errno"
36822 #: ../src/guestfs.pod:1430
36825 " int guestfs_last_errno (guestfs_h *g);\n"
36830 #: ../src/guestfs.pod:1432
36831 msgid "This returns the last error number (errno) that happened on C<g>."
36835 #: ../src/guestfs.pod:1434
36836 msgid "If successful, an errno integer not equal to zero is returned."
36840 #: ../src/guestfs.pod:1436
36842 "If no error, this returns 0. This call can return 0 in three situations:"
36846 #: ../src/guestfs.pod:1443
36847 msgid "There has not been any error on the handle."
36851 #: ../src/guestfs.pod:1447
36853 "There has been an error but the errno was meaningless. This corresponds to "
36854 "the case where the error did not come from a failed system call, but for "
36855 "some other reason."
36859 #: ../src/guestfs.pod:1453
36861 "There was an error from a failed system call, but for some reason the errno "
36862 "was not captured and returned. This usually indicates a bug in libguestfs."
36866 #: ../src/guestfs.pod:1459
36868 "Libguestfs tries to convert the errno from inside the applicance into a "
36869 "corresponding errno for the caller (not entirely trivial: the appliance "
36870 "might be running a completely different operating system from the library "
36871 "and error numbers are not standardized across Un*xen). If this could not be "
36872 "done, then the error is translated to C<EINVAL>. In practice this should "
36873 "only happen in very rare circumstances."
36877 #: ../src/guestfs.pod:1467
36878 msgid "guestfs_set_error_handler"
36882 #: ../src/guestfs.pod:1469
36885 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
36887 " const char *msg);\n"
36888 " void guestfs_set_error_handler (guestfs_h *g,\n"
36889 " guestfs_error_handler_cb cb,\n"
36890 " void *opaque);\n"
36895 #: ../src/guestfs.pod:1476
36897 "The callback C<cb> will be called if there is an error. The parameters "
36898 "passed to the callback are an opaque data pointer and the error message "
36903 #: ../src/guestfs.pod:1480
36905 "C<errno> is not passed to the callback. To get that the callback must call "
36906 "L</guestfs_last_errno>."
36910 #: ../src/guestfs.pod:1483
36912 "Note that the message string C<msg> is freed as soon as the callback "
36913 "function returns, so if you want to stash it somewhere you must make your "
36918 #: ../src/guestfs.pod:1487
36919 msgid "The default handler prints messages on C<stderr>."
36923 #: ../src/guestfs.pod:1489
36924 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
36928 #: ../src/guestfs.pod:1491
36929 msgid "guestfs_get_error_handler"
36933 #: ../src/guestfs.pod:1493
36936 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
36937 " void **opaque_rtn);\n"
36942 #: ../src/guestfs.pod:1496
36943 msgid "Returns the current error handler callback."
36947 #: ../src/guestfs.pod:1498
36948 msgid "guestfs_set_out_of_memory_handler"
36952 #: ../src/guestfs.pod:1500
36955 " typedef void (*guestfs_abort_cb) (void);\n"
36956 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
36957 " guestfs_abort_cb);\n"
36962 #: ../src/guestfs.pod:1504
36964 "The callback C<cb> will be called if there is an out of memory situation. "
36965 "I<Note this callback must not return>."
36969 #: ../src/guestfs.pod:1507
36970 msgid "The default is to call L<abort(3)>."
36974 #: ../src/guestfs.pod:1509
36976 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
36980 #: ../src/guestfs.pod:1512
36981 msgid "guestfs_get_out_of_memory_handler"
36985 #: ../src/guestfs.pod:1514
36988 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
36993 #: ../src/guestfs.pod:1516
36994 msgid "This returns the current out of memory handler."
36998 #: ../src/guestfs.pod:1518
37003 #: ../src/guestfs.pod:1522
37008 #: ../src/guestfs.pod:1524
37013 #: ../src/guestfs.pod:1526
37014 msgid "AVAILABILITY"
37018 #: ../src/guestfs.pod:1528
37019 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
37023 #: ../src/guestfs.pod:1530
37025 "Using L</guestfs_available> you can test availability of the following "
37026 "groups of functions. This test queries the appliance to see if the "
37027 "appliance you are currently using supports the functionality."
37031 #: ../src/guestfs.pod:1535
37032 msgid "@AVAILABILITY@"
37036 #: ../src/guestfs.pod:1537
37037 msgid "GUESTFISH supported COMMAND"
37041 #: ../src/guestfs.pod:1539
37043 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
37044 "prints out the available groups and whether they are supported by this build "
37045 "of libguestfs. Note however that you have to do C<run> first."
37049 #: ../src/guestfs.pod:1544
37050 msgid "SINGLE CALLS AT COMPILE TIME"
37054 #: ../src/guestfs.pod:1546
37056 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
37057 "function, such as:"
37061 #: ../src/guestfs.pod:1549
37064 " #define LIBGUESTFS_HAVE_DD 1\n"
37069 #: ../src/guestfs.pod:1551
37070 msgid "if L</guestfs_dd> is available."
37074 #: ../src/guestfs.pod:1553
37076 "Before version 1.5.8, if you needed to test whether a single libguestfs "
37077 "function is available at compile time, we recommended using build tools such "
37078 "as autoconf or cmake. For example in autotools you could use:"
37082 #: ../src/guestfs.pod:1558
37085 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
37086 " AC_CHECK_FUNCS([guestfs_dd])\n"
37091 #: ../src/guestfs.pod:1561
37093 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
37098 #: ../src/guestfs.pod:1564
37099 msgid "SINGLE CALLS AT RUN TIME"
37103 #: ../src/guestfs.pod:1566
37105 "Testing at compile time doesn't guarantee that a function really exists in "
37106 "the library. The reason is that you might be dynamically linked against a "
37107 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
37108 "This situation unfortunately results in a segmentation fault, which is a "
37109 "shortcoming of the C dynamic linking system itself."
37113 #: ../src/guestfs.pod:1573
37115 "You can use L<dlopen(3)> to test if a function is available at run time, as "
37116 "in this example program (note that you still need the compile time check as "
37121 #: ../src/guestfs.pod:1577
37124 " #include <stdio.h>\n"
37125 " #include <stdlib.h>\n"
37126 " #include <unistd.h>\n"
37127 " #include <dlfcn.h>\n"
37128 " #include <guestfs.h>\n"
37133 #: ../src/guestfs.pod:1583
37138 " #ifdef LIBGUESTFS_HAVE_DD\n"
37140 " int has_function;\n"
37145 #: ../src/guestfs.pod:1589
37148 " /* Test if the function guestfs_dd is really available. */\n"
37149 " dl = dlopen (NULL, RTLD_LAZY);\n"
37151 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
37152 " exit (EXIT_FAILURE);\n"
37154 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
37160 #: ../src/guestfs.pod:1598
37163 " if (!has_function)\n"
37164 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
37166 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
37167 " /* Now it's safe to call\n"
37168 " guestfs_dd (g, \"foo\", \"bar\");\n"
37172 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
37179 #: ../src/guestfs.pod:1611
37181 "You may think the above is an awful lot of hassle, and it is. There are "
37182 "other ways outside of the C linking system to ensure that this kind of "
37183 "incompatibility never arises, such as using package versioning:"
37187 #: ../src/guestfs.pod:1616
37190 " Requires: libguestfs >= 1.0.80\n"
37195 #: ../src/guestfs.pod:1618
37196 msgid "CALLS WITH OPTIONAL ARGUMENTS"
37200 #: ../src/guestfs.pod:1620
37202 "A recent feature of the API is the introduction of calls which take optional "
37203 "arguments. In C these are declared 3 ways. The main way is as a call which "
37204 "takes variable arguments (ie. C<...>), as in this example:"
37208 #: ../src/guestfs.pod:1625
37211 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
37216 #: ../src/guestfs.pod:1627
37218 "Call this with a list of optional arguments, terminated by C<-1>. So to "
37219 "call with no optional arguments specified:"
37223 #: ../src/guestfs.pod:1630
37226 " guestfs_add_drive_opts (g, filename, -1);\n"
37231 #: ../src/guestfs.pod:1632
37232 msgid "With a single optional argument:"
37236 #: ../src/guestfs.pod:1634
37239 " guestfs_add_drive_opts (g, filename,\n"
37240 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
37246 #: ../src/guestfs.pod:1638
37251 #: ../src/guestfs.pod:1640
37254 " guestfs_add_drive_opts (g, filename,\n"
37255 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
37256 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
37262 #: ../src/guestfs.pod:1645
37264 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
37269 #: ../src/guestfs.pod:1648
37270 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
37274 #: ../src/guestfs.pod:1650
37276 "The second variant has the same name with the suffix C<_va>, which works the "
37277 "same way but takes a C<va_list>. See the C manual for details. For the "
37278 "example function, this is declared:"
37282 #: ../src/guestfs.pod:1654
37285 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
37286 " va_list args);\n"
37291 #: ../src/guestfs.pod:1657
37292 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
37296 #: ../src/guestfs.pod:1659
37298 "The third variant is useful where you need to construct these calls. You "
37299 "pass in a structure where you fill in the optional fields. The structure "
37300 "has a bitmask as the first element which you must set to indicate which "
37301 "fields you have filled in. For our example function the structure and call "
37306 #: ../src/guestfs.pod:1665
37309 " struct guestfs_add_drive_opts_argv {\n"
37310 " uint64_t bitmask;\n"
37312 " const char *format;\n"
37315 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
37316 " const struct guestfs_add_drive_opts_argv *optargs);\n"
37321 #: ../src/guestfs.pod:1674
37322 msgid "You could call it like this:"
37326 #: ../src/guestfs.pod:1676
37329 " struct guestfs_add_drive_opts_argv optargs = {\n"
37330 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
37331 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
37332 " .readonly = 1,\n"
37333 " .format = \"qcow2\"\n"
37339 #: ../src/guestfs.pod:1683
37342 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
37347 #: ../src/guestfs.pod:1691
37348 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
37352 #: ../src/guestfs.pod:1696
37353 msgid "You do not need to fill in all fields of the structure."
37357 #: ../src/guestfs.pod:1700
37359 "There must be a one-to-one correspondence between fields of the structure "
37360 "that are filled in, and bits set in the bitmask."
37364 #: ../src/guestfs.pod:1705
37365 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
37369 #: ../src/guestfs.pod:1707
37371 "In other languages, optional arguments are expressed in the way that is "
37372 "natural for that language. We refer you to the language-specific "
37373 "documentation for more details on that."
37377 #: ../src/guestfs.pod:1711
37378 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
37382 #: ../src/guestfs.pod:1713
37383 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
37387 #: ../src/guestfs.pod:1715
37389 "B<Note:> This section documents the generic event mechanism introduced in "
37390 "libguestfs 1.10, which you should use in new code if possible. The old "
37391 "functions C<guestfs_set_log_message_callback>, "
37392 "C<guestfs_set_subprocess_quit_callback>, "
37393 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
37394 "C<guestfs_set_progress_callback> are no longer documented in this manual "
37395 "page. Because of the ABI guarantee, the old functions continue to work."
37399 #: ../src/guestfs.pod:1724
37401 "Handles generate events when certain things happen, such as log messages "
37402 "being generated, progress messages during long-running operations, or the "
37403 "handle being closed. The API calls described below let you register a "
37404 "callback to be called when events happen. You can register multiple "
37405 "callbacks (for the same, different or overlapping sets of events), and "
37406 "individually remove callbacks. If callbacks are not removed, then they "
37407 "remain in force until the handle is closed."
37411 #: ../src/guestfs.pod:1732
37413 "In the current implementation, events are only generated synchronously: that "
37414 "means that events (and hence callbacks) can only happen while you are in the "
37415 "middle of making another libguestfs call. The callback is called in the "
37420 #: ../src/guestfs.pod:1737
37422 "Events may contain a payload, usually nothing (void), an array of 64 bit "
37423 "unsigned integers, or a message buffer. Payloads are discussed later on."
37427 #: ../src/guestfs.pod:1741
37428 msgid "CLASSES OF EVENTS"
37432 #: ../src/guestfs.pod:1745
37433 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
37437 #: ../src/guestfs.pod:1748
37439 "The callback function will be called while the handle is being closed "
37440 "(synchronously from L</guestfs_close>)."
37444 #: ../src/guestfs.pod:1751
37446 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
37447 "handles that are open when the program exits. This means that this callback "
37448 "might be called indirectly from L<exit(3)>, which can cause unexpected "
37449 "problems in higher-level languages (eg. if your HLL interpreter has already "
37450 "been cleaned up by the time this is called, and if your callback then jumps "
37451 "into some HLL function)."
37455 #: ../src/guestfs.pod:1758
37457 "If no callback is registered: the handle is closed without any callback "
37462 #: ../src/guestfs.pod:1761
37463 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
37467 #: ../src/guestfs.pod:1764
37469 "The callback function will be called when the child process quits, either "
37470 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
37471 "corresponds to a transition from any state to the CONFIG state)."
37475 #: ../src/guestfs.pod:1768 ../src/guestfs.pod:1777 ../src/guestfs.pod:1894
37476 msgid "If no callback is registered: the event is ignored."
37480 #: ../src/guestfs.pod:1770
37481 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
37485 #: ../src/guestfs.pod:1773
37487 "The callback function will be called when the child process becomes ready "
37488 "first time after it has been launched. (This corresponds to a transition "
37489 "from LAUNCHING to the READY state)."
37493 #: ../src/guestfs.pod:1779
37494 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
37498 #: ../src/guestfs.pod:1782
37500 "Some long-running operations can generate progress messages. If this "
37501 "callback is registered, then it will be called each time a progress message "
37502 "is generated (usually two seconds after the operation started, and three "
37503 "times per second thereafter until it completes, although the frequency may "
37504 "change in future versions)."
37508 #: ../src/guestfs.pod:1788
37510 "The callback receives in the payload four unsigned 64 bit numbers which are "
37511 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
37515 #: ../src/guestfs.pod:1791
37517 "The units of C<total> are not defined, although for some operations C<total> "
37518 "may relate in some way to the amount of data to be transferred (eg. in bytes "
37519 "or megabytes), and C<position> may be the portion which has been transferred."
37523 #: ../src/guestfs.pod:1796
37524 msgid "The only defined and stable parts of the API are:"
37528 #: ../src/guestfs.pod:1802
37530 "The callback can display to the user some type of progress bar or indicator "
37531 "which shows the ratio of C<position>:C<total>."
37535 #: ../src/guestfs.pod:1807
37536 msgid "0 E<lt>= C<position> E<lt>= C<total>"
37540 #: ../src/guestfs.pod:1811
37542 "If any progress notification is sent during a call, then a final progress "
37543 "notification is always sent when C<position> = C<total> (I<unless> the call "
37544 "fails with an error)."
37548 #: ../src/guestfs.pod:1815
37550 "This is to simplify caller code, so callers can easily set the progress "
37551 "indicator to \"100%\" at the end of the operation, without requiring special "
37552 "code to detect this case."
37556 #: ../src/guestfs.pod:1821
37558 "For some calls we are unable to estimate the progress of the call, but we "
37559 "can still generate progress messages to indicate activity. This is known as "
37560 "\"pulse mode\", and is directly supported by certain progress bar "
37561 "implementations (eg. GtkProgressBar)."
37565 #: ../src/guestfs.pod:1826
37567 "For these calls, zero or more progress messages are generated with "
37568 "C<position = 0> and C<total = 1>, followed by a final message with "
37569 "C<position = total = 1>."
37573 #: ../src/guestfs.pod:1830
37575 "As noted above, if the call fails with an error then the final message may "
37576 "not be generated."
37580 #: ../src/guestfs.pod:1835
37582 "The callback also receives the procedure number (C<proc_nr>) and serial "
37583 "number (C<serial>) of the call. These are only useful for debugging "
37584 "protocol issues, and the callback can normally ignore them. The callback "
37585 "may want to print these numbers in error messages or debugging messages."
37589 #: ../src/guestfs.pod:1841
37590 msgid "If no callback is registered: progress messages are discarded."
37594 #: ../src/guestfs.pod:1843
37595 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
37599 #: ../src/guestfs.pod:1846
37601 "The callback function is called whenever a log message is generated by qemu, "
37602 "the appliance kernel, guestfsd (daemon), or utility programs."
37606 #: ../src/guestfs.pod:1849
37608 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
37609 "guestfs_launch>) then additional debug messages are generated."
37613 #: ../src/guestfs.pod:1852 ../src/guestfs.pod:1866
37615 "If no callback is registered: the messages are discarded unless the verbose "
37616 "flag is set in which case they are sent to stderr. You can override the "
37617 "printing of verbose messages to stderr by setting up a callback."
37621 #: ../src/guestfs.pod:1857
37622 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
37626 #: ../src/guestfs.pod:1860
37628 "The callback function is called whenever a log message is generated by the "
37629 "library part of libguestfs."
37633 #: ../src/guestfs.pod:1863
37635 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
37636 "messages are generated."
37640 #: ../src/guestfs.pod:1871
37641 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
37645 #: ../src/guestfs.pod:1874
37647 "The callback function is called whenever a trace message is generated. This "
37648 "only applies if the trace flag (L</guestfs_set_trace>) is set."
37652 #: ../src/guestfs.pod:1877
37654 "If no callback is registered: the messages are sent to stderr. You can "
37655 "override the printing of trace messages to stderr by setting up a callback."
37659 #: ../src/guestfs.pod:1881
37660 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
37664 #: ../src/guestfs.pod:1884
37666 "The callback function is called whenever a libguestfs function is entered."
37670 #: ../src/guestfs.pod:1887
37672 "The payload is a string which contains the name of the function that we are "
37673 "entering (not including C<guestfs_> prefix)."
37677 #: ../src/guestfs.pod:1890
37679 "Note that libguestfs functions can call themselves, so you may see many "
37680 "events from a single call. A few libguestfs functions do not generate this "
37685 #: ../src/guestfs.pod:1898
37686 msgid "guestfs_set_event_callback"
37690 #: ../src/guestfs.pod:1900
37693 " int guestfs_set_event_callback (guestfs_h *g,\n"
37694 " guestfs_event_callback cb,\n"
37695 " uint64_t event_bitmask,\n"
37697 " void *opaque);\n"
37702 #: ../src/guestfs.pod:1906
37704 "This function registers a callback (C<cb>) for all event classes in the "
37705 "C<event_bitmask>."
37709 #: ../src/guestfs.pod:1909
37711 "For example, to register for all log message events, you could call this "
37712 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
37713 "To register a single callback for all possible classes of events, use "
37714 "C<GUESTFS_EVENT_ALL>."
37718 #: ../src/guestfs.pod:1915
37719 msgid "C<flags> should always be passed as 0."
37723 #: ../src/guestfs.pod:1917
37725 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
37726 "it for any purpose."
37730 #: ../src/guestfs.pod:1920
37732 "The return value is the event handle (an integer) which you can use to "
37733 "delete the callback (see below)."
37737 #: ../src/guestfs.pod:1923
37739 "If there is an error, this function returns C<-1>, and sets the error in the "
37740 "handle in the usual way (see L</guestfs_last_error> etc.)"
37744 #: ../src/guestfs.pod:1926
37746 "Callbacks remain in effect until they are deleted, or until the handle is "
37751 #: ../src/guestfs.pod:1929
37753 "In the case where multiple callbacks are registered for a particular event "
37754 "class, all of the callbacks are called. The order in which multiple "
37755 "callbacks are called is not defined."
37759 #: ../src/guestfs.pod:1933
37760 msgid "guestfs_delete_event_callback"
37764 #: ../src/guestfs.pod:1935
37767 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
37772 #: ../src/guestfs.pod:1937
37774 "Delete a callback that was previously registered. C<event_handle> should be "
37775 "the integer that was returned by a previous call to "
37776 "C<guestfs_set_event_callback> on the same handle."
37780 #: ../src/guestfs.pod:1941
37781 msgid "guestfs_event_callback"
37785 #: ../src/guestfs.pod:1943
37788 " typedef void (*guestfs_event_callback) (\n"
37791 " uint64_t event,\n"
37792 " int event_handle,\n"
37794 " const char *buf, size_t buf_len,\n"
37795 " const uint64_t *array, size_t array_len);\n"
37800 #: ../src/guestfs.pod:1952
37802 "This is the type of the event callback function that you have to provide."
37806 #: ../src/guestfs.pod:1955
37808 "The basic parameters are: the handle (C<g>), the opaque user pointer "
37809 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
37810 "handle, and C<flags> which in the current API you should ignore."
37814 #: ../src/guestfs.pod:1959
37816 "The remaining parameters contain the event payload (if any). Each event may "
37817 "contain a payload, which usually relates to the event class, but for future "
37818 "proofing your code should be written to handle any payload for any event "
37823 #: ../src/guestfs.pod:1964
37825 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
37826 "there is no message buffer). Note that this message buffer can contain "
37827 "arbitrary 8 bit data, including NUL bytes."
37831 #: ../src/guestfs.pod:1968
37833 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
37834 "moment this is only used for progress messages."
37838 #: ../src/guestfs.pod:1971
37839 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
37843 #: ../src/guestfs.pod:1973
37845 "One motivation for the generic event API was to allow GUI programs to "
37846 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
37847 "unconditionally to C<stderr>."
37851 #: ../src/guestfs.pod:1977
37853 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
37854 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
37855 "messages are not events; you must capture error messages separately)."
37859 #: ../src/guestfs.pod:1982
37861 "Programs have to set up a callback to capture the classes of events of "
37866 #: ../src/guestfs.pod:1985
37870 " guestfs_set_event_callback\n"
37871 " (g, message_callback,\n"
37872 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
37873 " GUESTFS_EVENT_TRACE,\n"
37874 " 0, NULL) == -1)\n"
37875 " if (eh == -1) {\n"
37876 " // handle error in the usual way\n"
37882 #: ../src/guestfs.pod:1995
37884 "The callback can then direct messages to the appropriate place. In this "
37885 "example, messages are directed to syslog:"
37889 #: ../src/guestfs.pod:1998
37893 " message_callback (\n"
37896 " uint64_t event,\n"
37897 " int event_handle,\n"
37899 " const char *buf, size_t buf_len,\n"
37900 " const uint64_t *array, size_t array_len)\n"
37902 " const int priority = LOG_USER|LOG_INFO;\n"
37903 " if (buf_len > 0)\n"
37904 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
37910 #: ../src/guestfs.pod:2013
37911 msgid "CANCELLING LONG TRANSFERS"
37915 #: ../src/guestfs.pod:2015
37917 "Some operations can be cancelled by the caller while they are in progress. "
37918 "Currently only operations that involve uploading or downloading data can be "
37919 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
37920 "parameters in the generator)."
37924 #: ../src/guestfs.pod:2020
37925 msgid "guestfs_user_cancel"
37929 #: ../src/guestfs.pod:2022
37932 " void guestfs_user_cancel (guestfs_h *g);\n"
37937 #: ../src/guestfs.pod:2024
37939 "C<guestfs_user_cancel> cancels the current upload or download operation."
37943 #: ../src/guestfs.pod:2027
37945 "Unlike most other libguestfs calls, this function is signal safe and thread "
37946 "safe. You can call it from a signal handler or from another thread, without "
37947 "needing to do any locking."
37951 #: ../src/guestfs.pod:2031
37953 "The transfer that was in progress (if there is one) will stop shortly "
37954 "afterwards, and will return an error. The errno (see L</"
37955 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
37956 "out if the operation was cancelled or failed because of another error."
37960 #: ../src/guestfs.pod:2037
37962 "No cleanup is performed: for example, if a file was being uploaded then "
37963 "after cancellation there may be a partially uploaded file. It is the "
37964 "caller's responsibility to clean up if necessary."
37968 #: ../src/guestfs.pod:2041
37969 msgid "There are two common places that you might call C<guestfs_user_cancel>."
37973 #: ../src/guestfs.pod:2043
37975 "In an interactive text-based program, you might call it from a C<SIGINT> "
37976 "signal handler so that pressing C<^C> cancels the current operation. (You "
37977 "also need to call L</guestfs_set_pgroup> so that child processes don't "
37978 "receive the C<^C> signal)."
37982 #: ../src/guestfs.pod:2048
37984 "In a graphical program, when the main thread is displaying a progress bar "
37985 "with a cancel button, wire up the cancel button to call this function."
37989 #: ../src/guestfs.pod:2052
37990 msgid "PRIVATE DATA AREA"
37994 #: ../src/guestfs.pod:2054
37996 "You can attach named pieces of private data to the libguestfs handle, fetch "
37997 "them by name, and walk over them, for the lifetime of the handle. This is "
37998 "called the private data area and is only available from the C API."
38002 #: ../src/guestfs.pod:2059
38003 msgid "To attach a named piece of data, use the following call:"
38007 #: ../src/guestfs.pod:2061
38010 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
38015 #: ../src/guestfs.pod:2063
38017 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
38018 "pointer (which can be C<NULL>). Any previous item with the same key is "
38023 #: ../src/guestfs.pod:2067
38025 "You can use any C<key> you want, but your key should I<not> start with an "
38026 "underscore character. Keys beginning with an underscore character are "
38027 "reserved for internal libguestfs purposes (eg. for implementing language "
38028 "bindings). It is recommended that you prefix the key with some unique "
38029 "string to avoid collisions with other users."
38033 #: ../src/guestfs.pod:2073
38034 msgid "To retrieve the pointer, use:"
38038 #: ../src/guestfs.pod:2075
38041 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
38046 #: ../src/guestfs.pod:2077
38048 "This function returns C<NULL> if either no data is found associated with "
38049 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
38054 #: ../src/guestfs.pod:2081
38056 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
38057 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
38058 "all. In particular, libguestfs does I<not> try to free the data when the "
38059 "handle is closed. If the data must be freed, then the caller must either "
38060 "free it before calling L</guestfs_close> or must set up a close callback to "
38061 "do it (see L</GUESTFS_EVENT_CLOSE>)."
38065 #: ../src/guestfs.pod:2088
38066 msgid "To walk over all entries, use these two functions:"
38070 #: ../src/guestfs.pod:2090
38073 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
38078 #: ../src/guestfs.pod:2092
38081 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
38086 #: ../src/guestfs.pod:2094
38088 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
38089 "not have any particular meaning -- keys are not returned in any defined "
38090 "order). A pointer to the key is returned in C<*key_rtn> and the "
38091 "corresponding data pointer is returned from the function. C<NULL> is "
38092 "returned if there are no keys stored in the handle."
38096 #: ../src/guestfs.pod:2100
38098 "C<guestfs_next_private> returns the next key, pointer pair. The return "
38099 "value of this function is also C<NULL> is there are no further entries to "
38104 #: ../src/guestfs.pod:2104
38105 msgid "Notes about walking over entries:"
38109 #: ../src/guestfs.pod:2110
38111 "You must not call C<guestfs_set_private> while walking over the entries."
38115 #: ../src/guestfs.pod:2115
38117 "The handle maintains an internal iterator which is reset when you call "
38118 "C<guestfs_first_private>. This internal iterator is invalidated when you "
38119 "call C<guestfs_set_private>."
38123 #: ../src/guestfs.pod:2121
38124 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
38128 #: ../src/guestfs.pod:2123
38131 " guestfs_set_private (g, key, NULL);\n"
38136 #: ../src/guestfs.pod:2125
38137 msgid "then that C<key> is not returned when walking."
38141 #: ../src/guestfs.pod:2129
38143 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
38144 "C<guestfs_next_private> or C<guestfs_set_private>."
38148 #: ../src/guestfs.pod:2135
38150 "The following example code shows how to print all keys and data pointers "
38151 "that are associated with the handle C<g>:"
38155 #: ../src/guestfs.pod:2138
38158 " const char *key;\n"
38159 " void *data = guestfs_first_private (g, &key);\n"
38160 " while (data != NULL)\n"
38162 " printf (\"key = %s, data = %p\\n\", key, data);\n"
38163 " data = guestfs_next_private (g, &key);\n"
38169 #: ../src/guestfs.pod:2146
38171 "More commonly you are only interested in keys that begin with an application-"
38172 "specific prefix C<foo_>. Modify the loop like so:"
38176 #: ../src/guestfs.pod:2149
38179 " const char *key;\n"
38180 " void *data = guestfs_first_private (g, &key);\n"
38181 " while (data != NULL)\n"
38183 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
38184 " printf (\"key = %s, data = %p\\n\", key, data);\n"
38185 " data = guestfs_next_private (g, &key);\n"
38191 #: ../src/guestfs.pod:2158
38193 "If you need to modify keys while walking, then you have to jump back to the "
38194 "beginning of the loop. For example, to delete all keys prefixed with "
38199 #: ../src/guestfs.pod:2162
38202 " const char *key;\n"
38205 " data = guestfs_first_private (g, &key);\n"
38206 " while (data != NULL)\n"
38208 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
38210 " guestfs_set_private (g, key, NULL);\n"
38211 " /* note that 'key' pointer is now invalid, and so is\n"
38212 " the internal iterator */\n"
38215 " data = guestfs_next_private (g, &key);\n"
38221 #: ../src/guestfs.pod:2178
38223 "Note that the above loop is guaranteed to terminate because the keys are "
38224 "being deleted, but other manipulations of keys within the loop might not "
38225 "terminate unless you also maintain an indication of which keys have been "
38230 #: ../src/guestfs.pod:2183
38235 #: ../src/guestfs.pod:2185
38237 "The libguestfs C library can be probed using systemtap or DTrace. This is "
38238 "true of any library, not just libguestfs. However libguestfs also contains "
38239 "static markers to help in probing internal operations."
38243 #: ../src/guestfs.pod:2189
38244 msgid "You can list all the static markers by doing:"
38248 #: ../src/guestfs.pod:2191
38251 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
38252 " .provider(\"guestfs\").mark(\"*\")'\n"
38257 #: ../src/guestfs.pod:2194
38259 "B<Note:> These static markers are I<not> part of the stable API and may "
38260 "change in future versions."
38264 #: ../src/guestfs.pod:2197
38265 msgid "SYSTEMTAP SCRIPT EXAMPLE"
38269 #: ../src/guestfs.pod:2199
38271 "This script contains examples of displaying both the static markers and some "
38272 "ordinary C entry points:"
38276 #: ../src/guestfs.pod:2202
38284 #: ../src/guestfs.pod:2204
38287 " function display_time () {\n"
38288 " now = gettimeofday_us ();\n"
38291 " delta = now - last;\n"
38297 #: ../src/guestfs.pod:2211
38300 " printf (\"%d (+%d):\", now, delta);\n"
38306 #: ../src/guestfs.pod:2214
38311 " printf (\"ready\\n\");\n"
38317 #: ../src/guestfs.pod:2219
38320 " /* Display all calls to static markers. */\n"
38321 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
38322 " .provider(\"guestfs\").mark(\"*\") ? {\n"
38323 " display_time();\n"
38324 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
38330 #: ../src/guestfs.pod:2226
38333 " /* Display all calls to guestfs_mkfs* functions. */\n"
38334 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
38335 " .function(\"guestfs_mkfs*\") ? {\n"
38336 " display_time();\n"
38337 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
38343 #: ../src/guestfs.pod:2233
38345 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
38346 "program. Note that you either have to be root, or you have to add yourself "
38347 "to several special stap groups. Consult the systemtap documentation for "
38348 "more information."
38352 #: ../src/guestfs.pod:2238
38355 " # stap /tmp/test.stap\n"
38361 #: ../src/guestfs.pod:2241
38362 msgid "In another terminal, run a guestfish command such as this:"
38366 #: ../src/guestfs.pod:2245
38367 msgid "In the first terminal, stap trace output similar to this is shown:"
38371 #: ../src/guestfs.pod:2247
38374 " 1318248056692655 (+0):\tlaunch_start\n"
38375 " 1318248056692850 (+195): launch_build_appliance_start\n"
38376 " 1318248056818285 (+125435): launch_build_appliance_end\n"
38377 " 1318248056838059 (+19774): launch_run_qemu\n"
38378 " 1318248061071167 (+4233108): launch_end\n"
38379 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f device=0x1024e60\n"
38384 #: ../src/guestfs.pod:2254 ../src/guestfs.pod:2259
38389 #: ../src/guestfs.pod:2256
38391 "<!-- old anchor for the next section --> <a name="
38392 "\"state_machine_and_low_level_event_api\"/>"
38396 #: ../src/guestfs.pod:2261
38397 msgid "ARCHITECTURE"
38401 #: ../src/guestfs.pod:2263
38403 "Internally, libguestfs is implemented by running an appliance (a special "
38404 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
38405 "process of the main program."
38409 #: ../src/guestfs.pod:2267
38412 " ___________________\n"
38414 " | main program |\n"
38416 " | | child process / appliance\n"
38417 " | | __________________________\n"
38419 " +-------------------+ RPC | +-----------------+ |\n"
38420 " | libguestfs <--------------------> guestfsd | |\n"
38421 " | | | +-----------------+ |\n"
38422 " \\___________________/ | | Linux kernel | |\n"
38423 " | +--^--------------+ |\n"
38424 " \\_________|________________/\n"
38426 " _______v______\n"
38429 " | disk image |\n"
38430 " \\______________/\n"
38435 #: ../src/guestfs.pod:2287
38437 "The library, linked to the main program, creates the child process and hence "
38438 "the appliance in the L</guestfs_launch> function."
38442 #: ../src/guestfs.pod:2290
38444 "Inside the appliance is a Linux kernel and a complete stack of userspace "
38445 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
38446 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
38447 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
38448 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
38449 "attached to the qemu process which translates device access by the "
38450 "appliance's Linux kernel into accesses to the image."
38454 #: ../src/guestfs.pod:2299
38456 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
38457 "Although the disk image you are attached to might also be used by some "
38458 "virtual machine, libguestfs doesn't know or care about this. (But you will "
38459 "care if both libguestfs's qemu process and your virtual machine are trying "
38460 "to update the disk image at the same time, since these usually results in "
38461 "massive disk corruption)."
38465 #: ../src/guestfs.pod:2306
38466 msgid "STATE MACHINE"
38470 #: ../src/guestfs.pod:2308
38471 msgid "libguestfs uses a state machine to model the child process:"
38475 #: ../src/guestfs.pod:2310
38479 " guestfs_create\n"
38487 " / | \\ \\ guestfs_launch\n"
38488 " / | _\\__V______\n"
38490 " / | | LAUNCHING |\n"
38491 " / | \\___________/\n"
38493 " / | guestfs_launch\n"
38495 " ______ / __|____V\n"
38496 " / \\ ------> / \\\n"
38497 " | BUSY | | READY |\n"
38498 " \\______/ <------ \\________/\n"
38503 #: ../src/guestfs.pod:2332
38505 "The normal transitions are (1) CONFIG (when the handle is created, but there "
38506 "is no child process), (2) LAUNCHING (when the child process is booting up), "
38507 "(3) alternating between READY and BUSY as commands are issued to, and "
38508 "carried out by, the child process."
38512 #: ../src/guestfs.pod:2337
38514 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
38515 "asynchronously at any time (eg. due to some internal error), and that causes "
38516 "the state to transition back to CONFIG."
38520 #: ../src/guestfs.pod:2341
38522 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
38523 "issued when in the CONFIG state."
38527 #: ../src/guestfs.pod:2344
38529 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
38530 "L</guestfs_launch> blocks until the child process is READY to accept "
38531 "commands (or until some failure or timeout). L</guestfs_launch> internally "
38532 "moves the state from CONFIG to LAUNCHING while it is running."
38536 #: ../src/guestfs.pod:2350
38538 "API actions such as L</guestfs_mount> can only be issued when in the READY "
38539 "state. These API calls block waiting for the command to be carried out (ie. "
38540 "the state to transition to BUSY and then back to READY). There are no non-"
38541 "blocking versions, and no way to issue more than one command per handle at "
38546 #: ../src/guestfs.pod:2356
38548 "Finally, the child process sends asynchronous messages back to the main "
38549 "program, such as kernel log messages. You can register a callback to "
38550 "receive these messages."
38554 #: ../src/guestfs.pod:2360
38559 #: ../src/guestfs.pod:2362
38560 msgid "APPLIANCE BOOT PROCESS"
38564 #: ../src/guestfs.pod:2364
38566 "This process has evolved and continues to evolve. The description here "
38567 "corresponds only to the current version of libguestfs and is provided for "
38568 "information only."
38572 #: ../src/guestfs.pod:2368
38574 "In order to follow the stages involved below, enable libguestfs debugging "
38575 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
38579 #: ../src/guestfs.pod:2373
38580 msgid "Create the appliance"
38584 #: ../src/guestfs.pod:2375
38586 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
38587 "initrd and the appliance."
38591 #: ../src/guestfs.pod:2378
38593 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
38594 "directory if C<TMPDIR> is set)."
38598 #: ../src/guestfs.pod:2381
38600 "For a complete description of how the appliance is created and cached, read "
38601 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
38605 #: ../src/guestfs.pod:2385
38606 msgid "Start qemu and boot the kernel"
38610 #: ../src/guestfs.pod:2387
38611 msgid "qemu is invoked to boot the kernel."
38615 #: ../src/guestfs.pod:2389
38616 msgid "Run the initrd"
38620 #: ../src/guestfs.pod:2391
38622 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
38623 "appliance. The purpose of the initrd is to load enough kernel modules in "
38624 "order that the appliance itself can be mounted and started."
38628 #: ../src/guestfs.pod:2395
38630 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
38635 #: ../src/guestfs.pod:2398
38637 "When the initrd has started you will see messages showing that kernel "
38638 "modules are being loaded, similar to this:"
38642 #: ../src/guestfs.pod:2401
38645 " febootstrap: ext2 mini initrd starting up\n"
38646 " febootstrap: mounting /sys\n"
38647 " febootstrap: internal insmod libcrc32c.ko\n"
38648 " febootstrap: internal insmod crc32c-intel.ko\n"
38653 #: ../src/guestfs.pod:2406
38654 msgid "Find and mount the appliance device"
38658 #: ../src/guestfs.pod:2408
38660 "The appliance is a sparse file containing an ext2 filesystem which contains "
38661 "a familiar (although reduced in size) Linux operating system. It would "
38662 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
38666 #: ../src/guestfs.pod:2412
38668 "The regular disks being inspected by libguestfs are the first devices "
38669 "exposed by qemu (eg. as C</dev/vda>)."
38673 #: ../src/guestfs.pod:2415
38675 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
38676 "there was only one regular disk)."
38680 #: ../src/guestfs.pod:2418
38682 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
38683 "and switch root into the appliance, and run C</init> from the appliance."
38687 #: ../src/guestfs.pod:2422
38688 msgid "If this works successfully you will see messages such as:"
38692 #: ../src/guestfs.pod:2424
38695 " febootstrap: picked /sys/block/vdb/dev as root device\n"
38696 " febootstrap: creating /dev/root as block special 252:16\n"
38697 " febootstrap: mounting new root on /root\n"
38698 " febootstrap: chroot\n"
38699 " Starting /init script ...\n"
38704 #: ../src/guestfs.pod:2430
38706 "Note that C<Starting /init script ...> indicates that the appliance's init "
38707 "script is now running."
38711 #: ../src/guestfs.pod:2433
38712 msgid "Initialize the appliance"
38716 #: ../src/guestfs.pod:2435
38718 "The appliance itself now initializes itself. This involves starting certain "
38719 "processes like C<udev>, possibly printing some debug information, and "
38720 "finally running the daemon (C<guestfsd>)."
38724 #: ../src/guestfs.pod:2439
38729 #: ../src/guestfs.pod:2441
38731 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
38736 #: ../src/guestfs.pod:2444
38739 " verbose daemon enabled\n"
38744 #: ../src/guestfs.pod:2446
38746 "The daemon expects to see a named virtio-serial port exposed by qemu and "
38747 "connected on the other end to the library."
38751 #: ../src/guestfs.pod:2449
38753 "The daemon connects to this port (and hence to the library) and sends a four "
38754 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
38755 "protocol (see below)."
38759 #: ../src/guestfs.pod:2455
38760 msgid "COMMUNICATION PROTOCOL"
38764 #: ../src/guestfs.pod:2457
38766 "Don't rely on using this protocol directly. This section documents how it "
38767 "currently works, but it may change at any time."
38771 #: ../src/guestfs.pod:2460
38773 "The protocol used to talk between the library and the daemon running inside "
38774 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
38775 "1014, RFC 1832, RFC 4506)."
38779 #: ../src/guestfs.pod:2464
38781 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
38782 "this file is automatically generated)."
38786 #: ../src/guestfs.pod:2467
38788 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
38789 "and C<FileOut> parameters, which are handled with very simple request/reply "
38790 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
38791 "parameters, which use the same request and reply messages, but they may also "
38792 "be followed by files sent using a chunked encoding."
38796 #: ../src/guestfs.pod:2474
38797 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
38801 #: ../src/guestfs.pod:2476
38802 msgid "For ordinary functions, the request message is:"
38806 #: ../src/guestfs.pod:2478
38809 " total length (header + arguments,\n"
38810 " but not including the length word itself)\n"
38811 " struct guestfs_message_header (encoded as XDR)\n"
38812 " struct guestfs_<foo>_args (encoded as XDR)\n"
38817 #: ../src/guestfs.pod:2483
38819 "The total length field allows the daemon to allocate a fixed size buffer "
38820 "into which it slurps the rest of the message. As a result, the total length "
38821 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
38822 "effective size of any request is limited to somewhere under this size."
38826 #: ../src/guestfs.pod:2489
38828 "Note also that many functions don't take any arguments, in which case the "
38829 "C<guestfs_I<foo>_args> is completely omitted."
38833 #: ../src/guestfs.pod:2492
38835 "The header contains the procedure number (C<guestfs_proc>) which is how the "
38836 "receiver knows what type of args structure to expect, or none at all."
38840 #: ../src/guestfs.pod:2496
38842 "For functions that take optional arguments, the optional arguments are "
38843 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
38844 "arguments. A bitmask in the header indicates which optional arguments are "
38845 "meaningful. The bitmask is also checked to see if it contains bits set "
38846 "which the daemon does not know about (eg. if more optional arguments were "
38847 "added in a later version of the library), and this causes the call to be "
38852 #: ../src/guestfs.pod:2504
38853 msgid "The reply message for ordinary functions is:"
38857 #: ../src/guestfs.pod:2506
38860 " total length (header + ret,\n"
38861 " but not including the length word itself)\n"
38862 " struct guestfs_message_header (encoded as XDR)\n"
38863 " struct guestfs_<foo>_ret (encoded as XDR)\n"
38868 #: ../src/guestfs.pod:2511
38870 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
38871 "functions that return no formal return values."
38875 #: ../src/guestfs.pod:2514
38877 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
38881 #: ../src/guestfs.pod:2517
38883 "In the case of an error, a flag is set in the header, and the reply message "
38884 "is slightly changed:"
38888 #: ../src/guestfs.pod:2520
38891 " total length (header + error,\n"
38892 " but not including the length word itself)\n"
38893 " struct guestfs_message_header (encoded as XDR)\n"
38894 " struct guestfs_message_error (encoded as XDR)\n"
38899 #: ../src/guestfs.pod:2525
38901 "The C<guestfs_message_error> structure contains the error message as a "
38906 #: ../src/guestfs.pod:2528
38907 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
38911 #: ../src/guestfs.pod:2530
38913 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
38914 "The normal request message is sent (see above). However this is followed by "
38915 "a sequence of file chunks."
38919 #: ../src/guestfs.pod:2534
38922 " total length (header + arguments,\n"
38923 " but not including the length word itself,\n"
38924 " and not including the chunks)\n"
38925 " struct guestfs_message_header (encoded as XDR)\n"
38926 " struct guestfs_<foo>_args (encoded as XDR)\n"
38927 " sequence of chunks for FileIn param #0\n"
38928 " sequence of chunks for FileIn param #1 etc.\n"
38933 #: ../src/guestfs.pod:2542
38934 msgid "The \"sequence of chunks\" is:"
38938 #: ../src/guestfs.pod:2544
38941 " length of chunk (not including length word itself)\n"
38942 " struct guestfs_chunk (encoded as XDR)\n"
38943 " length of chunk\n"
38944 " struct guestfs_chunk (encoded as XDR)\n"
38946 " length of chunk\n"
38947 " struct guestfs_chunk (with data.data_len == 0)\n"
38952 #: ../src/guestfs.pod:2552
38954 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
38955 "is set in the final chunk to indicate either successful completion or early "
38960 #: ../src/guestfs.pod:2556
38962 "At time of writing there are no functions that have more than one FileIn "
38963 "parameter. However this is (theoretically) supported, by sending the "
38964 "sequence of chunks for each FileIn parameter one after another (from left to "
38969 #: ../src/guestfs.pod:2561
38971 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
38972 "transfer. The library does this by sending a chunk with a special flag set "
38973 "to indicate cancellation. When the daemon sees this, it cancels the whole "
38974 "RPC, does I<not> send any reply, and goes back to reading the next request."
38978 #: ../src/guestfs.pod:2567
38980 "The daemon may also cancel. It does this by writing a special word "
38981 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
38982 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
38983 "cancel chunk). The special word is chosen so that even if cancellation "
38984 "happens right at the end of the transfer (after the library has finished "
38985 "writing and has started listening for the reply), the \"spurious\" cancel "
38986 "flag will not be confused with the reply message."
38990 #: ../src/guestfs.pod:2576
38992 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
38993 "limit), and also files where the size is not known in advance (eg. from "
38994 "pipes or sockets). However the chunks are rather small "
38995 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
38996 "to keep much in memory."
39000 #: ../src/guestfs.pod:2582
39001 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
39005 #: ../src/guestfs.pod:2584
39007 "The protocol for FileOut parameters is exactly the same as for FileIn "
39008 "parameters, but with the roles of daemon and library reversed."
39012 #: ../src/guestfs.pod:2587
39015 " total length (header + ret,\n"
39016 " but not including the length word itself,\n"
39017 " and not including the chunks)\n"
39018 " struct guestfs_message_header (encoded as XDR)\n"
39019 " struct guestfs_<foo>_ret (encoded as XDR)\n"
39020 " sequence of chunks for FileOut param #0\n"
39021 " sequence of chunks for FileOut param #1 etc.\n"
39026 #: ../src/guestfs.pod:2595
39027 msgid "INITIAL MESSAGE"
39031 #: ../src/guestfs.pod:2597
39033 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
39034 "which indicates that the guest and daemon is alive. This is what L</"
39035 "guestfs_launch> waits for."
39039 #: ../src/guestfs.pod:2601
39040 msgid "PROGRESS NOTIFICATION MESSAGES"
39044 #: ../src/guestfs.pod:2603
39046 "The daemon may send progress notification messages at any time. These are "
39047 "distinguished by the normal length word being replaced by "
39048 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
39052 #: ../src/guestfs.pod:2607
39054 "The library turns them into progress callbacks (see L</"
39055 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
39060 #: ../src/guestfs.pod:2611
39062 "The daemon self-limits the frequency of progress messages it sends (see "
39063 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
39068 #: ../src/guestfs.pod:2615
39069 msgid "LIBGUESTFS VERSION NUMBERS"
39073 #: ../src/guestfs.pod:2617
39075 "Since April 2010, libguestfs has started to make separate development and "
39076 "stable releases, along with corresponding branches in our git repository. "
39077 "These separate releases can be identified by version number:"
39081 #: ../src/guestfs.pod:2622
39084 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
39085 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
39091 " | `-------- sub-version\n"
39093 " `------ always '1' because we don't change the ABI\n"
39098 #: ../src/guestfs.pod:2633
39099 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
39103 #: ../src/guestfs.pod:2635
39105 "As time passes we cherry pick fixes from the development branch and backport "
39106 "those into the stable branch, the effect being that the stable branch should "
39107 "get more stable and less buggy over time. So the stable releases are ideal "
39108 "for people who don't need new features but would just like the software to "
39113 #: ../src/guestfs.pod:2641
39114 msgid "Our criteria for backporting changes are:"
39118 #: ../src/guestfs.pod:2647
39120 "Documentation changes which don't affect any code are backported unless the "
39121 "documentation refers to a future feature which is not in stable."
39125 #: ../src/guestfs.pod:2653
39127 "Bug fixes which are not controversial, fix obvious problems, and have been "
39128 "well tested are backported."
39132 #: ../src/guestfs.pod:2658
39134 "Simple rearrangements of code which shouldn't affect how it works get "
39135 "backported. This is so that the code in the two branches doesn't get too "
39136 "far out of step, allowing us to backport future fixes more easily."
39140 #: ../src/guestfs.pod:2664
39142 "We I<don't> backport new features, new APIs, new tools etc, except in one "
39143 "exceptional case: the new feature is required in order to implement an "
39144 "important bug fix."
39148 #: ../src/guestfs.pod:2670
39150 "A new stable branch starts when we think the new features in development are "
39151 "substantial and compelling enough over the current stable branch to warrant "
39152 "it. When that happens we create new stable and development versions 1.N.0 "
39153 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
39154 "stable at this point, but by backporting fixes from development, that branch "
39155 "will stabilize over time."
39159 #: ../src/guestfs.pod:2678
39160 msgid "EXTENDING LIBGUESTFS"
39164 #: ../src/guestfs.pod:2680
39165 msgid "ADDING A NEW API ACTION"
39169 #: ../src/guestfs.pod:2682
39171 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
39172 "documentation) are generated, and this makes it easy to extend the "
39177 #: ../src/guestfs.pod:2686
39178 msgid "To add a new API action there are two changes:"
39182 #: ../src/guestfs.pod:2692
39184 "You need to add a description of the call (name, parameters, return type, "
39185 "tests, documentation) to C<generator/generator_actions.ml>."
39189 #: ../src/guestfs.pod:2695
39191 "There are two sorts of API action, depending on whether the call goes "
39192 "through to the daemon in the appliance, or is serviced entirely by the "
39193 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
39194 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
39195 "an example of the latter, since a trace flag is maintained in the handle and "
39196 "all tracing is done on the library side."
39200 #: ../src/guestfs.pod:2703
39202 "Most new actions are of the first type, and get added to the "
39203 "C<daemon_functions> list. Each function has a unique procedure number used "
39204 "in the RPC protocol which is assigned to that action when we publish "
39205 "libguestfs and cannot be reused. Take the latest procedure number and "
39210 #: ../src/guestfs.pod:2709
39212 "For library-only actions of the second type, add to the "
39213 "C<non_daemon_functions> list. Since these functions are serviced by the "
39214 "library and do not travel over the RPC mechanism to the daemon, these "
39215 "functions do not need a procedure number, and so the procedure number is set "
39220 #: ../src/guestfs.pod:2717
39221 msgid "Implement the action (in C):"
39225 #: ../src/guestfs.pod:2719
39227 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
39228 "C<daemon/> directory."
39232 #: ../src/guestfs.pod:2722
39234 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
39235 "(note: double underscore) in the C<src/> directory."
39239 #: ../src/guestfs.pod:2725
39240 msgid "In either case, use another function as an example of what to do."
39244 #: ../src/guestfs.pod:2729
39245 msgid "After making these changes, use C<make> to compile."
39249 #: ../src/guestfs.pod:2731
39251 "Note that you don't need to implement the RPC, language bindings, manual "
39252 "pages or anything else. It's all automatically generated from the OCaml "
39257 #: ../src/guestfs.pod:2735
39258 msgid "ADDING TESTS FOR AN API ACTION"
39262 #: ../src/guestfs.pod:2737
39264 "You can supply zero or as many tests as you want per API call. The tests "
39265 "can either be added as part of the API description (C<generator/"
39266 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
39267 "into C<regressions/>. Note that adding a script to C<regressions/> is "
39268 "slower, so if possible use the first method."
39272 #: ../src/guestfs.pod:2743
39274 "The following describes the test environment used when you add an API test "
39275 "in C<generator_actions.ml>."
39279 #: ../src/guestfs.pod:2746
39280 msgid "The test environment has 4 block devices:"
39284 #: ../src/guestfs.pod:2750
39285 msgid "C</dev/sda> 500MB"
39289 #: ../src/guestfs.pod:2752
39290 msgid "General block device for testing."
39294 #: ../src/guestfs.pod:2754
39295 msgid "C</dev/sdb> 50MB"
39299 #: ../src/guestfs.pod:2756
39301 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
39306 #: ../src/guestfs.pod:2759
39307 msgid "C</dev/sdc> 10MB"
39311 #: ../src/guestfs.pod:2761
39312 msgid "Used in a few tests where two block devices are needed."
39316 #: ../src/guestfs.pod:2763
39317 msgid "C</dev/sdd>"
39321 #: ../src/guestfs.pod:2765
39322 msgid "ISO with fixed content (see C<images/test.iso>)."
39326 #: ../src/guestfs.pod:2769
39328 "To be able to run the tests in a reasonable amount of time, the libguestfs "
39329 "appliance and block devices are reused between tests. So don't try testing "
39330 "L</guestfs_kill_subprocess> :-x"
39334 #: ../src/guestfs.pod:2773
39336 "Each test starts with an initial scenario, selected using one of the "
39337 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
39338 "initialize the disks mentioned above in a particular way as documented in "
39339 "C<generator_types.ml>. You should not assume anything about the previous "
39340 "contents of other disks that are not initialized."
39344 #: ../src/guestfs.pod:2779
39346 "You can add a prerequisite clause to any individual test. This is a run-"
39347 "time check, which, if it fails, causes the test to be skipped. Useful if "
39348 "testing a command which might not work on all variations of libguestfs "
39349 "builds. A test that has prerequisite of C<Always> means to run "
39354 #: ../src/guestfs.pod:2785
39356 "In addition, packagers can skip individual tests by setting environment "
39357 "variables before running C<make check>."
39361 #: ../src/guestfs.pod:2788
39364 " SKIP_TEST_<CMD>_<NUM>=1\n"
39369 #: ../src/guestfs.pod:2790
39370 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
39374 #: ../src/guestfs.pod:2792
39379 #: ../src/guestfs.pod:2794
39382 " SKIP_TEST_<CMD>=1\n"
39387 #: ../src/guestfs.pod:2796
39388 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
39392 #: ../src/guestfs.pod:2798
39393 msgid "Packagers can run only certain tests by setting for example:"
39397 #: ../src/guestfs.pod:2800
39400 " TEST_ONLY=\"vfs_type zerofree\"\n"
39405 #: ../src/guestfs.pod:2802
39407 "See C<capitests/tests.c> for more details of how these environment variables "
39412 #: ../src/guestfs.pod:2805
39413 msgid "DEBUGGING NEW API ACTIONS"
39417 #: ../src/guestfs.pod:2807
39418 msgid "Test new actions work before submitting them."
39422 #: ../src/guestfs.pod:2809
39423 msgid "You can use guestfish to try out new commands."
39427 #: ../src/guestfs.pod:2811
39429 "Debugging the daemon is a problem because it runs inside a minimal "
39430 "environment. However you can fprintf messages in the daemon to stderr, and "
39431 "they will show up if you use C<guestfish -v>."
39435 #: ../src/guestfs.pod:2815
39436 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
39440 #: ../src/guestfs.pod:2817
39442 "Our C source code generally adheres to some basic code-formatting "
39443 "conventions. The existing code base is not totally consistent on this "
39444 "front, but we do prefer that contributed code be formatted similarly. In "
39445 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
39446 "indentation level, and other than that, follow the K&R style."
39450 #: ../src/guestfs.pod:2823
39452 "If you use Emacs, add the following to one of one of your start-up files (e."
39453 "g., ~/.emacs), to help ensure that you get indentation right:"
39457 #: ../src/guestfs.pod:2826
39460 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
39461 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
39462 " (add-hook 'find-file-hook\n"
39463 " '(lambda () (if (and buffer-file-name\n"
39464 " (string-match \"/libguestfs\\\\>\"\n"
39465 " (buffer-file-name))\n"
39466 " (not (string-equal mode-name \"Change Log\"))\n"
39467 " (not (string-equal mode-name \"Makefile\")))\n"
39468 " (setq indent-tabs-mode nil))))\n"
39473 #: ../src/guestfs.pod:2836
39476 " ;;; When editing C sources in libguestfs, use this style.\n"
39477 " (defun libguestfs-c-mode ()\n"
39478 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
39480 " (c-set-style \"K&R\")\n"
39481 " (setq c-indent-level 2)\n"
39482 " (setq c-basic-offset 2))\n"
39483 " (add-hook 'c-mode-hook\n"
39484 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
39485 " (buffer-file-name))\n"
39486 " (libguestfs-c-mode))))\n"
39491 #: ../src/guestfs.pod:2848
39492 msgid "Enable warnings when compiling (and fix any problems this finds):"
39496 #: ../src/guestfs.pod:2851
39499 " ./configure --enable-gcc-warnings\n"
39504 #: ../src/guestfs.pod:2853
39505 msgid "Useful targets are:"
39509 #: ../src/guestfs.pod:2855
39512 " make syntax-check # checks the syntax of the C code\n"
39513 " make check # runs the test suite\n"
39518 #: ../src/guestfs.pod:2858
39519 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
39523 #: ../src/guestfs.pod:2860
39525 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
39526 "which are used to do shell quoting."
39530 #: ../src/guestfs.pod:2865
39535 #: ../src/guestfs.pod:2867
39537 "Simple shell quoted string. Any spaces or other shell characters are "
39542 #: ../src/guestfs.pod:2870
39547 #: ../src/guestfs.pod:2872
39549 "Same as C<%Q> except the string is treated as a path which is prefixed by "
39554 #: ../src/guestfs.pod:2879
39557 " asprintf (&cmd, \"cat %R\", path);\n"
39562 #: ../src/guestfs.pod:2881
39563 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
39567 #: ../src/guestfs.pod:2883
39569 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
39570 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
39571 "they are not passed via the shell (instead, straight to exec). You probably "
39572 "want to use the C<sysroot_path()> function however."
39576 #: ../src/guestfs.pod:2889
39577 msgid "SUBMITTING YOUR NEW API ACTIONS"
39581 #: ../src/guestfs.pod:2891
39583 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
39584 "libguestfs> and CC to L<rjones@redhat.com>."
39588 #: ../src/guestfs.pod:2895
39589 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
39593 #: ../src/guestfs.pod:2897
39594 msgid "We support i18n (gettext anyhow) in the library."
39598 #: ../src/guestfs.pod:2899
39600 "However many messages come from the daemon, and we don't translate those at "
39601 "the moment. One reason is that the appliance generally has all locale files "
39602 "removed from it, because they take up a lot of space. So we'd have to readd "
39603 "some of those, as well as copying our PO files into the appliance."
39607 #: ../src/guestfs.pod:2905
39609 "Debugging messages are never translated, since they are intended for the "
39614 #: ../src/guestfs.pod:2908
39615 msgid "SOURCE CODE SUBDIRECTORIES"
39619 #: ../src/guestfs.pod:2912
39624 #: ../src/guestfs.pod:2914
39625 msgid "L<virt-alignment-scan(1)> command and documentation."
39629 #: ../src/guestfs.pod:2918
39630 msgid "The libguestfs appliance, build scripts and so on."
39634 #: ../src/guestfs.pod:2920
39635 msgid "C<capitests>"
39639 #: ../src/guestfs.pod:2922
39640 msgid "Automated tests of the C API."
39644 #: ../src/guestfs.pod:2924
39649 #: ../src/guestfs.pod:2926
39651 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
39656 #: ../src/guestfs.pod:2929
39661 #: ../src/guestfs.pod:2931
39663 "Safety and liveness tests of components that libguestfs depends upon (not of "
39664 "libguestfs itself). Mainly this is for qemu and the kernel."
39668 #: ../src/guestfs.pod:2934
39673 #: ../src/guestfs.pod:2936
39675 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
39676 "command and documentation."
39680 #: ../src/guestfs.pod:2939
39685 #: ../src/guestfs.pod:2941
39686 msgid "Outside contributions, experimental parts."
39690 #: ../src/guestfs.pod:2943
39695 #: ../src/guestfs.pod:2945
39697 "The daemon that runs inside the libguestfs appliance and carries out actions."
39701 #: ../src/guestfs.pod:2948
39706 #: ../src/guestfs.pod:2950
39707 msgid "L<virt-df(1)> command and documentation."
39711 #: ../src/guestfs.pod:2952
39716 #: ../src/guestfs.pod:2954
39717 msgid "L<virt-edit(1)> command and documentation."
39721 #: ../src/guestfs.pod:2956
39722 msgid "C<examples>"
39726 #: ../src/guestfs.pod:2958
39727 msgid "C API example code."
39731 #: ../src/guestfs.pod:2960
39736 #: ../src/guestfs.pod:2962
39738 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
39739 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
39740 "L<virt-tar-out(1)>."
39744 #: ../src/guestfs.pod:2966
39749 #: ../src/guestfs.pod:2968
39751 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
39755 #: ../src/guestfs.pod:2970
39756 msgid "C<generator>"
39760 #: ../src/guestfs.pod:2972
39762 "The crucially important generator, used to automatically generate large "
39763 "amounts of boilerplate C code for things like RPC and bindings."
39767 #: ../src/guestfs.pod:2975
39772 #: ../src/guestfs.pod:2977
39773 msgid "Files used by the test suite."
39777 #: ../src/guestfs.pod:2979
39778 msgid "Some \"phony\" guest images which we test against."
39782 #: ../src/guestfs.pod:2981
39783 msgid "C<inspector>"
39787 #: ../src/guestfs.pod:2983
39788 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
39792 #: ../src/guestfs.pod:2985
39797 #: ../src/guestfs.pod:2987
39798 msgid "Logo used on the website. The fish is called Arthur by the way."
39802 #: ../src/guestfs.pod:2989
39807 #: ../src/guestfs.pod:2991
39808 msgid "M4 macros used by autoconf."
39812 #: ../src/guestfs.pod:2993
39817 #: ../src/guestfs.pod:2995
39818 msgid "Translations of simple gettext strings."
39822 #: ../src/guestfs.pod:2997
39827 #: ../src/guestfs.pod:2999
39829 "The build infrastructure and PO files for translations of manpages and POD "
39830 "files. Eventually this will be combined with the C<po> directory, but that "
39831 "is rather complicated."
39835 #: ../src/guestfs.pod:3003
39836 msgid "C<regressions>"
39840 #: ../src/guestfs.pod:3005
39841 msgid "Regression tests."
39845 #: ../src/guestfs.pod:3007
39850 #: ../src/guestfs.pod:3009
39851 msgid "L<virt-rescue(1)> command and documentation."
39855 #: ../src/guestfs.pod:3011
39860 #: ../src/guestfs.pod:3013
39861 msgid "L<virt-resize(1)> command and documentation."
39865 #: ../src/guestfs.pod:3015
39866 msgid "C<sparsify>"
39870 #: ../src/guestfs.pod:3017
39871 msgid "L<virt-sparsify(1)> command and documentation."
39875 #: ../src/guestfs.pod:3019
39880 #: ../src/guestfs.pod:3021
39881 msgid "Source code to the C library."
39885 #: ../src/guestfs.pod:3023
39890 #: ../src/guestfs.pod:3025
39892 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
39896 #: ../src/guestfs.pod:3027
39897 msgid "C<test-tool>"
39901 #: ../src/guestfs.pod:3029
39903 "Test tool for end users to test if their qemu/kernel combination will work "
39908 #: ../src/guestfs.pod:3032
39913 #: ../src/guestfs.pod:3034
39918 #: ../src/guestfs.pod:3036
39923 #: ../src/guestfs.pod:3038
39928 #: ../src/guestfs.pod:3040
39933 #: ../src/guestfs.pod:3042
39938 #: ../src/guestfs.pod:3044
39943 #: ../src/guestfs.pod:3046
39948 #: ../src/guestfs.pod:3048
39953 #: ../src/guestfs.pod:3050
39954 msgid "Language bindings."
39958 #: ../src/guestfs.pod:3054
39959 msgid "MAKING A STABLE RELEASE"
39963 #: ../src/guestfs.pod:3056
39965 "When we make a stable release, there are several steps documented here. See "
39966 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
39971 #: ../src/guestfs.pod:3064
39973 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
39977 #: ../src/guestfs.pod:3069
39978 msgid "Finalize RELEASE-NOTES."
39982 #: ../src/guestfs.pod:3073
39983 msgid "Update ROADMAP."
39987 #: ../src/guestfs.pod:3077
39988 msgid "Run C<src/api-support/update-from-tarballs.sh>."
39992 #: ../src/guestfs.pod:3081
39993 msgid "Push and pull from Transifex."
39997 #: ../src/guestfs.pod:3083
40002 #: ../src/guestfs.pod:3085
40010 #: ../src/guestfs.pod:3087
40011 msgid "to push the latest POT files to Transifex. Then run:"
40015 #: ../src/guestfs.pod:3089
40023 #: ../src/guestfs.pod:3091
40024 msgid "which is a wrapper to pull the latest translated C<*.po> files."
40028 #: ../src/guestfs.pod:3095
40030 "Create new stable and development directories under L<http://libguestfs.org/"
40035 #: ../src/guestfs.pod:3100
40036 msgid "Create the branch in git:"
40040 #: ../src/guestfs.pod:3102
40043 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
40044 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
40045 " git branch stable-1.XX\n"
40046 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
40051 #: ../src/guestfs.pod:3109
40056 #: ../src/guestfs.pod:3111
40057 msgid "PROTOCOL LIMITS"
40061 #: ../src/guestfs.pod:3113
40063 "Internally libguestfs uses a message-based protocol to pass API calls and "
40064 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
40065 "plenty more detail about this). The maximum message size used by the "
40066 "protocol is slightly less than 4 MB. For some API calls you may need to be "
40067 "aware of this limit. The API calls which may be affected are individually "
40068 "documented, with a link back to this section of the documentation."
40072 #: ../src/guestfs.pod:3121
40074 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
40075 "a simple string. Because this string is at some point internally encoded as "
40076 "a message, the maximum size that it can return is slightly under 4 MB. If "
40077 "the requested file is larger than this then you will get an error."
40081 #: ../src/guestfs.pod:3127
40083 "In order to transfer large files into and out of the guest filesystem, you "
40084 "need to use particular calls that support this. The sections L</UPLOADING> "
40085 "and L</DOWNLOADING> document how to do this."
40089 #: ../src/guestfs.pod:3131
40091 "You might also consider mounting the disk image using our FUSE filesystem "
40092 "support (L<guestmount(1)>)."
40096 #: ../src/guestfs.pod:3134
40097 msgid "MAXIMUM NUMBER OF DISKS"
40101 #: ../src/guestfs.pod:3136
40102 msgid "When using virtio disks (the default) the current limit is B<25> disks."
40106 #: ../src/guestfs.pod:3139
40108 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
40109 "slots. However febootstrap only understands disks with names C</dev/vda> "
40110 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
40115 #: ../src/guestfs.pod:3144
40117 "We are working to substantially raise this limit in future versions but it "
40118 "requires complex changes to qemu."
40122 #: ../src/guestfs.pod:3147
40124 "In future versions of libguestfs it should also be possible to \"hot plug\" "
40125 "disks (add and remove disks after calling L</guestfs_launch>). This also "
40126 "requires changes to qemu."
40130 #: ../src/guestfs.pod:3151
40131 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
40135 #: ../src/guestfs.pod:3153
40136 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
40140 #: ../src/guestfs.pod:3155
40142 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
40143 "vda>, and C</dev/vda1> through C</dev/vda15>)."
40147 #: ../src/guestfs.pod:3158
40149 "If you attach a disk with more than 15 partitions, the extra partitions are "
40150 "ignored by libguestfs."
40154 #: ../src/guestfs.pod:3161
40155 msgid "MAXIMUM SIZE OF A DISK"
40159 #: ../src/guestfs.pod:3163
40160 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
40164 #: ../src/guestfs.pod:3165
40166 "We have tested block devices up to 1 exabyte (2**60 or "
40167 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
40172 #: ../src/guestfs.pod:3169
40174 "Although libguestfs probably does not impose any limit, the underlying host "
40175 "storage will. If you store disk images on a host ext4 filesystem, then the "
40176 "maximum size will be limited by the maximum ext4 file size (currently 16 "
40177 "TB). If you store disk images as host logical volumes then you are limited "
40178 "by the maximum size of an LV."
40182 #: ../src/guestfs.pod:3175
40184 "For the hugest disk image files, we recommend using XFS on the host for "
40189 #: ../src/guestfs.pod:3178
40190 msgid "MAXIMUM SIZE OF A PARTITION"
40194 #: ../src/guestfs.pod:3180
40196 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
40197 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
40198 "address a partition located beyond 2 TB on the disk."
40202 #: ../src/guestfs.pod:3184
40204 "It is recommended that you use GPT partitions on disks which are larger than "
40205 "this size. GPT uses 64 bit sector numbers and so can address partitions "
40206 "which are theoretically larger than the largest disk we could support."
40210 #: ../src/guestfs.pod:3189
40211 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
40215 #: ../src/guestfs.pod:3191
40217 "This depends on the filesystem type. libguestfs itself does not impose any "
40218 "known limit. Consult Wikipedia or the filesystem documentation to find out "
40219 "what these limits are."
40223 #: ../src/guestfs.pod:3195
40224 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
40228 #: ../src/guestfs.pod:3197
40230 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
40231 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
40232 "uploads and downloads."
40236 #: ../src/guestfs.pod:3201
40237 msgid "INSPECTION LIMITS"
40241 #: ../src/guestfs.pod:3203
40243 "The inspection code has several arbitrary limits on things like the size of "
40244 "Windows Registry hive it will read, and the length of product name. These "
40245 "are intended to stop a malicious guest from consuming arbitrary amounts of "
40246 "memory and disk space on the host, and should not be reached in practice. "
40247 "See the source code for more information."
40251 #: ../src/guestfs.pod:3229
40253 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
40254 "effect as calling C<guestfs_set_verbose (g, 1)>."
40258 #: ../src/guestfs.pod:3241
40260 "Set the path that libguestfs uses to search for a supermin appliance. See "
40261 "the discussion of paths in section L</PATH> above."
40265 #: ../src/guestfs.pod:3250
40266 msgid "See also L</QEMU WRAPPERS> above."
40270 #: ../src/guestfs.pod:3254
40272 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
40273 "effect as calling C<guestfs_set_trace (g, 1)>."
40277 #: ../src/guestfs.pod:3272
40279 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-"
40280 "ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
40281 "L<guestfish(1)>, L<guestmount(1)>, L<virt-alignment-scan(1)>, L<virt-cat(1)"
40282 ">, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
40283 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
40284 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue"
40285 "(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar"
40286 "(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
40287 "L<febootstrap(1)>, L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)"
40288 ">, L<http://libguestfs.org/>."
40292 #: ../src/guestfs.pod:3308
40294 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
40295 "(8)>, L<disktype(1)>."
40299 #: ../src/guestfs.pod:3315 ../tools/virt-make-fs.pl:571
40300 #: ../tools/virt-win-reg.pl:772
40305 #: ../src/guestfs.pod:3317
40306 msgid "To get a list of bugs against libguestfs use this link:"
40310 #: ../src/guestfs.pod:3319
40312 "L<https://bugzilla.redhat.com/buglist.cgi?"
40313 "component=libguestfs&product=Virtualization+Tools>"
40317 #: ../src/guestfs.pod:3321
40318 msgid "To report a new bug against libguestfs use this link:"
40322 #: ../src/guestfs.pod:3323
40324 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
40325 "component=libguestfs&product=Virtualization+Tools>"
40329 #: ../src/guestfs.pod:3325
40330 msgid "When reporting a bug, please check:"
40334 #: ../src/guestfs.pod:3331
40335 msgid "That the bug hasn't been reported already."
40339 #: ../src/guestfs.pod:3335
40340 msgid "That you are testing a recent version."
40344 #: ../src/guestfs.pod:3339
40345 msgid "Describe the bug accurately, and give a way to reproduce it."
40349 #: ../src/guestfs.pod:3343
40351 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
40356 #: ../test-tool/libguestfs-test-tool.pod:5
40357 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
40361 #: ../test-tool/libguestfs-test-tool.pod:9
40364 " libguestfs-test-tool [--options]\n"
40369 #: ../test-tool/libguestfs-test-tool.pod:13
40371 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
40372 "to check basic libguestfs functionality is working. This is needed because "
40373 "libguestfs occasionally breaks for reasons beyond our control: usually "
40374 "because of changes in the underlying qemu or kernel packages, or the host "
40379 #: ../test-tool/libguestfs-test-tool.pod:19
40380 msgid "If you suspect a problem in libguestfs, then just run:"
40384 #: ../test-tool/libguestfs-test-tool.pod:21
40387 " libguestfs-test-tool\n"
40392 #: ../test-tool/libguestfs-test-tool.pod:23
40393 msgid "It will print lots of diagnostic messages."
40397 #: ../test-tool/libguestfs-test-tool.pod:25
40398 msgid "If it runs to completion successfully, you will see this near the end:"
40402 #: ../test-tool/libguestfs-test-tool.pod:27
40405 " ===== TEST FINISHED OK =====\n"
40410 #: ../test-tool/libguestfs-test-tool.pod:29
40411 msgid "and the test tool will exit with code 0."
40415 #: ../test-tool/libguestfs-test-tool.pod:31
40417 "If it fails (and/or exits with non-zero error code), please paste the "
40418 "I<complete, unedited> output of the test tool into a bug report. More "
40419 "information about reporting bugs can be found on the L<http://libguestfs.org/"
40424 #: ../test-tool/libguestfs-test-tool.pod:42
40425 msgid "Display short usage information and exit."
40429 #: ../test-tool/libguestfs-test-tool.pod:44
40430 msgid "B<--qemu qemu_binary>"
40434 #: ../test-tool/libguestfs-test-tool.pod:46
40436 "If you have downloaded another qemu binary, point this option at the full "
40437 "path of the binary to try it."
40441 #: ../test-tool/libguestfs-test-tool.pod:49
40442 msgid "B<--qemudir qemu_source_dir>"
40446 #: ../test-tool/libguestfs-test-tool.pod:51
40448 "If you have compiled qemu from source, point this option at the source "
40449 "directory to try it."
40453 #: ../test-tool/libguestfs-test-tool.pod:54
40458 #: ../test-tool/libguestfs-test-tool.pod:56
40459 msgid "B<--timeout N>"
40463 #: ../test-tool/libguestfs-test-tool.pod:58
40465 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
40466 "minutes) which does not usually need to be adjusted."
40470 #: ../test-tool/libguestfs-test-tool.pod:63
40471 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
40475 #: ../test-tool/libguestfs-test-tool.pod:65
40477 "If you have compiled another version of qemu from source and would like to "
40478 "try that, then you can use the I<--qemudir> option to point to the qemu "
40479 "source directory."
40483 #: ../test-tool/libguestfs-test-tool.pod:69
40485 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
40486 "option to point to the binary."
40490 #: ../test-tool/libguestfs-test-tool.pod:72
40492 "Note when using these options, you can ignore the business of qemu wrapper "
40493 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
40494 "wrapper script for you if one is needed."
40498 #: ../test-tool/libguestfs-test-tool.pod:76
40499 msgid "TRYING OUT A DIFFERENT KERNEL"
40503 #: ../test-tool/libguestfs-test-tool.pod:78
40505 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
40506 "libguestfs tries. You do this by setting the environment variables "
40507 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
40511 #: ../test-tool/libguestfs-test-tool.pod:82
40513 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
40518 #: ../test-tool/libguestfs-test-tool.pod:85
40519 msgid "SELF-DIAGNOSIS"
40523 #: ../test-tool/libguestfs-test-tool.pod:87
40525 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
40526 "produced by libguestfs-test-tool and/or possible errors."
40530 #: ../test-tool/libguestfs-test-tool.pod:92
40532 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
40533 "I<1> if there was an error."
40537 #: ../test-tool/libguestfs-test-tool.pod:97
40539 "For the full list of environment variables which may affect libguestfs, "
40540 "please see the L<guestfs(3)> manual page."
40544 #: ../test-tool/libguestfs-test-tool.pod:102
40545 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
40549 #: ../tools/virt-list-filesystems.pl:32
40551 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
40555 #: ../tools/virt-list-filesystems.pl:36
40558 " virt-list-filesystems [--options] domname\n"
40563 #: ../tools/virt-list-filesystems.pl:38
40566 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
40571 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
40573 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
40578 #: ../tools/virt-list-filesystems.pl:45
40580 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
40581 "are contained in a virtual machine or disk image."
40585 #: ../tools/virt-list-filesystems.pl:49
40587 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
40588 "functionality. For more complex cases you should look at the L<guestfish(1)"
40593 #: ../tools/virt-list-filesystems.pl:112
40595 "With this option, C<virt-list-filesystems> displays the type of each "
40596 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
40600 #: ../tools/virt-list-filesystems.pl:119
40605 #: ../tools/virt-list-filesystems.pl:123
40607 "Normally we only show mountable filesystems. If this option is given then "
40608 "swap devices are shown too."
40612 #: ../tools/virt-list-filesystems.pl:197
40614 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
40615 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
40616 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40620 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
40621 msgid "Copyright (C) 2009 Red Hat Inc."
40625 #: ../tools/virt-list-partitions.pl:32
40627 "virt-list-partitions - List partitions in a virtual machine or disk image"
40631 #: ../tools/virt-list-partitions.pl:36
40634 " virt-list-partitions [--options] domname\n"
40639 #: ../tools/virt-list-partitions.pl:38
40642 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
40647 #: ../tools/virt-list-partitions.pl:45
40649 "C<virt-list-partitions> is a command line tool to list the partitions that "
40650 "are contained in a virtual machine or disk image. It is mainly useful as a "
40651 "first step to using L<virt-resize(1)>."
40655 #: ../tools/virt-list-partitions.pl:50
40657 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
40658 "functionality. For more complex cases you should look at the L<guestfish(1)"
40663 #: ../tools/virt-list-partitions.pl:113
40664 msgid "Show sizes in human-readable form (eg. \"1G\")."
40668 #: ../tools/virt-list-partitions.pl:123
40670 "With this option, C<virt-list-partitions> displays the type and size of each "
40671 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
40675 #: ../tools/virt-list-partitions.pl:130
40680 #: ../tools/virt-list-partitions.pl:132
40685 #: ../tools/virt-list-partitions.pl:134
40687 "Display the total size of each block device (as a separate row or rows)."
40691 #: ../tools/virt-list-partitions.pl:267
40693 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
40694 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
40695 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40699 #: ../tools/virt-list-partitions.pl:283
40700 msgid "Copyright (C) 2009-2010 Red Hat Inc."
40704 #: ../tools/virt-make-fs.pl:37
40705 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
40709 #: ../tools/virt-make-fs.pl:41
40712 " virt-make-fs [--options] input.tar output.img\n"
40717 #: ../tools/virt-make-fs.pl:43
40720 " virt-make-fs [--options] input.tar.gz output.img\n"
40725 #: ../tools/virt-make-fs.pl:45
40728 " virt-make-fs [--options] directory output.img\n"
40733 #: ../tools/virt-make-fs.pl:49
40735 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
40736 "archive or some files in a directory. It is similar to tools like L<mkisofs"
40737 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
40738 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
40739 "you want to attach these filesystems to existing virtual machines (eg. to "
40740 "import large amounts of read-only data to a VM)."
40744 #: ../tools/virt-make-fs.pl:57
40745 msgid "Basic usage is:"
40749 #: ../tools/virt-make-fs.pl:59
40752 " virt-make-fs input output.img\n"
40757 #: ../tools/virt-make-fs.pl:61
40759 "where C<input> is either a directory containing files that you want to add, "
40760 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
40761 "C<output.img> is a disk image. The input type is detected automatically. "
40762 "The output disk image defaults to a raw ext2 sparse image unless you specify "
40763 "extra flags (see L</OPTIONS> below)."
40767 #: ../tools/virt-make-fs.pl:67
40768 msgid "FILESYSTEM TYPE"
40772 #: ../tools/virt-make-fs.pl:69
40774 "The default filesystem type is C<ext2>. Just about any filesystem type that "
40775 "libguestfs supports can be used (but I<not> read-only formats like "
40776 "ISO9660). Here are some of the more common choices:"
40780 #: ../tools/virt-make-fs.pl:75
40785 #: ../tools/virt-make-fs.pl:77
40787 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
40788 "you are not going to use the filesystem in a way that requires the journal, "
40789 "then this is just wasted overhead."
40793 #: ../tools/virt-make-fs.pl:81
40794 msgid "I<ntfs> or I<vfat>"
40798 #: ../tools/virt-make-fs.pl:83
40799 msgid "Useful if exporting data to a Windows guest."
40803 #: ../tools/virt-make-fs.pl:85
40805 "I<Note for vfat>: The tar archive or local directory must only contain files "
40806 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
40807 "program running within libguestfs is unable to change the ownership of non-"
40808 "root files, since vfat itself does not support this."
40812 #: ../tools/virt-make-fs.pl:90
40817 #: ../tools/virt-make-fs.pl:92
40819 "Lower overhead than C<ext2>, but certain limitations on filename length and "
40820 "total filesystem size."
40824 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116
40825 #: ../tools/virt-make-fs.pl:149
40830 #: ../tools/virt-make-fs.pl:99
40833 " virt-make-fs --type=minix input minixfs.img\n"
40838 #: ../tools/virt-make-fs.pl:101
40839 msgid "TO PARTITION OR NOT TO PARTITION"
40843 #: ../tools/virt-make-fs.pl:103
40844 msgid "Optionally virt-make-fs can add a partition table to the output disk."
40848 #: ../tools/virt-make-fs.pl:105
40850 "Adding a partition can make the disk image more compatible with certain "
40851 "virtualized operating systems which don't expect to see a filesystem "
40852 "directly located on a block device (Linux doesn't care and will happily "
40853 "handle both types)."
40857 #: ../tools/virt-make-fs.pl:110
40859 "On the other hand, if you have a partition table then the output image is no "
40860 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
40861 "directly on a partitioned disk image. (However libguestfs tools such as "
40862 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
40866 #: ../tools/virt-make-fs.pl:118
40867 msgid "Add an MBR partition:"
40871 #: ../tools/virt-make-fs.pl:120
40874 " virt-make-fs --partition -- input disk.img\n"
40879 #: ../tools/virt-make-fs.pl:122
40881 "If the output disk image could be terabyte-sized or larger, it's better to "
40882 "use an EFI/GPT-compatible partition table:"
40886 #: ../tools/virt-make-fs.pl:125
40889 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
40894 #: ../tools/virt-make-fs.pl:127
40895 msgid "EXTRA SPACE"
40899 #: ../tools/virt-make-fs.pl:129
40901 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
40902 "the files that it contains, but might have extra space. Depending on how "
40903 "you are going to use the output, you might think this extra space is wasted "
40904 "and want to minimize it, or you might want to leave space so that more files "
40905 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
40906 "but you can use the I<--size> flag to leave space in the filesystem if you "
40911 #: ../tools/virt-make-fs.pl:137
40913 "An alternative way to leave extra space but not make the output image any "
40914 "bigger is to use an alternative disk image format (instead of the default "
40915 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
40916 "image format (check your hypervisor supports this before using it). This "
40917 "allows you to choose a large I<--size> but the extra space won't actually be "
40918 "allocated in the image until you try to store something in it."
40922 #: ../tools/virt-make-fs.pl:145
40924 "Don't forget that you can also use local commands including L<resize2fs(8)> "
40925 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
40926 "to build another image from scratch."
40930 #: ../tools/virt-make-fs.pl:151
40933 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
40938 #: ../tools/virt-make-fs.pl:179
40939 msgid "Enable debugging information."
40943 #: ../tools/virt-make-fs.pl:185
40944 msgid "B<--size=E<lt>NE<gt>>"
40948 #: ../tools/virt-make-fs.pl:187
40949 msgid "B<--size=+E<lt>NE<gt>>"
40953 #: ../tools/virt-make-fs.pl:189
40954 msgid "B<-s E<lt>NE<gt>>"
40958 #: ../tools/virt-make-fs.pl:191
40959 msgid "B<-s +E<lt>NE<gt>>"
40963 #: ../tools/virt-make-fs.pl:193
40965 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
40969 #: ../tools/virt-make-fs.pl:196
40971 "If this option is I<not> given, then the output image will be just large "
40972 "enough to contain all the files, with not much wasted space."
40976 #: ../tools/virt-make-fs.pl:199
40978 "To choose a fixed size output disk, specify an absolute number followed by b/"
40979 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40980 "Petabytes or Exabytes. This must be large enough to contain all the input "
40981 "files, else you will get an error."
40985 #: ../tools/virt-make-fs.pl:204
40987 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
40988 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40989 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
40990 "the input files, and (approximately) an extra 200 MB free space."
40994 #: ../tools/virt-make-fs.pl:210
40996 "Note that virt-make-fs estimates free space, and therefore will not produce "
40997 "filesystems containing precisely the free space requested. (It is much more "
40998 "expensive and time-consuming to produce a filesystem which has precisely the "
40999 "desired free space)."
41003 #: ../tools/virt-make-fs.pl:219
41004 msgid "B<--format=E<lt>fmtE<gt>>"
41008 #: ../tools/virt-make-fs.pl:221
41009 msgid "B<-F E<lt>fmtE<gt>>"
41013 #: ../tools/virt-make-fs.pl:223
41014 msgid "Choose the output disk image format."
41018 #: ../tools/virt-make-fs.pl:225
41019 msgid "The default is C<raw> (raw sparse disk image)."
41023 #: ../tools/virt-make-fs.pl:227
41025 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
41026 "that would really make sense here is C<qcow2>."
41030 #: ../tools/virt-make-fs.pl:234
41031 msgid "B<--type=E<lt>fsE<gt>>"
41035 #: ../tools/virt-make-fs.pl:236
41036 msgid "B<-t E<lt>fsE<gt>>"
41040 #: ../tools/virt-make-fs.pl:238
41041 msgid "Choose the output filesystem type."
41045 #: ../tools/virt-make-fs.pl:240
41046 msgid "The default is C<ext2>."
41050 #: ../tools/virt-make-fs.pl:242
41052 "Any filesystem which is supported read-write by libguestfs can be used here."
41056 #: ../tools/virt-make-fs.pl:249
41057 msgid "B<--partition>"
41061 #: ../tools/virt-make-fs.pl:251
41062 msgid "B<--partition=E<lt>parttypeE<gt>>"
41066 #: ../tools/virt-make-fs.pl:253
41068 "If specified, this flag adds an MBR partition table to the output disk image."
41072 #: ../tools/virt-make-fs.pl:256
41074 "You can change the partition table type, eg. I<--partition=gpt> for large "
41079 #: ../tools/virt-make-fs.pl:259
41081 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
41082 "might consider the next parameter to be the partition type. For example:"
41086 #: ../tools/virt-make-fs.pl:263
41089 " virt-make-fs --partition input.tar output.img\n"
41094 #: ../tools/virt-make-fs.pl:265
41096 "would cause virt-make-fs to think you wanted to use a partition type of "
41097 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
41098 "dash) between options and the input and output arguments:"
41102 #: ../tools/virt-make-fs.pl:269
41105 " virt-make-fs --partition -- input.tar output.img\n"
41110 #: ../tools/virt-make-fs.pl:271
41111 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
41115 #: ../tools/virt-make-fs.pl:559
41117 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
41118 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
41119 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
41123 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
41125 "When reporting bugs, please enable debugging and capture the I<complete> "
41130 #: ../tools/virt-make-fs.pl:576
41133 " export LIBGUESTFS_DEBUG=1\n"
41134 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
41139 #: ../tools/virt-make-fs.pl:579
41141 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
41146 #: ../tools/virt-tar.pl:33
41147 msgid "virt-tar - Extract or upload files to a virtual machine"
41151 #: ../tools/virt-tar.pl:37
41154 " virt-tar [--options] -x domname directory tarball\n"
41159 #: ../tools/virt-tar.pl:39
41162 " virt-tar [--options] -u domname tarball directory\n"
41167 #: ../tools/virt-tar.pl:41
41170 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
41175 #: ../tools/virt-tar.pl:43
41178 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
41183 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
41188 #: ../tools/virt-tar.pl:47
41190 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
41191 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
41195 #: ../tools/virt-tar.pl:52
41196 msgid "Download C</home> from the VM into a local tarball:"
41200 #: ../tools/virt-tar.pl:54
41203 " virt-tar -x domname /home home.tar\n"
41208 #: ../tools/virt-tar.pl:56
41211 " virt-tar -zx domname /home home.tar.gz\n"
41216 #: ../tools/virt-tar.pl:58
41217 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
41221 #: ../tools/virt-tar.pl:60
41224 " virt-tar -u domname uploadstuff.tar /tmp\n"
41229 #: ../tools/virt-tar.pl:62
41232 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
41237 #: ../tools/virt-tar.pl:66
41239 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
41240 "virtual machines. If you do this, you risk disk corruption in the VM. "
41241 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
41245 #: ../tools/virt-tar.pl:71
41247 "You can use I<-x> (extract) on live virtual machines, but you might get "
41248 "inconsistent results or errors if there is filesystem activity inside the "
41249 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
41250 "work, but the only way to guarantee consistent results is if the virtual "
41251 "machine is shut down."
41255 #: ../tools/virt-tar.pl:79
41257 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
41258 "parts of a guest filesystem. There are many possibilities: making backups, "
41259 "uploading data files, snooping on guest activity, fixing or customizing "
41264 #: ../tools/virt-tar.pl:84
41266 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
41267 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
41268 "should look at the L<guestfish(1)> tool."
41272 #: ../tools/virt-tar.pl:88
41274 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
41275 "its contents (recursively) from the virtual machine into a local tarball. "
41276 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
41277 "virtual machine. You cannot use these two options together."
41281 #: ../tools/virt-tar.pl:94
41283 "In addition, you may need to use the I<-z> (gZip) option to enable "
41284 "compression. When uploading, you have to specify I<-z> if the upload file "
41285 "is compressed because virt-tar won't detect this on its own."
41289 #: ../tools/virt-tar.pl:98
41291 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
41292 "example it cannot do PKZip files or bzip2 compression. If you want that "
41293 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
41294 "the L<libguestfs(3)> API)."
41298 #: ../tools/virt-tar.pl:160
41299 msgid "B<--extract>"
41303 #: ../tools/virt-tar.pl:162
41304 msgid "B<--download>"
41308 #: ../tools/virt-tar.pl:164
41313 #: ../tools/virt-tar.pl:166
41314 msgid "B<--upload>"
41318 #: ../tools/virt-tar.pl:168
41320 "Use I<-x> to extract (download) a directory from a virtual machine to a "
41325 #: ../tools/virt-tar.pl:171
41327 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
41328 "Please read the L</WARNING> section above before using this option."
41332 #: ../tools/virt-tar.pl:175
41333 msgid "You must specify exactly one of these options."
41337 #: ../tools/virt-tar.pl:181
41342 #: ../tools/virt-tar.pl:183
41347 #: ../tools/virt-tar.pl:185
41348 msgid "Specify that the input or output tarball is gzip-compressed."
41352 #: ../tools/virt-tar.pl:298
41354 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
41355 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
41356 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
41361 #: ../tools/virt-win-reg.pl:37
41363 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
41367 #: ../tools/virt-win-reg.pl:41
41370 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
41375 #: ../tools/virt-win-reg.pl:43
41378 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
41383 #: ../tools/virt-win-reg.pl:45
41386 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
41391 #: ../tools/virt-win-reg.pl:47
41394 " virt-win-reg --merge domname [input.reg ...]\n"
41399 #: ../tools/virt-win-reg.pl:49
41402 " virt-win-reg [--options] disk.img ... # instead of domname\n"
41407 #: ../tools/virt-win-reg.pl:53
41409 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
41410 "virtual machines. If you do this, you I<will> get irreversible disk "
41411 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
41412 "but doesn't catch all cases."
41416 #: ../tools/virt-win-reg.pl:58
41418 "Modifying the Windows Registry is an inherently risky operation. The format "
41419 "is deliberately obscure and undocumented, and Registry changes can leave the "
41420 "system unbootable. Therefore when using the I<--merge> option, make sure "
41421 "you have a reliable backup first."
41425 #: ../tools/virt-win-reg.pl:65
41427 "This program can export and merge Windows Registry entries from a Windows "
41432 #: ../tools/virt-win-reg.pl:68
41434 "The first parameter is the libvirt guest name or the raw disk image of a "
41439 #: ../tools/virt-win-reg.pl:71
41441 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
41442 "exported (recursively). For example:"
41446 #: ../tools/virt-win-reg.pl:74
41449 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
41454 #: ../tools/virt-win-reg.pl:76
41456 "You can also display single values from within registry keys, for example:"
41460 #: ../tools/virt-win-reg.pl:79
41463 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
41464 " $ virt-win-reg Windows7 $cvkey ProductName\n"
41465 " Windows 7 Enterprise\n"
41470 #: ../tools/virt-win-reg.pl:83
41472 "With I<--merge>, you can merge a textual regedit file into the Windows "
41477 #: ../tools/virt-win-reg.pl:86
41480 " $ virt-win-reg --merge Windows7 changes.reg\n"
41485 #: ../tools/virt-win-reg.pl:90
41487 "This program is only meant for simple access to the registry. If you want "
41488 "to do complicated things with the registry, we suggest you download the "
41489 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
41490 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
41491 "L<hivexregedit(1)>."
41495 #: ../tools/virt-win-reg.pl:159
41500 #: ../tools/virt-win-reg.pl:161
41502 "In merge mode, this merges a textual regedit file into the Windows Registry "
41503 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
41504 "displays or exports Registry entries instead."
41508 #: ../tools/virt-win-reg.pl:165
41510 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
41511 "result in disk corruption. However exporting (without this flag) is always "
41516 #: ../tools/virt-win-reg.pl:173
41517 msgid "B<--encoding> UTF-16LE|ASCII"
41521 #: ../tools/virt-win-reg.pl:175
41523 "When merging (only), you may need to specify the encoding for strings to be "
41524 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
41525 "(3)/ENCODING STRINGS>."
41529 #: ../tools/virt-win-reg.pl:179
41531 "The default is to use UTF-16LE, which should work with recent versions of "
41536 #: ../tools/virt-win-reg.pl:186
41537 msgid "B<--unsafe-printable-strings>"
41541 #: ../tools/virt-win-reg.pl:188
41543 "When exporting (only), assume strings are UTF-16LE and print them as strings "
41544 "instead of hex sequences. Remove the final zero codepoint from strings if "
41549 #: ../tools/virt-win-reg.pl:192
41551 "This is unsafe and does not preserve the fidelity of strings in the original "
41552 "Registry for various reasons:"
41556 #: ../tools/virt-win-reg.pl:199
41558 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
41559 "other encodings will be corrupted by this transformation."
41563 #: ../tools/virt-win-reg.pl:204
41565 "Assumes that everything which has type 1 or 2 is really a string and that "
41566 "everything else is not a string, but the type field in real Registries is "
41571 #: ../tools/virt-win-reg.pl:210
41573 "Loses information about whether a zero codepoint followed the string in the "
41578 #: ../tools/virt-win-reg.pl:215
41580 "This all happens because the Registry itself contains no information about "
41581 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
41585 #: ../tools/virt-win-reg.pl:219
41587 "You should only use this option for quick hacking and debugging of the "
41588 "Registry contents, and I<never> use it if the output is going to be passed "
41589 "into another program or stored in another Registry."
41593 #: ../tools/virt-win-reg.pl:556
41594 msgid "SUPPORTED SYSTEMS"
41598 #: ../tools/virt-win-reg.pl:558
41600 "The program currently supports Windows NT-derived guests starting with "
41601 "Windows XP through to at least Windows 7."
41605 #: ../tools/virt-win-reg.pl:561
41606 msgid "The following Registry keys are supported:"
41610 #: ../tools/virt-win-reg.pl:565
41611 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
41615 #: ../tools/virt-win-reg.pl:567
41616 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
41620 #: ../tools/virt-win-reg.pl:569
41621 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
41625 #: ../tools/virt-win-reg.pl:571
41626 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
41630 #: ../tools/virt-win-reg.pl:573
41631 msgid "C<HKEY_USERS\\.DEFAULT>"
41635 #: ../tools/virt-win-reg.pl:575
41636 msgid "C<HKEY_USERS\\I<SID>>"
41640 #: ../tools/virt-win-reg.pl:577
41641 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
41645 #: ../tools/virt-win-reg.pl:579
41646 msgid "C<HKEY_USERS\\I<username>>"
41650 #: ../tools/virt-win-reg.pl:581
41652 "where I<username> is a local user name (this is a libguestfs extension)."
41656 #: ../tools/virt-win-reg.pl:585
41658 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
41663 #: ../tools/virt-win-reg.pl:588
41665 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
41666 "supported (there is no \"current user\")."
41670 #: ../tools/virt-win-reg.pl:591
41675 #: ../tools/virt-win-reg.pl:593
41677 "C<virt-win-reg> expects that regedit files have already been reencoded in "
41678 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
41679 "style line endings. Since Windows regedit files are often in UTF-16LE with "
41680 "Windows-style line endings, you may need to reencode the whole file before "
41681 "or after processing."
41685 #: ../tools/virt-win-reg.pl:599
41687 "To reencode a file from Windows format to Linux (before processing it with "
41688 "the I<--merge> option), you would do something like this:"
41692 #: ../tools/virt-win-reg.pl:602
41695 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
41700 #: ../tools/virt-win-reg.pl:604
41702 "To go in the opposite direction, after exporting and before sending the file "
41703 "to a Windows user, do something like this:"
41707 #: ../tools/virt-win-reg.pl:607
41710 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
41715 #: ../tools/virt-win-reg.pl:609
41716 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
41720 #: ../tools/virt-win-reg.pl:611
41722 "If you are unsure about the current encoding, use the L<file(1)> command. "
41723 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
41724 "style (CRLF) line endings, like this:"
41728 #: ../tools/virt-win-reg.pl:615
41731 " $ file software.reg\n"
41732 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
41733 " with CRLF line terminators\n"
41738 #: ../tools/virt-win-reg.pl:619
41739 msgid "This file would need conversion before you could I<--merge> it."
41743 #: ../tools/virt-win-reg.pl:621
41744 msgid "CurrentControlSet etc."
41748 #: ../tools/virt-win-reg.pl:623
41750 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
41751 "Registry at the level of the hive file, and therefore you cannot modify "
41756 #: ../tools/virt-win-reg.pl:627
41758 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
41759 "circumstances it might refer to another control set. The way to find out is "
41760 "to look at the C<HKLM\\SYSTEM\\Select> key:"
41764 #: ../tools/virt-win-reg.pl:631
41767 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
41768 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
41769 " \"Current\"=dword:00000001\n"
41770 " \"Default\"=dword:00000001\n"
41771 " \"Failed\"=dword:00000000\n"
41772 " \"LastKnownGood\"=dword:00000002\n"
41777 #: ../tools/virt-win-reg.pl:638
41778 msgid "\"Current\" is the one which Windows will choose when it boots."
41782 #: ../tools/virt-win-reg.pl:640
41784 "Similarly, other C<Current...> keys in the path may need to be replaced."
41788 #: ../tools/virt-win-reg.pl:643
41789 msgid "DELETING REGISTRY KEYS AND VALUES"
41793 #: ../tools/virt-win-reg.pl:645
41794 msgid "To delete a whole registry key, use the syntax:"
41798 #: ../tools/virt-win-reg.pl:647
41801 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
41806 #: ../tools/virt-win-reg.pl:649
41807 msgid "To delete a single value within a key, use the syntax:"
41811 #: ../tools/virt-win-reg.pl:651
41814 " [HKEY_LOCAL_MACHINE\\Foo]\n"
41820 #: ../tools/virt-win-reg.pl:654
41821 msgid "WINDOWS TIPS"
41825 #: ../tools/virt-win-reg.pl:656
41827 "Note that some of these tips modify the guest disk image. The guest I<must> "
41828 "be shut off, else you will get disk corruption."
41832 #: ../tools/virt-win-reg.pl:659
41833 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
41837 #: ../tools/virt-win-reg.pl:661
41839 "Prepare a DOS batch script, VBScript or executable. Upload this using "
41840 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
41841 "is uploaded into C<C:\\>:"
41845 #: ../tools/virt-win-reg.pl:665
41848 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
41853 #: ../tools/virt-win-reg.pl:667
41854 msgid "Prepare a regedit file containing the registry change:"
41858 #: ../tools/virt-win-reg.pl:669
41861 " cat > test.reg <<'EOF'\n"
41862 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
41863 " \"Test\"=\"c:\\\\test.bat\"\n"
41869 #: ../tools/virt-win-reg.pl:674
41871 "In this example we use the key C<RunOnce> which means that the script will "
41872 "run precisely once when the first user logs in. If you want it to run every "
41873 "time a user logs in, replace C<RunOnce> with C<Run>."
41877 #: ../tools/virt-win-reg.pl:678
41878 msgid "Now update the registry:"
41882 #: ../tools/virt-win-reg.pl:680
41885 " virt-win-reg --merge WindowsGuest test.reg\n"
41890 #: ../tools/virt-win-reg.pl:682
41891 msgid "INSTALLING A SERVICE"
41895 #: ../tools/virt-win-reg.pl:684
41897 "This section assumes you are familiar with Windows services, and you either "
41898 "have a program which handles the Windows Service Control Protocol directly "
41899 "or you want to run any program using a service wrapper like SrvAny or the "
41904 #: ../tools/virt-win-reg.pl:689
41906 "First upload the program and optionally the service wrapper. In this case "
41907 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
41911 #: ../tools/virt-win-reg.pl:693
41914 " guestfish -i -d WindowsGuest <<EOF\n"
41915 " upload rhsrvany.exe /rhsrvany.exe\n"
41916 " upload test.exe /test.exe\n"
41922 #: ../tools/virt-win-reg.pl:698
41924 "Prepare a regedit file containing the registry changes. In this example, "
41925 "the first registry change is needed for the service itself or the service "
41926 "wrapper (if used). The second registry change is only needed because I am "
41927 "using the RHSrvAny service wrapper."
41931 #: ../tools/virt-win-reg.pl:703
41934 " cat > service.reg <<'EOF'\n"
41935 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
41936 " \"Type\"=dword:00000010\n"
41937 " \"Start\"=dword:00000002\n"
41938 " \"ErrorControl\"=dword:00000001\n"
41939 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
41940 " \"DisplayName\"=\"RHSrvAny\"\n"
41941 " \"ObjectName\"=\"NetworkService\"\n"
41946 #: ../tools/virt-win-reg.pl:712
41949 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
41950 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
41951 " \"PWD\"=\"c:\\\\Temp\"\n"
41957 #: ../tools/virt-win-reg.pl:723
41959 "For use of C<ControlSet001> see the section above in this manual page. You "
41960 "may need to adjust this according to the control set that is in use by the "
41965 #: ../tools/virt-win-reg.pl:729
41967 "C<\"ObjectName\"> controls the privileges that the service will have. An "
41968 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
41969 "privileged account."
41973 #: ../tools/virt-win-reg.pl:735
41975 "For the meaning of the magic numbers, see this Microsoft KB article: "
41976 "L<http://support.microsoft.com/kb/103000>."
41980 #: ../tools/virt-win-reg.pl:740
41981 msgid "Update the registry:"
41985 #: ../tools/virt-win-reg.pl:742
41988 " virt-win-reg --merge WindowsGuest service.reg\n"
41993 #: ../tools/virt-win-reg.pl:746
41995 "Be careful when passing parameters containing C<\\> (backslash) in the "
41996 "shell. Usually you will have to use 'single quotes' or double backslashes "
41997 "(but not both) to protect them from the shell."
42001 #: ../tools/virt-win-reg.pl:750
42002 msgid "Paths and value names are case-insensitive."
42006 #: ../tools/virt-win-reg.pl:759
42008 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
42009 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
42010 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
42014 #: ../tools/virt-win-reg.pl:777
42017 " export LIBGUESTFS_DEBUG=1\n"
42018 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
42023 #: ../tools/virt-win-reg.pl:780
42025 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."